@waylay/client

2.11.0

Waylay

Waylay
Parameters
options (Object?) configuration options for this waylay client
Name Description
options.clientID string? the clientID (apiKey) to authenticate this client
options.secret string? the secret (apiSecret) to authenticate this client
options.domain string? the tenant domain used by this client (for authentication and as default endpoint). Note that any domain in the token takes precedence.
options.token string? the jwt token to authenticate this client (alternative to clientId, secret, domain arguments).
options.globalSettings Object? the organisation settings to use for this client (see withSettings ).
Example
const Waylay = require('@waylay/client')
// initialise with apiKey/apiSecret
const waylay = new Waylay({ domain: 'my-org.waylay.io', clientID: myApiKey, secret: myApiSecret })
// ... or login with username/password
const waylay = new Waylay({ domain: 'my-org.waylay.io' })
await waylay.login(username, password)
// ... or initialise with token
const waylay = new Waylay({ token: myStoredWaylayJwtToken})
// configure waylay endpoints from tenant configuration automatically
const waylay = await new Waylay(<credentials>).loadSettings()
// ... or provide the tenant organisation settings yourself
const waylay = new Waylay(<credentials>).withSettings(myOrgSettings)
Instance Members
token
token
domain
domain
login(username, password)
ping()
me()
loadSettings()
withSettings(settings?)
settings()

Actuators

Actuators
Instance Members
execute(name, version, body)
list()
get(name, version)
create(actuator)
remove(name)
getScript(name, version)
getVersions(name)

Alarms

Alarms
Instance Members
create(alarm)
get(id)
search(query)
update(id, alarm)
remove(id)
removeAll(filter)

Byoml

Byoml
Instance Members
list()
get(name)
exampleInput(name)
predict(name, payload)
regress(name, payload)
classify(name, payload)
remove(name)

Data

Data

Extends Resource

Instance Members
getSeries(resource, params)
postSeries(message, params)
postSeries(resource, message, params)
getMetricSeries(resource, metric, options)
getLastDatapointsForMetric(resource, metric, options)
getLastMetric(resource, metric)
getLatestDocument(resource)
getLatestMessages(resource)
remove(resource, params)

Resources

Resources
Static Members
batch
Instance Members
create(resource)
get(id, opts)
children(id, opts)
parent(id)
references(id)
update(id, resource)
replace(id, resource)
remove(id)
search(params, opts)
executeCommand(resource, command, properties)
commandLogs(resource, opts)
changelog(resource, query)

Sensors

Sensors
Instance Members
execute(name, version, body)
list()
get(name, version)
create(sensor)
remove(name)
getScript(name, version)
getVersions(name)

Tasks

Tasks
Static Members
batch
Instance Members
create(task)
update(id, task)
list(filter?, params, options)
remove(id)
batchRemove(taskIdList)
get(id, params, options)
start(id)
stop(id)
stopAndRemove(id)
log(options)
pushState(id, node, state)

Transformers

Transformers

Extends Resource

Instance Members
execute(name, version, body)
list()
get(name, version)
create(transformer)
remove(name)
getScript(name, version)
getVersions(name)

Types

Types
Static Members
batch
Instance Members
create(type)
remove(id)
update(id, type)
patch(id, data)
list(params, qs)
get(id)
constraints(id, options)
changelog(id, query)

Vault

Vault allows you to store encrypted data

Vault
Instance Members
set(key, data)
get(key)
remove(key)
keys()

Webscripts

Webscripts

Extends Resource

Instance Members
call(namespace, name, version, body)
list()
get(name, version)
create(webscript)
remove(name)
update(name, webscript)
log(name, version)

Analytics

Analytics allows you to calculate anomalies and predict future values of timeseries

Analytics
Instance Members
fit(resource, tsaConfig, options, useConfig, urlParams)
anomaly(resource, tsaConfig, options, useConfig, urlParams)
predict(resource, tsaConfig, options, useConfig, urlParams)
validate(resource, tsaConfig, options, useConfig, urlParams)
config(resource, configId)
replaceConfig(resource, configId, config)
updateConfig(resource, configId, config)
createConfig(resource, configId, config)
removeConfig(resource, configId)
configs(resource)

Policies

Policies
Instance Members
list()
get(id)
create(policy)
update(id, policy)
patch(id, policy)
remove(id)

Templates

Templates

Extends Resource

Instance Members
create(template)
update(name, template)
list(filter?, params, options)
get(name)
remove(id)

OrganisationSettings

Allows you to manage your organisation's settings

OrganisationSettings
Instance Members
list()
set(key, value)
remove(key)

Converter

Configure and test converter configurations for channels

Converter
Instance Members
getAll()
get(converterName)
create(converterName, type, template)
update(converterName, type, template)
delete(converterName)
convert(converterName, payload, params, forward)
test(type, template, payload)

Users

Users
Instance Members
list()
get(id)
create(user)
update(id, user)
delete(id)
addRole(id, role, tenant)
removeRole(id, role, tenant)
resetPassword(id)

Roles

Roles
Instance Members
list()
get(id)
create(role)
update(id, role)
delete(id)
addPermission(id, permission)
removePermission(id, permissionId, permission)
addUser(id, user, tenant)
removeUser(id, user, tenant)

PredefinedRoles

PredefinedRoles
Instance Members
list()

Permissions

Permissions
Instance Members
list()
get(id)
concepts()

TwoFA

TwoFA
Instance Members
status(user, tenant)
enableTwoFAEnforcement(tenant)
disableTwoFAEnforcement(tenant)