Skip to main content
reference

Types

PrivmxFile

Represents a file with associated metadata and status information.

interface PrivmxFile{
authorPubKey: string;
info: ServerFileInfo;
privateMeta: Uint8Array;
publicMeta: Uint8Array;
size: number;
statusCode: number;
}

Fields

NameTypeDescription
authorPubKeystringPublic key of the author of the file.
infoServerFileInfoInformation about the file from the server.
privateMetaUint8ArrayPrivate metadata associated with the file, represented as a Uint8Array.
publicMetaUint8ArrayPublic metadata associated with the file, represented as a Uint8Array.
sizenumberSize of the file in bytes.
statusCodenumberStatus code of the file. Set to 0 on success.

ServerFileInfo

Information about a file on the server.

interface ServerFileInfo{
author: string;
createDate: number;
fileId: string;
storeId: string;
}

Fields

NameTypeDescription
authorstringThe author of the file.
createDatenumberCreation date of the file, represented as a timestamp.
fileIdstringUnique ID of the file.
storeIdstringUnique ID of the Store where the file is located.

Store

Represents a Store with its metadata and file information.

interface Store{
contextId: string;
createDate: number;
creator: string;
filesCount: number;
lastFileDate: number;
lastModificationDate: number;
lastModifier: string;
managers: string[];
privateMeta: Uint8Array;
publicMeta: Uint8Array;
storeId: string;
users: string[];
version: number;
}

Fields

NameTypeDescription
contextIdstringContext ID of the Store.
createDatenumberCreation date of the Store, represented as a timestamp.
creatorstringThe creator of the Store.
filesCountnumberNumber of files in the Store.
lastFileDatenumberDate of the most recent file added to the Store, represented as a timestamp.
lastModificationDatenumberDate of the last modification to the Store, represented as a timestamp.
lastModifierstringThe last person who modified the Store.
managersstring[]A list of managers associated with the Store.
privateMetaUint8ArrayPrivate metadata associated with the Store, represented as a Uint8Array.
publicMetaUint8ArrayPublic metadata associated with the Store, represented as a Uint8Array.
storeIdstringUnique ID of the Store.
usersstring[]A list of users associated with the Store.
versionnumberVersion number of the Store.

StoreDeletedEventData

Represents the data associated with a deleted Store event.

interface StoreDeletedEventData{
storeId: string;
}

Fields

NameTypeDescription
storeIdstringUnique ID of the deleted Store.

StoreFileDeletedEventData

Represents the data associated with a file deletion event in a Store.

interface StoreFileDeletedEventData{
contextId: string;
fileId: string;
storeId: string;
}

Fields

NameTypeDescription
contextIdstringContext ID of the Store.
fileIdstringUnique ID of the deleted file.
storeIdstringUnique ID of the Store.

StoreFilePayload

Represents payload that is sent while uploading a file to a Store.

interface StoreFilePayload{
data: Uint8Array;
privateMeta: Uint8Array;
publicMeta: Uint8Array;
}

Fields

NameTypeDescription
dataUint8ArrayContent of the file.
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.

StoreStatsChangedEventData

Represents the data associated with a change in Store statistics.

interface StoreStatsChangedEventData{
contextId: string;
files: number;
lastFileDate: number;
storeId: string;
}

Fields

NameTypeDescription
contextIdstringContext ID of the Store.
filesnumberNumber of files in the Store.
lastFileDatenumberDate of the most recent file added to the Store, represented as a timestamp.
storeIdstringUnique ID of the Store.