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

Data Store

Classes

Access

Access contains a set of standard methods for getting and setting data for any database

AppState

The AppState allows the using application to store its current state in a common way, as well as any app specific data needed.

This is expecting a Database Adapter as its argument. It is assumed that the AppState owns the root of the database, as destroy() will remove it.

Structure : { status : { state : 'initializing' | 'started' | ... info : 'sub state' detail : { } updated : timestamp } app : { } }

DeviceStore

Returns a new DeviceStore class that is used to access the various bins of a Device's information

Access

Returns a new FirebaseStore class that will use the firebase library passed in. This should be either 'firebase' (on browser) or 'firebase-admin' on server.

FirebaseStore

contains many methods for interacting with the firebase database

RootStore

Returns a new SystemStore class that is used to access the various bins of a Device's information

SystemStore

Returns a new SystemStore class that is used to access the various bins of a Device's information

Functions

_refFor returns the ref for a child or the current ref(path)
child returns an access object for the child(path)
on starts an on listener(path, onComplete, onCancelled, cxt)
off starts an off listener(path, callback, cxt)
onAdd starts a listener for when a child is added(path, onComplete, onCancelled, cxt)
offAdd starts a listener for when a child is added(path, callback, cxt)
onRemove start a listener for when a child is removed(path, onComplete, onCancelled, cxt)
offRemove start a listener for when a child is removed(path, callback, cxt)
once make a one time query to the database for information(path, onComplete, onError)
set sets the value at the given path(path, value, onComplete)
push pushes the value at the given path(path, value, onComplete)
update updates the value at the given path(path, value, onComplete)
remove the data at the given path(path, onComplete)
timestampValue returns the timestamp of the server()
destroy Complete removes the state for this app(onComplete)
signIn sign in to the database()
setState sets the status state(value, onComplete)
setInfo Sets an optional sub-state value into the status block(value, onComplete)
getInfo gets info from the database(onComplete, onError)
setDetailData sets the value at the path(path, value, onComplete)
removeDetailData removes the data at the path(path, onComplete)
getDetailData gets the data on the path(path, onComplete, onError, cxt)
getStatus Returns a Promise that is querying the app for its full status.(onComplete, onError)
onStatus Listens for changes to the status object(onComplete, onCancel)
offStatus Listens for changes to the status object(callback)
setAppData sets app data at the path(path, value, onComplete)
getAppData gets the app data at the path(path, onComplete, onError)
onAppData listen for changes to the app data(path, onComplete, onCancel)
offAppData listen for changes to the app data(path, callback)
updateAppData updates the app data(path, value, onComplete)
removeAppData removes the app data at the path(path, value, onComplete)
sign in with a custom jwt token(jwt)
using the specified class(path, ClassType)
access Creates an Access object referencing the location retrive to the current root(path)
an Access object pointing to /srv/ is created(name)
timestampValue returns the timestamp of the server()
appByName searchs firebase instance for an app with the name(firebase, name)
registerDatabase adds a database class to the databases object(type, clzz)
registerLib adds a library to the lib object(type, lib)
createRootStore creates a store with the root store class(options)
createSystemStore creates a store with the system store class(options)
createDeviceStore creates a store with the device store class(options)
createAppState Creates an AppState object from the given arguments:(options, name)
data returns an instance of access for getting data()
meta returns an instance of access for getting the meta()
events returns an instance of access for getting events()
outbound returns an instance of access for outbound data()
device returns an instance of access for devices()
cache returns an instance of access for the cache()
init creates and returns an instance of a class for interacting with the database(firebase)
_refFor returns the reference for the given path(path)
child returns an access object for the provided path(path)
on starts a listener on the provided path(path, onComplete, onCancelled, cxt)
off starts a listener on the provided path(path, callback, cxt)
onAdd starts a listener on the provided path for children being added(path, onComplete, onCancelled, cxt)
offAdd starts a listener on the path for children being added(path, callback, cxt)
onRemove starts a listener for children being removed(path, onComplete, onCancelled, cxt)
offRemove starts a listener for children being removed(path, callback, cxt)
once makes a one time call to the database for information(path, onComplete, onError)
set sets the value at the path(path, value, onComplete)
update updates the value at the path(path, value, onComplete)
remove removes the value at the path(path, onComplete)
timestampValue returns the timestamp of the firebase server()
_refFor gets a database reference for the path(path)
_metaRefFor gets a database reference for the meta data of the path(path)
_serviceRefFor gets a database reference for the service data of the path(path)
sign in with a custom jwt token(jwt)
child returns a new FirebaseStore with the a new root(path)
data returns a new Access object to the data root()
meta returns a new Access object to the meta root()
device returns a new Accees object to the device root()
access Creates an Access object referencing the location reative to the current root(path)
on creates a listener for when the data at the path is changed(path, onComplete, onCancelled, cxt)
off create a listener for when the data at the path is changed(path, callback, cxt)
once get the data one time(path, onComplete, onError)
set sets the data at the path(path, value, onComplete)
update updates the data at the path(path, value, onComplete)
remove removes the data at the path(path, onComplete)
metaOn adds a listener to the meta data at the path(path, onComplete, onCancelled, cxt)
metaOff adds a listener to the meta data at the path(path, callback, cxt)
metaOnce gets the meta data once(path, onComplete, onError)
metaSet sets the meta data(path, value, onComplete)
metaUpdate updates the meta data(path, value, onComplete)
metaRemove removes the meta at the path(path, onComplete)
timestampValue gets the timestamp of the database()
appByName gets a firebase app based off its name(name)
Creates a DeviceStore for the systems device(dev)
deviceStore Creates a DeviceStore for the systems device(dev)

Access

Access contains a set of standard methods for getting and setting data for any database

Kind: global class

  • Access
    • new Access(ref, firebase)
    • new Access(ref)

new Access(ref, firebase)

ParamTypeDescription
refobjectcontains all the methods for interacting with the database
firebaseobjectfirebase database object

new Access(ref)

ParamTypeDescription
refobjectobject with methods to interact with the database

AppState

The AppState allows the using application to store its current state in a common way, as well as any app specific data needed.

This is expecting a Database Adapter as its argument. It is assumed that the AppState owns the root of the database, as destroy() will remove it.

Structure : { status : { state : 'initializing' | 'started' | ... info : 'sub state' detail : { } updated : timestamp } app : { } }

Kind: global class

DeviceStore

Returns a new DeviceStore class that is used to access the various bins of a Device's information

Kind: global class

Access

Returns a new FirebaseStore class that will use the firebase library passed in. This should be either 'firebase' (on browser) or 'firebase-admin' on server.

Kind: global class

  • Access
    • new Access(ref, firebase)
    • new Access(ref)

new Access(ref, firebase)

ParamTypeDescription
refobjectcontains all the methods for interacting with the database
firebaseobjectfirebase database object

new Access(ref)

ParamTypeDescription
refobjectobject with methods to interact with the database

FirebaseStore

contains many methods for interacting with the firebase database

Kind: global class

new FirebaseStore(options)

ParamTypeDescription
optionsobjectfirebase config

RootStore

Returns a new SystemStore class that is used to access the various bins of a Device's information

Kind: global class

SystemStore

Returns a new SystemStore class that is used to access the various bins of a Device's information

Kind: global class

_refFor returns the ref for a child or the current ref(path)

Kind: global function

ParamTypeDescription
pathstringnull for current ref or child string for a child

child returns an access object for the child(path)

Kind: global function

ParamTypeDescription
pathstringthe path for the child

on starts an on listener(path, onComplete, onCancelled, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to listen on
onCompletefunction
onCancelledfunction
cxtobject

off starts an off listener(path, callback, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to listen on
callbackfunction
cxtobject

onAdd starts a listener for when a child is added(path, onComplete, onCancelled, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to listen on
onCompletefunction
onCancelledfunction
cxtobject

offAdd starts a listener for when a child is added(path, callback, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to listen on
callbackfunction
cxtobject

onRemove start a listener for when a child is removed(path, onComplete, onCancelled, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to listen on
onCompletefunction
onCancelledfunction
cxtobject

offRemove start a listener for when a child is removed(path, callback, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to listen on
callbackfunction
cxtobject

once make a one time query to the database for information(path, onComplete, onError)

Kind: global function

ParamTypeDescription
pathstringthe path to listen on
onCompletefunction
onErrorfunction

set sets the value at the given path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to set the value on
valueanythe value to set
onCompletefunction

push pushes the value at the given path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to push the value to
valueanythe value to be pushed
onCompletefunction

update updates the value at the given path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to update the data at
valueanythe value to be updated
onCompletefunction

remove the data at the given path(path, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to remove the data at
onCompletefunction

timestampValue returns the timestamp of the server()

Kind: global function

destroy Complete removes the state for this app(onComplete)

Kind: global function

ParamType
onCompletefunction

signIn sign in to the database()

Kind: global function

setState sets the status state(value, onComplete)

Kind: global function

ParamTypeDescription
valueanyvalue to set the state to
onCompletefunction

setInfo Sets an optional sub-state value into the status block(value, onComplete)

Kind: global function

ParamTypeDescription
valueanyvalue to set the info to
onCompletefunction

getInfo gets info from the database(onComplete, onError)

Kind: global function

ParamType
onCompletefunction
onErrorfunction

setDetailData sets the value at the path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringpath to set the value at
valueanydata to set at the path
onCompletefunction

removeDetailData removes the data at the path(path, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to remove the data at
onCompletefunction

getDetailData gets the data on the path(path, onComplete, onError, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to get the data from
onCompletefunction
onErrorfunction
cxtany

getStatus Returns a Promise that is querying the app for its full status.(onComplete, onError)

Kind: global function

ParamType
onCompletefunction
onErrorfunction

onStatus Listens for changes to the status object(onComplete, onCancel)

Kind: global function

ParamType
onCompletefunction
onCancelfunction

offStatus Listens for changes to the status object(callback)

Kind: global function

ParamType
callbackfunction

setAppData sets app data at the path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringpath to set the data at
valueanydata to be set
onCompletefunction

getAppData gets the app data at the path(path, onComplete, onError)

Kind: global function

ParamTypeDescription
pathstringpath to get the data at
onCompletefunction
onErrorfunction

onAppData listen for changes to the app data(path, onComplete, onCancel)

Kind: global function

ParamTypeDescription
pathstringpath to listen to app data at
onCompletefunction
onCancelfunction

offAppData listen for changes to the app data(path, callback)

Kind: global function

ParamTypeDescription
pathstringpath to listen to app data at
callbackfunction

updateAppData updates the app data(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to update the data at
valueanyvalue to update the app data to
onCompletefunction

removeAppData removes the app data at the path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to remove the data at
valueanynot used?
onCompletefunction

access Creates an Access object referencing the location retrive to the current root(path)

Kind: global function

ParamTypeDescription
pathstringdata path

timestampValue returns the timestamp of the server()

Kind: global function

appByName searchs firebase instance for an app with the name(firebase, name)

Kind: global function

ParamTypeDescription
firebaseobject
namestringname of firebase app to search for

registerDatabase adds a database class to the databases object(type, clzz)

Kind: global function

ParamTypeDescription
typestringthe look up string for the database
clzzclassthe class for creating databases

registerLib adds a library to the lib object(type, lib)

Kind: global function

ParamTypeDescription
typestringthe string that lib gets registered under
libanythe library to be registered

createRootStore creates a store with the root store class(options)

Kind: global function

ParamType
optionsobject

createSystemStore creates a store with the system store class(options)

Kind: global function

ParamType
optionsobject

createDeviceStore creates a store with the device store class(options)

Kind: global function

ParamType
optionsobject

createAppState Creates an AppState object from the given arguments:(options, name)

Kind: global function

ParamDescription
optionseither a config object, or a database
namethe name of AppState to attach too. If null/undefined the options.appName or db.options.appName will be used.

data returns an instance of access for getting data()

Kind: global function

meta returns an instance of access for getting the meta()

Kind: global function

events returns an instance of access for getting events()

Kind: global function

outbound returns an instance of access for outbound data()

Kind: global function

device returns an instance of access for devices()

Kind: global function

cache returns an instance of access for the cache()

Kind: global function

init creates and returns an instance of a class for interacting with the database(firebase)

Kind: global function

ParamType
firebaseobject

_refFor returns the reference for the given path(path)

Kind: global function

ParamTypeDescription
pathstringthe path to return the ref of

child returns an access object for the provided path(path)

Kind: global function

ParamTypeDescription
pathstringthe path to return the new access object for

on starts a listener on the provided path(path, onComplete, onCancelled, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to start the listener on
onCompletefunction
onCancelledfunction
cxtobject

off starts a listener on the provided path(path, callback, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to start the listener
callbackfunction
cxtobject

onAdd starts a listener on the provided path for children being added(path, onComplete, onCancelled, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to listen on
onCompletefunction
onCancelledfunction
cxtobject

offAdd starts a listener on the path for children being added(path, callback, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path for the listener
callbackfunction
cxtobject

onRemove starts a listener for children being removed(path, onComplete, onCancelled, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path for the listener
onCompletefunction
onCancelledfunction
cxtobject

offRemove starts a listener for children being removed(path, callback, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path for the listener
callbackfunction
cxtobject

once makes a one time call to the database for information(path, onComplete, onError)

Kind: global function

ParamTypeDescription
pathstringthe path to get
onCompletefunction
onErrorfunction

set sets the value at the path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to set
valueanyvalue that will be set
onCompletefunction

update updates the value at the path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to update
valueanyvalue that will be updated
onCompletefunction

remove removes the value at the path(path, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path of the data to be removed
onCompletefunction

timestampValue returns the timestamp of the firebase server()

Kind: global function

_refFor gets a database reference for the path(path)

Kind: global function

ParamTypeDescription
pathstringpath to get a database reference for

_metaRefFor gets a database reference for the meta data of the path(path)

Kind: global function

ParamTypeDescription
pathstringpath to get the meta for

_serviceRefFor gets a database reference for the service data of the path(path)

Kind: global function

ParamTypeDescription
pathstringpath to get the service for

child returns a new FirebaseStore with the a new root(path)

Kind: global function

ParamTypeDescription
pathstringappended to the current root to make the root of the new FirebaseStore

data returns a new Access object to the data root()

Kind: global function

meta returns a new Access object to the meta root()

Kind: global function

device returns a new Accees object to the device root()

Kind: global function

access Creates an Access object referencing the location reative to the current root(path)

Kind: global function

ParamTypeDescription
pathstringpath for a new access object

on creates a listener for when the data at the path is changed(path, onComplete, onCancelled, cxt)

Kind: global function

ParamTypeDescription
pathstringpath to the desired data to be listened to
onCompletefunction
onCancelledfunction
cxtobject

off create a listener for when the data at the path is changed(path, callback, cxt)

Kind: global function

ParamTypeDescription
pathstringpath to the desired data to be listened to
callbackfunction
cxtobject

once get the data one time(path, onComplete, onError)

Kind: global function

ParamTypeDescription
pathstringpath to get the data from
onCompletefunction
onErrorfunction

set sets the data at the path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringpath to set the value at
valueanyvalue to set
onCompletefunction

update updates the data at the path(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringpath to update the value of
valueanyvalue to update
onCompletefunction

remove removes the data at the path(path, onComplete)

Kind: global function

ParamTypeDescription
pathstringpath to remove
onCompletefunction

metaOn adds a listener to the meta data at the path(path, onComplete, onCancelled, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to listen to the meta on
onCompletefunction
onCancelledfunction
cxtobject

metaOff adds a listener to the meta data at the path(path, callback, cxt)

Kind: global function

ParamTypeDescription
pathstringthe path to listen to the meta
callbackfunction
cxtobject

metaOnce gets the meta data once(path, onComplete, onError)

Kind: global function

ParamTypeDescription
pathstringthe path to get the meta from
onCompletefunction
onErrorfunction

metaSet sets the meta data(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to set the meta on
valueanythe data to set at the path
onCompletefunction

metaUpdate updates the meta data(path, value, onComplete)

Kind: global function

ParamTypeDescription
pathstringthe path to update the meta on
valueanythe data to update the meta with
onCompletefunction

metaRemove removes the meta at the path(path, onComplete)

Kind: global function

ParamTypeDescription
pathstringpath to remove the meta on
onCompletefunction

timestampValue gets the timestamp of the database()

Kind: global function

appByName gets a firebase app based off its name(name)

Kind: global function

ParamTypeDescription
namestringfirebase app to use

Creates a DeviceStore for the systems device(dev)

Kind: global function

ParamDescription
deveither th id of the device, or a device object that contains an id field

deviceStore Creates a DeviceStore for the systems device(dev)

Kind: global function

ParamDescription
deveither th id of the device, or a device object that contains an id field
← Cluster ManagerExit →
  • Classes
  • Functions
  • Access
    • new Access(ref, firebase)
    • new Access(ref)
  • AppState
  • DeviceStore
  • Access
    • new Access(ref, firebase)
    • new Access(ref)
  • FirebaseStore
    • new FirebaseStore(options)
  • RootStore
  • SystemStore
  • _refFor returns the ref for a child or the current ref(path)
  • child returns an access object for the child(path)
  • on starts an on listener(path, onComplete, onCancelled, cxt)
  • off starts an off listener(path, callback, cxt)
  • onAdd starts a listener for when a child is added(path, onComplete, onCancelled, cxt)
  • offAdd starts a listener for when a child is added(path, callback, cxt)
  • onRemove start a listener for when a child is removed(path, onComplete, onCancelled, cxt)
  • offRemove start a listener for when a child is removed(path, callback, cxt)
  • once make a one time query to the database for information(path, onComplete, onError)
  • set sets the value at the given path(path, value, onComplete)
  • push pushes the value at the given path(path, value, onComplete)
  • update updates the value at the given path(path, value, onComplete)
  • remove the data at the given path(path, onComplete)
  • timestampValue returns the timestamp of the server()
  • destroy Complete removes the state for this app(onComplete)
  • signIn sign in to the database()
  • setState sets the status state(value, onComplete)
  • setInfo Sets an optional sub-state value into the status block(value, onComplete)
  • getInfo gets info from the database(onComplete, onError)
  • setDetailData sets the value at the path(path, value, onComplete)
  • removeDetailData removes the data at the path(path, onComplete)
  • getDetailData gets the data on the path(path, onComplete, onError, cxt)
  • getStatus Returns a Promise that is querying the app for its full status.(onComplete, onError)
  • onStatus Listens for changes to the status object(onComplete, onCancel)
  • offStatus Listens for changes to the status object(callback)
  • setAppData sets app data at the path(path, value, onComplete)
  • getAppData gets the app data at the path(path, onComplete, onError)
  • onAppData listen for changes to the app data(path, onComplete, onCancel)
  • offAppData listen for changes to the app data(path, callback)
  • updateAppData updates the app data(path, value, onComplete)
  • removeAppData removes the app data at the path(path, value, onComplete)
  • access Creates an Access object referencing the location retrive to the current root(path)
  • timestampValue returns the timestamp of the server()
  • appByName searchs firebase instance for an app with the name(firebase, name)
  • registerDatabase adds a database class to the databases object(type, clzz)
  • registerLib adds a library to the lib object(type, lib)
  • createRootStore creates a store with the root store class(options)
  • createSystemStore creates a store with the system store class(options)
  • createDeviceStore creates a store with the device store class(options)
  • createAppState Creates an AppState object from the given arguments:(options, name)
  • data returns an instance of access for getting data()
  • meta returns an instance of access for getting the meta()
  • events returns an instance of access for getting events()
  • outbound returns an instance of access for outbound data()
  • device returns an instance of access for devices()
  • cache returns an instance of access for the cache()
  • init creates and returns an instance of a class for interacting with the database(firebase)
  • _refFor returns the reference for the given path(path)
  • child returns an access object for the provided path(path)
  • on starts a listener on the provided path(path, onComplete, onCancelled, cxt)
  • off starts a listener on the provided path(path, callback, cxt)
  • onAdd starts a listener on the provided path for children being added(path, onComplete, onCancelled, cxt)
  • offAdd starts a listener on the path for children being added(path, callback, cxt)
  • onRemove starts a listener for children being removed(path, onComplete, onCancelled, cxt)
  • offRemove starts a listener for children being removed(path, callback, cxt)
  • once makes a one time call to the database for information(path, onComplete, onError)
  • set sets the value at the path(path, value, onComplete)
  • update updates the value at the path(path, value, onComplete)
  • remove removes the value at the path(path, onComplete)
  • timestampValue returns the timestamp of the firebase server()
  • _refFor gets a database reference for the path(path)
  • _metaRefFor gets a database reference for the meta data of the path(path)
  • _serviceRefFor gets a database reference for the service data of the path(path)
  • child returns a new FirebaseStore with the a new root(path)
  • data returns a new Access object to the data root()
  • meta returns a new Access object to the meta root()
  • device returns a new Accees object to the device root()
  • access Creates an Access object referencing the location reative to the current root(path)
  • on creates a listener for when the data at the path is changed(path, onComplete, onCancelled, cxt)
  • off create a listener for when the data at the path is changed(path, callback, cxt)
  • once get the data one time(path, onComplete, onError)
  • set sets the data at the path(path, value, onComplete)
  • update updates the data at the path(path, value, onComplete)
  • remove removes the data at the path(path, onComplete)
  • metaOn adds a listener to the meta data at the path(path, onComplete, onCancelled, cxt)
  • metaOff adds a listener to the meta data at the path(path, callback, cxt)
  • metaOnce gets the meta data once(path, onComplete, onError)
  • metaSet sets the meta data(path, value, onComplete)
  • metaUpdate updates the meta data(path, value, onComplete)
  • metaRemove removes the meta at the path(path, onComplete)
  • timestampValue gets the timestamp of the database()
  • appByName gets a firebase app based off its name(name)
  • Creates a DeviceStore for the systems device(dev)
  • deviceStore Creates a DeviceStore for the systems device(dev)
Leverege Platform
Docs
Overview
Connect
FacebookLinkedInTwitter
Facebook Open Source