MCPcopy
hub / github.com/benjitaylor/agentation / TenantStore

Interface TenantStore

mcp/src/server/sqlite.ts:571–601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569// -----------------------------------------------------------------------------
570
571export interface TenantStore {
572 // Organizations
573 createOrganization(name: string): Organization;
574 getOrganization(id: string): Organization | undefined;
575
576 // Users
577 createUser(email: string, orgId: string, role?: UserRole): User;
578 getUser(id: string): User | undefined;
579 getUserByEmail(email: string): User | undefined;
580 getUsersByOrg(orgId: string): User[];
581
582 // API Keys
583 createApiKey(userId: string, name: string, expiresAt?: string): { apiKey: ApiKey; rawKey: string };
584 getApiKeyByHash(hash: string): ApiKey | undefined;
585 listApiKeys(userId: string): ApiKey[];
586 deleteApiKey(id: string): boolean;
587 updateApiKeyLastUsed(id: string): void;
588
589 // User-scoped sessions
590 createSessionForUser(userId: string, url: string, projectId?: string): Session;
591 listSessionsForUser(userId: string): Session[];
592 getSessionForUser(userId: string, sessionId: string): Session | undefined;
593 getSessionWithAnnotationsForUser(userId: string, sessionId: string): SessionWithAnnotations | undefined;
594
595 // User-scoped annotations
596 getPendingAnnotationsForUser(userId: string, sessionId: string): Annotation[];
597 getAllPendingForUser(userId: string): Annotation[];
598
599 // Lifecycle
600 close(): void;
601}
602
603// -----------------------------------------------------------------------------
604// Tenant Store Implementation

Callers 22

createOrganizationFunction · 0.80
getOrganizationFunction · 0.80
createUserFunction · 0.80
getUserFunction · 0.80
getUserByEmailFunction · 0.80
getUsersByOrgFunction · 0.80
createApiKeyFunction · 0.80
getApiKeyByHashFunction · 0.80
listApiKeysFunction · 0.80
deleteApiKeyFunction · 0.80
updateApiKeyLastUsedFunction · 0.80
createSessionForUserFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…