Skip to content

Commit cc9062b

Browse files
authored
Merge pull request #136 from chughts/master
Sort Sequence
2 parents 1ce2dae + 9ba1749 commit cc9062b

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@
2525
],
2626
"node-red": {
2727
"nodes": {
28-
"alchemy_language-v1": "services/alchemy_language/v1.js",
29-
"alchemy-vision-v1": "services/alchemy_vision/v1.js",
30-
"alchemy-news-v1": "services/alchemy_data_news/v1.js",
31-
"watson-natural-language-classifier-v1": "services/natural_language_classifier/v1.js",
3228
"watson-concept-insights-v2": "services/concept_insights/v2.js",
33-
"watson-dialog-v1": "services/dialog/v1.js",
29+
"watson-conversation-v1-experimental":"services/conversation/v1-exp.js",
3430
"watson-document-conversion-v1": "services/document_conversion/v1.js",
31+
"watson-dialog-v1": "services/dialog/v1.js",
32+
"alchemy_language-v1": "services/alchemy_language/v1.js",
3533
"watson-language-identification-v1": "/services/language_identification/v1.js",
3634
"watson-language-translate-v1": "services/language_translation/v2.js",
35+
"watson-natural-language-classifier-v1": "services/natural_language_classifier/v1.js",
36+
"alchemy-news-v1": "services/alchemy_data_news/v1.js",
3737
"watson-personality-insights-v1": "services/personality_insights/v1.js",
3838
"watson-relationship-extraction-v1": "services/relationship_extraction/v1.js",
3939
"watson-retrieve-and-rank-v1": "services/retrieve_and_rank/v1.js",
4040
"watson-speech-to-text-v1": "services/speech_to_text/v1.js",
4141
"watson-text-to-speech-v1": "services/text_to_speech/v1.js",
42+
"watson-tone-analyzer-v3": "services/tone_analyzer/v3.js",
4243
"watson-tradeoff-analytics-v1": "services/tradeoff_analytics/v1.js",
4344
"watson-tone-analyzer-v3-beta": "services/tone_analyzer/v3-beta.js",
4445
"watson-visual-recognition-v1": "services/visual_recognition/v1.js",
4546
"watson-visual-recognition-v3": "services/visual_recognition/v3.js",
46-
"watson-tone-analyzer-v3": "services/tone_analyzer/v3.js",
47-
"watson-conversation-v1-experimental":"services/conversation/v1-exp.js"
47+
"alchemy-vision-v1": "services/alchemy_vision/v1.js"
4848
}
4949
}
5050
}

services/conversation/v1-exp.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
-->
1616

17-
<script type="text/x-red" data-template-name="conversation-v1-experimental">
17+
<script type="text/x-red" data-template-name="watson-conversation-v1-experimental">
1818
<div id="credentials-check" class="form-row">
1919
<div class="form-tips">
2020
<i class="fa fa-question-circle"></i><b> Please wait: </b> Checking for bound service credentials...
@@ -27,7 +27,7 @@
2727
<div class="form-row credentials" style="display: none;">
2828
<label for="node-input-password"><i class="fa fa-key"></i> Password</label>
2929
<input type="password" id="node-input-password" placeholder="Password">
30-
</div>
30+
</div>
3131
<div class="form-row">
3232
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
3333
<input type="text" id="node-input-name" placeholder="Name">
@@ -40,10 +40,10 @@
4040
</script>
4141

4242

43-
<script type="text/x-red" data-help-name="conversation-v1-experimental">
43+
<script type="text/x-red" data-help-name="watson-conversation-v1-experimental">
4444
<p>With the IBM Watson™ Conversation service you can create cognitive agents – virtual agents that combine machine learning, natural language understanding, and integrated dialog scripting tools to provide outstanding customer engagements.</p>
45-
46-
45+
46+
4747
<p><b>Usage</b></p>
4848
<p>This node should be provided in input : </p>
4949
<ul>
@@ -62,14 +62,14 @@
6262

6363
<p>For full details, please see the <a href="https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/conversation/overview.shtml">Watson Conversation API documentation</a></p>
6464
<p>See also the <a href="https://watson-api-explorer.mybluemix.net/">API Explorer</a> and the <a href="https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/conversation/tutorial_basic.shtml">Tutorial</a>.</p>
65-
65+
6666
<p>Check the sample Flow for this node on <a href="https://github.com/watson-developer-cloud/node-red-bluemix-starter">Watson Node-RED Starter</a></p>
6767
</script>
6868

6969

7070
<script type="text/javascript">
7171
(function() {
72-
RED.nodes.registerType('conversation-v1-experimental', {
72+
RED.nodes.registerType('watson-conversation-v1-experimental', {
7373
category: 'IBM Watson',
7474
defaults: {
7575
name: {value: ""},

services/conversation/v1-exp.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
module.exports = function (RED) {
1818
var cfenv = require('cfenv'), watson = require('watson-developer-cloud'), service = null,
1919
sUsername = null, sPassword = null;
20-
20+
2121
service = cfenv.getAppEnv().getServiceCreds(/conversation/i);
2222

2323
if (service) {
@@ -28,19 +28,19 @@ module.exports = function (RED) {
2828
RED.httpAdmin.get('/watson-conversation/vcap', function (req, res) {
2929
res.json(service ? {bound_service: true} : null);
3030
});
31-
32-
31+
32+
3333
function verifyPayload(node, msg) {
3434
if (!msg.payload) {
35-
this.status({fill:'red', shape:'ring', text:'missing payload'});
35+
this.status({fill:'red', shape:'ring', text:'missing payload'});
3636
node.error('Missing property: msg.payload', msg);
3737
return false;
3838
}
3939
return true;
4040
}
4141

4242
function verifyInputs(node, msg, config) {
43-
// workspaceid can be either configured in the node,
43+
// workspaceid can be either configured in the node,
4444
// or sent into msg.params.workspace_id
4545
if (!config.workspaceid || config.workspaceid !== '') {
4646
node.workspaceid = config.workspaceid;
@@ -54,13 +54,13 @@ module.exports = function (RED) {
5454
}
5555

5656
function verifyServiceCredentials(node, msg) {
57-
// If it is present the newly provided user entered key
58-
// takes precedence over the existing one.
57+
// If it is present the newly provided user entered key
58+
// takes precedence over the existing one.
5959
var userName = sUsername || node.credentials.username,
6060
passWord = sPassword || node.credentials.password;
61-
61+
6262
if (!userName || !passWord) {
63-
node.status({fill:'red', shape:'ring', text:'missing credentials'});
63+
node.status({fill:'red', shape:'ring', text:'missing credentials'});
6464
node.error('Missing Watson Conversation API service credentials', msg);
6565
return false;
6666
}
@@ -75,23 +75,23 @@ module.exports = function (RED) {
7575

7676
function processResponse(err, body, node, msg) {
7777
if (err != null && body == null) {
78-
node.status({fill:'red', shape:'ring',
79-
text:'call to watson conversation service failed'});
78+
node.status({fill:'red', shape:'ring',
79+
text:'call to watson conversation service failed'});
8080
msg.result = {};
8181
if (err.code == null) {
8282
msg.result['error'] = err;
8383
} else {
8484
msg.result['error_code'] = err.code;
8585
if (!err.error) {
8686
msg.result['error'] = err.error;
87-
}
87+
}
8888
}
8989
node.error(err);
9090
return;
9191
}
9292
msg.result = body;
9393
msg.payload = 'see msg.result';
94-
node.send(msg);
94+
node.send(msg);
9595
node.status({});
9696
}
9797

@@ -111,7 +111,7 @@ module.exports = function (RED) {
111111

112112
RED.nodes.createNode(this, config);
113113

114-
node.on('input', function (msg) {
114+
node.on('input', function (msg) {
115115
var params = {};
116116

117117
node.status({});
@@ -131,8 +131,8 @@ module.exports = function (RED) {
131131
execute(params,node,msg);
132132
});
133133
}
134-
135-
RED.nodes.registerType('conversation-v1-experimental', WatsonConversationV1ExpNode, {
134+
135+
RED.nodes.registerType('watson-conversation-v1-experimental', WatsonConversationV1ExpNode, {
136136
credentials: {
137137
username: {type:'text'},
138138
password: {type:'password'}

0 commit comments

Comments
 (0)