@acarmisc/backstage-plugin-litellm 0.3.3 → 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.
- package/dist/api.d.ts +11 -1
- package/dist/components/AuditLog.d.ts +7 -0
- package/dist/components/KeysTable.d.ts +4 -0
- package/dist/components/UsageStats.d.ts +2 -1
- package/dist/index.cjs.js +584 -134
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.esm.js +616 -143
- package/dist/index.esm.js.map +4 -4
- package/dist/types.d.ts +32 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetchApi } from '@backstage/core-plugin-api';
|
|
2
|
-
import { UserInfo, VirtualKey, ModelInfo, UsageMetrics, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest } from './types';
|
|
2
|
+
import { UserInfo, VirtualKey, ModelInfo, UsageMetrics, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest, AuditLogsParams, PaginatedAuditLogs } from './types';
|
|
3
3
|
export interface LiteLlmApiInterface {
|
|
4
4
|
getUserInfo(): Promise<UserInfo>;
|
|
5
5
|
listKeys(): Promise<VirtualKey[]>;
|
|
@@ -8,10 +8,15 @@ export interface LiteLlmApiInterface {
|
|
|
8
8
|
deleteKey(keyId: string): Promise<{
|
|
9
9
|
success: boolean;
|
|
10
10
|
}>;
|
|
11
|
+
rotateKey(keyId: string): Promise<GenerateKeyResponse>;
|
|
12
|
+
blockKey(keyId: string): Promise<void>;
|
|
13
|
+
unblockKey(keyId: string): Promise<void>;
|
|
14
|
+
resetKeySpend(keyId: string): Promise<void>;
|
|
11
15
|
listModels(): Promise<ModelInfo[]>;
|
|
12
16
|
getTeams(): Promise<TeamInfo[]>;
|
|
13
17
|
getUsage(startDate: string, endDate: string): Promise<UsageMetrics>;
|
|
14
18
|
getTeamUsage(teamId: string, startDate: string, endDate: string): Promise<UsageMetrics>;
|
|
19
|
+
getAuditLogs(params: AuditLogsParams): Promise<PaginatedAuditLogs>;
|
|
15
20
|
}
|
|
16
21
|
export declare const liteLlmApiRef: import("@backstage/core-plugin-api").ApiRef<LiteLlmApiInterface>;
|
|
17
22
|
export declare class LiteLlmApi implements LiteLlmApiInterface {
|
|
@@ -29,6 +34,11 @@ export declare class LiteLlmApi implements LiteLlmApiInterface {
|
|
|
29
34
|
deleteKey(keyId: string): Promise<{
|
|
30
35
|
success: boolean;
|
|
31
36
|
}>;
|
|
37
|
+
rotateKey(keyId: string): Promise<GenerateKeyResponse>;
|
|
38
|
+
blockKey(keyId: string): Promise<void>;
|
|
39
|
+
unblockKey(keyId: string): Promise<void>;
|
|
40
|
+
resetKeySpend(keyId: string): Promise<void>;
|
|
41
|
+
getAuditLogs(params: AuditLogsParams): Promise<PaginatedAuditLogs>;
|
|
32
42
|
listModels(): Promise<ModelInfo[]>;
|
|
33
43
|
getTeams(): Promise<TeamInfo[]>;
|
|
34
44
|
getUsage(startDate: string, endDate: string): Promise<UsageMetrics>;
|
|
@@ -7,6 +7,10 @@ interface KeysTableProps {
|
|
|
7
7
|
loading: boolean;
|
|
8
8
|
onGenerateKey: (request: GenerateKeyRequest) => Promise<GenerateKeyResponse>;
|
|
9
9
|
onUpdateKey: (keyId: string, request: UpdateKeyRequest) => Promise<void>;
|
|
10
|
+
onRotateKey: (keyId: string) => Promise<GenerateKeyResponse>;
|
|
11
|
+
onBlockKey: (keyId: string) => Promise<void>;
|
|
12
|
+
onUnblockKey: (keyId: string) => Promise<void>;
|
|
13
|
+
onResetKeySpend: (keyId: string) => Promise<void>;
|
|
10
14
|
onDeleteKey: (keyId: string) => Promise<void>;
|
|
11
15
|
}
|
|
12
16
|
export declare const KeysTable: React.FC<KeysTableProps>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DateRange, UsageMetrics, ModelInfo } from '../types';
|
|
2
|
+
import { DateRange, UsageMetrics, ModelInfo, UserInfo } from '../types';
|
|
3
3
|
interface UsageStatsProps {
|
|
4
4
|
usage: UsageMetrics | null;
|
|
5
5
|
models: ModelInfo[];
|
|
6
6
|
dateRange: DateRange;
|
|
7
7
|
onDateRangeChange: (range: DateRange) => void;
|
|
8
8
|
loading: boolean;
|
|
9
|
+
userInfo?: UserInfo;
|
|
9
10
|
}
|
|
10
11
|
export declare const UsageStats: React.FC<UsageStatsProps>;
|
|
11
12
|
export {};
|