@osiris-ai/postgres-sdk
Version:
Osiris Postgres SDK
46 lines • 2.98 kB
TypeScript
import { DatabaseAdapter, DBTokenResponse, AuthenticationRecord, SessionRecord, ConnectionRecord, SecretRecord } from '@osiris-ai/sdk';
import { PostgresConfig } from './types';
/**
* PostgreSQL database adapter for MCP authentication data
* Provides production-ready data storage with proper indexing and constraints
*/
export declare class PostgresDatabaseAdapter implements DatabaseAdapter {
private pool;
private schema;
private config;
private initialized;
constructor(config: PostgresConfig);
private ensureInitialized;
private initialize;
storeAuthentication(auth: Omit<AuthenticationRecord, 'id' | 'createdAt' | 'updatedAt'>): Promise<AuthenticationRecord>;
updateAuthentication(connectionId: string, service: string, updates: Partial<Pick<AuthenticationRecord, 'token' | 'userInfo'>>): Promise<AuthenticationRecord>;
getAuthentication(connectionId: string, service: string): Promise<AuthenticationRecord | null>;
getAuthenticationsForConnection(connectionId: string): Promise<AuthenticationRecord[]>;
deleteAuthentication(id: string): Promise<boolean>;
getSessions(): Promise<SessionRecord[]>;
storeSession(session: Omit<SessionRecord, 'id' | 'createdAt'>): Promise<SessionRecord>;
updateSession(id: string, updates: Partial<Pick<SessionRecord, 'connectedServices' | 'status'>>): Promise<SessionRecord | null>;
getSession(id: string): Promise<SessionRecord | null>;
deleteSession(id: string): Promise<boolean>;
cleanupExpiredSessions(): Promise<number>;
storeConnection(connection: Omit<ConnectionRecord, 'createdAt' | 'updatedAt'>): Promise<ConnectionRecord>;
updateConnection(id: string, updates: Partial<Pick<ConnectionRecord, 'name' | 'description' | 'status' | 'services'>>): Promise<ConnectionRecord>;
getConnection(id: string): Promise<ConnectionRecord | null>;
getConnectionsForPackage(packageId: string): Promise<ConnectionRecord[]>;
deleteConnection(id: string): Promise<boolean>;
storeSecret(secret: Omit<SecretRecord, 'id' | 'createdAt' | 'updatedAt'>): Promise<SecretRecord>;
updateSecret(id: string, updates: Partial<Pick<SecretRecord, 'credentials'>>): Promise<SecretRecord | null>;
getSecretsForConnection(connectionId: string): Promise<SecretRecord[]>;
getSecret(connectionId: string, service: string): Promise<SecretRecord | null>;
deleteSecret(id: string): Promise<boolean>;
storeTokenForService(deploymentId: string, service: string, token: DBTokenResponse, userInfo: {
uniqueId: string;
} | any): Promise<void>;
updateTokenForService(deploymentId: string, service: string, token?: DBTokenResponse, userInfo?: {
uniqueId: string;
} | any): Promise<void>;
getTokensForDeployment(deploymentId: string): Promise<Map<string, DBTokenResponse>>;
getTokenForService(deploymentId: string, service: string): Promise<DBTokenResponse | null>;
close(): Promise<void>;
}
//# sourceMappingURL=adapter.d.ts.map