feat: add backup replication contracts

This commit is contained in:
2026-05-07 17:44:31 +00:00
parent dbcb75c460
commit 6f1bc574fd
2 changed files with 131 additions and 2 deletions
+36 -1
View File
@@ -1,4 +1,12 @@
export type TBackupStatus = 'pending' | 'running' | 'ready' | 'failed' | 'restoring' | 'restored';
export type TBackupStatus =
| 'pending'
| 'running'
| 'replicating'
| 'replicated'
| 'ready'
| 'failed'
| 'restoring'
| 'restored';
export type TBackupTrigger = 'manual' | 'scheduled';
@@ -37,6 +45,32 @@ export type TBackupSnapshot =
| IBackupDatabaseSnapshot
| IBackupObjectStorageSnapshot;
export type TBackupReplicationTargetType = 's3' | 'smb';
export interface IBackupArchiveObject {
path: string;
size: number;
sha256: string;
}
export interface IBackupArchiveManifest {
version: 1;
backupId: string;
createdAt: number;
objects: IBackupArchiveObject[];
totalSize: number;
}
export interface IBackupReplicationResult {
targetType: TBackupReplicationTargetType;
targetPath: string;
manifestPath: string;
manifestSha256: string;
objectCount: number;
totalSize: number;
completedAt: number;
}
export interface IBackupRestoreEvent {
restoredAt: number;
status: 'restored' | 'failed';
@@ -51,6 +85,7 @@ export interface IBackupRecord {
status: TBackupStatus;
trigger: TBackupTrigger;
snapshots: TBackupSnapshot[];
replication?: IBackupReplicationResult;
createdAt: number;
updatedAt: number;
completedAt?: number;