@mittwald/cli 1.0.0-alpha.19 → 1.0.0-alpha.21
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 +904 -83
- package/dist/esm/BaseCommand.js +1 -0
- package/dist/esm/commands/app/copy.d.ts +1 -0
- package/dist/esm/commands/app/copy.js +1 -0
- package/dist/esm/commands/app/dependency/list.js +1 -1
- package/dist/esm/commands/app/dependency/versions.js +1 -1
- package/dist/esm/commands/app/install/contao.d.ts +11 -0
- package/dist/esm/commands/app/install/contao.js +24 -0
- package/dist/esm/commands/app/install/joomla.d.ts +11 -0
- package/dist/esm/commands/app/install/joomla.js +23 -0
- package/dist/esm/commands/app/install/matomo.d.ts +11 -0
- package/dist/esm/commands/app/install/matomo.js +21 -0
- package/dist/esm/commands/app/install/node.d.ts +11 -0
- package/dist/esm/commands/app/install/node.js +13 -0
- package/dist/esm/commands/app/install/php.d.ts +11 -0
- package/dist/esm/commands/app/install/php.js +13 -0
- package/dist/esm/commands/app/install/shopware5.d.ts +11 -0
- package/dist/esm/commands/app/install/shopware5.js +26 -0
- package/dist/esm/commands/app/install/shopware6.d.ts +11 -0
- package/dist/esm/commands/app/install/shopware6.js +26 -0
- package/dist/esm/commands/app/install/typo3.d.ts +11 -0
- package/dist/esm/commands/app/install/typo3.js +22 -0
- package/dist/esm/commands/app/install/wordpress.d.ts +4 -16
- package/dist/esm/commands/app/install/wordpress.js +16 -107
- package/dist/esm/commands/app/list.d.ts +1 -1
- package/dist/esm/commands/app/list.js +1 -1
- package/dist/esm/commands/app/versions.js +1 -1
- package/dist/esm/commands/database/mysql/create.d.ts +1 -0
- package/dist/esm/commands/database/mysql/create.js +1 -1
- package/dist/esm/commands/database/mysql/list.d.ts +1 -1
- package/dist/esm/commands/database/mysql/list.js +1 -1
- package/dist/esm/commands/database/redis/create.d.ts +1 -0
- package/dist/esm/commands/database/redis/create.js +1 -1
- package/dist/esm/commands/database/redis/list.d.ts +1 -1
- package/dist/esm/commands/database/redis/list.js +1 -1
- package/dist/esm/commands/database/redis/versions.d.ts +2 -2
- package/dist/esm/commands/database/redis/versions.js +2 -2
- package/dist/esm/commands/domain/list.d.ts +1 -1
- package/dist/esm/commands/domain/list.js +1 -1
- package/dist/esm/commands/domain/ownership/list.d.ts +10 -3
- package/dist/esm/commands/domain/ownership/list.js +17 -3
- package/dist/esm/commands/domain/virtualhost/create.d.ts +1 -0
- package/dist/esm/commands/domain/virtualhost/create.js +1 -1
- package/dist/esm/commands/domain/virtualhost/list.d.ts +1 -0
- package/dist/esm/commands/domain/virtualhost/list.js +1 -1
- package/dist/esm/commands/mail/address/create.d.ts +1 -0
- package/dist/esm/commands/mail/address/create.js +1 -1
- package/dist/esm/commands/mail/address/list.d.ts +1 -1
- package/dist/esm/commands/mail/address/list.js +1 -1
- package/dist/esm/commands/org/delete.d.ts +1 -1
- package/dist/esm/commands/org/delete.js +1 -1
- package/dist/esm/commands/org/get.d.ts +1 -1
- package/dist/esm/commands/org/get.js +1 -1
- package/dist/esm/commands/org/invite/list.d.ts +1 -1
- package/dist/esm/commands/org/invite/list.js +1 -1
- package/dist/esm/commands/org/invite.d.ts +2 -2
- package/dist/esm/commands/org/invite.js +4 -17
- package/dist/esm/commands/org/membership/list.d.ts +1 -1
- package/dist/esm/commands/org/membership/list.js +1 -1
- package/dist/esm/commands/project/backup/create.d.ts +19 -0
- package/dist/esm/commands/project/backup/create.js +59 -0
- package/dist/esm/commands/project/backup/delete.d.ts +13 -0
- package/dist/esm/commands/project/backup/delete.js +21 -0
- package/dist/esm/commands/project/backup/download.d.ts +27 -0
- package/dist/esm/commands/project/backup/download.js +177 -0
- package/dist/esm/commands/project/backup/get.d.ts +11 -2
- package/dist/esm/commands/project/backup/get.js +26 -5
- package/dist/esm/commands/project/backup/list.d.ts +10 -10
- package/dist/esm/commands/project/backup/list.js +1 -1
- package/dist/esm/commands/project/backupschedule/list.d.ts +13 -7
- package/dist/esm/commands/project/backupschedule/list.js +15 -7
- package/dist/esm/commands/project/create.d.ts +3 -1
- package/dist/esm/commands/project/create.js +5 -8
- package/dist/esm/commands/project/cronjob/list.d.ts +1 -1
- package/dist/esm/commands/project/cronjob/list.js +1 -1
- package/dist/esm/commands/project/delete.d.ts +1 -1
- package/dist/esm/commands/project/delete.js +1 -1
- package/dist/esm/commands/project/filesystem/usage.d.ts +1 -1
- package/dist/esm/commands/project/filesystem/usage.js +1 -1
- package/dist/esm/commands/project/get.d.ts +1 -1
- package/dist/esm/commands/project/get.js +2 -2
- package/dist/esm/commands/project/list.d.ts +10 -2
- package/dist/esm/commands/project/list.js +10 -2
- package/dist/esm/commands/project/ssh.d.ts +1 -1
- package/dist/esm/commands/project/ssh.js +1 -1
- package/dist/esm/commands/project/update.d.ts +1 -1
- package/dist/esm/commands/project/update.js +1 -1
- package/dist/esm/lib/app/Installer.d.ts +21 -0
- package/dist/esm/lib/app/Installer.js +49 -0
- package/dist/esm/lib/app/flags.d.ts +25 -0
- package/dist/esm/lib/app/flags.js +190 -1
- package/dist/esm/lib/app/install.d.ts +4 -0
- package/dist/esm/lib/app/install.js +20 -0
- package/dist/esm/lib/app/{appVersionHelpers.d.ts → versions.d.ts} +3 -0
- package/dist/esm/lib/app/{appVersionHelpers.js → versions.js} +18 -0
- package/dist/esm/lib/app/wait.d.ts +3 -0
- package/dist/esm/lib/app/wait.js +19 -0
- package/dist/esm/lib/context_flags.d.ts +20 -9
- package/dist/esm/lib/context_flags.js +25 -2
- package/dist/esm/lib/database/mysql/flags.js +1 -1
- package/dist/esm/lib/database/redis/flags.js +1 -1
- package/dist/esm/lib/expires.d.ts +11 -0
- package/dist/esm/lib/expires.js +31 -0
- package/dist/esm/lib/handleError.js +3 -20
- package/dist/esm/lib/org/flags.d.ts +11 -3
- package/dist/esm/lib/password.d.ts +2 -0
- package/dist/esm/lib/password.js +20 -0
- package/dist/esm/lib/project/flags.d.ts +11 -3
- package/dist/esm/lib/project/hooks.d.ts +3 -0
- package/dist/esm/lib/project/hooks.js +11 -0
- package/dist/esm/lib/project/ingress.d.ts +2 -0
- package/dist/esm/lib/project/ingress.js +16 -0
- package/dist/esm/lib/project/shortId.d.ts +2 -0
- package/dist/esm/lib/project/shortId.js +11 -0
- package/dist/esm/lib/projectbackup/hooks.d.ts +5 -0
- package/dist/esm/lib/projectbackup/hooks.js +19 -0
- package/dist/esm/lib/server/flags.d.ts +11 -3
- package/dist/esm/lib/viewhelpers/size.d.ts +2 -1
- package/dist/esm/lib/viewhelpers/size.js +2 -2
- package/dist/esm/lib/wait.d.ts +4 -0
- package/dist/esm/lib/wait.js +13 -2
- package/dist/esm/rendering/process/components/ProcessStateSummary.js +3 -0
- package/dist/esm/rendering/process/process.d.ts +2 -0
- package/dist/esm/rendering/process/process.js +4 -0
- package/dist/esm/rendering/react/ExecRenderBaseCommand.js +11 -1
- package/dist/esm/rendering/react/components/ErrorBox.js +27 -1
- package/dist/esm/rendering/react/components/ProjectBackup/ProjectBackupDetails.d.ts +6 -0
- package/dist/esm/rendering/react/components/ProjectBackup/ProjectBackupDetails.js +29 -0
- package/dist/esm/rendering/react/components/ProjectBackup/ProjectBackupStatus.d.ts +6 -0
- package/dist/esm/rendering/react/components/ProjectBackup/ProjectBackupStatus.js +8 -0
- package/package.json +37 -3
- package/dist/esm/commands/project/backupschedule/get.d.ts +0 -3
- package/dist/esm/commands/project/backupschedule/get.js +0 -6
- package/dist/esm/commands/project/list-react.d.ts +0 -11
- package/dist/esm/commands/project/list-react.js +0 -42
- package/dist/esm/generated/backup/getProjectBackup.d.ts +0 -16
- package/dist/esm/generated/backup/getProjectBackup.js +0 -25
- package/dist/esm/generated/backup/getProjectBackupSchedule.d.ts +0 -16
- package/dist/esm/generated/backup/getProjectBackupSchedule.js +0 -25
- package/dist/esm/generated/backup/listProjectBackupSchedules.d.ts +0 -13
- package/dist/esm/generated/backup/listProjectBackupSchedules.js +0 -24
- package/dist/esm/generated/backup/listProjectBackups.d.ts +0 -13
- package/dist/esm/generated/backup/listProjectBackups.js +0 -24
- package/dist/esm/generated/domain/listDomainOwnerships.d.ts +0 -13
- package/dist/esm/generated/domain/listDomainOwnerships.js +0 -21
- /package/dist/esm/lib/app/{appHelpers.d.ts → uuid.d.ts} +0 -0
- /package/dist/esm/lib/app/{appHelpers.js → uuid.js} +0 -0
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Options } from "pretty-bytes";
|
|
2
|
+
export declare function formatBytes(bytes?: number, opts?: Options): string;
|
package/dist/esm/lib/wait.d.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
+
export declare const waitFlags: {
|
|
2
|
+
wait: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
3
|
+
"wait-timeout": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
4
|
+
};
|
|
1
5
|
export declare function waitUntil<T>(tester: () => Promise<T | null>, timeoutSeconds?: number): Promise<T>;
|
package/dist/esm/lib/wait.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
export const waitFlags = {
|
|
3
|
+
wait: Flags.boolean({
|
|
4
|
+
char: "w",
|
|
5
|
+
description: "Wait for the resource to be ready.",
|
|
6
|
+
}),
|
|
7
|
+
"wait-timeout": Flags.integer({
|
|
8
|
+
description: "The number of seconds to wait for the resource to be ready.",
|
|
9
|
+
default: 600,
|
|
10
|
+
}),
|
|
11
|
+
};
|
|
12
|
+
export async function waitUntil(tester, timeoutSeconds = 600) {
|
|
2
13
|
let waited = 0;
|
|
3
|
-
while (waited <
|
|
14
|
+
while (waited < timeoutSeconds) {
|
|
4
15
|
const result = await tester();
|
|
5
16
|
if (result) {
|
|
6
17
|
return result;
|
|
@@ -22,6 +22,9 @@ export const ProcessStateSummary = ({ step, }) => {
|
|
|
22
22
|
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: ". " }), _jsx(Text, { color: "red", children: "error" })] }));
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
|
+
if (step.progress) {
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: "... " }), _jsx(Text, { color: "blue", children: step.progress })] }));
|
|
27
|
+
}
|
|
25
28
|
return _jsx(Text, { children: "..." });
|
|
26
29
|
}
|
|
27
30
|
};
|
|
@@ -8,6 +8,7 @@ export type ProcessStepRunnable = {
|
|
|
8
8
|
title: ReactNode;
|
|
9
9
|
phase: "running" | "completed" | "failed" | "aborted";
|
|
10
10
|
error?: unknown;
|
|
11
|
+
progress?: string;
|
|
11
12
|
};
|
|
12
13
|
export type ProcessStepConfirm = {
|
|
13
14
|
type: "confirm";
|
|
@@ -28,6 +29,7 @@ export declare class RunnableHandler {
|
|
|
28
29
|
get done(): boolean;
|
|
29
30
|
abort(): void;
|
|
30
31
|
complete(): void;
|
|
32
|
+
progress(p: string): void;
|
|
31
33
|
error(err: unknown): void;
|
|
32
34
|
}
|
|
33
35
|
export interface ProcessRenderer {
|
|
@@ -16,6 +16,10 @@ export class RunnableHandler {
|
|
|
16
16
|
this.processStep.phase = "completed";
|
|
17
17
|
this.listener();
|
|
18
18
|
}
|
|
19
|
+
progress(p) {
|
|
20
|
+
this.processStep.progress = p;
|
|
21
|
+
this.listener();
|
|
22
|
+
}
|
|
19
23
|
error(err) {
|
|
20
24
|
this.processStep.phase = "failed";
|
|
21
25
|
this.processStep.error = err;
|
|
@@ -4,12 +4,22 @@ import { render, Text } from "ink";
|
|
|
4
4
|
import { RenderContextProvider } from "./context.js";
|
|
5
5
|
import { ExtendedBaseCommand } from "../../ExtendedBaseCommand.js";
|
|
6
6
|
const RenderComponent = (p) => (_jsx(_Fragment, { children: p.render() }));
|
|
7
|
+
function wrapRender(fn) {
|
|
8
|
+
return (result) => {
|
|
9
|
+
const innerResult = fn(result);
|
|
10
|
+
if (typeof innerResult === "string") {
|
|
11
|
+
return _jsx(Text, { children: innerResult });
|
|
12
|
+
}
|
|
13
|
+
return innerResult;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
7
16
|
export class ExecRenderBaseCommand extends ExtendedBaseCommand {
|
|
8
17
|
async run() {
|
|
9
18
|
const result = await this.exec();
|
|
19
|
+
const wrappedRender = wrapRender(this.render.bind(this));
|
|
10
20
|
render(_jsx(RenderContextProvider, { value: {
|
|
11
21
|
apiClient: this.apiClient,
|
|
12
22
|
renderAsJson: false,
|
|
13
|
-
}, children: _jsx(Suspense, { fallback: _jsx(Text, { children: "Loading..." }), children: _jsx(RenderComponent, { render: () =>
|
|
23
|
+
}, children: _jsx(Suspense, { fallback: _jsx(Text, { children: "Loading..." }), children: _jsx(RenderComponent, { render: () => wrappedRender(result) }) }) }));
|
|
14
24
|
}
|
|
15
25
|
}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
3
|
import Link from "ink-link";
|
|
4
4
|
import { FailedFlagValidationError, RequiredArgsError, } from "@oclif/core/lib/parser/errors.js";
|
|
5
|
+
import { ApiClientError, } from "@mittwald/api-client-commons";
|
|
5
6
|
const color = "red";
|
|
6
7
|
const issueURL = "https://github.com/mittwald/cli/issues/new";
|
|
7
8
|
const boxProps = {
|
|
@@ -12,8 +13,11 @@ const boxProps = {
|
|
|
12
13
|
paddingX: 1,
|
|
13
14
|
rowGap: 1,
|
|
14
15
|
};
|
|
16
|
+
const ErrorStack = ({ err }) => {
|
|
17
|
+
return (_jsxs(Box, { marginX: 2, marginY: 1, flexDirection: "column", rowGap: 1, children: [_jsx(Text, { color: color, dimColor: true, bold: true, children: "ERROR STACK TRACE" }), _jsx(Text, { color: color, dimColor: true, children: "Please provide this when opening a bug report." }), _jsx(Text, { color: color, dimColor: true, children: err.stack })] }));
|
|
18
|
+
};
|
|
15
19
|
const GenericError = ({ err, withStack, }) => {
|
|
16
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Box, { ...boxProps, borderColor: color, children: [_jsx(Text, { color: color, bold: true, underline: true, children: "ERROR" }), _jsx(Text, { color: color, children: "An error occurred while executing this command:" }), _jsx(Box, { marginX: 2, children: _jsx(Text, { color: color, children: err.toString() }) }), _jsxs(Text, { color: color, children: ["If you believe this to be a bug, please open an issue at", " ", _jsx(Link, { url: issueURL, children: issueURL }), "."] })] }), withStack && "stack" in err ?
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { ...boxProps, borderColor: color, children: [_jsx(Text, { color: color, bold: true, underline: true, children: "ERROR" }), _jsx(Text, { color: color, children: "An error occurred while executing this command:" }), _jsx(Box, { marginX: 2, children: _jsx(Text, { color: color, children: err.toString() }) }), _jsxs(Text, { color: color, children: ["If you believe this to be a bug, please open an issue at", " ", _jsx(Link, { url: issueURL, children: issueURL }), "."] })] }), withStack && "stack" in err ? _jsx(ErrorStack, { err: err }) : undefined] }));
|
|
17
21
|
};
|
|
18
22
|
const InvalidFlagsError = ({ err }) => {
|
|
19
23
|
const color = "yellow";
|
|
@@ -23,6 +27,25 @@ const InvalidArgsError = ({ err }) => {
|
|
|
23
27
|
const color = "yellow";
|
|
24
28
|
return (_jsxs(Box, { ...boxProps, borderColor: color, children: [_jsx(Text, { color: color, bold: true, underline: true, children: "INVALID COMMAND ARGUMENTS" }), _jsxs(Text, { color: color, children: ["The arguments that you provided for this command were invalid.", " ", err.message] })] }));
|
|
25
29
|
};
|
|
30
|
+
const RequestHeaders = ({ headers }) => {
|
|
31
|
+
const lines = headers.trim().split("\r\n");
|
|
32
|
+
const requestLine = lines.shift();
|
|
33
|
+
const values = lines.map((line) => line.split(": ", 2));
|
|
34
|
+
const maxKeyLength = Math.max(...values.map(([key]) => key.length));
|
|
35
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, underline: true, children: requestLine }), values.map(([key, value]) => (_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { dimColor: true, children: [key.toLowerCase().padEnd(maxKeyLength, " "), " "] }), _jsx(Text, { bold: true, children: key === "x-access-token" ? "[redacted]" : value })] }, key)))] }));
|
|
36
|
+
};
|
|
37
|
+
const Response = ({ status, statusText, body, headers }) => {
|
|
38
|
+
const keys = Object.keys(headers);
|
|
39
|
+
const maxKeyLength = Math.max(...keys.map((key) => key.length));
|
|
40
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { bold: true, underline: true, children: [status, " ", statusText] }, "status"), keys.map((key) => (_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { dimColor: true, children: [key.toLowerCase().padEnd(maxKeyLength, " "), " "] }), _jsx(Text, { bold: true, children: key === "x-access-token" ? "[redacted]" : headers[key] })] }, key))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: JSON.stringify(body, undefined, 2) }) }, "body")] }));
|
|
41
|
+
};
|
|
42
|
+
const HttpMessages = ({ err }) => {
|
|
43
|
+
const response = err.response ? (_jsx(Response, { status: err.response.status, statusText: err.response.statusText, body: err.response.data, headers: err.response.headers })) : (_jsx(Text, { children: "no response received" }));
|
|
44
|
+
return (_jsxs(Box, { marginX: 2, marginY: 1, flexDirection: "column", rowGap: 1, children: [_jsx(RequestHeaders, { headers: err.request._header }), response] }));
|
|
45
|
+
};
|
|
46
|
+
const ApiError = ({ err, withStack, withHTTPMessages }) => {
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { ...boxProps, children: [_jsx(Text, { color: color, bold: true, underline: true, children: "API CLIENT ERROR" }), _jsxs(Text, { color: color, children: ["An error occurred while communicating with the API: ", err.message] }), _jsx(Text, { children: JSON.stringify(err.response?.data, undefined, 2) })] }), withHTTPMessages === "full" ? _jsx(HttpMessages, { err: err }) : undefined, withStack && "stack" in err ? _jsx(ErrorStack, { err: err }) : undefined] }));
|
|
48
|
+
};
|
|
26
49
|
/**
|
|
27
50
|
* Render an error to the terminal.
|
|
28
51
|
*
|
|
@@ -37,6 +60,9 @@ export const ErrorBox = ({ err }) => {
|
|
|
37
60
|
else if (err instanceof RequiredArgsError) {
|
|
38
61
|
return _jsx(InvalidArgsError, { err: err });
|
|
39
62
|
}
|
|
63
|
+
else if (err instanceof ApiClientError) {
|
|
64
|
+
return _jsx(ApiError, { err: err, withStack: true, withHTTPMessages: "body" });
|
|
65
|
+
}
|
|
40
66
|
else if (err instanceof Error) {
|
|
41
67
|
return _jsx(GenericError, { err: err, withStack: true });
|
|
42
68
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SingleResult, SingleResultTable } from "../SingleResult.js";
|
|
3
|
+
import { Text } from "ink";
|
|
4
|
+
import { Value } from "../Value.js";
|
|
5
|
+
import { useProjectBackupSchedule } from "../../../../lib/projectbackup/hooks.js";
|
|
6
|
+
import { FormattedDate } from "../FormattedDate.js";
|
|
7
|
+
import { ProjectBackupStatus } from "./ProjectBackupStatus.js";
|
|
8
|
+
import { useProject } from "../../../../lib/project/hooks.js";
|
|
9
|
+
import { IDAndShortID } from "../IDAndShortID.js";
|
|
10
|
+
export const ProjectBackupDetails = ({ projectBackup }) => {
|
|
11
|
+
const project = useProject(projectBackup.projectId);
|
|
12
|
+
const schedule = projectBackup.parentId
|
|
13
|
+
? useProjectBackupSchedule(projectBackup.parentId)
|
|
14
|
+
: undefined;
|
|
15
|
+
return (_jsx(SingleResult, { title: _jsxs(Text, { children: ["PROJECT BACKUP: ", _jsx(Value, { children: projectBackup.id })] }), rows: {
|
|
16
|
+
ID: _jsx(Value, { children: projectBackup.id }),
|
|
17
|
+
"Created at": projectBackup.createdAt ? (_jsx(Value, { children: _jsx(FormattedDate, { date: projectBackup.createdAt, relative: true, absolute: true }) })) : (_jsx(Value, { notSet: true })),
|
|
18
|
+
"Expires in": projectBackup.expiresAt ? (_jsx(Value, { children: _jsx(FormattedDate, { date: projectBackup.expiresAt, relative: true, absolute: true }) })) : (_jsx(Value, { notSet: true })),
|
|
19
|
+
Status: _jsx(ProjectBackupStatus, { projectBackup: projectBackup }),
|
|
20
|
+
Project: (_jsx(SingleResultTable, { rows: {
|
|
21
|
+
ID: _jsx(IDAndShortID, { object: project }),
|
|
22
|
+
Description: _jsx(Value, { children: project.description }),
|
|
23
|
+
} })),
|
|
24
|
+
Schedule: schedule ? (_jsx(SingleResultTable, { rows: {
|
|
25
|
+
ID: _jsx(Value, { children: schedule.id }),
|
|
26
|
+
Schedule: _jsx(Value, { children: schedule.schedule }),
|
|
27
|
+
} })) : (_jsx(Value, { notSet: true })),
|
|
28
|
+
} }));
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from "ink";
|
|
3
|
+
export const ProjectBackupStatus = ({ projectBackup }) => {
|
|
4
|
+
if (projectBackup.status === "Completed") {
|
|
5
|
+
return _jsx(Text, { color: "green", children: "\u2705 completed" });
|
|
6
|
+
}
|
|
7
|
+
return _jsx(Text, { color: "yellow", children: projectBackup.status });
|
|
8
|
+
};
|
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.21",
|
|
4
4
|
"description": "Hand-crafted CLI for the mittwald API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -118,7 +118,15 @@
|
|
|
118
118
|
"topicSeparator": " ",
|
|
119
119
|
"topics": {
|
|
120
120
|
"app": {
|
|
121
|
-
"description": "Manage apps, and app installations in your projects"
|
|
121
|
+
"description": "Manage apps, and app installations in your projects",
|
|
122
|
+
"subtopics": {
|
|
123
|
+
"install": {
|
|
124
|
+
"description": "Install apps in your projects"
|
|
125
|
+
},
|
|
126
|
+
"dependency": {
|
|
127
|
+
"description": "Manage the system dependencies of your apps"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
122
130
|
},
|
|
123
131
|
"article": {
|
|
124
132
|
"description": "Query available hosting articles"
|
|
@@ -148,7 +156,33 @@
|
|
|
148
156
|
"description": "Manage your organizations, and also any kinds of user memberships concerning these organizations."
|
|
149
157
|
},
|
|
150
158
|
"project": {
|
|
151
|
-
"description": "Manage your projects, and also any kinds of user memberships concerning these projects."
|
|
159
|
+
"description": "Manage your projects, and also any kinds of user memberships concerning these projects.",
|
|
160
|
+
"subtopics": {
|
|
161
|
+
"backup": {
|
|
162
|
+
"description": "Manage backups of your projects"
|
|
163
|
+
},
|
|
164
|
+
"backupschedule": {
|
|
165
|
+
"description": "Manage backup schedules of your projects"
|
|
166
|
+
},
|
|
167
|
+
"cronjob": {
|
|
168
|
+
"description": "Manage cronjobs of your projects"
|
|
169
|
+
},
|
|
170
|
+
"filesystem": {
|
|
171
|
+
"description": "Interact with the filesystem of your project"
|
|
172
|
+
},
|
|
173
|
+
"invite": {
|
|
174
|
+
"description": "Invite users to your projects and manage their invitations"
|
|
175
|
+
},
|
|
176
|
+
"membership": {
|
|
177
|
+
"description": "Control who gets to work on your projects, and who doesn't"
|
|
178
|
+
},
|
|
179
|
+
"sftp-user": {
|
|
180
|
+
"description": "Manage SFTP users of your projects"
|
|
181
|
+
},
|
|
182
|
+
"ssh-user": {
|
|
183
|
+
"description": "Manage SSH users of your projects"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
152
186
|
},
|
|
153
187
|
"server": {
|
|
154
188
|
"description": "Manage your servers"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* prettier-ignore */
|
|
3
|
-
/* This file is auto-generated with acg (@mittwald/api-code-generator) */
|
|
4
|
-
import { GeneratedBackupGetProjectBackupSchedule } from "../../../generated/backup/getProjectBackupSchedule.js";
|
|
5
|
-
export default class Get extends GeneratedBackupGetProjectBackupSchedule {
|
|
6
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { RenderBaseCommand } from "../../rendering/react/RenderBaseCommand.js";
|
|
3
|
-
export default class List extends RenderBaseCommand<typeof List> {
|
|
4
|
-
static flags: {
|
|
5
|
-
columns: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
6
|
-
extended: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
7
|
-
noTruncate: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
-
wait: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<any>;
|
|
9
|
-
};
|
|
10
|
-
protected render(): React.ReactNode;
|
|
11
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { assertStatus } from "@mittwald/api-client-commons";
|
|
3
|
-
import { usePromise } from "@mittwald/react-use-promise";
|
|
4
|
-
import { RenderBaseCommand } from "../../rendering/react/RenderBaseCommand.js";
|
|
5
|
-
import { useRenderContext } from "../../rendering/react/context.js";
|
|
6
|
-
import { Table } from "../../rendering/react/components/Table/index.js";
|
|
7
|
-
import { UsePromiseRenderSetup } from "../../rendering/setup/usePromiseSetup.js";
|
|
8
|
-
import { TableRenderSetup } from "../../rendering/setup/TableRenderSetup.js";
|
|
9
|
-
import { ProjectStatus } from "../../rendering/react/components/Project/ProjectStatus.js";
|
|
10
|
-
const usePromiseSetup = new UsePromiseRenderSetup();
|
|
11
|
-
const tableSetupInstance = new TableRenderSetup();
|
|
12
|
-
export default class List extends RenderBaseCommand {
|
|
13
|
-
static flags = {
|
|
14
|
-
...usePromiseSetup.flags,
|
|
15
|
-
...tableSetupInstance.flags,
|
|
16
|
-
...RenderBaseCommand.buildFlags(),
|
|
17
|
-
};
|
|
18
|
-
render() {
|
|
19
|
-
const { apiClient } = useRenderContext();
|
|
20
|
-
const tableSetup = tableSetupInstance.getSetup(this.flags);
|
|
21
|
-
const usePromiseOptions = usePromiseSetup.getSetup(this.flags);
|
|
22
|
-
const projects = usePromise(apiClient.project.listProjects, [], usePromiseOptions);
|
|
23
|
-
assertStatus(projects, 200);
|
|
24
|
-
return (_jsx(Table, { data: projects.data, setup: tableSetup, columns: {
|
|
25
|
-
id: {
|
|
26
|
-
isUuid: true,
|
|
27
|
-
},
|
|
28
|
-
shortId: {
|
|
29
|
-
minWidth: 8,
|
|
30
|
-
},
|
|
31
|
-
customerId: {
|
|
32
|
-
isUuid: true,
|
|
33
|
-
extended: true,
|
|
34
|
-
},
|
|
35
|
-
description: {},
|
|
36
|
-
status: {
|
|
37
|
-
render: (project) => _jsx(ProjectStatus, { project: project }),
|
|
38
|
-
},
|
|
39
|
-
createdAt: {},
|
|
40
|
-
} }));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { GetBaseCommand } from "../../GetBaseCommand.js";
|
|
3
|
-
export type PathParams = MittwaldAPIV2.Paths.V2ProjectBackupsProjectBackupId.Get.Parameters.Path;
|
|
4
|
-
type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["backup"]["getProjectBackup"]>>;
|
|
5
|
-
export declare abstract class GeneratedBackupGetProjectBackup extends GetBaseCommand<typeof GeneratedBackupGetProjectBackup, 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
|
-
projectBackupId: 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 GeneratedBackupGetProjectBackup extends GetBaseCommand {
|
|
7
|
-
static description = "Get a ProjectBackup.";
|
|
8
|
-
static flags = {
|
|
9
|
-
...GetBaseCommand.baseFlags,
|
|
10
|
-
};
|
|
11
|
-
static args = {
|
|
12
|
-
projectBackupId: Args.string({
|
|
13
|
-
description: "ID of the ProjectBackup to retrieve.",
|
|
14
|
-
required: true,
|
|
15
|
-
}),
|
|
16
|
-
};
|
|
17
|
-
async getData() {
|
|
18
|
-
return await this.apiClient.backup.getProjectBackup({
|
|
19
|
-
pathParameters: await this.mapParams(this.args),
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
mapParams(input) {
|
|
23
|
-
return input;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { GetBaseCommand } from "../../GetBaseCommand.js";
|
|
3
|
-
export type PathParams = MittwaldAPIV2.Paths.V2ProjectBackupSchedulesProjectBackupScheduleId.Get.Parameters.Path;
|
|
4
|
-
type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["backup"]["getProjectBackupSchedule"]>>;
|
|
5
|
-
export declare abstract class GeneratedBackupGetProjectBackupSchedule extends GetBaseCommand<typeof GeneratedBackupGetProjectBackupSchedule, 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
|
-
projectBackupScheduleId: 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 GeneratedBackupGetProjectBackupSchedule extends GetBaseCommand {
|
|
7
|
-
static description = "Get a ProjectBackupSchedule.";
|
|
8
|
-
static flags = {
|
|
9
|
-
...GetBaseCommand.baseFlags,
|
|
10
|
-
};
|
|
11
|
-
static args = {
|
|
12
|
-
projectBackupScheduleId: Args.string({
|
|
13
|
-
description: "ID of the ProjectBackupSchedule to retrieve.",
|
|
14
|
-
required: true,
|
|
15
|
-
}),
|
|
16
|
-
};
|
|
17
|
-
async getData() {
|
|
18
|
-
return await this.apiClient.backup.getProjectBackupSchedule({
|
|
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.V2ProjectsProjectIdBackupSchedules.Get.Parameters.Path;
|
|
4
|
-
export type Response = Awaited<ReturnType<MittwaldAPIV2Client["backup"]["listProjectBackupSchedules"]>>;
|
|
5
|
-
export declare abstract class GeneratedBackupListProjectBackupSchedules<TItem extends Record<string, unknown>> extends ListBaseCommand<typeof GeneratedBackupListProjectBackupSchedules, TItem, Response> {
|
|
6
|
-
static description: string;
|
|
7
|
-
static args: {};
|
|
8
|
-
static flags: {
|
|
9
|
-
"project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
-
};
|
|
11
|
-
getData(): Promise<Response>;
|
|
12
|
-
protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
|
|
13
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Flags } from "@oclif/core";
|
|
2
|
-
import { ListBaseCommand } from "../../ListBaseCommand.js";
|
|
3
|
-
export class GeneratedBackupListProjectBackupSchedules extends ListBaseCommand {
|
|
4
|
-
static description = "List BackupSchedules belonging to a given Project.";
|
|
5
|
-
static args = {};
|
|
6
|
-
static flags = {
|
|
7
|
-
...ListBaseCommand.baseFlags,
|
|
8
|
-
"project-id": Flags.string({
|
|
9
|
-
description: "ID of the Project to list BackupSchedules for.",
|
|
10
|
-
required: true,
|
|
11
|
-
}),
|
|
12
|
-
};
|
|
13
|
-
async getData() {
|
|
14
|
-
const pathParams = {
|
|
15
|
-
projectId: this.flags["project-id"],
|
|
16
|
-
};
|
|
17
|
-
return await this.apiClient.backup.listProjectBackupSchedules({
|
|
18
|
-
pathParameters: await this.mapParams(pathParams),
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
mapParams(input) {
|
|
22
|
-
return input;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { ListBaseCommand } from "../../ListBaseCommand.js";
|
|
3
|
-
export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdBackups.Get.Parameters.Path;
|
|
4
|
-
export type Response = Awaited<ReturnType<MittwaldAPIV2Client["backup"]["listProjectBackups"]>>;
|
|
5
|
-
export declare abstract class GeneratedBackupListProjectBackups<TItem extends Record<string, unknown>> extends ListBaseCommand<typeof GeneratedBackupListProjectBackups, TItem, Response> {
|
|
6
|
-
static description: string;
|
|
7
|
-
static args: {};
|
|
8
|
-
static flags: {
|
|
9
|
-
"project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
-
};
|
|
11
|
-
getData(): Promise<Response>;
|
|
12
|
-
protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
|
|
13
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Flags } from "@oclif/core";
|
|
2
|
-
import { ListBaseCommand } from "../../ListBaseCommand.js";
|
|
3
|
-
export class GeneratedBackupListProjectBackups extends ListBaseCommand {
|
|
4
|
-
static description = "List Backups for a given Project.";
|
|
5
|
-
static args = {};
|
|
6
|
-
static flags = {
|
|
7
|
-
...ListBaseCommand.baseFlags,
|
|
8
|
-
"project-id": Flags.string({
|
|
9
|
-
description: "ID of the Project to get Backups for.",
|
|
10
|
-
required: true,
|
|
11
|
-
}),
|
|
12
|
-
};
|
|
13
|
-
async getData() {
|
|
14
|
-
const pathParams = {
|
|
15
|
-
projectId: this.flags["project-id"],
|
|
16
|
-
};
|
|
17
|
-
return await this.apiClient.backup.listProjectBackups({
|
|
18
|
-
pathParameters: await this.mapParams(pathParams),
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
mapParams(input) {
|
|
22
|
-
return input;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { ListBaseCommand } from "../../ListBaseCommand.js";
|
|
3
|
-
export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdDomainOwnerships.Get.Parameters.Path;
|
|
4
|
-
export type Response = Awaited<ReturnType<MittwaldAPIV2Client["domain"]["listDomainOwnerships"]>>;
|
|
5
|
-
export declare abstract class GeneratedDomainListDomainOwnerships<TItem extends Record<string, unknown>> extends ListBaseCommand<typeof GeneratedDomainListDomainOwnerships, TItem, Response> {
|
|
6
|
-
static description: string;
|
|
7
|
-
static args: {};
|
|
8
|
-
static flags: {
|
|
9
|
-
[x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any> | import("@oclif/core/lib/interfaces/parser.js").OptionFlag<unknown>;
|
|
10
|
-
};
|
|
11
|
-
getData(): Promise<Response>;
|
|
12
|
-
protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
|
|
13
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ListBaseCommand } from "../../ListBaseCommand.js";
|
|
2
|
-
import { projectFlags, withProjectId } from "../../lib/project/flags.js";
|
|
3
|
-
export class GeneratedDomainListDomainOwnerships extends ListBaseCommand {
|
|
4
|
-
static description = "List all domain ownerships of a project.";
|
|
5
|
-
static args = {};
|
|
6
|
-
static flags = {
|
|
7
|
-
...ListBaseCommand.baseFlags,
|
|
8
|
-
...projectFlags,
|
|
9
|
-
};
|
|
10
|
-
async getData() {
|
|
11
|
-
const pathParams = {
|
|
12
|
-
projectId: await withProjectId(this.apiClient, this.flags, this.args, this.config),
|
|
13
|
-
};
|
|
14
|
-
return await this.apiClient.domain.listDomainOwnerships({
|
|
15
|
-
pathParameters: await this.mapParams(pathParams),
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
mapParams(input) {
|
|
19
|
-
return input;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
File without changes
|
|
File without changes
|