@camunda/ccma-api 13.2.3 → 13.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/services/accounts/orgs.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 {\n type ActivityRetentionMonths,\n type AutoJoinAssignment,\n type ClusterCreationDefaults,\n type EnterpriseIncludingValueMetrics,\n type LicensingModelType,\n type Limits,\n type LlmProviderName,\n MINUTE,\n type OrganizationDto,\n type OrgWithNameAndSalesPlan,\n type User,\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 { Cache } from '../../utils/cache.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface GetSubscriptionItemsParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface GetSubscriptionDetailsParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface GetSubscriptionDetailsResponse {\n status: string\n currentContractTermEnd: number\n}\n\nexport interface OrgInfo {\n orgUuid: string\n name: string\n salesPlanUuid?: string\n salesForceProjectId?: string\n}\n\nexport interface SetLimitRequest extends RequestBaseParams {\n params: {\n orgId: string\n onBehalfOf: string\n limitKey: string\n limitValue: string | null\n }\n}\n\nexport interface UpdateSuppressDropDisksRequest extends RequestBaseParams {\n params: {\n orgId: string\n value: boolean\n }\n}\n\n/**\n * A limit that an org member can change on the member route. The admin route\n * (`setLimit`) takes every limit.\n */\nexport interface UpdateOrgLimitAsMemberRequest extends RequestBaseParams {\n params:\n | {\n orgId: string\n limitKey: 'preprodClusterTtlHours'\n /** `undefined` removes the limit from the org. */\n value: number | undefined\n }\n | {\n orgId: string\n limitKey: 'clusterPlanWhiteList'\n /** Comma-joined plan uuids. `undefined` removes the limit. */\n value: string | undefined\n }\n}\n\nexport interface UpdateOrgLimitAsMemberResponse {\n newLimits: Limits\n}\n\nexport interface UpdateSuppressDropDisksResponse {\n newLimits: {\n suppressDropDisks?: boolean\n [key: string]: any\n }\n}\n\nexport interface UpdateActivityRetentionRequest extends RequestBaseParams {\n params: {\n orgId: string\n months: ActivityRetentionMonths\n }\n}\n\nexport interface UpdateActivityRetentionResponse {\n activityRetentionMonths: number\n}\n\nexport interface RenameOrganizationRequest extends RequestBaseParams {\n params: {\n orgId: string\n newOrgName: string\n }\n}\n\nexport interface ExtendTrialRequest extends RequestBaseParams {\n params: {\n orgId: string\n onBehalfOf: string\n newExpireDate: string\n }\n}\n\nexport interface SelfExtendTrialRequest extends RequestBaseParams {\n params: {\n orgId: string\n surveyAnswers?: import('@camunda/ccma-shared-types').TrialExtensionSurveyAnswer[]\n researchConsent?: boolean\n }\n}\n\nexport interface ResetTrialExtensionsRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface EnterpriseDevOnlyRequest extends RequestBaseParams {\n params: {\n orgId: string\n enterpriseDevOnly: boolean\n }\n}\n\nexport interface AwsOnlyRequest extends RequestBaseParams {\n params: {\n orgId: string\n awsOnly: boolean\n }\n}\n\nexport interface OrgClusterDefaultsRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface UpdateOrgClusterDefaultsRequest\n extends OrgClusterDefaultsRequest {\n body: {\n defaults: ClusterCreationDefaults\n }\n}\n\n/** The cluster creation defaults that an organization holds (#9732). */\nexport interface OrgClusterDefaultsResponse {\n defaults: ClusterCreationDefaults\n}\n\nexport interface LicensingModelRequest extends RequestBaseParams {\n params: {\n orgId: string\n licensingModel: LicensingModelType\n }\n}\n\nexport interface SendInviteRequest extends RequestBaseParams {\n params: {\n orgId: string\n email: string\n orgRoles: string[]\n }\n}\n\nexport interface CheckUserExistsForInviteRequest extends RequestBaseParams {\n params: {\n inviteToken: string\n }\n}\n\nexport interface CheckUserExistsForInviteResponse {\n userExists: boolean\n userVerified: boolean\n email: string\n}\n\nexport interface ChangeSalesPlanRequest extends RequestBaseParams {\n params: {\n orgId: string\n salesPlanId: string\n options?: {\n duration?: number\n includedValueMetrics?: EnterpriseIncludingValueMetrics\n enterpriseDevOnly?: boolean\n awsOnly?: boolean\n enterPriseStartDate?: string\n onboardOrgClusterMapping?: Array<{\n clusterId: string\n planTypeId: string\n numberOfAllocatedHwPackages?: number\n keepModification?: boolean\n }>\n force?: boolean\n salesForceId?: string\n licensingModel?: LicensingModelType\n /**\n * Months of Activity to keep, 0 keeps all. The org keeps its current\n * period when this is missing.\n */\n activityRetentionMonths?: ActivityRetentionMonths\n }\n }\n}\n\nexport interface ConvertTrialToInNegotiationRequest extends RequestBaseParams {\n params: {\n orgId: string\n salesPlanId: string\n }\n}\n\nexport interface AutomatedEnterpriseOnboardingRequest {\n orgName: string\n awsOnly?: boolean\n renewalTermInMonths?: number\n licensingModel?: LicensingModelType\n valueMetrics: EnterpriseIncludingValueMetrics\n startDate?: string\n sfdcId: string\n reservations: {\n basic: number\n standard: number\n advanced: number\n }\n ownerEmail: string\n /** Months of activity history. Accounts sets 0 (Not set) when this is missing. */\n activityRetentionMonths?: ActivityRetentionMonths\n}\n\nexport interface AutomatedEnterpriseOnboardingResult {\n orgIds: {\n production: string\n development: string\n }\n}\n\nexport interface DeleteOrganizationRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n headers?: {\n 'x-camunda-email'?: string\n }\n}\n\nexport interface SetBetaTermsAcceptedRequest extends RequestBaseParams {\n params: {\n orgId: string\n accepted: boolean\n }\n}\n\nexport interface GetLLMUsageInfoParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface LLMUsageInfoResponse {\n key: string\n team_id: string\n spend: number\n /** Absent for a key with no budget limit. */\n max_budget?: number\n budget_duration: string\n is_blocked?: boolean\n /**\n * Upstream that holds the key of this org: `litellm` or `openrouter`.\n *\n * Optional because an accounts backend from before the OpenRouter rollout\n * does not send it. Read an absent value as `litellm`.\n */\n provider?: LlmProviderName\n [key: string]: any\n}\n\nexport interface GetQueuedOperationsParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\n/**\n * A background operation still outstanding, or dead-lettered, for an org.\n *\n * Deliberately carries no payload: the backend projects an explicit field list\n * so a future operation type cannot leak anything sensitive through this route.\n */\nexport interface QueuedOperationDto {\n id: number\n operationType: string\n status: 'pending' | 'processing' | 'failed'\n attempts: number\n maxAttempts: number\n /** ISO timestamp of the next scheduled attempt. */\n nextRunAt: string\n lastError?: string\n createdAt: string\n updatedAt: string\n}\n\nexport interface IncreaseLLMBudgetParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface IncreaseLLMBudgetResponse {\n newBudget: number\n message: string\n}\n\nexport interface BlockLiteLLMParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface UnblockLiteLLMParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface OnboardLiteLLMParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\n/**\n * The org answer depends on the caller: only a machine caller that may read the\n * managed LLM key gets it. Thus an entry holds the token of the caller that it\n * was fetched for, and no other caller reads it.\n */\nconst orgCache = new Cache<string, { caller: string; org: OrganizationDto }>(\n 5 * MINUTE,\n)\nconst ownerCache = new Cache<\n string,\n {\n owner: string\n email: string\n first?: string\n last?: string\n }\n>(60 * MINUTE)\nconst memberCache = new Cache<string, User[]>(60 * MINUTE)\nconst rolesCache = new Cache<string, string[]>(60 * MINUTE)\n\nexport class OrgsService {\n public static async renameOrganization(\n params: RenameOrganizationRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.renameOrganization`,\n url: `api/organizations/${encodeURIComponent(params.params.orgId)}/`,\n normalizedUrl: `api/organizations/:orgId/`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n newOrgName: params.params.newOrgName,\n },\n responseType: 'none',\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 getDetailsForOrgs(\n params: RequestBaseParams & { orgIds: string[] },\n ): Promise<OrgInfo[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getDetailsForOrgs`,\n url: `api/organizations/orgInfos`,\n normalizedUrl: `api/organizations/orgInfos`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<OrgInfo[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n orgIds: params.orgIds,\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 getAllOrgs(\n params: RequestBaseParams,\n ): Promise<OrganizationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getAllOrgs`,\n url: `api/organizations`,\n normalizedUrl: `api/organizations`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<OrganizationDto[]>({\n ...params,\n base: { id: 'accounts' },\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 getMyOrgs(\n params: RequestBaseParams,\n ): Promise<OrganizationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getMyOrgs`,\n url: `api/organizations/my`,\n normalizedUrl: `api/organizations/my`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<OrganizationDto[]>({\n ...params,\n base: { id: 'accounts' },\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 return response.body!\n }\n\n public static async getOrgInfo(\n params: {\n orgUuid: string\n headers?: { [key: string]: string }\n } & RequestBaseParams,\n ) {\n // `encodeURIComponent` keeps `.` and `..`, and the URL parser resolves\n // them as dot segments, also when they are written as `%2E`.\n if (['', '.', '..'].includes(params.orgUuid)) {\n throw new Error(\n `OrgsService.getOrgInfo: the org id \"${params.orgUuid}\" is not valid`,\n )\n }\n\n // Without a token of `config.auth`, the caller may authenticate by header,\n // and the cache cannot tell the callers apart. Then it is not used.\n const caller = await params.config.auth?.getToken()\n if (caller && !params.cacheControl?.ignoreCache) {\n const inCache = orgCache.get(params.orgUuid)\n if (inCache?.caller === caller) {\n return inCache.org\n }\n }\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getOrgInfo`,\n url: `api/organizations/${encodeURIComponent(params.orgUuid)}`,\n normalizedUrl: `api/organizations/:orgUuid`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<OrganizationDto>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n headers: params.headers,\n // A read-only GET, so retrying is free of side effects. Without this, a\n // brief accounts blip (pod restart, envoy connection reset) is reported\n // as an error once *per org* by the callers that fan this out across a\n // whole org list \u2014 one transient failure became 25 ERROR lines in a\n // single console `cron.sleep` tick.\n retryTransientErrors: true,\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 (caller) {\n orgCache.set(params.orgUuid, { caller, org: response.body! })\n }\n return response.body\n }\n\n public static async getOwner(\n params: {\n orgUuid: string\n headers?: { [key: string]: string }\n } & RequestBaseParams,\n ): Promise<{ owner: string; email: string; first?: string; last?: string }> {\n if (!params.cacheControl?.ignoreCache) {\n const inCache = ownerCache.get(params.orgUuid)\n if (inCache) {\n return inCache\n }\n }\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getOwner`,\n url: `api/organizations/${params.orgUuid}/owner`,\n normalizedUrl: `api/organizations/:orgUuid/owner`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<{\n owner: string\n email: string\n first?: string\n last?: string\n }>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n headers: params.headers,\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 ownerCache.set(params.orgUuid, response.body!)\n return response.body!\n }\n public static async createAndReturnSocialLoginUser(\n params: {\n body: {\n userId: string\n ipAddress?: string\n inviteToken?: string\n campaign?: string\n utm_medium?: string\n utm_source?: string\n utm_term?: string\n utm_content?: string\n utm_campaign?: string\n utm_gclid?: string\n utm_ga_id?: string\n signupOrigin?: string\n }\n } & RequestBaseParams,\n ): Promise<{ orgId: string; invitation?: { successful: boolean } }> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.createAndReturnSocialLoginUser`,\n url: `api/onboarding/social`,\n normalizedUrl: `api/onboarding/social`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<{\n orgId: string\n invitation?: { successful: boolean }\n }>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\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 {\n orgId: response.body?.orgId ?? '',\n invitation: response.body?.invitation,\n }\n }\n\n public static async getUsersOfOrg(\n params: { orgUuid: string } & RequestBaseParams,\n ) {\n if (!params.cacheControl?.ignoreCache) {\n const inCache = memberCache.get(params.orgUuid)\n if (inCache) {\n return inCache\n }\n }\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getUsersOfOrg`,\n url: `api/organizations/${params.orgUuid}/users`,\n normalizedUrl: `api/organizations/:orgUuid/users`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<User[]>({\n ...params,\n base: { id: 'accounts' },\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 memberCache.set(params.orgUuid, response.body!)\n return response.body\n }\n\n public static async getAllRoles(params: RequestBaseParams) {\n if (!params.cacheControl?.ignoreCache) {\n const inCache = rolesCache.get('roles')\n if (inCache) {\n return inCache\n }\n }\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getAllRoles`,\n url: `api/roles`,\n normalizedUrl: `api/roles`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<string[]>({\n ...params,\n base: { id: 'accounts' },\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 rolesCache.set('roles', response.body!)\n return response.body\n }\n\n public static async getNamesAndSalesplansForOrgs(\n params: { orgIds: string[] } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getAllOrgs`,\n url: `api/organizations/snowflake/getNamesAndSalesplansForOrgs`,\n normalizedUrl: `api/organizations/snowflake/getNamesAndSalesplansForOrgs`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<OrgWithNameAndSalesPlan[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n orgIds: params.orgIds,\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 markOrgHasAlreadyCreatedTemporaryCluster(\n params: { orgUuid: string } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.markOrgHasAlreadyCreatedTemporaryCluster`,\n url: `api/organizations/snowflake/${params.orgUuid}/markOrgHasAlreadyCreatedTemporaryCluster`,\n normalizedUrl: `api/organizations/snowflake/:orgUuid/markOrgHasAlreadyCreatedTemporaryCluster`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\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 setSalesForceId(\n params: { orgUuid: string; salesForceId: string } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setSalesForceId`,\n url: `api/organizations/${params.orgUuid}/salesForceId`,\n normalizedUrl: `api/organizations/:orgUuid/salesForceId`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n salesForceId: params.salesForceId,\n },\n responseType: 'none',\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 setLimit(params: SetLimitRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setLimit`,\n url: `api/organizations/${params.params.orgId}/limits/${params.params.limitKey}`,\n normalizedUrl: `api/organizations/:orgId/limits/:limitKey`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n value: params.params.limitValue,\n onBehalfOf: params.params.onBehalfOf,\n },\n responseType: 'none',\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 /** Owner only. The route answers 403 for any other role, 404 with the flag off. */\n public static async updateActivityRetention(\n params: UpdateActivityRetentionRequest,\n ): Promise<UpdateActivityRetentionResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateActivityRetention`,\n url: `api/organizations/${params.params.orgId}/activity-retention`,\n normalizedUrl: `api/organizations/:orgId/activity-retention`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<UpdateActivityRetentionResponse>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: { months: params.params.months },\n }).finally(() => {\n // The route can store the period and still fail, so drop the cached org\n // on every outcome. Otherwise `getOrgInfo` shows the old period.\n orgCache.delete(params.params.orgId)\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 updateSuppressDropDisks(\n params: UpdateSuppressDropDisksRequest,\n ): Promise<UpdateSuppressDropDisksResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateSuppressDropDisks`,\n url: `api/organizations/${params.params.orgId}/billing/limits/suppressDropDisks`,\n normalizedUrl: `api/organizations/:orgId/billing/limits/suppressDropDisks`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<UpdateSuppressDropDisksResponse>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n value: params.params.value,\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 updateOrgLimitAsMember(\n params: UpdateOrgLimitAsMemberRequest,\n ): Promise<UpdateOrgLimitAsMemberResponse> {\n const { orgId, limitKey, value } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateOrgLimitAsMember`,\n url: `api/organizations/${orgId}/billing/limits/${limitKey}`,\n normalizedUrl: `api/organizations/:orgId/billing/limits/:limitKey`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<UpdateOrgLimitAsMemberResponse>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n // The route removes the limit on `null`. JSON has no `undefined`.\n body: { value: value ?? null },\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 extendTrial(params: ExtendTrialRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.extendTrial`,\n url: `api/organizations/${params.params.orgId}/extendtrial`,\n normalizedUrl: `api/organizations/:orgId/extendtrial`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n newExpireDate: params.params.newExpireDate,\n onBehalfOf: params.params.onBehalfOf,\n },\n responseType: 'none',\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 selfExtendTrial(params: SelfExtendTrialRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.selfExtendTrial`,\n url: `api/organizations/${params.params.orgId}/self-extend-trial`,\n normalizedUrl: `api/organizations/:orgId/self-extend-trial`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n surveyAnswers: params.params.surveyAnswers ?? [],\n researchConsent: params.params.researchConsent,\n },\n responseType: 'none',\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 resetTrialExtensions(\n params: ResetTrialExtensionsRequest,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.resetTrialExtensions`,\n url: `api/organizations/${params.params.orgId}/reset-trial-extensions`,\n normalizedUrl: `api/organizations/:orgId/reset-trial-extensions`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\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 /** Send an org's trial to expired immediately (enterprise admin action). */\n public static async setToExpiredTrial(\n params: { params: { orgId: string } } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setToExpiredTrial`,\n url: `api/organizations/${params.params.orgId}/expiretrial`,\n normalizedUrl: `api/organizations/:orgId/expiretrial`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {},\n responseType: 'none',\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 * Modify an enterprise org's contract metadata (duration, start date,\n * included value metrics) \u2014 `PATCH api/organizations/:orgId/enterprise`.\n */\n public static async updateEnterpriseMetadata(\n params: {\n params: { orgId: string }\n body: {\n contractDurationInMonths?: number\n startDate?: string\n valueMetrics?: Partial<EnterpriseIncludingValueMetrics>\n }\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateEnterpriseMetadata`,\n url: `api/organizations/${params.params.orgId}/enterprise`,\n normalizedUrl: `api/organizations/:orgId/enterprise`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\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 /** Remove an org's LiteLLM (managed LLM) connection. */\n public static async deleteLiteLLM(\n params: { params: { orgId: string } } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.deleteLiteLLM`,\n url: `api/organizations/${params.params.orgId}/litellm`,\n normalizedUrl: `api/organizations/:orgId/litellm`,\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * The cluster creation defaults of an organization (#9732). An empty\n * `defaults` object means that a new cluster starts with the values of the\n * console backend.\n *\n * The route serves Control and the organization itself; the caller needs\n * `org.settings.read` on the organization, or the read-all permission of\n * accounts.\n */\n public static async getOrgClusterDefaults(\n params: OrgClusterDefaultsRequest,\n ): Promise<OrgClusterDefaultsResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getOrgClusterDefaults`,\n url: `api/organizations/${params.params.orgId}/cluster-defaults`,\n normalizedUrl: `api/organizations/:orgId/cluster-defaults`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request<OrgClusterDefaultsResponse>({\n config: params.config,\n base: { id: 'accounts' },\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 return response.body ?? { defaults: {} }\n }\n\n /**\n * Replace the cluster creation defaults of an organization. A field that\n * the body does not hold is no longer a default.\n *\n * The route refuses a field that the caller may not write: an organization\n * writes the fields of the availability `customer` alone.\n */\n public static async updateOrgClusterDefaults(\n params: UpdateOrgClusterDefaultsRequest,\n ): Promise<OrgClusterDefaultsResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateOrgClusterDefaults`,\n url: `api/organizations/${params.params.orgId}/cluster-defaults`,\n normalizedUrl: `api/organizations/:orgId/cluster-defaults`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request<OrgClusterDefaultsResponse>({\n config: params.config,\n base: { id: 'accounts' },\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 return response.body ?? { defaults: params.body.defaults }\n }\n\n public static async setAwsOnly(params: AwsOnlyRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setAwsOnly`,\n url: `api/organizations/${params.params.orgId}/awsOnly`,\n normalizedUrl: `api/organizations/:orgId/awsOnly`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n awsOnly: params.params.awsOnly,\n },\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 setEnterpriseDevOnly(params: EnterpriseDevOnlyRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setEnterpriseDevOnly`,\n url: `api/organizations/${params.params.orgId}/enterprise-dev`,\n normalizedUrl: `api/organizations/:orgId/enterprise-dev`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n enterpriseDevOnly: params.params.enterpriseDevOnly,\n },\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 setLicensingModel(params: LicensingModelRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setLicensingModel`,\n url: `api/organizations/${params.params.orgId}/licensing-model`,\n normalizedUrl: `api/organizations/:orgId/licensing-model`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n licensingModel: params.params.licensingModel,\n },\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 changeSalesPlan(params: ChangeSalesPlanRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.changeSalesPlan`,\n url: `api/organizations/${params.params.orgId}/salesplan/${params.params.salesPlanId}`,\n normalizedUrl: `api/organizations/:orgId/salesplan/:salesPlanId`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<any>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.params.options ?? {},\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 convertTrialToInNegotiation(\n params: ConvertTrialToInNegotiationRequest,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.convertTrialToInNegotiation`,\n url: `api/organizations/${params.params.orgId}/trial-to-in-negotiation/${params.params.salesPlanId}`,\n normalizedUrl: `api/organizations/:orgId/trial-to-in-negotiation/:salesPlanId`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<{ success: boolean }>({\n config: params.config,\n base: { id: 'accounts' },\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 return response.body\n }\n\n public static async sendInvite(params: SendInviteRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.sendInvite`,\n url: `api/organizations/${params.params.orgId}/invites`,\n normalizedUrl: `api/organizations/:orgId/invites`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n email: params.params.email,\n orgRoles: params.params.orgRoles,\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\n }\n\n public static async checkUserExistsForInvite(\n params: CheckUserExistsForInviteRequest,\n ): Promise<CheckUserExistsForInviteResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.checkUserExistsForInvite`,\n url: `verification/invitation/${params.params.inviteToken}/check-user-exists`,\n normalizedUrl: `verification/invitation/:inviteToken/check-user-exists`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<CheckUserExistsForInviteResponse>({\n config: params.config,\n base: { id: 'accounts' },\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 return response.body!\n }\n\n public static async automatedEnterpriseOnboarding(\n params: AutomatedEnterpriseOnboardingRequest & RequestBaseParams,\n ): Promise<AutomatedEnterpriseOnboardingResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.automatedEnterpriseOnboarding`,\n url: `external/onboarding`,\n normalizedUrl: `external/onboarding`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<AutomatedEnterpriseOnboardingResult>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n orgName: params.orgName,\n awsOnly: params.awsOnly,\n renewalTermInMonths: params.renewalTermInMonths,\n licensingModel: params.licensingModel,\n valueMetrics: params.valueMetrics,\n startDate: params.startDate,\n sfdcId: params.sfdcId,\n reservations: params.reservations,\n ownerEmail: params.ownerEmail,\n activityRetentionMonths: params.activityRetentionMonths,\n },\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 setBetaTermsAccepted(\n params: SetBetaTermsAcceptedRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.setBetaTermsAccepted',\n url: `api/organizations/${encodeURIComponent(params.params.orgId)}/betaTerms`,\n normalizedUrl: 'api/organizations/:orgId/betaTerms',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n accepted: params.params.accepted,\n },\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 * Delete an organization.\n *\n * The caller's own bearer token authenticates the request. Cloudbot can\n * also add `params.headers['x-camunda-email']` on top of its own M2M\n * bearer token, to act on behalf of the named human. Accounts-backend's\n * `emailBasedAuthMiddleware` rejects that header from every other caller \u2014\n * it does not replace the bearer token.\n */\n public static async deleteOrganization(\n params: DeleteOrganizationRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.deleteOrganization`,\n url: `api/organizations/${params.params.orgId}`,\n normalizedUrl: `api/organizations/:orgId`,\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n headers: params.headers,\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 * Create an organization (admin `createOrg`). Mirrors `POST api/organizations/`\n * \u2014 `internal` seeds an internal plan, otherwise a trial plan. Returns the new\n * org so the caller can navigate to it.\n */\n public static async createOrganization(\n params: RequestBaseParams & { name: string; internal?: boolean },\n ): Promise<{ uuid: string; name: string }> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.createOrganization`,\n url: `api/organizations`,\n normalizedUrl: `api/organizations`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<{ uuid: string; name: string }>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: { name: params.name, internal: params.internal ?? false },\n responseType: 'json',\n })\n\n if (!response.ok || !response.body) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async setAutoJoin(\n params: RequestBaseParams & {\n orgId: string\n autoJoin: AutoJoinAssignment\n },\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setAutoJoin`,\n url: `api/organizations/${params.orgId}/auto-join`,\n normalizedUrl: `api/organizations/:orgId/auto-join`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n autoJoin: params.autoJoin,\n },\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 return response.body!\n }\n\n /**\n * Background operations outstanding or dead-lettered for an org \u2014 the\n * support-facing view of the durable operation queue.\n */\n public static async getQueuedOperations(\n params: GetQueuedOperationsParams,\n ): Promise<QueuedOperationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.getQueuedOperations',\n url: `api/organizations/${params.params.orgId}/queued-operations`,\n normalizedUrl: 'api/organizations/:orgId/queued-operations',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<QueuedOperationDto[]>({\n ...params,\n base: { id: 'accounts' },\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 getLLMUsageInfo(\n params: GetLLMUsageInfoParams,\n ): Promise<LLMUsageInfoResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.getLLMUsageInfo',\n url: `api/organizations/${params.params.orgId}/llm/info`,\n normalizedUrl: 'api/organizations/:orgId/llm/info',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<LLMUsageInfoResponse>({\n ...params,\n base: { id: 'accounts' },\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 return response.body!\n }\n\n public static async increaseLLMBudget(\n params: IncreaseLLMBudgetParams,\n ): Promise<IncreaseLLMBudgetResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.increaseLLMBudget',\n url: `api/organizations/${params.params.orgId}/litellm/increase-budget`,\n normalizedUrl: 'api/organizations/:orgId/litellm/increase-budget',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<IncreaseLLMBudgetResponse>({\n ...params,\n base: { id: 'accounts' },\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 return response.body!\n }\n\n public static async blockLiteLLM(params: BlockLiteLLMParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.blockLiteLLM',\n url: `api/organizations/${params.params.orgId}/litellm/block`,\n normalizedUrl: 'api/organizations/:orgId/litellm/block',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'accounts' },\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 unblockLiteLLM(\n params: UnblockLiteLLMParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.unblockLiteLLM',\n url: `api/organizations/${params.params.orgId}/litellm/unblock`,\n normalizedUrl: 'api/organizations/:orgId/litellm/unblock',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'accounts' },\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 onboardLiteLLM(\n params: OnboardLiteLLMParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.onboardLiteLLM',\n url: `api/organizations/${params.params.orgId}/litellm/onboard`,\n normalizedUrl: 'api/organizations/:orgId/litellm/onboard',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'accounts' },\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"],
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 {\n type ActivityRetentionMonths,\n type AutoJoinAssignment,\n type ClusterCreationDefaults,\n type EnterpriseIncludingValueMetrics,\n type LicensingModelType,\n type Limits,\n type LlmProviderName,\n MINUTE,\n type OrganizationDto,\n type OrgWithNameAndSalesPlan,\n type User,\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 { Cache } from '../../utils/cache.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface GetSubscriptionItemsParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface GetSubscriptionDetailsParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface GetSubscriptionDetailsResponse {\n status: string\n currentContractTermEnd: number\n}\n\nexport interface OrgInfo {\n orgUuid: string\n name: string\n salesPlanUuid?: string\n salesForceProjectId?: string\n}\n\nexport interface SetLimitRequest extends RequestBaseParams {\n params: {\n orgId: string\n onBehalfOf: string\n limitKey: string\n limitValue: string | null\n }\n}\n\nexport interface UpdateSuppressDropDisksRequest extends RequestBaseParams {\n params: {\n orgId: string\n value: boolean\n }\n}\n\n/**\n * A limit that an org member can change on the member route. The admin route\n * (`setLimit`) takes every limit.\n */\nexport interface UpdateOrgLimitAsMemberRequest extends RequestBaseParams {\n params:\n | {\n orgId: string\n limitKey: 'preprodClusterTtlHours'\n /** `undefined` removes the limit from the org. */\n value: number | undefined\n }\n | {\n orgId: string\n limitKey: 'clusterPlanWhiteList'\n /** Comma-joined plan uuids. `undefined` removes the limit. */\n value: string | undefined\n }\n}\n\nexport interface UpdateOrgLimitAsMemberResponse {\n newLimits: Limits\n}\n\nexport interface UpdateSuppressDropDisksResponse {\n newLimits: {\n suppressDropDisks?: boolean\n [key: string]: any\n }\n}\n\nexport interface UpdateActivityRetentionRequest extends RequestBaseParams {\n params: {\n orgId: string\n months: ActivityRetentionMonths\n }\n}\n\nexport interface UpdateActivityRetentionResponse {\n activityRetentionMonths: number\n}\n\nexport interface RenameOrganizationRequest extends RequestBaseParams {\n params: {\n orgId: string\n newOrgName: string\n }\n}\n\nexport interface ExtendTrialRequest extends RequestBaseParams {\n params: {\n orgId: string\n onBehalfOf: string\n newExpireDate: string\n }\n}\n\nexport interface SelfExtendTrialRequest extends RequestBaseParams {\n params: {\n orgId: string\n surveyAnswers?: import('@camunda/ccma-shared-types').TrialExtensionSurveyAnswer[]\n researchConsent?: boolean\n }\n}\n\nexport interface ResetTrialExtensionsRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface EnterpriseDevOnlyRequest extends RequestBaseParams {\n params: {\n orgId: string\n enterpriseDevOnly: boolean\n }\n}\n\nexport interface AwsOnlyRequest extends RequestBaseParams {\n params: {\n orgId: string\n awsOnly: boolean\n }\n}\n\nexport interface OrgClusterDefaultsRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface UpdateOrgClusterDefaultsRequest\n extends OrgClusterDefaultsRequest {\n body: {\n defaults: ClusterCreationDefaults\n }\n}\n\n/** The cluster creation defaults that an organization holds (#9732). */\nexport interface OrgClusterDefaultsResponse {\n defaults: ClusterCreationDefaults\n}\n\nexport interface LicensingModelRequest extends RequestBaseParams {\n params: {\n orgId: string\n licensingModel: LicensingModelType\n }\n}\n\nexport interface SendInviteRequest extends RequestBaseParams {\n params: {\n orgId: string\n email: string\n orgRoles: string[]\n }\n}\n\nexport interface CheckUserExistsForInviteRequest extends RequestBaseParams {\n params: {\n inviteToken: string\n }\n}\n\nexport interface CheckUserExistsForInviteResponse {\n userExists: boolean\n userVerified: boolean\n email: string\n}\n\nexport interface ChangeSalesPlanRequest extends RequestBaseParams {\n params: {\n orgId: string\n salesPlanId: string\n options?: {\n duration?: number\n includedValueMetrics?: EnterpriseIncludingValueMetrics\n enterpriseDevOnly?: boolean\n awsOnly?: boolean\n enterPriseStartDate?: string\n onboardOrgClusterMapping?: Array<{\n clusterId: string\n planTypeId: string\n numberOfAllocatedHwPackages?: number\n keepModification?: boolean\n }>\n force?: boolean\n salesForceId?: string\n licensingModel?: LicensingModelType\n /**\n * Months of Activity to keep, 0 keeps all. The org keeps its current\n * period when this is missing.\n */\n activityRetentionMonths?: ActivityRetentionMonths\n }\n }\n}\n\nexport interface ConvertTrialToInNegotiationRequest extends RequestBaseParams {\n params: {\n orgId: string\n salesPlanId: string\n }\n}\n\nexport interface AutomatedEnterpriseOnboardingRequest {\n orgName: string\n awsOnly?: boolean\n renewalTermInMonths?: number\n licensingModel?: LicensingModelType\n valueMetrics: EnterpriseIncludingValueMetrics\n startDate?: string\n sfdcId: string\n reservations: {\n basic: number\n standard: number\n advanced: number\n }\n ownerEmail: string\n /** Months of activity history. Accounts sets 0 (Not set) when this is missing. */\n activityRetentionMonths?: ActivityRetentionMonths\n}\n\nexport interface AutomatedEnterpriseOnboardingResult {\n orgIds: {\n production: string\n development: string\n }\n}\n\nexport interface DeleteOrganizationRequest extends RequestBaseParams {\n params: {\n orgId: string\n }\n headers?: {\n 'x-camunda-email'?: string\n }\n}\n\nexport interface SetBetaTermsAcceptedRequest extends RequestBaseParams {\n params: {\n orgId: string\n accepted: boolean\n }\n}\n\nexport interface GetLLMUsageInfoParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface LLMUsageInfoResponse {\n key: string\n team_id: string\n spend: number\n /** Absent for a key with no budget limit. */\n max_budget?: number\n budget_duration: string\n is_blocked?: boolean\n /**\n * Upstream that holds the key of this org: `litellm` or `openrouter`.\n *\n * Optional because an accounts backend from before the OpenRouter rollout\n * does not send it. Read an absent value as `litellm`.\n */\n provider?: LlmProviderName\n [key: string]: any\n}\n\nexport interface GetQueuedOperationsParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\n/**\n * A background operation still outstanding, or dead-lettered, for an org.\n *\n * Deliberately carries no payload: the backend projects an explicit field list\n * so a future operation type cannot leak anything sensitive through this route.\n */\nexport interface QueuedOperationDto {\n id: number\n operationType: string\n status: 'pending' | 'processing' | 'failed'\n attempts: number\n maxAttempts: number\n /** ISO timestamp of the next scheduled attempt. */\n nextRunAt: string\n lastError?: string\n createdAt: string\n updatedAt: string\n}\n\nexport interface IncreaseLLMBudgetParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface IncreaseLLMBudgetResponse {\n newBudget: number\n message: string\n}\n\nexport interface BlockLiteLLMParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface UnblockLiteLLMParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface OnboardLiteLLMParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\n/**\n * The org answer depends on the caller: only a machine caller that may read the\n * managed LLM key gets it. Thus an entry holds the token of the caller that it\n * was fetched for, and no other caller reads it.\n */\nconst orgCache = new Cache<string, { caller: string; org: OrganizationDto }>(\n 5 * MINUTE,\n)\nconst ownerCache = new Cache<\n string,\n {\n owner: string\n email: string\n first?: string\n last?: string\n }\n>(60 * MINUTE)\nconst memberCache = new Cache<string, User[]>(60 * MINUTE)\nconst rolesCache = new Cache<string, string[]>(60 * MINUTE)\n\nexport class OrgsService {\n public static async renameOrganization(\n params: RenameOrganizationRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.renameOrganization`,\n url: `api/organizations/${encodeURIComponent(params.params.orgId)}/`,\n normalizedUrl: `api/organizations/:orgId/`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n newOrgName: params.params.newOrgName,\n },\n responseType: 'none',\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 getDetailsForOrgs(\n params: RequestBaseParams & { orgIds: string[] },\n ): Promise<OrgInfo[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getDetailsForOrgs`,\n url: `api/organizations/orgInfos`,\n normalizedUrl: `api/organizations/orgInfos`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<OrgInfo[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n orgIds: params.orgIds,\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 getAllOrgs(\n params: RequestBaseParams,\n ): Promise<OrganizationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getAllOrgs`,\n url: `api/organizations`,\n normalizedUrl: `api/organizations`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<OrganizationDto[]>({\n ...params,\n base: { id: 'accounts' },\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 getMyOrgs(\n params: RequestBaseParams,\n ): Promise<OrganizationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getMyOrgs`,\n url: `api/organizations/my`,\n normalizedUrl: `api/organizations/my`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<OrganizationDto[]>({\n ...params,\n base: { id: 'accounts' },\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 return response.body!\n }\n\n public static async getOrgInfo(\n params: {\n orgUuid: string\n headers?: { [key: string]: string }\n } & RequestBaseParams,\n ) {\n // `encodeURIComponent` keeps `.` and `..`, and the URL parser resolves\n // them as dot segments, also when they are written as `%2E`.\n if (['', '.', '..'].includes(params.orgUuid)) {\n throw new Error(\n `OrgsService.getOrgInfo: the org id \"${params.orgUuid}\" is not valid`,\n )\n }\n\n // Without a token of `config.auth`, the caller may authenticate by header,\n // and the cache cannot tell the callers apart. Then it is not used.\n const caller = await params.config.auth?.getToken()\n if (caller && !params.cacheControl?.ignoreCache) {\n const inCache = orgCache.get(params.orgUuid)\n if (inCache?.caller === caller) {\n return inCache.org\n }\n }\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getOrgInfo`,\n url: `api/organizations/${encodeURIComponent(params.orgUuid)}`,\n normalizedUrl: `api/organizations/:orgUuid`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<OrganizationDto>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n headers: params.headers,\n // A read-only GET, so retrying is free of side effects. Without this, a\n // brief accounts blip (pod restart, envoy connection reset) is reported\n // as an error once *per org* by the callers that fan this out across a\n // whole org list \u2014 one transient failure became 25 ERROR lines in a\n // single console `cron.sleep` tick.\n retryTransientErrors: true,\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 (caller) {\n orgCache.set(params.orgUuid, { caller, org: response.body! })\n }\n return response.body\n }\n\n public static async getOwner(\n params: {\n orgUuid: string\n headers?: { [key: string]: string }\n } & RequestBaseParams,\n ): Promise<{ owner: string; email: string; first?: string; last?: string }> {\n if (!params.cacheControl?.ignoreCache) {\n const inCache = ownerCache.get(params.orgUuid)\n if (inCache) {\n return inCache\n }\n }\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getOwner`,\n url: `api/organizations/${params.orgUuid}/owner`,\n normalizedUrl: `api/organizations/:orgUuid/owner`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<{\n owner: string\n email: string\n first?: string\n last?: string\n }>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n headers: params.headers,\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 ownerCache.set(params.orgUuid, response.body!)\n return response.body!\n }\n public static async createAndReturnSocialLoginUser(\n params: {\n body: {\n userId: string\n ipAddress?: string\n inviteToken?: string\n campaign?: string\n utm_medium?: string\n utm_source?: string\n utm_term?: string\n utm_content?: string\n utm_campaign?: string\n utm_gclid?: string\n utm_ga_id?: string\n signupOrigin?: string\n }\n } & RequestBaseParams,\n ): Promise<{ orgId: string; invitation?: { successful: boolean } }> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.createAndReturnSocialLoginUser`,\n url: `api/onboarding/social`,\n normalizedUrl: `api/onboarding/social`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<{\n orgId: string\n invitation?: { successful: boolean }\n }>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\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 {\n orgId: response.body?.orgId ?? '',\n invitation: response.body?.invitation,\n }\n }\n\n public static async getUsersOfOrg(\n params: { orgUuid: string } & RequestBaseParams,\n ) {\n if (!params.cacheControl?.ignoreCache) {\n const inCache = memberCache.get(params.orgUuid)\n if (inCache) {\n return inCache\n }\n }\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getUsersOfOrg`,\n url: `api/organizations/${params.orgUuid}/users`,\n normalizedUrl: `api/organizations/:orgUuid/users`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<User[]>({\n ...params,\n base: { id: 'accounts' },\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 memberCache.set(params.orgUuid, response.body!)\n return response.body\n }\n\n public static async getAllRoles(params: RequestBaseParams) {\n if (!params.cacheControl?.ignoreCache) {\n const inCache = rolesCache.get('roles')\n if (inCache) {\n return inCache\n }\n }\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getAllRoles`,\n url: `api/roles`,\n normalizedUrl: `api/roles`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<string[]>({\n ...params,\n base: { id: 'accounts' },\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 rolesCache.set('roles', response.body!)\n return response.body\n }\n\n public static async getNamesAndSalesplansForOrgs(\n params: { orgIds: string[] } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getAllOrgs`,\n url: `api/organizations/snowflake/getNamesAndSalesplansForOrgs`,\n normalizedUrl: `api/organizations/snowflake/getNamesAndSalesplansForOrgs`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<OrgWithNameAndSalesPlan[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n orgIds: params.orgIds,\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 markOrgHasAlreadyCreatedTemporaryCluster(\n params: { orgUuid: string } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.markOrgHasAlreadyCreatedTemporaryCluster`,\n url: `api/organizations/snowflake/${params.orgUuid}/markOrgHasAlreadyCreatedTemporaryCluster`,\n normalizedUrl: `api/organizations/snowflake/:orgUuid/markOrgHasAlreadyCreatedTemporaryCluster`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\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 setSalesForceId(\n params: { orgUuid: string; salesForceId: string } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setSalesForceId`,\n url: `api/organizations/${params.orgUuid}/salesForceId`,\n normalizedUrl: `api/organizations/:orgUuid/salesForceId`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n salesForceId: params.salesForceId,\n },\n responseType: 'none',\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 setLimit(params: SetLimitRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setLimit`,\n url: `api/organizations/${params.params.orgId}/limits/${params.params.limitKey}`,\n normalizedUrl: `api/organizations/:orgId/limits/:limitKey`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n value: params.params.limitValue,\n onBehalfOf: params.params.onBehalfOf,\n },\n responseType: 'none',\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 /** Owner only. The route answers 403 for any other role. */\n public static async updateActivityRetention(\n params: UpdateActivityRetentionRequest,\n ): Promise<UpdateActivityRetentionResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateActivityRetention`,\n url: `api/organizations/${params.params.orgId}/activity-retention`,\n normalizedUrl: `api/organizations/:orgId/activity-retention`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<UpdateActivityRetentionResponse>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: { months: params.params.months },\n }).finally(() => {\n // The route can store the period and still fail, so drop the cached org\n // on every outcome. Otherwise `getOrgInfo` shows the old period.\n orgCache.delete(params.params.orgId)\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 updateSuppressDropDisks(\n params: UpdateSuppressDropDisksRequest,\n ): Promise<UpdateSuppressDropDisksResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateSuppressDropDisks`,\n url: `api/organizations/${params.params.orgId}/billing/limits/suppressDropDisks`,\n normalizedUrl: `api/organizations/:orgId/billing/limits/suppressDropDisks`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<UpdateSuppressDropDisksResponse>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n value: params.params.value,\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 updateOrgLimitAsMember(\n params: UpdateOrgLimitAsMemberRequest,\n ): Promise<UpdateOrgLimitAsMemberResponse> {\n const { orgId, limitKey, value } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateOrgLimitAsMember`,\n url: `api/organizations/${orgId}/billing/limits/${limitKey}`,\n normalizedUrl: `api/organizations/:orgId/billing/limits/:limitKey`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<UpdateOrgLimitAsMemberResponse>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n // The route removes the limit on `null`. JSON has no `undefined`.\n body: { value: value ?? null },\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 extendTrial(params: ExtendTrialRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.extendTrial`,\n url: `api/organizations/${params.params.orgId}/extendtrial`,\n normalizedUrl: `api/organizations/:orgId/extendtrial`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n newExpireDate: params.params.newExpireDate,\n onBehalfOf: params.params.onBehalfOf,\n },\n responseType: 'none',\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 selfExtendTrial(params: SelfExtendTrialRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.selfExtendTrial`,\n url: `api/organizations/${params.params.orgId}/self-extend-trial`,\n normalizedUrl: `api/organizations/:orgId/self-extend-trial`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n surveyAnswers: params.params.surveyAnswers ?? [],\n researchConsent: params.params.researchConsent,\n },\n responseType: 'none',\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 resetTrialExtensions(\n params: ResetTrialExtensionsRequest,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.resetTrialExtensions`,\n url: `api/organizations/${params.params.orgId}/reset-trial-extensions`,\n normalizedUrl: `api/organizations/:orgId/reset-trial-extensions`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\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 /** Send an org's trial to expired immediately (enterprise admin action). */\n public static async setToExpiredTrial(\n params: { params: { orgId: string } } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setToExpiredTrial`,\n url: `api/organizations/${params.params.orgId}/expiretrial`,\n normalizedUrl: `api/organizations/:orgId/expiretrial`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {},\n responseType: 'none',\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 * Modify an enterprise org's contract metadata (duration, start date,\n * included value metrics) \u2014 `PATCH api/organizations/:orgId/enterprise`.\n */\n public static async updateEnterpriseMetadata(\n params: {\n params: { orgId: string }\n body: {\n contractDurationInMonths?: number\n startDate?: string\n valueMetrics?: Partial<EnterpriseIncludingValueMetrics>\n }\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateEnterpriseMetadata`,\n url: `api/organizations/${params.params.orgId}/enterprise`,\n normalizedUrl: `api/organizations/:orgId/enterprise`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\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 /** Remove an org's LiteLLM (managed LLM) connection. */\n public static async deleteLiteLLM(\n params: { params: { orgId: string } } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.deleteLiteLLM`,\n url: `api/organizations/${params.params.orgId}/litellm`,\n normalizedUrl: `api/organizations/:orgId/litellm`,\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * The cluster creation defaults of an organization (#9732). An empty\n * `defaults` object means that a new cluster starts with the values of the\n * console backend.\n *\n * The route serves Control and the organization itself; the caller needs\n * `org.settings.read` on the organization, or the read-all permission of\n * accounts.\n */\n public static async getOrgClusterDefaults(\n params: OrgClusterDefaultsRequest,\n ): Promise<OrgClusterDefaultsResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.getOrgClusterDefaults`,\n url: `api/organizations/${params.params.orgId}/cluster-defaults`,\n normalizedUrl: `api/organizations/:orgId/cluster-defaults`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request<OrgClusterDefaultsResponse>({\n config: params.config,\n base: { id: 'accounts' },\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 return response.body ?? { defaults: {} }\n }\n\n /**\n * Replace the cluster creation defaults of an organization. A field that\n * the body does not hold is no longer a default.\n *\n * The route refuses a field that the caller may not write: an organization\n * writes the fields of the availability `customer` alone.\n */\n public static async updateOrgClusterDefaults(\n params: UpdateOrgClusterDefaultsRequest,\n ): Promise<OrgClusterDefaultsResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.updateOrgClusterDefaults`,\n url: `api/organizations/${params.params.orgId}/cluster-defaults`,\n normalizedUrl: `api/organizations/:orgId/cluster-defaults`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n const response = await request<OrgClusterDefaultsResponse>({\n config: params.config,\n base: { id: 'accounts' },\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 return response.body ?? { defaults: params.body.defaults }\n }\n\n public static async setAwsOnly(params: AwsOnlyRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setAwsOnly`,\n url: `api/organizations/${params.params.orgId}/awsOnly`,\n normalizedUrl: `api/organizations/:orgId/awsOnly`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n awsOnly: params.params.awsOnly,\n },\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 setEnterpriseDevOnly(params: EnterpriseDevOnlyRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setEnterpriseDevOnly`,\n url: `api/organizations/${params.params.orgId}/enterprise-dev`,\n normalizedUrl: `api/organizations/:orgId/enterprise-dev`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n enterpriseDevOnly: params.params.enterpriseDevOnly,\n },\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 setLicensingModel(params: LicensingModelRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setLicensingModel`,\n url: `api/organizations/${params.params.orgId}/licensing-model`,\n normalizedUrl: `api/organizations/:orgId/licensing-model`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n licensingModel: params.params.licensingModel,\n },\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 changeSalesPlan(params: ChangeSalesPlanRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.changeSalesPlan`,\n url: `api/organizations/${params.params.orgId}/salesplan/${params.params.salesPlanId}`,\n normalizedUrl: `api/organizations/:orgId/salesplan/:salesPlanId`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<any>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.params.options ?? {},\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 convertTrialToInNegotiation(\n params: ConvertTrialToInNegotiationRequest,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.convertTrialToInNegotiation`,\n url: `api/organizations/${params.params.orgId}/trial-to-in-negotiation/${params.params.salesPlanId}`,\n normalizedUrl: `api/organizations/:orgId/trial-to-in-negotiation/:salesPlanId`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<{ success: boolean }>({\n config: params.config,\n base: { id: 'accounts' },\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 return response.body\n }\n\n public static async sendInvite(params: SendInviteRequest) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.sendInvite`,\n url: `api/organizations/${params.params.orgId}/invites`,\n normalizedUrl: `api/organizations/:orgId/invites`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n email: params.params.email,\n orgRoles: params.params.orgRoles,\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\n }\n\n public static async checkUserExistsForInvite(\n params: CheckUserExistsForInviteRequest,\n ): Promise<CheckUserExistsForInviteResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.checkUserExistsForInvite`,\n url: `verification/invitation/${params.params.inviteToken}/check-user-exists`,\n normalizedUrl: `verification/invitation/:inviteToken/check-user-exists`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<CheckUserExistsForInviteResponse>({\n config: params.config,\n base: { id: 'accounts' },\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 return response.body!\n }\n\n public static async automatedEnterpriseOnboarding(\n params: AutomatedEnterpriseOnboardingRequest & RequestBaseParams,\n ): Promise<AutomatedEnterpriseOnboardingResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.automatedEnterpriseOnboarding`,\n url: `external/onboarding`,\n normalizedUrl: `external/onboarding`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<AutomatedEnterpriseOnboardingResult>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n orgName: params.orgName,\n awsOnly: params.awsOnly,\n renewalTermInMonths: params.renewalTermInMonths,\n licensingModel: params.licensingModel,\n valueMetrics: params.valueMetrics,\n startDate: params.startDate,\n sfdcId: params.sfdcId,\n reservations: params.reservations,\n ownerEmail: params.ownerEmail,\n activityRetentionMonths: params.activityRetentionMonths,\n },\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 setBetaTermsAccepted(\n params: SetBetaTermsAcceptedRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.setBetaTermsAccepted',\n url: `api/organizations/${encodeURIComponent(params.params.orgId)}/betaTerms`,\n normalizedUrl: 'api/organizations/:orgId/betaTerms',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n accepted: params.params.accepted,\n },\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 * Delete an organization.\n *\n * The caller's own bearer token authenticates the request. Cloudbot can\n * also add `params.headers['x-camunda-email']` on top of its own M2M\n * bearer token, to act on behalf of the named human. Accounts-backend's\n * `emailBasedAuthMiddleware` rejects that header from every other caller \u2014\n * it does not replace the bearer token.\n */\n public static async deleteOrganization(\n params: DeleteOrganizationRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.deleteOrganization`,\n url: `api/organizations/${params.params.orgId}`,\n normalizedUrl: `api/organizations/:orgId`,\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n headers: params.headers,\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 * Create an organization (admin `createOrg`). Mirrors `POST api/organizations/`\n * \u2014 `internal` seeds an internal plan, otherwise a trial plan. Returns the new\n * org so the caller can navigate to it.\n */\n public static async createOrganization(\n params: RequestBaseParams & { name: string; internal?: boolean },\n ): Promise<{ uuid: string; name: string }> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.createOrganization`,\n url: `api/organizations`,\n normalizedUrl: `api/organizations`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<{ uuid: string; name: string }>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: { name: params.name, internal: params.internal ?? false },\n responseType: 'json',\n })\n\n if (!response.ok || !response.body) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async setAutoJoin(\n params: RequestBaseParams & {\n orgId: string\n autoJoin: AutoJoinAssignment\n },\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `OrgsService.setAutoJoin`,\n url: `api/organizations/${params.orgId}/auto-join`,\n normalizedUrl: `api/organizations/:orgId/auto-join`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n autoJoin: params.autoJoin,\n },\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 return response.body!\n }\n\n /**\n * Background operations outstanding or dead-lettered for an org \u2014 the\n * support-facing view of the durable operation queue.\n */\n public static async getQueuedOperations(\n params: GetQueuedOperationsParams,\n ): Promise<QueuedOperationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.getQueuedOperations',\n url: `api/organizations/${params.params.orgId}/queued-operations`,\n normalizedUrl: 'api/organizations/:orgId/queued-operations',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<QueuedOperationDto[]>({\n ...params,\n base: { id: 'accounts' },\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 getLLMUsageInfo(\n params: GetLLMUsageInfoParams,\n ): Promise<LLMUsageInfoResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.getLLMUsageInfo',\n url: `api/organizations/${params.params.orgId}/llm/info`,\n normalizedUrl: 'api/organizations/:orgId/llm/info',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<LLMUsageInfoResponse>({\n ...params,\n base: { id: 'accounts' },\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 return response.body!\n }\n\n public static async increaseLLMBudget(\n params: IncreaseLLMBudgetParams,\n ): Promise<IncreaseLLMBudgetResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.increaseLLMBudget',\n url: `api/organizations/${params.params.orgId}/litellm/increase-budget`,\n normalizedUrl: 'api/organizations/:orgId/litellm/increase-budget',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<IncreaseLLMBudgetResponse>({\n ...params,\n base: { id: 'accounts' },\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 return response.body!\n }\n\n public static async blockLiteLLM(params: BlockLiteLLMParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.blockLiteLLM',\n url: `api/organizations/${params.params.orgId}/litellm/block`,\n normalizedUrl: 'api/organizations/:orgId/litellm/block',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'accounts' },\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 unblockLiteLLM(\n params: UnblockLiteLLMParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.unblockLiteLLM',\n url: `api/organizations/${params.params.orgId}/litellm/unblock`,\n normalizedUrl: 'api/organizations/:orgId/litellm/unblock',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'accounts' },\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 onboardLiteLLM(\n params: OnboardLiteLLMParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'OrgsService.onboardLiteLLM',\n url: `api/organizations/${params.params.orgId}/litellm/onboard`,\n normalizedUrl: 'api/organizations/:orgId/litellm/onboard',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'accounts',\n type: 'internal',\n },\n }\n\n const response = await request<void>({\n ...params,\n base: { id: 'accounts' },\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
5
  "mappings": "AAMA;AAAA,EAQE;AAAA,OAIK;AAKP,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,iBAAiB;AA2U1B,MAAM,WAAW,IAAI;AAAA,EACnB,IAAI;AACN;AACA,MAAM,aAAa,IAAI,MAQrB,KAAK,MAAM;AACb,MAAM,cAAc,IAAI,MAAsB,KAAK,MAAM;AACzD,MAAM,aAAa,IAAI,MAAwB,KAAK,MAAM;AAEnD,MAAM,YAAY;AAAA,EACvB,aAAoB,mBAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,qBAAqB,mBAAmB,OAAO,OAAO,KAAK,CAAC;AAAA,QACjE,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AACA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,WAAW;AAAA,MACvB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,MAAM;AAAA,QACJ,YAAY,OAAO,OAAO;AAAA,MAC5B;AAAA,MACA,cAAc;AAAA,IAChB,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;A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MACR;AAAA,IACF;AAEA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,WAAW;AAAA,MACvB,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
  }
@@ -19,12 +19,51 @@ export interface SetTwoPhaseUpgradeModeParams extends TwoPhaseUpgradeParams {
19
19
  mode: TwoPhaseUpgradeMode;
20
20
  };
21
21
  }
22
+ /** A version that a backup can restore on. */
23
+ export interface TwoPhaseUpgradeRestoreOptionDto {
24
+ generationUuid: string;
25
+ generationName: string;
26
+ /** The version of the binary, for example `8.12.0`. */
27
+ binaryVersion: string;
28
+ /** The behavior version after the restore, `major.minor`. */
29
+ behaviorVersion: string;
30
+ /** `false` when the restore cannot use this generation. */
31
+ available: boolean;
32
+ /** Why it is not available. */
33
+ blockedBy?: 'elasticsearch' | 'generation-missing';
34
+ }
35
+ /**
36
+ * A backup from a rollback window. Its behavior version differs from the
37
+ * version of the generation that took it, so it can restore on either one.
38
+ */
39
+ export interface TwoPhaseUpgradeBackupVersionsDto {
40
+ backupId: string;
41
+ /** The version of the generation that took the backup. */
42
+ binaryVersion: string;
43
+ /** The behavior version when the backup was taken, `major.minor`. */
44
+ behaviorVersion: string;
45
+ /** The behavior version first, then the generation that took the backup. */
46
+ options: TwoPhaseUpgradeRestoreOptionDto[];
47
+ }
48
+ export interface SetTwoPhaseUpgradeRestoreChoiceParams extends TwoPhaseUpgradeParams {
49
+ body: {
50
+ backupId: string;
51
+ generationUuid: string;
52
+ };
53
+ }
22
54
  export declare class ConsoleTwoPhaseUpgradeMockupService {
23
55
  /** The state of a cluster. Answers 404 when the flag is off for the org. */
24
56
  static getState(params: TwoPhaseUpgradeParams): Promise<TwoPhaseUpgradeStateDto>;
25
57
  /** The dialog calls this just before the real upgrade. */
26
58
  static setMode(params: SetTwoPhaseUpgradeModeParams): Promise<void>;
27
59
  static commit(params: TwoPhaseUpgradeParams): Promise<TwoPhaseUpgradeStateDto>;
60
+ /** The backups from a rollback window. Other backups are left out. */
61
+ static getBackupVersions(params: TwoPhaseUpgradeParams): Promise<TwoPhaseUpgradeBackupVersionsDto[]>;
62
+ /**
63
+ * The restore dialog calls this just before the real restore. The restore
64
+ * then uses the chosen generation.
65
+ */
66
+ static setRestoreChoice(params: SetTwoPhaseUpgradeRestoreChoiceParams): Promise<void>;
28
67
  private static send;
29
68
  }
30
69
  export {};
@@ -29,6 +29,23 @@ class ConsoleTwoPhaseUpgradeMockupService {
29
29
  {}
30
30
  );
31
31
  }
32
+ /** The backups from a rollback window. Other backups are left out. */
33
+ static async getBackupVersions(params) {
34
+ return ConsoleTwoPhaseUpgradeMockupService.send("getBackupVersions", "get", "/backups", params);
35
+ }
36
+ /**
37
+ * The restore dialog calls this just before the real restore. The restore
38
+ * then uses the chosen generation.
39
+ */
40
+ static async setRestoreChoice(params) {
41
+ await ConsoleTwoPhaseUpgradeMockupService.send(
42
+ "setRestoreChoice",
43
+ "put",
44
+ "/restore-choice",
45
+ params,
46
+ params.body
47
+ );
48
+ }
32
49
  static async send(name, type, suffix, params, body) {
33
50
  const template = `api/orgs/:orgId/clusters/:clusterId/two-phase-upgrade${suffix}`;
34
51
  const url = `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/two-phase-upgrade${suffix}`;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/services/console/console.two-phase-upgrade-mockup.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\n// twoPhaseUpgradeMockup: the whole file goes when the operator reports the\n// behavior version. The response shape is the one that the real feature needs.\n\nexport type TwoPhaseUpgradeMode = 'auto' | 'manual'\n\nexport interface TwoPhaseUpgradeStateDto {\n mode: TwoPhaseUpgradeMode\n /** The version of the running binary, for example `8.10.1`. */\n binaryVersion: string\n /** The behavior version, `major.minor`, for example `8.9`. */\n behaviorVersion: string\n state: 'pending' | 'committing' | 'committed'\n}\n\ninterface TwoPhaseUpgradeParams extends RequestBaseParams {\n params: { orgId: string; clusterId: string }\n}\n\nexport interface SetTwoPhaseUpgradeModeParams extends TwoPhaseUpgradeParams {\n body: { mode: TwoPhaseUpgradeMode }\n}\n\nexport class ConsoleTwoPhaseUpgradeMockupService {\n /** The state of a cluster. Answers 404 when the flag is off for the org. */\n public static async getState(\n params: TwoPhaseUpgradeParams,\n ): Promise<TwoPhaseUpgradeStateDto> {\n return ConsoleTwoPhaseUpgradeMockupService.send<TwoPhaseUpgradeStateDto>(\n 'getState',\n 'get',\n '',\n params,\n )\n }\n\n /** The dialog calls this just before the real upgrade. */\n public static async setMode(\n params: SetTwoPhaseUpgradeModeParams,\n ): Promise<void> {\n await ConsoleTwoPhaseUpgradeMockupService.send<void>(\n 'setMode',\n 'put',\n '/mode',\n params,\n params.body,\n )\n }\n\n public static async commit(\n params: TwoPhaseUpgradeParams,\n ): Promise<TwoPhaseUpgradeStateDto> {\n return ConsoleTwoPhaseUpgradeMockupService.send<TwoPhaseUpgradeStateDto>(\n 'commit',\n 'post',\n '/commit',\n params,\n {},\n )\n }\n\n private static async send<T>(\n name: string,\n type: 'get' | 'put' | 'post',\n suffix: string,\n params: TwoPhaseUpgradeParams,\n body?: object,\n ): Promise<T> {\n // The ids must not reach logs or metrics: both get the template.\n const template = `api/orgs/:orgId/clusters/:clusterId/two-phase-upgrade${suffix}`\n const url = `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/two-phase-upgrade${suffix}`\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `ConsoleTwoPhaseUpgradeMockupService.${name}`,\n url: template,\n normalizedUrl: template,\n type,\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<T>({\n ...params,\n base: { id: 'console' },\n url,\n logUrl: template,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n ...(body ? { 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 as T\n }\n}\n"],
5
- "mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAwBnB,MAAM,oCAAoC;AAAA;AAAA,EAE/C,aAAoB,SAClB,QACkC;AAClC,WAAO,oCAAoC;AAAA,MACzC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAGA,aAAoB,QAClB,QACe;AACf,UAAM,oCAAoC;AAAA,MACxC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,aAAoB,OAClB,QACkC;AAClC,WAAO,oCAAoC;AAAA,MACzC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,aAAqB,KACnB,MACA,MACA,QACA,QACA,MACY;AAEZ,UAAM,WAAW,wDAAwD,MAAM;AAC/E,UAAM,MAAM,YAAY,OAAO,OAAO,KAAK,aAAa,OAAO,OAAO,SAAS,qBAAqB,MAAM;AAC1G,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM,uCAAuC,IAAI;AAAA,QACjD,KAAK;AAAA,QACL,eAAe;AAAA,QACf;AAAA,MACF;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AAEA,UAAM,WAAW,MAAM,QAAW;AAAA,MAChC,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB;AAAA,MACA,QAAQ;AAAA,MACR,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,GAAI,OAAO,EAAE,KAAK,IAAI,CAAC;AAAA,MACvB,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;AAAA,EAClB;AACF;",
4
+ "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\n// twoPhaseUpgradeMockup: the whole file goes when the operator reports the\n// behavior version. The response shape is the one that the real feature needs.\n\nexport type TwoPhaseUpgradeMode = 'auto' | 'manual'\n\nexport interface TwoPhaseUpgradeStateDto {\n mode: TwoPhaseUpgradeMode\n /** The version of the running binary, for example `8.10.1`. */\n binaryVersion: string\n /** The behavior version, `major.minor`, for example `8.9`. */\n behaviorVersion: string\n state: 'pending' | 'committing' | 'committed'\n}\n\ninterface TwoPhaseUpgradeParams extends RequestBaseParams {\n params: { orgId: string; clusterId: string }\n}\n\nexport interface SetTwoPhaseUpgradeModeParams extends TwoPhaseUpgradeParams {\n body: { mode: TwoPhaseUpgradeMode }\n}\n\n/** A version that a backup can restore on. */\nexport interface TwoPhaseUpgradeRestoreOptionDto {\n generationUuid: string\n generationName: string\n /** The version of the binary, for example `8.12.0`. */\n binaryVersion: string\n /** The behavior version after the restore, `major.minor`. */\n behaviorVersion: string\n /** `false` when the restore cannot use this generation. */\n available: boolean\n /** Why it is not available. */\n blockedBy?: 'elasticsearch' | 'generation-missing'\n}\n\n/**\n * A backup from a rollback window. Its behavior version differs from the\n * version of the generation that took it, so it can restore on either one.\n */\nexport interface TwoPhaseUpgradeBackupVersionsDto {\n backupId: string\n /** The version of the generation that took the backup. */\n binaryVersion: string\n /** The behavior version when the backup was taken, `major.minor`. */\n behaviorVersion: string\n /** The behavior version first, then the generation that took the backup. */\n options: TwoPhaseUpgradeRestoreOptionDto[]\n}\n\nexport interface SetTwoPhaseUpgradeRestoreChoiceParams\n extends TwoPhaseUpgradeParams {\n body: { backupId: string; generationUuid: string }\n}\n\nexport class ConsoleTwoPhaseUpgradeMockupService {\n /** The state of a cluster. Answers 404 when the flag is off for the org. */\n public static async getState(\n params: TwoPhaseUpgradeParams,\n ): Promise<TwoPhaseUpgradeStateDto> {\n return ConsoleTwoPhaseUpgradeMockupService.send<TwoPhaseUpgradeStateDto>(\n 'getState',\n 'get',\n '',\n params,\n )\n }\n\n /** The dialog calls this just before the real upgrade. */\n public static async setMode(\n params: SetTwoPhaseUpgradeModeParams,\n ): Promise<void> {\n await ConsoleTwoPhaseUpgradeMockupService.send<void>(\n 'setMode',\n 'put',\n '/mode',\n params,\n params.body,\n )\n }\n\n public static async commit(\n params: TwoPhaseUpgradeParams,\n ): Promise<TwoPhaseUpgradeStateDto> {\n return ConsoleTwoPhaseUpgradeMockupService.send<TwoPhaseUpgradeStateDto>(\n 'commit',\n 'post',\n '/commit',\n params,\n {},\n )\n }\n\n /** The backups from a rollback window. Other backups are left out. */\n public static async getBackupVersions(\n params: TwoPhaseUpgradeParams,\n ): Promise<TwoPhaseUpgradeBackupVersionsDto[]> {\n return ConsoleTwoPhaseUpgradeMockupService.send<\n TwoPhaseUpgradeBackupVersionsDto[]\n >('getBackupVersions', 'get', '/backups', params)\n }\n\n /**\n * The restore dialog calls this just before the real restore. The restore\n * then uses the chosen generation.\n */\n public static async setRestoreChoice(\n params: SetTwoPhaseUpgradeRestoreChoiceParams,\n ): Promise<void> {\n await ConsoleTwoPhaseUpgradeMockupService.send<void>(\n 'setRestoreChoice',\n 'put',\n '/restore-choice',\n params,\n params.body,\n )\n }\n\n private static async send<T>(\n name: string,\n type: 'get' | 'put' | 'post',\n suffix: string,\n params: TwoPhaseUpgradeParams,\n body?: object,\n ): Promise<T> {\n // The ids must not reach logs or metrics: both get the template.\n const template = `api/orgs/:orgId/clusters/:clusterId/two-phase-upgrade${suffix}`\n const url = `api/orgs/${params.params.orgId}/clusters/${params.params.clusterId}/two-phase-upgrade${suffix}`\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `ConsoleTwoPhaseUpgradeMockupService.${name}`,\n url: template,\n normalizedUrl: template,\n type,\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<T>({\n ...params,\n base: { id: 'console' },\n url,\n logUrl: template,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n ...(body ? { 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 as T\n }\n}\n"],
5
+ "mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAyDnB,MAAM,oCAAoC;AAAA;AAAA,EAE/C,aAAoB,SAClB,QACkC;AAClC,WAAO,oCAAoC;AAAA,MACzC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAGA,aAAoB,QAClB,QACe;AACf,UAAM,oCAAoC;AAAA,MACxC;AAAA,MACA;AAAA,MACA;AAA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A,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAEA,WAAO,SAAS;AAAA,EAClB;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/services/control/control.annotations.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 AnnotationDto,\n AnnotationEntityKind,\n AnnotationKind,\n AnnotationLookupDto,\n AnnotationTagDto,\n EntityAnnotationsDto,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseMethodType,\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 * The annotation surface of control-backend: the notes and the tags that a\n * Camundi attaches to an entity of the fleet.\n *\n * One service for every kind of entity, and not one for each. The routes carry\n * the kind as a value, which is what lets one panel in control-frontend sit on\n * the cluster page, the organization page and every other entity page without\n * a call of its own.\n *\n * Every route answers 404 while the feature flag `control.annotations` is off\n * on the stage, and while the service reaches no stage at all.\n */\n\nconst BASE = { id: 'control' } as const\n\n/** What names the entity. Every write and the entity read carry it. */\nexport interface AnnotationTargetDto {\n entityKind: AnnotationEntityKind\n entityId: string\n /**\n * What the entity is called now. The backend stores it as a COPY, so a\n * search result still reads after the entity is deleted. Send it when the\n * caller knows the name.\n */\n entityLabel?: string\n}\n\nexport interface GetEntityAnnotationsRequest extends RequestBaseParams {\n params: { entityKind: AnnotationEntityKind; entityId: string }\n}\n\nexport interface LookupAnnotationsRequest extends RequestBaseParams {\n params: { entityKind: AnnotationEntityKind; entityIds: string[] }\n}\n\nexport interface AddAnnotationNoteRequest extends RequestBaseParams {\n params: AnnotationTargetDto & { body: string }\n}\n\nexport interface EditAnnotationNoteRequest extends RequestBaseParams {\n params: {\n id: string\n body: string\n /**\n * The `version` of the note that the caller read.\n *\n * The backend writes only while the row still carries it, and answers 409\n * when it does not. Send what came with the note you are editing, never a\n * number of your own: it is what stops a stale tab from replacing an edit\n * that landed after it was opened.\n */\n version: number\n }\n}\n\nexport interface AnnotationIdRequest extends RequestBaseParams {\n params: { id: string }\n}\n\nexport interface AddAnnotationTagRequest extends RequestBaseParams {\n params: AnnotationTargetDto & { tag: string; reason?: string }\n}\n\nexport interface ListAnnotationTagsRequest extends RequestBaseParams {\n params?: { q?: string; limit?: number; offset?: number }\n}\n\nexport interface SearchAnnotationsRequest extends RequestBaseParams {\n params?: {\n kind?: AnnotationKind\n entityKind?: AnnotationEntityKind\n tag?: string\n q?: string\n limit?: number\n offset?: number\n }\n}\n\n/** One page of a read, and whether the table holds more of it. */\nexport interface AnnotationPageInfoDto {\n limit: number\n offset: number\n /** True when the next page holds more. Never read the length instead. */\n hasMore: boolean\n}\n\nexport interface AnnotationPageDto {\n annotations: AnnotationDto[]\n page: AnnotationPageInfoDto\n}\n\nexport interface AnnotationTagPageDto {\n tags: AnnotationTagDto[]\n page: AnnotationPageInfoDto\n}\n\nfunction contextFor(\n name: string,\n url: string,\n normalizedUrl: string,\n type: RequestBaseMethodType,\n source: string,\n): RequestBaseServiceContext {\n return {\n method: {\n name: `ControlAnnotationsService.${name}`,\n url,\n normalizedUrl,\n type,\n },\n source,\n target: { name: 'control', type: 'internal' },\n }\n}\n\n/** Builds `?a=1&b=2` from the values that are set, and `''` from none. */\nfunction queryOf(params: Record<string, unknown> = {}): string {\n const query = new URLSearchParams()\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n query.set(key, String(value))\n }\n }\n return query.size > 0 ? `?${query.toString()}` : ''\n}\n\nexport class ControlAnnotationsService {\n /**\n * Every live note and tag of one entity.\n *\n * An entity that carries nothing answers with two empty lists, and never\n * 404. The call also answers for an entity that the fleet no longer holds,\n * which is what keeps a link out of a search result working.\n */\n public static async forEntity(\n params: GetEntityAnnotationsRequest,\n ): Promise<EntityAnnotationsDto> {\n const url = `api/annotations${queryOf(params.params)}`\n return ControlAnnotationsService.send<EntityAnnotationsDto>(\n params,\n 'forEntity',\n url,\n 'api/annotations',\n 'get',\n )\n }\n\n /**\n * The tags, the note count and the newest note of many entities.\n *\n * A POST, because thousands of ids do not fit a request line. The answer\n * holds only the entities that carry something.\n */\n public static async lookup(\n params: LookupAnnotationsRequest,\n ): Promise<AnnotationLookupDto> {\n return ControlAnnotationsService.send<AnnotationLookupDto>(\n params,\n 'lookup',\n 'api/annotations/lookup',\n 'api/annotations/lookup',\n 'post',\n params.params,\n )\n }\n\n /** Writes a note on an entity. Any signed-in Camundi can. */\n public static async addNote(\n params: AddAnnotationNoteRequest,\n ): Promise<AnnotationDto> {\n const { annotation } = await ControlAnnotationsService.send<{\n annotation: AnnotationDto\n }>(\n params,\n 'addNote',\n 'api/annotations/notes',\n 'api/annotations/notes',\n 'post',\n params.params,\n )\n return annotation\n }\n\n /** Changes the text of a note. Only the person who wrote it can. */\n public static async editNote(\n params: EditAnnotationNoteRequest,\n ): Promise<AnnotationDto> {\n const url = `api/annotations/notes/${params.params.id}`\n const { annotation } = await ControlAnnotationsService.send<{\n annotation: AnnotationDto\n }>(params, 'editNote', url, 'api/annotations/notes/:id', 'patch', {\n body: params.params.body,\n version: params.params.version,\n })\n return annotation\n }\n\n /**\n * Takes a note or a tag off an entity.\n *\n * The row stays: the removal is a soft delete, so who wrote it and who took\n * it off both stay readable. A note can only be removed by its author; a tag\n * can be removed by anybody.\n */\n public static async remove(params: AnnotationIdRequest): Promise<void> {\n const url = `api/annotations/${params.params.id}`\n await ControlAnnotationsService.send<undefined>(\n params,\n 'remove',\n url,\n 'api/annotations/:id',\n 'delete',\n )\n }\n\n /**\n * Attaches a tag to an entity, and adds it to the dictionary when it is new.\n *\n * The name is normalized by the backend, so `Partner` and `partner` reach\n * one tag. A second attach of one tag on one entity answers 409.\n */\n public static async addTag(\n params: AddAnnotationTagRequest,\n ): Promise<AnnotationDto> {\n const { annotation } = await ControlAnnotationsService.send<{\n annotation: AnnotationDto\n }>(\n params,\n 'addTag',\n 'api/annotations/tags',\n 'api/annotations/tags',\n 'post',\n params.params,\n )\n return annotation\n }\n\n /**\n * The tag dictionary, with the live entities of each tag counted, most used\n * first.\n *\n * The autocomplete of the tag field reads this. It is what stops one idea\n * from becoming three spellings.\n *\n * It answers one PAGE, because the dictionary only grows. Read `page.hasMore`\n * to learn whether another follows.\n */\n public static async listTags(\n params: ListAnnotationTagsRequest,\n ): Promise<AnnotationTagPageDto> {\n const url = `api/annotations/tags${queryOf(params.params)}`\n return ControlAnnotationsService.send<AnnotationTagPageDto>(\n params,\n 'listTags',\n url,\n 'api/annotations/tags',\n 'get',\n )\n }\n\n /**\n * One page of the annotations that match, newest first.\n *\n * The answer holds annotations of entities that no longer exist, which is\n * the point: the note about a deleted cluster is often the only record of\n * why it was there.\n */\n public static async search(\n params: SearchAnnotationsRequest,\n ): Promise<AnnotationPageDto> {\n const url = `api/annotations/search${queryOf(params.params)}`\n return ControlAnnotationsService.send<AnnotationPageDto>(\n params,\n 'search',\n url,\n 'api/annotations/search',\n 'get',\n )\n }\n\n /**\n * The shared half of every call above.\n *\n * Seven routes differ only in the verb, the path and the body. One private\n * helper keeps the metrics context and the status check in one place.\n */\n private static async send<TResponse>(\n params: RequestBaseParams,\n name: string,\n url: string,\n normalizedUrl: string,\n method: RequestBaseMethodType,\n // `object` and not `Record<string, unknown>`: an interface has no index\n // signature, so the request shapes above would not be assignable to one,\n // and the alternative is `any`.\n body?: object,\n ): Promise<TResponse> {\n const serviceContext = contextFor(\n name,\n url,\n normalizedUrl,\n method,\n params.config.metrics?.source || 'unset',\n )\n const response = await request<TResponse>({\n // `...params` first, so `cacheControl` and `onCachedResponse` reach the\n // request. Every shape above extends `RequestBaseParams`, so a caller\n // may pass them, and `request` really reads `onCachedResponse` for its\n // stale-while-revalidate path. Passing `config` alone advertised two\n // options in the type and then dropped them both. The named fields\n // below are written after, so they still win.\n ...params,\n config: params.config,\n base: BASE,\n url,\n method,\n metricsDetails: serviceContext,\n body,\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 // `remove` answers 204, which carries no body. Its caller declares\n // `undefined` and reads nothing, so the assertion below is safe for it\n // too: every other route here answers a body.\n return response.body as TResponse\n }\n}\n"],
5
- "mappings": "AAmBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAe1B,MAAM,OAAO,EAAE,IAAI,UAAU;AAmF7B,SAAS,WACP,MACA,KACA,eACA,MACA,QAC2B;AAC3B,SAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM,6BAA6B,IAAI;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,EAC9C;AACF;AAGA,SAAS,QAAQ,SAAkC,CAAC,GAAW;AAC7D,QAAM,QAAQ,IAAI,gBAAgB;AAClC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,QAAI,UAAU,QAAW;AACvB,YAAM,IAAI,KAAK,OAAO,KAAK,CAAC;AAAA,IAC9B;AAAA,EACF;AACA,SAAO,MAAM,OAAO,IAAI,IAAI,MAAM,SAAS,CAAC,KAAK;AACnD;AAEO,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQrC,aAAoB,UAClB,QAC+B;AAC/B,UAAM,MAAM,kBAAkB,QAAQ,OAAO,MAAM,CAAC;AACpD,WAAO,0BAA0B;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,aAAoB,OAClB,QAC8B;AAC9B,WAAO,0BAA0B;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,MAC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A,EASA,aAAoB,OAClB,QAC4B;AAC5B,UAAM,MAAM,yBAAyB,QAAQ,OAAO,MAAM,CAAC;AAC3D,WAAO,0BAA0B;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,aAAqB,KACnB,QACA,MACA,KACA,eACA,QAIA,MACoB;AACpB,UAAM,iBAAiB;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,OAAO,SAAS,UAAU;AAAA,IACnC;AACA,UAAM,WAAW,MAAM,QAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOxC,GAAG;AAAA,MACH,QAAQ,OAAO;AAAA,MACf,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB;AAAA,IACF,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;AAIA,WAAO,SAAS;AAAA,EAClB;AACF;",
4
+ "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n AnnotationDto,\n AnnotationEntityKind,\n AnnotationKind,\n AnnotationLookupDto,\n AnnotationTagDto,\n EntityAnnotationsDto,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseMethodType,\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 * The annotation surface of control-backend: the notes and the tags that a\n * Camundi attaches to an entity of the fleet.\n *\n * One service for every kind of entity, and not one for each. The routes carry\n * the kind as a value, which is what lets one panel in control-frontend sit on\n * the cluster page, the organization page and every other entity page without\n * a call of its own.\n *\n * Every route answers 404 while the service reaches no stage at all.\n */\n\nconst BASE = { id: 'control' } as const\n\n/** What names the entity. Every write and the entity read carry it. */\nexport interface AnnotationTargetDto {\n entityKind: AnnotationEntityKind\n entityId: string\n /**\n * What the entity is called now. The backend stores it as a COPY, so a\n * search result still reads after the entity is deleted. Send it when the\n * caller knows the name.\n */\n entityLabel?: string\n}\n\nexport interface GetEntityAnnotationsRequest extends RequestBaseParams {\n params: { entityKind: AnnotationEntityKind; entityId: string }\n}\n\nexport interface LookupAnnotationsRequest extends RequestBaseParams {\n params: { entityKind: AnnotationEntityKind; entityIds: string[] }\n}\n\nexport interface AddAnnotationNoteRequest extends RequestBaseParams {\n params: AnnotationTargetDto & { body: string }\n}\n\nexport interface EditAnnotationNoteRequest extends RequestBaseParams {\n params: {\n id: string\n body: string\n /**\n * The `version` of the note that the caller read.\n *\n * The backend writes only while the row still carries it, and answers 409\n * when it does not. Send what came with the note you are editing, never a\n * number of your own: it is what stops a stale tab from replacing an edit\n * that landed after it was opened.\n */\n version: number\n }\n}\n\nexport interface AnnotationIdRequest extends RequestBaseParams {\n params: { id: string }\n}\n\nexport interface AddAnnotationTagRequest extends RequestBaseParams {\n params: AnnotationTargetDto & { tag: string; reason?: string }\n}\n\nexport interface ListAnnotationTagsRequest extends RequestBaseParams {\n params?: { q?: string; limit?: number; offset?: number }\n}\n\nexport interface SearchAnnotationsRequest extends RequestBaseParams {\n params?: {\n kind?: AnnotationKind\n entityKind?: AnnotationEntityKind\n tag?: string\n q?: string\n limit?: number\n offset?: number\n }\n}\n\n/** One page of a read, and whether the table holds more of it. */\nexport interface AnnotationPageInfoDto {\n limit: number\n offset: number\n /** True when the next page holds more. Never read the length instead. */\n hasMore: boolean\n}\n\nexport interface AnnotationPageDto {\n annotations: AnnotationDto[]\n page: AnnotationPageInfoDto\n}\n\nexport interface AnnotationTagPageDto {\n tags: AnnotationTagDto[]\n page: AnnotationPageInfoDto\n}\n\nfunction contextFor(\n name: string,\n url: string,\n normalizedUrl: string,\n type: RequestBaseMethodType,\n source: string,\n): RequestBaseServiceContext {\n return {\n method: {\n name: `ControlAnnotationsService.${name}`,\n url,\n normalizedUrl,\n type,\n },\n source,\n target: { name: 'control', type: 'internal' },\n }\n}\n\n/** Builds `?a=1&b=2` from the values that are set, and `''` from none. */\nfunction queryOf(params: Record<string, unknown> = {}): string {\n const query = new URLSearchParams()\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n query.set(key, String(value))\n }\n }\n return query.size > 0 ? `?${query.toString()}` : ''\n}\n\nexport class ControlAnnotationsService {\n /**\n * Every live note and tag of one entity.\n *\n * An entity that carries nothing answers with two empty lists, and never\n * 404. The call also answers for an entity that the fleet no longer holds,\n * which is what keeps a link out of a search result working.\n */\n public static async forEntity(\n params: GetEntityAnnotationsRequest,\n ): Promise<EntityAnnotationsDto> {\n const url = `api/annotations${queryOf(params.params)}`\n return ControlAnnotationsService.send<EntityAnnotationsDto>(\n params,\n 'forEntity',\n url,\n 'api/annotations',\n 'get',\n )\n }\n\n /**\n * The tags, the note count and the newest note of many entities.\n *\n * A POST, because thousands of ids do not fit a request line. The answer\n * holds only the entities that carry something.\n */\n public static async lookup(\n params: LookupAnnotationsRequest,\n ): Promise<AnnotationLookupDto> {\n return ControlAnnotationsService.send<AnnotationLookupDto>(\n params,\n 'lookup',\n 'api/annotations/lookup',\n 'api/annotations/lookup',\n 'post',\n params.params,\n )\n }\n\n /** Writes a note on an entity. Any signed-in Camundi can. */\n public static async addNote(\n params: AddAnnotationNoteRequest,\n ): Promise<AnnotationDto> {\n const { annotation } = await ControlAnnotationsService.send<{\n annotation: AnnotationDto\n }>(\n params,\n 'addNote',\n 'api/annotations/notes',\n 'api/annotations/notes',\n 'post',\n params.params,\n )\n return annotation\n }\n\n /** Changes the text of a note. Only the person who wrote it can. */\n public static async editNote(\n params: EditAnnotationNoteRequest,\n ): Promise<AnnotationDto> {\n const url = `api/annotations/notes/${params.params.id}`\n const { annotation } = await ControlAnnotationsService.send<{\n annotation: AnnotationDto\n }>(params, 'editNote', url, 'api/annotations/notes/:id', 'patch', {\n body: params.params.body,\n version: params.params.version,\n })\n return annotation\n }\n\n /**\n * Takes a note or a tag off an entity.\n *\n * The row stays: the removal is a soft delete, so who wrote it and who took\n * it off both stay readable. A note can only be removed by its author; a tag\n * can be removed by anybody.\n */\n public static async remove(params: AnnotationIdRequest): Promise<void> {\n const url = `api/annotations/${params.params.id}`\n await ControlAnnotationsService.send<undefined>(\n params,\n 'remove',\n url,\n 'api/annotations/:id',\n 'delete',\n )\n }\n\n /**\n * Attaches a tag to an entity, and adds it to the dictionary when it is new.\n *\n * The name is normalized by the backend, so `Partner` and `partner` reach\n * one tag. A second attach of one tag on one entity answers 409.\n */\n public static async addTag(\n params: AddAnnotationTagRequest,\n ): Promise<AnnotationDto> {\n const { annotation } = await ControlAnnotationsService.send<{\n annotation: AnnotationDto\n }>(\n params,\n 'addTag',\n 'api/annotations/tags',\n 'api/annotations/tags',\n 'post',\n params.params,\n )\n return annotation\n }\n\n /**\n * The tag dictionary, with the live entities of each tag counted, most used\n * first.\n *\n * The autocomplete of the tag field reads this. It is what stops one idea\n * from becoming three spellings.\n *\n * It answers one PAGE, because the dictionary only grows. Read `page.hasMore`\n * to learn whether another follows.\n */\n public static async listTags(\n params: ListAnnotationTagsRequest,\n ): Promise<AnnotationTagPageDto> {\n const url = `api/annotations/tags${queryOf(params.params)}`\n return ControlAnnotationsService.send<AnnotationTagPageDto>(\n params,\n 'listTags',\n url,\n 'api/annotations/tags',\n 'get',\n )\n }\n\n /**\n * One page of the annotations that match, newest first.\n *\n * The answer holds annotations of entities that no longer exist, which is\n * the point: the note about a deleted cluster is often the only record of\n * why it was there.\n */\n public static async search(\n params: SearchAnnotationsRequest,\n ): Promise<AnnotationPageDto> {\n const url = `api/annotations/search${queryOf(params.params)}`\n return ControlAnnotationsService.send<AnnotationPageDto>(\n params,\n 'search',\n url,\n 'api/annotations/search',\n 'get',\n )\n }\n\n /**\n * The shared half of every call above.\n *\n * Seven routes differ only in the verb, the path and the body. One private\n * helper keeps the metrics context and the status check in one place.\n */\n private static async send<TResponse>(\n params: RequestBaseParams,\n name: string,\n url: string,\n normalizedUrl: string,\n method: RequestBaseMethodType,\n // `object` and not `Record<string, unknown>`: an interface has no index\n // signature, so the request shapes above would not be assignable to one,\n // and the alternative is `any`.\n body?: object,\n ): Promise<TResponse> {\n const serviceContext = contextFor(\n name,\n url,\n normalizedUrl,\n method,\n params.config.metrics?.source || 'unset',\n )\n const response = await request<TResponse>({\n // `...params` first, so `cacheControl` and `onCachedResponse` reach the\n // request. Every shape above extends `RequestBaseParams`, so a caller\n // may pass them, and `request` really reads `onCachedResponse` for its\n // stale-while-revalidate path. Passing `config` alone advertised two\n // options in the type and then dropped them both. The named fields\n // below are written after, so they still win.\n ...params,\n config: params.config,\n base: BASE,\n url,\n method,\n metricsDetails: serviceContext,\n body,\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 // `remove` answers 204, which carries no body. Its caller declares\n // `undefined` and reads nothing, so the assertion below is safe for it\n // too: every other route here answers a body.\n return response.body as TResponse\n }\n}\n"],
5
+ "mappings": "AAmBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAc1B,MAAM,OAAO,EAAE,IAAI,UAAU;AAmF7B,SAAS,WACP,MACA,KACA,eACA,MACA,QAC2B;AAC3B,SAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM,6BAA6B,IAAI;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,EAC9C;AACF;AAGA,SAAS,QAAQ,SAAkC,CAAC,GAAW;AAC7D,QAAM,QAAQ,IAAI,gBAAgB;AAClC,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AAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAIA,WAAO,SAAS;AAAA,EAClB;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-api",
3
- "version": "13.2.3",
3
+ "version": "13.4.0",
4
4
  "description": "Centralized API service layer for Camunda Cloud Management Apps",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
@@ -41,7 +41,7 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@camunda/ccma-shared-types": "18.6.1"
44
+ "@camunda/ccma-shared-types": "18.7.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "node esbuild.mjs && tsc --emitDeclarationOnly --outDir dist",