daos/area

daos/area
Static Members
index(cb)
find(param, op, cb)
store(data, cb)
update(id, data, cb)
delete(id, cb)

daos/user

daos/user
Static Members
authenticate(param, cb)
find(param, op, cb)
update(id, data, cb)

daos/switch

daos/switch
Static Members
index(cb)
list(cb)
find(param, op, cb)
store(data, cb)
update(id, data, cb)
findAndUpdate(param, data, cb)
delete(id, cb)

services/area

services/area
Static Members
index(cb)
find(id, cb)
store(data, cb)
update(id, data, cb)
delete(id, cb)

utils/database

utils/database
Static Members
new Database()

daos/node

daos/node
Static Members
index(cb)
find(param, op, cb)
store(data, cb)
update(id, data, cb)
findAndUpdate(param, data, cb)
delete(id, cb)

daos/floor

daos/floor
Static Members
index(cb)
find(param, op, cb)
store(data, cb)
update(id, data, cb)
delete(id, cb)

controllers/floor

controllers/floor
Static Members
index(req, res)
store(req, res)
edit(req, res)
put(req, res)
delete(req, res)

services/floor

services/floor
Static Members
index(cb)
find(id, cb)
store(data, cb)
update(id, data, cb)
delete(id, cb)

controllers/area

controllers/area
Static Members
index(req, res)
create(req, res)
store(req, res)
edit(req, res)
put(req, res)
delete(req, res)

services/logger

services/logger

controllers/user

controllers/user
Static Members
authenticate(req, res)
changePassword(req, res)
updatePassword(req, res)
logout(req, res)

services/node

services/node
Static Members
index(cb)
find(id, cb)
store(data, cb)
update(id, data, cb)
delete(id, cb)

services/socket

services/socket
Static Members
switches(cb)
updateSwitchState(param, data, cb)
updateNodeAliveState(param, data, cb)
setNodeToDead(cb)

controllers/node

controllers/node
Static Members
index(req, res)
create(req, res)
store(req, res)
edit(req, res)
put(req, res)
delete(req, res)

controllers/switch

controllers/switch
Static Members
index(req, res)
create(req, res)
store(req, res)
edit(req, res)
put(req, res)
delete(req, res)

services/user

services/user
Static Members
authenticate(param, cb)
find(id, cb)
updatePassword(id, data, cb)

services/switch

services/switch
Static Members
index(cb)
find(id, cb)
store(data, cb)
update(id, data, cb)
delete(id, cb)

controllers/socket

controllers/socket

app

Junkiri: Wireless electrical switch

app
Author: Deepak Adhikari <deeps.adhi@gmail.com>

nodeExists

Check node exists already or not

nodeExists(data: Object, cb: Function)
Parameters
data (Object) Data
cb (Function) Callback

areaExists

Check area exists already or not

areaExists(data: Object, cb: Function)
Parameters
data (Object) Data
cb (Function) Callback

url

Get URL

url(req: Object): string
Parameters
req (Object) Express request object
Returns
string: URL

slugify

Slugify string

slugify(string: string): string
Parameters
string (string) Plain text
Returns
string: Slug text

utils/common

utils/common
Parameters
req (any)

floorExists

Check floor exists already or not

floorExists(data: Object, cb: Function)
Parameters
data (Object) Data
cb (Function) Callback

controllers/auth

controllers/auth
Parameters
req (any)
res (any)
next (any)

exports

Check user session

exports(req: Object, res: Object, next: Function): Function
Parameters
req (Object) Express request object
res (Object) Express response object
next (Function) Express next middleware function
Returns
Function: Express redirect

get

Junkiri app

get
Parameters
req (Object) Express request object
res (Object) Express response object
Returns
Function: Express view

get

Login page

get
Parameters
req (Object) Express request object
res (Object) Express response object
Returns
Function: Express view

exports

WebSocket connection

exports(wsServer: Object)
Parameters
wsServer (Object) WebSocket server

init

Open database

init()

broadcast

Broadcast message to all clients connected to WebSocket server

broadcast(message: string)
Parameters
message (string) Message to be sent

create

Add floor form

create(req: Object, res: Object): Function
Parameters
req (Object) Express request object
res (Object) Express response object
Returns
Function: Express view

findNode

Find node

findNode(param: Object, cb: Function)
Parameters
param (Object) Search parameter
cb (Function) Callback

publish

Publish message to NodeMCU

publish(node: string, pin: string, state_: boolean)
Parameters
node (string) Node name
pin (string) Pin number
state_ (boolean) Pin state

close

Close database

close()