fix(redis): paginate stream entries
This commit is contained in:
1 parent
7775bbf8f8
commit
223e9b3a2f
21 files changed
+479
-33
No files matched your search
@@ -392,6 +392,7 @@ export const redisScanKeys = forward("redisScanKeys");
|
||||
export const redisScanKeysBatch = forward("redisScanKeysBatch");
|
||||
export const redisScanValues = forward("redisScanValues");
|
||||
export const redisGetValue = forward("redisGetValue");
|
||||
export const redisGetStreamEntries = forward("redisGetStreamEntries");
|
||||
export const redisGetStreamGroups = forward("redisGetStreamGroups");
|
||||
export const redisGetStreamConsumers = forward("redisGetStreamConsumers");
|
||||
export const redisGetStreamPending = forward("redisGetStreamPending");
|
||||
@@ -640,6 +641,7 @@ export type {
|
||||
RedisStreamField,
|
||||
RedisStreamGroup,
|
||||
RedisStreamMetric,
|
||||
RedisStreamPage,
|
||||
RedisStreamPendingEntry,
|
||||
RedisStreamPendingPage,
|
||||
RedisValue,
|
||||
|
||||
@@ -70,6 +70,7 @@ import type {
|
||||
RedisDatabaseInfo,
|
||||
RedisStreamConsumer,
|
||||
RedisStreamGroup,
|
||||
RedisStreamPage,
|
||||
RedisStreamPendingPage,
|
||||
RedisValue,
|
||||
RedisScanResult,
|
||||
@@ -2253,6 +2254,10 @@ export async function redisGetValue(connectionId: string, db: number, keyRaw: st
|
||||
return post("/api/redis/get-value", { connectionId, db, keyRaw });
|
||||
}
|
||||
|
||||
export async function redisGetStreamEntries(connectionId: string, db: number, keyRaw: string, cursor?: string): Promise<RedisStreamPage> {
|
||||
return post("/api/redis/get-stream-entries", { connectionId, db, keyRaw, cursor });
|
||||
}
|
||||
|
||||
export async function redisGetStreamGroups(connectionId: string, db: number, keyRaw: string): Promise<RedisStreamGroup[]> {
|
||||
return post("/api/redis/get-stream-groups", { connectionId, db, keyRaw });
|
||||
}
|
||||
|
||||
@@ -1949,6 +1949,11 @@ export interface RedisStreamEntry {
|
||||
fields: RedisStreamField[];
|
||||
}
|
||||
|
||||
export interface RedisStreamPage {
|
||||
entries: RedisStreamEntry[];
|
||||
next_cursor?: string;
|
||||
}
|
||||
|
||||
// Redis counters above Number.MAX_SAFE_INTEGER are transported as decimal strings.
|
||||
export type RedisStreamMetric = number | string;
|
||||
|
||||
@@ -2002,7 +2007,7 @@ export type RedisValueData =
|
||||
total: number;
|
||||
scan_cursor?: number;
|
||||
}
|
||||
| { kind: "stream"; entries: RedisStreamEntry[] }
|
||||
| { kind: "stream"; entries: RedisStreamEntry[]; total?: number; next_cursor?: string }
|
||||
| { kind: "unknown" };
|
||||
|
||||
export interface RedisValue {
|
||||
@@ -2085,6 +2090,10 @@ export async function redisGetValue(connectionId: string, db: number, keyRaw: st
|
||||
return invoke("redis_get_value", { connectionId, db, keyRaw });
|
||||
}
|
||||
|
||||
export async function redisGetStreamEntries(connectionId: string, db: number, keyRaw: string, cursor?: string): Promise<RedisStreamPage> {
|
||||
return invoke("redis_get_stream_entries", { connectionId, db, keyRaw, cursor });
|
||||
}
|
||||
|
||||
export async function redisGetStreamGroups(connectionId: string, db: number, keyRaw: string): Promise<RedisStreamGroup[]> {
|
||||
return invoke("redis_get_stream_groups", { connectionId, db, keyRaw });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user