Skip to content

Commit 465a754

Browse files
Merge branch 'master' of github.com:watson-developer-cloud/node-sdk
2 parents b30e8ba + 49663ba commit 465a754

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1148
-1148
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
# (On Windows, git is often configured to automatically convert between the two - See https://git-scm.com/docs/git-config#git-config-coreautocrlf )
55

66
*.js text eol=lf
7+
*.ts text eol=lf

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ var conversation = new ConversationV1({
151151
username: '<username>',
152152
password: '<password>',
153153
url: 'https://gateway.watsonplatform.net/conversation/api/',
154-
version_date: '2017-05-26'
154+
version: '2017-05-26'
155155
});
156156

157157
conversation.message(
@@ -180,7 +180,7 @@ var discovery = new DiscoveryV1({
180180
username: '<username>',
181181
password: '<password>',
182182
url: 'https://gateway.watsonplatform.net/discovery/api/',
183-
version_date: '2017-09-01'
183+
version: '2017-09-01'
184184
});
185185

186186
discovery.query(
@@ -286,7 +286,7 @@ var NaturalLanguageUnderstandingV1 = require('watson-developer-cloud/natural-lan
286286
var nlu = new NaturalLanguageUnderstandingV1({
287287
username: '<username>',
288288
password: '<password>',
289-
version_date: '2017-02-27',
289+
version: '2017-02-27',
290290
url: 'https://gateway.watsonplatform.net/natural-language-understanding/api/'
291291
});
292292

@@ -320,7 +320,7 @@ var PersonalityInsightsV3 = require('watson-developer-cloud/personality-insights
320320
var personalityInsights = new PersonalityInsightsV3({
321321
username: '<username>',
322322
password: '<password>',
323-
version_date: '2016-10-19',
323+
version: '2016-10-19',
324324
url: 'https://gateway.watsonplatform.net/personality-insights/api/'
325325
});
326326

@@ -420,7 +420,7 @@ var ToneAnalyzerV3 = require('watson-developer-cloud/tone-analyzer/v3');
420420
var toneAnalyzer = new ToneAnalyzerV3({
421421
username: '<username>',
422422
password: '<password>',
423-
version_date: '2016-05-19',
423+
version: '2016-05-19',
424424
url: 'https://gateway.watsonplatform.net/tone-analyzer/api/'
425425
});
426426

@@ -453,7 +453,7 @@ var fs = require('fs');
453453

454454
var visualRecognition = new VisualRecognitionV3({
455455
api_key: '<api_key>',
456-
version_date: '2016-05-20'
456+
version: '2016-05-20'
457457
});
458458

459459
var params = {

conversation/v1-generated.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ConversationV1 extends BaseService {
3535
* Construct a ConversationV1 object.
3636
*
3737
* @param {Object} options - Options for the service.
38-
* @param {String} options.version_date - The API version date to use with the service, in "YYYY-MM-DD" format. Whenever the API is changed in a backwards incompatible way, a new minor version of the API is released. The service uses the API version for the date you specify, or the most recent version before that date. Note that you should not programmatically specify the current date at runtime, in case the API has been updated since your application's release. Instead, specify a version date that is compatible with your application, and don't change it until your application is ready for a later version.
38+
* @param {String} options.version - The API version date to use with the service, in "YYYY-MM-DD" format. Whenever the API is changed in a backwards incompatible way, a new minor version of the API is released. The service uses the API version for the date you specify, or the most recent version before that date. Note that you should not programmatically specify the current date at runtime, in case the API has been updated since your application's release. Instead, specify a version date that is compatible with your application, and don't change it until your application is ready for a later version.
3939
* @param {String} [options.url] - The base url to use when contacting the service (e.g. 'https://gateway.watsonplatform.net/conversation/api'). The base url may differ between Bluemix regions.
4040
* @param {String} [options.username] - The username used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable.
4141
* @param {String} [options.password] - The password used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable.
@@ -48,11 +48,11 @@ class ConversationV1 extends BaseService {
4848
*/
4949
constructor(options: ConversationV1.Options) {
5050
super(options);
51-
// check if 'version_date' was provided
52-
if (typeof this._options.version_date === 'undefined') {
53-
throw new Error('Argument error: version_date was not specified');
51+
// check if 'version' was provided
52+
if (typeof this._options.version === 'undefined') {
53+
throw new Error('Argument error: version was not specified');
5454
}
55-
this._options.qs.version = options.version_date;
55+
this._options.qs.version = options.version;
5656
}
5757

5858
/*************************
@@ -2240,7 +2240,7 @@ ConversationV1.prototype.serviceVersion = 'v1';
22402240
namespace ConversationV1 {
22412241
/** Options for the `ConversationV1` constructor. **/
22422242
export type Options = {
2243-
version_date: string;
2243+
version: string;
22442244
url?: string;
22452245
username?: string;
22462246
password?: string;

conversation/v1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ class ConversationV1 extends GeneratedConversationV1 {
3131
static VERSION_DATE_2016_07_11: string = '2016-07-11';
3232

3333
constructor(options) {
34-
super(options);
34+
// For backward compatibility, allow version to be passed in version_date.
35+
const _options = extend({}, options);
36+
_options.version = _options.version_date || _options.version;
37+
super(_options);
3538
}
3639

3740
private static removedError: Error = new Error(

dependency-lint.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44
executedModules:
55
npmScripts:
66
dev:
7+
- autofix
8+
- browserify
9+
- build
10+
- codecov
11+
- compat-check
12+
- doc
713
- lint
814
- lint-depsnpm t
15+
- minify
16+
- report-coverage
917
- test
10-
- autofix
11-
- doc
12-
- codecov
18+
- test-browser
1319
- test-integration
1420
- test-unit
15-
- test-browser
1621
- watch
17-
- browserify
1822
- watchify
19-
- minify
20-
- build
21-
- compat-check
2223
shellScripts:
2324
dev: []
2425
ignore: []

discovery/v1-generated.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DiscoveryV1 extends BaseService {
3535
* Construct a DiscoveryV1 object.
3636
*
3737
* @param {Object} options - Options for the service.
38-
* @param {String} options.version_date - The API version date to use with the service, in "YYYY-MM-DD" format. Whenever the API is changed in a backwards incompatible way, a new minor version of the API is released. The service uses the API version for the date you specify, or the most recent version before that date. Note that you should not programmatically specify the current date at runtime, in case the API has been updated since your application's release. Instead, specify a version date that is compatible with your application, and don't change it until your application is ready for a later version.
38+
* @param {String} options.version - The API version date to use with the service, in "YYYY-MM-DD" format. Whenever the API is changed in a backwards incompatible way, a new minor version of the API is released. The service uses the API version for the date you specify, or the most recent version before that date. Note that you should not programmatically specify the current date at runtime, in case the API has been updated since your application's release. Instead, specify a version date that is compatible with your application, and don't change it until your application is ready for a later version.
3939
* @param {String} [options.url] - The base url to use when contacting the service (e.g. 'https://gateway.watsonplatform.net/discovery/api'). The base url may differ between Bluemix regions.
4040
* @param {String} [options.username] - The username used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable.
4141
* @param {String} [options.password] - The password used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable.
@@ -48,11 +48,11 @@ class DiscoveryV1 extends BaseService {
4848
*/
4949
constructor(options: DiscoveryV1.Options) {
5050
super(options);
51-
// check if 'version_date' was provided
52-
if (typeof this._options.version_date === 'undefined') {
53-
throw new Error('Argument error: version_date was not specified');
51+
// check if 'version' was provided
52+
if (typeof this._options.version === 'undefined') {
53+
throw new Error('Argument error: version was not specified');
5454
}
55-
this._options.qs.version = options.version_date;
55+
this._options.qs.version = options.version;
5656
}
5757

5858
/*************************
@@ -2002,7 +2002,7 @@ DiscoveryV1.prototype.serviceVersion = 'v1';
20022002
namespace DiscoveryV1 {
20032003
/** Options for the `DiscoveryV1` constructor. **/
20042004
export type Options = {
2005-
version_date: string;
2005+
version: string;
20062006
url?: string;
20072007
username?: string;
20082008
password?: string;

0 commit comments

Comments
 (0)