import { SchemaConfig } from './schema'; import { StorageObject, StorageOptions } from './storage'; import { SchemaVersionManager } from './schema-versioning'; export interface SchemaMetadata { name: string; version: number; schema: SchemaConfig; prefix: string; options: StorageOptions; createdAt: Date; updatedAt: Date; lastAccessedAt: Date; statistics: { objectCount: number; createCount: number; readCount: number; updateCount: number; deleteCount: number; totalOperations: number; averageObjectSize: number; totalStorageSize: number; }; attributes: { fieldCount: number; indexedFieldCount: number; fields: Record; }; performance: { averageCreateTime: number; averageReadTime: number; averageUpdateTime: number; averageDeleteTime: number; slowestOperation: { type: string; duration: number; timestamp: Date; }; }; status: 'active' | 'inactive' | 'deprecated'; tags?: string[]; description?: string; } export interface RegistryOptions { redisUrl?: string; redisHost?: string; redisPort?: number; registryPrefix?: string; autoTrack?: boolean; persistMetadata?: boolean; metadataRefreshInterval?: number; } export interface BackupOptions { includeData?: boolean; includeMetadata?: boolean; compress?: boolean; } export interface RestoreOptions { overwrite?: boolean; skipExisting?: boolean; validateSchema?: boolean; } export declare class SchemaRegistry { private static instance; private static REGISTRY_KEY; private registeredSchemas; private storageInstances; private versionManagers; private client; private options; private metricsInterval; private registryKey; private keyManager; private initialized; private initializationPromise; private compiledSchemas; private constructor(); static getInstance(options?: RegistryOptions): SchemaRegistry; /** * Reset the singleton instance (for testing or reinitialization) */ static reset(): Promise; /** * Check if the registry is healthy * @returns true if registry is operating normally */ isHealthy(): Promise; /** * Get registry statistics * @returns Registry statistics including schema count, total operations, etc. */ getStats(): Promise<{ schemaCount: number; totalOperations: number; activeSchemas: number; deprecatedSchemas: number; }>; private initialize; private doInitialize; private initializeRedisClient; private loadPersistedSchemas; register(name: string, schema: SchemaConfig, options?: StorageOptions): Promise; private analyzeSchema; private persistSchema; getStorage = any>(name: string): Promise | null>; registerStorageInstance = any>(name: string, storage: StorageObject): Promise; private creatingInstances; private createStorageInstance; private doCreateStorageInstance; private wrapStorageMethods; private updateStatistics; private updateLastAccessed; getAllSchemas(): Promise; getSchemaMetadata(name: string): Promise; updateObjectCount(name: string): Promise; private startMetricsCollection; backup(options?: BackupOptions): Promise; restore(backupJson: string, options?: RestoreOptions): Promise<{ success: boolean; restored: string[]; failed: string[]; errors: Record; }>; cleanup(inactiveDays?: number): Promise<{ cleaned: string[]; kept: string[]; }>; validate(name: string): Promise<{ valid: boolean; errors: string[]; warnings: string[]; }>; getStatistics(): Promise<{ totalSchemas: number; activeSchemas: number; totalObjects: number; totalOperations: number; storageSize: number; topSchemas: Array<{ name: string; operations: number; objects: number; }>; }>; getVersionManager(name: string): SchemaVersionManager | undefined; shutdown(): Promise; clearAllPersistedSchemas(): Promise; /** * Unregister a schema and remove its storage instance from cache * This properly cleans up both the schema and the cached instance */ unregister(name: string): Promise; /** * Remove just the storage instance from cache (keeps schema) */ removeStorageInstance(name: string): void; /** * Register schema with version in single hash */ registerSchemaVersion(name: string, version: number): Promise; /** * Get all registered schemas from single hash */ getAllRegisteredSchemas(): Promise>; /** * Check if schema is registered in single hash */ hasSchema(name: string): Promise; /** * Get schema version from single hash */ getSchemaVersion(name: string): Promise; /** * Remove schema from single hash */ removeSchemaFromRegistry(name: string): Promise; } export declare function getSchemaRegistry(options?: RegistryOptions): SchemaRegistry; //# sourceMappingURL=schema-registry.d.ts.map