File tree 3 files changed +56
-0
lines changed
3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import * as CLIENT_NO_EVICT from '../commands/CLIENT_NO-EVICT';
25
25
import * as CLIENT_PAUSE from '../commands/CLIENT_PAUSE' ;
26
26
import * as CLIENT_SETNAME from '../commands/CLIENT_SETNAME' ;
27
27
import * as CLIENT_TRACKING from '../commands/CLIENT_TRACKING' ;
28
+ import * as CLIENT_TRACKINGINFO from '../commands/CLIENT_TRACKINGINFO' ;
28
29
import * as CLIENT_UNPAUSE from '../commands/CLIENT_UNPAUSE' ;
29
30
import * as CLIENT_INFO from '../commands/CLIENT_INFO' ;
30
31
import * as CLUSTER_ADDSLOTS from '../commands/CLUSTER_ADDSLOTS' ;
@@ -168,6 +169,8 @@ export default {
168
169
clientSetName : CLIENT_SETNAME ,
169
170
CLIENT_TRACKING ,
170
171
clientTracking : CLIENT_TRACKING ,
172
+ CLIENT_TRACKINGINFO ,
173
+ clientTrackingInfo : CLIENT_TRACKINGINFO ,
171
174
CLIENT_UNPAUSE ,
172
175
clientUnpause : CLIENT_UNPAUSE ,
173
176
CLIENT_INFO ,
Original file line number Diff line number Diff line change
1
+ import { strict as assert } from 'assert' ;
2
+ import testUtils , { GLOBAL } from '../test-utils' ;
3
+ import { transformArguments } from './CLIENT_TRACKINGINFO' ;
4
+
5
+ describe ( 'CLIENT TRACKINGINFO' , ( ) => {
6
+ testUtils . isVersionGreaterThanHook ( [ 6 , 2 ] ) ;
7
+
8
+ it ( 'transformArguments' , ( ) => {
9
+ assert . deepEqual (
10
+ transformArguments ( ) ,
11
+ [ 'CLIENT' , 'TRACKINGINFO' ]
12
+ ) ;
13
+ } ) ;
14
+
15
+ testUtils . testWithClient ( 'client.clientTrackingInfo' , async client => {
16
+ assert . deepEqual (
17
+ await client . clientTrackingInfo ( ) ,
18
+ {
19
+ flags : new Set ( [ 'off' ] ) ,
20
+ redirect : - 1 ,
21
+ prefixes : [ ]
22
+ }
23
+ ) ;
24
+ } , GLOBAL . SERVERS . OPEN ) ;
25
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { RedisCommandArguments } from '.' ;
2
+
3
+ export function transformArguments ( ) : RedisCommandArguments {
4
+ return [ 'CLIENT' , 'TRACKINGINFO' ] ;
5
+ }
6
+
7
+ type RawReply = [
8
+ 'flags' ,
9
+ Array < string > ,
10
+ 'redirect' ,
11
+ number ,
12
+ 'prefixes' ,
13
+ Array < string >
14
+ ] ;
15
+
16
+ interface Reply {
17
+ flags : Set < string > ;
18
+ redirect : number ;
19
+ prefixes : Array < string > ;
20
+ }
21
+
22
+ export function transformReply ( reply : RawReply ) : Reply {
23
+ return {
24
+ flags : new Set ( reply [ 1 ] ) ,
25
+ redirect : reply [ 3 ] ,
26
+ prefixes : reply [ 5 ]
27
+ } ;
28
+ }
You can’t perform that action at this time.
0 commit comments