@camunda/ccma-api 0.0.3 → 0.0.5
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 +11 -5
- package/dist/index.js +6 -0
- package/dist/index.js.map +2 -2
- package/dist/services/accounts/orgs.service.d.ts +10 -1
- package/dist/services/accounts/orgs.service.js +34 -0
- package/dist/services/accounts/orgs.service.js.map +2 -2
- package/dist/services/ask-backend/ask-backend.service.d.ts +85 -0
- package/dist/services/ask-backend/ask-backend.service.js +378 -0
- package/dist/services/ask-backend/ask-backend.service.js.map +7 -0
- package/dist/services/console/console.admin.service.d.ts +65 -0
- package/dist/services/console/console.admin.service.js +156 -2
- package/dist/services/console/console.admin.service.js.map +2 -2
- package/dist/services/console/console.cluster-parameters.service.d.ts +1 -0
- package/dist/services/console/console.cluster-parameters.service.js.map +2 -2
- package/dist/services/console/console.cluster.service.d.ts +9 -0
- package/dist/services/console/console.cluster.service.js +28 -0
- package/dist/services/console/console.cluster.service.js.map +2 -2
- package/dist/services/console/console.clusterplan.modification.service.d.ts +1 -0
- package/dist/services/console/console.clusterplan.modification.service.js +28 -0
- package/dist/services/console/console.clusterplan.modification.service.js.map +2 -2
- package/dist/services/console/generation.service.d.ts +11 -0
- package/dist/services/console/generation.service.js +36 -2
- package/dist/services/console/generation.service.js.map +2 -2
- package/dist/services/glean/glean.service.d.ts +20 -0
- package/dist/services/glean/glean.service.js +49 -0
- package/dist/services/glean/glean.service.js.map +7 -0
- package/dist/services/incident-io/incident-io.service.d.ts +20 -0
- package/dist/services/incident-io/incident-io.service.js +67 -0
- package/dist/services/incident-io/incident-io.service.js.map +7 -0
- package/dist/services/incident-io/incident-io.service.spec.d.ts +1 -0
- package/dist/services/slack/slack.service.d.ts +37 -0
- package/dist/services/slack/slack.service.js +98 -0
- package/dist/services/slack/slack.service.js.map +2 -2
- package/package.json +3 -6
|
@@ -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} 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 autoUpdate?: boolean\n enforceGroups?: boolean\n rba?: boolean\n identityBackendChecksEnabled?: boolean\n businessIdUniquenessEnabled?: boolean\n auditLogEnabled?: boolean | null\n auditLogUserCategories?: string[] | null\n auditLogClientCategories?: string[] | null\n }\n}\n\nexport interface GetConsoleClusterRequest extends RequestBaseParams {\n params: {\n orgId: string\n clusterId: 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 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": "AAcA,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} 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 autoUpdate?: boolean\n enforceGroups?: boolean\n rba?: boolean\n identityBackendChecksEnabled?: boolean\n businessIdUniquenessEnabled?: boolean\n auditLogEnabled?: boolean | null\n auditLogUserCategories?: string[] | null\n auditLogClientCategories?: string[] | null\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 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 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 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": "AAcA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAgHnB,MAAM,sBAAsB;AAAA,EACjC,aAAoB,YAClB,QAC8B;AAC9B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,YAAY,OAAO,OAAO,KAAK;AAAA,QACpC,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAA6B;AAAA,MAClD,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAEA,WAAO,SAAS,QAAQ,CAAC;AAAA,EAC3B;AAAA,EAEA,aAAoB,cAClB,QACuC;AACvC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,YAAY,OAAO,OAAO,KAAK;AAAA,QACpC,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAsC;AAAA,MAC3D,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,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e,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,OAAO;AAAA,IACf,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAoB,cAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,YAAY,OAAO,OAAO,KAAK,aAAa,OAAO,OAAO,SAAS;AAAA,QACxE,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -25,6 +25,7 @@ export declare class ClusterPlanModificationService {
|
|
|
25
25
|
static create(params: CreateClusterPlanModificationRequest): Promise<ClusterPlanModificationDto | undefined>;
|
|
26
26
|
static refine(params: RefineClusterPlanModificationRequest): Promise<ClusterPlanModificationDto | undefined>;
|
|
27
27
|
static seal(params: ClusterPlanModificationRequest): Promise<ClusterPlanModificationDto | undefined>;
|
|
28
|
+
static unseal(params: ClusterPlanModificationRequest): Promise<ClusterPlanModificationDto | undefined>;
|
|
28
29
|
static ack(params: ClusterPlanModificationRequest): Promise<ClusterPlanModificationDto | undefined>;
|
|
29
30
|
static execute(params: ClusterPlanModificationRequest): Promise<void>;
|
|
30
31
|
static restart(params: ClusterPlanModificationRequest): Promise<void>;
|
|
@@ -115,6 +115,34 @@ class ClusterPlanModificationService {
|
|
|
115
115
|
}
|
|
116
116
|
return response.body;
|
|
117
117
|
}
|
|
118
|
+
static async unseal(params) {
|
|
119
|
+
const serviceContext = {
|
|
120
|
+
method: {
|
|
121
|
+
name: "ClusterPlanModificationService.unseal",
|
|
122
|
+
url: `api/plans/modify/${params.uuid}/unseal`,
|
|
123
|
+
normalizedUrl: `api/plans/modify/:uuid/unseal`,
|
|
124
|
+
type: "post"
|
|
125
|
+
},
|
|
126
|
+
source: params.config.metrics?.source || "unset",
|
|
127
|
+
target: { name: "console", type: "internal" }
|
|
128
|
+
};
|
|
129
|
+
const response = await request({
|
|
130
|
+
config: params.config,
|
|
131
|
+
base: { id: "console" },
|
|
132
|
+
responseType: "json",
|
|
133
|
+
url: serviceContext.method.url,
|
|
134
|
+
method: serviceContext.method.type,
|
|
135
|
+
metricsDetails: serviceContext
|
|
136
|
+
});
|
|
137
|
+
if (!response.ok) {
|
|
138
|
+
throw new HttpError(
|
|
139
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
140
|
+
response.status,
|
|
141
|
+
response.statusText
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
return response.body;
|
|
145
|
+
}
|
|
118
146
|
static async ack(params) {
|
|
119
147
|
const serviceContext = {
|
|
120
148
|
method: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/services/console/console.clusterplan.modification.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 ClusterPlanModificationConfig,\n ClusterPlanModificationDto,\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\ninterface Settings {\n config?: Array<ClusterPlanModificationConfig>\n clusterplans?: Array<string>\n description?: string\n name?: string\n url?: string\n}\n\nexport interface CreateClusterPlanModificationRequest\n extends RequestBaseParams {\n settings: Settings & { description: string; name: string }\n}\n\nexport interface RefineClusterPlanModificationRequest\n extends RequestBaseParams {\n uuid: string\n settings: Settings\n}\n\nexport interface ClusterPlanModificationRequest extends RequestBaseParams {\n uuid: string\n}\n\nexport class ClusterPlanModificationService {\n public static async getAll(params: RequestBaseParams) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.getAll',\n url: 'api/plans/modify',\n normalizedUrl: 'api/plans/modify',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto[]>({\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 create(params: CreateClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.create',\n url: 'api/plans/modify',\n normalizedUrl: 'api/plans/modify',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\n config: params.config,\n base: { id: 'console' },\n body: params.settings,\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 refine(params: RefineClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.refine',\n url: `api/plans/modify/${params.uuid}`,\n normalizedUrl: `api/plans/modify/:uuid`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\n config: params.config,\n base: { id: 'console' },\n body: params.settings,\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 seal(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.seal',\n url: `api/plans/modify/${params.uuid}/seal`,\n normalizedUrl: `api/plans/modify/:uuid/seal`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\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 ack(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.ack',\n url: `api/plans/modify/${params.uuid}/ack`,\n normalizedUrl: `api/plans/modify/:uuid/ack`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\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 execute(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.execute',\n url: `api/plans/modify/${params.uuid}/execute`,\n normalizedUrl: `api/plans/modify/:uuid/execute`,\n type: 'post',\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: '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 }\n\n public static async restart(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.restart',\n url: `api/plans/modify/${params.uuid}/restart`,\n normalizedUrl: `api/plans/modify/:uuid/restart`,\n type: 'post',\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: '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 }\n\n public static async delete(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.delete',\n url: `api/plans/modify/${params.uuid}`,\n normalizedUrl: `api/plans/modify/:uuid`,\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\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"],
|
|
5
|
-
"mappings": "AAcA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAyBnB,MAAM,+BAA+B;AAAA,EAC1C,aAAoB,OAAO,QAA2B;AACpD,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,QAAsC;AAAA,MAC3D,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AACA,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,aAAoB,OAAO,QAA8C;AACvE,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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AAA,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,OAAO,QAAwC;AACjE,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,oBAAoB,OAAO,IAAI;AAAA,QACpC,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAoC;AAAA,MACzD,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;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 ClusterPlanModificationConfig,\n ClusterPlanModificationDto,\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\ninterface Settings {\n config?: Array<ClusterPlanModificationConfig>\n clusterplans?: Array<string>\n description?: string\n name?: string\n url?: string\n}\n\nexport interface CreateClusterPlanModificationRequest\n extends RequestBaseParams {\n settings: Settings & { description: string; name: string }\n}\n\nexport interface RefineClusterPlanModificationRequest\n extends RequestBaseParams {\n uuid: string\n settings: Settings\n}\n\nexport interface ClusterPlanModificationRequest extends RequestBaseParams {\n uuid: string\n}\n\nexport class ClusterPlanModificationService {\n public static async getAll(params: RequestBaseParams) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.getAll',\n url: 'api/plans/modify',\n normalizedUrl: 'api/plans/modify',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto[]>({\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 create(params: CreateClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.create',\n url: 'api/plans/modify',\n normalizedUrl: 'api/plans/modify',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\n config: params.config,\n base: { id: 'console' },\n body: params.settings,\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 refine(params: RefineClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.refine',\n url: `api/plans/modify/${params.uuid}`,\n normalizedUrl: `api/plans/modify/:uuid`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\n config: params.config,\n base: { id: 'console' },\n body: params.settings,\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 seal(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.seal',\n url: `api/plans/modify/${params.uuid}/seal`,\n normalizedUrl: `api/plans/modify/:uuid/seal`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\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 unseal(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.unseal',\n url: `api/plans/modify/${params.uuid}/unseal`,\n normalizedUrl: `api/plans/modify/:uuid/unseal`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\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 ack(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.ack',\n url: `api/plans/modify/${params.uuid}/ack`,\n normalizedUrl: `api/plans/modify/:uuid/ack`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\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 execute(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.execute',\n url: `api/plans/modify/${params.uuid}/execute`,\n normalizedUrl: `api/plans/modify/:uuid/execute`,\n type: 'post',\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: '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 }\n\n public static async restart(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.restart',\n url: `api/plans/modify/${params.uuid}/restart`,\n normalizedUrl: `api/plans/modify/:uuid/restart`,\n type: 'post',\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: '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 }\n\n public static async delete(params: ClusterPlanModificationRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'ClusterPlanModificationService.delete',\n url: `api/plans/modify/${params.uuid}`,\n normalizedUrl: `api/plans/modify/:uuid`,\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ClusterPlanModificationDto>({\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"],
|
|
5
|
+
"mappings": "AAcA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAyBnB,MAAM,+BAA+B;AAAA,EAC1C,aAAoB,OAAO,QAA2B;AACpD,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,QAAsC;AAAA,MAC3D,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AACA,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,aAAoB,OAAO,QAA8C;AACvE,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA,QACL,eAAe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EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAoC;AAAA,MACzD,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;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,6 +10,7 @@ export declare class GenerationService {
|
|
|
10
10
|
static upgradeCluster(params: {
|
|
11
11
|
generationUuid: string;
|
|
12
12
|
clusterId: string;
|
|
13
|
+
orgId: string;
|
|
13
14
|
tasklistV2Enabled?: boolean;
|
|
14
15
|
} & RequestBaseParams): Promise<void>;
|
|
15
16
|
static setSupported(params: {
|
|
@@ -26,4 +27,14 @@ export declare class GenerationService {
|
|
|
26
27
|
name: string;
|
|
27
28
|
clusterCount: number;
|
|
28
29
|
} | undefined>;
|
|
30
|
+
static updateUpgradePath(params: {
|
|
31
|
+
generationUuid: string;
|
|
32
|
+
upgradeableFrom: string[];
|
|
33
|
+
} & RequestBaseParams): Promise<{
|
|
34
|
+
name: string;
|
|
35
|
+
uuid: string;
|
|
36
|
+
upgradeableFrom: Array<{
|
|
37
|
+
uuid: string;
|
|
38
|
+
}>;
|
|
39
|
+
} | undefined>;
|
|
29
40
|
}
|
|
@@ -65,8 +65,8 @@ class GenerationService {
|
|
|
65
65
|
const serviceContext = {
|
|
66
66
|
method: {
|
|
67
67
|
name: `GenerationService.upgradeCluster`,
|
|
68
|
-
url: `api/
|
|
69
|
-
normalizedUrl: `api/
|
|
68
|
+
url: `api/orgs/${params.orgId}/clusters/${params.clusterId}/upgrade/${params.generationUuid}`,
|
|
69
|
+
normalizedUrl: `api/orgs/:orgId/clusters/:clusterId/upgrade/:generationUuid`,
|
|
70
70
|
type: "put"
|
|
71
71
|
},
|
|
72
72
|
source: params.config.metrics?.source || "unset",
|
|
@@ -159,6 +159,40 @@ class GenerationService {
|
|
|
159
159
|
}
|
|
160
160
|
return response.body;
|
|
161
161
|
}
|
|
162
|
+
static async updateUpgradePath(params) {
|
|
163
|
+
const body = {
|
|
164
|
+
upgradeableFrom: params.upgradeableFrom
|
|
165
|
+
};
|
|
166
|
+
const serviceContext = {
|
|
167
|
+
method: {
|
|
168
|
+
name: `GenerationService.updateUpgradePath`,
|
|
169
|
+
url: `external/generations/${params.generationUuid}/upgradepath`,
|
|
170
|
+
normalizedUrl: `external/generations/:generationUuid/upgradepath`,
|
|
171
|
+
type: "put"
|
|
172
|
+
},
|
|
173
|
+
source: params.config.metrics?.source || "unset",
|
|
174
|
+
target: { name: "console", type: "internal" }
|
|
175
|
+
};
|
|
176
|
+
const response = await request({
|
|
177
|
+
config: params.config,
|
|
178
|
+
base: {
|
|
179
|
+
id: "console"
|
|
180
|
+
},
|
|
181
|
+
body,
|
|
182
|
+
responseType: "json",
|
|
183
|
+
url: serviceContext.method.url,
|
|
184
|
+
method: serviceContext.method.type,
|
|
185
|
+
metricsDetails: serviceContext
|
|
186
|
+
});
|
|
187
|
+
if (!response.ok) {
|
|
188
|
+
throw new HttpError(
|
|
189
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
190
|
+
response.status,
|
|
191
|
+
response.statusText
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
return response.body;
|
|
195
|
+
}
|
|
162
196
|
}
|
|
163
197
|
export {
|
|
164
198
|
GenerationService
|
|
@@ -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 { GenerationDto } 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 class GenerationService {\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: { fromGenerationUuid: string } & RequestBaseParams,\n ): Promise<GenerationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradable`,\n url: `api/generations/${params.fromGenerationUuid}/upgradable`,\n normalizedUrl: `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 upgradeCluster(\n params: {\n generationUuid: string\n clusterId: string\n tasklistV2Enabled?: boolean\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.upgradeCluster`,\n url: `api/
|
|
5
|
-
"mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAEnB,MAAM,kBAAkB;AAAA,EAC7B,aAAoB,cAClB,QACoC;AACpC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,mBAAmB,OAAO,IAAI;AAAA,QACnC,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAuB;AAAA,MAC5C,QAAQ,OAAO;AAAA,MACf,MAAM;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AACA,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,aAAoB,cAClB,QAC0B;AAC1B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,mBAAmB,OAAO,kBAAkB;AAAA,QACjD,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAyB;AAAA,MAC9C,QAAQ,OAAO;AAAA,MACf,MAAM;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AACA,WAAO,SAAS,QAAQ,CAAC;AAAA,EAC3B;AAAA,EAEA,aAAoB,eAClB,
|
|
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 { GenerationDto } 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 class GenerationService {\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: { fromGenerationUuid: string } & RequestBaseParams,\n ): Promise<GenerationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradable`,\n url: `api/generations/${params.fromGenerationUuid}/upgradable`,\n normalizedUrl: `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 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 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 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"],
|
|
5
|
+
"mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAEnB,MAAM,kBAAkB;AAAA,EAC7B,aAAoB,cAClB,QACoC;AACpC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,mBAAmB,OAAO,IAAI;AAAA,QACnC,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAuB;AAAA,MAC5C,QAAQ,OAAO;AAAA,MACf,MAAM;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AACA,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,aAAoB,cAClB,QAC0B;AAC1B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,mBAAmB,OAAO,kBAAkB;AAAA,QACjD,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,O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estBaseParams } from '../../types/general.types.js';
|
|
2
|
+
export interface GleanSearchRequest extends RequestBaseParams {
|
|
3
|
+
options: {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
};
|
|
7
|
+
params: {
|
|
8
|
+
query: string;
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface GleanSearchResult {
|
|
13
|
+
title: string;
|
|
14
|
+
url: string;
|
|
15
|
+
snippet?: string;
|
|
16
|
+
datasource?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class GleanService {
|
|
19
|
+
static search(params: GleanSearchRequest): Promise<GleanSearchResult[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { request } from "../../utils/api.js";
|
|
2
|
+
import { HttpError } from "../../utils/errors.js";
|
|
3
|
+
class GleanService {
|
|
4
|
+
static async search(params) {
|
|
5
|
+
const url = `${params.options.baseUrl}/rest/api/v1/search`;
|
|
6
|
+
const serviceContext = {
|
|
7
|
+
method: {
|
|
8
|
+
name: "GleanService.search",
|
|
9
|
+
url,
|
|
10
|
+
normalizedUrl: `${params.options.baseUrl}/rest/api/v1/search`,
|
|
11
|
+
type: "post"
|
|
12
|
+
},
|
|
13
|
+
source: params.config.metrics?.source ?? "unset",
|
|
14
|
+
target: { name: "glean", type: "external" }
|
|
15
|
+
};
|
|
16
|
+
const response = await request({
|
|
17
|
+
config: params.config,
|
|
18
|
+
url,
|
|
19
|
+
method: "post",
|
|
20
|
+
metricsDetails: serviceContext,
|
|
21
|
+
type: "json",
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: `Bearer ${params.options.apiKey}`,
|
|
24
|
+
Accept: "application/json"
|
|
25
|
+
},
|
|
26
|
+
body: {
|
|
27
|
+
query: params.params.query,
|
|
28
|
+
pageSize: params.params.pageSize ?? 20
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
throw new HttpError(
|
|
33
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
34
|
+
response.status,
|
|
35
|
+
response.statusText
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return (response.body?.results ?? []).map((r) => ({
|
|
39
|
+
title: r.title ?? "",
|
|
40
|
+
url: r.url ?? "",
|
|
41
|
+
snippet: r.snippets?.[0]?.text,
|
|
42
|
+
datasource: r.datasource
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
GleanService
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=glean.service.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/services/glean/glean.service.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface GleanSearchRequest extends RequestBaseParams {\n options: {\n apiKey: string\n baseUrl: string\n }\n params: {\n query: string\n pageSize?: number\n }\n}\n\nexport interface GleanSearchResult {\n title: string\n url: string\n snippet?: string\n datasource?: string\n}\n\ninterface GleanApiResponse {\n results: Array<{\n title?: string\n url?: string\n snippets?: Array<{ text: string }>\n datasource?: string\n }>\n}\n\nexport class GleanService {\n public static async search(\n params: GleanSearchRequest,\n ): Promise<GleanSearchResult[]> {\n const url = `${params.options.baseUrl}/rest/api/v1/search`\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GleanService.search',\n url,\n normalizedUrl: `${params.options.baseUrl}/rest/api/v1/search`,\n type: 'post',\n },\n source: params.config.metrics?.source ?? 'unset',\n target: { name: 'glean', type: 'external' },\n }\n\n const response = await request<GleanApiResponse>({\n config: params.config,\n url,\n method: 'post',\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiKey}`,\n Accept: 'application/json',\n },\n body: {\n query: params.params.query,\n pageSize: params.params.pageSize ?? 20,\n },\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?.results ?? []).map((r) => ({\n title: r.title ?? '',\n url: r.url ?? '',\n snippet: r.snippets?.[0]?.text,\n datasource: r.datasource,\n }))\n }\n}\n"],
|
|
5
|
+
"mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA6BnB,MAAM,aAAa;AAAA,EACxB,aAAoB,OAClB,QAC8B;AAC9B,UAAM,MAAM,GAAG,OAAO,QAAQ,OAAO;AAErC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN;AAAA,QACA,eAAe,GAAG,OAAO,QAAQ,OAAO;AAAA,QACxC,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,SAAS,MAAM,WAAW;AAAA,IAC5C;AAEA,UAAM,WAAW,MAAM,QAA0B;AAAA,MAC/C,QAAQ,OAAO;AAAA,MACf;AAAA,MACA,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA,QACP,eAAe,UAAU,OAAO,QAAQ,MAAM;AAAA,QAC9C,QAAQ;AAAA,MACV;AAAA,MACA,MAAM;AAAA,QACJ,OAAO,OAAO,OAAO;AAAA,QACrB,UAAU,OAAO,OAAO,YAAY;AAAA,MACtC;AAAA,IACF,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAEA,YAAQ,SAAS,MAAM,WAAW,CAAC,GAAG,IAAI,CAAC,OAAO;AAAA,MAChD,OAAO,EAAE,SAAS;AAAA,MAClB,KAAK,EAAE,OAAO;AAAA,MACd,SAAS,EAAE,WAAW,CAAC,GAAG;AAAA,MAC1B,YAAY,EAAE;AAAA,IAChB,EAAE;AAAA,EACJ;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RequestBaseParams } from '../../types/general.types.js';
|
|
2
|
+
export interface OpenIncident {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
status: string;
|
|
6
|
+
severity: string | undefined;
|
|
7
|
+
permalink: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
clusterId: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface IncidentIoGetOpenIncidentsRequest extends RequestBaseParams {
|
|
13
|
+
options: {
|
|
14
|
+
apiKey: string;
|
|
15
|
+
clusterFieldId: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare class IncidentIoService {
|
|
19
|
+
static getOpenIncidents(params: IncidentIoGetOpenIncidentsRequest): Promise<OpenIncident[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { request } from "../../utils/api.js";
|
|
2
|
+
import { HttpError } from "../../utils/errors.js";
|
|
3
|
+
const INCIDENT_IO_BASE_URL = "https://api.incident.io";
|
|
4
|
+
class IncidentIoService {
|
|
5
|
+
static async getOpenIncidents(params) {
|
|
6
|
+
const { clusterFieldId, apiKey } = params.options;
|
|
7
|
+
const url = `${INCIDENT_IO_BASE_URL}/v2/incidents`;
|
|
8
|
+
const serviceContext = {
|
|
9
|
+
method: {
|
|
10
|
+
name: "IncidentIoService.getOpenIncidents",
|
|
11
|
+
url,
|
|
12
|
+
normalizedUrl: url,
|
|
13
|
+
type: "get"
|
|
14
|
+
},
|
|
15
|
+
source: params.config.metrics?.source ?? "unset",
|
|
16
|
+
target: { name: "incident-io", type: "external" }
|
|
17
|
+
};
|
|
18
|
+
const allIncidents = [];
|
|
19
|
+
let after;
|
|
20
|
+
do {
|
|
21
|
+
const pageUrl = new URL(url);
|
|
22
|
+
pageUrl.searchParams.append("status_category[one_of][]", "live");
|
|
23
|
+
pageUrl.searchParams.append("status_category[one_of][]", "triage");
|
|
24
|
+
pageUrl.searchParams.append("status_category[one_of][]", "paused");
|
|
25
|
+
pageUrl.searchParams.set("page_size", "250");
|
|
26
|
+
if (after) pageUrl.searchParams.set("after", after);
|
|
27
|
+
const response = await request({
|
|
28
|
+
config: params.config,
|
|
29
|
+
url: pageUrl.toString(),
|
|
30
|
+
method: "get",
|
|
31
|
+
metricsDetails: serviceContext,
|
|
32
|
+
type: "json",
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: `Bearer ${apiKey}`,
|
|
35
|
+
Accept: "application/json"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
throw new HttpError(
|
|
40
|
+
`${serviceContext.method.name}: ${response.status} ${response.statusText}`,
|
|
41
|
+
response.status,
|
|
42
|
+
response.statusText
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
allIncidents.push(...response.body?.incidents ?? []);
|
|
46
|
+
after = response.body?.pagination_meta?.after;
|
|
47
|
+
} while (after);
|
|
48
|
+
return allIncidents.map(
|
|
49
|
+
(incident) => ({
|
|
50
|
+
id: incident.id,
|
|
51
|
+
name: incident.name,
|
|
52
|
+
status: incident.incident_status.name,
|
|
53
|
+
severity: incident.severity?.name,
|
|
54
|
+
permalink: incident.permalink,
|
|
55
|
+
createdAt: incident.created_at,
|
|
56
|
+
updatedAt: incident.updated_at,
|
|
57
|
+
clusterId: incident.custom_field_entries.find(
|
|
58
|
+
(entry) => entry.custom_field.id === clusterFieldId
|
|
59
|
+
)?.values[0]?.value_option?.value
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
IncidentIoService
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=incident-io.service.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/services/incident-io/incident-io.service.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nconst INCIDENT_IO_BASE_URL = 'https://api.incident.io'\n\nexport interface OpenIncident {\n id: string\n name: string\n status: string\n severity: string | undefined\n permalink: string\n createdAt: string\n updatedAt: string\n clusterId: string | undefined\n}\n\nexport interface IncidentIoGetOpenIncidentsRequest extends RequestBaseParams {\n options: {\n apiKey: string\n clusterFieldId: string\n }\n}\n\n// Raw incident.io v2 API shapes \u2014 only the fields we use.\ninterface IncidentIoCustomFieldEntry {\n custom_field: {\n id: string\n name: string\n field_type: string\n }\n // multi_select uses value_option; text uses value_text; link uses value_link\n values: Array<{\n value_text?: string\n value_option?: { id: string; value: string }\n }>\n}\n\ninterface IncidentIoIncident {\n id: string\n name: string\n incident_status: { name: string }\n severity?: { name: string }\n permalink: string\n created_at: string\n updated_at: string\n custom_field_entries: IncidentIoCustomFieldEntry[]\n}\n\ninterface IncidentIoListResponse {\n incidents: IncidentIoIncident[]\n pagination_meta?: { after?: string; page_size: number }\n}\n\nexport class IncidentIoService {\n public static async getOpenIncidents(\n params: IncidentIoGetOpenIncidentsRequest,\n ): Promise<OpenIncident[]> {\n const { clusterFieldId, apiKey } = params.options\n const url = `${INCIDENT_IO_BASE_URL}/v2/incidents`\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'IncidentIoService.getOpenIncidents',\n url,\n normalizedUrl: url,\n type: 'get',\n },\n source: params.config.metrics?.source ?? 'unset',\n target: { name: 'incident-io', type: 'external' },\n }\n\n const allIncidents: IncidentIoIncident[] = []\n let after: string | undefined\n\n do {\n const pageUrl = new URL(url)\n pageUrl.searchParams.append('status_category[one_of][]', 'live')\n pageUrl.searchParams.append('status_category[one_of][]', 'triage')\n pageUrl.searchParams.append('status_category[one_of][]', 'paused')\n pageUrl.searchParams.set('page_size', '250')\n if (after) pageUrl.searchParams.set('after', after)\n\n const response = await request<IncidentIoListResponse>({\n config: params.config,\n url: pageUrl.toString(),\n method: 'get',\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${apiKey}`,\n Accept: 'application/json',\n },\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 allIncidents.push(...(response.body?.incidents ?? []))\n after = response.body?.pagination_meta?.after\n } while (after)\n\n return allIncidents.map(\n (incident): OpenIncident => ({\n id: incident.id,\n name: incident.name,\n status: incident.incident_status.name,\n severity: incident.severity?.name,\n permalink: incident.permalink,\n createdAt: incident.created_at,\n updatedAt: incident.updated_at,\n clusterId: incident.custom_field_entries.find(\n (entry) => entry.custom_field.id === clusterFieldId,\n )?.values[0]?.value_option?.value,\n }),\n )\n }\n}\n"],
|
|
5
|
+
"mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAE1B,MAAM,uBAAuB;AAkDtB,MAAM,kBAAkB;AAAA,EAC7B,aAAoB,iBAClB,QACyB;AACzB,UAAM,EAAE,gBAAgB,OAAO,IAAI,OAAO;AAC1C,UAAM,MAAM,GAAG,oBAAoB;AAEnC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN;AAAA,QACA,eAAe;AAAA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,aAAa,OAAO;AAAA,QACvC,GAAG,OAAO,CAAC,GAAG,cAAc;AAAA,MAC9B;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,6 +18,31 @@ export interface SlackLookupUserByEmailParams extends RequestBaseParams {
|
|
|
18
18
|
export interface SlackLookupUserByEmailResponse {
|
|
19
19
|
userId: string;
|
|
20
20
|
}
|
|
21
|
+
export interface SlackChatPostMessageParams extends RequestBaseParams {
|
|
22
|
+
params: {
|
|
23
|
+
channel: string;
|
|
24
|
+
blocks: Array<{
|
|
25
|
+
type: string;
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}>;
|
|
28
|
+
text?: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface SlackChatPostMessageResponse {
|
|
32
|
+
ok: boolean;
|
|
33
|
+
channel?: string;
|
|
34
|
+
ts?: string;
|
|
35
|
+
error?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface SlackConversationsInviteParams extends RequestBaseParams {
|
|
38
|
+
params: {
|
|
39
|
+
channel: string;
|
|
40
|
+
users: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface SlackConversationsInviteResponse {
|
|
44
|
+
ok: boolean;
|
|
45
|
+
}
|
|
21
46
|
export declare class SlackService {
|
|
22
47
|
static incomingWebhook(params: IncomingWebhookRequest): Promise<any>;
|
|
23
48
|
/**
|
|
@@ -27,5 +52,17 @@ export declare class SlackService {
|
|
|
27
52
|
* @returns The Slack user ID, or undefined if not found.
|
|
28
53
|
*/
|
|
29
54
|
static lookupUserByEmail(params: SlackLookupUserByEmailParams): Promise<SlackLookupUserByEmailResponse | undefined>;
|
|
55
|
+
/**
|
|
56
|
+
* Posts a Block Kit message to a Slack channel using the Web API.
|
|
57
|
+
* Unlike webhooks, this supports user mention notifications.
|
|
58
|
+
* Requires config.auth.getToken() to return a Slack Bot Token.
|
|
59
|
+
*/
|
|
60
|
+
static chatPostMessage(params: SlackChatPostMessageParams): Promise<SlackChatPostMessageResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Invites a user to a Slack channel.
|
|
63
|
+
* Silently succeeds if the user is already in the channel.
|
|
64
|
+
* Requires config.auth.getToken() to return a Slack Bot Token.
|
|
65
|
+
*/
|
|
66
|
+
static conversationsInvite(params: SlackConversationsInviteParams): Promise<SlackConversationsInviteResponse>;
|
|
30
67
|
}
|
|
31
68
|
export {};
|