Skip to content

Commit

Permalink
Stream commands (#636)
Browse files Browse the repository at this point in the history
* feat: xadd

* Add xrange and xrange test

* fix: nested decoding

* Add tests for xrange

* Add tests for xadd

* Remove dependabot

* Add missing imports to entry file

* Format redis.ts

---------

Co-authored-by: chronark <dev@chronark.com>
  • Loading branch information
ogzhanolguncu and chronark authored Oct 10, 2023
1 parent 306c15f commit 199bb75
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
3 changes: 2 additions & 1 deletion pkg/commands/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export * from "./touch.ts";
export * from "./ttl.ts";
export * from "./type.ts";
export * from "./unlink.ts";
export * from "./xadd.ts";
export * from "./zadd.ts";
export * from "./zcard.ts";
export * from "./zcount.ts";
Expand All @@ -139,3 +138,5 @@ export * from "./zrevrank.ts";
export * from "./zscan.ts";
export * from "./zscore.ts";
export * from "./zunionstore.ts";
export * from "./xadd.ts";
export * from "./xrange.ts";
20 changes: 15 additions & 5 deletions pkg/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ import {
TypeCommand,
UnlinkCommand,
XAddCommand,
XRangeCommand,
ZAddCommand,
ZAddCommandOptions,
ZAddCommandOptionsWithIncr,
Expand Down Expand Up @@ -407,7 +408,9 @@ export class Redis {
new BitOpCommand(
[op as any, destinationKey, sourceKey, ...sourceKeys],
this.opts,
).exec(this.client);
).exec(
this.client,
);

/**
* @see https://redis.io/commands/bitpos
Expand Down Expand Up @@ -1015,10 +1018,17 @@ export class Redis {
unlink = (...args: CommandArgs<typeof UnlinkCommand>) =>
new UnlinkCommand(args, this.opts).exec(this.client);

// /**
// * @see https://redis.io/commands/xadd
// */
// xadd =
/**
* @see https://redis.io/commands/xadd
*/
xadd = (...args: CommandArgs<typeof XAddCommand>) =>
new XAddCommand(args, this.opts).exec(this.client);

/**
* @see https://redis.io/commands/xrange
*/
xrange = (...args: CommandArgs<typeof XRangeCommand>) =>
new XRangeCommand(args, this.opts).exec(this.client);

/**
* @see https://redis.io/commands/zadd
Expand Down

0 comments on commit 199bb75

Please sign in to comment.