@camunda/ccma-api 7.5.0 → 7.7.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.
@@ -30,6 +30,40 @@ class ConsoleApprovalsM2MService {
30
30
  }
31
31
  return response.body;
32
32
  }
33
+ /**
34
+ * The organization and the generation of one cluster, for the check of a
35
+ * forced generation upgrade before the request opens. The route reads the
36
+ * approvals grant, so control-backend needs no read grant of the admin
37
+ * routes. See `ClusterGenerationStateDto`.
38
+ */
39
+ static async readClusterGenerationState(params) {
40
+ const serviceContext = {
41
+ method: {
42
+ name: "ConsoleApprovalsM2MService.readClusterGenerationState",
43
+ url: `api/admin/approvals/clusters/${params.params.clusterId}/generation-state`,
44
+ normalizedUrl: "api/admin/approvals/clusters/:clusterId/generation-state",
45
+ type: "get"
46
+ },
47
+ source: params.config.metrics?.source || "unset",
48
+ target: { name: "console", type: "internal" }
49
+ };
50
+ const response = await request({
51
+ config: params.config,
52
+ base: { id: "console" },
53
+ url: serviceContext.method.url,
54
+ method: serviceContext.method.type,
55
+ metricsDetails: serviceContext,
56
+ responseType: "json"
57
+ });
58
+ if (!response.ok || !response.body) {
59
+ throw new HttpError(
60
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
61
+ response.status,
62
+ response.statusText
63
+ );
64
+ }
65
+ return response.body;
66
+ }
33
67
  /**
34
68
  * The cluster as a plan type change reads it: the fields of the stale
35
69
  * guard of `changeClusterPlanType`, for a comparison before a request
@@ -255,6 +289,43 @@ class ConsoleApprovalsM2MService {
255
289
  );
256
290
  }
257
291
  }
292
+ /**
293
+ * Upgrades the generation of one cluster with `yolo`, past the upgrade
294
+ * gate, or both. Console answers 412 when the cluster left the expected
295
+ * generation, 409 when the upgrade gate blocks the upgrade, and 503 while
296
+ * generation updates are blocked, while a lock of the cluster stays taken,
297
+ * or while Redis does not answer.
298
+ */
299
+ static async forceGenerationUpgrade(params) {
300
+ const { clusterId } = params.params;
301
+ const serviceContext = {
302
+ method: {
303
+ name: "ConsoleApprovalsM2MService.forceGenerationUpgrade",
304
+ url: `api/admin/approvals/clusters/${clusterId}/generation`,
305
+ normalizedUrl: "api/admin/approvals/clusters/:clusterId/generation",
306
+ type: "put"
307
+ },
308
+ source: params.config.metrics?.source || "unset",
309
+ target: { name: "console", type: "internal" }
310
+ };
311
+ const response = await request({
312
+ config: params.config,
313
+ base: { id: "console" },
314
+ url: serviceContext.method.url,
315
+ method: serviceContext.method.type,
316
+ metricsDetails: serviceContext,
317
+ responseType: "json",
318
+ body: params.body
319
+ });
320
+ if (!response.ok) {
321
+ throw new HttpError(
322
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
323
+ response.status,
324
+ response.statusText
325
+ );
326
+ }
327
+ return response.body;
328
+ }
258
329
  /** Deletes an internal (incident) backup of a cluster. It cannot be undone. */
259
330
  static async deleteInternalBackup(params) {
260
331
  const { clusterId, backupName } = params.params;
@@ -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 ApprovalSummaryNamesRequest,\n ApprovalSummaryNamesResult,\n BackupDto,\n ChangeClusterPlanTypeResult,\n ChangeGenerationVersionsResult,\n ChangePlanTypeRetentionLimitsResult,\n ClusterBulkStepRequestDto,\n ClusterBulkStepResultDto,\n ClusterCorpseKind,\n ClusterCorpsesDto,\n ClusterLimits,\n ClusterModificationConfigDto,\n ClusterPlanModificationConfig,\n ClusterPlanTypeClustersDto,\n ClusterPlanTypeLimitsDto,\n ClusterPlanTypeStateDto,\n ClusterTtlDeletionResult,\n DeleteClusterCorpseResult,\n EditGenerationResult,\n ForceDeleteClusterPlanTypeStepResult,\n GenerationEnvVarsDto,\n GenerationImageVersionsDto,\n MoveClusterOwnerResult,\n ReleaseTrainPreview,\n ReleaseTrainPublishPayload,\n ReleaseTrainRollbackPayload,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseParamsConfig,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\nimport type { GenerationService } from './generation.service.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 * Whether the active modification config stays on the cluster. Absent\n * reads as false: the change removes it.\n */\n keepModification?: boolean\n }\n}\n\nexport interface ReadClusterCorpsesRequest extends RequestBaseParams {\n params: { kind: ClusterCorpseKind }\n}\n\nexport interface DeleteClusterCorpseThroughApprovalRequest\n extends RequestBaseParams {\n params: { kind: ClusterCorpseKind; clusterId: string }\n body: {\n actor: ApprovalM2mActor\n /** The context of a `k8s` corpse, where console deletes the resource. */\n k8sContextUuid?: string\n /** The uid of the resource of a `k8s` corpse. See `ClusterCorpseDto.resourceUid`. */\n resourceUid?: string\n }\n}\n\nexport interface ReadClusterPlanTypeClustersRequest extends RequestBaseParams {\n params: { planTypeId: string }\n}\n\nexport interface DeleteClusterOfPlanTypeThroughApprovalRequest\n extends RequestBaseParams {\n params: { planTypeId: string; clusterId: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport interface DeleteClusterPlanTypeThroughApprovalRequest\n extends RequestBaseParams {\n params: { planTypeId: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport interface ReadClusterPlanTypeLimitsRequest extends RequestBaseParams {\n params: { planTypeId: string }\n}\n\nexport interface ChangePlanTypeRetentionLimitsThroughApprovalRequest\n extends RequestBaseParams {\n params: { planTypeId: string }\n body: {\n actor: ApprovalM2mActor\n /**\n * The new retention limits. They replace the limits of the plan type as\n * a whole, so a key that is absent goes back to its default.\n */\n limits: ClusterLimits\n /**\n * The limits that the person who asked READ. Console compares them with\n * the plan type when the action runs. When the plan type holds neither\n * these limits nor `limits`, console changes nothing and answers 409.\n */\n expectedLimits: ClusterLimits\n }\n}\n\nexport interface ReadClusterPlanTypeStateRequest extends RequestBaseParams {\n params: { clusterId: string }\n query: {\n /** The organization that owns the cluster. Console refuses another one. */\n orgId: string\n /** The plan type of the question: its active plan is in the answer. */\n toPlanTypeUuid: string\n }\n}\n\nexport interface ChangeGenerationVersionsThroughApprovalRequest\n extends RequestBaseParams {\n params: { generationId: string }\n body: {\n actor: ApprovalM2mActor\n /**\n * The image versions to write. A key that is absent keeps its value.\n * An empty string clears an optional one. The env var fields are not\n * accepted: see `GENERATION_IMAGE_VERSION_KEYS`.\n */\n versions: GenerationImageVersionsDto\n /**\n * The values that the person who asked READ, one for each key of\n * `versions`. Console compares them with the generation when the action\n * runs, and changes nothing when one differs.\n */\n expectedVersions: GenerationImageVersionsDto\n }\n}\n\nexport interface EditGenerationThroughApprovalRequest\n extends RequestBaseParams {\n params: { generationId: string }\n body: {\n actor: ApprovalM2mActor\n /** The new name. Absent keeps the name. */\n name?: string\n /** The name that the person who asked READ. Necessary with `name`. */\n expectedName?: string\n /**\n * The env var text to write, by key. A key that is absent keeps its\n * value. An empty string clears the field.\n */\n envVars: GenerationEnvVarsDto\n /**\n * The text that the person who asked READ, one for each key of\n * `envVars`. Console compares it with the generation when the action\n * runs, and changes nothing when one differs.\n */\n expectedEnvVars: GenerationEnvVarsDto\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 DeleteApiClientThroughApprovalRequest\n extends RequestBaseParams {\n /** `clientUuid` is the `uuid` of the client, not its OAuth `clientId`. */\n params: { orgId: string; clientUuid: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport interface ReadApiClientThroughApprovalRequest extends RequestBaseParams {\n /** `clientUuid` is the `uuid` of the client, not its OAuth `clientId`. */\n params: { orgId: string; clientUuid: string }\n}\n\n/** The names of a Console API client, as console holds them. */\nexport interface ApprovalApiClientDto {\n uuid: string\n name: string\n /** The OAuth client id, which the customer knows. */\n clientId: string\n}\n\nexport interface DeleteClusterPastTtlThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterId: string }\n body: {\n actor: ApprovalM2mActor\n /** The owner that the request names. Console keeps a cluster with another. */\n orgId: string\n }\n}\n\nexport interface CreateCustomClusterPlanThroughApprovalRequest\n extends RequestBaseParams {\n body: {\n actor: ApprovalM2mActor\n clusterPlanId: string\n name: string\n plan: Record<string, unknown>\n }\n}\n\nexport interface CheckCustomClusterPlanRemovalRequest\n extends RequestBaseParams {\n params: { clusterPlanId: string }\n body: { actor: ApprovalM2mActor; forDelete: boolean }\n}\n\nexport interface DeleteCustomClusterPlanThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterPlanId: string }\n body: { actor: ApprovalM2mActor }\n}\n\n/** The publish and rollback requests carry no `preview`. Console reads it. */\nexport type ReleaseTrainPublishRequest = Omit<\n ReleaseTrainPublishPayload,\n 'preview'\n>\nexport type ReleaseTrainRollbackRequest = Omit<\n ReleaseTrainRollbackPayload,\n 'preview'\n>\n\n/** The answer of `GenerationService.publishReleaseTrain`. */\nexport type PublishReleaseTrainThroughApprovalResult = NonNullable<\n Awaited<ReturnType<typeof GenerationService.publishReleaseTrain>>\n>\n\n/** The answer of `GenerationService.rollbackReleaseTrain`. */\nexport type RollbackReleaseTrainThroughApprovalResult = NonNullable<\n Awaited<ReturnType<typeof GenerationService.rollbackReleaseTrain>>\n>\n\nexport interface PreviewReleaseTrainPublishRequest extends RequestBaseParams {\n body: { request: ReleaseTrainPublishRequest }\n}\n\nexport interface PublishReleaseTrainThroughApprovalRequest\n extends RequestBaseParams {\n body: { actor: ApprovalM2mActor; request: ReleaseTrainPublishRequest }\n}\n\nexport interface PreviewReleaseTrainRollbackRequest extends RequestBaseParams {\n body: { request: ReleaseTrainRollbackRequest }\n}\n\nexport interface RollbackReleaseTrainThroughApprovalRequest\n extends RequestBaseParams {\n body: { actor: ApprovalM2mActor; request: ReleaseTrainRollbackRequest }\n}\n\n/** What console answers for a custom cluster plan call. */\nexport interface CustomClusterPlanThroughApprovalResult {\n clusterPlanId: string\n}\n\nexport interface CreateCustomGenerationThroughApprovalRequest\n extends RequestBaseParams {\n body: {\n actor: ApprovalM2mActor\n generationId: string\n name: string\n versions: Record<string, string>\n upgradeableFrom?: string[]\n }\n}\n\nexport interface CheckCustomGenerationRemovalRequest extends RequestBaseParams {\n params: { generationId: string }\n body: { actor: ApprovalM2mActor; forDelete: boolean }\n}\n\nexport interface DeleteCustomGenerationThroughApprovalRequest\n extends RequestBaseParams {\n params: { generationId: string }\n body: { actor: ApprovalM2mActor }\n}\n\n/** What console answers for a custom generation call. */\nexport interface CustomGenerationThroughApprovalResult {\n generationId: string\n}\n\nexport interface ApplySelfServiceModificationRequest extends RequestBaseParams {\n params: { clusterUuid: string }\n body: {\n actor: ApprovalM2mActor\n /** The organization that owns the cluster. Console refuses another one. */\n orgId: string\n description: string\n planModifications: ClusterPlanModificationConfig[]\n /**\n * An ISO date, today to 30 days ahead. With no date, the config does not\n * expire.\n */\n expiresAt?: string\n }\n}\n\nexport interface DeactivateSelfServiceModificationRequest\n extends RequestBaseParams {\n params: { clusterUuid: string }\n body: {\n actor: ApprovalM2mActor\n orgId: string\n configId: string\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 * The cluster as a plan type change reads it: the fields of the stale\n * guard of `changeClusterPlanType`, for a comparison before a request\n * opens. See `ClusterPlanTypeStateDto`.\n */\n public static async readClusterPlanTypeState(\n params: ReadClusterPlanTypeStateRequest,\n ): Promise<ClusterPlanTypeStateDto> {\n const query = new URLSearchParams({\n orgId: params.query.orgId,\n toPlanTypeUuid: params.query.toPlanTypeUuid,\n })\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readClusterPlanTypeState',\n url: `api/admin/approvals/clusters/${params.params.clusterId}/plan-type-state?${query.toString()}`,\n normalizedUrl:\n 'api/admin/approvals/clusters/:clusterId/plan-type-state',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterPlanTypeStateDto>({\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 })\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 * Changes the mutable versions of one generation, and restarts its clusters.\n *\n * Console answers 409 when a value that the request expected is not the\n * value of the generation any more.\n */\n public static async changeGenerationVersions(\n params: ChangeGenerationVersionsThroughApprovalRequest,\n ): Promise<ChangeGenerationVersionsResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.changeGenerationVersions',\n url: `api/admin/approvals/generations/${params.params.generationId}/versions`,\n normalizedUrl: 'api/admin/approvals/generations/:generationId/versions',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ChangeGenerationVersionsResult>({\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 * Changes the name and the env vars of one generation, and sends the new\n * spec to its clusters.\n *\n * Console answers 409 when a value that the request expected is not the\n * value of the generation any more, and is not the requested value either.\n * When the generation already holds the requested value, console writes\n * nothing, sends the spec again and answers `reapplied: true`. The body\n * holds env var text, so no log line of this call carries a value of the\n * body.\n */\n public static async editGeneration(\n params: EditGenerationThroughApprovalRequest,\n ): Promise<EditGenerationResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.editGeneration',\n url: `api/admin/approvals/generations/${params.params.generationId}/edit`,\n normalizedUrl: 'api/admin/approvals/generations/:generationId/edit',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<EditGenerationResult>({\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 redactBody: true,\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 * 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 /**\n * Deletes a Console API client of an organization. Console answers 404 for\n * a client that is gone, and 403 for a client of another organization.\n */\n public static async deleteApiClient(\n params: DeleteApiClientThroughApprovalRequest,\n ): Promise<void> {\n const { orgId, clientUuid } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.deleteApiClient',\n url: `api/admin/approvals/orgs/${orgId}/api-clients/${clientUuid}`,\n normalizedUrl:\n 'api/admin/approvals/orgs/:orgId/api-clients/:clientUuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request({\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 /**\n * Deletes a cluster whose TTL ran out. Console tests the TTL and the owner\n * again first, and answers `kept` when the cluster stays.\n */\n public static async deleteClusterPastTtl(\n params: DeleteClusterPastTtlThroughApprovalRequest,\n ): Promise<ClusterTtlDeletionResult> {\n const { clusterId } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.deleteClusterPastTtl',\n url: `api/admin/approvals/clusters/${clusterId}/ttl-expiry`,\n normalizedUrl: 'api/admin/approvals/clusters/:clusterId/ttl-expiry',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterTtlDeletionResult>({\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 createCustomClusterPlan(\n params: CreateCustomClusterPlanThroughApprovalRequest,\n ): Promise<CustomClusterPlanThroughApprovalResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomClusterPlanThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.createCustomClusterPlan',\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 /**\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 checkCustomClusterPlanRemoval(\n params: CheckCustomClusterPlanRemovalRequest,\n ): Promise<CustomClusterPlanThroughApprovalResult> {\n const { clusterPlanId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomClusterPlanThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.checkCustomClusterPlanRemoval',\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\n /** Deletes a cluster plan that the Camundi created. It cannot be undone. */\n public static async deleteCustomClusterPlan(\n params: DeleteCustomClusterPlanThroughApprovalRequest,\n ): Promise<CustomClusterPlanThroughApprovalResult> {\n const { clusterPlanId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomClusterPlanThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteCustomClusterPlan',\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\n /** Creates a bespoke generation for a Camundi, with the uuid that the caller gives. */\n public static async createCustomGeneration(\n params: CreateCustomGenerationThroughApprovalRequest,\n ): Promise<CustomGenerationThroughApprovalResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomGenerationThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.createCustomGeneration',\n url: 'api/admin/approvals/generations',\n normalizedUrl: 'api/admin/approvals/generations',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /**\n * Asks whether a Camundi may remove a generation. Console answers 404 for a\n * generation of another person, or a generation that is not bespoke, and 409\n * for a delete that it refuses. A bespoke generation that the Camundi\n * created in the admin tool counts as theirs.\n */\n public static async checkCustomGenerationRemoval(\n params: CheckCustomGenerationRemovalRequest,\n ): Promise<CustomGenerationThroughApprovalResult> {\n const { generationId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomGenerationThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.checkCustomGenerationRemoval',\n url: `api/admin/approvals/generations/${generationId}/removal-check`,\n normalizedUrl:\n 'api/admin/approvals/generations/:generationId/removal-check',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /** Deletes a custom generation that the Camundi created. It cannot be undone. */\n public static async deleteCustomGeneration(\n params: DeleteCustomGenerationThroughApprovalRequest,\n ): Promise<CustomGenerationThroughApprovalResult> {\n const { generationId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomGenerationThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteCustomGeneration',\n url: `api/admin/approvals/generations/${generationId}`,\n normalizedUrl: 'api/admin/approvals/generations/:generationId',\n type: 'delete',\n body: params.body,\n },\n )\n }\n\n /**\n * Reads the names that console holds for clusters and generations, and the\n * number of clusters that run each generation. It changes nothing.\n *\n * It is a POST because a bulk operation names up to 3000 clusters.\n */\n public static async readSummaryNames(params: {\n config: RequestBaseParamsConfig\n body: ApprovalSummaryNamesRequest\n }): Promise<ApprovalSummaryNamesResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<ApprovalSummaryNamesResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.readSummaryNames',\n url: 'api/admin/approvals/summary-names',\n normalizedUrl: 'api/admin/approvals/summary-names',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /**\n * The names of a Console API client of an organization, for a\n * delete-api-client request when it opens. Console answers 404 for a client\n * that is not in the organization, and 403 when the caller lacks the\n * permission.\n */\n public static async readApiClient(\n params: ReadApiClientThroughApprovalRequest,\n ): Promise<ApprovalApiClientDto> {\n const { orgId, clientUuid } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readApiClient',\n url: `api/admin/approvals/orgs/${orgId}/api-clients/${clientUuid}`,\n normalizedUrl:\n 'api/admin/approvals/orgs/:orgId/api-clients/:clientUuid',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ApprovalApiClientDto>({\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 })\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 * The corpses of one kind now, for the request that deletes them. Console\n * reads them from its watch of Kubernetes and from its rows, as the\n * \"Corpses\" tab does.\n */\n public static async readClusterCorpses(\n params: ReadClusterCorpsesRequest,\n ): Promise<ClusterCorpsesDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readClusterCorpses',\n url: `api/admin/approvals/cluster-corpses/${params.params.kind}`,\n normalizedUrl: 'api/admin/approvals/cluster-corpses/:kind',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterCorpsesDto>({\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 })\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 * Deletes one corpse of a request. It cannot be undone.\n *\n * Console reads the live source again first, and deletes nothing when the\n * cluster is not a corpse any more (`not-a-corpse`) or when there is nothing\n * to delete (`gone`). It throws when it cannot read the live source.\n */\n public static async deleteClusterCorpse(\n params: DeleteClusterCorpseThroughApprovalRequest,\n ): Promise<DeleteClusterCorpseResult> {\n const { kind, clusterId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<DeleteClusterCorpseResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteClusterCorpse',\n url: `api/admin/approvals/cluster-corpses/${kind}/${clusterId}`,\n normalizedUrl: 'api/admin/approvals/cluster-corpses/:kind/:clusterId',\n type: 'delete',\n body: params.body,\n },\n )\n }\n\n /**\n * The clusters of a plan type now, for the request that force deletes it.\n * Console answers 404 when the plan type does not exist.\n */\n public static async readClusterPlanTypeClusters(\n params: ReadClusterPlanTypeClustersRequest,\n ): Promise<ClusterPlanTypeClustersDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readClusterPlanTypeClusters',\n url: `api/admin/approvals/cluster-plan-types/${params.params.planTypeId}/clusters`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plan-types/:planTypeId/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<ClusterPlanTypeClustersDto>({\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 })\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 * The retention limits of a plan type now, and the number of its clusters.\n * Console answers 404 when the plan type does not exist.\n */\n public static async readClusterPlanTypeLimits(\n params: ReadClusterPlanTypeLimitsRequest,\n ): Promise<ClusterPlanTypeLimitsDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readClusterPlanTypeLimits',\n url: `api/admin/approvals/cluster-plan-types/${params.params.planTypeId}/limits`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plan-types/:planTypeId/limits',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterPlanTypeLimitsDto>({\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 })\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 * Changes the retention limits of a plan type, and sends the new spec to\n * every cluster of the type.\n *\n * Console answers 409 when the limits of the plan type are not the\n * expected limits and not the new limits, and 404 when the plan type does\n * not exist.\n */\n public static async changePlanTypeRetentionLimits(\n params: ChangePlanTypeRetentionLimitsThroughApprovalRequest,\n ): Promise<ChangePlanTypeRetentionLimitsResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.changePlanTypeRetentionLimits',\n url: `api/admin/approvals/cluster-plan-types/${params.params.planTypeId}/limits`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plan-types/:planTypeId/limits',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ChangePlanTypeRetentionLimitsResult>({\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 * Deletes one cluster of a plan type, for a force delete request. It cannot\n * be undone. Console answers `gone` for a cluster that does not exist or\n * that is on another plan type now, and deletes nothing then.\n */\n public static async deleteClusterOfPlanType(\n params: DeleteClusterOfPlanTypeThroughApprovalRequest,\n ): Promise<ForceDeleteClusterPlanTypeStepResult> {\n const { planTypeId, clusterId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<ForceDeleteClusterPlanTypeStepResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteClusterOfPlanType',\n url: `api/admin/approvals/cluster-plan-types/${planTypeId}/clusters/${clusterId}`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plan-types/:planTypeId/clusters/:clusterId',\n type: 'delete',\n body: params.body,\n },\n )\n }\n\n /**\n * Deletes a plan type that no cluster uses, for a force delete request. It\n * cannot be undone. Console answers 409 while a cluster still uses the\n * type, and `gone` when the type does not exist.\n */\n public static async deleteClusterPlanType(\n params: DeleteClusterPlanTypeThroughApprovalRequest,\n ): Promise<ForceDeleteClusterPlanTypeStepResult> {\n const { planTypeId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<ForceDeleteClusterPlanTypeStepResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteClusterPlanType',\n url: `api/admin/approvals/cluster-plan-types/${planTypeId}`,\n normalizedUrl: 'api/admin/approvals/cluster-plan-types/:planTypeId',\n type: 'delete',\n body: params.body,\n },\n )\n }\n\n /** Reads what a publish would change. It changes nothing. */\n public static async previewReleaseTrainPublish(\n params: PreviewReleaseTrainPublishRequest,\n ): Promise<ReleaseTrainPreview> {\n return ConsoleApprovalsM2MService.callApprovalRoute<ReleaseTrainPreview>({\n config: params.config,\n name: 'ConsoleApprovalsM2MService.previewReleaseTrainPublish',\n url: 'api/admin/approvals/release-train/publish/preview',\n normalizedUrl: 'api/admin/approvals/release-train/publish/preview',\n type: 'post',\n body: params.body,\n })\n }\n\n /** Publishes a release train generation. */\n public static async publishReleaseTrain(\n params: PublishReleaseTrainThroughApprovalRequest,\n ): Promise<PublishReleaseTrainThroughApprovalResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<PublishReleaseTrainThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.publishReleaseTrain',\n url: 'api/admin/approvals/release-train/publish',\n normalizedUrl: 'api/admin/approvals/release-train/publish',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /** Reads what a rollback would change. It changes nothing. */\n public static async previewReleaseTrainRollback(\n params: PreviewReleaseTrainRollbackRequest,\n ): Promise<ReleaseTrainPreview> {\n return ConsoleApprovalsM2MService.callApprovalRoute<ReleaseTrainPreview>({\n config: params.config,\n name: 'ConsoleApprovalsM2MService.previewReleaseTrainRollback',\n url: 'api/admin/approvals/release-train/rollback/preview',\n normalizedUrl: 'api/admin/approvals/release-train/rollback/preview',\n type: 'post',\n body: params.body,\n })\n }\n\n /** Rolls back a release train generation. */\n public static async rollbackReleaseTrain(\n params: RollbackReleaseTrainThroughApprovalRequest,\n ): Promise<RollbackReleaseTrainThroughApprovalResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<RollbackReleaseTrainThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.rollbackReleaseTrain',\n url: 'api/admin/approvals/release-train/rollback',\n normalizedUrl: 'api/admin/approvals/release-train/rollback',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /**\n * Applies a cluster modification for the owner of the cluster, with no\n * approval. Console answers the new config.\n */\n public static async applySelfServiceModification(\n params: ApplySelfServiceModificationRequest,\n ): Promise<ClusterModificationConfigDto> {\n const { clusterUuid } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<ClusterModificationConfigDto>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.applySelfServiceModification',\n url: `api/admin/approvals/clusters/${clusterUuid}/self-service-modification`,\n normalizedUrl:\n 'api/admin/approvals/clusters/:clusterUuid/self-service-modification',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /** Deactivates the active config of a cluster for its owner. */\n public static async deactivateSelfServiceModification(\n params: DeactivateSelfServiceModificationRequest,\n ): Promise<ClusterModificationConfigDto> {\n const { clusterUuid } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<ClusterModificationConfigDto>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deactivateSelfServiceModification',\n url: `api/admin/approvals/clusters/${clusterUuid}/self-service-modification/deactivate`,\n normalizedUrl:\n 'api/admin/approvals/clusters/:clusterUuid/self-service-modification/deactivate',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n private static async callApprovalRoute<T>(args: {\n config: RequestBaseParams['config']\n name: string\n url: string\n normalizedUrl: string\n type: 'post' | 'delete'\n body: unknown\n }): Promise<T> {\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<T>({\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": "AAwCA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAwUnB,MAAM,2BAA2B;AAAA,EACtC,aAAoB,iBAClB,QACiC;AACjC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,gCAAgC,OAAO,OAAO,SAAS;AAAA,QAC5D,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,QAAgC;AAAA,MACrD,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,OAAO;AAAA,IACf,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,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AAAA,QACF,MAAM;AAAA,QACN,MAAM,OAAO;AAAA,MACf;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAGA,aAAoB,kCAClB,QACuC;AACvC,UAAM,EAAE,YAAY,IAAI,OAAO;AAC/B,WAAO,2BAA2B;AAAA,MAChC;AAAA,QACE,QAAQ,OAAO;AAAA,QACf,MAAM;AAAA,QACN,KAAK,gCAAgC,WAAW;AAAA,QAChD,eACE;AAAA,QACF,MAAM;AAAA,QACN,MAAM,OAAO;AAAA,MACf;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAqB,kBAAqB,MAO3B;AACb,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM,KAAK;AAAA,QACX,KAAK,KAAK;AAAA,QACV,eAAe,KAAK;AAAA,QACpB,MAAM,KAAK;AAAA,MACb;AAAA,MACA,QAAQ,KAAK,OAAO,SAAS,UAAU;AAAA,MACvC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAW;AAAA,MAChC,QAAQ,KAAK;AAAA,MACb,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,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;",
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 ApprovalSummaryNamesRequest,\n ApprovalSummaryNamesResult,\n BackupDto,\n ChangeClusterPlanTypeResult,\n ChangeGenerationVersionsResult,\n ChangePlanTypeRetentionLimitsResult,\n ClusterBulkStepRequestDto,\n ClusterBulkStepResultDto,\n ClusterCorpseKind,\n ClusterCorpsesDto,\n ClusterGenerationStateDto,\n ClusterLimits,\n ClusterModificationConfigDto,\n ClusterPlanModificationConfig,\n ClusterPlanTypeClustersDto,\n ClusterPlanTypeLimitsDto,\n ClusterPlanTypeStateDto,\n ClusterTtlDeletionResult,\n DeleteClusterCorpseResult,\n EditGenerationResult,\n ForceDeleteClusterPlanTypeStepResult,\n ForceGenerationUpgradeResult,\n GenerationEnvVarsDto,\n GenerationImageVersionsDto,\n MoveClusterOwnerResult,\n ReleaseTrainPreview,\n ReleaseTrainPublishPayload,\n ReleaseTrainRollbackPayload,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseParamsConfig,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\nimport type { GenerationService } from './generation.service.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 * Whether the active modification config stays on the cluster. Absent\n * reads as false: the change removes it.\n */\n keepModification?: boolean\n }\n}\n\nexport interface ReadClusterCorpsesRequest extends RequestBaseParams {\n params: { kind: ClusterCorpseKind }\n}\n\nexport interface DeleteClusterCorpseThroughApprovalRequest\n extends RequestBaseParams {\n params: { kind: ClusterCorpseKind; clusterId: string }\n body: {\n actor: ApprovalM2mActor\n /** The context of a `k8s` corpse, where console deletes the resource. */\n k8sContextUuid?: string\n /** The uid of the resource of a `k8s` corpse. See `ClusterCorpseDto.resourceUid`. */\n resourceUid?: string\n }\n}\n\nexport interface ReadClusterPlanTypeClustersRequest extends RequestBaseParams {\n params: { planTypeId: string }\n}\n\nexport interface DeleteClusterOfPlanTypeThroughApprovalRequest\n extends RequestBaseParams {\n params: { planTypeId: string; clusterId: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport interface DeleteClusterPlanTypeThroughApprovalRequest\n extends RequestBaseParams {\n params: { planTypeId: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport interface ReadClusterPlanTypeLimitsRequest extends RequestBaseParams {\n params: { planTypeId: string }\n}\n\nexport interface ChangePlanTypeRetentionLimitsThroughApprovalRequest\n extends RequestBaseParams {\n params: { planTypeId: string }\n body: {\n actor: ApprovalM2mActor\n /**\n * The new retention limits. They replace the limits of the plan type as\n * a whole, so a key that is absent goes back to its default.\n */\n limits: ClusterLimits\n /**\n * The limits that the person who asked READ. Console compares them with\n * the plan type when the action runs. When the plan type holds neither\n * these limits nor `limits`, console changes nothing and answers 409.\n */\n expectedLimits: ClusterLimits\n }\n}\n\nexport interface ReadClusterGenerationStateRequest extends RequestBaseParams {\n params: { clusterId: string }\n}\n\nexport interface ReadClusterPlanTypeStateRequest extends RequestBaseParams {\n params: { clusterId: string }\n query: {\n /** The organization that owns the cluster. Console refuses another one. */\n orgId: string\n /** The plan type of the question: its active plan is in the answer. */\n toPlanTypeUuid: string\n }\n}\n\nexport interface ChangeGenerationVersionsThroughApprovalRequest\n extends RequestBaseParams {\n params: { generationId: string }\n body: {\n actor: ApprovalM2mActor\n /**\n * The image versions to write. A key that is absent keeps its value.\n * An empty string clears an optional one. The env var fields are not\n * accepted: see `GENERATION_IMAGE_VERSION_KEYS`.\n */\n versions: GenerationImageVersionsDto\n /**\n * The values that the person who asked READ, one for each key of\n * `versions`. Console compares them with the generation when the action\n * runs, and changes nothing when one differs.\n */\n expectedVersions: GenerationImageVersionsDto\n }\n}\n\nexport interface EditGenerationThroughApprovalRequest\n extends RequestBaseParams {\n params: { generationId: string }\n body: {\n actor: ApprovalM2mActor\n /** The new name. Absent keeps the name. */\n name?: string\n /** The name that the person who asked READ. Necessary with `name`. */\n expectedName?: string\n /**\n * The env var text to write, by key. A key that is absent keeps its\n * value. An empty string clears the field.\n */\n envVars: GenerationEnvVarsDto\n /**\n * The text that the person who asked READ, one for each key of\n * `envVars`. Console compares it with the generation when the action\n * runs, and changes nothing when one differs.\n */\n expectedEnvVars: GenerationEnvVarsDto\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 ForceGenerationUpgradeThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterId: string }\n body: {\n actor: ApprovalM2mActor\n toGenerationUuid: string\n /**\n * The generation of the cluster when the request was opened. Console\n * answers 412 when the cluster runs another one now.\n */\n expectedGenerationUuid: string\n /** Ignore the upgrade graph. */\n yolo: boolean\n /** Ignore the upgrade gate. */\n ignoreUpgradeGate: boolean\n }\n}\n\nexport interface DeleteApiClientThroughApprovalRequest\n extends RequestBaseParams {\n /** `clientUuid` is the `uuid` of the client, not its OAuth `clientId`. */\n params: { orgId: string; clientUuid: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport interface ReadApiClientThroughApprovalRequest extends RequestBaseParams {\n /** `clientUuid` is the `uuid` of the client, not its OAuth `clientId`. */\n params: { orgId: string; clientUuid: string }\n}\n\n/** The names of a Console API client, as console holds them. */\nexport interface ApprovalApiClientDto {\n uuid: string\n name: string\n /** The OAuth client id, which the customer knows. */\n clientId: string\n}\n\nexport interface DeleteClusterPastTtlThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterId: string }\n body: {\n actor: ApprovalM2mActor\n /** The owner that the request names. Console keeps a cluster with another. */\n orgId: string\n }\n}\n\nexport interface CreateCustomClusterPlanThroughApprovalRequest\n extends RequestBaseParams {\n body: {\n actor: ApprovalM2mActor\n clusterPlanId: string\n name: string\n plan: Record<string, unknown>\n }\n}\n\nexport interface CheckCustomClusterPlanRemovalRequest\n extends RequestBaseParams {\n params: { clusterPlanId: string }\n body: { actor: ApprovalM2mActor; forDelete: boolean }\n}\n\nexport interface DeleteCustomClusterPlanThroughApprovalRequest\n extends RequestBaseParams {\n params: { clusterPlanId: string }\n body: { actor: ApprovalM2mActor }\n}\n\n/** The publish and rollback requests carry no `preview`. Console reads it. */\nexport type ReleaseTrainPublishRequest = Omit<\n ReleaseTrainPublishPayload,\n 'preview'\n>\nexport type ReleaseTrainRollbackRequest = Omit<\n ReleaseTrainRollbackPayload,\n 'preview'\n>\n\n/** The answer of `GenerationService.publishReleaseTrain`. */\nexport type PublishReleaseTrainThroughApprovalResult = NonNullable<\n Awaited<ReturnType<typeof GenerationService.publishReleaseTrain>>\n>\n\n/** The answer of `GenerationService.rollbackReleaseTrain`. */\nexport type RollbackReleaseTrainThroughApprovalResult = NonNullable<\n Awaited<ReturnType<typeof GenerationService.rollbackReleaseTrain>>\n>\n\nexport interface PreviewReleaseTrainPublishRequest extends RequestBaseParams {\n body: { request: ReleaseTrainPublishRequest }\n}\n\nexport interface PublishReleaseTrainThroughApprovalRequest\n extends RequestBaseParams {\n body: { actor: ApprovalM2mActor; request: ReleaseTrainPublishRequest }\n}\n\nexport interface PreviewReleaseTrainRollbackRequest extends RequestBaseParams {\n body: { request: ReleaseTrainRollbackRequest }\n}\n\nexport interface RollbackReleaseTrainThroughApprovalRequest\n extends RequestBaseParams {\n body: { actor: ApprovalM2mActor; request: ReleaseTrainRollbackRequest }\n}\n\n/** What console answers for a custom cluster plan call. */\nexport interface CustomClusterPlanThroughApprovalResult {\n clusterPlanId: string\n}\n\nexport interface CreateCustomGenerationThroughApprovalRequest\n extends RequestBaseParams {\n body: {\n actor: ApprovalM2mActor\n generationId: string\n name: string\n versions: Record<string, string>\n upgradeableFrom?: string[]\n }\n}\n\nexport interface CheckCustomGenerationRemovalRequest extends RequestBaseParams {\n params: { generationId: string }\n body: { actor: ApprovalM2mActor; forDelete: boolean }\n}\n\nexport interface DeleteCustomGenerationThroughApprovalRequest\n extends RequestBaseParams {\n params: { generationId: string }\n body: { actor: ApprovalM2mActor }\n}\n\n/** What console answers for a custom generation call. */\nexport interface CustomGenerationThroughApprovalResult {\n generationId: string\n}\n\nexport interface ApplySelfServiceModificationRequest extends RequestBaseParams {\n params: { clusterUuid: string }\n body: {\n actor: ApprovalM2mActor\n /** The organization that owns the cluster. Console refuses another one. */\n orgId: string\n description: string\n planModifications: ClusterPlanModificationConfig[]\n /**\n * An ISO date, today to 30 days ahead. With no date, the config does not\n * expire.\n */\n expiresAt?: string\n }\n}\n\nexport interface DeactivateSelfServiceModificationRequest\n extends RequestBaseParams {\n params: { clusterUuid: string }\n body: {\n actor: ApprovalM2mActor\n orgId: string\n configId: string\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 * The organization and the generation of one cluster, for the check of a\n * forced generation upgrade before the request opens. The route reads the\n * approvals grant, so control-backend needs no read grant of the admin\n * routes. See `ClusterGenerationStateDto`.\n */\n public static async readClusterGenerationState(\n params: ReadClusterGenerationStateRequest,\n ): Promise<ClusterGenerationStateDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readClusterGenerationState',\n url: `api/admin/approvals/clusters/${params.params.clusterId}/generation-state`,\n normalizedUrl:\n 'api/admin/approvals/clusters/:clusterId/generation-state',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterGenerationStateDto>({\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 })\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 * The cluster as a plan type change reads it: the fields of the stale\n * guard of `changeClusterPlanType`, for a comparison before a request\n * opens. See `ClusterPlanTypeStateDto`.\n */\n public static async readClusterPlanTypeState(\n params: ReadClusterPlanTypeStateRequest,\n ): Promise<ClusterPlanTypeStateDto> {\n const query = new URLSearchParams({\n orgId: params.query.orgId,\n toPlanTypeUuid: params.query.toPlanTypeUuid,\n })\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readClusterPlanTypeState',\n url: `api/admin/approvals/clusters/${params.params.clusterId}/plan-type-state?${query.toString()}`,\n normalizedUrl:\n 'api/admin/approvals/clusters/:clusterId/plan-type-state',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterPlanTypeStateDto>({\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 })\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 * Changes the mutable versions of one generation, and restarts its clusters.\n *\n * Console answers 409 when a value that the request expected is not the\n * value of the generation any more.\n */\n public static async changeGenerationVersions(\n params: ChangeGenerationVersionsThroughApprovalRequest,\n ): Promise<ChangeGenerationVersionsResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.changeGenerationVersions',\n url: `api/admin/approvals/generations/${params.params.generationId}/versions`,\n normalizedUrl: 'api/admin/approvals/generations/:generationId/versions',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ChangeGenerationVersionsResult>({\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 * Changes the name and the env vars of one generation, and sends the new\n * spec to its clusters.\n *\n * Console answers 409 when a value that the request expected is not the\n * value of the generation any more, and is not the requested value either.\n * When the generation already holds the requested value, console writes\n * nothing, sends the spec again and answers `reapplied: true`. The body\n * holds env var text, so no log line of this call carries a value of the\n * body.\n */\n public static async editGeneration(\n params: EditGenerationThroughApprovalRequest,\n ): Promise<EditGenerationResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.editGeneration',\n url: `api/admin/approvals/generations/${params.params.generationId}/edit`,\n normalizedUrl: 'api/admin/approvals/generations/:generationId/edit',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<EditGenerationResult>({\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 redactBody: true,\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 * 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 /**\n * Upgrades the generation of one cluster with `yolo`, past the upgrade\n * gate, or both. Console answers 412 when the cluster left the expected\n * generation, 409 when the upgrade gate blocks the upgrade, and 503 while\n * generation updates are blocked, while a lock of the cluster stays taken,\n * or while Redis does not answer.\n */\n public static async forceGenerationUpgrade(\n params: ForceGenerationUpgradeThroughApprovalRequest,\n ): Promise<ForceGenerationUpgradeResult> {\n const { clusterId } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.forceGenerationUpgrade',\n url: `api/admin/approvals/clusters/${clusterId}/generation`,\n normalizedUrl: 'api/admin/approvals/clusters/:clusterId/generation',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ForceGenerationUpgradeResult>({\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 /** 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 /**\n * Deletes a Console API client of an organization. Console answers 404 for\n * a client that is gone, and 403 for a client of another organization.\n */\n public static async deleteApiClient(\n params: DeleteApiClientThroughApprovalRequest,\n ): Promise<void> {\n const { orgId, clientUuid } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.deleteApiClient',\n url: `api/admin/approvals/orgs/${orgId}/api-clients/${clientUuid}`,\n normalizedUrl:\n 'api/admin/approvals/orgs/:orgId/api-clients/:clientUuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request({\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 /**\n * Deletes a cluster whose TTL ran out. Console tests the TTL and the owner\n * again first, and answers `kept` when the cluster stays.\n */\n public static async deleteClusterPastTtl(\n params: DeleteClusterPastTtlThroughApprovalRequest,\n ): Promise<ClusterTtlDeletionResult> {\n const { clusterId } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.deleteClusterPastTtl',\n url: `api/admin/approvals/clusters/${clusterId}/ttl-expiry`,\n normalizedUrl: 'api/admin/approvals/clusters/:clusterId/ttl-expiry',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterTtlDeletionResult>({\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 createCustomClusterPlan(\n params: CreateCustomClusterPlanThroughApprovalRequest,\n ): Promise<CustomClusterPlanThroughApprovalResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomClusterPlanThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.createCustomClusterPlan',\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 /**\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 checkCustomClusterPlanRemoval(\n params: CheckCustomClusterPlanRemovalRequest,\n ): Promise<CustomClusterPlanThroughApprovalResult> {\n const { clusterPlanId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomClusterPlanThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.checkCustomClusterPlanRemoval',\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\n /** Deletes a cluster plan that the Camundi created. It cannot be undone. */\n public static async deleteCustomClusterPlan(\n params: DeleteCustomClusterPlanThroughApprovalRequest,\n ): Promise<CustomClusterPlanThroughApprovalResult> {\n const { clusterPlanId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomClusterPlanThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteCustomClusterPlan',\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\n /** Creates a bespoke generation for a Camundi, with the uuid that the caller gives. */\n public static async createCustomGeneration(\n params: CreateCustomGenerationThroughApprovalRequest,\n ): Promise<CustomGenerationThroughApprovalResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomGenerationThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.createCustomGeneration',\n url: 'api/admin/approvals/generations',\n normalizedUrl: 'api/admin/approvals/generations',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /**\n * Asks whether a Camundi may remove a generation. Console answers 404 for a\n * generation of another person, or a generation that is not bespoke, and 409\n * for a delete that it refuses. A bespoke generation that the Camundi\n * created in the admin tool counts as theirs.\n */\n public static async checkCustomGenerationRemoval(\n params: CheckCustomGenerationRemovalRequest,\n ): Promise<CustomGenerationThroughApprovalResult> {\n const { generationId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomGenerationThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.checkCustomGenerationRemoval',\n url: `api/admin/approvals/generations/${generationId}/removal-check`,\n normalizedUrl:\n 'api/admin/approvals/generations/:generationId/removal-check',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /** Deletes a custom generation that the Camundi created. It cannot be undone. */\n public static async deleteCustomGeneration(\n params: DeleteCustomGenerationThroughApprovalRequest,\n ): Promise<CustomGenerationThroughApprovalResult> {\n const { generationId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<CustomGenerationThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteCustomGeneration',\n url: `api/admin/approvals/generations/${generationId}`,\n normalizedUrl: 'api/admin/approvals/generations/:generationId',\n type: 'delete',\n body: params.body,\n },\n )\n }\n\n /**\n * Reads the names that console holds for clusters and generations, and the\n * number of clusters that run each generation. It changes nothing.\n *\n * It is a POST because a bulk operation names up to 3000 clusters.\n */\n public static async readSummaryNames(params: {\n config: RequestBaseParamsConfig\n body: ApprovalSummaryNamesRequest\n }): Promise<ApprovalSummaryNamesResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<ApprovalSummaryNamesResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.readSummaryNames',\n url: 'api/admin/approvals/summary-names',\n normalizedUrl: 'api/admin/approvals/summary-names',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /**\n * The names of a Console API client of an organization, for a\n * delete-api-client request when it opens. Console answers 404 for a client\n * that is not in the organization, and 403 when the caller lacks the\n * permission.\n */\n public static async readApiClient(\n params: ReadApiClientThroughApprovalRequest,\n ): Promise<ApprovalApiClientDto> {\n const { orgId, clientUuid } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readApiClient',\n url: `api/admin/approvals/orgs/${orgId}/api-clients/${clientUuid}`,\n normalizedUrl:\n 'api/admin/approvals/orgs/:orgId/api-clients/:clientUuid',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ApprovalApiClientDto>({\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 })\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 * The corpses of one kind now, for the request that deletes them. Console\n * reads them from its watch of Kubernetes and from its rows, as the\n * \"Corpses\" tab does.\n */\n public static async readClusterCorpses(\n params: ReadClusterCorpsesRequest,\n ): Promise<ClusterCorpsesDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readClusterCorpses',\n url: `api/admin/approvals/cluster-corpses/${params.params.kind}`,\n normalizedUrl: 'api/admin/approvals/cluster-corpses/:kind',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterCorpsesDto>({\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 })\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 * Deletes one corpse of a request. It cannot be undone.\n *\n * Console reads the live source again first, and deletes nothing when the\n * cluster is not a corpse any more (`not-a-corpse`) or when there is nothing\n * to delete (`gone`). It throws when it cannot read the live source.\n */\n public static async deleteClusterCorpse(\n params: DeleteClusterCorpseThroughApprovalRequest,\n ): Promise<DeleteClusterCorpseResult> {\n const { kind, clusterId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<DeleteClusterCorpseResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteClusterCorpse',\n url: `api/admin/approvals/cluster-corpses/${kind}/${clusterId}`,\n normalizedUrl: 'api/admin/approvals/cluster-corpses/:kind/:clusterId',\n type: 'delete',\n body: params.body,\n },\n )\n }\n\n /**\n * The clusters of a plan type now, for the request that force deletes it.\n * Console answers 404 when the plan type does not exist.\n */\n public static async readClusterPlanTypeClusters(\n params: ReadClusterPlanTypeClustersRequest,\n ): Promise<ClusterPlanTypeClustersDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readClusterPlanTypeClusters',\n url: `api/admin/approvals/cluster-plan-types/${params.params.planTypeId}/clusters`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plan-types/:planTypeId/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<ClusterPlanTypeClustersDto>({\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 })\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 * The retention limits of a plan type now, and the number of its clusters.\n * Console answers 404 when the plan type does not exist.\n */\n public static async readClusterPlanTypeLimits(\n params: ReadClusterPlanTypeLimitsRequest,\n ): Promise<ClusterPlanTypeLimitsDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.readClusterPlanTypeLimits',\n url: `api/admin/approvals/cluster-plan-types/${params.params.planTypeId}/limits`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plan-types/:planTypeId/limits',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ClusterPlanTypeLimitsDto>({\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 })\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 * Changes the retention limits of a plan type, and sends the new spec to\n * every cluster of the type.\n *\n * Console answers 409 when the limits of the plan type are not the\n * expected limits and not the new limits, and 404 when the plan type does\n * not exist.\n */\n public static async changePlanTypeRetentionLimits(\n params: ChangePlanTypeRetentionLimitsThroughApprovalRequest,\n ): Promise<ChangePlanTypeRetentionLimitsResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleApprovalsM2MService.changePlanTypeRetentionLimits',\n url: `api/admin/approvals/cluster-plan-types/${params.params.planTypeId}/limits`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plan-types/:planTypeId/limits',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ChangePlanTypeRetentionLimitsResult>({\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 * Deletes one cluster of a plan type, for a force delete request. It cannot\n * be undone. Console answers `gone` for a cluster that does not exist or\n * that is on another plan type now, and deletes nothing then.\n */\n public static async deleteClusterOfPlanType(\n params: DeleteClusterOfPlanTypeThroughApprovalRequest,\n ): Promise<ForceDeleteClusterPlanTypeStepResult> {\n const { planTypeId, clusterId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<ForceDeleteClusterPlanTypeStepResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteClusterOfPlanType',\n url: `api/admin/approvals/cluster-plan-types/${planTypeId}/clusters/${clusterId}`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plan-types/:planTypeId/clusters/:clusterId',\n type: 'delete',\n body: params.body,\n },\n )\n }\n\n /**\n * Deletes a plan type that no cluster uses, for a force delete request. It\n * cannot be undone. Console answers 409 while a cluster still uses the\n * type, and `gone` when the type does not exist.\n */\n public static async deleteClusterPlanType(\n params: DeleteClusterPlanTypeThroughApprovalRequest,\n ): Promise<ForceDeleteClusterPlanTypeStepResult> {\n const { planTypeId } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<ForceDeleteClusterPlanTypeStepResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deleteClusterPlanType',\n url: `api/admin/approvals/cluster-plan-types/${planTypeId}`,\n normalizedUrl: 'api/admin/approvals/cluster-plan-types/:planTypeId',\n type: 'delete',\n body: params.body,\n },\n )\n }\n\n /** Reads what a publish would change. It changes nothing. */\n public static async previewReleaseTrainPublish(\n params: PreviewReleaseTrainPublishRequest,\n ): Promise<ReleaseTrainPreview> {\n return ConsoleApprovalsM2MService.callApprovalRoute<ReleaseTrainPreview>({\n config: params.config,\n name: 'ConsoleApprovalsM2MService.previewReleaseTrainPublish',\n url: 'api/admin/approvals/release-train/publish/preview',\n normalizedUrl: 'api/admin/approvals/release-train/publish/preview',\n type: 'post',\n body: params.body,\n })\n }\n\n /** Publishes a release train generation. */\n public static async publishReleaseTrain(\n params: PublishReleaseTrainThroughApprovalRequest,\n ): Promise<PublishReleaseTrainThroughApprovalResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<PublishReleaseTrainThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.publishReleaseTrain',\n url: 'api/admin/approvals/release-train/publish',\n normalizedUrl: 'api/admin/approvals/release-train/publish',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /** Reads what a rollback would change. It changes nothing. */\n public static async previewReleaseTrainRollback(\n params: PreviewReleaseTrainRollbackRequest,\n ): Promise<ReleaseTrainPreview> {\n return ConsoleApprovalsM2MService.callApprovalRoute<ReleaseTrainPreview>({\n config: params.config,\n name: 'ConsoleApprovalsM2MService.previewReleaseTrainRollback',\n url: 'api/admin/approvals/release-train/rollback/preview',\n normalizedUrl: 'api/admin/approvals/release-train/rollback/preview',\n type: 'post',\n body: params.body,\n })\n }\n\n /** Rolls back a release train generation. */\n public static async rollbackReleaseTrain(\n params: RollbackReleaseTrainThroughApprovalRequest,\n ): Promise<RollbackReleaseTrainThroughApprovalResult> {\n return ConsoleApprovalsM2MService.callApprovalRoute<RollbackReleaseTrainThroughApprovalResult>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.rollbackReleaseTrain',\n url: 'api/admin/approvals/release-train/rollback',\n normalizedUrl: 'api/admin/approvals/release-train/rollback',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /**\n * Applies a cluster modification for the owner of the cluster, with no\n * approval. Console answers the new config.\n */\n public static async applySelfServiceModification(\n params: ApplySelfServiceModificationRequest,\n ): Promise<ClusterModificationConfigDto> {\n const { clusterUuid } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<ClusterModificationConfigDto>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.applySelfServiceModification',\n url: `api/admin/approvals/clusters/${clusterUuid}/self-service-modification`,\n normalizedUrl:\n 'api/admin/approvals/clusters/:clusterUuid/self-service-modification',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n /** Deactivates the active config of a cluster for its owner. */\n public static async deactivateSelfServiceModification(\n params: DeactivateSelfServiceModificationRequest,\n ): Promise<ClusterModificationConfigDto> {\n const { clusterUuid } = params.params\n return ConsoleApprovalsM2MService.callApprovalRoute<ClusterModificationConfigDto>(\n {\n config: params.config,\n name: 'ConsoleApprovalsM2MService.deactivateSelfServiceModification',\n url: `api/admin/approvals/clusters/${clusterUuid}/self-service-modification/deactivate`,\n normalizedUrl:\n 'api/admin/approvals/clusters/:clusterUuid/self-service-modification/deactivate',\n type: 'post',\n body: params.body,\n },\n )\n }\n\n private static async callApprovalRoute<T>(args: {\n config: RequestBaseParams['config']\n name: string\n url: string\n normalizedUrl: string\n type: 'post' | 'delete'\n body: unknown\n }): Promise<T> {\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<T>({\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": "AA0CA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA8VnB,MAAM,2BAA2B;AAAA,EACtC,aAAoB,iBAClB,QACiC;AACjC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,gCAAgC,OAAO,OAAO,SAAS;AAAA,QAC5D,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,QAAgC;AAAA,MACrD,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,OAAO;AAAA,IACf,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;AAKA,WAAO,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,aAAoB,2BAClB,QACoC;AACpC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,gCAAgC,OAAO,OAAO,SAAS;AAAA,QAC5D,eACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;A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ACF;AAAA,EACF;AAAA;AAAA,EAGA,aAAoB,kCAClB,QACuC;AACvC,UAAM,EAAE,YAAY,IAAI,OAAO;AAC/B,WAAO,2BAA2B;AAAA,MAChC;AAAA,QACE,QAAQ,OAAO;AAAA,QACf,MAAM;AAAA,QACN,KAAK,gCAAgC,WAAW;AAAA,QAChD,eACE;AAAA,QACF,MAAM;AAAA,QACN,MAAM,OAAO;AAAA,MACf;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAqB,kBAAqB,MAO3B;AACb,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM,KAAK;AAAA,QACX,KAAK,KAAK;AAAA,QACV,eAAe,KAAK;AAAA,QACpB,MAAM,KAAK;AAAA,MACb;AAAA,MACA,QAAQ,KAAK,OAAO,SAAS,UAAU;AAAA,MACvC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAW;AAAA,MAChC,QAAQ,KAAK;AAAA,MACb,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,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
  }
@@ -770,6 +770,28 @@ export interface DeleteInternalBackupPayloadDto {
770
770
  /** A copy of the Slack link of the incident, for the approver to read. */
771
771
  incidentLink?: string;
772
772
  }
773
+ /** See `forceGenerationUpgradePayloadSchema` in control-backend. */
774
+ export interface ForceGenerationUpgradePayloadDto {
775
+ clusterId: string;
776
+ /** A copy, so a list shows a name that a person knows. Nothing reads it. */
777
+ clusterName?: string;
778
+ /** The organization of the cluster. Control reads it for the request page. */
779
+ orgId?: string;
780
+ toGenerationUuid: string;
781
+ /** A copy, so the approver reads a name. Nothing reads it. */
782
+ toGenerationName?: string;
783
+ /** The generation of the cluster when the person opened the request. */
784
+ expectedGenerationUuid: string;
785
+ /** A copy, so the approver reads a name. Nothing reads it. */
786
+ expectedGenerationName?: string;
787
+ /**
788
+ * Ignore the upgrade graph. Needs
789
+ * `console.clusters.canUpgradeGenerationYolo`.
790
+ */
791
+ yolo: boolean;
792
+ /** Ignore the upgrade gate. */
793
+ ignoreUpgradeGate: boolean;
794
+ }
773
795
  /** See `deleteApiClientPayloadSchema` in control-backend. */
774
796
  export interface DeleteApiClientPayloadDto {
775
797
  orgId: string;
@@ -847,6 +869,18 @@ export declare class ControlApprovalsService {
847
869
  approval: ApprovalJobDto;
848
870
  created: boolean;
849
871
  }>;
872
+ /**
873
+ * Opens a force-generation-upgrade request: a generation upgrade of one
874
+ * cluster with `yolo`, past the upgrade gate, or both.
875
+ *
876
+ * Opening one needs `console.clusters.canUpgradeGeneration`, and with `yolo`
877
+ * also `console.clusters.canUpgradeGenerationYolo`. A 200 means that a
878
+ * request for the same cluster is already open.
879
+ */
880
+ static createForceGenerationUpgrade(params: CreateApprovalRequest<ForceGenerationUpgradePayloadDto>): Promise<{
881
+ approval: ApprovalJobDto;
882
+ created: boolean;
883
+ }>;
850
884
  /**
851
885
  * Opens a delete-api-client request.
852
886
  *
@@ -187,6 +187,21 @@ class ControlApprovalsService {
187
187
  "api/approvals/delete-internal-backup"
188
188
  );
189
189
  }
190
+ /**
191
+ * Opens a force-generation-upgrade request: a generation upgrade of one
192
+ * cluster with `yolo`, past the upgrade gate, or both.
193
+ *
194
+ * Opening one needs `console.clusters.canUpgradeGeneration`, and with `yolo`
195
+ * also `console.clusters.canUpgradeGenerationYolo`. A 200 means that a
196
+ * request for the same cluster is already open.
197
+ */
198
+ static async createForceGenerationUpgrade(params) {
199
+ return ControlApprovalsService.create(
200
+ params,
201
+ "createForceGenerationUpgrade",
202
+ "api/approvals/force-generation-upgrade"
203
+ );
204
+ }
190
205
  /**
191
206
  * Opens a delete-api-client request.
192
207
  *