Skip to main content
reference

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

NameTypeDescription
authorPubKeystringPublic key of the author, used to verify the message's authenticity.
dataUint8ArrayThe content of the message itself, stored as a byte array.
infoServerMessageInfoInformation about the message as stored on the server.
privateMetaUint8ArrayPrivate metadata associated with the message, stored as a byte array.
publicMetaUint8ArrayPublic metadata associated with the message, stored as a byte array.
statusCodenumberStatus 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

NameTypeDescription
authorstringID of the author who created the message.
createDatenumberTimestamp when the message was created.
messageIdstringUnique ID of the message.
threadIdstringUnique 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

NameTypeDescription
contextIdstringUnique ID of the Context to which the Thread belongs.
createDatenumberTimestamp when the Thread was created.
creatorstringUser ID of user who created the Thread
lastModificationDatenumberTimestamp when the Thread was last modified.
lastModifierstringThe ID of the user who last modified the Thread.
lastMsgDatenumberTimestamp of the last message sent in the Thread.
managersstring[]An array of user. IDs who are managers of the Thread.
messagesCountnumberThe total number of. messages in the Thread.
privateMetaUint8ArrayPrivate metadata associated with the Thread, stored as a byte array.
publicMetaUint8ArrayPublic metadata associated with the Thread, stored as a byte array.
statusCodenumberStatus code of retrieval and decryption of the Thread
threadIdstringUnique ID of the Thread.
usersstring[]An array of user. IDs who are participants in the Thread.
versionnumberThe 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

NameTypeDescription
threadIdstringUnique 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

NameTypeDescription
messageIdstringUnique ID of the deleted message within the Thread.
threadIdstringUnique 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

NameTypeDescription
dataUint8ArrayContent of the message itself.
privateMetaUint8ArrayOptional, contains confidential data that will be encrypted before being sent to server.
publicMetaUint8ArrayOptional, 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

NameTypeDescription
lastMsgDatenumberTimestamp of the last message in the Thread.
messagesCountnumberThe total number of messages in the Thread.
threadIdstringUnique ID of the Thread for which statistics are being provided.