Files
FileHost/app/types/backup.ts
T
2026-10-17 17:31:30 +08:00

65 lines
1.3 KiB
TypeScript

export type BackupJobType = 'full_export' | 'full_restore' | 'backend_sync' | 'site_sync'
export type BackupJobStatus = 'pending' | 'running' | 'done' | 'failed'
export type SiteSyncDirection = 'push' | 'pull'
export interface BackupJobItem {
id: string
type: BackupJobType
status: BackupJobStatus
progress: number
total: number
message: string
payload: Record<string, unknown>
outputPath: string | null
archiveName: string | null
downloadable: boolean
error: string | null
createdAt: string
updatedAt: string
finishedAt: string | null
}
export interface BackupEstimate {
imageCount: number
imageBytes: number
databaseBytes: number
totalBytes: number
}
export interface BackupPackageItem {
name: string
bytes: number
modifiedAt: string
}
export interface BackupRestorePreview {
imageCount: number
imageBytes: number
newImages: number
conflictingImages: number
formatVersion: number
appVersion: string
createdAt: string
}
export interface BackendSyncPreview {
imageCount: number
imageBytes: number
fromBackendId: string
toBackendId: string
}
export interface SyncDraft {
fromBackendId: string
toBackendId: string
}
export interface SiteSyncRequest {
targetBaseUrl: string
token: string
conflictMode: 'skip' | 'overwrite'
direction: SiteSyncDirection
resumeJobId?: string
abandonJobId?: string
}