Enable attachment backup uploading

This commit is contained in:
trevor-signal 2024-05-29 19:46:43 -04:00 committed by GitHub
parent 94a262b799
commit 4254356812
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 2054 additions and 534 deletions

View file

@ -33,6 +33,7 @@ import type { CallLinkStateType, CallLinkType } from '../types/CallLink';
import type { AttachmentDownloadJobType } from '../types/AttachmentDownload';
import type { GroupSendEndorsementsData } from '../types/GroupSendEndorsements';
import type { SyncTaskType } from '../util/syncTasks';
import type { AttachmentBackupJobType } from '../types/AttachmentBackup';
export type AdjacentMessagesByConversationOptionsType = Readonly<{
conversationId: string;
@ -425,6 +426,12 @@ export type EditedMessageType = Readonly<{
readStatus: MessageType['readStatus'];
}>;
export type BackupCdnMediaObjectType = {
mediaId: string;
cdnNumber: number;
sizeOnBackupCdn: number;
};
export type DataInterface = {
close: () => Promise<void>;
pauseWriteAccess(): Promise<void>;
@ -761,6 +768,22 @@ export type DataInterface = {
job: AttachmentDownloadJobType
) => Promise<void>;
getNextAttachmentBackupJobs: (options: {
limit: number;
timestamp?: number;
}) => Promise<Array<AttachmentBackupJobType>>;
saveAttachmentBackupJob: (job: AttachmentBackupJobType) => Promise<void>;
markAllAttachmentBackupJobsInactive: () => Promise<void>;
removeAttachmentBackupJob: (job: AttachmentBackupJobType) => Promise<void>;
clearAllBackupCdnObjectMetadata: () => Promise<void>;
saveBackupCdnObjectMetadata: (
mediaObjects: Array<BackupCdnMediaObjectType>
) => Promise<void>;
getBackupCdnObjectMetadata: (
mediaId: string
) => Promise<BackupCdnMediaObjectType | undefined>;
createOrUpdateStickerPack: (pack: StickerPackType) => Promise<void>;
updateStickerPackStatus: (
id: string,