u
This commit is contained in:
51
src/db/mcp.js
Normal file
51
src/db/mcp.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import { getStore } from './store.js';
|
||||
|
||||
export async function registerClient(input) {
|
||||
const store = await getStore();
|
||||
return store.mcp.registerClient(input);
|
||||
}
|
||||
|
||||
export async function getClient(clientId) {
|
||||
const store = await getStore();
|
||||
return (await store.mcp.getClient(clientId)) ?? null;
|
||||
}
|
||||
|
||||
export async function listClients() {
|
||||
const store = await getStore();
|
||||
return store.mcp.listClients();
|
||||
}
|
||||
|
||||
export async function deleteClient(clientId) {
|
||||
const store = await getStore();
|
||||
return store.mcp.deleteClient(clientId);
|
||||
}
|
||||
|
||||
export async function createAuthCode(input) {
|
||||
const store = await getStore();
|
||||
return store.mcp.createAuthCode(input);
|
||||
}
|
||||
|
||||
export async function getAuthCode(code) {
|
||||
const store = await getStore();
|
||||
return (await store.mcp.getAuthCode(code)) ?? null;
|
||||
}
|
||||
|
||||
export async function consumeAuthCode(code) {
|
||||
const store = await getStore();
|
||||
return store.mcp.consumeAuthCode(code);
|
||||
}
|
||||
|
||||
export async function createRefreshToken(input) {
|
||||
const store = await getStore();
|
||||
return store.mcp.createRefreshToken(input);
|
||||
}
|
||||
|
||||
export async function getRefreshToken(refreshToken) {
|
||||
const store = await getStore();
|
||||
return (await store.mcp.getRefreshToken(refreshToken)) ?? null;
|
||||
}
|
||||
|
||||
export async function revokeRefreshToken(refreshToken) {
|
||||
const store = await getStore();
|
||||
return store.mcp.revokeRefreshToken(refreshToken);
|
||||
}
|
||||
@@ -54,6 +54,7 @@ const STORE_NAMESPACES = [
|
||||
'package',
|
||||
'articlelist',
|
||||
'optionslist',
|
||||
'mcp',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user