2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-09-24 21:53:21 +00:00
|
|
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
|
|
/* eslint-disable camelcase */
|
|
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2020-04-01 18:59:11 +00:00
|
|
|
import { LocaleMessagesType } from '../types/I18N';
|
|
|
|
|
2020-09-24 21:53:21 +00:00
|
|
|
import {
|
|
|
|
ConversationModelCollectionType,
|
|
|
|
MessageModelCollectionType,
|
|
|
|
} from '../model-types.d';
|
|
|
|
import { MessageModel } from '../models/messages';
|
|
|
|
import { ConversationModel } from '../models/conversations';
|
|
|
|
|
2020-04-01 18:59:11 +00:00
|
|
|
export type AttachmentDownloadJobType = any;
|
|
|
|
export type ConverationMetricsType = any;
|
|
|
|
export type ConversationType = any;
|
|
|
|
export type EmojiType = any;
|
|
|
|
export type IdentityKeyType = any;
|
|
|
|
export type ItemType = any;
|
|
|
|
export type MessageType = any;
|
|
|
|
export type MessageTypeUnhydrated = any;
|
|
|
|
export type PreKeyType = any;
|
|
|
|
export type SearchResultMessageType = any;
|
|
|
|
export type SessionType = any;
|
|
|
|
export type SignedPreKeyType = any;
|
|
|
|
export type StickerPackStatusType = string;
|
|
|
|
export type StickerPackType = any;
|
|
|
|
export type StickerType = any;
|
|
|
|
export type UnprocessedType = any;
|
|
|
|
|
|
|
|
export interface DataInterface {
|
|
|
|
close: () => Promise<void>;
|
|
|
|
removeDB: () => Promise<void>;
|
|
|
|
removeIndexedDBFiles: () => Promise<void>;
|
|
|
|
|
|
|
|
createOrUpdateIdentityKey: (data: IdentityKeyType) => Promise<void>;
|
|
|
|
getIdentityKeyById: (id: string) => Promise<IdentityKeyType | undefined>;
|
|
|
|
bulkAddIdentityKeys: (array: Array<IdentityKeyType>) => Promise<void>;
|
|
|
|
removeIdentityKeyById: (id: string) => Promise<void>;
|
|
|
|
removeAllIdentityKeys: () => Promise<void>;
|
|
|
|
getAllIdentityKeys: () => Promise<Array<IdentityKeyType>>;
|
|
|
|
|
|
|
|
createOrUpdatePreKey: (data: PreKeyType) => Promise<void>;
|
|
|
|
getPreKeyById: (id: number) => Promise<PreKeyType | undefined>;
|
|
|
|
bulkAddPreKeys: (array: Array<PreKeyType>) => Promise<void>;
|
|
|
|
removePreKeyById: (id: number) => Promise<void>;
|
|
|
|
removeAllPreKeys: () => Promise<void>;
|
|
|
|
getAllPreKeys: () => Promise<Array<PreKeyType>>;
|
|
|
|
|
|
|
|
createOrUpdateSignedPreKey: (data: SignedPreKeyType) => Promise<void>;
|
|
|
|
getSignedPreKeyById: (id: number) => Promise<SignedPreKeyType | undefined>;
|
|
|
|
bulkAddSignedPreKeys: (array: Array<SignedPreKeyType>) => Promise<void>;
|
|
|
|
removeSignedPreKeyById: (id: number) => Promise<void>;
|
|
|
|
removeAllSignedPreKeys: () => Promise<void>;
|
|
|
|
getAllSignedPreKeys: () => Promise<Array<SignedPreKeyType>>;
|
|
|
|
|
|
|
|
createOrUpdateItem: (data: ItemType) => Promise<void>;
|
|
|
|
getItemById: (id: string) => Promise<ItemType | undefined>;
|
|
|
|
bulkAddItems: (array: Array<ItemType>) => Promise<void>;
|
|
|
|
removeItemById: (id: string) => Promise<void>;
|
|
|
|
removeAllItems: () => Promise<void>;
|
|
|
|
getAllItems: () => Promise<Array<ItemType>>;
|
|
|
|
|
|
|
|
createOrUpdateSession: (data: SessionType) => Promise<void>;
|
|
|
|
createOrUpdateSessions: (array: Array<SessionType>) => Promise<void>;
|
|
|
|
getSessionById: (id: string) => Promise<SessionType | undefined>;
|
|
|
|
getSessionsById: (conversationId: string) => Promise<Array<SessionType>>;
|
|
|
|
bulkAddSessions: (array: Array<SessionType>) => Promise<void>;
|
|
|
|
removeSessionById: (id: string) => Promise<void>;
|
|
|
|
removeSessionsByConversation: (conversationId: string) => Promise<void>;
|
|
|
|
removeAllSessions: () => Promise<void>;
|
|
|
|
getAllSessions: () => Promise<Array<SessionType>>;
|
|
|
|
|
2020-09-09 00:56:23 +00:00
|
|
|
eraseStorageServiceStateFromConversations: () => Promise<void>;
|
2020-04-01 18:59:11 +00:00
|
|
|
getConversationCount: () => Promise<number>;
|
|
|
|
saveConversation: (data: ConversationType) => Promise<void>;
|
|
|
|
saveConversations: (array: Array<ConversationType>) => Promise<void>;
|
|
|
|
updateConversations: (array: Array<ConversationType>) => Promise<void>;
|
|
|
|
getAllConversationIds: () => Promise<Array<string>>;
|
|
|
|
|
|
|
|
searchConversations: (
|
|
|
|
query: string,
|
|
|
|
options?: { limit?: number }
|
|
|
|
) => Promise<Array<ConversationType>>;
|
|
|
|
searchMessages: (
|
|
|
|
query: string,
|
|
|
|
options?: { limit?: number }
|
|
|
|
) => Promise<Array<SearchResultMessageType>>;
|
|
|
|
searchMessagesInConversation: (
|
|
|
|
query: string,
|
|
|
|
conversationId: string,
|
|
|
|
options?: { limit?: number }
|
|
|
|
) => Promise<Array<SearchResultMessageType>>;
|
|
|
|
|
2020-05-27 21:37:06 +00:00
|
|
|
getMessageCount: (conversationId?: string) => Promise<number>;
|
2020-04-01 18:59:11 +00:00
|
|
|
saveMessages: (
|
|
|
|
arrayOfMessages: Array<MessageType>,
|
|
|
|
options: { forceSave?: boolean }
|
|
|
|
) => Promise<void>;
|
|
|
|
getAllMessageIds: () => Promise<Array<string>>;
|
|
|
|
getMessageMetricsForConversation: (
|
|
|
|
conversationId: string
|
|
|
|
) => Promise<ConverationMetricsType>;
|
2020-12-07 20:43:19 +00:00
|
|
|
hasGroupCallHistoryMessage: (
|
|
|
|
conversationId: string,
|
|
|
|
eraId: string
|
|
|
|
) => Promise<boolean>;
|
2020-07-10 18:28:49 +00:00
|
|
|
migrateConversationMessages: (
|
|
|
|
obsoleteId: string,
|
|
|
|
currentId: string
|
|
|
|
) => Promise<void>;
|
2020-04-01 18:59:11 +00:00
|
|
|
|
|
|
|
getUnprocessedCount: () => Promise<number>;
|
|
|
|
getAllUnprocessed: () => Promise<Array<UnprocessedType>>;
|
|
|
|
saveUnprocessed: (
|
|
|
|
data: UnprocessedType,
|
|
|
|
options?: { forceSave?: boolean }
|
|
|
|
) => Promise<number>;
|
|
|
|
updateUnprocessedAttempts: (id: string, attempts: number) => Promise<void>;
|
|
|
|
updateUnprocessedWithData: (
|
|
|
|
id: string,
|
|
|
|
data: UnprocessedType
|
|
|
|
) => Promise<void>;
|
|
|
|
updateUnprocessedsWithData: (array: Array<UnprocessedType>) => Promise<void>;
|
|
|
|
getUnprocessedById: (id: string) => Promise<UnprocessedType | undefined>;
|
|
|
|
saveUnprocesseds: (
|
|
|
|
arrayOfUnprocessed: Array<UnprocessedType>,
|
|
|
|
options?: { forceSave?: boolean }
|
|
|
|
) => Promise<void>;
|
|
|
|
removeUnprocessed: (id: string) => Promise<void>;
|
|
|
|
removeAllUnprocessed: () => Promise<void>;
|
|
|
|
|
|
|
|
getNextAttachmentDownloadJobs: (
|
|
|
|
limit?: number,
|
|
|
|
options?: { timestamp?: number }
|
|
|
|
) => Promise<Array<AttachmentDownloadJobType>>;
|
|
|
|
saveAttachmentDownloadJob: (job: AttachmentDownloadJobType) => Promise<void>;
|
|
|
|
setAttachmentDownloadJobPending: (
|
|
|
|
id: string,
|
|
|
|
pending: boolean
|
|
|
|
) => Promise<void>;
|
|
|
|
resetAttachmentDownloadPending: () => Promise<void>;
|
|
|
|
removeAttachmentDownloadJob: (id: string) => Promise<void>;
|
|
|
|
removeAllAttachmentDownloadJobs: () => Promise<void>;
|
|
|
|
|
|
|
|
createOrUpdateStickerPack: (pack: StickerPackType) => Promise<void>;
|
|
|
|
updateStickerPackStatus: (
|
|
|
|
id: string,
|
|
|
|
status: StickerPackStatusType,
|
|
|
|
options?: { timestamp: number }
|
|
|
|
) => Promise<void>;
|
|
|
|
createOrUpdateSticker: (sticker: StickerType) => Promise<void>;
|
|
|
|
updateStickerLastUsed: (
|
|
|
|
packId: string,
|
|
|
|
stickerId: number,
|
|
|
|
lastUsed: number
|
|
|
|
) => Promise<void>;
|
|
|
|
addStickerPackReference: (messageId: string, packId: string) => Promise<void>;
|
|
|
|
deleteStickerPackReference: (
|
|
|
|
messageId: string,
|
|
|
|
packId: string
|
|
|
|
) => Promise<Array<string>>;
|
|
|
|
getStickerCount: () => Promise<number>;
|
|
|
|
deleteStickerPack: (packId: string) => Promise<Array<string>>;
|
|
|
|
getAllStickerPacks: () => Promise<Array<StickerPackType>>;
|
|
|
|
getAllStickers: () => Promise<Array<StickerType>>;
|
|
|
|
getRecentStickers: (options?: {
|
|
|
|
limit?: number;
|
|
|
|
}) => Promise<Array<StickerType>>;
|
|
|
|
|
|
|
|
updateEmojiUsage: (shortName: string, timeUsed?: number) => Promise<void>;
|
|
|
|
getRecentEmojis: (limit?: number) => Promise<Array<EmojiType>>;
|
|
|
|
|
|
|
|
removeAll: () => Promise<void>;
|
|
|
|
removeAllConfiguration: () => Promise<void>;
|
|
|
|
|
|
|
|
getMessagesNeedingUpgrade: (
|
|
|
|
limit: number,
|
|
|
|
options: { maxVersion: number }
|
|
|
|
) => Promise<Array<MessageType>>;
|
|
|
|
getMessagesWithVisualMediaAttachments: (
|
|
|
|
conversationId: string,
|
|
|
|
options: { limit: number }
|
|
|
|
) => Promise<Array<MessageType>>;
|
|
|
|
getMessagesWithFileAttachments: (
|
|
|
|
conversationId: string,
|
|
|
|
options: { limit: number }
|
|
|
|
) => Promise<Array<MessageType>>;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The reason for client/server divergence is the need to inject Backbone models and
|
|
|
|
// collections into data calls so those are the objects returned. This was necessary in
|
|
|
|
// July 2018 when creating the Data API as a drop-in replacement for previous database
|
|
|
|
// requests via ORM.
|
|
|
|
|
|
|
|
// Note: It is extremely important that items are duplicated between these two. Client.js
|
|
|
|
// loops over all of its local functions to generate the server-side IPC-based API.
|
|
|
|
|
|
|
|
export type ServerInterface = DataInterface & {
|
|
|
|
getAllConversations: () => Promise<Array<ConversationType>>;
|
|
|
|
getAllGroupsInvolvingId: (id: string) => Promise<Array<ConversationType>>;
|
|
|
|
getAllPrivateConversations: () => Promise<Array<ConversationType>>;
|
|
|
|
getConversationById: (id: string) => Promise<ConversationType>;
|
|
|
|
getExpiredMessages: () => Promise<Array<MessageType>>;
|
|
|
|
getMessageById: (id: string) => Promise<MessageType | undefined>;
|
|
|
|
getMessageBySender: (options: {
|
|
|
|
source: string;
|
|
|
|
sourceUuid: string;
|
|
|
|
sourceDevice: string;
|
|
|
|
sent_at: number;
|
|
|
|
}) => Promise<Array<MessageType>>;
|
|
|
|
getMessagesBySentAt: (sentAt: number) => Promise<Array<MessageType>>;
|
|
|
|
getOlderMessagesByConversation: (
|
|
|
|
conversationId: string,
|
2020-09-24 20:57:54 +00:00
|
|
|
options?: {
|
|
|
|
limit?: number;
|
|
|
|
receivedAt?: number;
|
2021-01-13 16:32:18 +00:00
|
|
|
sentAt?: number;
|
2020-09-24 20:57:54 +00:00
|
|
|
messageId?: string;
|
|
|
|
}
|
2020-04-01 18:59:11 +00:00
|
|
|
) => Promise<Array<MessageTypeUnhydrated>>;
|
|
|
|
getNewerMessagesByConversation: (
|
|
|
|
conversationId: string,
|
2021-01-13 16:32:18 +00:00
|
|
|
options?: { limit?: number; receivedAt?: number; sentAt?: number }
|
2020-04-01 18:59:11 +00:00
|
|
|
) => Promise<Array<MessageTypeUnhydrated>>;
|
2021-01-20 17:31:44 +00:00
|
|
|
getLastConversationActivity: (options: {
|
|
|
|
conversationId: string;
|
|
|
|
ourConversationId: string;
|
|
|
|
}) => Promise<MessageType | undefined>;
|
|
|
|
getLastConversationPreview: (options: {
|
|
|
|
conversationId: string;
|
|
|
|
ourConversationId: string;
|
|
|
|
}) => Promise<MessageType | undefined>;
|
2020-04-01 18:59:11 +00:00
|
|
|
getNextExpiringMessage: () => Promise<MessageType>;
|
|
|
|
getNextTapToViewMessageToAgeOut: () => Promise<MessageType>;
|
|
|
|
getOutgoingWithoutExpiresAt: () => Promise<Array<MessageType>>;
|
|
|
|
getTapToViewMessagesNeedingErase: () => Promise<Array<MessageType>>;
|
|
|
|
getUnreadByConversation: (
|
|
|
|
conversationId: string
|
|
|
|
) => Promise<Array<MessageType>>;
|
|
|
|
removeConversation: (id: Array<string> | string) => Promise<void>;
|
2021-01-13 00:42:15 +00:00
|
|
|
removeMessage: (id: string) => Promise<void>;
|
|
|
|
removeMessages: (ids: Array<string>) => Promise<void>;
|
2020-04-01 18:59:11 +00:00
|
|
|
saveMessage: (
|
|
|
|
data: MessageType,
|
|
|
|
options: { forceSave?: boolean }
|
2020-09-24 20:57:54 +00:00
|
|
|
) => Promise<string>;
|
2020-04-01 18:59:11 +00:00
|
|
|
updateConversation: (data: ConversationType) => Promise<void>;
|
|
|
|
|
|
|
|
// For testing only
|
|
|
|
_getAllMessages: () => Promise<Array<MessageType>>;
|
|
|
|
|
|
|
|
// Server-only
|
|
|
|
|
|
|
|
initialize: (options: {
|
|
|
|
configDir: string;
|
|
|
|
key: string;
|
|
|
|
messages: LocaleMessagesType;
|
|
|
|
}) => Promise<boolean>;
|
|
|
|
|
|
|
|
removeKnownAttachments: (
|
|
|
|
allAttachments: Array<string>
|
|
|
|
) => Promise<Array<string>>;
|
|
|
|
removeKnownStickers: (allStickers: Array<string>) => Promise<Array<string>>;
|
|
|
|
removeKnownDraftAttachments: (
|
|
|
|
allStickers: Array<string>
|
|
|
|
) => Promise<Array<string>>;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type ClientInterface = DataInterface & {
|
2021-01-13 00:42:15 +00:00
|
|
|
getAllConversations: (options: {
|
2020-07-10 18:28:49 +00:00
|
|
|
ConversationCollection: typeof ConversationModelCollectionType;
|
|
|
|
}) => Promise<ConversationModelCollectionType>;
|
2020-04-01 18:59:11 +00:00
|
|
|
getAllGroupsInvolvingId: (
|
|
|
|
id: string,
|
2021-01-13 00:42:15 +00:00
|
|
|
options: {
|
2020-07-10 18:28:49 +00:00
|
|
|
ConversationCollection: typeof ConversationModelCollectionType;
|
2020-04-01 18:59:11 +00:00
|
|
|
}
|
2020-07-10 18:28:49 +00:00
|
|
|
) => Promise<ConversationModelCollectionType>;
|
2021-01-13 00:42:15 +00:00
|
|
|
getAllPrivateConversations: (options: {
|
2020-07-10 18:28:49 +00:00
|
|
|
ConversationCollection: typeof ConversationModelCollectionType;
|
|
|
|
}) => Promise<ConversationModelCollectionType>;
|
2020-04-01 18:59:11 +00:00
|
|
|
getConversationById: (
|
|
|
|
id: string,
|
2021-01-13 00:42:15 +00:00
|
|
|
options: { Conversation: typeof ConversationModel }
|
2020-09-24 20:57:54 +00:00
|
|
|
) => Promise<ConversationModel>;
|
2021-01-13 00:42:15 +00:00
|
|
|
getExpiredMessages: (options: {
|
2020-07-10 18:28:49 +00:00
|
|
|
MessageCollection: typeof MessageModelCollectionType;
|
|
|
|
}) => Promise<MessageModelCollectionType>;
|
2020-04-01 18:59:11 +00:00
|
|
|
getMessageById: (
|
|
|
|
id: string,
|
2021-01-13 00:42:15 +00:00
|
|
|
options: { Message: typeof MessageModel }
|
2020-04-01 18:59:11 +00:00
|
|
|
) => Promise<MessageType | undefined>;
|
|
|
|
getMessageBySender: (
|
2021-01-13 00:42:15 +00:00
|
|
|
data: {
|
2020-04-01 18:59:11 +00:00
|
|
|
source: string;
|
|
|
|
sourceUuid: string;
|
|
|
|
sourceDevice: string;
|
|
|
|
sent_at: number;
|
|
|
|
},
|
2021-01-13 00:42:15 +00:00
|
|
|
options: { Message: typeof MessageModel }
|
2020-09-24 20:57:54 +00:00
|
|
|
) => Promise<MessageModel | null>;
|
2020-04-01 18:59:11 +00:00
|
|
|
getMessagesBySentAt: (
|
|
|
|
sentAt: number,
|
2021-01-13 00:42:15 +00:00
|
|
|
options: { MessageCollection: typeof MessageModelCollectionType }
|
2020-07-10 18:28:49 +00:00
|
|
|
) => Promise<MessageModelCollectionType>;
|
2020-04-01 18:59:11 +00:00
|
|
|
getOlderMessagesByConversation: (
|
|
|
|
conversationId: string,
|
|
|
|
options: {
|
|
|
|
limit?: number;
|
2020-09-24 20:57:54 +00:00
|
|
|
messageId?: string;
|
2020-04-01 18:59:11 +00:00
|
|
|
receivedAt?: number;
|
2021-01-13 16:32:18 +00:00
|
|
|
sentAt?: number;
|
2020-07-10 18:28:49 +00:00
|
|
|
MessageCollection: typeof MessageModelCollectionType;
|
2020-04-01 18:59:11 +00:00
|
|
|
}
|
2020-07-10 18:28:49 +00:00
|
|
|
) => Promise<MessageModelCollectionType>;
|
2020-04-01 18:59:11 +00:00
|
|
|
getNewerMessagesByConversation: (
|
|
|
|
conversationId: string,
|
|
|
|
options: {
|
|
|
|
limit?: number;
|
|
|
|
receivedAt?: number;
|
2021-01-13 16:32:18 +00:00
|
|
|
sentAt?: number;
|
2020-07-10 18:28:49 +00:00
|
|
|
MessageCollection: typeof MessageModelCollectionType;
|
2020-04-01 18:59:11 +00:00
|
|
|
}
|
2020-07-10 18:28:49 +00:00
|
|
|
) => Promise<MessageModelCollectionType>;
|
2021-01-20 17:31:44 +00:00
|
|
|
getLastConversationActivity: (options: {
|
|
|
|
conversationId: string;
|
|
|
|
ourConversationId: string;
|
|
|
|
Message: typeof MessageModel;
|
|
|
|
}) => Promise<MessageModel | undefined>;
|
|
|
|
getLastConversationPreview: (options: {
|
|
|
|
conversationId: string;
|
|
|
|
ourConversationId: string;
|
|
|
|
Message: typeof MessageModel;
|
|
|
|
}) => Promise<MessageModel | undefined>;
|
2021-01-13 00:42:15 +00:00
|
|
|
getNextExpiringMessage: (options: {
|
2020-09-24 20:57:54 +00:00
|
|
|
Message: typeof MessageModel;
|
|
|
|
}) => Promise<MessageModel | null>;
|
2021-01-13 00:42:15 +00:00
|
|
|
getNextTapToViewMessageToAgeOut: (options: {
|
2020-09-24 20:57:54 +00:00
|
|
|
Message: typeof MessageModel;
|
|
|
|
}) => Promise<MessageModel | null>;
|
2021-01-13 00:42:15 +00:00
|
|
|
getOutgoingWithoutExpiresAt: (options: {
|
2020-07-10 18:28:49 +00:00
|
|
|
MessageCollection: typeof MessageModelCollectionType;
|
|
|
|
}) => Promise<MessageModelCollectionType>;
|
2021-01-13 00:42:15 +00:00
|
|
|
getTapToViewMessagesNeedingErase: (options: {
|
2020-07-10 18:28:49 +00:00
|
|
|
MessageCollection: typeof MessageModelCollectionType;
|
|
|
|
}) => Promise<MessageModelCollectionType>;
|
2020-04-01 18:59:11 +00:00
|
|
|
getUnreadByConversation: (
|
|
|
|
conversationId: string,
|
2021-01-13 00:42:15 +00:00
|
|
|
options: { MessageCollection: typeof MessageModelCollectionType }
|
2020-07-10 18:28:49 +00:00
|
|
|
) => Promise<MessageModelCollectionType>;
|
2020-04-01 18:59:11 +00:00
|
|
|
removeConversation: (
|
|
|
|
id: string,
|
2021-01-13 00:42:15 +00:00
|
|
|
options: { Conversation: typeof ConversationModel }
|
2020-04-01 18:59:11 +00:00
|
|
|
) => Promise<void>;
|
|
|
|
removeMessage: (
|
|
|
|
id: string,
|
2021-01-13 00:42:15 +00:00
|
|
|
options: { Message: typeof MessageModel }
|
|
|
|
) => Promise<void>;
|
|
|
|
removeMessages: (
|
|
|
|
ids: Array<string>,
|
|
|
|
options: { Message: typeof MessageModel }
|
2020-04-01 18:59:11 +00:00
|
|
|
) => Promise<void>;
|
|
|
|
saveMessage: (
|
|
|
|
data: MessageType,
|
2020-09-24 20:57:54 +00:00
|
|
|
options: { forceSave?: boolean; Message: typeof MessageModel }
|
|
|
|
) => Promise<string>;
|
|
|
|
updateConversation: (data: ConversationType, extra?: unknown) => void;
|
2020-04-01 18:59:11 +00:00
|
|
|
|
|
|
|
// Test-only
|
|
|
|
|
2021-01-13 00:42:15 +00:00
|
|
|
_getAllMessages: (options: {
|
2020-07-10 18:28:49 +00:00
|
|
|
MessageCollection: typeof MessageModelCollectionType;
|
|
|
|
}) => Promise<MessageModelCollectionType>;
|
2020-04-01 18:59:11 +00:00
|
|
|
|
|
|
|
// Client-side only
|
|
|
|
|
|
|
|
shutdown: () => Promise<void>;
|
|
|
|
removeAllMessagesInConversation: (
|
|
|
|
conversationId: string,
|
2021-01-13 00:42:15 +00:00
|
|
|
options: {
|
|
|
|
logId: string;
|
|
|
|
MessageCollection: typeof MessageModelCollectionType;
|
|
|
|
}
|
2020-04-01 18:59:11 +00:00
|
|
|
) => Promise<void>;
|
|
|
|
removeOtherData: () => Promise<void>;
|
|
|
|
cleanupOrphanedAttachments: () => Promise<void>;
|
|
|
|
ensureFilePermissions: () => Promise<void>;
|
|
|
|
|
|
|
|
// Client-side only, and test-only
|
|
|
|
|
|
|
|
_removeConversations: (ids: Array<string>) => Promise<void>;
|
|
|
|
_cleanData: (data: any, path?: string) => any;
|
|
|
|
_jobs: { [id: string]: ClientJobType };
|
|
|
|
};
|
|
|
|
|
|
|
|
export type ClientJobType = {
|
|
|
|
fnName: string;
|
|
|
|
start: number;
|
|
|
|
resolve?: Function;
|
|
|
|
reject?: Function;
|
|
|
|
|
|
|
|
// Only in DEBUG mode
|
|
|
|
complete?: boolean;
|
|
|
|
args?: Array<any>;
|
|
|
|
};
|