Receive support for Sender Key

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
Scott Nonnenberg 2021-05-13 18:18:43 -07:00
parent e5f9c0db28
commit e6bab06510
28 changed files with 743 additions and 164 deletions

View file

@ -66,6 +66,16 @@ export type ClientSearchResultMessageType = MessageType & {
bodyRanges: [];
snippet: string;
};
export type SenderKeyType = {
// Primary key
id: string;
// These two are combined into one string to give us the final id
senderId: string;
distributionId: string;
// Raw data to serialize/deserialize into signal-client SenderKeyRecord
data: Buffer;
lastUpdatedDate: number;
};
export type SessionType = {
id: string;
conversationId: string;
@ -171,6 +181,11 @@ export type DataInterface = {
removeAllItems: () => Promise<void>;
getAllItems: () => Promise<Array<ItemType>>;
createOrUpdateSenderKey: (key: SenderKeyType) => Promise<void>;
getSenderKeyById: (id: string) => Promise<SenderKeyType | undefined>;
removeAllSenderKeys: () => Promise<void>;
getAllSenderKeys: () => Promise<Array<SenderKeyType>>;
createOrUpdateSession: (data: SessionType) => Promise<void>;
createOrUpdateSessions: (array: Array<SessionType>) => Promise<void>;
getSessionById: (id: string) => Promise<SessionType | undefined>;