@upstash/redis 1.1.0-alpha.1 → 1.3.0-alpha.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
@@ -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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Redis
3
- } from "./chunk-256N7RVN.mjs";
3
+ } from "./chunk-CWZSFQQQ.mjs";
4
4
  import {
5
5
  HttpClient
6
6
  } from "./chunk-HIDCSH5S.mjs";
@@ -8,6 +8,7 @@ import {
8
8
  DecrCommand,
9
9
  DelCommand,
10
10
  EchoCommand,
11
+ EvalCommand,
11
12
  ExistsCommand,
12
13
  ExpireAtCommand,
13
14
  ExpireCommand,
@@ -107,7 +108,7 @@ import {
107
108
  ZScanCommand,
108
109
  ZScoreCommand,
109
110
  ZUnionStoreCommand
110
- } from "./chunk-HZBBCLMC.mjs";
111
+ } from "./chunk-TLMWNHIZ.mjs";
111
112
  import {
112
113
  UpstashError
113
114
  } from "./chunk-7YUZYRJS.mjs";
@@ -139,6 +140,7 @@ var Pipeline = class {
139
140
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
140
141
  this.del = (...args) => this.chain(new DelCommand(...args));
141
142
  this.echo = (...args) => this.chain(new EchoCommand(...args));
143
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
142
144
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
143
145
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
144
146
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -265,6 +267,7 @@ var Redis = class {
265
267
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
266
268
  this.del = (...args) => new DelCommand(...args).exec(this.client);
267
269
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
270
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
268
271
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
269
272
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
270
273
  this.expireat = (...args) => new ExpireAtCommand(...args).exec(this.client);
@@ -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, nArgs, ...args) {
121
+ super(["eval", script, nArgs, ...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,
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-5b966c20';
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, nArgs, ...args) {
196
+ super(["eval", script, nArgs, ...args]);
197
+ }
198
+ };
199
+
193
200
  // pkg/commands/exists.ts
194
201
  var ExistsCommand = class extends Command {
195
202
  constructor(...keys) {
@@ -1069,6 +1076,7 @@ var Pipeline = class {
1069
1076
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
1070
1077
  this.del = (...args) => this.chain(new DelCommand(...args));
1071
1078
  this.echo = (...args) => this.chain(new EchoCommand(...args));
1079
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
1072
1080
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
1073
1081
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
1074
1082
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -1195,6 +1203,7 @@ var Redis = class {
1195
1203
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
1196
1204
  this.del = (...args) => new DelCommand(...args).exec(this.client);
1197
1205
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
1206
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
1198
1207
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
1199
1208
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
1200
1209
  this.expireat = (...args) => new ExpireAtCommand(...args).exec(this.client);
@@ -1314,9 +1323,10 @@ var Redis2 = class extends Redis {
1314
1323
  });
1315
1324
  super(client);
1316
1325
  }
1317
- static fromEnv() {
1318
- const url = UPSTASH_REDIS_REST_URL;
1319
- const token = UPSTASH_REDIS_REST_TOKEN;
1326
+ static fromEnv(env) {
1327
+ var _a, _b;
1328
+ const url = (_a = env == null ? void 0 : env.UPSTASH_REDIS_REST_URL) != null ? _a : UPSTASH_REDIS_REST_URL;
1329
+ const token = (_b = env == null ? void 0 : env.UPSTASH_REDIS_REST_TOKEN) != null ? _b : UPSTASH_REDIS_REST_TOKEN;
1320
1330
  if (!url) {
1321
1331
  throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`");
1322
1332
  }
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-CWZSFQQQ.mjs";
4
+ import "./chunk-TLMWNHIZ.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, nArgs: number, ...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, nArgs, ...args) {
263
+ super(["eval", script, nArgs, ...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-TLMWNHIZ.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-5b966c20';
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, nArgs, ...args) {
196
+ super(["eval", script, nArgs, ...args]);
197
+ }
198
+ };
199
+
193
200
  // pkg/commands/exists.ts
194
201
  var ExistsCommand = class extends Command {
195
202
  constructor(...keys) {
@@ -1069,6 +1076,7 @@ var Pipeline = class {
1069
1076
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
1070
1077
  this.del = (...args) => this.chain(new DelCommand(...args));
1071
1078
  this.echo = (...args) => this.chain(new EchoCommand(...args));
1079
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
1072
1080
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
1073
1081
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
1074
1082
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -1195,6 +1203,7 @@ var Redis = class {
1195
1203
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
1196
1204
  this.del = (...args) => new DelCommand(...args).exec(this.client);
1197
1205
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
1206
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
1198
1207
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
1199
1208
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
1200
1209
  this.expireat = (...args) => new ExpireAtCommand(...args).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-CWZSFQQQ.mjs";
4
+ import "./chunk-TLMWNHIZ.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-5b966c20';
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, nArgs, ...args) {
169
+ super(["eval", script, nArgs, ...args]);
170
+ }
171
+ };
172
+
166
173
  // pkg/commands/exists.ts
167
174
  var ExistsCommand = class extends Command {
168
175
  constructor(...keys) {
@@ -1042,6 +1049,7 @@ var Pipeline = class {
1042
1049
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
1043
1050
  this.del = (...args) => this.chain(new DelCommand(...args));
1044
1051
  this.echo = (...args) => this.chain(new EchoCommand(...args));
1052
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
1045
1053
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
1046
1054
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
1047
1055
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -1168,6 +1176,7 @@ var Redis = class {
1168
1176
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
1169
1177
  this.del = (...args) => new DelCommand(...args).exec(this.client);
1170
1178
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
1179
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
1171
1180
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
1172
1181
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
1173
1182
  this.expireat = (...args) => new ExpireAtCommand(...args).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-4PD625HD.mjs";
4
+ import "./chunk-CWZSFQQQ.mjs";
5
+ import "./chunk-TLMWNHIZ.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-5b966c20';
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, nArgs, ...args) {
168
+ super(["eval", script, nArgs, ...args]);
169
+ }
170
+ };
171
+
165
172
  // pkg/commands/exists.ts
166
173
  var ExistsCommand = class extends Command {
167
174
  constructor(...keys) {
@@ -1041,6 +1048,7 @@ var Pipeline = class {
1041
1048
  this.decrby = (...args) => this.chain(new DecrByCommand(...args));
1042
1049
  this.del = (...args) => this.chain(new DelCommand(...args));
1043
1050
  this.echo = (...args) => this.chain(new EchoCommand(...args));
1051
+ this.eval = (...args) => this.chain(new EvalCommand(...args));
1044
1052
  this.exists = (...args) => this.chain(new ExistsCommand(...args));
1045
1053
  this.expire = (...args) => this.chain(new ExpireCommand(...args));
1046
1054
  this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
@@ -1167,6 +1175,7 @@ var Redis = class {
1167
1175
  this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
1168
1176
  this.del = (...args) => new DelCommand(...args).exec(this.client);
1169
1177
  this.echo = (...args) => new EchoCommand(...args).exec(this.client);
1178
+ this.eval = (...args) => new EvalCommand(...args).exec(this.client);
1170
1179
  this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
1171
1180
  this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
1172
1181
  this.expireat = (...args) => new ExpireAtCommand(...args).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-4PD625HD.mjs";
4
+ import "./chunk-CWZSFQQQ.mjs";
5
+ import "./chunk-TLMWNHIZ.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-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
+ { "name": "@upstash/redis", "version": "v1.3.0-alpha.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" } ] }
@@ -99,6 +99,10 @@ declare class Pipeline {
99
99
  * @see https://redis.io/commands/echo
100
100
  */
101
101
  echo: (message: string) => this;
102
+ /**
103
+ * @see https://redis.io/commands/eval
104
+ */
105
+ eval: (script: string, nArgs: number, ...args: unknown[]) => this;
102
106
  /**
103
107
  * @see https://redis.io/commands/exists
104
108
  */
@@ -585,6 +589,11 @@ declare class Redis {
585
589
  * @see https://redis.io/commands/echo
586
590
  */
587
591
  echo: (message: string) => Promise<string>;
592
+ /**
593
+ *
594
+ * @see https://redis.io/commands/eval
595
+ */
596
+ eval: (script: string, nArgs: number, ...args: unknown[]) => Promise<unknown>;
588
597
  /**
589
598
  * @see https://redis.io/commands/exists
590
599
  */