Paramètres : accès API et MCP (jetons) ; documentation

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nh6YQSjM9ni5jiTc8u5Tj1
This commit is contained in:
claude BotandClaude Opus 5.5 committed 2026-10-14 10:14:31 +02:00
1 parent 9b8f53d0d0
commit 6ac2dbd227
7 files changed
+251 -1

No files matched your search

+20
View File
@@ -72,6 +72,16 @@ export interface Share {
expires?: string;
}
/** Jeton d'accès à l'API et au serveur MCP (api : créé ici ; oauth : autorisé depuis un client). */
export interface ApiToken {
id: string;
name: string;
kind: "api" | "oauth";
client?: string;
created: string;
lastUsed?: string;
}
/** Schéma partagé tel que servi sans authentification. */
export interface PublicScene {
name: string;
@@ -203,6 +213,16 @@ export const api = {
await request("/api/shares/revoke-all", { method: "POST" });
},
tokens: async (): Promise<ApiToken[]> => (await request("/api/tokens")).json(),
/** Le jeton en clair (token) n'est renvoyé qu'à la création. */
createToken: async (name: string): Promise<ApiToken & { token: string }> =>
(await request("/api/tokens", json({ name }))).json(),
revokeToken: async (id: string): Promise<void> => {
await request(`/api/tokens/${q(id)}`, { method: "DELETE" });
},
publicScene: async (token: string): Promise<PublicScene> =>
(await request(`/api/public/${q(token)}`)).json(),