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

API Redux

Classes

Grp - Class representing a group of items
Grp
Interface

Class representing the interface route of the api

Messages
Obj - class representing a Single device
Obj
User

User - class representing a user

Users

Users - class representing a group of users

Functions

verify(targetLocation) ⇒ function

gets and verifies the Bearer token

login(username, password, projectId) ⇒ function

will log in the user

logout() ⇒ function

will log the user out

forgotPassword(username, projectId) ⇒ function

sends an email to reset the password

changePassword(oldPassword, newPassword) ⇒ function

change the currently logged in user's password

resetPassword(username, password, confirm, token, projectId) ⇒ function

changes the user's password

renew(auto) ⇒ function
isLoggedIn(state) ⇒ boolean

checks if there is a user logged in

isLoading(state) ⇒ boolean

checks if the ui is attempting to log in or verify a user

isVerifying(state) ⇒ boolean

checks if the ui is attempting to verify a user

isError(state) ⇒ boolean

checks if there was an error on the most recent action taken

getErrorMessage(state) ⇒ string
getUsername(state) ⇒ string
getUserId(state) ⇒ string
getProfile(state) ⇒ object
isLoading(state, path) ⇒ boolean

checks if a query is loading

isError(state, path) ⇒ boolean

check if a query is in error

isDone(state, path) ⇒ boolean

check if a query has completed

isList(state, path) ⇒ boolean

check if a query result is a list

isTable(state, path) ⇒ boolean

check if a query result is a table

isObject(state, path) ⇒ boolean

check if a query result is an object

getObject(state, path) ⇒ object

gets the result of a query if it is an object

getHistory(state, path, queryName) ⇒ object

gets the result of a history query

getList(state, path, opts) ⇒ array

get the list result of a query

getTable(state, path, opts) ⇒ array

get the table result of a query

setFilter(name, filter)

Registers a filter function against the filter type.

getFilter()

Returns the filter function registerd at the name

getTextFilter()

Returns the default text filter

createPromise(method, path, body, options, type, extra) ⇒ function
list(path, parentId, type, options) ⇒ function
create(path, obj, parentId, type, options) ⇒ function
get(path, parentPath, options) ⇒ function
getHistory(path, parentPath, options, queryName) ⇒ function
remove(path, id, options) ⇒ function
update(path, data, parentPath, parentId, options) ⇒ function
createDeviceUser(path, obj, parentPath, options) ⇒ function
addDeviceUser(path, obj, parentId, options) ⇒ function

creates a user, and then addes them to the device

sendOutboundDeviceMessage(path, obj, parentId, options) ⇒ function

sends an outbound message to a device

updateDeviceUser(path, obj, parentId, options) ⇒ promise
removeDeviceUser(path, obj, parentId, options) ⇒ function
copy()

Shallow copies the state, as well as the lookup and data if needed

getApiQueryable(query) ⇒ function
getApiQueryable(query) ⇒ function
defaultGetApiQueryable(query) ⇒ function
create(query) ⇒ function
getActionConstant(action, mode) ⇒ string
isSimpleTimeQuery(q) ⇒ boolean
isReversed(opts) ⇒ boolean
mergeItems(items, newItems, range) ⇒ array
getQueryChunks(opts, chunkSize) ⇒ object
getQueryOptions(opts) ⇒ object
receive(state, action)

behavior for the GET action

update(state, action)

behavior for the UPDATE action

add(state, action)

behavior for the ADD action

remove(state, action)

behavior for the REMOVE action

reducer(initialState, actionTypeBase, additionalReducers)

creates and returns a generic reducer

list(opts) ⇒ function

makes an api call to get the list of current users for the project

create(item) ⇒ function

makes an api call to create a new user

get(item, opts) ⇒ function

makes an api call to get a user

remove(item) ⇒ function

makes an api call to remove a user

update(item, patchOps, opts) ⇒ function

makes an api call to update a user

forcePWReset(item, projectId) ⇒ function

makes an api call sending an email to the provided user making them reset their password

encodeQ(options)

turns a query object to a string to be appended to an http request url

objectToQueryString(a)

turns an object into a string that can be used in a http request url

buildParams(prefix, obj, add)

manipulates obj according to the add function provided to it

getPatchOpsArray(patchOps)

transforms an object into an array of {path, value, op} objects

combinePath(path, subpath)

checks for '/' and appends the subpath onto the path

getId(id, throwIfNull)

returns id if id is string or id.id if id is an object

getLastInPath(path)

returns the substring after the last '/'

Grp - Class representing a group of items

Kind: global class

Grp

Kind: global class

  • Grp
    • new Grp(parentPath, id, attribute)
    • .list(options) ⇒ function
    • .create(obj, options) ⇒ function
    • .get(id, options) ⇒ function
    • .update(id, data, options) ⇒ function
    • .delete(id, options) ⇒ function
    • .model(options) ⇒ function
    • .filter(filter)
    • .obj(id) ⇒ Obj
    • .getList(state, opts) ⇒ object
    • .isTable(state, opts) ⇒ boolean
    • .getObject(state, id, opts) ⇒ object
    • .getModel(state) ⇒ object
    • .isLoading(state) ⇒ boolean
    • .isError(state) ⇒ boolean
    • .isDone(state) ⇒ boolean

new Grp(parentPath, id, attribute)

creates a group

ParamTypeDescription
parentPathstringthe path of the api call for the immediate parent
idstringidentifier for the group to be queried for
attributestringadditional information to be added to the path

grp.list(options) ⇒ function

makes an api call for the list of objects

Kind: instance method of Grp
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectapi options

grp.create(obj, options) ⇒ function

api call to create an item as a child of the current path

Kind: instance method of Grp
Returns: function - redux thunk function

ParamTypeDescription
objobjectitem to be created
optionsobjectapi options

grp.get(id, options) ⇒ function

api call to get a child of the current path

Kind: instance method of Grp
Returns: function - redux thunk function

ParamTypeDescription
idstringid of the item to be returned
optionsobjectapi options

grp.update(id, data, options) ⇒ function

api call to update a child of the current path

Kind: instance method of Grp
Returns: function - redux thunk function

ParamTypeDescription
idstringid of the item to be updated
dataobjectvalues of the item to be changed
optionsobjectapi options

grp.delete(id, options) ⇒ function

api call to delete a child of the current path

Kind: instance method of Grp
Returns: function - redux thunk function

ParamTypeDescription
idstringid of the item to be deleted
optionsobjectapi options

grp.model(options) ⇒ function

api call to get the model for the path

Kind: instance method of Grp
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectapi options

grp.filter(filter)

locally filters the results

Kind: instance method of Grp

ParamTypeDescription
filterobjectthe filter object for the path

grp.obj(id) ⇒ Obj

returns an instance of the obj class with the current path prepended

Kind: instance method of Grp
Returns: Obj - has the current path with the id

ParamType
idstring

grp.getList(state, opts) ⇒ object

Kind: instance method of Grp
Returns: object - results, in the form of a list

ParamTypeDescription
stateobjectthe current redux state
optsobject

grp.isTable(state, opts) ⇒ boolean

Kind: instance method of Grp
Returns: boolean - whether or not the results can be returned as a table

ParamTypeDescription
stateobjectthe current redux state
optsobject

grp.getObject(state, id, opts) ⇒ object

Kind: instance method of Grp
Returns: object - returns the resulting object from the query

ParamTypeDescription
stateobjectthe current redux state
idstringid of the object
optsobject

grp.getModel(state) ⇒ object

Kind: instance method of Grp
Returns: object - returns a model for the query

ParamTypeDescription
stateobjectthe current redux state

grp.isLoading(state) ⇒ boolean

Kind: instance method of Grp
Returns: boolean - whether the query is loading

ParamTypeDescription
stateobjectthe current redux state

grp.isError(state) ⇒ boolean

Kind: instance method of Grp
Returns: boolean - whether the query had an error

ParamTypeDescription
stateobjectthe current redux state

grp.isDone(state) ⇒ boolean

Kind: instance method of Grp
Returns: boolean - whether the query is finished

ParamTypeDescription
stateobjectthe current redux state

Interface

Class representing the interface route of the api

Kind: global class

  • Interface
    • new Interface(system, type)
    • .list(options) ⇒ function
    • .filter(filter)
    • .create(obj, options) ⇒ function
    • .delete(id, options) ⇒ function
    • .model(options) ⇒ function
    • .obj(id) ⇒ Obj
    • .getList(state, opts) ⇒ object
    • .getModel(state) ⇒ object
    • .isLoading(state) ⇒ boolean
    • .isError(state) ⇒ boolean
    • .isDone(state) ⇒ boolean

new Interface(system, type)

create the Interface

ParamTypeDescription
systemstringid or alias of the system to connect to
typestringthe alias of the type of blueprint/devices

interface.list(options) ⇒ function

api call to get the list of devices of the provided type

Kind: instance method of Interface
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectto be included in the api call

interface.filter(filter)

locally filters the results

Kind: instance method of Interface

ParamTypeDescription
filterobjectthe filter object for the path

interface.create(obj, options) ⇒ function

api call to create a device of the provided type

Kind: instance method of Interface
Returns: function - redux thunk function

ParamTypeDescription
objobjectdevice to be created
optionsobjectto be included in the api call

interface.delete(id, options) ⇒ function

api call to delete a device of the provided type

Kind: instance method of Interface
Returns: function - redux thunk function

ParamTypeDescription
idstringid of the device to be deleted
optionsobjectto be included in the api call

interface.model(options) ⇒ function

api call to get the model of a device of the provided type

Kind: instance method of Interface
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectto be included in the api call

interface.obj(id) ⇒ Obj

returns an instance of the obj class with the current path prepended

Kind: instance method of Interface
Returns: Obj - has the current path with the id

ParamType
idstring

interface.getList(state, opts) ⇒ object

Kind: instance method of Interface
Returns: object - results, in the form of a list

ParamTypeDescription
stateobjectthe current redux state
optsobject

interface.getModel(state) ⇒ object

Kind: instance method of Interface
Returns: object - returns a model for the query

ParamTypeDescription
stateobjectthe current redux state

interface.isLoading(state) ⇒ boolean

Kind: instance method of Interface
Returns: boolean - whether the query is loading

ParamTypeDescription
stateobjectthe current redux state

interface.isError(state) ⇒ boolean

Kind: instance method of Interface
Returns: boolean - whether the query had an error

ParamTypeDescription
stateobjectthe current redux state

interface.isDone(state) ⇒ boolean

Kind: instance method of Interface
Returns: boolean - whether the query is finished

ParamTypeDescription
stateobjectthe current redux state

Messages

Kind: global class

  • Messages
    • new Messages(parentPath)
    • .getMessages(state, queryName) ⇒ object

new Messages(parentPath)

creates Messages

ParamTypeDescription
parentPathstringthe path of the api call for the immediate parent

messages.getMessages(state, queryName) ⇒ object

gets the sent outbound messages

Kind: instance method of Messages
Returns: object - the sent outbound messages

ParamTypeDescription
stateobjectthe current redux state
queryNamestringidentifier of the query

Obj - class representing a Single device

Kind: global class

Obj

Kind: global class

  • Obj
    • new Obj(parentPath, id, isInGroup)
    • .get(options) ⇒ function
    • .history(options) ⇒ function
    • .create(obj, options) ⇒ function
    • .update(obj, options) ⇒ function
    • .delete(options) ⇒ function
    • .model(options) ⇒ function
    • .obj(id) ⇒ Obj
    • .grp(attribute) ⇒ Grp
    • .users() ⇒ object
    • .messages() ⇒ object
    • .getObject(state) ⇒ object
    • .getTable(state, opts) ⇒ object
    • .getModel(state) ⇒ object
    • .getHistory(state, queryName) ⇒ object
    • .isTable(state) ⇒ boolean
    • .isLoading(state) ⇒ boolean
    • .isError(state) ⇒ boolean
    • .isDone(state) ⇒ boolean

new Obj(parentPath, id, isInGroup)

creates an Object

ParamTypeDescription
parentPathstringthe path of the api call for the immediate parent
idstringidentifier for the group to be queried for
isInGroupbooleanrepresents if the object is in a group

obj.get(options) ⇒ function

makes an api call for the for the Object at the path

Kind: instance method of Obj
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectapi options

obj.history(options) ⇒ function

makes an api call to get the history of an object at the path

Kind: instance method of Obj
Returns: function - redux thunk function

ParamTypeDescription
query.queryobjectquery params that the server will use
query.queryNamestringquery identifier
optionsobjectapi options

obj.create(obj, options) ⇒ function

makes an api call to create an object at the path

Kind: instance method of Obj
Returns: function - redux thunk function

ParamTypeDescription
objobjectthe object to be created
optionsobjectapi options

obj.update(obj, options) ⇒ function

makes an api call to update the object at the path

Kind: instance method of Obj
Returns: function - redux thunk function

ParamTypeDescription
objobjectthe object values to be updated
optionsobjectapi options

obj.delete(options) ⇒ function

makes an api call to delete the object at the path

Kind: instance method of Obj
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectapi options

obj.model(options) ⇒ function

api call to get the model for the path

Kind: instance method of Obj
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectapi options

obj.obj(id) ⇒ Obj

Kind: instance method of Obj
Returns: Obj - object with the current path and the id provided

ParamTypeDescription
idstringid of an obj

obj.grp(attribute) ⇒ Grp

Kind: instance method of Obj
Returns: Grp - group class with the current path and attribute

ParamTypeDescription
attributestringthe attribute representing a group on the current object

obj.users() ⇒ object

makes an api call to get the users on the device

Kind: instance method of Obj
Returns: object - represents the users permissioned on the device

obj.messages() ⇒ object

makes an api access object for managing a device's outbound messages

Kind: instance method of Obj
Returns: object - the api access object

obj.getObject(state) ⇒ object

get the current object from the state

Kind: instance method of Obj
Returns: object - the object

ParamTypeDescription
stateobjectthe current redux state

obj.getTable(state, opts) ⇒ object

Kind: instance method of Obj
Returns: object - table of the results

ParamTypeDescription
stateobjectcurrent redux state
optsobject

obj.getModel(state) ⇒ object

Kind: instance method of Obj
Returns: object - the model for the object

ParamTypeDescription
stateobjectthe current redux state

obj.getHistory(state, queryName) ⇒ object

gets the results of a specific query

Kind: instance method of Obj
Returns: object - the results of the query

ParamTypeDescription
stateobjectthe current redux state
queryNamestringidentifier of the query

obj.isTable(state) ⇒ boolean

Kind: instance method of Obj
Returns: boolean - whether or not the results can be returned as a table

ParamTypeDescription
stateobjectthe current redux state

obj.isLoading(state) ⇒ boolean

Kind: instance method of Obj
Returns: boolean - whether the query is loading

ParamTypeDescription
stateobjectthe current redux state

obj.isError(state) ⇒ boolean

Kind: instance method of Obj
Returns: boolean - whether the query had an error

ParamTypeDescription
stateobjectthe current redux state

obj.isDone(state) ⇒ boolean

Kind: instance method of Obj
Returns: boolean - whether the query is finished

ParamTypeDescription
stateobjectthe current redux state

User

User - class representing a user

Kind: global class

  • User
    • new User(parentPath, parentId, id)
    • .get(options) ⇒ function
    • .update() ⇒ function
    • .delete(options) ⇒ function
    • .remove(options) ⇒ function
    • .getObject(state) ⇒ object
    • .isLoading(state) ⇒ boolean
    • .isError(state) ⇒ boolean
    • .isDone(state) ⇒ boolean

new User(parentPath, parentId, id)

creates a User

ParamTypeDescription
parentPathstringthe path of the api call for the immediate parent
parentIdstringthe id for the immediate parent
idstringidentifier for the user

user.get(options) ⇒ function

Requests the object at this path

Kind: instance method of User
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectapi options

user.update() ⇒ function

Updates the object at this path

Kind: instance method of User
Returns: function - redux thunk function

ParamTypeDescription
object
object.permissionsobjectpermissions of the user being updated
object.metadataobjectmetadata of the user being created

user.delete(options) ⇒ function

Deletes the object at the path

Kind: instance method of User
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectapi options

user.remove(options) ⇒ function

Deletes the object at the path

Kind: instance method of User
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectapi options

user.getObject(state) ⇒ object

gets the user of the current path

Kind: instance method of User

ParamTypeDescription
stateobjectthe current redux state

user.isLoading(state) ⇒ boolean

Kind: instance method of User
Returns: boolean - whether the query is loading

ParamTypeDescription
stateobjectthe current redux state

user.isError(state) ⇒ boolean

Kind: instance method of User
Returns: boolean - whether the query had an error

ParamTypeDescription
stateobjectthe current redux state

user.isDone(state) ⇒ boolean

Kind: instance method of User
Returns: boolean - whether the query is finished

ParamTypeDescription
stateobjectthe current redux state

Users

Users - class representing a group of users

Kind: global class

  • Users
    • new Users(parentPath, id)
    • .list(options) ⇒ function
    • .create(object, options) ⇒ function
    • .add(user) ⇒ function
    • .update(id, data) ⇒ function
    • .delete(id, options) ⇒ function
    • .remove(id, options) ⇒ function
    • .user(id) ⇒ User
    • .getList(state, opts) ⇒ object
    • .isLoading(state) ⇒ boolean
    • .isError(state) ⇒ boolean
    • .isDone(state) ⇒ boolean

new Users(parentPath, id)

creates Users

ParamTypeDescription
parentPathstringthe path of the api call for the immediate parent
idstringidentifier for the user

users.list(options) ⇒ function

make an api call for the list of users

Kind: instance method of Users
Returns: function - redux thunk function

ParamTypeDescription
optionsobjectapi options

users.create(object, options) ⇒ function

makes an api call to create a user and permission them on the current path

Kind: instance method of Users
Returns: function - redux thunk function

ParamTypeDescription
objectobject
object.userobjectrepresents the user to be created
object.permissionsobjectrepresents the permissions of the user
object.metadataobjectmetadata of the user to be created
optionsobjectapi options

users.add(user) ⇒ function

Adds a user with permission to the device. One of id, username, or user (object with id) is required.

Kind: instance method of Users
Returns: function - redux thunk function

ParamType
userobject
user.idstring
user.usernamestring
user.userobject
user.permissionsobject
user.metadataobject

users.update(id, data) ⇒ function

If permission is an array, it is sent as a patchOps. Otherwise, a a patch ops will be build to replace permissions and metdata.

Kind: instance method of Users
Returns: function - redux thunk function

ParamTypeDescription
idstringid of the user
dataobject
data.permissionsobject
data.metadataobject

users.delete(id, options) ⇒ function

Deletes the user at the path

Kind: instance method of Users
Returns: function - redux thunk function

ParamTypeDescription
idstringuser id
optionsobjectapi options

users.remove(id, options) ⇒ function

Deletes the object at the path

Kind: instance method of Users
Returns: function - redux thunk function

ParamTypeDescription
idstringuser id
optionsobjectapi options

users.user(id) ⇒ User

Kind: instance method of Users
Returns: User - a user object for the given Id

ParamTypeDescription
idstringuser id

users.getList(state, opts) ⇒ object

Kind: instance method of Users
Returns: object - list from the current state

ParamTypeDescription
stateobjectcurrent redux state
optsobject

users.isLoading(state) ⇒ boolean

Kind: instance method of Users
Returns: boolean - whether the query is loading

ParamTypeDescription
stateobjectthe current redux state

users.isError(state) ⇒ boolean

Kind: instance method of Users
Returns: boolean - whether the query had an error

ParamTypeDescription
stateobjectthe current redux state

users.isDone(state) ⇒ boolean

Kind: instance method of Users
Returns: boolean - whether the query is finished

ParamTypeDescription
stateobjectthe current redux state

verify(targetLocation) ⇒ function

gets and verifies the Bearer token

Kind: global function
Returns: function - redux thunk function

ParamType
targetLocationstring

login(username, password, projectId) ⇒ function

will log in the user

Kind: global function
Returns: function - redux thunk function

ParamTypeDescription
usernamestring
passwordstring
projectIdstringimagine projectId, will use the project id from the api object passed to redux thunk if none provided

logout() ⇒ function

will log the user out

Kind: global function
Returns: function - redux thunk function

forgotPassword(username, projectId) ⇒ function

sends an email to reset the password

Kind: global function
Returns: function - redux thunk function

ParamTypeDescription
usernamestringthe user that the email will be sent to
projectIdstringimagine projectId, will use the project id from the api object passed to redux thunk if none provided

changePassword(oldPassword, newPassword) ⇒ function

change the currently logged in user's password

Kind: global function
Returns: function - redux thunk function

ParamType
oldPasswordstring
newPasswordstring

resetPassword(username, password, confirm, token, projectId) ⇒ function

changes the user's password

Kind: global function
Returns: function - redux thunk function

ParamTypeDescription
usernamestring
passwordstring
confirmstring2nd password entry to confirm first is correct
tokenstringapi generated token
projectIdstring

renew(auto) ⇒ function

Kind: global function
Returns: function - redux thunk function

ParamTypeDefault
autonumber0

isLoggedIn(state) ⇒ boolean

checks if there is a user logged in

Kind: global function
Returns: boolean - if there is a user logged in or not

ParamTypeDescription
stateobjectthe current Auth redux state

isLoading(state) ⇒ boolean

checks if the ui is attempting to log in or verify a user

Kind: global function
Returns: boolean - true if loading property is verifying or logging in

ParamTypeDescription
stateobjectthe current Auth redux state

isVerifying(state) ⇒ boolean

checks if the ui is attempting to verify a user

Kind: global function
Returns: boolean - if loading property is verifying

ParamTypeDescription
stateobjectthe current Auth redux state

isError(state) ⇒ boolean

checks if there was an error on the most recent action taken

Kind: global function
Returns: boolean - true if error occured

ParamTypeDescription
stateobjectthe current Auth redux state

getErrorMessage(state) ⇒ string

Kind: global function
Returns: string - the message/reason for error

ParamTypeDescription
stateobjectthe current Auth redux state

getUsername(state) ⇒ string

Kind: global function
Returns: string - username of currently logged in user

ParamTypeDescription
stateobjectthe current Auth redux state

getUserId(state) ⇒ string

Kind: global function
Returns: string - id of currently logged in user

ParamTypeDescription
stateobjectthe current Auth redux state

getProfile(state) ⇒ object

Kind: global function
Returns: object - profile of the currently logged in user

ParamTypeDescription
stateobjectthe current Auth redux state

isLoading(state, path) ⇒ boolean

checks if a query is loading

Kind: global function

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api

isError(state, path) ⇒ boolean

check if a query is in error

Kind: global function

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api

isDone(state, path) ⇒ boolean

check if a query has completed

Kind: global function

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api

isList(state, path) ⇒ boolean

check if a query result is a list

Kind: global function

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api

isTable(state, path) ⇒ boolean

check if a query result is a table

Kind: global function

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api

isObject(state, path) ⇒ boolean

check if a query result is an object

Kind: global function

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api

getObject(state, path) ⇒ object

gets the result of a query if it is an object

Kind: global function

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api

getHistory(state, path, queryName) ⇒ object

gets the result of a history query

Kind: global function

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api
queryNamestringname of the query

getList(state, path, opts) ⇒ array

get the list result of a query

Kind: global function
Returns: array - array of items

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api
optsobject

getTable(state, path, opts) ⇒ array

get the table result of a query

Kind: global function
Returns: array - array of items

ParamTypeDescription
stateobjectthe current interface redux object
pathstringstring representing the query path sent to the api
optsobject

setFilter(name, filter)

Registers a filter function against the filter type.

Kind: global function

ParamTypeDescription
namestringthe type name of the filter
filterfunctionthe function is given ( filter, items ) and should return a new list, filterer as needed. The supplied filter and list should NOT be modified.

getFilter()

Returns the filter function registerd at the name

Kind: global function

getTextFilter()

Returns the default text filter

Kind: global function

createPromise(method, path, body, options, type, extra) ⇒ function

Kind: global function
Returns: function - redux thunk function

ParamTypeDescription
methodstringhttp method
pathstringapi route to be queried
bodyobjectdata to be sent in the api call
optionsobjectoptions to be sent in the api call
typestringaction type to be used to maintain the api-redux status
extraobjectadditional information to be incuded in redux dispatches

list(path, parentId, type, options) ⇒ function

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
parentIdstringid of the parent device
typestringaction type to maintain the redux state
optionsobjectto be included in the api call

create(path, obj, parentId, type, options) ⇒ function

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
objobjectthe item to be created
parentIdstringid of the parent device
typestringaction type to maintain the redux state
optionsobjectto be included in the api call

get(path, parentPath, options) ⇒ function

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
parentPathstringpath to the parent device
optionsobjectto be included in the api call

getHistory(path, parentPath, options, queryName) ⇒ function

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
parentPathstringpath to the parent device
optionsobjectto be included in the api call
queryNamestringidentifier to maintian different query statuses

remove(path, id, options) ⇒ function

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
idstringdevice to be removed
optionsobjectto be included in the api call

update(path, data, parentPath, parentId, options) ⇒ function

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
dataobjectdata to update the device with
parentPathstringpath to the parent device
parentIdstringid of the parent device
optionsobjectto be included in the api call

createDeviceUser(path, obj, parentPath, options) ⇒ function

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
objobjectuser to be created and added to the device
parentPathstringpath to the parent device
optionsobjectto be included in the api call

addDeviceUser(path, obj, parentId, options) ⇒ function

creates a user, and then addes them to the device

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
objobjectuser to be added to the device
parentIdstringid of the parent device
optionsobjectto be included in the api call

sendOutboundDeviceMessage(path, obj, parentId, options) ⇒ function

sends an outbound message to a device

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
objobjectmessage to be sent to the device
parentIdstringid of the parent device
optionsobjectto be included in the api call

updateDeviceUser(path, obj, parentId, options) ⇒ promise

Kind: global function
Returns: promise - represents the result of the api call

ParamTypeDescription
pathstringroute to be queried from the api
objobjectuser of the device and their values to be updated
parentIdstringid of the parent device
optionsobjectto be included in the api call

removeDeviceUser(path, obj, parentId, options) ⇒ function

Kind: global function
Returns: function - call to createPromise

ParamTypeDescription
pathstringroute to be queried from the api
objobjectuser to be removed from the device
parentIdstringid of the parent device
optionsobjectto be included in the api call

copy()

Shallow copies the state, as well as the lookup and data if needed

Kind: global function

getApiQueryable(query) ⇒ function

Kind: global function

ParamTypeDescription
queryobject
query.apiobjectan api object
query.typestring
query.modestring
query.queryablestring

getApiQueryable(query) ⇒ function

Kind: global function

ParamTypeDescription
queryobject
query.apiobjectan api object
query.typestring
query.modestring
query.queryablestring

defaultGetApiQueryable(query) ⇒ function

Kind: global function

ParamTypeDescription
queryobject
query.apiobjectan api object
query.typestring
query.modestring
query.objstring

create(query) ⇒ function

Kind: global function
Returns: function - install function

ParamType
queryobject
query.modestring
query.getApiQueryableobject
query.chunkTimestring

getActionConstant(action, mode) ⇒ string

Kind: global function
Returns: string - string representing the constant for the provided action

ParamTypeDescription
actionstringaction being taken
modestring

isSimpleTimeQuery(q) ⇒ boolean

Kind: global function
Returns: boolean - represents whether the provided query is just time based or not

ParamTypeDescription
qobjectthe query object

isReversed(opts) ⇒ boolean

Kind: global function
Returns: boolean - represents whether the provided query is in descending order or not

ParamTypeDescription
optsobjectthe query object

mergeItems(items, newItems, range) ⇒ array

Kind: global function
Returns: array - array of items with newItems inserted in for the given range

ParamTypeDescription
itemsarraycurrent items
newItemsarrayitems to be merged in
rangearraytuple of start and end

getQueryChunks(opts, chunkSize) ⇒ object

Kind: global function
Returns: object - options for an api call for a chunk of data

ParamTypeDescription
optsobject
chunkSizenumbersize of the api result queries

getQueryOptions(opts) ⇒ object

Kind: global function
Returns: object - returns the opts object with correct start and end

ParamTypeDescription
optsobjectquery options

receive(state, action)

behavior for the GET action

Kind: global function

ParamTypeDescription
stateobjectcurrent redux state
actionobjectredux action

update(state, action)

behavior for the UPDATE action

Kind: global function

ParamTypeDescription
stateobjectcurrent redux state
actionobjectredux action

add(state, action)

behavior for the ADD action

Kind: global function

ParamTypeDescription
stateobjectcurrent redux state
actionobjectredux action

remove(state, action)

behavior for the REMOVE action

Kind: global function

ParamTypeDescription
stateobjectcurrent redux stae
actionobjectredux action

reducer(initialState, actionTypeBase, additionalReducers)

creates and returns a generic reducer

Kind: global function

ParamTypeDescription
initialStateobject
actionTypeBasestringdetermines what constants will be used for the action types
additionalReducers*function that will be called with state and action in the default case

list(opts) ⇒ function

makes an api call to get the list of current users for the project

Kind: global function
Returns: function - redux thunk function

ParamTypeDescription
optsobjectoptions to be provided to the api call

create(item) ⇒ function

makes an api call to create a new user

Kind: global function
Returns: function - redux thunk function

ParamTypeDescription
itemobjectthe new user to be created

get(item, opts) ⇒ function

makes an api call to get a user

Kind: global function
Returns: function - redux thunk function

ParamTypeDescription
itemstringid of the user
optsobjectoptions to be inculded in the api call

remove(item) ⇒ function

makes an api call to remove a user

Kind: global function
Returns: function - redux thunk function

ParamTypeDescription
itemstringid of the user

update(item, patchOps, opts) ⇒ function

makes an api call to update a user

Kind: global function
Returns: function - redux thunk function

ParamTypeDescription
itemstringid of the user to be updated
patchOpsobjectobject with the values to be updated
optsobjectany additional options to be sent to the api

forcePWReset(item, projectId) ⇒ function

makes an api call sending an email to the provided user making them reset their password

Kind: global function
Returns: function - redux thunk function

ParamType
itemstring
projectIdstring

encodeQ(options)

turns a query object to a string to be appended to an http request url

Kind: global function

ParamTypeDescription
optionsobjectthe parameters to be sent with a http request url

objectToQueryString(a)

turns an object into a string that can be used in a http request url

Kind: global function

ParamTypeDescription
aobjectthe object to be turned into a query string

buildParams(prefix, obj, add)

manipulates obj according to the add function provided to it

Kind: global function

ParamTypeDescription
prefixstring
objobject \arraythe object to be manipulated
addfunctionfunction used to do the manipulation

getPatchOpsArray(patchOps)

transforms an object into an array of {path, value, op} objects

Kind: global function

ParamType
patchOpsobject

combinePath(path, subpath)

checks for '/' and appends the subpath onto the path

Kind: global function

ParamType
pathstring
subpathstring

getId(id, throwIfNull)

returns id if id is string or id.id if id is an object

Kind: global function

ParamTypeDefaultDescription
idstring \object
throwIfNullbooleantrueif true will throw an error if there is no id

getLastInPath(path)

returns the substring after the last '/'

Kind: global function

ParamType
pathstring
← Api Patch OpsArray Util →
  • Classes
  • Functions
  • Grp - Class representing a group of items
  • Grp
    • new Grp(parentPath, id, attribute)
    • grp.list(options) ⇒ function
    • grp.create(obj, options) ⇒ function
    • grp.get(id, options) ⇒ function
    • grp.update(id, data, options) ⇒ function
    • grp.delete(id, options) ⇒ function
    • grp.model(options) ⇒ function
    • grp.filter(filter)
    • grp.obj(id) ⇒ Obj
    • grp.getList(state, opts) ⇒ object
    • grp.isTable(state, opts) ⇒ boolean
    • grp.getObject(state, id, opts) ⇒ object
    • grp.getModel(state) ⇒ object
    • grp.isLoading(state) ⇒ boolean
    • grp.isError(state) ⇒ boolean
    • grp.isDone(state) ⇒ boolean
  • Interface
    • new Interface(system, type)
    • interface.list(options) ⇒ function
    • interface.filter(filter)
    • interface.create(obj, options) ⇒ function
    • interface.delete(id, options) ⇒ function
    • interface.model(options) ⇒ function
    • interface.obj(id) ⇒ Obj
    • interface.getList(state, opts) ⇒ object
    • interface.getModel(state) ⇒ object
    • interface.isLoading(state) ⇒ boolean
    • interface.isError(state) ⇒ boolean
    • interface.isDone(state) ⇒ boolean
  • Messages
    • new Messages(parentPath)
    • messages.getMessages(state, queryName) ⇒ object
  • Obj - class representing a Single device
  • Obj
    • new Obj(parentPath, id, isInGroup)
    • obj.get(options) ⇒ function
    • obj.history(options) ⇒ function
    • obj.create(obj, options) ⇒ function
    • obj.update(obj, options) ⇒ function
    • obj.delete(options) ⇒ function
    • obj.model(options) ⇒ function
    • obj.obj(id) ⇒ Obj
    • obj.grp(attribute) ⇒ Grp
    • obj.users() ⇒ object
    • obj.messages() ⇒ object
    • obj.getObject(state) ⇒ object
    • obj.getTable(state, opts) ⇒ object
    • obj.getModel(state) ⇒ object
    • obj.getHistory(state, queryName) ⇒ object
    • obj.isTable(state) ⇒ boolean
    • obj.isLoading(state) ⇒ boolean
    • obj.isError(state) ⇒ boolean
    • obj.isDone(state) ⇒ boolean
  • User
    • new User(parentPath, parentId, id)
    • user.get(options) ⇒ function
    • user.update() ⇒ function
    • user.delete(options) ⇒ function
    • user.remove(options) ⇒ function
    • user.getObject(state) ⇒ object
    • user.isLoading(state) ⇒ boolean
    • user.isError(state) ⇒ boolean
    • user.isDone(state) ⇒ boolean
  • Users
    • new Users(parentPath, id)
    • users.list(options) ⇒ function
    • users.create(object, options) ⇒ function
    • users.add(user) ⇒ function
    • users.update(id, data) ⇒ function
    • users.delete(id, options) ⇒ function
    • users.remove(id, options) ⇒ function
    • users.user(id) ⇒ User
    • users.getList(state, opts) ⇒ object
    • users.isLoading(state) ⇒ boolean
    • users.isError(state) ⇒ boolean
    • users.isDone(state) ⇒ boolean
  • verify(targetLocation) ⇒ function
  • login(username, password, projectId) ⇒ function
  • logout() ⇒ function
  • forgotPassword(username, projectId) ⇒ function
  • changePassword(oldPassword, newPassword) ⇒ function
  • resetPassword(username, password, confirm, token, projectId) ⇒ function
  • renew(auto) ⇒ function
  • isLoggedIn(state) ⇒ boolean
  • isLoading(state) ⇒ boolean
  • isVerifying(state) ⇒ boolean
  • isError(state) ⇒ boolean
  • getErrorMessage(state) ⇒ string
  • getUsername(state) ⇒ string
  • getUserId(state) ⇒ string
  • getProfile(state) ⇒ object
  • isLoading(state, path) ⇒ boolean
  • isError(state, path) ⇒ boolean
  • isDone(state, path) ⇒ boolean
  • isList(state, path) ⇒ boolean
  • isTable(state, path) ⇒ boolean
  • isObject(state, path) ⇒ boolean
  • getObject(state, path) ⇒ object
  • getHistory(state, path, queryName) ⇒ object
  • getList(state, path, opts) ⇒ array
  • getTable(state, path, opts) ⇒ array
  • setFilter(name, filter)
  • getFilter()
  • getTextFilter()
  • createPromise(method, path, body, options, type, extra) ⇒ function
  • list(path, parentId, type, options) ⇒ function
  • create(path, obj, parentId, type, options) ⇒ function
  • get(path, parentPath, options) ⇒ function
  • getHistory(path, parentPath, options, queryName) ⇒ function
  • remove(path, id, options) ⇒ function
  • update(path, data, parentPath, parentId, options) ⇒ function
  • createDeviceUser(path, obj, parentPath, options) ⇒ function
  • addDeviceUser(path, obj, parentId, options) ⇒ function
  • sendOutboundDeviceMessage(path, obj, parentId, options) ⇒ function
  • updateDeviceUser(path, obj, parentId, options) ⇒ promise
  • removeDeviceUser(path, obj, parentId, options) ⇒ function
  • copy()
  • getApiQueryable(query) ⇒ function
  • getApiQueryable(query) ⇒ function
  • defaultGetApiQueryable(query) ⇒ function
  • create(query) ⇒ function
  • getActionConstant(action, mode) ⇒ string
  • isSimpleTimeQuery(q) ⇒ boolean
  • isReversed(opts) ⇒ boolean
  • mergeItems(items, newItems, range) ⇒ array
  • getQueryChunks(opts, chunkSize) ⇒ object
  • getQueryOptions(opts) ⇒ object
  • receive(state, action)
  • update(state, action)
  • add(state, action)
  • remove(state, action)
  • reducer(initialState, actionTypeBase, additionalReducers)
  • list(opts) ⇒ function
  • create(item) ⇒ function
  • get(item, opts) ⇒ function
  • remove(item) ⇒ function
  • update(item, patchOps, opts) ⇒ function
  • forcePWReset(item, projectId) ⇒ function
  • encodeQ(options)
  • objectToQueryString(a)
  • buildParams(prefix, obj, add)
  • getPatchOpsArray(patchOps)
  • combinePath(path, subpath)
  • getId(id, throwIfNull)
  • getLastInPath(path)
Leverege Platform
Docs
Overview
Connect
FacebookLinkedInTwitter
Facebook Open Source