@camunda/ccma-api 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/index.d.ts +6 -4
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +2 -2
  4. package/dist/services/accounts/bug-report.service.d.ts +28 -0
  5. package/dist/services/accounts/bug-report.service.js +44 -0
  6. package/dist/services/accounts/bug-report.service.js.map +7 -0
  7. package/dist/services/accounts/hdp.service.d.ts +8 -1
  8. package/dist/services/accounts/hdp.service.js +33 -0
  9. package/dist/services/accounts/hdp.service.js.map +2 -2
  10. package/dist/services/accounts/orgs.service.d.ts +4 -16
  11. package/dist/services/accounts/orgs.service.js.map +2 -2
  12. package/dist/services/accounts/orgs.v2.service.d.ts +7 -0
  13. package/dist/services/accounts/orgs.v2.service.js +35 -0
  14. package/dist/services/accounts/orgs.v2.service.js.map +2 -2
  15. package/dist/services/audit-logger/audit-logger.system.service.d.ts +6 -0
  16. package/dist/services/audit-logger/audit-logger.system.service.js +3 -0
  17. package/dist/services/audit-logger/audit-logger.system.service.js.map +2 -2
  18. package/dist/services/console/console.admin.service.d.ts +14 -0
  19. package/dist/services/console/console.admin.service.js +34 -0
  20. package/dist/services/console/console.admin.service.js.map +2 -2
  21. package/dist/services/console/console.cluster.v2.service.d.ts +3 -3
  22. package/dist/services/console/console.cluster.v2.service.js +20 -7
  23. package/dist/services/console/console.cluster.v2.service.js.map +2 -2
  24. package/dist/services/console/console.hotbackups.service.d.ts +22 -0
  25. package/dist/services/console/console.hotbackups.service.js +85 -0
  26. package/dist/services/console/console.hotbackups.service.js.map +2 -2
  27. package/dist/services/console/console.hotbackups.service.spec.d.ts +1 -0
  28. package/dist/services/console/generation.service.d.ts +19 -1
  29. package/dist/services/console/generation.service.js +71 -0
  30. package/dist/services/console/generation.service.js.map +2 -2
  31. package/dist/services/hibob/hibob.service.d.ts +1 -1
  32. package/dist/services/hibob/hibob.service.js.map +1 -1
  33. package/dist/services/litellm/litellm.service.d.ts +30 -0
  34. package/dist/services/litellm/litellm.service.js +42 -0
  35. package/dist/services/litellm/litellm.service.js.map +2 -2
  36. package/dist/utils/api.js +12 -6
  37. package/dist/utils/api.js.map +2 -2
  38. package/dist/utils/api.log-duration.spec.d.ts +1 -0
  39. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/services/console/generation.service.ts"],
4
- "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n GenerationDto,\n UpgradableGenerationsDto,\n ZeebeClusterVersionsDto,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\n/**\n * Version payload accepted by the create/update generation endpoints. Mirrors\n * `ZeebeClusterVersionsDto` but allows the optional component versions to be\n * omitted; the backend normalizes blank optionals to `undefined`.\n */\nexport type GenerationVersionsInput = Partial<ZeebeClusterVersionsDto> &\n Pick<ZeebeClusterVersionsDto, 'zeebe' | 'elasticSearchOss' | 'optimize'>\n\nexport interface CreateGenerationParams extends RequestBaseParams {\n body: {\n name: string\n versions: GenerationVersionsInput\n upgradeableFrom?: string[]\n isUnsupportedStarting?: string\n isBespoke?: boolean\n }\n}\n\nexport interface UpdateGenerationParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n name?: string\n versions: Partial<GenerationVersionsInput>\n upgradeableFrom?: string[]\n }\n}\n\nexport interface DeleteGenerationParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n}\n\nexport interface SetGenerationBespokeParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n isBespoke: boolean\n }\n}\n\nexport interface ListGenerationsParams extends RequestBaseParams {}\n\nexport class GenerationService {\n public static async list(\n params: ListGenerationsParams,\n ): Promise<GenerationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.list',\n url: 'api/generations',\n normalizedUrl: 'api/generations',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto[]>({\n ...params,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body ?? []\n }\n\n public static async getGeneration(\n params: { uuid: string } & RequestBaseParams,\n ): Promise<GenerationDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getGeneration`,\n url: `api/generations/${params.uuid}`,\n normalizedUrl: `api/generations/:generationUuid`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto>({\n config: params.config,\n base: {\n id: 'console',\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async getUpgradable(\n params: {\n fromGenerationUuid: string\n clusterId?: string\n } & RequestBaseParams,\n ): Promise<GenerationDto[]> {\n const baseUrl = `api/generations/${params.fromGenerationUuid}/upgradable`\n const url = params.clusterId\n ? `${baseUrl}?clusterId=${encodeURIComponent(params.clusterId)}`\n : baseUrl\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradable`,\n url,\n normalizedUrl: params.clusterId\n ? `api/generations/:fromGenerationUuid/upgradable?clusterId=:clusterId`\n : `api/generations/:fromGenerationUuid/upgradable`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<GenerationDto[]>({\n config: params.config,\n base: {\n id: 'console',\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body ?? []\n }\n\n public static async getUpgradableMulti(\n params: {\n fromGenerationUuid: string\n clusterId?: string\n } & RequestBaseParams,\n ): Promise<UpgradableGenerationsDto> {\n const baseUrl = `api/generations/${params.fromGenerationUuid}/upgradable-multi`\n const url = params.clusterId\n ? `${baseUrl}?clusterId=${encodeURIComponent(params.clusterId)}`\n : baseUrl\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradableMulti`,\n url,\n normalizedUrl: params.clusterId\n ? `api/generations/:fromGenerationUuid/upgradable-multi?clusterId=:clusterId`\n : `api/generations/:fromGenerationUuid/upgradable-multi`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<UpgradableGenerationsDto>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body ?? { preferred: null, options: [] }\n }\n\n public static async upgradeCluster(\n params: {\n generationUuid: string\n clusterId: string\n orgId: string\n tasklistV2Enabled?: boolean\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.upgradeCluster`,\n url: `api/orgs/${params.orgId}/clusters/${params.clusterId}/upgrade/${params.generationUuid}`,\n normalizedUrl: `api/orgs/:orgId/clusters/:clusterId/upgrade/:generationUuid`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<string>({\n config: params.config,\n base: {\n id: 'console',\n },\n body:\n params.tasklistV2Enabled === undefined\n ? undefined\n : { tasklistV2Enabled: params.tasklistV2Enabled },\n responseType: 'text',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async setSupported(\n params: {\n generationUuid: string\n unsupportedStartingAt: string | null\n } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.setSupported`,\n url: `api/generations/${params.generationUuid}/supported`,\n normalizedUrl: `api/generations/:generationUuid/supported`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<any>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: {\n unsupportedStartingAt: params.unsupportedStartingAt,\n },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async createAutoUpdateBulkOperation(\n params: {\n generationUuid: string\n name: string\n reason: string\n eyes: number\n } & RequestBaseParams,\n ) {\n const body = {\n name: params.name,\n reason: params.reason,\n eyes: params.eyes,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.createAutoUpdateBulkOperation`,\n url: `external/generations/${params.generationUuid}/autoupdate`,\n normalizedUrl: `external/generations/:generationUuid/autoupdate`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n uuid: string\n name: string\n clusterCount: number\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async createBulkUpgradeOperation(\n params: {\n fromGenerationUuid: string\n toGenerationUuid: string\n name: string\n reason: string\n eyes: number\n } & RequestBaseParams,\n ) {\n const body = {\n toGenerationUuid: params.toGenerationUuid,\n name: params.name,\n reason: params.reason,\n eyes: params.eyes,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.createBulkUpgradeOperation`,\n url: `external/generations/${params.fromGenerationUuid}/bulkUpgrade`,\n normalizedUrl: `external/generations/:fromGenerationUuid/bulkUpgrade`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n uuid: string\n name: string\n clusterCount: number\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async updateUpgradePath(\n params: {\n generationUuid: string\n upgradeableFrom: string[]\n } & RequestBaseParams,\n ): Promise<\n | {\n name: string\n uuid: string\n upgradeableFrom: Array<{ uuid: string }>\n }\n | undefined\n > {\n const body = {\n upgradeableFrom: params.upgradeableFrom,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.updateUpgradePath`,\n url: `external/generations/${params.generationUuid}/upgradepath`,\n normalizedUrl: `external/generations/:generationUuid/upgradepath`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n name: string\n uuid: string\n upgradeableFrom: Array<{ uuid: string }>\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async publishReleaseTrain(\n params: {\n previousGenerationId: string\n name: string\n releaseType: 'patch' | 'alpha' | 'minor'\n versions?: Partial<ZeebeClusterVersionsDto>\n isUnsupportedStarting?: string\n } & RequestBaseParams,\n ) {\n const {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\n } = params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.publishReleaseTrain',\n url: 'external/release-train/generation',\n normalizedUrl: 'external/release-train/generation',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n generationId: string\n changes: {\n newGeneration: { uuid: string; name: string }\n previousGenerationCleared?: { uuid: string; name: string }\n nextMinorGenerationUpdated?: { uuid: string; name: string }\n channelsUpdated: Array<{\n channelName: string\n generationAdded: { uuid: string; name: string }\n generationRemoved?: { uuid: string; name: string }\n newDefault: { uuid: string; name: string }\n }>\n }\n }>({\n config: params.config,\n base: { id: 'console' },\n body: {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async rollbackReleaseTrain(\n params: {\n generationId: string\n releaseType: 'patch' | 'alpha' | 'minor'\n replacementGenerationId?: string\n stableReplacementGenerationId?: string\n alphaReplacementGenerationId?: string\n } & RequestBaseParams,\n ) {\n const {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\n } = params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.rollbackReleaseTrain',\n url: 'external/release-train/rollback',\n normalizedUrl: 'external/release-train/rollback',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n rolledBackGenerationId: string\n changes: {\n channelsUpdated: Array<{\n channelName: string\n generationAdded: { uuid: string; name: string }\n generationRemoved?: { uuid: string; name: string }\n newDefault: { uuid: string; name: string }\n }>\n previousGenerationRestored?: { uuid: string; name: string }\n nextMinorGenerationRestored?: { uuid: string; name: string }\n }\n }>({\n config: params.config,\n base: { id: 'console' },\n body: {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async triggerAutoUpgrade(\n params: { generationId: string } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.triggerAutoUpgrade',\n url: `external/release-train/generation/${params.generationId}/auto-upgrade`,\n normalizedUrl:\n 'external/release-train/generation/:generationId/auto-upgrade',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n bulkOperationUuid: string\n clusterCount: number\n }>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async create(\n params: CreateGenerationParams,\n ): Promise<GenerationDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.create',\n url: 'api/generations',\n normalizedUrl: 'api/generations',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n return response.body\n }\n\n public static async update(params: UpdateGenerationParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.update',\n url: `api/generations/${params.params.generationUuid}`,\n normalizedUrl: 'api/generations/:generationUuid',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async delete(params: DeleteGenerationParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.delete',\n url: `api/generations/${params.params.generationUuid}`,\n normalizedUrl: 'api/generations/:generationUuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async setBespoke(\n params: SetGenerationBespokeParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.setBespoke',\n url: `api/generations/${params.params.generationUuid}/bespoke`,\n normalizedUrl: 'api/generations/:generationUuid/bespoke',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
5
- "mappings": "AAeA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAgDnB,MAAM,kBAAkB;AAAA,EAC7B,aAAoB,KAClB,QAC0B;AAC1B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA,QACL,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAyB;AAAA,MAC9C,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AACA,WAAO,SAAS,QAAQ,CAAC;AAAA,EAC3B;AAAA,EAEA,aAAoB,cAClB,QACoC;AACpC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAA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EAAE,IAAI,UAAU;AAAA,MACtB,MAAM,OAAO;AAAA,MACb,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n GenerationDto,\n ReleaseTrainSanityReport,\n UpgradableGenerationsDto,\n ZeebeClusterVersionsDto,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\n/**\n * Version payload accepted by the create/update generation endpoints. Mirrors\n * `ZeebeClusterVersionsDto` but allows the optional component versions to be\n * omitted; the backend normalizes blank optionals to `undefined`.\n */\nexport type GenerationVersionsInput = Partial<ZeebeClusterVersionsDto> &\n Pick<ZeebeClusterVersionsDto, 'zeebe' | 'elasticSearchOss' | 'optimize'>\n\nexport interface CreateGenerationParams extends RequestBaseParams {\n body: {\n name: string\n versions: GenerationVersionsInput\n upgradeableFrom?: string[]\n isUnsupportedStarting?: string\n isBespoke?: boolean\n }\n}\n\nexport interface UpdateGenerationParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n name?: string\n versions: Partial<GenerationVersionsInput>\n upgradeableFrom?: string[]\n }\n}\n\nexport interface DeleteGenerationParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n}\n\nexport interface SetGenerationBespokeParams extends RequestBaseParams {\n params: {\n generationUuid: string\n }\n body: {\n isBespoke: boolean\n }\n}\n\nexport interface ListGenerationsParams extends RequestBaseParams {}\n\nexport class GenerationService {\n public static async list(\n params: ListGenerationsParams,\n ): Promise<GenerationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.list',\n url: 'api/generations',\n normalizedUrl: 'api/generations',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto[]>({\n ...params,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body ?? []\n }\n\n public static async getGeneration(\n params: { uuid: string } & RequestBaseParams,\n ): Promise<GenerationDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getGeneration`,\n url: `api/generations/${params.uuid}`,\n normalizedUrl: `api/generations/:generationUuid`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto>({\n config: params.config,\n base: {\n id: 'console',\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async getUpgradable(\n params: {\n fromGenerationUuid: string\n clusterId?: string\n } & RequestBaseParams,\n ): Promise<GenerationDto[]> {\n const baseUrl = `api/generations/${params.fromGenerationUuid}/upgradable`\n const url = params.clusterId\n ? `${baseUrl}?clusterId=${encodeURIComponent(params.clusterId)}`\n : baseUrl\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradable`,\n url,\n normalizedUrl: params.clusterId\n ? `api/generations/:fromGenerationUuid/upgradable?clusterId=:clusterId`\n : `api/generations/:fromGenerationUuid/upgradable`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<GenerationDto[]>({\n config: params.config,\n base: {\n id: 'console',\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body ?? []\n }\n\n public static async getUpgradableMulti(\n params: {\n fromGenerationUuid: string\n clusterId?: string\n } & RequestBaseParams,\n ): Promise<UpgradableGenerationsDto> {\n const baseUrl = `api/generations/${params.fromGenerationUuid}/upgradable-multi`\n const url = params.clusterId\n ? `${baseUrl}?clusterId=${encodeURIComponent(params.clusterId)}`\n : baseUrl\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.getUpgradableMulti`,\n url,\n normalizedUrl: params.clusterId\n ? `api/generations/:fromGenerationUuid/upgradable-multi?clusterId=:clusterId`\n : `api/generations/:fromGenerationUuid/upgradable-multi`,\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<UpgradableGenerationsDto>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body ?? { preferred: null, options: [] }\n }\n\n public static async upgradeCluster(\n params: {\n generationUuid: string\n clusterId: string\n orgId: string\n tasklistV2Enabled?: boolean\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.upgradeCluster`,\n url: `api/orgs/${params.orgId}/clusters/${params.clusterId}/upgrade/${params.generationUuid}`,\n normalizedUrl: `api/orgs/:orgId/clusters/:clusterId/upgrade/:generationUuid`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<string>({\n config: params.config,\n base: {\n id: 'console',\n },\n body:\n params.tasklistV2Enabled === undefined\n ? undefined\n : { tasklistV2Enabled: params.tasklistV2Enabled },\n responseType: 'text',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n /**\n * Upgrades a cluster to a generation via the internal/admin route (`PUT\n * api/generations/:generationUuid/upgradecluster/:clusterId`), as opposed\n * to {@link upgradeCluster}'s customer-facing, org-scoped route. This is\n * the endpoint Camunda staff use to upgrade a cluster on a customer's\n * behalf: it is not gated by `orgValidator`/`clusterOwnerValidator`, always\n * records the change as done `byCamunda`, and \u2014 when `yolo` is set \u2014\n * bypasses the generation's `upgradeableFrom` compatibility graph\n * entirely (subject to the caller holding the yolo permission\n * server-side). Mirrors accounts-frontend's\n * `generations.upgradeCluster` model action.\n */\n public static async upgradeClusterAdmin(\n params: {\n generationUuid: string\n clusterId: string\n yolo?: boolean\n } & RequestBaseParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.upgradeClusterAdmin',\n url: `api/generations/${params.generationUuid}/upgradecluster/${params.clusterId}`,\n normalizedUrl:\n 'api/generations/:generationUuid/upgradecluster/:clusterId',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: { yolo: params.yolo ?? false, byCamunda: true },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async setSupported(\n params: {\n generationUuid: string\n unsupportedStartingAt: string | null\n } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.setSupported`,\n url: `api/generations/${params.generationUuid}/supported`,\n normalizedUrl: `api/generations/:generationUuid/supported`,\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<any>({\n config: params.config,\n base: {\n id: 'console',\n },\n body: {\n unsupportedStartingAt: params.unsupportedStartingAt,\n },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async createAutoUpdateBulkOperation(\n params: {\n generationUuid: string\n name: string\n reason: string\n eyes: number\n } & RequestBaseParams,\n ) {\n const body = {\n name: params.name,\n reason: params.reason,\n eyes: params.eyes,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.createAutoUpdateBulkOperation`,\n url: `external/generations/${params.generationUuid}/autoupdate`,\n normalizedUrl: `external/generations/:generationUuid/autoupdate`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n uuid: string\n name: string\n clusterCount: number\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async createBulkUpgradeOperation(\n params: {\n fromGenerationUuid: string\n toGenerationUuid: string\n name: string\n reason: string\n eyes: number\n } & RequestBaseParams,\n ) {\n const body = {\n toGenerationUuid: params.toGenerationUuid,\n name: params.name,\n reason: params.reason,\n eyes: params.eyes,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.createBulkUpgradeOperation`,\n url: `external/generations/${params.fromGenerationUuid}/bulkUpgrade`,\n normalizedUrl: `external/generations/:fromGenerationUuid/bulkUpgrade`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n uuid: string\n name: string\n clusterCount: number\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async updateUpgradePath(\n params: {\n generationUuid: string\n upgradeableFrom: string[]\n } & RequestBaseParams,\n ): Promise<\n | {\n name: string\n uuid: string\n upgradeableFrom: Array<{ uuid: string }>\n }\n | undefined\n > {\n const body = {\n upgradeableFrom: params.upgradeableFrom,\n }\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: `GenerationService.updateUpgradePath`,\n url: `external/generations/${params.generationUuid}/upgradepath`,\n normalizedUrl: `external/generations/:generationUuid/upgradepath`,\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n name: string\n uuid: string\n upgradeableFrom: Array<{ uuid: string }>\n }>({\n config: params.config,\n base: {\n id: 'console',\n },\n body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async publishReleaseTrain(\n params: {\n previousGenerationId: string\n name: string\n releaseType: 'patch' | 'alpha' | 'minor'\n versions?: Partial<ZeebeClusterVersionsDto>\n isUnsupportedStarting?: string\n } & RequestBaseParams,\n ) {\n const {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\n } = params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.publishReleaseTrain',\n url: 'external/release-train/generation',\n normalizedUrl: 'external/release-train/generation',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n generationId: string\n changes: {\n newGeneration: { uuid: string; name: string }\n previousGenerationCleared?: { uuid: string; name: string }\n nextMinorGenerationUpdated?: { uuid: string; name: string }\n channelsUpdated: Array<{\n channelName: string\n generationAdded: { uuid: string; name: string }\n generationRemoved?: { uuid: string; name: string }\n newDefault: { uuid: string; name: string }\n }>\n }\n }>({\n config: params.config,\n base: { id: 'console' },\n body: {\n previousGenerationId,\n name,\n releaseType,\n versions,\n isUnsupportedStarting,\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async rollbackReleaseTrain(\n params: {\n generationId: string\n releaseType: 'patch' | 'alpha' | 'minor'\n replacementGenerationId?: string\n stableReplacementGenerationId?: string\n alphaReplacementGenerationId?: string\n } & RequestBaseParams,\n ) {\n const {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\n } = params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.rollbackReleaseTrain',\n url: 'external/release-train/rollback',\n normalizedUrl: 'external/release-train/rollback',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n rolledBackGenerationId: string\n changes: {\n channelsUpdated: Array<{\n channelName: string\n generationAdded: { uuid: string; name: string }\n generationRemoved?: { uuid: string; name: string }\n newDefault: { uuid: string; name: string }\n }>\n previousGenerationRestored?: { uuid: string; name: string }\n nextMinorGenerationRestored?: { uuid: string; name: string }\n }\n }>({\n config: params.config,\n base: { id: 'console' },\n body: {\n generationId,\n releaseType,\n replacementGenerationId,\n stableReplacementGenerationId,\n alphaReplacementGenerationId,\n },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async triggerAutoUpgrade(\n params: { generationId: string } & RequestBaseParams,\n ) {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.triggerAutoUpgrade',\n url: `external/release-train/generation/${params.generationId}/auto-upgrade`,\n normalizedUrl:\n 'external/release-train/generation/:generationId/auto-upgrade',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<{\n bulkOperationUuid: string\n clusterCount: number\n }>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body\n }\n\n public static async getReleaseTrainSanity(\n params: RequestBaseParams,\n ): Promise<ReleaseTrainSanityReport> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.getReleaseTrainSanity',\n url: 'external/release-train/sanity-check',\n normalizedUrl: 'external/release-train/sanity-check',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<ReleaseTrainSanityReport>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n return response.body\n }\n\n public static async create(\n params: CreateGenerationParams,\n ): Promise<GenerationDto | undefined> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.create',\n url: 'api/generations',\n normalizedUrl: 'api/generations',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<GenerationDto>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'json',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n if (!response.body) {\n throw new Error(`${serviceContext.method.name}: Empty response body`)\n }\n return response.body\n }\n\n public static async update(params: UpdateGenerationParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.update',\n url: `api/generations/${params.params.generationUuid}`,\n normalizedUrl: 'api/generations/:generationUuid',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async delete(params: DeleteGenerationParams): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.delete',\n url: `api/generations/${params.params.generationUuid}`,\n normalizedUrl: 'api/generations/:generationUuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async setBespoke(\n params: SetGenerationBespokeParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'GenerationService.setBespoke',\n url: `api/generations/${params.params.generationUuid}/bespoke`,\n normalizedUrl: 'api/generations/:generationUuid/bespoke',\n type: 'patch',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'console', type: 'internal' },\n }\n const response = await request<void>({\n config: params.config,\n base: { id: 'console' },\n body: params.body,\n responseType: 'none',\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
5
+ "mappings": "AAgBA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAgDnB,MAAM,kBAAkB;AAAA,EAC7B,aAAoB,KAClB,QAC0B;AAC1B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA,QACL,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAyB;AAAA,MAC9C,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,G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,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAoB,WAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,mBAAmB,OAAO,OAAO,cAAc;AAAA,QACpD,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,WAAW,MAAM,WAAW;AAAA,IAC9C;AACA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,UAAU;AAAA,MACtB,MAAM,OAAO;AAAA,MACb,cAAc;AAAA,MACd,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AACD,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -52,7 +52,7 @@ export interface HibobEmployee {
52
52
  value: string;
53
53
  };
54
54
  humanReadable?: {
55
- work: {
55
+ work?: {
56
56
  department?: string;
57
57
  customColumns?: {
58
58
  [DIVISION_ID]?: string;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/services/hibob/hibob.service.ts"],
4
- "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface HibobSearchRequest extends RequestBaseParams {\n options: {\n hibobApiUrl: string\n username: string\n password: string\n email: string\n }\n}\n\nexport interface HibobGetAllUsersRequest extends RequestBaseParams {\n options: {\n hibobApiUrl: string\n username: string\n password: string\n }\n}\n\nexport interface HibobReportsTo {\n id: string\n firstName: string\n surname: string\n email: string\n displayName: string\n}\n\nexport const DIVISION_ID = 'column_1629151319875'\nexport const SUB_DIVISION_ID = 'column_1642024758438'\n\nexport const DEPARTMENT = '/work/department'\nexport const DIVISION = `/work/customColumns/${DIVISION_ID}`\nexport const SUB_DIVISION = `/work/customColumns/${SUB_DIVISION_ID}`\n\nexport interface HibobEmployee {\n id: string\n email: string\n work?: {\n reportsTo?: HibobReportsTo\n }\n /**\n * Hibob API returns field paths as property names in the response.\n * These are alternative representations of the employee data.\n */\n '/root/email'?: {\n value: string\n }\n '/work/reportsTo'?: {\n value: HibobReportsTo\n }\n [DIVISION]?: {\n value: string\n }\n [SUB_DIVISION]?: {\n value: string\n }\n [DEPARTMENT]?: {\n value: string\n }\n humanReadable?: {\n work: {\n department?: string\n customColumns?: {\n [DIVISION_ID]?: string\n [SUB_DIVISION_ID]?: string\n }\n }\n }\n}\n\nexport interface HibobSearchResponse {\n employees: HibobEmployee[]\n}\n\n// Common fields configuration for Hibob API requests\nconst HIBOB_SEARCH_FIELDS = [\n 'root.email',\n 'work.reportsTo',\n 'work.department',\n 'work.customColumns.column_1629151319875',\n 'work.customColumns.column_1642024758438',\n]\n\nexport class HibobService {\n /**\n * Creates a Basic auth token from username and password.\n */\n private static createBasicToken(username: string, password: string): string {\n return Buffer.from(`${username}:${password}`).toString('base64')\n }\n\n public static async getUserByEmail(\n params: HibobSearchRequest,\n ): Promise<HibobSearchResponse> {\n const url = `${params.options.hibobApiUrl}v1/people/search`\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'HibobService.getUserByEmail',\n url,\n normalizedUrl: `${params.options.hibobApiUrl}v1/people/search`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'hibob',\n type: 'external',\n },\n }\n\n const basicToken = HibobService.createBasicToken(\n params.options.username,\n params.options.password,\n )\n\n const body = {\n fields: HIBOB_SEARCH_FIELDS,\n filters: [\n {\n values: [params.options.email],\n fieldPath: 'root.email',\n operator: 'equals',\n },\n ],\n showInactive: false,\n }\n\n const response = await request<HibobSearchResponse>({\n config: params.config,\n url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Basic ${basicToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async getAllUsers(\n params: HibobGetAllUsersRequest,\n ): Promise<HibobSearchResponse> {\n const url = `${params.options.hibobApiUrl}v1/people/search`\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'HibobService.getAllUsers',\n url,\n normalizedUrl: `${params.options.hibobApiUrl}v1/people/search`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'hibob',\n type: 'external',\n },\n }\n\n const basicToken = HibobService.createBasicToken(\n params.options.username,\n params.options.password,\n )\n\n const body = {\n fields: HIBOB_SEARCH_FIELDS,\n showInactive: false,\n humanReadable: 'APPEND',\n }\n\n const response = await request<HibobSearchResponse>({\n config: params.config,\n url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Basic ${basicToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\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 type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface HibobSearchRequest extends RequestBaseParams {\n options: {\n hibobApiUrl: string\n username: string\n password: string\n email: string\n }\n}\n\nexport interface HibobGetAllUsersRequest extends RequestBaseParams {\n options: {\n hibobApiUrl: string\n username: string\n password: string\n }\n}\n\nexport interface HibobReportsTo {\n id: string\n firstName: string\n surname: string\n email: string\n displayName: string\n}\n\nexport const DIVISION_ID = 'column_1629151319875'\nexport const SUB_DIVISION_ID = 'column_1642024758438'\n\nexport const DEPARTMENT = '/work/department'\nexport const DIVISION = `/work/customColumns/${DIVISION_ID}`\nexport const SUB_DIVISION = `/work/customColumns/${SUB_DIVISION_ID}`\n\nexport interface HibobEmployee {\n id: string\n email: string\n work?: {\n reportsTo?: HibobReportsTo\n }\n /**\n * Hibob API returns field paths as property names in the response.\n * These are alternative representations of the employee data.\n */\n '/root/email'?: {\n value: string\n }\n '/work/reportsTo'?: {\n value: HibobReportsTo\n }\n [DIVISION]?: {\n value: string\n }\n [SUB_DIVISION]?: {\n value: string\n }\n [DEPARTMENT]?: {\n value: string\n }\n humanReadable?: {\n work?: {\n department?: string\n customColumns?: {\n [DIVISION_ID]?: string\n [SUB_DIVISION_ID]?: string\n }\n }\n }\n}\n\nexport interface HibobSearchResponse {\n employees: HibobEmployee[]\n}\n\n// Common fields configuration for Hibob API requests\nconst HIBOB_SEARCH_FIELDS = [\n 'root.email',\n 'work.reportsTo',\n 'work.department',\n 'work.customColumns.column_1629151319875',\n 'work.customColumns.column_1642024758438',\n]\n\nexport class HibobService {\n /**\n * Creates a Basic auth token from username and password.\n */\n private static createBasicToken(username: string, password: string): string {\n return Buffer.from(`${username}:${password}`).toString('base64')\n }\n\n public static async getUserByEmail(\n params: HibobSearchRequest,\n ): Promise<HibobSearchResponse> {\n const url = `${params.options.hibobApiUrl}v1/people/search`\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'HibobService.getUserByEmail',\n url,\n normalizedUrl: `${params.options.hibobApiUrl}v1/people/search`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'hibob',\n type: 'external',\n },\n }\n\n const basicToken = HibobService.createBasicToken(\n params.options.username,\n params.options.password,\n )\n\n const body = {\n fields: HIBOB_SEARCH_FIELDS,\n filters: [\n {\n values: [params.options.email],\n fieldPath: 'root.email',\n operator: 'equals',\n },\n ],\n showInactive: false,\n }\n\n const response = await request<HibobSearchResponse>({\n config: params.config,\n url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Basic ${basicToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async getAllUsers(\n params: HibobGetAllUsersRequest,\n ): Promise<HibobSearchResponse> {\n const url = `${params.options.hibobApiUrl}v1/people/search`\n\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'HibobService.getAllUsers',\n url,\n normalizedUrl: `${params.options.hibobApiUrl}v1/people/search`,\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'hibob',\n type: 'external',\n },\n }\n\n const basicToken = HibobService.createBasicToken(\n params.options.username,\n params.options.password,\n )\n\n const body = {\n fields: HIBOB_SEARCH_FIELDS,\n showInactive: false,\n humanReadable: 'APPEND',\n }\n\n const response = await request<HibobSearchResponse>({\n config: params.config,\n url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Basic ${basicToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n}\n"],
5
5
  "mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA2BnB,MAAM,cAAc;AACpB,MAAM,kBAAkB;AAExB,MAAM,aAAa;AACnB,MAAM,WAAW,uBAAuB,WAAW;AACnD,MAAM,eAAe,uBAAuB,eAAe;AA2ClE,MAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA,EAIxB,OAAe,iBAAiB,UAAkB,UAA0B;AAC1E,WAAO,OAAO,KAAK,GAAG,QAAQ,IAAI,QAAQ,EAAE,EAAE,SAAS,QAAQ;AAAA,EACjE;AAAA,EAEA,aAAoB,eAClB,QAC8B;AAC9B,UAAM,MAAM,GAAG,OAAO,QAAQ,WAAW;AAEzC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN;AAAA,QACA,eAAe,GAAG,OAAO,QAAQ,WAAW;AAAA,QAC5C,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAEA,UAAM,aAAa,aAAa;AAAA,MAC9B,OAAO,QAAQ;AAAA,MACf,OAAO,QAAQ;AAAA,IACjB;AAEA,UAAM,OAAO;AAAA,MACX,QAAQ;AAAA,MACR,SAAS;AAAA,QACP;AAAA,UACE,QAAQ,CAAC,OAAO,QAAQ,KAAK;AAAA,UAC7B,WAAW;AAAA,UACX,UAAU;AAAA,QACZ;AAAA,MACF;AAAA,MACA,cAAc;AAAA,IAChB;AAEA,UAAM,WAAW,MAAM,QAA6B;AAAA,MAClD,QAAQ,OAAO;AAAA,MACf;AAAA,MACA,QAAQ,eAAe,OAAO;A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A,WAAO,SAAS;AAAA,EAClB;AACF;",
6
6
  "names": []
7
7
  }
@@ -140,6 +140,30 @@ export interface GenerateKeyResponse {
140
140
  metadata?: Record<string, any>;
141
141
  [key: string]: any;
142
142
  }
143
+ /**
144
+ * Request to regenerate (rotate) an existing key
145
+ * POST /key/regenerate
146
+ */
147
+ export interface RegenerateKeyRequest extends RequestBaseParams {
148
+ options: {
149
+ /** Base URL for LiteLLM API */
150
+ litellmApiBaseUrl: string;
151
+ /** API token for authentication */
152
+ apiToken: string;
153
+ /** The current key to regenerate */
154
+ key: string;
155
+ };
156
+ }
157
+ /**
158
+ * Response from regenerating a key. All settings (team, budget, spend, models)
159
+ * are carried over from the old key; only the key material changes.
160
+ */
161
+ export interface RegenerateKeyResponse {
162
+ key: string;
163
+ key_name?: string;
164
+ team_id?: string;
165
+ [key: string]: any;
166
+ }
143
167
  /**
144
168
  * Request to block a key
145
169
  * POST /key/block
@@ -266,6 +290,12 @@ export declare class LiteLLMService {
266
290
  * POST /key/generate
267
291
  */
268
292
  static generateKey(params: GenerateKeyRequest): Promise<GenerateKeyResponse>;
293
+ /**
294
+ * Regenerate (rotate) an existing key. The old key is invalidated
295
+ * immediately; all other key settings are preserved.
296
+ * POST /key/regenerate
297
+ */
298
+ static regenerateKey(params: RegenerateKeyRequest): Promise<RegenerateKeyResponse>;
269
299
  /**
270
300
  * Block a key to quickly disable it
271
301
  * POST /key/block
@@ -191,6 +191,48 @@ class LiteLLMService {
191
191
  }
192
192
  return response.body;
193
193
  }
194
+ /**
195
+ * Regenerate (rotate) an existing key. The old key is invalidated
196
+ * immediately; all other key settings are preserved.
197
+ * POST /key/regenerate
198
+ */
199
+ static async regenerateKey(params) {
200
+ const serviceContext = {
201
+ method: {
202
+ name: "LiteLLMService.regenerateKey",
203
+ url: `${params.options.litellmApiBaseUrl}/key/regenerate`,
204
+ normalizedUrl: "/key/regenerate",
205
+ type: "post"
206
+ },
207
+ source: params.config.metrics?.source || "unset",
208
+ target: {
209
+ name: "litellm",
210
+ type: "external"
211
+ }
212
+ };
213
+ const body = {
214
+ key: params.options.key
215
+ };
216
+ const response = await request({
217
+ config: params.config,
218
+ url: serviceContext.method.url,
219
+ method: serviceContext.method.type,
220
+ metricsDetails: serviceContext,
221
+ type: "json",
222
+ headers: {
223
+ Authorization: `Bearer ${params.options.apiToken}`
224
+ },
225
+ body
226
+ });
227
+ if (!response.ok) {
228
+ throw new HttpError(
229
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
230
+ response.status,
231
+ response.statusText
232
+ );
233
+ }
234
+ return response.body;
235
+ }
194
236
  /**
195
237
  * Block a key to quickly disable it
196
238
  * POST /key/block
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/services/litellm/litellm.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/**\n * Request to create a new team in LiteLLM\n * POST /team/new\n */\nexport interface CreateTeamRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Team alias/name */\n team_alias: string\n /** Maximum budget for the team */\n max_budget?: number\n /** Budget duration (e.g., '30d', '1mo') */\n budget_duration?: string\n /** Organization ID to associate the team with */\n organization_id?: string\n }\n}\n\n/**\n * Response from creating a new team\n */\nexport interface CreateTeamResponse {\n team_id: string\n team_alias: string\n max_budget?: number\n budget_duration?: string\n created_at?: string\n [key: string]: any\n}\n\n/**\n * Request to update a team's budget in LiteLLM\n * POST /team/update\n */\nexport interface UpdateTeamBudgetRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Team ID to update */\n team_id: string\n /** New maximum budget for the team */\n max_budget: number\n }\n}\n\n/**\n * Response from updating a team's budget\n */\nexport interface UpdateTeamBudgetResponse {\n team_id: string\n team_alias?: string\n max_budget: number\n budget_duration?: string\n [key: string]: any\n}\n\n/**\n * Request to update a key's budget in LiteLLM\n * POST /key/update\n */\nexport interface UpdateKeyBudgetRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to update */\n key: string\n /** New maximum budget for the key */\n max_budget: number\n }\n}\n\n/**\n * Response from updating a key's budget\n */\nexport interface UpdateKeyBudgetResponse {\n key: string\n max_budget: number\n [key: string]: any\n}\n\n/**\n * Request to delete a team\n * POST /team/delete\n */\nexport interface DeleteTeamRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Team ID to delete */\n team_id: string\n }\n}\n\n/**\n * Response from deleting a team\n */\nexport interface DeleteTeamResponse {\n deleted_teams: string[]\n [key: string]: any\n}\n\n/**\n * Request to generate a key for a team\n * POST /key/generate\n */\nexport interface GenerateKeyRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Team ID to generate key for */\n team_id: string\n /** Models the key can access */\n models?: string[]\n /** Optional key alias */\n key_alias?: string\n /** Duration for the key */\n duration?: string\n /** Additional metadata */\n metadata?: Record<string, any>\n /** Maximum budget for this key */\n max_budget?: number\n /** Budget duration */\n budget_duration?: string\n /** Organization ID to associate the key with */\n organization_id?: string\n }\n}\n\n/**\n * Response from generating a key\n */\nexport interface GenerateKeyResponse {\n key: string\n key_name?: string\n expires?: string\n team_id: string\n metadata?: Record<string, any>\n [key: string]: any\n}\n\n/**\n * Request to block a key\n * POST /key/block\n */\nexport interface BlockKeyRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to block */\n key: string\n }\n}\n\n/**\n * Response from blocking a key\n */\nexport interface BlockKeyResponse {\n status: string\n message?: string\n [key: string]: any\n}\n\n/**\n * Request to unblock a key\n * POST /key/unblock\n */\nexport interface UnblockKeyRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to unblock */\n key: string\n }\n}\n\n/**\n * Response from unblocking a key\n */\nexport interface UnblockKeyResponse {\n status: string\n message?: string\n [key: string]: any\n}\n\n/**\n * Request to get key info\n * GET /key/info\n */\nexport interface GetKeyInfoRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to get info for */\n key: string\n }\n}\n\n/**\n * Request to delete a key\n * POST /key/delete\n */\nexport interface DeleteKeyRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to delete */\n key: string\n }\n}\n\n/**\n * Response from deleting a key\n */\nexport interface DeleteKeyResponse {\n deleted_keys: string[]\n [key: string]: any\n}\n\n/**\n * Response from getting key info including usage and spend\n */\nexport interface GetKeyInfoResponse {\n info: {\n key: string\n team_id: string\n spend?: number\n usage?: {\n total_tokens?: number\n prompt_tokens?: number\n completion_tokens?: number\n }\n max_budget?: number\n budget_duration?: string\n blocked?: boolean\n created_at?: string\n expires_at?: string\n metadata?: Record<string, any>\n [key: string]: any\n }\n}\n\n/**\n * Service for interacting with LiteLLM API\n * API Documentation: https://camunda.litellm-prod.ai\n */\nexport class LiteLLMService {\n /**\n * Create a new team in LiteLLM\n * POST /team/new\n */\n public static async createTeam(\n params: CreateTeamRequest,\n ): Promise<CreateTeamResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.createTeam',\n url: `${params.options.litellmApiBaseUrl}/team/new`,\n normalizedUrl: '/team/new',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n team_alias: params.options.team_alias,\n ...(params.options.max_budget !== undefined && {\n max_budget: params.options.max_budget,\n }),\n ...(params.options.budget_duration && {\n budget_duration: params.options.budget_duration,\n }),\n ...(params.options.organization_id && {\n organization_id: params.options.organization_id,\n }),\n }\n\n const response = await request<CreateTeamResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Update a team's budget in LiteLLM\n * POST /team/update\n */\n public static async updateTeamBudget(\n params: UpdateTeamBudgetRequest,\n ): Promise<UpdateTeamBudgetResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.updateTeamBudget',\n url: `${params.options.litellmApiBaseUrl}/team/update`,\n normalizedUrl: '/team/update',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n team_id: params.options.team_id,\n max_budget: params.options.max_budget,\n }\n\n const response = await request<UpdateTeamBudgetResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Update a key's budget in LiteLLM\n * POST /key/update\n */\n public static async updateKeyBudget(\n params: UpdateKeyBudgetRequest,\n ): Promise<UpdateKeyBudgetResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.updateKeyBudget',\n url: `${params.options.litellmApiBaseUrl}/key/update`,\n normalizedUrl: '/key/update',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n key: params.options.key,\n max_budget: params.options.max_budget,\n }\n\n const response = await request<UpdateKeyBudgetResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Generate a key for a team\n * POST /key/generate\n */\n public static async generateKey(\n params: GenerateKeyRequest,\n ): Promise<GenerateKeyResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.generateKey',\n url: `${params.options.litellmApiBaseUrl}/key/generate`,\n normalizedUrl: '/key/generate',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n team_id: params.options.team_id,\n key_type: 'llm_api',\n allowed_routes: ['/chat/completions'],\n ...(params.options.models && { models: params.options.models }),\n ...(params.options.key_alias && { key_alias: params.options.key_alias }),\n ...(params.options.duration && { duration: params.options.duration }),\n ...(params.options.metadata && { metadata: params.options.metadata }),\n ...(params.options.max_budget !== undefined && {\n max_budget: params.options.max_budget,\n }),\n ...(params.options.budget_duration && {\n budget_duration: params.options.budget_duration,\n }),\n ...(params.options.organization_id && {\n organization_id: params.options.organization_id,\n }),\n }\n\n const response = await request<GenerateKeyResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Block a key to quickly disable it\n * POST /key/block\n */\n public static async blockKey(\n params: BlockKeyRequest,\n ): Promise<BlockKeyResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.blockKey',\n url: `${params.options.litellmApiBaseUrl}/key/block`,\n normalizedUrl: '/key/block',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n key: params.options.key,\n }\n\n const response = await request<BlockKeyResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Unblock a key to re-enable it\n * POST /key/unblock\n */\n public static async unblockKey(\n params: UnblockKeyRequest,\n ): Promise<UnblockKeyResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.unblockKey',\n url: `${params.options.litellmApiBaseUrl}/key/unblock`,\n normalizedUrl: '/key/unblock',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n key: params.options.key,\n }\n\n const response = await request<UnblockKeyResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Get information about a key including usage and spend\n * GET /key/info\n */\n public static async getKeyInfo(\n params: GetKeyInfoRequest,\n ): Promise<GetKeyInfoResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.getKeyInfo',\n url: `${params.options.litellmApiBaseUrl}/key/info?key=${encodeURIComponent(params.options.key)}`,\n normalizedUrl: '/key/info',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const response = await request<GetKeyInfoResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\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 /**\n * Delete a key\n * POST /key/delete\n */\n public static async deleteKey(\n params: DeleteKeyRequest,\n ): Promise<DeleteKeyResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.deleteKey',\n url: `${params.options.litellmApiBaseUrl}/key/delete`,\n normalizedUrl: '/key/delete',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n keys: [params.options.key],\n }\n\n const response = await request<DeleteKeyResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Delete a team\n * POST /team/delete\n */\n public static async deleteTeam(\n params: DeleteTeamRequest,\n ): Promise<DeleteTeamResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.deleteTeam',\n url: `${params.options.litellmApiBaseUrl}/team/delete`,\n normalizedUrl: '/team/delete',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n team_ids: [params.options.team_id],\n }\n\n const response = await request<DeleteTeamResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n}\n"],
5
- "mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA0QnB,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,EAK1B,aAAoB,WAClB,QAC6B;AAC7B,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,GAAG,OAAO,QAAQ,iBAAiB;AAAA,QACxC,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;AAEA,UAAM,OAAO;AAAA,MACX,YAAY,OAAO,QAAQ;AAAA,MAC3B,GAAI,OAAO,QAAQ,eAAe,UAAa;AAAA,QAC7C,YAAY,OAAO,QAAQ;AAAA,MAC7B;AAAA,MACA,GAAI,OAAO,QAAQ,mBAAmB;AAAA,QACpC,iBAAiB,OAAO,QAAQ;AAAA,MAClC;AAAA,MACA,GAAI,OAAO,QAAQ,mBAAmB;AAAA,QACpC,iBAAiB,OAAO,QAAQ;AAAA,MAClC;AAAA,IACF;AAEA,UAAM,WAAW,MAAM,QAA4B;AAAA,MACjD,QAAQ,OAAO;AAAA,MACf,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,e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,MAC9B,gBAAgB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA,QACP,eAAe,UAAU,OAAO,QAAQ,QAAQ;AAAA,MAClD;AAAA,MACA;AAAA,IACF,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAEA,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/**\n * Request to create a new team in LiteLLM\n * POST /team/new\n */\nexport interface CreateTeamRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Team alias/name */\n team_alias: string\n /** Maximum budget for the team */\n max_budget?: number\n /** Budget duration (e.g., '30d', '1mo') */\n budget_duration?: string\n /** Organization ID to associate the team with */\n organization_id?: string\n }\n}\n\n/**\n * Response from creating a new team\n */\nexport interface CreateTeamResponse {\n team_id: string\n team_alias: string\n max_budget?: number\n budget_duration?: string\n created_at?: string\n [key: string]: any\n}\n\n/**\n * Request to update a team's budget in LiteLLM\n * POST /team/update\n */\nexport interface UpdateTeamBudgetRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Team ID to update */\n team_id: string\n /** New maximum budget for the team */\n max_budget: number\n }\n}\n\n/**\n * Response from updating a team's budget\n */\nexport interface UpdateTeamBudgetResponse {\n team_id: string\n team_alias?: string\n max_budget: number\n budget_duration?: string\n [key: string]: any\n}\n\n/**\n * Request to update a key's budget in LiteLLM\n * POST /key/update\n */\nexport interface UpdateKeyBudgetRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to update */\n key: string\n /** New maximum budget for the key */\n max_budget: number\n }\n}\n\n/**\n * Response from updating a key's budget\n */\nexport interface UpdateKeyBudgetResponse {\n key: string\n max_budget: number\n [key: string]: any\n}\n\n/**\n * Request to delete a team\n * POST /team/delete\n */\nexport interface DeleteTeamRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Team ID to delete */\n team_id: string\n }\n}\n\n/**\n * Response from deleting a team\n */\nexport interface DeleteTeamResponse {\n deleted_teams: string[]\n [key: string]: any\n}\n\n/**\n * Request to generate a key for a team\n * POST /key/generate\n */\nexport interface GenerateKeyRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Team ID to generate key for */\n team_id: string\n /** Models the key can access */\n models?: string[]\n /** Optional key alias */\n key_alias?: string\n /** Duration for the key */\n duration?: string\n /** Additional metadata */\n metadata?: Record<string, any>\n /** Maximum budget for this key */\n max_budget?: number\n /** Budget duration */\n budget_duration?: string\n /** Organization ID to associate the key with */\n organization_id?: string\n }\n}\n\n/**\n * Response from generating a key\n */\nexport interface GenerateKeyResponse {\n key: string\n key_name?: string\n expires?: string\n team_id: string\n metadata?: Record<string, any>\n [key: string]: any\n}\n\n/**\n * Request to regenerate (rotate) an existing key\n * POST /key/regenerate\n */\nexport interface RegenerateKeyRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** The current key to regenerate */\n key: string\n }\n}\n\n/**\n * Response from regenerating a key. All settings (team, budget, spend, models)\n * are carried over from the old key; only the key material changes.\n */\nexport interface RegenerateKeyResponse {\n key: string\n key_name?: string\n team_id?: string\n [key: string]: any\n}\n\n/**\n * Request to block a key\n * POST /key/block\n */\nexport interface BlockKeyRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to block */\n key: string\n }\n}\n\n/**\n * Response from blocking a key\n */\nexport interface BlockKeyResponse {\n status: string\n message?: string\n [key: string]: any\n}\n\n/**\n * Request to unblock a key\n * POST /key/unblock\n */\nexport interface UnblockKeyRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to unblock */\n key: string\n }\n}\n\n/**\n * Response from unblocking a key\n */\nexport interface UnblockKeyResponse {\n status: string\n message?: string\n [key: string]: any\n}\n\n/**\n * Request to get key info\n * GET /key/info\n */\nexport interface GetKeyInfoRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to get info for */\n key: string\n }\n}\n\n/**\n * Request to delete a key\n * POST /key/delete\n */\nexport interface DeleteKeyRequest extends RequestBaseParams {\n options: {\n /** Base URL for LiteLLM API */\n litellmApiBaseUrl: string\n /** API token for authentication */\n apiToken: string\n /** Key to delete */\n key: string\n }\n}\n\n/**\n * Response from deleting a key\n */\nexport interface DeleteKeyResponse {\n deleted_keys: string[]\n [key: string]: any\n}\n\n/**\n * Response from getting key info including usage and spend\n */\nexport interface GetKeyInfoResponse {\n info: {\n key: string\n team_id: string\n spend?: number\n usage?: {\n total_tokens?: number\n prompt_tokens?: number\n completion_tokens?: number\n }\n max_budget?: number\n budget_duration?: string\n blocked?: boolean\n created_at?: string\n expires_at?: string\n metadata?: Record<string, any>\n [key: string]: any\n }\n}\n\n/**\n * Service for interacting with LiteLLM API\n * API Documentation: https://camunda.litellm-prod.ai\n */\nexport class LiteLLMService {\n /**\n * Create a new team in LiteLLM\n * POST /team/new\n */\n public static async createTeam(\n params: CreateTeamRequest,\n ): Promise<CreateTeamResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.createTeam',\n url: `${params.options.litellmApiBaseUrl}/team/new`,\n normalizedUrl: '/team/new',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n team_alias: params.options.team_alias,\n ...(params.options.max_budget !== undefined && {\n max_budget: params.options.max_budget,\n }),\n ...(params.options.budget_duration && {\n budget_duration: params.options.budget_duration,\n }),\n ...(params.options.organization_id && {\n organization_id: params.options.organization_id,\n }),\n }\n\n const response = await request<CreateTeamResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Update a team's budget in LiteLLM\n * POST /team/update\n */\n public static async updateTeamBudget(\n params: UpdateTeamBudgetRequest,\n ): Promise<UpdateTeamBudgetResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.updateTeamBudget',\n url: `${params.options.litellmApiBaseUrl}/team/update`,\n normalizedUrl: '/team/update',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n team_id: params.options.team_id,\n max_budget: params.options.max_budget,\n }\n\n const response = await request<UpdateTeamBudgetResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Update a key's budget in LiteLLM\n * POST /key/update\n */\n public static async updateKeyBudget(\n params: UpdateKeyBudgetRequest,\n ): Promise<UpdateKeyBudgetResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.updateKeyBudget',\n url: `${params.options.litellmApiBaseUrl}/key/update`,\n normalizedUrl: '/key/update',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n key: params.options.key,\n max_budget: params.options.max_budget,\n }\n\n const response = await request<UpdateKeyBudgetResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Generate a key for a team\n * POST /key/generate\n */\n public static async generateKey(\n params: GenerateKeyRequest,\n ): Promise<GenerateKeyResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.generateKey',\n url: `${params.options.litellmApiBaseUrl}/key/generate`,\n normalizedUrl: '/key/generate',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n team_id: params.options.team_id,\n key_type: 'llm_api',\n allowed_routes: ['/chat/completions'],\n ...(params.options.models && { models: params.options.models }),\n ...(params.options.key_alias && { key_alias: params.options.key_alias }),\n ...(params.options.duration && { duration: params.options.duration }),\n ...(params.options.metadata && { metadata: params.options.metadata }),\n ...(params.options.max_budget !== undefined && {\n max_budget: params.options.max_budget,\n }),\n ...(params.options.budget_duration && {\n budget_duration: params.options.budget_duration,\n }),\n ...(params.options.organization_id && {\n organization_id: params.options.organization_id,\n }),\n }\n\n const response = await request<GenerateKeyResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Regenerate (rotate) an existing key. The old key is invalidated\n * immediately; all other key settings are preserved.\n * POST /key/regenerate\n */\n public static async regenerateKey(\n params: RegenerateKeyRequest,\n ): Promise<RegenerateKeyResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.regenerateKey',\n url: `${params.options.litellmApiBaseUrl}/key/regenerate`,\n normalizedUrl: '/key/regenerate',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n key: params.options.key,\n }\n\n const response = await request<RegenerateKeyResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Block a key to quickly disable it\n * POST /key/block\n */\n public static async blockKey(\n params: BlockKeyRequest,\n ): Promise<BlockKeyResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.blockKey',\n url: `${params.options.litellmApiBaseUrl}/key/block`,\n normalizedUrl: '/key/block',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n key: params.options.key,\n }\n\n const response = await request<BlockKeyResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Unblock a key to re-enable it\n * POST /key/unblock\n */\n public static async unblockKey(\n params: UnblockKeyRequest,\n ): Promise<UnblockKeyResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.unblockKey',\n url: `${params.options.litellmApiBaseUrl}/key/unblock`,\n normalizedUrl: '/key/unblock',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n key: params.options.key,\n }\n\n const response = await request<UnblockKeyResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Get information about a key including usage and spend\n * GET /key/info\n */\n public static async getKeyInfo(\n params: GetKeyInfoRequest,\n ): Promise<GetKeyInfoResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.getKeyInfo',\n url: `${params.options.litellmApiBaseUrl}/key/info?key=${encodeURIComponent(params.options.key)}`,\n normalizedUrl: '/key/info',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const response = await request<GetKeyInfoResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\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 /**\n * Delete a key\n * POST /key/delete\n */\n public static async deleteKey(\n params: DeleteKeyRequest,\n ): Promise<DeleteKeyResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.deleteKey',\n url: `${params.options.litellmApiBaseUrl}/key/delete`,\n normalizedUrl: '/key/delete',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n keys: [params.options.key],\n }\n\n const response = await request<DeleteKeyResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n /**\n * Delete a team\n * POST /team/delete\n */\n public static async deleteTeam(\n params: DeleteTeamRequest,\n ): Promise<DeleteTeamResponse> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'LiteLLMService.deleteTeam',\n url: `${params.options.litellmApiBaseUrl}/team/delete`,\n normalizedUrl: '/team/delete',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: {\n name: 'litellm',\n type: 'external',\n },\n }\n\n const body = {\n team_ids: [params.options.team_id],\n }\n\n const response = await request<DeleteTeamResponse>({\n config: params.config,\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n type: 'json',\n headers: {\n Authorization: `Bearer ${params.options.apiToken}`,\n },\n body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n}\n"],
5
+ "mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA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,OAAO,QAAQ,iBAAiB;AAAA,QACxC,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;AAEA,UAAM,OAAO;AAAA,MACX,UAAU,CAAC,OAAO,QAAQ,OAAO;AAAA,IACnC;AAEA,UAAM,WAAW,MAAM,QAA4B;AAAA,MACjD,QAAQ,OAAO;AAAA,MACf,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA,QACP,eAAe,UAAU,OAAO,QAAQ,QAAQ;AAAA,MAClD;AAAA,MACA;AAAA,IACF,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAEA,WAAO,SAAS;AAAA,EAClB;AACF;",
6
6
  "names": []
7
7
  }
package/dist/utils/api.js CHANGED
@@ -243,7 +243,7 @@ async function request(payload) {
243
243
  const end = performance.now();
244
244
  const duration = end - start;
245
245
  if ([429].includes(fetchResponse.status)) {
246
- log(payload, "info", "rate limited");
246
+ log(payload, "info", "rate limited", { durationMs: Math.floor(duration) });
247
247
  sendMetrics(payload, "rate-limit-retry", {
248
248
  duration,
249
249
  statusCode: String(fetchResponse.status)
@@ -283,7 +283,9 @@ async function request(payload) {
283
283
  };
284
284
  return request(payload);
285
285
  }
286
- log(payload, "debug", `rate limited, no more retries`);
286
+ log(payload, "debug", `rate limited, no more retries`, {
287
+ durationMs: Math.floor(duration)
288
+ });
287
289
  }
288
290
  const response = {
289
291
  // eslint-disable-next-line id-length
@@ -297,7 +299,8 @@ async function request(payload) {
297
299
  const responseType = payload.responseType ?? type;
298
300
  if (response.ok) {
299
301
  log(payload, "debug", `request successful in ${Math.floor(duration)}ms`, {
300
- baseUrl: base
302
+ baseUrl: base,
303
+ durationMs: Math.floor(duration)
301
304
  });
302
305
  sendMetrics(payload, "success", {
303
306
  duration,
@@ -361,7 +364,8 @@ async function request(payload) {
361
364
  "debug",
362
365
  `request failed with status ${response.status}: ${statusText}`,
363
366
  {
364
- baseUrl: base
367
+ baseUrl: base,
368
+ durationMs: Math.floor(duration)
365
369
  }
366
370
  );
367
371
  if (TRANSIENT_RETRY_STATUS.includes(response.status) && canRetryTransient(payload)) {
@@ -427,7 +431,8 @@ async function request(payload) {
427
431
  if (canRetryTransient(payload)) {
428
432
  log(payload, "debug", `request failed with no status, retrying`, {
429
433
  baseUrl: base,
430
- error
434
+ error,
435
+ durationMs: Math.floor(duration)
431
436
  });
432
437
  sendMetrics(payload, "transient-retry", {
433
438
  statusCode: "fetch-error",
@@ -439,7 +444,8 @@ async function request(payload) {
439
444
  }
440
445
  log(payload, "error", `request failed with no status`, {
441
446
  baseUrl: base,
442
- error
447
+ error,
448
+ durationMs: Math.floor(duration)
443
449
  });
444
450
  sendMetrics(payload, "error", {
445
451
  statusCode: "fetch-error",