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
Name | Type | Description |
---|---|---|
authorPubKey | string | Public key of the author of the file. |
info | ServerFileInfo | Information about the file from the server. |
privateMeta | Uint8Array | Private metadata associated with the file, represented as a Uint8Array. |
publicMeta | Uint8Array | Public metadata associated with the file, represented as a Uint8Array. |
size | number | Size of the file in bytes. |
statusCode | number | Status 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
Name | Type | Description |
---|---|---|
author | string | The author of the file. |
createDate | number | Creation date of the file, represented as a timestamp. |
fileId | string | Unique ID of the file. |
storeId | string | Unique 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
Name | Type | Description |
---|---|---|
contextId | string | Context ID of the Store. |
createDate | number | Creation date of the Store, represented as a timestamp. |
creator | string | The creator of the Store. |
filesCount | number | Number of files in the Store. |
lastFileDate | number | Date of the most recent file added to the Store, represented as a timestamp. |
lastModificationDate | number | Date of the last modification to the Store, represented as a timestamp. |
lastModifier | string | The last person who modified the Store. |
managers | string[] | A list of managers associated with the Store. |
privateMeta | Uint8Array | Private metadata associated with the Store, represented as a Uint8Array. |
publicMeta | Uint8Array | Public metadata associated with the Store, represented as a Uint8Array. |
storeId | string | Unique ID of the Store. |
users | string[] | A list of users associated with the Store. |
version | number | Version number of the Store. |
StoreDeletedEventData
Represents the data associated with a deleted Store event.
interface StoreDeletedEventData{
storeId: string;
}
Fields
Name | Type | Description |
---|---|---|
storeId | string | Unique 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
Name | Type | Description |
---|---|---|
contextId | string | Context ID of the Store. |
fileId | string | Unique ID of the deleted file. |
storeId | string | Unique 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
Name | Type | Description |
---|---|---|
data | Uint8Array | Content of the file. |
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. |
StoreStatsChangedEventData
Represents the data associated with a change in Store statistics.
interface StoreStatsChangedEventData{
contextId: string;
files: number;
lastFileDate: number;
storeId: string;
}
Fields
Name | Type | Description |
---|---|---|
contextId | string | Context ID of the Store. |
files | number | Number of files in the Store. |
lastFileDate | number | Date of the most recent file added to the Store, represented as a timestamp. |
storeId | string | Unique ID of the Store. |