@upstash/redis 0.1.4 → 0.1.8

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