@devvit/redis 0.11.17-next-2025-06-04-9f97a2cf2.0 → 0.11.17-next-2025-06-05-61fd8e75f.0
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/RedisClient.d.ts +56 -56
- package/RedisClient.js +56 -56
- package/package.json +6 -6
- package/types/redis.d.ts +56 -56
package/RedisClient.d.ts
CHANGED
|
@@ -14,38 +14,38 @@ export declare class TxClient implements TxClientLike {
|
|
|
14
14
|
discard(): Promise<void>;
|
|
15
15
|
watch(...keys: string[]): Promise<TxClientLike>;
|
|
16
16
|
unwatch(): Promise<TxClientLike>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
getRange(key: string, start: number, end: number): Promise<TxClientLike>;
|
|
18
|
+
setRange(key: string, offset: number, value: string): Promise<TxClientLike>;
|
|
19
|
+
strLen(key: string): Promise<TxClientLike>;
|
|
20
|
+
mGet(keys: string[]): Promise<TxClientLike>;
|
|
21
|
+
mSet(keyValues: {
|
|
22
22
|
[key: string]: string;
|
|
23
23
|
}): Promise<TxClientLike>;
|
|
24
|
-
|
|
24
|
+
incrBy(key: string, value: number): Promise<TxClientLike>;
|
|
25
25
|
expire(key: string, seconds: number): Promise<TxClientLike>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
expireTime(key: string): Promise<TxClientLike>;
|
|
27
|
+
zAdd(key: string, ...members: ZMember[]): Promise<TxClientLike>;
|
|
28
|
+
zScore(key: string, member: string): Promise<TxClientLike>;
|
|
29
|
+
zRank(key: string, member: string): Promise<TxClientLike>;
|
|
30
|
+
zIncrBy(key: string, member: string, value: number): Promise<TxClientLike>;
|
|
31
|
+
zScan(key: string, cursor: number, pattern?: string | undefined, count?: number | undefined): Promise<TxClientLike>;
|
|
32
|
+
zCard(key: string): Promise<TxClientLike>;
|
|
33
|
+
zRange(key: string, start: number | string, stop: number | string, options?: ZRangeOptions): Promise<TxClientLike>;
|
|
34
|
+
zRem(key: string, members: string[]): Promise<TxClientLike>;
|
|
35
|
+
zRemRangeByLex(key: string, min: string, max: string): Promise<TxClientLike>;
|
|
36
|
+
zRemRangeByRank(key: string, start: number, stop: number): Promise<TxClientLike>;
|
|
37
|
+
zRemRangeByScore(key: string, min: number, max: number): Promise<TxClientLike>;
|
|
38
|
+
hGetAll(key: string): Promise<TxClientLike>;
|
|
39
|
+
hGet(key: string, field: string): Promise<TxClientLike>;
|
|
40
|
+
hMGet(key: string, fields: string[]): Promise<TxClientLike>;
|
|
41
|
+
hSet(key: string, fieldValues: {
|
|
42
42
|
[field: string]: string;
|
|
43
43
|
}): Promise<TxClientLike>;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
hIncrBy(key: string, field: string, value: number): Promise<TxClientLike>;
|
|
45
|
+
hDel(key: string, fields: string[]): Promise<TxClientLike>;
|
|
46
|
+
hScan(key: string, cursor: number, pattern?: string | undefined, count?: number | undefined): Promise<TxClientLike>;
|
|
47
|
+
hKeys(key: string): Promise<TxClientLike>;
|
|
48
|
+
hLen(key: string): Promise<TxClientLike>;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* This is a subset of the overall Redis API. You should be able to look up https://redis.io/commands
|
|
@@ -61,48 +61,48 @@ export declare class RedisClient implements RedisClientLike {
|
|
|
61
61
|
constructor(storage: RedisAPI, scope: RedisKeyScope);
|
|
62
62
|
watch(...keys: string[]): Promise<TxClientLike>;
|
|
63
63
|
get(key: string): Promise<string | undefined>;
|
|
64
|
-
|
|
64
|
+
getBuffer(key: string): Promise<Buffer | undefined>;
|
|
65
65
|
set(key: string, value: string, options?: SetOptions): Promise<string>;
|
|
66
66
|
exists(...keys: string[]): Promise<number>;
|
|
67
67
|
del(...keys: string[]): Promise<void>;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
incrBy(key: string, value: number): Promise<number>;
|
|
69
|
+
getRange(key: string, start: number, end: number): Promise<string>;
|
|
70
|
+
setRange(key: string, offset: number, value: string): Promise<number>;
|
|
71
|
+
strLen(key: string): Promise<number>;
|
|
72
72
|
expire(key: string, seconds: number): Promise<void>;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
expireTime(key: string): Promise<number>;
|
|
74
|
+
zAdd(key: string, ...members: ZMember[]): Promise<number>;
|
|
75
|
+
zRange(key: string, start: number | string, stop: number | string, options?: ZRangeOptions): Promise<{
|
|
76
76
|
member: string;
|
|
77
77
|
score: number;
|
|
78
78
|
}[]>;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
zRem(key: string, members: string[]): Promise<number>;
|
|
80
|
+
zRemRangeByLex(key: string, min: string, max: string): Promise<number>;
|
|
81
|
+
zRemRangeByRank(key: string, start: number, stop: number): Promise<number>;
|
|
82
|
+
zRemRangeByScore(key: string, min: number, max: number): Promise<number>;
|
|
83
|
+
zScore(key: string, member: string): Promise<number | undefined>;
|
|
84
|
+
zRank(key: string, member: string): Promise<number | undefined>;
|
|
85
|
+
zIncrBy(key: string, member: string, value: number): Promise<number>;
|
|
86
|
+
mGet(keys: string[]): Promise<(string | null)[]>;
|
|
87
|
+
mSet(keyValues: {
|
|
88
88
|
[key: string]: string;
|
|
89
89
|
}): Promise<void>;
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
zCard(key: string): Promise<number>;
|
|
91
|
+
zScan(key: string, cursor: number, pattern?: string | undefined, count?: number | undefined): Promise<ZScanResponse>;
|
|
92
92
|
type(key: string): Promise<string>;
|
|
93
93
|
rename(key: string, newKey: string): Promise<string>;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
hGet(key: string, field: string): Promise<string | undefined>;
|
|
95
|
+
hMGet(key: string, fields: string[]): Promise<(string | null)[]>;
|
|
96
|
+
hSet(key: string, fieldValues: {
|
|
97
97
|
[field: string]: string;
|
|
98
98
|
}): Promise<number>;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
hSetNX(key: string, field: string, value: string): Promise<number>;
|
|
100
|
+
hGetAll(key: string): Promise<Record<string, string>>;
|
|
101
|
+
hDel(key: string, fields: string[]): Promise<number>;
|
|
102
|
+
hScan(key: string, cursor: number, pattern?: string | undefined, count?: number | undefined): Promise<HScanResponse>;
|
|
103
|
+
hKeys(key: string): Promise<string[]>;
|
|
104
|
+
hIncrBy(key: string, field: string, value: number): Promise<number>;
|
|
105
|
+
hLen(key: string): Promise<number>;
|
|
106
106
|
bitfield(key: string, ...cmds: [] | BitfieldCommand | [...BitfieldCommand, ...BitfieldCommand] | [...BitfieldCommand, ...BitfieldCommand, ...BitfieldCommand, ...(number | string)[]]): Promise<number[]>;
|
|
107
107
|
}
|
|
108
108
|
//# sourceMappingURL=RedisClient.d.ts.map
|
package/RedisClient.js
CHANGED
|
@@ -98,28 +98,28 @@ export class TxClient {
|
|
|
98
98
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").Unwatch(__classPrivateFieldGet(this, _TxClient_transactionId, "f"), __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
99
99
|
return this;
|
|
100
100
|
}
|
|
101
|
-
async
|
|
101
|
+
async getRange(key, start, end) {
|
|
102
102
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").GetRange({ key, start, end, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
103
103
|
return this;
|
|
104
104
|
}
|
|
105
|
-
async
|
|
105
|
+
async setRange(key, offset, value) {
|
|
106
106
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").SetRange({ key, offset, value, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
107
107
|
return this;
|
|
108
108
|
}
|
|
109
|
-
async
|
|
109
|
+
async strLen(key) {
|
|
110
110
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").Strlen({ key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
111
111
|
return this;
|
|
112
112
|
}
|
|
113
|
-
async
|
|
113
|
+
async mGet(keys) {
|
|
114
114
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").MGet({ keys, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
115
115
|
return this;
|
|
116
116
|
}
|
|
117
|
-
async
|
|
117
|
+
async mSet(keyValues) {
|
|
118
118
|
const kv = Object.entries(keyValues).map(([key, value]) => ({ key, value }));
|
|
119
119
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").MSet({ kv, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
120
120
|
return this;
|
|
121
121
|
}
|
|
122
|
-
async
|
|
122
|
+
async incrBy(key, value) {
|
|
123
123
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").IncrBy({ key, value, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
124
124
|
return this;
|
|
125
125
|
}
|
|
@@ -127,27 +127,27 @@ export class TxClient {
|
|
|
127
127
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").Expire({ key, seconds, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
128
128
|
return this;
|
|
129
129
|
}
|
|
130
|
-
async
|
|
130
|
+
async expireTime(key) {
|
|
131
131
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ExpireTime({ key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
132
132
|
return this;
|
|
133
133
|
}
|
|
134
|
-
async
|
|
134
|
+
async zAdd(key, ...members) {
|
|
135
135
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZAdd({ key, members, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
136
136
|
return this;
|
|
137
137
|
}
|
|
138
|
-
async
|
|
138
|
+
async zScore(key, member) {
|
|
139
139
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZScore({ key: { key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, member }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
140
140
|
return this;
|
|
141
141
|
}
|
|
142
|
-
async
|
|
142
|
+
async zRank(key, member) {
|
|
143
143
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZRank({ key: { key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, member }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
144
144
|
return this;
|
|
145
145
|
}
|
|
146
|
-
async
|
|
146
|
+
async zIncrBy(key, member, value) {
|
|
147
147
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZIncrBy({ key, member, value, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
148
148
|
return this;
|
|
149
149
|
}
|
|
150
|
-
async
|
|
150
|
+
async zScan(key, cursor, pattern, count) {
|
|
151
151
|
const request = {
|
|
152
152
|
key,
|
|
153
153
|
cursor,
|
|
@@ -158,11 +158,11 @@ export class TxClient {
|
|
|
158
158
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZScan(request, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
159
159
|
return this;
|
|
160
160
|
}
|
|
161
|
-
async
|
|
161
|
+
async zCard(key) {
|
|
162
162
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZCard({ key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
163
163
|
return this;
|
|
164
164
|
}
|
|
165
|
-
async
|
|
165
|
+
async zRange(key, start, stop, options) {
|
|
166
166
|
// eslint-disable-next-line
|
|
167
167
|
let opts = { rev: false, byLex: false, byScore: false, offset: 0, count: 1000 };
|
|
168
168
|
if (options?.reverse) {
|
|
@@ -191,48 +191,48 @@ export class TxClient {
|
|
|
191
191
|
}, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
192
192
|
return this;
|
|
193
193
|
}
|
|
194
|
-
async
|
|
194
|
+
async zRem(key, members) {
|
|
195
195
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZRem({ key: { key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, members: members }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
196
196
|
return this;
|
|
197
197
|
}
|
|
198
|
-
async
|
|
198
|
+
async zRemRangeByLex(key, min, max) {
|
|
199
199
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZRemRangeByLex({ key: { key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, min: min, max: max }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
200
200
|
return this;
|
|
201
201
|
}
|
|
202
|
-
async
|
|
202
|
+
async zRemRangeByRank(key, start, stop) {
|
|
203
203
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZRemRangeByRank({ key: { key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, start: start, stop: stop }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
204
204
|
return this;
|
|
205
205
|
}
|
|
206
|
-
async
|
|
206
|
+
async zRemRangeByScore(key, min, max) {
|
|
207
207
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").ZRemRangeByScore({ key: { key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, min: min, max: max }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
208
208
|
return this;
|
|
209
209
|
}
|
|
210
|
-
async
|
|
210
|
+
async hGetAll(key) {
|
|
211
211
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").HGetAll({ key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
212
212
|
return this;
|
|
213
213
|
}
|
|
214
|
-
async
|
|
214
|
+
async hGet(key, field) {
|
|
215
215
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").HGet({ key: key, field: field, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
216
216
|
return this;
|
|
217
217
|
}
|
|
218
|
-
async
|
|
218
|
+
async hMGet(key, fields) {
|
|
219
219
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").HMGet({ key: key, fields: fields, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
220
220
|
return this;
|
|
221
221
|
}
|
|
222
|
-
async
|
|
222
|
+
async hSet(key, fieldValues) {
|
|
223
223
|
const fv = Object.entries(fieldValues).map(([field, value]) => ({ field, value }));
|
|
224
224
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").HSet({ key, fv, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
225
225
|
return this;
|
|
226
226
|
}
|
|
227
|
-
async
|
|
227
|
+
async hIncrBy(key, field, value) {
|
|
228
228
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").HIncrBy({ key, field, value, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
229
229
|
return this;
|
|
230
230
|
}
|
|
231
|
-
async
|
|
231
|
+
async hDel(key, fields) {
|
|
232
232
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").HDel({ key, fields, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
233
233
|
return this;
|
|
234
234
|
}
|
|
235
|
-
async
|
|
235
|
+
async hScan(key, cursor, pattern, count) {
|
|
236
236
|
const request = {
|
|
237
237
|
key,
|
|
238
238
|
cursor,
|
|
@@ -243,11 +243,11 @@ export class TxClient {
|
|
|
243
243
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").HScan(request, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
244
244
|
return this;
|
|
245
245
|
}
|
|
246
|
-
async
|
|
246
|
+
async hKeys(key) {
|
|
247
247
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").HKeys({ key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
248
248
|
return this;
|
|
249
249
|
}
|
|
250
|
-
async
|
|
250
|
+
async hLen(key) {
|
|
251
251
|
await __classPrivateFieldGet(this, _TxClient_storage, "f").HLen({ key, transactionId: __classPrivateFieldGet(this, _TxClient_transactionId, "f") }, __classPrivateFieldGet(this, _TxClient_instances, "a", _TxClient_metadata_get));
|
|
252
252
|
return this;
|
|
253
253
|
}
|
|
@@ -293,7 +293,7 @@ export class RedisClient {
|
|
|
293
293
|
throw e;
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
async
|
|
296
|
+
async getBuffer(key) {
|
|
297
297
|
try {
|
|
298
298
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").GetBytes({ key, scope: this.scope }, {
|
|
299
299
|
...__classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get),
|
|
@@ -333,33 +333,33 @@ export class RedisClient {
|
|
|
333
333
|
async del(...keys) {
|
|
334
334
|
await __classPrivateFieldGet(this, _RedisClient_storage, "f").Del({ keys, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
335
335
|
}
|
|
336
|
-
async
|
|
336
|
+
async incrBy(key, value) {
|
|
337
337
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").IncrBy({ key, value, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
338
338
|
return response.value;
|
|
339
339
|
}
|
|
340
|
-
async
|
|
340
|
+
async getRange(key, start, end) {
|
|
341
341
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").GetRange({ key, start, end, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
342
342
|
return response !== null ? response.value : response;
|
|
343
343
|
}
|
|
344
|
-
async
|
|
344
|
+
async setRange(key, offset, value) {
|
|
345
345
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").SetRange({ key, offset, value, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
346
346
|
return response.value;
|
|
347
347
|
}
|
|
348
|
-
async
|
|
348
|
+
async strLen(key) {
|
|
349
349
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").Strlen({ key, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
350
350
|
return response.value;
|
|
351
351
|
}
|
|
352
352
|
async expire(key, seconds) {
|
|
353
353
|
await __classPrivateFieldGet(this, _RedisClient_storage, "f").Expire({ key, seconds, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
354
354
|
}
|
|
355
|
-
async
|
|
355
|
+
async expireTime(key) {
|
|
356
356
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").ExpireTime({ key, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
357
357
|
return response.value;
|
|
358
358
|
}
|
|
359
|
-
async
|
|
359
|
+
async zAdd(key, ...members) {
|
|
360
360
|
return (await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZAdd({ key, members, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get))).value;
|
|
361
361
|
}
|
|
362
|
-
async
|
|
362
|
+
async zRange(key, start, stop, options) {
|
|
363
363
|
// eslint-disable-next-line
|
|
364
364
|
let opts = { rev: false, byLex: false, byScore: false, offset: 0, count: 1000 };
|
|
365
365
|
if (options?.reverse) {
|
|
@@ -387,23 +387,23 @@ export class RedisClient {
|
|
|
387
387
|
}
|
|
388
388
|
return (await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZRange({ key: { key: key }, start: start + '', stop: stop + '', ...opts, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get))).members;
|
|
389
389
|
}
|
|
390
|
-
async
|
|
390
|
+
async zRem(key, members) {
|
|
391
391
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZRem({ key: { key }, members, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
392
392
|
return response.value;
|
|
393
393
|
}
|
|
394
|
-
async
|
|
394
|
+
async zRemRangeByLex(key, min, max) {
|
|
395
395
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZRemRangeByLex({ key: { key }, min, max, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
396
396
|
return response.value;
|
|
397
397
|
}
|
|
398
|
-
async
|
|
398
|
+
async zRemRangeByRank(key, start, stop) {
|
|
399
399
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZRemRangeByRank({ key: { key }, start, stop, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
400
400
|
return response.value;
|
|
401
401
|
}
|
|
402
|
-
async
|
|
402
|
+
async zRemRangeByScore(key, min, max) {
|
|
403
403
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZRemRangeByScore({ key: { key }, min, max, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
404
404
|
return response.value;
|
|
405
405
|
}
|
|
406
|
-
async
|
|
406
|
+
async zScore(key, member) {
|
|
407
407
|
try {
|
|
408
408
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZScore({ key: { key }, member, scope: this.scope }, {
|
|
409
409
|
...__classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get),
|
|
@@ -418,7 +418,7 @@ export class RedisClient {
|
|
|
418
418
|
throw e;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
async
|
|
421
|
+
async zRank(key, member) {
|
|
422
422
|
try {
|
|
423
423
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZRank({ key: { key }, member, scope: this.scope }, {
|
|
424
424
|
...__classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get),
|
|
@@ -433,23 +433,23 @@ export class RedisClient {
|
|
|
433
433
|
throw e;
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
async
|
|
436
|
+
async zIncrBy(key, member, value) {
|
|
437
437
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZIncrBy({ key, member, value, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
438
438
|
return response !== null ? response.value : response;
|
|
439
439
|
}
|
|
440
|
-
async
|
|
440
|
+
async mGet(keys) {
|
|
441
441
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").MGet({ keys, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
442
442
|
return response !== null ? response.values.map((value) => value || null) : response;
|
|
443
443
|
}
|
|
444
|
-
async
|
|
444
|
+
async mSet(keyValues) {
|
|
445
445
|
const kv = Object.entries(keyValues).map(([key, value]) => ({ key, value }));
|
|
446
446
|
await __classPrivateFieldGet(this, _RedisClient_storage, "f").MSet({ kv, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
447
447
|
}
|
|
448
|
-
async
|
|
448
|
+
async zCard(key) {
|
|
449
449
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZCard({ key, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
450
450
|
return response !== null ? response.value : response;
|
|
451
451
|
}
|
|
452
|
-
async
|
|
452
|
+
async zScan(key, cursor, pattern, count) {
|
|
453
453
|
const request = { key, cursor, pattern, count, scope: this.scope };
|
|
454
454
|
return await __classPrivateFieldGet(this, _RedisClient_storage, "f").ZScan(request, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
455
455
|
}
|
|
@@ -461,7 +461,7 @@ export class RedisClient {
|
|
|
461
461
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").Rename({ key, newKey, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
462
462
|
return response.result;
|
|
463
463
|
}
|
|
464
|
-
async
|
|
464
|
+
async hGet(key, field) {
|
|
465
465
|
try {
|
|
466
466
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").HGet({ key, field, scope: this.scope }, {
|
|
467
467
|
...__classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get),
|
|
@@ -476,40 +476,40 @@ export class RedisClient {
|
|
|
476
476
|
throw e;
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
async
|
|
479
|
+
async hMGet(key, fields) {
|
|
480
480
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").HMGet({ key, fields, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
481
481
|
return response !== null ? response.values.map((value) => value || null) : response;
|
|
482
482
|
}
|
|
483
|
-
async
|
|
483
|
+
async hSet(key, fieldValues) {
|
|
484
484
|
const fv = Object.entries(fieldValues).map(([field, value]) => ({ field, value }));
|
|
485
485
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").HSet({ key, fv, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
486
486
|
return response.value;
|
|
487
487
|
}
|
|
488
|
-
async
|
|
488
|
+
async hSetNX(key, field, value) {
|
|
489
489
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").HSetNX({ key, field, value, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
490
490
|
return response.success;
|
|
491
491
|
}
|
|
492
|
-
async
|
|
492
|
+
async hGetAll(key) {
|
|
493
493
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").HGetAll({ key, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
494
494
|
return response !== null ? response.fieldValues : response;
|
|
495
495
|
}
|
|
496
|
-
async
|
|
496
|
+
async hDel(key, fields) {
|
|
497
497
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").HDel({ key, fields, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
498
498
|
return response.value;
|
|
499
499
|
}
|
|
500
|
-
async
|
|
500
|
+
async hScan(key, cursor, pattern, count) {
|
|
501
501
|
const request = { key, cursor, pattern, count, scope: this.scope };
|
|
502
502
|
return await __classPrivateFieldGet(this, _RedisClient_storage, "f").HScan(request, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
503
503
|
}
|
|
504
|
-
async
|
|
504
|
+
async hKeys(key) {
|
|
505
505
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").HKeys({ key, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
506
506
|
return response !== null ? response.keys : response;
|
|
507
507
|
}
|
|
508
|
-
async
|
|
508
|
+
async hIncrBy(key, field, value) {
|
|
509
509
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").HIncrBy({ key, field, value, scope: this.scope }, __classPrivateFieldGet(this, _RedisClient_instances, "a", _RedisClient_metadata_get));
|
|
510
510
|
return response.value;
|
|
511
511
|
}
|
|
512
|
-
async
|
|
512
|
+
async hLen(key) {
|
|
513
513
|
const response = await __classPrivateFieldGet(this, _RedisClient_storage, "f").HLen({
|
|
514
514
|
key,
|
|
515
515
|
scope: this.scope,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/redis",
|
|
3
|
-
"version": "0.11.17-next-2025-06-
|
|
3
|
+
"version": "0.11.17-next-2025-06-05-61fd8e75f.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
},
|
|
24
24
|
"types": "./index.d.ts",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@devvit/protos": "0.11.17-next-2025-06-
|
|
26
|
+
"@devvit/protos": "0.11.17-next-2025-06-05-61fd8e75f.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@devvit/server": "*"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@devvit/repo-tools": "0.11.17-next-2025-06-
|
|
33
|
-
"@devvit/server": "0.11.17-next-2025-06-
|
|
34
|
-
"@devvit/tsconfig": "0.11.17-next-2025-06-
|
|
32
|
+
"@devvit/repo-tools": "0.11.17-next-2025-06-05-61fd8e75f.0",
|
|
33
|
+
"@devvit/server": "0.11.17-next-2025-06-05-61fd8e75f.0",
|
|
34
|
+
"@devvit/tsconfig": "0.11.17-next-2025-06-05-61fd8e75f.0",
|
|
35
35
|
"eslint": "9.11.1",
|
|
36
36
|
"typescript": "5.8.3",
|
|
37
37
|
"vitest": "1.6.1"
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"directory": "dist"
|
|
41
41
|
},
|
|
42
42
|
"source": "./src/index.ts",
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "2ae004f9ec8a91646f4d173b7b4dbd2d4e216172"
|
|
44
44
|
}
|
package/types/redis.d.ts
CHANGED
|
@@ -152,7 +152,7 @@ export type TxClientLike = {
|
|
|
152
152
|
* }
|
|
153
153
|
* ```
|
|
154
154
|
*/
|
|
155
|
-
|
|
155
|
+
incrBy(key: string, value: number): Promise<TxClientLike>;
|
|
156
156
|
/**
|
|
157
157
|
* Returns the string representation of the type of the value stored at key
|
|
158
158
|
* https://redis.io/commands/type/
|
|
@@ -185,7 +185,7 @@ export type TxClientLike = {
|
|
|
185
185
|
* }
|
|
186
186
|
* ```
|
|
187
187
|
*/
|
|
188
|
-
|
|
188
|
+
getRange(key: string, start: number, end: number): Promise<TxClientLike>;
|
|
189
189
|
/**
|
|
190
190
|
* Overwrites part of the string stored at key, starting at the
|
|
191
191
|
* specified offset, for the entire length of value.
|
|
@@ -202,7 +202,7 @@ export type TxClientLike = {
|
|
|
202
202
|
* }
|
|
203
203
|
* ```
|
|
204
204
|
*/
|
|
205
|
-
|
|
205
|
+
setRange(key: string, offset: number, value: string): Promise<TxClientLike>;
|
|
206
206
|
/**
|
|
207
207
|
* Returns the length of the string value stored at key.
|
|
208
208
|
* An error is returned when key holds a non-string value.
|
|
@@ -218,7 +218,7 @@ export type TxClientLike = {
|
|
|
218
218
|
* }
|
|
219
219
|
* ```
|
|
220
220
|
*/
|
|
221
|
-
|
|
221
|
+
strLen(key: string): Promise<TxClientLike>;
|
|
222
222
|
/**
|
|
223
223
|
* Returns the values of all specified keys.
|
|
224
224
|
* https://redis.io/commands/mget/
|
|
@@ -235,7 +235,7 @@ export type TxClientLike = {
|
|
|
235
235
|
* }
|
|
236
236
|
* ```
|
|
237
237
|
*/
|
|
238
|
-
|
|
238
|
+
mGet(keys: string[]): Promise<TxClientLike>;
|
|
239
239
|
/**
|
|
240
240
|
* Sets the given keys to their respective values.
|
|
241
241
|
* https://redis.io/commands/mset/
|
|
@@ -251,7 +251,7 @@ export type TxClientLike = {
|
|
|
251
251
|
* }
|
|
252
252
|
* ```
|
|
253
253
|
*/
|
|
254
|
-
|
|
254
|
+
mSet(keyValues: {
|
|
255
255
|
[key: string]: string;
|
|
256
256
|
}): Promise<TxClientLike>;
|
|
257
257
|
/**
|
|
@@ -280,7 +280,7 @@ export type TxClientLike = {
|
|
|
280
280
|
* console.log("Expire time: " + expireTime);
|
|
281
281
|
* }
|
|
282
282
|
*/
|
|
283
|
-
|
|
283
|
+
expireTime(key: string): Promise<TxClientLike>;
|
|
284
284
|
/**
|
|
285
285
|
* Adds all the specified members with the specified scores to the sorted set stored at key.
|
|
286
286
|
* https://redis.io/commands/zadd/
|
|
@@ -300,7 +300,7 @@ export type TxClientLike = {
|
|
|
300
300
|
* }
|
|
301
301
|
* ```
|
|
302
302
|
*/
|
|
303
|
-
|
|
303
|
+
zAdd(key: string, ...members: ZMember[]): Promise<TxClientLike>;
|
|
304
304
|
/**
|
|
305
305
|
* Returns the cardinality (number of elements) of the sorted set stored at key.
|
|
306
306
|
* https://redis.io/commands/zcard/
|
|
@@ -320,7 +320,7 @@ export type TxClientLike = {
|
|
|
320
320
|
* }
|
|
321
321
|
* ```
|
|
322
322
|
*/
|
|
323
|
-
|
|
323
|
+
zCard(key: string): Promise<TxClientLike>;
|
|
324
324
|
/**
|
|
325
325
|
* Increments the score of member in the sorted set stored at key by value
|
|
326
326
|
* https://redis.io/commands/zincrby/
|
|
@@ -342,7 +342,7 @@ export type TxClientLike = {
|
|
|
342
342
|
* }
|
|
343
343
|
* ```
|
|
344
344
|
*/
|
|
345
|
-
|
|
345
|
+
zIncrBy(key: string, member: string, value: number): Promise<TxClientLike>;
|
|
346
346
|
/**
|
|
347
347
|
* Returns the rank of member in the sorted set stored at key
|
|
348
348
|
* https://redis.io/commands/zrank/
|
|
@@ -364,7 +364,7 @@ export type TxClientLike = {
|
|
|
364
364
|
* }
|
|
365
365
|
* ```
|
|
366
366
|
*/
|
|
367
|
-
|
|
367
|
+
zRank(key: string, member: string): Promise<TxClientLike>;
|
|
368
368
|
/**
|
|
369
369
|
* Returns the score of member in the sorted set at key.
|
|
370
370
|
* https://redis.io/commands/zscore/
|
|
@@ -387,7 +387,7 @@ export type TxClientLike = {
|
|
|
387
387
|
* }
|
|
388
388
|
* ```
|
|
389
389
|
*/
|
|
390
|
-
|
|
390
|
+
zScore(key: string, member: string): Promise<TxClientLike>;
|
|
391
391
|
/**
|
|
392
392
|
* Iterates elements of Sorted Set types and their associated scores.
|
|
393
393
|
* @arg {} key
|
|
@@ -409,7 +409,7 @@ export type TxClientLike = {
|
|
|
409
409
|
* }
|
|
410
410
|
* ```
|
|
411
411
|
*/
|
|
412
|
-
|
|
412
|
+
zScan(key: string, cursor: number, pattern?: string | undefined, count?: number | undefined): Promise<TxClientLike>;
|
|
413
413
|
/**
|
|
414
414
|
* Returns the specified range of elements in the sorted set stored at key.
|
|
415
415
|
* https://redis.io/commands/zrange/
|
|
@@ -439,7 +439,7 @@ export type TxClientLike = {
|
|
|
439
439
|
* }
|
|
440
440
|
* ```
|
|
441
441
|
*/
|
|
442
|
-
|
|
442
|
+
zRange(key: string, start: number | string, stop: number | string, options?: ZRangeOptions): Promise<TxClientLike>;
|
|
443
443
|
/**
|
|
444
444
|
* Removes the specified members from the sorted set stored at key.
|
|
445
445
|
* https://redis.io/commands/zrem/
|
|
@@ -460,7 +460,7 @@ export type TxClientLike = {
|
|
|
460
460
|
* }
|
|
461
461
|
* ```
|
|
462
462
|
*/
|
|
463
|
-
|
|
463
|
+
zRem(key: string, members: string[]): Promise<TxClientLike>;
|
|
464
464
|
/**
|
|
465
465
|
* removes all elements in the sorted set stored at key between the
|
|
466
466
|
* lexicographical range specified by min and max
|
|
@@ -487,7 +487,7 @@ export type TxClientLike = {
|
|
|
487
487
|
* }
|
|
488
488
|
* ```
|
|
489
489
|
*/
|
|
490
|
-
|
|
490
|
+
zRemRangeByLex(key: string, min: string, max: string): Promise<TxClientLike>;
|
|
491
491
|
/**
|
|
492
492
|
* Removes all elements in the sorted set stored at key with rank between start and stop.
|
|
493
493
|
* https://redis.io/commands/zremrangebyrank/
|
|
@@ -512,7 +512,7 @@ export type TxClientLike = {
|
|
|
512
512
|
* }
|
|
513
513
|
* ```
|
|
514
514
|
*/
|
|
515
|
-
|
|
515
|
+
zRemRangeByRank(key: string, start: number, stop: number): Promise<TxClientLike>;
|
|
516
516
|
/**
|
|
517
517
|
* Removes all elements in the sorted set stored at key with a score between min and max
|
|
518
518
|
* https://redis.io/commands/zremrangebyscore/
|
|
@@ -536,7 +536,7 @@ export type TxClientLike = {
|
|
|
536
536
|
* }
|
|
537
537
|
* ```
|
|
538
538
|
*/
|
|
539
|
-
|
|
539
|
+
zRemRangeByScore(key: string, min: number, max: number): Promise<TxClientLike>;
|
|
540
540
|
/**
|
|
541
541
|
* Sets the specified fields to their respective values in the hash stored at key.
|
|
542
542
|
* https://redis.io/commands/hset
|
|
@@ -551,7 +551,7 @@ export type TxClientLike = {
|
|
|
551
551
|
* }
|
|
552
552
|
* ```
|
|
553
553
|
*/
|
|
554
|
-
|
|
554
|
+
hSet(key: string, fieldValues: {
|
|
555
555
|
[field: string]: string;
|
|
556
556
|
}): Promise<TxClientLike>;
|
|
557
557
|
/**
|
|
@@ -569,7 +569,7 @@ export type TxClientLike = {
|
|
|
569
569
|
* }
|
|
570
570
|
* ```
|
|
571
571
|
*/
|
|
572
|
-
|
|
572
|
+
hGet(key: string, field: string): Promise<TxClientLike>;
|
|
573
573
|
/**
|
|
574
574
|
* Returns the values associated with fields in the hash stored at key.
|
|
575
575
|
* https://redis.io/commands/hmget
|
|
@@ -585,7 +585,7 @@ export type TxClientLike = {
|
|
|
585
585
|
* }
|
|
586
586
|
* ```
|
|
587
587
|
*/
|
|
588
|
-
|
|
588
|
+
hMGet(key: string, fields: string[]): Promise<TxClientLike>;
|
|
589
589
|
/**
|
|
590
590
|
* Returns all fields and values of the hash stored at key
|
|
591
591
|
* https://redis.io/commands/hgetall
|
|
@@ -608,7 +608,7 @@ export type TxClientLike = {
|
|
|
608
608
|
* }
|
|
609
609
|
* ```
|
|
610
610
|
*/
|
|
611
|
-
|
|
611
|
+
hGetAll(key: string): Promise<TxClientLike>;
|
|
612
612
|
/**
|
|
613
613
|
* Removes the specified fields from the hash stored at key.
|
|
614
614
|
* https://redis.io/commands/hdel/
|
|
@@ -623,7 +623,7 @@ export type TxClientLike = {
|
|
|
623
623
|
* }
|
|
624
624
|
* ```
|
|
625
625
|
*/
|
|
626
|
-
|
|
626
|
+
hDel(key: string, fields: string[]): Promise<TxClientLike>;
|
|
627
627
|
/**
|
|
628
628
|
* Iterates fields of Hash types and their associated values.
|
|
629
629
|
* @arg {} key
|
|
@@ -647,7 +647,7 @@ export type TxClientLike = {
|
|
|
647
647
|
* }
|
|
648
648
|
* ```
|
|
649
649
|
*/
|
|
650
|
-
|
|
650
|
+
hScan(key: string, cursor: number, pattern?: string | undefined, count?: number | undefined): Promise<TxClientLike>;
|
|
651
651
|
/**
|
|
652
652
|
* Returns all field names in the hash stored at key.
|
|
653
653
|
* @arg {} key
|
|
@@ -664,7 +664,7 @@ export type TxClientLike = {
|
|
|
664
664
|
* }
|
|
665
665
|
* ```
|
|
666
666
|
*/
|
|
667
|
-
|
|
667
|
+
hKeys(key: string): Promise<TxClientLike>;
|
|
668
668
|
/**
|
|
669
669
|
* Increments the number stored at field in the hash stored at key by increment.
|
|
670
670
|
* https://redis.io/commands/hincrby/
|
|
@@ -680,7 +680,7 @@ export type TxClientLike = {
|
|
|
680
680
|
* }
|
|
681
681
|
* ```
|
|
682
682
|
*/
|
|
683
|
-
|
|
683
|
+
hIncrBy(key: string, field: string, value: number): Promise<TxClientLike>;
|
|
684
684
|
/**
|
|
685
685
|
* Returns the number of fields contained in the hash stored at key.
|
|
686
686
|
* @arg {} key
|
|
@@ -699,7 +699,7 @@ export type TxClientLike = {
|
|
|
699
699
|
* }
|
|
700
700
|
* ```
|
|
701
701
|
*/
|
|
702
|
-
|
|
702
|
+
hLen(key: string): Promise<TxClientLike>;
|
|
703
703
|
};
|
|
704
704
|
export type RedisClient = {
|
|
705
705
|
/**
|
|
@@ -752,7 +752,7 @@ export type RedisClient = {
|
|
|
752
752
|
* }
|
|
753
753
|
* ```
|
|
754
754
|
*/
|
|
755
|
-
|
|
755
|
+
getBuffer(key: string): Promise<Buffer | undefined>;
|
|
756
756
|
/**
|
|
757
757
|
* Set key to hold the string value. If key already holds a value, it is overwritten
|
|
758
758
|
* https://redis.io/commands/set/
|
|
@@ -851,7 +851,7 @@ export type RedisClient = {
|
|
|
851
851
|
* }
|
|
852
852
|
* ```
|
|
853
853
|
*/
|
|
854
|
-
|
|
854
|
+
getRange(key: string, start: number, end: number): Promise<string>;
|
|
855
855
|
/**
|
|
856
856
|
* Overwrites part of the string stored at key, starting at the
|
|
857
857
|
* specified offset, for the entire length of value.
|
|
@@ -868,7 +868,7 @@ export type RedisClient = {
|
|
|
868
868
|
* }
|
|
869
869
|
* ```
|
|
870
870
|
*/
|
|
871
|
-
|
|
871
|
+
setRange(key: string, offset: number, value: string): Promise<number>;
|
|
872
872
|
/**
|
|
873
873
|
* Returns the length of the string value stored at key.
|
|
874
874
|
* An error is returned when key holds a non-string value.
|
|
@@ -884,7 +884,7 @@ export type RedisClient = {
|
|
|
884
884
|
* }
|
|
885
885
|
* ```
|
|
886
886
|
*/
|
|
887
|
-
|
|
887
|
+
strLen(key: string): Promise<number>;
|
|
888
888
|
/**
|
|
889
889
|
* Increments the number stored at key by increment.
|
|
890
890
|
* https://redis.io/commands/incrby/
|
|
@@ -900,7 +900,7 @@ export type RedisClient = {
|
|
|
900
900
|
* }
|
|
901
901
|
* ```
|
|
902
902
|
*/
|
|
903
|
-
|
|
903
|
+
incrBy(key: string, value: number): Promise<number>;
|
|
904
904
|
/**
|
|
905
905
|
* Returns the values of all specified keys.
|
|
906
906
|
* https://redis.io/commands/mget/
|
|
@@ -917,7 +917,7 @@ export type RedisClient = {
|
|
|
917
917
|
* }
|
|
918
918
|
* ```
|
|
919
919
|
*/
|
|
920
|
-
|
|
920
|
+
mGet(keys: string[]): Promise<(string | null)[]>;
|
|
921
921
|
/**
|
|
922
922
|
* Sets the given keys to their respective values.
|
|
923
923
|
* https://redis.io/commands/mset/
|
|
@@ -929,7 +929,7 @@ export type RedisClient = {
|
|
|
929
929
|
* }
|
|
930
930
|
* ```
|
|
931
931
|
*/
|
|
932
|
-
|
|
932
|
+
mSet(keyValues: {
|
|
933
933
|
[key: string]: string;
|
|
934
934
|
}): Promise<void>;
|
|
935
935
|
/**
|
|
@@ -958,7 +958,7 @@ export type RedisClient = {
|
|
|
958
958
|
* console.log("Expire time: " + expireTime);
|
|
959
959
|
* }
|
|
960
960
|
*/
|
|
961
|
-
|
|
961
|
+
expireTime(key: string): Promise<number>;
|
|
962
962
|
/**
|
|
963
963
|
* Adds all the specified members with the specified scores to the sorted set stored at key.
|
|
964
964
|
* https://redis.io/commands/zadd/
|
|
@@ -978,7 +978,7 @@ export type RedisClient = {
|
|
|
978
978
|
* }
|
|
979
979
|
* ```
|
|
980
980
|
*/
|
|
981
|
-
|
|
981
|
+
zAdd(key: string, ...members: ZMember[]): Promise<number>;
|
|
982
982
|
/**
|
|
983
983
|
* Returns the cardinality (number of elements) of the sorted set stored at key.
|
|
984
984
|
* https://redis.io/commands/zcard/
|
|
@@ -998,7 +998,7 @@ export type RedisClient = {
|
|
|
998
998
|
* }
|
|
999
999
|
* ```
|
|
1000
1000
|
*/
|
|
1001
|
-
|
|
1001
|
+
zCard(key: string): Promise<number>;
|
|
1002
1002
|
/**
|
|
1003
1003
|
* Returns the score of member in the sorted set at key.
|
|
1004
1004
|
* https://redis.io/commands/zscore/
|
|
@@ -1019,7 +1019,7 @@ export type RedisClient = {
|
|
|
1019
1019
|
* }
|
|
1020
1020
|
* ```
|
|
1021
1021
|
*/
|
|
1022
|
-
|
|
1022
|
+
zScore(key: string, member: string): Promise<number | undefined>;
|
|
1023
1023
|
/**
|
|
1024
1024
|
* Returns the rank of member in the sorted set stored at key
|
|
1025
1025
|
* https://redis.io/commands/zrank/
|
|
@@ -1044,7 +1044,7 @@ export type RedisClient = {
|
|
|
1044
1044
|
* }
|
|
1045
1045
|
* ```
|
|
1046
1046
|
*/
|
|
1047
|
-
|
|
1047
|
+
zRank(key: string, member: string): Promise<number | undefined>;
|
|
1048
1048
|
/**
|
|
1049
1049
|
* Increments the score of member in the sorted set stored at key by value
|
|
1050
1050
|
* https://redis.io/commands/zincrby/
|
|
@@ -1066,7 +1066,7 @@ export type RedisClient = {
|
|
|
1066
1066
|
* }
|
|
1067
1067
|
* ```
|
|
1068
1068
|
*/
|
|
1069
|
-
|
|
1069
|
+
zIncrBy(key: string, member: string, value: number): Promise<number>;
|
|
1070
1070
|
/**
|
|
1071
1071
|
* Returns the specified range of elements in the sorted set stored at key.
|
|
1072
1072
|
* https://redis.io/commands/zrange/
|
|
@@ -1096,7 +1096,7 @@ export type RedisClient = {
|
|
|
1096
1096
|
* }
|
|
1097
1097
|
* ```
|
|
1098
1098
|
*/
|
|
1099
|
-
|
|
1099
|
+
zRange(key: string, start: number | string, stop: number | string, options?: ZRangeOptions): Promise<{
|
|
1100
1100
|
member: string;
|
|
1101
1101
|
score: number;
|
|
1102
1102
|
}[]>;
|
|
@@ -1120,7 +1120,7 @@ export type RedisClient = {
|
|
|
1120
1120
|
* }
|
|
1121
1121
|
* ```
|
|
1122
1122
|
*/
|
|
1123
|
-
|
|
1123
|
+
zRem(key: string, members: string[]): Promise<number>;
|
|
1124
1124
|
/**
|
|
1125
1125
|
* removes all elements in the sorted set stored at key between the
|
|
1126
1126
|
* lexicographical range specified by min and max
|
|
@@ -1147,7 +1147,7 @@ export type RedisClient = {
|
|
|
1147
1147
|
* }
|
|
1148
1148
|
* ```
|
|
1149
1149
|
*/
|
|
1150
|
-
|
|
1150
|
+
zRemRangeByLex(key: string, min: string, max: string): Promise<number>;
|
|
1151
1151
|
/**
|
|
1152
1152
|
* Removes all elements in the sorted set stored at key with rank between start and stop.
|
|
1153
1153
|
* https://redis.io/commands/zremrangebyrank/
|
|
@@ -1172,7 +1172,7 @@ export type RedisClient = {
|
|
|
1172
1172
|
* }
|
|
1173
1173
|
* ```
|
|
1174
1174
|
*/
|
|
1175
|
-
|
|
1175
|
+
zRemRangeByRank(key: string, start: number, stop: number): Promise<number>;
|
|
1176
1176
|
/**
|
|
1177
1177
|
* Removes all elements in the sorted set stored at key with a score between min and max
|
|
1178
1178
|
* https://redis.io/commands/zremrangebyscore/
|
|
@@ -1196,7 +1196,7 @@ export type RedisClient = {
|
|
|
1196
1196
|
* }
|
|
1197
1197
|
* ```
|
|
1198
1198
|
*/
|
|
1199
|
-
|
|
1199
|
+
zRemRangeByScore(key: string, min: number, max: number): Promise<number>;
|
|
1200
1200
|
/**
|
|
1201
1201
|
* Iterates elements of Sorted Set types and their associated scores.
|
|
1202
1202
|
* @arg {} key
|
|
@@ -1218,7 +1218,7 @@ export type RedisClient = {
|
|
|
1218
1218
|
* }
|
|
1219
1219
|
* ```
|
|
1220
1220
|
*/
|
|
1221
|
-
|
|
1221
|
+
zScan(key: string, cursor: number, pattern?: string | undefined, count?: number | undefined): Promise<ZScanResponse>;
|
|
1222
1222
|
/**
|
|
1223
1223
|
* Sets the specified fields to their respective values in the hash stored at key.
|
|
1224
1224
|
* https://redis.io/commands/hset
|
|
@@ -1233,7 +1233,7 @@ export type RedisClient = {
|
|
|
1233
1233
|
* }
|
|
1234
1234
|
* ```
|
|
1235
1235
|
*/
|
|
1236
|
-
|
|
1236
|
+
hSet(key: string, fieldValues: {
|
|
1237
1237
|
[field: string]: string;
|
|
1238
1238
|
}): Promise<number>;
|
|
1239
1239
|
/**
|
|
@@ -1248,7 +1248,7 @@ export type RedisClient = {
|
|
|
1248
1248
|
* }
|
|
1249
1249
|
* ```
|
|
1250
1250
|
*/
|
|
1251
|
-
|
|
1251
|
+
hSetNX(key: string, field: string, value: string): Promise<number>;
|
|
1252
1252
|
/**
|
|
1253
1253
|
* Returns the value associated with field in the hash stored at key.
|
|
1254
1254
|
* https://redis.io/commands/hget
|
|
@@ -1264,7 +1264,7 @@ export type RedisClient = {
|
|
|
1264
1264
|
* }
|
|
1265
1265
|
* ```
|
|
1266
1266
|
*/
|
|
1267
|
-
|
|
1267
|
+
hGet(key: string, field: string): Promise<string | undefined>;
|
|
1268
1268
|
/**
|
|
1269
1269
|
* Returns the values associated with fields in the hash stored at key.
|
|
1270
1270
|
* https://redis.io/commands/hmget
|
|
@@ -1280,7 +1280,7 @@ export type RedisClient = {
|
|
|
1280
1280
|
* }
|
|
1281
1281
|
* ```
|
|
1282
1282
|
*/
|
|
1283
|
-
|
|
1283
|
+
hMGet(key: string, fields: string[]): Promise<(string | null)[]>;
|
|
1284
1284
|
/**
|
|
1285
1285
|
* Returns all fields and values of the hash stored at key
|
|
1286
1286
|
* https://redis.io/commands/hgetall
|
|
@@ -1303,7 +1303,7 @@ export type RedisClient = {
|
|
|
1303
1303
|
* }
|
|
1304
1304
|
* ```
|
|
1305
1305
|
*/
|
|
1306
|
-
|
|
1306
|
+
hGetAll(key: string): Promise<Record<string, string>>;
|
|
1307
1307
|
/**
|
|
1308
1308
|
* Removes the specified fields from the hash stored at key.
|
|
1309
1309
|
* https://redis.io/commands/hdel/
|
|
@@ -1319,7 +1319,7 @@ export type RedisClient = {
|
|
|
1319
1319
|
* }
|
|
1320
1320
|
* ```
|
|
1321
1321
|
*/
|
|
1322
|
-
|
|
1322
|
+
hDel(key: string, fields: string[]): Promise<number>;
|
|
1323
1323
|
/**
|
|
1324
1324
|
* Iterates fields of Hash types and their associated values.
|
|
1325
1325
|
* @arg {} key
|
|
@@ -1343,7 +1343,7 @@ export type RedisClient = {
|
|
|
1343
1343
|
* }
|
|
1344
1344
|
* ```
|
|
1345
1345
|
*/
|
|
1346
|
-
|
|
1346
|
+
hScan(key: string, cursor: number, pattern?: string | undefined, count?: number | undefined): Promise<HScanResponse>;
|
|
1347
1347
|
/**
|
|
1348
1348
|
* Returns all field names in the hash stored at key.
|
|
1349
1349
|
* @arg {} key
|
|
@@ -1360,7 +1360,7 @@ export type RedisClient = {
|
|
|
1360
1360
|
* }
|
|
1361
1361
|
* ```
|
|
1362
1362
|
*/
|
|
1363
|
-
|
|
1363
|
+
hKeys(key: string): Promise<string[]>;
|
|
1364
1364
|
/**
|
|
1365
1365
|
* Increments the number stored at field in the hash stored at key by increment.
|
|
1366
1366
|
* https://redis.io/commands/hincrby/
|
|
@@ -1376,7 +1376,7 @@ export type RedisClient = {
|
|
|
1376
1376
|
* }
|
|
1377
1377
|
* ```
|
|
1378
1378
|
*/
|
|
1379
|
-
|
|
1379
|
+
hIncrBy(key: string, field: string, value: number): Promise<number>;
|
|
1380
1380
|
/**
|
|
1381
1381
|
* Returns the number of fields contained in the hash stored at key.
|
|
1382
1382
|
* @arg {} key
|
|
@@ -1395,7 +1395,7 @@ export type RedisClient = {
|
|
|
1395
1395
|
* }
|
|
1396
1396
|
* ```
|
|
1397
1397
|
*/
|
|
1398
|
-
|
|
1398
|
+
hLen(key: string): Promise<number>;
|
|
1399
1399
|
/**
|
|
1400
1400
|
* Performs operations on a redis string treating it as an array of bits.
|
|
1401
1401
|
* Operations available:
|