@camunda/ccma-api 5.20.2 → 6.1.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.
Files changed (51) hide show
  1. package/dist/index.d.ts +8 -6
  2. package/dist/index.js +10 -2
  3. package/dist/index.js.map +2 -2
  4. package/dist/services/accounts/approvals.m2m.service.d.ts +41 -2
  5. package/dist/services/accounts/approvals.m2m.service.js +62 -0
  6. package/dist/services/accounts/approvals.m2m.service.js.map +2 -2
  7. package/dist/services/accounts/orgs.service.d.ts +2 -1
  8. package/dist/services/accounts/orgs.service.js.map +2 -2
  9. package/dist/services/ccma/ccma.openapi.service.d.ts +48 -0
  10. package/dist/services/ccma/ccma.openapi.service.js +88 -0
  11. package/dist/services/ccma/ccma.openapi.service.js.map +7 -0
  12. package/dist/services/ccma/ccma.openapi.service.spec.d.ts +1 -0
  13. package/dist/services/console/console.admin.service.d.ts +1 -0
  14. package/dist/services/console/console.admin.service.js.map +1 -1
  15. package/dist/services/console/console.approvals.m2m.service.d.ts +12 -2
  16. package/dist/services/console/console.approvals.m2m.service.js +18 -0
  17. package/dist/services/console/console.approvals.m2m.service.js.map +2 -2
  18. package/dist/services/console/console.channel.service.d.ts +10 -5
  19. package/dist/services/console/console.channel.service.js.map +2 -2
  20. package/dist/services/console/console.cluster-parameters.service.d.ts +2 -0
  21. package/dist/services/console/console.cluster-parameters.service.js.map +2 -2
  22. package/dist/services/console/generation.service.d.ts +4 -0
  23. package/dist/services/console/generation.service.js.map +2 -2
  24. package/dist/services/control/control.agent-grants.redact.spec.d.ts +1 -0
  25. package/dist/services/control/control.agent-grants.service.d.ts +26 -0
  26. package/dist/services/control/control.agent-grants.service.js +57 -0
  27. package/dist/services/control/control.agent-grants.service.js.map +7 -0
  28. package/dist/services/control/control.agent-grants.service.spec.d.ts +1 -0
  29. package/dist/services/control/control.agent-tokens.service.d.ts +19 -1
  30. package/dist/services/control/control.agent-tokens.service.js +34 -2
  31. package/dist/services/control/control.agent-tokens.service.js.map +2 -2
  32. package/dist/services/control/control.approvals.service.d.ts +74 -11
  33. package/dist/services/control/control.approvals.service.js +84 -11
  34. package/dist/services/control/control.approvals.service.js.map +2 -2
  35. package/dist/services/token-issuer/token-issuer.grant.service.d.ts +26 -0
  36. package/dist/services/token-issuer/token-issuer.grant.service.js +52 -0
  37. package/dist/services/token-issuer/token-issuer.grant.service.js.map +7 -0
  38. package/dist/services/token-issuer/token-issuer.grant.service.spec.d.ts +1 -0
  39. package/dist/types/general.types.d.ts +22 -0
  40. package/dist/utils/api.ccma-openapi-status.spec.d.ts +1 -0
  41. package/dist/utils/api.d.ts +13 -2
  42. package/dist/utils/api.js +55 -5
  43. package/dist/utils/api.js.map +2 -2
  44. package/dist/utils/api.on-failed-response.spec.d.ts +1 -0
  45. package/dist/utils/environments.d.ts +1 -1
  46. package/dist/utils/environments.js +0 -7
  47. package/dist/utils/environments.js.map +2 -2
  48. package/package.json +1 -1
  49. package/dist/services/mixpanel/mixpanel.service.d.ts +0 -16
  50. package/dist/services/mixpanel/mixpanel.service.js +0 -86
  51. package/dist/services/mixpanel/mixpanel.service.js.map +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/services/console/generation.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 DryRunSanityDiff,\n GenerationDto,\n ReleaseTrainAutoUpgradeCandidates,\n ReleaseTrainSanityReport,\n UpgradableGenerationsDto,\n UpgradeReadinessDto,\n ZeebeClusterVersionsDto,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface ReleaseTrainGenerationRef {\n uuid: string\n name: string\n}\n\ninterface ReleaseTrainChannelChange {\n channelName: string\n generationAdded: ReleaseTrainGenerationRef\n generationRemoved?: ReleaseTrainGenerationRef\n /** Absent when the release did not manage that channel default. */\n newDefault?: ReleaseTrainGenerationRef\n}\n\ninterface DryRunBase {\n dryRun: true\n /** Sanity rules before and after the change, and the violations that differ. */\n sanity: DryRunSanityDiff\n /**\n * True if a real call with no `overrideSanityErrors` refuses: it adds a\n * sanity violation of severity `error`, or it breaks a rule of the release\n * train.\n */\n wouldRefuse: boolean\n /**\n * The rules of the release train that the change breaks. A real call\n * refuses on each of them, also with `overrideSanityErrors`. A console\n * that is older than control-frontend sends no list, because the two\n * deploy separately.\n */\n refusals?: string[]\n}\n\nexport interface DryRunPublishReleaseTrainResponse extends DryRunBase {\n changes: {\n newGeneration: ReleaseTrainGenerationRef\n previousGeneration: ReleaseTrainGenerationRef & { channels: string[] }\n previousGenerationCleared?: ReleaseTrainGenerationRef\n nextMinorGenerationUpdated?: ReleaseTrainGenerationRef\n channelsUpdated: ReleaseTrainChannelChange[]\n }\n}\n\nexport interface DryRunRollbackReleaseTrainResponse extends DryRunBase {\n changes: {\n channelsUpdated: ReleaseTrainChannelChange[]\n previousGenerationRestored?: ReleaseTrainGenerationRef\n nextMinorGenerationRestored?: ReleaseTrainGenerationRef\n }\n}\n\n/**\n * Version payload accepted by the create/update generation endpoints. Mirrors\n * `ZeebeClusterVersionsDto` but allows the optional component versions to be\n * omitted; the backend normalizes blank optionals to `undefined`.\n *\n * The required set matches what console-backend validates with `checkVersion`\n * (not `checkVersionOptional`): zeebe, elasticSearchOss and\n * elasticSearchCurator. `optimize` is optional \u2014 generations in production\n * hold a blank value for it.\n */\nexport type GenerationVersionsInput = Partial<ZeebeClusterVersionsDto> &\n // `Required`, because `elasticSearchCurator` is optional in\n // `ZeebeClusterVersionsDto` and a plain `Pick` keeps that modifier. The\n // create route refuses a payload without it, thus the type must too.\n Required<\n Pick<\n ZeebeClusterVersionsDto,\n 'zeebe' | 'elasticSearchOss' | 'elasticSearchCurator'\n >\n >\n\nexport interface CreateGenerationParams extends RequestBaseParams {\n body: {\n name: string\n versions: GenerationVersionsInput\n upgradeableFrom?: string[]\n isUnsupportedStarting?: string\n isBespoke?: boolean\n }\n}\n\nexport interface UpdateGenerationParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n name?: string\n /**\n * A PATCH of the mutable versions. A key that the object names changes,\n * a key that it does not name keeps its value on the generation, and an\n * empty string clears an optional one. So send only what you change:\n * a save of the name or the env vars that does not name the image\n * versions cannot write over a change that an approval request made in\n * between, and the request cannot write over this save.\n *\n * Omit the whole object to edit `upgradeableFrom` or `name` alone.\n */\n versions?: Partial<GenerationVersionsInput>\n upgradeableFrom?: string[]\n }\n}\n\nexport interface DeleteGenerationParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n}\n\nexport interface SetGenerationBespokeParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n isBespoke: boolean\n }\n}\n\nexport interface SetGenerationArchivedParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n isArchived: boolean\n }\n}\n\nexport interface ListGenerationsParams extends RequestBaseParams {}\n\nexport class GenerationService {\n public static async list(\n params: ListGenerationsParams,\n ): Promise<GenerationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.list',\n url: 'api/generations',\n normalizedUrl: 'api/generations',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto[]>({\n ...params,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async getGeneration(\n params: { uuid: string } & RequestBaseParams,\n ): Promise<GenerationDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getGeneration`,\n url: `api/generations/${params.uuid}`,\n normalizedUrl: `api/generations/:generationUuid`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto>({\n config: params.config,\n base: {\n id: 'console',\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async getUpgradable(\n params: {\n fromGenerationUuid: string\n clusterId?: string\n } & RequestBaseParams,\n ): Promise<GenerationDto[]> {\n const baseUrl = `api/generations/${params.fromGenerationUuid}/upgradable`\n const url = params.clusterId\n ? `${baseUrl}?clusterId=${encodeURIComponent(params.clusterId)}`\n : baseUrl\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradable`,\n url,\n normalizedUrl: params.clusterId\n ? `api/generations/:fromGenerationUuid/upgradable?clusterId=:clusterId`\n : `api/generations/:fromGenerationUuid/upgradable`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<GenerationDto[]>({\n config: params.config,\n base: {\n id: 'console',\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async getUpgradableMulti(\n params: {\n fromGenerationUuid: string\n clusterId?: string\n } & RequestBaseParams,\n ): Promise<UpgradableGenerationsDto> {\n const baseUrl = `api/generations/${params.fromGenerationUuid}/upgradable-multi`\n const url = params.clusterId\n ? `${baseUrl}?clusterId=${encodeURIComponent(params.clusterId)}`\n : baseUrl\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradableMulti`,\n url,\n normalizedUrl: params.clusterId\n ? `api/generations/:fromGenerationUuid/upgradable-multi?clusterId=:clusterId`\n : `api/generations/:fromGenerationUuid/upgradable-multi`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<UpgradableGenerationsDto>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 ?? { preferred: null, options: [] }\n }\n\n public static async upgradeCluster(\n params: {\n generationUuid: string\n clusterId: string\n orgId: string\n tasklistV2Enabled?: boolean\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.upgradeCluster`,\n url: `api/orgs/${params.orgId}/clusters/${params.clusterId}/upgrade/${params.generationUuid}`,\n normalizedUrl: `api/orgs/:orgId/clusters/:clusterId/upgrade/:generationUuid`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<string>({\n config: params.config,\n base: {\n id: 'console',\n },\n body:\n params.tasklistV2Enabled === undefined\n ? undefined\n : { tasklistV2Enabled: params.tasklistV2Enabled },\n responseType: 'text',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * Upgrades a cluster to a generation via the internal/admin route (`PUT\n * api/generations/:generationUuid/upgradecluster/:clusterId`), as opposed\n * to {@link upgradeCluster}'s customer-facing, org-scoped route. This is\n * the endpoint Camunda staff use to upgrade a cluster on a customer's\n * behalf: it is not gated by `orgValidator`/`clusterOwnerValidator`, always\n * records the change as done `byCamunda`, and \u2014 when `yolo` is set \u2014\n * bypasses the generation's `upgradeableFrom` compatibility graph\n * entirely (subject to the caller holding the yolo permission\n * server-side). Mirrors accounts-frontend's\n * `generations.upgradeCluster` model action.\n */\n public static async upgradeClusterAdmin(\n params: {\n generationUuid: string\n clusterId: string\n yolo?: boolean\n /** Skips the upgrade gate for this upgrade. Needs canUpgradeGeneration. */\n ignoreUpgradeGate?: boolean\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.upgradeClusterAdmin',\n url: `api/generations/${params.generationUuid}/upgradecluster/${params.clusterId}`,\n normalizedUrl:\n 'api/generations/:generationUuid/upgradecluster/:clusterId',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: {\n yolo: params.yolo ?? false,\n byCamunda: true,\n ...(params.ignoreUpgradeGate && { ignoreUpgradeGate: true }),\n },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * The upgrade gate of a cluster, for the customer (PDP-3067). `undefined`\n * when the route answers 404: the stage does not have the flag, so the\n * server enforces no rule.\n */\n public static getUpgradeReadiness(\n params: { orgId: string; clusterId: string } & RequestBaseParams,\n ): Promise<UpgradeReadinessDto | undefined> {\n return GenerationService.readUpgradeReadiness(params, {\n name: 'GenerationService.getUpgradeReadiness',\n url: `api/orgs/${params.orgId}/clusters/${params.clusterId}/upgrade-readiness`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/upgrade-readiness',\n type: 'get',\n })\n }\n\n /** The same as {@link getUpgradeReadiness}, on the admin route of Control. */\n public static getUpgradeReadinessAdmin(\n params: { clusterId: string } & RequestBaseParams,\n ): Promise<UpgradeReadinessDto | undefined> {\n return GenerationService.readUpgradeReadiness(params, {\n name: 'GenerationService.getUpgradeReadinessAdmin',\n url: `api/admin/clusters/${params.clusterId}/upgrade-readiness`,\n normalizedUrl: 'api/admin/clusters/:clusterUuid/upgrade-readiness',\n type: 'get',\n })\n }\n\n private static async readUpgradeReadiness(\n params: RequestBaseParams,\n method: RequestBaseServiceContext['method'],\n ): Promise<UpgradeReadinessDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method,\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<UpgradeReadinessDto>({\n config: params.config,\n base: { id: 'console' },\n url: method.url,\n method: method.type,\n metricsDetails: serviceContext,\n })\n if (response.status === 404) {\n return undefined\n }\n if (!response.ok) {\n throw new HttpError(\n `${method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async setSupported(\n params: {\n generationUuid: string\n unsupportedStartingAt: string | null\n } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.setSupported`,\n url: `api/generations/${params.generationUuid}/supported`,\n normalizedUrl: `api/generations/:generationUuid/supported`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<any>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: {\n unsupportedStartingAt: params.unsupportedStartingAt,\n },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async createAutoUpdateBulkOperation(\n params: {\n generationUuid: string\n name: string\n reason: string\n eyes: number\n } & RequestBaseParams,\n ) {\n const body = {\n name: params.name,\n reason: params.reason,\n eyes: params.eyes,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.createAutoUpdateBulkOperation`,\n url: `external/generations/${params.generationUuid}/autoupdate`,\n normalizedUrl: `external/generations/:generationUuid/autoupdate`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n uuid: string\n name: string\n clusterCount: number\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async createBulkUpgradeOperation(\n params: {\n fromGenerationUuid: string\n toGenerationUuid: string\n name: string\n reason: string\n eyes: number\n } & RequestBaseParams,\n ) {\n const body = {\n toGenerationUuid: params.toGenerationUuid,\n name: params.name,\n reason: params.reason,\n eyes: params.eyes,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.createBulkUpgradeOperation`,\n url: `external/generations/${params.fromGenerationUuid}/bulkUpgrade`,\n normalizedUrl: `external/generations/:fromGenerationUuid/bulkUpgrade`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n uuid: string\n name: string\n clusterCount: number\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n /**\n * Replaces a generation's upgrade path via the external API (`PUT\n * external/generations/:generationUuid/upgradepath`). Gated on the\n * M2M-only `m2m.manageGenerationUpgradePath` scope by design, so this is\n * for service-credential callers (e.g. the release-train hack scripts).\n * Interactive/browser callers cannot use it \u2014 they edit the upgrade path\n * through {@link update} against `api/generations/:generationUuid`, the same\n * way accounts-frontend does.\n */\n public static async updateUpgradePath(\n params: {\n generationUuid: string\n upgradeableFrom: string[]\n } & RequestBaseParams,\n ): Promise<\n | {\n name: string\n uuid: string\n upgradeableFrom: Array<{ uuid: string }>\n }\n | undefined\n > {\n const body = {\n upgradeableFrom: params.upgradeableFrom,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.updateUpgradePath`,\n url: `external/generations/${params.generationUuid}/upgradepath`,\n normalizedUrl: `external/generations/:generationUuid/upgradepath`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n name: string\n uuid: string\n upgradeableFrom: Array<{ uuid: string }>\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async publishReleaseTrain(\n params: {\n previousGenerationId: string\n name: string\n releaseType: 'patch' | 'alpha' | 'minor'\n versions?: Partial<ZeebeClusterVersionsDto>\n isUnsupportedStarting?: string\n /** Runs the publish although it adds new errors of the sanity rules. */\n overrideSanityErrors?: boolean\n } & RequestBaseParams,\n ) {\n const {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\n overrideSanityErrors,\n } = params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.publishReleaseTrain',\n url: 'external/release-train/generation',\n normalizedUrl: 'external/release-train/generation',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n generationId: string\n changes: {\n newGeneration: { uuid: string; name: string }\n previousGenerationCleared?: { uuid: string; name: string }\n nextMinorGenerationUpdated?: { uuid: string; name: string }\n channelsUpdated: Array<{\n channelName: string\n generationAdded: { uuid: string; name: string }\n generationRemoved?: { uuid: string; name: string }\n /** Absent when the release did not manage that channel default. */\n newDefault?: { uuid: string; name: string }\n }>\n }\n }>({\n config: params.config,\n base: { id: 'console' },\n body: {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\n overrideSanityErrors,\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async rollbackReleaseTrain(\n params: {\n generationId: string\n releaseType: 'patch' | 'alpha' | 'minor'\n replacementGenerationId?: string\n stableReplacementGenerationId?: string\n alphaReplacementGenerationId?: string\n /** Runs the rollback although it adds new errors of the sanity rules. */\n overrideSanityErrors?: boolean\n } & RequestBaseParams,\n ) {\n const {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\n overrideSanityErrors,\n } = params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.rollbackReleaseTrain',\n url: 'external/release-train/rollback',\n normalizedUrl: 'external/release-train/rollback',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n rolledBackGenerationId: string\n changes: {\n channelsUpdated: Array<{\n channelName: string\n generationAdded: { uuid: string; name: string }\n generationRemoved?: { uuid: string; name: string }\n newDefault: { uuid: string; name: string }\n }>\n previousGenerationRestored?: { uuid: string; name: string }\n nextMinorGenerationRestored?: { uuid: string; name: string }\n }\n }>({\n config: params.config,\n base: { id: 'console' },\n body: {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\n overrideSanityErrors,\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async triggerAutoUpgrade(\n params: { generationId: string } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.triggerAutoUpgrade',\n url: `external/release-train/generation/${params.generationId}/auto-upgrade`,\n normalizedUrl:\n 'external/release-train/generation/:generationId/auto-upgrade',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n bulkOperationUuid: string\n clusterCount: number\n }>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 /** The clusters that an auto-upgrade to this generation changes now. */\n public static async getAutoUpgradeCandidates(\n params: { params: { generationId: string } } & RequestBaseParams,\n ): Promise<ReleaseTrainAutoUpgradeCandidates> {\n const { generationId } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.getAutoUpgradeCandidates',\n url: `external/release-train/generation/${encodeURIComponent(generationId)}/auto-upgrade-candidates`,\n normalizedUrl:\n 'external/release-train/generation/:generationId/auto-upgrade-candidates',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ReleaseTrainAutoUpgradeCandidates>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n return response.body\n }\n\n /**\n * Dry run of `publishReleaseTrain`. The backend writes nothing and answers\n * with what a real call would change and how the sanity rules would react.\n */\n public static async dryRunPublishReleaseTrain(\n params: Parameters<typeof GenerationService.publishReleaseTrain>[0],\n ) {\n return GenerationService.postReleaseTrainDryRun<DryRunPublishReleaseTrainResponse>(\n 'GenerationService.dryRunPublishReleaseTrain',\n params.config,\n 'external/release-train/generation',\n 'external/release-train/generation',\n {\n previousGenerationId: params.previousGenerationId,\n name: params.name,\n releaseType: params.releaseType,\n versions: params.versions,\n isUnsupportedStarting: params.isUnsupportedStarting,\n dryRun: true,\n },\n )\n }\n\n /** Dry run of `rollbackReleaseTrain`. Writes nothing. */\n public static async dryRunRollbackReleaseTrain(\n params: Parameters<typeof GenerationService.rollbackReleaseTrain>[0],\n ) {\n return GenerationService.postReleaseTrainDryRun<DryRunRollbackReleaseTrainResponse>(\n 'GenerationService.dryRunRollbackReleaseTrain',\n params.config,\n 'external/release-train/rollback',\n 'external/release-train/rollback',\n {\n generationId: params.generationId,\n releaseType: params.releaseType,\n replacementGenerationId: params.replacementGenerationId,\n stableReplacementGenerationId: params.stableReplacementGenerationId,\n alphaReplacementGenerationId: params.alphaReplacementGenerationId,\n dryRun: true,\n },\n )\n }\n\n private static async postReleaseTrainDryRun<T>(\n methodName: string,\n config: RequestBaseParams['config'],\n url: string,\n normalizedUrl: string,\n body: Record<string, unknown> | undefined,\n ): Promise<T | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: methodName,\n url,\n normalizedUrl,\n type: 'post',\n },\n source: config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<T>({\n config,\n base: { id: 'console' },\n body,\n responseType: 'json',\n url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async getReleaseTrainSanity(\n params: RequestBaseParams,\n ): Promise<ReleaseTrainSanityReport> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.getReleaseTrainSanity',\n url: 'external/release-train/sanity-check',\n normalizedUrl: 'external/release-train/sanity-check',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ReleaseTrainSanityReport>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n return response.body\n }\n\n public static async create(\n params: CreateGenerationParams,\n ): Promise<GenerationDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.create',\n url: 'api/generations',\n normalizedUrl: 'api/generations',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n return response.body\n }\n\n public static async update(params: UpdateGenerationParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.update',\n url: `api/generations/${params.params.generationUuid}`,\n normalizedUrl: 'api/generations/:generationUuid',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async delete(params: DeleteGenerationParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.delete',\n url: `api/generations/${params.params.generationUuid}`,\n normalizedUrl: 'api/generations/:generationUuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async setBespoke(\n params: SetGenerationBespokeParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.setBespoke',\n url: `api/generations/${params.params.generationUuid}/bespoke`,\n normalizedUrl: 'api/generations/:generationUuid/bespoke',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async setArchived(\n params: SetGenerationArchivedParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.setArchived',\n url: `api/generations/${params.params.generationUuid}/archived`,\n normalizedUrl: 'api/generations/:generationUuid/archived',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
5
- "mappings": "AAmBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAkInB,MAAM,kBAAkB;AAAA,EAC7B,aAAoB,KAClB,QAC0B;AAC1B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA,QACL,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAyB;AAAA,MAC9C,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,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,QAAQ,CAAC;AAAA,EAC3B;AAAA,EAEA,aAAoB,cAClB,QACoC;AACpC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,mBAAmB,OAAO,IAAI;AAAA,QACnC,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAuB;AAAA,MAC5C,QAAQ,OAAO;AAAA,M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;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAoB,YAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,mBAAmB,OAAO,OAAO,cAAc;AAAA,QACpD,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,MAAM,OAAO;AAAA,MACb,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
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 DryRunSanityDiff,\n GenerationDto,\n ReleaseTrainAutoUpgradeCandidates,\n ReleaseTrainSanityReport,\n UpgradableGenerationsDto,\n UpgradeReadinessDto,\n ZeebeClusterVersionsDto,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface ReleaseTrainGenerationRef {\n uuid: string\n name: string\n}\n\ninterface ReleaseTrainChannelChange {\n channelName: string\n generationAdded: ReleaseTrainGenerationRef\n generationRemoved?: ReleaseTrainGenerationRef\n /** Absent when the release did not manage that channel default. */\n newDefault?: ReleaseTrainGenerationRef\n}\n\ninterface DryRunBase {\n dryRun: true\n /** Sanity rules before and after the change, and the violations that differ. */\n sanity: DryRunSanityDiff\n /**\n * True if a real call with no `overrideSanityErrors` refuses: it adds a\n * sanity violation of severity `error`, or it breaks a rule of the release\n * train.\n */\n wouldRefuse: boolean\n /**\n * The rules of the release train that the change breaks. A real call\n * refuses on each of them, also with `overrideSanityErrors`. A console\n * that is older than control-frontend sends no list, because the two\n * deploy separately.\n */\n refusals?: string[]\n}\n\nexport interface DryRunPublishReleaseTrainResponse extends DryRunBase {\n changes: {\n newGeneration: ReleaseTrainGenerationRef\n previousGeneration: ReleaseTrainGenerationRef & { channels: string[] }\n previousGenerationCleared?: ReleaseTrainGenerationRef\n nextMinorGenerationUpdated?: ReleaseTrainGenerationRef\n channelsUpdated: ReleaseTrainChannelChange[]\n /** Names of channels the release emptied. They add no generation. */\n channelsEmptied?: string[]\n }\n}\n\nexport interface DryRunRollbackReleaseTrainResponse extends DryRunBase {\n changes: {\n channelsUpdated: ReleaseTrainChannelChange[]\n /** Names of channels the release emptied. They add no generation. */\n channelsEmptied?: string[]\n previousGenerationRestored?: ReleaseTrainGenerationRef\n nextMinorGenerationRestored?: ReleaseTrainGenerationRef\n }\n}\n\n/**\n * Version payload accepted by the create/update generation endpoints. Mirrors\n * `ZeebeClusterVersionsDto` but allows the optional component versions to be\n * omitted; the backend normalizes blank optionals to `undefined`.\n *\n * The required set matches what console-backend validates with `checkVersion`\n * (not `checkVersionOptional`): zeebe, elasticSearchOss and\n * elasticSearchCurator. `optimize` is optional \u2014 generations in production\n * hold a blank value for it.\n */\nexport type GenerationVersionsInput = Partial<ZeebeClusterVersionsDto> &\n // `Required`, because `elasticSearchCurator` is optional in\n // `ZeebeClusterVersionsDto` and a plain `Pick` keeps that modifier. The\n // create route refuses a payload without it, thus the type must too.\n Required<\n Pick<\n ZeebeClusterVersionsDto,\n 'zeebe' | 'elasticSearchOss' | 'elasticSearchCurator'\n >\n >\n\nexport interface CreateGenerationParams extends RequestBaseParams {\n body: {\n name: string\n versions: GenerationVersionsInput\n upgradeableFrom?: string[]\n isUnsupportedStarting?: string\n isBespoke?: boolean\n }\n}\n\nexport interface UpdateGenerationParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n name?: string\n /**\n * A PATCH of the mutable versions. A key that the object names changes,\n * a key that it does not name keeps its value on the generation, and an\n * empty string clears an optional one. So send only what you change:\n * a save of the name or the env vars that does not name the image\n * versions cannot write over a change that an approval request made in\n * between, and the request cannot write over this save.\n *\n * Omit the whole object to edit `upgradeableFrom` or `name` alone.\n */\n versions?: Partial<GenerationVersionsInput>\n upgradeableFrom?: string[]\n }\n}\n\nexport interface DeleteGenerationParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n}\n\nexport interface SetGenerationBespokeParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n isBespoke: boolean\n }\n}\n\nexport interface SetGenerationArchivedParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n isArchived: boolean\n }\n}\n\nexport interface ListGenerationsParams extends RequestBaseParams {}\n\nexport class GenerationService {\n public static async list(\n params: ListGenerationsParams,\n ): Promise<GenerationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.list',\n url: 'api/generations',\n normalizedUrl: 'api/generations',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto[]>({\n ...params,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async getGeneration(\n params: { uuid: string } & RequestBaseParams,\n ): Promise<GenerationDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getGeneration`,\n url: `api/generations/${params.uuid}`,\n normalizedUrl: `api/generations/:generationUuid`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto>({\n config: params.config,\n base: {\n id: 'console',\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async getUpgradable(\n params: {\n fromGenerationUuid: string\n clusterId?: string\n } & RequestBaseParams,\n ): Promise<GenerationDto[]> {\n const baseUrl = `api/generations/${params.fromGenerationUuid}/upgradable`\n const url = params.clusterId\n ? `${baseUrl}?clusterId=${encodeURIComponent(params.clusterId)}`\n : baseUrl\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradable`,\n url,\n normalizedUrl: params.clusterId\n ? `api/generations/:fromGenerationUuid/upgradable?clusterId=:clusterId`\n : `api/generations/:fromGenerationUuid/upgradable`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<GenerationDto[]>({\n config: params.config,\n base: {\n id: 'console',\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async getUpgradableMulti(\n params: {\n fromGenerationUuid: string\n clusterId?: string\n } & RequestBaseParams,\n ): Promise<UpgradableGenerationsDto> {\n const baseUrl = `api/generations/${params.fromGenerationUuid}/upgradable-multi`\n const url = params.clusterId\n ? `${baseUrl}?clusterId=${encodeURIComponent(params.clusterId)}`\n : baseUrl\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradableMulti`,\n url,\n normalizedUrl: params.clusterId\n ? `api/generations/:fromGenerationUuid/upgradable-multi?clusterId=:clusterId`\n : `api/generations/:fromGenerationUuid/upgradable-multi`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<UpgradableGenerationsDto>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 ?? { preferred: null, options: [] }\n }\n\n public static async upgradeCluster(\n params: {\n generationUuid: string\n clusterId: string\n orgId: string\n tasklistV2Enabled?: boolean\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.upgradeCluster`,\n url: `api/orgs/${params.orgId}/clusters/${params.clusterId}/upgrade/${params.generationUuid}`,\n normalizedUrl: `api/orgs/:orgId/clusters/:clusterId/upgrade/:generationUuid`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<string>({\n config: params.config,\n base: {\n id: 'console',\n },\n body:\n params.tasklistV2Enabled === undefined\n ? undefined\n : { tasklistV2Enabled: params.tasklistV2Enabled },\n responseType: 'text',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * Upgrades a cluster to a generation via the internal/admin route (`PUT\n * api/generations/:generationUuid/upgradecluster/:clusterId`), as opposed\n * to {@link upgradeCluster}'s customer-facing, org-scoped route. This is\n * the endpoint Camunda staff use to upgrade a cluster on a customer's\n * behalf: it is not gated by `orgValidator`/`clusterOwnerValidator`, always\n * records the change as done `byCamunda`, and \u2014 when `yolo` is set \u2014\n * bypasses the generation's `upgradeableFrom` compatibility graph\n * entirely (subject to the caller holding the yolo permission\n * server-side). Mirrors accounts-frontend's\n * `generations.upgradeCluster` model action.\n */\n public static async upgradeClusterAdmin(\n params: {\n generationUuid: string\n clusterId: string\n yolo?: boolean\n /** Skips the upgrade gate for this upgrade. Needs canUpgradeGeneration. */\n ignoreUpgradeGate?: boolean\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.upgradeClusterAdmin',\n url: `api/generations/${params.generationUuid}/upgradecluster/${params.clusterId}`,\n normalizedUrl:\n 'api/generations/:generationUuid/upgradecluster/:clusterId',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: {\n yolo: params.yolo ?? false,\n byCamunda: true,\n ...(params.ignoreUpgradeGate && { ignoreUpgradeGate: true }),\n },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * The upgrade gate of a cluster, for the customer (PDP-3067). `undefined`\n * when the route answers 404: the stage does not have the flag, so the\n * server enforces no rule.\n */\n public static getUpgradeReadiness(\n params: { orgId: string; clusterId: string } & RequestBaseParams,\n ): Promise<UpgradeReadinessDto | undefined> {\n return GenerationService.readUpgradeReadiness(params, {\n name: 'GenerationService.getUpgradeReadiness',\n url: `api/orgs/${params.orgId}/clusters/${params.clusterId}/upgrade-readiness`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/upgrade-readiness',\n type: 'get',\n })\n }\n\n /** The same as {@link getUpgradeReadiness}, on the admin route of Control. */\n public static getUpgradeReadinessAdmin(\n params: { clusterId: string } & RequestBaseParams,\n ): Promise<UpgradeReadinessDto | undefined> {\n return GenerationService.readUpgradeReadiness(params, {\n name: 'GenerationService.getUpgradeReadinessAdmin',\n url: `api/admin/clusters/${params.clusterId}/upgrade-readiness`,\n normalizedUrl: 'api/admin/clusters/:clusterUuid/upgrade-readiness',\n type: 'get',\n })\n }\n\n private static async readUpgradeReadiness(\n params: RequestBaseParams,\n method: RequestBaseServiceContext['method'],\n ): Promise<UpgradeReadinessDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method,\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<UpgradeReadinessDto>({\n config: params.config,\n base: { id: 'console' },\n url: method.url,\n method: method.type,\n metricsDetails: serviceContext,\n })\n if (response.status === 404) {\n return undefined\n }\n if (!response.ok) {\n throw new HttpError(\n `${method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async setSupported(\n params: {\n generationUuid: string\n unsupportedStartingAt: string | null\n } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.setSupported`,\n url: `api/generations/${params.generationUuid}/supported`,\n normalizedUrl: `api/generations/:generationUuid/supported`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<any>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: {\n unsupportedStartingAt: params.unsupportedStartingAt,\n },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async createAutoUpdateBulkOperation(\n params: {\n generationUuid: string\n name: string\n reason: string\n eyes: number\n } & RequestBaseParams,\n ) {\n const body = {\n name: params.name,\n reason: params.reason,\n eyes: params.eyes,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.createAutoUpdateBulkOperation`,\n url: `external/generations/${params.generationUuid}/autoupdate`,\n normalizedUrl: `external/generations/:generationUuid/autoupdate`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n uuid: string\n name: string\n clusterCount: number\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async createBulkUpgradeOperation(\n params: {\n fromGenerationUuid: string\n toGenerationUuid: string\n name: string\n reason: string\n eyes: number\n } & RequestBaseParams,\n ) {\n const body = {\n toGenerationUuid: params.toGenerationUuid,\n name: params.name,\n reason: params.reason,\n eyes: params.eyes,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.createBulkUpgradeOperation`,\n url: `external/generations/${params.fromGenerationUuid}/bulkUpgrade`,\n normalizedUrl: `external/generations/:fromGenerationUuid/bulkUpgrade`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n uuid: string\n name: string\n clusterCount: number\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n /**\n * Replaces a generation's upgrade path via the external API (`PUT\n * external/generations/:generationUuid/upgradepath`). Gated on the\n * M2M-only `m2m.manageGenerationUpgradePath` scope by design, so this is\n * for service-credential callers (e.g. the release-train hack scripts).\n * Interactive/browser callers cannot use it \u2014 they edit the upgrade path\n * through {@link update} against `api/generations/:generationUuid`, the same\n * way accounts-frontend does.\n */\n public static async updateUpgradePath(\n params: {\n generationUuid: string\n upgradeableFrom: string[]\n } & RequestBaseParams,\n ): Promise<\n | {\n name: string\n uuid: string\n upgradeableFrom: Array<{ uuid: string }>\n }\n | undefined\n > {\n const body = {\n upgradeableFrom: params.upgradeableFrom,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.updateUpgradePath`,\n url: `external/generations/${params.generationUuid}/upgradepath`,\n normalizedUrl: `external/generations/:generationUuid/upgradepath`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n name: string\n uuid: string\n upgradeableFrom: Array<{ uuid: string }>\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async publishReleaseTrain(\n params: {\n previousGenerationId: string\n name: string\n releaseType: 'patch' | 'alpha' | 'minor'\n versions?: Partial<ZeebeClusterVersionsDto>\n isUnsupportedStarting?: string\n /** Runs the publish although it adds new errors of the sanity rules. */\n overrideSanityErrors?: boolean\n } & RequestBaseParams,\n ) {\n const {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\n overrideSanityErrors,\n } = params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.publishReleaseTrain',\n url: 'external/release-train/generation',\n normalizedUrl: 'external/release-train/generation',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n generationId: string\n changes: {\n newGeneration: { uuid: string; name: string }\n previousGenerationCleared?: { uuid: string; name: string }\n nextMinorGenerationUpdated?: { uuid: string; name: string }\n channelsUpdated: Array<{\n channelName: string\n generationAdded: { uuid: string; name: string }\n generationRemoved?: { uuid: string; name: string }\n /** Absent when the release did not manage that channel default. */\n newDefault?: { uuid: string; name: string }\n }>\n }\n }>({\n config: params.config,\n base: { id: 'console' },\n body: {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\n overrideSanityErrors,\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async rollbackReleaseTrain(\n params: {\n generationId: string\n releaseType: 'patch' | 'alpha' | 'minor'\n replacementGenerationId?: string\n stableReplacementGenerationId?: string\n alphaReplacementGenerationId?: string\n /** Runs the rollback although it adds new errors of the sanity rules. */\n overrideSanityErrors?: boolean\n } & RequestBaseParams,\n ) {\n const {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\n overrideSanityErrors,\n } = params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.rollbackReleaseTrain',\n url: 'external/release-train/rollback',\n normalizedUrl: 'external/release-train/rollback',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n rolledBackGenerationId: string\n changes: {\n channelsUpdated: Array<{\n channelName: string\n generationAdded: { uuid: string; name: string }\n generationRemoved?: { uuid: string; name: string }\n newDefault: { uuid: string; name: string }\n }>\n previousGenerationRestored?: { uuid: string; name: string }\n nextMinorGenerationRestored?: { uuid: string; name: string }\n }\n }>({\n config: params.config,\n base: { id: 'console' },\n body: {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\n overrideSanityErrors,\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async triggerAutoUpgrade(\n params: { generationId: string } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.triggerAutoUpgrade',\n url: `external/release-train/generation/${params.generationId}/auto-upgrade`,\n normalizedUrl:\n 'external/release-train/generation/:generationId/auto-upgrade',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n bulkOperationUuid: string\n clusterCount: number\n }>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 /** The clusters that an auto-upgrade to this generation changes now. */\n public static async getAutoUpgradeCandidates(\n params: { params: { generationId: string } } & RequestBaseParams,\n ): Promise<ReleaseTrainAutoUpgradeCandidates> {\n const { generationId } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.getAutoUpgradeCandidates',\n url: `external/release-train/generation/${encodeURIComponent(generationId)}/auto-upgrade-candidates`,\n normalizedUrl:\n 'external/release-train/generation/:generationId/auto-upgrade-candidates',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ReleaseTrainAutoUpgradeCandidates>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n return response.body\n }\n\n /**\n * Dry run of `publishReleaseTrain`. The backend writes nothing and answers\n * with what a real call would change and how the sanity rules would react.\n */\n public static async dryRunPublishReleaseTrain(\n params: Parameters<typeof GenerationService.publishReleaseTrain>[0],\n ) {\n return GenerationService.postReleaseTrainDryRun<DryRunPublishReleaseTrainResponse>(\n 'GenerationService.dryRunPublishReleaseTrain',\n params.config,\n 'external/release-train/generation',\n 'external/release-train/generation',\n {\n previousGenerationId: params.previousGenerationId,\n name: params.name,\n releaseType: params.releaseType,\n versions: params.versions,\n isUnsupportedStarting: params.isUnsupportedStarting,\n dryRun: true,\n },\n )\n }\n\n /** Dry run of `rollbackReleaseTrain`. Writes nothing. */\n public static async dryRunRollbackReleaseTrain(\n params: Parameters<typeof GenerationService.rollbackReleaseTrain>[0],\n ) {\n return GenerationService.postReleaseTrainDryRun<DryRunRollbackReleaseTrainResponse>(\n 'GenerationService.dryRunRollbackReleaseTrain',\n params.config,\n 'external/release-train/rollback',\n 'external/release-train/rollback',\n {\n generationId: params.generationId,\n releaseType: params.releaseType,\n replacementGenerationId: params.replacementGenerationId,\n stableReplacementGenerationId: params.stableReplacementGenerationId,\n alphaReplacementGenerationId: params.alphaReplacementGenerationId,\n dryRun: true,\n },\n )\n }\n\n private static async postReleaseTrainDryRun<T>(\n methodName: string,\n config: RequestBaseParams['config'],\n url: string,\n normalizedUrl: string,\n body: Record<string, unknown> | undefined,\n ): Promise<T | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: methodName,\n url,\n normalizedUrl,\n type: 'post',\n },\n source: config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<T>({\n config,\n base: { id: 'console' },\n body,\n responseType: 'json',\n url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 public static async getReleaseTrainSanity(\n params: RequestBaseParams,\n ): Promise<ReleaseTrainSanityReport> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.getReleaseTrainSanity',\n url: 'external/release-train/sanity-check',\n normalizedUrl: 'external/release-train/sanity-check',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ReleaseTrainSanityReport>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n return response.body\n }\n\n public static async create(\n params: CreateGenerationParams,\n ): Promise<GenerationDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.create',\n url: 'api/generations',\n normalizedUrl: 'api/generations',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\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 if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n return response.body\n }\n\n public static async update(params: UpdateGenerationParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.update',\n url: `api/generations/${params.params.generationUuid}`,\n normalizedUrl: 'api/generations/:generationUuid',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async delete(params: DeleteGenerationParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.delete',\n url: `api/generations/${params.params.generationUuid}`,\n normalizedUrl: 'api/generations/:generationUuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async setBespoke(\n params: SetGenerationBespokeParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.setBespoke',\n url: `api/generations/${params.params.generationUuid}/bespoke`,\n normalizedUrl: 'api/generations/:generationUuid/bespoke',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async setArchived(\n params: SetGenerationArchivedParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.setArchived',\n url: `api/generations/${params.params.generationUuid}/archived`,\n normalizedUrl: 'api/generations/:generationUuid/archived',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
5
+ "mappings": "AAmBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAsInB,MAAM,kBAAkB;AAAA,EAC7B,aAAoB,KAClB,QAC0B;AAC1B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA,QACL,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAyB;AAAA,MAC9C,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,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,QAAQ,CAAC;AAAA,EAC3B;AAAA,EAEA,aAAoB,cAClB,QACoC;AACpC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,mBAAmB,OAAO,IAAI;AAAA,QACnC,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAA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AU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAoB,YAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,mBAAmB,OAAO,OAAO,cAAc;AAAA,QACpD,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,MAAM,OAAO;AAAA,MACb,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,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,\n )\n }\n}\n"],
5
+ "mappings": "AAYA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAoB1B,SAAS,aAAa,MAA6C;AACjE,MAAI;AACF,UAAM,SAAkB,KAAK,MAAM,IAAI;AACvC,QACE,OAAO,WAAW,YAClB,WAAW,QACX,OAAQ,OAAgC,WAAW,UACnD;AACA,aAAO;AAAA,IACT;AAAA,EACF,SAAS,QAAQ;AAAA,EAEjB;AACA,SAAO;AACT;AAEO,MAAM,kCAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO7C,aAAoB,OAClB,QACiC;AACjC,UAAM,OAAO;AACb,UAAM,MAAM;AACZ,UAAM,WAAW,MAAM,QAA+C;AAAA,MACpE,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB;AAAA,MACA,QAAQ;AAAA,MACR,gBAAgB;AAAA,QACd,QAAQ,EAAE,MAAM,KAAK,eAAe,KAAK,MAAM,OAAO;AAAA,QACtD,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,QACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAoB;AAAA,MACvD;AAAA,MACA,MAAM,OAAO;AAAA;AAAA,MAEb,YAAY;AAAA,MACZ,OAAO,EAAE,UAAU,GAAG,WAAW,EAAE;AAAA,IACrC,CAAC;AACD,QAAI,SAAS,IAAI;AACf,aAAO,EAAE,IAAI,MAAM,OAAO,SAAS,KAA0B;AAAA,IAC/D;AACA,QAAI,SAAS,WAAW,KAAK;AAC3B,YAAM,UAAU,aAAa,SAAS,cAAc,EAAE;AACtD,UAAI,SAAS;AACX,eAAO,EAAE,IAAI,OAAO,QAAQ;AAAA,MAC9B;AAAA,IACF;AACA,UAAM,IAAI;AAAA,MACR,GAAG,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,MAClD,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -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: { name: string; expiresInDays: AgentTokenExpiryDays }\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): 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 })\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 /** 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 )\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AA,IACF;AAAA,EACF;AAAA;AAAA,EAGA,aAAoB,OAClB,QAC4B;AAC5B,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,oBAAoB,mBAAmB,OAAO,OAAO,IAAI,CAAC;AAAA,MAC1D;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAGA,aAAoB,OAAO,QAA8C;AACvE,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,oBAAoB,mBAAmB,OAAO,OAAO,IAAI,CAAC;AAAA,MAC1D;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEO,MAAM,mCAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS9C,aAAoB,OAClB,QAC8B;AAC9B,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,EAAE,UAAU,GAAG,WAAW,EAAE;AAAA,IAC9B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,aAAoB,OAClB,QAC8B;AAC9B,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,0BAA0B,mBAAmB,OAAO,OAAO,IAAI,CAAC;AAAA,MAChE;AAAA,MACA;AAAA,MACA;AAAA,MACA,EAAE,UAAU,GAAG,WAAW,EAAE;AAAA,IAC9B;AAAA,EACF;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 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,KAC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