watson-developer-cloud
Advanced tools
Comparing version 1.12.2 to 1.12.3
@@ -59,2 +59,8 @@ { | ||
"extract_dates": { | ||
"html" : "/html/HTMLExtractDates", | ||
"url" : "/url/URLExtractDates", | ||
"text" : "/text/TextExtractDates" | ||
}, | ||
"text_raw": { | ||
@@ -61,0 +67,0 @@ "html" : "/html/HTMLGetRawText", |
@@ -210,3 +210,3 @@ /** | ||
* @param {{}} options | ||
* @returns {LanguageTranslation} | ||
* @returns {LanguageTranslator} | ||
*/ | ||
@@ -213,0 +213,0 @@ language_translator: createServiceAPI('language_translator'), |
{ | ||
"name": "watson-developer-cloud", | ||
"version": "1.12.2", | ||
"version": "1.12.3", | ||
"description": "Client library to use the IBM Watson Services and AlchemyAPI", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
@@ -151,3 +151,3 @@ /** | ||
/** | ||
* Categorizes the text for text, a URL or HTML. | ||
* Extracts the publication date from a webpage or HTML file. | ||
*/ | ||
@@ -157,2 +157,8 @@ AlchemyLanguage.prototype.publicationDate = createRequest('publication_date'); | ||
/** | ||
* Finds dates in the source text, including relative dates like "next Tuesday" | ||
* if an anchorDate is set. | ||
*/ | ||
AlchemyLanguage.prototype.dates = createRequest('extract_dates'); | ||
/** | ||
* Detects the RSS/ATOM feeds for a URL or HTML. | ||
@@ -173,3 +179,3 @@ */ | ||
/** | ||
* Categorized through the taxonomy call for text, HTML, or a URL. | ||
* Combines multiple API operations into a single call. | ||
*/ | ||
@@ -176,0 +182,0 @@ AlchemyLanguage.prototype.combined = createRequest('combined'); |
@@ -31,3 +31,3 @@ /** | ||
// Warn if not specifying version date | ||
var version_date = '2015-12-01'; | ||
var version_date = '2015-12-15'; | ||
if(options && options.version_date) { | ||
@@ -38,3 +38,3 @@ version_date = options.version_date; | ||
console.warn('[DocumentConversion] WARNING: No version_date specified. Using a (possibly old) default. ' + | ||
'e.g. watson.document_conversion({ version_date: "2015-12-01" })'); | ||
'e.g. watson.document_conversion({ version_date: "2015-12-15" })'); | ||
} | ||
@@ -54,5 +54,5 @@ | ||
DocumentConversion.prototype.conversion_target = { | ||
ANSWER_UNITS: 'ANSWER_UNITS', | ||
NORMALIZED_HTML: 'NORMALIZED_HTML', | ||
NORMALIZED_TEXT: 'NORMALIZED_TEXT' | ||
ANSWER_UNITS: 'answer_units', | ||
NORMALIZED_HTML: 'normalized_html', | ||
NORMALIZED_TEXT: 'normalized_text' | ||
}; | ||
@@ -87,3 +87,3 @@ | ||
* @param {Object} params | ||
* @param {Object} params.conversion_target Must be set to one of ['ANSWER_UNITS', 'NORMALIZED_HTML', 'NORMALIZED_TEXT'] | ||
* @param {Object} params.conversion_target Must be set to one of ['answer_units', 'normalized_html', 'normalized_text'] | ||
* @param {ReadableStream} [params.file] The document file to convert. May be a ReadableStream or Buffer | ||
@@ -95,6 +95,8 @@ * @param {String} [params.content_type] Set this when the content type cannot be determined from the filename (params.file.path) | ||
params = params || {}; | ||
if (!params.conversion_target || !DocumentConversion.prototype.conversion_target[params.conversion_target]) { | ||
var keys = Object.keys(DocumentConversion.prototype.conversion_target); | ||
var values = keys.map(function(v) { return DocumentConversion.prototype.conversion_target[v]; }); | ||
if (typeof params.conversion_target === 'string') { | ||
params.conversion_target = params.conversion_target.toLowerCase(); | ||
} | ||
var keys = Object.keys(DocumentConversion.prototype.conversion_target); | ||
var values = keys.map(function(v) { return DocumentConversion.prototype.conversion_target[v]; }); | ||
if (values.indexOf(params.conversion_target) == -1) { | ||
callback(new Error('Missing required parameters: conversion_target. Possible values are: ' + values.join(', '))); | ||
@@ -101,0 +103,0 @@ return; |
@@ -32,3 +32,3 @@ /** | ||
*/ | ||
function LanguageTranslation(options) { | ||
function LanguageTranslator(options) { | ||
// Default URL | ||
@@ -53,3 +53,3 @@ var serviceDefaults = { | ||
*/ | ||
LanguageTranslation.prototype.getModels = function(params, callback) { | ||
LanguageTranslator.prototype.getModels = function(params, callback) { | ||
params = params || {}; | ||
@@ -73,3 +73,3 @@ | ||
*/ | ||
LanguageTranslation.prototype.getModel = function(params, callback) { | ||
LanguageTranslator.prototype.getModel = function(params, callback) { | ||
params = params || {}; | ||
@@ -98,3 +98,3 @@ | ||
*/ | ||
LanguageTranslation.prototype.createModel = function(params, callback) { | ||
LanguageTranslator.prototype.createModel = function(params, callback) { | ||
params = params || {}; | ||
@@ -136,3 +136,3 @@ | ||
*/ | ||
LanguageTranslation.prototype.deleteModel = function(params, callback) { | ||
LanguageTranslator.prototype.deleteModel = function(params, callback) { | ||
params = params || {}; | ||
@@ -158,3 +158,3 @@ | ||
*/ | ||
LanguageTranslation.prototype.translate = function(params, callback) { | ||
LanguageTranslator.prototype.translate = function(params, callback) { | ||
params = params || {}; | ||
@@ -183,3 +183,3 @@ | ||
*/ | ||
LanguageTranslation.prototype.getIdentifiableLanguages = function(params, callback) { | ||
LanguageTranslator.prototype.getIdentifiableLanguages = function(params, callback) { | ||
params = params || {}; | ||
@@ -203,3 +203,3 @@ | ||
*/ | ||
LanguageTranslation.prototype.identify = function(params, callback) { | ||
LanguageTranslator.prototype.identify = function(params, callback) { | ||
if (!params || !params.text){ | ||
@@ -227,2 +227,2 @@ callback(new Error('Missing required parameters: text')); | ||
module.exports = LanguageTranslation; | ||
module.exports = LanguageTranslator; |
@@ -213,4 +213,6 @@ /** | ||
RecognizeStream.prototype.afterSend = function afterSend(next) { | ||
// note: bufferedAmount is currently always 0 | ||
// see https://github.com/watson-developer-cloud/node-sdk/issues/285 | ||
if (this.socket.bufferedAmount <= this._writableState.highWaterMark || 0) { | ||
next(); | ||
process.nextTick(next); | ||
} else { | ||
@@ -217,0 +219,0 @@ setTimeout(this.afterSend.bind(this, next), 10); |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
233157
5145
2