@mittwald/cli 1.0.0-alpha.18 → 1.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +889 -56
  2. package/dist/esm/commands/app/install/contao.d.ts +11 -0
  3. package/dist/esm/commands/app/install/contao.js +24 -0
  4. package/dist/esm/commands/app/install/joomla.d.ts +11 -0
  5. package/dist/esm/commands/app/install/joomla.js +23 -0
  6. package/dist/esm/commands/app/install/matomo.d.ts +11 -0
  7. package/dist/esm/commands/app/install/matomo.js +21 -0
  8. package/dist/esm/commands/app/install/node.d.ts +11 -0
  9. package/dist/esm/commands/app/install/node.js +13 -0
  10. package/dist/esm/commands/app/install/php.d.ts +11 -0
  11. package/dist/esm/commands/app/install/php.js +13 -0
  12. package/dist/esm/commands/app/install/shopware5.d.ts +11 -0
  13. package/dist/esm/commands/app/install/shopware5.js +26 -0
  14. package/dist/esm/commands/app/install/shopware6.d.ts +11 -0
  15. package/dist/esm/commands/app/install/shopware6.js +26 -0
  16. package/dist/esm/commands/app/install/typo3.d.ts +11 -0
  17. package/dist/esm/commands/app/install/typo3.js +22 -0
  18. package/dist/esm/commands/app/install/wordpress.d.ts +4 -16
  19. package/dist/esm/commands/app/install/wordpress.js +16 -107
  20. package/dist/esm/commands/app/versions.js +1 -1
  21. package/dist/esm/commands/org/invite.d.ts +1 -2
  22. package/dist/esm/commands/org/invite.js +3 -16
  23. package/dist/esm/commands/project/backup/create.d.ts +18 -0
  24. package/dist/esm/commands/project/backup/create.js +59 -0
  25. package/dist/esm/commands/project/backup/delete.d.ts +13 -0
  26. package/dist/esm/commands/project/backup/delete.js +21 -0
  27. package/dist/esm/commands/project/backup/download.d.ts +27 -0
  28. package/dist/esm/commands/project/backup/download.js +177 -0
  29. package/dist/esm/commands/project/backup/get.d.ts +11 -2
  30. package/dist/esm/commands/project/backup/get.js +26 -5
  31. package/dist/esm/commands/project/backup/list.d.ts +9 -9
  32. package/dist/esm/commands/project/backupschedule/list.d.ts +13 -7
  33. package/dist/esm/commands/project/backupschedule/list.js +15 -7
  34. package/dist/esm/commands/project/create.d.ts +2 -1
  35. package/dist/esm/commands/project/create.js +3 -6
  36. package/dist/esm/lib/app/Installer.d.ts +21 -0
  37. package/dist/esm/lib/app/Installer.js +49 -0
  38. package/dist/esm/lib/app/flags.d.ts +25 -0
  39. package/dist/esm/lib/app/flags.js +190 -1
  40. package/dist/esm/lib/app/install.d.ts +4 -0
  41. package/dist/esm/lib/app/install.js +20 -0
  42. package/dist/esm/lib/app/{appVersionHelpers.d.ts → versions.d.ts} +3 -0
  43. package/dist/esm/lib/app/{appVersionHelpers.js → versions.js} +18 -0
  44. package/dist/esm/lib/app/wait.d.ts +3 -0
  45. package/dist/esm/lib/app/wait.js +19 -0
  46. package/dist/esm/lib/expires.d.ts +11 -0
  47. package/dist/esm/lib/expires.js +31 -0
  48. package/dist/esm/lib/password.d.ts +2 -0
  49. package/dist/esm/lib/password.js +20 -0
  50. package/dist/esm/lib/project/hooks.d.ts +3 -0
  51. package/dist/esm/lib/project/hooks.js +11 -0
  52. package/dist/esm/lib/project/ingress.d.ts +2 -0
  53. package/dist/esm/lib/project/ingress.js +16 -0
  54. package/dist/esm/lib/project/shortId.d.ts +2 -0
  55. package/dist/esm/lib/project/shortId.js +11 -0
  56. package/dist/esm/lib/projectbackup/hooks.d.ts +5 -0
  57. package/dist/esm/lib/projectbackup/hooks.js +19 -0
  58. package/dist/esm/lib/viewhelpers/size.d.ts +2 -1
  59. package/dist/esm/lib/viewhelpers/size.js +2 -2
  60. package/dist/esm/lib/wait.d.ts +4 -0
  61. package/dist/esm/lib/wait.js +13 -2
  62. package/dist/esm/rendering/process/components/ProcessStateSummary.js +3 -0
  63. package/dist/esm/rendering/process/process.d.ts +2 -0
  64. package/dist/esm/rendering/process/process.js +4 -0
  65. package/dist/esm/rendering/react/components/ProjectBackup/ProjectBackupDetails.d.ts +6 -0
  66. package/dist/esm/rendering/react/components/ProjectBackup/ProjectBackupDetails.js +29 -0
  67. package/dist/esm/rendering/react/components/ProjectBackup/ProjectBackupStatus.d.ts +6 -0
  68. package/dist/esm/rendering/react/components/ProjectBackup/ProjectBackupStatus.js +8 -0
  69. package/package.json +1 -1
  70. package/dist/esm/commands/project/backupschedule/get.d.ts +0 -3
  71. package/dist/esm/commands/project/backupschedule/get.js +0 -6
  72. package/dist/esm/generated/backup/getProjectBackup.d.ts +0 -16
  73. package/dist/esm/generated/backup/getProjectBackup.js +0 -25
  74. package/dist/esm/generated/backup/getProjectBackupSchedule.d.ts +0 -16
  75. package/dist/esm/generated/backup/getProjectBackupSchedule.js +0 -25
  76. package/dist/esm/generated/backup/listProjectBackupSchedules.d.ts +0 -13
  77. package/dist/esm/generated/backup/listProjectBackupSchedules.js +0 -24
  78. package/dist/esm/generated/backup/listProjectBackups.d.ts +0 -13
  79. package/dist/esm/generated/backup/listProjectBackups.js +0 -24
  80. /package/dist/esm/lib/app/{appHelpers.d.ts → uuid.d.ts} +0 -0
  81. /package/dist/esm/lib/app/{appHelpers.js → uuid.js} +0 -0
@@ -0,0 +1,11 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import React from "react";
3
+ import { AppInstallationResult } from "../../../lib/app/Installer.js";
4
+ export default class InstallContao extends ExecRenderBaseCommand<typeof InstallContao, AppInstallationResult> {
5
+ static description: string;
6
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("version" | "host" | "admin-user" | "admin-email" | "admin-pass" | "admin-firstname" | "admin-lastname" | "site-title" | "wait")[]>>;
7
+ protected exec(): Promise<{
8
+ appInstallationId: string;
9
+ }>;
10
+ protected render(result: AppInstallationResult): React.ReactNode;
11
+ }
@@ -0,0 +1,24 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { AppInstaller, } from "../../../lib/app/Installer.js";
3
+ const installer = new AppInstaller("4916ce3e-cba4-4d2e-9798-a8764aa14cf3", "Contao", [
4
+ "version",
5
+ "host",
6
+ "admin-firstname",
7
+ "admin-user",
8
+ "admin-email",
9
+ "admin-pass",
10
+ "admin-firstname",
11
+ "admin-lastname",
12
+ "site-title",
13
+ "wait",
14
+ ]);
15
+ export default class InstallContao extends ExecRenderBaseCommand {
16
+ static description = installer.description;
17
+ static flags = installer.flags;
18
+ async exec() {
19
+ return installer.exec(this.apiClient, this.args, this.flags, this.config);
20
+ }
21
+ render(result) {
22
+ return installer.render(result, this.flags);
23
+ }
24
+ }
@@ -0,0 +1,11 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import React from "react";
3
+ import { AppInstallationResult } from "../../../lib/app/Installer.js";
4
+ export default class InstallJoomla extends ExecRenderBaseCommand<typeof InstallJoomla, AppInstallationResult> {
5
+ static description: string;
6
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("version" | "host" | "admin-user" | "admin-email" | "admin-pass" | "admin-firstname" | "admin-lastname" | "site-title" | "wait")[]>>;
7
+ protected exec(): Promise<{
8
+ appInstallationId: string;
9
+ }>;
10
+ protected render(result: AppInstallationResult): React.ReactNode;
11
+ }
@@ -0,0 +1,23 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { AppInstaller, } from "../../../lib/app/Installer.js";
3
+ const installer = new AppInstaller("8d404bff-6d75-4833-9eed-1b83b0552585", "Joomla!", [
4
+ "version",
5
+ "host",
6
+ "admin-user",
7
+ "admin-email",
8
+ "admin-pass",
9
+ "admin-firstname",
10
+ "admin-lastname",
11
+ "site-title",
12
+ "wait",
13
+ ]);
14
+ export default class InstallJoomla extends ExecRenderBaseCommand {
15
+ static description = installer.description;
16
+ static flags = installer.flags;
17
+ async exec() {
18
+ return installer.exec(this.apiClient, this.args, this.flags, this.config);
19
+ }
20
+ render(result) {
21
+ return installer.render(result, this.flags);
22
+ }
23
+ }
@@ -0,0 +1,11 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import React from "react";
3
+ import { AppInstallationResult } from "../../../lib/app/Installer.js";
4
+ export default class InstallMatomo extends ExecRenderBaseCommand<typeof InstallMatomo, AppInstallationResult> {
5
+ static description: string;
6
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("version" | "host" | "admin-user" | "admin-email" | "admin-pass" | "site-title" | "wait")[]>>;
7
+ protected exec(): Promise<{
8
+ appInstallationId: string;
9
+ }>;
10
+ protected render(result: AppInstallationResult): React.ReactNode;
11
+ }
@@ -0,0 +1,21 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { AppInstaller, } from "../../../lib/app/Installer.js";
3
+ const installer = new AppInstaller("91fa05e7-34f7-42e8-a8d3-a9c42abd5f8c", "Matomo", [
4
+ "version",
5
+ "host",
6
+ "admin-user",
7
+ "admin-email",
8
+ "admin-pass",
9
+ "site-title",
10
+ "wait",
11
+ ]);
12
+ export default class InstallMatomo extends ExecRenderBaseCommand {
13
+ static description = installer.description;
14
+ static flags = installer.flags;
15
+ async exec() {
16
+ return installer.exec(this.apiClient, this.args, this.flags, this.config);
17
+ }
18
+ render(result) {
19
+ return installer.render(result, this.flags);
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import React from "react";
3
+ import { AppInstallationResult } from "../../../lib/app/Installer.js";
4
+ export default class InstallNode extends ExecRenderBaseCommand<typeof InstallNode, AppInstallationResult> {
5
+ static description: string;
6
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("version" | "site-title" | "wait")[]>>;
7
+ protected exec(): Promise<{
8
+ appInstallationId: string;
9
+ }>;
10
+ protected render(result: AppInstallationResult): React.ReactNode;
11
+ }
@@ -0,0 +1,13 @@
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
+ }
@@ -0,0 +1,11 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import React from "react";
3
+ import { AppInstallationResult } from "../../../lib/app/Installer.js";
4
+ export default class InstallPhp extends ExecRenderBaseCommand<typeof InstallPhp, AppInstallationResult> {
5
+ static description: string;
6
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("version" | "site-title" | "wait")[]>>;
7
+ protected exec(): Promise<{
8
+ appInstallationId: string;
9
+ }>;
10
+ protected render(result: AppInstallationResult): React.ReactNode;
11
+ }
@@ -0,0 +1,13 @@
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", "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
+ }
@@ -0,0 +1,11 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import React from "react";
3
+ import { AppInstallationResult } from "../../../lib/app/Installer.js";
4
+ export default class InstallShopware5 extends ExecRenderBaseCommand<typeof InstallShopware5, AppInstallationResult> {
5
+ static description: string;
6
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("version" | "host" | "admin-user" | "admin-email" | "admin-pass" | "admin-firstname" | "admin-lastname" | "site-title" | "shop-email" | "shop-lang" | "shop-currency" | "wait")[]>>;
7
+ protected exec(): Promise<{
8
+ appInstallationId: string;
9
+ }>;
10
+ protected render(result: AppInstallationResult): React.ReactNode;
11
+ }
@@ -0,0 +1,26 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { AppInstaller, } from "../../../lib/app/Installer.js";
3
+ const installer = new AppInstaller("a23acf9c-9298-4082-9e7d-25356f9976dc", "Shopware 5", [
4
+ "version",
5
+ "host",
6
+ "admin-user",
7
+ "admin-email",
8
+ "admin-pass",
9
+ "admin-firstname",
10
+ "admin-lastname",
11
+ "site-title",
12
+ "shop-email",
13
+ "shop-lang",
14
+ "shop-currency",
15
+ "wait",
16
+ ]);
17
+ export default class InstallShopware5 extends ExecRenderBaseCommand {
18
+ static description = installer.description;
19
+ static flags = installer.flags;
20
+ async exec() {
21
+ return installer.exec(this.apiClient, this.args, this.flags, this.config);
22
+ }
23
+ render(result) {
24
+ return installer.render(result, this.flags);
25
+ }
26
+ }
@@ -0,0 +1,11 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import React from "react";
3
+ import { AppInstallationResult } from "../../../lib/app/Installer.js";
4
+ export default class InstallShopware6 extends ExecRenderBaseCommand<typeof InstallShopware6, AppInstallationResult> {
5
+ static description: string;
6
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("version" | "host" | "admin-user" | "admin-email" | "admin-pass" | "admin-firstname" | "admin-lastname" | "site-title" | "shop-email" | "shop-lang" | "shop-currency" | "wait")[]>>;
7
+ protected exec(): Promise<{
8
+ appInstallationId: string;
9
+ }>;
10
+ protected render(result: AppInstallationResult): React.ReactNode;
11
+ }
@@ -0,0 +1,26 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { AppInstaller, } from "../../../lib/app/Installer.js";
3
+ const installer = new AppInstaller("12d54d05-7e55-4cf3-90c4-093516e0eaf8", "Shopware 6", [
4
+ "version",
5
+ "host",
6
+ "admin-user",
7
+ "admin-email",
8
+ "admin-pass",
9
+ "admin-firstname",
10
+ "admin-lastname",
11
+ "site-title",
12
+ "shop-email",
13
+ "shop-lang",
14
+ "shop-currency",
15
+ "wait",
16
+ ]);
17
+ export default class InstallShopware6 extends ExecRenderBaseCommand {
18
+ static description = installer.description;
19
+ static flags = installer.flags;
20
+ async exec() {
21
+ return installer.exec(this.apiClient, this.args, this.flags, this.config);
22
+ }
23
+ render(result) {
24
+ return installer.render(result, this.flags);
25
+ }
26
+ }
@@ -0,0 +1,11 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import React from "react";
3
+ import { AppInstallationResult } from "../../../lib/app/Installer.js";
4
+ export default class InstallTYPO3 extends ExecRenderBaseCommand<typeof InstallTYPO3, AppInstallationResult> {
5
+ static description: string;
6
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("version" | "host" | "admin-user" | "admin-email" | "admin-pass" | "site-title" | "install-mode" | "wait")[]>>;
7
+ protected exec(): Promise<{
8
+ appInstallationId: string;
9
+ }>;
10
+ protected render(result: AppInstallationResult): React.ReactNode;
11
+ }
@@ -0,0 +1,22 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { AppInstaller, } from "../../../lib/app/Installer.js";
3
+ const installer = new AppInstaller("352971cc-b96a-4a26-8651-b08d7c8a7357", "TYPO3", [
4
+ "version",
5
+ "host",
6
+ "admin-user",
7
+ "admin-email",
8
+ "admin-pass",
9
+ "site-title",
10
+ "install-mode",
11
+ "wait",
12
+ ]);
13
+ export default class InstallTYPO3 extends ExecRenderBaseCommand {
14
+ static description = installer.description;
15
+ static flags = installer.flags;
16
+ async exec() {
17
+ return installer.exec(this.apiClient, this.args, this.flags, this.config);
18
+ }
19
+ render(result) {
20
+ return installer.render(result, this.flags);
21
+ }
22
+ }
@@ -1,23 +1,11 @@
1
1
  import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
2
  import React from "react";
3
- export default class AppCreateWordpress extends ExecRenderBaseCommand<typeof AppCreateWordpress, {
4
- appInstallationId: string;
5
- }> {
3
+ import { AppInstallationResult } from "../../../lib/app/Installer.js";
4
+ export default class InstallWordPress extends ExecRenderBaseCommand<typeof InstallWordPress, AppInstallationResult> {
6
5
  static description: string;
7
- static flags: {
8
- version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
- host: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- "admin-user": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
- "admin-email": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
- "admin-pass": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
- "site-title": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
14
- wait: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
15
- quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
16
- };
6
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("version" | "host" | "admin-user" | "admin-email" | "admin-pass" | "site-title" | "wait")[]>>;
17
7
  protected exec(): Promise<{
18
8
  appInstallationId: string;
19
9
  }>;
20
- protected render({ appInstallationId, }: {
21
- appInstallationId: string;
22
- }): React.ReactNode;
10
+ protected render(result: AppInstallationResult): React.ReactNode;
23
11
  }
@@ -1,112 +1,21 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Flags } from "@oclif/core";
3
- import { getAppUuidFromAppName } from "../../../lib/app/appHelpers.js";
4
- import { getAppVersionUuidFromAppVersion, getLatestAvailableAppVersionForApp, } from "../../../lib/app/appVersionHelpers.js";
5
- import { assertStatus } from "@mittwald/api-client-commons";
6
- import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
7
1
  import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
8
- import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
9
- import { Value } from "../../../rendering/react/components/Value.js";
10
- import { Text } from "ink";
11
- import { Success } from "../../../rendering/react/components/Success.js";
12
- import { waitUntil } from "../../../lib/wait.js";
13
- export default class AppCreateWordpress extends ExecRenderBaseCommand {
14
- static description = "Creates new WordPress Installation.";
15
- static flags = {
16
- ...projectFlags,
17
- ...processFlags,
18
- version: Flags.string({
19
- required: true,
20
- description: "Version of the App to be created - Defaults to latest",
21
- default: "latest",
22
- }),
23
- host: Flags.string({
24
- required: true,
25
- description: "Host under which the App will be available (Needs to be created separately).",
26
- }),
27
- "admin-user": Flags.string({
28
- required: true,
29
- description: "First Admin User for the app.",
30
- }),
31
- "admin-email": Flags.string({
32
- required: true,
33
- description: "First Admin Users E-Mail.",
34
- }),
35
- "admin-pass": Flags.string({
36
- required: true,
37
- description: "First Admin Users Password.",
38
- }),
39
- "site-title": Flags.string({
40
- required: true,
41
- description: "Site Title of the created appInstallation.",
42
- }),
43
- wait: Flags.boolean({
44
- char: "w",
45
- description: "Wait for the App to be ready.",
46
- }),
47
- };
2
+ import { AppInstaller, } from "../../../lib/app/Installer.js";
3
+ const installer = new AppInstaller("da3aa3ae-4b6b-4398-a4a8-ee8def827876", "WordPress", [
4
+ "version",
5
+ "host",
6
+ "admin-user",
7
+ "admin-email",
8
+ "admin-pass",
9
+ "site-title",
10
+ "wait",
11
+ ]);
12
+ export default class InstallWordPress extends ExecRenderBaseCommand {
13
+ static description = installer.description;
14
+ static flags = installer.flags;
48
15
  async exec() {
49
- const process = makeProcessRenderer(this.flags, "Installing WordPress");
50
- const { flags, args } = await this.parse(AppCreateWordpress);
51
- const app = "WordPress";
52
- const appUuid = await getAppUuidFromAppName(this.apiClient, app);
53
- const projectId = await withProjectId(this.apiClient, flags, args, this.config);
54
- const appVersion = await process.runStep("determining app version", async () => {
55
- let v;
56
- if (flags.version && flags.version !== "latest") {
57
- v = await getAppVersionUuidFromAppVersion(this.apiClient, appUuid, flags.version);
58
- }
59
- else {
60
- v = await getLatestAvailableAppVersionForApp(this.apiClient, appUuid);
61
- }
62
- if (!v) {
63
- throw new Error("App Version ${flags.version} not found.");
64
- }
65
- return v;
66
- });
67
- process.addInfo(_jsxs(Text, { children: ["installing version: ", _jsx(Value, { children: appVersion.externalVersion })] }));
68
- const [appInstallationId, eventId] = await process.runStep("starting installation", async () => {
69
- const result = await this.apiClient.app.requestAppinstallation({
70
- pathParameters: { projectId },
71
- data: {
72
- appVersionId: appVersion.id,
73
- description: flags["site-title"],
74
- updatePolicy: "none",
75
- userInputs: [
76
- { name: "host", value: flags.host },
77
- { name: "site_title", value: flags["site-title"] },
78
- { name: "admin_user", value: flags["admin-user"] },
79
- { name: "admin_email", value: flags["admin-email"] },
80
- { name: "admin_pass", value: flags["admin-pass"] },
81
- ],
82
- },
83
- });
84
- assertStatus(result, 201);
85
- return [result.data.id, result.headers["etag"]];
86
- });
87
- if (flags.wait) {
88
- const stepWaiting = process.addStep(_jsx(Text, { children: "waiting for app installation to be ready" }));
89
- await waitUntil(async () => {
90
- const installationResponse = await this.apiClient.app.getAppinstallation({
91
- pathParameters: { appInstallationId },
92
- // TODO: Remove once @mittwald/api-client supports this
93
- headers: { "if-event-reached": eventId }, // eslint-disable-line
94
- });
95
- if (installationResponse.status === 200 &&
96
- installationResponse.data.appVersion.current ==
97
- installationResponse.data.appVersion.desired) {
98
- return true;
99
- }
100
- });
101
- stepWaiting.complete();
102
- }
103
- process.complete(_jsx(Success, { children: "Your WordPress installation is now complete. Have fun! \uD83C\uDF89" }));
104
- return { appInstallationId };
16
+ return installer.exec(this.apiClient, this.args, this.flags, this.config);
105
17
  }
106
- render({ appInstallationId, }) {
107
- if (this.flags.quiet) {
108
- this.log(appInstallationId);
109
- }
110
- return undefined;
18
+ render(result) {
19
+ return installer.render(result, this.flags);
111
20
  }
112
21
  }
@@ -2,7 +2,7 @@ import { BaseCommand } from "../../BaseCommand.js";
2
2
  import { Args } from "@oclif/core";
3
3
  import { isUuid } from "../../Helpers.js";
4
4
  import { assertStatus } from "@mittwald/api-client-commons";
5
- import { getAppNameFromUuid, getAppUuidFromAppName, } from "../../lib/app/appHelpers.js";
5
+ import { getAppNameFromUuid, getAppUuidFromAppName, } from "../../lib/app/uuid.js";
6
6
  export default class AppVersions extends BaseCommand {
7
7
  static description = "List supported Apps and Versions";
8
8
  static args = {
@@ -5,13 +5,12 @@ 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
13
  };
14
- protected getExpirationDate(): Date | undefined;
15
14
  protected exec(): Promise<{
16
15
  inviteId: string;
17
16
  }>;
@@ -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,24 +20,11 @@ const inviteFlags = {
20
20
  message: Flags.string({
21
21
  description: "A message to include in the invitation email.",
22
22
  }),
23
- expires: Flags.string({
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
30
  const customerId = await withOrgId(this.apiClient, this.flags, this.args, this.config);
@@ -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.getExpirationDate()?.toJSON(),
38
+ membershipExpiresAt: expirationDateFromFlagsOptional(this.flags)?.toJSON(),
52
39
  },
53
40
  });
54
41
  assertStatus(result, 201);
@@ -0,0 +1,18 @@
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
+ quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
14
+ };
15
+ protected exec(): Promise<CreateResult>;
16
+ protected render(executionResult: CreateResult): ReactNode;
17
+ }
18
+ 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, 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
+ }