Skip to content

Commit 01c4d89

Browse files
authored
Merge pull request #426 from chughts/074
BUMP Release
2 parents 39b08d2 + f05776e commit 01c4d89

File tree

15 files changed

+108
-61
lines changed

15 files changed

+108
-61
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ Node-RED Watson Nodes for IBM Cloud
77

88
<a href="https://cla-assistant.io/watson-developer-cloud/node-red-node-watson"><img src="https://cla-assistant.io/readme/badge/watson-developer-cloud/node-red-node-watson" alt="CLA assistant" /></a>
99

10+
### New in version 0.7.4
11+
- Bump SDK Dependency to 3.11.0
12+
- Bump Assistant version to 2018-09-20
13+
- Bump Discovery version to 2018-08-01
14+
- Bump Natural Language Understanding to 2018-09-21
15+
- Bump Personality Insights to 2017-10-13
16+
- Discovery New Environment Size is now a string
17+
- Add Language Text to DropDrown for new supported languages in Translation Node.
18+
- Natural Language Classifier updated for use of IAM key for authentication.
19+
- Fix the Natural Language Understanding for bound IAM key service.
20+
- German is a supported STT Language.
21+
- Visual Recognition Key fix when migrating from unbound to bound service.
22+
1023
### New in version 0.7.3
1124
- Modify Discovery Query Builder Node to use `listCollectionFields` to determine query list.
1225

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-node-watson",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"description": "A collection of Node-RED nodes for IBM Watson services",
55
"dependencies": {
66
"async": "^1.5.2",
@@ -10,7 +10,7 @@
1010
"temp": "^0.8.3",
1111
"qs": "6.x",
1212
"image-type": "^2.0.2",
13-
"watson-developer-cloud": "^3.5.0",
13+
"watson-developer-cloud": "^3.11.0",
1414
"kuromoji": "^0.1.1",
1515
"word-count": "^0.2.2",
1616
"is-docx": "^0.0.3",

services/conversation/v1-workspace-manager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = function (RED) {
2828
username = '', password = '', sUsername = '', sPassword = '',
2929
apikey = '', sApikey = '',
3030
endpoint = '', sEndpoint = '',
31-
version = '2018-02-16';
31+
version = '2018-09-20';
3232

3333
if (!service) {
3434
service = serviceutils.getServiceCreds(OLD_SERVICE_IDENTIFIER);
@@ -506,7 +506,7 @@ module.exports = function (RED) {
506506

507507
function executeMethod(node, method, params, msg) {
508508
let conv = null,
509-
version = '2018-02-16',
509+
version = '2018-09-20',
510510
serviceSettings = {
511511
version_date: version,
512512
version: version,

services/conversation/v1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ module.exports = function(RED) {
164164
apiKey = sApikey || node.credentials.apikey,
165165
endpoint = '',
166166
optoutLearning = false,
167-
version = '2018-02-16';
167+
version = '2018-09-20';
168168

169169
if (!verifyCredentials(msg, apiKey, userName, passWord)) {
170170
node.error('Missing Watson Assistant API service credentials');

services/discovery/discovery-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DiscoveryUtils.prototype = {
2121

2222
buildService: function(username, password, apikey, endpoint) {
2323
let serviceSettings = {
24-
version_date: '2018-03-05',
24+
version_date: '2018-08-01',
2525
headers: {
2626
'User-Agent': pkg.name + '-' + pkg.version
2727
}

services/discovery/v1.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,18 @@
148148
</div>
149149
<div class="form-row">
150150
<label for="node-input-size">Envrionment Size</label>
151-
<input type="number" min="0" max="4"
152-
id="node-input-size" />
151+
<select type="text" id="node-input-size" style="display: inline-block; width: 70%;">
152+
<option value="LT">LT</option>
153+
<option value="XS">XS</option>
154+
<option value="S">S</option>
155+
<option value="MS">MS</option>
156+
<option value="M">M</option>
157+
<option value="ML">ML</option>
158+
<option value="L">L</option>
159+
<option value="XL">XL</option>
160+
<option value="XXL">XXL</option>
161+
<option value="XXXL">XXXL</option>
162+
</select>
153163
</div>
154164

155165
</script>
@@ -464,7 +474,7 @@
464474
aggregation: {value: ''},
465475
return: {value: ''},
466476
description: {value: ''},
467-
size: {value: 0},
477+
size: {value: 'LT'},
468478
'discovery-method': {value:'query'},
469479
'default-endpoint' :{value: true},
470480
'service-endpoint' :{value: 'https://gateway.watsonplatform.net/discovery/api'}

services/language_translator/v3.html

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -228,21 +228,28 @@
228228

229229
tor.LANGUAGES = { 'ar' : 'Arabic',
230230
'arz': 'Spoken Arabic',
231-
'en': 'English' ,
232-
'es': 'Spanish',
233-
'fr': 'French',
234-
'it': 'Italian',
235-
'de': 'German',
236-
'ja': 'Japanese',
237-
'pt': 'Portuguese',
238-
'ko': 'Korean',
239-
'nl': 'Dutch',
240-
'pl': 'Polish',
241-
'ru': 'Russian',
242-
'tr': 'Turkish',
243-
'zh': 'Chinese',
231+
'ca' : 'Catalan',
232+
'cs' : 'Czech',
233+
'da' : 'Danish',
234+
'en' : 'English' ,
235+
'es' : 'Spanish',
236+
'fr' : 'French',
237+
'fi' : 'Finnish',
238+
'hi' : 'Hindi',
239+
'it' : 'Italian',
240+
'de' : 'German',
241+
'ja' : 'Japanese',
242+
'pt' : 'Portuguese',
243+
'ko' : 'Korean',
244+
'nb' : 'Norwegian Bokmål',
245+
'nl' : 'Dutch',
246+
'pl' : 'Polish',
247+
'ru' : 'Russian',
248+
'sv' : 'Swedish',
249+
'tr' : 'Turkish',
250+
'zh' : 'Chinese',
244251
'zh-TW' : 'Taiwanese',
245-
'zht': 'Traditional Chinese'
252+
'zht' : 'Traditional Chinese'
246253
};
247254

248255
// convert an id in the form it-ko into Italian - Korean for display

services/natural_language_classifier/v1.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
<input type="password" id="node-input-password" placeholder="Password">
3434
</div>
3535

36+
<div class="form-row credentials" style="display: none;">
37+
<label for="node-input-apikey"><i class="fa fa-key"></i> API Key</label>
38+
<input type="password" id="node-input-apikey" placeholder="API Key"></input>
39+
</div>
40+
3641
<div class="form-row credentials">
3742
<label>&nbsp;</label>
3843
<input type="checkbox" id="node-input-default-endpoint" style="display: inline-block; width: auto; vertical-align: top;">
@@ -181,7 +186,8 @@
181186
},
182187
credentials: {
183188
username: {type:"text"},
184-
password: {type:"password"}
189+
password: {type:"password"},
190+
apikey: {type: 'password'}
185191
},
186192
color: "rgb(140, 198, 63)",
187193
inputs: 1,

services/natural_language_classifier/v1.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ module.exports = function(RED) {
2727
service = serviceutils.getServiceCreds(SERVICE_IDENTIFIER),
2828
username = null,
2929
password = null,
30+
apikey = null,
3031
sUsername = null,
3132
sPassword = null,
33+
sApikey = null,
3234
endpoint = '',
3335
sEndpoint = 'https://gateway.watsonplatform.net/natural-language-classifier/api';
3436

3537
if (service) {
36-
sUsername = service.username;
37-
sPassword = service.password;
38+
sUsername = service.username ? service.username : '';
39+
sPassword = service.password ? service.password : '';
40+
sApikey = service.apikey ? service.apikey : '';
3841
sEndpoint = service.url;
3942
}
4043

@@ -57,13 +60,14 @@ module.exports = function(RED) {
5760
node.verifyCredentials = function(msg) {
5861
username = sUsername || node.credentials.username;
5962
password = sPassword || node.credentials.password;
63+
apikey = sApikey || node.credentials.apikey;
6064

6165
endpoint = sEndpoint;
6266
if ((!config['default-endpoint']) && config['service-endpoint']) {
6367
endpoint = config['service-endpoint'];
6468
}
6569

66-
if (!username || !password) {
70+
if (!apikey && (!username || !password)) {
6771
return Promise.reject('Missing Natural Language Classifier credentials');
6872
} else {
6973
return Promise.resolve();
@@ -188,14 +192,19 @@ module.exports = function(RED) {
188192
var p = new Promise(function resolver(resolve, reject) {
189193
var natural_language_classifier = null,
190194
serviceSettings = {
191-
username: username,
192-
password: password,
193195
version: 'v1',
194196
headers: {
195197
'User-Agent': pkg.name + '-' + pkg.version
196198
}
197199
};
198200

201+
if (apikey) {
202+
serviceSettings.iam_apikey = apikey;
203+
} else {
204+
serviceSettings.username = username;
205+
serviceSettings.password = password;
206+
}
207+
199208
if (endpoint) {
200209
serviceSettings.url = endpoint;
201210
}
@@ -211,7 +220,7 @@ module.exports = function(RED) {
211220
if (err) {
212221
reject(err);
213222
} else {
214-
console.log(response);
223+
//console.log(response);
215224
switch (mode) {
216225
case 'classify':
217226
msg.payload = {
@@ -278,12 +287,9 @@ module.exports = function(RED) {
278287
}
279288
RED.nodes.registerType('watson-natural-language-classifier', Node, {
280289
credentials: {
281-
username: {
282-
type: 'text'
283-
},
284-
password: {
285-
type: 'password'
286-
}
290+
username: {type: 'text'},
291+
password: {type: 'password'},
292+
apikey: {type:'password'}
287293
}
288294
});
289295
};

services/natural_language_understanding/v1.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
<input type="password" id="node-input-password" placeholder="Password">
3131
</div>
3232

33-
<p style="width:100%; text-align:center;"><em>or</em></p>
33+
<div class="form-row credentials" style="display: none;">
34+
<p style="width:100%; text-align:center;"><em>or</em></p>
35+
</div>
3436

3537
<div class="form-row credentials" style="display: none;">
3638
<label for="node-input-apikey"><i class="fa fa-key"></i> API Key</label>

0 commit comments

Comments
 (0)