From fc6610ebafcad03629acc26054f5a70f8ec11d03 Mon Sep 17 00:00:00 2001 From: Arnaud Durand Date: Wed, 2 Apr 2025 23:41:18 +0200 Subject: [PATCH] Upgrade @upstash/redis to 1.34 --- package.json | 2 +- src/collection.ts | 4 ++-- src/collection_index.ts | 2 +- src/interceptor.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 663978e..0d0f68e 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "next": "^13.4.19", "tsup": "^7.2.0", "typescript": "^5.2.2", - "@upstash/redis": "^1.22.0" + "@upstash/redis": "^1.36.0" }, "dependencies": { "crypto-js": "^4.1.1" diff --git a/src/collection.ts b/src/collection.ts index fc33686..9d6da73 100644 --- a/src/collection.ts +++ b/src/collection.ts @@ -119,13 +119,13 @@ export class Collection { documents = await this.redis.mget(...documentIds.map((id) => this.documentKey(id))); } else { const documentKeys: string[] = []; - let cursor = 0; + let cursor = '0'; while (true) { const [c, keys] = await this.redis.scan(cursor, { match: this.documentKey("*"), }); documentKeys.push(...keys); - if (c > 0) { + if (c !== '0') { cursor = c; } else { break; diff --git a/src/collection_index.ts b/src/collection_index.ts index 0dedde0..9bd8846 100644 --- a/src/collection_index.ts +++ b/src/collection_index.ts @@ -1,5 +1,5 @@ import { Redis } from "@upstash/redis"; -import type { Pipeline } from "@upstash/redis/types/pkg/pipeline"; +import type { Pipeline } from "@upstash/redis"; import { Collection } from "./collection"; import { INDEX_PREFIX } from "./constants"; import type { DotNotation } from "./dot-notation"; diff --git a/src/interceptor.ts b/src/interceptor.ts index e861da8..50b46e4 100644 --- a/src/interceptor.ts +++ b/src/interceptor.ts @@ -1,4 +1,4 @@ -import type { Pipeline } from "@upstash/redis/types/pkg/pipeline"; +import type { Pipeline } from "@upstash/redis"; import { Data, Document } from "./types"; export enum Event {