1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00

stream commands + some more

This commit is contained in:
Leibale
2023-06-28 11:40:46 -04:00
parent 1bda2400e5
commit ea2d9d2a77
54 changed files with 1513 additions and 1455 deletions

View File

@@ -1,13 +1,26 @@
// import { RedisCommandArgument, RedisCommandArguments } from '.';
import { RedisArgument, SimpleStringReply, Command } from '../RESP/types';
// export const FIRST_KEY_INDEX = 2;
export interface XGroupSetIdOptions {
/** added in 7.0 */
ENTRIESREAD?: number;
}
// export function transformArguments(
// key: RedisCommandArgument,
// group: RedisCommandArgument,
// id: RedisCommandArgument
// ): RedisCommandArguments {
// return ['XGROUP', 'SETID', key, group, id];
// }
export default {
FIRST_KEY_INDEX: 2,
IS_READ_ONLY: false,
transformArguments(
key: RedisArgument,
group: RedisArgument,
id: RedisArgument,
options?: XGroupSetIdOptions
) {
const args = ['XGROUP', 'SETID', key, group, id];
// export declare function transformReply(): RedisCommandArgument;
if (options?.ENTRIESREAD) {
args.push('ENTRIESREAD', options.ENTRIESREAD.toString());
}
return args;
},
transformReply: undefined as unknown as () => SimpleStringReply<'OK'>
} as const satisfies Command;