Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prisma-redis-middleware

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-redis-middleware - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

4

dist/index.d.ts

@@ -1,2 +0,2 @@

import type { CreatePrismaRedisCache, Middleware, Result } from "./types";
export declare const createPrismaRedisCache: ({ models, onDedupe, onError, onHit, onMiss, storage, cacheTime, excludeModels, excludeMethods, }: CreatePrismaRedisCache) => Middleware<Result>;
import type { CreatePrismaRedisCache, Middleware } from "./types";
export declare const createPrismaRedisCache: ({ models, onDedupe, onError, onHit, onMiss, storage, cacheTime, excludeModels, excludeMethods, }: CreatePrismaRedisCache) => Middleware<any>;

@@ -17,3 +17,3 @@ import type Redis from "ioredis";

};
export declare type Middleware<T = Result> = (params: MiddlewareParams, next: (params: MiddlewareParams) => Promise<T>) => Promise<T>;
export declare type Middleware<T = any> = (params: MiddlewareParams, next: (params: MiddlewareParams) => Promise<T>) => Promise<T>;
export declare type FetchFromPrisma = (params: MiddlewareParams) => Promise<Result>;

@@ -20,0 +20,0 @@ export declare type RedisMemoryOptions = {

{
"name": "prisma-redis-middleware",
"author": "A-J Roos <asjas@hey.com>",
"version": "3.1.0",
"version": "3.2.0",
"description": "Prisma Middleware for caching results of queries in Redis",

@@ -22,3 +22,3 @@ "license": "Hippocratic-3.0",

"test:watch": "vitest -w",
"coverage": "vitest run --coverage",
"coverage": "c8 --reporter=lcov vitest run --coverage",
"check-types": "tsc",

@@ -36,3 +36,3 @@ "lint": "eslint --ext .ts .",

"async-cache-dedupe": "1.2.2",
"ioredis": "5.0.3"
"ioredis": "5.0.4"
},

@@ -46,3 +46,3 @@ "devDependencies": {

"ioredis-mock": "7.2.0",
"lint-staged": "12.3.7",
"lint-staged": "12.3.8",
"npm-run-all": "4.1.5",

@@ -54,3 +54,3 @@ "rimraf": "3.0.2",

"typescript": "4.6.3",
"vitest": "0.9.0"
"vitest": "0.9.3"
},

@@ -57,0 +57,0 @@ "husky": {

@@ -89,3 +89,3 @@ # `prisma-redis-middleware`

models: [
{ model: "User", cacheTime: 60, excludeMethods: "findMany" },
{ model: "User", cacheTime: 60, excludeMethods: ["findMany"] },
{ model: "Post", cacheTime: 180, cacheKey: "article" },

@@ -96,3 +96,3 @@ ],

excludeModels: ["Product", "Cart"],
excludeMethods: ["count", "groupby"],
excludeMethods: ["count", "groupBy"],
onDedupe: (key) => {

@@ -99,0 +99,0 @@ console.log("deduped", key);

@@ -40,3 +40,3 @@ import type Redis from "ioredis";

// https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#use
export type Middleware<T = Result> = (
export type Middleware<T = any> = (
params: MiddlewareParams,

@@ -43,0 +43,0 @@ next: (params: MiddlewareParams) => Promise<T>,

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