UNPKG

node-red-contrib-ozmap

Version:

OZMap wrapper to ozmap-api. Helper to use OZMap API's

21 lines (18 loc) 593 B
const OZmapSDK = require('@ozmap/ozmap-sdk'); module.exports = function (RED) { function OZMapConnection(n, config, done) { RED.nodes.createNode(this, n); this.url = n.url; this.username = n.username; this.ozmap = new OZmapSDK(this.url, this.credentials.key); this.ozmap.authentication(this.username, this.credentials.password).then((a) => { console.warn('Ozmap foi iniciado...'); }); } RED.nodes.registerType('ozmap-connection', OZMapConnection, { credentials: { password: { type: 'password' }, key: { type: 'password' }, }, }); };