Interface MessageStore

interface MessageStore {
    clear(): Promise<void>;
    close(): Promise<void>;
    delete(tenant: string, cid: string, options?: MessageStoreOptions): Promise<void>;
    get(tenant: string, cid: string, options?: MessageStoreOptions): Promise<undefined | GenericMessage>;
    open(): Promise<void>;
    put(tenant: string, message: GenericMessage, indexes: KeyValues, options?: MessageStoreOptions): Promise<void>;
    query(tenant: string, filters: Filter[], messageSort?: MessageSort, pagination?: Pagination, options?: MessageStoreOptions): Promise<{
        cursor?: PaginationCursor;
        messages: GenericMessage[];
    }>;
}

Implemented by

Methods

  • Clears the entire store. Mainly used for cleaning up in test environment.

    Returns Promise<void>

  • adds a message to the underlying store. Uses the message's cid as the key

    Parameters

    Returns Promise<void>