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