Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
botmaster-session-ware
Advanced tools
A configurable botmaster ware to provide session data to downstream middleware. Works with Botmaster ^3.0.7.
npm install botmaster-session-ware -S
const Botmaster = require('botmaster');
const SessionWare = require('botmaster-session-ware');
botmaster.use({
type: 'incoming',
name: 'some controller',
controller: (bot, update) => {
// this will be {} on the first call from a certain user
// and will contain the last message upon all the next iterations
console.log(update.session);
update.session.lastMessage = update.message;
}
})
.
.
.
// place after declaring all your other middleware
const sessionWare = SessionWare();
botmaster.useWrapped(sessionWare.incoming, sessionWare.outgoing);
Adapters should be provided in their own package. Their api must follow the MemoryStore example.
Create an object providing incoming and outgoing middleware that manages a
session object for you. By using this middleware, your other middleware will
have access to a persisted update.session
object.
Parameters
options
[Object] options object for generated sessionWare
Returns Object an object that contains two functions 'incoming' and 'outgoing'. They should be used with the useWrapped method of botmaster
The most basic adapter ever for SessionWare. This is the default store that is
used when instantiating a SessionWare object without any params.
It provides the standard required API for stores. I.e. a getter and a setter method.
Called get
and set
that both return promises where get resolves with the session
value and set sets the session value
Get or create a session with the id.
Parameters
id
String a unique id for the sessionReturns Promise evaluates to an object that is the session
Update a session in the storage.
Parameters
Returns Promise resolves when the session has been saved
FAQs
botmaster session ware for storing context
We found that botmaster-session-ware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.