Skip to content

Commit 8eb6225

Browse files
committed
Code tidy
1 parent 9eed4c8 commit 8eb6225

File tree

7 files changed

+117
-101
lines changed

7 files changed

+117
-101
lines changed

ChangeHistory.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,88 @@
1+
## 0.6.x
2+
3+
### New in version 0.6.14
4+
- Visual Recognition instances created post May 22 2018, have a new authentication mechanism
5+
6+
### New in version 0.6.13
7+
- Added opt-out option for collection parsing of strings in Natural Language Classifier Node.
8+
9+
### New in version 0.6.12
10+
- Fix to collection check in Natural Language Classification Node allowing for . in domain
11+
names.
12+
13+
### New in version 0.6.11
14+
- Fix to defaulting name for NLU Node.
15+
- Allow pre-check of audio format to be disabled in Speech to Text node.
16+
- Migrate from deprecated getModels and getCustomizations methods in Speech to Text nodes.
17+
- Implement update classifier in Visual Recognition Util node.
18+
- In Visual Recognition Util node append 'positive_' to zip name if neither 'positive' not 'negative' not already there.
19+
- Removed duplicated code in Visual Recognition Util node.
20+
21+
### New in version 0.6.10
22+
- Needed to stringify json before addDocument in Discovery node.
23+
- Using Node.js v 6 features, so will not run on Node.js v 4 anymore
24+
25+
### New in version 0.6.9
26+
- Implemented classify collection on Natural Language Classifier node. The collection can be
27+
in the form of multiple sentences, an array of strings, or an array of objects.
28+
29+
### New in version 0.6.8
30+
- Move all Discovery calls to latest API version - 2017-11-07
31+
- Updated calls to deprecated discovery methods addJsonDocument and getCollections
32+
- Correct implemetation of passages related options
33+
- Allow highlight option to be specified in Discovery overrides - msg.discoveryparams
34+
- Rename Conversation Nodes to Assistant
35+
- Use Assistant endpoint
36+
- Move all Assistant calls to latest API version - 2018-02-16
37+
- Move all Visual Recognition calls to lates API version - 2018-03-19
38+
- Add French as a Visual Recognition classification response language
39+
40+
### New in version 0.6.7
41+
- Enable Opt-out option for Conversation Node.
42+
- Implement time out option for response from Conversation Node.
43+
- Bump to v 3.2.1 of watson-developer-cloud dependency.
44+
- Fix to how API version is specified in Natural Language Understanding Node.
45+
- Add Korean to list of languages in Natural Language Classifier Node.
46+
47+
### New in version 0.6.6
48+
- Added Mute option for STT Node warning status when running in Streaming mode
49+
- Discard option for STT Node Streaming listening events.
50+
- Added Auto-Connect mode for STT Node - Will keep connection to service alive,
51+
else connection is restored on demand.
52+
- Fix to Discovery Query Builder Node to return schema options.
53+
54+
### New in version 0.6.5
55+
- Endpoint can now be specified in Natural Language Classifier Node
56+
57+
### New in version 0.6.4
58+
- Speech to Text node now reports all errors, including disconnects when running in stream mode.
59+
60+
### New in version 0.6.3
61+
- Allow input / output from Node-RED web-sockets for Speech to Text node. To
62+
enable select streaming mode. No token is needed as the Node handles this. Look
63+
out for sample flows and templates showing how to use this feature.
64+
- Three new languages for Language Translator, Polish, Russian and Turkish in Neural Translation mode.
65+
- Removed the code for the deprecated Language Translation Nodes.
66+
67+
### New in version 0.6.2
68+
- Visual Recognition fix for accept-language
69+
70+
### New in version 0.6.1
71+
- Allow STT Language to be dyamically configurable using msg.srclang
72+
73+
### New in version 0.6.0
74+
- Bump to watson-developer-cloud 3.0.4
75+
- Document link updates
76+
- IE fix
77+
- Option to set Conversation credentials though msg.params
78+
- Speech To Text fullresult now includes speaker_labels. Breaking change to any code that used fullresult due an extra level of indirection.
79+
- Allow Korean as an option for Personality Insights
80+
- Text Recognition option removed from Visual Recognition Node
81+
- Move Retrieve and Rank nodes to deprecated list
82+
- Removed Document Conversion, Alchemy, Concept Insights, Dialog, Tradeoff Analytics and Similarity Search Nodes
83+
- Nodes deprecated in 0.5.x will be removed in 0.6.x releases
84+
85+
186
## 0.5.x
287

388
### New in version 0.5.23

README.md

Lines changed: 2 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -7,96 +7,15 @@ 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.6.15
10+
### New in version 0.7.0
1111
- Assistant, Discovery, Speech to Text, Text to Speech, Tone Analyzer nodes updated
1212
to allow for use of iam key for authentication.
1313
- Migrated STT node off deprecated methods.
1414
- Fix to Tone Analyzer Node to preserve credentials on config reopen.
1515
- Fix to Tone Analyzer to allow json objects and arrays as payload.
1616
- Fix to STT where auto-connect was not being preserved when reopening configuration.
1717
- Bump to 2018-03-05 version date for Discovery service.
18-
19-
### New in version 0.6.14
20-
- Visual Recognition instances created post May 22 2018, have a new authentication mechanism
21-
22-
### New in version 0.6.13
23-
- Added opt-out option for collection parsing of strings in Natural Language Classifier Node.
24-
25-
### New in version 0.6.12
26-
- Fix to collection check in Natural Language Classification Node allowing for . in domain
27-
names.
28-
29-
### New in version 0.6.11
30-
- Fix to defaulting name for NLU Node.
31-
- Allow pre-check of audio format to be disabled in Speech to Text node.
32-
- Migrate from deprecated getModels and getCustomizations methods in Speech to Text nodes.
33-
- Implement update classifier in Visual Recognition Util node.
34-
- In Visual Recognition Util node append 'positive_' to zip name if neither 'positive' not 'negative' not already there.
35-
- Removed duplicated code in Visual Recognition Util node.
36-
37-
### New in version 0.6.10
38-
- Needed to stringify json before addDocument in Discovery node.
39-
- Using Node.js v 6 features, so will not run on Node.js v 4 anymore
40-
41-
### New in version 0.6.9
42-
- Implemented classify collection on Natural Language Classifier node. The collection can be
43-
in the form of multiple sentences, an array of strings, or an array of objects.
44-
45-
### New in version 0.6.8
46-
- Move all Discovery calls to latest API version - 2017-11-07
47-
- Updated calls to deprecated discovery methods addJsonDocument and getCollections
48-
- Correct implemetation of passages related options
49-
- Allow highlight option to be specified in Discovery overrides - msg.discoveryparams
50-
- Rename Conversation Nodes to Assistant
51-
- Use Assistant endpoint
52-
- Move all Assistant calls to latest API version - 2018-02-16
53-
- Move all Visual Recognition calls to lates API version - 2018-03-19
54-
- Add French as a Visual Recognition classification response language
55-
56-
### New in version 0.6.7
57-
- Enable Opt-out option for Conversation Node.
58-
- Implement time out option for response from Conversation Node.
59-
- Bump to v 3.2.1 of watson-developer-cloud dependency.
60-
- Fix to how API version is specified in Natural Language Understanding Node.
61-
- Add Korean to list of languages in Natural Language Classifier Node.
62-
63-
### New in version 0.6.6
64-
- Added Mute option for STT Node warning status when running in Streaming mode
65-
- Discard option for STT Node Streaming listening events.
66-
- Added Auto-Connect mode for STT Node - Will keep connection to service alive,
67-
else connection is restored on demand.
68-
- Fix to Discovery Query Builder Node to return schema options.
69-
70-
### New in version 0.6.5
71-
- Endpoint can now be specified in Natural Language Classifier Node
72-
73-
### New in version 0.6.4
74-
- Speech to Text node now reports all errors, including disconnects when running in stream mode.
75-
76-
### New in version 0.6.3
77-
- Allow input / output from Node-RED web-sockets for Speech to Text node. To
78-
enable select streaming mode. No token is needed as the Node handles this. Look
79-
out for sample flows and templates showing how to use this feature.
80-
- Three new languages for Language Translator, Polish, Russian and Turkish in Neural Translation mode.
81-
- Removed the code for the deprecated Language Translation Nodes.
82-
83-
### New in version 0.6.2
84-
- Visual Recognition fix for accept-language
85-
86-
### New in version 0.6.1
87-
- Allow STT Language to be dyamically configurable using msg.srclang
88-
89-
### New in version 0.6.0
90-
- Bump to watson-developer-cloud 3.0.4
91-
- Document link updates
92-
- IE fix
93-
- Option to set Conversation credentials though msg.params
94-
- Speech To Text fullresult now includes speaker_labels. Breaking change to any code that used fullresult due an extra level of indirection.
95-
- Allow Korean as an option for Personality Insights
96-
- Text Recognition option removed from Visual Recognition Node
97-
- Move Retrieve and Rank nodes to deprecated list
98-
- Removed Document Conversion, Alchemy, Concept Insights, Dialog, Tradeoff Analytics and Similarity Search Nodes
99-
- Nodes deprecated in 0.5.x will be removed in 0.6.x releases
18+
- Migraged Discovery Query Builder off deprecated getEnvrionments method
10019

10120

10221
### Watson Nodes for Node-RED

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-node-watson",
3-
"version": "0.6.15",
3+
"version": "0.7.0",
44
"description": "A collection of Node-RED nodes for IBM Watson services",
55
"dependencies": {
66
"async": "^1.5.2",

services/discovery/discovery-utils.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,18 @@ DiscoveryUtils.prototype = {
2121

2222
buildService: function(username, password, apikey, endpoint) {
2323
let serviceSettings = {
24-
version_date: '2018-03-05',
25-
headers: {
26-
'User-Agent': pkg.name + '-' + pkg.version
27-
}
28-
};
29-
30-
if (apikey) {
31-
serviceSettings.iam_apikey = apikey;
32-
} else {
33-
serviceSettings.username = username;
34-
serviceSettings.password = password;
24+
version_date: '2018-03-05',
25+
headers: {
26+
'User-Agent': pkg.name + '-' + pkg.version
3527
}
28+
};
3629

37-
if (endpoint) {
38-
serviceSettings.url = endpoint;
39-
}
30+
if (apikey) {
31+
serviceSettings.iam_apikey = apikey;
32+
} else {
33+
serviceSettings.username = username;
34+
serviceSettings.password = password;
35+
}
4036

4137
if (endpoint) {
4238
serviceSettings.url = endpoint;

services/speech_to_text/stt-utils.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
const pkg = require('../../package.json'),
1+
/**
2+
* Copyright 2018 IBM Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
**/
16+
17+
const pkg = require('../../package.json'),
218
STTV1 = require('watson-developer-cloud/speech-to-text/v1');
319

420
class STTUtils {

services/speech_to_text/v1-corpus-builder.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
module.exports = function (RED) {
1818
const SERVICE_IDENTIFIER = 'speech-to-text';
19-
var cfenv = require('cfenv'),
20-
url = require('url'),
19+
var url = require('url'),
2120
temp = require('temp'),
2221
fs = require('fs'),
2322
fileType = require('file-type'),

services/speech_to_text/v1.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@
614614
'payload-response' :{value: false},
615615
'streaming-mode' :{value: false},
616616
'streaming-mute' :{value: true},
617+
'auto-connect' :{value: false},
617618
'discard-listening' :{value: false},
618619
'disable-precheck' :{value: false},
619620
'default-endpoint' :{value: true},

0 commit comments

Comments
 (0)