/**
 * Backup Manager for Onebox
 *
 * Handles service backup and restore operations using @serve.zone/containerarchive
 * for content-addressed, deduplicated, optionally encrypted backup storage.
 *
 * Features:
 * - Service configuration export/import
 * - MongoDB database dumps
 * - S3 bucket contents (smartstorage / legacy MinIO)
 * - ClickHouse database dumps
 * - MariaDB database dumps
 * - Valkey data export
 * - Docker image export/import
 * - Content-addressed deduplication via containerarchive
 * - Legacy .tar.enc backup support for backward compatibility
 */
import * as plugins from '../plugins.js';
import type { IBackup, IBackupResult, IRestoreOptions, IRestoreResult, IBackupCreateOptions } from '../types.js';
import type { Onebox } from './onebox.js';
interface IS3ConnectionInfo {
    endpoint: string;
    accessKey: string;
    secretKey: string;
    bucket: string;
    region: string;
}
export declare class BackupManager {
    private oneboxRef;
    archive: plugins.ContainerArchive | null;
    constructor(oneboxRef: Onebox);
    /**
     * Initialize the containerarchive repository.
     * Opens an existing repo or creates a new one.
     */
    init(): Promise<void>;
    /**
     * Close the containerarchive repository
     */
    close(): Promise<void>;
    /**
     * Create a backup for a service
     * @param serviceName - Name of the service to backup
     * @param options - Optional backup creation options (scheduleId)
     */
    createBackup(serviceName: string, options?: IBackupCreateOptions): Promise<IBackupResult>;
    /**
     * Restore a backup
     * @param backupIdOrPath - Backup ID (number) or legacy file path (string)
     * @param options - Restore options (mode, newServiceName, etc.)
     */
    restoreBackup(backupIdOrPath: number | string, options: IRestoreOptions): Promise<IRestoreResult>;
    /**
     * List all backups
     */
    listBackups(serviceName?: string): Promise<IBackup[]>;
    /**
     * Delete a backup
     */
    deleteBackup(backupId: number): Promise<void>;
    private deleteArchiveSnapshot;
    deleteBackupsForService(serviceId: number): Promise<void>;
    /**
     * Get backup file path for download (legacy backups only)
     */
    getBackupFilePath(backupId: number): Promise<string | null>;
    /**
     * Export a containerarchive backup as a downloadable encrypted tar stream.
     * Returns the path to a temporary encrypted file (caller must clean up).
     */
    getBackupExportPath(backupId: number): Promise<string | null>;
    /**
     * Get backup password from settings
     */
    private getBackupPassword;
    /**
     * Get containerarchive repository path
     */
    private getArchiveRepoPath;
    /**
     * Get legacy backups directory
     */
    private getBackupsDirectory;
    /**
     * Restore from a legacy .tar.enc file
     */
    private restoreLegacyBackup;
    /**
     * Shared restore logic: takes parsed backup data and performs the actual restore
     */
    private migrateLegacyBackupEnvironment;
    private performRestore;
    /**
     * Read a Node.js ReadableStream into a string
     */
    private streamToString;
    /**
     * Write a Node.js ReadableStream to a file
     */
    private streamToFile;
    /**
     * Export service configuration
     */
    private exportServiceConfig;
    private getVolumeBackupName;
    private exportServiceVolumes;
    private restoreServiceVolumes;
    /**
     * Export MongoDB database
     */
    private exportMongoDatabase;
    /**
     * Export an S3 bucket (smartstorage or legacy MinIO)
     */
    private exportS3Bucket;
    /**
     * Export ClickHouse database
     */
    private exportClickHouseDatabase;
    /**
     * Export MariaDB database
     */
    private exportMariaDBDatabase;
    /**
     * Export Valkey data
     */
    private exportValkeyData;
    /**
     * Export Docker image
     */
    private exportDockerImage;
    /**
     * Import Docker image
     */
    private importDockerImage;
    private copyFromContainer;
    private copyToContainer;
    private runDockerCp;
    /**
     * Restore platform resources for a service
     */
    private restorePlatformResources;
    /**
     * Import MongoDB database
     */
    private importMongoDatabase;
    /**
     * Import an S3 bucket (smartstorage or legacy MinIO)
     */
    private importS3Bucket;
    /**
     * Import ClickHouse database
     */
    private importClickHouseDatabase;
    /**
     * Import MariaDB database
     */
    private importMariaDBDatabase;
    /**
     * Import Valkey data
     */
    private importValkeyData;
    /**
     * Create tar archive from directory
     */
    private createTarArchive;
    /**
     * Extract tar archive to directory
     */
    private extractTarArchive;
    /**
     * Encrypt a file using AES-256-GCM
     */
    private encryptFile;
    /**
     * Decrypt a file using AES-256-GCM
     */
    private decryptFile;
    /**
     * Derive encryption key from password using PBKDF2
     */
    private deriveKey;
    /**
     * Compute SHA-256 checksum
     */
    private computeChecksum;
    private getS3ConnectionInfo;
    getReachableS3ConnectionInfo(credentials: Record<string, string>, platformServiceId: number): Promise<IS3ConnectionInfo>;
    createS3Client(s3Info: IS3ConnectionInfo): import("@aws-sdk/client-s3").S3Client;
    private walkFiles;
    private toArrayBuffer;
}
export {};
