@camunda/ccma-api 5.20.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -6
- package/dist/index.js +10 -2
- package/dist/index.js.map +2 -2
- package/dist/services/accounts/approvals.m2m.service.d.ts +41 -2
- package/dist/services/accounts/approvals.m2m.service.js +62 -0
- package/dist/services/accounts/approvals.m2m.service.js.map +2 -2
- package/dist/services/accounts/orgs.service.d.ts +2 -1
- package/dist/services/accounts/orgs.service.js.map +2 -2
- package/dist/services/ccma/ccma.openapi.service.d.ts +48 -0
- package/dist/services/ccma/ccma.openapi.service.js +88 -0
- package/dist/services/ccma/ccma.openapi.service.js.map +7 -0
- package/dist/services/ccma/ccma.openapi.service.spec.d.ts +1 -0
- package/dist/services/console/console.approvals.m2m.service.d.ts +12 -2
- package/dist/services/console/console.approvals.m2m.service.js +18 -0
- package/dist/services/console/console.approvals.m2m.service.js.map +2 -2
- package/dist/services/control/control.agent-grants.redact.spec.d.ts +1 -0
- package/dist/services/control/control.agent-grants.service.d.ts +26 -0
- package/dist/services/control/control.agent-grants.service.js +57 -0
- package/dist/services/control/control.agent-grants.service.js.map +7 -0
- package/dist/services/control/control.agent-grants.service.spec.d.ts +1 -0
- package/dist/services/control/control.agent-tokens.service.d.ts +19 -1
- package/dist/services/control/control.agent-tokens.service.js +34 -2
- package/dist/services/control/control.agent-tokens.service.js.map +2 -2
- package/dist/services/control/control.approvals.service.d.ts +74 -11
- package/dist/services/control/control.approvals.service.js +84 -11
- package/dist/services/control/control.approvals.service.js.map +2 -2
- package/dist/services/token-issuer/token-issuer.grant.service.d.ts +26 -0
- package/dist/services/token-issuer/token-issuer.grant.service.js +52 -0
- package/dist/services/token-issuer/token-issuer.grant.service.js.map +7 -0
- package/dist/services/token-issuer/token-issuer.grant.service.spec.d.ts +1 -0
- package/dist/types/general.types.d.ts +22 -0
- package/dist/utils/api.ccma-openapi-status.spec.d.ts +1 -0
- package/dist/utils/api.d.ts +13 -2
- package/dist/utils/api.js +55 -5
- package/dist/utils/api.js.map +2 -2
- package/dist/utils/api.on-failed-response.spec.d.ts +1 -0
- package/dist/utils/environments.d.ts +1 -1
- package/dist/utils/environments.js +0 -7
- package/dist/utils/environments.js.map +2 -2
- package/package.json +2 -2
- package/dist/services/mixpanel/mixpanel.service.d.ts +0 -16
- package/dist/services/mixpanel/mixpanel.service.js +0 -86
- package/dist/services/mixpanel/mixpanel.service.js.map +0 -7
|
@@ -443,6 +443,24 @@ class ConsoleApprovalsM2MService {
|
|
|
443
443
|
}
|
|
444
444
|
);
|
|
445
445
|
}
|
|
446
|
+
/**
|
|
447
|
+
* Reads the names that console holds for clusters and generations, and the
|
|
448
|
+
* number of clusters that run each generation. It changes nothing.
|
|
449
|
+
*
|
|
450
|
+
* It is a POST because a bulk operation names up to 3000 clusters.
|
|
451
|
+
*/
|
|
452
|
+
static async readSummaryNames(params) {
|
|
453
|
+
return ConsoleApprovalsM2MService.callApprovalRoute(
|
|
454
|
+
{
|
|
455
|
+
config: params.config,
|
|
456
|
+
name: "ConsoleApprovalsM2MService.readSummaryNames",
|
|
457
|
+
url: "api/admin/approvals/summary-names",
|
|
458
|
+
normalizedUrl: "api/admin/approvals/summary-names",
|
|
459
|
+
type: "post",
|
|
460
|
+
body: params.body
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
}
|
|
446
464
|
/**
|
|
447
465
|
* The names of a Console API client of an organization, for a
|
|
448
466
|
* delete-api-client request when it opens. Console answers 404 for a client
|
|
@@ -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 BackupDto,\n ChangeClusterPlanTypeResult,\n ChangeGenerationVersionsResult,\n ClusterBulkStepRequestDto,\n ClusterBulkStepResultDto,\n ClusterCorpseKind,\n ClusterCorpsesDto,\n ClusterModificationConfigDto,\n ClusterPlanModificationConfig,\n ClusterPlanTypeClustersDto,\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 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 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 * 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 * 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": "AAkCA,SAAS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AAA,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 ClusterBulkStepRequestDto,\n ClusterBulkStepResultDto,\n ClusterCorpseKind,\n ClusterCorpsesDto,\n ClusterModificationConfigDto,\n ClusterPlanModificationConfig,\n ClusterPlanTypeClustersDto,\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 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 * 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": "AAqCA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAiTnB,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;AAA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,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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentGrantCreated, AgentGrantRefusal, CreateAgentGrantDto } from '@camunda/ccma-shared-types';
|
|
2
|
+
import type { RequestBaseParams } from '../../types/general.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The grants of agent tokens in control-backend, for CloudBot. A grant is a
|
|
5
|
+
* one-time code that a Slack channel with a binding can trade for a token.
|
|
6
|
+
*/
|
|
7
|
+
export interface CreateAgentGrantRequest extends RequestBaseParams {
|
|
8
|
+
params: CreateAgentGrantDto;
|
|
9
|
+
}
|
|
10
|
+
/** A refusal of control-backend is an answer, not an error. */
|
|
11
|
+
export type CreateAgentGrantResult = {
|
|
12
|
+
ok: true;
|
|
13
|
+
grant: AgentGrantCreated;
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
refusal: AgentGrantRefusal;
|
|
17
|
+
};
|
|
18
|
+
export declare class ControlAgentGrantsInternalService {
|
|
19
|
+
/**
|
|
20
|
+
* Asks for a grant. It needs a machine token for `camunda-cloud-audience`
|
|
21
|
+
* that holds `ctag`. A 409 gives the refusal, and CloudBot words the reply
|
|
22
|
+
* from its `reason`. Any other failure throws. A 429 is NOT tried again,
|
|
23
|
+
* because CloudBot answers a Slack message with a deadline.
|
|
24
|
+
*/
|
|
25
|
+
static create(params: CreateAgentGrantRequest): Promise<CreateAgentGrantResult>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { request } from "../../utils/api.js";
|
|
2
|
+
import { HttpError } from "../../utils/errors.js";
|
|
3
|
+
function parseRefusal(text) {
|
|
4
|
+
try {
|
|
5
|
+
const parsed = JSON.parse(text);
|
|
6
|
+
if (typeof parsed === "object" && parsed !== null && typeof parsed.reason === "string") {
|
|
7
|
+
return parsed;
|
|
8
|
+
}
|
|
9
|
+
} catch (_error) {
|
|
10
|
+
}
|
|
11
|
+
return void 0;
|
|
12
|
+
}
|
|
13
|
+
class ControlAgentGrantsInternalService {
|
|
14
|
+
/**
|
|
15
|
+
* Asks for a grant. It needs a machine token for `camunda-cloud-audience`
|
|
16
|
+
* that holds `ctag`. A 409 gives the refusal, and CloudBot words the reply
|
|
17
|
+
* from its `reason`. Any other failure throws. A 429 is NOT tried again,
|
|
18
|
+
* because CloudBot answers a Slack message with a deadline.
|
|
19
|
+
*/
|
|
20
|
+
static async create(params) {
|
|
21
|
+
const name = "ControlAgentGrantsInternalService.create";
|
|
22
|
+
const url = "internal/agent-grants";
|
|
23
|
+
const response = await request({
|
|
24
|
+
...params,
|
|
25
|
+
base: { id: "control" },
|
|
26
|
+
url,
|
|
27
|
+
method: "post",
|
|
28
|
+
metricsDetails: {
|
|
29
|
+
method: { name, url, normalizedUrl: url, type: "post" },
|
|
30
|
+
source: params.config.metrics?.source || "unset",
|
|
31
|
+
target: { name: "control", type: "internal" }
|
|
32
|
+
},
|
|
33
|
+
body: params.params,
|
|
34
|
+
// The body holds the emails of the requester and the owner.
|
|
35
|
+
redactBody: true,
|
|
36
|
+
retry: { attempts: 1, remaining: 0 }
|
|
37
|
+
});
|
|
38
|
+
if (response.ok) {
|
|
39
|
+
return { ok: true, grant: response.body };
|
|
40
|
+
}
|
|
41
|
+
if (response.status === 409) {
|
|
42
|
+
const refusal = parseRefusal(response.statusText ?? "");
|
|
43
|
+
if (refusal) {
|
|
44
|
+
return { ok: false, refusal };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
throw new HttpError(
|
|
48
|
+
`${name}: ${response.status} ${response.statusText}`,
|
|
49
|
+
response.status,
|
|
50
|
+
response.statusText
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
ControlAgentGrantsInternalService
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=control.agent-grants.service.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/services/control/control.agent-grants.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 AgentGrantCreated,\n AgentGrantRefusal,\n CreateAgentGrantDto,\n} from '@camunda/ccma-shared-types'\nimport type { RequestBaseParams } from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\n/**\n * The grants of agent tokens in control-backend, for CloudBot. A grant is a\n * one-time code that a Slack channel with a binding can trade for a token.\n */\n\nexport interface CreateAgentGrantRequest extends RequestBaseParams {\n params: CreateAgentGrantDto\n}\n\n/** A refusal of control-backend is an answer, not an error. */\nexport type CreateAgentGrantResult =\n | { ok: true; grant: AgentGrantCreated }\n | { ok: false; refusal: AgentGrantRefusal }\n\n/**\n * `request()` keeps the text of a failed response in `statusText`, not in\n * `body`. The text is cut at a size limit, so a parse can fail.\n */\nfunction parseRefusal(text: string): AgentGrantRefusal | undefined {\n try {\n const parsed: unknown = JSON.parse(text)\n if (\n typeof parsed === 'object' &&\n parsed !== null &&\n typeof (parsed as { reason?: unknown }).reason === 'string'\n ) {\n return parsed as AgentGrantRefusal\n }\n } catch (_error) {\n // not JSON: the caller throws an HttpError\n }\n return undefined\n}\n\nexport class ControlAgentGrantsInternalService {\n /**\n * Asks for a grant. It needs a machine token for `camunda-cloud-audience`\n * that holds `ctag`. A 409 gives the refusal, and CloudBot words the reply\n * from its `reason`. Any other failure throws. A 429 is NOT tried again,\n * because CloudBot answers a Slack message with a deadline.\n */\n public static async create(\n params: CreateAgentGrantRequest,\n ): Promise<CreateAgentGrantResult> {\n const name = 'ControlAgentGrantsInternalService.create'\n const url = 'internal/agent-grants'\n const response = await request<AgentGrantCreated | AgentGrantRefusal>({\n ...params,\n base: { id: 'control' },\n url,\n method: 'post',\n metricsDetails: {\n method: { name, url, normalizedUrl: url, type: 'post' },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'control', type: 'internal' as const },\n },\n body: params.params,\n // The body holds the emails of the requester and the owner.\n redactBody: true,\n retry: { attempts: 1, remaining: 0 },\n })\n if (response.ok) {\n return { ok: true, grant: response.body as AgentGrantCreated }\n }\n if (response.status === 409) {\n const refusal = parseRefusal(response.statusText ?? '')\n if (refusal) {\n return { ok: false, refusal }\n }\n }\n throw new HttpError(\n `${name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import type { AgentStatusResponse, AgentToken, AgentTokenAdmin, AgentTokenCreated, AgentTokenExpiryDays, AgentTokenStatus, AgentVerifyResponse } from '@camunda/ccma-shared-types';
|
|
1
|
+
import type { AgentStatusResponse, AgentToken, AgentTokenAdmin, AgentTokenCreated, AgentTokenExpiryDays, AgentTokenStatus, AgentVerifyResponse, ExtendAgentTokenDto, RedeemAgentGrantDto } from '@camunda/ccma-shared-types';
|
|
2
2
|
import type { RequestBaseParams } from '../../types/general.types.js';
|
|
3
3
|
export interface CreateAgentTokenRequest extends RequestBaseParams {
|
|
4
4
|
params: {
|
|
5
5
|
name: string;
|
|
6
6
|
expiresInDays: AgentTokenExpiryDays;
|
|
7
|
+
slackChannelId?: string;
|
|
7
8
|
};
|
|
8
9
|
}
|
|
10
|
+
export interface ExtendAgentTokenRequest extends RequestBaseParams {
|
|
11
|
+
params: {
|
|
12
|
+
uuid: string;
|
|
13
|
+
} & ExtendAgentTokenDto;
|
|
14
|
+
}
|
|
15
|
+
export interface RedeemAgentGrantRequest extends RequestBaseParams {
|
|
16
|
+
params: RedeemAgentGrantDto;
|
|
17
|
+
}
|
|
9
18
|
export interface ListAllAgentTokensRequest extends RequestBaseParams {
|
|
10
19
|
params?: {
|
|
11
20
|
status?: Exclude<AgentTokenStatus, 'inactive'>;
|
|
@@ -41,6 +50,8 @@ export declare class ControlAgentTokensService {
|
|
|
41
50
|
}>;
|
|
42
51
|
/** A new secret for an own, active token. 404 while the flag is off. */
|
|
43
52
|
static rotate(params: AgentTokenUuidRequest): Promise<AgentTokenCreated>;
|
|
53
|
+
/** Moves the expiry of an own token to now plus `expiresInDays`. */
|
|
54
|
+
static extend(params: ExtendAgentTokenRequest): Promise<AgentToken>;
|
|
44
55
|
/** Revokes an own token, or any token with `agentTokens.admin`. */
|
|
45
56
|
static revoke(params: AgentTokenUuidRequest): Promise<void>;
|
|
46
57
|
}
|
|
@@ -63,4 +74,11 @@ export declare class ControlAgentClientsInternalService {
|
|
|
63
74
|
* an agent request open, and it has a deadline of its own.
|
|
64
75
|
*/
|
|
65
76
|
static status(params: AgentTokenUuidRequest): Promise<AgentStatusResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Trades a grant code and its PKCE verifier for the identity of the
|
|
79
|
+
* binding. It needs no token: do not set `config.auth`. A 401 means that
|
|
80
|
+
* the code is not valid, for any reason. Like `verify`, a 429 is NOT tried
|
|
81
|
+
* again.
|
|
82
|
+
*/
|
|
83
|
+
static redeemGrant(params: RedeemAgentGrantRequest): Promise<AgentVerifyResponse>;
|
|
66
84
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { request } from "../../utils/api.js";
|
|
2
2
|
import { HttpError } from "../../utils/errors.js";
|
|
3
3
|
const BASE = { id: "control" };
|
|
4
|
-
async function send(params, name, url, normalizedUrl, method, body, retry) {
|
|
4
|
+
async function send(params, name, url, normalizedUrl, method, body, retry, redactBody) {
|
|
5
5
|
const serviceContext = {
|
|
6
6
|
method: { name, url, normalizedUrl, type: method },
|
|
7
7
|
source: params.config.metrics?.source || "unset",
|
|
@@ -15,7 +15,8 @@ async function send(params, name, url, normalizedUrl, method, body, retry) {
|
|
|
15
15
|
method,
|
|
16
16
|
metricsDetails: serviceContext,
|
|
17
17
|
body,
|
|
18
|
-
retry
|
|
18
|
+
retry,
|
|
19
|
+
redactBody
|
|
19
20
|
});
|
|
20
21
|
if (!response.ok) {
|
|
21
22
|
throw new HttpError(
|
|
@@ -76,6 +77,18 @@ class ControlAgentTokensService {
|
|
|
76
77
|
"post"
|
|
77
78
|
);
|
|
78
79
|
}
|
|
80
|
+
/** Moves the expiry of an own token to now plus `expiresInDays`. */
|
|
81
|
+
static async extend(params) {
|
|
82
|
+
const { uuid, expiresInDays } = params.params;
|
|
83
|
+
return send(
|
|
84
|
+
params,
|
|
85
|
+
"ControlAgentTokensService.extend",
|
|
86
|
+
`api/agent-tokens/${encodeURIComponent(uuid)}/extend`,
|
|
87
|
+
"api/agent-tokens/:uuid/extend",
|
|
88
|
+
"post",
|
|
89
|
+
{ expiresInDays }
|
|
90
|
+
);
|
|
91
|
+
}
|
|
79
92
|
/** Revokes an own token, or any token with `agentTokens.admin`. */
|
|
80
93
|
static async revoke(params) {
|
|
81
94
|
await send(
|
|
@@ -126,6 +139,25 @@ class ControlAgentClientsInternalService {
|
|
|
126
139
|
{ attempts: 1, remaining: 0 }
|
|
127
140
|
);
|
|
128
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Trades a grant code and its PKCE verifier for the identity of the
|
|
144
|
+
* binding. It needs no token: do not set `config.auth`. A 401 means that
|
|
145
|
+
* the code is not valid, for any reason. Like `verify`, a 429 is NOT tried
|
|
146
|
+
* again.
|
|
147
|
+
*/
|
|
148
|
+
static async redeemGrant(params) {
|
|
149
|
+
return send(
|
|
150
|
+
params,
|
|
151
|
+
"ControlAgentClientsInternalService.redeemGrant",
|
|
152
|
+
"internal/agent-grants/redeem",
|
|
153
|
+
"internal/agent-grants/redeem",
|
|
154
|
+
"post",
|
|
155
|
+
params.params,
|
|
156
|
+
{ attempts: 1, remaining: 0 },
|
|
157
|
+
// The code and the verifier are secrets, and the key names do not say so.
|
|
158
|
+
true
|
|
159
|
+
);
|
|
160
|
+
}
|
|
129
161
|
}
|
|
130
162
|
export {
|
|
131
163
|
ControlAgentClientsInternalService,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/control/control.agent-tokens.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 AgentStatusResponse,\n AgentToken,\n AgentTokenAdmin,\n AgentTokenCreated,\n AgentTokenExpiryDays,\n AgentTokenStatus,\n AgentVerifyResponse,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseMethodType,\n RequestBaseParams,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\n/**\n * The agent tokens of ccmacli in control-backend.\n *\n * `ControlAgentTokensService` is for a Camundi, with the user token of\n * control-frontend. `ControlAgentClientsInternalService` is for the machine\n * callers: token-issuer verifies credentials, and console-backend and\n * accounts-backend read the status of a client.\n */\n\nconst BASE = { id: 'control' } as const\n\nexport interface CreateAgentTokenRequest extends RequestBaseParams {\n params: {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n AgentStatusResponse,\n AgentToken,\n AgentTokenAdmin,\n AgentTokenCreated,\n AgentTokenExpiryDays,\n AgentTokenStatus,\n AgentVerifyResponse,\n ExtendAgentTokenDto,\n RedeemAgentGrantDto,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseMethodType,\n RequestBaseParams,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\n/**\n * The agent tokens of ccmacli in control-backend.\n *\n * `ControlAgentTokensService` is for a Camundi, with the user token of\n * control-frontend. `ControlAgentClientsInternalService` is for the machine\n * callers: token-issuer verifies credentials, and console-backend and\n * accounts-backend read the status of a client.\n */\n\nconst BASE = { id: 'control' } as const\n\nexport interface CreateAgentTokenRequest extends RequestBaseParams {\n params: {\n name: string\n expiresInDays: AgentTokenExpiryDays\n slackChannelId?: string\n }\n}\n\nexport interface ExtendAgentTokenRequest extends RequestBaseParams {\n params: { uuid: string } & ExtendAgentTokenDto\n}\n\nexport interface RedeemAgentGrantRequest extends RequestBaseParams {\n params: RedeemAgentGrantDto\n}\n\nexport interface ListAllAgentTokensRequest extends RequestBaseParams {\n params?: { status?: Exclude<AgentTokenStatus, 'inactive'> }\n}\n\nexport interface AgentTokenUuidRequest extends RequestBaseParams {\n params: { uuid: string }\n}\n\nexport interface VerifyAgentClientRequest extends RequestBaseParams {\n params: { clientId: string; clientSecret: string }\n}\n\nasync function send<TResponse>(\n params: RequestBaseParams,\n name: string,\n url: string,\n normalizedUrl: string,\n method: RequestBaseMethodType,\n body?: object,\n retry?: { attempts: number; remaining: number },\n /** True masks every value of the body in the log lines. */\n redactBody?: boolean,\n): Promise<TResponse> {\n const serviceContext = {\n method: { name, url, normalizedUrl, type: method },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'control', type: 'internal' as const },\n }\n const response = await request<TResponse>({\n ...params,\n config: params.config,\n base: BASE,\n url,\n method,\n metricsDetails: serviceContext,\n body,\n retry,\n redactBody,\n })\n if (!response.ok) {\n throw new HttpError(\n `${name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n // `revoke` answers 204 with no body, and its caller reads nothing.\n return response.body as TResponse\n}\n\nexport class ControlAgentTokensService {\n /**\n * Creates an agent token of the caller. The answer is the only place that\n * holds the secret. 404 while the flag `control.agentTokens` is off.\n */\n public static async create(\n params: CreateAgentTokenRequest,\n ): Promise<AgentTokenCreated> {\n return send<AgentTokenCreated>(\n params,\n 'ControlAgentTokensService.create',\n 'api/agent-tokens',\n 'api/agent-tokens',\n 'post',\n params.params,\n )\n }\n\n /** The tokens that the caller created, newest first. */\n public static async listOwn(\n params: RequestBaseParams,\n ): Promise<{ items: AgentToken[] }> {\n return send<{ items: AgentToken[] }>(\n params,\n 'ControlAgentTokensService.listOwn',\n 'api/agent-tokens',\n 'api/agent-tokens',\n 'get',\n )\n }\n\n /**\n * The newest 500 tokens of the stage that match `status`. Needs\n * `agentTokens.admin`.\n */\n public static async listAll(\n params: ListAllAgentTokensRequest,\n ): Promise<{ items: AgentTokenAdmin[] }> {\n const status = params.params?.status\n const query = status ? `?status=${encodeURIComponent(status)}` : ''\n return send<{ items: AgentTokenAdmin[] }>(\n params,\n 'ControlAgentTokensService.listAll',\n `api/agent-tokens/all${query}`,\n 'api/agent-tokens/all',\n 'get',\n )\n }\n\n /** A new secret for an own, active token. 404 while the flag is off. */\n public static async rotate(\n params: AgentTokenUuidRequest,\n ): Promise<AgentTokenCreated> {\n return send<AgentTokenCreated>(\n params,\n 'ControlAgentTokensService.rotate',\n `api/agent-tokens/${encodeURIComponent(params.params.uuid)}/rotate`,\n 'api/agent-tokens/:uuid/rotate',\n 'post',\n )\n }\n\n /** Moves the expiry of an own token to now plus `expiresInDays`. */\n public static async extend(\n params: ExtendAgentTokenRequest,\n ): Promise<AgentToken> {\n const { uuid, expiresInDays } = params.params\n return send<AgentToken>(\n params,\n 'ControlAgentTokensService.extend',\n `api/agent-tokens/${encodeURIComponent(uuid)}/extend`,\n 'api/agent-tokens/:uuid/extend',\n 'post',\n { expiresInDays },\n )\n }\n\n /** Revokes an own token, or any token with `agentTokens.admin`. */\n public static async revoke(params: AgentTokenUuidRequest): Promise<void> {\n await send<undefined>(\n params,\n 'ControlAgentTokensService.revoke',\n `api/agent-tokens/${encodeURIComponent(params.params.uuid)}`,\n 'api/agent-tokens/:uuid',\n 'delete',\n )\n }\n}\n\nexport class ControlAgentClientsInternalService {\n /**\n * Checks the credentials of an agent client. It needs no token: do not\n * set `config.auth`. A 401 means that the credentials are not valid, for\n * any reason, and it does not count as an error in the metrics.\n *\n * A 429 is NOT tried again. token-issuer calls this inside a token request,\n * and `request` would otherwise wait and try up to 8 times.\n */\n public static async verify(\n params: VerifyAgentClientRequest,\n ): Promise<AgentVerifyResponse> {\n return send<AgentVerifyResponse>(\n params,\n 'ControlAgentClientsInternalService.verify',\n 'internal/agent-clients/verify',\n 'internal/agent-clients/verify',\n 'post',\n params.params,\n { attempts: 1, remaining: 0 },\n )\n }\n\n /**\n * Whether an agent client is active, and its read permissions. It needs a\n * machine token for `camunda-cloud-audience` that holds `ctas`. An unknown\n * uuid answers `active: false`.\n *\n * A 429 is NOT tried again, for the reason of `verify`: the caller holds\n * an agent request open, and it has a deadline of its own.\n */\n public static async status(\n params: AgentTokenUuidRequest,\n ): Promise<AgentStatusResponse> {\n return send<AgentStatusResponse>(\n params,\n 'ControlAgentClientsInternalService.status',\n `internal/agent-clients/${encodeURIComponent(params.params.uuid)}/status`,\n 'internal/agent-clients/:uuid/status',\n 'get',\n undefined,\n { attempts: 1, remaining: 0 },\n )\n }\n\n /**\n * Trades a grant code and its PKCE verifier for the identity of the\n * binding. It needs no token: do not set `config.auth`. A 401 means that\n * the code is not valid, for any reason. Like `verify`, a 429 is NOT tried\n * again.\n */\n public static async redeemGrant(\n params: RedeemAgentGrantRequest,\n ): Promise<AgentVerifyResponse> {\n return send<AgentVerifyResponse>(\n params,\n 'ControlAgentClientsInternalService.redeemGrant',\n 'internal/agent-grants/redeem',\n 'internal/agent-grants/redeem',\n 'post',\n params.params,\n { attempts: 1, remaining: 0 },\n // The code and the verifier are secrets, and the key names do not say so.\n true,\n )\n }\n}\n"],
|
|
5
|
+
"mappings": "AAqBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAW1B,MAAM,OAAO,EAAE,IAAI,UAAU;AA8B7B,eAAe,KACb,QACA,MACA,KACA,eACA,QACA,MACA,OAEA,YACoB;AACpB,QAAM,iBAAiB;AAAA,IACrB,QAAQ,EAAE,MAAM,KAAK,eAAe,MAAM,OAAO;AAAA,IACjD,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,IACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAoB;AAAA,EACvD;AACA,QAAM,WAAW,MAAM,QAAmB;AAAA,IACxC,GAAG;AAAA,IACH,QAAQ,OAAO;AAAA,IACf,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI;AAAA,MACR,GAAG,IAAI,KAAK,SAAS,MAAM,IA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