Skip to main content

Function: downloadBackupWithMetadata()

function downloadBackupWithMetadata(args: {
downloadObject: (key: string) => Promise<Buffer<ArrayBufferLike>>;
key: string;
}): Promise<{
buffer: Buffer;
entry: CloudBackupEntry;
}>;

Defined in: electron/services/cloud/providers/cloudBackupIo.ts:46

Downloads a backup object and its .metadata.json sidecar.

Parameters​

args​

Download parameters.

downloadObject​

(key: string) => Promise<Buffer<ArrayBufferLike>>

Provider download primitive. Must accept POSIX-style keys.

key​

string

Backup key to download (must already be normalized by the provider).

Returns​

Promise<{ buffer: Buffer; entry: CloudBackupEntry; }>

Both the backup buffer and the parsed CloudBackupEntry.

Remarks​

This helper assumes the provider stores backup metadata as UTF-8 JSON at the canonical sidecar key returned by backupMetadataKeyForBackupKey.

Providers are responsible for normalizing the backup key (POSIX separators, no leading slashes, etc.) before calling this function.