1
0
forked from wrenn/wrenn

Added basic frontend (#1)

Reviewed-on: wrenn/sandbox#1
Co-authored-by: pptx704 <rafeed@omukk.dev>
Co-committed-by: pptx704 <rafeed@omukk.dev>
This commit is contained in:
2026-03-22 19:01:38 +00:00
committed by Rafeed M. Bhuiyan
parent 866f3ac012
commit 97292ba0bf
76 changed files with 5770 additions and 683 deletions

View File

@ -0,0 +1,26 @@
import { apiFetch, type ApiResult } from '$lib/api/client';
export type APIKey = {
id: string;
team_id: string;
name: string;
key_prefix: string;
created_by: string;
creator_email?: string;
created_at: string;
last_used?: string;
key?: string; // only present immediately after creation
};
export async function listKeys(): Promise<ApiResult<APIKey[]>> {
return apiFetch('GET', '/api/v1/api-keys');
}
export async function createKey(name: string): Promise<ApiResult<APIKey>> {
return apiFetch('POST', '/api/v1/api-keys', { name });
}
export async function revokeKey(id: string): Promise<ApiResult<void>> {
return apiFetch('DELETE', `/api/v1/api-keys/${id}`);
}