Skip to content

Commit e354a46

Browse files
committed
Added deprecated warning to v1 Visual Recognition Node
1 parent c65c552 commit e354a46

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

services/visual_recognition/v1.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
</script>
3636

3737
<script type="text/x-red" data-help-name="watson-visual-recognition">
38+
<p><b>NB:</b> This node uses the old beta API and it is only being retained for backward compatibility for anyone that has an olde AlchemyAPI key. It will no longer work with new AlchemyAPI keys.</p>
39+
<br/>
3840
<p>The Visual Recognition service analyses images to understand their contents.</p>
3941
<p>The image to be analysed should be passed in on <code>msg.payload</code>.</p>
4042
<p>Supported <code>msg.payload</code> types:</b>.</p>

services/visual_recognition/v3.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module.exports = function (RED) {
7070
};
7171

7272
function urlCheck(str) {
73-
var parsed = url.parse(str)
73+
var parsed = url.parse(str);
7474
return (!!parsed.hostname && !!parsed.protocol && str.indexOf(' ') < 0);
7575
};
7676

@@ -171,7 +171,8 @@ module.exports = function (RED) {
171171

172172
if (err != null && body==null)
173173
{
174-
node.status({fill:'red', shape:'ring', text:'call to watson visual recognition v3 service failed'});
174+
node.status({fill:'red', shape:'ring',
175+
text:'call to watson visual recognition v3 service failed'});
175176
msg.result = {};
176177
msg.result['error_code']= err.code;
177178
if (!err.error)
@@ -183,7 +184,7 @@ module.exports = function (RED) {
183184
else if (body.images[0].error)
184185
{
185186
var err_desc = body.images[0].error.description;
186-
var err_id = body.images[0].error.error_id
187+
var err_id = body.images[0].error.error_id;
187188
node.status({fill:'red', shape:'ring', text:'call to watson visual recognition v3 service failed'});
188189
msg.result = {};
189190
msg.result['error_id']= err_id;
@@ -283,7 +284,8 @@ module.exports = function (RED) {
283284
var buffer = msg.params[prop];
284285
temp.open({suffix: '.' + fileType(buffer).ext}, function (err, info) {
285286
if (err) {
286-
this.status({fill:'red', shape:'ring', text:'unable to open image stream'});
287+
this.status({fill:'red', shape:'ring',
288+
text:'unable to open image stream'});
287289
var message ='Node has been unable to open the image stream';
288290
node.error(message, msg);
289291
callback('open error on '+prop);
@@ -317,14 +319,14 @@ module.exports = function (RED) {
317319
performAction(params, feature, actionComplete2);
318320
});
319321
}
320-
else if (feature==='retrieveClassifiersList') {
322+
else if (feature === 'retrieveClassifiersList') {
321323
performAction(params, feature, actionComplete2);
322324
}
323-
else if (feature ==='retrieveClassifierDetails') {
325+
else if (feature === 'retrieveClassifierDetails') {
324326
params['classifier_id']=msg.params['classifier_id'];
325327
performAction(params, feature, actionComplete2);
326328
}
327-
else if (feature=='deleteClassifier') {
329+
else if (feature === 'deleteClassifier') {
328330
params['classifier_id']=msg.params['classifier_id'];
329331
performAction(params, feature, actionCompleteDeleteClassifier);
330332

0 commit comments

Comments
 (0)