redis / node-redis

Redis Node.js client
https://redis.js.org/
MIT License
16.95k stars 1.89k forks source link

Command parameter enums not exported #2805

Open redlizard opened 4 months ago

redlizard commented 4 months ago

Description

I am trying to invoke the clientKill() command on a redis client object. This command takes a parameter object containing a field of type enum ClientKillFilters. But this enum is not exported by the redis or @redis/client packages, which means there is no way to supply a valid parameter object for this command.

The same is true for other commands that take an enum parameter, of which there are a handful. A quick grep shows:

I have found a workaround by importing the enum from the '@redis/client/dist/lib/commands/CLIENT_KILL' package, but obviously that is not a sustainable solution. The @redis/client package should either export those enums, or replace the enums altogether with one-of-several-strings parameters.

Node.js Version

v20.14.0

Redis Server Version

No response

Node Redis Version

4.6.14

Platform

No response

Logs

No response