Base URI for reading content of VFS file
Base URI for VFS file sharing
An apigateway allows client side to execute a custom server-side script and get back the result. This gateway is particularly useful in case of performing a task that is not provided by the core API
execution indication, provided only when ws is false
otherwise, d
should be written directly to the websocket stream as JSON object.
Two possible formats of d
:
execute an server-side script file:
{
path: [VFS path],
parameters: [parameters of the server-side script]
}
or, execute directly a snippet of server-side script:
{ code: [server-side script code snippet as string] }
flag indicate whether to use websocket for the connection to the gateway API. In case of streaming data, the websocket is preferred
a promise on the result object (any)
Check if a user is logged in
a promise on a RequestResult that contains an error or a UserSettingType object
This is the low level function of AntOS VDB API. It requests the server API to perform some simple SQL query.
action to perform: save, delete, get, select
data object of the request based on each action:
{ table: "table name", data: [record data object]}
{ table: "table name", id: [record id]}
{ table: "table name", id: [record id]}
or
{ table: "table name", cond: [conditional object]}
{ table: "table name", cond: [conditional object]}
a promise of RequestResult on the query data
A conditional object represents a SQL condition statement as an object,
example: pid = 10 AND cid = 2 ORDER BY date DESC
{
exp: {
"and": {
pid: 10,
cid: 2
}
},
order: {
date: "DESC"
}
}
Read the file as binary data
VFS file to be read
a Promise on an array buffer
Get VFS file meta-data
VFS file path
A promise on a RequestResult which contains an error or an object of FileInfoType
Perform a login operation
user data UserLoginType
a promise on a RequestResult that contains an error or a UserSettingType object
Perform a logout operation
a promise on a RequestResult
Send a request to the server-side API for directory creation
VFS path of the directory to be created
A promise on a RequestResult which contains an error or true on success
Move a file to another location on server-side
VFS source file path
VFS destination file path
A promise on a RequestResult which contains an error or a success response
Send a command to the serverside package manager
a package command of type PackageCommandType
a promise on a RequestResult
Read a VFS file content. There are many ways a VFS file can be read:
path of the VFS file
return data type:
A promise on a RequestResult which contains an error or an object of FileInfoType
Delete a VFS file on the server-side
VFS file path
A promise on a RequestResult which contains an error or a success response
Send a request to the server-side API for a directory scanning operation
a VFS file path e.g. home://test/
A promise on a RequestResult which contains an error or a list of FileInfoType
Save the current user settings
a promise on a RequestResult
Send a request to the server-side API for sharing/unsharing a VFS file, once shared a VFS file will be publicly visible by everyone
VFS file path to be shared
flag: share (true) or unshare (false)
A promise on a RequestResult which contains an error or true on success
Upload file to the server via VFS interface
VFS destination directory path
a promise on a RequestResult
Write Base 64 encoded data to a VFS file
path to the VFS file
file data encoded in Base 64
a promise on a RequestResult
The namespace
handle
contains some low level API to communicate with the server side API. It is the only API layer that communicate directly with the server. To make AntOS compatible with any server side API, all exported variable unctions defined in thehandle
namespace should be re-implemented