Stores
Class representing instance of Stores API
Fields
native
StoreApiNative
Methods
createStore
Creates a new Store in given Context.
Params
contextId
string
ID of the Context to create the Store in
users
UserWithPubKey[]
array of UserWithPubKey structs which indicates who will have access to the created Store
managers
UserWithPubKey[]
array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store
publicMeta
Uint8Array
public (unencrypted) metadata
privateMeta
Uint8Array
private (encrypted) metadata
policies
ContainerPolicy
Store's policies
Returns
Promise<string>
·
created Store ID
updateStore
Updates an existing Store.
Params
storeId
string
ID of the Store to update
users
UserWithPubKey[]
array of UserWithPubKey structs which indicates who will have access to the created Store
managers
UserWithPubKey[]
array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store
publicMeta
Uint8Array
public (unencrypted) metadata
privateMeta
Uint8Array
private (encrypted) metadata
version
number
current version of the updated Store
force
boolean
force update (without checking version)
forceGenerateNewKey
boolean
force to regenerate a key for the Store
policies
ContainerPolicy
Store's policies
deleteStore
Deletes a Store by given Store ID.
Params
storeId
string
ID of the Store to delete
getStore
Gets a single Store by given Store ID.
Params
storeId
string
ID of the Store to get
Returns
Promise<Store>
·
struct containing information about the Store
listStores
Gets a list of Stores in given Context.
Params
contextId
string
ID of the Context to get the Stores from
pagingQuery
PagingQuery
struct with list query parameters
Returns
Promise<PagingList<Store>>
·
struct containing list of Stores
createFile
Creates a new file in a Store.
Params
storeId
string
ID of the Store to create the file in
publicMeta
Uint8Array
public file metadata
privateMeta
Uint8Array
private file metadata
size
number
size of the file
Returns
Promise<number>
·
handle to write data
updateFile
Update an existing file in a Store.
Params
fileId
string
ID of the file to update
publicMeta
Uint8Array
public file metadata
privateMeta
Uint8Array
private file metadata
size
number
size of the file
Returns
Promise<number>
·
handle to write file data
updateFileMeta
Update metadata of an existing file in a Store.
Params
fileId
string
ID of the file to update
publicMeta
Uint8Array
public file metadata
privateMeta
Uint8Array
private file metadata
writeToFile
Writes a file data.
Params
fileHandle
number
handle to write file data
dataChunk
Uint8Array
file data chunk
deleteFile
Deletes a file by given ID.
Params
fileId
string
ID of the file to delete
getFile
Gets a single file by the given file ID.
Params
fileId
string
ID of the file to get
Returns
Promise<File>
·
struct containing information about the file
listFiles
Gets a list of files in given Store.
Params
storeId
string
ID of the Store to get files from
pagingQuery
PagingQuery
struct with list query parameters
Returns
Promise<PagingList<File>>
·
struct containing list of files
openFile
Opens a file to read.
Params
fileId
string
ID of the file to read
Returns
Promise<number>
·
handle to read file data
readFromFile
Reads file data. Single read call moves the files's cursor position by declared length or set it at the end of the file.
Params
fileHandle
number
handle to write file data
length
number
size of data to read
Returns
Promise<Uint8Array>
·
array buffer with file data chunk
seekInFile
Moves read cursor.
Params
fileHandle
number
handle to write file data
position
number
new cursor position
closeFile
Closes the file handle.
Params
fileHandle
number
handle to read/write file data
Returns
Promise<string>
·
ID of closed file
subscribeForStoreEvents
Subscribes for the Store module main events.
unsubscribeFromStoreEvents
Unsubscribes from the Store module main events.
subscribeForFileEvents
Subscribes for events in given Store.
Params
storeId
string
ID of the Store to subscribe
unsubscribeFromFileEvents
Unsubscribes from events in given Store.
Params
storeId
string
ID of the Store to unsubscribe
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.