3.6.1 • Published 2 years ago

jovo-plugin-inbox v3.6.1

Weekly downloads
100
License
Apache-2.0
Repository
-
Last release
2 years ago

Jovo Inbox Plugin

Installation

npm install --save jovo-plugin-inbox

This plugin uses TypeORM to provide access to various databases. Depending on the SQL Database you use, an additional installation of the database driver is necessary.

MySQL or MariaDB

npm install --save mysql

PostgreSQL or CockraochDB

npm install pg --save

SQLite

npm install --save sqlite3

More databases: https://typeorm.io/#/undefined/installation

Usage

const { JovoInboxPlugin } = require('jovo-plugin-inbox');

app.use(
    new JovoInboxPlugin({
        appId: 'PizzaPlace',
        db: {
			type: 'mysql',
			host: 'host',
			port: 3306,
			username: 'user',
			password: 'pass',
			database: 'jovoinbox',
		},         
    })
);

See https://github.com/typeorm/typeorm/blob/master/docs/connection-options.md for database specific config.

Config

{
    appId: string;
    defaultLocale: string; // defaultLocale for platforms without a locale in the request
    skipPlatforms?: string[]; // platforms where no data is stored, e.g. ['Alexa', 'GoogleAssistant']
    skipLocales?: string[]; // requests from given locales are skipped, e.g. ['de', 'en-US'],
    skipUserIds?: string[]; // users from given ids are skipped, e.g. ['jovo-debugger-user']
    skipRequestObjects?: string[]; // paths to objects in request json, e.g. ['context.System.apiAccessToken']
    skipResponseObjects?: string[]; // paths to objects in response json,
    maskRequestObjects?: string[]; // paths to objects in request json that are masked, e.g. sensitive data like access tokens
    maskResponseObjects?: string[]; // paths to objects in response json that are masked
    maskValue: string | Function; // new value for masked objects
    db: ConnectionOptions; // db connection options 
}

Troubleshooting

Open database connections on AWS Lambda won't let the event loop get empty. The result is a timeout for every request. This can be fixed by adding the following line into the handler method inindex.js / index.ts

exports.handler = async (event, context, callback) => {
  context.callbackWaitsForEmptyEventLoop = false; // <-- ADD THIS
  await app.handle(new Lambda(event, context, callback));
};
3.6.1

2 years ago

3.6.0

2 years ago

3.5.2

3 years ago

3.5.1

3 years ago

3.5.0

3 years ago

3.4.1

3 years ago

3.4.0

3 years ago

3.3.1

3 years ago