interface EventLog {
    append(tenant, messageCid, indexes): Promise<void>;
    clear(): Promise<void>;
    close(): Promise<void>;
    deleteEventsByCid(tenant, messageCids): Promise<void>;
    getEvents(tenant, cursor?): Promise<{
        cursor?: PaginationCursor;
        events: string[];
    }>;
    open(): Promise<void>;
    queryEvents(tenant, filters, cursor?): Promise<{
        cursor?: PaginationCursor;
        events: string[];
    }>;
}

Implemented by

Methods

  • adds an event to a tenant's event log

    Parameters

    • tenant: string

      the tenant's DID

    • messageCid: string

      the CID of the message

    • indexes: KeyValues

      (key-value pairs) to be included as part of indexing this event.

    Returns Promise<void>

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

    Returns Promise<void>

  • closes the connection to the underlying store

    Returns Promise<void>

  • deletes any events that have any of the messageCids provided

    Parameters

    • tenant: string
    • messageCids: string[]

    Returns Promise<void>

    the number of events deleted

  • Retrieves all of a tenant's events that occurred after the cursor provided. If no cursor is provided, all events for a given tenant will be returned.

    The cursor is a messageCid.

    Returns an array of messageCids that represent the events.

    Parameters

    Returns Promise<{
        cursor?: PaginationCursor;
        events: string[];
    }>

  • opens a connection to the underlying store

    Returns Promise<void>

  • retrieves a filtered set of events that occurred after a the cursor provided, accepts multiple filters.

    If no cursor is provided, all events for a given tenant and filter combo will be returned. The cursor is a messageCid.

    Returns an array of messageCids that represent the events.

    Parameters

    Returns Promise<{
        cursor?: PaginationCursor;
        events: string[];
    }>