@upstash/redis 1.18.5-rc.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -81,6 +81,12 @@ data = await redis.spop('animals', 1)
81
81
  console.log(data)
82
82
  ```
83
83
 
84
+ ## Troubleshooting
85
+
86
+ We have a [dedicated page](https://docs.upstash.com/troubleshooting) for common
87
+ problems. If you can't find a solution, please
88
+ [open an issue](https://github.com/upstash/upstash-redis/issues/new).
89
+
84
90
  ## Docs
85
91
 
86
92
  See [the documentation](https://docs.upstash.com/features/javascriptsdk) for
@@ -23,6 +23,7 @@ export * from "./getset.js";
23
23
  export * from "./hdel.js";
24
24
  export * from "./hexists.js";
25
25
  export * from "./hget.js";
26
+ export * from "./smismember.js";
26
27
  export * from "./hgetall.js";
27
28
  export * from "./hincrby.js";
28
29
  export * from "./hincrbyfloat.js";
@@ -0,0 +1,9 @@
1
+ import { Command } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/smismember
4
+ */
5
+ export class SMIsMemberCommand extends Command {
6
+ constructor(cmd, opts) {
7
+ super(["smismember", ...cmd], opts);
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ import { Command } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/zdiffstore
4
+ */
5
+ export class ZDiffStoreCommand extends Command {
6
+ constructor(cmd, opts) {
7
+ super(["zdiffstore", ...cmd], opts);
8
+ }
9
+ }
@@ -1,7 +1,8 @@
1
- import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetDelCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, LMoveCommand, LPopCommand, LPosCommand, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PersistCommand, PExpireAtCommand, PExpireCommand, PingCommand, PSetEXCommand, PTtlCommand, PublishCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, RPopCommand, RPushCommand, RPushXCommand, SAddCommand, ScanCommand, SCardCommand, ScriptExistsCommand, ScriptFlushCommand, ScriptLoadCommand, SDiffCommand, SDiffStoreCommand, SetBitCommand, SetCommand, SetExCommand, SetNxCommand, SetRangeCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, StrLenCommand, SUnionCommand, SUnionStoreCommand, TimeCommand, TouchCommand, TtlCommand, TypeCommand, UnlinkCommand, ZAddCommand, ZCardCommand, ZCountCommand, ZIncrByCommand, ZInterStoreCommand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRangeCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand, ZUnionStoreCommand, } from "./commands/mod.js";
1
+ import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetDelCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, LMoveCommand, LPopCommand, LPosCommand, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PersistCommand, PExpireAtCommand, PExpireCommand, PingCommand, PSetEXCommand, PTtlCommand, PublishCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, RPopCommand, RPushCommand, RPushXCommand, SAddCommand, ScanCommand, SCardCommand, ScriptExistsCommand, ScriptFlushCommand, ScriptLoadCommand, SDiffCommand, SDiffStoreCommand, SetBitCommand, SetCommand, SetExCommand, SetNxCommand, SetRangeCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMIsMemberCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, StrLenCommand, SUnionCommand, SUnionStoreCommand, TimeCommand, TouchCommand, TtlCommand, TypeCommand, UnlinkCommand, ZAddCommand, ZCardCommand, ZCountCommand, ZIncrByCommand, ZInterStoreCommand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRangeCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand, ZUnionStoreCommand, } from "./commands/mod.js";
2
2
  import { UpstashError } from "./error.js";
3
3
  import { ZMScoreCommand } from "./commands/zmscore.js";
4
4
  import { HRandFieldCommand } from "./commands/hrandfield.js";
5
+ import { ZDiffStoreCommand } from "./commands/zdiffstore.js";
5
6
  /**
6
7
  * Upstash REST API supports command pipelining to send multiple commands in
7
8
  * batch, instead of sending each command one by one and waiting for a response.
@@ -133,6 +134,15 @@ export class Pipeline {
133
134
  writable: true,
134
135
  value: (...args) => this.chain(new BitPosCommand(args, this.commandOptions))
135
136
  });
137
+ /**
138
+ * @see https://redis.io/commands/zdiffstore
139
+ */
140
+ Object.defineProperty(this, "zdiffstore", {
141
+ enumerable: true,
142
+ configurable: true,
143
+ writable: true,
144
+ value: (...args) => this.chain(new ZDiffStoreCommand(args, this.commandOptions))
145
+ });
136
146
  /**
137
147
  * @see https://redis.io/commands/dbsize
138
148
  */
@@ -871,6 +881,15 @@ export class Pipeline {
871
881
  writable: true,
872
882
  value: (...args) => this.chain(new SMembersCommand(args, this.commandOptions))
873
883
  });
884
+ /**
885
+ * @see https://redis.io/commands/smismember
886
+ */
887
+ Object.defineProperty(this, "smismember", {
888
+ enumerable: true,
889
+ configurable: true,
890
+ writable: true,
891
+ value: (key, members) => this.chain(new SMIsMemberCommand([key, members], this.commandOptions))
892
+ });
874
893
  /**
875
894
  * @see https://redis.io/commands/smove
876
895
  */
package/esm/pkg/redis.js CHANGED
@@ -1,7 +1,8 @@
1
- import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetDelCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HRandFieldCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, LMoveCommand, LPopCommand, LPosCommand, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PersistCommand, PExpireAtCommand, PExpireCommand, PingCommand, PSetEXCommand, PTtlCommand, PublishCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, RPopCommand, RPushCommand, RPushXCommand, SAddCommand, ScanCommand, SCardCommand, ScriptExistsCommand, ScriptFlushCommand, ScriptLoadCommand, SDiffCommand, SDiffStoreCommand, SetBitCommand, SetCommand, SetExCommand, SetNxCommand, SetRangeCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, StrLenCommand, SUnionCommand, SUnionStoreCommand, TimeCommand, TouchCommand, TtlCommand, TypeCommand, UnlinkCommand, ZAddCommand, ZCardCommand, ZCountCommand, ZIncrByCommand, ZInterStoreCommand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRangeCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand, ZUnionStoreCommand, } from "./commands/mod.js";
1
+ import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetDelCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HRandFieldCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, LMoveCommand, LPopCommand, LPosCommand, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PersistCommand, PExpireAtCommand, PExpireCommand, PingCommand, PSetEXCommand, PTtlCommand, PublishCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, RPopCommand, RPushCommand, RPushXCommand, SAddCommand, ScanCommand, SCardCommand, ScriptExistsCommand, ScriptFlushCommand, ScriptLoadCommand, SDiffCommand, SDiffStoreCommand, SetBitCommand, SetCommand, SetExCommand, SetNxCommand, SetRangeCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMIsMemberCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, StrLenCommand, SUnionCommand, SUnionStoreCommand, TimeCommand, TouchCommand, TtlCommand, TypeCommand, UnlinkCommand, ZAddCommand, ZCardCommand, ZCountCommand, ZIncrByCommand, ZInterStoreCommand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRangeCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand, ZUnionStoreCommand, } from "./commands/mod.js";
2
2
  import { Pipeline } from "./pipeline.js";
3
3
  import { Script } from "./script.js";
4
4
  import { ZMScoreCommand } from "./commands/zmscore.js";
5
+ import { ZDiffStoreCommand } from "./commands/zdiffstore.js";
5
6
  /**
6
7
  * Serverless redis client for upstash.
7
8
  */
@@ -842,6 +843,15 @@ export class Redis {
842
843
  writable: true,
843
844
  value: (key, member) => new SIsMemberCommand([key, member], this.opts).exec(this.client)
844
845
  });
846
+ /**
847
+ * @see https://redis.io/commands/smismember
848
+ */
849
+ Object.defineProperty(this, "smismember", {
850
+ enumerable: true,
851
+ configurable: true,
852
+ writable: true,
853
+ value: (key, members) => new SMIsMemberCommand([key, members], this.opts).exec(this.client)
854
+ });
845
855
  /**
846
856
  * @see https://redis.io/commands/smembers
847
857
  */
@@ -1000,6 +1010,15 @@ export class Redis {
1000
1010
  writable: true,
1001
1011
  value: (...args) => new ZCountCommand(args, this.opts).exec(this.client)
1002
1012
  });
1013
+ /**
1014
+ * @see https://redis.io/commands/zdiffstore
1015
+ */
1016
+ Object.defineProperty(this, "zdiffstore", {
1017
+ enumerable: true,
1018
+ configurable: true,
1019
+ writable: true,
1020
+ value: (...args) => new ZDiffStoreCommand(args, this.opts).exec(this.client)
1021
+ });
1003
1022
  /**
1004
1023
  * @see https://redis.io/commands/zincrby
1005
1024
  */
package/esm/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "v1.18.5-rc.0";
1
+ export const VERSION = "v1.19.0";
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./script/platforms/nodejs.js",
4
4
  "types": "./types/platforms/nodejs.d.ts",
5
5
  "name": "@upstash/redis",
6
- "version": "v1.18.5-rc.0",
6
+ "version": "v1.19.0",
7
7
  "description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
8
8
  "repository": {
9
9
  "type": "git",
@@ -39,6 +39,7 @@ __exportStar(require("./getset.js"), exports);
39
39
  __exportStar(require("./hdel.js"), exports);
40
40
  __exportStar(require("./hexists.js"), exports);
41
41
  __exportStar(require("./hget.js"), exports);
42
+ __exportStar(require("./smismember.js"), exports);
42
43
  __exportStar(require("./hgetall.js"), exports);
43
44
  __exportStar(require("./hincrby.js"), exports);
44
45
  __exportStar(require("./hincrbyfloat.js"), exports);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SMIsMemberCommand = void 0;
4
+ const command_js_1 = require("./command.js");
5
+ /**
6
+ * @see https://redis.io/commands/smismember
7
+ */
8
+ class SMIsMemberCommand extends command_js_1.Command {
9
+ constructor(cmd, opts) {
10
+ super(["smismember", ...cmd], opts);
11
+ }
12
+ }
13
+ exports.SMIsMemberCommand = SMIsMemberCommand;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZDiffStoreCommand = void 0;
4
+ const command_js_1 = require("./command.js");
5
+ /**
6
+ * @see https://redis.io/commands/zdiffstore
7
+ */
8
+ class ZDiffStoreCommand extends command_js_1.Command {
9
+ constructor(cmd, opts) {
10
+ super(["zdiffstore", ...cmd], opts);
11
+ }
12
+ }
13
+ exports.ZDiffStoreCommand = ZDiffStoreCommand;
@@ -5,6 +5,7 @@ const mod_js_1 = require("./commands/mod.js");
5
5
  const error_js_1 = require("./error.js");
6
6
  const zmscore_js_1 = require("./commands/zmscore.js");
7
7
  const hrandfield_js_1 = require("./commands/hrandfield.js");
8
+ const zdiffstore_js_1 = require("./commands/zdiffstore.js");
8
9
  /**
9
10
  * Upstash REST API supports command pipelining to send multiple commands in
10
11
  * batch, instead of sending each command one by one and waiting for a response.
@@ -136,6 +137,15 @@ class Pipeline {
136
137
  writable: true,
137
138
  value: (...args) => this.chain(new mod_js_1.BitPosCommand(args, this.commandOptions))
138
139
  });
140
+ /**
141
+ * @see https://redis.io/commands/zdiffstore
142
+ */
143
+ Object.defineProperty(this, "zdiffstore", {
144
+ enumerable: true,
145
+ configurable: true,
146
+ writable: true,
147
+ value: (...args) => this.chain(new zdiffstore_js_1.ZDiffStoreCommand(args, this.commandOptions))
148
+ });
139
149
  /**
140
150
  * @see https://redis.io/commands/dbsize
141
151
  */
@@ -874,6 +884,15 @@ class Pipeline {
874
884
  writable: true,
875
885
  value: (...args) => this.chain(new mod_js_1.SMembersCommand(args, this.commandOptions))
876
886
  });
887
+ /**
888
+ * @see https://redis.io/commands/smismember
889
+ */
890
+ Object.defineProperty(this, "smismember", {
891
+ enumerable: true,
892
+ configurable: true,
893
+ writable: true,
894
+ value: (key, members) => this.chain(new mod_js_1.SMIsMemberCommand([key, members], this.commandOptions))
895
+ });
877
896
  /**
878
897
  * @see https://redis.io/commands/smove
879
898
  */
@@ -5,6 +5,7 @@ const mod_js_1 = require("./commands/mod.js");
5
5
  const pipeline_js_1 = require("./pipeline.js");
6
6
  const script_js_1 = require("./script.js");
7
7
  const zmscore_js_1 = require("./commands/zmscore.js");
8
+ const zdiffstore_js_1 = require("./commands/zdiffstore.js");
8
9
  /**
9
10
  * Serverless redis client for upstash.
10
11
  */
@@ -845,6 +846,15 @@ class Redis {
845
846
  writable: true,
846
847
  value: (key, member) => new mod_js_1.SIsMemberCommand([key, member], this.opts).exec(this.client)
847
848
  });
849
+ /**
850
+ * @see https://redis.io/commands/smismember
851
+ */
852
+ Object.defineProperty(this, "smismember", {
853
+ enumerable: true,
854
+ configurable: true,
855
+ writable: true,
856
+ value: (key, members) => new mod_js_1.SMIsMemberCommand([key, members], this.opts).exec(this.client)
857
+ });
848
858
  /**
849
859
  * @see https://redis.io/commands/smembers
850
860
  */
@@ -1003,6 +1013,15 @@ class Redis {
1003
1013
  writable: true,
1004
1014
  value: (...args) => new mod_js_1.ZCountCommand(args, this.opts).exec(this.client)
1005
1015
  });
1016
+ /**
1017
+ * @see https://redis.io/commands/zdiffstore
1018
+ */
1019
+ Object.defineProperty(this, "zdiffstore", {
1020
+ enumerable: true,
1021
+ configurable: true,
1022
+ writable: true,
1023
+ value: (...args) => new zdiffstore_js_1.ZDiffStoreCommand(args, this.opts).exec(this.client)
1024
+ });
1006
1025
  /**
1007
1026
  * @see https://redis.io/commands/zincrby
1008
1027
  */
package/script/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "v1.18.5-rc.0";
4
+ exports.VERSION = "v1.19.0";
@@ -23,6 +23,7 @@ export * from "./getset.js";
23
23
  export * from "./hdel.js";
24
24
  export * from "./hexists.js";
25
25
  export * from "./hget.js";
26
+ export * from "./smismember.js";
26
27
  export * from "./hgetall.js";
27
28
  export * from "./hincrby.js";
28
29
  export * from "./hincrbyfloat.js";
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/smismember
4
+ */
5
+ export declare class SMIsMemberCommand<TMembers extends unknown[]> extends Command<("0" | "1")[], (0 | 1)[]> {
6
+ constructor(cmd: [key: string, ...members: TMembers], opts?: CommandOptions<("0" | "1")[], (0 | 1)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/zdiffstore
4
+ */
5
+ export declare class ZDiffStoreCommand extends Command<number, number> {
6
+ constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
7
+ }
@@ -85,6 +85,10 @@ export declare class Pipeline {
85
85
  * @see https://redis.io/commands/bitpos
86
86
  */
87
87
  bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => this;
88
+ /**
89
+ * @see https://redis.io/commands/zdiffstore
90
+ */
91
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => this;
88
92
  /**
89
93
  * @see https://redis.io/commands/dbsize
90
94
  */
@@ -424,6 +428,10 @@ export declare class Pipeline {
424
428
  * @see https://redis.io/commands/smembers
425
429
  */
426
430
  smembers: <TData extends unknown[] = string[]>(key: string) => this;
431
+ /**
432
+ * @see https://redis.io/commands/smismember
433
+ */
434
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => this;
427
435
  /**
428
436
  * @see https://redis.io/commands/smove
429
437
  */
@@ -411,6 +411,10 @@ export declare class Redis {
411
411
  * @see https://redis.io/commands/sismember
412
412
  */
413
413
  sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
414
+ /**
415
+ * @see https://redis.io/commands/smismember
416
+ */
417
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
414
418
  /**
415
419
  * @see https://redis.io/commands/smembers
416
420
  */
@@ -479,6 +483,10 @@ export declare class Redis {
479
483
  * @see https://redis.io/commands/zcount
480
484
  */
481
485
  zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
486
+ /**
487
+ * @see https://redis.io/commands/zdiffstore
488
+ */
489
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
482
490
  /**
483
491
  * @see https://redis.io/commands/zincrby
484
492
  */
@@ -1 +1 @@
1
- export declare const VERSION = "v1.18.5-rc.0";
1
+ export declare const VERSION = "v1.19.0";