Skip to content

Commit

Permalink
fix(dep): freeze dependencies
Browse files Browse the repository at this point in the history
Freeze dependencies
  • Loading branch information
Antonio Pintus committed Feb 26, 2019
1 parent ca1919f commit 9ab282b
Show file tree
Hide file tree
Showing 10 changed files with 2,147 additions and 2,155 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion examples/lambda-bot-filter/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
12 changes: 7 additions & 5 deletions examples/lambda-bot-filter/src/lambda-bot-filter.js
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));
24 changes: 13 additions & 11 deletions examples/lambda-bot-filter/src/lambda-bot-filter.ts
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));
2 changes: 1 addition & 1 deletion examples/lambda-bot-manager/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Loading

0 comments on commit 9ab282b

Please sign in to comment.