Leverege Platform

Leverege Platform

  • Overview
  • JSDocs
  • REST API
  • Help

›JSDoc

JSDoc

  • Home
  • API Server
  • API Attributes
  • Api Patch Ops
  • API Redux
  • Array Util
  • Base62 Util
  • Cache
  • Cluster Manager
  • Data Store
  • Exit
  • Factory
  • Limit
  • Lock
  • Message Queue
  • Messages
  • Path
  • Permissions
  • Reasoner
  • String Util
  • UI Active Theme
  • UI Elements
  • UI Linear View Elements
  • UI Mapbox Elements
  • Validator

Reasoner

Functions

main(script, event, callback)
getJson()

Extracts the message from the pubsub event

publish(topic, message)

publish a message into the leverege platform

filterBuildRecipients(users, defaultAccessor, filter, recipientKey) ⇒ Object

This method builds a list of contact information given a list of users, a method for accessing and filtering users, and a key to put the user info on in a final object

sendToTargets(msg, targets, targets[i, options, defaultUserAccessor, topic, allowedRecipientKeys, recipientOverride) ⇒ Promise
email(msg, targets, options)
sms(msg, targets, options)
setDeviceData(pathValueArray, oMsg, options)
message(msg, route, options)
send(topic, msg, route)

send a message into the leverege system

main(script, event, callback)

Kind: global function

ParamTypeDescription
scriptobjectthe export of a script file
eventobjectPubsub message that triggered reasoner execution
callbackfunctionfunction to be run after the script has been executed

getJson()

Extracts the message from the pubsub event

Kind: global function

publish(topic, message)

publish a message into the leverege platform

Kind: global function

ParamTypeDescription
topicstringthe topic that the message will be published to
messageMessageacceptable messages can be found in the @leverege/messages library

filterBuildRecipients(users, defaultAccessor, filter, recipientKey) ⇒ Object

This method builds a list of contact information given a list of users, a method for accessing and filtering users, and a key to put the user info on in a final object

Kind: global function
Returns: Object - the recipients built from the user list

ParamTypeDescription
users*a list of user objects, generally including metadata
defaultAccessor*a default way to get relevant user contact info out
filter*an accessor for how to filter users out of selection and get the relevant field
recipientKey*the key to use in object creation

sendToTargets(msg, targets, targets[i, options, defaultUserAccessor, topic, allowedRecipientKeys, recipientOverride) ⇒ Promise

Kind: global function

ParamTypeDescription
msgObjectthe message to send to either emailer or messenger
targetsArraythe targets
targets[iObject \stringa target. if object see below, if string and string is 'device', use context to get the device that came from the reason trigger and send to that, if string and string is 'system', do the same but for the system
targets[i].typeObject'device''system'
targets[i].filterfunction \stringa way of telling whether a user should be messaged or not. If a function, returning true will contact the user in a default manner, returning a string or array will contact a user using the string or list of strings returned, returning anything else will filter the user. If a string, path is used to the same effect
targets[i].idstringthe id of the target to get
options*an object passed in through closure by the reason script
defaultUserAccessor*a default way to get the contact string for a user
topic*the topic to ultimately send the message to
allowedRecipientKeys*a set of keys we can modify along the way getting recipients
recipientOverride*(optional) if specified, forces targeting to a specific key

email(msg, targets, options)

Kind: global function

ParamTypeDescription
msgobjectan email message as detailed in @leverege/messages
targetsarrayrecipients of the email
optionsobject

sms(msg, targets, options)

Kind: global function

ParamTypeDescription
msgobjecta detailed description of supported messages can be found in @leverege/messages library
targetsarrayrecipients of the sms
optionsobject

setDeviceData(pathValueArray, oMsg, options)

Kind: global function

ParamTypeDescription
pathValueArrayarrayarray of objects with a path key and a value key
oMsgobjectdevice, system, blueprint and project ids
optionsobject

message(msg, route, options)

Kind: global function

ParamTypeDescription
msgMessagea detailed description of supported messages can be found in @leverege/messages library
route*GCP route to send the message on
optionsobject

send(topic, msg, route)

send a message into the leverege system

Kind: global function

ParamTypeDescription
topicstringthe topic that the message should be published to
msgMessagea detailed description of supported messages can be found in @leverege/messages library
route*GCP route to send the message on
← PermissionsString Util →
  • Functions
  • main(script, event, callback)
  • getJson()
  • publish(topic, message)
  • filterBuildRecipients(users, defaultAccessor, filter, recipientKey) ⇒ Object
  • sendToTargets(msg, targets, targets[i, options, defaultUserAccessor, topic, allowedRecipientKeys, recipientOverride) ⇒ Promise
  • email(msg, targets, options)
  • sms(msg, targets, options)
  • setDeviceData(pathValueArray, oMsg, options)
  • message(msg, route, options)
  • send(topic, msg, route)
Leverege Platform
Docs
Overview
Connect
FacebookLinkedInTwitter
Facebook Open Source