diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 09f6b698..00000000 --- a/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - [ "@babel/preset-env", - { - "targets": { - "edge": "17", - "firefox": "60", - "chrome": "67", - "safari": "11.1" - }, - "useBuiltIns": "usage", - "corejs": 3 - } - ] - ], - "sourceType": "unambiguous" -} diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 27056102..00000000 --- a/.editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -# EditorConfig http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true - -# Matches multiple files with brace expansion notation -# Set default charset -[*.{js,json,yml,html,htm}] -charset = utf-8 -indent_style = space -indent_size = 2 - - diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 7da88777..00000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -dist/ -doc/ \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index fdd0bf1f..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports = { - parser: 'esprima', - env: { - node: true, - browser: true, - }, - globals: { - // we want to enable a limited sub-set of ES6 features - // this library should (partially) work even in IE - // false meaning this code doesn't define it - Promise: false, - DataView: false, - ArrayBuffer: false, - Float32Array: false, - }, - plugins: ['prettier'], - extends: ['eslint:recommended', 'prettier'], - rules: { - 'no-var': 'off', - 'prefer-const': 'off', - 'prefer-rest-params': 'off', - 'prefer-spread': 'off', - }, -} diff --git a/.github/issue_template.md b/.github/issue_template.md deleted file mode 100644 index 7900f645..00000000 --- a/.github/issue_template.md +++ /dev/null @@ -1,8 +0,0 @@ -Remember, an issue is not the place to ask questions. You can use [Stack Overflow](http://stackoverflow.com/questions/tagged/ibm-watson-cognitive) for that, or you may want to start a discussion on the [dW Answers](https://developer.ibm.com/answers/questions/ask/?topics=watson). - -### When reporting a bug, please be sure to include the following: -- [ ] Steps to reproduce -- [ ] Expected behavior -- [ ] Actual behavior -- [ ] Browser version(s) -- [ ] SDK version diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index bccca28d..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,14 +0,0 @@ - - -##### Checklist - - -- [ ] `npm test` passes (tip: `npm run autofix` can correct most style issues) -- [ ] tests are included -- [ ] readme and/or JSDoc is updated diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index e3e4aac1..00000000 --- a/.github/stale.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: wontfix -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has had no - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.gitignore b/.gitignore index 9cdf3b12..404451b5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,15 +3,6 @@ node_modules/ npm-debug.log.* .DS_store Thumbs.db -test/resources/stt-auth.json -test/resources/tts-auth.json -doc/ -*-auth.json -.env -dist/*.js -dist/*.map -gh-pages/ -.idea -watson-speech-*.tgz -IBM_Cloud_CLI_0.6.6_amd64.tar.gz -Bluemix_CLI +test/resources/auth.json +examples/ +test/ diff --git a/.nojekyl b/.nojekyl new file mode 100644 index 00000000..e69de29b diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 84506553..00000000 --- a/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -doc/ -jsdoc/ -test/ -.editorconfig -.travis.yml -gh-pages/ -scripts/ -docs/ -.env -.github/ -CHANGELOG.md -bower.json -karma.conf.js -webpack.config.js -watson-speech-*.tgz diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 9845a1c0..00000000 --- a/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "trailingComma": "es5", - "tabWidth": 2, - "semi": true, - "singleQuote": true, - "arrowParens": "always", - "printWidth": 160 -} diff --git a/.releaserc b/.releaserc deleted file mode 100644 index fdd7967d..00000000 --- a/.releaserc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "branch": "master", - "publish": [ - "@semantic-release/npm", - { - "path": "@semantic-release/github", - "assets": [ - {"path": "dist/watson-speech.js", "label": "watson-speech.js"}, - {"path": "dist/watson-speech.min.js", "label": "watson-speech.min.js"}, - {"path": "dist/watson-speech.min.js.map", "label": "watson-speech.min.js.map"}, - ] - } - ] -} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dd23227e..00000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: node_js -node_js: - - "12" -sudo: required -services: - - xvfb -addons: - firefox: "latest" - chrome: "stable" -script: -- npm run build -- npm test -- sed -i "s/\/master\//\/$TRAVIS_BRANCH\//g" README.md -- npm run doc -after_success: -- scripts/jsdoc/publish.sh -env: - global: - - BX_APP=watson-speech - - BX_API=https://api.ng.bluemix.net - - BX_ORGANIZATION=WatsonPlatformServices - - BX_SPACE=sdks -before_deploy: npm install -g bx-blue-green -deploy: -- provider: script - skip_cleanup: true - script: npx semantic-release@15 - on: - node: 12 diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index e9354689..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,194 +0,0 @@ -# Changelog - -### v0.40.0 -* Update vulnerable dependencies -* feat(recognize-stream): add new websocket parameter character_insertion_bias - -### v0.39.1 -* Update vulnerable dependencies -* Update example dependencies (removed vulenerable express-browserify) - -### 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 -* Restore support for environments that pre-date Buffer.from() - -### v0.33.1 -* Remove continuous param -* Add support for vorbis, webm - -### v0.33.0 -* Send audio earlier - #26 -* Add customization support to STT synthesize() - -### v0.32.1 -* Fixed bower main file to be unminified instead of minified - -### v0.32.0 -* Added bower support -* Switched dist/ bundler from browserify to webpack (saves sevral hundred bytes) -* Added UMD support to dist scripts -* No internal changes - -### v0.31.0 -* Added support for a mediaStream argument to recognizeMicrophone() for advanced usages -* Fixed error message when source ends before WebSocket connection is opened. - -### v0.30.1 -* added recognizeMicrophone.isSupported flag (checks for getUserMedia, assumes other features will be there if that one is) - -### v0.29.1 -* Added setStartTime() method to TimingStream to facilitate syncing wit when files loaded via URL actually begin playing -* Updated recognizeFile() to automatically sync timing stream to playback - -### v0.29.0 -* BREAKING: recognizeFile()'s data option renamed to file -* File option may be a string URL. This enables streaming transcription/playback and mobile Safari support. -* Added support for 'X-Watson-Learning-Opt-Out' and 'accept' params in TTS synthesize() - -### v0.28.4 -* Prevent RecognizeStream from sending a blank content-type header - now emits an error if content-type is unset and unable to be automatically determined. - -### v0.28.3 -* Made SpeakerStream put keywords_result and word_alternatives on the correct result - -### v0.28.2 -* Fix regression introduced in v0.23 with playback-error change - transcription now continues after a playback error. - -### v0.28.0 -* Significantly simplified TimingStream, fixing one bug in the process - -### v0.27.2 -* stream from recognizeMicrophone emits an `end` event when microphone access is not avaliable - -### v0.27.0 -* TimingStream rewrite - now emits exact results received from the service, always in the exact order recieved - * old version created extra interim results and could emit speaker_labels before their matching final result in certain circumstances - * emitAt now defaults to END to allow for interim results even when final is cached -* SpeakerStream now emits keywords, alternatives, etc, although sometimes on a slightly earlier result then where the word is mentioned -* SpeakerStream now gracefully handles situations where labels arrive before the matching final result - -### v0.26.0 -* Renamed RecognizeStream 'connect' event to 'open' to match 'close' event -* Removed deprecated connection-close event -* Corrected deprecation notices for unsupported events (results, result, speaker_labels, connect, connection-close) -* Tweaked error handling to still fire `end` event when possible -* FormatStream: Changed default %HESITATION replacement from '\u2026' (ellipse - ...) to '' -* FormatStream: add space to end of interim transcripts to match service behavior -* SpeakerStream: add speakerlessInterim option to allow faster UI updating - -### v0.25.1 -* Workaround for browser bug that was breaking automatic content-type detection in certain cases - -### v0.25.0 -* Fixed bug with recognizeStream failing to auto-detect content-type -* RecognizeStream no longer sets any default options -* recognizeMicrophone() and recognizeFile() methods now do set default options that were previously set by RecognizeStream -* added new 'message' event to RecognizeStream that emits any message received over the WebSocket (mainly for debugging and demo usage) -* exposed recognizeStream property on any stream returned from recognizeMicrophone() or recognizeFile() (for debugging) - -### v0.24.0 -* Renamed `ResultExtractor` to `ResultStream`, exposed it in speech-to-text/index.js -* Added new SpeakerStream class to split results by speaker -* Added new `resultsBySpeaker` option to `recognizeFile()` and `recognizeMicrophone()` to enable SpeakerStream -* Fixed a bug in TimingStream where result_indexes would be lost (introduced in v0.22.0) - -### v0.23.0 -* Changed file player error.name from `UNRECOGNIZED_FORMAT` to `UNSUPPORTED_FORMAT` - (There are now two potential errors with this name: the file is recognized but the browser cannot play it, and the file type is not recognized.) -* Changed the `playback-error` event to just `error` -* Automatically stop file playback in the event of a RecognizeStream error - -### v0.22.0 -* Breaking: RecognizeStream now emits the original JSON message rather than the extracted results objects. -* New ResultExtractor stream that can provide the old behavior -* New `extract_results` option on recogniseFile/Microphone enables this. -* Removed deprecated `result` and `results` events from RecognizeStream. -* Removed `receive-json` event from RecognizeStream because it now duplicates the behavior of the `data` event. -* Added support for `speaker_labels` option in RecognizeStream, updated other streams to handle speaker_labels correctly -* Added a simple speaker_labels stream-to-console example -* Added support for ` X-Watson-Learning-Opt-Out` option in RecognizeStream - -### v0.21.0 -* Made FormatStream formatting methods available outside of streaming interface - -### v0.20.4 -* Fix looping error propagation when not using FormatStream in recognizeMicrophone - -### v0.20.3 -* Fixed broken model query param in STT RecognizeStream - -### v0.20.2 -* Fixed bug where errors were not propagated to final stream (#10) -* Fixed bug where RecognizeStream could attempt to send data on non-open WebSocket (#17) - -### v0.20.1 -* Fixed bug with ellipses at the ends of sentences - -### v0.20 -* Documented RecognizeStream's options.token -* Added support for customization_id in SDK (not yet supported in public STT service) - -### v0.19 -* Added support for STT's `smart_formatting` option - -### v0.17 -* Enabled interim_results by default for text mode because the service now buffers final results until the end otherwise. - (They are not emitted in text mode, just used for the side effect of faster final results.) -* Added examples to log data to console in text and object modes -* Fixed a couple of bugs in .stop() behavior - -### v0.16 -* Added STT.getModels() method to fetch the list of available voice models -* Added support for STT profanity_filter & documented keywords and words_alternatives options - -### v0.15 -* Removed `SpeechToText.recognizeElement()` due to quality issues -* Added `options.element` to TextToSpeech.synthesize() to support playing through exiting elements -* Fixed a couple of bugs in the TimingStream - -### v0.14 -* Moved getUserMedia shim to a [standalone library](https://www.npmjs.com/package/get-user-media-promise) -* added a python token server example - -### v0.13 -* Fixed bug where `continuous: false` didn't close the microphone at end of recognition -* Added `keepMic` option to `recognizeMicrophone()` to prevent multiple permission popups in firefox - -### v0.12 -* Added `autoPlay` option to `synthesize()` -* Added proper parameter filtering to `synthesize()` - -### v0.11 -* renamed `recognizeBlob` to `recognizeFile` to make the primary usage more apparent -* Added support for `` and `