@mittwald/cli 1.0.0-alpha.3 → 1.0.0-alpha.4

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 (89) hide show
  1. package/README.md +490 -749
  2. package/dist/esm/commands/app/dependency/getSystemsoftware.d.ts +3 -0
  3. package/dist/esm/commands/app/{getSystemsoftware.js → dependency/getSystemsoftware.js} +1 -1
  4. package/dist/esm/commands/app/dependency/getSystemsoftwareversion.d.ts +3 -0
  5. package/dist/esm/commands/app/{getSystemsoftwareversion.js → dependency/getSystemsoftwareversion.js} +1 -1
  6. package/dist/esm/commands/app/{listSystemsoftwares.d.ts → dependency/listSystemsoftwares.d.ts} +2 -2
  7. package/dist/esm/commands/app/{listSystemsoftwares.js → dependency/listSystemsoftwares.js} +1 -1
  8. package/dist/esm/commands/app/{listSystemsoftwareversions.d.ts → dependency/listSystemsoftwareversions.d.ts} +3 -3
  9. package/dist/esm/commands/app/{listSystemsoftwareversions.js → dependency/listSystemsoftwareversions.js} +1 -1
  10. package/dist/esm/commands/app/install/wordpress.d.ts +15 -0
  11. package/dist/esm/commands/app/install/wordpress.js +80 -0
  12. package/dist/esm/commands/app/versions.d.ts +12 -0
  13. package/dist/esm/commands/app/versions.js +53 -0
  14. package/dist/esm/commands/domain/dnszone/get.d.ts +3 -0
  15. package/dist/esm/commands/domain/{dnsZoneGetSpecific.js → dnszone/get.js} +1 -1
  16. package/dist/esm/commands/domain/dnszone/list.d.ts +3 -0
  17. package/dist/esm/commands/domain/{dnsZonesForProject.js → dnszone/list.js} +1 -1
  18. package/dist/esm/commands/domain/{getSpecificDomainOwnership.d.ts → ownership/get.d.ts} +1 -1
  19. package/dist/esm/commands/domain/{getSpecificDomainOwnership.js → ownership/get.js} +1 -1
  20. package/dist/esm/commands/domain/{listDomainOwnerships.d.ts → ownership/list.d.ts} +2 -2
  21. package/dist/esm/commands/domain/{listDomainOwnerships.js → ownership/list.js} +1 -1
  22. package/dist/esm/commands/org/invite/get.d.ts +3 -0
  23. package/dist/esm/commands/{customer/getCustomerInvite.js → org/invite/get.js} +1 -1
  24. package/dist/esm/commands/{customer/listCustomerInvites.d.ts → org/invite/list-own.d.ts} +2 -2
  25. package/dist/esm/commands/{customer/listCustomerInvites.js → org/invite/list-own.js} +1 -1
  26. package/dist/esm/commands/{customer/listInvitesForCustomer.d.ts → org/invite/list.d.ts} +2 -2
  27. package/dist/esm/commands/{customer/listInvitesForCustomer.js → org/invite/list.js} +1 -1
  28. package/dist/esm/commands/{customer/listCustomers.d.ts → org/list.d.ts} +2 -0
  29. package/dist/esm/commands/org/list.js +28 -0
  30. package/dist/esm/commands/org/membership/get.d.ts +3 -0
  31. package/dist/esm/commands/{customer/getCustomerMembership.js → org/membership/get.js} +1 -1
  32. package/dist/esm/commands/{customer/listCustomerMemberships.d.ts → org/membership/list-own.d.ts} +2 -2
  33. package/dist/esm/commands/{customer/listCustomerMemberships.js → org/membership/list-own.js} +1 -1
  34. package/dist/esm/commands/{customer/listMembershipsForCustomer.d.ts → org/membership/list.d.ts} +2 -2
  35. package/dist/esm/commands/{customer/listMembershipsForCustomer.js → org/membership/list.js} +1 -1
  36. package/dist/esm/commands/project/cronjob/execution/get.d.ts +3 -0
  37. package/dist/esm/commands/{cronjob/getExecution.js → project/cronjob/execution/get.js} +1 -1
  38. package/dist/esm/commands/{cronjob/listExecutions.d.ts → project/cronjob/execution/list.d.ts} +4 -2
  39. package/dist/esm/commands/project/cronjob/execution/list.js +22 -0
  40. package/dist/esm/commands/project/cronjob/get.d.ts +3 -0
  41. package/dist/esm/commands/{cronjob/getCronjob.js → project/cronjob/get.js} +1 -1
  42. package/dist/esm/commands/{cronjob/listCronjobs.d.ts → project/cronjob/list.d.ts} +4 -2
  43. package/dist/esm/commands/project/cronjob/list.js +26 -0
  44. package/dist/esm/lib/app/appHelpers.d.ts +4 -0
  45. package/dist/esm/lib/app/appHelpers.js +43 -0
  46. package/dist/esm/lib/app/appVersionHelpers.d.ts +5 -0
  47. package/dist/esm/lib/app/appVersionHelpers.js +35 -0
  48. package/package.json +3 -1
  49. package/dist/esm/commands/app/getApp.d.ts +0 -3
  50. package/dist/esm/commands/app/getApp.js +0 -6
  51. package/dist/esm/commands/app/getAppversion.d.ts +0 -3
  52. package/dist/esm/commands/app/getAppversion.js +0 -6
  53. package/dist/esm/commands/app/getSystemsoftware.d.ts +0 -3
  54. package/dist/esm/commands/app/getSystemsoftwareversion.d.ts +0 -3
  55. package/dist/esm/commands/app/listAppinstallations.d.ts +0 -9
  56. package/dist/esm/commands/app/listAppinstallations.js +0 -6
  57. package/dist/esm/commands/app/listApps.d.ts +0 -9
  58. package/dist/esm/commands/app/listApps.js +0 -6
  59. package/dist/esm/commands/app/listAppversions.d.ts +0 -9
  60. package/dist/esm/commands/app/listAppversions.js +0 -6
  61. package/dist/esm/commands/app/retrieveStatus.d.ts +0 -3
  62. package/dist/esm/commands/app/retrieveStatus.js +0 -6
  63. package/dist/esm/commands/cronjob/getCronjob.d.ts +0 -3
  64. package/dist/esm/commands/cronjob/getExecution.d.ts +0 -3
  65. package/dist/esm/commands/cronjob/listCronjobs.js +0 -6
  66. package/dist/esm/commands/cronjob/listExecutions.js +0 -6
  67. package/dist/esm/commands/customer/getCustomerCategory.d.ts +0 -3
  68. package/dist/esm/commands/customer/getCustomerCategory.js +0 -6
  69. package/dist/esm/commands/customer/getCustomerInvite.d.ts +0 -3
  70. package/dist/esm/commands/customer/getCustomerMembership.d.ts +0 -3
  71. package/dist/esm/commands/customer/getCustomerTokenInvite.d.ts +0 -3
  72. package/dist/esm/commands/customer/getCustomerTokenInvite.js +0 -6
  73. package/dist/esm/commands/customer/listCustomers.js +0 -6
  74. package/dist/esm/commands/customer/listOfCustomerCategories.d.ts +0 -9
  75. package/dist/esm/commands/customer/listOfCustomerCategories.js +0 -6
  76. package/dist/esm/commands/domain/dnsZoneGetSpecific.d.ts +0 -3
  77. package/dist/esm/commands/domain/dnsZonesForProject.d.ts +0 -3
  78. /package/dist/esm/commands/app/{getAppinstallation.d.ts → get.d.ts} +0 -0
  79. /package/dist/esm/commands/app/{getAppinstallation.js → get.js} +0 -0
  80. /package/dist/esm/commands/article/{getArticle.d.ts → get.d.ts} +0 -0
  81. /package/dist/esm/commands/article/{getArticle.js → get.js} +0 -0
  82. /package/dist/esm/commands/article/{listArticles.d.ts → list.d.ts} +0 -0
  83. /package/dist/esm/commands/article/{listArticles.js → list.js} +0 -0
  84. /package/dist/esm/commands/domain/{getHandleFields.d.ts → get-handle.d.ts} +0 -0
  85. /package/dist/esm/commands/domain/{getHandleFields.js → get-handle.js} +0 -0
  86. /package/dist/esm/commands/{customer/isCustomerLegallyCompetent.d.ts → org/can-order.d.ts} +0 -0
  87. /package/dist/esm/commands/{customer/isCustomerLegallyCompetent.js → org/can-order.js} +0 -0
  88. /package/dist/esm/commands/{customer/getCustomer.d.ts → org/get.d.ts} +0 -0
  89. /package/dist/esm/commands/{customer/getCustomer.js → org/get.js} +0 -0
@@ -0,0 +1,3 @@
1
+ import { GeneratedAppGetSystemsoftware } from "../../../generated/app/getSystemsoftware.js";
2
+ export default class Get extends GeneratedAppGetSystemsoftware {
3
+ }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
3
  /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedAppGetSystemsoftware } from "../../generated/app/getSystemsoftware.js";
4
+ import { GeneratedAppGetSystemsoftware } from "../../../generated/app/getSystemsoftware.js";
5
5
  export default class Get extends GeneratedAppGetSystemsoftware {
6
6
  }
@@ -0,0 +1,3 @@
1
+ import { GeneratedAppGetSystemsoftwareversion } from "../../../generated/app/getSystemsoftwareversion.js";
2
+ export default class Get extends GeneratedAppGetSystemsoftwareversion {
3
+ }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
3
  /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedAppGetSystemsoftwareversion } from "../../generated/app/getSystemsoftwareversion.js";
4
+ import { GeneratedAppGetSystemsoftwareversion } from "../../../generated/app/getSystemsoftwareversion.js";
5
5
  export default class Get extends GeneratedAppGetSystemsoftwareversion {
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedAppListSystemsoftwares, Response } from "../../generated/app/listSystemsoftwares.js";
3
+ import { SuccessfulResponse } from "../../../types.js";
4
+ import { GeneratedAppListSystemsoftwares, Response } from "../../../generated/app/listSystemsoftwares.js";
5
5
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2Systemsoftwares.Get.Responses.$200.Content.ApplicationJson[number]>;
6
6
  export default class List extends GeneratedAppListSystemsoftwares<ResponseItem> {
7
7
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.AppSystemSoftware[];
@@ -1,4 +1,4 @@
1
- import { GeneratedAppListSystemsoftwares, } from "../../generated/app/listSystemsoftwares.js";
1
+ import { GeneratedAppListSystemsoftwares, } from "../../../generated/app/listSystemsoftwares.js";
2
2
  export default class List extends GeneratedAppListSystemsoftwares {
3
3
  mapData(data) {
4
4
  return data;
@@ -1,7 +1,7 @@
1
- import { Simplify } from "@mittwald/api-client-commons";
1
+ import { Simplify } from '@mittwald/api-client-commons';
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedAppListSystemsoftwareversions, Response } from "../../generated/app/listSystemsoftwareversions.js";
3
+ import { SuccessfulResponse } from "../../../types.js";
4
+ import { GeneratedAppListSystemsoftwareversions, Response } from "../../../generated/app/listSystemsoftwareversions.js";
5
5
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2SystemsoftwareSystemSoftwareIdVersions.Get.Responses.$200.Content.ApplicationJson[number]>;
6
6
  export default class List extends GeneratedAppListSystemsoftwareversions<ResponseItem> {
7
7
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.AppSystemSoftwareVersion[];
@@ -1,4 +1,4 @@
1
- import { GeneratedAppListSystemsoftwareversions, } from "../../generated/app/listSystemsoftwareversions.js";
1
+ import { GeneratedAppListSystemsoftwareversions, } from "../../../generated/app/listSystemsoftwareversions.js";
2
2
  export default class List extends GeneratedAppListSystemsoftwareversions {
3
3
  mapData(data) {
4
4
  return data;
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from "../../../BaseCommand.js";
2
+ export default class AppCreateWordpress extends BaseCommand<typeof AppCreateWordpress> {
3
+ static description: string;
4
+ static flags: {
5
+ "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
+ host: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
+ "admin-user": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
+ "admin-email": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
+ "admin-pass": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
+ "site-title": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
+ wait: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,80 @@
1
+ import { Flags, ux } from "@oclif/core";
2
+ import { BaseCommand } from "../../../BaseCommand.js";
3
+ import { getAppUuidFromAppName } from "../../../lib/app/appHelpers.js";
4
+ import { getLatestAvailableAppVersionForApp, getAppVersionUuidFromAppVersion, } from "../../../lib/app/appVersionHelpers.js";
5
+ import { assertStatus } from "@mittwald/api-client-commons";
6
+ import { normalizeProjectIdToUuid } from "../../../Helpers.js";
7
+ export default class AppCreateWordpress extends BaseCommand {
8
+ static description = "Creates new WordPress Installation.";
9
+ static flags = {
10
+ "project-id": Flags.string({
11
+ char: "p",
12
+ required: true,
13
+ description: "ID of the Project, in which the App will be created.",
14
+ }),
15
+ version: Flags.string({
16
+ required: false,
17
+ description: "Version of the App to be created - Defaults to latest",
18
+ }),
19
+ host: Flags.string({
20
+ required: true,
21
+ description: "Host under which the App will be available (Needs to be created separately).",
22
+ }),
23
+ "admin-user": Flags.string({
24
+ required: true,
25
+ description: "First Admin User for the app.",
26
+ }),
27
+ "admin-email": Flags.string({
28
+ required: true,
29
+ description: "First Admin Users E-Mail.",
30
+ }),
31
+ "admin-pass": Flags.string({
32
+ required: true,
33
+ description: "First Admin Users Password.",
34
+ }),
35
+ "site-title": Flags.string({
36
+ required: true,
37
+ description: "Site Title of the created appInstallation.",
38
+ }),
39
+ wait: Flags.boolean({
40
+ char: "w",
41
+ description: "Wait for the App to be ready.",
42
+ }),
43
+ };
44
+ async run() {
45
+ ux.action.start("requesting installation for WordPress");
46
+ const { flags } = await this.parse(AppCreateWordpress);
47
+ const app = "WordPress";
48
+ const appUuid = await getAppUuidFromAppName(this.apiClient, app);
49
+ const projectId = await normalizeProjectIdToUuid(this.apiClient, flags["project-id"]);
50
+ let appVersion;
51
+ if (flags.version) {
52
+ appVersion = await getAppVersionUuidFromAppVersion(this.apiClient, appUuid, flags.version);
53
+ }
54
+ else {
55
+ appVersion = await getLatestAvailableAppVersionForApp(this.apiClient, appUuid);
56
+ }
57
+ if (!appVersion) {
58
+ this.log("App Version ${flags.version} not found.");
59
+ ux.exit(1);
60
+ }
61
+ const result = await this.apiClient.app.requestAppinstallation({
62
+ pathParameters: { projectId },
63
+ data: {
64
+ appVersionId: appVersion.id,
65
+ description: flags["site-title"],
66
+ updatePolicy: "none",
67
+ userInputs: [
68
+ { name: "host", value: flags.host },
69
+ { name: "site_title", value: flags["site-title"] },
70
+ { name: "admin_user", value: flags["admin-user"] },
71
+ { name: "admin_email", value: flags["admin-email"] },
72
+ { name: "admin_pass", value: flags["admin-pass"] },
73
+ ],
74
+ },
75
+ });
76
+ assertStatus(result, 201);
77
+ ux.action.stop("created");
78
+ this.log(result.data.id);
79
+ }
80
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from "../../BaseCommand.js";
2
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
3
+ export default class AppVersions extends BaseCommand<typeof AppVersions> {
4
+ static description: string;
5
+ static args: {
6
+ app: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<void>;
9
+ protected getApp(apiClient: MittwaldAPIV2Client, appId: string): Promise<string[]>;
10
+ protected getAllApps(apiClient: MittwaldAPIV2Client): Promise<string[]>;
11
+ protected outputVersionsForAppUuid(apiClient: MittwaldAPIV2Client, appUuid: string): Promise<void>;
12
+ }
@@ -0,0 +1,53 @@
1
+ import { BaseCommand } from "../../BaseCommand.js";
2
+ import { Args } from "@oclif/core";
3
+ import { isUuid } from "../../Helpers.js";
4
+ import { assertStatus } from "@mittwald/api-client-commons";
5
+ import { getAppNameFromUuid, getAppUuidFromAppName, } from "../../lib/app/appHelpers.js";
6
+ export default class AppVersions extends BaseCommand {
7
+ static description = "List supported Apps and Versions";
8
+ static args = {
9
+ app: Args.string({
10
+ description: "name of specific app to get versions for",
11
+ required: false,
12
+ }),
13
+ };
14
+ async run() {
15
+ const { args } = await this.parse(AppVersions);
16
+ const AppUuidsToGetVersionsFor = args.app
17
+ ? await this.getApp(this.apiClient, args.app)
18
+ : await this.getAllApps(this.apiClient);
19
+ for (const appUuid of AppUuidsToGetVersionsFor) {
20
+ console.log(`Available ${await getAppNameFromUuid(this.apiClient, appUuid)} Versions:`);
21
+ await this.outputVersionsForAppUuid(this.apiClient, appUuid);
22
+ console.log("");
23
+ }
24
+ }
25
+ async getApp(apiClient, appId) {
26
+ let appUuid;
27
+ if (isUuid(appId)) {
28
+ appUuid = appId;
29
+ }
30
+ else {
31
+ appUuid = await getAppUuidFromAppName(apiClient, appId);
32
+ }
33
+ return [appUuid];
34
+ }
35
+ async getAllApps(apiClient) {
36
+ const apps = await apiClient.app.listApps();
37
+ assertStatus(apps, 200);
38
+ const appUuids = [];
39
+ for (const app of apps.data) {
40
+ appUuids.push(app.id);
41
+ }
42
+ return appUuids;
43
+ }
44
+ async outputVersionsForAppUuid(apiClient, appUuid) {
45
+ const versions = await apiClient.app.listAppversions({
46
+ pathParameters: { appId: appUuid },
47
+ });
48
+ assertStatus(versions, 200);
49
+ for (const version of versions.data) {
50
+ console.log(version.externalVersion);
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,3 @@
1
+ import { GeneratedDnsZoneGetSpecific } from "../../../generated/domain/dnsZoneGetSpecific.js";
2
+ export default class Get extends GeneratedDnsZoneGetSpecific {
3
+ }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
3
  /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedDnsZoneGetSpecific } from "../../generated/domain/dnsZoneGetSpecific.js";
4
+ import { GeneratedDnsZoneGetSpecific } from "../../../generated/domain/dnsZoneGetSpecific.js";
5
5
  export default class Get extends GeneratedDnsZoneGetSpecific {
6
6
  }
@@ -0,0 +1,3 @@
1
+ import { GeneratedDnsZonesForProject } from "../../../generated/domain/dnsZonesForProject.js";
2
+ export default class Get extends GeneratedDnsZonesForProject {
3
+ }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
3
  /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedDnsZonesForProject } from "../../generated/domain/dnsZonesForProject.js";
4
+ import { GeneratedDnsZonesForProject } from "../../../generated/domain/dnsZonesForProject.js";
5
5
  export default class Get extends GeneratedDnsZonesForProject {
6
6
  }
@@ -1,3 +1,3 @@
1
- import { GeneratedDomainGetSpecificDomainOwnership } from "../../generated/domain/getSpecificDomainOwnership.js";
1
+ import { GeneratedDomainGetSpecificDomainOwnership } from "../../../generated/domain/getSpecificDomainOwnership.js";
2
2
  export default class Get extends GeneratedDomainGetSpecificDomainOwnership {
3
3
  }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
3
  /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedDomainGetSpecificDomainOwnership } from "../../generated/domain/getSpecificDomainOwnership.js";
4
+ import { GeneratedDomainGetSpecificDomainOwnership } from "../../../generated/domain/getSpecificDomainOwnership.js";
5
5
  export default class Get extends GeneratedDomainGetSpecificDomainOwnership {
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedDomainListDomainOwnerships, Response } from "../../generated/domain/listDomainOwnerships.js";
3
+ import { SuccessfulResponse } from "../../../types.js";
4
+ import { GeneratedDomainListDomainOwnerships, Response } from "../../../generated/domain/listDomainOwnerships.js";
5
5
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdDomainOwnerships.Get.Responses.$200.Content.ApplicationJson[number]>;
6
6
  export default class List extends GeneratedDomainListDomainOwnerships<ResponseItem> {
7
7
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.DomainDomainOwnership[];
@@ -1,4 +1,4 @@
1
- import { GeneratedDomainListDomainOwnerships, } from "../../generated/domain/listDomainOwnerships.js";
1
+ import { GeneratedDomainListDomainOwnerships, } from "../../../generated/domain/listDomainOwnerships.js";
2
2
  export default class List extends GeneratedDomainListDomainOwnerships {
3
3
  mapData(data) {
4
4
  return data;
@@ -0,0 +1,3 @@
1
+ import { GeneratedCustomerGetCustomerInvite } from "../../../generated/customer/getCustomerInvite.js";
2
+ export default class Get extends GeneratedCustomerGetCustomerInvite {
3
+ }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
3
  /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedCustomerGetCustomerInvite } from "../../generated/customer/getCustomerInvite.js";
4
+ import { GeneratedCustomerGetCustomerInvite } from "../../../generated/customer/getCustomerInvite.js";
5
5
  export default class Get extends GeneratedCustomerGetCustomerInvite {
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedCustomerListCustomerInvites, Response } from "../../generated/customer/listCustomerInvites.js";
3
+ import { SuccessfulResponse } from "../../../types.js";
4
+ import { GeneratedCustomerListCustomerInvites, Response } from "../../../generated/customer/listCustomerInvites.js";
5
5
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2CustomerInvites.Get.Responses.$200.Content.ApplicationJson[number]>;
6
6
  export default class List extends GeneratedCustomerListCustomerInvites<ResponseItem> {
7
7
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MembershipCustomerInvite[];
@@ -1,4 +1,4 @@
1
- import { GeneratedCustomerListCustomerInvites, } from "../../generated/customer/listCustomerInvites.js";
1
+ import { GeneratedCustomerListCustomerInvites, } from "../../../generated/customer/listCustomerInvites.js";
2
2
  export default class List extends GeneratedCustomerListCustomerInvites {
3
3
  mapData(data) {
4
4
  return data;
@@ -1,7 +1,7 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedCustomerListInvitesForCustomer, Response } from "../../generated/customer/listInvitesForCustomer.js";
3
+ import { SuccessfulResponse } from "../../../types.js";
4
+ import { GeneratedCustomerListInvitesForCustomer, Response } from "../../../generated/customer/listInvitesForCustomer.js";
5
5
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2CustomersCustomerIdInvites.Get.Responses.$200.Content.ApplicationJson[number]>;
6
6
  export default class List extends GeneratedCustomerListInvitesForCustomer<ResponseItem> {
7
7
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MembershipCustomerInvite[];
@@ -1,4 +1,4 @@
1
- import { GeneratedCustomerListInvitesForCustomer, } from "../../generated/customer/listInvitesForCustomer.js";
1
+ import { GeneratedCustomerListInvitesForCustomer, } from "../../../generated/customer/listInvitesForCustomer.js";
2
2
  export default class List extends GeneratedCustomerListInvitesForCustomer {
3
3
  mapData(data) {
4
4
  return data;
@@ -2,8 +2,10 @@ import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
3
  import { SuccessfulResponse } from "../../types.js";
4
4
  import { GeneratedCustomerListCustomers, Response } from "../../generated/customer/listCustomers.js";
5
+ import { ListColumns } from "../../Formatter.js";
5
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2Customers.Get.Responses.$200.Content.ApplicationJson[number]>;
6
7
  export default class List extends GeneratedCustomerListCustomers<ResponseItem> {
7
8
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.CustomerCustomer[];
9
+ protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
8
10
  }
9
11
  export {};
@@ -0,0 +1,28 @@
1
+ import { GeneratedCustomerListCustomers, } from "../../generated/customer/listCustomers.js";
2
+ export default class List extends GeneratedCustomerListCustomers {
3
+ mapData(data) {
4
+ return data;
5
+ }
6
+ getColumns(data) {
7
+ return {
8
+ id: {
9
+ get: (r) => r.customerId,
10
+ minWidth: 36,
11
+ },
12
+ name: {},
13
+ owner: {
14
+ get: (r) => {
15
+ if (!r.owner) {
16
+ return "not set";
17
+ }
18
+ if (r.owner.company) {
19
+ return `${r.owner.firstName} ${r.owner.lastName}, ${r.owner.company}`;
20
+ }
21
+ return `${r.owner.firstName} ${r.owner.lastName}`;
22
+ }
23
+ },
24
+ memberCount: { header: "Members" },
25
+ projectCount: { header: "Projects" },
26
+ };
27
+ }
28
+ }
@@ -0,0 +1,3 @@
1
+ import { GeneratedCustomerGetCustomerMembership } from "../../../generated/customer/getCustomerMembership.js";
2
+ export default class Get extends GeneratedCustomerGetCustomerMembership {
3
+ }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
3
  /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedCustomerGetCustomerMembership } from "../../generated/customer/getCustomerMembership.js";
4
+ import { GeneratedCustomerGetCustomerMembership } from "../../../generated/customer/getCustomerMembership.js";
5
5
  export default class Get extends GeneratedCustomerGetCustomerMembership {
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedCustomerListCustomerMemberships, Response } from "../../generated/customer/listCustomerMemberships.js";
3
+ import { SuccessfulResponse } from "../../../types.js";
4
+ import { GeneratedCustomerListCustomerMemberships, Response } from "../../../generated/customer/listCustomerMemberships.js";
5
5
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2CustomerMemberships.Get.Responses.$200.Content.ApplicationJson[number]>;
6
6
  export default class List extends GeneratedCustomerListCustomerMemberships<ResponseItem> {
7
7
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MembershipCustomerMembership[];
@@ -1,4 +1,4 @@
1
- import { GeneratedCustomerListCustomerMemberships, } from "../../generated/customer/listCustomerMemberships.js";
1
+ import { GeneratedCustomerListCustomerMemberships, } from "../../../generated/customer/listCustomerMemberships.js";
2
2
  export default class List extends GeneratedCustomerListCustomerMemberships {
3
3
  mapData(data) {
4
4
  return data;
@@ -1,7 +1,7 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedCustomerListMembershipsForCustomer, Response } from "../../generated/customer/listMembershipsForCustomer.js";
3
+ import { SuccessfulResponse } from "../../../types.js";
4
+ import { GeneratedCustomerListMembershipsForCustomer, Response } from "../../../generated/customer/listMembershipsForCustomer.js";
5
5
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2CustomersCustomerIdMemberships.Get.Responses.$200.Content.ApplicationJson[number]>;
6
6
  export default class List extends GeneratedCustomerListMembershipsForCustomer<ResponseItem> {
7
7
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MembershipCustomerMembership[];
@@ -1,4 +1,4 @@
1
- import { GeneratedCustomerListMembershipsForCustomer, } from "../../generated/customer/listMembershipsForCustomer.js";
1
+ import { GeneratedCustomerListMembershipsForCustomer, } from "../../../generated/customer/listMembershipsForCustomer.js";
2
2
  export default class List extends GeneratedCustomerListMembershipsForCustomer {
3
3
  mapData(data) {
4
4
  return data;
@@ -0,0 +1,3 @@
1
+ import { GeneratedCronjobGetExecution } from "../../../../generated/cronjob/getExecution.js";
2
+ export default class Get extends GeneratedCronjobGetExecution {
3
+ }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
3
  /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedCronjobGetExecution } from "../../generated/cronjob/getExecution.js";
4
+ import { GeneratedCronjobGetExecution } from "../../../../generated/cronjob/getExecution.js";
5
5
  export default class Get extends GeneratedCronjobGetExecution {
6
6
  }
@@ -1,9 +1,11 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedCronjobListExecutions, Response } from "../../generated/cronjob/listExecutions.js";
3
+ import { SuccessfulResponse } from "../../../../types.js";
4
+ import { GeneratedCronjobListExecutions, Response } from "../../../../generated/cronjob/listExecutions.js";
5
+ import { ListColumns } from "../../../../Formatter.js";
5
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2CronjobsCronjobIdExecutions.Get.Responses.$200.Content.ApplicationJson[number]>;
6
7
  export default class List extends GeneratedCronjobListExecutions<ResponseItem> {
7
8
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.CronjobCronjobExecution[];
9
+ protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
8
10
  }
9
11
  export {};
@@ -0,0 +1,22 @@
1
+ import { GeneratedCronjobListExecutions, } from "../../../../generated/cronjob/listExecutions.js";
2
+ import { formatDate } from "../../../../lib/viewhelpers/date.js";
3
+ export default class List extends GeneratedCronjobListExecutions {
4
+ mapData(data) {
5
+ return data;
6
+ }
7
+ getColumns(data) {
8
+ return {
9
+ id: {},
10
+ status: {},
11
+ duration: {
12
+ get: r => r.durationInMilliseconds ? Math.round(r.durationInMilliseconds / 1000) + "s" : "",
13
+ },
14
+ started: {
15
+ get: r => formatDate(r.executionStart),
16
+ },
17
+ ended: {
18
+ get: r => formatDate(r.executionEnd),
19
+ },
20
+ };
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ import { GeneratedCronjobGetCronjob } from "../../../generated/cronjob/getCronjob.js";
2
+ export default class Get extends GeneratedCronjobGetCronjob {
3
+ }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
3
  /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedCronjobGetCronjob } from "../../generated/cronjob/getCronjob.js";
4
+ import { GeneratedCronjobGetCronjob } from "../../../generated/cronjob/getCronjob.js";
5
5
  export default class Get extends GeneratedCronjobGetCronjob {
6
6
  }
@@ -1,9 +1,11 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedCronjobListCronjobs, Response } from "../../generated/cronjob/listCronjobs.js";
3
+ import { SuccessfulResponse } from "../../../types.js";
4
+ import { GeneratedCronjobListCronjobs, Response } from "../../../generated/cronjob/listCronjobs.js";
5
+ import { ListColumns } from "../../../Formatter.js";
5
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdCronjobs.Get.Responses.$200.Content.ApplicationJson[number]>;
6
7
  export default class List extends GeneratedCronjobListCronjobs<ResponseItem> {
7
8
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.CronjobCronjob[];
9
+ protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
8
10
  }
9
11
  export {};
@@ -0,0 +1,26 @@
1
+ import { GeneratedCronjobListCronjobs, } from "../../../generated/cronjob/listCronjobs.js";
2
+ import { formatDate } from "../../../lib/viewhelpers/date.js";
3
+ export default class List extends GeneratedCronjobListCronjobs {
4
+ mapData(data) {
5
+ return data;
6
+ }
7
+ getColumns(data) {
8
+ const baseColumns = super.getColumns(data);
9
+ return {
10
+ id: baseColumns.id,
11
+ shortId: baseColumns.shortId,
12
+ interval: {},
13
+ description: {},
14
+ lastExecution: {
15
+ header: "Last execution",
16
+ get: (r) => {
17
+ if (!r.latestExecution) {
18
+ return "-";
19
+ }
20
+ return r.latestExecution.status + ", " + formatDate(r.latestExecution.start); // API specs are broken
21
+ }
22
+ },
23
+ createdAt: baseColumns.createdAt,
24
+ };
25
+ }
26
+ }
@@ -0,0 +1,4 @@
1
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
2
+ export declare function getAppUuidFromAppName(apiClient: MittwaldAPIV2Client, softwareName: string): Promise<string>;
3
+ export declare function getAppNameFromUuid(apiClient: MittwaldAPIV2Client, uuid: string): Promise<string>;
4
+ export declare function getAppVersionFromUuid(apiClient: MittwaldAPIV2Client, appId: string, appVersionId: string): Promise<string>;
@@ -0,0 +1,43 @@
1
+ import { assertStatus } from "@mittwald/api-client-commons";
2
+ import { isUuid } from "../../Helpers.js";
3
+ // Get App UUID from App Name
4
+ export async function getAppUuidFromAppName(apiClient, softwareName) {
5
+ const apps = await apiClient.app.listApps();
6
+ assertStatus(apps, 200);
7
+ const foundApp = apps.data.find((item) => {
8
+ return (item.name.toLowerCase().replace(/[!. ]/g, "") ===
9
+ softwareName.toLowerCase().replace(/[!. ]/g, ""));
10
+ });
11
+ if (foundApp) {
12
+ return foundApp.id;
13
+ }
14
+ throw new Error("Access Denied.");
15
+ }
16
+ // Get App Human readable Name from App UUID
17
+ export async function getAppNameFromUuid(apiClient, uuid) {
18
+ if (!isUuid(uuid)) {
19
+ throw new Error("Given UUID not valid.");
20
+ }
21
+ const apps = await apiClient.app.listApps();
22
+ assertStatus(apps, 200);
23
+ const foundApp = apps.data.find((item) => {
24
+ return item.id === uuid;
25
+ });
26
+ if (foundApp) {
27
+ return foundApp.name;
28
+ }
29
+ throw new Error("App not found.");
30
+ }
31
+ // Get App Human Readable Version from App Version
32
+ export async function getAppVersionFromUuid(apiClient, appId, appVersionId) {
33
+ if (!isUuid(appId) && !isUuid(appVersionId)) {
34
+ throw new Error("Given UUID not valid.");
35
+ }
36
+ const appVersion = await apiClient.app.getAppversion({
37
+ pathParameters: { appId: appId, appVersionId: appVersionId },
38
+ });
39
+ if (appVersion.data.externalVersion) {
40
+ return appVersion.data.externalVersion;
41
+ }
42
+ throw new Error("AppVersion not found.");
43
+ }
@@ -0,0 +1,5 @@
1
+ import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
2
+ type AppVersion = MittwaldAPIV2.Components.Schemas.AppAppVersion;
3
+ export declare function getLatestAvailableAppVersionForApp(apiClient: MittwaldAPIV2Client, appId: string): Promise<AppVersion | undefined>;
4
+ export declare function getAppVersionUuidFromAppVersion(apiClient: MittwaldAPIV2Client, appId: string, appVersion: string | undefined): Promise<AppVersion | undefined>;
5
+ export {};