prisma-redis-middleware
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -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>, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
277921
+ Addedioredis@5.0.4(transitive)
- Removedioredis@5.0.3(transitive)
Updatedioredis@5.0.4