Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-wazo-platform

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-wazo-platform - npm Package Compare versions

Comparing version 1.0.35 to 1.0.36

2

nodes/config.js

@@ -58,3 +58,3 @@ global.window = global;

try {
const check = false;
let check = false;
if (this.token) {

@@ -61,0 +61,0 @@ check = await this.apiClient.auth.checkToken(this.token);

@@ -6,3 +6,3 @@ global.window = global;

function request(n) {
function WazoRequest(n) {
RED.nodes.createNode(this, n);

@@ -13,25 +13,32 @@ this.conn = RED.nodes.getNode(n.server);

var node = this;
this.on('input', async (msg) => {
const {
version,
method,
endpoint,
body = null,
header = 'application/json',
tenant = this.tenant
} = msg.payload;
node.on('input', async msg => {
const version = msg.payload.version;
const method = msg.payload.method;
const endpoint = msg.payload.endpoint;
const body = msg.payload.body;
const header = msg.payload.header || 'application/json';
const tenant = msg.payload.tenant || this.tenant;
const url = `https://${node.conn.host}:${node.conn.port}/api/${node.serviceName}/${version}/${endpoint}`;
const url = `https://${this.conn.host}:${this.conn.port}/api/${this.serviceName}/${version}/${endpoint}`;
node.log(`Make a ${method} request to the service ${node.serviceName} on ${url}`);
node.status({fill:"blue", shape:"dot", text: `Request to ${node.serviceName}!`});
const token = await node.conn.authenticate();
const result = await apiRequest(url, method, token, body, header, tenant);
msg.payload = result;
node.send(msg);
node.status({});
this.log(`Make a ${method} request to the service ${this.serviceName} on ${url}`);
this.status({ fill: "blue", shape: "dot", text: `Request to ${this.serviceName}!` });
try {
const token = await this.conn.authenticate();
const result = await apiRequest(url, method, token, body, header, tenant);
msg.payload = result;
this.send(msg);
this.status({});
} catch (error) {
this.error(`Error making API request: ${error.message}`, msg);
this.status({ fill: "red", shape: "ring", text: "Error" });
}
});
}
RED.nodes.registerType("wazo request", request);
RED.nodes.registerType("wazo request", WazoRequest);
};
{
"name": "node-red-contrib-wazo-platform",
"version": "1.0.35",
"version": "1.0.36",
"description": "Node Red module for the Wazo Platform API",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc