{"action":"created","comment":{"url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/comments/67473093","id":67473093,"diff_hunk":"@@ -0,0 +1,143 @@\n+/**\n+ * Copyright 2016 IBM Corp.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the 'License');\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ **/\n+\n+module.exports = function (RED) {\n+  var cfenv = require('cfenv'), watson = require('watson-developer-cloud'), service = null,\n+    sUsername = null, sPassword = null;\n+  \n+  service = cfenv.getAppEnv().getServiceCreds(/conversation/i);\n+\n+  if (service) {\n+    sUsername = service.username;\n+    sPassword = service.password;\n+  }\n+\n+  RED.httpAdmin.get('/watson-conversation/vcap', function (req, res) {\n+    res.json(service ? {bound_service: true} : null);\n+  });\n+ \n+  \n+  function verifyPayload(node, msg) {\n+    if (!msg.payload) {\n+      this.status({fill:'red', shape:'ring', text:'missing payload'}); \n+      node.error('Missing property: msg.payload', msg);\n+      return false;\n+    }\n+    return true;\n+  }\n+\n+  function verifyInputs(node, msg, config) {\n+    // workspaceid can be either configured in the node, \n+    // or sent into msg.params.workspace_id\n+    if (!config.workspaceid || config.workspaceid !== '') {\n+      node.workspaceid = config.workspaceid;\n+      return true;\n+    } else if (!msg.params || '' !== msg.params.workspace_id) {","path":"services/conversation/v1-exp.js","position":48,"original_position":48,"commit_id":"cd49d677c26da39ead9c4515c9ee64fc1b51d4d7","original_commit_id":"cd49d677c26da39ead9c4515c9ee64fc1b51d4d7","user":{"login":"yrezgui","id":1113976,"avatar_url":"https://avatars.githubusercontent.com/u/1113976?v=3","gravatar_id":"","url":"https://api.github.com/users/yrezgui","html_url":"https://github.com/yrezgui","followers_url":"https://api.github.com/users/yrezgui/followers","following_url":"https://api.github.com/users/yrezgui/following{/other_user}","gists_url":"https://api.github.com/users/yrezgui/gists{/gist_id}","starred_url":"https://api.github.com/users/yrezgui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yrezgui/subscriptions","organizations_url":"https://api.github.com/users/yrezgui/orgs","repos_url":"https://api.github.com/users/yrezgui/repos","events_url":"https://api.github.com/users/yrezgui/events{/privacy}","received_events_url":"https://api.github.com/users/yrezgui/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Expected literal to be on the right side of !==.](https://www.codacy.com/app/node-red-nodes-watson/node-red-node-watson/file/2780588330/issues/source?bid=3225115&fileBranchId=3365376#l48)","created_at":"2016-06-17T08:02:54Z","updated_at":"2016-06-17T08:02:54Z","html_url":"https://github.com/watson-developer-cloud/node-red-node-watson/pull/134#discussion_r67473093","pull_request_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/134","_links":{"self":{"href":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/comments/67473093"},"html":{"href":"https://github.com/watson-developer-cloud/node-red-node-watson/pull/134#discussion_r67473093"},"pull_request":{"href":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/134"}}},"pull_request":{"url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/134","id":74199346,"html_url":"https://github.com/watson-developer-cloud/node-red-node-watson/pull/134","diff_url":"https://github.com/watson-developer-cloud/node-red-node-watson/pull/134.diff","patch_url":"https://github.com/watson-developer-cloud/node-red-node-watson/pull/134.patch","issue_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/issues/134","number":134,"state":"open","locked":false,"title":"Added node for Watson Conversation (Experimental)","user":{"login":"ylecleach","id":7034390,"avatar_url":"https://avatars.githubusercontent.com/u/7034390?v=3","gravatar_id":"","url":"https://api.github.com/users/ylecleach","html_url":"https://github.com/ylecleach","followers_url":"https://api.github.com/users/ylecleach/followers","following_url":"https://api.github.com/users/ylecleach/following{/other_user}","gists_url":"https://api.github.com/users/ylecleach/gists{/gist_id}","starred_url":"https://api.github.com/users/ylecleach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ylecleach/subscriptions","organizations_url":"https://api.github.com/users/ylecleach/orgs","repos_url":"https://api.github.com/users/ylecleach/repos","events_url":"https://api.github.com/users/ylecleach/events{/privacy}","received_events_url":"https://api.github.com/users/ylecleach/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-17T07:24:42Z","updated_at":"2016-06-17T08:02:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ad6b44f1cb5612335134e74efbc75968e24c706","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/134/commits","review_comments_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/134/comments","review_comment_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/issues/134/comments","statuses_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/statuses/cd49d677c26da39ead9c4515c9ee64fc1b51d4d7","head":{"label":"ylecleach:master","ref":"master","sha":"cd49d677c26da39ead9c4515c9ee64fc1b51d4d7","user":{"login":"ylecleach","id":7034390,"avatar_url":"https://avatars.githubusercontent.com/u/7034390?v=3","gravatar_id":"","url":"https://api.github.com/users/ylecleach","html_url":"https://github.com/ylecleach","followers_url":"https://api.github.com/users/ylecleach/followers","following_url":"https://api.github.com/users/ylecleach/following{/other_user}","gists_url":"https://api.github.com/users/ylecleach/gists{/gist_id}","starred_url":"https://api.github.com/users/ylecleach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ylecleach/subscriptions","organizations_url":"https://api.github.com/users/ylecleach/orgs","repos_url":"https://api.github.com/users/ylecleach/repos","events_url":"https://api.github.com/users/ylecleach/events{/privacy}","received_events_url":"https://api.github.com/users/ylecleach/received_events","type":"User","site_admin":false},"repo":{"id":56971768,"name":"node-red-node-watson","full_name":"ylecleach/node-red-node-watson","owner":{"login":"ylecleach","id":7034390,"avatar_url":"https://avatars.githubusercontent.com/u/7034390?v=3","gravatar_id":"","url":"https://api.github.com/users/ylecleach","html_url":"https://github.com/ylecleach","followers_url":"https://api.github.com/users/ylecleach/followers","following_url":"https://api.github.com/users/ylecleach/following{/other_user}","gists_url":"https://api.github.com/users/ylecleach/gists{/gist_id}","starred_url":"https://api.github.com/users/ylecleach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ylecleach/subscriptions","organizations_url":"https://api.github.com/users/ylecleach/orgs","repos_url":"https://api.github.com/users/ylecleach/repos","events_url":"https://api.github.com/users/ylecleach/events{/privacy}","received_events_url":"https://api.github.com/users/ylecleach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ylecleach/node-red-node-watson","description":"A collection of nodes for the IBM Watson services","fork":true,"url":"https://api.github.com/repos/ylecleach/node-red-node-watson","forks_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/forks","keys_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/teams","hooks_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/hooks","issue_events_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/issues/events{/number}","events_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/events","assignees_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/assignees{/user}","branches_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/branches{/branch}","tags_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/tags","blobs_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/git/refs{/sha}","trees_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/statuses/{sha}","languages_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/languages","stargazers_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/stargazers","contributors_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/contributors","subscribers_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/subscribers","subscription_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/subscription","commits_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/commits{/sha}","git_commits_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/git/commits{/sha}","comments_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/comments{/number}","issue_comment_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/issues/comments{/number}","contents_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/contents/{+path}","compare_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/merges","archive_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/downloads","issues_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/issues{/number}","pulls_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/pulls{/number}","milestones_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/milestones{/number}","notifications_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/labels{/name}","releases_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/releases{/id}","deployments_url":"https://api.github.com/repos/ylecleach/node-red-node-watson/deployments","created_at":"2016-04-24T13:02:37Z","updated_at":"2016-04-24T13:02:38Z","pushed_at":"2016-06-17T07:28:24Z","git_url":"git://github.com/ylecleach/node-red-node-watson.git","ssh_url":"git@github.com:ylecleach/node-red-node-watson.git","clone_url":"https://github.com/ylecleach/node-red-node-watson.git","svn_url":"https://github.com/ylecleach/node-red-node-watson","homepage":null,"size":7804,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"watson-developer-cloud:master","ref":"master","sha":"2b159d3d69812a0f7a45f21384f2fa9ca711b413","user":{"login":"watson-developer-cloud","id":10017763,"avatar_url":"https://avatars.githubusercontent.com/u/10017763?v=3","gravatar_id":"","url":"https://api.github.com/users/watson-developer-cloud","html_url":"https://github.com/watson-developer-cloud","followers_url":"https://api.github.com/users/watson-developer-cloud/followers","following_url":"https://api.github.com/users/watson-developer-cloud/following{/other_user}","gists_url":"https://api.github.com/users/watson-developer-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/watson-developer-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watson-developer-cloud/subscriptions","organizations_url":"https://api.github.com/users/watson-developer-cloud/orgs","repos_url":"https://api.github.com/users/watson-developer-cloud/repos","events_url":"https://api.github.com/users/watson-developer-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/watson-developer-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":55415107,"name":"node-red-node-watson","full_name":"watson-developer-cloud/node-red-node-watson","owner":{"login":"watson-developer-cloud","id":10017763,"avatar_url":"https://avatars.githubusercontent.com/u/10017763?v=3","gravatar_id":"","url":"https://api.github.com/users/watson-developer-cloud","html_url":"https://github.com/watson-developer-cloud","followers_url":"https://api.github.com/users/watson-developer-cloud/followers","following_url":"https://api.github.com/users/watson-developer-cloud/following{/other_user}","gists_url":"https://api.github.com/users/watson-developer-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/watson-developer-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watson-developer-cloud/subscriptions","organizations_url":"https://api.github.com/users/watson-developer-cloud/orgs","repos_url":"https://api.github.com/users/watson-developer-cloud/repos","events_url":"https://api.github.com/users/watson-developer-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/watson-developer-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/watson-developer-cloud/node-red-node-watson","description":"A collection of nodes for the IBM Watson services","fork":true,"url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson","forks_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/forks","keys_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/teams","hooks_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/hooks","issue_events_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/issues/events{/number}","events_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/events","assignees_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/assignees{/user}","branches_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/branches{/branch}","tags_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/tags","blobs_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/git/refs{/sha}","trees_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/statuses/{sha}","languages_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/languages","stargazers_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/stargazers","contributors_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/contributors","subscribers_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/subscribers","subscription_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/subscription","commits_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/commits{/sha}","git_commits_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/git/commits{/sha}","comments_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/comments{/number}","issue_comment_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/issues/comments{/number}","contents_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/contents/{+path}","compare_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/merges","archive_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/downloads","issues_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/issues{/number}","pulls_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls{/number}","milestones_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/milestones{/number}","notifications_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/labels{/name}","releases_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/releases{/id}","deployments_url":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/deployments","created_at":"2016-04-04T13:51:28Z","updated_at":"2016-06-13T14:01:18Z","pushed_at":"2016-06-17T07:28:24Z","git_url":"git://github.com/watson-developer-cloud/node-red-node-watson.git","ssh_url":"git@github.com:watson-developer-cloud/node-red-node-watson.git","clone_url":"https://github.com/watson-developer-cloud/node-red-node-watson.git","svn_url":"https://github.com/watson-developer-cloud/node-red-node-watson","homepage":null,"size":7892,"stargazers_count":10,"watchers_count":10,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":7,"forks":13,"open_issues":7,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/134"},"html":{"href":"https://github.com/watson-developer-cloud/node-red-node-watson/pull/134"},"issue":{"href":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/issues/134"},"comments":{"href":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/watson-developer-cloud/node-red-node-watson/statuses/cd49d677c26da39ead9c4515c9ee64fc1b51d4d7"}}}}
{"actor":{"display_login":"yrezgui"}}