mcp-memory-ts
Version:
Cloud-based vector MCP memory service for Claude.ai - TypeScript implementation
101 lines • 2.78 kB
TypeScript
/**
* Schema Compatibility Layer
* Provides seamless interoperability between TypeScript and Python schemas
*/
import type { Memory, Entity } from '../types/base.js';
/**
* Schema compatibility manager
*/
export declare class SchemaCompatibility {
/**
* Memory field mappings between TypeScript and Python
*/
private static memoryFieldMappings;
/**
* Entity field mappings
*/
private static entityFieldMappings;
/**
* Map memory fields for database compatibility
*/
static mapMemoryForDatabase(memory: Partial<Memory>): Record<string, any>;
/**
* Map memory fields from database to TypeScript model
*/
static mapMemoryFromDatabase(row: Record<string, any>): Memory;
/**
* Map entity fields for database compatibility
*/
static mapEntityForDatabase(entity: Partial<Entity>): Record<string, any>;
/**
* Map entity fields from database to TypeScript model
*/
static mapEntityFromDatabase(row: Record<string, any>): Entity;
/**
* Generate UUID v4 for Python compatibility
*/
static generateUUID(): string;
/**
* Convert Python snake_case to TypeScript camelCase
*/
static snakeToCamel(str: string): string;
/**
* Convert TypeScript camelCase to Python snake_case
*/
static camelToSnake(str: string): string;
/**
* Transform API response for Python compatibility
*/
static transformForPythonAPI(data: any): any;
/**
* Transform API request from Python format
*/
static transformFromPythonAPI(data: any): any;
}
/**
* API Key security utilities
*/
export declare class ApiKeySecurity {
/**
* Hash an API key using SHA-256
*/
static hashApiKey(apiKey: string): string;
/**
* Verify an API key against a hash
*/
static verifyApiKey(apiKey: string, hash: string): boolean;
/**
* Generate a new secure API key
*/
static generateApiKey(): string;
/**
* Check if an API key needs hashing
*/
static needsHashing(storedKey: string | null): boolean;
/**
* Migrate a plaintext key to hashed format
*/
static migrateKey(plaintextKey: string): {
original: string;
hashed: string;
migrated: boolean;
};
}
/**
* Database compatibility utilities
*/
export declare class DatabaseCompatibility {
/**
* Check if database has required compatibility columns
*/
static checkCompatibility(db: any): Promise<{
compatible: boolean;
missingColumns: string[];
suggestions: string[];
}>;
/**
* Apply compatibility fixes
*/
static applyCompatibilityFixes(db: any): Promise<void>;
}
//# sourceMappingURL=compatibility.d.ts.map