@camunda/ccma-api 0.1.0 → 0.4.0
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.
- package/dist/index.d.ts +31 -7
- package/dist/index.js +56 -2
- package/dist/index.js.map +2 -2
- package/dist/services/accounts/admin-tools.service.d.ts +27 -0
- package/dist/services/accounts/admin-tools.service.js +70 -0
- package/dist/services/accounts/admin-tools.service.js.map +7 -0
- package/dist/services/accounts/connections.service.d.ts +85 -0
- package/dist/services/accounts/connections.service.js +150 -0
- package/dist/services/accounts/connections.service.js.map +2 -2
- package/dist/services/accounts/early-access-features.service.d.ts +59 -0
- package/dist/services/accounts/early-access-features.service.js +142 -0
- package/dist/services/accounts/early-access-features.service.js.map +2 -2
- package/dist/services/accounts/invites.service.d.ts +28 -0
- package/dist/services/accounts/invites.service.js +53 -0
- package/dist/services/accounts/invites.service.js.map +7 -0
- package/dist/services/accounts/orgs.service.d.ts +42 -0
- package/dist/services/accounts/orgs.service.js +123 -0
- package/dist/services/accounts/orgs.service.js.map +2 -2
- package/dist/services/accounts/orgs.v2.service.d.ts +6 -0
- package/dist/services/accounts/orgs.v2.service.js +34 -0
- package/dist/services/accounts/orgs.v2.service.js.map +2 -2
- package/dist/services/accounts/pdf-watermark.service.d.ts +93 -0
- package/dist/services/accounts/pdf-watermark.service.js +147 -0
- package/dist/services/accounts/pdf-watermark.service.js.map +7 -0
- package/dist/services/accounts/release-train.service.d.ts +25 -0
- package/dist/services/accounts/release-train.service.js +46 -0
- package/dist/services/accounts/release-train.service.js.map +7 -0
- package/dist/services/accounts/salesplan.service.d.ts +45 -0
- package/dist/services/accounts/salesplan.service.js +185 -0
- package/dist/services/accounts/salesplan.service.js.map +2 -2
- package/dist/services/accounts/token-issuer.service.d.ts +31 -0
- package/dist/services/accounts/token-issuer.service.js +63 -0
- package/dist/services/accounts/token-issuer.service.js.map +7 -0
- package/dist/services/accounts/users.service.d.ts +59 -0
- package/dist/services/accounts/users.service.js +296 -4
- package/dist/services/accounts/users.service.js.map +2 -2
- package/dist/services/console/console.admin.service.d.ts +21 -1
- package/dist/services/console/console.admin.service.js +75 -0
- package/dist/services/console/console.admin.service.js.map +2 -2
- package/dist/services/console/console.channel.service.d.ts +49 -0
- package/dist/services/console/console.channel.service.js +123 -0
- package/dist/services/console/console.channel.service.js.map +7 -0
- package/dist/services/console/console.cluster.service.d.ts +23 -11
- package/dist/services/console/console.cluster.service.js +36 -1
- package/dist/services/console/console.cluster.service.js.map +2 -2
- package/dist/services/console/console.cluster.v2.service.d.ts +18 -1
- package/dist/services/console/console.cluster.v2.service.js +95 -0
- package/dist/services/console/console.cluster.v2.service.js.map +2 -2
- package/dist/services/console/console.clusterplan.service.d.ts +21 -0
- package/dist/services/console/console.clusterplan.service.js +92 -0
- package/dist/services/console/console.clusterplan.service.js.map +2 -2
- package/dist/services/console/console.clusterplantype.service.d.ts +54 -0
- package/dist/services/console/console.clusterplantype.service.js +152 -0
- package/dist/services/console/console.clusterplantype.service.js.map +7 -0
- package/dist/services/console/console.k8scontext.service.d.ts +10 -0
- package/dist/services/console/console.k8scontext.service.js +41 -0
- package/dist/services/console/console.k8scontext.service.js.map +7 -0
- package/dist/services/console/console.storybook-config.service.d.ts +10 -0
- package/dist/services/console/console.storybook-config.service.js +40 -0
- package/dist/services/console/console.storybook-config.service.js.map +7 -0
- package/dist/services/console/generation.service.d.ts +45 -0
- package/dist/services/console/generation.service.js +143 -0
- package/dist/services/console/generation.service.js.map +2 -2
- package/dist/services/external/external.accounts.service.d.ts +27 -0
- package/dist/services/external/external.accounts.service.js +80 -0
- package/dist/services/external/external.accounts.service.js.map +7 -0
- package/dist/services/external/external.console.service.d.ts +37 -0
- package/dist/services/external/external.console.service.js +81 -0
- package/dist/services/external/external.console.service.js.map +7 -0
- package/dist/services/external/external.notifications.service.d.ts +78 -0
- package/dist/services/external/external.notifications.service.js +220 -0
- package/dist/services/external/external.notifications.service.js.map +7 -0
- package/dist/services/external/external.services.spec.d.ts +1 -0
- package/dist/services/notifications/notifications.service.d.ts +45 -1
- package/dist/services/notifications/notifications.service.js +168 -1
- package/dist/services/notifications/notifications.service.js.map +2 -2
- package/dist/types/general.types.d.ts +9 -1
- package/dist/utils/api.d.ts +14 -1
- package/dist/utils/api.js +71 -6
- package/dist/utils/api.js.map +2 -2
- package/dist/utils/api.request-headers.spec.d.ts +1 -0
- package/dist/utils/api.transient-retry.spec.d.ts +1 -0
- package/dist/utils/sse.d.ts +51 -0
- package/dist/utils/sse.js +254 -0
- package/dist/utils/sse.js.map +7 -0
- package/dist/utils/sse.spec.d.ts +1 -0
- package/dist/utils/traceparent.d.ts +30 -0
- package/dist/utils/traceparent.js +46 -0
- package/dist/utils/traceparent.js.map +7 -0
- package/dist/utils/traceparent.spec.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,6 +1,98 @@
|
|
|
1
1
|
import { request } from "../../utils/api.js";
|
|
2
2
|
import { HttpError } from "../../utils/errors.js";
|
|
3
3
|
class ClusterPlanService {
|
|
4
|
+
/**
|
|
5
|
+
* List every cluster plan (`GET api/plans`). Each entry carries a
|
|
6
|
+
* `clusterCount` computed by the backend, so callers get per-plan usage
|
|
7
|
+
* without a separate lookup.
|
|
8
|
+
*/
|
|
9
|
+
static async getAll(params) {
|
|
10
|
+
const serviceContext = {
|
|
11
|
+
method: {
|
|
12
|
+
name: "ClusterPlanService.getAll",
|
|
13
|
+
url: "api/plans",
|
|
14
|
+
normalizedUrl: "api/plans",
|
|
15
|
+
type: "get"
|
|
16
|
+
},
|
|
17
|
+
source: params.config.metrics?.source || "unset",
|
|
18
|
+
target: { name: "console", type: "internal" }
|
|
19
|
+
};
|
|
20
|
+
const response = await request({
|
|
21
|
+
...params,
|
|
22
|
+
base: { id: "console" },
|
|
23
|
+
url: serviceContext.method.url,
|
|
24
|
+
method: serviceContext.method.type,
|
|
25
|
+
metricsDetails: serviceContext,
|
|
26
|
+
responseType: "json"
|
|
27
|
+
});
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
throw new HttpError(
|
|
30
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
31
|
+
response.status,
|
|
32
|
+
response.statusText
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return response.body ?? [];
|
|
36
|
+
}
|
|
37
|
+
static async create(params) {
|
|
38
|
+
const serviceContext = {
|
|
39
|
+
method: {
|
|
40
|
+
name: "ClusterPlanService.create",
|
|
41
|
+
url: "api/plans",
|
|
42
|
+
normalizedUrl: "api/plans",
|
|
43
|
+
type: "post"
|
|
44
|
+
},
|
|
45
|
+
source: params.config.metrics?.source || "unset",
|
|
46
|
+
target: { name: "console", type: "internal" }
|
|
47
|
+
};
|
|
48
|
+
const response = await request({
|
|
49
|
+
...params,
|
|
50
|
+
base: { id: "console" },
|
|
51
|
+
url: serviceContext.method.url,
|
|
52
|
+
method: serviceContext.method.type,
|
|
53
|
+
metricsDetails: serviceContext,
|
|
54
|
+
body: params.body,
|
|
55
|
+
responseType: "json"
|
|
56
|
+
});
|
|
57
|
+
if (!response.ok) {
|
|
58
|
+
throw new HttpError(
|
|
59
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
60
|
+
response.status,
|
|
61
|
+
response.statusText
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (!response.body) {
|
|
65
|
+
throw new Error(`${serviceContext.method.name}: Empty response body`);
|
|
66
|
+
}
|
|
67
|
+
return response.body;
|
|
68
|
+
}
|
|
69
|
+
static async delete(params) {
|
|
70
|
+
const serviceContext = {
|
|
71
|
+
method: {
|
|
72
|
+
name: "ClusterPlanService.delete",
|
|
73
|
+
url: `api/plans/${params.params.uuid}`,
|
|
74
|
+
normalizedUrl: "api/plans/:uuid",
|
|
75
|
+
type: "delete"
|
|
76
|
+
},
|
|
77
|
+
source: params.config.metrics?.source || "unset",
|
|
78
|
+
target: { name: "console", type: "internal" }
|
|
79
|
+
};
|
|
80
|
+
const response = await request({
|
|
81
|
+
...params,
|
|
82
|
+
base: { id: "console" },
|
|
83
|
+
url: serviceContext.method.url,
|
|
84
|
+
method: serviceContext.method.type,
|
|
85
|
+
metricsDetails: serviceContext,
|
|
86
|
+
responseType: "none"
|
|
87
|
+
});
|
|
88
|
+
if (!response.ok) {
|
|
89
|
+
throw new HttpError(
|
|
90
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
91
|
+
response.status,
|
|
92
|
+
response.statusText
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
4
96
|
static async updatePerformanceExpectations(params) {
|
|
5
97
|
const serviceContext = {
|
|
6
98
|
method: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/console/console.clusterplan.service.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface UpdatePerformanceExpectationsParams extends RequestBaseParams {\n params: {\n planUuid: string\n }\n body: {\n performanceExpectations: string | null\n }\n}\n\nexport interface UpdateMigratableFromParams extends RequestBaseParams {\n params: {\n planUuid: string\n }\n body: {\n migratableFrom: string[]\n }\n}\n\nexport class ClusterPlanService {\n public static async updatePerformanceExpectations(\n params: UpdatePerformanceExpectationsParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanService.updatePerformanceExpectations',\n url: `api/plans/${params.params.planUuid}/performance-expectations`,\n normalizedUrl: 'api/plans/:planUuid/performance-expectations',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n type: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async updateMigratableFrom(\n params: UpdateMigratableFromParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanService.updateMigratableFrom',\n url: `api/plans/${params.params.planUuid}/migratable-from`,\n normalizedUrl: 'api/plans/:planUuid/migratable-from',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n type: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { ClusterPlanDto } from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface UpdatePerformanceExpectationsParams extends RequestBaseParams {\n params: {\n planUuid: string\n }\n body: {\n performanceExpectations: string | null\n }\n}\n\nexport interface UpdateMigratableFromParams extends RequestBaseParams {\n params: {\n planUuid: string\n }\n body: {\n migratableFrom: string[]\n }\n}\n\nexport interface CreateClusterPlanParams extends RequestBaseParams {\n body: {\n name: string\n plan: unknown\n cloneMigrateableFrom?: string\n }\n}\n\nexport interface DeleteClusterPlanParams extends RequestBaseParams {\n params: {\n uuid: string\n }\n}\n\nexport class ClusterPlanService {\n /**\n * List every cluster plan (`GET api/plans`). Each entry carries a\n * `clusterCount` computed by the backend, so callers get per-plan usage\n * without a separate lookup.\n */\n public static async getAll(\n params: RequestBaseParams,\n ): Promise<ClusterPlanDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanService.getAll',\n url: 'api/plans',\n normalizedUrl: 'api/plans',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterPlanDto[]>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body ?? []\n }\n\n public static async create(params: CreateClusterPlanParams): Promise<string> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanService.create',\n url: 'api/plans',\n normalizedUrl: 'api/plans',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<string>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n public static async delete(params: DeleteClusterPlanParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanService.delete',\n url: `api/plans/${params.params.uuid}`,\n normalizedUrl: 'api/plans/:uuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async updatePerformanceExpectations(\n params: UpdatePerformanceExpectationsParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanService.updatePerformanceExpectations',\n url: `api/plans/${params.params.planUuid}/performance-expectations`,\n normalizedUrl: 'api/plans/:planUuid/performance-expectations',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n type: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async updateMigratableFrom(\n params: UpdateMigratableFromParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanService.updateMigratableFrom',\n url: `api/plans/${params.params.planUuid}/migratable-from`,\n normalizedUrl: 'api/plans/:planUuid/migratable-from',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n type: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAkCnB,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,aAAoB,OAClB,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AI,UAAU;AAAA,MACtB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,MAAM,OAAO;AAAA,MACb,MAAM;AAAA,IACR,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAoB,qBAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,aAAa,OAAO,OAAO,QAAQ;AAAA,QACxC,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,MAAM,OAAO;AAAA,MACb,MAAM;AAAA,IACR,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ClusterPlanTypeDto } from '@camunda/ccma-shared-types';
|
|
2
|
+
import type { RequestBaseParams } from '../../types/general.types.js';
|
|
3
|
+
export interface GetClusterPlanTypesParams extends RequestBaseParams {
|
|
4
|
+
}
|
|
5
|
+
export interface CreateClusterPlanTypeParams extends RequestBaseParams {
|
|
6
|
+
body: {
|
|
7
|
+
name: string;
|
|
8
|
+
activePlan: string;
|
|
9
|
+
description: string;
|
|
10
|
+
internal: boolean;
|
|
11
|
+
development: boolean;
|
|
12
|
+
category: string;
|
|
13
|
+
availabilityClass: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface UpdateClusterPlanTypeParams extends RequestBaseParams {
|
|
17
|
+
params: {
|
|
18
|
+
uuid: string;
|
|
19
|
+
};
|
|
20
|
+
body: {
|
|
21
|
+
name: string;
|
|
22
|
+
activePlan: string;
|
|
23
|
+
description: string;
|
|
24
|
+
internal: boolean;
|
|
25
|
+
development: boolean;
|
|
26
|
+
category: string;
|
|
27
|
+
availabilityClass: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface SetClusterPlanTypeLimitsParams extends RequestBaseParams {
|
|
31
|
+
params: {
|
|
32
|
+
uuid: string;
|
|
33
|
+
};
|
|
34
|
+
body: {
|
|
35
|
+
limits: {
|
|
36
|
+
dataRetentionOperate?: number;
|
|
37
|
+
dataRetentionTasklist?: number;
|
|
38
|
+
dataRetentionOptimize?: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface DeleteClusterPlanTypeParams extends RequestBaseParams {
|
|
43
|
+
params: {
|
|
44
|
+
uuid: string;
|
|
45
|
+
force?: boolean;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export declare class ClusterPlanTypeService {
|
|
49
|
+
static getAll(params: GetClusterPlanTypesParams): Promise<ClusterPlanTypeDto[]>;
|
|
50
|
+
static create(params: CreateClusterPlanTypeParams): Promise<ClusterPlanTypeDto>;
|
|
51
|
+
static update(params: UpdateClusterPlanTypeParams): Promise<void>;
|
|
52
|
+
static setLimits(params: SetClusterPlanTypeLimitsParams): Promise<void>;
|
|
53
|
+
static delete(params: DeleteClusterPlanTypeParams): Promise<void>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { request } from "../../utils/api.js";
|
|
2
|
+
import { HttpError } from "../../utils/errors.js";
|
|
3
|
+
class ClusterPlanTypeService {
|
|
4
|
+
static async getAll(params) {
|
|
5
|
+
const serviceContext = {
|
|
6
|
+
method: {
|
|
7
|
+
name: "ClusterPlanTypeService.getAll",
|
|
8
|
+
url: "api/plans/type",
|
|
9
|
+
normalizedUrl: "api/plans/type",
|
|
10
|
+
type: "get"
|
|
11
|
+
},
|
|
12
|
+
source: params.config.metrics?.source || "unset",
|
|
13
|
+
target: { name: "console", type: "internal" }
|
|
14
|
+
};
|
|
15
|
+
const response = await request({
|
|
16
|
+
...params,
|
|
17
|
+
base: { id: "console" },
|
|
18
|
+
url: serviceContext.method.url,
|
|
19
|
+
method: serviceContext.method.type,
|
|
20
|
+
metricsDetails: serviceContext,
|
|
21
|
+
responseType: "json"
|
|
22
|
+
});
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
throw new HttpError(
|
|
25
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
26
|
+
response.status,
|
|
27
|
+
response.statusText
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return response.body ?? [];
|
|
31
|
+
}
|
|
32
|
+
static async create(params) {
|
|
33
|
+
const serviceContext = {
|
|
34
|
+
method: {
|
|
35
|
+
name: "ClusterPlanTypeService.create",
|
|
36
|
+
url: "api/plans/type",
|
|
37
|
+
normalizedUrl: "api/plans/type",
|
|
38
|
+
type: "post"
|
|
39
|
+
},
|
|
40
|
+
source: params.config.metrics?.source || "unset",
|
|
41
|
+
target: { name: "console", type: "internal" }
|
|
42
|
+
};
|
|
43
|
+
const response = await request({
|
|
44
|
+
...params,
|
|
45
|
+
base: { id: "console" },
|
|
46
|
+
url: serviceContext.method.url,
|
|
47
|
+
method: serviceContext.method.type,
|
|
48
|
+
metricsDetails: serviceContext,
|
|
49
|
+
body: params.body,
|
|
50
|
+
responseType: "json"
|
|
51
|
+
});
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
throw new HttpError(
|
|
54
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
55
|
+
response.status,
|
|
56
|
+
response.statusText
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
if (!response.body) {
|
|
60
|
+
throw new Error(`${serviceContext.method.name}: Empty response body`);
|
|
61
|
+
}
|
|
62
|
+
return response.body;
|
|
63
|
+
}
|
|
64
|
+
static async update(params) {
|
|
65
|
+
const serviceContext = {
|
|
66
|
+
method: {
|
|
67
|
+
name: "ClusterPlanTypeService.update",
|
|
68
|
+
url: `api/plans/type/${params.params.uuid}`,
|
|
69
|
+
normalizedUrl: "api/plans/type/:uuid",
|
|
70
|
+
type: "put"
|
|
71
|
+
},
|
|
72
|
+
source: params.config.metrics?.source || "unset",
|
|
73
|
+
target: { name: "console", type: "internal" }
|
|
74
|
+
};
|
|
75
|
+
const response = await request({
|
|
76
|
+
...params,
|
|
77
|
+
base: { id: "console" },
|
|
78
|
+
url: serviceContext.method.url,
|
|
79
|
+
method: serviceContext.method.type,
|
|
80
|
+
metricsDetails: serviceContext,
|
|
81
|
+
body: params.body,
|
|
82
|
+
responseType: "none"
|
|
83
|
+
});
|
|
84
|
+
if (!response.ok) {
|
|
85
|
+
throw new HttpError(
|
|
86
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
87
|
+
response.status,
|
|
88
|
+
response.statusText
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
static async setLimits(params) {
|
|
93
|
+
const serviceContext = {
|
|
94
|
+
method: {
|
|
95
|
+
name: "ClusterPlanTypeService.setLimits",
|
|
96
|
+
url: `api/plans/type/${params.params.uuid}/limits`,
|
|
97
|
+
normalizedUrl: "api/plans/type/:uuid/limits",
|
|
98
|
+
type: "patch"
|
|
99
|
+
},
|
|
100
|
+
source: params.config.metrics?.source || "unset",
|
|
101
|
+
target: { name: "console", type: "internal" }
|
|
102
|
+
};
|
|
103
|
+
const response = await request({
|
|
104
|
+
...params,
|
|
105
|
+
base: { id: "console" },
|
|
106
|
+
url: serviceContext.method.url,
|
|
107
|
+
method: serviceContext.method.type,
|
|
108
|
+
metricsDetails: serviceContext,
|
|
109
|
+
body: params.body,
|
|
110
|
+
responseType: "none"
|
|
111
|
+
});
|
|
112
|
+
if (!response.ok) {
|
|
113
|
+
throw new HttpError(
|
|
114
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
115
|
+
response.status,
|
|
116
|
+
response.statusText
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
static async delete(params) {
|
|
121
|
+
const path = `api/plans/type/${params.params.uuid}${params.params.force ? "/force" : ""}`;
|
|
122
|
+
const serviceContext = {
|
|
123
|
+
method: {
|
|
124
|
+
name: "ClusterPlanTypeService.delete",
|
|
125
|
+
url: path,
|
|
126
|
+
normalizedUrl: params.params.force ? "api/plans/type/:uuid/force" : "api/plans/type/:uuid",
|
|
127
|
+
type: "delete"
|
|
128
|
+
},
|
|
129
|
+
source: params.config.metrics?.source || "unset",
|
|
130
|
+
target: { name: "console", type: "internal" }
|
|
131
|
+
};
|
|
132
|
+
const response = await request({
|
|
133
|
+
...params,
|
|
134
|
+
base: { id: "console" },
|
|
135
|
+
url: serviceContext.method.url,
|
|
136
|
+
method: serviceContext.method.type,
|
|
137
|
+
metricsDetails: serviceContext,
|
|
138
|
+
responseType: "none"
|
|
139
|
+
});
|
|
140
|
+
if (!response.ok) {
|
|
141
|
+
throw new HttpError(
|
|
142
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
143
|
+
response.status,
|
|
144
|
+
response.statusText
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
export {
|
|
150
|
+
ClusterPlanTypeService
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=console.clusterplantype.service.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/services/console/console.clusterplantype.service.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { ClusterPlanTypeDto } from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface GetClusterPlanTypesParams extends RequestBaseParams {}\n\nexport interface CreateClusterPlanTypeParams extends RequestBaseParams {\n body: {\n name: string\n activePlan: string\n description: string\n internal: boolean\n development: boolean\n category: string\n availabilityClass: string\n }\n}\n\nexport interface UpdateClusterPlanTypeParams extends RequestBaseParams {\n params: {\n uuid: string\n }\n body: {\n name: string\n activePlan: string\n description: string\n internal: boolean\n development: boolean\n category: string\n availabilityClass: string\n }\n}\n\nexport interface SetClusterPlanTypeLimitsParams extends RequestBaseParams {\n params: {\n uuid: string\n }\n body: {\n limits: {\n dataRetentionOperate?: number\n dataRetentionTasklist?: number\n dataRetentionOptimize?: number\n }\n }\n}\n\nexport interface DeleteClusterPlanTypeParams extends RequestBaseParams {\n params: {\n uuid: string\n force?: boolean\n }\n}\n\nexport class ClusterPlanTypeService {\n public static async getAll(\n params: GetClusterPlanTypesParams,\n ): Promise<ClusterPlanTypeDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanTypeService.getAll',\n url: 'api/plans/type',\n normalizedUrl: 'api/plans/type',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterPlanTypeDto[]>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body ?? []\n }\n\n public static async create(\n params: CreateClusterPlanTypeParams,\n ): Promise<ClusterPlanTypeDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanTypeService.create',\n url: 'api/plans/type',\n normalizedUrl: 'api/plans/type',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterPlanTypeDto>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n public static async update(\n params: UpdateClusterPlanTypeParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanTypeService.update',\n url: `api/plans/type/${params.params.uuid}`,\n normalizedUrl: 'api/plans/type/:uuid',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async setLimits(\n params: SetClusterPlanTypeLimitsParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanTypeService.setLimits',\n url: `api/plans/type/${params.params.uuid}/limits`,\n normalizedUrl: 'api/plans/type/:uuid/limits',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async delete(\n params: DeleteClusterPlanTypeParams,\n ): Promise<void> {\n const path = `api/plans/type/${params.params.uuid}${\n params.params.force ? '/force' : ''\n }`\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanTypeService.delete',\n url: path,\n normalizedUrl: params.params.force\n ? 'api/plans/type/:uuid/force'\n : 'api/plans/type/:uuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAmDnB,MAAM,uBAAuB;AAAA,EAClC,aAAoB,OAClB,QAC+B;AAC/B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA,QACL,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAA8B;AAAA,MACnD,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,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AA,IACF;AAAA,EACF;AAAA,EAEA,aAAoB,OAClB,QACe;AACf,UAAM,OAAO,kBAAkB,OAAO,OAAO,IAAI,GAC/C,OAAO,OAAO,QAAQ,WAAW,EACnC;AACA,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA,QACL,eAAe,OAAO,OAAO,QACzB,+BACA;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { K8sConfig } from '@camunda/ccma-shared-types';
|
|
2
|
+
import type { RequestBaseParams } from '../../types/general.types.js';
|
|
3
|
+
export interface GetK8sContextsParams extends RequestBaseParams {
|
|
4
|
+
params?: {
|
|
5
|
+
withClusterCounts?: boolean;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export declare class K8sContextService {
|
|
9
|
+
static getAll(params: GetK8sContextsParams): Promise<K8sConfig>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { request } from "../../utils/api.js";
|
|
2
|
+
import { HttpError } from "../../utils/errors.js";
|
|
3
|
+
class K8sContextService {
|
|
4
|
+
static async getAll(params) {
|
|
5
|
+
const withClusterCounts = params.params?.withClusterCounts;
|
|
6
|
+
const url = `api/admin/k8sContexts${withClusterCounts ? "?withClusterCounts=please" : ""}`;
|
|
7
|
+
const serviceContext = {
|
|
8
|
+
method: {
|
|
9
|
+
name: "K8sContextService.getAll",
|
|
10
|
+
url,
|
|
11
|
+
normalizedUrl: "api/admin/k8sContexts",
|
|
12
|
+
type: "get"
|
|
13
|
+
},
|
|
14
|
+
source: params.config.metrics?.source || "unset",
|
|
15
|
+
target: { name: "console", type: "internal" }
|
|
16
|
+
};
|
|
17
|
+
const response = await request({
|
|
18
|
+
...params,
|
|
19
|
+
base: { id: "console" },
|
|
20
|
+
url: serviceContext.method.url,
|
|
21
|
+
method: serviceContext.method.type,
|
|
22
|
+
metricsDetails: serviceContext,
|
|
23
|
+
responseType: "json"
|
|
24
|
+
});
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
throw new HttpError(
|
|
27
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
28
|
+
response.status,
|
|
29
|
+
response.statusText
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
if (!response.body) {
|
|
33
|
+
throw new Error(`${serviceContext.method.name}: Empty response body`);
|
|
34
|
+
}
|
|
35
|
+
return response.body;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
K8sContextService
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=console.k8scontext.service.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/services/console/console.k8scontext.service.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { K8sConfig } from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface GetK8sContextsParams extends RequestBaseParams {\n params?: {\n withClusterCounts?: boolean\n }\n}\n\nexport class K8sContextService {\n public static async getAll(params: GetK8sContextsParams): Promise<K8sConfig> {\n const withClusterCounts = params.params?.withClusterCounts\n const url = `api/admin/k8sContexts${\n withClusterCounts ? '?withClusterCounts=please' : ''\n }`\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'K8sContextService.getAll',\n url,\n normalizedUrl: 'api/admin/k8sContexts',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<K8sConfig>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAQnB,MAAM,kBAAkB;AAAA,EAC7B,aAAoB,OAAO,QAAkD;AAC3E,UAAM,oBAAoB,OAAO,QAAQ;AACzC,UAAM,MAAM,wBACV,oBAAoB,8BAA8B,EACpD;AACA,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN;AAAA,QACA,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAmB;AAAA,MACxC,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAEA,QAAI,CAAC,SAAS,MAAM;AAClB,YAAM,IAAI,MAAM,GAAG,eAAe,OAAO,IAAI,uBAAuB;AAAA,IACtE;AAEA,WAAO,SAAS;AAAA,EAClB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StorybookConfig } from '@camunda/ccma-shared-types';
|
|
2
|
+
import type { RequestBaseParams } from '../../types/general.types.js';
|
|
3
|
+
export type GetStorybookConfigParams = RequestBaseParams;
|
|
4
|
+
/**
|
|
5
|
+
* Client for the unguarded `GET /api/storybook-config` catalog endpoint used by
|
|
6
|
+
* the screenshot-tooling storybooks. No auth required.
|
|
7
|
+
*/
|
|
8
|
+
export declare class StorybookConfigService {
|
|
9
|
+
static getAll(params: GetStorybookConfigParams): Promise<StorybookConfig>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { request } from "../../utils/api.js";
|
|
2
|
+
import { HttpError } from "../../utils/errors.js";
|
|
3
|
+
class StorybookConfigService {
|
|
4
|
+
static async getAll(params) {
|
|
5
|
+
const url = "api/storybook-config";
|
|
6
|
+
const serviceContext = {
|
|
7
|
+
method: {
|
|
8
|
+
name: "StorybookConfigService.getAll",
|
|
9
|
+
url,
|
|
10
|
+
normalizedUrl: url,
|
|
11
|
+
type: "get"
|
|
12
|
+
},
|
|
13
|
+
source: params.config.metrics?.source || "unset",
|
|
14
|
+
target: { name: "console", type: "internal" }
|
|
15
|
+
};
|
|
16
|
+
const response = await request({
|
|
17
|
+
...params,
|
|
18
|
+
base: { id: "console" },
|
|
19
|
+
url: serviceContext.method.url,
|
|
20
|
+
method: serviceContext.method.type,
|
|
21
|
+
metricsDetails: serviceContext,
|
|
22
|
+
responseType: "json"
|
|
23
|
+
});
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
throw new HttpError(
|
|
26
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
27
|
+
response.status,
|
|
28
|
+
response.statusText
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
if (!response.body) {
|
|
32
|
+
throw new Error(`${serviceContext.method.name}: Empty response body`);
|
|
33
|
+
}
|
|
34
|
+
return response.body;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
StorybookConfigService
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=console.storybook-config.service.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/services/console/console.storybook-config.service.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { StorybookConfig } from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport type GetStorybookConfigParams = RequestBaseParams\n\n/**\n * Client for the unguarded `GET /api/storybook-config` catalog endpoint used by\n * the screenshot-tooling storybooks. No auth required.\n */\nexport class StorybookConfigService {\n public static async getAll(\n params: GetStorybookConfigParams,\n ): Promise<StorybookConfig> {\n const url = 'api/storybook-config'\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'StorybookConfigService.getAll',\n url,\n normalizedUrl: url,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<StorybookConfig>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAQnB,MAAM,uBAAuB;AAAA,EAClC,aAAoB,OAClB,QAC0B;AAC1B,UAAM,MAAM;AACZ,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN;AAAA,QACA,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAyB;AAAA,MAC9C,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAEA,QAAI,CAAC,SAAS,MAAM;AAClB,YAAM,IAAI,MAAM,GAAG,eAAe,OAAO,IAAI,uBAAuB;AAAA,IACtE;AAEA,WAAO,SAAS;AAAA,EAClB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
import type { GenerationDto, UpgradableGenerationsDto, ZeebeClusterVersionsDto } from '@camunda/ccma-shared-types';
|
|
2
2
|
import type { RequestBaseParams } from '../../types/general.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Version payload accepted by the create/update generation endpoints. Mirrors
|
|
5
|
+
* `ZeebeClusterVersionsDto` but allows the optional component versions to be
|
|
6
|
+
* omitted; the backend normalizes blank optionals to `undefined`.
|
|
7
|
+
*/
|
|
8
|
+
export type GenerationVersionsInput = Partial<ZeebeClusterVersionsDto> & Pick<ZeebeClusterVersionsDto, 'zeebe' | 'elasticSearchOss' | 'optimize'>;
|
|
9
|
+
export interface CreateGenerationParams extends RequestBaseParams {
|
|
10
|
+
body: {
|
|
11
|
+
name: string;
|
|
12
|
+
versions: GenerationVersionsInput;
|
|
13
|
+
upgradeableFrom?: string[];
|
|
14
|
+
isUnsupportedStarting?: string;
|
|
15
|
+
isBespoke?: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface UpdateGenerationParams extends RequestBaseParams {
|
|
19
|
+
params: {
|
|
20
|
+
generationUuid: string;
|
|
21
|
+
};
|
|
22
|
+
body: {
|
|
23
|
+
name?: string;
|
|
24
|
+
versions: Partial<GenerationVersionsInput>;
|
|
25
|
+
upgradeableFrom?: string[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface DeleteGenerationParams extends RequestBaseParams {
|
|
29
|
+
params: {
|
|
30
|
+
generationUuid: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface SetGenerationBespokeParams extends RequestBaseParams {
|
|
34
|
+
params: {
|
|
35
|
+
generationUuid: string;
|
|
36
|
+
};
|
|
37
|
+
body: {
|
|
38
|
+
isBespoke: boolean;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface ListGenerationsParams extends RequestBaseParams {
|
|
42
|
+
}
|
|
3
43
|
export declare class GenerationService {
|
|
44
|
+
static list(params: ListGenerationsParams): Promise<GenerationDto[]>;
|
|
4
45
|
static getGeneration(params: {
|
|
5
46
|
uuid: string;
|
|
6
47
|
} & RequestBaseParams): Promise<GenerationDto | undefined>;
|
|
@@ -131,4 +172,8 @@ export declare class GenerationService {
|
|
|
131
172
|
bulkOperationUuid: string;
|
|
132
173
|
clusterCount: number;
|
|
133
174
|
} | undefined>;
|
|
175
|
+
static create(params: CreateGenerationParams): Promise<GenerationDto | undefined>;
|
|
176
|
+
static update(params: UpdateGenerationParams): Promise<void>;
|
|
177
|
+
static delete(params: DeleteGenerationParams): Promise<void>;
|
|
178
|
+
static setBespoke(params: SetGenerationBespokeParams): Promise<void>;
|
|
134
179
|
}
|