node-red-bluemix-nodes
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "node-red-bluemix-nodes", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A collection of extra Node-RED nodes for IBM Bluemix.", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -43,6 +43,6 @@ /** | ||
this.on('input', function(msg) { | ||
username = username || this.credentials.username; | ||
password = password || this.credentials.password; | ||
var service_username = username || this.credentials.username; | ||
var service_password = password || this.credentials.password; | ||
if (!username || !password) { | ||
if (!service_username || !service_password) { | ||
var message = 'Missing Weather Insights service credentials'; | ||
@@ -71,5 +71,14 @@ node.error(message, msg); | ||
node.status({fill:"blue", shape:"dot", text:"requesting"}); | ||
request({url: host + base_uri + geocode + config.service, auth: {username: username, password: password}, qs: {units: config.units, language: config.language}}, function(error, response, body) { | ||
request({url: host + base_uri + geocode + config.service, auth: {username: service_username, password: service_password}, qs: {units: config.units, language: config.language}}, function(error, response, body) { | ||
node.status({}); | ||
if (!error && response.statusCode == 200) { | ||
if (error) { | ||
node.error('Weather Insights service call failed with error HTTP response.', msg); | ||
} else if (response.statusCode === 401) { | ||
node.error('Weather Insights service call failure due to authentication failure.', msg); | ||
} else if (response.statusCode === 404) { | ||
node.error('Weather Insights service call failed due to HTTP 404 response to API call.', msg); | ||
} else if (response.statusCode !== 200) { | ||
node.error('Weather Insights service call failed due to non-200 HTTP response to API call.', msg); | ||
} else { | ||
var results = JSON.parse(body); | ||
@@ -80,5 +89,2 @@ msg.forecasts = results.forecasts; | ||
node.send(msg); | ||
} else { | ||
var message3 = 'Weather Insights service call failed with error HTTP response.'; | ||
node.error(message3, msg); | ||
} | ||
@@ -85,0 +91,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
116656
1182
3