Socket
Socket
Sign inDemoInstall

@salutejs/storage-adapter-memory

Package Overview
Dependencies
Maintainers
3
Versions
240
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@salutejs/storage-adapter-memory

In memory storage adapter for SaluteJS


Version published
Weekly downloads
176
increased by46.67%
Maintainers
3
Weekly downloads
 
Created
Source

@salutejs/storage-adapter-memory

Адаптер для хранения сессии в памяти процесса.

npm i -S @salutejs/storage-adapter-memory

Использование

import { createSaluteRequest, createSaluteResponse, createScenarioWalker } from '@salutejs/scenario';
import { SaluteMemoryStorage } from '@salutejs/memory';
import express from 'express';

//...

const app = express();
app.use(express.json());

const storage = new SaluteMemoryStorage();
const scenarioWalker = createScenarioWalker({
    intents,
    recognizer,
    systemScenario,
    userScenario,
});

app.post('/', async ({ body }, response) => {
    const req = createSaluteRequest(body);
    const res = createSaluteResponse(body);
    const session = await storage.resolve(body.uuid.sessionId);

    await scenarioWalker({ req, res, session });

    await storage.save({ id: body.uuid.sessionId, session });

    response.status(200).json(res.message);
});

SberDevices with :heart:

FAQs

Package last updated on 19 Aug 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc