-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Freeze dependencies
- Loading branch information
Antonio Pintus
committed
Feb 26, 2019
1 parent
ca1919f
commit 9ab282b
Showing
10 changed files
with
2,147 additions
and
2,155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
"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; | ||
// maybe calling an API or reading from a DB... | ||
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<BotRequest> => { | ||
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)); | ||
module.exports.handler = serverless(toLambda(filter)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.