Skip to content

Commit

Permalink
fix: bump redis
Browse files Browse the repository at this point in the history
  • Loading branch information
CahidArda committed Oct 21, 2024
1 parent 7aa7aa7 commit 658e3d2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 23 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/cloudflare-workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"deploy": "wrangler publish"
},
"dependencies": {
"@upstash/ratelimit": "^1.0.3",
"@upstash/redis": "^1.20.6"
"@upstash/ratelimit": "latest",
"@upstash/redis": "latest"
}
}
1 change: 0 additions & 1 deletion examples/nextjs/app/api/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const redis = new Redis({

// Create a new ratelimiter
const ratelimit = new Ratelimit({
// @ts-ignore
redis,
limiter: Ratelimit.slidingWindow(10, "10 s"),
prefix: "@upstash/ratelimit",
Expand Down
6 changes: 3 additions & 3 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"lint": "next lint"
},
"dependencies": {
"@upstash/ratelimit": "^1.1.3",
"@upstash/redis": "^1.34.2",
"@upstash/ratelimit": "latest",
"@upstash/redis": "latest",
"@vercel/functions": "^1.0.2",
"next": "14.2.3",
"react": "^18",
Expand All @@ -30,4 +30,4 @@
},
"module": "index.ts",
"type": "module"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@upstash/redis": "^1.31.5",
"@upstash/redis": "^1.34.3",
"bun-types": "latest",
"eslint": "^9.10.0",
"eslint-plugin-unicorn": "^55.0.0",
Expand Down
24 changes: 8 additions & 16 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Pipeline } from "@upstash/redis";
import type { Redis as RedisCore } from "@upstash/redis";
import type { Geo } from "./analytics";

/**
Expand Down Expand Up @@ -123,25 +123,17 @@ export type LimitOptions = {
* This is all we need from the redis sdk.
*/
export type Redis = {
sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
sadd: RedisCore["sadd"]

hset: <TValue>(key: string, obj: { [key: string]: TValue }) => Promise<number>;
hset: RedisCore["hset"]

eval: <TArgs extends unknown[], TData = unknown>(
...args: [script: string, keys: string[], args: TArgs]
) => Promise<TData>;
eval: RedisCore["eval"]

evalsha: <TArgs extends unknown[], TData = unknown>(
...args: [sha1: string, keys: string[], args: TArgs]
) => Promise<TData>;
evalsha: RedisCore["evalsha"]

scriptLoad: (
...args: [script: string]
) => Promise<string>;
scriptLoad: RedisCore["scriptLoad"]

smismember: (
key: string, members: string[]
) => Promise<IsDenied[]>;
smismember: RedisCore["smismember"]

multi: () => Pipeline
multi: RedisCore["multi"]
}

0 comments on commit 658e3d2

Please sign in to comment.