File tree 3 files changed +31
-0
lines changed
3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ import * as XRANGE from '../commands/XRANGE';
155
155
import * as XREAD from '../commands/XREAD' ;
156
156
import * as XREADGROUP from '../commands/XREADGROUP' ;
157
157
import * as XREVRANGE from '../commands/XREVRANGE' ;
158
+ import * as XSETID from '../commands/XSETID' ;
158
159
import * as XTRIM from '../commands/XTRIM' ;
159
160
import * as ZADD from '../commands/ZADD' ;
160
161
import * as ZCARD from '../commands/ZCARD' ;
@@ -508,6 +509,8 @@ export default {
508
509
xReadGroup : XREADGROUP ,
509
510
XREVRANGE ,
510
511
xRevRange : XREVRANGE ,
512
+ XSETID ,
513
+ xSetId : XSETID ,
511
514
XTRIM ,
512
515
xTrim : XTRIM ,
513
516
ZADD ,
Original file line number Diff line number Diff line change
1
+ import { RedisCommandArgument , RedisCommandArguments } from '.' ;
2
+
3
+ export const FIRST_KEY_INDEX = 1 ;
4
+
5
+ interface XSetIdOptions {
6
+ ENTRIESADDED ?: number ;
7
+ MAXDELETEDID ?: RedisCommandArgument ;
8
+ }
9
+
10
+ export function transformArguments (
11
+ key : RedisCommandArgument ,
12
+ lastId : RedisCommandArgument ,
13
+ options ?: XSetIdOptions
14
+ ) : RedisCommandArguments {
15
+ const args = [ 'XSETID' , key , lastId ] ;
16
+
17
+ if ( options ?. ENTRIESADDED ) {
18
+ args . push ( 'ENTRIESADDED' , options . ENTRIESADDED . toString ( ) ) ;
19
+ }
20
+
21
+ if ( options ?. MAXDELETEDID ) {
22
+ args . push ( 'MAXDELETEDID' , options . MAXDELETEDID ) ;
23
+ }
24
+
25
+ return args ;
26
+ }
27
+
28
+ export declare function transformReply ( ) : 'OK' ;
You can’t perform that action at this time.
0 commit comments