Enable downloading attachments from backup CDN
This commit is contained in:
parent
2964006b79
commit
1e8047cf73
21 changed files with 989 additions and 385 deletions
|
@ -78,6 +78,14 @@ export type AttachmentType = {
|
|||
textAttachment?: TextAttachmentType;
|
||||
wasTooBig?: boolean;
|
||||
|
||||
incrementalMac?: string;
|
||||
incrementalMacChunkSize?: number;
|
||||
|
||||
backupLocator?: {
|
||||
mediaName: string;
|
||||
cdnNumber?: number;
|
||||
};
|
||||
|
||||
/** Legacy field. Used only for downloading old attachments */
|
||||
id?: number;
|
||||
|
||||
|
|
|
@ -4,6 +4,11 @@ import { z } from 'zod';
|
|||
import { MIMETypeSchema, type MIMEType } from './MIME';
|
||||
import type { AttachmentType } from './Attachment';
|
||||
|
||||
export enum MediaTier {
|
||||
STANDARD = 'standard',
|
||||
BACKUP = 'backup',
|
||||
}
|
||||
|
||||
export const attachmentDownloadTypeSchema = z.enum([
|
||||
'long-message',
|
||||
'attachment',
|
||||
|
|
|
@ -89,3 +89,6 @@ export type JSONWithUnknownFields<Value> = Value extends Record<
|
|||
: Value extends Array<infer E>
|
||||
? ReadonlyArray<JSONWithUnknownFields<E>>
|
||||
: Value;
|
||||
|
||||
export type WithRequiredProperties<T, P extends keyof T> = Omit<T, P> &
|
||||
Required<Pick<T, P>>;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { BackupLevel } from '@signalapp/libsignal-client/zkgroup';
|
||||
import type { GetBackupCDNCredentialsResponseType } from '../textsecure/WebAPI';
|
||||
|
||||
export type BackupCredentialType = Readonly<{
|
||||
credential: string;
|
||||
|
@ -18,3 +19,9 @@ export type BackupSignedPresentationType = Readonly<{
|
|||
headers: BackupPresentationHeadersType;
|
||||
level: BackupLevel;
|
||||
}>;
|
||||
|
||||
export type BackupCdnReadCredentialType = Readonly<{
|
||||
credentials: Readonly<GetBackupCDNCredentialsResponseType>;
|
||||
retrievedAtMs: number;
|
||||
cdnNumber: number;
|
||||
}>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue