Global

Methods

(async) createGroup(group, valuesopt)

createGroup creates a group. It fails if the group already exists.
Parameters:
Name Type Attributes Description
group string
values Object <optional>
Source:

(async) createObject(url, valuesopt)

createObject makes a PUT request to url with JSON data. It fails if the object already exists.
Parameters:
Name Type Attributes Description
url string
values Object <optional>
Source:

(async) createToken(group, template) → {Promise.<string>}

createToken creates a new token and returns its name
Parameters:
Name Type Description
group string
template Object
Source:
Returns:
Type
Promise.<string>

(async) createUser(group, user, wildcard, values)

createUser creates a new user entry. It fails if the user already exists.
Parameters:
Name Type Description
group string
user string
wildcard boolean
values Object
Source:

(async) deleteGroup(group, etagopt)

deleteGroup deletes a group.
Parameters:
Name Type Attributes Description
group string
etag string <optional>
Source:

(async) deleteObject(url, etagopt)

deleteObject makes a DELETE request to the given URL. If an ETag is provided, it fails if the ETag didn't match.
Parameters:
Name Type Attributes Description
url string
etag string <optional>
Source:

(async) deleteUser(group, user, wildcard, etagopt)

deleteUser deletes a user.
Parameters:
Name Type Attributes Description
group string
user string
wildcard boolean
etag string <optional>
Source:

(async) getGroup(group, etagopt) → {Promise.<Object>}

getGroup returns the sanitised description of the given group.
Parameters:
Name Type Attributes Description
group string
etag string <optional>
Source:
Returns:
Type
Promise.<Object>

(async) getObject(url, etagopt) → {Promise.<Object>}

getObject fetches the JSON object at a given URL. If an ETag is provided, it fails if the ETag didn't match.
Parameters:
Name Type Attributes Description
url string
etag string <optional>
Source:
Returns:
Type
Promise.<Object>

(async) getToken(group, token, etagopt) → {Promise.<Object>}

getToken returns a given token.
Parameters:
Name Type Attributes Description
group string
token string
etag string <optional>
Source:
Returns:
Type
Promise.<Object>

(async) getUser(group, user, wildcard, etagopt) → {Promise.<Object>}

getUser returns a given user entry.
Parameters:
Name Type Attributes Description
group string
user string
wildcard boolean
etag string <optional>
Source:
Returns:
Type
Promise.<Object>

httpError(r) → {Error}

httpError returns an error that encapsulates the status of the response r.
Parameters:
Name Type Description
r Response
Source:
Returns:
Type
Error

(async) listGroups() → {Promise.<Array.<string>>}

listGroups returns the list of groups.
Source:
Returns:
Type
Promise.<Array.<string>>

(async) listObjects(url) → {Promise.<Array.<string>>}

listObjects fetches a list of strings from the given URL.
Parameters:
Name Type Description
url string
Source:
Returns:
Type
Promise.<Array.<string>>

(async) listTokens(group) → {Promise.<Array.<string>>}

listTokens lists the tokens for a given group.
Parameters:
Name Type Description
group string
Source:
Returns:
Type
Promise.<Array.<string>>

(async) listUsers(group) → {Promise.<Array.<string>>}

listUsers lists the users in a given group.
Parameters:
Name Type Description
group string
Source:
Returns:
Type
Promise.<Array.<string>>

newLocalId() → {string}

newLocalId returns a string that is unique in this session.
Source:
Returns:
Type
string

newRandomId() → {string}

newRandomId returns a random string of 32 hex digits (16 bytes).
Source:
Returns:
Type
string

parseTime(value) → {Date}

Protocol version 1 uses integers for dates, later versions use dates in ISO 8601 format. This function takes a date in either format and returns a Date object.
Parameters:
Name Type Description
value string | number
Source:
Returns:
Type
Date

recomputeUserStreams(sc, id) → {boolean}

recomputeUserStreams recomputes the user.streams array for a given user. It returns true if anything changed.
Parameters:
Name Type Description
sc ServerConnection
id string
Source:
Returns:
Type
boolean

sendFileCancel(sc, userid, id, messageopt)

Send a cancel message for a file transfer. Don't call this, call TransferredFile.cancel instead.
Parameters:
Name Type Attributes Description
sc ServerConnection
userid string
id string
message string | Error <optional>
Source:

(async) setPassword(group, user, wildcard, password, oldpasswordopt)

setPassword sets a user's password. If oldpassword is provided, then it is used for authentication instead of the browser's normal mechanism.
Parameters:
Name Type Attributes Description
group string
user string
wildcard boolean
password string
oldpassword string <optional>
Source:

toHex(array) → {string}

toHex formats an array as a hexadecimal string.
Parameters:
Name Type Description
array Array.<number> | Uint8Array the array to format
Source:
Returns:
- the hexadecimal representation of array
Type
string

(async) updateGroup(group, values, etagopt)

updateGroup modifies a group definition. Any fields present in values are overriden, any fields absent in values are left unchanged.
Parameters:
Name Type Attributes Description
group string
values Object
etag string <optional>
Source:

(async) updateObject(url, values, etagopt)

updateObject makes a read-modify-write cycle on the given URL. Any fields that are non-null in values are added or modified, any fields that are null are deleted, any fields that are absent are left unchanged.
Parameters:
Name Type Attributes Description
url string
values Object
etag string <optional>
Source:

(async) updateToken(group, token)

updateToken modifies a token.
Parameters:
Name Type Description
group string
token Object
Source:

(async) updateUser(group, user, values, wildcard, etagopt)

updateUser modifies a given user entry.
Parameters:
Name Type Attributes Description
group string
user string
values Object
wildcard boolean
etag string <optional>
Source:

userURL(group, user, wildcard)

userURL returns the URL for a user entry
Parameters:
Name Type Description
group string
user string
wildcard boolean
Source:

Type Definitions

message

Type:
  • Object
Properties:
Name Type Attributes Description
type string
version Array.<string> <optional>
kind string <optional>
error string <optional>
id string <optional>
replace string <optional>
source string <optional>
dest string <optional>
username string <optional>
password string <optional>
token string <optional>
privileged boolean <optional>
permissions Array.<string> <optional>
status Object.<string, any> <optional>
data Object.<string, any> <optional>
group string <optional>
value unknown <optional>
noecho boolean <optional>
time string | number <optional>
sdp string <optional>
candidate RTCIceCandidate <optional>
label string <optional>
request Object.<string, Array.<string>> | Array.<string> <optional>
rtcConfiguration Object.<string, any> <optional>
Source:

user

Type:
  • Object
Properties:
Name Type Description
username string
permissions Array.<string>
data Object.<string, any>
streams Object.<string, Object.<string, boolean>>
Source: