mm-services-devices
v0.0.7
Published
Device Manager for MicroMinion platform
Downloads
8
Readme
mm-services-devices
Device Manager for MicroMinion platform
Initialization
var MicroMinionPlatform = require('mm-platform')
var DeviceManager = require('mm-services-devices')
var MemStore = require('kad-memstore')
var platform = new MicroMinionPlatform()
var devices = new DeviceManager({
platform: platform,
storage: new MemStore(),
logger: platform._log
})
Function calls
devices.addKey(publicKey, dontSave)
Adds a third-party key that is trusted to database. dontSave is boolean to determine whether or not to save devices list to storage.
devices.createTenant(publicKey, secret)
Calls the tenant service on publicKey and provides secret in order to create a new tenant
devices.getDevices()
Returns an array with all trusted publicKeys
Messaging API
Data structures
The data structure maintained is an array of trusted public keys
Published messages
tenant.create
devices.update
Published locally. Contains list of trusted devices.