@upstash/redis 0.1.11 → 0.2.1

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const client_1 = __importDefault(require("./client"));
7
+ const redis = (0, client_1.default)();
8
+ module.exports = client_1.default;
9
+ module.exports.auth = redis.auth;
10
+ module.exports.append = redis.append;
11
+ module.exports.decr = redis.decr;
12
+ module.exports.decrby = redis.decrby;
13
+ module.exports.get = redis.get;
14
+ module.exports.getrange = redis.getrange;
15
+ module.exports.getset = redis.getset;
16
+ module.exports.incr = redis.incr;
17
+ module.exports.incrby = redis.incrby;
18
+ module.exports.incrbyfloat = redis.incrbyfloat;
19
+ module.exports.mget = redis.mget;
20
+ module.exports.mset = redis.mset;
21
+ module.exports.msetnx = redis.msetnx;
22
+ module.exports.psetex = redis.psetex;
23
+ module.exports.set = redis.set;
24
+ module.exports.setex = redis.setex;
25
+ module.exports.setnx = redis.setnx;
26
+ module.exports.setrange = redis.setrange;
27
+ module.exports.strlen = redis.strlen;
28
+ module.exports.bitcount = redis.bitcount;
29
+ module.exports.bitop = redis.bitop;
30
+ module.exports.bitpos = redis.bitpos;
31
+ module.exports.getbit = redis.getbit;
32
+ module.exports.setbit = redis.setbit;
33
+ module.exports.echo = redis.echo;
34
+ module.exports.ping = redis.ping;
35
+ module.exports.hdel = redis.hdel;
36
+ module.exports.hexists = redis.hexists;
37
+ module.exports.hget = redis.hget;
38
+ module.exports.hgetall = redis.hgetall;
39
+ module.exports.hincrby = redis.hincrby;
40
+ module.exports.hincrbyfloat = redis.hincrbyfloat;
41
+ module.exports.hkeys = redis.hkeys;
42
+ module.exports.hlen = redis.hlen;
43
+ module.exports.hmget = redis.hmget;
44
+ module.exports.hmset = redis.hmset;
45
+ module.exports.hscan = redis.hscan;
46
+ module.exports.hset = redis.hset;
47
+ module.exports.hsetnx = redis.hsetnx;
48
+ module.exports.hvals = redis.hvals;
49
+ module.exports.del = redis.del;
50
+ module.exports.exists = redis.exists;
51
+ module.exports.expire = redis.expire;
52
+ module.exports.expireat = redis.expireat;
53
+ module.exports.keys = redis.keys;
54
+ module.exports.persist = redis.persist;
55
+ module.exports.pexpire = redis.pexpire;
56
+ module.exports.pexpireat = redis.pexpireat;
57
+ module.exports.pttl = redis.pttl;
58
+ module.exports.randomkey = redis.randomkey;
59
+ module.exports.rename = redis.rename;
60
+ module.exports.renamenx = redis.renamenx;
61
+ module.exports.scan = redis.scan;
62
+ module.exports.touch = redis.touch;
63
+ module.exports.ttl = redis.ttl;
64
+ module.exports.type = redis.type;
65
+ module.exports.unlink = redis.unlink;
66
+ module.exports.lindex = redis.lindex;
67
+ module.exports.linsert = redis.linsert;
68
+ module.exports.llen = redis.llen;
69
+ module.exports.lpop = redis.lpop;
70
+ module.exports.lpush = redis.lpush;
71
+ module.exports.lpushx = redis.lpushx;
72
+ module.exports.lrange = redis.lrange;
73
+ module.exports.lrem = redis.lrem;
74
+ module.exports.lset = redis.lset;
75
+ module.exports.ltrim = redis.ltrim;
76
+ module.exports.rpop = redis.rpop;
77
+ module.exports.rpoplpush = redis.rpoplpush;
78
+ module.exports.rpush = redis.rpush;
79
+ module.exports.rpushx = redis.rpushx;
80
+ module.exports.dbsize = redis.dbsize;
81
+ module.exports.flushall = redis.flushall;
82
+ module.exports.flushdb = redis.flushdb;
83
+ module.exports.info = redis.info;
84
+ module.exports.time = redis.time;
85
+ module.exports.sadd = redis.sadd;
86
+ module.exports.scard = redis.scard;
87
+ module.exports.sdiff = redis.sdiff;
88
+ module.exports.sdiffstore = redis.sdiffstore;
89
+ module.exports.sinter = redis.sinter;
90
+ module.exports.sinterstore = redis.sinterstore;
91
+ module.exports.sismember = redis.sismember;
92
+ module.exports.smembers = redis.smembers;
93
+ module.exports.smove = redis.smove;
94
+ module.exports.spop = redis.spop;
95
+ module.exports.srandmember = redis.srandmember;
96
+ module.exports.srem = redis.srem;
97
+ module.exports.sunion = redis.sunion;
98
+ module.exports.sunionstore = redis.sunionstore;
99
+ module.exports.zadd = redis.zadd;
100
+ module.exports.zcard = redis.zcard;
101
+ module.exports.zcount = redis.zcount;
102
+ module.exports.zincrby = redis.zincrby;
103
+ module.exports.zinterstore = redis.zinterstore;
104
+ module.exports.zlexcount = redis.zlexcount;
105
+ module.exports.zpopmax = redis.zpopmax;
106
+ module.exports.zpopmin = redis.zpopmin;
107
+ module.exports.zrange = redis.zrange;
108
+ module.exports.zrangebylex = redis.zrangebylex;
109
+ module.exports.zrangebyscore = redis.zrangebyscore;
110
+ module.exports.zrank = redis.zrank;
111
+ module.exports.zrem = redis.zrem;
112
+ module.exports.zremrangebylex = redis.zremrangebylex;
113
+ module.exports.zremrangebyrank = redis.zremrangebyrank;
114
+ module.exports.zremrangebyscore = redis.zremrangebyscore;
115
+ module.exports.zrevrange = redis.zrevrange;
116
+ module.exports.zrevrangebylex = redis.zrevrangebylex;
117
+ module.exports.zrevrangebyscore = redis.zrevrangebyscore;
118
+ module.exports.zrevrank = redis.zrevrank;
119
+ module.exports.zscore = redis.zscore;
120
+ module.exports.zunionstore = redis.zunionstore;
@@ -0,0 +1,179 @@
1
+ export declare type ClientObjectProps = {
2
+ url?: undefined | string;
3
+ token?: undefined | string;
4
+ requestOptions?: undefined | RequestInit;
5
+ };
6
+ export declare type ReturnType = {
7
+ data: string | number | [] | any;
8
+ error: string | null;
9
+ };
10
+ export declare type MethodReturn = Promise<ReturnType>;
11
+ export declare type Part = string | boolean | number;
12
+ export declare type Bit = 0 | 1;
13
+ export declare type Infinities = '+inf' | '-inf';
14
+ export declare type ZSetNumber = Infinities | number | string;
15
+ declare type Auth1 = (options?: ClientObjectProps) => void;
16
+ declare type Auth2 = (url?: string, token?: string) => void;
17
+ declare type Auth3 = (url?: string | ClientObjectProps, token?: string) => void;
18
+ declare type SET1 = (key: string, value: string | number) => MethodReturn;
19
+ declare type SET2 = (key: string, value: string | number, timeType: 'EX' | 'PX', time: number | string) => MethodReturn;
20
+ declare type BITCOUNT1 = (key: string) => MethodReturn;
21
+ declare type BITCOUNT2 = (key: string, start: number | string, end: number | string) => MethodReturn;
22
+ declare type BITPOS1 = (key: string, bit: Bit) => MethodReturn;
23
+ declare type BITPOS2 = (key: string, bit: Bit, start: number) => MethodReturn;
24
+ declare type BITPOS3 = (key: string, bit: Bit, start: number, end: number) => MethodReturn;
25
+ declare type PING1 = () => MethodReturn;
26
+ declare type PING2 = (message: string) => MethodReturn;
27
+ declare type SCAN1 = (cursor: number | string) => MethodReturn;
28
+ declare type SCAN2 = (cursor: number | string, match: 'MATCH', pattern: string) => MethodReturn;
29
+ declare type SCAN3 = (cursor: number | string, count: 'COUNT', value: number | string) => MethodReturn;
30
+ declare type SCAN4 = (cursor: number | string, match: 'MATCH', pattern: string, count: 'COUNT', value: number | string) => MethodReturn;
31
+ declare type FLUSHALL1 = () => MethodReturn;
32
+ declare type FLUSHALL2 = (mode: 'ASYNC') => MethodReturn;
33
+ declare type FLUSHDB1 = () => MethodReturn;
34
+ declare type FLUSHDB2 = (mode: 'ASYNC' | 'SYNC') => MethodReturn;
35
+ declare type INFO1 = () => MethodReturn;
36
+ declare type INFO2 = (section: string) => MethodReturn;
37
+ declare type XSCAN1 = (key: string, cursor: number | string) => MethodReturn;
38
+ declare type XSCAN2 = (key: string, cursor: number | string, match: 'MATCH', pattern: string) => MethodReturn;
39
+ declare type XSCAN3 = (key: string, cursor: number | string, count: 'COUNT', value: number | string) => MethodReturn;
40
+ declare type XSCAN4 = (key: string, cursor: number | string, match: 'MATCH', pattern: string, count: 'COUNT', value: number | string) => MethodReturn;
41
+ declare type SPOP1 = (key: string) => MethodReturn;
42
+ declare type SPOP2 = (key: string, count: number) => MethodReturn;
43
+ declare type SRANDMEMBER1 = (key: string) => MethodReturn;
44
+ declare type SRANDMEMBER2 = (key: string, count: number) => MethodReturn;
45
+ declare type ZPOPMAX1 = (key: string) => MethodReturn;
46
+ declare type ZPOPMAX2 = (key: string, count: number | string) => MethodReturn;
47
+ declare type ZRANGE1 = (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
48
+ declare type ZRANGE2 = (key: string, min: ZSetNumber, max: ZSetNumber, withscores: 'WITHSCORES') => MethodReturn;
49
+ declare type ZRANGEBYLEX1 = (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
50
+ declare type ZRANGEBYLEX2 = (key: string, min: ZSetNumber, max: ZSetNumber, limit: 'LIMIT', offset: number | string, count: number | string) => MethodReturn;
51
+ declare type ZRANGEBYSCORE1 = (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
52
+ declare type ZRANGEBYSCORE2 = (key: string, min: ZSetNumber, max: ZSetNumber, withScores: 'WITHSCORES') => MethodReturn;
53
+ declare type ZRANGEBYSCORE3 = (key: string, min: ZSetNumber, max: ZSetNumber, limit: 'LIMIT', offset: number | string, count: number | string) => MethodReturn;
54
+ declare type ZRANGEBYSCORE4 = (key: string, min: ZSetNumber, max: ZSetNumber, withScores: 'WITHSCORES', limit: 'LIMIT', offset: number | string, count: number | string) => MethodReturn;
55
+ declare type ZREVRANGEBYLEX1 = (key: string, max: ZSetNumber, min: ZSetNumber) => MethodReturn;
56
+ declare type ZREVRANGEBYLEX2 = (key: string, max: ZSetNumber, min: ZSetNumber, limit: 'LIMIT', offset: number | string, count: number | string) => MethodReturn;
57
+ declare type ZREVRANGEBYSCORE1 = (key: string, max: ZSetNumber, min: ZSetNumber) => MethodReturn;
58
+ declare type ZREVRANGEBYSCORE2 = (key: string, max: ZSetNumber, min: ZSetNumber, withScores: 'WITHSCORES') => MethodReturn;
59
+ declare type ZREVRANGEBYSCORE3 = (key: string, max: ZSetNumber, min: ZSetNumber, limit: 'LIMIT', offset: number | string, count: number | string) => MethodReturn;
60
+ declare type ZREVRANGEBYSCORE4 = (key: string, max: ZSetNumber, min: ZSetNumber, withScores: 'WITHSCORES', limit: 'LIMIT', offset: number | string, count: number | string) => MethodReturn;
61
+ declare type ZREVRANGE1 = (key: string, start: number | string, stop: number | string) => MethodReturn;
62
+ declare type ZREVRANGE2 = (key: string, start: number | string, stop: number | string, withscores: 'WITHSCORES') => MethodReturn;
63
+ export declare type Upstash = {
64
+ auth: Auth1 & Auth2 & Auth3;
65
+ append: (key: string, value: string) => MethodReturn;
66
+ decr: (key: string) => MethodReturn;
67
+ decrby: (key: string, decrement: number | string) => MethodReturn;
68
+ get: (key: string) => MethodReturn;
69
+ getrange: (key: string, start: number | string, end: number | string) => MethodReturn;
70
+ getset: (key: string, value: string) => MethodReturn;
71
+ incr: (key: string) => MethodReturn;
72
+ incrby: (key: string, increment: number | string) => MethodReturn;
73
+ incrbyfloat: (key: string, increment: number | string) => MethodReturn;
74
+ mget: (...key: any) => MethodReturn;
75
+ mset: (...keyValue: any) => MethodReturn;
76
+ msetnx: (...keyValue: any) => MethodReturn;
77
+ psetex: (key: string, miliseconds: number | string, value: string) => MethodReturn;
78
+ set: SET1 & SET2;
79
+ setex: (key: string, seconds: number | string, value: string) => MethodReturn;
80
+ setnx: (key: string, value: string) => MethodReturn;
81
+ setrange: (key: string, offset: number | string, value: string) => MethodReturn;
82
+ strlen: (key: string) => MethodReturn;
83
+ bitcount: BITCOUNT1 & BITCOUNT2;
84
+ bitop: (operation: 'AND' | 'OR' | 'XOR' | 'NOT', destKey: string, ...key: any) => MethodReturn;
85
+ bitpos: BITPOS1 & BITPOS2 & BITPOS3;
86
+ getbit: (key: string, offset: number | string) => MethodReturn;
87
+ setbit: (key: string, offset: number | string, value: Bit) => MethodReturn;
88
+ echo: (message: string) => MethodReturn;
89
+ ping: PING1 & PING2;
90
+ hdel: (key: string, ...field: any) => MethodReturn;
91
+ hexists: (key: string, field: string) => MethodReturn;
92
+ hget: (key: string, field: string) => MethodReturn;
93
+ hgetall: (key: string) => MethodReturn;
94
+ hincrby: (key: string, field: string, increment: number | string) => MethodReturn;
95
+ hincrbyfloat: (key: string, field: string, increment: number | string) => MethodReturn;
96
+ hkeys: (key: string) => MethodReturn;
97
+ hlen: (key: string) => MethodReturn;
98
+ hmget: (key: string, ...field: any) => MethodReturn;
99
+ hmset: (key: string, ...fieldValue: any) => MethodReturn;
100
+ hscan: XSCAN1 & XSCAN2 & XSCAN3 & XSCAN4;
101
+ hset: (key: string, ...fieldValue: any) => MethodReturn;
102
+ hsetnx: (key: string, field: string, value: string) => MethodReturn;
103
+ hvals: (key: string) => MethodReturn;
104
+ del: (...key: any) => MethodReturn;
105
+ exists: (...key: any) => MethodReturn;
106
+ expire: (key: string, seconds: number | string) => MethodReturn;
107
+ expireat: (key: string, timestamp: number | string) => MethodReturn;
108
+ keys: (pattern: string) => MethodReturn;
109
+ persist: (key: string) => MethodReturn;
110
+ pexpire: (key: string, miliseconds: number | string) => MethodReturn;
111
+ pexpireat: (key: string, milisecondsTimestamp: number | string) => MethodReturn;
112
+ pttl: (key: string) => MethodReturn;
113
+ randomkey: () => MethodReturn;
114
+ rename: (key: string, newKey: string) => MethodReturn;
115
+ renamenx: (key: string, newKey: string) => MethodReturn;
116
+ scan: SCAN1 & SCAN2 & SCAN3 & SCAN4;
117
+ touch: (...key: any) => MethodReturn;
118
+ ttl: (key: string) => MethodReturn;
119
+ type: (key: string) => MethodReturn;
120
+ unlink: (...key: any) => MethodReturn;
121
+ lindex: (key: string, index: number | string) => MethodReturn;
122
+ linsert: (key: string, option: 'BEFORE' | 'AFTER', pivot: string, element: string) => MethodReturn;
123
+ llen: (key: string) => MethodReturn;
124
+ lpop: (key: string) => MethodReturn;
125
+ lpush: (key: string, ...element: any) => MethodReturn;
126
+ lpushx: (key: string, ...element: any) => MethodReturn;
127
+ lrange: (key: string, start: number | string, stop: number | string) => MethodReturn;
128
+ lrem: (key: string, count: number | string, element: string) => MethodReturn;
129
+ lset: (key: string, index: number | string, element: string) => MethodReturn;
130
+ ltrim: (key: string, start: number | string, stop: number | string) => MethodReturn;
131
+ rpop: (key: string) => MethodReturn;
132
+ rpoplpush: (source: string, destination: string) => MethodReturn;
133
+ rpush: (key: string, ...element: any) => MethodReturn;
134
+ rpushx: (key: string, ...element: any) => MethodReturn;
135
+ dbsize: () => MethodReturn;
136
+ flushall: FLUSHALL1 & FLUSHALL2;
137
+ flushdb: FLUSHDB1 & FLUSHDB2;
138
+ info: INFO1 & INFO2;
139
+ time: () => MethodReturn;
140
+ sadd: (key: string, ...member: any) => MethodReturn;
141
+ scard: (key: string) => MethodReturn;
142
+ sdiff: (...key: any) => MethodReturn;
143
+ sdiffstore: (destination: string, ...key: any) => MethodReturn;
144
+ sinter: (...key: any) => MethodReturn;
145
+ sinterstore: (destination: string, ...key: any) => MethodReturn;
146
+ sismember: (key: string, member: string) => MethodReturn;
147
+ smembers: (key: string) => MethodReturn;
148
+ smove: (source: string, destination: string, member: string) => MethodReturn;
149
+ spop: SPOP1 & SPOP2;
150
+ srandmember: SRANDMEMBER1 & SRANDMEMBER2;
151
+ srem: (key: string, ...member: any) => MethodReturn;
152
+ sscan: XSCAN1 & XSCAN2 & XSCAN3 & XSCAN4;
153
+ sunion: (...key: any) => MethodReturn;
154
+ sunionstore: (destination: string, ...key: any) => MethodReturn;
155
+ zadd: (key: string, ...scoreMember: any) => MethodReturn;
156
+ zcard: (key: string) => MethodReturn;
157
+ zcount: (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
158
+ zincrby: (key: string, increment: number | string, member: string) => MethodReturn;
159
+ zinterstore: (destination: string, numkeys: number | string, ...key: any) => MethodReturn;
160
+ zlexcount: (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
161
+ zpopmax: ZPOPMAX1 & ZPOPMAX2;
162
+ zpopmin: ZPOPMAX1 & ZPOPMAX2;
163
+ zrange: ZRANGE1 & ZRANGE2;
164
+ zrangebylex: ZRANGEBYLEX1 & ZRANGEBYLEX2;
165
+ zrangebyscore: ZRANGEBYSCORE1 & ZRANGEBYSCORE2 & ZRANGEBYSCORE3 & ZRANGEBYSCORE4;
166
+ zrank: (key: string, member: string) => MethodReturn;
167
+ zrem: (key: string, ...member: any) => MethodReturn;
168
+ zremrangebylex: (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
169
+ zremrangebyrank: (key: string, start: number | string, stop: number | string) => MethodReturn;
170
+ zremrangebyscore: (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
171
+ zrevrange: ZREVRANGE1 & ZREVRANGE2;
172
+ zrevrangebylex: ZREVRANGEBYLEX1 & ZREVRANGEBYLEX2;
173
+ zrevrangebyscore: ZREVRANGEBYSCORE1 & ZREVRANGEBYSCORE2 & ZREVRANGEBYSCORE3 & ZREVRANGEBYSCORE4;
174
+ zrevrank: (key: string, member: string) => MethodReturn;
175
+ zscan: XSCAN1 & XSCAN2 & XSCAN3 & XSCAN4;
176
+ zscore: (key: string, member: string) => MethodReturn;
177
+ zunionstore: (destination: string, ...numkeys: any) => MethodReturn;
178
+ };
179
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,158 +1,21 @@
1
- export declare type ReturnType = {
2
- data: string | number | [] | any;
3
- error: string | null;
4
- };
5
- declare type MethodReturn = Promise<ReturnType>;
6
- declare type Callback = (res: ReturnType) => any;
7
- declare type Bit = 0 | 1;
8
- declare type Infinities = '+inf' | '-inf';
9
- declare type ZSetNumber = number | Infinities | string;
1
+ import { ClientObjectProps, Upstash } from './types';
10
2
  /**
11
- * Upstash client
12
- * @param {string} url - database rest url
13
- * @param {string} token - database rest token
3
+ * Creates a Upstash Redis instance
4
+ *
5
+ * @constructor
6
+ * @param {Object} options
7
+ * @param {string} [options.url]
8
+ * @param {string} [options.token]
9
+ * @param {Object} [options.requestOptions]
10
+ *
11
+ * @example
12
+ * ```js
13
+ * import upstash from '@upstash/redis'
14
+ *
15
+ * const redis1 = upstash('url', token);
16
+ * const redis2 = upstash({ url: '', token: '', requestOptions: {} });
17
+ * ```
14
18
  */
15
- export default function client(url?: string, token?: string): {
16
- auth: (url: string, token: string) => void;
17
- append: (key: string, value: string, callback?: Callback | undefined) => MethodReturn;
18
- decr: (key: string, callback?: Callback | undefined) => MethodReturn;
19
- decrby: (key: string, decrement: number, callback?: Callback | undefined) => MethodReturn;
20
- get: (key: string, callback?: Callback | undefined) => MethodReturn;
21
- getrange: (key: string, start: number, end: number, callback?: Callback | undefined) => MethodReturn;
22
- getset: (key: string, value: string, callback?: Callback | undefined) => MethodReturn;
23
- incr: (key: string, callback?: Callback | undefined) => MethodReturn;
24
- incrby: (key: string, value: number | string, callback?: Callback | undefined) => MethodReturn;
25
- incrbyfloat: (key: string, value: number | string, callback?: Callback | undefined) => MethodReturn;
26
- mget: (values: string[], callback?: Callback | undefined) => MethodReturn;
27
- mset: (values: string[], callback?: Callback | undefined) => MethodReturn;
28
- msetnx: (values: string[], callback?: Callback | undefined) => MethodReturn;
29
- psetex: (key: string, miliseconds: number, value: string | number, callback?: Callback | undefined) => MethodReturn;
30
- set: (key: string, value: string | number, callback?: Callback | undefined) => MethodReturn;
31
- setex: (key: string, seconds: number, value: string | number, callback?: Callback | undefined) => MethodReturn;
32
- setnx: (key: string, value: string, callback?: Callback | undefined) => MethodReturn;
33
- setrange: (key: string, offset: number | string, value: string, callback?: Callback | undefined) => MethodReturn;
34
- strlen: (key: string, callback?: Callback | undefined) => MethodReturn;
35
- bitcount: (key: string, start?: number | undefined, end?: number | undefined, callback?: Callback | undefined) => MethodReturn;
36
- bitop: (operation: 'AND' | 'OR' | 'XOR' | 'NOT', destinationKey: string, sourceKeys: string[], callback?: Callback | undefined) => MethodReturn;
37
- bitpos: (key: string, bit: Bit, start?: number | undefined, end?: number | undefined, callback?: Callback | undefined) => MethodReturn;
38
- getbit: (key: string, offset: number, callback?: Callback | undefined) => MethodReturn;
39
- setbit: (key: string, offset: number, value: Bit, callback?: Callback | undefined) => MethodReturn;
40
- echo: (value: string, callback?: Callback | undefined) => MethodReturn;
41
- ping: (value?: string | undefined, callback?: Callback | undefined) => MethodReturn;
42
- hdel: (key: string, fields: string[], callback?: Callback | undefined) => MethodReturn;
43
- hexists: (key: string, field: string, callback?: Callback | undefined) => MethodReturn;
44
- hget: (key: string, field: string, callback?: Callback | undefined) => MethodReturn;
45
- hgetall: (key: string, callback?: Callback | undefined) => MethodReturn;
46
- hincrby: (key: string, field: string, increment: number | string, callback?: Callback | undefined) => MethodReturn;
47
- hincrbyfloat: (key: string, field: string, increment: number | string, callback?: Callback | undefined) => MethodReturn;
48
- hkeys: (key: string, callback?: Callback | undefined) => MethodReturn;
49
- hlen: (key: string, callback?: Callback | undefined) => MethodReturn;
50
- hmget: (key: string, fields: string[], callback?: Callback | undefined) => MethodReturn;
51
- hmset: (key: string, values: string[], callback?: Callback | undefined) => MethodReturn;
52
- hset: (key: string, values: string[], callback?: Callback | undefined) => MethodReturn;
53
- hsetnx: (key: string, field: string, value: string, callback?: Callback | undefined) => MethodReturn;
54
- hvals: (key: string, callback?: Callback | undefined) => MethodReturn;
55
- hscan: (key: string, cursor: number, options?: {
56
- match?: string | number | undefined;
57
- count?: string | number | undefined;
58
- } | undefined, callback?: Callback | undefined) => MethodReturn;
59
- del: (keys: string[], callback?: Callback | undefined) => MethodReturn;
60
- exists: (keys: string[], callback?: Callback | undefined) => MethodReturn;
61
- expire: (key: string, seconds: number, callback?: Callback | undefined) => MethodReturn;
62
- expireat: (key: string, timestamp: number | string, callback?: Callback | undefined) => MethodReturn;
63
- keys: (pattern: string, callback?: Callback | undefined) => MethodReturn;
64
- persist: (key: string, callback?: Callback | undefined) => MethodReturn;
65
- pexpire: (key: string, miliseconds: number, callback?: Callback | undefined) => MethodReturn;
66
- pexpireat: (key: string, miliseconds: number, callback?: Callback | undefined) => MethodReturn;
67
- pttl: (key: string, callback?: Callback | undefined) => MethodReturn;
68
- randomkey: (callback?: Callback | undefined) => MethodReturn;
69
- rename: (key: string, newkey: string, callback?: Callback | undefined) => MethodReturn;
70
- renamenx: (key: string, newkey: string, callback?: Callback | undefined) => MethodReturn;
71
- scan: (cursor: number, opitons?: {
72
- match?: string | number | undefined;
73
- count?: string | number | undefined;
74
- } | undefined, callback?: Callback | undefined) => MethodReturn;
75
- touch: (keys: string[], callback?: Callback | undefined) => MethodReturn;
76
- ttl: (key: string, callback?: Callback | undefined) => MethodReturn;
77
- type: (key: string, callback?: Callback | undefined) => MethodReturn;
78
- unlink: (keys: string[], callback?: Callback | undefined) => MethodReturn;
79
- lindex: (key: string, index: number, callback?: Callback | undefined) => MethodReturn;
80
- linsert: (key: string, option: 'BEFORE' | 'AFTER', pivot: string, element: string, callback?: Callback | undefined) => MethodReturn;
81
- llen: (key: string, callback?: Callback | undefined) => MethodReturn;
82
- lpop: (key: string, callback?: Callback | undefined) => MethodReturn;
83
- lpush: (key: string, elements: string[], callback?: Callback | undefined) => MethodReturn;
84
- lpushx: (key: string, elements: string[], callback?: Callback | undefined) => MethodReturn;
85
- lrange: (key: string, start: number, stop: number, callback?: Callback | undefined) => MethodReturn;
86
- lrem: (key: string, count: number, element: string, callback?: Callback | undefined) => MethodReturn;
87
- lset: (key: string, index: number, element: string, callback?: Callback | undefined) => MethodReturn;
88
- ltrim: (key: string, start: number, stop: number, callback?: Callback | undefined) => MethodReturn;
89
- rpop: (key: string, callback?: Callback | undefined) => MethodReturn;
90
- rpoplpush: (source: string, destination: string, callback?: Callback | undefined) => MethodReturn;
91
- rpush: (key: string, elements: string[], callback?: Callback | undefined) => MethodReturn;
92
- rpushx: (key: string, elements: string[], callback?: Callback | undefined) => MethodReturn;
93
- dbsize: (callback?: Callback | undefined) => MethodReturn;
94
- flushall: (mode?: "ASYNC" | undefined, callback?: Callback | undefined) => MethodReturn;
95
- flushdb: (mode?: "ASYNC" | undefined, callback?: Callback | undefined) => MethodReturn;
96
- info: (callback?: Callback | undefined) => MethodReturn;
97
- time: (callback?: Callback | undefined) => MethodReturn;
98
- sadd: (key: string, members: string[], callback?: Callback | undefined) => MethodReturn;
99
- scard: (key: string, callback?: Callback | undefined) => MethodReturn;
100
- sdiff: (keys: string[], callback?: Callback | undefined) => MethodReturn;
101
- sdiffstore: (destination: string, keys: string[], callback?: Callback | undefined) => MethodReturn;
102
- sinter: (keys: string[], callback?: Callback | undefined) => MethodReturn;
103
- sinterstore: (destination: string, keys: string[], callback?: Callback | undefined) => MethodReturn;
104
- sismember: (key: string, member: string, callback?: Callback | undefined) => MethodReturn;
105
- smembers: (key: string, callback?: Callback | undefined) => MethodReturn;
106
- smove: (source: string, destination: string, member: string, callback?: Callback | undefined) => MethodReturn;
107
- spop: (key: string, count?: number | undefined, callback?: Callback | undefined) => MethodReturn;
108
- srandmember: (key: string, count?: number | undefined, callback?: Callback | undefined) => MethodReturn;
109
- srem: (key: string, members: string[], callback?: Callback | undefined) => MethodReturn;
110
- sunion: (keys: string[], callback?: Callback | undefined) => MethodReturn;
111
- sunionstore: (destination: string, keys: string[], callback?: Callback | undefined) => MethodReturn;
112
- zadd: (key: string, values: ZSetNumber[], options?: (({
113
- xx?: boolean | undefined;
114
- } | {
115
- nx?: boolean | undefined;
116
- }) & {
117
- ch?: boolean | undefined;
118
- incr: boolean;
119
- }) | undefined, callback?: Callback | undefined) => MethodReturn;
120
- zcard: (key: string, callback?: Callback | undefined) => MethodReturn;
121
- zcount: (key: string, min: ZSetNumber, max: ZSetNumber, callback?: Callback | undefined) => MethodReturn;
122
- zincrby: (key: string, increment: number | string, member: string, callback?: Callback | undefined) => MethodReturn;
123
- zinterstore: (destination: string, keys: string[], options?: {
124
- weights?: number[] | undefined;
125
- aggregate?: "MIN" | "MAX" | "SUM" | undefined;
126
- } | undefined, callback?: Callback | undefined) => MethodReturn;
127
- zlexcount: (key: string, min: ZSetNumber, max: ZSetNumber, callback?: Callback | undefined) => MethodReturn;
128
- zpopmax: (key: string, count?: number | undefined, callback?: Callback | undefined) => MethodReturn;
129
- zpopmin: (key: string, count?: number | undefined, callback?: Callback | undefined) => MethodReturn;
130
- zrange: (key: string, min: ZSetNumber, max: ZSetNumber, options?: {
131
- withScores: boolean;
132
- } | undefined, callback?: Callback | undefined) => MethodReturn;
133
- zrangebylex: (key: string, min: ZSetNumber, max: ZSetNumber, offset?: number | undefined, count?: number | undefined, callback?: Callback | undefined) => MethodReturn;
134
- zrangebyscore: (key: string, min: ZSetNumber, max: ZSetNumber, options?: {
135
- withScores?: boolean | undefined;
136
- limit?: {
137
- offset: number;
138
- count: number;
139
- } | undefined;
140
- } | undefined, callback?: Callback | undefined) => MethodReturn;
141
- zrank: (key: string, member: string, callback?: Callback | undefined) => MethodReturn;
142
- zrem: (key: string, members: string[], callback?: Callback | undefined) => MethodReturn;
143
- zremrangebylex: (key: string, min: ZSetNumber, max: ZSetNumber, callback?: Callback | undefined) => MethodReturn;
144
- zremrangebyrank: (key: string, start: number, stop: number, callback?: Callback | undefined) => MethodReturn;
145
- zremrangebyscore: (key: string, min: ZSetNumber, max: ZSetNumber, callback?: Callback | undefined) => MethodReturn;
146
- zrevrange: (key: string, start: number, stop: number, options?: {
147
- withScores: boolean;
148
- } | undefined, callback?: Callback | undefined) => MethodReturn;
149
- zrevrangebylex: (key: string, max: ZSetNumber, min: ZSetNumber, offset?: number | undefined, count?: number | undefined, callback?: Callback | undefined) => MethodReturn;
150
- zrevrangebyscore: (key: string, min: ZSetNumber, max: ZSetNumber, callback?: Callback | undefined) => MethodReturn;
151
- zscore: (key: string, member: string, callback?: Callback | undefined) => MethodReturn;
152
- zunionstore: (destination: string, keys: string[], options?: {
153
- weights?: number[] | undefined;
154
- aggregate?: "MIN" | "MAX" | "SUM" | undefined;
155
- } | undefined, callback?: Callback | undefined) => MethodReturn;
156
- };
157
- export {};
158
- //# sourceMappingURL=client.d.ts.map
19
+ declare function upstash(options?: ClientObjectProps): Upstash;
20
+ declare function upstash(url?: string, token?: string): Upstash;
21
+ export default upstash;