Add quak backup-metadata: dump all decrypted metadata to plain JSON
New command: quak backup-metadata <dir>
Dumps every piece of decrypted account metadata into a directory tree
of plain JSON files without downloading any file content. Layout:
<dir>/
account.json { email, userID }
collections/
<id>-<name>/
_collection.json { id, name, type, pubMagicMetadata?, ... }
<fileID>.json { id, metadata, magicMetadata?, pubMagicMetadata? }
Also adds collection-level magic metadata decryption (magicMetadata,
pubMagicMetadata, sharedMagicMetadata) to decryptCollection, which was
previously only done for files. The server sends these for visibility
settings, sort order, cover photo selection, etc.
6 new tests covering: account.json, per-collection dirs with
_collection.json, collection pubMagicMetadata decryption, per-file
JSON with all three metadata layers, graceful handling of files with
no magic metadata, and incremental re-run safety. 116 total.
This commit is contained in:
@@ -15,6 +15,9 @@ export interface Collection {
|
||||
type: CollectionType;
|
||||
updationTime: Microseconds;
|
||||
isShared: boolean;
|
||||
magicMetadata?: Record<string, unknown>;
|
||||
pubMagicMetadata?: Record<string, unknown>;
|
||||
sharedMagicMetadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export type FileType = "image" | "video" | "livePhoto" | "unknown";
|
||||
@@ -59,6 +62,9 @@ export interface RawCollection {
|
||||
type: string;
|
||||
updationTime: number;
|
||||
isDeleted?: boolean;
|
||||
magicMetadata?: RawMagicMetadata;
|
||||
pubMagicMetadata?: RawMagicMetadata;
|
||||
sharedMagicMetadata?: RawMagicMetadata;
|
||||
}
|
||||
|
||||
export interface RawMagicMetadata {
|
||||
|
||||
Reference in New Issue
Block a user