@acarmisc/backstage-plugin-litellm 0.35.0 → 0.37.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 +9 -0
- package/dist/components/ConnectPage.d.ts +7 -0
- package/dist/connect.d.ts +10 -0
- package/dist/index.cjs.js +294 -150
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.esm.js +279 -135
- package/dist/index.esm.js.map +4 -4
- package/dist/plugin.d.ts +40 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ export interface LiteLlmApiInterface {
|
|
|
26
26
|
}>;
|
|
27
27
|
listModels(): Promise<ModelInfo[]>;
|
|
28
28
|
getTeams(): Promise<TeamInfo[]>;
|
|
29
|
+
connectLocalClient(redirectUri: string, team?: string): Promise<{
|
|
30
|
+
key: string;
|
|
31
|
+
team: string | null;
|
|
32
|
+
}>;
|
|
29
33
|
getManagedTeams(): Promise<TeamInfo[]>;
|
|
30
34
|
addTeamMember(teamId: string, body: {
|
|
31
35
|
userEntityRef: string;
|
|
@@ -85,6 +89,11 @@ export declare class LiteLlmApi implements LiteLlmApiInterface {
|
|
|
85
89
|
}>;
|
|
86
90
|
getAuditLogs(params: AuditLogsParams): Promise<PaginatedAuditLogs>;
|
|
87
91
|
listModels(): Promise<ModelInfo[]>;
|
|
92
|
+
/** Mints (or rotates) the caller's connect-flow key, optionally bound to one of their teams. */
|
|
93
|
+
connectLocalClient(redirectUri: string, team?: string): Promise<{
|
|
94
|
+
key: string;
|
|
95
|
+
team: string | null;
|
|
96
|
+
}>;
|
|
88
97
|
getTeams(): Promise<TeamInfo[]>;
|
|
89
98
|
getManagedTeams(): Promise<TeamInfo[]>;
|
|
90
99
|
addTeamMember(teamId: string, body: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Confirmation page for local clients (abby-desktop installer, OpenCode plugins): mints one
|
|
4
|
+
* key per selected team through fetchApi, so the Backstage session authenticates the call,
|
|
5
|
+
* then hands the keys back to the client's loopback listener.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ConnectPage: FC;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local-client connect flow (e.g. abby-desktop's installer): the client listens on a loopback
|
|
3
|
+
* port and opens /litellm/connect?redirect_uri=http://localhost:<port>/callback&state=<nonce>.
|
|
4
|
+
*/
|
|
5
|
+
/** Same rule as the backend: only http://localhost|127.0.0.1:<port>/callback, never an open redirect. */
|
|
6
|
+
export declare function isLoopbackCallback(uri: string | null): uri is string;
|
|
7
|
+
/** Hands the keys to the local client as a form POST, so they never land in a URL or the browser history. */
|
|
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>;
|