watson-developer-cloud
Advanced tools
Comparing version 0.9.5 to 0.9.6
@@ -11,2 +11,6 @@ 'use strict'; | ||
/////////////////// | ||
// Annotate text // | ||
/////////////////// | ||
var params = { | ||
@@ -25,1 +29,25 @@ user: 'wikipedia', | ||
}); | ||
///////////////////// | ||
// Semantic Search // | ||
///////////////////// | ||
var payload = { | ||
func: 'semanticSearch', | ||
ids: [ | ||
'/graph/wikipedia/en-20120601/Software_development_process', | ||
'/graph/wikipedia/en-20120601/Programming_tool' | ||
], | ||
corpus: 'ibmresearcher', | ||
user: 'public', | ||
limit: 5 | ||
}; | ||
concept_insights.semanticSearch(payload, function(error, results) { | ||
if (error) | ||
console.log(error); | ||
else | ||
console.log(JSON.stringify(results, null, 2)); | ||
}); |
{ | ||
"name": "watson-developer-cloud", | ||
"version": "0.9.5", | ||
"version": "0.9.6", | ||
"description": "Nodejs Client Wrapper to use the IBM Watson Services", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
@@ -426,3 +426,3 @@ Watson Developer Cloud Nodejs Client | ||
```sh | ||
$ NODE_DEBUG='request' app.js | ||
$ NODE_DEBUG='request' node app.js | ||
``` | ||
@@ -429,0 +429,0 @@ where `app.js` is your nodejs file |
@@ -287,2 +287,18 @@ /** | ||
params = params || {}; | ||
// Initially, we expected the user to supply JSON.stringify'd ids. Now we expect an array of strings that we'll JSON.stringify our self. | ||
// We still support the old version for backwards compatibility, BUT we don't want to accept any old string, only a valid JSON array, so we parse and check it to be sure. | ||
if (!Array.isArray(params.ids)) { | ||
try { | ||
params.ids = JSON.parse(params.ids); | ||
} catch (ex) { | ||
// if it wasn't valid JSON, then it still won't be an array and we'll throw an error when we check that in a couple of lines | ||
} | ||
if (!Array.isArray(params.ids)) { | ||
return process.nextTick(callback.bind(null, new Error("Invalid or missing required parameters: the ids param be an array of strings"))); | ||
} | ||
} | ||
params.ids = JSON.stringify(params.ids); | ||
var parameters = { | ||
@@ -289,0 +305,0 @@ options: { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2881571
41
1816
5