Types
Message
Represents a message, including its metadata and content.
interface Message{
authorPubKey: string;
data: Uint8Array;
info: ServerMessageInfo;
privateMeta: Uint8Array;
publicMeta: Uint8Array;
statusCode: number;
}
Fields
Name | Type | Description |
---|---|---|
authorPubKey | string | Public key of the author, used to verify the message's authenticity. |
data | Uint8Array | The content of the message itself, stored as a byte array. |
info | ServerMessageInfo | Information about the message as stored on the server. |
privateMeta | Uint8Array | Private metadata associated with the message, stored as a byte array. |
publicMeta | Uint8Array | Public metadata associated with the message, stored as a byte array. |
statusCode | number | Status code of the message, indicating its current state. |
ServerMessageInfo
Represents information about the location of given message on the server.
interface ServerMessageInfo{
author: string;
createDate: number;
messageId: string;
threadId: string;
}
Fields
Name | Type | Description |
---|---|---|
author | string | ID of the author who created the message. |
createDate | number | Timestamp when the message was created. |
messageId | string | Unique ID of the message. |
threadId | string | Unique ID of the Thread that the message belongs to. |
Thread
Represents a communication Thread, which may contain multiple messages.
interface Thread{
contextId: string;
createDate: number;
creator: string;
lastModificationDate: number;
lastModifier: string;
lastMsgDate: number;
managers: string[];
messagesCount: number;
privateMeta: Uint8Array;
publicMeta: Uint8Array;
statusCode: number;
threadId: string;
users: string[];
version: number;
}
Fields
Name | Type | Description |
---|---|---|
contextId | string | Unique ID of the Context to which the Thread belongs. |
createDate | number | Timestamp when the Thread was created. |
creator | string | User ID of user who created the Thread |
lastModificationDate | number | Timestamp when the Thread was last modified. |
lastModifier | string | The ID of the user who last modified the Thread. |
lastMsgDate | number | Timestamp of the last message sent in the Thread. |
managers | string[] | An array of user. IDs who are managers of the Thread. |
messagesCount | number | The total number of. messages in the Thread. |
privateMeta | Uint8Array | Private metadata associated with the Thread, stored as a byte array. |
publicMeta | Uint8Array | Public metadata associated with the Thread, stored as a byte array. |
statusCode | number | Status code of retrieval and decryption of the Thread |
threadId | string | Unique ID of the Thread. |
users | string[] | An array of user. IDs who are participants in the Thread. |
version | number | The current version of the Thread, used for concurrency control. |
ThreadDeletedEventData
Represents the data for an event where a Thread is deleted.
interface ThreadDeletedEventData{
threadId: string;
}
Fields
Name | Type | Description |
---|---|---|
threadId | string | Unique ID of the deleted Thread. |
ThreadDeletedMessageEventData
Represents the data for an event where a message within a Thread is deleted.
interface ThreadDeletedMessageEventData{
messageId: string;
threadId: string;
}
Fields
Name | Type | Description |
---|---|---|
messageId | string | Unique ID of the deleted message within the Thread. |
threadId | string | Unique ID of the Thread containing the deleted message. |
ThreadMessagePayload
Represents payload that is sent while sending a message to a Thread.
interface ThreadMessagePayload{
data: Uint8Array;
privateMeta: Uint8Array;
publicMeta: Uint8Array;
}
Fields
Name | Type | Description |
---|---|---|
data | Uint8Array | Content of the message itself. |
privateMeta | Uint8Array | Optional, contains confidential data that will be encrypted before being sent to server. |
publicMeta | Uint8Array | Optional, contains data that can be accessed by everyone and is not encrypted. |
ThreadStatsEventData
Represents the data for an event providing statistics about a Thread.
interface ThreadStatsEventData{
lastMsgDate: number;
messagesCount: number;
threadId: string;
}
Fields
Name | Type | Description |
---|---|---|
lastMsgDate | number | Timestamp of the last message in the Thread. |
messagesCount | number | The total number of messages in the Thread. |
threadId | string | Unique ID of the Thread for which statistics are being provided. |