@camunda/ccma-api 0.4.0 → 0.5.1
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 +9 -5
- package/dist/index.js +6 -0
- package/dist/index.js.map +2 -2
- package/dist/services/accounts/bug-report.service.d.ts +28 -0
- package/dist/services/accounts/bug-report.service.js +44 -0
- package/dist/services/accounts/bug-report.service.js.map +7 -0
- package/dist/services/accounts/hdp.service.d.ts +15 -1
- package/dist/services/accounts/hdp.service.js +36 -0
- package/dist/services/accounts/hdp.service.js.map +2 -2
- package/dist/services/accounts/orgs.service.d.ts +4 -16
- package/dist/services/accounts/orgs.service.js.map +2 -2
- package/dist/services/accounts/orgs.v2.service.d.ts +7 -0
- package/dist/services/accounts/orgs.v2.service.js +35 -0
- package/dist/services/accounts/orgs.v2.service.js.map +2 -2
- package/dist/services/accounts/telemetry-ingest.service.d.ts +32 -0
- package/dist/services/accounts/telemetry-ingest.service.js +41 -0
- package/dist/services/accounts/telemetry-ingest.service.js.map +7 -0
- package/dist/services/audit-logger/audit-logger.system.service.d.ts +6 -0
- package/dist/services/audit-logger/audit-logger.system.service.js +3 -0
- package/dist/services/audit-logger/audit-logger.system.service.js.map +2 -2
- package/dist/services/console/console.admin.service.d.ts +14 -0
- package/dist/services/console/console.admin.service.js +34 -0
- package/dist/services/console/console.admin.service.js.map +2 -2
- package/dist/services/console/console.cluster.v2.service.d.ts +3 -3
- package/dist/services/console/console.cluster.v2.service.js +20 -7
- package/dist/services/console/console.cluster.v2.service.js.map +2 -2
- package/dist/services/console/console.hotbackups.service.d.ts +22 -0
- package/dist/services/console/console.hotbackups.service.js +85 -0
- package/dist/services/console/console.hotbackups.service.js.map +2 -2
- package/dist/services/console/console.hotbackups.service.spec.d.ts +1 -0
- package/dist/services/console/generation.service.d.ts +19 -1
- package/dist/services/console/generation.service.js +71 -0
- package/dist/services/console/generation.service.js.map +2 -2
- package/dist/services/hibob/hibob.service.d.ts +1 -1
- package/dist/services/hibob/hibob.service.js.map +1 -1
- package/dist/services/litellm/litellm.service.d.ts +30 -0
- package/dist/services/litellm/litellm.service.js +42 -0
- package/dist/services/litellm/litellm.service.js.map +2 -2
- package/dist/utils/api.js +12 -6
- package/dist/utils/api.js.map +2 -2
- package/dist/utils/api.log-duration.spec.d.ts +1 -0
- package/dist/utils/traceparent.d.ts +21 -1
- package/dist/utils/traceparent.js +14 -0
- package/dist/utils/traceparent.js.map +2 -2
- package/package.json +2 -2
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { request } from "../../utils/api.js";
|
|
2
2
|
import { HttpError } from "../../utils/errors.js";
|
|
3
3
|
import { toQueryString } from "../../utils/query.js";
|
|
4
|
+
function splitOrgIds(params) {
|
|
5
|
+
const orgIds = params?.filter?.orgIds;
|
|
6
|
+
if (!orgIds || orgIds.length === 0) {
|
|
7
|
+
return { query: toQueryString(params), body: void 0 };
|
|
8
|
+
}
|
|
9
|
+
const { orgIds: _omit, ...restFilter } = params.filter ?? {};
|
|
10
|
+
return {
|
|
11
|
+
query: toQueryString({ ...params, filter: restFilter }),
|
|
12
|
+
body: { orgIds }
|
|
13
|
+
};
|
|
14
|
+
}
|
|
4
15
|
class ConsoleClusterV2Service {
|
|
5
16
|
static async listClusters(params) {
|
|
6
|
-
const query =
|
|
17
|
+
const { query, body } = splitOrgIds(params.params);
|
|
7
18
|
const serviceContext = {
|
|
8
19
|
method: {
|
|
9
20
|
name: "ConsoleClusterV2Service.listClusters",
|
|
10
21
|
url: `v2/clusters${query}`,
|
|
11
22
|
normalizedUrl: "v2/clusters",
|
|
12
|
-
type: "
|
|
23
|
+
type: "post"
|
|
13
24
|
},
|
|
14
25
|
source: params.config.metrics?.source || "unset",
|
|
15
26
|
target: { name: "console", type: "internal" }
|
|
@@ -20,6 +31,7 @@ class ConsoleClusterV2Service {
|
|
|
20
31
|
url: serviceContext.method.url,
|
|
21
32
|
method: serviceContext.method.type,
|
|
22
33
|
metricsDetails: serviceContext,
|
|
34
|
+
body,
|
|
23
35
|
responseType: "json"
|
|
24
36
|
});
|
|
25
37
|
if (!response.ok || !response.body) {
|
|
@@ -151,18 +163,18 @@ class ConsoleClusterV2Service {
|
|
|
151
163
|
return response.body ?? [];
|
|
152
164
|
}
|
|
153
165
|
/**
|
|
154
|
-
* Filtered cluster CSV export (
|
|
155
|
-
* as `listClusters
|
|
156
|
-
* the whole CSV as text.
|
|
166
|
+
* Filtered cluster CSV export (POST /v2/clusters/export). Same filter params
|
|
167
|
+
* as `listClusters` (`orgIds` in the body, the rest in the query string); the
|
|
168
|
+
* backend walks the cursor server-side and returns the whole CSV as text.
|
|
157
169
|
*/
|
|
158
170
|
static async exportCsv(params) {
|
|
159
|
-
const query =
|
|
171
|
+
const { query, body } = splitOrgIds(params.params);
|
|
160
172
|
const serviceContext = {
|
|
161
173
|
method: {
|
|
162
174
|
name: "ConsoleClusterV2Service.exportCsv",
|
|
163
175
|
url: `v2/clusters/export${query}`,
|
|
164
176
|
normalizedUrl: "v2/clusters/export",
|
|
165
|
-
type: "
|
|
177
|
+
type: "post"
|
|
166
178
|
},
|
|
167
179
|
source: params.config.metrics?.source || "unset",
|
|
168
180
|
target: { name: "console", type: "internal" }
|
|
@@ -173,6 +185,7 @@ class ConsoleClusterV2Service {
|
|
|
173
185
|
url: serviceContext.method.url,
|
|
174
186
|
method: serviceContext.method.type,
|
|
175
187
|
metricsDetails: serviceContext,
|
|
188
|
+
body,
|
|
176
189
|
responseType: "text"
|
|
177
190
|
});
|
|
178
191
|
if (!response.ok || response.body === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/console/console.cluster.v2.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 ClusterByClientV2Dto,\n ClusterDetailV2Dto,\n ClusterFacetsV2Dto,\n ClusterListItemV2Dto,\n ClusterParametersV2Dto,\n CursorPage,\n ListClustersV2Params,\n} 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'\nimport { toQueryString } from '../../utils/query.js'\n\nexport interface ListClustersV2Request extends RequestBaseParams {\n params?: ListClustersV2Params\n}\n\nexport interface ListOrgClustersV2Request extends RequestBaseParams {\n params: { orgId: string } & ListClustersV2Params\n}\n\nexport interface GetClusterV2Request extends RequestBaseParams {\n params: { clusterId: string }\n}\n\nexport type GetClusterParametersV2Request = RequestBaseParams\n\n/**\n * Console-backend `/v2` read endpoints for the Control frontend.\n * Reads only \u2014 mutations stay on the existing v1 services (spec Q6).\n */\nexport class ConsoleClusterV2Service {\n public static async listClusters(\n params: ListClustersV2Request,\n ): Promise<CursorPage<ClusterListItemV2Dto>> {\n const query = toQueryString(params.params)\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.listClusters',\n url: `v2/clusters${query}`,\n normalizedUrl: 'v2/clusters',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<CursorPage<ClusterListItemV2Dto>>({\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 || !response.body) {\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 listOrgClusters(\n params: ListOrgClustersV2Request,\n ): Promise<CursorPage<ClusterListItemV2Dto>> {\n const { orgId, ...rest } = params.params\n const query = toQueryString(rest)\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.listOrgClusters',\n url: `v2/orgs/${encodeURIComponent(orgId)}/clusters${query}`,\n normalizedUrl: 'v2/orgs/:orgId/clusters',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<CursorPage<ClusterListItemV2Dto>>({\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 || !response.body) {\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 getCluster(\n params: GetClusterV2Request,\n ): Promise<ClusterDetailV2Dto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.getCluster',\n url: `v2/clusters/${encodeURIComponent(params.params.clusterId)}`,\n normalizedUrl: 'v2/clusters/:clusterId',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterDetailV2Dto>({\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 || !response.body) {\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 /** Aggregated distribution counts for the list page (GET /v2/clusters/facets). */\n public static async getFacets(\n params: RequestBaseParams,\n ): Promise<ClusterFacetsV2Dto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.getFacets',\n url: 'v2/clusters/facets',\n normalizedUrl: 'v2/clusters/facets',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterFacetsV2Dto>({\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 || !response.body) {\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 /**\n * Resolve Zeebe client-id fragments (min 6 chars) to cluster + owning org\n * (GET /v2/clusters/by-client). Backs the cross-backend org search.\n */\n public static async findByClient(\n params: { params: { q: string } } & RequestBaseParams,\n ): Promise<ClusterByClientV2Dto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.findByClient',\n url: `v2/clusters/by-client?q=${encodeURIComponent(params.params.q)}`,\n normalizedUrl: 'v2/clusters/by-client',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterByClientV2Dto[]>({\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 /**\n * Filtered cluster CSV export (GET /v2/clusters/export). Same filter params\n * as `listClusters`; the backend walks the cursor server-side and returns\n * the whole CSV as text.\n */\n public static async exportCsv(\n params: ListClustersV2Request,\n ): Promise<string> {\n const query = toQueryString(params.params)\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.exportCsv',\n url: `v2/clusters/export${query}`,\n normalizedUrl: 'v2/clusters/export',\n type: 'get',\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 responseType: 'text',\n })\n\n if (!response.ok || response.body === undefined) {\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 getParameters(\n params: GetClusterParametersV2Request,\n ): Promise<ClusterParametersV2Dto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.getParameters',\n url: 'v2/clusters/parameters',\n normalizedUrl: 'v2/clusters/parameters',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterParametersV2Dto>({\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 || !response.body) {\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"],
|
|
5
|
-
"mappings": "AAmBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;
|
|
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 ClusterByClientV2Dto,\n ClusterDetailV2Dto,\n ClusterFacetsV2Dto,\n ClusterListItemV2Dto,\n ClusterParametersV2Dto,\n CursorPage,\n ListClustersV2Params,\n} 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'\nimport { toQueryString } from '../../utils/query.js'\n\nexport interface ListClustersV2Request extends RequestBaseParams {\n params?: ListClustersV2Params\n}\n\n/**\n * `orgIds` can be thousands of uuids (prefilter-clusters-by-orgs); a comma-list\n * that long overflows the GET request line (~HTTP 431/414). So `listClusters`\n * is a POST: `orgIds` rides in the JSON body while every other (small) filter\n * stays in the query string, keeping the backend's existing query parsing.\n */\nfunction splitOrgIds(params: ListClustersV2Params | undefined): {\n query: string\n body: { orgIds: string[] } | undefined\n} {\n const orgIds = params?.filter?.orgIds\n if (!orgIds || orgIds.length === 0) {\n return { query: toQueryString(params), body: undefined }\n }\n const { orgIds: _omit, ...restFilter } = params.filter ?? {}\n return {\n query: toQueryString({ ...params, filter: restFilter }),\n body: { orgIds },\n }\n}\n\nexport interface ListOrgClustersV2Request extends RequestBaseParams {\n params: { orgId: string } & ListClustersV2Params\n}\n\nexport interface GetClusterV2Request extends RequestBaseParams {\n params: { clusterId: string }\n}\n\nexport type GetClusterParametersV2Request = RequestBaseParams\n\n/**\n * Console-backend `/v2` read endpoints for the Control frontend.\n * Reads only \u2014 mutations stay on the existing v1 services (spec Q6).\n */\nexport class ConsoleClusterV2Service {\n public static async listClusters(\n params: ListClustersV2Request,\n ): Promise<CursorPage<ClusterListItemV2Dto>> {\n const { query, body } = splitOrgIds(params.params)\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.listClusters',\n url: `v2/clusters${query}`,\n normalizedUrl: 'v2/clusters',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<CursorPage<ClusterListItemV2Dto>>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body,\n responseType: 'json',\n })\n\n if (!response.ok || !response.body) {\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 listOrgClusters(\n params: ListOrgClustersV2Request,\n ): Promise<CursorPage<ClusterListItemV2Dto>> {\n const { orgId, ...rest } = params.params\n const query = toQueryString(rest)\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.listOrgClusters',\n url: `v2/orgs/${encodeURIComponent(orgId)}/clusters${query}`,\n normalizedUrl: 'v2/orgs/:orgId/clusters',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<CursorPage<ClusterListItemV2Dto>>({\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 || !response.body) {\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 getCluster(\n params: GetClusterV2Request,\n ): Promise<ClusterDetailV2Dto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.getCluster',\n url: `v2/clusters/${encodeURIComponent(params.params.clusterId)}`,\n normalizedUrl: 'v2/clusters/:clusterId',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterDetailV2Dto>({\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 || !response.body) {\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 /** Aggregated distribution counts for the list page (GET /v2/clusters/facets). */\n public static async getFacets(\n params: RequestBaseParams,\n ): Promise<ClusterFacetsV2Dto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.getFacets',\n url: 'v2/clusters/facets',\n normalizedUrl: 'v2/clusters/facets',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterFacetsV2Dto>({\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 || !response.body) {\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 /**\n * Resolve Zeebe client-id fragments (min 6 chars) to cluster + owning org\n * (GET /v2/clusters/by-client). Backs the cross-backend org search.\n */\n public static async findByClient(\n params: { params: { q: string } } & RequestBaseParams,\n ): Promise<ClusterByClientV2Dto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.findByClient',\n url: `v2/clusters/by-client?q=${encodeURIComponent(params.params.q)}`,\n normalizedUrl: 'v2/clusters/by-client',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterByClientV2Dto[]>({\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 /**\n * Filtered cluster CSV export (POST /v2/clusters/export). Same filter params\n * as `listClusters` (`orgIds` in the body, the rest in the query string); the\n * backend walks the cursor server-side and returns the whole CSV as text.\n */\n public static async exportCsv(\n params: ListClustersV2Request,\n ): Promise<string> {\n const { query, body } = splitOrgIds(params.params)\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.exportCsv',\n url: `v2/clusters/export${query}`,\n normalizedUrl: 'v2/clusters/export',\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,\n responseType: 'text',\n })\n\n if (!response.ok || response.body === undefined) {\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 getParameters(\n params: GetClusterParametersV2Request,\n ): Promise<ClusterParametersV2Dto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterV2Service.getParameters',\n url: 'v2/clusters/parameters',\n normalizedUrl: 'v2/clusters/parameters',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterParametersV2Dto>({\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 || !response.body) {\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"],
|
|
5
|
+
"mappings": "AAmBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAY9B,SAAS,YAAY,QAGnB;AACA,QAAM,SAAS,QAAQ,QAAQ;AAC/B,MAAI,CAAC,UAAU,OAAO,WAAW,GAAG;AAClC,WAAO,EAAE,OAAO,cAAc,MAAM,GAAG,MAAM,OAAU;AAAA,EACzD;AACA,QAAM,EAAE,QAAQ,OAAO,GAAG,WAAW,IAAI,OAAO,UAAU,CAAC;AAC3D,SAAO;AAAA,IACL,OAAO,cAAc,EAAE,GAAG,QAAQ,QAAQ,WAAW,CAAC;AAAA,IACtD,MAAM,EAAE,OAAO;AAAA,EACjB;AACF;AAgBO,MAAM,wBAAwB;AAAA,EACnC,aAAoB,aAClB,QAC2C;AAC3C,UAAM,EAAE,OAAO,KAAK,IAAI,YAAY,OAAO,MAAM;AACjD,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,cAAc,KAAK;AAAA,QACxB,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,QAA0C;AAAA,MAC/D,GAAG;AAAA,MACH,MA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backupId: string;
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
+
export interface GetConsoleInternalBackupsParams extends RequestBaseParams {
|
|
37
|
+
params: {
|
|
38
|
+
clusterId: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface CreateConsoleInternalBackupParams extends RequestBaseParams {
|
|
42
|
+
params: {
|
|
43
|
+
clusterId: string;
|
|
44
|
+
};
|
|
45
|
+
body: {
|
|
46
|
+
incidentLink: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface DeleteConsoleInternalBackupParams extends RequestBaseParams {
|
|
50
|
+
params: {
|
|
51
|
+
clusterId: string;
|
|
52
|
+
backupName: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
36
55
|
export declare class ConsoleHotBackupsService {
|
|
37
56
|
static getHotBackups(params: GetConsoleHotBackupsParams): Promise<BackupDto[]>;
|
|
38
57
|
static createHotBackup(params: CreateConsoleHotBackupParams): Promise<BackupDto>;
|
|
39
58
|
static deleteHotBackup(params: DeleteConsoleHotBackupParams): Promise<void>;
|
|
40
59
|
static retryHotBackup(params: RetryConsoleHotBackupParams): Promise<BackupDto>;
|
|
41
60
|
static restoreHotBackup(params: RestoreConsoleHotBackupParams): Promise<RestoreDto>;
|
|
61
|
+
static getInternalBackups(params: GetConsoleInternalBackupsParams): Promise<BackupDto[]>;
|
|
62
|
+
static createInternalBackup(params: CreateConsoleInternalBackupParams): Promise<BackupDto>;
|
|
63
|
+
static deleteInternalBackup(params: DeleteConsoleInternalBackupParams): Promise<BackupDto>;
|
|
42
64
|
}
|
|
@@ -141,6 +141,91 @@ class ConsoleHotBackupsService {
|
|
|
141
141
|
}
|
|
142
142
|
return response.body;
|
|
143
143
|
}
|
|
144
|
+
static async getInternalBackups(params) {
|
|
145
|
+
const serviceContext = {
|
|
146
|
+
method: {
|
|
147
|
+
name: "ConsoleHotBackupsService.getInternalBackups",
|
|
148
|
+
url: `api/admin/clusters/${params.params.clusterId}/internalbackups`,
|
|
149
|
+
normalizedUrl: "api/admin/clusters/:clusterId/internalbackups",
|
|
150
|
+
type: "get"
|
|
151
|
+
},
|
|
152
|
+
source: params.config.metrics?.source || "unset",
|
|
153
|
+
target: { name: "console", type: "internal" }
|
|
154
|
+
};
|
|
155
|
+
const response = await request({
|
|
156
|
+
...params,
|
|
157
|
+
base: { id: "console" },
|
|
158
|
+
url: serviceContext.method.url,
|
|
159
|
+
method: serviceContext.method.type,
|
|
160
|
+
metricsDetails: serviceContext,
|
|
161
|
+
responseType: "json"
|
|
162
|
+
});
|
|
163
|
+
if (!response.ok) {
|
|
164
|
+
throw new HttpError(
|
|
165
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
166
|
+
response.status,
|
|
167
|
+
response.statusText
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
return response.body ?? [];
|
|
171
|
+
}
|
|
172
|
+
static async createInternalBackup(params) {
|
|
173
|
+
const serviceContext = {
|
|
174
|
+
method: {
|
|
175
|
+
name: "ConsoleHotBackupsService.createInternalBackup",
|
|
176
|
+
url: `api/admin/clusters/${params.params.clusterId}/internalbackups`,
|
|
177
|
+
normalizedUrl: "api/admin/clusters/:clusterId/internalbackups",
|
|
178
|
+
type: "post"
|
|
179
|
+
},
|
|
180
|
+
source: params.config.metrics?.source || "unset",
|
|
181
|
+
target: { name: "console", type: "internal" }
|
|
182
|
+
};
|
|
183
|
+
const response = await request({
|
|
184
|
+
...params,
|
|
185
|
+
base: { id: "console" },
|
|
186
|
+
url: serviceContext.method.url,
|
|
187
|
+
method: serviceContext.method.type,
|
|
188
|
+
metricsDetails: serviceContext,
|
|
189
|
+
body: params.body,
|
|
190
|
+
responseType: "json"
|
|
191
|
+
});
|
|
192
|
+
if (!response.ok) {
|
|
193
|
+
throw new HttpError(
|
|
194
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
195
|
+
response.status,
|
|
196
|
+
response.statusText
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
return response.body;
|
|
200
|
+
}
|
|
201
|
+
static async deleteInternalBackup(params) {
|
|
202
|
+
const serviceContext = {
|
|
203
|
+
method: {
|
|
204
|
+
name: "ConsoleHotBackupsService.deleteInternalBackup",
|
|
205
|
+
url: `api/admin/clusters/${params.params.clusterId}/internalbackups/${params.params.backupName}`,
|
|
206
|
+
normalizedUrl: "api/admin/clusters/:clusterId/internalbackups/:backupName",
|
|
207
|
+
type: "delete"
|
|
208
|
+
},
|
|
209
|
+
source: params.config.metrics?.source || "unset",
|
|
210
|
+
target: { name: "console", type: "internal" }
|
|
211
|
+
};
|
|
212
|
+
const response = await request({
|
|
213
|
+
...params,
|
|
214
|
+
base: { id: "console" },
|
|
215
|
+
url: serviceContext.method.url,
|
|
216
|
+
method: serviceContext.method.type,
|
|
217
|
+
metricsDetails: serviceContext,
|
|
218
|
+
responseType: "json"
|
|
219
|
+
});
|
|
220
|
+
if (!response.ok) {
|
|
221
|
+
throw new HttpError(
|
|
222
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
223
|
+
response.status,
|
|
224
|
+
response.statusText
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
return response.body;
|
|
228
|
+
}
|
|
144
229
|
}
|
|
145
230
|
export {
|
|
146
231
|
ConsoleHotBackupsService
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/console/console.hotbackups.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 { BackupDto, RestoreDto } 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 GetConsoleHotBackupsParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface CreateConsoleHotBackupParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface DeleteConsoleHotBackupParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n backupId: string\n }\n}\n\nexport interface RetryConsoleHotBackupParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n backupId: string\n }\n}\n\nexport interface RestoreConsoleHotBackupParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n backupId: string\n }\n}\n\nexport class ConsoleHotBackupsService {\n public static async getHotBackups(\n params: GetConsoleHotBackupsParams,\n ): Promise<BackupDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.getHotBackups',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/backups',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<BackupDto[]>({\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 createHotBackup(\n params: CreateConsoleHotBackupParams,\n ): Promise<BackupDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.createHotBackup',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/backups',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<BackupDto>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n 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 return response.body!\n }\n\n public static async deleteHotBackup(\n params: DeleteConsoleHotBackupParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.deleteHotBackup',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups/${params.params.backupId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/backups/:backupId',\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 retryHotBackup(\n params: RetryConsoleHotBackupParams,\n ): Promise<BackupDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.retryHotBackup',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups/${params.params.backupId}/retry`,\n normalizedUrl:\n 'api/orgs/:orgId/clusters/:clusterId/backups/:backupId/retry',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<BackupDto>({\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 restoreHotBackup(\n params: RestoreConsoleHotBackupParams,\n ): Promise<RestoreDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.restoreHotBackup',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups/${params.params.backupId}/restore`,\n normalizedUrl:\n 'api/orgs/:orgId/clusters/:clusterId/backups/:backupId/restore',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<RestoreDto>({\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"],
|
|
5
|
-
"mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;
|
|
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 { BackupDto, RestoreDto } 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 GetConsoleHotBackupsParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface CreateConsoleHotBackupParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface DeleteConsoleHotBackupParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n backupId: string\n }\n}\n\nexport interface RetryConsoleHotBackupParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n backupId: string\n }\n}\n\nexport interface RestoreConsoleHotBackupParams extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n backupId: string\n }\n}\n\nexport interface GetConsoleInternalBackupsParams extends RequestBaseParams {\n params: {\n clusterId: string\n }\n}\n\nexport interface CreateConsoleInternalBackupParams extends RequestBaseParams {\n params: {\n clusterId: string\n }\n body: {\n incidentLink: string\n }\n}\n\nexport interface DeleteConsoleInternalBackupParams extends RequestBaseParams {\n params: {\n clusterId: string\n backupName: string\n }\n}\n\nexport class ConsoleHotBackupsService {\n public static async getHotBackups(\n params: GetConsoleHotBackupsParams,\n ): Promise<BackupDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.getHotBackups',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/backups',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<BackupDto[]>({\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 createHotBackup(\n params: CreateConsoleHotBackupParams,\n ): Promise<BackupDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.createHotBackup',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/backups',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<BackupDto>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n 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 return response.body!\n }\n\n public static async deleteHotBackup(\n params: DeleteConsoleHotBackupParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.deleteHotBackup',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups/${params.params.backupId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/backups/:backupId',\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 retryHotBackup(\n params: RetryConsoleHotBackupParams,\n ): Promise<BackupDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.retryHotBackup',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups/${params.params.backupId}/retry`,\n normalizedUrl:\n 'api/orgs/:orgId/clusters/:clusterId/backups/:backupId/retry',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<BackupDto>({\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 restoreHotBackup(\n params: RestoreConsoleHotBackupParams,\n ): Promise<RestoreDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.restoreHotBackup',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/backups/${params.params.backupId}/restore`,\n normalizedUrl:\n 'api/orgs/:orgId/clusters/:clusterId/backups/:backupId/restore',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<RestoreDto>({\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 getInternalBackups(\n params: GetConsoleInternalBackupsParams,\n ): Promise<BackupDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.getInternalBackups',\n url: `api/admin/clusters/${params.params.clusterId}/internalbackups`,\n normalizedUrl: 'api/admin/clusters/:clusterId/internalbackups',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<BackupDto[]>({\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 createInternalBackup(\n params: CreateConsoleInternalBackupParams,\n ): Promise<BackupDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.createInternalBackup',\n url: `api/admin/clusters/${params.params.clusterId}/internalbackups`,\n normalizedUrl: 'api/admin/clusters/:clusterId/internalbackups',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<BackupDto>({\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 return response.body!\n }\n\n public static async deleteInternalBackup(\n params: DeleteConsoleInternalBackupParams,\n ): Promise<BackupDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleHotBackupsService.deleteInternalBackup',\n url: `api/admin/clusters/${params.params.clusterId}/internalbackups/${params.params.backupName}`,\n normalizedUrl:\n 'api/admin/clusters/:clusterId/internalbackups/:backupName',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<BackupDto>({\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"],
|
|
5
|
+
"mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA8DnB,MAAM,yBAAyB;AAAA,EACpC,aAAoB,cAClB,QACsB;AACtB,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,YAAY,OAAO,OAAO,KAAK,aAAa,OAAO,OAAO,SAAS;AAAA,QACxE,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,QAAqB;AAAA,MAC1C,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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ChB,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,WAAO,SAAS;AAAA,EAClB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GenerationDto, UpgradableGenerationsDto, ZeebeClusterVersionsDto } from '@camunda/ccma-shared-types';
|
|
1
|
+
import type { GenerationDto, ReleaseTrainSanityReport, UpgradableGenerationsDto, ZeebeClusterVersionsDto } from '@camunda/ccma-shared-types';
|
|
2
2
|
import type { RequestBaseParams } from '../../types/general.types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Version payload accepted by the create/update generation endpoints. Mirrors
|
|
@@ -59,6 +59,23 @@ export declare class GenerationService {
|
|
|
59
59
|
orgId: string;
|
|
60
60
|
tasklistV2Enabled?: boolean;
|
|
61
61
|
} & RequestBaseParams): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Upgrades a cluster to a generation via the internal/admin route (`PUT
|
|
64
|
+
* api/generations/:generationUuid/upgradecluster/:clusterId`), as opposed
|
|
65
|
+
* to {@link upgradeCluster}'s customer-facing, org-scoped route. This is
|
|
66
|
+
* the endpoint Camunda staff use to upgrade a cluster on a customer's
|
|
67
|
+
* behalf: it is not gated by `orgValidator`/`clusterOwnerValidator`, always
|
|
68
|
+
* records the change as done `byCamunda`, and — when `yolo` is set —
|
|
69
|
+
* bypasses the generation's `upgradeableFrom` compatibility graph
|
|
70
|
+
* entirely (subject to the caller holding the yolo permission
|
|
71
|
+
* server-side). Mirrors accounts-frontend's
|
|
72
|
+
* `generations.upgradeCluster` model action.
|
|
73
|
+
*/
|
|
74
|
+
static upgradeClusterAdmin(params: {
|
|
75
|
+
generationUuid: string;
|
|
76
|
+
clusterId: string;
|
|
77
|
+
yolo?: boolean;
|
|
78
|
+
} & RequestBaseParams): Promise<void>;
|
|
62
79
|
static setSupported(params: {
|
|
63
80
|
generationUuid: string;
|
|
64
81
|
unsupportedStartingAt: string | null;
|
|
@@ -172,6 +189,7 @@ export declare class GenerationService {
|
|
|
172
189
|
bulkOperationUuid: string;
|
|
173
190
|
clusterCount: number;
|
|
174
191
|
} | undefined>;
|
|
192
|
+
static getReleaseTrainSanity(params: RequestBaseParams): Promise<ReleaseTrainSanityReport>;
|
|
175
193
|
static create(params: CreateGenerationParams): Promise<GenerationDto | undefined>;
|
|
176
194
|
static update(params: UpdateGenerationParams): Promise<void>;
|
|
177
195
|
static delete(params: DeleteGenerationParams): Promise<void>;
|
|
@@ -151,6 +151,46 @@ class GenerationService {
|
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Upgrades a cluster to a generation via the internal/admin route (`PUT
|
|
156
|
+
* api/generations/:generationUuid/upgradecluster/:clusterId`), as opposed
|
|
157
|
+
* to {@link upgradeCluster}'s customer-facing, org-scoped route. This is
|
|
158
|
+
* the endpoint Camunda staff use to upgrade a cluster on a customer's
|
|
159
|
+
* behalf: it is not gated by `orgValidator`/`clusterOwnerValidator`, always
|
|
160
|
+
* records the change as done `byCamunda`, and — when `yolo` is set —
|
|
161
|
+
* bypasses the generation's `upgradeableFrom` compatibility graph
|
|
162
|
+
* entirely (subject to the caller holding the yolo permission
|
|
163
|
+
* server-side). Mirrors accounts-frontend's
|
|
164
|
+
* `generations.upgradeCluster` model action.
|
|
165
|
+
*/
|
|
166
|
+
static async upgradeClusterAdmin(params) {
|
|
167
|
+
const serviceContext = {
|
|
168
|
+
method: {
|
|
169
|
+
name: "GenerationService.upgradeClusterAdmin",
|
|
170
|
+
url: `api/generations/${params.generationUuid}/upgradecluster/${params.clusterId}`,
|
|
171
|
+
normalizedUrl: "api/generations/:generationUuid/upgradecluster/:clusterId",
|
|
172
|
+
type: "put"
|
|
173
|
+
},
|
|
174
|
+
source: params.config.metrics?.source || "unset",
|
|
175
|
+
target: { name: "console", type: "internal" }
|
|
176
|
+
};
|
|
177
|
+
const response = await request({
|
|
178
|
+
config: params.config,
|
|
179
|
+
base: { id: "console" },
|
|
180
|
+
body: { yolo: params.yolo ?? false, byCamunda: true },
|
|
181
|
+
responseType: "none",
|
|
182
|
+
url: serviceContext.method.url,
|
|
183
|
+
method: serviceContext.method.type,
|
|
184
|
+
metricsDetails: serviceContext
|
|
185
|
+
});
|
|
186
|
+
if (!response.ok) {
|
|
187
|
+
throw new HttpError(
|
|
188
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
189
|
+
response.status,
|
|
190
|
+
response.statusText
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
154
194
|
static async setSupported(params) {
|
|
155
195
|
const serviceContext = {
|
|
156
196
|
method: {
|
|
@@ -402,6 +442,37 @@ class GenerationService {
|
|
|
402
442
|
}
|
|
403
443
|
return response.body;
|
|
404
444
|
}
|
|
445
|
+
static async getReleaseTrainSanity(params) {
|
|
446
|
+
const serviceContext = {
|
|
447
|
+
method: {
|
|
448
|
+
name: "GenerationService.getReleaseTrainSanity",
|
|
449
|
+
url: "external/release-train/sanity-check",
|
|
450
|
+
normalizedUrl: "external/release-train/sanity-check",
|
|
451
|
+
type: "get"
|
|
452
|
+
},
|
|
453
|
+
source: params.config.metrics?.source || "unset",
|
|
454
|
+
target: { name: "console", type: "internal" }
|
|
455
|
+
};
|
|
456
|
+
const response = await request({
|
|
457
|
+
config: params.config,
|
|
458
|
+
base: { id: "console" },
|
|
459
|
+
responseType: "json",
|
|
460
|
+
url: serviceContext.method.url,
|
|
461
|
+
method: serviceContext.method.type,
|
|
462
|
+
metricsDetails: serviceContext
|
|
463
|
+
});
|
|
464
|
+
if (!response.ok) {
|
|
465
|
+
throw new HttpError(
|
|
466
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
467
|
+
response.status,
|
|
468
|
+
response.statusText
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
if (!response.body) {
|
|
472
|
+
throw new Error(`${serviceContext.method.name}: Empty response body`);
|
|
473
|
+
}
|
|
474
|
+
return response.body;
|
|
475
|
+
}
|
|
405
476
|
static async create(params) {
|
|
406
477
|
const serviceContext = {
|
|
407
478
|
method: {
|