@upstash/redis 1.1.0 → 1.3.0-alpha.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.
package/README.md CHANGED
@@ -77,11 +77,26 @@ const redis = new Redis({
77
77
  url: <UPSTASH_REDIS_REST_URL>,
78
78
  token: <UPSTASH_REDIS_REST_TOKEN>,
79
79
  })
80
- // or load directly from env
80
+
81
+
82
+ // or load directly from global env
83
+
84
+ // service worker
81
85
  const redis = Redis.fromEnv()
86
+
87
+
88
+ // module worker
89
+ export default {
90
+ async fetch(request: Request, env: Bindings) {
91
+ const redis = Redis.fromEnv(env)
92
+ // ...
93
+ }
94
+ }
95
+
82
96
  ```
83
97
 
84
- - [Code example](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers)
98
+ - [Code example service worker](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers)
99
+ - [Code example module worker](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers-modules)
85
100
  - [Documentation](https://docs.upstash.com/redis/tutorials/cloudflare_workers_with_redis)
86
101
 
87
102
  #### Fastly
@@ -115,6 +115,13 @@ var EchoCommand = class extends Command {
115
115
  }
116
116
  };
117
117
 
118
+ // pkg/commands/eval.ts
119
+ var EvalCommand = class extends Command {
120
+ constructor(script, keys, args) {
121
+ super(["eval", script, keys.length, ...keys, ...args != null ? args : []]);
122
+ }
123
+ };
124
+
118
125
  // pkg/commands/exists.ts
119
126
  var ExistsCommand = class extends Command {
120
127
  constructor(...keys) {
@@ -978,6 +985,7 @@ export {
978
985
  DecrByCommand,
979
986
  DelCommand,
980
987
  EchoCommand,
988
+ EvalCommand,
981
989
  ExistsCommand,
982
990
  ExpireCommand,
983
991
  ExpireAtCommand,
@@ -3,11 +3,13 @@ import {
3
3
  BitCountCommand,
4
4
  BitOpCommand,
5
5
  BitPosCommand,
6
+ Command,
6
7
  DBSizeCommand,
7
8
  DecrByCommand,
8
9
  DecrCommand,
9
10
  DelCommand,
10
11
  EchoCommand,
12
+ EvalCommand,
11
13
  ExistsCommand,
12
14
  ExpireAtCommand,
13
15
  ExpireCommand,
@@ -107,11 +109,50 @@ import {
107
109
  ZScanCommand,
108
110
  ZScoreCommand,
109
111
  ZUnionStoreCommand
110
- } from "./chunk-HZBBCLMC.mjs";
112
+ } from "./chunk-5567SQFQ.mjs";
111
113
  import {
112
114
  UpstashError
113
115
  } from "./chunk-7YUZYRJS.mjs";
114
116
 
117
+ // pkg/commands/evalsha.ts
118
+ var EvalshaCommand = class extends Command {
119
+ constructor(sha, keys, args) {
120
+ super(["evalsha", sha, keys.length, ...keys, ...args != null ? args : []]);
121
+ }
122
+ };
123
+
124
+ // pkg/commands/script_exists.ts
125
+ var ScriptExistsCommand = class extends Command {
126
+ constructor(...hash) {
127
+ super(["script", "exists", ...hash], {
128
+ deserialize: (result) => {
129
+ const parsed = result;
130
+ return parsed.length === 1 ? parsed[0] : parsed;
131
+ }
132
+ });
133
+ }
134
+ };
135
+
136
+ // pkg/commands/script_flush.ts
137
+ var ScriptFlushCommand = class extends Command {
138
+ constructor(opts) {
139
+ const cmd = ["script", "flush"];
140
+ if (opts == null ? void 0 : opts.sync) {
141
+ cmd.push("sync");
142
+ } else if (opts == null ? void 0 : opts.async) {
143
+ cmd.push("async");
144
+ }
145
+ super(cmd);
146
+ }
147
+ };
148
+
149
+ // pkg/commands/script_load.ts
150
+ var ScriptLoadCommand = class extends Command {
151
+ constructor(script) {
152
+ super(["script", "load", script]);
153
+ }
154
+ };
155
+
115
156
  // pkg/pipeline.ts
116
157
  var Pipeline = class {
117
158
  constructor(client) {
@@ -139,6 +180,8 @@ var Pipeline = class {
139
180
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
140
181
  this.del = (...args) => this.chain(new DelCommand(...args));
141
182
  this.echo = (...args) => this.chain(new EchoCommand(...args));
183
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
184
+ this.evalsha = (...args) => this.chain(new EvalshaCommand(...args));
142
185
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
143
186
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
144
187
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -196,6 +239,9 @@ var Pipeline = class {
196
239
  this.sadd = (key, ...members) => this.chain(new SAddCommand(key, ...members));
197
240
  this.scan = (...args) => this.chain(new ScanCommand(...args));
198
241
  this.scard = (...args) => this.chain(new SCardCommand(...args));
242
+ this.scriptExists = (...args) => this.chain(new ScriptExistsCommand(...args));
243
+ this.scriptFlush = (...args) => this.chain(new ScriptFlushCommand(...args));
244
+ this.scriptLoad = (...args) => this.chain(new ScriptLoadCommand(...args));
199
245
  this.sdiff = (...args) => this.chain(new SDiffCommand(...args));
200
246
  this.sdiffstore = (...args) => this.chain(new SDiffStoreCommand(...args));
201
247
  this.set = (key, value, opts) => this.chain(new SetCommand(key, value, opts));
@@ -265,6 +311,8 @@ var Redis = class {
265
311
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
266
312
  this.del = (...args) => new DelCommand(...args).exec(this.client);
267
313
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
314
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
315
+ this.evalsha = (...args) => new EvalshaCommand(...args).exec(this.client);
268
316
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
269
317
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
270
318
  this.expireat = (...args) => new ExpireAtCommand(...args).exec(this.client);
@@ -322,6 +370,9 @@ var Redis = class {
322
370
  this.sadd = (key, ...members) => new SAddCommand(key, ...members).exec(this.client);
323
371
  this.scan = (...args) => new ScanCommand(...args).exec(this.client);
324
372
  this.scard = (...args) => new SCardCommand(...args).exec(this.client);
373
+ this.scriptExists = (...args) => new ScriptExistsCommand(...args).exec(this.client);
374
+ this.scriptFlush = (...args) => new ScriptFlushCommand(...args).exec(this.client);
375
+ this.scriptLoad = (...args) => new ScriptLoadCommand(...args).exec(this.client);
325
376
  this.sdiff = (...args) => new SDiffCommand(...args).exec(this.client);
326
377
  this.sdiffstore = (...args) => new SDiffStoreCommand(...args).exec(this.client);
327
378
  this.set = (key, value, opts) => new SetCommand(key, value, opts).exec(this.client);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Redis
3
- } from "./chunk-256N7RVN.mjs";
3
+ } from "./chunk-KI7YOGWS.mjs";
4
4
  import {
5
5
  HttpClient
6
6
  } from "./chunk-HIDCSH5S.mjs";
package/cloudflare.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as Redis$1 } from './redis-a9efcf58';
1
+ import { R as Redis$1 } from './redis-364a4445';
2
2
  import './http';
3
3
  import './zunionstore-342168a6';
4
4
 
@@ -32,7 +32,10 @@ declare class Redis extends Redis$1 {
32
32
  * ```
33
33
  */
34
34
  constructor(config: RedisConfigCloudflare);
35
- static fromEnv(): Redis;
35
+ static fromEnv(env?: {
36
+ UPSTASH_REDIS_REST_URL: string;
37
+ UPSTASH_REDIS_REST_TOKEN: string;
38
+ }): Redis;
36
39
  }
37
40
 
38
41
  export { Redis, RedisConfigCloudflare };
package/cloudflare.js CHANGED
@@ -190,6 +190,13 @@ var EchoCommand = class extends Command {
190
190
  }
191
191
  };
192
192
 
193
+ // pkg/commands/eval.ts
194
+ var EvalCommand = class extends Command {
195
+ constructor(script, keys, args) {
196
+ super(["eval", script, keys.length, ...keys, ...args != null ? args : []]);
197
+ }
198
+ };
199
+
193
200
  // pkg/commands/exists.ts
194
201
  var ExistsCommand = class extends Command {
195
202
  constructor(...keys) {
@@ -1042,6 +1049,45 @@ var ZUnionStoreCommand = class extends Command {
1042
1049
  }
1043
1050
  };
1044
1051
 
1052
+ // pkg/commands/evalsha.ts
1053
+ var EvalshaCommand = class extends Command {
1054
+ constructor(sha, keys, args) {
1055
+ super(["evalsha", sha, keys.length, ...keys, ...args != null ? args : []]);
1056
+ }
1057
+ };
1058
+
1059
+ // pkg/commands/script_exists.ts
1060
+ var ScriptExistsCommand = class extends Command {
1061
+ constructor(...hash) {
1062
+ super(["script", "exists", ...hash], {
1063
+ deserialize: (result) => {
1064
+ const parsed = result;
1065
+ return parsed.length === 1 ? parsed[0] : parsed;
1066
+ }
1067
+ });
1068
+ }
1069
+ };
1070
+
1071
+ // pkg/commands/script_flush.ts
1072
+ var ScriptFlushCommand = class extends Command {
1073
+ constructor(opts) {
1074
+ const cmd = ["script", "flush"];
1075
+ if (opts == null ? void 0 : opts.sync) {
1076
+ cmd.push("sync");
1077
+ } else if (opts == null ? void 0 : opts.async) {
1078
+ cmd.push("async");
1079
+ }
1080
+ super(cmd);
1081
+ }
1082
+ };
1083
+
1084
+ // pkg/commands/script_load.ts
1085
+ var ScriptLoadCommand = class extends Command {
1086
+ constructor(script) {
1087
+ super(["script", "load", script]);
1088
+ }
1089
+ };
1090
+
1045
1091
  // pkg/pipeline.ts
1046
1092
  var Pipeline = class {
1047
1093
  constructor(client) {
@@ -1069,6 +1115,8 @@ var Pipeline = class {
1069
1115
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
1070
1116
  this.del = (...args) => this.chain(new DelCommand(...args));
1071
1117
  this.echo = (...args) => this.chain(new EchoCommand(...args));
1118
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
1119
+ this.evalsha = (...args) => this.chain(new EvalshaCommand(...args));
1072
1120
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
1073
1121
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
1074
1122
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -1126,6 +1174,9 @@ var Pipeline = class {
1126
1174
  this.sadd = (key, ...members) => this.chain(new SAddCommand(key, ...members));
1127
1175
  this.scan = (...args) => this.chain(new ScanCommand(...args));
1128
1176
  this.scard = (...args) => this.chain(new SCardCommand(...args));
1177
+ this.scriptExists = (...args) => this.chain(new ScriptExistsCommand(...args));
1178
+ this.scriptFlush = (...args) => this.chain(new ScriptFlushCommand(...args));
1179
+ this.scriptLoad = (...args) => this.chain(new ScriptLoadCommand(...args));
1129
1180
  this.sdiff = (...args) => this.chain(new SDiffCommand(...args));
1130
1181
  this.sdiffstore = (...args) => this.chain(new SDiffStoreCommand(...args));
1131
1182
  this.set = (key, value, opts) => this.chain(new SetCommand(key, value, opts));
@@ -1195,6 +1246,8 @@ var Redis = class {
1195
1246
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
1196
1247
  this.del = (...args) => new DelCommand(...args).exec(this.client);
1197
1248
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
1249
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
1250
+ this.evalsha = (...args) => new EvalshaCommand(...args).exec(this.client);
1198
1251
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
1199
1252
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
1200
1253
  this.expireat = (...args) => new ExpireAtCommand(...args).exec(this.client);
@@ -1252,6 +1305,9 @@ var Redis = class {
1252
1305
  this.sadd = (key, ...members) => new SAddCommand(key, ...members).exec(this.client);
1253
1306
  this.scan = (...args) => new ScanCommand(...args).exec(this.client);
1254
1307
  this.scard = (...args) => new SCardCommand(...args).exec(this.client);
1308
+ this.scriptExists = (...args) => new ScriptExistsCommand(...args).exec(this.client);
1309
+ this.scriptFlush = (...args) => new ScriptFlushCommand(...args).exec(this.client);
1310
+ this.scriptLoad = (...args) => new ScriptLoadCommand(...args).exec(this.client);
1255
1311
  this.sdiff = (...args) => new SDiffCommand(...args).exec(this.client);
1256
1312
  this.sdiffstore = (...args) => new SDiffStoreCommand(...args).exec(this.client);
1257
1313
  this.set = (key, value, opts) => new SetCommand(key, value, opts).exec(this.client);
@@ -1314,9 +1370,10 @@ var Redis2 = class extends Redis {
1314
1370
  });
1315
1371
  super(client);
1316
1372
  }
1317
- static fromEnv() {
1318
- const url = UPSTASH_REDIS_REST_URL;
1319
- const token = UPSTASH_REDIS_REST_TOKEN;
1373
+ static fromEnv(env) {
1374
+ var _a, _b;
1375
+ const url = (_a = env == null ? void 0 : env.UPSTASH_REDIS_REST_URL) != null ? _a : UPSTASH_REDIS_REST_URL;
1376
+ const token = (_b = env == null ? void 0 : env.UPSTASH_REDIS_REST_TOKEN) != null ? _b : UPSTASH_REDIS_REST_TOKEN;
1320
1377
  if (!url) {
1321
1378
  throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`");
1322
1379
  }
package/cloudflare.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Redis
3
- } from "./chunk-256N7RVN.mjs";
4
- import "./chunk-HZBBCLMC.mjs";
3
+ } from "./chunk-KI7YOGWS.mjs";
4
+ import "./chunk-5567SQFQ.mjs";
5
5
  import {
6
6
  HttpClient
7
7
  } from "./chunk-HIDCSH5S.mjs";
@@ -18,9 +18,10 @@ var Redis2 = class extends Redis {
18
18
  });
19
19
  super(client);
20
20
  }
21
- static fromEnv() {
22
- const url = UPSTASH_REDIS_REST_URL;
23
- const token = UPSTASH_REDIS_REST_TOKEN;
21
+ static fromEnv(env) {
22
+ var _a, _b;
23
+ const url = (_a = env == null ? void 0 : env.UPSTASH_REDIS_REST_URL) != null ? _a : UPSTASH_REDIS_REST_URL;
24
+ const token = (_b = env == null ? void 0 : env.UPSTASH_REDIS_REST_TOKEN) != null ? _b : UPSTASH_REDIS_REST_TOKEN;
24
25
  if (!url) {
25
26
  throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`");
26
27
  }
package/commands.d.ts CHANGED
@@ -67,6 +67,13 @@ declare class EchoCommand extends Command<string, string> {
67
67
  constructor(message: string);
68
68
  }
69
69
 
70
+ /**
71
+ * @see https://redis.io/commands/eval
72
+ */
73
+ declare class EvalCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
74
+ constructor(script: string, keys: string[], args: TArgs);
75
+ }
76
+
70
77
  /**
71
78
  * @see https://redis.io/commands/exists
72
79
  */
@@ -724,4 +731,4 @@ declare class ZScoreCommand<TData> extends Command<number | null, string | null>
724
731
  constructor(key: string, member: TData);
725
732
  }
726
733
 
727
- export { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, 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, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PExpireAtCommand, PExpireCommand, PSetEXCommand, PTtlCommand, PersistCommand, PingCommand, PublishCommand, RPopCommand, RPushCommand, RPushXCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, SAddCommand, SCardCommand, SDiffCommand, SDiffStoreCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, SUnionCommand, SUnionStoreCommand, SetBitCommand, SetExCommand, SetNxCommand, SetRangeCommand, StrLenCommand, TimeCommand, TouchCommand, TtlCommand, ZCardCommand, ZCountCommand, ZIncrByComand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand };
734
+ export { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, 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, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PExpireAtCommand, PExpireCommand, PSetEXCommand, PTtlCommand, PersistCommand, PingCommand, PublishCommand, RPopCommand, RPushCommand, RPushXCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, SAddCommand, SCardCommand, SDiffCommand, SDiffStoreCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, SUnionCommand, SUnionStoreCommand, SetBitCommand, SetExCommand, SetNxCommand, SetRangeCommand, StrLenCommand, TimeCommand, TouchCommand, TtlCommand, ZCardCommand, ZCountCommand, ZIncrByComand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand };
package/commands.js CHANGED
@@ -34,6 +34,7 @@ __export(commands_exports, {
34
34
  DecrCommand: () => DecrCommand,
35
35
  DelCommand: () => DelCommand,
36
36
  EchoCommand: () => EchoCommand,
37
+ EvalCommand: () => EvalCommand,
37
38
  ExistsCommand: () => ExistsCommand,
38
39
  ExpireAtCommand: () => ExpireAtCommand,
39
40
  ExpireCommand: () => ExpireCommand,
@@ -256,6 +257,13 @@ var EchoCommand = class extends Command {
256
257
  }
257
258
  };
258
259
 
260
+ // pkg/commands/eval.ts
261
+ var EvalCommand = class extends Command {
262
+ constructor(script, keys, args) {
263
+ super(["eval", script, keys.length, ...keys, ...args != null ? args : []]);
264
+ }
265
+ };
266
+
259
267
  // pkg/commands/exists.ts
260
268
  var ExistsCommand = class extends Command {
261
269
  constructor(...keys) {
@@ -1120,6 +1128,7 @@ module.exports = __toCommonJS(commands_exports);
1120
1128
  DecrCommand,
1121
1129
  DelCommand,
1122
1130
  EchoCommand,
1131
+ EvalCommand,
1123
1132
  ExistsCommand,
1124
1133
  ExpireAtCommand,
1125
1134
  ExpireCommand,
package/commands.mjs CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  DecrCommand,
10
10
  DelCommand,
11
11
  EchoCommand,
12
+ EvalCommand,
12
13
  ExistsCommand,
13
14
  ExpireAtCommand,
14
15
  ExpireCommand,
@@ -108,7 +109,7 @@ import {
108
109
  ZScanCommand,
109
110
  ZScoreCommand,
110
111
  ZUnionStoreCommand
111
- } from "./chunk-HZBBCLMC.mjs";
112
+ } from "./chunk-5567SQFQ.mjs";
112
113
  import "./chunk-7YUZYRJS.mjs";
113
114
  export {
114
115
  AppendCommand,
@@ -121,6 +122,7 @@ export {
121
122
  DecrCommand,
122
123
  DelCommand,
123
124
  EchoCommand,
125
+ EvalCommand,
124
126
  ExistsCommand,
125
127
  ExpireAtCommand,
126
128
  ExpireCommand,
package/fastly.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as Redis$1 } from './redis-a9efcf58';
1
+ import { R as Redis$1 } from './redis-364a4445';
2
2
  import './http';
3
3
  import './zunionstore-342168a6';
4
4
 
package/fastly.js CHANGED
@@ -190,6 +190,13 @@ var EchoCommand = class extends Command {
190
190
  }
191
191
  };
192
192
 
193
+ // pkg/commands/eval.ts
194
+ var EvalCommand = class extends Command {
195
+ constructor(script, keys, args) {
196
+ super(["eval", script, keys.length, ...keys, ...args != null ? args : []]);
197
+ }
198
+ };
199
+
193
200
  // pkg/commands/exists.ts
194
201
  var ExistsCommand = class extends Command {
195
202
  constructor(...keys) {
@@ -1042,6 +1049,45 @@ var ZUnionStoreCommand = class extends Command {
1042
1049
  }
1043
1050
  };
1044
1051
 
1052
+ // pkg/commands/evalsha.ts
1053
+ var EvalshaCommand = class extends Command {
1054
+ constructor(sha, keys, args) {
1055
+ super(["evalsha", sha, keys.length, ...keys, ...args != null ? args : []]);
1056
+ }
1057
+ };
1058
+
1059
+ // pkg/commands/script_exists.ts
1060
+ var ScriptExistsCommand = class extends Command {
1061
+ constructor(...hash) {
1062
+ super(["script", "exists", ...hash], {
1063
+ deserialize: (result) => {
1064
+ const parsed = result;
1065
+ return parsed.length === 1 ? parsed[0] : parsed;
1066
+ }
1067
+ });
1068
+ }
1069
+ };
1070
+
1071
+ // pkg/commands/script_flush.ts
1072
+ var ScriptFlushCommand = class extends Command {
1073
+ constructor(opts) {
1074
+ const cmd = ["script", "flush"];
1075
+ if (opts == null ? void 0 : opts.sync) {
1076
+ cmd.push("sync");
1077
+ } else if (opts == null ? void 0 : opts.async) {
1078
+ cmd.push("async");
1079
+ }
1080
+ super(cmd);
1081
+ }
1082
+ };
1083
+
1084
+ // pkg/commands/script_load.ts
1085
+ var ScriptLoadCommand = class extends Command {
1086
+ constructor(script) {
1087
+ super(["script", "load", script]);
1088
+ }
1089
+ };
1090
+
1045
1091
  // pkg/pipeline.ts
1046
1092
  var Pipeline = class {
1047
1093
  constructor(client) {
@@ -1069,6 +1115,8 @@ var Pipeline = class {
1069
1115
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
1070
1116
  this.del = (...args) => this.chain(new DelCommand(...args));
1071
1117
  this.echo = (...args) => this.chain(new EchoCommand(...args));
1118
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
1119
+ this.evalsha = (...args) => this.chain(new EvalshaCommand(...args));
1072
1120
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
1073
1121
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
1074
1122
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -1126,6 +1174,9 @@ var Pipeline = class {
1126
1174
  this.sadd = (key, ...members) => this.chain(new SAddCommand(key, ...members));
1127
1175
  this.scan = (...args) => this.chain(new ScanCommand(...args));
1128
1176
  this.scard = (...args) => this.chain(new SCardCommand(...args));
1177
+ this.scriptExists = (...args) => this.chain(new ScriptExistsCommand(...args));
1178
+ this.scriptFlush = (...args) => this.chain(new ScriptFlushCommand(...args));
1179
+ this.scriptLoad = (...args) => this.chain(new ScriptLoadCommand(...args));
1129
1180
  this.sdiff = (...args) => this.chain(new SDiffCommand(...args));
1130
1181
  this.sdiffstore = (...args) => this.chain(new SDiffStoreCommand(...args));
1131
1182
  this.set = (key, value, opts) => this.chain(new SetCommand(key, value, opts));
@@ -1195,6 +1246,8 @@ var Redis = class {
1195
1246
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
1196
1247
  this.del = (...args) => new DelCommand(...args).exec(this.client);
1197
1248
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
1249
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
1250
+ this.evalsha = (...args) => new EvalshaCommand(...args).exec(this.client);
1198
1251
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
1199
1252
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
1200
1253
  this.expireat = (...args) => new ExpireAtCommand(...args).exec(this.client);
@@ -1252,6 +1305,9 @@ var Redis = class {
1252
1305
  this.sadd = (key, ...members) => new SAddCommand(key, ...members).exec(this.client);
1253
1306
  this.scan = (...args) => new ScanCommand(...args).exec(this.client);
1254
1307
  this.scard = (...args) => new SCardCommand(...args).exec(this.client);
1308
+ this.scriptExists = (...args) => new ScriptExistsCommand(...args).exec(this.client);
1309
+ this.scriptFlush = (...args) => new ScriptFlushCommand(...args).exec(this.client);
1310
+ this.scriptLoad = (...args) => new ScriptLoadCommand(...args).exec(this.client);
1255
1311
  this.sdiff = (...args) => new SDiffCommand(...args).exec(this.client);
1256
1312
  this.sdiffstore = (...args) => new SDiffStoreCommand(...args).exec(this.client);
1257
1313
  this.set = (key, value, opts) => new SetCommand(key, value, opts).exec(this.client);
package/fastly.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Redis
3
- } from "./chunk-256N7RVN.mjs";
4
- import "./chunk-HZBBCLMC.mjs";
3
+ } from "./chunk-KI7YOGWS.mjs";
4
+ import "./chunk-5567SQFQ.mjs";
5
5
  import {
6
6
  HttpClient
7
7
  } from "./chunk-HIDCSH5S.mjs";
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { Redis, RedisConfigNodejs } from './nodejs';
2
- import './redis-a9efcf58';
2
+ import './redis-364a4445';
3
3
  import './http';
4
4
  import './zunionstore-342168a6';
5
5
 
package/index.js CHANGED
@@ -163,6 +163,13 @@ var EchoCommand = class extends Command {
163
163
  }
164
164
  };
165
165
 
166
+ // pkg/commands/eval.ts
167
+ var EvalCommand = class extends Command {
168
+ constructor(script, keys, args) {
169
+ super(["eval", script, keys.length, ...keys, ...args != null ? args : []]);
170
+ }
171
+ };
172
+
166
173
  // pkg/commands/exists.ts
167
174
  var ExistsCommand = class extends Command {
168
175
  constructor(...keys) {
@@ -1015,6 +1022,45 @@ var ZUnionStoreCommand = class extends Command {
1015
1022
  }
1016
1023
  };
1017
1024
 
1025
+ // pkg/commands/evalsha.ts
1026
+ var EvalshaCommand = class extends Command {
1027
+ constructor(sha, keys, args) {
1028
+ super(["evalsha", sha, keys.length, ...keys, ...args != null ? args : []]);
1029
+ }
1030
+ };
1031
+
1032
+ // pkg/commands/script_exists.ts
1033
+ var ScriptExistsCommand = class extends Command {
1034
+ constructor(...hash) {
1035
+ super(["script", "exists", ...hash], {
1036
+ deserialize: (result) => {
1037
+ const parsed = result;
1038
+ return parsed.length === 1 ? parsed[0] : parsed;
1039
+ }
1040
+ });
1041
+ }
1042
+ };
1043
+
1044
+ // pkg/commands/script_flush.ts
1045
+ var ScriptFlushCommand = class extends Command {
1046
+ constructor(opts) {
1047
+ const cmd = ["script", "flush"];
1048
+ if (opts == null ? void 0 : opts.sync) {
1049
+ cmd.push("sync");
1050
+ } else if (opts == null ? void 0 : opts.async) {
1051
+ cmd.push("async");
1052
+ }
1053
+ super(cmd);
1054
+ }
1055
+ };
1056
+
1057
+ // pkg/commands/script_load.ts
1058
+ var ScriptLoadCommand = class extends Command {
1059
+ constructor(script) {
1060
+ super(["script", "load", script]);
1061
+ }
1062
+ };
1063
+
1018
1064
  // pkg/pipeline.ts
1019
1065
  var Pipeline = class {
1020
1066
  constructor(client) {
@@ -1042,6 +1088,8 @@ var Pipeline = class {
1042
1088
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
1043
1089
  this.del = (...args) => this.chain(new DelCommand(...args));
1044
1090
  this.echo = (...args) => this.chain(new EchoCommand(...args));
1091
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
1092
+ this.evalsha = (...args) => this.chain(new EvalshaCommand(...args));
1045
1093
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
1046
1094
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
1047
1095
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -1099,6 +1147,9 @@ var Pipeline = class {
1099
1147
  this.sadd = (key, ...members) => this.chain(new SAddCommand(key, ...members));
1100
1148
  this.scan = (...args) => this.chain(new ScanCommand(...args));
1101
1149
  this.scard = (...args) => this.chain(new SCardCommand(...args));
1150
+ this.scriptExists = (...args) => this.chain(new ScriptExistsCommand(...args));
1151
+ this.scriptFlush = (...args) => this.chain(new ScriptFlushCommand(...args));
1152
+ this.scriptLoad = (...args) => this.chain(new ScriptLoadCommand(...args));
1102
1153
  this.sdiff = (...args) => this.chain(new SDiffCommand(...args));
1103
1154
  this.sdiffstore = (...args) => this.chain(new SDiffStoreCommand(...args));
1104
1155
  this.set = (key, value, opts) => this.chain(new SetCommand(key, value, opts));
@@ -1168,6 +1219,8 @@ var Redis = class {
1168
1219
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
1169
1220
  this.del = (...args) => new DelCommand(...args).exec(this.client);
1170
1221
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
1222
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
1223
+ this.evalsha = (...args) => new EvalshaCommand(...args).exec(this.client);
1171
1224
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
1172
1225
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
1173
1226
  this.expireat = (...args) => new ExpireAtCommand(...args).exec(this.client);
@@ -1225,6 +1278,9 @@ var Redis = class {
1225
1278
  this.sadd = (key, ...members) => new SAddCommand(key, ...members).exec(this.client);
1226
1279
  this.scan = (...args) => new ScanCommand(...args).exec(this.client);
1227
1280
  this.scard = (...args) => new SCardCommand(...args).exec(this.client);
1281
+ this.scriptExists = (...args) => new ScriptExistsCommand(...args).exec(this.client);
1282
+ this.scriptFlush = (...args) => new ScriptFlushCommand(...args).exec(this.client);
1283
+ this.scriptLoad = (...args) => new ScriptLoadCommand(...args).exec(this.client);
1228
1284
  this.sdiff = (...args) => new SDiffCommand(...args).exec(this.client);
1229
1285
  this.sdiffstore = (...args) => new SDiffStoreCommand(...args).exec(this.client);
1230
1286
  this.set = (key, value, opts) => new SetCommand(key, value, opts).exec(this.client);
package/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Redis
3
- } from "./chunk-FR62Y7XB.mjs";
4
- import "./chunk-256N7RVN.mjs";
5
- import "./chunk-HZBBCLMC.mjs";
3
+ } from "./chunk-T3BIHZ2F.mjs";
4
+ import "./chunk-KI7YOGWS.mjs";
5
+ import "./chunk-5567SQFQ.mjs";
6
6
  import "./chunk-HIDCSH5S.mjs";
7
7
  import {
8
8
  UpstashError
package/nodejs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as Redis$1 } from './redis-a9efcf58';
1
+ import { R as Redis$1 } from './redis-364a4445';
2
2
  import './http';
3
3
  import './zunionstore-342168a6';
4
4
 
package/nodejs.js CHANGED
@@ -162,6 +162,13 @@ var EchoCommand = class extends Command {
162
162
  }
163
163
  };
164
164
 
165
+ // pkg/commands/eval.ts
166
+ var EvalCommand = class extends Command {
167
+ constructor(script, keys, args) {
168
+ super(["eval", script, keys.length, ...keys, ...args != null ? args : []]);
169
+ }
170
+ };
171
+
165
172
  // pkg/commands/exists.ts
166
173
  var ExistsCommand = class extends Command {
167
174
  constructor(...keys) {
@@ -1014,6 +1021,45 @@ var ZUnionStoreCommand = class extends Command {
1014
1021
  }
1015
1022
  };
1016
1023
 
1024
+ // pkg/commands/evalsha.ts
1025
+ var EvalshaCommand = class extends Command {
1026
+ constructor(sha, keys, args) {
1027
+ super(["evalsha", sha, keys.length, ...keys, ...args != null ? args : []]);
1028
+ }
1029
+ };
1030
+
1031
+ // pkg/commands/script_exists.ts
1032
+ var ScriptExistsCommand = class extends Command {
1033
+ constructor(...hash) {
1034
+ super(["script", "exists", ...hash], {
1035
+ deserialize: (result) => {
1036
+ const parsed = result;
1037
+ return parsed.length === 1 ? parsed[0] : parsed;
1038
+ }
1039
+ });
1040
+ }
1041
+ };
1042
+
1043
+ // pkg/commands/script_flush.ts
1044
+ var ScriptFlushCommand = class extends Command {
1045
+ constructor(opts) {
1046
+ const cmd = ["script", "flush"];
1047
+ if (opts == null ? void 0 : opts.sync) {
1048
+ cmd.push("sync");
1049
+ } else if (opts == null ? void 0 : opts.async) {
1050
+ cmd.push("async");
1051
+ }
1052
+ super(cmd);
1053
+ }
1054
+ };
1055
+
1056
+ // pkg/commands/script_load.ts
1057
+ var ScriptLoadCommand = class extends Command {
1058
+ constructor(script) {
1059
+ super(["script", "load", script]);
1060
+ }
1061
+ };
1062
+
1017
1063
  // pkg/pipeline.ts
1018
1064
  var Pipeline = class {
1019
1065
  constructor(client) {
@@ -1041,6 +1087,8 @@ var Pipeline = class {
1041
1087
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
1042
1088
  this.del = (...args) => this.chain(new DelCommand(...args));
1043
1089
  this.echo = (...args) => this.chain(new EchoCommand(...args));
1090
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
1091
+ this.evalsha = (...args) => this.chain(new EvalshaCommand(...args));
1044
1092
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
1045
1093
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
1046
1094
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -1098,6 +1146,9 @@ var Pipeline = class {
1098
1146
  this.sadd = (key, ...members) => this.chain(new SAddCommand(key, ...members));
1099
1147
  this.scan = (...args) => this.chain(new ScanCommand(...args));
1100
1148
  this.scard = (...args) => this.chain(new SCardCommand(...args));
1149
+ this.scriptExists = (...args) => this.chain(new ScriptExistsCommand(...args));
1150
+ this.scriptFlush = (...args) => this.chain(new ScriptFlushCommand(...args));
1151
+ this.scriptLoad = (...args) => this.chain(new ScriptLoadCommand(...args));
1101
1152
  this.sdiff = (...args) => this.chain(new SDiffCommand(...args));
1102
1153
  this.sdiffstore = (...args) => this.chain(new SDiffStoreCommand(...args));
1103
1154
  this.set = (key, value, opts) => this.chain(new SetCommand(key, value, opts));
@@ -1167,6 +1218,8 @@ var Redis = class {
1167
1218
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
1168
1219
  this.del = (...args) => new DelCommand(...args).exec(this.client);
1169
1220
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
1221
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
1222
+ this.evalsha = (...args) => new EvalshaCommand(...args).exec(this.client);
1170
1223
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
1171
1224
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
1172
1225
  this.expireat = (...args) => new ExpireAtCommand(...args).exec(this.client);
@@ -1224,6 +1277,9 @@ var Redis = class {
1224
1277
  this.sadd = (key, ...members) => new SAddCommand(key, ...members).exec(this.client);
1225
1278
  this.scan = (...args) => new ScanCommand(...args).exec(this.client);
1226
1279
  this.scard = (...args) => new SCardCommand(...args).exec(this.client);
1280
+ this.scriptExists = (...args) => new ScriptExistsCommand(...args).exec(this.client);
1281
+ this.scriptFlush = (...args) => new ScriptFlushCommand(...args).exec(this.client);
1282
+ this.scriptLoad = (...args) => new ScriptLoadCommand(...args).exec(this.client);
1227
1283
  this.sdiff = (...args) => new SDiffCommand(...args).exec(this.client);
1228
1284
  this.sdiffstore = (...args) => new SDiffStoreCommand(...args).exec(this.client);
1229
1285
  this.set = (key, value, opts) => new SetCommand(key, value, opts).exec(this.client);
package/nodejs.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Redis
3
- } from "./chunk-FR62Y7XB.mjs";
4
- import "./chunk-256N7RVN.mjs";
5
- import "./chunk-HZBBCLMC.mjs";
3
+ } from "./chunk-T3BIHZ2F.mjs";
4
+ import "./chunk-KI7YOGWS.mjs";
5
+ import "./chunk-5567SQFQ.mjs";
6
6
  import "./chunk-HIDCSH5S.mjs";
7
7
  import "./chunk-7YUZYRJS.mjs";
8
8
  export {
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "@upstash/redis", "version": "v1.1.0", "engines": { "node": ">=10" }, "description": "An HTTP/REST based Redis client built on top of Upstash REST API.", "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "scripts": { "test": "jest -i", "fmt": "pnpm lint && pnpm prettier --write .", "lint": "eslint --ext .ts --fix --ignore-path .gitignore .", "build": "tsup && cp package.json ./dist/ && pnpm size-limit" }, "repository": { "type": "git", "url": "git+https://github.com/upstash/upstash-redis.git" }, "keywords": [ "redis", "database", "serverless", "edge", "upstash" ], "author": "Andreas Thomas <andreas.thomas@chronark.com>", "license": "MIT", "bugs": { "url": "https://github.com/upstash/upstash-redis/issues" }, "homepage": "https://github.com/upstash/upstash-redis#readme", "directories": { "examples": "examples" }, "devDependencies": { "@jest/globals": "^27.4.6", "@size-limit/preset-small-lib": "^7.0.8", "@trivago/prettier-plugin-sort-imports": "^3.2.0", "@types/jest": "^27.4.0", "@types/node": "^17.0.8", "@typescript-eslint/eslint-plugin": "^5.9.1", "@typescript-eslint/parser": "^5.9.1", "dotenv": "^12.0.3", "eslint": "^8.6.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^27.4.7", "prettier": "^2.5.1", "size-limit": "^7.0.8", "ts-jest": "^27.1.3", "tsup": "^5.11.11", "typescript": "^4.5.5" }, "dependencies": { "isomorphic-fetch": "^3.0.0" }, "browser": { "isomorphic-fetch": false }, "size-limit": [ { "path": "dist/index.js", "limit": "5 KB" }, { "path": "dist/index.mjs", "limit": "5 KB" }, { "path": "dist/cloudflare.js", "limit": "5 KB" }, { "path": "dist/cloudflare.mjs", "limit": "5 KB" }, { "path": "dist/nodejs.js", "limit": "5 KB" }, { "path": "dist/nodejs.mjs", "limit": "5 KB" }, { "path": "dist/fastly.js", "limit": "5 KB" }, { "path": "dist/fastly.mjs", "limit": "5 KB" } ] }
1
+ { "name": "@upstash/redis", "version": "v1.3.0-alpha.1", "engines": { "node": ">=10" }, "description": "An HTTP/REST based Redis client built on top of Upstash REST API.", "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "scripts": { "test": "jest -i", "fmt": "pnpm lint && pnpm prettier --write .", "lint": "eslint --ext .ts --fix --ignore-path .gitignore .", "build": "tsup && cp package.json ./dist/ && pnpm size-limit" }, "repository": { "type": "git", "url": "git+https://github.com/upstash/upstash-redis.git" }, "keywords": [ "redis", "database", "serverless", "edge", "upstash" ], "author": "Andreas Thomas <andreas.thomas@chronark.com>", "license": "MIT", "bugs": { "url": "https://github.com/upstash/upstash-redis/issues" }, "homepage": "https://github.com/upstash/upstash-redis#readme", "directories": { "examples": "examples" }, "devDependencies": { "@jest/globals": "^27.4.6", "@size-limit/preset-small-lib": "^7.0.8", "@trivago/prettier-plugin-sort-imports": "^3.2.0", "@types/jest": "^27.4.0", "@types/node": "^17.0.8", "@typescript-eslint/eslint-plugin": "^5.9.1", "@typescript-eslint/parser": "^5.9.1", "dotenv": "^12.0.3", "eslint": "^8.6.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^27.4.7", "prettier": "^2.5.1", "size-limit": "^7.0.8", "ts-jest": "^27.1.3", "tsup": "^5.11.11", "typescript": "^4.5.5" }, "dependencies": { "isomorphic-fetch": "^3.0.0" }, "browser": { "isomorphic-fetch": false }, "size-limit": [ { "path": "dist/index.js", "limit": "5 KB" }, { "path": "dist/index.mjs", "limit": "5 KB" }, { "path": "dist/cloudflare.js", "limit": "5 KB" }, { "path": "dist/cloudflare.mjs", "limit": "5 KB" }, { "path": "dist/nodejs.js", "limit": "5 KB" }, { "path": "dist/nodejs.mjs", "limit": "5 KB" }, { "path": "dist/fastly.js", "limit": "5 KB" }, { "path": "dist/fastly.mjs", "limit": "5 KB" } ] }
@@ -1,6 +1,14 @@
1
1
  import { HttpClient } from './http';
2
2
  import { S as ScanCommandOptions, a as SetCommandOptions, C as CommandArgs, U as UnlinkCommand, b as ScoreMember, Z as ZAddCommandOptions, c as ZAddCommandOptionsWithIncr, d as ZInterStoreCommandOptions, e as ZRangeCommandOptions, f as ZUnionStoreCommandOptions, T as Type } from './zunionstore-342168a6';
3
3
 
4
+ declare type ScriptFlushCommandOptions = {
5
+ sync: true;
6
+ async?: never;
7
+ } | {
8
+ sync?: never;
9
+ async: true;
10
+ };
11
+
4
12
  /**
5
13
  * Upstash REST API supports command pipelining to send multiple commands in
6
14
  * batch, instead of sending each command one by one and waiting for a response.
@@ -99,6 +107,16 @@ declare class Pipeline {
99
107
  * @see https://redis.io/commands/echo
100
108
  */
101
109
  echo: (message: string) => this;
110
+ /**
111
+ *
112
+ * @see https://redis.io/commands/eval
113
+ */
114
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => this;
115
+ /**
116
+ *
117
+ * @see https://redis.io/commands/evalsha
118
+ */
119
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => this;
102
120
  /**
103
121
  * @see https://redis.io/commands/exists
104
122
  */
@@ -339,6 +357,18 @@ declare class Pipeline {
339
357
  * @see https://redis.io/commands/scard
340
358
  */
341
359
  scard: (key: string) => this;
360
+ /**
361
+ * @see https://redis.io/commands/script-exists
362
+ */
363
+ scriptExists: (args_0: string, ...args_1: string[]) => this;
364
+ /**
365
+ * @see https://redis.io/commands/script-flush
366
+ */
367
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => this;
368
+ /**
369
+ * @see https://redis.io/commands/script-load
370
+ */
371
+ scriptLoad: (script: string) => this;
342
372
  /**
343
373
  * @see https://redis.io/commands/sdiff
344
374
  */
@@ -585,6 +615,16 @@ declare class Redis {
585
615
  * @see https://redis.io/commands/echo
586
616
  */
587
617
  echo: (message: string) => Promise<string>;
618
+ /**
619
+ *
620
+ * @see https://redis.io/commands/eval
621
+ */
622
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<unknown>;
623
+ /**
624
+ *
625
+ * @see https://redis.io/commands/evalsha
626
+ */
627
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<unknown>;
588
628
  /**
589
629
  * @see https://redis.io/commands/exists
590
630
  */
@@ -825,6 +865,18 @@ declare class Redis {
825
865
  * @see https://redis.io/commands/scard
826
866
  */
827
867
  scard: (key: string) => Promise<number>;
868
+ /**
869
+ * @see https://redis.io/commands/script-exists
870
+ */
871
+ scriptExists: (args_0: string, ...args_1: string[]) => Promise<[]>;
872
+ /**
873
+ * @see https://redis.io/commands/script-flush
874
+ */
875
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
876
+ /**
877
+ * @see https://redis.io/commands/script-load
878
+ */
879
+ scriptLoad: (script: string) => Promise<string>;
828
880
  /**
829
881
  * @see https://redis.io/commands/sdiff
830
882
  */