Skip to main content
reference

Types

BreakEvent

Represents a generic event structure.

interface BreakEvent{
channel: Channel;
connectionId: string;
data: any;
type: "libBreak";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataanyData associated with the event.
type"libBreak"Type of the event.

ConnectedEvent

Represents an event for when the user connects to PrivMX Bridge.

interface ConnectedEvent{
channel: Channel;
connectionId: string;
data: any;
type: "libConnected";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataanyData associated with the event.
type"libConnected"Type of the event.

Context

Represents a user's Context.

interface Context{
contextId: string;
userId: string;
}

Fields

NameTypeDescription
contextIdstringUnique identifier of given Context.
userIdstringUnique identifier of the user associated with this Context.

DisconnectedEvent

Represents an event for when the user disconnects from PrivMX Bridge.

interface DisconnectedEvent{
channel: Channel;
connectionId: string;
data: any;
type: "libDisconnected";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataanyData associated with the event.
type"libDisconnected"Type of the event.

GenericEvent

Represents a generic event structure.

interface GenericEvent{
channel: Channel;
connectionId: string;
data: any;
type: string;
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataanyData associated with the event.
typestringType of the event.

InboxCreatedEvent

Represents an event for when an Inbox is created.

interface InboxCreatedEvent{
channel: Channel;
connectionId: string;
data: Inbox;
type: "inboxCreated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataInboxData associated with the event.
type"inboxCreated"Type of the event.

InboxDeletedEvent

Represents an event for when an Inbox is deleted.

interface InboxDeletedEvent{
channel: Channel;
connectionId: string;
data: InboxDeletedEventData;
type: "inboxDeleted";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataInboxDeletedEventDataData associated with the event.
type"inboxDeleted"Type of the event.

InboxEntryCreatedEvent

Represents an event for when a new Inbox entry is added to an Inbox.

interface InboxEntryCreatedEvent{
channel: Channel;
connectionId: string;
data: InboxEntry;
type: "inboxEntryCreated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataInboxEntryData associated with the event.
type"inboxEntryCreated"Type of the event.

InboxEntryDeletedEvent

Represents an event for when an entry is deleted from an Inbox.

interface InboxEntryDeletedEvent{
channel: Channel;
connectionId: string;
data: InboxEntryDeletedEventData;
type: "inboxEntryDeleted";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataInboxEntryDeletedEventDataData associated with the event.
type"inboxEntryDeleted"Type of the event.

InboxUpdatedEvent

Represents an event for when an Inbox is updated.

interface InboxUpdatedEvent{
channel: Channel;
connectionId: string;
data: Inbox;
type: "inboxUpdated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataInboxData associated with the event.
type"inboxUpdated"Type of the event.

LibDisconnectedEvent

Represents a generic event structure.

interface LibDisconnectedEvent{
channel: Channel;
connectionId: string;
data: any;
type: "libPlatformDisconnected";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataanyData associated with the event.
type"libPlatformDisconnected"Type of the event.

ListOptions

interface ListOptions{
lastId: string;
pageSize: number;
sort: SortOrder;
}

Fields

NameTypeDescription
lastIdstringAn optional ID that, if provided, sets the starting point for the query. The item with this ID will be the first item in the result set.
pageSizenumberHow many messages per page (default: 100).
sortSortOrderSort oder by date. Can be either 'asc' for ascending order or 'desc' for descending.

PagingList

Represents a paginated list of items of type `T`.

interface PagingList{
readItems: T[];
totalAvailable: number;
}

Fields

NameTypeDescription
readItemsT[]An array of items of type `T` that were read from the data source.
totalAvailablenumberThe total number of items available in the entire collection, not just the number of items returned in `readItems`.

PagingQuery

Represents the query parameters for fetching a paginated list of items.

interface PagingQuery{
lastId: string;
limit: number;
skip: number;
sortOrder: SortOrder;
}

Fields

NameTypeDescription
lastIdstringAn optional ID that, if provided, sets the starting point for the query. The item with this ID will be the first item in the result set.
limitnumberThe maximum number of items to retrieve. It limits the size of the result set.
skipnumberThe number of items to skip before starting to collect the result set.
sortOrderSortOrderSort order by date. Can be either 'asc' for ascending order or 'desc' for descending.

StoreCreatedEvent

Represents an event for when a Store is created.

interface StoreCreatedEvent{
channel: Channel;
connectionId: string;
data: Store;
type: "storeCreated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataStoreData associated with the event.
type"storeCreated"Type of the event.

StoreDeletedEvent

Represents an event for when a Store is deleted.

interface StoreDeletedEvent{
channel: Channel;
connectionId: string;
data: StoreDeletedEventData;
type: "storeDeleted";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataStoreDeletedEventDataData associated with the event.
type"storeDeleted"Type of the event.

StoreFileCreatedEvent

Represents an event for when a file is created in a Store.

interface StoreFileCreatedEvent{
channel: Channel;
connectionId: string;
data: PrivmxFile;
type: "storeFileCreated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataPrivmxFileData associated with the event.
type"storeFileCreated"Type of the event.

StoreFileDeletedEvent

Represents an event for when a file is deleted from a Store.

interface StoreFileDeletedEvent{
channel: Channel;
connectionId: string;
data: StoreFileDeletedEventData;
type: "storeFileDeleted";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataStoreFileDeletedEventDataData associated with the event.
type"storeFileDeleted"Type of the event.

StoreFileUpdatedEvent

Represents an event for when a file in a Store is updated.

interface StoreFileUpdatedEvent{
channel: Channel;
connectionId: string;
data: PrivmxFile;
type: "storeFileUpdated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataPrivmxFileData associated with the event.
type"storeFileUpdated"Type of the event.

StoreStatsChangedEvent

Represents an event for when the statistics of a Store are changed.

interface StoreStatsChangedEvent{
channel: Channel;
connectionId: string;
data: StoreStatsChangedEventData;
type: "storeStatsChanged";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataStoreStatsChangedEventDataData associated with the event.
type"storeStatsChanged"Type of the event.

StoreUpdatedEvent

Represents an event for when a Store is updated.

interface StoreUpdatedEvent{
channel: Channel;
connectionId: string;
data: Store;
type: "storeUpdated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataStoreData associated with the event.
type"storeUpdated"Type of the event.

SubscribeForChannel

interface SubscribeForChannel{
on: (eventType: E,callback: (payload: Extract<ThreadCreatedEvent, {type: E;}> | Extract<ThreadUpdatedEvent, {type: E;}> | Extract<ThreadDeletedEvent, {type: E;}> | Extract<ThreadStatsEvent, {type: E;}> | Extract<ThreadNewMessageEvent, {type: E;}> | Extract<ThreadMessageDeletedEvent, {type: E;}> | Extract<ThreadMessageUpdatedEvent, {type: E;}> | Extract<StoreFileCreatedEvent, {type: E;}> | Extract<StoreFileUpdatedEvent, {type: E;}> | Extract<StoreFileDeletedEvent, {type: E;}> | Extract<StoreCreatedEvent, {type: E;}> | Extract<StoreUpdatedEvent, {type: E;}> | Extract<StoreDeletedEvent, {type: E;}> | Extract<StoreStatsChangedEvent, {type: E;}> | Extract<InboxEntryCreatedEvent, {type: E;}> | Extract<InboxEntryDeletedEvent, {type: E;}> | Extract<InboxCreatedEvent, {type: E;}> | Extract<InboxUpdatedEvent, {type: E;}> | Extract<InboxDeletedEvent, {type: E;}> | Extract<ConnectedEvent, {type: E;}> | Extract<LibDisconnectedEvent, {type: E;}> | Extract<DisconnectedEvent, {type: E;}> | Extract<BreakEvent, {type: E;}>)=>void)=>SubscribeForChannel<T> & {
removeEventListener: ()=>void;
};
}

Fields

NameTypeDescription
on(eventType: E,callback: (payload: Extract<ThreadCreatedEvent, {type: E;}> | Extract<ThreadUpdatedEvent, {type: E;}> | Extract<ThreadDeletedEvent, {type: E;}> | Extract<ThreadStatsEvent, {type: E;}> | Extract<ThreadNewMessageEvent, {type: E;}> | Extract<ThreadMessageDeletedEvent, {type: E;}> | Extract<ThreadMessageUpdatedEvent, {type: E;}> | Extract<StoreFileCreatedEvent, {type: E;}> | Extract<StoreFileUpdatedEvent, {type: E;}> | Extract<StoreFileDeletedEvent, {type: E;}> | Extract<StoreCreatedEvent, {type: E;}> | Extract<StoreUpdatedEvent, {type: E;}> | Extract<StoreDeletedEvent, {type: E;}> | Extract<StoreStatsChangedEvent, {type: E;}> | Extract<InboxEntryCreatedEvent, {type: E;}> | Extract<InboxEntryDeletedEvent, {type: E;}> | Extract<InboxCreatedEvent, {type: E;}> | Extract<InboxUpdatedEvent, {type: E;}> | Extract<InboxDeletedEvent, {type: E;}> | Extract<ConnectedEvent, {type: E;}> | Extract<LibDisconnectedEvent, {type: E;}> | Extract<DisconnectedEvent, {type: E;}> | Extract<BreakEvent, {type: E;}>)=>void)=>SubscribeForChannel<T> & { removeEventListener: ()=>void; }

ThreadCreatedEvent

Represents an event for when a Thread is created.

interface ThreadCreatedEvent{
channel: Channel;
connectionId: string;
data: Thread;
type: "threadCreated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataThreadData associated with the event.
type"threadCreated"Type of the event.

ThreadDeletedEvent

Represents an event for when a Thread is deleted.

interface ThreadDeletedEvent{
channel: Channel;
connectionId: string;
data: ThreadDeletedEventData;
type: "threadDeleted";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataThreadDeletedEventDataData associated with the event.
type"threadDeleted"Type of the event.

ThreadMessageDeletedEvent

Represents an event for when a message is deleted from a Thread.

interface ThreadMessageDeletedEvent{
channel: Channel;
connectionId: string;
data: ThreadDeletedMessageEventData;
type: "threadMessageDeleted";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataThreadDeletedMessageEventDataData associated with the event.
type"threadMessageDeleted"Type of the event.

ThreadMessageUpdatedEvent

Represents an event for when a message in a Thread is updated.

interface ThreadMessageUpdatedEvent{
channel: Channel;
connectionId: string;
data: Message;
type: "threadMessageUpdated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataMessageData associated with the event.
type"threadMessageUpdated"Type of the event.

ThreadNewMessageEvent

Represents an event for when a new message is added to a Thread.

interface ThreadNewMessageEvent{
channel: Channel;
connectionId: string;
data: Message;
type: "threadNewMessage";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataMessageData associated with the event.
type"threadNewMessage"Type of the event.

ThreadStatsEvent

Represents an event for when Thread statistics are updated. For example a new message has arrived (there is no need to subscribe to a specific Thread).

interface ThreadStatsEvent{
channel: Channel;
connectionId: string;
data: ThreadStatsEventData;
type: "threadStatsChanged";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataThreadStatsEventDataData associated with the event.
type"threadStatsChanged"Type of the event.

ThreadUpdatedEvent

Represents an event for when a Thread is updated.

interface ThreadUpdatedEvent{
channel: Channel;
connectionId: string;
data: Thread;
type: "threadUpdated";
}

Fields

NameTypeDescription
channelChannelThe channel through which the event was emitted.
connectionIdstringID of connection to which the event was sent.
dataThreadData associated with the event.
type"threadUpdated"Type of the event.

UserWithPubKey

Represents a user along with their associated public key for cryptographic operations.

interface UserWithPubKey{
pubKey: string;
userId: string;
}

Fields

NameTypeDescription
pubKeystringUser's public key, used for cryptographic purposes such as verifying the user's identity or securing communications.
userIdstringUnique identifier of the user.