From 79117020c098a06fce8cd6a26602597be8a5f53a Mon Sep 17 00:00:00 2001 From: Yuriy Dybskiy Date: Mon, 3 Jun 2019 10:29:53 -0400 Subject: [PATCH] Readme update (#10) * Update package.json * Update README * Update package.json, fix standard issues in server.js * Update readme with a note on ngrok * Update readme and package.json * Update readme * Add app.json * Update readme * Add deploy to Heroku button * Update to use env private.key * Add Dockerfile * Cleaned up server code Moved to express, removed front end demo code. * Updates for heroku deployments * updates to readme --- .env | 9 - .gitignore | 5 +- Dockerfile | 13 + Files/dummy | 1 - Procfile | 1 + README.md | 124 ++- app.json | 54 ++ docker-compose.yml | 10 + example.env | 10 +- index.html | 156 --- langs.json | 596 ------------ ncco_input.json | 11 - ncco_websocket.json | 20 - package-lock.json | 2197 ------------------------------------------- package.json | 10 +- server.js | 317 ++----- 16 files changed, 260 insertions(+), 3274 deletions(-) delete mode 100644 .env create mode 100644 Dockerfile delete mode 100644 Files/dummy create mode 100644 Procfile create mode 100644 app.json create mode 100644 docker-compose.yml delete mode 100644 index.html delete mode 100644 langs.json delete mode 100644 ncco_input.json delete mode 100644 ncco_websocket.json delete mode 100644 package-lock.json diff --git a/.env b/.env deleted file mode 100644 index 34ff448..0000000 --- a/.env +++ /dev/null @@ -1,9 +0,0 @@ -# Hostname where you are running the webserver listening on port 8000 -HOSTNAME="example.ngrok.io" - -# Hostname where you are running the webserver listening on port 8001 -WSHOSTNAME="example-socket.ngrok.io" - -GOOGLE_APPLICATION_CREDENTIALS=./google_creds.json - -APP_ID="aaaaaaaa-bbbb-cccc-dddd-0123456789ab" diff --git a/.gitignore b/.gitignore index c5a2e28..6ae9ad9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ google_creds.json +.env files/* private.key -.env -node_modules* \ No newline at end of file +node_modules* +package-lock.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9457a76 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:11-alpine + +EXPOSE 8000 +WORKDIR /usr/src/ + +COPY ./package.json ./ +RUN npm install + +ENV PATH /usr/src/node_modules/.bin:$PATH + +COPY . . + +CMD ["npm", "start"] diff --git a/Files/dummy b/Files/dummy deleted file mode 100644 index be9bd12..0000000 --- a/Files/dummy +++ /dev/null @@ -1 +0,0 @@ -ignore diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..4ad56ea --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: node ./server diff --git a/README.md b/README.md index 6a3572b..8b74237 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,111 @@ -# Google Cloud Speech Transcription Demo +# Nexmo + Google Cloud Speech Transcription Demo +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://nexmo.dev/google-nexmo-speechtotext-heroku) -This is a demo applicaiton of using Google Cloud Speech API with Nexmo Websockets to perform realtime transcription in multiple languages. +You can use this code as a base for doing real time transcription of a phone call using Google Speech to Text API. -## Google Cloud Speech API -You'll need to signup for the Speech API as part of Google Cloud, start here https://console.cloud.google.com/launcher/details/google/speech.googleapis.com +An audio stream is sent via websocket connection to your server and then relayed to the Google streaming interface. Speech recognition is performed and the text returned to the console. +<<<<<<< HEAD -### Prerequisites -The application is built in node you will need the following packages: -* dotenv -* websocket -* httpdispatcher -* url -* @google-cloud/speech -* nexmo -These are all specified in the `package.json` +## Google Speech to Text API +You will need to set up a [Google Cloud project and service account](https://cloud.google.com/speech-to-text/docs/quickstart-client-libraries). Once these steps are completed, you will have a downloaded JSON file to set up the rest of the project. You will need this file prior to using the `Deploy to Heroku` button. If you plan on running this locally, make sure this file is saved in the project folder. -Once you have enabled the API you'll need to create a project and get a set of credentials, these will be downloaded as a JSON file, save that file as `google_creds.json` in this project. +## Running the App -## Nexmo -You will need to create a Nexmo Voice Applicaiton with the answer url set to `[YOURHOSTNAME]/ncco` and optionally the event URL set to `[YOURHOSTNAME]/event` -You then need to purchase a number and link that to the applicaiton, you can edit the number that is displayed on the webpage in `index.html` to match your number. +### Running on Heroku +In order to run this on Heroku, you will need to gather the following information: -## Configuration -Apart from the Google credentials the only other parameter to configure is the hostname(s) The server needs to listen on 2 separate TCP ports to expose a websocket server for the browser and for the nexmo voice API to connect to, the defaults for this are port 8000 and port 8001. -Almost everything is on port 8000 apart from the nexmo websocket connection which uses 8001, you can either run this server using ngrok and your local machine then expose each of the 2 ports under different hostnames or use the same hostname for the machine and just put `:8000` & `:8001` on the end of the hostnames. -These are configured in the `.env` file. +1. `API_KEY` - This is the API key from your Nexmo Account. +1. `API_SECRET` - This is the API secret from your Nexmo Account. +1. `GOOGLE_CLIENT_EMAIL` - You can find this in the `google_creds.json` file as `client_email` +1. `GOOGLE_PRIVATE_KEY` - You can find this in the `google_creds.json` file as `private_key`. + 1. Be sure to select everything as `-----BEGIN PRIVATE KEY-----\nXXXXXXXXX\n-----END PRIVATE KEY-----\n` +This will create a new Nexmo application and phone number to begin testing with. View the logs to see the transcription response from the service. You can do this in the Heroku dashboard, or with the Heroku CLI using `heroku logs -t`. -## Running -To start the server execute `node ./server.js` -You can then browse to the root of your hostname and the page should be served, call the number linked to your applicaiton, enter the language code you want to test (e.g. 16 for UK English) and once the language has been confirmed to you start talking. You will see transcription on the right hand side of the page. +### Linking the app to Nexmo +You will need to create a new Nexmo application in order to work with this app: +#### Create a Nexmo Application Using the Command Line Interface + +Install the CLI by following [these instructions](https://github.com/Nexmo/nexmo-cli#installation). Then create a new Nexmo application that also sets up your `answer_url` and `event_url` for the app running locally on your machine. + +``` +nexmo app:create google-speech-to-text http:///ncco http:///event +``` + +This will return an application ID. Make a note of it. + +#### Buy a New Virtual Number +If you don't have a number already in place, you will need to buy one. This can also be achieved using the CLI by running this command: + +``` +nexmo number:buy +``` + +#### Link the Virtual Number to the Application +Finally, link your new number to the application you created by running: + +``` +nexmo link:app YOUR_NUMBER YOUR_APPLICATION_ID +``` + +### Local Install + +To run this on your machine you'll need an up-to-date version of Node. + +Start by installing the dependencies with: + +``` +npm install +``` + +Then copy the example.env file to a new file called .env: + +``` +cp .env.example > .env +``` + +Edit the .env file to add in your application ID and the location of the credentials file from Google. + +```yaml +GOOGLE_APPLICATION_CREDENTIALS=./google_creds.json +APP_ID="12345678-aaaa-bbbb-4321-1234567890ab" +LANG_CODE="en-US" +``` + +Tools like [ngrok](https://ngrok.com/) are great for exposing ports on your local machine to the internet. If you haven't done this before, [check out this guide](https://www.nexmo.com/blog/2017/07/04/local-development-nexmo-ngrok-tunnel-dr/). + +If you aren't going to be working in the en-US language then you can change the language to any of the other supported languages listed in the [Google Speech to Text API documentation](https://cloud.google.com/speech-to-text/docs/languages). + +### Using Docker +To run the app using Docker run the following command in your terminal: + +``` +docker-compose up +``` + +This will create a new image with all the dependencies and run it at http://localhost:3000. +======= + +For google +Create or select a project. https://console.cloud.google.com/project +Enable the Google Speech-to-Text API for that project. https://console.cloud.google.com/flows/enableapi?apiid=speech.googleapis.com +Create a service account. +Download a private key as JSON. + +Deploy to Heroku + +Get the nexmo api key and secret +Buildpack will create an app and a number for you + +Running locally +You will need to create an app and get a number + +with docker compose + +using a tunnel + +## Prerequisites +>>>>>>> cff1bc0... updates for readme changes diff --git a/app.json b/app.json new file mode 100644 index 0000000..31821ad --- /dev/null +++ b/app.json @@ -0,0 +1,54 @@ +{ + "name": "Nexmo + Google Cloud Speech", + "description": "Demo applicaiton of using Google Cloud Speech API with Nexmo Websockets to perform realtime transcription in multiple languages.", + "repository": "https://github.com/nexmo-community/voice-google-speechtotext", + "keywords": ["node", "nexmo", "google cloud", "gcp", "text to speech"], + "env": { + "NAME": { + "description": "The Heroku app name." + }, + "CREATE_NEXMO_APP": { + "description": "Should the application automatically create a Nexmo application and purchase a new phone number", + "value": "yes" + }, + "API_KEY": { + "description": "Your Nexmo API Key", + "value": "", + "required" : true + }, + "API_SECRET": { + "description": "Your Nexmo API Secret", + "value": "", + "required" : true + }, + "CC": { + "description": "The ISO 3361 Country Code where you want the number to be purchased eg, US, GB, ES etc.", + "value": "US", + "required" : true + }, + "GOOGLE_CLIENT_EMAIL": { + "description": "The client_email property from your google_creds.json file.", + "value": "service_account_name@project.iam.gserviceaccount.com", + "required" : true + }, + "GOOGLE_PRIVATE_KEY": { + "description": "The private_key property from your google_creds.json file. Make sure to copy and paste everything here.", + "value": "-----BEGIN PRIVATE KEY-----", + "required" : true + } + }, + "buildpacks": [ + { + "url": "https://github.com/nexmo-community/heroku-buildpack-voice" + }, + { + "url": "heroku/node" + } + ], + "formation": { + "web": { + "quantity": 1, + "size": "free" + } + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..682adf1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.7' +services: + voice-google: + build: . + env_file: .env + ports: + - 8000:8000 + volumes: + - ./:/usr/src + - ./node_modules:/usr/src/node_modules diff --git a/example.env b/example.env index 33ebe47..2d35e67 100644 --- a/example.env +++ b/example.env @@ -1,9 +1,3 @@ -# Hostname where you are running the webserver listening on port 8000 -HOSTNAME="example.ngrok.io" - -# Hostname where you are running the webserver listening on port 8001 -WSHOSTNAME="examplews.ngrok.io" - GOOGLE_APPLICATION_CREDENTIALS=./google_creds.json - -APP_ID="12345678-aaaa-bbbb-4321-1234567890ab" \ No newline at end of file +APP_ID="12345678-aaaa-bbbb-4321-1234567890ab" +LANG_CODE="en-US" diff --git a/index.html b/index.html deleted file mode 100644 index 86f58a9..0000000 --- a/index.html +++ /dev/null @@ -1,156 +0,0 @@ - - - -Google Cloud Speech Transcription - - - - - - - -
-
-
-

- Call 020 7946 1234 -

-

- Demo application of Google Cloud Speech recognition -

-
-
-
- -
-
-
- -
- -
- -
-
-
- - - - - - - - diff --git a/langs.json b/langs.json deleted file mode 100644 index cd1031f..0000000 --- a/langs.json +++ /dev/null @@ -1,596 +0,0 @@ -[{ - "Language": "Afrikaans (Suid-Afrika)", - "languageCode": "af-ZA", - "languageName": "Afrikaans (South Africa)", - "languageID": "1" -}, { - "Language": "አማርኛ (ኢትዮጵያ)", - "languageCode": "am-ET", - "languageName": "Amharic (Ethiopia)", - "languageID": "2" -}, { - "Language": "Հայ (Հայաստան)", - "languageCode": "hy-AM", - "languageName": "Armenian (Armenia)", - "languageID": "3" -}, { - "Language": "Azərbaycan (Azərbaycan)", - "languageCode": "az-AZ", - "languageName": "Azerbaijani (Azerbaijan)", - "languageID": "4" -}, { - "Language": "Bahasa Indonesia (Indonesia)", - "languageCode": "id-ID", - "languageName": "Indonesian (Indonesia)", - "languageID": "5" -}, { - "Language": "Bahasa Melayu (Malaysia)", - "languageCode": "ms-MY", - "languageName": "Malay (Malaysia)", - "languageID": "6" -}, { - "Language": "বাংলা (বাংলাদেশ)", - "languageCode": "bn-BD", - "languageName": "Bengali (Bangladesh)", - "languageID": "7" -}, { - "Language": "বাংলা (ভারত)", - "languageCode": "bn-IN", - "languageName": "Bengali (India)", - "languageID": "8" -}, { - "Language": "Català (Espanya)", - "languageCode": "ca-ES", - "languageName": "Catalan (Spain)", - "languageID": "9" -}, { - "Language": "Čeština (Česká republika)", - "languageCode": "cs-CZ", - "languageName": "Czech (Czech Republic)", - "languageID": "10" -}, { - "Language": "Dansk (Danmark)", - "languageCode": "da-DK", - "languageName": "Danish (Denmark)", - "languageID": "11" -}, { - "Language": "Deutsch (Deutschland)", - "languageCode": "de-DE", - "languageName": "German (Germany)", - "languageID": "12" -}, { - "Language": "English (Australia)", - "languageCode": "en-AU", - "languageName": "English (Australia)", - "languageID": "13" -}, { - "Language": "English (Canada)", - "languageCode": "en-CA", - "languageName": "English (Canada)", - "languageID": "14" -}, { - "Language": "English (Ghana)", - "languageCode": "en-GH", - "languageName": "English (Ghana)", - "languageID": "15" -}, { - "Language": "English (Great Britain)", - "languageCode": "en-GB", - "languageName": "English (United Kingdom)", - "languageID": "16" -}, { - "Language": "English (India)", - "languageCode": "en-IN", - "languageName": "English (India)", - "languageID": "17" -}, { - "Language": "English (Ireland)", - "languageCode": "en-IE", - "languageName": "English (Ireland)", - "languageID": "18" -}, { - "Language": "English (Kenya)", - "languageCode": "en-KE", - "languageName": "English (Kenya)", - "languageID": "19" -}, { - "Language": "English (New Zealand)", - "languageCode": "en-NZ", - "languageName": "English (New Zealand)", - "languageID": "20" -}, { - "Language": "English (Nigeria)", - "languageCode": "en-NG", - "languageName": "English (Nigeria)", - "languageID": "21" -}, { - "Language": "English (Philippines)", - "languageCode": "en-PH", - "languageName": "English (Philippines)", - "languageID": "22" -}, { - "Language": "English (South Africa)", - "languageCode": "en-ZA", - "languageName": "English (South Africa)", - "languageID": "23" -}, { - "Language": "English (Tanzania)", - "languageCode": "en-TZ", - "languageName": "English (Tanzania)", - "languageID": "24" -}, { - "Language": "English (United States)", - "languageCode": "en-US", - "languageName": "English (United States)", - "languageID": "25" -}, { - "Language": "Español (Argentina)", - "languageCode": "es-AR", - "languageName": "Spanish (Argentina)", - "languageID": "26" -}, { - "Language": "Español (Bolivia)", - "languageCode": "es-BO", - "languageName": "Spanish (Bolivia)", - "languageID": "27" -}, { - "Language": "Español (Chile)", - "languageCode": "es-CL", - "languageName": "Spanish (Chile)", - "languageID": "28" -}, { - "Language": "Español (Colombia)", - "languageCode": "es-CO", - "languageName": "Spanish (Colombia)", - "languageID": "29" -}, { - "Language": "Español (Costa Rica)", - "languageCode": "es-CR", - "languageName": "Spanish (Costa Rica)", - "languageID": "30" -}, { - "Language": "Español (Ecuador)", - "languageCode": "es-EC", - "languageName": "Spanish (Ecuador)", - "languageID": "31" -}, { - "Language": "Español (El Salvador)", - "languageCode": "es-SV", - "languageName": "Spanish (El Salvador)", - "languageID": "32" -}, { - "Language": "Español (España)", - "languageCode": "es-ES", - "languageName": "Spanish (Spain)", - "languageID": "33" -}, { - "Language": "Español (Estados Unidos)", - "languageCode": "es-US", - "languageName": "Spanish (United States)", - "languageID": "34" -}, { - "Language": "Español (Guatemala)", - "languageCode": "es-GT", - "languageName": "Spanish (Guatemala)", - "languageID": "35" -}, { - "Language": "Español (Honduras)", - "languageCode": "es-HN", - "languageName": "Spanish (Honduras)", - "languageID": "36" -}, { - "Language": "Español (México)", - "languageCode": "es-MX", - "languageName": "Spanish (Mexico)", - "languageID": "37" -}, { - "Language": "Español (Nicaragua)", - "languageCode": "es-NI", - "languageName": "Spanish (Nicaragua)", - "languageID": "38" -}, { - "Language": "Español (Panamá)", - "languageCode": "es-PA", - "languageName": "Spanish (Panama)", - "languageID": "39" -}, { - "Language": "Español (Paraguay)", - "languageCode": "es-PY", - "languageName": "Spanish (Paraguay)", - "languageID": "40" -}, { - "Language": "Español (Perú)", - "languageCode": "es-PE", - "languageName": "Spanish (Peru)", - "languageID": "41" -}, { - "Language": "Español (Puerto Rico)", - "languageCode": "es-PR", - "languageName": "Spanish (Puerto Rico)", - "languageID": "42" -}, { - "Language": "Español (República Dominicana)", - "languageCode": "es-DO", - "languageName": "Spanish (Dominican Republic)", - "languageID": "43" -}, { - "Language": "Español (Uruguay)", - "languageCode": "es-UY", - "languageName": "Spanish (Uruguay)", - "languageID": "44" -}, { - "Language": "Español (Venezuela)", - "languageCode": "es-VE", - "languageName": "Spanish (Venezuela)", - "languageID": "45" -}, { - "Language": "Euskara (Espainia)", - "languageCode": "eu-ES", - "languageName": "Basque (Spain)", - "languageID": "46" -}, { - "Language": "Filipino (Pilipinas)", - "languageCode": "fil-PH", - "languageName": "Filipino (Philippines)", - "languageID": "47" -}, { - "Language": "Français (Canada)", - "languageCode": "fr-CA", - "languageName": "French (Canada)", - "languageID": "48" -}, { - "Language": "Français (France)", - "languageCode": "fr-FR", - "languageName": "French (France)", - "languageID": "49" -}, { - "Language": "Galego (España)", - "languageCode": "gl-ES", - "languageName": "Galician (Spain)", - "languageID": "50" -}, { - "Language": "ქართული (საქართველო)", - "languageCode": "ka-GE", - "languageName": "Georgian (Georgia)", - "languageID": "51" -}, { - "Language": "ગુજરાતી (ભારત)", - "languageCode": "gu-IN", - "languageName": "Gujarati (India)", - "languageID": "52" -}, { - "Language": "Hrvatski (Hrvatska)", - "languageCode": "hr-HR", - "languageName": "Croatian (Croatia)", - "languageID": "53" -}, { - "Language": "IsiZulu (Ningizimu Afrika)", - "languageCode": "zu-ZA", - "languageName": "Zulu (South Africa)", - "languageID": "54" -}, { - "Language": "Íslenska (Ísland)", - "languageCode": "is-IS", - "languageName": "Icelandic (Iceland)", - "languageID": "55" -}, { - "Language": "Italiano (Italia)", - "languageCode": "it-IT", - "languageName": "Italian (Italy)", - "languageID": "56" -}, { - "Language": "Jawa (Indonesia)", - "languageCode": "jv-ID", - "languageName": "Javanese (Indonesia)", - "languageID": "57" -}, { - "Language": "ಕನ್ನಡ (ಭಾರತ)", - "languageCode": "kn-IN", - "languageName": "Kannada (India)", - "languageID": "58" -}, { - "Language": "ភាសាខ្មែរ (កម្ពុជា)", - "languageCode": "km-KH", - "languageName": "Khmer (Cambodia)", - "languageID": "59" -}, { - "Language": "ລາວ (ລາວ)", - "languageCode": "lo-LA", - "languageName": "Lao (Laos)", - "languageID": "60" -}, { - "Language": "Latviešu (latviešu)", - "languageCode": "lv-LV", - "languageName": "Latvian (Latvia)", - "languageID": "61" -}, { - "Language": "Lietuvių (Lietuva)", - "languageCode": "lt-LT", - "languageName": "Lithuanian (Lithuania)", - "languageID": "62" -}, { - "Language": "Magyar (Magyarország)", - "languageCode": "hu-HU", - "languageName": "Hungarian (Hungary)", - "languageID": "63" -}, { - "Language": "മലയാളം (ഇന്ത്യ)", - "languageCode": "ml-IN", - "languageName": "Malayalam (India)", - "languageID": "64" -}, { - "Language": "मराठी (भारत)", - "languageCode": "mr-IN", - "languageName": "Marathi (India)", - "languageID": "65" -}, { - "Language": "Nederlands (Nederland)", - "languageCode": "nl-NL", - "languageName": "Dutch (Netherlands)", - "languageID": "66" -}, { - "Language": "नेपाली (नेपाल)", - "languageCode": "ne-NP", - "languageName": "Nepali (Nepal)", - "languageID": "67" -}, { - "Language": "Norsk bokmål (Norge)", - "languageCode": "nb-NO", - "languageName": "Norwegian Bokmål (Norway)", - "languageID": "68" -}, { - "Language": "Polski (Polska)", - "languageCode": "pl-PL", - "languageName": "Polish (Poland)", - "languageID": "69" -}, { - "Language": "Português (Brasil)", - "languageCode": "pt-BR", - "languageName": "Portuguese (Brazil)", - "languageID": "70" -}, { - "Language": "Português (Portugal)", - "languageCode": "pt-PT", - "languageName": "Portuguese (Portugal)", - "languageID": "71" -}, { - "Language": "Română (România)", - "languageCode": "ro-RO", - "languageName": "Romanian (Romania)", - "languageID": "72" -}, { - "Language": "සිංහල (ශ්රී ලංකාව)", - "languageCode": "si-LK", - "languageName": "Sinhala (Srilanka)", - "languageID": "73" -}, { - "Language": "Slovenčina (Slovensko)", - "languageCode": "sk-SK", - "languageName": "Slovak (Slovakia)", - "languageID": "74" -}, { - "Language": "Slovenščina (Slovenija)", - "languageCode": "sl-SI", - "languageName": "Slovenian (Slovenia)", - "languageID": "75" -}, { - "Language": "Urang (Indonesia)", - "languageCode": "su-ID", - "languageName": "Sundanese (Indonesia)", - "languageID": "76" -}, { - "Language": "Swahili (Tanzania)", - "languageCode": "sw-TZ", - "languageName": "Swahili (Tanzania)", - "languageID": "77" -}, { - "Language": "Swahili (Kenya)", - "languageCode": "sw-KE", - "languageName": "Swahili (Kenya)", - "languageID": "78" -}, { - "Language": "Suomi (Suomi)", - "languageCode": "fi-FI", - "languageName": "Finnish (Finland)", - "languageID": "79" -}, { - "Language": "Svenska (Sverige)", - "languageCode": "sv-SE", - "languageName": "Swedish (Sweden)", - "languageID": "80" -}, { - "Language": "தமிழ் (இந்தியா)", - "languageCode": "ta-IN", - "languageName": "Tamil (India)", - "languageID": "81" -}, { - "Language": "தமிழ் (சிங்கப்பூர்)", - "languageCode": "ta-SG", - "languageName": "Tamil (Singapore)", - "languageID": "82" -}, { - "Language": "தமிழ் (இலங்கை)", - "languageCode": "ta-LK", - "languageName": "Tamil (Sri Lanka)", - "languageID": "83" -}, { - "Language": "தமிழ் (மலேசியா)", - "languageCode": "ta-MY", - "languageName": "Tamil (Malaysia)", - "languageID": "84" -}, { - "Language": "తెలుగు (భారతదేశం)", - "languageCode": "te-IN", - "languageName": "Telugu (India)", - "languageID": "85" -}, { - "Language": "Tiếng Việt (Việt Nam)", - "languageCode": "vi-VN", - "languageName": "Vietnamese (Vietnam)", - "languageID": "86" -}, { - "Language": "Türkçe (Türkiye)", - "languageCode": "tr-TR", - "languageName": "Turkish (Turkey)", - "languageID": "87" -}, { - "Language": "اردو (پاکستان)", - "languageCode": "ur-PK", - "languageName": "Urdu (Pakistan)", - "languageID": "88" -}, { - "Language": "اردو (بھارت)", - "languageCode": "ur-IN", - "languageName": "Urdu (India)", - "languageID": "89" -}, { - "Language": "Ελληνικά (Ελλάδα)", - "languageCode": "el-GR", - "languageName": "Greek (Greece)", - "languageID": "90" -}, { - "Language": "Български (България)", - "languageCode": "bg-BG", - "languageName": "Bulgarian (Bulgaria)", - "languageID": "91" -}, { - "Language": "Русский (Россия)", - "languageCode": "ru-RU", - "languageName": "Russian (Russia)", - "languageID": "92" -}, { - "Language": "Српски (Србија)", - "languageCode": "sr-RS", - "languageName": "Serbian (Serbia)", - "languageID": "93" -}, { - "Language": "Українська (Україна)", - "languageCode": "uk-UA", - "languageName": "Ukrainian (Ukraine)", - "languageID": "94" -}, { - "Language": "עברית (ישראל)", - "languageCode": "he-IL", - "languageName": "Hebrew (Israel)", - "languageID": "95" -}, { - "Language": "العربية (إسرائيل)", - "languageCode": "ar-IL", - "languageName": "Arabic (Israel)", - "languageID": "96" -}, { - "Language": "العربية (الأردن)", - "languageCode": "ar-JO", - "languageName": "Arabic (Jordan)", - "languageID": "97" -}, { - "Language": "العربية (الإمارات)", - "languageCode": "ar-AE", - "languageName": "Arabic (United Arab Emirates)", - "languageID": "98" -}, { - "Language": "العربية (البحرين)", - "languageCode": "ar-BH", - "languageName": "Arabic (Bahrain)", - "languageID": "99" -}, { - "Language": "العربية (الجزائر)", - "languageCode": "ar-DZ", - "languageName": "Arabic (Algeria)", - "languageID": "100" -}, { - "Language": "العربية (السعودية)", - "languageCode": "ar-SA", - "languageName": "Arabic (Saudi Arabia)", - "languageID": "101" -}, { - "Language": "العربية (العراق)", - "languageCode": "ar-IQ", - "languageName": "Arabic (Iraq)", - "languageID": "102" -}, { - "Language": "العربية (الكويت)", - "languageCode": "ar-KW", - "languageName": "Arabic (Kuwait)", - "languageID": "103" -}, { - "Language": "العربية (المغرب)", - "languageCode": "ar-MA", - "languageName": "Arabic (Morocco)", - "languageID": "104" -}, { - "Language": "العربية (تونس)", - "languageCode": "ar-TN", - "languageName": "Arabic (Tunisia)", - "languageID": "105" -}, { - "Language": "العربية (عُمان)", - "languageCode": "ar-OM", - "languageName": "Arabic (Oman)", - "languageID": "106" -}, { - "Language": "العربية (فلسطين)", - "languageCode": "ar-PS", - "languageName": "Arabic (State of Palestine)", - "languageID": "107" -}, { - "Language": "العربية (قطر)", - "languageCode": "ar-QA", - "languageName": "Arabic (Qatar)", - "languageID": "108" -}, { - "Language": "العربية (لبنان)", - "languageCode": "ar-LB", - "languageName": "Arabic (Lebanon)", - "languageID": "109" -}, { - "Language": "العربية (مصر)", - "languageCode": "ar-EG", - "languageName": "Arabic (Egypt)", - "languageID": "110" -}, { - "Language": "فارسی (ایران)", - "languageCode": "fa-IR", - "languageName": "Persian (Iran)", - "languageID": "111" -}, { - "Language": "हिन्दी (भारत)", - "languageCode": "hi-IN", - "languageName": "Hindi (India)", - "languageID": "112" -}, { - "Language": "ไทย (ประเทศไทย)", - "languageCode": "th-TH", - "languageName": "Thai (Thailand)", - "languageID": "113" -}, { - "Language": "한국어 (대한민국)", - "languageCode": "ko-KR", - "languageName": "Korean (South Korea)", - "languageID": "114" -}, { - "Language": "國語 (台灣)", - "languageCode": "cmn-Hant-TW", - "languageName": "Chinese Mandarin(Traditional - Taiwan)", - "languageID": "115" -}, { - "Language": "廣東話 (香港)", - "languageCode": "yue-Hant-HK", - "languageName": "Chinese Cantonese(Traditional - Hong Kong)", - "languageID": "116" -}, { - "Language": "日本語(日本)", - "languageCode": "ja-JP", - "languageName": "Japanese (Japan)", - "languageID": "117" -}, { - "Language": "普通話 (香港)", - "languageCode": "cmn-Hans-HK", - "languageName": "Chinese Mandarin(Simplified - Hong Kong)", - "languageID": "118" -}, { - "Language": "普通话 (中国大陆)", - "languageCode": "cmn-Hans-CN", - "languageName": "Chinese Mandarin(Simplified - China)", - "languageID": "119" -}] \ No newline at end of file diff --git a/ncco_input.json b/ncco_input.json deleted file mode 100644 index 1ad47d0..0000000 --- a/ncco_input.json +++ /dev/null @@ -1,11 +0,0 @@ -[{ - "action" : "talk", - "text" : "Please enter your language code followed by the hash key", - "bargeIn": true -}, -{ - "action": "input", - "timeOut": 20, - "submitOnHash": true, - "eventUrl": [] -}] \ No newline at end of file diff --git a/ncco_websocket.json b/ncco_websocket.json deleted file mode 100644 index df89f1a..0000000 --- a/ncco_websocket.json +++ /dev/null @@ -1,20 +0,0 @@ -[ { - "action" : "record", - "format" : "wav", - "eventUrl": [] - }, - { - "action" : "talk" - }, - { - "action": "connect", - "endpoint": [ - { - "type": "websocket", - "content-type": "audio/l16;rate=16000", - "headers": { - } - } - ] - } -] diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 58fc678..0000000 --- a/package-lock.json +++ /dev/null @@ -1,2197 +0,0 @@ -{ - "name": "voice-google-speechtotext", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@google-cloud/speech": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@google-cloud/speech/-/speech-1.1.0.tgz", - "integrity": "sha512-a6Nb8ly2yAWeTrGiKFaEdCW+ghxYa0Nb/atRJq52zu6GmwSkMwUOO2vf8FQRQBWGqMwdRx+ayHHeQR8L2s+ucg==", - "requires": { - "extend": "3.0.1", - "google-gax": "0.14.5", - "google-proto-files": "0.15.0", - "lodash.merge": "4.6.1", - "protobufjs": "6.8.4", - "pumpify": "1.4.0", - "stream-events": "1.0.2", - "through2": "2.0.3" - } - }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "1.1.2", - "@protobufjs/inquire": "1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "@types/long": { - "version": "3.0.32", - "resolved": "https://registry.npmjs.org/@types/long/-/long-3.0.32.tgz", - "integrity": "sha512-ZXyOOm83p7X8p3s0IYM3VeueNmHpkk/yMlP8CLeOnEcu6hIwPH7YjZBvhQkR0ZFS2DqZAxKtJ/M5fcuv3OU5BA==" - }, - "@types/node": { - "version": "8.9.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.9.3.tgz", - "integrity": "sha512-wqrPE4Uvj2fmL0E5JFQiY7D/5bAKvVUfWTnQ5NEV35ULkAU0j3QuqIi9Qyrytz8M5hsrh8Kijt+FsdLQaZR+IA==" - }, - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" - }, - "acorn-es7-plugin": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", - "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=" - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.0.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "arguejs": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/arguejs/-/arguejs-0.2.3.tgz", - "integrity": "sha1-tvk59f4OPNHz+T4qqSYkJL8xKvc=" - }, - "array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=" - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "requires": { - "array-uniq": "1.0.3" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" - }, - "ascli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", - "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", - "requires": { - "colour": "0.7.1", - "optjs": "3.2.2" - } - }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", - "requires": { - "lodash": "4.17.5" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base64url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", - "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "requires": { - "hoek": "4.2.0" - }, - "dependencies": { - "hoek": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", - "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" - }, - "bytebuffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", - "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", - "requires": { - "long": "3.2.0" - } - }, - "call-signature": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", - "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=" - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "colour": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", - "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" - }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "requires": { - "delayed-stream": "1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "core-js": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", - "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "requires": { - "boom": "5.2.0" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "requires": { - "hoek": "4.2.0" - } - }, - "hoek": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", - "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" - } - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", - "requires": { - "foreach": "2.0.5", - "object-keys": "1.0.11" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "diff-match-patch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.0.tgz", - "integrity": "sha1-HMPIOkkNZ/ldkeOfatHy4Ia2MEg=" - }, - "dir-glob": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", - "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", - "requires": { - "arrify": "1.0.1", - "path-type": "3.0.0" - } - }, - "dotenv": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz", - "integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=" - }, - "duplexify": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.3.tgz", - "integrity": "sha512-g8ID9OroF9hKt2POf8YLayy+9594PzmM3scI00/uBXocX3TWNgoB67hjzkFe9ITAbQOne/lLdBxHXvYUM4ZgGA==", - "requires": { - "end-of-stream": "1.4.1", - "inherits": "2.0.3", - "readable-stream": "2.3.4", - "stream-shift": "1.0.0" - } - }, - "eastasianwidth": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.1.1.tgz", - "integrity": "sha1-RNZW3p2kFWlEZzNTZfsxR7hXK3w=" - }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "ecdsa-sig-formatter": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", - "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", - "requires": { - "base64url": "2.0.0", - "safe-buffer": "5.1.1" - } - }, - "empower": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/empower/-/empower-1.2.3.tgz", - "integrity": "sha1-bw2nNEf07dg4/sXGAxOoi6XLhSs=", - "requires": { - "core-js": "2.5.3", - "empower-core": "0.6.2" - } - }, - "empower-core": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-0.6.2.tgz", - "integrity": "sha1-Wt71ZgiOMfuoC6CjbfR9cJQWkUQ=", - "requires": { - "call-signature": "0.0.2", - "core-js": "2.5.3" - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "1.4.0" - } - }, - "espurify": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.7.0.tgz", - "integrity": "sha1-HFz2y8zDLm9jk4C9T5kfq5up0iY=", - "requires": { - "core-js": "2.5.3" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" - }, - "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", - "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", - "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.17" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "gcp-metadata": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.4.1.tgz", - "integrity": "sha512-yFE7v+NyoMiTOi2L6r8q87eVbiZCKooJNPKXTHhBStga8pwwgWofK9iHl00qd0XevZxcpk7ORaEL/ALuTvlaGQ==", - "requires": { - "extend": "3.0.1", - "retry-request": "3.3.1" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "globby": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", - "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", - "requires": { - "array-union": "1.0.2", - "dir-glob": "2.0.0", - "glob": "7.1.2", - "ignore": "3.3.7", - "pify": "3.0.0", - "slash": "1.0.0" - } - }, - "google-auth-library": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-0.12.0.tgz", - "integrity": "sha512-79qCXtJ1VweBmmLr4yLq9S4clZB2p5Y+iACvuKk9gu4JitEnPc+bQFmYvtCYehVR44MQzD1J8DVmYW2w677IEw==", - "requires": { - "gtoken": "1.2.3", - "jws": "3.1.4", - "lodash.isstring": "4.0.1", - "lodash.merge": "4.6.1", - "request": "2.83.0" - } - }, - "google-auto-auth": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.9.3.tgz", - "integrity": "sha512-TbOZZs0WJOolrRmdQLK5qmWdOJQFG1oPnxcIBbAwL7XCWcv3XgZ9gHJ6W4byrdEZT8TahNFgMfkHd73mqxM9dw==", - "requires": { - "async": "2.6.0", - "gcp-metadata": "0.4.1", - "google-auth-library": "0.12.0", - "request": "2.83.0" - } - }, - "google-gax": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-0.14.5.tgz", - "integrity": "sha512-3A6KbrtLDavrqZnnzurnSydRIJnyH+2Sm56fAvXciQ/62aEnSDaR43MCgWhtReCLVjeFjBiCEIdX5zV0LVLVBg==", - "requires": { - "extend": "3.0.1", - "globby": "7.1.1", - "google-auto-auth": "0.9.3", - "google-proto-files": "0.14.2", - "grpc": "1.7.3", - "is-stream-ended": "0.1.3", - "lodash": "4.17.5", - "protobufjs": "6.8.4", - "readable-stream": "2.3.4", - "through2": "2.0.3" - }, - "dependencies": { - "google-proto-files": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.14.2.tgz", - "integrity": "sha512-wwm2TIlfTgAjDbjrxAb3akznO7vBM0PRLS6Xf2QfR3L7b0p+szD3iwOW0wMSFl3B0UbLv27hUVk+clePqCVmXA==", - "requires": { - "globby": "7.1.1", - "power-assert": "1.4.4", - "prettier": "1.10.2", - "protobufjs": "6.8.4" - } - } - } - }, - "google-p12-pem": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-0.1.2.tgz", - "integrity": "sha1-M8RqsCGqc0+gMys5YKmj/8svMXc=", - "requires": { - "node-forge": "0.7.1" - } - }, - "google-proto-files": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.15.0.tgz", - "integrity": "sha512-reirGcMJMI4yxmQRrOJguyRa17AEPxcPfeK/v/o0ez1kJ3VG8FKl8B2W9gMpU56Sr5TmnPIwnKj9Qa1UurxgtQ==", - "requires": { - "globby": "7.1.1", - "power-assert": "1.4.4", - "prettier": "1.10.2", - "protobufjs": "6.8.4" - } - }, - "grpc": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.7.3.tgz", - "integrity": "sha512-7zXQJlDXMr/ZaDqdaIchgclViyoWo8GQxZSmFUAxR8GwSr28b6/BTgF221WG+2W693jpp74XJ/+I9DcPXsgt9Q==", - "requires": { - "arguejs": "0.2.3", - "lodash": "4.17.5", - "nan": "2.8.0", - "node-pre-gyp": "0.6.39", - "protobufjs": "5.0.2" - }, - "dependencies": { - "abbrev": { - "version": "1.0.9", - "bundled": true - }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.3" - } - }, - "asn1": { - "version": "0.2.3", - "bundled": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "requires": { - "hoek": "2.16.3" - } - }, - "brace-expansion": { - "version": "1.1.8", - "bundled": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "caseless": { - "version": "0.12.0", - "bundled": true - }, - "co": { - "version": "4.6.0", - "bundled": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true - } - } - }, - "debug": { - "version": "2.6.8", - "bundled": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true - }, - "detect-libc": { - "version": "1.0.2", - "bundled": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true - }, - "extsprintf": { - "version": "1.3.0", - "bundled": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.2" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true - } - } - }, - "glob": { - "version": "7.1.1", - "bundled": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true - }, - "har-schema": { - "version": "1.0.5", - "bundled": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.4", - "bundled": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true - }, - "jsprim": { - "version": "1.4.1", - "bundled": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true - } - } - }, - "mime-db": { - "version": "1.30.0", - "bundled": true - }, - "mime-types": { - "version": "2.1.17", - "bundled": true, - "requires": { - "mime-db": "1.30.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "1.1.8" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true - }, - "node-pre-gyp": { - "version": "0.6.39", - "bundled": true, - "requires": { - "detect-libc": "1.0.2", - "hawk": "3.1.3", - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.2", - "rc": "1.2.2", - "request": "2.81.0", - "rimraf": "2.6.2", - "semver": "5.4.1", - "tar": "2.2.1", - "tar-pack": "3.4.1" - }, - "dependencies": { - "nopt": { - "version": "4.0.1", - "bundled": true, - "requires": { - "abbrev": "1.0.9", - "osenv": "0.1.4" - } - } - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true - }, - "osenv": { - "version": "0.1.4", - "bundled": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true - }, - "protobufjs": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.2.tgz", - "integrity": "sha1-WXSNfc8D0tsiwT2p/rAk4Wq4DJE=", - "requires": { - "ascli": "1.0.1", - "bytebuffer": "5.0.1", - "glob": "7.1.1", - "yargs": "3.32.0" - } - }, - "punycode": { - "version": "1.4.1", - "bundled": true - }, - "qs": { - "version": "6.4.0", - "bundled": true - }, - "rc": { - "version": "1.2.2", - "bundled": true, - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true - } - } - }, - "readable-stream": { - "version": "2.3.3", - "bundled": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.81.0", - "bundled": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.6.0", - "uuid": "3.1.0" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "requires": { - "glob": "7.1.1" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true - }, - "semver": { - "version": "5.4.1", - "bundled": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true - }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "requires": { - "hoek": "2.16.3" - } - }, - "sshpk": { - "version": "1.13.1", - "bundled": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true - } - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.0.3", - "bundled": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "stringstream": { - "version": "0.0.5", - "bundled": true - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true - }, - "tar": { - "version": "2.2.1", - "bundled": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.1", - "bundled": true, - "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.3.3", - "rimraf": "2.6.2", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, - "tough-cookie": { - "version": "2.3.3", - "bundled": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true - }, - "uuid": { - "version": "3.1.0", - "bundled": true - }, - "verror": { - "version": "1.10.0", - "bundled": true, - "requires": { - "assert-plus": "1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "1.3.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true - } - } - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - } - } - }, - "gtoken": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-1.2.3.tgz", - "integrity": "sha512-wQAJflfoqSgMWrSBk9Fg86q+sd6s7y6uJhIvvIPz++RElGlMtEqsdAR2oWwZ/WTEtp7P9xFbJRrT976oRgzJ/w==", - "requires": { - "google-p12-pem": "0.1.2", - "jws": "3.1.4", - "mime": "1.6.0", - "request": "2.83.0" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", - "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" - } - }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.0", - "sntp": "2.1.0" - }, - "dependencies": { - "hoek": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", - "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" - } - } - }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" - } - }, - "httpdispatcher": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/httpdispatcher/-/httpdispatcher-2.1.2.tgz", - "integrity": "sha1-wfLIpR2h8vpdCyAxQ3UW0hg3wik=", - "requires": { - "mime-types": "2.1.17" - } - }, - "ignore": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", - "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==" - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-stream-ended": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.3.tgz", - "integrity": "sha1-oEc7Jnx1ZjVIa+7cfjNE5UnRUqw=" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isemail": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz", - "integrity": "sha1-vgPfjMPineTSxd9lASY/H6RZXpo=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "joi": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/joi/-/joi-6.10.1.tgz", - "integrity": "sha1-TVDDGAeRIgAP5fFq8f+OGRe3fgY=", - "requires": { - "hoek": "2.16.3", - "isemail": "1.2.0", - "moment": "2.20.1", - "topo": "1.1.0" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsonwebtoken": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.4.3.tgz", - "integrity": "sha1-d/UCHeBYtgWheD+hKD6ZgS5kVjg=", - "requires": { - "joi": "6.10.1", - "jws": "3.1.4", - "lodash.once": "4.1.1", - "ms": "2.1.1", - "xtend": "4.0.1" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "jwa": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", - "integrity": "sha1-oFUs4CIHQs1S4VN3SjKQXDDnVuU=", - "requires": { - "base64url": "2.0.0", - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.9", - "safe-buffer": "5.1.1" - } - }, - "jws": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", - "integrity": "sha1-+ei5M46KhHJ31kRLFGT2GIDgUKI=", - "requires": { - "base64url": "2.0.0", - "jwa": "1.1.5", - "safe-buffer": "5.1.1" - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "1.0.0" - } - }, - "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" - }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" - }, - "lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" - }, - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "mime-db": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", - "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" - }, - "mime-types": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", - "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", - "requires": { - "mime-db": "1.30.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "1.1.11" - } - }, - "moment": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.20.1.tgz", - "integrity": "sha512-Yh9y73JRljxW5QxN08Fner68eFLxM5ynNOAw2LbIB1YAGeQzZT8QFSUvkAz609Zf+IHhhaUxqZK8dG3W/+HEvg==" - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "nan": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", - "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=" - }, - "nexmo": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nexmo/-/nexmo-2.2.0.tgz", - "integrity": "sha512-7D/QVyQakLJ8M40hANSvINzswK/3XWfml0hY7Ce2pwn5Kinu5UL5i5+nobnvvftoi0mv1Sx288+fmVEqJkh0Mw==", - "requires": { - "jsonwebtoken": "7.4.3", - "request": "2.83.0", - "uuid": "2.0.3" - } - }, - "node-forge": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.1.tgz", - "integrity": "sha1-naYR6giYL0uUIGs760zJZl8gwwA=" - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" - }, - "object-keys": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", - "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1.0.2" - } - }, - "optjs": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", - "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "requires": { - "pify": "3.0.0" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - }, - "power-assert": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.4.4.tgz", - "integrity": "sha1-kpXqdDcZb1pgH95CDwQmMRhtdRc=", - "requires": { - "define-properties": "1.1.2", - "empower": "1.2.3", - "power-assert-formatter": "1.4.1", - "universal-deep-strict-equal": "1.2.2", - "xtend": "4.0.1" - } - }, - "power-assert-context-formatter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.1.1.tgz", - "integrity": "sha1-7bo1LT7YpgMRTWZyZazOYNaJzN8=", - "requires": { - "core-js": "2.5.3", - "power-assert-context-traversal": "1.1.1" - } - }, - "power-assert-context-reducer-ast": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.1.2.tgz", - "integrity": "sha1-SEqZ4m9Jc/+IMuXFzHVnAuYJQXQ=", - "requires": { - "acorn": "4.0.13", - "acorn-es7-plugin": "1.1.7", - "core-js": "2.5.3", - "espurify": "1.7.0", - "estraverse": "4.2.0" - } - }, - "power-assert-context-traversal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.1.1.tgz", - "integrity": "sha1-iMq8oNE7Y1nwfT0+ivppkmRXftk=", - "requires": { - "core-js": "2.5.3", - "estraverse": "4.2.0" - } - }, - "power-assert-formatter": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", - "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", - "requires": { - "core-js": "2.5.3", - "power-assert-context-formatter": "1.1.1", - "power-assert-context-reducer-ast": "1.1.2", - "power-assert-renderer-assertion": "1.1.1", - "power-assert-renderer-comparison": "1.1.1", - "power-assert-renderer-diagram": "1.1.2", - "power-assert-renderer-file": "1.1.1" - } - }, - "power-assert-renderer-assertion": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.1.1.tgz", - "integrity": "sha1-y/wOd+AIao+Wrz8djme57n4ozpg=", - "requires": { - "power-assert-renderer-base": "1.1.1", - "power-assert-util-string-width": "1.1.1" - } - }, - "power-assert-renderer-base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", - "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=" - }, - "power-assert-renderer-comparison": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.1.1.tgz", - "integrity": "sha1-10Odl9hRVr5OMKAPL7WnJRTOPAg=", - "requires": { - "core-js": "2.5.3", - "diff-match-patch": "1.0.0", - "power-assert-renderer-base": "1.1.1", - "stringifier": "1.3.0", - "type-name": "2.0.2" - } - }, - "power-assert-renderer-diagram": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.1.2.tgz", - "integrity": "sha1-ZV+PcRk1qbbVQbhjJ2VHF8Y3qYY=", - "requires": { - "core-js": "2.5.3", - "power-assert-renderer-base": "1.1.1", - "power-assert-util-string-width": "1.1.1", - "stringifier": "1.3.0" - } - }, - "power-assert-renderer-file": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.1.1.tgz", - "integrity": "sha1-o34rvReMys0E5427eckv40kzxec=", - "requires": { - "power-assert-renderer-base": "1.1.1" - } - }, - "power-assert-util-string-width": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.1.1.tgz", - "integrity": "sha1-vmWet5N/3S5smncmjar2S9W3xZI=", - "requires": { - "eastasianwidth": "0.1.1" - } - }, - "prettier": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.10.2.tgz", - "integrity": "sha512-TcdNoQIWFoHblurqqU6d1ysopjq7UX0oRcT/hJ8qvBAELiYWn+Ugf0AXdnzISEJ7vuhNnQ98N8jR8Sh53x4IZg==" - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "protobufjs": { - "version": "6.8.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.4.tgz", - "integrity": "sha512-d+WZqUDXKM+oZhr8yprAtQW07q08p9/V35AJ2J1fds+r903S/aH9P8uO1gmTwozOKugt2XCjdrre3OxuPRGkGg==", - "requires": { - "@protobufjs/aspromise": "1.1.2", - "@protobufjs/base64": "1.1.2", - "@protobufjs/codegen": "2.0.4", - "@protobufjs/eventemitter": "1.1.0", - "@protobufjs/fetch": "1.1.0", - "@protobufjs/float": "1.0.2", - "@protobufjs/inquire": "1.1.0", - "@protobufjs/path": "1.1.2", - "@protobufjs/pool": "1.1.0", - "@protobufjs/utf8": "1.1.0", - "@types/long": "3.0.32", - "@types/node": "8.9.3", - "long": "3.2.0" - } - }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" - } - }, - "pumpify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.4.0.tgz", - "integrity": "sha512-2kmNR9ry+Pf45opRVirpNuIFotsxUGLaYqxIwuR77AYrYRMuFCz9eryHBS52L360O+NcR383CL4QYlMKPq4zYA==", - "requires": { - "duplexify": "3.5.3", - "inherits": "2.0.3", - "pump": "2.0.1" - } - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" - }, - "readable-stream": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", - "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.83.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", - "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.1", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" - }, - "dependencies": { - "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" - } - } - }, - "retry-request": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-3.3.1.tgz", - "integrity": "sha512-PjAmtWIxjNj4Co/6FRtBl8afRP3CxrrIAnUzb1dzydfROd+6xt7xAebFeskgQgkfFf8NmzrXIoaB3HxmswXyxw==", - "requires": { - "request": "2.83.0", - "through2": "2.0.3" - } - }, - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" - }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" - }, - "sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", - "requires": { - "hoek": "4.2.0" - }, - "dependencies": { - "hoek": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", - "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" - } - } - }, - "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - } - }, - "stream-events": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.2.tgz", - "integrity": "sha1-q/OfZsCJCk63lbyNXoWbJhW1kLI=", - "requires": { - "stubs": "3.0.0" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "5.1.1" - } - }, - "stringifier": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.3.0.tgz", - "integrity": "sha1-3vGDQvaTPbDy2/yaoCF1tEjBeVk=", - "requires": { - "core-js": "2.5.3", - "traverse": "0.6.6", - "type-name": "2.0.2" - } - }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "2.1.1" - } - }, - "stubs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", - "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=" - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "requires": { - "readable-stream": "2.3.4", - "xtend": "4.0.1" - } - }, - "topo": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz", - "integrity": "sha1-6ddRYV0buH3IZdsYL6HKCl71NtU=", - "requires": { - "hoek": "2.16.3" - } - }, - "tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", - "requires": { - "punycode": "1.4.1" - } - }, - "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "5.1.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true - }, - "type-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", - "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=" - }, - "typedarray-to-buffer": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.2.tgz", - "integrity": "sha1-EBezLZhP9VbroQD1AViauhrOLgQ=", - "requires": { - "is-typedarray": "1.0.0" - } - }, - "universal-deep-strict-equal": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", - "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", - "requires": { - "array-filter": "1.0.0", - "indexof": "0.0.1", - "object-keys": "1.0.11" - } - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", - "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "1.3.0" - } - }, - "websocket": { - "version": "1.0.25", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.25.tgz", - "integrity": "sha512-M58njvi6ZxVb5k7kpnHh2BvNKuBWiwIYvsToErBzWhvBZYwlEiLcyLrG41T1jRcrY9ettqPYEqduLI7ul54CVQ==", - "requires": { - "debug": "2.6.9", - "nan": "2.8.0", - "typedarray-to-buffer": "3.1.2", - "yaeti": "0.0.6" - } - }, - "window-size": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, - "yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" - }, - "yargs": { - "version": "3.32.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", - "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", - "requires": { - "camelcase": "2.1.1", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "os-locale": "1.4.0", - "string-width": "1.0.2", - "window-size": "0.1.4", - "y18n": "3.2.1" - } - } - } -} diff --git a/package.json b/package.json index 5861c99..f8949d1 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,11 @@ }, "homepage": "https://github.com/nexmo-community/voice-google-speechtotext#readme", "dependencies": { - "@google-cloud/speech": "^1.1.0", + "@google-cloud/speech": "^2.3.0", + "body-parser": "^1.18.3", "dotenv": "^4.0.0", - "httpdispatcher": "^2.0.1", - "nexmo": "^2.2.0", - "url": "^0.11.0", - "websocket": "^1.0.23" + "express": "^4.16.4", + "express-ws": "^4.0.0", + "nexmo": "^2.4.0" } } diff --git a/server.js b/server.js index 84375ed..ad7799b 100644 --- a/server.js +++ b/server.js @@ -1,265 +1,92 @@ -"use strict"; -require('dotenv').load(); +'use strict' +require('dotenv').load() -var WebSocketServer = require('websocket').server; -var http = require('http'); -var HttpDispatcher = require('httpdispatcher'); -var dispatcher = new HttpDispatcher(); -var url = require("url"); - -const fs = require('fs'); - -const Speech = require('@google-cloud/speech'); - -const speech = new Speech.SpeechClient(); - - -var clients = [] - -//Create a server -var server = http.createServer(handleRequest); -var wsserver = http.createServer(handleRequest); - -process.env.APP_ID +const express = require('express'); +const bodyParser = require('body-parser') +const app = express(); +const expressWs = require('express-ws')(app); const Nexmo = require('nexmo'); -const nexmo = new Nexmo({ - apiKey: "dummy", - apiSecret: "dummy", - applicationId: process.env.APP_ID, - privateKey: "./private.key" -}); - - -var nexmows = new WebSocketServer({ - httpServer: wsserver, - autoAcceptConnections: true, - -}); - -var pagews = new WebSocketServer({ - httpServer: server, - autoAcceptConnections: true, - -}); - -// use our dispatcher -function handleRequest(request, response){ - try { - //Dispatch - dispatcher.dispatch(request, response); - } catch(err) { - console.log(err); +const { Readable } = require('stream'); +const speech = require('@google-cloud/speech'); + +// this is used with the heroku one-click install. +// if you are running locally, use GOOGLE_APPLICATION_CREDENTIALS to point to the file location +let config = null; +if (process.env.GOOGLE_APPLICATION_CREDENTIALS === undefined) { + config = { + projectId: 'nexmo-extend', + credentials: { + client_email: process.env.GOOGLE_CLIENT_EMAIL, + private_key: process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g, '\n') } + } } -// Downsample frames from 16Khz to 8Khz -function convert(message){ - var arr = [] - var x = 0; - var y; - var i; - for (i = 0; i < 160; i++) { - y = x+2 - arr.push(message.slice(x,y)) - x += 4; - } - var data = Buffer.concat(arr); - return data -} - -dispatcher.setStatic('/files'); -dispatcher.setStaticDirname('files'); - -// Serve the page -dispatcher.onGet("/", function(req, res) { - fs.readFile('./index.html', function(error, data) { - res.writeHead(200, { 'Content-Type': 'text/html' }); - res.end(data, 'utf-8'); - }); -}); - -// Serve the langs -dispatcher.onGet("/langs.json", function(req, res) { - fs.readFile('./langs.json', function(error, data) { - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(data, 'utf-16'); - }); -}); - - - -// Serve the 1st ncco -dispatcher.onGet("/ncco", function(req, res) { - var parsedUrl = url.parse(req.url, true); // true to get query as object - var params = parsedUrl.query; - var ncco = require('./ncco_input.json'); - - ncco[1].eventUrl[0] = "http://"+process.env.HOSTNAME+"/input?user=" + params.from - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(JSON.stringify(ncco), 'utf-8'); -}); - +const client = new speech.SpeechClient(config||null); -// Serve the 2nd ncco based on input -dispatcher.onPost("/input", function(req, res) { - var params = JSON.parse(req.body); - var parsedUrl = url.parse(req.url, true); // true to get query as object - var getparams = parsedUrl.query; - var ncco = require('./ncco_websocket.json'); - var langs = require('./langs.json'); - var lang = langs.filter(function(l){ - return l.languageID == params.dtmf; - }); - ncco[0].eventUrl[0] = "http://"+process.env.HOSTNAME+"/recording?from=" + getparams.user +"&langCode=" + lang[0].languageCode - ncco[1].text = lang[0].languageName - ncco[2].endpoint[0].uri = "ws://"+ process.env.HOSTNAME + "/nexmosocket" - ncco[2].endpoint[0].headers.languageCode = lang[0].languageCode - ncco[2].endpoint[0].headers.user = getparams.user - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(JSON.stringify(ncco), 'utf-8'); +const nexmo = new Nexmo({ + applicationId: process.env.APP_ID, + privateKey: process.env.PRIVATE_KEY || './private.key' }); +app.use(bodyParser.json()); -// Receive Recording -dispatcher.onPost("/recording", function(req, res) { - var parsedUrl = url.parse(req.url, true); // true to get query as object - var getparams = parsedUrl.query; - var params = JSON.parse(req.body); - console.log(req.body) - var localfile = "files/"+params['conversation_uuid']+".wav" - nexmo.files.save(params['recording_url'], localfile, (err, response) => { - if(response) { - console.log('The audio is downloaded successfully!'); - var response = {text: "http://"+process.env.HOSTNAME + "/" + localfile, - languageCode: getparams.langCode, - user: getparams.from - } - for (var i = 0; i < clients.length; i++) { - clients[i].send(JSON.stringify(response)) - } - } - }); - res.writeHead(204); - res.end(); -}); - +app.get('/answer', (req, res) => { + let nccoResponse = [ + { + "action": "connect", + "endpoint": [{ + "type": "websocket", + "content-type": "audio/l16;rate=16000", + "uri": `ws://${req.hostname}/socket` + }] + } + ]; -// Log events -dispatcher.onPost("/event", function(req, res) { - console.log(req.body) - res.writeHead(204); - res.end(); + res.status(200).json(nccoResponse); }); -// Page Websocket Handler -pagews.on('connect', function(connection) { - console.log((new Date()) + ' Connection accepted' + ' - Protocol Version ' + connection.webSocketVersion); - clients.push(connection); - connection.on('message', function(message) { - request.config.languageCode = message.utf8Data; - }); - connection.on('close', function(reasonCode, description) { - console.log((new Date()) + ' Peer ' + connection.remoteAddress + ' disconnected.'); - //remove the page from the list of clients - var index = clients.indexOf(connection); - if (index > -1) { - clients.splice(index, 1); - } - }); +app.post('/event', (req, res) => { + console.log('EVENT LOG::', req.body) + res.status(204).end(); }); - // Nexmo Websocket Handler -nexmows.on('connect', function(connection) { - console.log((new Date()) + ' Connection accepted' + ' - Protocol Version ' + connection.webSocketVersion); - // Create the stream at the start of the call - var recognizeStream = new RecognizeStream(connection); -}); - -class RecognizeStream { - constructor(connection) { - this.streamCreatedAt = null; - this.stream = null; - this.user = null - this.request = { - config: { - encoding: 'LINEAR16', - sampleRateHertz: 8000, - languageCode: 'en-US' //Default Lang, will be updated with value from websocket - }, - interimResults: false // If you want interim results, set this to true - }; - connection.on('message', this.processMessage.bind(this)); - connection.on('close', this.close.bind(this)); - } - - processMessage(message){ - if (message.type === 'utf8') { - // Log the initial Message - var data = JSON.parse(message.utf8Data) - this.request.config.languageCode = data.languageCode - this.user = data.user - } - else if (message.type === 'binary') { - // Convert to 8k then send to recogniser - var data8000 = convert(message.binaryData); - this.getStream().write(data8000); - } - +app.ws('/socket', (ws, req) => { + + let request ={ + config: { + encoding: 'LINEAR16', + sampleRateHertz: 16000, + languageCode: process.env.LANG_CODE || 'en-US' + }, + interimResults: false + }; + + const recognizeStream = client + .streamingRecognize(request) + .on('error', console.error) + .on('data', data => { + console.log( + `Transcription: ${data.results[0].alternatives[0].transcript}` + ); + }); + + ws.on('message', (msg) => { + if (typeof msg === "string") { + let config = JSON.parse(msg); + } else { + recognizeStream.write(msg); } - - close(){ - this.stream.destroy(); - } - - newStreamRequired() { - // No stream exists - if(!this.stream) { - return true; - } - // check time since stream was created. If 60+ seconds ago create a new stream - else { - const now = new Date(); - const timeSinceStreamCreated = (now - this.streamCreatedAt); // returns millis since stream created - return (timeSinceStreamCreated/1000) > 60; - } - } - - // helper function to ensure we always get a stream object with enough time remaining to work with - getStream() { - if(this.newStreamRequired()) { - if (this.stream){ - this.stream.destroy(); - } - this.streamCreatedAt = new Date(); - //console.log("Sending request as " + this.request.config.languageCode); - this.stream = speech.streamingRecognize(this.request) - .on('error', console.error) - .on('data', this.sendTranscription.bind(this)); - } - return this.stream; - } - - sendTranscription(data){ - var response = {text: data.results[0].alternatives[0].transcript, - languageCode: this.request.config.languageCode, - user: this.user - } - for (var i = 0; i < clients.length; i++) { - clients[i].send(JSON.stringify(response)) - } - } -} - -//Start the server -server.listen(8000, function(){ - //Callback triggered when server is successfully running - console.log("Server listening on: http://localhost:%s", 8000); -}); -wsserver.listen(8001, function(){ - //Callback triggered when server is successfully running - console.log("Server listening on: http://localhost:%s", 8001); + }); + + ws.on('close', () => { + recognizeStream.destroy(); + }) }); + +const port = process.env.PORT || 8000; +app.listen(port, () => console.log(`Example app listening on port ${port}!`))