1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +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,24 +1,34 @@
// import { RedisCommandArgument, RedisCommandArguments } from '.';
import { RedisArgument, SimpleStringReply, Command } from '../RESP/types';
// export const FIRST_KEY_INDEX = 2;
export interface XGroupCreateOptions {
MKSTREAM?: boolean;
/**
* added in 7.0
*/
ENTRIESREAD?: number;
}
// interface XGroupCreateOptions {
// MKSTREAM?: true;
// }
export default {
FIRST_KEY_INDEX: 2,
IS_READ_ONLY: false,
transformArguments(
key: RedisArgument,
group: RedisArgument,
id: RedisArgument,
options?: XGroupCreateOptions
) {
const args = ['XGROUP', 'CREATE', key, group, id];
// export function transformArguments(
// key: RedisCommandArgument,
// group: RedisCommandArgument,
// id: RedisCommandArgument,
// options?: XGroupCreateOptions
// ): RedisCommandArguments {
// const args = ['XGROUP', 'CREATE', key, group, id];
if (options?.MKSTREAM) {
args.push('MKSTREAM');
}
// if (options?.MKSTREAM) {
// args.push('MKSTREAM');
// }
if (options?.ENTRIESREAD) {
args.push('ENTRIESREAD', options.ENTRIESREAD.toString());
}
// return args;
// }
return args;
},
transformReply: undefined as unknown as () => SimpleStringReply<'OK'>
} as const satisfies Command;
// export declare function transformReply(): RedisCommandArgument;