@camunda/ccma-api 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -2
- package/dist/index.js +10 -0
- package/dist/index.js.map +2 -2
- package/dist/services/accounts/hdp.service.d.ts +7 -1
- package/dist/services/accounts/hdp.service.js +38 -0
- package/dist/services/accounts/hdp.service.js.map +2 -2
- package/dist/services/accounts/orgs.service.d.ts +28 -0
- package/dist/services/accounts/orgs.service.js +41 -1
- package/dist/services/accounts/orgs.service.js.map +2 -2
- package/dist/services/accounts/orgs.service.spec.d.ts +1 -0
- package/dist/services/accounts/queued-operations.service.d.ts +59 -0
- package/dist/services/accounts/queued-operations.service.js +49 -0
- package/dist/services/accounts/queued-operations.service.js.map +7 -0
- package/dist/services/accounts/trial-management.service.d.ts +27 -0
- package/dist/services/accounts/trial-management.service.js +101 -0
- package/dist/services/accounts/trial-management.service.js.map +7 -0
- package/dist/services/audit-logger/audit-logger.service.js +10 -1
- package/dist/services/audit-logger/audit-logger.service.js.map +2 -2
- package/dist/services/audit-logger/audit-logger.service.spec.d.ts +1 -0
- package/dist/services/auth0/auth0.service.d.ts +7 -0
- package/dist/services/auth0/auth0.service.js +2 -1
- package/dist/services/auth0/auth0.service.js.map +2 -2
- package/dist/services/auth0/auth0.service.spec.d.ts +1 -0
- package/dist/services/console/console.admin.service.js +13 -2
- package/dist/services/console/console.admin.service.js.map +2 -2
- package/dist/services/console/console.admin.service.spec.d.ts +1 -0
- package/dist/services/console/console.cluster.service.d.ts +9 -0
- package/dist/services/console/console.cluster.service.js +7 -0
- package/dist/services/console/console.cluster.service.js.map +2 -2
- package/dist/services/console/generation.service.d.ts +21 -1
- package/dist/services/console/generation.service.js +9 -0
- package/dist/services/console/generation.service.js.map +2 -2
- package/dist/services/github/github.service.d.ts +1 -0
- package/dist/services/github/github.service.js +32 -22
- package/dist/services/github/github.service.js.map +2 -2
- package/dist/services/github/github.service.spec.d.ts +1 -0
- package/dist/services/thanos/thanos.service.d.ts +49 -0
- package/dist/services/thanos/thanos.service.js +60 -0
- package/dist/services/thanos/thanos.service.js.map +7 -0
- package/dist/services/thanos/thanos.service.spec.d.ts +1 -0
- package/dist/services/token-issuer/token-issuer.jwks.service.js +5 -1
- package/dist/services/token-issuer/token-issuer.jwks.service.js.map +2 -2
- package/dist/services/token-issuer/token-issuer.jwks.service.spec.d.ts +1 -0
- package/dist/utils/api.js +8 -0
- package/dist/utils/api.js.map +2 -2
- package/dist/utils/cache.d.ts +24 -0
- package/dist/utils/cache.js +41 -0
- package/dist/utils/cache.js.map +2 -2
- package/dist/utils/cache.spec.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/console/console.cluster.service.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n ClusterLabels,\n ConsoleClusterDto,\n ExternalIdpConfig,\n OptimizeFilteringConfig,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface GetConsoleClustersRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface CreateConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n body: {\n name: string\n planTypeId: string\n channelId: string\n generationId: string\n k8sContextId: string\n autoUpdate?: boolean\n stageLabel?: string\n backupRegionId?: string\n encryption?: string\n numberOfAllocatedHwPackages?: number\n tasklistV2Enabled?: boolean\n identityBackendChecksEnabled?: boolean\n description?: string\n }\n}\n\nexport interface CreateConsoleClusterResponse {\n clusterId: string\n}\n\nexport interface WakeConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface SuspendConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface ProxyOrchestrationClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n region: string\n app: 'tasklist' | 'optimize' | 'operate' | 'zeebe' | 'identity'\n route?: string\n headers: {\n [key: string]: string\n }\n }\n body?: unknown\n method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'\n}\n\nexport interface UpdateClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n name?: string\n description?: string\n labels?: ClusterLabels\n primaryEncryptionKeyId?: string\n secondaryEncryptionKeyId?: string\n numberOfAllocatedHwPackages?: number\n mcpEnabled?: boolean\n playMode?: boolean\n swagger?: boolean\n tasklistV2Enabled?: boolean\n optimizeEnabled?: boolean\n autoUpdate?: boolean\n enforceGroups?: boolean\n rba?: boolean\n identityBackendChecksEnabled?: boolean\n multiTenancyEnabled?: boolean\n // BYOIDP Phase 1 (#3190). Secret is sent via updateExternalIdpSecret, not here.\n externalIdpEnabled?: boolean\n externalIdpConfig?: ExternalIdpConfig\n businessIdUniquenessEnabled?: boolean\n appIntegrationsEnabled?: boolean\n auditLogEnabled?: boolean | null\n auditLogUserCategories?: string[] | null\n auditLogClientCategories?: string[] | null\n /** null deactivates filtering; otherwise the full config replaces what's stored. */\n optimizeFiltering?: OptimizeFilteringConfig | null\n }\n}\n\n// BYOIDP Phase 1 (#3190): write the OIDC client secret. Separate from updateCluster \u2014\n// the value never travels through the cluster PATCH/DB/CR path.\nexport interface UpdateExternalIdpSecretRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n name: string\n clientSecret: string\n }\n}\n\nexport interface GetConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface MoveClusterOwnerRequest extends RequestBaseParams {\n params: {\n clusterId: string\n }\n body: {\n ownerId: string\n }\n}\n\nexport interface FailoverConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n /** Backups to clone into the failover cluster (one or more). */\n backupIds: string[]\n /** The single backup to restore from immediately; must be one of `backupIds`. */\n restoreBackupId: string\n }\n}\n\nexport interface FailoverConsoleClusterResult {\n newClusterId: string\n results: {\n backupClone: 'ok' | { error: string }\n restore: 'ok' | { error: string }\n }\n}\n\nexport interface DeleteConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport class ConsoleClusterService {\n public static async getClusters(\n params: GetConsoleClustersRequest,\n ): Promise<ConsoleClusterDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getClusters',\n url: `api/orgs/${params.params.orgId}/clusters`,\n normalizedUrl: 'api/orgs/:orgId/clusters',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ConsoleClusterDto[]>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body ?? []\n }\n\n public static async createCluster(\n params: CreateConsoleClusterRequest,\n ): Promise<CreateConsoleClusterResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.createCluster',\n url: `api/orgs/${params.params.orgId}/clusters`,\n normalizedUrl: 'api/orgs/:orgId/clusters',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<CreateConsoleClusterResponse>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n public static async getCluster(\n params: GetConsoleClusterRequest,\n ): Promise<ConsoleClusterDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ConsoleClusterDto>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n public static async suspendCluster(\n params: SuspendConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.suspendCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/suspend`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/suspend',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async wakeCluster(\n params: WakeConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.wakeCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/wake`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/wake',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * Proxy request to orchestration cluster application\n * @param params - Request parameters including clusterId, region, app, and optional route\n * @returns Response from the orchestration cluster\n */\n public static async proxyOrchestrationCluster<TResponse = unknown>(\n params: ProxyOrchestrationClusterRequest,\n ): Promise<TResponse> {\n const method = params.method || 'GET'\n const route = params.params.route || ''\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `ConsoleClusterService.proxyOrchestrationCluster`,\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/oc`,\n normalizedUrl: `api/orgs/:orgId/clusters/:clusterId/oc`,\n type: method.toLowerCase() as\n | 'get'\n | 'post'\n | 'put'\n | 'patch'\n | 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n // Construct request body with _cluster metadata and body payload\n const requestBody = {\n _cluster: {\n region: params.params.region,\n app: params.params.app,\n route,\n },\n body: params.body,\n }\n\n const response = await request<TResponse>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: requestBody,\n headers: params.params.headers,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (response.body === undefined) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n /**\n * Update cluster properties\n * @param params - Request parameters including orgId, clusterId, and properties to update\n * @returns void\n */\n public static async updateCluster(\n params: UpdateClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.updateCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: params.body,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n // BYOIDP Phase 1 (#3190). Call BEFORE updateCluster enables the provider so the CR\n // never references a not-yet-written Secret (fail-closed ordering, design \u00A73).\n public static async updateExternalIdpSecret(\n params: UpdateExternalIdpSecretRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.updateExternalIdpSecret',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/external-idp/secret`,\n normalizedUrl:\n 'api/orgs/:orgId/clusters/:clusterId/external-idp/secret',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: params.body,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async moveClusterOwner(\n params: MoveClusterOwnerRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.moveClusterOwner',\n url: `api/admin/clusters/${params.params.clusterId}/owner`,\n normalizedUrl: 'api/admin/clusters/:clusterId/owner',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async failoverCluster(\n params: FailoverConsoleClusterRequest,\n ): Promise<FailoverConsoleClusterResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.failoverCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/failover`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/failover',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<FailoverConsoleClusterResult>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async deleteCluster(\n params: DeleteConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.deleteCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "AAgBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n ClusterLabels,\n ConsoleClusterDto,\n ExternalIdpConfig,\n OptimizeFilteringConfig,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface GetConsoleClustersRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface CreateConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n body: {\n name: string\n planTypeId: string\n channelId: string\n generationId: string\n k8sContextId: string\n autoUpdate?: boolean\n stageLabel?: string\n backupRegionId?: string\n encryption?: string\n numberOfAllocatedHwPackages?: number\n tasklistV2Enabled?: boolean\n identityBackendChecksEnabled?: boolean\n description?: string\n }\n}\n\nexport interface CreateConsoleClusterResponse {\n clusterId: string\n}\n\nexport interface WakeConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface SuspendConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface ProxyOrchestrationClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n region: string\n app: 'tasklist' | 'optimize' | 'operate' | 'zeebe' | 'identity'\n route?: string\n headers: {\n [key: string]: string\n }\n }\n body?: unknown\n method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'\n}\n\nexport interface UpdateClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n name?: string\n description?: string\n labels?: ClusterLabels\n primaryEncryptionKeyId?: string\n secondaryEncryptionKeyId?: string\n numberOfAllocatedHwPackages?: number\n mcpEnabled?: boolean\n playMode?: boolean\n swagger?: boolean\n tasklistV2Enabled?: boolean\n optimizeEnabled?: boolean\n autoUpdate?: boolean\n enforceGroups?: boolean\n rba?: boolean\n identityBackendChecksEnabled?: boolean\n multiTenancyEnabled?: boolean\n sessionMaxInactiveIntervalMinutes?: number\n sessionHeartbeatEnabled?: boolean\n // BYOIDP Phase 1 (#3190). Secret is sent via updateExternalIdpSecret, not here.\n externalIdpEnabled?: boolean\n externalIdpConfig?: ExternalIdpConfig\n businessIdUniquenessEnabled?: boolean\n appIntegrationsEnabled?: boolean\n auditLogEnabled?: boolean | null\n auditLogUserCategories?: string[] | null\n auditLogClientCategories?: string[] | null\n /** null deactivates filtering; otherwise the full config replaces what's stored. */\n optimizeFiltering?: OptimizeFilteringConfig | null\n }\n}\n\n// BYOIDP Phase 1 (#3190): write the OIDC client secret. Separate from updateCluster \u2014\n// the value never travels through the cluster PATCH/DB/CR path.\nexport interface UpdateExternalIdpSecretRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n name: string\n clientSecret: string\n }\n}\n\nexport interface GetConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport interface MoveClusterOwnerRequest extends RequestBaseParams {\n params: {\n clusterId: string\n }\n body: {\n ownerId: string\n }\n}\n\nexport interface FailoverConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n body: {\n /** Backups to clone into the failover cluster (one or more). */\n backupIds: string[]\n /** The single backup to restore from immediately; must be one of `backupIds`. */\n restoreBackupId: string\n }\n}\n\nexport interface FailoverConsoleClusterResult {\n newClusterId: string\n results: {\n backupClone: 'ok' | { error: string }\n restore: 'ok' | { error: string }\n }\n}\n\nexport interface DeleteConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: string\n }\n}\n\nexport class ConsoleClusterService {\n public static async getClusters(\n params: GetConsoleClustersRequest,\n ): Promise<ConsoleClusterDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getClusters',\n url: `api/orgs/${params.params.orgId}/clusters`,\n normalizedUrl: 'api/orgs/:orgId/clusters',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ConsoleClusterDto[]>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body ?? []\n }\n\n public static async createCluster(\n params: CreateConsoleClusterRequest,\n ): Promise<CreateConsoleClusterResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.createCluster',\n url: `api/orgs/${params.params.orgId}/clusters`,\n normalizedUrl: 'api/orgs/:orgId/clusters',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<CreateConsoleClusterResponse>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n public static async getCluster(\n params: GetConsoleClusterRequest,\n ): Promise<ConsoleClusterDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.getCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<ConsoleClusterDto>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n public static async suspendCluster(\n params: SuspendConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.suspendCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/suspend`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/suspend',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async wakeCluster(\n params: WakeConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.wakeCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/wake`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/wake',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * Proxy request to orchestration cluster application\n * @param params - Request parameters including clusterId, region, app, and optional route\n * @returns Response from the orchestration cluster\n */\n public static async proxyOrchestrationCluster<TResponse = unknown>(\n params: ProxyOrchestrationClusterRequest,\n ): Promise<TResponse> {\n const method = params.method || 'GET'\n const route = params.params.route || ''\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `ConsoleClusterService.proxyOrchestrationCluster`,\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/oc`,\n normalizedUrl: `api/orgs/:orgId/clusters/:clusterId/oc`,\n type: method.toLowerCase() as\n | 'get'\n | 'post'\n | 'put'\n | 'patch'\n | 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n // Construct request body with _cluster metadata and body payload\n const requestBody = {\n _cluster: {\n region: params.params.region,\n app: params.params.app,\n route,\n },\n body: params.body,\n }\n\n const response = await request<TResponse>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: requestBody,\n headers: params.params.headers,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n if (response.body === undefined) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n\n return response.body\n }\n\n /**\n * Update cluster properties\n * @param params - Request parameters including orgId, clusterId, and properties to update\n * @returns void\n */\n public static async updateCluster(\n params: UpdateClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.updateCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: params.body,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n // BYOIDP Phase 1 (#3190). Call BEFORE updateCluster enables the provider so the CR\n // never references a not-yet-written Secret (fail-closed ordering, design \u00A73).\n public static async updateExternalIdpSecret(\n params: UpdateExternalIdpSecretRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.updateExternalIdpSecret',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/external-idp/secret`,\n normalizedUrl:\n 'api/orgs/:orgId/clusters/:clusterId/external-idp/secret',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'console',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: params.body,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * Not currently used by control-frontend. This service was introduced for\n * accounts-frontend's \"Move to other org\" action; the control-frontend parity\n * review (2026-08-25) decided not to port that UI. Kept deliberately \u2014 the\n * console endpoint remains routed and may be reused by a future\n * cluster-transfer flow.\n */\n public static async moveClusterOwner(\n params: MoveClusterOwnerRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.moveClusterOwner',\n url: `api/admin/clusters/${params.params.clusterId}/owner`,\n normalizedUrl: 'api/admin/clusters/:clusterId/owner',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async failoverCluster(\n params: FailoverConsoleClusterRequest,\n ): Promise<FailoverConsoleClusterResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.failoverCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/failover`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId/failover',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<FailoverConsoleClusterResult>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'json',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async deleteCluster(\n params: DeleteConsoleClusterRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ConsoleClusterService.deleteCluster',\n url: `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}`,\n normalizedUrl: 'api/orgs/:orgId/clusters/:clusterId',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'console' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\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AA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,7 +21,18 @@ export interface UpdateGenerationParams extends RequestBaseParams {
|
|
|
21
21
|
};
|
|
22
22
|
body: {
|
|
23
23
|
name?: string;
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Omit this when the request is meant to edit `upgradeableFrom` (or
|
|
26
|
+
* `name`) alone, the way accounts-frontend's `updateUpgradableFrom` does —
|
|
27
|
+
* the backend then leaves the generation's versions alone.
|
|
28
|
+
*
|
|
29
|
+
* When it IS present, the object is authoritative for every mutable
|
|
30
|
+
* version: `GenerationController.updateVersionOrName` clears each mutable
|
|
31
|
+
* field absent from it (`elasticSearchCurator`, `zeebeAnalytics` and all
|
|
32
|
+
* the `*EnvVars`). So send the generation's current values alongside the
|
|
33
|
+
* ones you're changing — a partial `versions` still wipes the rest.
|
|
34
|
+
*/
|
|
35
|
+
versions?: Partial<GenerationVersionsInput>;
|
|
25
36
|
upgradeableFrom?: string[];
|
|
26
37
|
};
|
|
27
38
|
}
|
|
@@ -101,6 +112,15 @@ export declare class GenerationService {
|
|
|
101
112
|
name: string;
|
|
102
113
|
clusterCount: number;
|
|
103
114
|
} | undefined>;
|
|
115
|
+
/**
|
|
116
|
+
* Replaces a generation's upgrade path via the external API (`PUT
|
|
117
|
+
* external/generations/:generationUuid/upgradepath`). Gated on the
|
|
118
|
+
* M2M-only `m2m.manageGenerationUpgradePath` scope by design, so this is
|
|
119
|
+
* for service-credential callers (e.g. the release-train hack scripts).
|
|
120
|
+
* Interactive/browser callers cannot use it — they edit the upgrade path
|
|
121
|
+
* through {@link update} against `api/generations/:generationUuid`, the same
|
|
122
|
+
* way accounts-frontend does.
|
|
123
|
+
*/
|
|
104
124
|
static updateUpgradePath(params: {
|
|
105
125
|
generationUuid: string;
|
|
106
126
|
upgradeableFrom: string[];
|
|
@@ -296,6 +296,15 @@ class GenerationService {
|
|
|
296
296
|
}
|
|
297
297
|
return response.body;
|
|
298
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* Replaces a generation's upgrade path via the external API (`PUT
|
|
301
|
+
* external/generations/:generationUuid/upgradepath`). Gated on the
|
|
302
|
+
* M2M-only `m2m.manageGenerationUpgradePath` scope by design, so this is
|
|
303
|
+
* for service-credential callers (e.g. the release-train hack scripts).
|
|
304
|
+
* Interactive/browser callers cannot use it — they edit the upgrade path
|
|
305
|
+
* through {@link update} against `api/generations/:generationUuid`, the same
|
|
306
|
+
* way accounts-frontend does.
|
|
307
|
+
*/
|
|
299
308
|
static async updateUpgradePath(params) {
|
|
300
309
|
const body = {
|
|
301
310
|
upgradeableFrom: params.upgradeableFrom
|
|
@@ -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 GenerationDto,\n ReleaseTrainSanityReport,\n UpgradableGenerationsDto,\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\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 */\nexport type GenerationVersionsInput = Partial<ZeebeClusterVersionsDto> &\n Pick<ZeebeClusterVersionsDto, 'zeebe' | 'elasticSearchOss' | 'optimize'>\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 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 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 } & 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: { yolo: params.yolo ?? false, byCamunda: true },\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 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 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 } & RequestBaseParams,\n ) {\n const {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\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 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 },\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 } & RequestBaseParams,\n ) {\n const {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\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 },\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 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"],
|
|
5
|
-
"mappings": "AAgBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAgDnB,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;AAA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,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,QAAQ,OAAO;AAAA,MACf,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;AAAA,EACF;AAAA,EAEA,aAAoB,WAClB,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 GenerationDto,\n ReleaseTrainSanityReport,\n UpgradableGenerationsDto,\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\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 */\nexport type GenerationVersionsInput = Partial<ZeebeClusterVersionsDto> &\n Pick<ZeebeClusterVersionsDto, 'zeebe' | 'elasticSearchOss' | 'optimize'>\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 * Omit this when the request is meant to edit `upgradeableFrom` (or\n * `name`) alone, the way accounts-frontend's `updateUpgradableFrom` does \u2014\n * the backend then leaves the generation's versions alone.\n *\n * When it IS present, the object is authoritative for every mutable\n * version: `GenerationController.updateVersionOrName` clears each mutable\n * field absent from it (`elasticSearchCurator`, `zeebeAnalytics` and all\n * the `*EnvVars`). So send the generation's current values alongside the\n * ones you're changing \u2014 a partial `versions` still wipes the rest.\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 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 } & 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: { yolo: params.yolo ?? false, byCamunda: true },\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 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 } & RequestBaseParams,\n ) {\n const {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\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 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 },\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 } & RequestBaseParams,\n ) {\n const {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\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 },\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 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"],
|
|
5
|
+
"mappings": "AAgBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA2DnB,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,QAA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AAO;AAAA,MACf,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;AAAA,EACF;AAAA,EAEA,aAAoB,WAClB,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
|
}
|
|
@@ -67,6 +67,7 @@ export interface GithubContentItem {
|
|
|
67
67
|
export declare class GithubService {
|
|
68
68
|
static getNextBugfixReleaseVersion(params: GithubGetNextBugfixReleaseVersionRequest): Promise<string>;
|
|
69
69
|
static listMajorMinorReleases(params: GithubListMajorMinorReleasesRequest): Promise<GithubRelease[]>;
|
|
70
|
+
private static fetchMajorMinorReleases;
|
|
70
71
|
static getReleases(params: GithubListReleasesRequest): Promise<GithubRelease[]>;
|
|
71
72
|
static listDirectoryContent(params: GithubListDirectoryContentRequest): Promise<GithubContentItem[]>;
|
|
72
73
|
static getRawFile(params: GithubGetRawFileRequest): Promise<string>;
|
|
@@ -3,6 +3,7 @@ import { request } from "../../utils/api.js";
|
|
|
3
3
|
import { Cache } from "../../utils/cache.js";
|
|
4
4
|
import { HttpError } from "../../utils/errors.js";
|
|
5
5
|
const releaseCache = new Cache(HOUR);
|
|
6
|
+
const PAGE_BATCH_SIZE = 5;
|
|
6
7
|
class GithubService {
|
|
7
8
|
static async getNextBugfixReleaseVersion(params) {
|
|
8
9
|
const releases = await GithubService.listMajorMinorReleases({
|
|
@@ -41,29 +42,39 @@ class GithubService {
|
|
|
41
42
|
throw new Error(`No bugfix release found for ${params.options.majorMinor}`);
|
|
42
43
|
}
|
|
43
44
|
static async listMajorMinorReleases(params) {
|
|
44
|
-
const cacheKey = `major-minor-${params.options.owner}-${params.options.repo}-${params.options.onlyLatest ?? false}-${params.options.includeAlphas ?? false}-${params.options.onlyPrerelease ?? false}`;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
const cacheKey = `major-minor-${params.options.owner}-${params.options.repo}-${params.options.onlyLatest ?? false}-${params.options.includeAlphas ?? false}-${params.options.onlyPrerelease ?? false}-${params.options.replaceBugfixSuffix ?? false}`;
|
|
46
|
+
return releaseCache.getOrLoad(
|
|
47
|
+
cacheKey,
|
|
48
|
+
() => GithubService.fetchMajorMinorReleases(params),
|
|
49
|
+
{ ignoreCache: params.cacheControl?.ignoreCache === true }
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
static async fetchMajorMinorReleases(params) {
|
|
51
53
|
const pageSize = 100;
|
|
52
54
|
const ITERATIONS = params.options.iterations || 15;
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
const allPageResults = [];
|
|
56
|
+
for (let firstPage = 1; firstPage <= ITERATIONS; firstPage += PAGE_BATCH_SIZE) {
|
|
57
|
+
const batchSize = Math.min(PAGE_BATCH_SIZE, ITERATIONS - firstPage + 1);
|
|
58
|
+
const batch = await Promise.all(
|
|
59
|
+
Array.from(
|
|
60
|
+
{ length: batchSize },
|
|
61
|
+
(_, index) => GithubService.getReleases({
|
|
62
|
+
config: params.config,
|
|
63
|
+
options: {
|
|
64
|
+
owner: params.options.owner,
|
|
65
|
+
repo: params.options.repo,
|
|
66
|
+
apiToken: params.options.apiToken,
|
|
67
|
+
pageSize,
|
|
68
|
+
currentPage: firstPage + index
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
allPageResults.push(...batch);
|
|
74
|
+
if (batch.some((releases) => releases.length < pageSize)) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
67
78
|
const stableReleases = [];
|
|
68
79
|
for (const releases of allPageResults) {
|
|
69
80
|
if (params.options.replaceBugfixSuffix === true) {
|
|
@@ -111,7 +122,6 @@ class GithubService {
|
|
|
111
122
|
} else {
|
|
112
123
|
releasesToRespond = stableReleases;
|
|
113
124
|
}
|
|
114
|
-
releaseCache.set(cacheKey, releasesToRespond);
|
|
115
125
|
return releasesToRespond;
|
|
116
126
|
}
|
|
117
127
|
static async getReleases(params) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/github/github.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 { HOUR } from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { Cache } from '../../utils/cache.js'\nimport { HttpError } from '../../utils/errors.js'\n\nconst releaseCache = new Cache<string, GithubRelease[]>(HOUR)\n\nexport interface GithubListMajorMinorReleasesRequest extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n iterations?: number\n onlyLatest?: boolean\n includeAlphas?: boolean\n onlyPrerelease?: boolean\n replaceBugfixSuffix?: boolean\n }\n}\n\nexport interface GithubListReleasesRequest extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n pageSize?: number\n currentPage?: number\n }\n}\n\nexport interface GithubGetNextBugfixReleaseVersionRequest\n extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n iterations?: number\n onlyLatest?: boolean\n majorMinor: string\n }\n}\n\nexport interface GithubRelease {\n url: string\n tag_name: string\n body: string\n created_at: string\n prerelease: boolean\n}\n\nexport interface GithubListDirectoryContentRequest extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n path: string\n ref?: string\n }\n}\n\nexport interface GithubGetRawFileRequest extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n path: string\n ref?: string\n }\n}\n\nexport interface GithubContentItem {\n name: string\n path: string\n sha: string\n size: number\n url: string\n download_url: string | undefined\n type: string\n}\n\nexport class GithubService {\n public static async getNextBugfixReleaseVersion(\n params: GithubGetNextBugfixReleaseVersionRequest,\n ): Promise<string> {\n const releases = await GithubService.listMajorMinorReleases({\n config: params.config,\n options: {\n owner: params.options.owner,\n repo: params.options.repo,\n apiToken: params.options.apiToken,\n onlyLatest: true,\n iterations: params.options.iterations,\n },\n })\n if (releases.length === 0) {\n throw new Error(\n `No releases found for ${params.options.owner}/${params.options.repo}`,\n )\n }\n const latestRelease = releases[0]\n if (latestRelease.tag_name.startsWith(params.options.majorMinor)) {\n throw new Error(\n `Not allowed to create a new bugfix release for ${latestRelease.tag_name}`,\n )\n }\n for (const release of releases) {\n if (release.tag_name.startsWith(params.options.majorMinor)) {\n const versionSplitted = release.tag_name.split('.')\n if (versionSplitted.length !== 3) {\n throw new Error(`Invalid version format: ${release.tag_name}`)\n }\n const majorVersion = Number(versionSplitted[0])\n const minorVersion = Number(versionSplitted[1])\n const patchVersion = Number(versionSplitted[2]) + 1\n return `${majorVersion}.${minorVersion}.${patchVersion}`\n }\n }\n throw new Error(`No bugfix release found for ${params.options.majorMinor}`)\n }\n\n public static async listMajorMinorReleases(\n params: GithubListMajorMinorReleasesRequest,\n ): Promise<GithubRelease[]> {\n const cacheKey = `major-minor-${params.options.owner}-${\n params.options.repo\n }-${params.options.onlyLatest ?? false}-${\n params.options.includeAlphas ?? false\n }-${params.options.onlyPrerelease ?? false}`\n if (!params.cacheControl?.ignoreCache) {\n const cached = releaseCache.get(cacheKey)\n if (cached) {\n return cached\n }\n }\n const pageSize = 100\n const ITERATIONS = params.options.iterations || 15\n\n // Fetch all pages in parallel for improved performance\n const pagePromises = Array.from({ length: ITERATIONS }, (_, index) => {\n const currentPage = index + 1\n return GithubService.getReleases({\n config: params.config,\n options: {\n owner: params.options.owner,\n repo: params.options.repo,\n apiToken: params.options.apiToken,\n pageSize,\n currentPage,\n },\n })\n })\n\n const allPageResults = await Promise.all(pagePromises)\n\n const stableReleases: GithubRelease[] = []\n for (const releases of allPageResults) {\n // replace bugfix suffix\n if (params.options.replaceBugfixSuffix === true) {\n releases.forEach((release) => {\n if (release.tag_name.endsWith('_bugfix')) {\n release.tag_name = release.tag_name.replace(/_bugfix.*/u, '')\n }\n })\n }\n\n const filtered = releases.filter((release) => {\n let includeRelease = !release.prerelease\n if (params.options.onlyPrerelease) {\n includeRelease = release.prerelease\n }\n if (includeRelease && params.options.includeAlphas) {\n includeRelease =\n release.tag_name.includes('-alpha') &&\n !release.tag_name.includes('-alphatest')\n }\n return includeRelease\n })\n stableReleases.push(...filtered)\n }\n\n let releasesToRespond: GithubRelease[] = []\n\n stableReleases.sort((a, b) => {\n return new Date(b.created_at).getTime() - new Date(a.created_at).getTime()\n })\n\n if (params.options.onlyLatest) {\n const onlyLatest: Record<string, number> = {}\n for (const release of stableReleases) {\n const splitted = release.tag_name.split('.')\n const majorMinor = `${splitted[0]}.${splitted[1]}`\n const patchVersion = Number(splitted[2])\n if (!onlyLatest[majorMinor]) {\n onlyLatest[majorMinor] = patchVersion\n } else if (patchVersion > onlyLatest[majorMinor]) {\n onlyLatest[majorMinor] = patchVersion\n }\n }\n const releaseStrings = Object.keys(onlyLatest).map((key) => {\n return `${key}.${onlyLatest[key]}`\n })\n const foundReleases = stableReleases.filter((release) => {\n return releaseStrings.includes(release.tag_name)\n })\n releasesToRespond = foundReleases\n } else {\n releasesToRespond = stableReleases\n }\n releaseCache.set(cacheKey, releasesToRespond)\n return releasesToRespond\n }\n\n public static async getReleases(\n params: GithubListReleasesRequest,\n ): Promise<GithubRelease[]> {\n const pageSize = params.options.pageSize || 100\n const currentPage = params.options.currentPage || 1\n const queryParams = new URLSearchParams()\n queryParams.append('per_page', pageSize.toString())\n queryParams.append('page', currentPage.toString())\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GithubService.getReleases`,\n url: `https://api.github.com/repos/${params.options.owner}/${\n params.options.repo\n }/releases?${queryParams.toString()}`,\n normalizedUrl: `https://api.github.com/repos/:owner/:repo`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'github',\n type: 'external',\n },\n }\n\n const response = await request<GithubRelease[]>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Accept: 'application/vnd.github+json',\n Authorization: `Bearer ${params.options.apiToken}`,\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 let releases: GithubRelease[] = []\n if (response.body) {\n releases = response.body.map((release) => {\n return {\n url: release.url,\n tag_name: release.tag_name,\n body: release.body,\n created_at: release.created_at,\n prerelease: release.prerelease,\n }\n })\n }\n return releases\n }\n\n public static async listDirectoryContent(\n params: GithubListDirectoryContentRequest,\n ): Promise<GithubContentItem[]> {\n const queryParams = new URLSearchParams()\n if (params.options.ref) {\n queryParams.append('ref', params.options.ref)\n }\n const encodedPath = encodeURIComponent(params.options.path).replace(\n /%2F/gu,\n '/',\n )\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GithubService.listDirectoryContent`,\n url: `https://api.github.com/repos/${params.options.owner}/${\n params.options.repo\n }/contents/${encodedPath}${queryParams.size ? `?${queryParams.toString()}` : ''}`,\n normalizedUrl: `https://api.github.com/repos/:owner/:repo/contents/:path`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'github',\n type: 'external',\n },\n }\n\n const response = await request<any[]>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Accept: 'application/vnd.github+json',\n Authorization: `Bearer ${params.options.apiToken}`,\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 let items: GithubContentItem[] = []\n if (Array.isArray(response.body)) {\n items = response.body.map((item: any) => {\n return {\n name: item.name,\n path: item.path,\n sha: item.sha,\n size: item.size,\n url: item.url,\n download_url: item.download_url,\n type: item.type,\n } as GithubContentItem\n })\n }\n return items\n }\n\n public static async getRawFile(\n params: GithubGetRawFileRequest,\n ): Promise<string> {\n const queryParams = new URLSearchParams()\n if (params.options.ref) {\n queryParams.append('ref', params.options.ref)\n }\n const encodedPath = encodeURIComponent(params.options.path).replace(\n /%2F/gu,\n '/',\n )\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GithubService.getRawFile`,\n url: `https://api.github.com/repos/${params.options.owner}/${\n params.options.repo\n }/contents/${encodedPath}${queryParams.size ? `?${queryParams.toString()}` : ''}`,\n normalizedUrl: `https://api.github.com/repos/:owner/:repo/contents/:path`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'github',\n type: 'external',\n },\n }\n\n const response = await request<string>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n // do not set a Content-Type for GET, but expect text back\n type: 'none',\n responseType: 'text',\n headers: {\n Accept: 'application/vnd.github.raw',\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body ?? ''\n }\n}\n"],
|
|
5
|
-
"mappings": "AAMA,SAAS,YAAY;AAKrB,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAE1B,MAAM,eAAe,IAAI,MAA+B,IAAI;
|
|
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 { HOUR } from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { Cache } from '../../utils/cache.js'\nimport { HttpError } from '../../utils/errors.js'\n\nconst releaseCache = new Cache<string, GithubRelease[]>(HOUR)\n\n/**\n * How many release pages are fetched at once.\n *\n * GitHub's *secondary* rate limit is about concurrency, not a request budget:\n * firing every iteration in one `Promise.all` is what answered\n * `GET /api/releases/release-train/:trainName` with \"You have exceeded a\n * secondary rate limit\". Batching keeps the walk parallel enough to stay fast\n * while bounding how much of it is in flight.\n */\nconst PAGE_BATCH_SIZE = 5\n\nexport interface GithubListMajorMinorReleasesRequest extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n iterations?: number\n onlyLatest?: boolean\n includeAlphas?: boolean\n onlyPrerelease?: boolean\n replaceBugfixSuffix?: boolean\n }\n}\n\nexport interface GithubListReleasesRequest extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n pageSize?: number\n currentPage?: number\n }\n}\n\nexport interface GithubGetNextBugfixReleaseVersionRequest\n extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n iterations?: number\n onlyLatest?: boolean\n majorMinor: string\n }\n}\n\nexport interface GithubRelease {\n url: string\n tag_name: string\n body: string\n created_at: string\n prerelease: boolean\n}\n\nexport interface GithubListDirectoryContentRequest extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n path: string\n ref?: string\n }\n}\n\nexport interface GithubGetRawFileRequest extends RequestBaseParams {\n options: {\n owner: string\n repo: string\n apiToken: string\n path: string\n ref?: string\n }\n}\n\nexport interface GithubContentItem {\n name: string\n path: string\n sha: string\n size: number\n url: string\n download_url: string | undefined\n type: string\n}\n\nexport class GithubService {\n public static async getNextBugfixReleaseVersion(\n params: GithubGetNextBugfixReleaseVersionRequest,\n ): Promise<string> {\n const releases = await GithubService.listMajorMinorReleases({\n config: params.config,\n options: {\n owner: params.options.owner,\n repo: params.options.repo,\n apiToken: params.options.apiToken,\n onlyLatest: true,\n iterations: params.options.iterations,\n },\n })\n if (releases.length === 0) {\n throw new Error(\n `No releases found for ${params.options.owner}/${params.options.repo}`,\n )\n }\n const latestRelease = releases[0]\n if (latestRelease.tag_name.startsWith(params.options.majorMinor)) {\n throw new Error(\n `Not allowed to create a new bugfix release for ${latestRelease.tag_name}`,\n )\n }\n for (const release of releases) {\n if (release.tag_name.startsWith(params.options.majorMinor)) {\n const versionSplitted = release.tag_name.split('.')\n if (versionSplitted.length !== 3) {\n throw new Error(`Invalid version format: ${release.tag_name}`)\n }\n const majorVersion = Number(versionSplitted[0])\n const minorVersion = Number(versionSplitted[1])\n const patchVersion = Number(versionSplitted[2]) + 1\n return `${majorVersion}.${minorVersion}.${patchVersion}`\n }\n }\n throw new Error(`No bugfix release found for ${params.options.majorMinor}`)\n }\n\n public static async listMajorMinorReleases(\n params: GithubListMajorMinorReleasesRequest,\n ): Promise<GithubRelease[]> {\n // `replaceBugfixSuffix` rewrites the tags in the result, so it has to be\n // part of the key: without it `getNextBugfixReleaseVersion` (which does not\n // set it) and the release-train lookup (which does) shared one entry and\n // whichever loaded first decided what the other saw.\n const cacheKey = `major-minor-${params.options.owner}-${\n params.options.repo\n }-${params.options.onlyLatest ?? false}-${\n params.options.includeAlphas ?? false\n }-${params.options.onlyPrerelease ?? false}-${\n params.options.replaceBugfixSuffix ?? false\n }`\n // Single-flight: several trains are looked up at once and they all land on\n // this key, so without coalescing each concurrent miss ran its own page\n // walk against GitHub.\n return releaseCache.getOrLoad(\n cacheKey,\n () => GithubService.fetchMajorMinorReleases(params),\n { ignoreCache: params.cacheControl?.ignoreCache === true },\n )\n }\n\n private static async fetchMajorMinorReleases(\n params: GithubListMajorMinorReleasesRequest,\n ): Promise<GithubRelease[]> {\n const pageSize = 100\n const ITERATIONS = params.options.iterations || 15\n\n // Walk the pages in bounded-concurrency batches and stop as soon as a page\n // comes back short \u2014 GitHub only returns fewer than `per_page` items on the\n // last page, so every iteration after that was an empty response whose only\n // effect was upstream load.\n const allPageResults: GithubRelease[][] = []\n for (\n let firstPage = 1;\n firstPage <= ITERATIONS;\n firstPage += PAGE_BATCH_SIZE\n ) {\n const batchSize = Math.min(PAGE_BATCH_SIZE, ITERATIONS - firstPage + 1)\n // eslint-disable-next-line no-await-in-loop\n const batch = await Promise.all(\n Array.from({ length: batchSize }, (_, index) =>\n GithubService.getReleases({\n config: params.config,\n options: {\n owner: params.options.owner,\n repo: params.options.repo,\n apiToken: params.options.apiToken,\n pageSize,\n currentPage: firstPage + index,\n },\n }),\n ),\n )\n allPageResults.push(...batch)\n if (batch.some((releases) => releases.length < pageSize)) {\n break\n }\n }\n\n const stableReleases: GithubRelease[] = []\n for (const releases of allPageResults) {\n // replace bugfix suffix\n if (params.options.replaceBugfixSuffix === true) {\n releases.forEach((release) => {\n if (release.tag_name.endsWith('_bugfix')) {\n release.tag_name = release.tag_name.replace(/_bugfix.*/u, '')\n }\n })\n }\n\n const filtered = releases.filter((release) => {\n let includeRelease = !release.prerelease\n if (params.options.onlyPrerelease) {\n includeRelease = release.prerelease\n }\n if (includeRelease && params.options.includeAlphas) {\n includeRelease =\n release.tag_name.includes('-alpha') &&\n !release.tag_name.includes('-alphatest')\n }\n return includeRelease\n })\n stableReleases.push(...filtered)\n }\n\n let releasesToRespond: GithubRelease[] = []\n\n stableReleases.sort((a, b) => {\n return new Date(b.created_at).getTime() - new Date(a.created_at).getTime()\n })\n\n if (params.options.onlyLatest) {\n const onlyLatest: Record<string, number> = {}\n for (const release of stableReleases) {\n const splitted = release.tag_name.split('.')\n const majorMinor = `${splitted[0]}.${splitted[1]}`\n const patchVersion = Number(splitted[2])\n if (!onlyLatest[majorMinor]) {\n onlyLatest[majorMinor] = patchVersion\n } else if (patchVersion > onlyLatest[majorMinor]) {\n onlyLatest[majorMinor] = patchVersion\n }\n }\n const releaseStrings = Object.keys(onlyLatest).map((key) => {\n return `${key}.${onlyLatest[key]}`\n })\n const foundReleases = stableReleases.filter((release) => {\n return releaseStrings.includes(release.tag_name)\n })\n releasesToRespond = foundReleases\n } else {\n releasesToRespond = stableReleases\n }\n // Storing is `getOrLoad`'s job \u2014 it only caches a load that resolved.\n return releasesToRespond\n }\n\n public static async getReleases(\n params: GithubListReleasesRequest,\n ): Promise<GithubRelease[]> {\n const pageSize = params.options.pageSize || 100\n const currentPage = params.options.currentPage || 1\n const queryParams = new URLSearchParams()\n queryParams.append('per_page', pageSize.toString())\n queryParams.append('page', currentPage.toString())\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GithubService.getReleases`,\n url: `https://api.github.com/repos/${params.options.owner}/${\n params.options.repo\n }/releases?${queryParams.toString()}`,\n normalizedUrl: `https://api.github.com/repos/:owner/:repo`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'github',\n type: 'external',\n },\n }\n\n const response = await request<GithubRelease[]>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Accept: 'application/vnd.github+json',\n Authorization: `Bearer ${params.options.apiToken}`,\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 let releases: GithubRelease[] = []\n if (response.body) {\n releases = response.body.map((release) => {\n return {\n url: release.url,\n tag_name: release.tag_name,\n body: release.body,\n created_at: release.created_at,\n prerelease: release.prerelease,\n }\n })\n }\n return releases\n }\n\n public static async listDirectoryContent(\n params: GithubListDirectoryContentRequest,\n ): Promise<GithubContentItem[]> {\n const queryParams = new URLSearchParams()\n if (params.options.ref) {\n queryParams.append('ref', params.options.ref)\n }\n const encodedPath = encodeURIComponent(params.options.path).replace(\n /%2F/gu,\n '/',\n )\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GithubService.listDirectoryContent`,\n url: `https://api.github.com/repos/${params.options.owner}/${\n params.options.repo\n }/contents/${encodedPath}${queryParams.size ? `?${queryParams.toString()}` : ''}`,\n normalizedUrl: `https://api.github.com/repos/:owner/:repo/contents/:path`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'github',\n type: 'external',\n },\n }\n\n const response = await request<any[]>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Accept: 'application/vnd.github+json',\n Authorization: `Bearer ${params.options.apiToken}`,\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 let items: GithubContentItem[] = []\n if (Array.isArray(response.body)) {\n items = response.body.map((item: any) => {\n return {\n name: item.name,\n path: item.path,\n sha: item.sha,\n size: item.size,\n url: item.url,\n download_url: item.download_url,\n type: item.type,\n } as GithubContentItem\n })\n }\n return items\n }\n\n public static async getRawFile(\n params: GithubGetRawFileRequest,\n ): Promise<string> {\n const queryParams = new URLSearchParams()\n if (params.options.ref) {\n queryParams.append('ref', params.options.ref)\n }\n const encodedPath = encodeURIComponent(params.options.path).replace(\n /%2F/gu,\n '/',\n )\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GithubService.getRawFile`,\n url: `https://api.github.com/repos/${params.options.owner}/${\n params.options.repo\n }/contents/${encodedPath}${queryParams.size ? `?${queryParams.toString()}` : ''}`,\n normalizedUrl: `https://api.github.com/repos/:owner/:repo/contents/:path`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'github',\n type: 'external',\n },\n }\n\n const response = await request<string>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n // do not set a Content-Type for GET, but expect text back\n type: 'none',\n responseType: 'text',\n headers: {\n Accept: 'application/vnd.github.raw',\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body ?? ''\n }\n}\n"],
|
|
5
|
+
"mappings": "AAMA,SAAS,YAAY;AAKrB,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAE1B,MAAM,eAAe,IAAI,MAA+B,IAAI;AAW5D,MAAM,kBAAkB;AA2EjB,MAAM,cAAc;AAAA,EACzB,aAAoB,4BAClB,QACiB;AACjB,UAAM,WAAW,MAAM,cAAc,uBAAuB;AAAA,MAC1D,QAAQ,OAAO;AAAA,MACf,SAAS;AAAA,QACP,OAAO,OAAO,QAAQ;AAAA,QACtB,MAAM,OAAO,QAAQ;AAAA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