New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lbu/store

Package Overview
Dependencies
Maintainers
2
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lbu/store - npm Package Compare versions

Comparing version 0.0.51 to 0.0.52

24

index.d.ts

@@ -373,27 +373,11 @@ import * as minioVendor from "minio";

/**
* Stop the background job
* Remove all expired sessions
*/
kill(): void;
clean(): Promise<void>;
}
export interface SessionStoreOptions {
/**
* Interval at which a background job runs to remove expired sessions
* Defaults to 45 minutes
*/
cleanupInterval?: number;
/**
* Disable deletion interval completely
*/
disableInterval?: boolean;
}
/**
* Create a session store that can be used in combination with @lbu/server#session
* Create a session store compatible with @lbu/server#session
*/
export function newSessionStore(
sql: postgresVendor.Sql<{}>,
opts?: SessionStoreOptions,
): SessionStore;
export function newSessionStore(sql: postgresVendor.Sql<{}>): SessionStore;

@@ -400,0 +384,0 @@ /**

8

package.json
{
"name": "@lbu/store",
"version": "0.0.51",
"version": "0.0.52",
"description": "Postgres & S3-compatible wrappers for common things",

@@ -18,4 +18,4 @@ "main": "./index.js",

"dependencies": {
"@lbu/insight": "0.0.51",
"@lbu/stdlib": "0.0.51",
"@lbu/insight": "0.0.52",
"@lbu/stdlib": "0.0.52",
"@types/minio": "7.0.6",

@@ -47,3 +47,3 @@ "mime-types": "2.1.27",

},
"gitHead": "25c297d76a4ac9d9a1bb4c0f6ab917d12db6f5f2"
"gitHead": "a41579009d718cd285ea960c7ef5e66cc1eed9dd"
}
import { storeQueries } from "./generated/queries.js";
const DELETE_INTERVAL = 45 * 60 * 1000; // 45 minutes
/**
*
* @param sql
* @param {object} [options]
* @param {number} [options.cleanupInterval]
* @param {boolean} [options.disableInterval]
* @param {Postgres} sql
* @returns {SessionStore}
*/
export function newSessionStore(sql, options) {
options = options || {};
options.cleanupInterval = options.cleanupInterval || DELETE_INTERVAL; // 45 minutes
let interval;
if (!options.disableInterval) {
interval = setInterval(() => {
storeQueries.sessionStoreDelete(sql, { expiresLowerThan: new Date() });
}, options.cleanupInterval);
}
export function newSessionStore(sql) {
return {

@@ -46,6 +29,8 @@ get: async (sid) => {

},
kill: () => {
clearInterval(interval);
clean: () => {
return storeQueries.sessionStoreDelete(sql, {
expiresLowerThan: new Date(),
});
},
};
}
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