@mittwald/cli 1.0.0-alpha.27 → 1.0.0-alpha.28

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 (115) hide show
  1. package/README.md +814 -760
  2. package/dist/esm/ExtendedBaseCommand.d.ts +4 -0
  3. package/dist/esm/ExtendedBaseCommand.js +12 -0
  4. package/dist/esm/Formatter.js +13 -1
  5. package/dist/esm/GetBaseCommand.d.ts +2 -3
  6. package/dist/esm/GetBaseCommand.js +2 -4
  7. package/dist/esm/ListBaseCommand.d.ts +2 -3
  8. package/dist/esm/ListBaseCommand.js +2 -4
  9. package/dist/esm/commands/app/copy.d.ts +1 -1
  10. package/dist/esm/commands/app/copy.js +3 -3
  11. package/dist/esm/commands/app/dependency/list.d.ts +1 -1
  12. package/dist/esm/commands/app/dependency/update.d.ts +1 -1
  13. package/dist/esm/commands/app/dependency/update.js +3 -3
  14. package/dist/esm/commands/app/dependency/versions.d.ts +1 -1
  15. package/dist/esm/commands/app/get.d.ts +1 -1
  16. package/dist/esm/commands/app/get.js +4 -3
  17. package/dist/esm/commands/app/list.d.ts +1 -1
  18. package/dist/esm/commands/app/list.js +4 -0
  19. package/dist/esm/commands/app/ssh.d.ts +4 -3
  20. package/dist/esm/commands/app/ssh.js +18 -9
  21. package/dist/esm/commands/app/uninstall.d.ts +1 -1
  22. package/dist/esm/commands/app/uninstall.js +3 -6
  23. package/dist/esm/commands/backup/create.js +2 -2
  24. package/dist/esm/commands/backup/list.js +2 -2
  25. package/dist/esm/commands/context/get.js +27 -5
  26. package/dist/esm/commands/conversation/show.js +1 -2
  27. package/dist/esm/commands/cronjob/create.d.ts +22 -0
  28. package/dist/esm/commands/cronjob/create.js +96 -0
  29. package/dist/esm/commands/cronjob/delete.d.ts +13 -0
  30. package/dist/esm/commands/cronjob/delete.js +21 -0
  31. package/dist/esm/commands/cronjob/execute.d.ts +17 -0
  32. package/dist/esm/commands/cronjob/execute.js +42 -0
  33. package/dist/esm/commands/cronjob/execution/abort.d.ts +18 -0
  34. package/dist/esm/commands/cronjob/execution/abort.js +41 -0
  35. package/dist/esm/commands/cronjob/execution/list.js +4 -5
  36. package/dist/esm/commands/cronjob/get.d.ts +7 -9
  37. package/dist/esm/commands/cronjob/get.js +22 -12
  38. package/dist/esm/commands/cronjob/list.js +4 -6
  39. package/dist/esm/commands/database/mysql/charsets.d.ts +2 -4
  40. package/dist/esm/commands/database/mysql/charsets.js +2 -6
  41. package/dist/esm/commands/database/mysql/create.js +2 -2
  42. package/dist/esm/commands/database/mysql/delete.js +2 -2
  43. package/dist/esm/commands/database/mysql/list.d.ts +1 -2
  44. package/dist/esm/commands/database/mysql/list.js +2 -2
  45. package/dist/esm/commands/database/mysql/user/list.d.ts +1 -2
  46. package/dist/esm/commands/database/mysql/user/list.js +2 -3
  47. package/dist/esm/commands/database/mysql/versions.d.ts +1 -2
  48. package/dist/esm/commands/database/mysql/versions.js +1 -3
  49. package/dist/esm/commands/database/redis/create.js +2 -2
  50. package/dist/esm/commands/database/redis/get.d.ts +1 -3
  51. package/dist/esm/commands/database/redis/get.js +0 -3
  52. package/dist/esm/commands/database/redis/list.d.ts +1 -2
  53. package/dist/esm/commands/database/redis/list.js +3 -5
  54. package/dist/esm/commands/database/redis/versions.d.ts +1 -2
  55. package/dist/esm/commands/database/redis/versions.js +2 -3
  56. package/dist/esm/commands/domain/dnszone/list.d.ts +1 -2
  57. package/dist/esm/commands/domain/dnszone/list.js +2 -2
  58. package/dist/esm/commands/domain/list.d.ts +1 -2
  59. package/dist/esm/commands/domain/list.js +3 -4
  60. package/dist/esm/commands/domain/ownership/list.js +3 -7
  61. package/dist/esm/commands/domain/virtualhost/create.js +4 -4
  62. package/dist/esm/commands/domain/virtualhost/delete.js +1 -1
  63. package/dist/esm/commands/domain/virtualhost/get.js +1 -1
  64. package/dist/esm/commands/domain/virtualhost/list.d.ts +1 -3
  65. package/dist/esm/commands/domain/virtualhost/list.js +5 -8
  66. package/dist/esm/commands/mail/address/create.d.ts +4 -0
  67. package/dist/esm/commands/mail/address/create.js +59 -5
  68. package/dist/esm/commands/mail/address/list.d.ts +2 -2
  69. package/dist/esm/commands/mail/address/list.js +2 -4
  70. package/dist/esm/commands/mail/deliverybox/list.js +2 -2
  71. package/dist/esm/commands/project/create.js +2 -2
  72. package/dist/esm/commands/project/delete.d.ts +0 -1
  73. package/dist/esm/commands/project/delete.js +4 -8
  74. package/dist/esm/commands/project/filesystem/usage.d.ts +1 -1
  75. package/dist/esm/commands/project/filesystem/usage.js +3 -3
  76. package/dist/esm/commands/project/get.js +5 -5
  77. package/dist/esm/commands/project/invite/list.js +2 -2
  78. package/dist/esm/commands/project/membership/list.js +5 -5
  79. package/dist/esm/commands/project/ssh.d.ts +2 -2
  80. package/dist/esm/commands/project/ssh.js +4 -5
  81. package/dist/esm/commands/project/update.d.ts +2 -2
  82. package/dist/esm/commands/project/update.js +4 -5
  83. package/dist/esm/commands/server/get.d.ts +1 -3
  84. package/dist/esm/commands/server/get.js +2 -5
  85. package/dist/esm/commands/sftp-user/list.js +2 -2
  86. package/dist/esm/commands/ssh-user/list.js +2 -2
  87. package/dist/esm/lib/app/flags.d.ts +4 -2
  88. package/dist/esm/lib/app/flags.js +3 -7
  89. package/dist/esm/lib/assert_success.d.ts +3 -0
  90. package/dist/esm/lib/assert_success.js +7 -0
  91. package/dist/esm/lib/context.d.ts +24 -5
  92. package/dist/esm/lib/context.js +21 -16
  93. package/dist/esm/lib/context_flags.d.ts +10 -6
  94. package/dist/esm/lib/context_flags.js +8 -5
  95. package/dist/esm/lib/context_terraform.d.ts +6 -0
  96. package/dist/esm/lib/context_terraform.js +61 -0
  97. package/dist/esm/lib/context_user.d.ts +10 -0
  98. package/dist/esm/lib/context_user.js +34 -0
  99. package/dist/esm/lib/org/flags.d.ts +1 -9
  100. package/dist/esm/lib/org/flags.js +1 -1
  101. package/dist/esm/lib/project/flags.d.ts +1 -9
  102. package/dist/esm/lib/project/flags.js +1 -1
  103. package/dist/esm/lib/project/ingress.js +4 -2
  104. package/dist/esm/lib/server/flags.d.ts +1 -9
  105. package/dist/esm/lib/server/flags.js +1 -1
  106. package/dist/esm/rendering/react/RenderBaseCommand.d.ts +3 -0
  107. package/dist/esm/rendering/react/RenderBaseCommand.js +7 -0
  108. package/dist/esm/rendering/react/components/AppInstallation/AppInstallationDetails.js +8 -1
  109. package/dist/esm/rendering/react/components/CronJob/CronJobDetails.d.ts +8 -0
  110. package/dist/esm/rendering/react/components/CronJob/CronJobDetails.js +48 -0
  111. package/dist/esm/rendering/react/components/LocalFilename.d.ts +5 -0
  112. package/dist/esm/rendering/react/components/LocalFilename.js +14 -0
  113. package/dist/esm/rendering/react/components/Note.d.ts +1 -0
  114. package/dist/esm/rendering/react/components/Note.js +1 -1
  115. package/package.json +8 -6
@@ -0,0 +1,21 @@
1
+ import { DeleteBaseCommand } from "../../DeleteBaseCommand.js";
2
+ import { Args } from "@oclif/core";
3
+ import assertSuccess from "../../lib/assert_success.js";
4
+ export default class Delete extends DeleteBaseCommand {
5
+ static description = "Delete a cron job";
6
+ static resourceName = "cron job";
7
+ static flags = { ...DeleteBaseCommand.baseFlags };
8
+ static args = {
9
+ "cronjob-id": Args.string({
10
+ description: "ID of the cronjob to be deleted.",
11
+ required: true,
12
+ }),
13
+ };
14
+ async deleteResource() {
15
+ const { "cronjob-id": cronjobId } = this.args;
16
+ const response = await this.apiClient.cronjob.deleteCronjob({
17
+ cronjobId,
18
+ });
19
+ assertSuccess(response);
20
+ }
21
+ }
@@ -0,0 +1,17 @@
1
+ import { ExecRenderBaseCommand } from "../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { ReactNode } from "react";
3
+ type Result = {
4
+ executionId: string;
5
+ };
6
+ export declare class Execute extends ExecRenderBaseCommand<typeof Execute, Result> {
7
+ static summary: string;
8
+ static flags: {
9
+ quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
10
+ };
11
+ static args: {
12
+ "cronjob-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
13
+ };
14
+ protected exec(): Promise<Result>;
15
+ protected render({ executionId }: Result): ReactNode;
16
+ }
17
+ export {};
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ExecRenderBaseCommand } from "../../rendering/react/ExecRenderBaseCommand.js";
3
+ import { makeProcessRenderer, processFlags, } from "../../rendering/process/process_flags.js";
4
+ import { Args } from "@oclif/core";
5
+ import { assertStatus } from "@mittwald/api-client-commons";
6
+ import { Success } from "../../rendering/react/components/Success.js";
7
+ import { Value } from "../../rendering/react/components/Value.js";
8
+ export class Execute extends ExecRenderBaseCommand {
9
+ static summary = "Manually run a cron job";
10
+ static flags = {
11
+ ...processFlags,
12
+ };
13
+ static args = {
14
+ "cronjob-id": Args.string({
15
+ required: true,
16
+ summary: "ID of the cron job to run",
17
+ }),
18
+ };
19
+ async exec() {
20
+ const p = makeProcessRenderer(this.flags, "Running a cron job");
21
+ const { "cronjob-id": cronjobId } = this.args;
22
+ const cronjob = await p.runStep("getting cron job", async () => {
23
+ const r = await this.apiClient.cronjob.getCronjob({ cronjobId });
24
+ assertStatus(r, 200);
25
+ return r.data;
26
+ });
27
+ const { id: executionId } = await p.runStep("running cron job", async () => {
28
+ const r = await this.apiClient.cronjob.createExecution({
29
+ cronjobId,
30
+ });
31
+ assertStatus(r, 201);
32
+ return r.data;
33
+ });
34
+ p.complete(_jsxs(Success, { children: ["An execution for cron job ", _jsx(Value, { children: cronjob.shortId }), " was successfully created. Execution ID: ", _jsx(Value, { children: executionId })] }));
35
+ return { executionId };
36
+ }
37
+ render({ executionId }) {
38
+ if (this.flags.quiet) {
39
+ return executionId;
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,18 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { ReactNode } from "react";
3
+ type Result = {
4
+ executionId: string;
5
+ };
6
+ export declare class Abort extends ExecRenderBaseCommand<typeof Abort, Result> {
7
+ static summary: string;
8
+ static flags: {
9
+ quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
10
+ };
11
+ static args: {
12
+ "cronjob-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
13
+ "execution-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
14
+ };
15
+ protected exec(): Promise<Result>;
16
+ protected render({ executionId }: Result): ReactNode;
17
+ }
18
+ export {};
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
3
+ import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
4
+ import { Args } from "@oclif/core";
5
+ import { Success } from "../../../rendering/react/components/Success.js";
6
+ import { Value } from "../../../rendering/react/components/Value.js";
7
+ import assertSuccess from "../../../lib/assert_success.js";
8
+ export class Abort extends ExecRenderBaseCommand {
9
+ static summary = "Abort a running cron job execution.";
10
+ static flags = {
11
+ ...processFlags,
12
+ };
13
+ static args = {
14
+ "cronjob-id": Args.string({
15
+ description: "ID of the cronjob the execution belongs to",
16
+ required: true,
17
+ }),
18
+ "execution-id": Args.string({
19
+ required: true,
20
+ description: "ID of the cron job execution to abort",
21
+ }),
22
+ };
23
+ async exec() {
24
+ const p = makeProcessRenderer(this.flags, "Aborting a cron job execution");
25
+ const { "cronjob-id": cronjobId, "execution-id": executionId } = this.args;
26
+ await p.runStep("aborting cron job execution", async () => {
27
+ const r = await this.apiClient.cronjob.abortExecution({
28
+ cronjobId,
29
+ executionId,
30
+ });
31
+ assertSuccess(r);
32
+ });
33
+ p.complete(_jsxs(Success, { children: ["Execution ", _jsx(Value, { children: executionId }), " was successfully aborted."] }));
34
+ return { executionId };
35
+ }
36
+ render({ executionId }) {
37
+ if (this.flags.quiet) {
38
+ return executionId;
39
+ }
40
+ }
41
+ }
@@ -9,15 +9,14 @@ export class List extends ListBaseCommand {
9
9
  static flags = {
10
10
  ...ListBaseCommand.baseFlags,
11
11
  "cronjob-id": Flags.string({
12
- description: "ID of the Cronjob for which to list CronjobExecutions for.",
12
+ description: "ID of the cron job for which to list executions for.",
13
13
  required: true,
14
+ default: undefined,
14
15
  }),
15
16
  };
16
17
  async getData() {
17
- const pathParams = {
18
- cronjobId: this.flags["cronjob-id"],
19
- };
20
- return await this.apiClient.cronjob.listExecutions(pathParams);
18
+ const { "cronjob-id": cronjobId } = this.flags;
19
+ return await this.apiClient.cronjob.listExecutions({ cronjobId });
21
20
  }
22
21
  mapData(data) {
23
22
  return data;
@@ -1,16 +1,14 @@
1
- import { MittwaldAPIV2Client } from "@mittwald/api-client";
2
- import { GetBaseCommand } from "../../GetBaseCommand.js";
3
- type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["cronjob"]["getCronjob"]>>;
4
- export declare class Get extends GetBaseCommand<typeof Get, APIResponse> {
1
+ import { RenderBaseCommand } from "../../rendering/react/RenderBaseCommand.js";
2
+ import { GetFormatter } from "../../Formatter.js";
3
+ import { ReactNode } from "react";
4
+ export declare class Get extends RenderBaseCommand<typeof Get> {
5
5
  static description: string;
6
6
  static flags: {
7
7
  [x: string]: import("@oclif/core/lib/interfaces/parser.js").Flag<any>;
8
8
  };
9
9
  static args: {
10
- cronjobId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
10
+ "cronjob-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
11
11
  };
12
- static aliases: string[];
13
- static deprecateAliases: boolean;
14
- protected getData(): Promise<APIResponse>;
12
+ protected formatter: GetFormatter;
13
+ protected render(): ReactNode;
15
14
  }
16
- export {};
@@ -1,20 +1,30 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { GetBaseCommand } from "../../GetBaseCommand.js";
2
3
  import { Args } from "@oclif/core";
3
- export class Get extends GetBaseCommand {
4
- static description = "Get a cronjob.";
5
- static flags = {
6
- ...GetBaseCommand.baseFlags,
7
- };
4
+ import { RenderBaseCommand } from "../../rendering/react/RenderBaseCommand.js";
5
+ import { GetFormatter } from "../../Formatter.js";
6
+ import { ComponentPrinter } from "../../rendering/react/ComponentPrinter.js";
7
+ import { usePromise } from "@mittwald/react-use-promise";
8
+ import { assertStatus } from "@mittwald/api-client-commons";
9
+ import { RenderJson } from "../../rendering/react/json/RenderJson.js";
10
+ import { CronJobDetails } from "../../rendering/react/components/CronJob/CronJobDetails.js";
11
+ export class Get extends RenderBaseCommand {
12
+ static description = "Get details of a cron job";
13
+ static flags = { ...GetBaseCommand.baseFlags };
8
14
  static args = {
9
- cronjobId: Args.string({
10
- description: "ID of the cronjob to be retrieved.",
15
+ "cronjob-id": Args.string({
16
+ description: "ID of the cron job to be retrieved.",
11
17
  required: true,
12
18
  }),
13
19
  };
14
- static aliases = ["project:cronjob:get"];
15
- static deprecateAliases = true;
16
- async getData() {
17
- const { cronjobId } = this.args;
18
- return await this.apiClient.cronjob.getCronjob({ cronjobId });
20
+ formatter = new GetFormatter(new ComponentPrinter((r) => _jsx(CronJobDetails, { cronjob: r })));
21
+ render() {
22
+ const { "cronjob-id": cronjobId } = this.args;
23
+ const cronjobResponse = usePromise((cronjobId) => this.apiClient.cronjob.getCronjob({ cronjobId }), [cronjobId]);
24
+ assertStatus(cronjobResponse, 200);
25
+ if (this.flags.output === "json") {
26
+ return _jsx(RenderJson, { name: "cronjob", data: cronjobResponse.data });
27
+ }
28
+ return _jsx(CronJobDetails, { cronjob: cronjobResponse.data });
19
29
  }
20
30
  }
@@ -1,8 +1,8 @@
1
1
  import { ListBaseCommand } from "../../ListBaseCommand.js";
2
- import { projectFlags, withProjectId } from "../../lib/project/flags.js";
2
+ import { projectFlags } from "../../lib/project/flags.js";
3
3
  import { formatRelativeDate } from "../../lib/viewhelpers/date.js";
4
4
  export class List extends ListBaseCommand {
5
- static description = "List Cronjobs belonging to a Project.";
5
+ static description = "List cron jobs belonging to a project.";
6
6
  static aliases = ["project:cronjob:list"];
7
7
  static deprecateAliases = true;
8
8
  static args = {};
@@ -11,10 +11,8 @@ export class List extends ListBaseCommand {
11
11
  ...projectFlags,
12
12
  };
13
13
  async getData() {
14
- const pathParams = {
15
- projectId: await withProjectId(this.apiClient, List, this.flags, this.args, this.config),
16
- };
17
- return await this.apiClient.cronjob.listCronjobs(pathParams);
14
+ const projectId = await this.withProjectId(List);
15
+ return await this.apiClient.cronjob.listCronjobs({ projectId });
18
16
  }
19
17
  mapData(data) {
20
18
  return data;
@@ -4,8 +4,7 @@ import { SuccessfulResponse } from "../../../types.js";
4
4
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
5
5
  import { ListColumns } from "../../../Formatter.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2MysqlCharsets.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export type PathParams = MittwaldAPIV2.Paths.V2MysqlCharsets.Get.Parameters.Path;
8
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listMysqlCharsets"]>>;
7
+ type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listMysqlCharsets"]>>;
9
8
  export declare class Charsets extends ListBaseCommand<typeof Charsets, ResponseItem, Response> {
10
9
  static description: string;
11
10
  static args: {};
@@ -13,8 +12,7 @@ export declare class Charsets extends ListBaseCommand<typeof Charsets, ResponseI
13
12
  [x: string]: import("@oclif/core/lib/interfaces/parser.js").Flag<any>;
14
13
  };
15
14
  getData(): Promise<Response>;
16
- protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
17
15
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.DatabaseMySqlCharacterSettings[];
18
- protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
16
+ protected getColumns(): ListColumns<ResponseItem>;
19
17
  }
20
18
  export {};
@@ -6,17 +6,13 @@ export class Charsets extends ListBaseCommand {
6
6
  ...ListBaseCommand.baseFlags,
7
7
  };
8
8
  async getData() {
9
- const pathParams = {};
10
- return await this.apiClient.database.listMysqlCharsets((await this.mapParams(pathParams)));
11
- }
12
- mapParams(input) {
13
- return input;
9
+ return await this.apiClient.database.listMysqlCharsets({});
14
10
  }
15
11
  mapData(data) {
16
12
  data.sort((a, b) => a.name.localeCompare(b.name));
17
13
  return data;
18
14
  }
19
- getColumns(data) {
15
+ getColumns() {
20
16
  return {
21
17
  name: {},
22
18
  collations: {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
3
- import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
3
+ import { projectFlags } from "../../../lib/project/flags.js";
4
4
  import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
5
5
  import { Flags } from "@oclif/core";
6
6
  import { Text } from "ink";
@@ -46,7 +46,7 @@ export class Create extends ExecRenderBaseCommand {
46
46
  };
47
47
  async exec() {
48
48
  const p = makeProcessRenderer(this.flags, "Creating a new MySQL database");
49
- const projectId = await withProjectId(this.apiClient, Create, this.flags, this.args, this.config);
49
+ const projectId = await this.withProjectId(Create);
50
50
  const { description, version, collation, "character-set": characterSet, "user-external": externalAccess, "user-access-level": accessLevel, } = this.flags;
51
51
  const password = await this.getPassword(p);
52
52
  const db = await p.runStep("creating MySQL database", async () => {
@@ -1,7 +1,7 @@
1
- import { assertStatus } from "@mittwald/api-client-commons";
2
1
  import { normalizeProjectIdToUuid } from "../../../Helpers.js";
3
2
  import { DeleteBaseCommand } from "../../../DeleteBaseCommand.js";
4
3
  import { mysqlArgs, withMySQLId } from "../../../lib/database/mysql/flags.js";
4
+ import assertSuccess from "../../../lib/assert_success.js";
5
5
  export default class Delete extends DeleteBaseCommand {
6
6
  static description = "Delete a MySQL database";
7
7
  static resourceName = "MySQL database";
@@ -12,7 +12,7 @@ export default class Delete extends DeleteBaseCommand {
12
12
  const response = await this.apiClient.database.deleteMysqlDatabase({
13
13
  mysqlDatabaseId,
14
14
  });
15
- assertStatus(response, 200);
15
+ assertSuccess(response);
16
16
  }
17
17
  mapResourceId(id) {
18
18
  return normalizeProjectIdToUuid(this.apiClient, id);
@@ -4,8 +4,7 @@ import { SuccessfulResponse } from "../../../types.js";
4
4
  import { ListColumns } from "../../../Formatter.js";
5
5
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdMysqlDatabases.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdMysqlDatabases.Get.Parameters.Path;
8
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listMysqlDatabases"]>>;
7
+ type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listMysqlDatabases"]>>;
9
8
  export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
10
9
  static description: string;
11
10
  static args: {};
@@ -1,5 +1,5 @@
1
1
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
2
- import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
2
+ import { projectFlags } from "../../../lib/project/flags.js";
3
3
  export class List extends ListBaseCommand {
4
4
  static description = "List MySQLDatabases belonging to a Project.";
5
5
  static args = {};
@@ -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, List, this.flags, this.args, this.config);
11
+ const projectId = await this.withProjectId(List);
12
12
  return await this.apiClient.database.listMysqlDatabases({
13
13
  projectId,
14
14
  });
@@ -4,8 +4,7 @@ import { SuccessfulResponse } from "../../../../types.js";
4
4
  import { ListBaseCommand } from "../../../../ListBaseCommand.js";
5
5
  import { ListColumns } from "../../../../Formatter.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2MysqlDatabasesDatabaseIdUsers.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export type PathParams = MittwaldAPIV2.Paths.V2MysqlDatabasesDatabaseIdUsers.Get.Parameters.Path;
8
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listMysqlUsers"]>>;
7
+ type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listMysqlUsers"]>>;
9
8
  export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
10
9
  static description: string;
11
10
  static args: {};
@@ -11,10 +11,9 @@ export class List extends ListBaseCommand {
11
11
  }),
12
12
  };
13
13
  async getData() {
14
- const pathParams = {
14
+ return await this.apiClient.database.listMysqlUsers({
15
15
  databaseId: this.flags["database-id"],
16
- };
17
- return await this.apiClient.database.listMysqlUsers(pathParams);
16
+ });
18
17
  }
19
18
  mapData(data) {
20
19
  return data;
@@ -4,8 +4,7 @@ import { SuccessfulResponse } from "../../../types.js";
4
4
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
5
5
  import { ListColumns } from "../../../Formatter.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2MysqlVersions.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export type PathParams = MittwaldAPIV2.Paths.V2MysqlVersions.Get.Parameters.Path;
8
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listMysqlVersions"]>>;
7
+ type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listMysqlVersions"]>>;
9
8
  export declare class Versions extends ListBaseCommand<typeof Versions, ResponseItem, Response> {
10
9
  static description: string;
11
10
  static args: {};
@@ -6,9 +6,7 @@ export class Versions extends ListBaseCommand {
6
6
  ...ListBaseCommand.baseFlags,
7
7
  };
8
8
  async getData() {
9
- return await this.apiClient.database.listMysqlVersions({
10
- pathParameters: {},
11
- });
9
+ return await this.apiClient.database.listMysqlVersions({});
12
10
  }
13
11
  mapData(data) {
14
12
  return data;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
3
- import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
3
+ import { projectFlags } from "../../../lib/project/flags.js";
4
4
  import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
5
5
  import { Flags } from "@oclif/core";
6
6
  import { assertStatus } from "@mittwald/api-client-commons";
@@ -47,7 +47,7 @@ export class Create extends ExecRenderBaseCommand {
47
47
  };
48
48
  async exec() {
49
49
  const p = makeProcessRenderer(this.flags, "Creating a new Redis database");
50
- const projectId = await withProjectId(this.apiClient, Create, this.flags, this.args, this.config);
50
+ const projectId = await this.withProjectId(Create);
51
51
  const { description, version, "max-memory": maxMemory, "max-memory-policy": maxMemoryPolicy, persistent, } = this.flags;
52
52
  const db = await p.runStep("creating Redis database", async () => {
53
53
  const r = await this.apiClient.database.createRedisDatabase({
@@ -1,6 +1,5 @@
1
- import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
1
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
2
2
  import { GetBaseCommand } from "../../../GetBaseCommand.js";
3
- export type PathParams = MittwaldAPIV2.Paths.V2RedisDatabasesRedisDatabaseId.Get.Parameters.Path;
4
3
  type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["database"]["getRedisDatabase"]>>;
5
4
  export declare class Get extends GetBaseCommand<typeof Get, APIResponse> {
6
5
  static description: string;
@@ -11,6 +10,5 @@ export declare class Get extends GetBaseCommand<typeof Get, APIResponse> {
11
10
  id: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
12
11
  };
13
12
  protected getData(): Promise<APIResponse>;
14
- protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
15
13
  }
16
14
  export {};
@@ -16,7 +16,4 @@ export class Get extends GetBaseCommand {
16
16
  redisDatabaseId: this.args.id,
17
17
  });
18
18
  }
19
- mapParams(input) {
20
- return input;
21
- }
22
19
  }
@@ -4,8 +4,7 @@ import { SuccessfulResponse } from "../../../types.js";
4
4
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
5
5
  import { ListColumns } from "../../../Formatter.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdRedisDatabases.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdRedisDatabases.Get.Parameters.Path;
8
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listRedisDatabases"]>>;
7
+ type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listRedisDatabases"]>>;
9
8
  export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
10
9
  static description: string;
11
10
  static args: {};
@@ -1,5 +1,5 @@
1
1
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
2
- import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
2
+ import { projectFlags } from "../../../lib/project/flags.js";
3
3
  export class List extends ListBaseCommand {
4
4
  static description = "List Redis databases belonging to a project.";
5
5
  static args = {};
@@ -8,10 +8,8 @@ export class List extends ListBaseCommand {
8
8
  ...projectFlags,
9
9
  };
10
10
  async getData() {
11
- const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
12
- return await this.apiClient.database.listRedisDatabases({
13
- projectId,
14
- });
11
+ const projectId = await this.withProjectId(List);
12
+ return await this.apiClient.database.listRedisDatabases({ projectId });
15
13
  }
16
14
  mapData(data) {
17
15
  return data;
@@ -4,8 +4,7 @@ import { SuccessfulResponse } from "../../../types.js";
4
4
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
5
5
  import { ListColumns } from "../../../Formatter.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2RedisVersions.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export type PathParams = MittwaldAPIV2.Paths.V2RedisVersions.Get.Parameters.Path;
8
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listRedisVersions"]>>;
7
+ type Response = Awaited<ReturnType<MittwaldAPIV2Client["database"]["listRedisVersions"]>>;
9
8
  export default class Versions extends ListBaseCommand<typeof Versions, ResponseItem, Response> {
10
9
  static description: string;
11
10
  static args: {};
@@ -1,5 +1,5 @@
1
1
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
2
- import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
2
+ import { projectFlags } from "../../../lib/project/flags.js";
3
3
  export default class Versions extends ListBaseCommand {
4
4
  static description = "List available Redis versions.";
5
5
  static args = {};
@@ -8,9 +8,8 @@ export default class Versions extends ListBaseCommand {
8
8
  ...projectFlags,
9
9
  };
10
10
  async getData() {
11
- const projectId = await withProjectId(this.apiClient, Versions, this.flags, this.args, this.config);
11
+ const projectId = await this.withProjectId(Versions);
12
12
  return await this.apiClient.database.listRedisVersions({
13
- pathParameters: {},
14
13
  queryParameters: { projectId },
15
14
  });
16
15
  }
@@ -1,6 +1,5 @@
1
- import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
1
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
2
2
  import { GetBaseCommand } from "../../../GetBaseCommand.js";
3
- export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdDnsZones.Get.Parameters.Path;
4
3
  type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["domain"]["dnsListDnsZones"]>>;
5
4
  export default class List extends GetBaseCommand<typeof List, APIResponse> {
6
5
  static description: string;
@@ -1,5 +1,5 @@
1
1
  import { GetBaseCommand } from "../../../GetBaseCommand.js";
2
- import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
2
+ import { projectFlags } from "../../../lib/project/flags.js";
3
3
  export default class List extends GetBaseCommand {
4
4
  static description = "gets all dns zones by project id";
5
5
  static flags = {
@@ -8,7 +8,7 @@ export default class List extends GetBaseCommand {
8
8
  };
9
9
  static args = {};
10
10
  async getData() {
11
- const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
11
+ const projectId = await this.withProjectId(List);
12
12
  return await this.apiClient.domain.dnsListDnsZones({
13
13
  projectId,
14
14
  });
@@ -3,8 +3,7 @@ import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
3
3
  import { ListBaseCommand } from "../../ListBaseCommand.js";
4
4
  import { SuccessfulResponse } from "../../types.js";
5
5
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdDomains.Get.Responses.$200.Content.ApplicationJson[number]>;
6
- export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdDomains.Get.Parameters.Path;
7
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["domain"]["listDomains"]>>;
6
+ type Response = Awaited<ReturnType<MittwaldAPIV2Client["domain"]["listDomains"]>>;
8
7
  export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
9
8
  static description: string;
10
9
  static args: {};
@@ -1,5 +1,5 @@
1
1
  import { ListBaseCommand } from "../../ListBaseCommand.js";
2
- import { projectFlags, withProjectId } from "../../lib/project/flags.js";
2
+ import { projectFlags } from "../../lib/project/flags.js";
3
3
  export class List extends ListBaseCommand {
4
4
  static description = "List Domains belonging to a Project.";
5
5
  static args = {};
@@ -8,9 +8,8 @@ export class List extends ListBaseCommand {
8
8
  ...projectFlags,
9
9
  };
10
10
  async getData() {
11
- const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
12
- const pathParams = { projectId };
13
- return await this.apiClient.domain.listDomains(pathParams);
11
+ const projectId = await this.withProjectId(List);
12
+ return await this.apiClient.domain.listDomains({ projectId });
14
13
  }
15
14
  mapData(data) {
16
15
  return data;
@@ -1,5 +1,5 @@
1
1
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
2
- import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
2
+ import { projectFlags } from "../../../lib/project/flags.js";
3
3
  export class List extends ListBaseCommand {
4
4
  static description = "List all domain ownerships of a project.";
5
5
  static args = {};
@@ -8,12 +8,8 @@ export class List extends ListBaseCommand {
8
8
  ...projectFlags,
9
9
  };
10
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
- });
11
+ const projectId = await this.withProjectId(List);
12
+ return await this.apiClient.domain.listDomainOwnerships({ projectId });
17
13
  }
18
14
  mapData(data) {
19
15
  return data;