You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
wip
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Resp2Reply } from '../RESP/types';
|
||||
import { DoubleReply, Resp2Reply } from '../RESP/types';
|
||||
import { ArrayReply, BlobStringReply, Command, NumberReply, TuplesToMapReply } from '../RESP/types';
|
||||
|
||||
export type AclLogReply = ArrayReply<TuplesToMapReply<[
|
||||
@@ -7,8 +7,14 @@ export type AclLogReply = ArrayReply<TuplesToMapReply<[
|
||||
[BlobStringReply<'context'>, BlobStringReply],
|
||||
[BlobStringReply<'object'>, BlobStringReply],
|
||||
[BlobStringReply<'username'>, BlobStringReply],
|
||||
[BlobStringReply<'age-seconds'>, BlobStringReply],
|
||||
[BlobStringReply<'client-info'>, BlobStringReply]
|
||||
[BlobStringReply<'age-seconds'>, DoubleReply],
|
||||
[BlobStringReply<'client-info'>, BlobStringReply],
|
||||
/** added in 7.0 */
|
||||
[BlobStringReply<'entry-id'>, NumberReply],
|
||||
/** added in 7.0 */
|
||||
[BlobStringReply<'timestamp-created'>, NumberReply],
|
||||
/** added in 7.0 */
|
||||
[BlobStringReply<'timestamp-last-updated'>, NumberReply]
|
||||
]>>;
|
||||
|
||||
export default {
|
||||
@@ -24,15 +30,18 @@ export default {
|
||||
return args;
|
||||
},
|
||||
transformReply: {
|
||||
2: (reply: Resp2Reply<AclLogReply>) => ({
|
||||
count: Number(reply[1]),
|
||||
reason: reply[3],
|
||||
context: reply[5],
|
||||
object: reply[7],
|
||||
username: reply[9],
|
||||
'age-seconds': Number(reply[11]),
|
||||
'client-info': reply[13]
|
||||
}),
|
||||
2: (reply: Resp2Reply<AclLogReply>) => reply.map(item => ({
|
||||
count: item[1],
|
||||
reason: item[3],
|
||||
context: item[5],
|
||||
object: item[7],
|
||||
username: item[9],
|
||||
'age-seconds': Number(item[11]),
|
||||
'client-info': item[13],
|
||||
'entry-id': item[15],
|
||||
'timestamp-created': item[17],
|
||||
'timestamp-last-updated': item[19]
|
||||
})),
|
||||
3: undefined as unknown as () => AclLogReply
|
||||
}
|
||||
} as const satisfies Command;
|
||||
|
Reference in New Issue
Block a user