Skip to content

Commit a851b5e

Browse files
authored
Merge pull request watson-developer-cloud#419 from adrien2p/fix/415-STTEventsParameter
[STT] events parameter [semver patch]
2 parents 633eedd + ddb4629 commit a851b5e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

speech-to-text/v1.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ SpeechToTextV1.URL = 'https://stream.watsonplatform.net/speech-to-text/api';
9797
*
9898
* @param {object} params - The parameters
9999
* @param {string} params.callback_url - A URL to which callback notifications are to be sent
100-
* @param {string} params.user_secret - A user-specified string that the service uses to generate the HMAC-SHA1 signature that it sends via the X-Callback-Signature header
100+
* @param {string} [params.user_secret] - A user-specified string that the service uses to generate the HMAC-SHA1 signature that it sends via the X-Callback-Signature header
101101
* @param {Function} callback
102102
* @returns {ReadableStream|undefined}
103103
*/
@@ -131,7 +131,7 @@ SpeechToTextV1.prototype.registerCallback = function(params, callback) {
131131
* @param {Stream} params.audio - Audio to be recognized
132132
* @param {string} params.content_type - The Content-type e.g. audio/l16; rate=48000
133133
* @param {string} params.callback_url - A URL to which callback notifications are to be sent
134-
* @param {string} [params.event] - recognitions.started|recognitions.completed|recognitions.failed|recognitions.completed_with_results
134+
* @param {string} [params.events] - recognitions.started|recognitions.completed|recognitions.failed|recognitions.completed_with_results
135135
* @param {string} [params.user_token] - The token allows the user to maintain an internal mapping between jobs and notification events
136136
* @param {number} [params.results_ttl] - time to alive of the job result
137137
* @param {*} [params.*] - all params that .recognize() accepts may also be passed to createRecognitionJob()
@@ -157,7 +157,7 @@ SpeechToTextV1.prototype.createRecognitionJob = function(params, callback) {
157157
headers: {
158158
'Content-Type': params.content_type
159159
},
160-
qs: pick(params, ['callback_url', 'event', 'user_token', 'results_ttl'].concat(PARAMS_ALLOWED)),
160+
qs: pick(params, ['callback_url', 'events', 'user_token', 'results_ttl'].concat(PARAMS_ALLOWED)),
161161
json: true
162162
},
163163
defaultOptions: this._options

test/integration/test.speech_to_text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ describe('speech_to_text_integration', function() {
421421
// if this fails, logs are available at https://watson-test-resources.mybluemix.net/speech-to-text-async/secure
422422
callback_url: 'https://watson-test-resources.mybluemix.net/speech-to-text-async/secure/callback',
423423
user_token: 'Node.js SDK Integration Test at ' + new Date(),
424-
event: 'recognitions.completed',
424+
events: 'recognitions.completed',
425425
results_ttl: 1
426426
};
427427
speech_to_text.createRecognitionJob(params, function(err, res) {

test/unit/test.speech_to_text.v1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ describe('speech_to_text', function() {
368368
});
369369

370370
it('should create new recognitions job', function() {
371-
const path = '/v1/recognitions?callback_url=http%3A%2F%2Fwatson-test-resources.mybluemix.net%2Fresults&event=recognitions.completed&user_token=myArbitraryIdentifier1&results_ttl=60';
371+
const path = '/v1/recognitions?callback_url=http%3A%2F%2Fwatson-test-resources.mybluemix.net%2Fresults&events=recognitions.completed&user_token=myArbitraryIdentifier1&results_ttl=60';
372372
const response = {
373373
id: '4bd734c0-e575-21f3-de03-f932aa0468a0',
374374
status: 'waiting',
@@ -388,7 +388,7 @@ describe('speech_to_text', function() {
388388
content_type: 'audio/l16;rate=41100',
389389
callback_url: 'http://watson-test-resources.mybluemix.net/results',
390390
user_token: 'myArbitraryIdentifier1',
391-
event: 'recognitions.completed',
391+
events: 'recognitions.completed',
392392
results_ttl: 60
393393
};
394394
const req = speech_to_text.createRecognitionJob(params, checkRes);

0 commit comments

Comments
 (0)