File tree Expand file tree Collapse file tree
services/visual_recognition Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ Node-RED Watson Nodes for IBM Cloud
1818- Natural Language Classifier updated for use of IAM key for authentication.
1919- Fix the Natural Language Understanding for bound IAM key service.
2020- German is a supported STT Language.
21+ - Visual Recognition Key fix when migrating from unbound to bound service.
2122
2223### New in version 0.7.3
2324- Modify Discovery Query Builder Node to use ` listCollectionFields ` to determine query list.
Original file line number Diff line number Diff line change 163163 category : 'IBM Watson' ,
164164 defaults : {
165165 name : { value : "" } ,
166- apikey : { value : "" } ,
167166 'vr-service-endpoint' :{ value : 'https://gateway-a.watsonplatform.net/visual-recognition/api' } ,
168167 "image-feature" : { value : "" } ,
169168 "lang" : { value : "" } ,
232231 category : 'IBM Watson' ,
233232 defaults : {
234233 name : { value : "" } ,
235- apikey : { value : "" } ,
236234 'vr-service-endpoint' :{ value : 'https://gateway-a.watsonplatform.net/visual-recognition/api' } ,
237235 "image-feature" : { value : "" }
238236 } ,
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ module.exports = function(RED) {
4040 async = require ( 'async' ) ,
4141 toArray = require ( 'stream-to-array' ) ,
4242 sAPIKey = null ,
43+ apikey = '' ,
4344 iamAPIKey = false ,
4445 service = null ,
4546 endpoint = '' ,
@@ -152,8 +153,8 @@ module.exports = function(RED) {
152153 function verifyServiceCredentials ( node , msg ) {
153154 // If it is present the newly provided user entered key
154155 // takes precedence over the existing one.
155- node . apikey = sAPIKey || node . credentials . apikey ;
156- if ( ! node . apikey ) {
156+ apikey = sAPIKey || node . credentials . apikey ;
157+ if ( ! apikey ) {
157158 return Promise . reject ( 'Missing Watson Visual Recognition API service credentials' ) ;
158159 }
159160
@@ -170,9 +171,9 @@ module.exports = function(RED) {
170171
171172 // VR instances created post 22 May 2018, are expecting an iam API Key
172173 if ( iamAPIKey ) {
173- serviceSettings . iam_apikey = node . apikey ;
174+ serviceSettings . iam_apikey = apikey ;
174175 } else {
175- serviceSettings . api_key = node . apikey ;
176+ serviceSettings . api_key = apikey ;
176177 }
177178
178179 // The change to watson-developer-cloud 3.0.x has resulted in a
You can’t perform that action at this time.
0 commit comments