import { RedisArgument, ArrayReply, TuplesReply, BlobStringReply, UnwrapReply, Command } from '@redis/client/dist/lib/RESP/types'; import { CommandParser } from '@redis/client/dist/lib/client/parser'; type SlowLogRawReply = ArrayReply>; export default { IS_READ_ONLY: true, parseCommand(parser: CommandParser, key: RedisArgument) { parser.push('GRAPH.SLOWLOG'); parser.pushKey(key); }, transformReply(reply: UnwrapReply) { return reply.map(log => { const [timestamp, command, query, took] = log as unknown as UnwrapReply; return { timestamp: Number(timestamp), command, query, took: Number(took) }; }); } } as const satisfies Command;