Guest User

Untitled

a guest
Jul 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. "const nirovision = require('@nirovision/alarms');const _ = require('lodash');module.exports = function (context, cb) { const helpers = nirovision.nirovision(context); if (helpers.isTopic('METADATA_START')) { const notification = { userIds: _.map(context.body.users, function(user) { return user.id; }), templateId: 'de8c4eed-9c99-4f3e-97ec-9b2c7e235145', customId: 'This is a test notification', data: [{ key: 'Camera', value: context.body.camera.name, }, { key: 'Location', value: context.body.location.name, }, { key: 'Timestamp', value: context.body.event.producerTimestamp, }], }; return helpers.sendNotification(context.body.companyId, notification) .then((res) => { cb(null, { message: res }) }) }};",
Add Comment
Please, Sign In to add comment