Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

@salutejs/storage-adapter-memory

Package Overview
Dependencies
1
Maintainers
4
Versions
133
Issues
File Explorer

Advanced tools

@salutejs/storage-adapter-memory

In memory storage adapter for SaluteJS

    0.33.0latest
    GitHub

Version published
Maintainers
4
Weekly downloads
854
increased by11.34%

Weekly downloads

Readme

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); });

FAQs

Last updated on 20 Mar 2023

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc