Skip to content

Commit d6d8d8e

Browse files
fix(client): export various enum values (#3074)
Certain command parameter enums, specifically ClientKillFilters for the CLIENT KILL command, were not publicly exported by the @redis/client package. The purpose of this change is to make the ClientKillFilters enum accessible to all package consumers, eliminating the need for users to rely on an unstable internal import path. This matters because it provides a reliable and supported way for developers to use commands that require these enums, improving the package's usability and API stability. fixes: #2805 Co-authored-by: Nikolay Karadzhov <nkaradzhov89@gmail.com>
1 parent 5b63382 commit d6d8d8e

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

packages/client/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ export const createSentinel = RedisSentinel.create;
3131

3232
export { GEO_REPLY_WITH, GeoReplyWith } from './lib/commands/GEOSEARCH_WITH';
3333

34-
export { SetOptions } from './lib/commands/SET';
3534

36-
export { REDIS_FLUSH_MODES } from './lib/commands/FLUSHALL';
35+
export { SetOptions, CLIENT_KILL_FILTERS, FAILOVER_MODES, CLUSTER_SLOT_STATES, COMMAND_LIST_FILTER_BY, REDIS_FLUSH_MODES } from './lib/commands'
3736

3837
export { BasicClientSideCache, BasicPooledClientSideCache } from './lib/client/cache';
39-

packages/client/lib/commands/index.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import CLIENT_GETNAME from './CLIENT_GETNAME';
3535
import CLIENT_GETREDIR from './CLIENT_GETREDIR';
3636
import CLIENT_ID from './CLIENT_ID';
3737
import CLIENT_INFO from './CLIENT_INFO';
38-
import CLIENT_KILL from './CLIENT_KILL';
38+
import CLIENT_KILL, { CLIENT_KILL_FILTERS } from './CLIENT_KILL';
3939
import CLIENT_LIST from './CLIENT_LIST';
4040
import CLIENT_NO_EVICT from './CLIENT_NO-EVICT';
4141
import CLIENT_NO_TOUCH from './CLIENT_NO-TOUCH';
@@ -51,7 +51,7 @@ import CLUSTER_COUNT_FAILURE_REPORTS from './CLUSTER_COUNT-FAILURE-REPORTS';
5151
import CLUSTER_COUNTKEYSINSLOT from './CLUSTER_COUNTKEYSINSLOT';
5252
import CLUSTER_DELSLOTS from './CLUSTER_DELSLOTS';
5353
import CLUSTER_DELSLOTSRANGE from './CLUSTER_DELSLOTSRANGE';
54-
import CLUSTER_FAILOVER from './CLUSTER_FAILOVER';
54+
import CLUSTER_FAILOVER, { FAILOVER_MODES } from './CLUSTER_FAILOVER';
5555
import CLUSTER_FLUSHSLOTS from './CLUSTER_FLUSHSLOTS';
5656
import CLUSTER_FORGET from './CLUSTER_FORGET';
5757
import CLUSTER_GETKEYSINSLOT from './CLUSTER_GETKEYSINSLOT';
@@ -67,13 +67,13 @@ import CLUSTER_REPLICATE from './CLUSTER_REPLICATE';
6767
import CLUSTER_RESET from './CLUSTER_RESET';
6868
import CLUSTER_SAVECONFIG from './CLUSTER_SAVECONFIG';
6969
import CLUSTER_SET_CONFIG_EPOCH from './CLUSTER_SET-CONFIG-EPOCH';
70-
import CLUSTER_SETSLOT from './CLUSTER_SETSLOT';
70+
import CLUSTER_SETSLOT, { CLUSTER_SLOT_STATES } from './CLUSTER_SETSLOT';
7171
import CLUSTER_SLOTS from './CLUSTER_SLOTS';
7272
import COMMAND_COUNT from './COMMAND_COUNT';
7373
import COMMAND_GETKEYS from './COMMAND_GETKEYS';
7474
import COMMAND_GETKEYSANDFLAGS from './COMMAND_GETKEYSANDFLAGS';
7575
import COMMAND_INFO from './COMMAND_INFO';
76-
import COMMAND_LIST from './COMMAND_LIST';
76+
import COMMAND_LIST, { COMMAND_LIST_FILTER_BY } from './COMMAND_LIST';
7777
import COMMAND from './COMMAND';
7878
import CONFIG_GET from './CONFIG_GET';
7979
import CONFIG_RESETASTAT from './CONFIG_RESETSTAT';
@@ -117,7 +117,7 @@ import EXISTS from './EXISTS';
117117
import EXPIRE from './EXPIRE';
118118
import EXPIREAT from './EXPIREAT';
119119
import EXPIRETIME from './EXPIRETIME';
120-
import FLUSHALL from './FLUSHALL';
120+
import FLUSHALL, { REDIS_FLUSH_MODES } from './FLUSHALL';
121121
import FLUSHDB from './FLUSHDB';
122122
import FCALL from './FCALL';
123123
import FCALL_RO from './FCALL_RO';
@@ -362,6 +362,16 @@ import VSETATTR from './VSETATTR';
362362
import VSIM from './VSIM';
363363
import VSIM_WITHSCORES from './VSIM_WITHSCORES';
364364

365+
export {
366+
CLIENT_KILL_FILTERS,
367+
FAILOVER_MODES,
368+
CLUSTER_SLOT_STATES,
369+
COMMAND_LIST_FILTER_BY,
370+
REDIS_FLUSH_MODES
371+
};
372+
373+
export { SetOptions } from './SET';
374+
365375
export default {
366376
ACL_CAT,
367377
aclCat: ACL_CAT,

0 commit comments

Comments
 (0)