watson-developer-cloud
Advanced tools
Comparing version 3.5.3 to 3.6.0
@@ -35,7 +35,8 @@ /** | ||
/** | ||
* Get a percent-encoded authorization token based on resource query string param | ||
* If using an RC service, get an IAM access token. If using a CF service, | ||
* get a percent-encoded authorization token based on resource query string param | ||
* | ||
* @param {Object} [options] | ||
* @param {String} [options.url] defaults to url supplied to constructor (if any) | ||
* @param {Function(err, token)} callback - called with a %-encoded token | ||
* @param {Function(err, token)} callback - called with a %-encoded token if CF | ||
*/ | ||
@@ -42,0 +43,0 @@ getToken(params: any, callback: any): any; |
@@ -53,7 +53,8 @@ "use strict"; | ||
/** | ||
* Get a percent-encoded authorization token based on resource query string param | ||
* If using an RC service, get an IAM access token. If using a CF service, | ||
* get a percent-encoded authorization token based on resource query string param | ||
* | ||
* @param {Object} [options] | ||
* @param {String} [options.url] defaults to url supplied to constructor (if any) | ||
* @param {Function(err, token)} callback - called with a %-encoded token | ||
* @param {Function(err, token)} callback - called with a %-encoded token if CF | ||
*/ | ||
@@ -65,2 +66,9 @@ AuthorizationV1.prototype.getToken = function (params, callback) { | ||
} | ||
// if the service is an RC instance, return an IAM access token | ||
if (this.tokenManager) { | ||
// callback should expect (err, token) format, | ||
// which is what the token manager will pass in | ||
return this.tokenManager.getToken(callback); | ||
} | ||
// otherwise, return a CF Watson token | ||
if (!params.url) { | ||
@@ -67,0 +75,0 @@ callback(new Error('Missing required parameters: url')); |
@@ -35,3 +35,3 @@ "use strict"; | ||
function hasBasicCredentials(obj) { | ||
return obj && obj.username && obj.password; | ||
return obj && obj.username && obj.password && obj.username !== 'apikey'; | ||
} | ||
@@ -80,2 +80,8 @@ var BaseService = /** @class */ (function () { | ||
} | ||
else if (_options.username === 'apikey') { | ||
this.tokenManager = new v1_1.IamTokenManagerV1({ | ||
iamApikey: _options.password, | ||
iamUrl: _options.iam_url | ||
}); | ||
} | ||
else { | ||
@@ -82,0 +88,0 @@ this.tokenManager = null; |
@@ -74,2 +74,5 @@ /** | ||
* @param {IamTokenManagerV1} [options.token_manager] - Token manager for authenticating with IAM | ||
* @param {string} [options.base_model_version] - The version of the specified base model that is to be used with recognition request or, for the **Create a session** method, with the new session. | ||
* Multiple versions of a base model can exist when a model is updated for internal improvements. The parameter is intended primarily for use with custom models that have been upgraded for a new base model. | ||
* The default value depends on whether the parameter is used with or without a custom model. For more information, see [Base model version](https://console.bluemix.net/docs/services/speech-to-text/input.html#version). | ||
* | ||
@@ -76,0 +79,0 @@ * @constructor |
@@ -97,2 +97,5 @@ "use strict"; | ||
* @param {IamTokenManagerV1} [options.token_manager] - Token manager for authenticating with IAM | ||
* @param {string} [options.base_model_version] - The version of the specified base model that is to be used with recognition request or, for the **Create a session** method, with the new session. | ||
* Multiple versions of a base model can exist when a model is updated for internal improvements. The parameter is intended primarily for use with custom models that have been upgraded for a new base model. | ||
* The default value depends on whether the parameter is used with or without a custom model. For more information, see [Base model version](https://console.bluemix.net/docs/services/speech-to-text/input.html#version). | ||
* | ||
@@ -99,0 +102,0 @@ * @constructor |
{ | ||
"name": "watson-developer-cloud", | ||
"version": "3.5.3", | ||
"version": "3.6.0", | ||
"description": "Client library to use the IBM Watson Services and AlchemyAPI", | ||
@@ -47,2 +47,4 @@ "main": "./index", | ||
"devDependencies": { | ||
"@commitlint/cli": "^7.0.0", | ||
"@commitlint/config-conventional": "^7.0.1", | ||
"browserify": "~16.2.2", | ||
@@ -100,2 +102,3 @@ "codecov": "~3.0.2", | ||
"precommit": "lint-staged", | ||
"commitmsg": "commitlint -E GIT_PARAMS", | ||
"tslint:config": "tslint-config-prettier-check ./tslint.json", | ||
@@ -102,0 +105,0 @@ "tslint:fix": "tslint --fix -p . -c tslint.json", |
@@ -8,2 +8,3 @@ # Watson APIs Node.js SDK | ||
[![npm-downloads](https://img.shields.io/npm/dm/watson-developer-cloud.svg)](https://www.npmjs.com/package/watson-developer-cloud) | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) | ||
@@ -10,0 +11,0 @@ Node.js client library to use the Watson APIs. |
@@ -79,3 +79,3 @@ /// <reference types="node" /> | ||
* @param {String} params.content_type - Content-type | ||
* @param {Boolean} [params.continuous] | ||
* @param {String} [params.base_model_version] | ||
* @param {Number} [params.max_alternatives] | ||
@@ -82,0 +82,0 @@ * @param {Boolean} [params.timestamps] |
@@ -27,3 +27,2 @@ "use strict"; | ||
var PARAMS_ALLOWED = [ | ||
'continuous', | ||
'max_alternatives', | ||
@@ -44,3 +43,4 @@ 'timestamps', | ||
'customization_weight', | ||
'acoustic_customization_id' | ||
'acoustic_customization_id', | ||
'base_model_version' | ||
]; | ||
@@ -419,3 +419,3 @@ /** | ||
* @param {String} params.content_type - Content-type | ||
* @param {Boolean} [params.continuous] | ||
* @param {String} [params.base_model_version] | ||
* @param {Number} [params.max_alternatives] | ||
@@ -422,0 +422,0 @@ * @param {Boolean} [params.timestamps] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
117
720
6832595
28
118552