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