@upstash/redis 1.12.0 → 1.13.0-next.1

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.
@@ -0,0 +1,11 @@
1
+ import { Command } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/zscore
4
+ */
5
+ export class ZMScoreCommand extends Command {
6
+ constructor(cmd, opts) {
7
+ const [key, members] = cmd;
8
+ console.log({ key, members });
9
+ super(["zmscore", key, ...members], opts);
10
+ }
11
+ }
@@ -1,5 +1,6 @@
1
1
  import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, 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";
2
2
  import { UpstashError } from "./error.js";
3
+ import { ZMScoreCommand } from "./commands/zmscore.js";
3
4
  /**
4
5
  * Upstash REST API supports command pipelining to send multiple commands in
5
6
  * batch, instead of sending each command one by one and waiting for a response.
@@ -1011,6 +1012,15 @@ export class Pipeline {
1011
1012
  writable: true,
1012
1013
  value: (...args) => this.chain(new ZLexCountCommand(args, this.commandOptions))
1013
1014
  });
1015
+ /**
1016
+ * @see https://redis.io/commands/zmscore
1017
+ */
1018
+ Object.defineProperty(this, "zmscore", {
1019
+ enumerable: true,
1020
+ configurable: true,
1021
+ writable: true,
1022
+ value: (...args) => this.chain(new ZMScoreCommand(args, this.commandOptions))
1023
+ });
1014
1024
  /**
1015
1025
  * @see https://redis.io/commands/zpopmax
1016
1026
  */
package/esm/pkg/redis.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, 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";
2
2
  import { Pipeline } from "./pipeline.js";
3
3
  import { Script } from "./script.js";
4
+ import { ZMScoreCommand } from "./commands/zmscore.js";
4
5
  /**
5
6
  * Serverless redis client for upstash.
6
7
  */
@@ -975,6 +976,15 @@ export class Redis {
975
976
  writable: true,
976
977
  value: (...args) => new ZLexCountCommand(args, this.opts).exec(this.client)
977
978
  });
979
+ /**
980
+ * @see https://redis.io/commands/zmscore
981
+ */
982
+ Object.defineProperty(this, "zmscore", {
983
+ enumerable: true,
984
+ configurable: true,
985
+ writable: true,
986
+ value: (...args) => new ZMScoreCommand(args, this.opts).exec(this.client)
987
+ });
978
988
  /**
979
989
  * @see https://redis.io/commands/zpopmax
980
990
  */
package/package.json CHANGED
@@ -3,7 +3,6 @@
3
3
  "main": "./script/platforms/nodejs.js",
4
4
  "types": "./types/platforms/nodejs.d.ts",
5
5
  "name": "@upstash/redis",
6
- "version": "v1.12.0",
7
6
  "description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
8
7
  "repository": {
9
8
  "type": "git",
@@ -59,5 +58,6 @@
59
58
  "require": "./script/platforms/node_with_fetch.js",
60
59
  "types": "./types/platforms/node_with_fetch.d.ts"
61
60
  }
62
- }
61
+ },
62
+ "version": "1.13.0-next.1"
63
63
  }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZMScoreCommand = void 0;
4
+ const command_js_1 = require("./command.js");
5
+ /**
6
+ * @see https://redis.io/commands/zscore
7
+ */
8
+ class ZMScoreCommand extends command_js_1.Command {
9
+ constructor(cmd, opts) {
10
+ const [key, members] = cmd;
11
+ console.log({ key, members });
12
+ super(["zmscore", key, ...members], opts);
13
+ }
14
+ }
15
+ exports.ZMScoreCommand = ZMScoreCommand;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Pipeline = void 0;
4
4
  const mod_js_1 = require("./commands/mod.js");
5
5
  const error_js_1 = require("./error.js");
6
+ const zmscore_js_1 = require("./commands/zmscore.js");
6
7
  /**
7
8
  * Upstash REST API supports command pipelining to send multiple commands in
8
9
  * batch, instead of sending each command one by one and waiting for a response.
@@ -1014,6 +1015,15 @@ class Pipeline {
1014
1015
  writable: true,
1015
1016
  value: (...args) => this.chain(new mod_js_1.ZLexCountCommand(args, this.commandOptions))
1016
1017
  });
1018
+ /**
1019
+ * @see https://redis.io/commands/zmscore
1020
+ */
1021
+ Object.defineProperty(this, "zmscore", {
1022
+ enumerable: true,
1023
+ configurable: true,
1024
+ writable: true,
1025
+ value: (...args) => this.chain(new zmscore_js_1.ZMScoreCommand(args, this.commandOptions))
1026
+ });
1017
1027
  /**
1018
1028
  * @see https://redis.io/commands/zpopmax
1019
1029
  */
@@ -4,6 +4,7 @@ exports.Redis = void 0;
4
4
  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
+ const zmscore_js_1 = require("./commands/zmscore.js");
7
8
  /**
8
9
  * Serverless redis client for upstash.
9
10
  */
@@ -978,6 +979,15 @@ class Redis {
978
979
  writable: true,
979
980
  value: (...args) => new mod_js_1.ZLexCountCommand(args, this.opts).exec(this.client)
980
981
  });
982
+ /**
983
+ * @see https://redis.io/commands/zmscore
984
+ */
985
+ Object.defineProperty(this, "zmscore", {
986
+ enumerable: true,
987
+ configurable: true,
988
+ writable: true,
989
+ value: (...args) => new zmscore_js_1.ZMScoreCommand(args, this.opts).exec(this.client)
990
+ });
981
991
  /**
982
992
  * @see https://redis.io/commands/zpopmax
983
993
  */
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/zscore
4
+ */
5
+ export declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
6
+ constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
7
+ }
@@ -483,6 +483,10 @@ export declare class Pipeline {
483
483
  * @see https://redis.io/commands/zlexcount
484
484
  */
485
485
  zlexcount: (key: string, min: string, max: string) => this;
486
+ /**
487
+ * @see https://redis.io/commands/zmscore
488
+ */
489
+ zmscore: (key: string, members: unknown[]) => this;
486
490
  /**
487
491
  * @see https://redis.io/commands/zpopmax
488
492
  */
@@ -465,6 +465,10 @@ export declare class Redis {
465
465
  * @see https://redis.io/commands/zlexcount
466
466
  */
467
467
  zlexcount: (key: string, min: string, max: string) => Promise<number>;
468
+ /**
469
+ * @see https://redis.io/commands/zmscore
470
+ */
471
+ zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
468
472
  /**
469
473
  * @see https://redis.io/commands/zpopmax
470
474
  */