tero
Version:
tero is a JSON document Manager, with ACID complaint and backup recovery mechanism.
47 lines (46 loc) • 1.35 kB
TypeScript
import { CloudStorageConfig } from "./backup.js";
export interface RecoveryConfig {
cloudStorage: CloudStorageConfig;
localPath: string;
autoRecover?: boolean;
recoveryTimeout?: number;
}
export interface RecoveryResult {
success: boolean;
recovered: string[];
failed: string[];
totalFiles: number;
duration: number;
}
export interface FileRecoveryInfo {
key: string;
exists: boolean;
size?: number;
lastModified?: Date;
recovered?: boolean;
}
export declare class DataRecovery {
private s3Client;
private config;
constructor(config: RecoveryConfig);
private initializeCloudStorage;
private getCloudKey;
checkFileInCloud(key: string): Promise<FileRecoveryInfo>;
recoverSingleFile(key: string): Promise<boolean>;
recoverFromArchive(archiveName?: string): Promise<RecoveryResult>;
recoverIndividualFiles(keys?: string[]): Promise<RecoveryResult>;
listAvailableArchives(): Promise<string[]>;
listAvailableFiles(): Promise<string[]>;
private downloadFile;
private extractArchive;
testCloudConnection(): Promise<{
success: boolean;
message: string;
}>;
getRecoveryInfo(): Promise<{
cloudFiles: number;
localFiles: number;
missingLocally: string[];
availableForRecovery: string[];
}>;
}