New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-cognitive-services

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-cognitive-services - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

cognitive-services/icons/computervision.png

54

cognitive-services/weblm.js
var request = require('request');
module.exports = function(RED) {
function weblm(config) {
module.exports = function(RED)
{
function weblm(config)
{
RED.nodes.createNode(this,config);
var node = this;
this.on('input', function(msg) {
this.on('input', function(msg)
{
console.log("config.operation=" + config.operation);

@@ -30,9 +33,21 @@ if (this.credentials == null || this.credentials.key == null || this.credentials.key == "")

{
try {
console.log("body=" + body);
if (body.results != null && body.results.length > 0)
try
{
if (!error)
{
msg.payload = body.results[0].probability;
node.send(msg);
console.log("response.statusCode=" + response.statusCode + ", body=" + body);
if (response.statusCode == 200 && body.results != null && body.results.length > 0)
{
msg.payload = body.results[0].probability;
node.send(msg);
}
else
{
node.error(body);
}
}
else
{
node.error(error);
}
}

@@ -58,6 +73,21 @@ catch (e)

{
try {
console.log("body=" + body);
msg.payload = body;
node.send(msg);
try
{
if (!error)
{
console.log("response.statusCode=" + response.statusCode + ", body=" + body);
if (response.statusCode == 200)
{
msg.payload = body;
node.send(msg);
}
else
{
node.error(body);
}
}
else
{
node.error(error);
}
}

@@ -64,0 +94,0 @@ catch (e)

{
"name" : "node-red-contrib-cognitive-services",
"version" : "0.0.1",
"version" : "0.0.2",
"description" : "Microsoft Cognitive Services",

@@ -13,2 +13,2 @@ "dependencies": {

}
}
}

Sorry, the diff of this file is not supported yet

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