@mittwald/cli 1.0.0-alpha.33 → 1.0.0-alpha.35

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 (65) hide show
  1. package/README.md +70 -10
  2. package/dist/esm/ExtendedBaseCommand.d.ts +1 -1
  3. package/dist/esm/ListBaseCommand.d.ts +4 -1
  4. package/dist/esm/ListBaseCommand.js +9 -4
  5. package/dist/esm/commands/app/copy.d.ts +0 -1
  6. package/dist/esm/commands/app/dependency/list.js +2 -2
  7. package/dist/esm/commands/app/dependency/update.d.ts +0 -1
  8. package/dist/esm/commands/app/download.d.ts +0 -1
  9. package/dist/esm/commands/app/get.d.ts +0 -1
  10. package/dist/esm/commands/app/list.d.ts +1 -1
  11. package/dist/esm/commands/app/list.js +5 -10
  12. package/dist/esm/commands/app/ssh.d.ts +0 -1
  13. package/dist/esm/commands/app/uninstall.d.ts +0 -1
  14. package/dist/esm/commands/app/versions.js +1 -1
  15. package/dist/esm/commands/backup/list.js +3 -3
  16. package/dist/esm/commands/backup/schedule/list.js +3 -3
  17. package/dist/esm/commands/context/reset.d.ts +6 -0
  18. package/dist/esm/commands/context/reset.js +9 -0
  19. package/dist/esm/commands/context/set.js +5 -6
  20. package/dist/esm/commands/conversation/close.js +2 -2
  21. package/dist/esm/commands/conversation/list.js +2 -2
  22. package/dist/esm/commands/conversation/reply.js +2 -2
  23. package/dist/esm/commands/conversation/show.js +2 -2
  24. package/dist/esm/commands/cronjob/create.d.ts +0 -1
  25. package/dist/esm/commands/cronjob/list.js +4 -4
  26. package/dist/esm/commands/database/mysql/delete.js +2 -2
  27. package/dist/esm/commands/database/mysql/list.js +6 -7
  28. package/dist/esm/commands/database/mysql/user/list.js +6 -4
  29. package/dist/esm/commands/database/redis/list.js +6 -4
  30. package/dist/esm/commands/mail/address/list.d.ts +0 -2
  31. package/dist/esm/commands/mail/address/list.js +1 -7
  32. package/dist/esm/commands/org/list.d.ts +1 -1
  33. package/dist/esm/commands/org/list.js +6 -6
  34. package/dist/esm/commands/project/list.js +5 -8
  35. package/dist/esm/commands/server/list.js +4 -4
  36. package/dist/esm/commands/sftp-user/delete.d.ts +13 -0
  37. package/dist/esm/commands/sftp-user/delete.js +21 -0
  38. package/dist/esm/commands/sftp-user/list.js +6 -4
  39. package/dist/esm/commands/ssh-user/delete.d.ts +13 -0
  40. package/dist/esm/commands/ssh-user/delete.js +21 -0
  41. package/dist/esm/commands/ssh-user/list.js +6 -4
  42. package/dist/esm/lib/app/flags.d.ts +1 -2
  43. package/dist/esm/lib/app/flags.js +4 -14
  44. package/dist/esm/lib/app/uuid.d.ts +39 -3
  45. package/dist/esm/lib/app/uuid.js +66 -33
  46. package/dist/esm/lib/context.d.ts +2 -0
  47. package/dist/esm/lib/context.js +7 -0
  48. package/dist/esm/lib/context_user.d.ts +1 -0
  49. package/dist/esm/lib/context_user.js +15 -1
  50. package/dist/esm/lib/database/mysql/flags.js +1 -1
  51. package/dist/esm/lib/database/redis/flags.js +1 -1
  52. package/dist/esm/lib/domain/dnszone/flags.js +1 -1
  53. package/dist/esm/lib/domain/flags.js +1 -1
  54. package/dist/esm/lib/org/flags.js +2 -2
  55. package/dist/esm/lib/project/flags.js +2 -2
  56. package/dist/esm/lib/project/ingress.js +2 -2
  57. package/dist/esm/lib/server/flags.js +2 -2
  58. package/dist/esm/normalize_id.d.ts +7 -0
  59. package/dist/esm/normalize_id.js +34 -0
  60. package/dist/esm/rendering/react/RenderBaseCommand.d.ts +1 -1
  61. package/package.json +1 -1
  62. package/dist/esm/Helpers.d.ts +0 -7
  63. package/dist/esm/Helpers.js +0 -36
  64. package/dist/esm/Translator.d.ts +0 -9
  65. package/dist/esm/Translator.js +0 -74
package/README.md CHANGED
@@ -144,6 +144,7 @@ USAGE
144
144
  * [`mw backup list`](#mw-backup-list)
145
145
  * [`mw backup schedule list`](#mw-backup-schedule-list)
146
146
  * [`mw context get`](#mw-context-get)
147
+ * [`mw context reset`](#mw-context-reset)
147
148
  * [`mw context set`](#mw-context-set)
148
149
  * [`mw conversation categories`](#mw-conversation-categories)
149
150
  * [`mw conversation close ID`](#mw-conversation-close-id)
@@ -236,7 +237,9 @@ USAGE
236
237
  * [`mw project update [PROJECT-ID]`](#mw-project-update-project-id)
237
238
  * [`mw server get [SERVER-ID]`](#mw-server-get-server-id)
238
239
  * [`mw server list`](#mw-server-list)
240
+ * [`mw sftp-user delete SFTP-USER-ID`](#mw-sftp-user-delete-sftp-user-id)
239
241
  * [`mw sftp-user list`](#mw-sftp-user-list)
242
+ * [`mw ssh-user delete SSH-USER-ID`](#mw-ssh-user-delete-ssh-user-id)
240
243
  * [`mw ssh-user list`](#mw-ssh-user-list)
241
244
  * [`mw update [CHANNEL]`](#mw-update-channel)
242
245
  * [`mw user api-token create`](#mw-user-api-token-create)
@@ -1779,6 +1782,20 @@ DESCRIPTION
1779
1782
  don't have to specify them on every command.
1780
1783
  ```
1781
1784
 
1785
+ ## `mw context reset`
1786
+
1787
+ Reset context values
1788
+
1789
+ ```
1790
+ USAGE
1791
+ $ mw context reset
1792
+
1793
+ DESCRIPTION
1794
+ Reset context values
1795
+
1796
+ This command resets any values for common parameters that you've previously set with 'context set'.
1797
+ ```
1798
+
1782
1799
  ## `mw context set`
1783
1800
 
1784
1801
  Set context values for the current project, org or server
@@ -1938,14 +1955,12 @@ Create a new cron job
1938
1955
 
1939
1956
  ```
1940
1957
  USAGE
1941
- $ mw cronjob create --description <value> --interval <value> [-p <value>] [-i <value>] [-q] [--disable] [--email
1942
- <value>] [--url <value> | --command <value>] [--interpreter <value>]
1958
+ $ mw cronjob create --description <value> --interval <value> [-i <value>] [-q] [--disable] [--email <value>]
1959
+ [--url <value> | --command <value>] [--interpreter <value>]
1943
1960
 
1944
1961
  FLAGS
1945
1962
  -i, --installation-id=<value> ID or short ID of an app installation; this flag is optional if a default app
1946
1963
  installation is set in the context
1947
- -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the
1948
- context
1949
1964
  -q, --quiet suppress process output and only display a machine-readable summary.
1950
1965
  --command=<value> Command to execute for the cron job; either this or `--url` is required.
1951
1966
  --description=<value> (required) Description of the cron job
@@ -1960,15 +1975,10 @@ FLAG DESCRIPTIONS
1960
1975
 
1961
1976
  ID or short ID of an app installation; this flag is optional if a default app installation is set in the context
1962
1977
 
1963
- May contain a short ID or a full ID of an app installation.; you can also use the "mw context set
1978
+ May contain a short ID or a full ID of an app installation; you can also use the "mw context set
1964
1979
  --installation-id=<VALUE>" command to persistently set a default app installation for all commands that accept this
1965
1980
  flag.
1966
1981
 
1967
- -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the context
1968
-
1969
- May contain a short ID or a full ID of a project; you can also use the "mw context set --project-id=<VALUE>" command
1970
- to persistently set a default project for all commands that accept this flag.
1971
-
1972
1982
  -q, --quiet suppress process output and only display a machine-readable summary.
1973
1983
 
1974
1984
  This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in
@@ -4176,6 +4186,31 @@ DESCRIPTION
4176
4186
  List servers for an organization or user.
4177
4187
  ```
4178
4188
 
4189
+ ## `mw sftp-user delete SFTP-USER-ID`
4190
+
4191
+ Delete an SFTP user
4192
+
4193
+ ```
4194
+ USAGE
4195
+ $ mw sftp-user delete SFTP-USER-ID [-q] [-f]
4196
+
4197
+ ARGUMENTS
4198
+ SFTP-USER-ID The ID of the SFTP user to delete
4199
+
4200
+ FLAGS
4201
+ -f, --force Do not ask for confirmation
4202
+ -q, --quiet suppress process output and only display a machine-readable summary.
4203
+
4204
+ DESCRIPTION
4205
+ Delete an SFTP user
4206
+
4207
+ FLAG DESCRIPTIONS
4208
+ -q, --quiet suppress process output and only display a machine-readable summary.
4209
+
4210
+ This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in
4211
+ scripts), you can use this flag to easily get the IDs of created resources for further processing.
4212
+ ```
4213
+
4179
4214
  ## `mw sftp-user list`
4180
4215
 
4181
4216
  List all SFTP users for a project.
@@ -4209,6 +4244,31 @@ FLAG DESCRIPTIONS
4209
4244
  to persistently set a default project for all commands that accept this flag.
4210
4245
  ```
4211
4246
 
4247
+ ## `mw ssh-user delete SSH-USER-ID`
4248
+
4249
+ Delete an SSH user
4250
+
4251
+ ```
4252
+ USAGE
4253
+ $ mw ssh-user delete SSH-USER-ID [-q] [-f]
4254
+
4255
+ ARGUMENTS
4256
+ SSH-USER-ID The ID of the SSH user to delete
4257
+
4258
+ FLAGS
4259
+ -f, --force Do not ask for confirmation
4260
+ -q, --quiet suppress process output and only display a machine-readable summary.
4261
+
4262
+ DESCRIPTION
4263
+ Delete an SSH user
4264
+
4265
+ FLAG DESCRIPTIONS
4266
+ -q, --quiet suppress process output and only display a machine-readable summary.
4267
+
4268
+ This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in
4269
+ scripts), you can use this flag to easily get the IDs of created resources for further processing.
4270
+ ```
4271
+
4212
4272
  ## `mw ssh-user list`
4213
4273
 
4214
4274
  List all SSH users for a project.
@@ -5,7 +5,7 @@ export declare abstract class ExtendedBaseCommand<T extends typeof BaseCommand>
5
5
  protected flags: CommandFlags<T>;
6
6
  protected args: CommandArgs<T>;
7
7
  init(): Promise<void>;
8
- withAppInstallationId(command: CommandType<"installation" | "project"> | "flag" | "arg"): Promise<string>;
8
+ withAppInstallationId(command: CommandType<"installation"> | "flag" | "arg"): Promise<string>;
9
9
  withProjectId(command: CommandType<"project"> | "flag" | "arg"): Promise<string>;
10
10
  withServerId(command: CommandType<"server"> | "flag" | "arg"): Promise<string>;
11
11
  }
@@ -6,6 +6,9 @@ import { SuccessfulResponse } from "./types.js";
6
6
  import { ExtendedBaseCommand } from "./ExtendedBaseCommand.js";
7
7
  export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof ListBaseCommand)["baseFlags"] & T["flags"]>;
8
8
  export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
9
+ export type ColumnOpts<TItem> = {
10
+ shortIdKey?: keyof TItem;
11
+ };
9
12
  export declare abstract class ListBaseCommand<T extends typeof BaseCommand, TItem extends Record<string, unknown>, TAPIResponse extends Response> extends ExtendedBaseCommand<T> {
10
13
  static baseFlags: {
11
14
  [x: string]: Interfaces.Flag<any>;
@@ -15,5 +18,5 @@ export declare abstract class ListBaseCommand<T extends typeof BaseCommand, TIte
15
18
  run(): Promise<void>;
16
19
  protected abstract getData(): Promise<TAPIResponse>;
17
20
  protected abstract mapData(data: SuccessfulResponse<TAPIResponse, 200>["data"]): TItem[] | Promise<TItem[]>;
18
- protected getColumns(data: TItem[]): ListColumns<TItem>;
21
+ protected getColumns(data: TItem[], opts?: ColumnOpts<TItem>): ListColumns<TItem>;
19
22
  }
@@ -24,7 +24,8 @@ export class ListBaseCommand extends ExtendedBaseCommand {
24
24
  const data = await this.mapData(response.data);
25
25
  this.formatter.log(data, this.getColumns(data), { ...this.flags });
26
26
  }
27
- getColumns(data) {
27
+ getColumns(data, opts = {}) {
28
+ const { shortIdKey = "shortId" } = opts;
28
29
  if (data.length === 0) {
29
30
  return {
30
31
  id: {
@@ -40,11 +41,15 @@ export class ListBaseCommand extends ExtendedBaseCommand {
40
41
  minWidth: 36,
41
42
  },
42
43
  };
43
- if ("shortId" in data[0]) {
44
+ if (shortIdKey in data[0]) {
45
+ // If there's a short ID in the data, the actual UUID becomes less useful,
46
+ // so we hide it by default.
47
+ columns.id.header = "UUID";
48
+ columns.id.extended = true;
44
49
  columns = {
45
50
  ...columns,
46
- shortId: {
47
- header: "Short ID",
51
+ [shortIdKey]: {
52
+ header: "ID",
48
53
  minWidth: 8,
49
54
  },
50
55
  };
@@ -6,7 +6,6 @@ type Result = {
6
6
  export declare class Copy extends ExecRenderBaseCommand<typeof Copy, Result> {
7
7
  static description: string;
8
8
  static args: {
9
- "project-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
10
9
  "installation-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
11
10
  };
12
11
  static flags: {
@@ -15,9 +15,9 @@ export class List extends ListBaseCommand {
15
15
  return data;
16
16
  }
17
17
  getColumns(data) {
18
- const baseColumns = super.getColumns(data);
18
+ const { id } = super.getColumns(data);
19
19
  return {
20
- id: baseColumns.id,
20
+ id,
21
21
  name: {},
22
22
  tags: {
23
23
  get: (item) => item.tags.join(", "),
@@ -3,7 +3,6 @@ import { ReactNode } from "react";
3
3
  export default class Update extends ExecRenderBaseCommand<typeof Update, void> {
4
4
  static summary: string;
5
5
  static args: {
6
- "project-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
7
6
  "installation-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
8
7
  };
9
8
  static examples: {
@@ -3,7 +3,6 @@ import { ReactNode } from "react";
3
3
  export declare class Download extends ExecRenderBaseCommand<typeof Download, void> {
4
4
  static description: string;
5
5
  static args: {
6
- "project-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
7
6
  "installation-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
8
7
  };
9
8
  static flags: {
@@ -6,7 +6,6 @@ export default class Get extends RenderBaseCommand<typeof Get> {
6
6
  [x: string]: import("@oclif/core/lib/interfaces/parser.js").Flag<any>;
7
7
  };
8
8
  static args: {
9
- "project-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
10
9
  "installation-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
11
10
  };
12
11
  protected render(): ReactNode;
@@ -19,6 +19,6 @@ export default class List extends ListBaseCommand<typeof List, ResponseItem, Res
19
19
  };
20
20
  protected getData(): Promise<Response>;
21
21
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): Promise<ExtendedResponseItem[]>;
22
- protected getColumns(): ListColumns<ExtendedResponseItem>;
22
+ protected getColumns(rows: ResponseItem[]): ListColumns<ExtendedResponseItem>;
23
23
  }
24
24
  export {};
@@ -1,9 +1,9 @@
1
1
  import { assertStatus } from "@mittwald/api-client-commons";
2
- import { getAppFromUuid, getAppVersionFromUuid } from "../../Translator.js";
3
2
  import { projectFlags, withProjectId } from "../../lib/project/flags.js";
4
3
  import { ListBaseCommand } from "../../ListBaseCommand.js";
5
4
  import { phpInstaller } from "./create/php.js";
6
5
  import { nodeInstaller } from "./create/node.js";
6
+ import { getAppFromUuid, getAppVersionFromUuid } from "../../lib/app/uuid.js";
7
7
  export default class List extends ListBaseCommand {
8
8
  static description = "List installed apps in a project.";
9
9
  static flags = {
@@ -30,16 +30,11 @@ export default class List extends ListBaseCommand {
30
30
  };
31
31
  }));
32
32
  }
33
- getColumns() {
33
+ getColumns(rows) {
34
+ const { id, shortId } = super.getColumns(rows);
34
35
  return {
35
- id: {
36
- header: "ID",
37
- minWidth: 36,
38
- },
39
- shortId: {
40
- header: "Short ID",
41
- minWidth: 8,
42
- },
36
+ id,
37
+ shortId,
43
38
  description: {},
44
39
  app: {
45
40
  header: "Application",
@@ -2,7 +2,6 @@ import { ExtendedBaseCommand } from "../../ExtendedBaseCommand.js";
2
2
  export default class Ssh extends ExtendedBaseCommand<typeof Ssh> {
3
3
  static description: string;
4
4
  static args: {
5
- "project-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
6
5
  "installation-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
7
6
  };
8
7
  static flags: {
@@ -3,7 +3,6 @@ export default class Uninstall extends DeleteBaseCommand<typeof Uninstall> {
3
3
  static description: string;
4
4
  static resourceName: string;
5
5
  static args: {
6
- "project-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
7
6
  "installation-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
8
7
  };
9
8
  protected deleteResource(): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
2
  import { Args } from "@oclif/core";
3
- import { isUuid } from "../../Helpers.js";
3
+ import { isUuid } from "../../normalize_id.js";
4
4
  import { assertStatus } from "@mittwald/api-client-commons";
5
5
  import { getAppNameFromUuid, getAppUuidFromAppName, } from "../../lib/app/uuid.js";
6
6
  export default class AppVersions extends BaseCommand {
@@ -20,11 +20,11 @@ export class List extends ListBaseCommand {
20
20
  });
21
21
  }
22
22
  getColumns(data) {
23
- const baseColumns = super.getColumns(data);
23
+ const { id, createdAt } = super.getColumns(data);
24
24
  return {
25
- id: baseColumns.id,
25
+ id,
26
26
  status: {},
27
- createdAt: baseColumns.createdAt,
27
+ createdAt,
28
28
  expiresIn: {
29
29
  header: "Expires in",
30
30
  get: (r) => formatRelativeDate(r.expiresAt),
@@ -19,13 +19,13 @@ export class List extends ListBaseCommand {
19
19
  return data;
20
20
  }
21
21
  getColumns(data) {
22
- const baseColumns = super.getColumns(data);
22
+ const { id, createdAt } = super.getColumns(data);
23
23
  return {
24
- id: baseColumns.id,
24
+ id,
25
25
  isSystemBackup: { header: "System backup" },
26
26
  schedule: {},
27
27
  ttl: { header: "TTL" },
28
- createdAt: baseColumns.createdAt,
28
+ createdAt,
29
29
  };
30
30
  }
31
31
  }
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from "../../BaseCommand.js";
2
+ export declare class Reset extends BaseCommand {
3
+ static summary: string;
4
+ static description: string;
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,9 @@
1
+ import { Context } from "../../lib/context.js";
2
+ import { BaseCommand } from "../../BaseCommand.js";
3
+ export class Reset extends BaseCommand {
4
+ static summary = "Reset context values";
5
+ static description = "This command resets any values for common parameters that you've previously set with 'context set'.";
6
+ async run() {
7
+ await new Context(this.config).reset();
8
+ }
9
+ }
@@ -1,8 +1,7 @@
1
1
  import { Flags } from "@oclif/core";
2
2
  import { Context } from "../../lib/context.js";
3
3
  import { BaseCommand } from "../../BaseCommand.js";
4
- import { normalizeCustomerIdToUuid, normalizeProjectIdToUuid, normalizeServerIdToUuid, } from "../../Helpers.js";
5
- import { normalizeAppInstallationId } from "../../lib/app/flags.js";
4
+ import { normalizeAppInstallationId, normalizeCustomerId, normalizeProjectId, normalizeServerId, } from "../../normalize_id.js";
6
5
  export class Set extends BaseCommand {
7
6
  static summary = "Set context values for the current project, org or server";
8
7
  static description = "The context allows you to persistently set values for common parameters, like --project-id or --server-id, so you don't have to specify them on every command.";
@@ -25,22 +24,22 @@ export class Set extends BaseCommand {
25
24
  const { flags } = await this.parse(Set);
26
25
  const ctx = new Context(this.config);
27
26
  if (flags["project-id"]) {
28
- const projectId = await normalizeProjectIdToUuid(this.apiClient, flags["project-id"]);
27
+ const projectId = await normalizeProjectId(this.apiClient, flags["project-id"]);
29
28
  await ctx.setProjectId(projectId);
30
29
  this.log(`Set project ID to ${projectId}`);
31
30
  }
32
31
  if (flags["server-id"]) {
33
- const serverId = await normalizeServerIdToUuid(this.apiClient, flags["server-id"]);
32
+ const serverId = await normalizeServerId(this.apiClient, flags["server-id"]);
34
33
  await ctx.setServerId(serverId);
35
34
  this.log(`Set server ID to ${serverId}`);
36
35
  }
37
36
  if (flags["org-id"]) {
38
- const orgId = await normalizeCustomerIdToUuid(this.apiClient, flags["org-id"]);
37
+ const orgId = await normalizeCustomerId(this.apiClient, flags["org-id"]);
39
38
  await ctx.setOrgId(orgId);
40
39
  this.log(`Set organization ID to ${orgId}`);
41
40
  }
42
41
  if (flags["installation-id"]) {
43
- const installationId = await normalizeAppInstallationId(this.apiClient, (await ctx.projectId())?.value ?? "", flags["installation-id"]);
42
+ const installationId = await normalizeAppInstallationId(this.apiClient, flags["installation-id"]);
44
43
  await ctx.setAppInstallationId(installationId);
45
44
  this.log(`Set installation ID to ${installationId}`);
46
45
  }
@@ -1,6 +1,6 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
2
  import { Args, ux } from "@oclif/core";
3
- import { normalizeConversationIdToUuid } from "../../Helpers.js";
3
+ import { normalizeConversationId } from "../../normalize_id.js";
4
4
  import { assertStatus } from "@mittwald/api-client-commons";
5
5
  export default class Close extends BaseCommand {
6
6
  static description = "Close a conversation";
@@ -12,7 +12,7 @@ export default class Close extends BaseCommand {
12
12
  };
13
13
  async run() {
14
14
  const { args } = await this.parse(Close);
15
- const conversationId = await normalizeConversationIdToUuid(this.apiClient, args.id);
15
+ const conversationId = await normalizeConversationId(this.apiClient, args.id);
16
16
  ux.action.start(`closing conversation ${conversationId}`);
17
17
  const response = await this.apiClient.conversation.setConversationStatus({
18
18
  conversationId,
@@ -15,12 +15,12 @@ export default class List extends ListBaseCommand {
15
15
  getColumns() {
16
16
  return {
17
17
  conversationId: {
18
- header: "ID",
18
+ header: "UUID",
19
19
  minWidth: 36,
20
20
  extended: true,
21
21
  },
22
22
  shortId: {
23
- header: "Short ID",
23
+ header: "ID",
24
24
  minWidth: 8,
25
25
  },
26
26
  status: {},
@@ -1,6 +1,6 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
2
  import { Args, ux } from "@oclif/core";
3
- import { normalizeConversationIdToUuid } from "../../Helpers.js";
3
+ import { normalizeConversationId } from "../../normalize_id.js";
4
4
  import { assertStatus } from "@mittwald/api-client-commons";
5
5
  import { messageFlags, retrieveMessage, } from "../../lib/conversation/message_input.js";
6
6
  export default class Reply extends BaseCommand {
@@ -17,7 +17,7 @@ export default class Reply extends BaseCommand {
17
17
  };
18
18
  async run() {
19
19
  const { args, flags } = await this.parse(Reply);
20
- const conversationId = await normalizeConversationIdToUuid(this.apiClient, args.id);
20
+ const conversationId = await normalizeConversationId(this.apiClient, args.id);
21
21
  const messageContent = await retrieveMessage(flags);
22
22
  ux.action.start(`replying to ${conversationId}`);
23
23
  const response = await this.apiClient.conversation.createMessage({
@@ -1,6 +1,6 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
2
  import { Args } from "@oclif/core";
3
- import { normalizeConversationIdToUuid } from "../../Helpers.js";
3
+ import { normalizeConversationId } from "../../normalize_id.js";
4
4
  import { assertStatus } from "@mittwald/api-client-commons";
5
5
  import { formatRelativeDate } from "../../lib/viewhelpers/date.js";
6
6
  import { marked } from "marked";
@@ -17,7 +17,7 @@ export default class Show extends BaseCommand {
17
17
  };
18
18
  async run() {
19
19
  const { args } = await this.parse(Show);
20
- const conversationId = await normalizeConversationIdToUuid(this.apiClient, args.id);
20
+ const conversationId = await normalizeConversationId(this.apiClient, args.id);
21
21
  const [conversationResponse, messagesResponse] = await Promise.all([
22
22
  this.apiClient.conversation.getConversation({
23
23
  conversationId,
@@ -14,7 +14,6 @@ export declare class Create extends ExecRenderBaseCommand<typeof Create, Result>
14
14
  interpreter: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
15
15
  command: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
16
16
  quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
17
- "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
18
17
  "installation-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
19
18
  };
20
19
  protected exec(): Promise<Result>;
@@ -18,10 +18,10 @@ export class List extends ListBaseCommand {
18
18
  return data;
19
19
  }
20
20
  getColumns(data) {
21
- const baseColumns = super.getColumns(data);
21
+ const { id, shortId, createdAt } = super.getColumns(data);
22
22
  return {
23
- id: baseColumns.id,
24
- shortId: baseColumns.shortId,
23
+ id,
24
+ shortId,
25
25
  interval: {},
26
26
  description: {},
27
27
  lastExecution: {
@@ -37,7 +37,7 @@ export class List extends ListBaseCommand {
37
37
  formatRelativeDate(r.latestExecution.start));
38
38
  },
39
39
  },
40
- createdAt: baseColumns.createdAt,
40
+ createdAt,
41
41
  };
42
42
  }
43
43
  }
@@ -1,4 +1,4 @@
1
- import { normalizeProjectIdToUuid } from "../../../Helpers.js";
1
+ import { normalizeProjectId } from "../../../normalize_id.js";
2
2
  import { DeleteBaseCommand } from "../../../DeleteBaseCommand.js";
3
3
  import { mysqlArgs, withMySQLId } from "../../../lib/database/mysql/flags.js";
4
4
  import assertSuccess from "../../../lib/assert_success.js";
@@ -15,6 +15,6 @@ export default class Delete extends DeleteBaseCommand {
15
15
  assertSuccess(response);
16
16
  }
17
17
  mapResourceId(id) {
18
- return normalizeProjectIdToUuid(this.apiClient, id);
18
+ return normalizeProjectId(this.apiClient, id);
19
19
  }
20
20
  }
@@ -17,13 +17,12 @@ export class List extends ListBaseCommand {
17
17
  return data;
18
18
  }
19
19
  getColumns(ignoredData) {
20
- const commonColumns = super.getColumns(ignoredData);
20
+ const { id, name, createdAt } = super.getColumns(ignoredData, {
21
+ shortIdKey: "name",
22
+ });
21
23
  return {
22
- id: commonColumns.id,
23
- name: {
24
- header: "Name",
25
- minWidth: 12,
26
- },
24
+ id,
25
+ name,
27
26
  version: {
28
27
  header: "Version",
29
28
  },
@@ -52,7 +51,7 @@ export class List extends ListBaseCommand {
52
51
  get: (row) => row.characterSettings?.collation,
53
52
  extended: true,
54
53
  },
55
- createdAt: commonColumns.createdAt,
54
+ createdAt,
56
55
  };
57
56
  }
58
57
  }
@@ -19,10 +19,12 @@ export class List extends ListBaseCommand {
19
19
  return data;
20
20
  }
21
21
  getColumns(data) {
22
- const baseColumns = super.getColumns(data);
22
+ const { id, name, createdAt } = super.getColumns(data, {
23
+ shortIdKey: "name",
24
+ });
23
25
  return {
24
- id: baseColumns.id,
25
- name: {},
26
+ id,
27
+ name,
26
28
  description: {},
27
29
  mainUser: {
28
30
  header: "Main user",
@@ -33,7 +35,7 @@ export class List extends ListBaseCommand {
33
35
  header: "External access",
34
36
  get: (i) => (i.externalAccess ? "yes" : "no"),
35
37
  },
36
- createdAt: baseColumns.createdAt,
38
+ createdAt,
37
39
  };
38
40
  }
39
41
  }
@@ -15,14 +15,16 @@ export class List extends ListBaseCommand {
15
15
  return data;
16
16
  }
17
17
  getColumns(data) {
18
- const baseColumns = super.getColumns(data);
18
+ const { id, name, createdAt } = super.getColumns(data, {
19
+ shortIdKey: "name",
20
+ });
19
21
  return {
20
- id: baseColumns.id,
21
- name: {},
22
+ id,
23
+ name,
22
24
  version: {},
23
25
  description: {},
24
26
  hostname: {},
25
- createdAt: baseColumns.createdAt,
27
+ createdAt,
26
28
  };
27
29
  }
28
30
  }
@@ -4,7 +4,6 @@ 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.V2ProjectsProjectIdMailAddresses.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdMailAddresses.Get.Parameters.Path;
8
7
  type Response = Awaited<ReturnType<MittwaldAPIV2Client["mail"]["listMailAddresses"]>>;
9
8
  export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
10
9
  static description: string;
@@ -14,7 +13,6 @@ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Res
14
13
  };
15
14
  getData(): Promise<Response>;
16
15
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MailMailAddress[];
17
- protected mapParams(input: PathParams): Promise<PathParams>;
18
16
  protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
19
17
  }
20
18
  export {};
@@ -1,7 +1,7 @@
1
1
  import { formatRelativeDate } from "../../../lib/viewhelpers/date.js";
2
2
  import { formatBytes } from "../../../lib/viewhelpers/size.js";
3
3
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
4
- import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
4
+ import { projectFlags } from "../../../lib/project/flags.js";
5
5
  export class List extends ListBaseCommand {
6
6
  static description = "Get all mail addresses for a project ID";
7
7
  static args = {};
@@ -16,12 +16,6 @@ export class List extends ListBaseCommand {
16
16
  mapData(data) {
17
17
  return data;
18
18
  }
19
- async mapParams(input) {
20
- return {
21
- ...input,
22
- projectId: await withProjectId(this.apiClient, List, this.flags, this.args, this.config),
23
- };
24
- }
25
19
  getColumns(data) {
26
20
  const baseColumns = super.getColumns(data);
27
21
  return {
@@ -15,6 +15,6 @@ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Res
15
15
  getData(): Promise<Response>;
16
16
  protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
17
17
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.CustomerCustomer[];
18
- protected getColumns(): ListColumns<ResponseItem>;
18
+ protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
19
19
  }
20
20
  export {};