@acarmisc/backstage-plugin-litellm 0.1.13 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts CHANGED
@@ -1,29 +1,36 @@
1
1
  import { FetchApi } from '@backstage/core-plugin-api';
2
- import { UserInfo, VirtualKey, ModelInfo, UsageMetrics, GenerateKeyRequest, GenerateKeyResponse } from './types';
2
+ import { UserInfo, VirtualKey, ModelInfo, UsageMetrics, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest } from './types';
3
3
  export interface LiteLlmApiInterface {
4
- getUserInfo(userId?: string): Promise<UserInfo>;
5
- listKeys(userId?: string): Promise<VirtualKey[]>;
4
+ getUserInfo(): Promise<UserInfo>;
5
+ listKeys(): Promise<VirtualKey[]>;
6
6
  generateKey(request: GenerateKeyRequest): Promise<GenerateKeyResponse>;
7
+ updateKey(keyId: string, request: UpdateKeyRequest): Promise<VirtualKey>;
7
8
  deleteKey(keyId: string): Promise<{
8
9
  success: boolean;
9
10
  }>;
10
11
  listModels(): Promise<ModelInfo[]>;
11
- getUsage(startDate: string, endDate: string, userId?: string): Promise<UsageMetrics>;
12
+ getTeams(): Promise<TeamInfo[]>;
13
+ getUsage(startDate: string, endDate: string): Promise<UsageMetrics>;
14
+ getTeamUsage(teamId: string, startDate: string, endDate: string): Promise<UsageMetrics>;
12
15
  }
13
16
  export declare const liteLlmApiRef: import("@backstage/core-plugin-api").ApiRef<LiteLlmApiInterface>;
14
17
  export declare class LiteLlmApi implements LiteLlmApiInterface {
15
18
  private fetchApi;
16
19
  private basePath;
17
20
  constructor(fetchApi: FetchApi, basePath?: string);
21
+ private throwIfNotOk;
18
22
  private get;
19
23
  private post;
20
24
  private del;
21
- getUserInfo(userId?: string): Promise<UserInfo>;
22
- listKeys(userId?: string): Promise<VirtualKey[]>;
25
+ getUserInfo(): Promise<UserInfo>;
26
+ listKeys(): Promise<VirtualKey[]>;
23
27
  generateKey(request: GenerateKeyRequest): Promise<GenerateKeyResponse>;
28
+ updateKey(keyId: string, request: UpdateKeyRequest): Promise<VirtualKey>;
24
29
  deleteKey(keyId: string): Promise<{
25
30
  success: boolean;
26
31
  }>;
27
32
  listModels(): Promise<ModelInfo[]>;
28
- getUsage(startDate: string, endDate: string, userId?: string): Promise<UsageMetrics>;
33
+ getTeams(): Promise<TeamInfo[]>;
34
+ getUsage(startDate: string, endDate: string): Promise<UsageMetrics>;
35
+ getTeamUsage(teamId: string, startDate: string, endDate: string): Promise<UsageMetrics>;
29
36
  }
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- import { UserInfo } from '../types';
2
+ import { UserInfo, TeamInfo } from '../types';
3
3
  interface DashboardHeaderProps {
4
- userInfo: UserInfo | null;
4
+ userInfo: UserInfo;
5
+ teams: TeamInfo[];
5
6
  loading: boolean;
6
7
  }
7
8
  export declare const DashboardHeader: React.FC<DashboardHeaderProps>;
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
- import { VirtualKey, ModelInfo, GenerateKeyRequest, GenerateKeyResponse } from '../types';
2
+ import { VirtualKey, ModelInfo, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest } from '../types';
3
3
  interface KeysTableProps {
4
4
  keys: VirtualKey[];
5
5
  models: ModelInfo[];
6
+ teams: TeamInfo[];
6
7
  loading: boolean;
7
8
  onGenerateKey: (request: GenerateKeyRequest) => Promise<GenerateKeyResponse>;
9
+ onUpdateKey: (keyId: string, request: UpdateKeyRequest) => Promise<void>;
8
10
  onDeleteKey: (keyId: string) => Promise<void>;
9
11
  }
10
12
  export declare const KeysTable: React.FC<KeysTableProps>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { TeamInfo, UsageMetrics, DateRange } from '../types';
3
+ interface TeamUsageProps {
4
+ teams: TeamInfo[];
5
+ loading: boolean;
6
+ dateRange: DateRange;
7
+ getTeamUsage: (teamId: string) => UsageMetrics | null;
8
+ getTeamUsageLoading: (teamId: string) => boolean;
9
+ }
10
+ export declare const TeamUsage: React.FC<TeamUsageProps>;
11
+ export {};