Skip to content

Commit 5daf11b

Browse files
committed
move tuples to map to requiring simple string for map key
adjust all usages of it to SimpleStringReply
1 parent f13f47a commit 5daf11b

21 files changed

+154
-154
lines changed

packages/bloom/lib/commands/bloom/INFO.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { RedisArgument, Command, UnwrapReply, NullReply, BlobStringReply, NumberReply, TuplesToMapReply, Resp2Reply } from '@redis/client/dist/lib/RESP/types';
1+
import { RedisArgument, Command, UnwrapReply, NullReply, NumberReply, TuplesToMapReply, Resp2Reply, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
22

33
export type BfInfoReplyMap = TuplesToMapReply<[
4-
[BlobStringReply<'Capacity'>, NumberReply],
5-
[BlobStringReply<'Size'>, NumberReply],
6-
[BlobStringReply<'Number of filters'>, NumberReply],
7-
[BlobStringReply<'Number of items inserted'>, NumberReply],
8-
[BlobStringReply<'Expansion rate'>, NullReply | NumberReply]
4+
[SimpleStringReply<'Capacity'>, NumberReply],
5+
[SimpleStringReply<'Size'>, NumberReply],
6+
[SimpleStringReply<'Number of filters'>, NumberReply],
7+
[SimpleStringReply<'Number of items inserted'>, NumberReply],
8+
[SimpleStringReply<'Expansion rate'>, NullReply | NumberReply]
99
]>;
1010

1111
export interface BfInfoReply {

packages/bloom/lib/commands/count-min-sketch/INFO.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { RedisArgument, TuplesToMapReply, BlobStringReply, NumberReply, UnwrapReply, Resp2Reply, Command } from '@redis/client/dist/lib/RESP/types';
1+
import { RedisArgument, TuplesToMapReply, NumberReply, UnwrapReply, Resp2Reply, Command, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
22

33
export type CmsInfoReplyMap = TuplesToMapReply<[
4-
[BlobStringReply<'width'>, NumberReply],
5-
[BlobStringReply<'depth'>, NumberReply],
6-
[BlobStringReply<'count'>, NumberReply]
4+
[SimpleStringReply<'width'>, NumberReply],
5+
[SimpleStringReply<'depth'>, NumberReply],
6+
[SimpleStringReply<'count'>, NumberReply]
77
]>;
88

99
export interface CmsInfoReply {

packages/bloom/lib/commands/cuckoo/INFO.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { RedisArgument, Command, NumberReply, BlobStringReply, TuplesToMapReply, UnwrapReply, Resp2Reply } from '@redis/client/dist/lib/RESP/types';
1+
import { RedisArgument, Command, NumberReply, TuplesToMapReply, UnwrapReply, Resp2Reply, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
22

33
export type CfInfoReplyMap = TuplesToMapReply<[
4-
[BlobStringReply<'Size'>, NumberReply],
5-
[BlobStringReply<'Number of buckets'>, NumberReply],
6-
[BlobStringReply<'Number of filters'>, NumberReply],
7-
[BlobStringReply<'Number of items inserted'>, NumberReply],
8-
[BlobStringReply<'Number of items deleted'>, NumberReply],
9-
[BlobStringReply<'Bucket size'>, NumberReply],
10-
[BlobStringReply<'Expansion rate'>, NumberReply],
11-
[BlobStringReply<'Max iterations'>, NumberReply]
4+
[SimpleStringReply<'Size'>, NumberReply],
5+
[SimpleStringReply<'Number of buckets'>, NumberReply],
6+
[SimpleStringReply<'Number of filters'>, NumberReply],
7+
[SimpleStringReply<'Number of items inserted'>, NumberReply],
8+
[SimpleStringReply<'Number of items deleted'>, NumberReply],
9+
[SimpleStringReply<'Bucket size'>, NumberReply],
10+
[SimpleStringReply<'Expansion rate'>, NumberReply],
11+
[SimpleStringReply<'Max iterations'>, NumberReply]
1212
]>;
1313

1414
export interface CfInfoReply {

packages/bloom/lib/commands/t-digest/INFO.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { RedisArgument, Command, BlobStringReply, NumberReply, TuplesToMapReply, UnwrapReply, Resp2Reply } from '@redis/client/dist/lib/RESP/types';
1+
import { RedisArgument, Command, NumberReply, TuplesToMapReply, UnwrapReply, Resp2Reply, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
22

33
export type TdInfoReplyMap = TuplesToMapReply<[
4-
[BlobStringReply<'Compression'>, NumberReply],
5-
[BlobStringReply<'Capacity'>, NumberReply],
6-
[BlobStringReply<'Merged nodes'>, NumberReply],
7-
[BlobStringReply<'Unmerged nodes'>, NumberReply],
8-
[BlobStringReply<'Merged weight'>, NumberReply],
9-
[BlobStringReply<'Unmerged weight'>, NumberReply],
10-
[BlobStringReply<'Observations'>, NumberReply],
11-
[BlobStringReply<'Total compressions'>, NumberReply],
12-
[BlobStringReply<'Memory usage'>, NumberReply]
4+
[SimpleStringReply<'Compression'>, NumberReply],
5+
[SimpleStringReply<'Capacity'>, NumberReply],
6+
[SimpleStringReply<'Merged nodes'>, NumberReply],
7+
[SimpleStringReply<'Unmerged nodes'>, NumberReply],
8+
[SimpleStringReply<'Merged weight'>, NumberReply],
9+
[SimpleStringReply<'Unmerged weight'>, NumberReply],
10+
[SimpleStringReply<'Observations'>, NumberReply],
11+
[SimpleStringReply<'Total compressions'>, NumberReply],
12+
[SimpleStringReply<'Memory usage'>, NumberReply]
1313
]>;
1414

1515
export interface TdInfoReply {

packages/bloom/lib/commands/top-k/INFO.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { RedisArgument, TuplesToMapReply, BlobStringReply, NumberReply, DoubleReply, UnwrapReply, Resp2Reply, Command } from '@redis/client/dist/lib/RESP/types';
1+
import { RedisArgument, TuplesToMapReply, NumberReply, DoubleReply, UnwrapReply, Resp2Reply, Command, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
22

33
export type TopKInfoReplyMap = TuplesToMapReply<[
4-
[BlobStringReply<'k'>, NumberReply],
5-
[BlobStringReply<'width'>, NumberReply],
6-
[BlobStringReply<'depth'>, NumberReply],
7-
[BlobStringReply<'decay'>, DoubleReply]
4+
[SimpleStringReply<'k'>, NumberReply],
5+
[SimpleStringReply<'width'>, NumberReply],
6+
[SimpleStringReply<'depth'>, NumberReply],
7+
[SimpleStringReply<'decay'>, DoubleReply]
88
]>;
99

1010
export type TkInfoReply = {

packages/client/lib/RESP/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ export interface MapReply<K, V> extends RespType<
128128
Map<any, any> | Array<any>
129129
> {}
130130

131-
type MapKeyValue = [key: BlobStringReply, value: unknown];
131+
type MapKeyValue = [key: SimpleStringReply, value: unknown];
132132

133133
type MapTuples = Array<MapKeyValue>;
134134

135-
type ExtractMapKey<T> = T extends BlobStringReply<infer S> ? S : never;
135+
type ExtractMapKey<T> = T extends SimpleStringReply<infer S> ? S : never;
136136

137137
export interface TuplesToMapReply<T extends MapTuples> extends RespType<
138138
RESP_TYPES['MAP'],

packages/client/lib/commands/ACL_GETUSER.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { RedisArgument, TuplesToMapReply, BlobStringReply, ArrayReply, UnwrapReply, Resp2Reply, Command } from '../RESP/types';
1+
import { RedisArgument, TuplesToMapReply, BlobStringReply, ArrayReply, UnwrapReply, Resp2Reply, Command, SimpleStringReply } from '../RESP/types';
22

33
type AclUser = TuplesToMapReply<[
4-
[BlobStringReply<'flags'>, ArrayReply<BlobStringReply>],
5-
[BlobStringReply<'passwords'>, ArrayReply<BlobStringReply>],
6-
[BlobStringReply<'commands'>, BlobStringReply],
4+
[SimpleStringReply<'flags'>, ArrayReply<BlobStringReply>],
5+
[SimpleStringReply<'passwords'>, ArrayReply<BlobStringReply>],
6+
[SimpleStringReply<'commands'>, BlobStringReply],
77
/** changed to BlobStringReply in 7.0 */
8-
[BlobStringReply<'keys'>, ArrayReply<BlobStringReply> | BlobStringReply],
8+
[SimpleStringReply<'keys'>, ArrayReply<BlobStringReply> | BlobStringReply],
99
/** added in 6.2, changed to BlobStringReply in 7.0 */
10-
[BlobStringReply<'channels'>, ArrayReply<BlobStringReply> | BlobStringReply],
10+
[SimpleStringReply<'channels'>, ArrayReply<BlobStringReply> | BlobStringReply],
1111
/** added in 7.0 */
12-
[BlobStringReply<'selectors'>, ArrayReply<TuplesToMapReply<[
13-
[BlobStringReply<'commands'>, BlobStringReply],
14-
[BlobStringReply<'keys'>, BlobStringReply],
15-
[BlobStringReply<'channels'>, BlobStringReply]
12+
[SimpleStringReply<'selectors'>, ArrayReply<TuplesToMapReply<[
13+
[SimpleStringReply<'commands'>, BlobStringReply],
14+
[SimpleStringReply<'keys'>, BlobStringReply],
15+
[SimpleStringReply<'channels'>, BlobStringReply]
1616
]>>],
1717
]>;
1818

packages/client/lib/commands/ACL_LOG.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { ArrayReply, TuplesToMapReply, BlobStringReply, NumberReply, DoubleReply, UnwrapReply, Resp2Reply, Command } from '../RESP/types';
1+
import { ArrayReply, TuplesToMapReply, BlobStringReply, NumberReply, DoubleReply, UnwrapReply, Resp2Reply, Command, SimpleStringReply } from '../RESP/types';
22

33
export type AclLogReply = ArrayReply<TuplesToMapReply<[
4-
[BlobStringReply<'count'>, NumberReply],
5-
[BlobStringReply<'reason'>, BlobStringReply],
6-
[BlobStringReply<'context'>, BlobStringReply],
7-
[BlobStringReply<'object'>, BlobStringReply],
8-
[BlobStringReply<'username'>, BlobStringReply],
9-
[BlobStringReply<'age-seconds'>, DoubleReply],
10-
[BlobStringReply<'client-info'>, BlobStringReply],
4+
[SimpleStringReply<'count'>, NumberReply],
5+
[SimpleStringReply<'reason'>, BlobStringReply],
6+
[SimpleStringReply<'context'>, BlobStringReply],
7+
[SimpleStringReply<'object'>, BlobStringReply],
8+
[SimpleStringReply<'username'>, BlobStringReply],
9+
[SimpleStringReply<'age-seconds'>, DoubleReply],
10+
[SimpleStringReply<'client-info'>, BlobStringReply],
1111
/** added in 7.0 */
12-
[BlobStringReply<'entry-id'>, NumberReply],
12+
[SimpleStringReply<'entry-id'>, NumberReply],
1313
/** added in 7.0 */
14-
[BlobStringReply<'timestamp-created'>, NumberReply],
14+
[SimpleStringReply<'timestamp-created'>, NumberReply],
1515
/** added in 7.0 */
16-
[BlobStringReply<'timestamp-last-updated'>, NumberReply]
16+
[SimpleStringReply<'timestamp-last-updated'>, NumberReply]
1717
]>>;
1818

1919
export default {

packages/client/lib/commands/CLIENT_TRACKINGINFO.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { TuplesToMapReply, BlobStringReply, SetReply, NumberReply, ArrayReply, UnwrapReply, Resp2Reply, Command } from '../RESP/types';
1+
import { TuplesToMapReply, BlobStringReply, SetReply, NumberReply, ArrayReply, UnwrapReply, Resp2Reply, Command, SimpleStringReply } from '../RESP/types';
22

33
type TrackingInfo = TuplesToMapReply<[
4-
[BlobStringReply<'flags'>, SetReply<BlobStringReply>],
5-
[BlobStringReply<'redirect'>, NumberReply],
6-
[BlobStringReply<'prefixes'>, ArrayReply<BlobStringReply>]
4+
[SimpleStringReply<'flags'>, SetReply<BlobStringReply>],
5+
[SimpleStringReply<'redirect'>, NumberReply],
6+
[SimpleStringReply<'prefixes'>, ArrayReply<BlobStringReply>]
77
]>;
88

99
export default {

packages/client/lib/commands/CLUSTER_LINKS.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ArrayReply, TuplesToMapReply, BlobStringReply, NumberReply, UnwrapReply, Resp2Reply, Command } from '../RESP/types';
1+
import { ArrayReply, TuplesToMapReply, BlobStringReply, NumberReply, UnwrapReply, Resp2Reply, Command, SimpleStringReply } from '../RESP/types';
22

33
type ClusterLinksReply = ArrayReply<TuplesToMapReply<[
4-
[BlobStringReply<'direction'>, BlobStringReply],
5-
[BlobStringReply<'node'>, BlobStringReply],
6-
[BlobStringReply<'create-time'>, NumberReply],
7-
[BlobStringReply<'events'>, BlobStringReply],
8-
[BlobStringReply<'send-buffer-allocated'>, NumberReply],
9-
[BlobStringReply<'send-buffer-used'>, NumberReply],
4+
[SimpleStringReply<'direction'>, BlobStringReply],
5+
[SimpleStringReply<'node'>, BlobStringReply],
6+
[SimpleStringReply<'create-time'>, NumberReply],
7+
[SimpleStringReply<'events'>, BlobStringReply],
8+
[SimpleStringReply<'send-buffer-allocated'>, NumberReply],
9+
[SimpleStringReply<'send-buffer-used'>, NumberReply],
1010
]>>;
1111

1212
export default {

0 commit comments

Comments
 (0)