From 10a3ff10a011fbdc5a2f4422c7f6879611767fe5 Mon Sep 17 00:00:00 2001 From: Dustin Popp Date: Fri, 4 Oct 2019 16:06:07 -0500 Subject: [PATCH] feat: update parameter names in recognize/synthesize streams to be lower camel case * this is to match the recent changes in the watson node sdk * `access_token` is renamed to `accessToken` in all modules --- CHANGELOG.md | 6 + examples/server.js | 4 +- examples/static/index.html | 2 +- examples/static/microphone-alternatives.html | 2 +- .../microphone-streaming-text-to-console.html | 2 +- .../static/microphone-word-confidence.html | 2 +- .../static/speaker-labels-file-console.html | 2 +- examples/static/speaker-stream-file-html.html | 2 +- package-lock.json | 413 +++++++++--------- package.json | 2 +- speech-to-text/get-models.js | 12 +- speech-to-text/recognize-file.js | 22 +- speech-to-text/recognize-microphone.js | 20 +- speech-to-text/recognize-stream.js | 153 +++---- test/resources/offline_test_server.js | 2 +- text-to-speech/get-voices.js | 10 +- text-to-speech/synthesize.js | 22 +- util/process-user-parameters.js | 41 ++ 18 files changed, 385 insertions(+), 334 deletions(-) create mode 100644 util/process-user-parameters.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fe7bdd1..9501ddc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### v0.37.0 +* BREAKING CHANGES INTRODUCED: + * All options parameters for all methods are coverted to be lowerCamelCase + * For example: `access_token` is now `accessToken` and `content-type` is now `contentType` + * Response data from the service is not affected by this change + ### v0.34.0 * Add support for guessing .mp3 (via file name & header) & .webm (via filename) content-types * Re-factored content-type guessing to check filename first, and file header second diff --git a/examples/server.js b/examples/server.js index 321b93cb..cc02ad00 100644 --- a/examples/server.js +++ b/examples/server.js @@ -94,7 +94,7 @@ app.use('/api/speech-to-text/token', function(req, res) { } const token = response.token || response; if (process.env.SPEECH_TO_TEXT_IAM_APIKEY) { - res.json({ access_token: token, url: sttCredentials.url }); + res.json({ accessToken: token, url: sttCredentials.url }); } else { res.json({ token: token, url: sttCredentials.url }); } @@ -121,7 +121,7 @@ app.use('/api/text-to-speech/token', function(req, res) { } const token = response.token || response; if (process.env.TEXT_TO_SPEECH_IAM_APIKEY) { - res.json({ access_token: token, url: ttsCredentials.url }); + res.json({ accessToken: token, url: ttsCredentials.url }); } else { res.json({ token: token, url: ttsCredentials.url }); } diff --git a/examples/static/index.html b/examples/static/index.html index a7805437..2c0389af 100644 --- a/examples/static/index.html +++ b/examples/static/index.html @@ -32,7 +32,7 @@

File Input