Show backup status in Settings window

This commit is contained in:
trevor-signal
2025-04-02 14:57:29 -04:00
committed by GitHub
parent 51647fef95
commit aba0e028d4
25 changed files with 1136 additions and 191 deletions

10
ts/types/Storage.d.ts vendored
View File

@@ -17,7 +17,11 @@ import type {
SessionResetsType,
StorageServiceCredentials,
} from '../textsecure/Types.d';
import type { BackupCredentialWrapperType } from './backups';
import type {
BackupCredentialWrapperType,
BackupsSubscriptionType,
BackupStatusType,
} from './backups';
import type { ServiceIdString } from './ServiceId';
import type { RegisteredChallengeType } from '../challenge';
@@ -222,6 +226,10 @@ export type StorageAccessType = {
key: string;
};
backupTier: number | undefined;
cloudBackupStatus: BackupStatusType | undefined;
backupSubscriptionStatus: BackupsSubscriptionType;
// If true Desktop message history was restored from backup
isRestoredFromBackup: boolean;

View File

@@ -29,3 +29,35 @@ export type BackupCdnReadCredentialType = Readonly<{
retrievedAtMs: number;
cdnNumber: number;
}>;
export type SubscriptionCostType = {
amount: number;
currencyCode: string;
};
export type BackupStatusType = {
createdAt?: number;
protoSize?: number;
mediaSize?: number;
};
export type BackupsSubscriptionType =
| {
status: 'not-found' | 'expired';
}
| {
status: 'free';
mediaIncludedInBackupDurationDays: number;
}
| (
| {
status: 'active';
renewalDate?: Date;
cost?: SubscriptionCostType;
}
| {
status: 'pending-cancellation';
expiryDate?: Date;
cost?: SubscriptionCostType;
}
);