You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
* (docs) bloom: add jsdocs for all commands * (docs) json: add jsdocs * (docs) search: add jsdocs for all commands * (docs) jsdocs for std commands * (docs) jsdoc comments to time series commands
29 lines
928 B
TypeScript
29 lines
928 B
TypeScript
import { CommandParser } from '../client/parser';
|
|
import { TuplesToMapReply, BlobStringReply, SetReply, NumberReply, ArrayReply, UnwrapReply, Resp2Reply, Command } from '../RESP/types';
|
|
|
|
type TrackingInfo = TuplesToMapReply<[
|
|
[BlobStringReply<'flags'>, SetReply<BlobStringReply>],
|
|
[BlobStringReply<'redirect'>, NumberReply],
|
|
[BlobStringReply<'prefixes'>, ArrayReply<BlobStringReply>]
|
|
]>;
|
|
|
|
export default {
|
|
NOT_KEYED_COMMAND: true,
|
|
IS_READ_ONLY: true,
|
|
/**
|
|
* Returns information about the current connection's key tracking state
|
|
* @param parser - The Redis command parser
|
|
*/
|
|
parseCommand(parser: CommandParser) {
|
|
parser.push('CLIENT', 'TRACKINGINFO');
|
|
},
|
|
transformReply: {
|
|
2: (reply: UnwrapReply<Resp2Reply<TrackingInfo>>) => ({
|
|
flags: reply[1],
|
|
redirect: reply[3],
|
|
prefixes: reply[5]
|
|
}),
|
|
3: undefined as unknown as () => TrackingInfo
|
|
}
|
|
} as const satisfies Command;
|