@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,6 +1,6 @@
|
|
|
1
1
|
import { ListBaseCommand } from "../../../ListBaseCommand.js";
|
|
2
2
|
import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
|
|
3
|
-
export default class
|
|
3
|
+
export default class Versions extends ListBaseCommand {
|
|
4
4
|
static description = "List available Redis versions.";
|
|
5
5
|
static args = {};
|
|
6
6
|
static flags = {
|
|
@@ -8,7 +8,7 @@ export default class List extends ListBaseCommand {
|
|
|
8
8
|
...projectFlags,
|
|
9
9
|
};
|
|
10
10
|
async getData() {
|
|
11
|
-
const projectId = await withProjectId(this.apiClient, this.flags, this.args, this.config);
|
|
11
|
+
const projectId = await withProjectId(this.apiClient, Versions, this.flags, this.args, this.config);
|
|
12
12
|
return await this.apiClient.database.listRedisVersions({
|
|
13
13
|
pathParameters: {},
|
|
14
14
|
queryParameters: { projectId },
|
|
@@ -9,7 +9,7 @@ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Res
|
|
|
9
9
|
static description: string;
|
|
10
10
|
static args: {};
|
|
11
11
|
static flags: {
|
|
12
|
-
|
|
12
|
+
"project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
13
13
|
};
|
|
14
14
|
getData(): Promise<Response>;
|
|
15
15
|
protected mapData(data: SuccessfulResponse<Response, 200>["data"]): ResponseItem[] | Promise<ResponseItem[]>;
|
|
@@ -8,7 +8,7 @@ export class List extends ListBaseCommand {
|
|
|
8
8
|
...projectFlags,
|
|
9
9
|
};
|
|
10
10
|
async getData() {
|
|
11
|
-
const projectId = await withProjectId(this.apiClient, this.flags, this.args, this.config);
|
|
11
|
+
const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
|
|
12
12
|
const pathParams = { projectId };
|
|
13
13
|
return await this.apiClient.domain.listDomains({
|
|
14
14
|
pathParameters: pathParams,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Simplify } from "@mittwald/api-client-commons";
|
|
2
|
-
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
2
|
+
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
3
3
|
import { SuccessfulResponse } from "../../../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ListBaseCommand } from "../../../ListBaseCommand.js";
|
|
5
5
|
type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdDomainOwnerships.Get.Responses.$200.Content.ApplicationJson[number]>;
|
|
6
|
-
|
|
6
|
+
type Response = Awaited<ReturnType<MittwaldAPIV2Client["domain"]["listDomainOwnerships"]>>;
|
|
7
|
+
export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
|
|
8
|
+
static description: string;
|
|
9
|
+
static args: {};
|
|
10
|
+
static flags: {
|
|
11
|
+
"project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
12
|
+
};
|
|
13
|
+
getData(): Promise<Response>;
|
|
7
14
|
protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.DomainDomainOwnership[];
|
|
8
15
|
}
|
|
9
16
|
export {};
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ListBaseCommand } from "../../../ListBaseCommand.js";
|
|
2
|
+
import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
|
|
3
|
+
export class List extends ListBaseCommand {
|
|
4
|
+
static description = "List all domain ownerships of a project.";
|
|
5
|
+
static args = {};
|
|
6
|
+
static flags = {
|
|
7
|
+
...ListBaseCommand.baseFlags,
|
|
8
|
+
...projectFlags,
|
|
9
|
+
};
|
|
10
|
+
async getData() {
|
|
11
|
+
const pathParameters = {
|
|
12
|
+
projectId: await withProjectId(this.apiClient, List, this.flags, this.args, this.config),
|
|
13
|
+
};
|
|
14
|
+
return await this.apiClient.domain.listDomainOwnerships({
|
|
15
|
+
pathParameters,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
3
18
|
mapData(data) {
|
|
4
|
-
console.log(data);
|
|
5
19
|
return data;
|
|
6
20
|
}
|
|
7
21
|
}
|
|
@@ -18,6 +18,7 @@ export default class Create extends ExecRenderBaseCommand<typeof Create, CreateR
|
|
|
18
18
|
"path-to-dir": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
19
19
|
"path-to-app": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
20
20
|
"path-to-url": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
21
|
+
"project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
21
22
|
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
22
23
|
};
|
|
23
24
|
protected exec(): Promise<CreateResult>;
|
|
@@ -50,7 +50,7 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
50
50
|
}),
|
|
51
51
|
};
|
|
52
52
|
async exec() {
|
|
53
|
-
const projectId = await withProjectId(this.apiClient, this.flags, this.args, this.config);
|
|
53
|
+
const projectId = await withProjectId(this.apiClient, Create, this.flags, this.args, this.config);
|
|
54
54
|
const process = makeProcessRenderer(this.flags, "Creating a new ingress");
|
|
55
55
|
const { hostname } = this.flags;
|
|
56
56
|
const paths = [];
|
|
@@ -11,6 +11,7 @@ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Res
|
|
|
11
11
|
static args: {};
|
|
12
12
|
static flags: {
|
|
13
13
|
all: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
14
|
+
"project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
14
15
|
};
|
|
15
16
|
getData(): Promise<Response>;
|
|
16
17
|
protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
|
|
@@ -16,7 +16,7 @@ export class List extends ListBaseCommand {
|
|
|
16
16
|
if (this.flags.all) {
|
|
17
17
|
return await this.apiClient.domain.ingressListAccessible({});
|
|
18
18
|
}
|
|
19
|
-
const projectId = await withProjectId(this.apiClient, this.flags, this.args, this.config);
|
|
19
|
+
const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
|
|
20
20
|
return await this.apiClient.domain.ingressListForProject({
|
|
21
21
|
pathParameters: { projectId },
|
|
22
22
|
});
|
|
@@ -16,6 +16,7 @@ export default class Create extends ExecRenderBaseCommand<typeof Create, CreateR
|
|
|
16
16
|
password: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
17
|
"random-password": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
18
18
|
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
19
|
+
"project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
19
20
|
};
|
|
20
21
|
static examples: {
|
|
21
22
|
description: string;
|
|
@@ -67,7 +67,7 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
67
67
|
}
|
|
68
68
|
async exec() {
|
|
69
69
|
const { flags } = await this.parse(Create);
|
|
70
|
-
const projectId = await withProjectId(this.apiClient, flags, {}, this.config);
|
|
70
|
+
const projectId = await withProjectId(this.apiClient, Create, flags, {}, this.config);
|
|
71
71
|
const process = makeProcessRenderer(flags, "Creating a new mail address");
|
|
72
72
|
const [password, passwordGenerated] = await this.getPassword(process);
|
|
73
73
|
const response = await process.runStep("creating mail address", async () => {
|
|
@@ -10,7 +10,7 @@ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Res
|
|
|
10
10
|
static description: string;
|
|
11
11
|
static args: {};
|
|
12
12
|
static flags: {
|
|
13
|
-
|
|
13
|
+
"project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
14
14
|
};
|
|
15
15
|
getData(): Promise<Response>;
|
|
16
16
|
protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MailMailAddress[];
|
|
@@ -23,7 +23,7 @@ export class List extends ListBaseCommand {
|
|
|
23
23
|
async mapParams(input) {
|
|
24
24
|
return {
|
|
25
25
|
...input,
|
|
26
|
-
projectId: await withProjectId(this.apiClient, this.flags, this.args, this.config),
|
|
26
|
+
projectId: await withProjectId(this.apiClient, List, this.flags, this.args, this.config),
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
getColumns(data) {
|
|
@@ -7,7 +7,7 @@ export default class Delete extends DeleteBaseCommand<typeof Delete> {
|
|
|
7
7
|
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
8
|
};
|
|
9
9
|
static args: {
|
|
10
|
-
|
|
10
|
+
"org-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
|
|
11
11
|
};
|
|
12
12
|
protected deleteResource(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -7,7 +7,7 @@ export default class Delete extends DeleteBaseCommand {
|
|
|
7
7
|
static flags = { ...DeleteBaseCommand.baseFlags };
|
|
8
8
|
static args = { ...orgArgs };
|
|
9
9
|
async deleteResource() {
|
|
10
|
-
const customerId = await withOrgId(this.apiClient, {}, this.args, this.config);
|
|
10
|
+
const customerId = await withOrgId(this.apiClient, Delete, {}, this.args, this.config);
|
|
11
11
|
const response = await this.apiClient.customer.deleteCustomer({
|
|
12
12
|
pathParameters: { customerId },
|
|
13
13
|
});
|
|
@@ -8,7 +8,7 @@ export declare class Get extends RenderBaseCommand<typeof Get> {
|
|
|
8
8
|
[x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
|
|
9
9
|
};
|
|
10
10
|
static args: {
|
|
11
|
-
|
|
11
|
+
"org-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
|
|
12
12
|
};
|
|
13
13
|
protected render(): ReactNode;
|
|
14
14
|
}
|
|
@@ -39,7 +39,7 @@ export class Get extends RenderBaseCommand {
|
|
|
39
39
|
};
|
|
40
40
|
static args = { ...orgArgs };
|
|
41
41
|
render() {
|
|
42
|
-
const customerId = usePromise(() => withOrgId(this.apiClient, this.flags, this.args, this.config), []);
|
|
42
|
+
const customerId = usePromise(() => withOrgId(this.apiClient, Get, this.flags, this.args, this.config), []);
|
|
43
43
|
const customerResponse = usePromise((id) => this.apiClient.customer.getCustomer({
|
|
44
44
|
pathParameters: { customerId: id },
|
|
45
45
|
}), [customerId]);
|
|
@@ -10,7 +10,7 @@ export declare abstract class List extends ListBaseCommand<typeof List, Response
|
|
|
10
10
|
static description: string;
|
|
11
11
|
static args: {};
|
|
12
12
|
static flags: {
|
|
13
|
-
|
|
13
|
+
"org-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
14
14
|
};
|
|
15
15
|
getData(): Promise<Response>;
|
|
16
16
|
protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MembershipCustomerInvite[];
|
|
@@ -9,7 +9,7 @@ export class List extends ListBaseCommand {
|
|
|
9
9
|
...orgFlags,
|
|
10
10
|
};
|
|
11
11
|
async getData() {
|
|
12
|
-
const customerId = await withOrgId(this.apiClient, this.flags, this.args, this.config);
|
|
12
|
+
const customerId = await withOrgId(this.apiClient, List, this.flags, this.args, this.config);
|
|
13
13
|
return await this.apiClient.customer.listInvitesForCustomer({
|
|
14
14
|
pathParameters: { customerId },
|
|
15
15
|
});
|
|
@@ -5,13 +5,13 @@ export declare class Invite extends ExecRenderBaseCommand<typeof Invite, {
|
|
|
5
5
|
}> {
|
|
6
6
|
static description: string;
|
|
7
7
|
static flags: {
|
|
8
|
+
expires: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
9
|
email: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
10
|
role: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
11
|
message: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
-
expires: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
12
|
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
13
|
+
"org-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
13
14
|
};
|
|
14
|
-
protected getExpirationDate(): Date | undefined;
|
|
15
15
|
protected exec(): Promise<{
|
|
16
16
|
inviteId: string;
|
|
17
17
|
}>;
|
|
@@ -3,10 +3,10 @@ import { ExecRenderBaseCommand } from "../../rendering/react/ExecRenderBaseComma
|
|
|
3
3
|
import { orgFlags, withOrgId } from "../../lib/org/flags.js";
|
|
4
4
|
import { makeProcessRenderer, processFlags, } from "../../rendering/process/process_flags.js";
|
|
5
5
|
import { Flags } from "@oclif/core";
|
|
6
|
-
import parseDuration from "parse-duration";
|
|
7
6
|
import { assertStatus } from "@mittwald/api-client-commons";
|
|
8
7
|
import { Success } from "../../rendering/react/components/Success.js";
|
|
9
8
|
import { Value } from "../../rendering/react/components/Value.js";
|
|
9
|
+
import { expirationDateFromFlagsOptional, expireFlags, } from "../../lib/expires.js";
|
|
10
10
|
const inviteFlags = {
|
|
11
11
|
email: Flags.string({
|
|
12
12
|
description: "The email address of the user to invite.",
|
|
@@ -20,27 +20,14 @@ const inviteFlags = {
|
|
|
20
20
|
message: Flags.string({
|
|
21
21
|
description: "A message to include in the invitation email.",
|
|
22
22
|
}),
|
|
23
|
-
|
|
24
|
-
description: "An interval after which the invitation expires (examples: 30m, 30d, 1y).",
|
|
25
|
-
}),
|
|
23
|
+
...expireFlags("invitation"),
|
|
26
24
|
};
|
|
27
25
|
export class Invite extends ExecRenderBaseCommand {
|
|
28
26
|
static description = "Invite a user to an organization.";
|
|
29
27
|
static flags = { ...orgFlags, ...processFlags, ...inviteFlags };
|
|
30
|
-
getExpirationDate() {
|
|
31
|
-
if (!this.flags.expires) {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
const d = new Date();
|
|
35
|
-
const i = parseDuration(this.flags.expires);
|
|
36
|
-
if (!i) {
|
|
37
|
-
throw new Error("could not parse duration: " + this.flags.expires);
|
|
38
|
-
}
|
|
39
|
-
return new Date(d.getTime() + i);
|
|
40
|
-
}
|
|
41
28
|
async exec() {
|
|
42
29
|
const process = makeProcessRenderer(this.flags, "Inviting user to organization");
|
|
43
|
-
const customerId = await withOrgId(this.apiClient, this.flags, this.args, this.config);
|
|
30
|
+
const customerId = await withOrgId(this.apiClient, Invite, this.flags, this.args, this.config);
|
|
44
31
|
const invite = await process.runStep("Creating invite", async () => {
|
|
45
32
|
const result = await this.apiClient.customer.createCustomerInvite({
|
|
46
33
|
pathParameters: { customerId },
|
|
@@ -48,7 +35,7 @@ export class Invite extends ExecRenderBaseCommand {
|
|
|
48
35
|
mailAddress: this.flags.email,
|
|
49
36
|
role: this.flags.role,
|
|
50
37
|
message: this.flags.message,
|
|
51
|
-
membershipExpiresAt: this.
|
|
38
|
+
membershipExpiresAt: expirationDateFromFlagsOptional(this.flags)?.toJSON(),
|
|
52
39
|
},
|
|
53
40
|
});
|
|
54
41
|
assertStatus(result, 201);
|
|
@@ -13,7 +13,7 @@ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Res
|
|
|
13
13
|
static description: string;
|
|
14
14
|
static args: {};
|
|
15
15
|
static flags: {
|
|
16
|
-
|
|
16
|
+
"org-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
17
17
|
};
|
|
18
18
|
getData(): Promise<Response>;
|
|
19
19
|
protected mapData(data: SuccessfulResponse<Response, 200>["data"]): Promise<(MittwaldAPIV2.Components.Schemas.MembershipCustomerMembership | {
|
|
@@ -9,7 +9,7 @@ export class List extends ListBaseCommand {
|
|
|
9
9
|
...orgFlags,
|
|
10
10
|
};
|
|
11
11
|
async getData() {
|
|
12
|
-
const customerId = await withOrgId(this.apiClient, this.flags, this.args, this.config);
|
|
12
|
+
const customerId = await withOrgId(this.apiClient, List, this.flags, this.args, this.config);
|
|
13
13
|
return await this.apiClient.customer.listMembershipsForCustomer({
|
|
14
14
|
pathParameters: { customerId },
|
|
15
15
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
type CreateResult = {
|
|
4
|
+
backupId: string;
|
|
5
|
+
};
|
|
6
|
+
export declare class Create extends ExecRenderBaseCommand<typeof Create, CreateResult> {
|
|
7
|
+
static summary: string;
|
|
8
|
+
static flags: {
|
|
9
|
+
wait: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
|
+
"wait-timeout": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
expires: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
description: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
"project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
14
|
+
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
protected exec(): Promise<CreateResult>;
|
|
17
|
+
protected render(executionResult: CreateResult): ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
|
|
3
|
+
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
4
|
+
import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
|
|
5
|
+
import { Flags } from "@oclif/core";
|
|
6
|
+
import { expirationDateFromFlags, expireFlagsRequired, } from "../../../lib/expires.js";
|
|
7
|
+
import { assertStatus } from "@mittwald/api-client-commons";
|
|
8
|
+
import { Success } from "../../../rendering/react/components/Success.js";
|
|
9
|
+
import { waitFlags, waitUntil } from "../../../lib/wait.js";
|
|
10
|
+
import { Text } from "ink";
|
|
11
|
+
export class Create extends ExecRenderBaseCommand {
|
|
12
|
+
static summary = "Create a new backup of a project";
|
|
13
|
+
static flags = {
|
|
14
|
+
...processFlags,
|
|
15
|
+
...projectFlags,
|
|
16
|
+
description: Flags.string({
|
|
17
|
+
description: "a description for the backup.",
|
|
18
|
+
}),
|
|
19
|
+
...expireFlagsRequired("backup"),
|
|
20
|
+
...waitFlags,
|
|
21
|
+
};
|
|
22
|
+
async exec() {
|
|
23
|
+
const p = makeProcessRenderer(this.flags, "Creating backup");
|
|
24
|
+
const projectId = await withProjectId(this.apiClient, Create, this.flags, this.args, this.config);
|
|
25
|
+
const { description } = this.flags;
|
|
26
|
+
const expirationTime = expirationDateFromFlags(this.flags);
|
|
27
|
+
const backup = await p.runStep("creating backup", async () => {
|
|
28
|
+
const r = await this.apiClient.backup.createProjectBackup({
|
|
29
|
+
pathParameters: { projectId },
|
|
30
|
+
data: {
|
|
31
|
+
description,
|
|
32
|
+
expirationTime: expirationTime.toJSON(),
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
assertStatus(r, 201);
|
|
36
|
+
return r.data;
|
|
37
|
+
});
|
|
38
|
+
if (this.flags.wait) {
|
|
39
|
+
const stepWaiting = p.addStep(_jsx(Text, { children: "waiting for backup to be complete" }));
|
|
40
|
+
await waitUntil(async () => {
|
|
41
|
+
const backupResponse = await this.apiClient.backup.getProjectBackup({
|
|
42
|
+
pathParameters: { projectBackupId: backup.id },
|
|
43
|
+
});
|
|
44
|
+
if (backupResponse.status === 200 &&
|
|
45
|
+
backupResponse.data.status === "Completed") {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
}, this.flags["wait-timeout"]);
|
|
49
|
+
stepWaiting.complete();
|
|
50
|
+
}
|
|
51
|
+
p.complete(_jsx(Success, { children: "Backup successfully created." }));
|
|
52
|
+
return { backupId: backup.id };
|
|
53
|
+
}
|
|
54
|
+
render(executionResult) {
|
|
55
|
+
if (this.flags.quiet) {
|
|
56
|
+
return executionResult.backupId;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DeleteBaseCommand } from "../../../DeleteBaseCommand.js";
|
|
2
|
+
export declare class Delete extends DeleteBaseCommand<typeof Delete> {
|
|
3
|
+
static description: string;
|
|
4
|
+
static resourceName: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
7
|
+
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
"backup-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
protected deleteResource(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DeleteBaseCommand } from "../../../DeleteBaseCommand.js";
|
|
2
|
+
import { assertStatus } from "@mittwald/api-client-commons";
|
|
3
|
+
import { Args } from "@oclif/core";
|
|
4
|
+
export class Delete extends DeleteBaseCommand {
|
|
5
|
+
static description = "Delete a backup";
|
|
6
|
+
static resourceName = "backup";
|
|
7
|
+
static flags = { ...DeleteBaseCommand.baseFlags };
|
|
8
|
+
static args = {
|
|
9
|
+
"backup-id": Args.string({
|
|
10
|
+
required: true,
|
|
11
|
+
description: "The ID of the Backup to show.",
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
14
|
+
async deleteResource() {
|
|
15
|
+
const projectBackupId = this.args["backup-id"];
|
|
16
|
+
const response = await this.apiClient.backup.deleteProjectBackup({
|
|
17
|
+
pathParameters: { projectBackupId },
|
|
18
|
+
});
|
|
19
|
+
assertStatus(response, 204);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { ProcessRenderer } from "../../../rendering/process/process.js";
|
|
4
|
+
import { AxiosResponseHeaders, RawAxiosResponseHeaders } from "@mittwald/api-client-commons";
|
|
5
|
+
type Result = {
|
|
6
|
+
outputFilename: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class Download extends ExecRenderBaseCommand<typeof Download, Result> {
|
|
9
|
+
static description: string;
|
|
10
|
+
static args: {
|
|
11
|
+
"backup-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
static flags: {
|
|
14
|
+
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
format: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
|
+
password: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
|
+
"generate-password": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
18
|
+
"prompt-password": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
19
|
+
resume: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
20
|
+
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
21
|
+
};
|
|
22
|
+
protected getPassword(p: ProcessRenderer): Promise<string | undefined>;
|
|
23
|
+
protected exec(): Promise<Result>;
|
|
24
|
+
protected getFilename(headers: RawAxiosResponseHeaders | AxiosResponseHeaders): string;
|
|
25
|
+
protected render(executionResult: Result): ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
|
|
3
|
+
import { Args, Flags } from "@oclif/core";
|
|
4
|
+
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
5
|
+
import crypto from "crypto";
|
|
6
|
+
import { Text } from "ink";
|
|
7
|
+
import { Value } from "../../../rendering/react/components/Value.js";
|
|
8
|
+
import { assertStatus, } from "@mittwald/api-client-commons";
|
|
9
|
+
import { waitUntil } from "../../../lib/wait.js";
|
|
10
|
+
import axios from "axios";
|
|
11
|
+
import * as fs from "fs";
|
|
12
|
+
import { formatBytes } from "../../../lib/viewhelpers/size.js";
|
|
13
|
+
import { Success } from "../../../rendering/react/components/Success.js";
|
|
14
|
+
export class Download extends ExecRenderBaseCommand {
|
|
15
|
+
static description = "Download a backup to your local disk";
|
|
16
|
+
static args = {
|
|
17
|
+
"backup-id": Args.string({
|
|
18
|
+
required: true,
|
|
19
|
+
description: "the ID of the Backup to download.",
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
static flags = {
|
|
23
|
+
...processFlags,
|
|
24
|
+
output: Flags.string({
|
|
25
|
+
description: "the file to write the backup to; if omitted, the filename will be determined by the server.",
|
|
26
|
+
}),
|
|
27
|
+
format: Flags.string({
|
|
28
|
+
description: "the file format to download the backup in.",
|
|
29
|
+
options: ["tar", "zip"],
|
|
30
|
+
default: "tar",
|
|
31
|
+
}),
|
|
32
|
+
password: Flags.string({
|
|
33
|
+
summary: "the password to encrypt the backup with.",
|
|
34
|
+
description: `\
|
|
35
|
+
CAUTION #1: this is not stored anywhere.
|
|
36
|
+
CAUTION #2: it is dangerous to use this option, as the password might be stored in your shell history.`,
|
|
37
|
+
exclusive: ["generate-password", "prompt-password"],
|
|
38
|
+
}),
|
|
39
|
+
"generate-password": Flags.boolean({
|
|
40
|
+
summary: "generate a random password to encrypt the backup with.",
|
|
41
|
+
description: "CAUTION: this is not stored anywhere.",
|
|
42
|
+
exclusive: ["password", "prompt-password"],
|
|
43
|
+
}),
|
|
44
|
+
"prompt-password": Flags.boolean({
|
|
45
|
+
summary: "prompt for a password to encrypt the backup with.",
|
|
46
|
+
description: "CAUTION: this is not stored anywhere.",
|
|
47
|
+
exclusive: ["password", "generate-password"],
|
|
48
|
+
}),
|
|
49
|
+
resume: Flags.boolean({
|
|
50
|
+
summary: "resume a previously interrupted download.",
|
|
51
|
+
dependsOn: ["output"],
|
|
52
|
+
}),
|
|
53
|
+
};
|
|
54
|
+
async getPassword(p) {
|
|
55
|
+
if (this.flags.password) {
|
|
56
|
+
return this.flags.password;
|
|
57
|
+
}
|
|
58
|
+
if (this.flags["generate-password"]) {
|
|
59
|
+
const password = await p.runStep("generating password", async () => {
|
|
60
|
+
return crypto.randomBytes(32).toString("ascii").substring(0, 32);
|
|
61
|
+
});
|
|
62
|
+
p.addInfo(_jsxs(Text, { children: ["generated password: ", _jsx(Value, { children: password })] }));
|
|
63
|
+
return password;
|
|
64
|
+
}
|
|
65
|
+
if (this.flags["prompt-password"]) {
|
|
66
|
+
return await p.addInput(_jsx(Text, { children: "enter backup password" }), true);
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
async exec() {
|
|
71
|
+
const p = makeProcessRenderer(this.flags, "Downloading backup");
|
|
72
|
+
const projectBackupId = this.args["backup-id"];
|
|
73
|
+
const { format } = this.flags;
|
|
74
|
+
const password = await this.getPassword(p);
|
|
75
|
+
const backup = await p.runStep("fetching backup", async () => {
|
|
76
|
+
const r = await this.apiClient.backup.getProjectBackup({
|
|
77
|
+
pathParameters: { projectBackupId },
|
|
78
|
+
});
|
|
79
|
+
assertStatus(r, 200);
|
|
80
|
+
return r.data;
|
|
81
|
+
});
|
|
82
|
+
if (backup.export && backup.export.phase !== "Expired") {
|
|
83
|
+
p.addInfo(_jsx(Text, { children: "backup download is already prepared" }));
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
await p.runStep("preparing backup download", async () => {
|
|
87
|
+
const r = await this.apiClient.backup.createProjectBackupExport({
|
|
88
|
+
pathParameters: { projectBackupId },
|
|
89
|
+
data: {
|
|
90
|
+
format: format,
|
|
91
|
+
password,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
assertStatus(r, 204);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const backupExport = await p.runStep("waiting for backup download to be ready", () => {
|
|
98
|
+
return waitUntil(async () => {
|
|
99
|
+
const r = await this.apiClient.backup.getProjectBackup({
|
|
100
|
+
pathParameters: { projectBackupId },
|
|
101
|
+
});
|
|
102
|
+
assertStatus(r, 200);
|
|
103
|
+
if (r.data.export?.phase === "Completed") {
|
|
104
|
+
return r.data.export;
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}, 3600);
|
|
108
|
+
});
|
|
109
|
+
if (!backupExport.downloadURL) {
|
|
110
|
+
throw new Error("backup download is not ready");
|
|
111
|
+
}
|
|
112
|
+
const reqConfig = { responseType: "stream" };
|
|
113
|
+
if (this.flags.resume &&
|
|
114
|
+
this.flags.output &&
|
|
115
|
+
fs.existsSync(this.flags.output)) {
|
|
116
|
+
const stat = fs.statSync(this.flags.output);
|
|
117
|
+
const range = `bytes=${stat.size}-`;
|
|
118
|
+
reqConfig.headers = { Range: range };
|
|
119
|
+
p.addInfo(_jsxs(Text, { children: ["resuming download starting at ", _jsx(Value, { children: stat.size }), " bytes"] }));
|
|
120
|
+
}
|
|
121
|
+
const downloadStep = p.addStep("downloading backup");
|
|
122
|
+
const resp = await axios(backupExport.downloadURL, reqConfig);
|
|
123
|
+
const size = parseInt(resp.headers["content-length"] || "0", 10);
|
|
124
|
+
let downloaded = 0;
|
|
125
|
+
const outputFilename = this.getFilename(resp.headers);
|
|
126
|
+
const outputStream = fs.createWriteStream(outputFilename, {
|
|
127
|
+
flags: this.flags.resume ? "a" : undefined,
|
|
128
|
+
});
|
|
129
|
+
resp.data.on("data", (chunk) => {
|
|
130
|
+
downloaded += chunk.length;
|
|
131
|
+
downloadStep.progress(formatBytes(downloaded, {
|
|
132
|
+
minimumFractionDigits: 2,
|
|
133
|
+
maximumFractionDigits: 2,
|
|
134
|
+
}) +
|
|
135
|
+
" of " +
|
|
136
|
+
formatBytes(size, {
|
|
137
|
+
minimumFractionDigits: 2,
|
|
138
|
+
maximumFractionDigits: 2,
|
|
139
|
+
}));
|
|
140
|
+
outputStream.write(chunk);
|
|
141
|
+
});
|
|
142
|
+
await new Promise((res) => {
|
|
143
|
+
resp.data.on("end", () => {
|
|
144
|
+
downloadStep.complete();
|
|
145
|
+
res();
|
|
146
|
+
});
|
|
147
|
+
resp.data.on("error", (err) => {
|
|
148
|
+
downloadStep.error(err);
|
|
149
|
+
res();
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
p.complete(_jsxs(Success, { children: ["The backup was successfully downloaded to", " ", _jsx(Value, { children: outputFilename })] }));
|
|
153
|
+
return { outputFilename };
|
|
154
|
+
}
|
|
155
|
+
getFilename(headers) {
|
|
156
|
+
if (this.flags.output) {
|
|
157
|
+
return this.flags.output;
|
|
158
|
+
}
|
|
159
|
+
const disposition = headers["content-disposition"];
|
|
160
|
+
if (disposition) {
|
|
161
|
+
const match = disposition.match(/filename=("?)(.*)\1/);
|
|
162
|
+
if (match) {
|
|
163
|
+
return match[2];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (this.flags.format === "tar") {
|
|
167
|
+
return "backup.tar.gz";
|
|
168
|
+
}
|
|
169
|
+
return "backup.zip";
|
|
170
|
+
}
|
|
171
|
+
render(executionResult) {
|
|
172
|
+
if (this.flags.quiet) {
|
|
173
|
+
return executionResult.outputFilename;
|
|
174
|
+
}
|
|
175
|
+
return undefined;
|
|
176
|
+
}
|
|
177
|
+
}
|