@upstash/redis 0.1.5 → 0.1.9

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.
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,56 +7,41 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const isomorphic_unfetch_1 = __importDefault(require("isomorphic-unfetch"));
10
+ import fetch from 'isomorphic-unfetch';
16
11
  /**
17
12
  * Parse Options
18
13
  */
19
- function parseOptions(url, token, edgeUrl, readFromEdge) {
14
+ function parseOptions(url, token, requestOptions = {}) {
20
15
  if (typeof url === 'object' && url !== null) {
21
- return parseOptions(url.url, url.token, url.edgeUrl, url.readFromEdge);
16
+ return parseOptions(url.url, url.token, url.requestOptions);
22
17
  }
18
+ // try auto fill from env variables
23
19
  if (!url && typeof window === 'undefined') {
24
- // try auto fill from env variables
25
20
  url = process.env.UPSTASH_REDIS_REST_URL;
26
21
  token = process.env.UPSTASH_REDIS_REST_TOKEN;
27
- edgeUrl = process.env.UPSTASH_REDIS_EDGE_URL;
28
22
  }
29
- readFromEdge = edgeUrl ? readFromEdge !== null && readFromEdge !== void 0 ? readFromEdge : true : false;
30
- return edgeUrl ? { url, token, edgeUrl, readFromEdge } : { url, token };
23
+ return { url: url, token, requestOptions };
31
24
  }
32
25
  /**
33
26
  * Fetch
34
27
  */
35
- function fetchData(url, options, init) {
28
+ function fetchData(options, ...parts) {
29
+ var _a;
36
30
  return __awaiter(this, void 0, void 0, function* () {
31
+ if (!options.url) {
32
+ throw 'Database url not found?';
33
+ }
37
34
  try {
38
- const res = yield (0, isomorphic_unfetch_1.default)(url, Object.assign(Object.assign({}, init), { headers: Object.assign({ Authorization: `Bearer ${options.token}` }, init.headers) }));
35
+ const res = yield fetch(options.url, Object.assign({ method: 'POST', body: JSON.stringify(parts), headers: Object.assign({ Authorization: `Bearer ${options.token}` }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers) }, options.requestOptions));
39
36
  const data = yield res.json();
40
37
  if (!res.ok) {
41
38
  if (data.error)
42
39
  throw data.error;
43
40
  throw `Upstash failed with (${res.status}): ${JSON.stringify(data, null, 2)}`;
44
41
  }
45
- let edge = false;
46
- let cache = null;
47
- switch (res.headers.get('x-cache')) {
48
- case 'Hit from cloudfront':
49
- edge = true;
50
- cache = 'hit';
51
- break;
52
- case 'Miss from cloudfront':
53
- edge = true;
54
- cache = 'miss';
55
- break;
56
- }
57
42
  return {
58
43
  data: data.result,
59
44
  error: null,
60
- metadata: { edge, cache },
61
45
  };
62
46
  }
63
47
  catch (err) {
@@ -65,56 +49,10 @@ function fetchData(url, options, init) {
65
49
  data: null,
66
50
  // @ts-ignore
67
51
  error: err,
68
- metadata: { edge: false, cache: null },
69
52
  };
70
53
  }
71
54
  });
72
55
  }
73
- /**
74
- * Request
75
- */
76
- function request(options, config, ...parts) {
77
- var _a;
78
- if (!options.url) {
79
- throw 'Database url not found?';
80
- }
81
- if (!options.edgeUrl) {
82
- if (options.readFromEdge || (config === null || config === void 0 ? void 0 : config.edge)) {
83
- throw 'You need to set Edge Url to read from edge.';
84
- }
85
- }
86
- let fromEdge = !!options.edgeUrl && options.readFromEdge !== false;
87
- if (config === undefined) {
88
- fromEdge = false;
89
- }
90
- else if (options.edgeUrl) {
91
- fromEdge = (_a = config === null || config === void 0 ? void 0 : config.edge) !== null && _a !== void 0 ? _a : true;
92
- }
93
- if (fromEdge) {
94
- const command = encodeURI(parts.join('/'));
95
- const edgeUrlWithPath = `${options.edgeUrl}/${command}`;
96
- return fetchData(edgeUrlWithPath, options, { method: 'GET' });
97
- }
98
- else {
99
- return fetchData(options.url, options, {
100
- method: 'POST',
101
- body: JSON.stringify(parts),
102
- });
103
- }
104
- }
105
- function hasConfig(options, command, a) {
106
- let lastArg;
107
- let args = [...a];
108
- if (a.length > 0) {
109
- lastArg = args.pop();
110
- }
111
- if (typeof lastArg === 'object' && lastArg !== null) {
112
- return request(options, lastArg, command, ...args);
113
- }
114
- else {
115
- return request(options, {}, command, ...a);
116
- }
117
- }
118
56
  function upstash(url, token) {
119
57
  const options = parseOptions(url, token);
120
58
  /**
@@ -124,369 +62,367 @@ function upstash(url, token) {
124
62
  Object.assign(options, {
125
63
  url: undefined,
126
64
  token: undefined,
127
- edgeUrl: undefined,
128
- readFromEdge: undefined,
129
65
  }, parseOptions(arguments[0], arguments[1]));
130
66
  }
131
67
  /**
132
68
  * STRING
133
69
  */
134
70
  function append() {
135
- return request(options, undefined, 'append', ...arguments);
71
+ return fetchData(options, 'append', ...arguments);
136
72
  }
137
73
  function decr() {
138
- return request(options, undefined, 'decr', ...arguments);
74
+ return fetchData(options, 'decr', ...arguments);
139
75
  }
140
76
  function decrby() {
141
- return request(options, undefined, 'decrby', ...arguments);
77
+ return fetchData(options, 'decrby', ...arguments);
142
78
  }
143
79
  function get() {
144
- return hasConfig(options, 'get', arguments);
80
+ return fetchData(options, 'get', ...arguments);
145
81
  }
146
82
  function getrange() {
147
- return hasConfig(options, 'getrange', arguments);
83
+ return fetchData(options, 'getrange', ...arguments);
148
84
  }
149
85
  function getset() {
150
- return request(options, undefined, 'getset', ...arguments);
86
+ return fetchData(options, 'getset', ...arguments);
151
87
  }
152
88
  function incr() {
153
- return request(options, undefined, 'incr', ...arguments);
89
+ return fetchData(options, 'incr', ...arguments);
154
90
  }
155
91
  function incrby() {
156
- return request(options, undefined, 'incrby', ...arguments);
92
+ return fetchData(options, 'incrby', ...arguments);
157
93
  }
158
94
  function incrbyfloat() {
159
- return request(options, undefined, 'incrbyfloat', ...arguments);
95
+ return fetchData(options, 'incrbyfloat', ...arguments);
160
96
  }
161
97
  function mget() {
162
- return hasConfig(options, 'mget', arguments);
98
+ return fetchData(options, 'mget', ...arguments);
163
99
  }
164
100
  function mset() {
165
- return request(options, undefined, 'mset', ...arguments);
101
+ return fetchData(options, 'mset', ...arguments);
166
102
  }
167
103
  function msetnx() {
168
- return request(options, undefined, 'msetnx', ...arguments);
104
+ return fetchData(options, 'msetnx', ...arguments);
169
105
  }
170
106
  function psetex() {
171
- return request(options, undefined, 'psetex', ...arguments);
107
+ return fetchData(options, 'psetex', ...arguments);
172
108
  }
173
109
  function set() {
174
- return request(options, undefined, 'set', ...arguments);
110
+ return fetchData(options, 'set', ...arguments);
175
111
  }
176
112
  function setex() {
177
- return request(options, undefined, 'setex', ...arguments);
113
+ return fetchData(options, 'setex', ...arguments);
178
114
  }
179
115
  function setnx() {
180
- return request(options, undefined, 'setnx', ...arguments);
116
+ return fetchData(options, 'setnx', ...arguments);
181
117
  }
182
118
  function setrange() {
183
- return request(options, undefined, 'setrange', ...arguments);
119
+ return fetchData(options, 'setrange', ...arguments);
184
120
  }
185
121
  function strlen() {
186
- return hasConfig(options, 'strlen', arguments);
122
+ return fetchData(options, 'strlen', ...arguments);
187
123
  }
188
124
  /**
189
125
  * BITMAPS
190
126
  */
191
127
  function bitcount() {
192
- return hasConfig(options, 'bitcount', arguments);
128
+ return fetchData(options, 'bitcount', ...arguments);
193
129
  }
194
130
  function bitop() {
195
- return request(options, undefined, 'bitop', ...arguments);
131
+ return fetchData(options, 'bitop', ...arguments);
196
132
  }
197
133
  function bitpos() {
198
- return hasConfig(options, 'bitpos', arguments);
134
+ return fetchData(options, 'bitpos', ...arguments);
199
135
  }
200
136
  function getbit() {
201
- return hasConfig(options, 'getbit', arguments);
137
+ return fetchData(options, 'getbit', ...arguments);
202
138
  }
203
139
  function setbit() {
204
- return request(options, undefined, 'setbit', ...arguments);
140
+ return fetchData(options, 'setbit', ...arguments);
205
141
  }
206
142
  /**
207
143
  * CONNECTION
208
144
  */
209
145
  function echo() {
210
- return hasConfig(options, 'echo', arguments);
146
+ return fetchData(options, 'echo', ...arguments);
211
147
  }
212
148
  function ping() {
213
- return hasConfig(options, 'ping', arguments);
149
+ return fetchData(options, 'ping', ...arguments);
214
150
  }
215
151
  /**
216
152
  * HASHES
217
153
  */
218
154
  function hdel() {
219
- return request(options, undefined, 'hdel', ...arguments);
155
+ return fetchData(options, 'hdel', ...arguments);
220
156
  }
221
157
  function hexists() {
222
- return hasConfig(options, 'hexists', arguments);
158
+ return fetchData(options, 'hexists', ...arguments);
223
159
  }
224
160
  function hget() {
225
- return hasConfig(options, 'hget', arguments);
161
+ return fetchData(options, 'hget', ...arguments);
226
162
  }
227
163
  function hgetall() {
228
- return hasConfig(options, 'hgetall', arguments);
164
+ return fetchData(options, 'hgetall', ...arguments);
229
165
  }
230
166
  function hincrby() {
231
- return request(options, undefined, 'hincrby', ...arguments);
167
+ return fetchData(options, 'hincrby', ...arguments);
232
168
  }
233
169
  function hincrbyfloat() {
234
- return request(options, undefined, 'hincrbyfloat', ...arguments);
170
+ return fetchData(options, 'hincrbyfloat', ...arguments);
235
171
  }
236
172
  function hkeys() {
237
- return hasConfig(options, 'hkeys', arguments);
173
+ return fetchData(options, 'hkeys', ...arguments);
238
174
  }
239
175
  function hlen() {
240
- return hasConfig(options, 'hlen', arguments);
176
+ return fetchData(options, 'hlen', ...arguments);
241
177
  }
242
178
  function hmget() {
243
- return hasConfig(options, 'hmget', arguments);
179
+ return fetchData(options, 'hmget', ...arguments);
244
180
  }
245
181
  function hmset() {
246
- return request(options, undefined, 'hmset', ...arguments);
182
+ return fetchData(options, 'hmset', ...arguments);
247
183
  }
248
184
  function hscan() {
249
- return request(options, undefined, 'hscan', ...arguments);
185
+ return fetchData(options, 'hscan', ...arguments);
250
186
  }
251
187
  function hset() {
252
- return request(options, undefined, 'hset', ...arguments);
188
+ return fetchData(options, 'hset', ...arguments);
253
189
  }
254
190
  function hsetnx() {
255
- return request(options, undefined, 'hsetnx', ...arguments);
191
+ return fetchData(options, 'hsetnx', ...arguments);
256
192
  }
257
193
  function hvals() {
258
- return hasConfig(options, 'hvals', arguments);
194
+ return fetchData(options, 'hvals', ...arguments);
259
195
  }
260
196
  /**
261
197
  * KEYS
262
198
  */
263
199
  function del() {
264
- return request(options, undefined, 'del', ...arguments);
200
+ return fetchData(options, 'del', ...arguments);
265
201
  }
266
202
  function exists() {
267
- return hasConfig(options, 'exists', arguments);
203
+ return fetchData(options, 'exists', ...arguments);
268
204
  }
269
205
  function expire() {
270
- return request(options, undefined, 'expire', ...arguments);
206
+ return fetchData(options, 'expire', ...arguments);
271
207
  }
272
208
  function expireat() {
273
- return request(options, undefined, 'expireat', ...arguments);
209
+ return fetchData(options, 'expireat', ...arguments);
274
210
  }
275
211
  function keys() {
276
- return hasConfig(options, 'keys', arguments);
212
+ return fetchData(options, 'keys', ...arguments);
277
213
  }
278
214
  function persist() {
279
- return request(options, undefined, 'persist', ...arguments);
215
+ return fetchData(options, 'persist', ...arguments);
280
216
  }
281
217
  function pexpire() {
282
- return request(options, undefined, 'pexpire', ...arguments);
218
+ return fetchData(options, 'pexpire', ...arguments);
283
219
  }
284
220
  function pexpireat() {
285
- return request(options, undefined, 'pexpireat', ...arguments);
221
+ return fetchData(options, 'pexpireat', ...arguments);
286
222
  }
287
223
  function pttl() {
288
- return hasConfig(options, 'pttl', arguments);
224
+ return fetchData(options, 'pttl', ...arguments);
289
225
  }
290
226
  function randomkey() {
291
- return request(options, undefined, 'randomkey', ...arguments);
227
+ return fetchData(options, 'randomkey', ...arguments);
292
228
  }
293
229
  function rename() {
294
- return request(options, undefined, 'rename', ...arguments);
230
+ return fetchData(options, 'rename', ...arguments);
295
231
  }
296
232
  function renamenx() {
297
- return request(options, undefined, 'renamenx', ...arguments);
233
+ return fetchData(options, 'renamenx', ...arguments);
298
234
  }
299
235
  function scan() {
300
- return request(options, undefined, 'scan', ...arguments);
236
+ return fetchData(options, 'scan', ...arguments);
301
237
  }
302
238
  function touch() {
303
- return request(options, undefined, 'touch', ...arguments);
239
+ return fetchData(options, 'touch', ...arguments);
304
240
  }
305
241
  function ttl() {
306
- return hasConfig(options, 'ttl', arguments);
242
+ return fetchData(options, 'ttl', ...arguments);
307
243
  }
308
244
  function type() {
309
- return hasConfig(options, 'type', arguments);
245
+ return fetchData(options, 'type', ...arguments);
310
246
  }
311
247
  function unlink() {
312
- return request(options, undefined, 'unlink', ...arguments);
248
+ return fetchData(options, 'unlink', ...arguments);
313
249
  }
314
250
  /**
315
251
  * LISTS
316
252
  */
317
253
  function lindex() {
318
- return hasConfig(options, 'lindex', arguments);
254
+ return fetchData(options, 'lindex', ...arguments);
319
255
  }
320
256
  function linsert() {
321
- return request(options, undefined, 'linsert', ...arguments);
257
+ return fetchData(options, 'linsert', ...arguments);
322
258
  }
323
259
  function llen() {
324
- return hasConfig(options, 'llen', arguments);
260
+ return fetchData(options, 'llen', ...arguments);
325
261
  }
326
262
  function lpop() {
327
- return request(options, undefined, 'lpop', ...arguments);
263
+ return fetchData(options, 'lpop', ...arguments);
328
264
  }
329
265
  function lpush() {
330
- return request(options, undefined, 'lpush', ...arguments);
266
+ return fetchData(options, 'lpush', ...arguments);
331
267
  }
332
268
  function lpushx() {
333
- return request(options, undefined, 'lpushx', ...arguments);
269
+ return fetchData(options, 'lpushx', ...arguments);
334
270
  }
335
271
  function lrange() {
336
- return hasConfig(options, 'lrange', arguments);
272
+ return fetchData(options, 'lrange', ...arguments);
337
273
  }
338
274
  function lrem() {
339
- return request(options, undefined, 'lrem', ...arguments);
275
+ return fetchData(options, 'lrem', ...arguments);
340
276
  }
341
277
  function lset() {
342
- return request(options, undefined, 'lset', ...arguments);
278
+ return fetchData(options, 'lset', ...arguments);
343
279
  }
344
280
  function ltrim() {
345
- return request(options, undefined, 'ltrim', ...arguments);
281
+ return fetchData(options, 'ltrim', ...arguments);
346
282
  }
347
283
  function rpop() {
348
- return request(options, undefined, 'rpop', ...arguments);
284
+ return fetchData(options, 'rpop', ...arguments);
349
285
  }
350
286
  function rpoplpush() {
351
- return request(options, undefined, 'rpoplpush', ...arguments);
287
+ return fetchData(options, 'rpoplpush', ...arguments);
352
288
  }
353
289
  function rpush() {
354
- return request(options, undefined, 'rpush', ...arguments);
290
+ return fetchData(options, 'rpush', ...arguments);
355
291
  }
356
292
  function rpushx() {
357
- return request(options, undefined, 'rpushx', ...arguments);
293
+ return fetchData(options, 'rpushx', ...arguments);
358
294
  }
359
295
  /**
360
296
  * SERVER
361
297
  */
362
298
  function dbsize() {
363
- return hasConfig(options, 'dbsize', arguments);
299
+ return fetchData(options, 'dbsize', ...arguments);
364
300
  }
365
301
  function flushall() {
366
- return request(options, undefined, 'flushall', ...arguments);
302
+ return fetchData(options, 'flushall', ...arguments);
367
303
  }
368
304
  function flushdb() {
369
- return request(options, undefined, 'flushdb', ...arguments);
305
+ return fetchData(options, 'flushdb', ...arguments);
370
306
  }
371
307
  function info() {
372
- return hasConfig(options, 'info', arguments);
308
+ return fetchData(options, 'info', ...arguments);
373
309
  }
374
310
  function time() {
375
- return request(options, undefined, 'time', ...arguments);
311
+ return fetchData(options, 'time', ...arguments);
376
312
  }
377
313
  /**
378
314
  * SET
379
315
  */
380
316
  function sadd() {
381
- return request(options, undefined, 'sadd', ...arguments);
317
+ return fetchData(options, 'sadd', ...arguments);
382
318
  }
383
319
  function scard() {
384
- return request(options, undefined, 'scard', ...arguments);
320
+ return fetchData(options, 'scard', ...arguments);
385
321
  }
386
322
  function sdiff() {
387
- return hasConfig(options, 'sdiff', arguments);
323
+ return fetchData(options, 'sdiff', ...arguments);
388
324
  }
389
325
  function sdiffstore() {
390
- return request(options, undefined, 'sdiffstore', ...arguments);
326
+ return fetchData(options, 'sdiffstore', ...arguments);
391
327
  }
392
328
  function sinter() {
393
- return hasConfig(options, 'sinter', arguments);
329
+ return fetchData(options, 'sinter', ...arguments);
394
330
  }
395
331
  function sinterstore() {
396
- return request(options, undefined, 'sinterstore', ...arguments);
332
+ return fetchData(options, 'sinterstore', ...arguments);
397
333
  }
398
334
  function sismember() {
399
- return hasConfig(options, 'sismember', arguments);
335
+ return fetchData(options, 'sismember', ...arguments);
400
336
  }
401
337
  function smembers() {
402
- return hasConfig(options, 'smembers', arguments);
338
+ return fetchData(options, 'smembers', ...arguments);
403
339
  }
404
340
  function smove() {
405
- return request(options, undefined, 'smove', ...arguments);
341
+ return fetchData(options, 'smove', ...arguments);
406
342
  }
407
343
  function spop() {
408
- return request(options, undefined, 'spop', ...arguments);
344
+ return fetchData(options, 'spop', ...arguments);
409
345
  }
410
346
  function srandmember() {
411
- return hasConfig(options, 'srandmember', arguments);
347
+ return fetchData(options, 'srandmember', ...arguments);
412
348
  }
413
349
  function srem() {
414
- return request(options, undefined, 'srem', ...arguments);
350
+ return fetchData(options, 'srem', ...arguments);
415
351
  }
416
352
  function sunion() {
417
- return hasConfig(options, 'sunion', arguments);
353
+ return fetchData(options, 'sunion', ...arguments);
418
354
  }
419
355
  function sunionstore() {
420
- return request(options, undefined, 'sunionstore', ...arguments);
356
+ return fetchData(options, 'sunionstore', ...arguments);
421
357
  }
422
358
  /**
423
359
  * SORTED SETS
424
360
  */
425
361
  function zadd() {
426
- return request(options, undefined, 'zadd', ...arguments);
362
+ return fetchData(options, 'zadd', ...arguments);
427
363
  }
428
364
  function zcard() {
429
- return hasConfig(options, 'zcard', arguments);
365
+ return fetchData(options, 'zcard', ...arguments);
430
366
  }
431
367
  function zcount() {
432
- return hasConfig(options, 'zcount', arguments);
368
+ return fetchData(options, 'zcount', ...arguments);
433
369
  }
434
370
  function zincrby() {
435
- return request(options, undefined, 'zincrby', ...arguments);
371
+ return fetchData(options, 'zincrby', ...arguments);
436
372
  }
437
373
  function zinterstore() {
438
- return request(options, undefined, 'zinterstore', ...arguments);
374
+ return fetchData(options, 'zinterstore', ...arguments);
439
375
  }
440
376
  function zlexcount() {
441
- return hasConfig(options, 'zlexcount', arguments);
377
+ return fetchData(options, 'zlexcount', ...arguments);
442
378
  }
443
379
  function zpopmax() {
444
- return request(options, undefined, 'zpopmax', ...arguments);
380
+ return fetchData(options, 'zpopmax', ...arguments);
445
381
  }
446
382
  function zpopmin() {
447
- return request(options, undefined, 'zpopmin', ...arguments);
383
+ return fetchData(options, 'zpopmin', ...arguments);
448
384
  }
449
385
  function zrange() {
450
- return hasConfig(options, 'zrange', arguments);
386
+ return fetchData(options, 'zrange', ...arguments);
451
387
  }
452
388
  function zrangebylex() {
453
- return hasConfig(options, 'zrangebylex', arguments);
389
+ return fetchData(options, 'zrangebylex', ...arguments);
454
390
  }
455
391
  function zrangebyscore() {
456
- return hasConfig(options, 'zrangebyscore', arguments);
392
+ return fetchData(options, 'zrangebyscore', ...arguments);
457
393
  }
458
394
  function zrank() {
459
- return hasConfig(options, 'zrank', arguments);
395
+ return fetchData(options, 'zrank', ...arguments);
460
396
  }
461
397
  function zrem() {
462
- return request(options, undefined, 'zrem', ...arguments);
398
+ return fetchData(options, 'zrem', ...arguments);
463
399
  }
464
400
  function zremrangebylex() {
465
- return request(options, undefined, 'zremrangebylex', ...arguments);
401
+ return fetchData(options, 'zremrangebylex', ...arguments);
466
402
  }
467
403
  function zremrangebyrank() {
468
- return request(options, undefined, 'zremrangebyrank', ...arguments);
404
+ return fetchData(options, 'zremrangebyrank', ...arguments);
469
405
  }
470
406
  function zremrangebyscore() {
471
- return request(options, undefined, 'zremrangebyscore', ...arguments);
407
+ return fetchData(options, 'zremrangebyscore', ...arguments);
472
408
  }
473
409
  function zrevrange() {
474
- return hasConfig(options, 'zrevrange', arguments);
410
+ return fetchData(options, 'zrevrange', ...arguments);
475
411
  }
476
412
  function zrevrangebylex() {
477
- return hasConfig(options, 'zrevrangebylex', arguments);
413
+ return fetchData(options, 'zrevrangebylex', ...arguments);
478
414
  }
479
415
  function zrevrangebyscore() {
480
- return hasConfig(options, 'zrevrangebyscore', arguments);
416
+ return fetchData(options, 'zrevrangebyscore', ...arguments);
481
417
  }
482
418
  function zrevrank() {
483
- return hasConfig(options, 'zrevrank', arguments);
419
+ return fetchData(options, 'zrevrank', ...arguments);
484
420
  }
485
421
  function zscore() {
486
- return hasConfig(options, 'zscore', arguments);
422
+ return fetchData(options, 'zscore', ...arguments);
487
423
  }
488
424
  function zunionstore() {
489
- return request(options, undefined, 'zunionstore', ...arguments);
425
+ return fetchData(options, 'zunionstore', ...arguments);
490
426
  }
491
427
  return {
492
428
  auth,
@@ -612,4 +548,4 @@ function upstash(url, token) {
612
548
  zunionstore,
613
549
  };
614
550
  }
615
- exports.default = upstash;
551
+ export default upstash;