diff --git a/README.md b/README.md index 0644d05..e1efbeb 100644 --- a/README.md +++ b/README.md @@ -2526,7 +2526,7 @@ module.exports.handler = serverless(toLambda(manager)); where, in this case, `manager` is your `BotManager` instance. -3. In the project root directory, create a `serverless.yaml` file (or copy one those contained in the examples directory, mentioned before in this document). This file should have a configuration like the following (related to a BotFilter): +3. In the project root directory, create a `serverless.yaml` file (or copy one of those contained in the `examples directory`, as mentioned before in this document). This file should have a configuration like the following (related to a BotFilter): ```yaml # serverless.yml @@ -2540,6 +2540,9 @@ provider: stage: dev # AWS region, change it as needed region: us-west-2 + # Endpoint type, default is EDGE. Uncomment next line to deploy to closed gov clouds + #endpointType: REGIONAL + timeout: 30 functions: # name of your Lambda function lambda-bot-filter: diff --git a/examples/lambda-bot-filter/package.json b/examples/lambda-bot-filter/package.json index fd322cd..3f9e3db 100644 --- a/examples/lambda-bot-filter/package.json +++ b/examples/lambda-bot-filter/package.json @@ -1,6 +1,6 @@ { "name": "lambda-bot-filter", - "version": "3.2.0", + "version": "3.3.0", "description": "Example of a Vivocha Bot Filter deployed as AWS Lambda", "main": "dist/index.js", "scripts": { diff --git a/examples/lambda-bot-filter/src/lambda-bot-filter.js b/examples/lambda-bot-filter/src/lambda-bot-filter.js index fce8e34..97f3cb7 100644 --- a/examples/lambda-bot-filter/src/lambda-bot-filter.js +++ b/examples/lambda-bot-filter/src/lambda-bot-filter.js @@ -1,12 +1,14 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -// install and use @vivocha/bot-sdk to run this bot! -const bot_sdk_1 = require("@vivocha/bot-sdk"); +// install and import @vivocha/bot-sdk to run this bot filter! +// replace next line with: +// import { BotFilter, BotRequest, toLambda, serverless } from '@vivocha/bot-sdk'; +const index_1 = require("../../../dist/index"); // A really simple BotFilter implementation -// which augments the BotRequest in input with a number of availableAgents +// which augments the BotRequest in input with a number of availableAgents // and sets if user is premium // (like in the domain of customer support services) -const filter = new bot_sdk_1.BotFilter(async (msg) => { +const filter = new index_1.BotFilter(async (msg) => { msg.data = msg.data || {}; // maybe calling an API... msg.data.availableAgents = 5; @@ -14,4 +16,4 @@ const filter = new bot_sdk_1.BotFilter(async (msg) => { msg.data.isPremiumUser = true; return msg; }, undefined); -module.exports.handler = bot_sdk_1.serverless(bot_sdk_1.toLambda(filter)); +module.exports.handler = index_1.serverless(index_1.toLambda(filter)); diff --git a/examples/lambda-bot-filter/src/lambda-bot-filter.ts b/examples/lambda-bot-filter/src/lambda-bot-filter.ts index cd7fd69..57991cd 100644 --- a/examples/lambda-bot-filter/src/lambda-bot-filter.ts +++ b/examples/lambda-bot-filter/src/lambda-bot-filter.ts @@ -1,17 +1,19 @@ -// install and use @vivocha/bot-sdk to run this bot! -import { BotFilter, BotRequest, toLambda, serverless } from '@vivocha/bot-sdk'; +// install and import @vivocha/bot-sdk to run this bot filter! +// replace next line with: +// import { BotFilter, BotRequest, toLambda, serverless } from '@vivocha/bot-sdk'; +import { BotFilter, BotRequest, toLambda, serverless } from '../../../dist/index'; // A really simple BotFilter implementation -// which augments the BotRequest in input with a number of availableAgents +// which augments the BotRequest in input with a number of availableAgents // and sets if user is premium // (like in the domain of customer support services) const filter = new BotFilter(async (msg: BotRequest): Promise => { - msg.data = msg.data || {}; - // maybe calling an API... - msg.data.availableAgents = 5; - // maybe calling an API or reading from a DB... - msg.data.isPremiumUser = true; - return msg; - }, undefined); + msg.data = msg.data || {}; + // maybe calling an API... + msg.data.availableAgents = 5; + // maybe calling an API or reading from a DB... + msg.data.isPremiumUser = true; + return msg; +}, undefined); - module.exports.handler = serverless(toLambda(filter)); \ No newline at end of file +module.exports.handler = serverless(toLambda(filter)); diff --git a/examples/lambda-bot-manager/package.json b/examples/lambda-bot-manager/package.json index db00d90..fc3d4d8 100644 --- a/examples/lambda-bot-manager/package.json +++ b/examples/lambda-bot-manager/package.json @@ -1,6 +1,6 @@ { "name": "lambda-bot-manager", - "version": "3.2.0", + "version": "3.3.0", "description": "Example of a Vivocha Bot Manager deployed as AWS Lambda", "main": "dist/index.js", "scripts": { diff --git a/examples/lambda-bot-manager/src/lambda-bot.js b/examples/lambda-bot-manager/src/lambda-bot.js index f3929ee..7afab48 100644 --- a/examples/lambda-bot-manager/src/lambda-bot.js +++ b/examples/lambda-bot-manager/src/lambda-bot.js @@ -1,14 +1,15 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -// install and use @vivocha/bot-sdk to run this bot! -const bot_sdk_1 = require("@vivocha/bot-sdk"); -const serverless = require('serverless-http'); +// install and import @vivocha/bot-sdk to run this bot! +// replace next line with: +// import { BotFilter, BotRequest, toLambda, serverless } from '@vivocha/bot-sdk'; +const index_1 = require("../../../dist/index"); // got is just a simple library to perform http requests (see below in the BotAgent code) const got = require("got"); // A BotManager is a web server which exposes an API to send messages // to registered BotAgents, it exposes a Swagger description of the API with related JSON Schemas. // A BotManager holds a BotAgents registry. -const manager = new bot_sdk_1.BotAgentManager(); +const manager = new index_1.BotAgentManager(); // A BotAgent actually represents the Bot implementation and basically it is // a function which takes a BotRequest message in input and returns a Promise, // resolved with a BotResponse message. @@ -33,69 +34,85 @@ manager.registerAgent('custom', async (msg) => { // handle the start event (e.g., replying with a welcome message and event set to "continue") if (msg.event === 'start') { console.log('Start event detected'); - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Hello! I am a Lambda DummyBot :) Write help to see what I can do for you.' - }]; + } + ]; response.data = {}; } else { // This bot understands few sentences ;) switch (msg.message.body.toLowerCase()) { case 'hi': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Hello again!' - }]; + } + ]; break; case 'hello': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Hey!' - }]; + } + ]; break; case 'ciao': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'hello :)' - }]; + } + ]; break; case 'ok': const replies = ['Good! :)', ':)', 'yup! :D', 'oook!', 'yep!', ';)']; - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: replies[Math.floor(Math.random() * replies.length)] - }]; + } + ]; break; case 'bye': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Bye, see you soon!' - }]; + } + ]; response.event = 'end'; break; - // just an example to show how to call an external API to compose a response + // just an example to show how to call an external API to compose a response case 'code': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: `A brand new code generated for you is: ${(await got('https://httpbin.org/uuid', { json: true })).body.uuid || 0}` - }]; + } + ]; break; case 'quick': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Just an example of quick replies... choose a color?', - quick_replies: [{ + quick_replies: [ + { content_type: 'text', title: 'Red', payload: 'red' @@ -116,7 +133,8 @@ manager.registerAgent('custom', async (msg) => { response.event = 'continue'; break; case 'help': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Just an example of generic template:', @@ -124,57 +142,59 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "You can send me the following messages", + title: 'You can send me the following messages', buttons: [ { - type: "postback", - title: "quick", + type: 'postback', + title: 'quick', payload: 'quick' }, { - type: "postback", - title: "team", + type: 'postback', + title: 'team', payload: 'team' }, { - type: "postback", - title: "cat", + type: 'postback', + title: 'cat', payload: 'cat' }, { - type: "postback", - title: "cats", + type: 'postback', + title: 'cats', payload: 'cats' }, { - type: "postback", - title: "tm-buttons", + type: 'postback', + title: 'tm-buttons', payload: 'tm-buttons' }, { - type: "postback", - title: "tm-elements", + type: 'postback', + title: 'tm-elements', payload: 'tm-elements' }, { - type: "postback", - title: "bye", + type: 'postback', + title: 'bye', payload: 'bye' }, { - type: "postback", - title: "pagevent", + type: 'postback', + title: 'pagevent', payload: 'pagevent' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'pagevent': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Just an event', @@ -182,26 +202,29 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "You can handle the following page events", + title: 'You can handle the following page events', buttons: [ { - type: "page_event", - url: "https://en.wikipedia.org/wiki/Cat", - title: "View Website" + type: 'page_event', + url: 'https://en.wikipedia.org/wiki/Cat', + title: 'View Website' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'team': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Choose a team member', - quick_replies: [{ + quick_replies: [ + { content_type: 'text', title: 'Federico', payload: 'federico', @@ -225,7 +248,8 @@ manager.registerAgent('custom', async (msg) => { response.event = 'continue'; break; case 'cat': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Just an example of generic templates:', @@ -233,32 +257,35 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "Meow!", - image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg/1024px-Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg", - subtitle: "We have the right cat for everyone.", + title: 'Meow!', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg/1024px-Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg', + subtitle: 'We have the right cat for everyone.', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'cats': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Just an example of generic templates:', @@ -266,52 +293,56 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "Meow!", - image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg/1024px-Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg", - subtitle: "We have the right cat for everyone.", + title: 'Meow!', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg/1024px-Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg', + subtitle: 'We have the right cat for everyone.', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' } ] }, { - title: "Meow!", - image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Adult_Scottish_Fold.jpg/1920px-Adult_Scottish_Fold.jpg", - subtitle: "We have the right cat for everyone.", + title: 'Meow!', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Adult_Scottish_Fold.jpg/1920px-Adult_Scottish_Fold.jpg', + subtitle: 'We have the right cat for everyone.', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'andrea': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Andrea Lovicu', @@ -319,32 +350,35 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "Andrea Lovicu", - image_url: "https://www.vivocha.com/wp-content/uploads/2017/03/team_andrea.png", - subtitle: "Head of Development", + title: 'Andrea Lovicu', + image_url: 'https://www.vivocha.com/wp-content/uploads/2017/03/team_andrea.png', + subtitle: 'Head of Development', default_action: { - type: "web_url", - url: "https://www.vivocha.com/team/" + type: 'web_url', + url: 'https://www.vivocha.com/team/' }, buttons: [ { - type: "web_url", - url: "https://www.vivocha.com/team/", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" + type: 'web_url', + url: 'https://www.vivocha.com/team/', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'federico': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Federico Pinna', @@ -352,32 +386,35 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "Federico Pinna", - image_url: "https://www.vivocha.com/wp-content/uploads/2017/03/team_federico.png", - subtitle: "Founder & CTO", + title: 'Federico Pinna', + image_url: 'https://www.vivocha.com/wp-content/uploads/2017/03/team_federico.png', + subtitle: 'Founder & CTO', default_action: { - type: "web_url", - url: "https://www.vivocha.com/team/" + type: 'web_url', + url: 'https://www.vivocha.com/team/' }, buttons: [ { - type: "web_url", - url: "https://www.vivocha.com/team/", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" + type: 'web_url', + url: 'https://www.vivocha.com/team/', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'antonio': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Antonio Pintus', @@ -385,32 +422,35 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "Antonio Pintus", - image_url: "https://www.vivocha.com/wp-content/uploads/2017/05/team-antonio.png", - subtitle: "Senior Software Enginner", + title: 'Antonio Pintus', + image_url: 'https://www.vivocha.com/wp-content/uploads/2017/05/team-antonio.png', + subtitle: 'Senior Software Enginner', default_action: { - type: "web_url", - url: "https://www.vivocha.com/team/" + type: 'web_url', + url: 'https://www.vivocha.com/team/' }, buttons: [ { - type: "web_url", - url: "https://www.vivocha.com/team/", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" + type: 'web_url', + url: 'https://www.vivocha.com/team/', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'red': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'RED is the color', @@ -418,32 +458,35 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "Red is a nice choice", - image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Vermillon_pigment.jpg/800px-Vermillon_pigment.jpg", - subtitle: "RED Pigments", + title: 'Red is a nice choice', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Vermillon_pigment.jpg/800px-Vermillon_pigment.jpg', + subtitle: 'RED Pigments', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Red" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Red' }, buttons: [ { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Red", - title: "More info..." - }, { - type: "postback", - title: "OK", - payload: "abcd 123" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Red', + title: 'More info...' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'blue': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'BLUE is the color', @@ -451,32 +494,35 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "Blue is a good choice", - image_url: "https://upload.wikimedia.org/wikipedia/commons/1/18/Indigo_plant_extract_sample.jpg", - subtitle: "Blue...", + title: 'Blue is a good choice', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/1/18/Indigo_plant_extract_sample.jpg', + subtitle: 'Blue...', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Blue" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Blue' }, buttons: [ { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Blue", - title: "More info..." - }, { - type: "postback", - title: "OK", - payload: "abcd 123" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Blue', + title: 'More info...' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'white': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'White is amazing', @@ -484,43 +530,48 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "White is a very nice choice", - image_url: "https://upload.wikimedia.org/wikipedia/commons/7/71/Ivory_Gull_Portrait.jpg", - subtitle: "White is nice!", + title: 'White is a very nice choice', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/7/71/Ivory_Gull_Portrait.jpg', + subtitle: 'White is nice!', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/White" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/White' }, buttons: [ { - type: "web_url", - url: "https://en.wikipedia.org/wiki/White", - title: "More info..." - }, { - type: "postback", - title: "OK", - payload: "abcd 123" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/White', + title: 'More info...' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'transfer': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: "OK I'm transferring you to a jolly agent. Bye!" - }]; + } + ]; response.event = 'end'; response.data = { transferToAgent: 'jolly' }; break; case 'tm-buttons': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Too many buttons', @@ -528,47 +579,49 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "Too many buttons", - subtitle: "to FB Messenger only the first 3 buttons are sent", + title: 'Too many buttons', + subtitle: 'to FB Messenger only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'tm-elements': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Too many buttons', @@ -576,436 +629,439 @@ manager.registerAgent('custom', async (msg) => { type: 'generic', elements: [ { - title: "1", - subtitle: "to FB Messenger only the first 3 buttons are sent", + title: '1', + subtitle: 'to FB Messenger only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "2", - subtitle: "only the first 3 buttons are sent", + title: '2', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "3", - subtitle: "only the first 3 buttons are sent", + title: '3', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "4", - subtitle: "only the first 3 buttons are sent", + title: '4', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "5", - subtitle: "only the first 3 buttons are sent", + title: '5', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "6", - subtitle: "only the first 3 buttons are sent", + title: '6', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "7", - subtitle: "only the first 3 buttons are sent", + title: '7', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "8", - subtitle: "only the first 3 buttons are sent", + title: '8', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "9", - subtitle: "only the first 3 buttons are sent", + title: '9', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "10", - subtitle: "only the first 3 buttons are sent", + title: '10', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "11", - subtitle: "only the first 3 buttons are sent", + title: '11', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] }, { - title: "12", - subtitle: "only the first 3 buttons are sent", + title: '12', + subtitle: 'only the first 3 buttons are sent', default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, buttons: [ { - type: "postback", - title: "Button1", - payload: "abcd 123" + type: 'postback', + title: 'Button1', + payload: 'abcd 123' }, { - type: "postback", - title: "Button2", - payload: "abcd 123" + type: 'postback', + title: 'Button2', + payload: 'abcd 123' }, { - type: "postback", - title: "Button3", - payload: "abcd 123" + type: 'postback', + title: 'Button3', + payload: 'abcd 123' }, { - type: "postback", - title: "Button4", - payload: "abcd 123" + type: 'postback', + title: 'Button4', + payload: 'abcd 123' }, { - type: "postback", - title: "Button5", - payload: "abcd 123" + type: 'postback', + title: 'Button5', + payload: 'abcd 123' } ] } ] // end elements } - }]; + } + ]; response.event = 'continue'; break; case 'datacoll': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Using the collected data', - quick_replies: [{ + quick_replies: [ + { content_type: 'text', title: msg.data.a, payload: msg.data.a @@ -1021,15 +1077,18 @@ manager.registerAgent('custom', async (msg) => { payload: msg.data.c } ] - }]; + } + ]; response.event = 'continue'; break; case 'stringify': - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: 'Using a JSON string in data', - quick_replies: [{ + quick_replies: [ + { content_type: 'text', title: JSON.parse(msg.data.json).a, payload: JSON.parse(msg.data.json).a @@ -1038,20 +1097,23 @@ manager.registerAgent('custom', async (msg) => { content_type: 'text', title: JSON.parse(msg.data.json).b, payload: JSON.parse(msg.data.json).b - }] - }]; + } + ] + } + ]; response.event = 'continue'; break; default: - response.messages = [{ + response.messages = [ + { code: 'message', type: 'text', body: "Sorry, I didn't get that! Could you say that again, please?" - }]; + } + ]; } - ; } console.log('Sending Response ', response); return response; }); -module.exports.handler = serverless(bot_sdk_1.toLambda(manager)); +module.exports.handler = index_1.serverless(index_1.toLambda(manager)); diff --git a/examples/lambda-bot-manager/src/lambda-bot.ts b/examples/lambda-bot-manager/src/lambda-bot.ts index c02b611..c5e95ef 100644 --- a/examples/lambda-bot-manager/src/lambda-bot.ts +++ b/examples/lambda-bot-manager/src/lambda-bot.ts @@ -1,7 +1,7 @@ -// install and use @vivocha/bot-sdk to run this bot! -import { BotAgentManager, BotRequest, BotResponse, TextMessage, toLambda } from '@vivocha/bot-sdk'; -const serverless = require('serverless-http'); - +// install and import @vivocha/bot-sdk to run this bot! +// replace next line with: +// import { BotFilter, BotRequest, toLambda, serverless } from '@vivocha/bot-sdk'; +import { BotAgentManager, BotRequest, BotResponse, TextMessage, toLambda, serverless } from '../../../dist/index'; // got is just a simple library to perform http requests (see below in the BotAgent code) import * as got from 'got'; @@ -23,1098 +23,1151 @@ const manager = new BotAgentManager(); // The BotAgent is then registered to the BotManager which will forward all // the incoming messages (sent by Vivocha Platform) containing (in this case) an engine type === 'custom' in // the settings property. -manager.registerAgent('custom', async (msg: BotRequest): Promise => { - +manager.registerAgent( + 'custom', + async (msg: BotRequest): Promise => { console.log('Incoming MSG: ', msg); const response: BotResponse = { - settings: { - engine: msg.settings.engine - }, - messages: [], - event: 'continue' + settings: { + engine: msg.settings.engine + }, + messages: [], + event: 'continue' }; // handle the start event (e.g., replying with a welcome message and event set to "continue") if (msg.event === 'start') { - console.log('Start event detected'); - response.messages = [{ - code: 'message', - type: 'text', - body: 'Hello! I am a Lambda DummyBot :) Write help to see what I can do for you.' - } as TextMessage]; - response.data = {}; + console.log('Start event detected'); + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Hello! I am a Lambda DummyBot :) Write help to see what I can do for you.' + } as TextMessage + ]; + response.data = {}; } else { - // This bot understands few sentences ;) - switch ((msg.message as any).body.toLowerCase()) { - case 'hi': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Hello again!' - } as TextMessage]; - break; - case 'hello': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Hey!' - } as TextMessage]; - break; - case 'ciao': - response.messages = [{ - code: 'message', - type: 'text', - body: 'hello :)' - } as TextMessage]; - break; - case 'ok': - const replies = ['Good! :)', ':)', 'yup! :D', 'oook!', 'yep!', ';)']; - response.messages = [{ - code: 'message', - type: 'text', - body: replies[Math.floor(Math.random() * replies.length)] - } as TextMessage]; - break; - case 'bye': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Bye, see you soon!' - } as TextMessage]; - response.event = 'end'; - break; - // just an example to show how to call an external API to compose a response - case 'code': - response.messages = [{ - code: 'message', - type: 'text', - body: `A brand new code generated for you is: ${(await got('https://httpbin.org/uuid', { - json: true - })).body.uuid || 0}` - } as TextMessage]; - break; - case 'quick': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Just an example of quick replies... choose a color?', - quick_replies: [{ - content_type: 'text', - title: 'Red', - payload: 'red' - }, - { - content_type: 'text', - title: 'Blue', - payload: 'blue' - }, - { - content_type: 'text', - title: 'White', - payload: 'white' - } + // This bot understands few sentences ;) + switch ((msg.message as any).body.toLowerCase()) { + case 'hi': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Hello again!' + } as TextMessage + ]; + break; + case 'hello': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Hey!' + } as TextMessage + ]; + break; + case 'ciao': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'hello :)' + } as TextMessage + ]; + break; + case 'ok': + const replies = ['Good! :)', ':)', 'yup! :D', 'oook!', 'yep!', ';)']; + response.messages = [ + { + code: 'message', + type: 'text', + body: replies[Math.floor(Math.random() * replies.length)] + } as TextMessage + ]; + break; + case 'bye': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Bye, see you soon!' + } as TextMessage + ]; + response.event = 'end'; + break; + // just an example to show how to call an external API to compose a response + case 'code': + response.messages = [ + { + code: 'message', + type: 'text', + body: `A brand new code generated for you is: ${(await got('https://httpbin.org/uuid', { + json: true + })).body.uuid || 0}` + } as TextMessage + ]; + break; + case 'quick': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Just an example of quick replies... choose a color?', + quick_replies: [ + { + content_type: 'text', + title: 'Red', + payload: 'red' + }, + { + content_type: 'text', + title: 'Blue', + payload: 'blue' + }, + { + content_type: 'text', + title: 'White', + payload: 'white' + } + ] + } as any + ]; + response.event = 'continue'; + break; + case 'help': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Just an example of generic template:', + template: { + type: 'generic', + elements: [ + { + title: 'You can send me the following messages', + buttons: [ + { + type: 'postback', + title: 'quick', + payload: 'quick' + }, + { + type: 'postback', + title: 'team', + payload: 'team' + }, + { + type: 'postback', + title: 'cat', + payload: 'cat' + }, + { + type: 'postback', + title: 'cats', + payload: 'cats' + }, + { + type: 'postback', + title: 'tm-buttons', + payload: 'tm-buttons' + }, + { + type: 'postback', + title: 'tm-elements', + payload: 'tm-elements' + }, + { + type: 'postback', + title: 'bye', + payload: 'bye' + }, + { + type: 'postback', + title: 'pagevent', + payload: 'pagevent' + } ] - } as any - ]; - response.event = 'continue'; - break; - case 'help': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Just an example of generic template:', - template: { - type: 'generic', - elements: [ - { - title: "You can send me the following messages", - buttons: [ - { - - type: "postback", - title: "quick", - payload: 'quick' - }, - { - type: "postback", - title: "team", - payload: 'team' - }, - { - type: "postback", - title: "cat", - payload: 'cat' - }, - { - type: "postback", - title: "cats", - payload: 'cats' - }, - { - type: "postback", - title: "tm-buttons", - payload: 'tm-buttons' - }, - { - type: "postback", - title: "tm-elements", - payload: 'tm-elements' - }, - { - type: "postback", - title: "bye", - payload: 'bye' - }, - { - type: "postback", - title: "pagevent", - payload: 'pagevent' - } - ] - - } - - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'pagevent': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Just an event', - template: { - type: 'generic', - elements: [ - { - title: "You can handle the following page events", - buttons: [ - { - type: "page_event", - url: "https://en.wikipedia.org/wiki/Cat", - title: "View Website" - } - - ] - - } - - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'team': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Choose a team member', - quick_replies: [{ - content_type: 'text', - title: 'Federico', - payload: 'federico', - image_url: 'https://www.vivocha.com/wp-content/uploads/2017/03/team_federico.png' - - }, - { - content_type: 'text', - title: 'Andrea', - payload: 'andrea', - image_url: 'https://www.vivocha.com/wp-content/uploads/2017/03/team_andrea.png' - - }, - { - content_type: 'text', - title: 'Antonio', - payload: 'antonio', - image_url: 'https://www.vivocha.com/wp-content/uploads/2017/05/team-antonio.png' - } + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'pagevent': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Just an event', + template: { + type: 'generic', + elements: [ + { + title: 'You can handle the following page events', + buttons: [ + { + type: 'page_event', + url: 'https://en.wikipedia.org/wiki/Cat', + title: 'View Website' + } ] - } as any - ]; - response.event = 'continue'; - break; - case 'cat': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Just an example of generic templates:', - template: { - type: 'generic', - elements: [ - { - title: "Meow!", - image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg/1024px-Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg", - subtitle: "We have the right cat for everyone.", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, - - buttons: [ - { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" - } - ] - } - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'cats': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Just an example of generic templates:', - template: { - type: 'generic', - elements: [ - { - title: "Meow!", - image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg/1024px-Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg", - subtitle: "We have the right cat for everyone.", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, - - buttons: [ - { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" - } - ] - - }, - { - title: "Meow!", - image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Adult_Scottish_Fold.jpg/1920px-Adult_Scottish_Fold.jpg", - subtitle: "We have the right cat for everyone.", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, - - buttons: [ - { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" - } - ] - - } - - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'andrea': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Andrea Lovicu', - template: { - type: 'generic', - elements: [ - { - title: "Andrea Lovicu", - image_url: "https://www.vivocha.com/wp-content/uploads/2017/03/team_andrea.png", - subtitle: "Head of Development", - - default_action: { - type: "web_url", - url: "https://www.vivocha.com/team/" - }, - - buttons: [ - { - type: "web_url", - url: "https://www.vivocha.com/team/", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" - } - ] - } - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'federico': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Federico Pinna', - template: { - type: 'generic', - elements: [ - { - title: "Federico Pinna", - image_url: "https://www.vivocha.com/wp-content/uploads/2017/03/team_federico.png", - subtitle: "Founder & CTO", - - default_action: { - type: "web_url", - url: "https://www.vivocha.com/team/" - }, - - buttons: [ - { - type: "web_url", - url: "https://www.vivocha.com/team/", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" - } - ] - } - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'antonio': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Antonio Pintus', - template: { - type: 'generic', - elements: [ - { - title: "Antonio Pintus", - image_url: "https://www.vivocha.com/wp-content/uploads/2017/05/team-antonio.png", - subtitle: "Senior Software Enginner", - - default_action: { - type: "web_url", - url: "https://www.vivocha.com/team/" - }, - - buttons: [ - { - type: "web_url", - url: "https://www.vivocha.com/team/", - title: "View Website" - }, { - type: "postback", - title: "OK", - payload: "abcd 123" - } - ] - } - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'red': - response.messages = [{ - code: 'message', - type: 'text', - body: 'RED is the color', - template: { - type: 'generic', - elements: [ - { - title: "Red is a nice choice", - image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Vermillon_pigment.jpg/800px-Vermillon_pigment.jpg", - subtitle: "RED Pigments", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Red" - }, - - buttons: [ - { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Red", - title: "More info..." - }, { - type: "postback", - title: "OK", - payload: "abcd 123" - } - ] - } - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'blue': - response.messages = [{ - code: 'message', - type: 'text', - body: 'BLUE is the color', - template: { - type: 'generic', - elements: [ - { - title: "Blue is a good choice", - image_url: "https://upload.wikimedia.org/wikipedia/commons/1/18/Indigo_plant_extract_sample.jpg", - subtitle: "Blue...", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Blue" - }, - - buttons: [ - { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Blue", - title: "More info..." - }, { - type: "postback", - title: "OK", - payload: "abcd 123" - } - ] - } - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'white': - response.messages = [{ - code: 'message', - type: 'text', - body: 'White is amazing', - template: { - type: 'generic', - elements: [ - { - title: "White is a very nice choice", - image_url: "https://upload.wikimedia.org/wikipedia/commons/7/71/Ivory_Gull_Portrait.jpg", - subtitle: "White is nice!", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/White" - }, - - buttons: [ - { - type: "web_url", - url: "https://en.wikipedia.org/wiki/White", - title: "More info..." - }, { - type: "postback", - title: "OK", - payload: "abcd 123" - } - ] - } - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - - case 'transfer': - response.messages = [{ - code: 'message', - type: 'text', - body: "OK I'm transferring you to a jolly agent. Bye!" - } as TextMessage]; - response.event = 'end'; - response.data = { - transferToAgent: 'jolly' + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'team': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Choose a team member', + quick_replies: [ + { + content_type: 'text', + title: 'Federico', + payload: 'federico', + image_url: 'https://www.vivocha.com/wp-content/uploads/2017/03/team_federico.png' + }, + { + content_type: 'text', + title: 'Andrea', + payload: 'andrea', + image_url: 'https://www.vivocha.com/wp-content/uploads/2017/03/team_andrea.png' + }, + { + content_type: 'text', + title: 'Antonio', + payload: 'antonio', + image_url: 'https://www.vivocha.com/wp-content/uploads/2017/05/team-antonio.png' } - break; - case 'tm-buttons': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Too many buttons', - template: { - type: 'generic', - elements: [ - { - title: "Too many buttons", - subtitle: "to FB Messenger only the first 3 buttons are sent", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, - - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - } - - ] // end elements - } - } as any]; - response.event = 'continue'; - break; - case 'tm-elements': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Too many buttons', - template: { - type: 'generic', - elements: [ - { - title: "1", - subtitle: "to FB Messenger only the first 3 buttons are sent", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, - - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "2", - subtitle: "only the first 3 buttons are sent", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, - - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "3", - subtitle: "only the first 3 buttons are sent", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, - - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "4", - subtitle: "only the first 3 buttons are sent", - - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, + ] + } as any + ]; + response.event = 'continue'; + break; + case 'cat': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Just an example of generic templates:', + template: { + type: 'generic', + elements: [ + { + title: 'Meow!', + image_url: + 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg/1024px-Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg', + subtitle: 'We have the right cat for everyone.', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "5", - subtitle: "only the first 3 buttons are sent", + buttons: [ + { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'cats': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Just an example of generic templates:', + template: { + type: 'generic', + elements: [ + { + title: 'Meow!', + image_url: + 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg/1024px-Tajeschidolls_Beren_of_LoveLorien_Ragdoll_Seal_Mink_Lynx_Bicolor.jpg', + subtitle: 'We have the right cat for everyone.', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, + buttons: [ + { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' + } + ] + }, + { + title: 'Meow!', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Adult_Scottish_Fold.jpg/1920px-Adult_Scottish_Fold.jpg', + subtitle: 'We have the right cat for everyone.', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "6", - subtitle: "only the first 3 buttons are sent", + buttons: [ + { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'andrea': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Andrea Lovicu', + template: { + type: 'generic', + elements: [ + { + title: 'Andrea Lovicu', + image_url: 'https://www.vivocha.com/wp-content/uploads/2017/03/team_andrea.png', + subtitle: 'Head of Development', + + default_action: { + type: 'web_url', + url: 'https://www.vivocha.com/team/' + }, - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, + buttons: [ + { + type: 'web_url', + url: 'https://www.vivocha.com/team/', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'federico': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Federico Pinna', + template: { + type: 'generic', + elements: [ + { + title: 'Federico Pinna', + image_url: 'https://www.vivocha.com/wp-content/uploads/2017/03/team_federico.png', + subtitle: 'Founder & CTO', + + default_action: { + type: 'web_url', + url: 'https://www.vivocha.com/team/' + }, - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "7", - subtitle: "only the first 3 buttons are sent", + buttons: [ + { + type: 'web_url', + url: 'https://www.vivocha.com/team/', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'antonio': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Antonio Pintus', + template: { + type: 'generic', + elements: [ + { + title: 'Antonio Pintus', + image_url: 'https://www.vivocha.com/wp-content/uploads/2017/05/team-antonio.png', + subtitle: 'Senior Software Enginner', + + default_action: { + type: 'web_url', + url: 'https://www.vivocha.com/team/' + }, - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, + buttons: [ + { + type: 'web_url', + url: 'https://www.vivocha.com/team/', + title: 'View Website' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'red': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'RED is the color', + template: { + type: 'generic', + elements: [ + { + title: 'Red is a nice choice', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Vermillon_pigment.jpg/800px-Vermillon_pigment.jpg', + subtitle: 'RED Pigments', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Red' + }, - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "8", - subtitle: "only the first 3 buttons are sent", + buttons: [ + { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Red', + title: 'More info...' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'blue': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'BLUE is the color', + template: { + type: 'generic', + elements: [ + { + title: 'Blue is a good choice', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/1/18/Indigo_plant_extract_sample.jpg', + subtitle: 'Blue...', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Blue' + }, - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, + buttons: [ + { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Blue', + title: 'More info...' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'white': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'White is amazing', + template: { + type: 'generic', + elements: [ + { + title: 'White is a very nice choice', + image_url: 'https://upload.wikimedia.org/wikipedia/commons/7/71/Ivory_Gull_Portrait.jpg', + subtitle: 'White is nice!', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/White' + }, - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "9", - subtitle: "only the first 3 buttons are sent", + buttons: [ + { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/White', + title: 'More info...' + }, + { + type: 'postback', + title: 'OK', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + + case 'transfer': + response.messages = [ + { + code: 'message', + type: 'text', + body: "OK I'm transferring you to a jolly agent. Bye!" + } as TextMessage + ]; + response.event = 'end'; + response.data = { + transferToAgent: 'jolly' + }; + break; + case 'tm-buttons': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Too many buttons', + template: { + type: 'generic', + elements: [ + { + title: 'Too many buttons', + subtitle: 'to FB Messenger only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + case 'tm-elements': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Too many buttons', + template: { + type: 'generic', + elements: [ + { + title: '1', + subtitle: 'to FB Messenger only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "10", - subtitle: "only the first 3 buttons are sent", + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '2', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '3', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "11", - subtitle: "only the first 3 buttons are sent", + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '4', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '5', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - }, - { - title: "12", - subtitle: "only the first 3 buttons are sent", + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '6', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - default_action: { - type: "web_url", - url: "https://en.wikipedia.org/wiki/Cat" - }, + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '7', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - buttons: [ - { - type: "postback", - title: "Button1", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button2", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button3", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button4", - payload: "abcd 123" - }, - { - type: "postback", - title: "Button5", - payload: "abcd 123" - } - ] - } + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '8', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - ] // end elements - } - } as any]; - response.event = 'continue'; - break; + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '9', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' + }, - case 'datacoll': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Using the collected data', - quick_replies: [{ - content_type: 'text', - title: msg.data.a, - payload: msg.data.a + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '10', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, - { - content_type: 'text', - title: msg.data.b, - payload: msg.data.b + + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + }, + { + title: '11', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, - { - content_type: 'text', - title: msg.data.c, - payload: msg.data.c - } + + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } ] - } as any]; - response.event = 'continue'; - break; - case 'stringify': - response.messages = [{ - code: 'message', - type: 'text', - body: 'Using a JSON string in data', - quick_replies: [{ - content_type: 'text', - title: JSON.parse(msg.data.json).a, - payload: JSON.parse(msg.data.json).a + }, + { + title: '12', + subtitle: 'only the first 3 buttons are sent', + + default_action: { + type: 'web_url', + url: 'https://en.wikipedia.org/wiki/Cat' }, - { - content_type: 'text', - title: JSON.parse(msg.data.json).b, - payload: JSON.parse(msg.data.json).b - }] - } as any]; - response.event = 'continue'; - break; - default: - response.messages = [{ - code: 'message', - type: 'text', - body: "Sorry, I didn't get that! Could you say that again, please?" - } as TextMessage]; - }; + + buttons: [ + { + type: 'postback', + title: 'Button1', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button2', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button3', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button4', + payload: 'abcd 123' + }, + { + type: 'postback', + title: 'Button5', + payload: 'abcd 123' + } + ] + } + ] // end elements + } + } as any + ]; + response.event = 'continue'; + break; + + case 'datacoll': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Using the collected data', + quick_replies: [ + { + content_type: 'text', + title: msg.data.a, + payload: msg.data.a + }, + { + content_type: 'text', + title: msg.data.b, + payload: msg.data.b + }, + { + content_type: 'text', + title: msg.data.c, + payload: msg.data.c + } + ] + } as any + ]; + response.event = 'continue'; + break; + case 'stringify': + response.messages = [ + { + code: 'message', + type: 'text', + body: 'Using a JSON string in data', + quick_replies: [ + { + content_type: 'text', + title: JSON.parse(msg.data.json).a, + payload: JSON.parse(msg.data.json).a + }, + { + content_type: 'text', + title: JSON.parse(msg.data.json).b, + payload: JSON.parse(msg.data.json).b + } + ] + } as any + ]; + response.event = 'continue'; + break; + default: + response.messages = [ + { + code: 'message', + type: 'text', + body: "Sorry, I didn't get that! Could you say that again, please?" + } as TextMessage + ]; + } } console.log('Sending Response ', response); return response; -}); + } +); -module.exports.handler = serverless(toLambda(manager)); \ No newline at end of file +module.exports.handler = serverless(toLambda(manager)); diff --git a/package-lock.json b/package-lock.json index bade0db..4865221 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@vivocha/bot-sdk", - "version": "3.2.0-beta", + "version": "0.0.0-semantically-released", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -14,14 +14,14 @@ } }, "@babel/generator": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.0.tgz", - "integrity": "sha512-dZTwMvTgWfhmibq4V9X+LMf6Bgl7zAodRn9PvcPdhlzFMbvUutx74dbEv7Atz3ToeEpevYEJtAwfxq/bDCzHWg==", + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.3.tgz", + "integrity": "sha512-aEADYwRRZjJyMnKN7llGIlircxTCofm3dtV5pmY6ob18MSIuipHpA2yZWkPlycwu5HJcx/pADS3zssd8eY7/6A==", "dev": true, "requires": { - "@babel/types": "^7.3.0", + "@babel/types": "^7.3.3", "jsesc": "^2.5.1", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "source-map": "^0.5.0", "trim-right": "^1.0.1" }, @@ -106,9 +106,9 @@ } }, "@babel/parser": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.1.tgz", - "integrity": "sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA==", + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.3.tgz", + "integrity": "sha512-xsH1CJoln2r74hR+y7cg2B5JCPaTh+Hd+EbBRk9nWGSNspuo6krjhX0Om6RnRQuIvFq8wVXCLKH3kwKDYhanSg==", "dev": true }, "@babel/template": { @@ -140,13 +140,13 @@ } }, "@babel/types": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.0.tgz", - "integrity": "sha512-QkFPw68QqWU1/RVPyBe8SO7lXbPfjtqAxRYQKpFpaB8yMq7X2qAqfwK5LKoQufEkSmO5NQ70O6Kc3Afk03RwXw==", + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.3.tgz", + "integrity": "sha512-2tACZ80Wg09UnPg5uGAOUvvInaqLk3l/IAhQzlxLQOIXacr6bMsra5SH6AWw/hIDRCSbCdHP2KzSOD+cT7TzMQ==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "to-fast-properties": "^2.0.0" } }, @@ -444,9 +444,9 @@ } }, "@types/lodash": { - "version": "4.14.120", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.120.tgz", - "integrity": "sha512-jQ21kQ120mo+IrDs1nFNVm/AsdFxIx2+vZ347DbogHJPd/JzKNMOqU6HCYin1W6v8l5R9XSO2/e9cxmn7HAnVw==", + "version": "4.14.121", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.121.tgz", + "integrity": "sha512-ORj7IBWj13iYufXt/VXrCNMbUuCTJfhzme5kx9U/UtcIPdJYuvPDUAlHlbNhz/8lKCLy9XGIZnGrqXOtQbPGoQ==", "dev": true }, "@types/mime": { @@ -455,9 +455,9 @@ "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==" }, "@types/mocha": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", - "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.6.tgz", + "integrity": "sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw==", "dev": true }, "@types/node": { @@ -674,13 +674,10 @@ "dev": true }, "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true }, "arr-flatten": { "version": "1.1.0", @@ -726,9 +723,9 @@ "dev": true }, "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, "arrest": { @@ -980,14 +977,32 @@ } }, "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "browser-stdout": { @@ -1363,24 +1378,34 @@ "dev": true }, "commitizen": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-3.0.5.tgz", - "integrity": "sha512-WB9sz7qudArOsW1ninU8YGLNoXLQ5lJBZf538iQ7i96SXAkqVMZdmPtSyN4WFPM5PjQR7rWxDa+hzfGIJfrXUg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-3.0.7.tgz", + "integrity": "sha512-2j8E8Ik1pe1Jqy1gQ1SzEZDJCdr0ItjvhbXmDqhz186Q3ukRoQHMBkmCqmsFYmfDmchBkrOXV1239mTeXEPJKQ==", "dev": true, "requires": { "cachedir": "2.1.0", "cz-conventional-changelog": "2.1.0", "dedent": "0.7.0", "detect-indent": "^5.0.0", - "find-node-modules": "1.0.4", + "find-node-modules": "2.0.0", "find-root": "1.1.0", "fs-extra": "^7.0.0", "glob": "7.1.3", "inquirer": "6.2.0", + "is-utf8": "^0.2.1", "lodash": "4.17.11", "minimist": "1.2.0", "shelljs": "0.7.6", + "strip-bom": "3.0.0", "strip-json-comments": "2.0.1" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } } }, "compare-func": { @@ -1908,9 +1933,9 @@ } }, "coveralls": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.2.tgz", - "integrity": "sha512-Tv0LKe/MkBOilH2v7WBiTBdudg2ChfGbdXafc/s330djpF3zKOmuehTeRwjXWc7pzfj9FrDUTA7tEx6Div8NFw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.3.tgz", + "integrity": "sha512-viNfeGlda2zJr8Gj1zqXpDMRjw9uM54p7wzZdvLRyOgnAfCe974Dq4veZkjJdxQXbmdppu6flEajFYseHYaUhg==", "dev": true, "requires": { "growl": "~> 1.10.0", @@ -1918,7 +1943,7 @@ "lcov-parse": "^0.0.10", "log-driver": "^1.2.7", "minimist": "^1.2.0", - "request": "^2.85.0" + "request": "^2.86.0" } }, "cross-spawn": { @@ -2146,13 +2171,10 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, "detect-file": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", - "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", - "dev": true, - "requires": { - "fs-exists-sync": "^0.1.0" - } + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true }, "detect-indent": { "version": "5.0.0", @@ -2389,30 +2411,56 @@ } }, "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "fill-range": "^2.1.0" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "expand-tilde": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", - "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "dev": true, "requires": { - "os-homedir": "^1.0.1" + "homedir-polyfill": "^1.0.1" } }, "express": { @@ -2516,12 +2564,74 @@ } }, "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "is-extglob": "^1.0.0" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } } }, "extsprintf": { @@ -2883,23 +2993,27 @@ "escape-string-regexp": "^1.0.5" } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "finalhandler": { @@ -2932,13 +3046,13 @@ } }, "find-node-modules": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/find-node-modules/-/find-node-modules-1.0.4.tgz", - "integrity": "sha1-tt6zzMtpnIcDdne87eLF9YYrJVA=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-node-modules/-/find-node-modules-2.0.0.tgz", + "integrity": "sha512-8MWIBRgJi/WpjjfVXumjPKCtmQ10B+fjx6zmSA+770GMJirLhWIzg8l763rhjl9xaeaHbnxPNRQKq2mgMhr+aw==", "dev": true, "requires": { - "findup-sync": "0.4.2", - "merge": "^1.2.0" + "findup-sync": "^3.0.0", + "merge": "^1.2.1" } }, "find-root": { @@ -2975,15 +3089,15 @@ } }, "findup-sync": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.2.tgz", - "integrity": "sha1-qBF9D3MST1pFRoOVef5S1xKfteU=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", "dev": true, "requires": { - "detect-file": "^0.1.0", - "is-glob": "^2.0.1", - "micromatch": "^2.3.7", - "resolve-dir": "^0.1.0" + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" } }, "for-in": { @@ -2992,15 +3106,6 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -3045,12 +3150,6 @@ "readable-stream": "^2.0.0" } }, - "fs-exists-sync": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", - "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", - "dev": true - }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -3184,25 +3283,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, "glob-to-regexp": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", @@ -3210,31 +3290,33 @@ "dev": true }, "global-modules": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", - "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "requires": { - "global-prefix": "^0.1.4", - "is-windows": "^0.2.0" + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" } }, "global-prefix": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", - "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", "dev": true, "requires": { - "homedir-polyfill": "^1.0.0", + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", "ini": "^1.3.4", - "is-windows": "^0.2.0", - "which": "^1.2.12" + "is-windows": "^1.0.1", + "which": "^1.2.14" } }, "globals": { - "version": "11.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", - "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", "dev": true }, "globby": { @@ -3420,9 +3502,9 @@ "dev": true }, "homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", "dev": true, "requires": { "parse-passwd": "^1.0.0" @@ -3838,21 +3920,6 @@ "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", "dev": true }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -3860,9 +3927,9 @@ "dev": true }, "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-finite": { @@ -3882,18 +3949,18 @@ } }, "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", "dev": true, "requires": { - "is-extglob": "^1.0.0" + "is-extglob": "^2.1.1" } }, "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -3928,18 +3995,6 @@ } } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -3977,9 +4032,9 @@ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" }, "is-windows": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", - "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, "isarray": { @@ -3993,13 +4048,10 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, "isomorphic-fetch": { "version": "2.2.1", @@ -4029,15 +4081,15 @@ } }, "istanbul-lib-coverage": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", - "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", "dev": true }, "istanbul-lib-instrument": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.0.0.tgz", - "integrity": "sha512-eQY9vN9elYjdgN9Iv6NS/00bptm02EBBk70lRMaVjeA6QYocQgenVrSgC28TJurdnZa80AGO3ASdFN+w/njGiQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz", + "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==", "dev": true, "requires": { "@babel/generator": "^7.0.0", @@ -4045,7 +4097,7 @@ "@babel/template": "^7.0.0", "@babel/traverse": "^7.0.0", "@babel/types": "^7.0.0", - "istanbul-lib-coverage": "^2.0.1", + "istanbul-lib-coverage": "^2.0.3", "semver": "^5.5.0" } }, @@ -4433,12 +4485,6 @@ } } }, - "math-random": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", - "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", - "dev": true - }, "md5": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", @@ -4504,24 +4550,32 @@ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } } }, "mime": { @@ -5215,15 +5269,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, "normalize-url": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", @@ -8356,53 +8401,37 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "nyc": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.1.0.tgz", - "integrity": "sha512-3GyY6TpQ58z9Frpv4GMExE1SV2tAgYqC7HSy2omEhNiCT3mhT9NyiOvIE8zkbuJVFzmvvNTnE4h/7/wQae7xLg==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.3.0.tgz", + "integrity": "sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w==", "dev": true, "requires": { "archy": "^1.0.0", "arrify": "^1.0.1", - "caching-transform": "^2.0.0", + "caching-transform": "^3.0.1", "convert-source-map": "^1.6.0", - "debug-log": "^1.0.1", "find-cache-dir": "^2.0.0", "find-up": "^3.0.0", "foreground-child": "^1.5.6", "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.1", - "istanbul-lib-hook": "^2.0.1", - "istanbul-lib-instrument": "^3.0.0", - "istanbul-lib-report": "^2.0.2", - "istanbul-lib-source-maps": "^2.0.1", - "istanbul-reports": "^2.0.1", + "istanbul-lib-coverage": "^2.0.3", + "istanbul-lib-hook": "^2.0.3", + "istanbul-lib-instrument": "^3.1.0", + "istanbul-lib-report": "^2.0.4", + "istanbul-lib-source-maps": "^3.0.2", + "istanbul-reports": "^2.1.1", "make-dir": "^1.3.0", "merge-source-map": "^1.1.0", "resolve-from": "^4.0.0", - "rimraf": "^2.6.2", + "rimraf": "^2.6.3", "signal-exit": "^3.0.2", "spawn-wrap": "^1.4.2", - "test-exclude": "^5.0.0", + "test-exclude": "^5.1.0", "uuid": "^3.3.2", - "yargs": "11.1.0", - "yargs-parser": "^9.0.2" + "yargs": "^12.0.5", + "yargs-parser": "^11.1.1" }, "dependencies": { - "align-text": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - } - }, - "amdefine": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, "ansi-regex": { "version": "3.0.0", "bundled": true, @@ -8427,9 +8456,12 @@ "dev": true }, "async": { - "version": "1.5.2", + "version": "2.6.2", "bundled": true, - "dev": true + "dev": true, + "requires": { + "lodash": "^4.17.11" + } }, "balanced-match": { "version": "1.0.0", @@ -8445,55 +8477,30 @@ "concat-map": "0.0.1" } }, - "builtin-modules": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, "caching-transform": { - "version": "2.0.0", + "version": "3.0.1", "bundled": true, "dev": true, "requires": { - "make-dir": "^1.0.0", - "md5-hex": "^2.0.0", - "package-hash": "^2.0.0", - "write-file-atomic": "^2.0.0" + "hasha": "^3.0.0", + "make-dir": "^1.3.0", + "package-hash": "^3.0.0", + "write-file-atomic": "^2.3.0" } }, "camelcase": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true - }, - "center-align": { - "version": "0.1.3", + "version": "5.0.0", "bundled": true, - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } + "dev": true }, "cliui": { - "version": "2.1.0", + "version": "4.1.0", "bundled": true, "dev": true, - "optional": true, "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "bundled": true, - "dev": true, - "optional": true - } + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } }, "code-point-at": { @@ -8501,6 +8508,12 @@ "bundled": true, "dev": true }, + "commander": { + "version": "2.17.1", + "bundled": true, + "dev": true, + "optional": true + }, "commondir": { "version": "1.0.1", "bundled": true, @@ -8529,18 +8542,13 @@ } }, "debug": { - "version": "3.1.0", + "version": "4.1.1", "bundled": true, "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, - "debug-log": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, "decamelize": { "version": "1.2.0", "bundled": true, @@ -8554,6 +8562,14 @@ "strip-bom": "^3.0.0" } }, + "end-of-stream": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, "error-ex": { "version": "1.3.2", "bundled": true, @@ -8568,12 +8584,12 @@ "dev": true }, "execa": { - "version": "0.7.0", + "version": "1.0.0", "bundled": true, "dev": true, "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", "is-stream": "^1.1.0", "npm-run-path": "^2.0.0", "p-finally": "^1.0.0", @@ -8582,11 +8598,13 @@ }, "dependencies": { "cross-spawn": { - "version": "5.1.0", + "version": "6.0.5", "bundled": true, "dev": true, "requires": { - "lru-cache": "^4.0.1", + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } @@ -8631,9 +8649,12 @@ "dev": true }, "get-stream": { - "version": "3.0.0", + "version": "4.1.0", "bundled": true, - "dev": true + "dev": true, + "requires": { + "pump": "^3.0.0" + } }, "glob": { "version": "7.1.3", @@ -8649,28 +8670,25 @@ } }, "graceful-fs": { - "version": "4.1.11", + "version": "4.1.15", "bundled": true, "dev": true }, "handlebars": { - "version": "4.0.11", + "version": "4.1.0", "bundled": true, "dev": true, "requires": { - "async": "^1.4.0", + "async": "^2.5.0", "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" }, "dependencies": { "source-map": { - "version": "0.4.4", + "version": "0.6.1", "bundled": true, - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } + "dev": true } } }, @@ -8679,6 +8697,14 @@ "bundled": true, "dev": true }, + "hasha": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-stream": "^1.0.1" + } + }, "hosted-git-info": { "version": "2.7.1", "bundled": true, @@ -8704,7 +8730,7 @@ "dev": true }, "invert-kv": { - "version": "1.0.0", + "version": "2.0.0", "bundled": true, "dev": true }, @@ -8713,19 +8739,6 @@ "bundled": true, "dev": true }, - "is-buffer": { - "version": "1.1.6", - "bundled": true, - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, "is-fullwidth-code-point": { "version": "2.0.0", "bundled": true, @@ -8742,12 +8755,12 @@ "dev": true }, "istanbul-lib-coverage": { - "version": "2.0.1", + "version": "2.0.3", "bundled": true, "dev": true }, "istanbul-lib-hook": { - "version": "2.0.1", + "version": "2.0.3", "bundled": true, "dev": true, "requires": { @@ -8755,22 +8768,32 @@ } }, "istanbul-lib-report": { - "version": "2.0.2", + "version": "2.0.4", "bundled": true, "dev": true, "requires": { - "istanbul-lib-coverage": "^2.0.1", + "istanbul-lib-coverage": "^2.0.3", "make-dir": "^1.3.0", - "supports-color": "^5.4.0" + "supports-color": "^6.0.0" + }, + "dependencies": { + "supports-color": { + "version": "6.1.0", + "bundled": true, + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "istanbul-lib-source-maps": { - "version": "2.0.1", + "version": "3.0.2", "bundled": true, "dev": true, "requires": { - "debug": "^3.1.0", - "istanbul-lib-coverage": "^2.0.1", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.3", "make-dir": "^1.3.0", "rimraf": "^2.6.2", "source-map": "^0.6.1" @@ -8784,11 +8807,11 @@ } }, "istanbul-reports": { - "version": "2.0.1", + "version": "2.1.1", "bundled": true, "dev": true, "requires": { - "handlebars": "^4.0.11" + "handlebars": "^4.1.0" } }, "json-parse-better-errors": { @@ -8796,26 +8819,12 @@ "bundled": true, "dev": true }, - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "lazy-cache": { - "version": "1.0.4", - "bundled": true, - "dev": true, - "optional": true - }, "lcid": { - "version": "1.0.0", + "version": "2.0.0", "bundled": true, "dev": true, "requires": { - "invert-kv": "^1.0.0" + "invert-kv": "^2.0.0" } }, "load-json-file": { @@ -8838,18 +8847,18 @@ "path-exists": "^3.0.0" } }, - "lodash.flattendeep": { - "version": "4.4.0", + "lodash": { + "version": "4.17.11", "bundled": true, "dev": true }, - "longest": { - "version": "1.0.1", + "lodash.flattendeep": { + "version": "4.4.0", "bundled": true, "dev": true }, "lru-cache": { - "version": "4.1.3", + "version": "4.1.5", "bundled": true, "dev": true, "requires": { @@ -8865,25 +8874,22 @@ "pify": "^3.0.0" } }, - "md5-hex": { - "version": "2.0.0", + "map-age-cleaner": { + "version": "0.1.3", "bundled": true, "dev": true, "requires": { - "md5-o-matic": "^0.1.1" + "p-defer": "^1.0.0" } }, - "md5-o-matic": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, "mem": { - "version": "1.1.0", + "version": "4.1.0", "bundled": true, "dev": true, "requires": { - "mimic-fn": "^1.0.0" + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^1.0.0", + "p-is-promise": "^2.0.0" } }, "merge-source-map": { @@ -8935,17 +8941,22 @@ } }, "ms": { - "version": "2.0.0", + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "nice-try": { + "version": "1.0.5", "bundled": true, "dev": true }, "normalize-package-data": { - "version": "2.4.0", + "version": "2.5.0", "bundled": true, "dev": true, "requires": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" } @@ -8986,23 +8997,33 @@ "dev": true }, "os-locale": { - "version": "2.1.0", + "version": "3.1.0", "bundled": true, "dev": true, "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" } }, + "p-defer": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, "p-finally": { "version": "1.0.0", "bundled": true, "dev": true }, - "p-limit": { + "p-is-promise": { "version": "2.0.0", "bundled": true, + "dev": true + }, + "p-limit": { + "version": "2.1.0", + "bundled": true, "dev": true, "requires": { "p-try": "^2.0.0" @@ -9022,13 +9043,13 @@ "dev": true }, "package-hash": { - "version": "2.0.0", + "version": "3.0.0", "bundled": true, "dev": true, "requires": { - "graceful-fs": "^4.1.11", + "graceful-fs": "^4.1.15", + "hasha": "^3.0.0", "lodash.flattendeep": "^4.4.0", - "md5-hex": "^2.0.0", "release-zalgo": "^1.0.0" } }, @@ -9056,6 +9077,11 @@ "bundled": true, "dev": true }, + "path-parse": { + "version": "1.0.6", + "bundled": true, + "dev": true + }, "path-type": { "version": "3.0.0", "bundled": true, @@ -9082,6 +9108,15 @@ "bundled": true, "dev": true }, + "pump": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "read-pkg": { "version": "3.0.0", "bundled": true, @@ -9109,11 +9144,6 @@ "es6-error": "^4.0.1" } }, - "repeat-string": { - "version": "1.6.1", - "bundled": true, - "dev": true - }, "require-directory": { "version": "2.1.1", "bundled": true, @@ -9124,26 +9154,25 @@ "bundled": true, "dev": true }, - "resolve-from": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "right-align": { - "version": "0.1.3", + "resolve": { + "version": "1.10.0", "bundled": true, "dev": true, - "optional": true, "requires": { - "align-text": "^0.1.1" + "path-parse": "^1.0.6" } }, + "resolve-from": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, "rimraf": { - "version": "2.6.2", + "version": "2.6.3", "bundled": true, "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } }, "safe-buffer": { @@ -9152,7 +9181,7 @@ "dev": true }, "semver": { - "version": "5.5.0", + "version": "5.6.0", "bundled": true, "dev": true }, @@ -9179,12 +9208,6 @@ "bundled": true, "dev": true }, - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true, - "optional": true - }, "spawn-wrap": { "version": "1.4.2", "bundled": true, @@ -9199,7 +9222,7 @@ } }, "spdx-correct": { - "version": "3.0.0", + "version": "3.1.0", "bundled": true, "dev": true, "requires": { @@ -9208,7 +9231,7 @@ } }, "spdx-exceptions": { - "version": "2.1.0", + "version": "2.2.0", "bundled": true, "dev": true }, @@ -9222,7 +9245,7 @@ } }, "spdx-license-ids": { - "version": "3.0.0", + "version": "3.0.3", "bundled": true, "dev": true }, @@ -9253,16 +9276,8 @@ "bundled": true, "dev": true }, - "supports-color": { - "version": "5.4.0", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, "test-exclude": { - "version": "5.0.0", + "version": "5.1.0", "bundled": true, "dev": true, "requires": { @@ -9273,43 +9288,30 @@ } }, "uglify-js": { - "version": "2.8.29", + "version": "3.4.9", "bundled": true, "dev": true, "optional": true, "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" + "commander": "~2.17.1", + "source-map": "~0.6.1" }, "dependencies": { - "yargs": { - "version": "3.10.0", + "source-map": { + "version": "0.6.1", "bundled": true, "dev": true, - "optional": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } + "optional": true } } }, - "uglify-to-browserify": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, "uuid": { "version": "3.3.2", "bundled": true, "dev": true }, "validate-npm-package-license": { - "version": "3.0.3", + "version": "3.0.4", "bundled": true, "dev": true, "requires": { @@ -9330,12 +9332,6 @@ "bundled": true, "dev": true }, - "window-size": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "optional": true - }, "wordwrap": { "version": "0.0.3", "bundled": true, @@ -9389,7 +9385,7 @@ "dev": true }, "write-file-atomic": { - "version": "2.3.0", + "version": "2.4.2", "bundled": true, "dev": true, "requires": { @@ -9399,7 +9395,7 @@ } }, "y18n": { - "version": "3.2.1", + "version": "4.0.0", "bundled": true, "dev": true }, @@ -9409,87 +9405,31 @@ "dev": true }, "yargs": { - "version": "11.1.0", + "version": "12.0.5", "bundled": true, "dev": true, "requires": { "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", + "os-locale": "^3.0.0", "require-directory": "^2.1.1", "require-main-filename": "^1.0.1", "set-blocking": "^2.0.0", "string-width": "^2.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - }, - "dependencies": { - "cliui": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "bundled": true, - "dev": true - } + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" } }, "yargs-parser": { - "version": "9.0.2", + "version": "11.1.1", "bundled": true, "dev": true, "requires": { - "camelcase": "^4.1.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "bundled": true, - "dev": true - } + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } @@ -9543,16 +9483,6 @@ } } }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -9746,18 +9676,6 @@ "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", "dev": true }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - } - }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -10024,12 +9942,6 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", @@ -10101,31 +10013,6 @@ "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", "dev": true }, - "randomatic": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", - "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, "range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", @@ -10244,15 +10131,6 @@ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -10273,12 +10151,6 @@ "safe-buffer": "^5.0.1" } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", @@ -10327,21 +10199,21 @@ } }, "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", + "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", "requires": { - "lodash": "^4.13.1" + "lodash": "^4.17.11" } }, "request-promise-native": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", - "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", + "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", "requires": { - "request-promise-core": "1.1.1", - "stealthy-require": "^1.1.0", - "tough-cookie": ">=2.3.3" + "request-promise-core": "1.1.2", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" } }, "require-directory": { @@ -10373,13 +10245,13 @@ } }, "resolve-dir": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", - "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", "dev": true, "requires": { - "expand-tilde": "^1.2.2", - "global-modules": "^0.2.3" + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" } }, "resolve-from": { @@ -10462,9 +10334,9 @@ "dev": true }, "rxjs": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", - "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", + "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -11526,9 +11398,9 @@ "dev": true }, "typescript": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.4.tgz", - "integrity": "sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3.tgz", + "integrity": "sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 2dec3de..3286311 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ "scripts": { "clean": "rimraf dist coverage .nyc_output uploads", "clean:all": "npm run clean && rimraf node_modules", - "prebuild": "rimraf dist", + "prebuild": "npm i && rimraf dist", "build": "tsc", "build:examples": "(cd examples/lambda-bot-manager && npm i && npm run build) && (cd examples/lambda-bot-filter && npm i && npm run build) && (tsc -p examples)", - "build:all": "npm run build && tsc -p test && npm run build:examples", + "build:all": "npm run build && tsc -p test && npm run build:examples && npm i --package-lock", "commit": "git-cz", "check-coverage": "./node_modules/.bin/nyc check-coverage --statements 90 --branches 60 --functions 80 --lines 90", "report-coverage": "cat ./coverage/lcov.info | coveralls", @@ -37,8 +37,8 @@ "@types/chai-as-promised": "7.1.0", "@types/chai-spies": "1.0.0", "@types/dotenv": "^6.1.0", - "@types/lodash": "^4.14.120", - "@types/mocha": "^5.2.5", + "@types/lodash": "^4.14.121", + "@types/mocha": "^5.2.6", "@types/node": "^10.12.18", "@types/node-wit": "^4.2.2", "@types/request": "^2.48.1", @@ -47,8 +47,8 @@ "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "chai-spies": "^1.0.0", - "commitizen": "^3.0.5", - "coveralls": "^3.0.2", + "commitizen": "^3.0.7", + "coveralls": "^3.0.3", "cz-conventional-changelog": "^2.1.0", "dotenv": "^6.2.0", "got": "^9.6.0", @@ -56,12 +56,12 @@ "mocha": "^5.2.0", "mochawesome": "^3.1.1", "multer": "^1.4.1", - "nyc": "^13.1.0", + "nyc": "^13.3.0", "pem-promise": "^1.0.0", "request": "^2.88.0", "rimraf": "^2.6.3", "semantic-release": "^15.13.3", - "typescript": "^3.2.4" + "typescript": "^3.3.3" }, "config": { "commitizen": { @@ -70,14 +70,14 @@ }, "dependencies": { "@types/debug": "0.0.30", - "@types/express": "^4.16.1", + "@types/express": "4.16.1", "@vivocha/public-entities": "6.6.0", - "arrest": "^7.5.0", - "lodash": "^4.17.11", - "node-wit": "^5.0.0", - "request-promise-native": "^1.0.5", - "serverless-http": "^1.9.0", - "uuid": "^3.3.2" + "arrest": "7.5.0", + "lodash": "4.17.11", + "node-wit": "5.0.0", + "request-promise-native": "1.0.7", + "serverless-http": "1.9.0", + "uuid": "3.3.2" }, "husky": { "hooks": { diff --git a/tsconfig.json b/tsconfig.json index a5342ed..42fca44 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,15 +1,13 @@ { - "compilerOptions": { - "module": "commonjs", - "target": "es2017", - "noImplicitAny": false, - "sourceMap": true, - "declaration": true, - "outDir": "dist", - "strictNullChecks": true, - "allowJs": false - }, - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file + "compilerOptions": { + "module": "commonjs", + "target": "es2017", + "noImplicitAny": false, + "sourceMap": true, + "declaration": true, + "outDir": "dist", + "strictNullChecks": true, + "allowJs": false + }, + "include": ["src/**/*.ts"] +}