Types
BreakEvent
Represents a generic event structure.
interface BreakEvent{
channel: Channel;
connectionId: string;
data: any;
type: "libBreak";
}
Fields
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | any | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | any | Data associated with the event. |
type | "libConnected" | Type of the event. |
Context
Represents a user's Context.
interface Context{
contextId: string;
userId: string;
}
Fields
Name | Type | Description |
---|
contextId | string | Unique identifier of given Context. |
userId | string | Unique 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | any | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | any | Data associated with the event. |
type | string | Type of the event. |
InboxCreatedEvent
Represents an event for when an Inbox is created.
interface InboxCreatedEvent{
channel: Channel;
connectionId: string;
data: Inbox;
type: "inboxCreated";
}
Fields
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | Inbox | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | InboxDeletedEventData | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | InboxEntry | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | InboxEntryDeletedEventData | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | Inbox | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | any | Data associated with the event. |
type | "libPlatformDisconnected" | Type of the event. |
ListOptions
interface ListOptions{
lastId: string;
pageSize: number;
sort: SortOrder;
}
Fields
Name | Type | Description |
---|
lastId | string | An 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. |
pageSize | number | How many messages per page (default: 100). |
sort | SortOrder | Sort 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
Name | Type | Description |
---|
readItems | T[] | An array of items of type `T` that were read from the data source. |
totalAvailable | number | The 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
Name | Type | Description |
---|
lastId | string | An 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. |
limit | number | The maximum number of items to retrieve.
It limits the size of the result set. |
skip | number | The number of items to skip before starting to collect the result set. |
sortOrder | SortOrder | Sort 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | Store | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | StoreDeletedEventData | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | PrivmxFile | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | StoreFileDeletedEventData | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | PrivmxFile | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | StoreStatsChangedEventData | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | Store | Data 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
Name | Type | Description |
---|
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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | Thread | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | ThreadDeletedEventData | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | ThreadDeletedMessageEventData | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | Message | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | Message | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | ThreadStatsEventData | Data 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
Name | Type | Description |
---|
channel | Channel | The channel through which the event was emitted. |
connectionId | string | ID of connection to which the event was sent. |
data | Thread | Data 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
Name | Type | Description |
---|
pubKey | string | User's public key, used for cryptographic purposes such as
verifying the user's identity or securing communications. |
userId | string | Unique identifier of the user. |