Skip to content

Commit

Permalink
Merge 802c517 into 23b6513
Browse files Browse the repository at this point in the history
  • Loading branch information
leibale authored Apr 25, 2022
2 parents 23b6513 + 802c517 commit 902bbf5
Show file tree
Hide file tree
Showing 51 changed files with 1,408 additions and 326 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
node-version: ['12', '14', '16']
redis-version: ['5', '6.0', '6.2', '7.0-rc2']
redis-version: ['5', '6.0', '6.2', '7.0-rc3']
steps:
- uses: actions/[email protected]
with:
Expand Down
27 changes: 19 additions & 8 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
RedisModules,
RedisFunctions,
RedisScripts,
createClient as _createClient,
RedisClientOptions,
Expand Down Expand Up @@ -33,12 +34,17 @@ export type RedisDefaultModules = typeof modules;

export type RedisClientType<
M extends RedisModules = RedisDefaultModules,
F extends RedisFunctions = Record<string, never>,
S extends RedisScripts = Record<string, never>
> = _RedisClientType<M, S>;
> = _RedisClientType<M, F, S>;

export function createClient<M extends RedisModules, S extends RedisScripts>(
options?: RedisClientOptions<M, S>
): _RedisClientType<RedisDefaultModules & M, S> {
export function createClient<
M extends RedisModules,
F extends RedisFunctions,
S extends RedisScripts
>(
options?: RedisClientOptions<M, F, S>
): _RedisClientType<RedisDefaultModules & M, F, S> {
return _createClient({
...options,
modules: {
Expand All @@ -50,12 +56,17 @@ export function createClient<M extends RedisModules, S extends RedisScripts>(

export type RedisClusterType<
M extends RedisModules = RedisDefaultModules,
F extends RedisFunctions = Record<string, never>,
S extends RedisScripts = Record<string, never>
> = _RedisClusterType<M, S>;
> = _RedisClusterType<M, F, S>;

export function createCluster<M extends RedisModules, S extends RedisScripts>(
options: RedisClusterOptions<M, S>
): RedisClusterType<RedisDefaultModules & M, S> {
export function createCluster<
M extends RedisModules,
F extends RedisFunctions,
S extends RedisScripts
>(
options: RedisClusterOptions<M, F, S>
): RedisClusterType<RedisDefaultModules & M, F, S> {
return _createCluster({
...options,
modules: {
Expand Down
45 changes: 34 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import RedisCluster from './lib/cluster';

export { RedisClientType, RedisClientOptions } from './lib/client';

export { RedisModules, RedisScripts } from './lib/commands';
export { RedisModules, RedisFunctions, RedisScripts } from './lib/commands';

export const createClient = RedisClient.create;

Expand Down
27 changes: 27 additions & 0 deletions packages/client/lib/client/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ import * as ECHO from '../commands/ECHO';
import * as FAILOVER from '../commands/FAILOVER';
import * as FLUSHALL from '../commands/FLUSHALL';
import * as FLUSHDB from '../commands/FLUSHDB';
import * as FUNCTION_DELETE from '../commands/FUNCTION_DELETE';
import * as FUNCTION_DUMP from '../commands/FUNCTION_DUMP';
import * as FUNCTION_FLUSH from '../commands/FUNCTION_FLUSH';
import * as FUNCTION_KILL from '../commands/FUNCTION_KILL';
import * as FUNCTION_LIST_WITHCODE from '../commands/FUNCTION_LIST_WITHCODE';
import * as FUNCTION_LIST from '../commands/FUNCTION_LIST';
import * as FUNCTION_LOAD from '../commands/FUNCTION_LOAD';
import * as FUNCTION_RESTORE from '../commands/FUNCTION_RESTORE';
import * as FUNCTION_STATS from '../commands/FUNCTION_STATS';
import * as HELLO from '../commands/HELLO';
import * as INFO from '../commands/INFO';
import * as KEYS from '../commands/KEYS';
Expand Down Expand Up @@ -228,6 +237,24 @@ export default {
flushAll: FLUSHALL,
FLUSHDB,
flushDb: FLUSHDB,
FUNCTION_DELETE,
functionDelete: FUNCTION_DELETE,
FUNCTION_DUMP,
functionDump: FUNCTION_DUMP,
FUNCTION_FLUSH,
functionFlush: FUNCTION_FLUSH,
FUNCTION_KILL,
functionKill: FUNCTION_KILL,
FUNCTION_LIST_WITHCODE,
functionListWithCode: FUNCTION_LIST_WITHCODE,
FUNCTION_LIST,
functionList: FUNCTION_LIST,
FUNCTION_LOAD,
functionLoad: FUNCTION_LOAD,
FUNCTION_RESTORE,
functionRestore: FUNCTION_RESTORE,
FUNCTION_STATS,
functionStats: FUNCTION_STATS,
HELLO,
hello: HELLO,
INFO,
Expand Down
Loading

0 comments on commit 902bbf5

Please sign in to comment.