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

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,35 @@
1
+ import { assertStatus } from "@mittwald/api-client-commons";
2
+ import { gt } from "semver";
3
+ // Get latest available Internal App Version for App UUID
4
+ export async function getLatestAvailableAppVersionForApp(apiClient, appId) {
5
+ const versions = await apiClient.app.listAppversions({
6
+ pathParameters: {
7
+ appId,
8
+ },
9
+ });
10
+ assertStatus(versions, 200);
11
+ if (versions.data.length === 0) {
12
+ return undefined;
13
+ }
14
+ let latestVersion = "0.0.0";
15
+ for (const version of versions.data) {
16
+ if (gt(version.internalVersion, latestVersion)) {
17
+ latestVersion = version.internalVersion;
18
+ }
19
+ }
20
+ return versions.data.find((item) => item.internalVersion === latestVersion);
21
+ }
22
+ // App Version UUID from App Version irellevant if internal or external
23
+ export async function getAppVersionUuidFromAppVersion(apiClient, appId, appVersion) {
24
+ const versions = await apiClient.app.listAppversions({
25
+ pathParameters: {
26
+ appId,
27
+ },
28
+ });
29
+ if (!appVersion) {
30
+ return getLatestAvailableAppVersionForApp(apiClient, appId);
31
+ }
32
+ assertStatus(versions, 200);
33
+ return versions.data.find((item) => item.internalVersion === appVersion ||
34
+ item.externalVersion === appVersion);
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/cli",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.5",
4
4
  "description": "Auto-generated CLI for the mittwald API",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -55,6 +55,7 @@
55
55
  "parse-duration": "^1.1.0",
56
56
  "pretty-bytes": "^6.1.0",
57
57
  "react": "^18.2.0",
58
+ "semver": "^7.5.4",
58
59
  "tempfile": "^5.0.0"
59
60
  },
60
61
  "resolutions": {
@@ -72,6 +73,7 @@
72
73
  "@types/parse-duration": "^0.3.0",
73
74
  "@types/pretty-bytes": "^5.2.0",
74
75
  "@types/react": "^18",
76
+ "@types/semver": "^7.5.0",
75
77
  "@typescript-eslint/eslint-plugin": "^5.61.0",
76
78
  "@typescript-eslint/parser": "^5.61.0",
77
79
  "@yarnpkg/pnpify": "^4.0.0-rc.48",
@@ -1,3 +0,0 @@
1
- import { GeneratedAppGetApp } from "../../generated/app/getApp.js";
2
- export default class Get extends GeneratedAppGetApp {
3
- }
@@ -1,6 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedAppGetApp } from "../../generated/app/getApp.js";
5
- export default class Get extends GeneratedAppGetApp {
6
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedAppGetAppversion } from "../../generated/app/getAppversion.js";
2
- export default class Get extends GeneratedAppGetAppversion {
3
- }
@@ -1,6 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedAppGetAppversion } from "../../generated/app/getAppversion.js";
5
- export default class Get extends GeneratedAppGetAppversion {
6
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedAppGetSystemsoftware } from "../../generated/app/getSystemsoftware.js";
2
- export default class Get extends GeneratedAppGetSystemsoftware {
3
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedAppGetSystemsoftwareversion } from "../../generated/app/getSystemsoftwareversion.js";
2
- export default class Get extends GeneratedAppGetSystemsoftwareversion {
3
- }
@@ -1,9 +0,0 @@
1
- import { Simplify } from "@mittwald/api-client-commons";
2
- import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedAppListAppinstallations, Response } from "../../generated/app/listAppinstallations.js";
5
- type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdAppinstallations.Get.Responses.$200.Content.ApplicationJson[number]>;
6
- export default class List extends GeneratedAppListAppinstallations<ResponseItem> {
7
- protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.AppAppInstallation[];
8
- }
9
- export {};
@@ -1,6 +0,0 @@
1
- import { GeneratedAppListAppinstallations, } from "../../generated/app/listAppinstallations.js";
2
- export default class List extends GeneratedAppListAppinstallations {
3
- mapData(data) {
4
- return data;
5
- }
6
- }
@@ -1,9 +0,0 @@
1
- import { Simplify } from "@mittwald/api-client-commons";
2
- import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedAppListApps, Response } from "../../generated/app/listApps.js";
5
- type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2Apps.Get.Responses.$200.Content.ApplicationJson[number]>;
6
- export default class List extends GeneratedAppListApps<ResponseItem> {
7
- protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.AppApp[];
8
- }
9
- export {};
@@ -1,6 +0,0 @@
1
- import { GeneratedAppListApps, } from "../../generated/app/listApps.js";
2
- export default class List extends GeneratedAppListApps {
3
- mapData(data) {
4
- return data;
5
- }
6
- }
@@ -1,9 +0,0 @@
1
- import { Simplify } from "@mittwald/api-client-commons";
2
- import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedAppListAppversions, Response } from "../../generated/app/listAppversions.js";
5
- type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2AppsAppIdVersions.Get.Responses.$200.Content.ApplicationJson[number]>;
6
- export default class List extends GeneratedAppListAppversions<ResponseItem> {
7
- protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.AppAppVersion[];
8
- }
9
- export {};
@@ -1,6 +0,0 @@
1
- import { GeneratedAppListAppversions, } from "../../generated/app/listAppversions.js";
2
- export default class List extends GeneratedAppListAppversions {
3
- mapData(data) {
4
- return data;
5
- }
6
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedAppRetrieveStatus } from "../../generated/app/retrieveStatus.js";
2
- export default class Get extends GeneratedAppRetrieveStatus {
3
- }
@@ -1,6 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedAppRetrieveStatus } from "../../generated/app/retrieveStatus.js";
5
- export default class Get extends GeneratedAppRetrieveStatus {
6
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedCronjobGetCronjob } from "../../generated/cronjob/getCronjob.js";
2
- export default class Get extends GeneratedCronjobGetCronjob {
3
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedCronjobGetExecution } from "../../generated/cronjob/getExecution.js";
2
- export default class Get extends GeneratedCronjobGetExecution {
3
- }
@@ -1,6 +0,0 @@
1
- import { GeneratedCronjobListCronjobs, } from "../../generated/cronjob/listCronjobs.js";
2
- export default class List extends GeneratedCronjobListCronjobs {
3
- mapData(data) {
4
- return data;
5
- }
6
- }
@@ -1,6 +0,0 @@
1
- import { GeneratedCronjobListExecutions, } from "../../generated/cronjob/listExecutions.js";
2
- export default class List extends GeneratedCronjobListExecutions {
3
- mapData(data) {
4
- return data;
5
- }
6
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedCustomerGetCustomerCategory } from "../../generated/customer/getCustomerCategory.js";
2
- export default class Get extends GeneratedCustomerGetCustomerCategory {
3
- }
@@ -1,6 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedCustomerGetCustomerCategory } from "../../generated/customer/getCustomerCategory.js";
5
- export default class Get extends GeneratedCustomerGetCustomerCategory {
6
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedCustomerGetCustomerInvite } from "../../generated/customer/getCustomerInvite.js";
2
- export default class Get extends GeneratedCustomerGetCustomerInvite {
3
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedCustomerGetCustomerMembership } from "../../generated/customer/getCustomerMembership.js";
2
- export default class Get extends GeneratedCustomerGetCustomerMembership {
3
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedCustomerGetCustomerTokenInvite } from "../../generated/customer/getCustomerTokenInvite.js";
2
- export default class Get extends GeneratedCustomerGetCustomerTokenInvite {
3
- }
@@ -1,6 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedCustomerGetCustomerTokenInvite } from "../../generated/customer/getCustomerTokenInvite.js";
5
- export default class Get extends GeneratedCustomerGetCustomerTokenInvite {
6
- }
@@ -1,6 +0,0 @@
1
- import { GeneratedCustomerListCustomers, } from "../../generated/customer/listCustomers.js";
2
- export default class List extends GeneratedCustomerListCustomers {
3
- mapData(data) {
4
- return data;
5
- }
6
- }
@@ -1,9 +0,0 @@
1
- import { Simplify } from "@mittwald/api-client-commons";
2
- import { MittwaldAPIV2 } from "@mittwald/api-client";
3
- import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedCustomerListOfCustomerCategories, Response } from "../../generated/customer/listOfCustomerCategories.js";
5
- type ResponseItem = Simplify<Required<MittwaldAPIV2.Paths.V2CustomerCategories.Get.Responses.$200.Content.ApplicationJson>["categories"][number]>;
6
- export default class List extends GeneratedCustomerListOfCustomerCategories<ResponseItem> {
7
- protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.CustomerCategory[];
8
- }
9
- export {};
@@ -1,6 +0,0 @@
1
- import { GeneratedCustomerListOfCustomerCategories, } from "../../generated/customer/listOfCustomerCategories.js";
2
- export default class List extends GeneratedCustomerListOfCustomerCategories {
3
- mapData(data) {
4
- return data.categories ?? [];
5
- }
6
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedDnsZoneGetSpecific } from "../../generated/domain/dnsZoneGetSpecific.js";
2
- export default class Get extends GeneratedDnsZoneGetSpecific {
3
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedDnsZonesForProject } from "../../generated/domain/dnsZonesForProject.js";
2
- export default class Get extends GeneratedDnsZonesForProject {
3
- }