@acarmisc/backstage-plugin-litellm 0.36.0 → 0.38.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 +3 -1
- package/dist/components/InsightsTab.d.ts +12 -0
- package/dist/connect.d.ts +2 -0
- package/dist/index.cjs.js +363 -294
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.esm.js +401 -332
- package/dist/index.esm.js.map +4 -4
- package/dist/insights.d.ts +8 -0
- package/dist/types.d.ts +1 -1
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FetchApi, type DiscoveryApi } from '@backstage/frontend-plugin-api';
|
|
2
|
-
import { UserInfo, VirtualKey, ModelInfo, UsageMetrics, TeamMemberUsage, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest, AuditLogsParams, PaginatedAuditLogs, LiteLlmConfig, VectorStoreInfo, McpServerInfo, CreateTeamRequest, CreateTeamResponse, UpdateTeamRequest } from './types';
|
|
2
|
+
import { UserInfo, VirtualKey, ModelInfo, UsageMetrics, TeamMemberUsage, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest, AuditLogsParams, PaginatedAuditLogs, SpendLogsParams, PaginatedSpendLogs, LiteLlmConfig, VectorStoreInfo, McpServerInfo, CreateTeamRequest, CreateTeamResponse, UpdateTeamRequest } from './types';
|
|
3
3
|
export declare class ApiError extends Error {
|
|
4
4
|
body: unknown;
|
|
5
5
|
status: number;
|
|
@@ -45,6 +45,7 @@ export interface LiteLlmApiInterface {
|
|
|
45
45
|
/** Per-member breakdown; rejects (403/404) when the caller may not see it. */
|
|
46
46
|
getTeamMemberUsage(teamId: string, startDate: string, endDate: string): Promise<TeamMemberUsage>;
|
|
47
47
|
getAuditLogs(params: AuditLogsParams): Promise<PaginatedAuditLogs>;
|
|
48
|
+
getSpendLogs(params: SpendLogsParams): Promise<PaginatedSpendLogs>;
|
|
48
49
|
getConfig(): Promise<LiteLlmConfig>;
|
|
49
50
|
createTeam(request: CreateTeamRequest): Promise<CreateTeamResponse>;
|
|
50
51
|
updateTeam(teamId: string, request: UpdateTeamRequest): Promise<TeamInfo>;
|
|
@@ -108,6 +109,7 @@ export declare class LiteLlmApi implements LiteLlmApiInterface {
|
|
|
108
109
|
getUsage(startDate: string, endDate: string): Promise<UsageMetrics>;
|
|
109
110
|
getTeamUsage(teamId: string, startDate: string, endDate: string): Promise<UsageMetrics>;
|
|
110
111
|
getTeamMemberUsage(teamId: string, startDate: string, endDate: string): Promise<TeamMemberUsage>;
|
|
112
|
+
getSpendLogs(params: SpendLogsParams): Promise<PaginatedSpendLogs>;
|
|
111
113
|
getConfig(): Promise<LiteLlmConfig>;
|
|
112
114
|
createTeam(request: CreateTeamRequest): Promise<CreateTeamResponse>;
|
|
113
115
|
updateTeam(teamId: string, request: UpdateTeamRequest): Promise<TeamInfo>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { LiteLlmApiInterface } from '../api';
|
|
3
|
+
import type { DateRange, ModelInfo, UsageMetrics, VirtualKey } from '../types';
|
|
4
|
+
export interface InsightsTabProps {
|
|
5
|
+
api: LiteLlmApiInterface;
|
|
6
|
+
usage: UsageMetrics | null;
|
|
7
|
+
models: ModelInfo[];
|
|
8
|
+
keys: VirtualKey[];
|
|
9
|
+
dateRange: DateRange;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const InsightsTab: FC<InsightsTabProps>;
|
package/dist/connect.d.ts
CHANGED
|
@@ -6,3 +6,5 @@
|
|
|
6
6
|
export declare function isLoopbackCallback(uri: string | null): uri is string;
|
|
7
7
|
/** Hands the keys to the local client as a form POST, so they never land in a URL or the browser history. */
|
|
8
8
|
export declare function postToLoopback(redirectUri: string, fields: [string, string][]): void;
|
|
9
|
+
/** Teams ticked when the page opens: only the ones the client has no key for, when it says (`have`). */
|
|
10
|
+
export declare function initialTeams(all: string[], have: Set<string>): Set<string>;
|