Skip to content

A modern, self-hosted backup solution for secure, encrypted backups across local and cloud storage.

2.6 KB
Raw Blame
export interface BackupCompletionStats {
   files_new: number;
   files_changed: number;
   files_unmodified: number;
   dirs_new: number;
   dirs_changed: number;
   dirs_unmodified: number;
   data_blobs: number;
   tree_blobs: number;
   data_added: number;
   data_added_packed: number;
   total_files_processed: number;
   total_bytes_processed: number;
   total_duration: number;
   snapshot_id: string;
}

export interface BackupTaskStats {
   message_type: string;
   files_new: number;
   files_changed: number;
   files_unmodified: number;
   dirs_new: number;
   dirs_changed: number;
   dirs_unmodified: number;
   data_blobs: number;
   tree_blobs: number;
   data_added: number;
   data_added_packed: number;
   total_files_processed: number;
   total_bytes_processed: number;
   total_duration: number;
   snapshot_id: string;
   dry_run: boolean;
}

export interface BackupMirror {
   replicationId: string;
   storageId: string;
   storageName: string;
   storagePath: string;
   storageType: string;
   status: 'pending' | 'started' | 'completed' | 'failed';
   started?: number;
   ended?: number;
   error?: string;
   size?: number;
}

export type Backup = {
   id: string;
   title?: string;
   description?: string;
   snapshotId: string;
   started: number;
   ended: number;
   duration: number;
   status: 'completed' | 'cancelled' | 'failed' | 'started' | 'retrying' | 'initializing';
   inProgress: boolean;
   totalFiles: number;
   totalSize: number;
   changes: { new: number; modified: number; removed: number; newDirs?: number; modifiedDirs?: number };
   active?: boolean;
   errorMsg?: string;
   hasRevisions?: boolean;
   revisionsSkipped?: boolean;
   hasChangesFile?: boolean;
   download?: {
      status: string;
      storageId?: string;
      storageName?: string;
      storageType?: string;
      started?: number;
      ended?: number;
      error?: string;
   };
   mirrors?: BackupMirror[];
};

export interface BackupProgressEvent {
   timestamp: string;
   phase: string;
   action: string;
   completed: boolean;
   resticData?: any;
   error?: string;
}

export interface ReplicationProgressData {
   replicationId: string;
   storageId: string;
   storageName: string;
   storageType: string;
   status: 'pending' | 'running' | 'completed' | 'failed' | 'retrying';
   error?: string;
   events: BackupProgressEvent[];
}

export interface BackupProgressData {
   planId: string;
   backupId: string;
   status: string;
   startTime: string;
   lastUpdate: string;
   events: BackupProgressEvent[];
   duration?: number;
   mirrors?: Record<string, ReplicationProgressData>;
}