@camunda/ccma-api 3.1.0 → 5.0.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 +12 -8
- package/dist/index.js +4 -0
- package/dist/index.js.map +2 -2
- package/dist/services/accounts/approvals.m2m.service.d.ts +212 -0
- package/dist/services/accounts/approvals.m2m.service.js +330 -0
- package/dist/services/accounts/approvals.m2m.service.js.map +2 -2
- package/dist/services/accounts/early-access-features.service.d.ts +4 -0
- package/dist/services/accounts/early-access-features.service.js.map +2 -2
- package/dist/services/accounts/hdp.service.d.ts +16 -3
- package/dist/services/accounts/hdp.service.js +45 -2
- package/dist/services/accounts/hdp.service.js.map +2 -2
- package/dist/services/accounts/orgs.service.d.ts +5 -0
- package/dist/services/accounts/orgs.service.js.map +2 -2
- package/dist/services/console/console.approvals.m2m.service.d.ts +95 -1
- package/dist/services/console/console.approvals.m2m.service.js +142 -0
- package/dist/services/console/console.approvals.m2m.service.js.map +2 -2
- package/dist/services/console/console.cluster-parameters.service.d.ts +6 -0
- package/dist/services/console/console.cluster-parameters.service.js.map +2 -2
- package/dist/services/console/console.cluster.service.d.ts +2 -0
- package/dist/services/console/console.cluster.service.js.map +2 -2
- package/dist/services/console/generation.service.d.ts +17 -1
- package/dist/services/console/generation.service.js +52 -1
- package/dist/services/console/generation.service.js.map +2 -2
- package/dist/services/control/control.approvals.service.d.ts +421 -0
- package/dist/services/control/control.approvals.service.js +209 -1
- package/dist/services/control/control.approvals.service.js.map +2 -2
- package/dist/services/control/control.approvals.service.spec.d.ts +1 -0
- package/dist/services/control/control.dashboards.service.d.ts +76 -0
- package/dist/services/control/control.dashboards.service.js +180 -0
- package/dist/services/control/control.dashboards.service.js.map +7 -0
- package/dist/services/control/control.dashboards.service.spec.d.ts +1 -0
- package/dist/services/control/control.feature-flags.service.d.ts +53 -0
- package/dist/services/control/control.feature-flags.service.js +123 -0
- package/dist/services/control/control.feature-flags.service.js.map +7 -0
- package/dist/services/control/control.feature-flags.service.spec.d.ts +1 -0
- package/dist/services/control/control.platform.service.d.ts +14 -0
- package/dist/services/control/control.platform.service.js +27 -0
- package/dist/services/control/control.platform.service.js.map +2 -2
- package/dist/services/control/control.platform.service.spec.d.ts +1 -0
- package/dist/services/external/external.accounts.service.d.ts +2 -2
- package/dist/services/external/external.accounts.service.js.map +2 -2
- package/dist/services/github/github.service.d.ts +20 -0
- package/dist/services/github/github.service.js +50 -1
- package/dist/services/github/github.service.js.map +2 -2
- package/dist/services/openrouter/openrouter.service.d.ts +35 -0
- package/dist/services/openrouter/openrouter.service.js +45 -0
- package/dist/services/openrouter/openrouter.service.js.map +2 -2
- package/dist/services/slack/slack-blockkit.service.d.ts +7 -0
- package/dist/services/slack/slack-blockkit.service.js +1 -0
- package/dist/services/slack/slack-blockkit.service.js.map +2 -2
- package/dist/utils/environments.js +3 -4
- package/dist/utils/environments.js.map +2 -2
- package/dist/utils/sse.d.ts +1 -0
- package/dist/utils/sse.js +7 -0
- package/dist/utils/sse.js.map +2 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApprovalM2mActor, ClusterBulkStepRequestDto, ClusterBulkStepResultDto, MoveClusterOwnerResult } from '@camunda/ccma-shared-types';
|
|
1
|
+
import type { ApprovalM2mActor, BackupDto, ChangeClusterPlanTypeResult, ClusterBulkStepRequestDto, ClusterBulkStepResultDto, MoveClusterOwnerResult } from '@camunda/ccma-shared-types';
|
|
2
2
|
import type { RequestBaseParams } from '../../types/general.types.js';
|
|
3
3
|
/**
|
|
4
4
|
* The route of `api/admin/approvals` in console-backend.
|
|
@@ -14,6 +14,34 @@ export interface MoveClusterOwnerThroughApprovalRequest extends RequestBaseParam
|
|
|
14
14
|
ownerId: string;
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
+
export interface ChangeClusterPlanTypeThroughApprovalRequest extends RequestBaseParams {
|
|
18
|
+
params: {
|
|
19
|
+
clusterId: string;
|
|
20
|
+
};
|
|
21
|
+
body: {
|
|
22
|
+
actor: ApprovalM2mActor;
|
|
23
|
+
/** The organization that owns the cluster. Console refuses another one. */
|
|
24
|
+
orgId: string;
|
|
25
|
+
toPlanTypeUuid: string;
|
|
26
|
+
numberOfAllocatedHwPackages: number;
|
|
27
|
+
/**
|
|
28
|
+
* The plan type that the person who asked READ. Console compares it with
|
|
29
|
+
* the plan type of the cluster when the action runs, and changes nothing
|
|
30
|
+
* when the two differ.
|
|
31
|
+
*/
|
|
32
|
+
expectedPlanTypeUuid: string;
|
|
33
|
+
/** The packages the person READ, 1 for a cluster that holds none. */
|
|
34
|
+
expectedNumberOfAllocatedHwPackages: number;
|
|
35
|
+
/** The plan the cluster ran when the person read it. */
|
|
36
|
+
expectedClusterPlanUuid: string;
|
|
37
|
+
/** The active modification config the person read, absent for none. */
|
|
38
|
+
expectedActiveModificationConfigUuid?: string;
|
|
39
|
+
/** The active plan of the new plan type the person read. */
|
|
40
|
+
expectedTargetPlanUuid: string;
|
|
41
|
+
/** Whether the cluster plan moves to that plan, as the person read it. */
|
|
42
|
+
expectedClusterPlanUpdate: boolean;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
17
45
|
export interface RunClusterBulkStepThroughApprovalRequest extends RequestBaseParams {
|
|
18
46
|
params: {
|
|
19
47
|
clusterId: string;
|
|
@@ -29,8 +57,62 @@ export interface AnnounceClusterBulkPlanUpdateRequest extends RequestBaseParams
|
|
|
29
57
|
doneCount: number;
|
|
30
58
|
};
|
|
31
59
|
}
|
|
60
|
+
export interface DeleteInternalBackupThroughApprovalRequest extends RequestBaseParams {
|
|
61
|
+
params: {
|
|
62
|
+
clusterId: string;
|
|
63
|
+
backupName: string;
|
|
64
|
+
};
|
|
65
|
+
body: {
|
|
66
|
+
actor: ApprovalM2mActor;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface CreateCustomerClusterPlanThroughApprovalRequest extends RequestBaseParams {
|
|
70
|
+
body: {
|
|
71
|
+
actor: ApprovalM2mActor;
|
|
72
|
+
clusterPlanId: string;
|
|
73
|
+
name: string;
|
|
74
|
+
plan: Record<string, unknown>;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface CheckCustomerClusterPlanRemovalRequest extends RequestBaseParams {
|
|
78
|
+
params: {
|
|
79
|
+
clusterPlanId: string;
|
|
80
|
+
};
|
|
81
|
+
body: {
|
|
82
|
+
actor: ApprovalM2mActor;
|
|
83
|
+
forDelete: boolean;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export interface DeleteCustomerClusterPlanThroughApprovalRequest extends RequestBaseParams {
|
|
87
|
+
params: {
|
|
88
|
+
clusterPlanId: string;
|
|
89
|
+
};
|
|
90
|
+
body: {
|
|
91
|
+
actor: ApprovalM2mActor;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** What console answers for a customer cluster plan call. */
|
|
95
|
+
export interface CustomerClusterPlanThroughApprovalResult {
|
|
96
|
+
clusterPlanId: string;
|
|
97
|
+
}
|
|
32
98
|
export declare class ConsoleApprovalsM2MService {
|
|
33
99
|
static moveClusterOwner(params: MoveClusterOwnerThroughApprovalRequest): Promise<MoveClusterOwnerResult>;
|
|
100
|
+
/**
|
|
101
|
+
* Changes the plan type and the hardware packages of one cluster.
|
|
102
|
+
*
|
|
103
|
+
* Console checks the reservations of the organization, and it moves the
|
|
104
|
+
* cluster plan to the active plan of the new type when that plan is
|
|
105
|
+
* migratable from the plan of the cluster. It answers 409 when one of the
|
|
106
|
+
* `expected…` fields of the body differs at the run: the plan type, the
|
|
107
|
+
* hardware packages, the cluster plan or the active modification config
|
|
108
|
+
* of the cluster, or the active plan of the new type. A cluster that runs
|
|
109
|
+
* no plan and a type that has no active plan meet that guard too, because
|
|
110
|
+
* both fields of the body are required. It answers 400 when the request
|
|
111
|
+
* changes nothing, when the new type is retired, when its active plan is
|
|
112
|
+
* neither the plan of the cluster nor migratable from it, or when the
|
|
113
|
+
* organization has no free reservation.
|
|
114
|
+
*/
|
|
115
|
+
static changeClusterPlanType(params: ChangeClusterPlanTypeThroughApprovalRequest): Promise<ChangeClusterPlanTypeResult>;
|
|
34
116
|
/**
|
|
35
117
|
* Runs one step of a cluster bulk operation on one cluster.
|
|
36
118
|
*
|
|
@@ -44,4 +126,16 @@ export declare class ConsoleApprovalsM2MService {
|
|
|
44
126
|
* operation of console-backend posts the same message after its run.
|
|
45
127
|
*/
|
|
46
128
|
static announceClusterBulkPlanUpdate(params: AnnounceClusterBulkPlanUpdateRequest): Promise<void>;
|
|
129
|
+
/** Deletes an internal (incident) backup of a cluster. It cannot be undone. */
|
|
130
|
+
static deleteInternalBackup(params: DeleteInternalBackupThroughApprovalRequest): Promise<BackupDto>;
|
|
131
|
+
/** Creates a cluster plan for a Camundi, with the uuid that the caller gives. */
|
|
132
|
+
static createCustomerClusterPlan(params: CreateCustomerClusterPlanThroughApprovalRequest): Promise<CustomerClusterPlanThroughApprovalResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Asks whether a Camundi may remove a plan. Console answers 403 for a plan
|
|
135
|
+
* of another person, and 409 for a plan that a cluster uses.
|
|
136
|
+
*/
|
|
137
|
+
static checkCustomerClusterPlanRemoval(params: CheckCustomerClusterPlanRemovalRequest): Promise<CustomerClusterPlanThroughApprovalResult>;
|
|
138
|
+
/** Deletes a cluster plan that the Camundi created. It cannot be undone. */
|
|
139
|
+
static deleteCustomerClusterPlan(params: DeleteCustomerClusterPlanThroughApprovalRequest): Promise<CustomerClusterPlanThroughApprovalResult>;
|
|
140
|
+
private static callClusterPlan;
|
|
47
141
|
}
|
|
@@ -30,6 +30,50 @@ class ConsoleApprovalsM2MService {
|
|
|
30
30
|
}
|
|
31
31
|
return response.body;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Changes the plan type and the hardware packages of one cluster.
|
|
35
|
+
*
|
|
36
|
+
* Console checks the reservations of the organization, and it moves the
|
|
37
|
+
* cluster plan to the active plan of the new type when that plan is
|
|
38
|
+
* migratable from the plan of the cluster. It answers 409 when one of the
|
|
39
|
+
* `expected…` fields of the body differs at the run: the plan type, the
|
|
40
|
+
* hardware packages, the cluster plan or the active modification config
|
|
41
|
+
* of the cluster, or the active plan of the new type. A cluster that runs
|
|
42
|
+
* no plan and a type that has no active plan meet that guard too, because
|
|
43
|
+
* both fields of the body are required. It answers 400 when the request
|
|
44
|
+
* changes nothing, when the new type is retired, when its active plan is
|
|
45
|
+
* neither the plan of the cluster nor migratable from it, or when the
|
|
46
|
+
* organization has no free reservation.
|
|
47
|
+
*/
|
|
48
|
+
static async changeClusterPlanType(params) {
|
|
49
|
+
const serviceContext = {
|
|
50
|
+
method: {
|
|
51
|
+
name: "ConsoleApprovalsM2MService.changeClusterPlanType",
|
|
52
|
+
url: `api/admin/approvals/clusters/${params.params.clusterId}/plan-type`,
|
|
53
|
+
normalizedUrl: "api/admin/approvals/clusters/:clusterId/plan-type",
|
|
54
|
+
type: "patch"
|
|
55
|
+
},
|
|
56
|
+
source: params.config.metrics?.source || "unset",
|
|
57
|
+
target: { name: "console", type: "internal" }
|
|
58
|
+
};
|
|
59
|
+
const response = await request({
|
|
60
|
+
config: params.config,
|
|
61
|
+
base: { id: "console" },
|
|
62
|
+
url: serviceContext.method.url,
|
|
63
|
+
method: serviceContext.method.type,
|
|
64
|
+
metricsDetails: serviceContext,
|
|
65
|
+
responseType: "json",
|
|
66
|
+
body: params.body
|
|
67
|
+
});
|
|
68
|
+
if (!response.ok || !response.body) {
|
|
69
|
+
throw new HttpError(
|
|
70
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
71
|
+
response.status,
|
|
72
|
+
response.statusText
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
return response.body;
|
|
76
|
+
}
|
|
33
77
|
/**
|
|
34
78
|
* Runs one step of a cluster bulk operation on one cluster.
|
|
35
79
|
*
|
|
@@ -98,6 +142,104 @@ class ConsoleApprovalsM2MService {
|
|
|
98
142
|
);
|
|
99
143
|
}
|
|
100
144
|
}
|
|
145
|
+
/** Deletes an internal (incident) backup of a cluster. It cannot be undone. */
|
|
146
|
+
static async deleteInternalBackup(params) {
|
|
147
|
+
const { clusterId, backupName } = params.params;
|
|
148
|
+
const serviceContext = {
|
|
149
|
+
method: {
|
|
150
|
+
name: "ConsoleApprovalsM2MService.deleteInternalBackup",
|
|
151
|
+
url: `api/admin/approvals/clusters/${clusterId}/internal-backups/${encodeURIComponent(backupName)}`,
|
|
152
|
+
normalizedUrl: "api/admin/approvals/clusters/:clusterId/internal-backups/:backupName",
|
|
153
|
+
type: "delete"
|
|
154
|
+
},
|
|
155
|
+
source: params.config.metrics?.source || "unset",
|
|
156
|
+
target: { name: "console", type: "internal" }
|
|
157
|
+
};
|
|
158
|
+
const response = await request({
|
|
159
|
+
config: params.config,
|
|
160
|
+
base: { id: "console" },
|
|
161
|
+
url: serviceContext.method.url,
|
|
162
|
+
method: serviceContext.method.type,
|
|
163
|
+
metricsDetails: serviceContext,
|
|
164
|
+
responseType: "json",
|
|
165
|
+
body: params.body
|
|
166
|
+
});
|
|
167
|
+
if (!response.ok) {
|
|
168
|
+
throw new HttpError(
|
|
169
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
170
|
+
response.status,
|
|
171
|
+
response.statusText
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
return response.body;
|
|
175
|
+
}
|
|
176
|
+
/** Creates a cluster plan for a Camundi, with the uuid that the caller gives. */
|
|
177
|
+
static async createCustomerClusterPlan(params) {
|
|
178
|
+
return ConsoleApprovalsM2MService.callClusterPlan({
|
|
179
|
+
config: params.config,
|
|
180
|
+
name: "ConsoleApprovalsM2MService.createCustomerClusterPlan",
|
|
181
|
+
url: "api/admin/approvals/cluster-plans",
|
|
182
|
+
normalizedUrl: "api/admin/approvals/cluster-plans",
|
|
183
|
+
type: "post",
|
|
184
|
+
body: params.body
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Asks whether a Camundi may remove a plan. Console answers 403 for a plan
|
|
189
|
+
* of another person, and 409 for a plan that a cluster uses.
|
|
190
|
+
*/
|
|
191
|
+
static async checkCustomerClusterPlanRemoval(params) {
|
|
192
|
+
const { clusterPlanId } = params.params;
|
|
193
|
+
return ConsoleApprovalsM2MService.callClusterPlan({
|
|
194
|
+
config: params.config,
|
|
195
|
+
name: "ConsoleApprovalsM2MService.checkCustomerClusterPlanRemoval",
|
|
196
|
+
url: `api/admin/approvals/cluster-plans/${clusterPlanId}/removal-check`,
|
|
197
|
+
normalizedUrl: "api/admin/approvals/cluster-plans/:clusterPlanId/removal-check",
|
|
198
|
+
type: "post",
|
|
199
|
+
body: params.body
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/** Deletes a cluster plan that the Camundi created. It cannot be undone. */
|
|
203
|
+
static async deleteCustomerClusterPlan(params) {
|
|
204
|
+
const { clusterPlanId } = params.params;
|
|
205
|
+
return ConsoleApprovalsM2MService.callClusterPlan({
|
|
206
|
+
config: params.config,
|
|
207
|
+
name: "ConsoleApprovalsM2MService.deleteCustomerClusterPlan",
|
|
208
|
+
url: `api/admin/approvals/cluster-plans/${clusterPlanId}`,
|
|
209
|
+
normalizedUrl: "api/admin/approvals/cluster-plans/:clusterPlanId",
|
|
210
|
+
type: "delete",
|
|
211
|
+
body: params.body
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
static async callClusterPlan(args) {
|
|
215
|
+
const serviceContext = {
|
|
216
|
+
method: {
|
|
217
|
+
name: args.name,
|
|
218
|
+
url: args.url,
|
|
219
|
+
normalizedUrl: args.normalizedUrl,
|
|
220
|
+
type: args.type
|
|
221
|
+
},
|
|
222
|
+
source: args.config.metrics?.source || "unset",
|
|
223
|
+
target: { name: "console", type: "internal" }
|
|
224
|
+
};
|
|
225
|
+
const response = await request({
|
|
226
|
+
config: args.config,
|
|
227
|
+
base: { id: "console" },
|
|
228
|
+
url: serviceContext.method.url,
|
|
229
|
+
method: serviceContext.method.type,
|
|
230
|
+
metricsDetails: serviceContext,
|
|
231
|
+
responseType: "json",
|
|
232
|
+
body: args.body
|
|
233
|
+
});
|
|
234
|
+
if (!response.ok) {
|
|
235
|
+
throw new HttpError(
|
|
236
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
237
|
+
response.status,
|
|
238
|
+
response.statusText
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
return response.body;
|
|
242
|
+
}
|
|
101
243
|
}
|
|
102
244
|
export {
|
|
103
245
|
ConsoleApprovalsM2MService
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/console/console.approvals.m2m.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 ApprovalM2mActor,\n ClusterBulkStepRequestDto,\n ClusterBulkStepResultDto,\n MoveClusterOwnerResult,\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'\n\n/**\n * The route of `api/admin/approvals` in console-backend.\n *\n * The twin of `AccountsApprovalsM2MService`. Read the note there.\n */\n\nexport interface MoveClusterOwnerThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterId: string }\n body: {\n actor: ApprovalM2mActor\n ownerId: string\n }\n}\n\nexport interface RunClusterBulkStepThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterId: string }\n body: ClusterBulkStepRequestDto & { actor: ApprovalM2mActor }\n}\n\nexport interface AnnounceClusterBulkPlanUpdateRequest\n extends RequestBaseParams {\n body: {\n actor: ApprovalM2mActor\n toPlanUuid: string\n doneCount: number\n }\n}\n\nexport class ConsoleApprovalsM2MService {\n public static async moveClusterOwner(\n params: MoveClusterOwnerThroughApprovalRequest,\n ): Promise<MoveClusterOwnerResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.moveClusterOwner',\n url: `api/admin/approvals/clusters/${params.params.clusterId}/owner`,\n normalizedUrl: 'api/admin/approvals/clusters/:clusterId/owner',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<MoveClusterOwnerResult>({\n config: params.config,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 // This route is new, so there is no older backend that answers 204 with no\n // body for the same-owner case. `ConsoleClusterService.moveClusterOwner`\n // carries that case, and this one does not need it.\n return response.body!\n }\n\n /**\n * Runs one step of a cluster bulk operation on one cluster.\n *\n * Every outcome of the STEP answers 200, including a cluster that refused.\n * A thrown `HttpError` says that the CALL failed, and the caller then\n * leaves the cluster to run again.\n */\n public static async runClusterBulkStep(\n params: RunClusterBulkStepThroughApprovalRequest,\n ): Promise<ClusterBulkStepResultDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.runClusterBulkStep',\n url: `api/admin/approvals/clusters/${params.params.clusterId}/bulk-step`,\n normalizedUrl: 'api/admin/approvals/clusters/:clusterId/bulk-step',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterBulkStepResultDto>({\n config: params.config,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 return response.body\n }\n\n /**\n * Posts the Slack message that ends an approved bulk plan update. The bulk\n * operation of console-backend posts the same message after its run.\n */\n public static async announceClusterBulkPlanUpdate(\n params: AnnounceClusterBulkPlanUpdateRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.announceClusterBulkPlanUpdate',\n url: 'api/admin/approvals/cluster-bulk/plan-update-announcement',\n normalizedUrl:\n 'api/admin/approvals/cluster-bulk/plan-update-announcement',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n body: params.body,\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 {\n ApprovalM2mActor,\n BackupDto,\n ChangeClusterPlanTypeResult,\n ClusterBulkStepRequestDto,\n ClusterBulkStepResultDto,\n MoveClusterOwnerResult,\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'\n\n/**\n * The route of `api/admin/approvals` in console-backend.\n *\n * The twin of `AccountsApprovalsM2MService`. Read the note there.\n */\n\nexport interface MoveClusterOwnerThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterId: string }\n body: {\n actor: ApprovalM2mActor\n ownerId: string\n }\n}\n\nexport interface ChangeClusterPlanTypeThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterId: string }\n body: {\n actor: ApprovalM2mActor\n /** The organization that owns the cluster. Console refuses another one. */\n orgId: string\n toPlanTypeUuid: string\n numberOfAllocatedHwPackages: number\n /**\n * The plan type that the person who asked READ. Console compares it with\n * the plan type of the cluster when the action runs, and changes nothing\n * when the two differ.\n */\n expectedPlanTypeUuid: string\n /** The packages the person READ, 1 for a cluster that holds none. */\n expectedNumberOfAllocatedHwPackages: number\n /** The plan the cluster ran when the person read it. */\n expectedClusterPlanUuid: string\n /** The active modification config the person read, absent for none. */\n expectedActiveModificationConfigUuid?: string\n /** The active plan of the new plan type the person read. */\n expectedTargetPlanUuid: string\n /** Whether the cluster plan moves to that plan, as the person read it. */\n expectedClusterPlanUpdate: boolean\n }\n}\n\nexport interface RunClusterBulkStepThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterId: string }\n body: ClusterBulkStepRequestDto & { actor: ApprovalM2mActor }\n}\n\nexport interface AnnounceClusterBulkPlanUpdateRequest\n extends RequestBaseParams {\n body: {\n actor: ApprovalM2mActor\n toPlanUuid: string\n doneCount: number\n }\n}\n\nexport interface DeleteInternalBackupThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterId: string; backupName: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport interface CreateCustomerClusterPlanThroughApprovalRequest\n extends RequestBaseParams {\n body: {\n actor: ApprovalM2mActor\n clusterPlanId: string\n name: string\n plan: Record<string, unknown>\n }\n}\n\nexport interface CheckCustomerClusterPlanRemovalRequest\n extends RequestBaseParams {\n params: { clusterPlanId: string }\n body: { actor: ApprovalM2mActor; forDelete: boolean }\n}\n\nexport interface DeleteCustomerClusterPlanThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterPlanId: string }\n body: { actor: ApprovalM2mActor }\n}\n\n/** What console answers for a customer cluster plan call. */\nexport interface CustomerClusterPlanThroughApprovalResult {\n clusterPlanId: string\n}\n\nexport class ConsoleApprovalsM2MService {\n public static async moveClusterOwner(\n params: MoveClusterOwnerThroughApprovalRequest,\n ): Promise<MoveClusterOwnerResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.moveClusterOwner',\n url: `api/admin/approvals/clusters/${params.params.clusterId}/owner`,\n normalizedUrl: 'api/admin/approvals/clusters/:clusterId/owner',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<MoveClusterOwnerResult>({\n config: params.config,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 // This route is new, so there is no older backend that answers 204 with no\n // body for the same-owner case. `ConsoleClusterService.moveClusterOwner`\n // carries that case, and this one does not need it.\n return response.body!\n }\n\n /**\n * Changes the plan type and the hardware packages of one cluster.\n *\n * Console checks the reservations of the organization, and it moves the\n * cluster plan to the active plan of the new type when that plan is\n * migratable from the plan of the cluster. It answers 409 when one of the\n * `expected\u2026` fields of the body differs at the run: the plan type, the\n * hardware packages, the cluster plan or the active modification config\n * of the cluster, or the active plan of the new type. A cluster that runs\n * no plan and a type that has no active plan meet that guard too, because\n * both fields of the body are required. It answers 400 when the request\n * changes nothing, when the new type is retired, when its active plan is\n * neither the plan of the cluster nor migratable from it, or when the\n * organization has no free reservation.\n */\n public static async changeClusterPlanType(\n params: ChangeClusterPlanTypeThroughApprovalRequest,\n ): Promise<ChangeClusterPlanTypeResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.changeClusterPlanType',\n url: `api/admin/approvals/clusters/${params.params.clusterId}/plan-type`,\n normalizedUrl: 'api/admin/approvals/clusters/:clusterId/plan-type',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ChangeClusterPlanTypeResult>({\n config: params.config,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 return response.body\n }\n\n /**\n * Runs one step of a cluster bulk operation on one cluster.\n *\n * Every outcome of the STEP answers 200, including a cluster that refused.\n * A thrown `HttpError` says that the CALL failed, and the caller then\n * leaves the cluster to run again.\n */\n public static async runClusterBulkStep(\n params: RunClusterBulkStepThroughApprovalRequest,\n ): Promise<ClusterBulkStepResultDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.runClusterBulkStep',\n url: `api/admin/approvals/clusters/${params.params.clusterId}/bulk-step`,\n normalizedUrl: 'api/admin/approvals/clusters/:clusterId/bulk-step',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterBulkStepResultDto>({\n config: params.config,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 return response.body\n }\n\n /**\n * Posts the Slack message that ends an approved bulk plan update. The bulk\n * operation of console-backend posts the same message after its run.\n */\n public static async announceClusterBulkPlanUpdate(\n params: AnnounceClusterBulkPlanUpdateRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.announceClusterBulkPlanUpdate',\n url: 'api/admin/approvals/cluster-bulk/plan-update-announcement',\n normalizedUrl:\n 'api/admin/approvals/cluster-bulk/plan-update-announcement',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n body: params.body,\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 /** Deletes an internal (incident) backup of a cluster. It cannot be undone. */\n public static async deleteInternalBackup(\n params: DeleteInternalBackupThroughApprovalRequest,\n ): Promise<BackupDto> {\n const { clusterId, backupName } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.deleteInternalBackup',\n url: `api/admin/approvals/clusters/${clusterId}/internal-backups/${encodeURIComponent(backupName)}`,\n normalizedUrl:\n 'api/admin/approvals/clusters/:clusterId/internal-backups/: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 config: params.config,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 return response.body!\n }\n\n /** Creates a cluster plan for a Camundi, with the uuid that the caller gives. */\n public static async createCustomerClusterPlan(\n params: CreateCustomerClusterPlanThroughApprovalRequest,\n ): Promise<CustomerClusterPlanThroughApprovalResult> {\n return ConsoleApprovalsM2MService.callClusterPlan({\n config: params.config,\n name: 'ConsoleApprovalsM2MService.createCustomerClusterPlan',\n url: 'api/admin/approvals/cluster-plans',\n normalizedUrl: 'api/admin/approvals/cluster-plans',\n type: 'post',\n body: params.body,\n })\n }\n\n /**\n * Asks whether a Camundi may remove a plan. Console answers 403 for a plan\n * of another person, and 409 for a plan that a cluster uses.\n */\n public static async checkCustomerClusterPlanRemoval(\n params: CheckCustomerClusterPlanRemovalRequest,\n ): Promise<CustomerClusterPlanThroughApprovalResult> {\n const { clusterPlanId } = params.params\n return ConsoleApprovalsM2MService.callClusterPlan({\n config: params.config,\n name: 'ConsoleApprovalsM2MService.checkCustomerClusterPlanRemoval',\n url: `api/admin/approvals/cluster-plans/${clusterPlanId}/removal-check`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plans/:clusterPlanId/removal-check',\n type: 'post',\n body: params.body,\n })\n }\n\n /** Deletes a cluster plan that the Camundi created. It cannot be undone. */\n public static async deleteCustomerClusterPlan(\n params: DeleteCustomerClusterPlanThroughApprovalRequest,\n ): Promise<CustomerClusterPlanThroughApprovalResult> {\n const { clusterPlanId } = params.params\n return ConsoleApprovalsM2MService.callClusterPlan({\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteCustomerClusterPlan',\n url: `api/admin/approvals/cluster-plans/${clusterPlanId}`,\n normalizedUrl: 'api/admin/approvals/cluster-plans/:clusterPlanId',\n type: 'delete',\n body: params.body,\n })\n }\n\n private static async callClusterPlan(args: {\n config: RequestBaseParams['config']\n name: string\n url: string\n normalizedUrl: string\n type: 'post' | 'delete'\n body: unknown\n }): Promise<CustomerClusterPlanThroughApprovalResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: args.name,\n url: args.url,\n normalizedUrl: args.normalizedUrl,\n type: args.type,\n },\n source: args.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<CustomerClusterPlanThroughApprovalResult>({\n config: args.config,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: args.body,\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 return response.body!\n }\n}\n"],
|
|
5
|
+
"mappings": "AAkBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA6FnB,MAAM,2BAA2B;AAAA,EACtC,aAAoB,iBAClB,QACi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,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,KAAK;AAAA,IACb,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;AACA,WAAO,SAAS;AAAA,EAClB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -51,11 +51,17 @@ export interface ConsoleClusterCreationParametersClusterPlanType {
|
|
|
51
51
|
};
|
|
52
52
|
[key: string]: unknown;
|
|
53
53
|
}
|
|
54
|
+
export interface ConsoleClusterCreationParametersUnlockedClusterPlan {
|
|
55
|
+
uuid: string;
|
|
56
|
+
name?: string;
|
|
57
|
+
}
|
|
54
58
|
export interface ConsoleClusterCreationParametersResponse {
|
|
55
59
|
regions?: ConsoleClusterCreationParametersRegion[];
|
|
56
60
|
channels?: ConsoleClusterCreationParametersChannel[];
|
|
57
61
|
clusterPlanTypes?: ConsoleClusterCreationParametersClusterPlanType[];
|
|
58
62
|
clusterPlanTypesFromSalesPlan?: ConsoleClusterCreationParametersClusterPlanType[];
|
|
63
|
+
/** Only when the flag `shared.unlockedClusterPlans` is on. */
|
|
64
|
+
unlockedClusterPlans?: ConsoleClusterCreationParametersUnlockedClusterPlan[];
|
|
59
65
|
}
|
|
60
66
|
export interface GetConsoleClusterCreationParametersRequest extends RequestBaseParams {
|
|
61
67
|
params: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/console/console.cluster-parameters.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 ConsoleClusterCreationParametersRegionBackupRegion {\n id?: string\n uuid?: string\n label?: string\n name?: string\n}\n\nexport interface ConsoleClusterCreationParametersRegionBackup {\n uuid: string\n regions?: ConsoleClusterCreationParametersRegionBackupRegion[]\n /** True when this pairing's operator support is complete enough to fail over. */\n failover?: boolean\n}\n\nexport interface ConsoleClusterCreationParametersRegion {\n uuid: string\n name?: string\n provider?: string\n backups?: ConsoleClusterCreationParametersRegionBackup[]\n}\n\nexport interface ConsoleClusterCreationParametersGenerationVersionInfo {\n zeebe?: string\n [key: string]: unknown\n}\n\nexport interface ConsoleClusterCreationParametersGeneration {\n uuid: string\n name?: string\n classification?: 'channel' | 'existingCluster' | 'orgUnlocked'\n versions?: ConsoleClusterCreationParametersGenerationVersionInfo\n [key: string]: unknown\n}\n\nexport interface ConsoleClusterCreationParametersChannel {\n uuid: string\n name?: string\n description?: string\n isDefault?: boolean\n defaultGeneration?: {\n uuid?: string\n }\n allowedGenerations?: ConsoleClusterCreationParametersGeneration[]\n [key: string]: unknown\n}\n\nexport interface ConsoleClusterCreationParametersClusterPlanType {\n uuid: string\n name?: string\n description?: string\n development?: boolean\n category?: string\n availabilityClass?: string\n activePlan?: {\n uuid?: string\n }\n [key: string]: unknown\n}\n\nexport interface ConsoleClusterCreationParametersResponse {\n regions?: ConsoleClusterCreationParametersRegion[]\n channels?: ConsoleClusterCreationParametersChannel[]\n clusterPlanTypes?: ConsoleClusterCreationParametersClusterPlanType[]\n clusterPlanTypesFromSalesPlan?: ConsoleClusterCreationParametersClusterPlanType[]\n}\n\nexport interface GetConsoleClusterCreationParametersRequest\n extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport class ConsoleClusterParametersService {\n public static async getCreationParameters(\n params: GetConsoleClusterCreationParametersRequest,\n ): Promise<ConsoleClusterCreationParametersResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterParametersService.getCreationParameters',\n url: `api/orgs/${params.params.orgId}/clusters/parameters`,\n normalizedUrl: 'api/orgs/:orgId/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<ConsoleClusterCreationParametersResponse>({\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 === undefined) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n}\n"],
|
|
5
|
-
"mappings": "AAUA,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 {\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 ConsoleClusterCreationParametersRegionBackupRegion {\n id?: string\n uuid?: string\n label?: string\n name?: string\n}\n\nexport interface ConsoleClusterCreationParametersRegionBackup {\n uuid: string\n regions?: ConsoleClusterCreationParametersRegionBackupRegion[]\n /** True when this pairing's operator support is complete enough to fail over. */\n failover?: boolean\n}\n\nexport interface ConsoleClusterCreationParametersRegion {\n uuid: string\n name?: string\n provider?: string\n backups?: ConsoleClusterCreationParametersRegionBackup[]\n}\n\nexport interface ConsoleClusterCreationParametersGenerationVersionInfo {\n zeebe?: string\n [key: string]: unknown\n}\n\nexport interface ConsoleClusterCreationParametersGeneration {\n uuid: string\n name?: string\n classification?: 'channel' | 'existingCluster' | 'orgUnlocked'\n versions?: ConsoleClusterCreationParametersGenerationVersionInfo\n [key: string]: unknown\n}\n\nexport interface ConsoleClusterCreationParametersChannel {\n uuid: string\n name?: string\n description?: string\n isDefault?: boolean\n defaultGeneration?: {\n uuid?: string\n }\n allowedGenerations?: ConsoleClusterCreationParametersGeneration[]\n [key: string]: unknown\n}\n\nexport interface ConsoleClusterCreationParametersClusterPlanType {\n uuid: string\n name?: string\n description?: string\n development?: boolean\n category?: string\n availabilityClass?: string\n activePlan?: {\n uuid?: string\n }\n [key: string]: unknown\n}\n\nexport interface ConsoleClusterCreationParametersUnlockedClusterPlan {\n uuid: string\n name?: string\n}\n\nexport interface ConsoleClusterCreationParametersResponse {\n regions?: ConsoleClusterCreationParametersRegion[]\n channels?: ConsoleClusterCreationParametersChannel[]\n clusterPlanTypes?: ConsoleClusterCreationParametersClusterPlanType[]\n clusterPlanTypesFromSalesPlan?: ConsoleClusterCreationParametersClusterPlanType[]\n /** Only when the flag `shared.unlockedClusterPlans` is on. */\n unlockedClusterPlans?: ConsoleClusterCreationParametersUnlockedClusterPlan[]\n}\n\nexport interface GetConsoleClusterCreationParametersRequest\n extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport class ConsoleClusterParametersService {\n public static async getCreationParameters(\n params: GetConsoleClusterCreationParametersRequest,\n ): Promise<ConsoleClusterCreationParametersResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterParametersService.getCreationParameters',\n url: `api/orgs/${params.params.orgId}/clusters/parameters`,\n normalizedUrl: 'api/orgs/:orgId/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<ConsoleClusterCreationParametersResponse>({\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 === undefined) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n}\n"],
|
|
5
|
+
"mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAkFnB,MAAM,gCAAgC;AAAA,EAC3C,aAAoB,sBAClB,QACmD;AACnD,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,YAAY,OAAO,OAAO,KAAK;AAAA,QACpC,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,QAAkD;AAAA,MACvE,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,SAAS,SAAS,QAAW;AAC/B,YAAM,IAAI,MAAM,GAAG,eAAe,OAAO,IAAI,uBAAuB;AAAA,IACtE;AAEA,WAAO,SAAS;AAAA,EAClB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,6 +23,8 @@ export interface CreateConsoleClusterRequest extends RequestBaseParams {
|
|
|
23
23
|
tasklistV2Enabled?: boolean;
|
|
24
24
|
identityBackendChecksEnabled?: boolean;
|
|
25
25
|
description?: string;
|
|
26
|
+
/** A plan of the org's `clusterPlanWhiteList`. */
|
|
27
|
+
clusterPlanId?: string;
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
export interface CreateConsoleClusterResponse {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/console/console.cluster.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 ClusterLabels,\n ConsoleClusterDto,\n ExternalIdpConfig,\n MoveClusterOwnerResult,\n OptimizeFilteringConfig,\n SecretsFilterMode,\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'\n\nexport interface GetConsoleClustersRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface CreateConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n body: {\n name: string\n planTypeId: string\n channelId: string\n generationId: string\n k8sContextId: string\n autoUpdate?: boolean\n stageLabel?: string\n backupRegionId?: string\n encryption?: string\n numberOfAllocatedHwPackages?: number\n tasklistV2Enabled?: boolean\n identityBackendChecksEnabled?: boolean\n description?: string\n }\n}\n\nexport interface CreateConsoleClusterResponse {\n clusterId: string\n}\n\n/**\n * The body of a duplicate is the body of a create: the fields that the customer\n * selects again for the new cluster. Every other setting of the source cluster\n * comes from console-backend.\n */\nexport interface DuplicateConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: CreateConsoleClusterRequest['body'] & {\n /**\n * Deletes the source cluster once the new cluster exists. An org that holds\n * one reservation can duplicate a cluster only this way. It needs the\n * permission to delete a cluster.\n */\n replaceSource?: boolean\n }\n}\n\n/** The result of one carry-over step of a duplicate. */\nexport type ConsoleClusterCarryOverResult = 'ok' | 'skipped' | { error: string }\n\nexport interface DuplicateConsoleClusterResponse {\n clusterId: string\n /**\n * False when `replaceSource` was asked for and the source cluster is still\n * there: either a carry-over step failed, which stops the delete, or the\n * delete itself failed. The new cluster exists either way, thus the caller\n * must tell the customer to delete the source cluster by hand.\n */\n sourceDeleted?: boolean\n /**\n * A step that failed does not fail the duplicate: the new cluster exists\n * either way. Thus the caller must show the steps that did not complete.\n */\n carryOver: {\n clusterClients: ConsoleClusterCarryOverResult\n connectorSecrets: ConsoleClusterCarryOverResult\n alerts: ConsoleClusterCarryOverResult\n byom: ConsoleClusterCarryOverResult\n byoidp: ConsoleClusterCarryOverResult\n backupSchedule: ConsoleClusterCarryOverResult\n }\n}\n\nexport interface WakeConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface SuspendConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface ProxyOrchestrationClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n region: string\n app: 'tasklist' | 'optimize' | 'operate' | 'zeebe' | 'identity'\n route?: string\n headers: {\n [key: string]: string\n }\n }\n body?: unknown\n method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'\n}\n\nexport interface UpdateClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n name?: string\n description?: string\n labels?: ClusterLabels\n primaryEncryptionKeyId?: string\n secondaryEncryptionKeyId?: string\n numberOfAllocatedHwPackages?: number\n mcpEnabled?: boolean\n playMode?: boolean\n swagger?: boolean\n tasklistV2Enabled?: boolean\n optimizeEnabled?: boolean\n autoUpdate?: boolean\n enforceGroups?: boolean\n rba?: boolean\n identityBackendChecksEnabled?: boolean\n multiTenancyEnabled?: boolean\n sessionMaxInactiveIntervalMinutes?: number\n sessionHeartbeatEnabled?: boolean\n // BYOIDP Phase 1 (#3190). Secret is sent via updateExternalIdpSecret, not here.\n externalIdpEnabled?: boolean\n externalIdpConfig?: ExternalIdpConfig\n businessIdUniquenessEnabled?: boolean\n appIntegrationsEnabled?: boolean\n secretsFilterMode?: SecretsFilterMode\n auditLogEnabled?: boolean | null\n auditLogUserCategories?: string[] | null\n auditLogClientCategories?: string[] | null\n /** null deactivates filtering; otherwise the full config replaces what's stored. */\n optimizeFiltering?: OptimizeFilteringConfig | null\n }\n}\n\n// BYOIDP Phase 1 (#3190): write the OIDC client secret. Separate from updateCluster \u2014\n// the value never travels through the cluster PATCH/DB/CR path.\nexport interface UpdateExternalIdpSecretRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n name: string\n clientSecret: string\n }\n}\n\n// BYOIDP (#9864): remove the whole external-IdP setup \u2014 config, CR entry, and\n// delivered secret. Distinct from the enable/disable toggle, which keeps the config.\nexport interface DeleteExternalIdpRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface GetConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface MoveClusterOwnerRequest extends RequestBaseParams {\n params: {\n clusterId: string\n }\n body: {\n ownerId: string\n }\n}\n\nexport interface GetAdminClusterRequest extends RequestBaseParams {\n params: {\n clusterId: string\n }\n}\n\nexport interface FailoverConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n /** Backups to clone into the failover cluster (one or more). */\n backupIds: string[]\n /** The single backup to restore from immediately; must be one of `backupIds`. */\n restoreBackupId: string\n }\n}\n\nexport interface FailoverConsoleClusterResult {\n newClusterId: string\n results: {\n backupClone: 'ok' | { error: string }\n restore: 'ok' | { error: string }\n }\n}\n\nexport interface DeleteConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport class ConsoleClusterService {\n public static async getClusters(\n params: GetConsoleClustersRequest,\n ): Promise<ConsoleClusterDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getClusters',\n url: `api/orgs/${params.params.orgId}/clusters`,\n normalizedUrl: 'api/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<ConsoleClusterDto[]>({\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 createCluster(\n params: CreateConsoleClusterRequest,\n ): Promise<CreateConsoleClusterResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.createCluster',\n url: `api/orgs/${params.params.orgId}/clusters`,\n normalizedUrl: 'api/orgs/:orgId/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<CreateConsoleClusterResponse>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 duplicateCluster(\n params: DuplicateConsoleClusterRequest,\n ): Promise<DuplicateConsoleClusterResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.duplicateCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/duplicate`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/duplicate',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<DuplicateConsoleClusterResponse>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 getCluster(\n params: GetConsoleClusterRequest,\n ): Promise<ConsoleClusterDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/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<ConsoleClusterDto>({\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 public static async suspendCluster(\n params: SuspendConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.suspendCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/suspend`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/suspend',\n type: 'post',\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 wakeCluster(\n params: WakeConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.wakeCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/wake`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/wake',\n type: 'post',\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 /**\n * Proxy request to orchestration cluster application\n * @param params - Request parameters including clusterId, region, app, and optional route\n * @returns Response from the orchestration cluster\n */\n public static async proxyOrchestrationCluster<TResponse = unknown>(\n params: ProxyOrchestrationClusterRequest,\n ): Promise<TResponse> {\n const method = params.method || 'GET'\n const route = params.params.route || ''\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `ConsoleClusterService.proxyOrchestrationCluster`,\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/oc`,\n normalizedUrl: `api/orgs/:orgId/clusters/:clusterId/oc`,\n type: method.toLowerCase() as\n | 'get'\n | 'post'\n | 'put'\n | 'patch'\n | 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n // Construct request body with _cluster metadata and body payload\n const requestBody = {\n _cluster: {\n region: params.params.region,\n app: params.params.app,\n route,\n },\n body: params.body,\n }\n\n const response = await request<TResponse>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: requestBody,\n headers: params.params.headers,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 === undefined) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n /**\n * Update cluster properties\n * @param params - Request parameters including orgId, clusterId, and properties to update\n * @returns void\n */\n public static async updateCluster(\n params: UpdateClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.updateCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: params.body,\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 // BYOIDP Phase 1 (#3190). Call BEFORE updateCluster enables the provider so the CR\n // never references a not-yet-written Secret (fail-closed ordering, design \u00A73).\n public static async updateExternalIdpSecret(\n params: UpdateExternalIdpSecretRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.updateExternalIdpSecret',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/external-idp/secret`,\n normalizedUrl:\n 'api/orgs/:orgId/clusters/:clusterId/external-idp/secret',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: params.body,\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 // BYOIDP (#9864). Clears the config, the CR entry, and the delivered secret in\n // one call. The backend owns the order \u2014 see the route in ClusterRouter.ts.\n public static async deleteExternalIdp(\n params: DeleteExternalIdpRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.deleteExternalIdp',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/external-idp`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/external-idp',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\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 /**\n * Reads one cluster by its id alone, on the admin route.\n *\n * The org-scoped `getCluster` needs the owning organization, which is the very\n * thing a caller that only holds a cluster id does not know. This admin route\n * (`api/admin/clusters/:clusterId`) resolves the cluster without it, so a\n * caller can read `ownerId` \u2014 the current owning organization. It needs\n * `clusters.canReadAllClusterInfo` on the backend.\n */\n public static async getAdminCluster(\n params: GetAdminClusterRequest,\n ): Promise<ConsoleClusterDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getAdminCluster',\n url: `api/admin/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/admin/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<ConsoleClusterDto>({\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 public static async moveClusterOwner(\n params: MoveClusterOwnerRequest,\n ): Promise<MoveClusterOwnerResult | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.moveClusterOwner',\n url: `api/admin/clusters/${params.params.clusterId}/owner`,\n normalizedUrl: 'api/admin/clusters/:clusterId/owner',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<MoveClusterOwnerResult>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 // The current backend answers 200 with `ownerUnchanged: true` for the\n // no-op case (the owner does not change). An older backend, still live\n // during a rollout, answers 204 with no body for that same case.\n // `request()` still parses an empty body as `{}` for a 'json' response\n // type, so the 204 case needs its own check.\n if (response.status === 204) {\n return undefined\n }\n\n return response.body\n }\n\n public static async failoverCluster(\n params: FailoverConsoleClusterRequest,\n ): Promise<FailoverConsoleClusterResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.failoverCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/failover`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/failover',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<FailoverConsoleClusterResult>({\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 deleteCluster(\n params: DeleteConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.deleteCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\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": "AAkBA,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 {\n ClusterLabels,\n ConsoleClusterDto,\n ExternalIdpConfig,\n MoveClusterOwnerResult,\n OptimizeFilteringConfig,\n SecretsFilterMode,\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'\n\nexport interface GetConsoleClustersRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface CreateConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n body: {\n name: string\n planTypeId: string\n channelId: string\n generationId: string\n k8sContextId: string\n autoUpdate?: boolean\n stageLabel?: string\n backupRegionId?: string\n encryption?: string\n numberOfAllocatedHwPackages?: number\n tasklistV2Enabled?: boolean\n identityBackendChecksEnabled?: boolean\n description?: string\n /** A plan of the org's `clusterPlanWhiteList`. */\n clusterPlanId?: string\n }\n}\n\nexport interface CreateConsoleClusterResponse {\n clusterId: string\n}\n\n/**\n * The body of a duplicate is the body of a create: the fields that the customer\n * selects again for the new cluster. Every other setting of the source cluster\n * comes from console-backend.\n */\nexport interface DuplicateConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: CreateConsoleClusterRequest['body'] & {\n /**\n * Deletes the source cluster once the new cluster exists. An org that holds\n * one reservation can duplicate a cluster only this way. It needs the\n * permission to delete a cluster.\n */\n replaceSource?: boolean\n }\n}\n\n/** The result of one carry-over step of a duplicate. */\nexport type ConsoleClusterCarryOverResult = 'ok' | 'skipped' | { error: string }\n\nexport interface DuplicateConsoleClusterResponse {\n clusterId: string\n /**\n * False when `replaceSource` was asked for and the source cluster is still\n * there: either a carry-over step failed, which stops the delete, or the\n * delete itself failed. The new cluster exists either way, thus the caller\n * must tell the customer to delete the source cluster by hand.\n */\n sourceDeleted?: boolean\n /**\n * A step that failed does not fail the duplicate: the new cluster exists\n * either way. Thus the caller must show the steps that did not complete.\n */\n carryOver: {\n clusterClients: ConsoleClusterCarryOverResult\n connectorSecrets: ConsoleClusterCarryOverResult\n alerts: ConsoleClusterCarryOverResult\n byom: ConsoleClusterCarryOverResult\n byoidp: ConsoleClusterCarryOverResult\n backupSchedule: ConsoleClusterCarryOverResult\n }\n}\n\nexport interface WakeConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface SuspendConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface ProxyOrchestrationClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n region: string\n app: 'tasklist' | 'optimize' | 'operate' | 'zeebe' | 'identity'\n route?: string\n headers: {\n [key: string]: string\n }\n }\n body?: unknown\n method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'\n}\n\nexport interface UpdateClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n name?: string\n description?: string\n labels?: ClusterLabels\n primaryEncryptionKeyId?: string\n secondaryEncryptionKeyId?: string\n numberOfAllocatedHwPackages?: number\n mcpEnabled?: boolean\n playMode?: boolean\n swagger?: boolean\n tasklistV2Enabled?: boolean\n optimizeEnabled?: boolean\n autoUpdate?: boolean\n enforceGroups?: boolean\n rba?: boolean\n identityBackendChecksEnabled?: boolean\n multiTenancyEnabled?: boolean\n sessionMaxInactiveIntervalMinutes?: number\n sessionHeartbeatEnabled?: boolean\n // BYOIDP Phase 1 (#3190). Secret is sent via updateExternalIdpSecret, not here.\n externalIdpEnabled?: boolean\n externalIdpConfig?: ExternalIdpConfig\n businessIdUniquenessEnabled?: boolean\n appIntegrationsEnabled?: boolean\n secretsFilterMode?: SecretsFilterMode\n auditLogEnabled?: boolean | null\n auditLogUserCategories?: string[] | null\n auditLogClientCategories?: string[] | null\n /** null deactivates filtering; otherwise the full config replaces what's stored. */\n optimizeFiltering?: OptimizeFilteringConfig | null\n }\n}\n\n// BYOIDP Phase 1 (#3190): write the OIDC client secret. Separate from updateCluster \u2014\n// the value never travels through the cluster PATCH/DB/CR path.\nexport interface UpdateExternalIdpSecretRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n name: string\n clientSecret: string\n }\n}\n\n// BYOIDP (#9864): remove the whole external-IdP setup \u2014 config, CR entry, and\n// delivered secret. Distinct from the enable/disable toggle, which keeps the config.\nexport interface DeleteExternalIdpRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface GetConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface MoveClusterOwnerRequest extends RequestBaseParams {\n params: {\n clusterId: string\n }\n body: {\n ownerId: string\n }\n}\n\nexport interface GetAdminClusterRequest extends RequestBaseParams {\n params: {\n clusterId: string\n }\n}\n\nexport interface FailoverConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n /** Backups to clone into the failover cluster (one or more). */\n backupIds: string[]\n /** The single backup to restore from immediately; must be one of `backupIds`. */\n restoreBackupId: string\n }\n}\n\nexport interface FailoverConsoleClusterResult {\n newClusterId: string\n results: {\n backupClone: 'ok' | { error: string }\n restore: 'ok' | { error: string }\n }\n}\n\nexport interface DeleteConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport class ConsoleClusterService {\n public static async getClusters(\n params: GetConsoleClustersRequest,\n ): Promise<ConsoleClusterDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getClusters',\n url: `api/orgs/${params.params.orgId}/clusters`,\n normalizedUrl: 'api/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<ConsoleClusterDto[]>({\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 createCluster(\n params: CreateConsoleClusterRequest,\n ): Promise<CreateConsoleClusterResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.createCluster',\n url: `api/orgs/${params.params.orgId}/clusters`,\n normalizedUrl: 'api/orgs/:orgId/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<CreateConsoleClusterResponse>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 duplicateCluster(\n params: DuplicateConsoleClusterRequest,\n ): Promise<DuplicateConsoleClusterResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.duplicateCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/duplicate`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/duplicate',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<DuplicateConsoleClusterResponse>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 getCluster(\n params: GetConsoleClusterRequest,\n ): Promise<ConsoleClusterDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/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<ConsoleClusterDto>({\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 public static async suspendCluster(\n params: SuspendConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.suspendCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/suspend`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/suspend',\n type: 'post',\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 wakeCluster(\n params: WakeConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.wakeCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/wake`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/wake',\n type: 'post',\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 /**\n * Proxy request to orchestration cluster application\n * @param params - Request parameters including clusterId, region, app, and optional route\n * @returns Response from the orchestration cluster\n */\n public static async proxyOrchestrationCluster<TResponse = unknown>(\n params: ProxyOrchestrationClusterRequest,\n ): Promise<TResponse> {\n const method = params.method || 'GET'\n const route = params.params.route || ''\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `ConsoleClusterService.proxyOrchestrationCluster`,\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/oc`,\n normalizedUrl: `api/orgs/:orgId/clusters/:clusterId/oc`,\n type: method.toLowerCase() as\n | 'get'\n | 'post'\n | 'put'\n | 'patch'\n | 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n // Construct request body with _cluster metadata and body payload\n const requestBody = {\n _cluster: {\n region: params.params.region,\n app: params.params.app,\n route,\n },\n body: params.body,\n }\n\n const response = await request<TResponse>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: requestBody,\n headers: params.params.headers,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 === undefined) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n /**\n * Update cluster properties\n * @param params - Request parameters including orgId, clusterId, and properties to update\n * @returns void\n */\n public static async updateCluster(\n params: UpdateClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.updateCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: params.body,\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 // BYOIDP Phase 1 (#3190). Call BEFORE updateCluster enables the provider so the CR\n // never references a not-yet-written Secret (fail-closed ordering, design \u00A73).\n public static async updateExternalIdpSecret(\n params: UpdateExternalIdpSecretRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.updateExternalIdpSecret',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/external-idp/secret`,\n normalizedUrl:\n 'api/orgs/:orgId/clusters/:clusterId/external-idp/secret',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: params.body,\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 // BYOIDP (#9864). Clears the config, the CR entry, and the delivered secret in\n // one call. The backend owns the order \u2014 see the route in ClusterRouter.ts.\n public static async deleteExternalIdp(\n params: DeleteExternalIdpRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.deleteExternalIdp',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/external-idp`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/external-idp',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\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 /**\n * Reads one cluster by its id alone, on the admin route.\n *\n * The org-scoped `getCluster` needs the owning organization, which is the very\n * thing a caller that only holds a cluster id does not know. This admin route\n * (`api/admin/clusters/:clusterId`) resolves the cluster without it, so a\n * caller can read `ownerId` \u2014 the current owning organization. It needs\n * `clusters.canReadAllClusterInfo` on the backend.\n */\n public static async getAdminCluster(\n params: GetAdminClusterRequest,\n ): Promise<ConsoleClusterDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getAdminCluster',\n url: `api/admin/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/admin/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<ConsoleClusterDto>({\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 public static async moveClusterOwner(\n params: MoveClusterOwnerRequest,\n ): Promise<MoveClusterOwnerResult | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.moveClusterOwner',\n url: `api/admin/clusters/${params.params.clusterId}/owner`,\n normalizedUrl: 'api/admin/clusters/:clusterId/owner',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<MoveClusterOwnerResult>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\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 // The current backend answers 200 with `ownerUnchanged: true` for the\n // no-op case (the owner does not change). An older backend, still live\n // during a rollout, answers 204 with no body for that same case.\n // `request()` still parses an empty body as `{}` for a 'json' response\n // type, so the 204 case needs its own check.\n if (response.status === 204) {\n return undefined\n }\n\n return response.body\n }\n\n public static async failoverCluster(\n params: FailoverConsoleClusterRequest,\n ): Promise<FailoverConsoleClusterResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.failoverCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/failover`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/failover',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<FailoverConsoleClusterResult>({\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 deleteCluster(\n params: DeleteConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.deleteCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\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": "AAkBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA4NnB,MAAM,sBAAsB;AAAA,EACjC,aAAoB,YAClB,QAC8B;AAC9B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,YAAY,OAAO,OAAO,KAAK;AAAA,QACpC,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MAC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;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;AAAA,EAEA,aAAoB,cAClB,QACe;AACf,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,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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GenerationDto, ReleaseTrainSanityReport, UpgradableGenerationsDto, ZeebeClusterVersionsDto } from '@camunda/ccma-shared-types';
|
|
1
|
+
import type { GenerationDto, ReleaseTrainSanityReport, UpgradableGenerationsDto, UpgradeReadinessDto, 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
|
|
@@ -99,7 +99,23 @@ export declare class GenerationService {
|
|
|
99
99
|
generationUuid: string;
|
|
100
100
|
clusterId: string;
|
|
101
101
|
yolo?: boolean;
|
|
102
|
+
/** Skips the upgrade gate for this upgrade. Needs canUpgradeGeneration. */
|
|
103
|
+
ignoreUpgradeGate?: boolean;
|
|
102
104
|
} & RequestBaseParams): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* The upgrade gate of a cluster, for the customer (PDP-3067). `undefined`
|
|
107
|
+
* when the route answers 404: the stage does not have the flag, so the
|
|
108
|
+
* server enforces no rule.
|
|
109
|
+
*/
|
|
110
|
+
static getUpgradeReadiness(params: {
|
|
111
|
+
orgId: string;
|
|
112
|
+
clusterId: string;
|
|
113
|
+
} & RequestBaseParams): Promise<UpgradeReadinessDto | undefined>;
|
|
114
|
+
/** The same as {@link getUpgradeReadiness}, on the admin route of Control. */
|
|
115
|
+
static getUpgradeReadinessAdmin(params: {
|
|
116
|
+
clusterId: string;
|
|
117
|
+
} & RequestBaseParams): Promise<UpgradeReadinessDto | undefined>;
|
|
118
|
+
private static readUpgradeReadiness;
|
|
103
119
|
static setSupported(params: {
|
|
104
120
|
generationUuid: string;
|
|
105
121
|
unsupportedStartingAt: string | null;
|