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

Messages

Classes

AbstractValidator

Class to preform the action of checking data in the form of an object against a struct

ApiEventMsg ⇐ AbstractValidator

Validates the apiEventMsg

DeviceAckMsg ⇐ AbstractValidator

Validates the deviceAckMsg

DeviceDataEventMsg ⇐ AbstractValidator

Validates a DeviceDataEventMsg

DeviceEventAckMsg ⇐ AbstractValidator

Validates a DeviceEventAckMsg

InboundAckMsg ⇐ AbstractValidator

Validates an InboundAckMsg

InboundDataEventMsg ⇐ AbstractValidator

Validates an inboundDataEventMsg

IotHubEventMsg ⇐ AbstractValidator

Validates an iothubEventMsg

OutboundInitMsg ⇐ AbstractValidator

Validates the outboundInitMsg

OutboundSentMsg ⇐ AbstractValidator

Validates the outboundSentMsg

EmailMsg ⇐ AbstractValidator

Validates an EmailMsg

SmsMsg ⇐ AbstractValidator

Validates a SmsMsg

SolarTimer

Defines a Solar Timer. A solar timer will fire based off of an offset from either sunrise or sunset.

AttributeCondition ⇐ Condition
Condition ⇐ AbstractValidator

Defines a condition that can be tested for, yielding either true or false

DeltaCondition ⇐ Condition
NotCondition ⇐ Condition
NotCondition ⇐ Condition

Functions

parse()

Attempts to turn time into a milliseconds time. If it cannot, it will return dTime, which defaults to Date.now()

AbstractValidator

Class to preform the action of checking data in the form of an object against a struct

Kind: global class

  • AbstractValidator
    • new AbstractValidator(struct, data)
    • .toObject ⇒ object

new AbstractValidator(struct, data)

class that will check an object against a struct and add all the keys to itself

ParamTypeDescription
structStructa function returned by creating a struct with superstruct
dataobjectan object that will be checked against the provided struct

abstractValidator.toObject ⇒ object

Kind: instance property of AbstractValidator
Returns: object - - the validated object of the data originally provided

ApiEventMsg ⇐ AbstractValidator

Validates the apiEventMsg

Kind: global class
Extends: AbstractValidator

  • ApiEventMsg ⇐ AbstractValidator
    • new ApiEventMsg()
    • .toObject ⇒ object

new ApiEventMsg()

create a ApiEventMsg

ParamTypeDescription
data.eventTypestringthe number type of the event from the spec
data.deviceIdstringA string representing the internal name of the device.
data.systemIdstringThe name of the system the device belongs to
data.blueprintIdstringthe id of the blueprint that the device belongs to
data.projectIdstringthe id of the project that the device belongs to
data.attributeIdstringthe id of the attribute affected
data.networkIdstringThe networkId of the source
data.userIdstringthe string user id of the event source
data.routestringthe string route taken into the data to create the event
data.fromModelInterfacestringwhether or not the event was generated by calls to the model interface

apiEventMsg.toObject ⇒ object

Kind: instance property of ApiEventMsg
Returns: object - - the validated object of the data originally provided

DeviceAckMsg ⇐ AbstractValidator

Validates the deviceAckMsg

Kind: global class
Extends: AbstractValidator

  • DeviceAckMsg ⇐ AbstractValidator
    • new DeviceAckMsg()
    • .toObject ⇒ object

new DeviceAckMsg()

create a DeviceAckMsg

ParamTypeDescription
data.timestring \integerthe time of the message, as reported by the device
data.receivedTimestring \integerthe time of the message, as reported by the ingestion server
data.timestring \integerthe time of the message, as reported by the device
data.msgIdstringThe message id, created at outbound initiated step
data.deviceIdstringA string representing the internal name of the device.
data.systemIdstringThe name of the system the device belongs to
data.networkIdstringThe networkId of the source
data.blueprintIdstringthe id of the blueprint that the device belongs to
data.projectIdstringthe id of the project that the device belongs to
data.statusstringfinal updated string status of the message
data.responseobjectThis contains the response data from the device
data.sourceobjectthis contains the device, (or less likely) the user, or reason script source info of the inboundAckMsg this derived from

deviceAckMsg.toObject ⇒ object

Kind: instance property of DeviceAckMsg
Returns: object - - the validated object of the data originally provided

DeviceDataEventMsg ⇐ AbstractValidator

Validates a DeviceDataEventMsg

Kind: global class
Extends: AbstractValidator

  • DeviceDataEventMsg ⇐ AbstractValidator
    • new DeviceDataEventMsg()
    • .toObject ⇒ object

new DeviceDataEventMsg()

create the DeviceDataEventMsg class

ParamTypeDescription
data.idstringA uuid generated for this message
data.timestring \integerthe time of the message, as reported by the device
data.receivedTimestring \integerthe time of the message, as reported by the ingestion server
data.storedTimestring \integerthe time of the message, as reported by the writer
data.historicalbooleanwhether or not the message is known to be historical only (don't write to rt dbs)
data.deviceIdstringA string representing the internal name of the device.
data.systemIdstringThe name of the system the device belongs to
data.blueprintIdstringThe id of the blueprint the device belongs to
data.projectIdstringThe id of the project the device belongs to
data.networkIdstringThe networkId of the source
data.dataarray \objectThis contains a data report. The data report as a path, which is the name of the data field, and a value. The path should only contain a-z, A-Z, 0-9, _. Forward slashes (‘/’) are treated as directories
data.data.pathstringA string of keys, separated by a ‘/’. For examples, ‘speed’, or ‘battery/temperature1”
data.data.valuenumberthe value of the path
data.eventarray \objectThis contains an event report. The event indicates that something significant has happened.
data.event.typestringThe list that the event should be inserted into. If not supplied, this will default to ‘default’
data.event.timestring \numberOptional. Server time will be used
device.event.idstringreserved
data.sourceobjectthis contains the device, user, or reason script source info of the object that created this msg
data.userIdobjectthe userId (if any) that initiated the writing of information

deviceDataEventMsg.toObject ⇒ object

Kind: instance property of DeviceDataEventMsg
Returns: object - - the validated object of the data originally provided

DeviceEventAckMsg ⇐ AbstractValidator

Validates a DeviceEventAckMsg

Kind: global class
Extends: AbstractValidator

  • DeviceEventAckMsg ⇐ AbstractValidator
    • new DeviceEventAckMsg()
    • .toObject ⇒ object

new DeviceEventAckMsg()

create the DeviceEventAckMsg class

ParamTypeDescription
data.idstringthe id of the event being acked
data.timestring \integerthe time of the message, as reported by the device
data.receivedTimestring \integerthe time of the message, as reported by the ingestion server
data.storedTimestring \integerthe time of the message, as reported by the writer
data.deviceIdstringA string representing the internal name of the device.
data.systemIdstringThe name of the system the device belongs to
data.blueprintIdstringThe id of the blueprint the device belongs to
data.projectIdstringThe id of the project the device belongs to
data.dataarray \objectThis contains a data report. The data report as a path, which is the name of the data field, and a value. The path should only contain a-z, A-Z, 0-9, _. Forward slashes (‘/’) are treated as directories
data.data.pathstringA string of keys, separated by a ‘/’. For examples, ‘speed’, or ‘battery/temperature1”
data.data.valuenumberthe value of the path
data.eventTypestringthe type of the event being acked by id
data.userIdstringthe user (if any) that is acking the message
data.sourcestringthe source info of the device, user, or reason script (if any) that is acking the event

deviceEventAckMsg.toObject ⇒ object

Kind: instance property of DeviceEventAckMsg
Returns: object - - the validated object of the data originally provided

InboundAckMsg ⇐ AbstractValidator

Validates an InboundAckMsg

Kind: global class
Extends: AbstractValidator

  • InboundAckMsg ⇐ AbstractValidator
    • new InboundAckMsg()
    • .toObject ⇒ object

new InboundAckMsg()

create a InboundAckMsg

ParamTypeDescription
data.timestring \integerthe time of the message, as reported by the device
data.receivedTimestring \integerthe time of the message, as reported by the ingestion server
data.storedTimestring \integerthe time of the message, as reported by the writer
data.msgIdstringThe message id, created at outbound initiated step
data.networkIdstringThe id of network contributing the acknowledgement
data.deviceIdstringA string representing the external name of the device. This could be an IotHub device id, a MAC address of a sensor, etc
data.systemIdstringthe id of the system the device belongs to
data.aliasKeystringThe name of the key that forms the mapping between the external device’s id and the internal device. This is stored in the internal device’s aliases list, and tends to be unique per network.
data.statusstringan updated string status of the message
data.responseobjectThis contains the response data from the device

inboundAckMsg.toObject ⇒ object

Kind: instance property of InboundAckMsg
Returns: object - - the validated object of the data originally provided

InboundDataEventMsg ⇐ AbstractValidator

Validates an inboundDataEventMsg

Kind: global class
Extends: AbstractValidator

  • InboundDataEventMsg ⇐ AbstractValidator
    • new InboundDataEventMsg()
    • .toObject ⇒ object

new InboundDataEventMsg()

create an InboundDataEventMsg

ParamTypeDescription
data.timestring \integerthe time of the message, as reported by the device
data.receivedTimestring \integerthe time of the message, as reported by the ingestion server
data.historicalbooleanwhether or not the message is known to be historical only (don't write to rt dbs)
data.networkIdstringThe networkId of the source
data.deviceIdstringA string representing the external name of the device. This could be an IotHub device id, a MAC address of a sensor, etc
data.aliasKeystringThe name of the key that forms the mapping between the external device’s id and the internal device. This is stored in the internal device’s aliases list, and tends to be unique per network.
data.dataarray \objectThis contains a data report. The data report as a path, which is the name of the data field, and a value. The path should only contain a-z, A-Z, 0-9, _. Forward slashes (‘/’) are treated as directories
data.data.pathstringA string of keys, separated by a ‘/’. For examples, ‘speed’, or ‘battery/temperature1”
data.data.valuenumberthe value of the path
data.eventarray \objectThis contains an event report. The event indicates that something significant has happened.
data.event.typestringThe list that the event should be inserted into. If not supplied, this will default to ‘default’
data.event.timestring \numberOptional. Server time will be used
data.event.idstringreserved
data.sourceobjectadditional info about the source of the message pertaining to a generating user or reason script

inboundDataEventMsg.toObject ⇒ object

Kind: instance property of InboundDataEventMsg
Returns: object - - the validated object of the data originally provided

IotHubEventMsg ⇐ AbstractValidator

Validates an iothubEventMsg

Kind: global class
Extends: AbstractValidator

  • IotHubEventMsg ⇐ AbstractValidator
    • new IotHubEventMsg()
    • .toObject ⇒ object

new IotHubEventMsg()

ParamTypeDescription
data.dataobject \arrayThis contains a data report. The data report as a path, which is the name of the data field, and a value. Multiple reports can be sent at once by sending an array of the about objects.
data.data.pathstringA string of keys, separated by a ‘/’. For examples, ‘speed’, or ‘battery/temperature1”
data.data.valuenumberthe value of the path
data.eventobject \arrayThis contains an event report. The event indicates that something significant has happened
data.event.typestringThe list that the event should be inserted into. If not supplied, this will default to ‘default’
data.event.timestring \numberOptional. Server time will be used
device.event.idstringreserved

iotHubEventMsg.toObject ⇒ object

Kind: instance property of IotHubEventMsg
Returns: object - - the validated object of the data originally provided

OutboundInitMsg ⇐ AbstractValidator

Validates the outboundInitMsg

Kind: global class
Extends: AbstractValidator

  • OutboundInitMsg ⇐ AbstractValidator
    • new OutboundInitMsg()
    • .toObject ⇒ object

new OutboundInitMsg()

create a OutboundInitMsg

ParamTypeDescription
data.timestring \integerthe time of the message, as reported by the device
data.receivedTimestring \integerthe time of the message, as reported by the ingestion server
data.msgIdstringThe message id, created at outbound initiated step
data.deviceIdstringA string representing the internal name of the device.
data.systemIdstringThe name of the system the device belongs to
data.blueprintIdstringthe id of the blueprint that the device belongs to
data.projectIdstringthe id of the project that the device belongs to
data.messageobjectThis contains the message to go out to the device
data.sourceobjectinformation about the device, (or less likely) the user, or reason script that generated this message

outboundInitMsg.toObject ⇒ object

Kind: instance property of OutboundInitMsg
Returns: object - - the validated object of the data originally provided

OutboundSentMsg ⇐ AbstractValidator

Validates the outboundSentMsg

Kind: global class
Extends: AbstractValidator

  • OutboundSentMsg ⇐ AbstractValidator
    • new OutboundSentMsg()
    • .toObject ⇒ object

new OutboundSentMsg()

create a OutboundSentMsg

ParamTypeDescription
data.timestring \integerthe time of the message, as reported by the device
data.receivedTimestring \integerthe time of the message, as reported by the ingestion server
data.msgIdstringThe message id, created at outbound initiated step
data.deviceIdstringA string representing the internal name of the device.
data.systemIdstringThe name of the system the device belongs to
data.blueprintIdstringthe id of the blueprint that the device belongs to
data.projectIdstringthe id of the project that the device belongs to
data.statusstringan updated string status of the device
data.sendInfoobjectany information or notes about the data sent
data.sourceobjectinformation about the device, (or less likely) the user, or reason script that generated this message

outboundSentMsg.toObject ⇒ object

Kind: instance property of OutboundSentMsg
Returns: object - - the validated object of the data originally provided

EmailMsg ⇐ AbstractValidator

Validates an EmailMsg

Kind: global class
Extends: AbstractValidator

  • EmailMsg ⇐ AbstractValidator
    • new EmailMsg()
    • .toObject ⇒ object

new EmailMsg()

create an EmailMsg

ParamTypeDescription
data.subjectstringthe subject line of the email to be sent
data.tostring \arraythe email address/es to send the email to
data.ccstring \arraythe email address/es to cc on the email
data.bccstring \arraythe email address/es to bcc on the email
data.fromstringthe email address the email is to be sent from
data.htmlstringemail content as html
data.textstringemail content as plain text
data.templatestring
data.contextstring
data.attachmentsarrayattachments to be included with the email

emailMsg.toObject ⇒ object

Kind: instance property of EmailMsg
Returns: object - - the validated object of the data originally provided

SmsMsg ⇐ AbstractValidator

Validates a SmsMsg

Kind: global class
Extends: AbstractValidator

  • SmsMsg ⇐ AbstractValidator
    • new SmsMsg()
    • .toObject ⇒ object

new SmsMsg()

create a SmsProcessorMsg

ParamTypeDescription
data.recipientsarray \stringthe phone number/s to send the message to
data.messagestringthe text of the message that will be sent

smsMsg.toObject ⇒ object

Kind: instance property of SmsMsg
Returns: object - - the validated object of the data originally provided

SolarTimer

Defines a Solar Timer. A solar timer will fire based off of an offset from either sunrise or sunset.

Kind: global class

  • SolarTimer
    • new SolarTimer(data)
    • .next()

new SolarTimer(data)

Create a Solar Timer

ParamTypeDescription
dataobject
data.latitudenumberthe north/south position on the earth in degrees
data.longitudenumberthe east/west position on the earth in degreews
data.fromSunrisebooleanif true, the timer is based on sunrise. Otherwise, sunset is used
data.offsetnumberthe offset in milliseconds from sunrise or sunset

solarTimer.next()

Returns the next time to fire from the current time. If when is set and it is less than fromTime, -1 is returned.

Kind: instance method of SolarTimer

AttributeCondition ⇐ Condition

Kind: global class
Extends: Condition

  • AttributeCondition ⇐ Condition
    • .toObject ⇒ object
    • .satisfies(context)

attributeCondition.toObject ⇒ object

Kind: instance property of AttributeCondition
Returns: object - - the validated object of the data originally provided

attributeCondition.satisfies(context)

Determines whether the condition is met or not given the context

Kind: instance method of AttributeCondition

ParamTypeDescription
context*The context with which the satisfies method is to be executed

Condition ⇐ AbstractValidator

Defines a condition that can be tested for, yielding either true or false

Kind: global class
Extends: AbstractValidator

condition.toObject ⇒ object

Kind: instance property of Condition
Returns: object - - the validated object of the data originally provided

DeltaCondition ⇐ Condition

Kind: global class
Extends: Condition

  • DeltaCondition ⇐ Condition
    • .toObject ⇒ object
    • .satisfies(context)

deltaCondition.toObject ⇒ object

Kind: instance property of DeltaCondition
Returns: object - - the validated object of the data originally provided

deltaCondition.satisfies(context)

Determines whether the condition is met or not given the context

Kind: instance method of DeltaCondition

ParamTypeDescription
context*The context with which the satisfies method is to be executed

NotCondition ⇐ Condition

Kind: global class
Extends: Condition

  • NotCondition ⇐ Condition
    • .toObject ⇒ object
    • .satisfies(context)
    • .satisfies(context)

notCondition.toObject ⇒ object

Kind: instance property of NotCondition
Overrides: toObject
Returns: object - - the validated object of the data originally provided

notCondition.satisfies(context)

Determines whether the condition is met or not given the context

Kind: instance method of NotCondition

ParamTypeDescription
context*The context with which the satisfies method is to be executed

notCondition.satisfies(context)

Determines whether the condition is met or not given the context

Kind: instance method of NotCondition

ParamTypeDescription
context*The context with which the satisfies method is to be executed

NotCondition ⇐ Condition

Kind: global class
Extends: Condition

  • NotCondition ⇐ Condition
    • .toObject ⇒ object
    • .satisfies(context)
    • .satisfies(context)

notCondition.toObject ⇒ object

Kind: instance property of NotCondition
Overrides: toObject
Returns: object - - the validated object of the data originally provided

notCondition.satisfies(context)

Determines whether the condition is met or not given the context

Kind: instance method of NotCondition

ParamTypeDescription
context*The context with which the satisfies method is to be executed

notCondition.satisfies(context)

Determines whether the condition is met or not given the context

Kind: instance method of NotCondition

ParamTypeDescription
context*The context with which the satisfies method is to be executed

parse()

Attempts to turn time into a milliseconds time. If it cannot, it will return dTime, which defaults to Date.now()

Kind: global function

← Message QueuePath →
  • Classes
  • Functions
  • AbstractValidator
    • new AbstractValidator(struct, data)
    • abstractValidator.toObject ⇒ object
  • ApiEventMsg ⇐ AbstractValidator
    • new ApiEventMsg()
    • apiEventMsg.toObject ⇒ object
  • DeviceAckMsg ⇐ AbstractValidator
    • new DeviceAckMsg()
    • deviceAckMsg.toObject ⇒ object
  • DeviceDataEventMsg ⇐ AbstractValidator
    • new DeviceDataEventMsg()
    • deviceDataEventMsg.toObject ⇒ object
  • DeviceEventAckMsg ⇐ AbstractValidator
    • new DeviceEventAckMsg()
    • deviceEventAckMsg.toObject ⇒ object
  • InboundAckMsg ⇐ AbstractValidator
    • new InboundAckMsg()
    • inboundAckMsg.toObject ⇒ object
  • InboundDataEventMsg ⇐ AbstractValidator
    • new InboundDataEventMsg()
    • inboundDataEventMsg.toObject ⇒ object
  • IotHubEventMsg ⇐ AbstractValidator
    • new IotHubEventMsg()
    • iotHubEventMsg.toObject ⇒ object
  • OutboundInitMsg ⇐ AbstractValidator
    • new OutboundInitMsg()
    • outboundInitMsg.toObject ⇒ object
  • OutboundSentMsg ⇐ AbstractValidator
    • new OutboundSentMsg()
    • outboundSentMsg.toObject ⇒ object
  • EmailMsg ⇐ AbstractValidator
    • new EmailMsg()
    • emailMsg.toObject ⇒ object
  • SmsMsg ⇐ AbstractValidator
    • new SmsMsg()
    • smsMsg.toObject ⇒ object
  • SolarTimer
    • new SolarTimer(data)
    • solarTimer.next()
  • AttributeCondition ⇐ Condition
    • attributeCondition.toObject ⇒ object
    • attributeCondition.satisfies(context)
  • Condition ⇐ AbstractValidator
    • condition.toObject ⇒ object
  • DeltaCondition ⇐ Condition
    • deltaCondition.toObject ⇒ object
    • deltaCondition.satisfies(context)
  • NotCondition ⇐ Condition
    • notCondition.toObject ⇒ object
    • notCondition.satisfies(context)
    • notCondition.satisfies(context)
  • NotCondition ⇐ Condition
    • notCondition.toObject ⇒ object
    • notCondition.satisfies(context)
    • notCondition.satisfies(context)
  • parse()
Leverege Platform
Docs
Overview
Connect
FacebookLinkedInTwitter
Facebook Open Source