@upstash/redis 1.34.4 → 1.34.6
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/{chunk-T6D4KAGH.mjs → chunk-56TVFNIH.mjs} +303 -50
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +303 -50
- package/cloudflare.mjs +1 -1
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +303 -50
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +2 -2
- package/nodejs.d.ts +2 -2
- package/nodejs.js +303 -50
- package/nodejs.mjs +1 -1
- package/package.json +1 -1
- package/{zmscore-C3G81zLz.d.mts → zmscore-BdNsMd17.d.mts} +90 -0
- package/{zmscore-C3G81zLz.d.ts → zmscore-BdNsMd17.d.ts} +90 -0
package/cloudflare.js
CHANGED
|
@@ -56,6 +56,43 @@ var UrlError = class extends Error {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
// pkg/util.ts
|
|
60
|
+
function parseRecursive(obj) {
|
|
61
|
+
const parsed = Array.isArray(obj) ? obj.map((o) => {
|
|
62
|
+
try {
|
|
63
|
+
return parseRecursive(o);
|
|
64
|
+
} catch {
|
|
65
|
+
return o;
|
|
66
|
+
}
|
|
67
|
+
}) : JSON.parse(obj);
|
|
68
|
+
if (typeof parsed === "number" && parsed.toString() !== obj) {
|
|
69
|
+
return obj;
|
|
70
|
+
}
|
|
71
|
+
return parsed;
|
|
72
|
+
}
|
|
73
|
+
function parseResponse(result) {
|
|
74
|
+
try {
|
|
75
|
+
return parseRecursive(result);
|
|
76
|
+
} catch {
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function deserializeScanResponse(result) {
|
|
81
|
+
return [result[0], ...parseResponse(result.slice(1))];
|
|
82
|
+
}
|
|
83
|
+
function mergeHeaders(...headers) {
|
|
84
|
+
const merged = {};
|
|
85
|
+
for (const header of headers) {
|
|
86
|
+
if (!header) continue;
|
|
87
|
+
for (const [key, value] of Object.entries(header)) {
|
|
88
|
+
if (value !== void 0 && value !== null) {
|
|
89
|
+
merged[key] = value;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return merged;
|
|
94
|
+
}
|
|
95
|
+
|
|
59
96
|
// pkg/http.ts
|
|
60
97
|
var HttpClient = class {
|
|
61
98
|
baseUrl;
|
|
@@ -104,15 +141,18 @@ var HttpClient = class {
|
|
|
104
141
|
this.headers = merge(this.headers, "Upstash-Telemetry-Sdk", telemetry.sdk);
|
|
105
142
|
}
|
|
106
143
|
async request(req) {
|
|
144
|
+
const requestHeaders = mergeHeaders(this.headers, req.headers ?? {});
|
|
145
|
+
const requestUrl = [this.baseUrl, ...req.path ?? []].join("/");
|
|
146
|
+
const isEventStream = requestHeaders.Accept === "text/event-stream";
|
|
107
147
|
const requestOptions = {
|
|
108
148
|
//@ts-expect-error this should throw due to bun regression
|
|
109
149
|
cache: this.options.cache,
|
|
110
150
|
method: "POST",
|
|
111
|
-
headers:
|
|
151
|
+
headers: requestHeaders,
|
|
112
152
|
body: JSON.stringify(req.body),
|
|
113
153
|
keepalive: this.options.keepAlive,
|
|
114
154
|
agent: this.options.agent,
|
|
115
|
-
signal: this.options.signal,
|
|
155
|
+
signal: req.signal ?? this.options.signal,
|
|
116
156
|
/**
|
|
117
157
|
* Fastly specific
|
|
118
158
|
*/
|
|
@@ -131,7 +171,7 @@ var HttpClient = class {
|
|
|
131
171
|
let error = null;
|
|
132
172
|
for (let i = 0; i <= this.retry.attempts; i++) {
|
|
133
173
|
try {
|
|
134
|
-
res = await fetch(
|
|
174
|
+
res = await fetch(requestUrl, requestOptions);
|
|
135
175
|
break;
|
|
136
176
|
} catch (error_) {
|
|
137
177
|
if (this.options.signal?.aborted) {
|
|
@@ -154,14 +194,46 @@ var HttpClient = class {
|
|
|
154
194
|
if (!res) {
|
|
155
195
|
throw error ?? new Error("Exhausted all retries");
|
|
156
196
|
}
|
|
157
|
-
const body = await res.json();
|
|
158
197
|
if (!res.ok) {
|
|
159
|
-
|
|
198
|
+
const body2 = await res.json();
|
|
199
|
+
throw new UpstashError(`${body2.error}, command was: ${JSON.stringify(req.body)}`);
|
|
160
200
|
}
|
|
161
201
|
if (this.readYourWrites) {
|
|
162
202
|
const headers = res.headers;
|
|
163
203
|
this.upstashSyncToken = headers.get("upstash-sync-token") ?? "";
|
|
164
204
|
}
|
|
205
|
+
if (isEventStream && req && req.onMessage && res.body) {
|
|
206
|
+
const reader = res.body.getReader();
|
|
207
|
+
const decoder = new TextDecoder();
|
|
208
|
+
(async () => {
|
|
209
|
+
try {
|
|
210
|
+
while (true) {
|
|
211
|
+
const { value, done } = await reader.read();
|
|
212
|
+
if (done) break;
|
|
213
|
+
const chunk = decoder.decode(value);
|
|
214
|
+
const lines = chunk.split("\n");
|
|
215
|
+
for (const line of lines) {
|
|
216
|
+
if (line.startsWith("data: ")) {
|
|
217
|
+
const data = line.slice(6);
|
|
218
|
+
req.onMessage?.(data);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
} catch (error2) {
|
|
223
|
+
if (error2 instanceof Error && error2.name === "AbortError") {
|
|
224
|
+
} else {
|
|
225
|
+
console.error("Stream reading error:", error2);
|
|
226
|
+
}
|
|
227
|
+
} finally {
|
|
228
|
+
try {
|
|
229
|
+
await reader.cancel();
|
|
230
|
+
} catch {
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
})();
|
|
234
|
+
return { result: 1 };
|
|
235
|
+
}
|
|
236
|
+
const body = await res.json();
|
|
165
237
|
if (this.readYourWrites) {
|
|
166
238
|
const headers = res.headers;
|
|
167
239
|
this.upstashSyncToken = headers.get("upstash-sync-token") ?? "";
|
|
@@ -311,31 +383,6 @@ var AutoPipelineExecutor = class {
|
|
|
311
383
|
}
|
|
312
384
|
};
|
|
313
385
|
|
|
314
|
-
// pkg/util.ts
|
|
315
|
-
function parseRecursive(obj) {
|
|
316
|
-
const parsed = Array.isArray(obj) ? obj.map((o) => {
|
|
317
|
-
try {
|
|
318
|
-
return parseRecursive(o);
|
|
319
|
-
} catch {
|
|
320
|
-
return o;
|
|
321
|
-
}
|
|
322
|
-
}) : JSON.parse(obj);
|
|
323
|
-
if (typeof parsed === "number" && parsed.toString() !== obj) {
|
|
324
|
-
return obj;
|
|
325
|
-
}
|
|
326
|
-
return parsed;
|
|
327
|
-
}
|
|
328
|
-
function parseResponse(result) {
|
|
329
|
-
try {
|
|
330
|
-
return parseRecursive(result);
|
|
331
|
-
} catch {
|
|
332
|
-
return result;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
function deserializeScanResponse(result) {
|
|
336
|
-
return [result[0], ...parseResponse(result.slice(1))];
|
|
337
|
-
}
|
|
338
|
-
|
|
339
386
|
// pkg/commands/command.ts
|
|
340
387
|
var defaultSerializer = (c) => {
|
|
341
388
|
switch (typeof c) {
|
|
@@ -353,6 +400,11 @@ var Command = class {
|
|
|
353
400
|
command;
|
|
354
401
|
serialize;
|
|
355
402
|
deserialize;
|
|
403
|
+
headers;
|
|
404
|
+
path;
|
|
405
|
+
onMessage;
|
|
406
|
+
isStreaming;
|
|
407
|
+
signal;
|
|
356
408
|
/**
|
|
357
409
|
* Create a new command instance.
|
|
358
410
|
*
|
|
@@ -362,6 +414,11 @@ var Command = class {
|
|
|
362
414
|
this.serialize = defaultSerializer;
|
|
363
415
|
this.deserialize = opts?.automaticDeserialization === void 0 || opts.automaticDeserialization ? opts?.deserialize ?? parseResponse : (x) => x;
|
|
364
416
|
this.command = command.map((c) => this.serialize(c));
|
|
417
|
+
this.headers = opts?.headers;
|
|
418
|
+
this.path = opts?.path;
|
|
419
|
+
this.onMessage = opts?.streamOptions?.onMessage;
|
|
420
|
+
this.isStreaming = opts?.streamOptions?.isStreaming ?? false;
|
|
421
|
+
this.signal = opts?.streamOptions?.signal;
|
|
365
422
|
if (opts?.latencyLogging) {
|
|
366
423
|
const originalExec = this.exec.bind(this);
|
|
367
424
|
this.exec = async (client) => {
|
|
@@ -382,7 +439,12 @@ var Command = class {
|
|
|
382
439
|
async exec(client) {
|
|
383
440
|
const { result, error } = await client.request({
|
|
384
441
|
body: this.command,
|
|
385
|
-
|
|
442
|
+
path: this.path,
|
|
443
|
+
upstashSyncToken: client.upstashSyncToken,
|
|
444
|
+
headers: this.headers,
|
|
445
|
+
onMessage: this.onMessage,
|
|
446
|
+
isStreaming: this.isStreaming,
|
|
447
|
+
signal: this.signal
|
|
386
448
|
});
|
|
387
449
|
if (error) {
|
|
388
450
|
throw new UpstashError(error);
|
|
@@ -810,9 +872,9 @@ function deserialize(result) {
|
|
|
810
872
|
return null;
|
|
811
873
|
}
|
|
812
874
|
const obj = {};
|
|
813
|
-
|
|
814
|
-
const key = result
|
|
815
|
-
const value = result
|
|
875
|
+
for (let i = 0; i < result.length; i += 2) {
|
|
876
|
+
const key = result[i];
|
|
877
|
+
const value = result[i + 1];
|
|
816
878
|
try {
|
|
817
879
|
const valueIsNumberAndNotSafeInteger = !Number.isNaN(Number(value)) && !Number.isSafeInteger(Number(value));
|
|
818
880
|
obj[key] = valueIsNumberAndNotSafeInteger ? value : JSON.parse(value);
|
|
@@ -896,9 +958,9 @@ function deserialize3(result) {
|
|
|
896
958
|
return null;
|
|
897
959
|
}
|
|
898
960
|
const obj = {};
|
|
899
|
-
|
|
900
|
-
const key = result
|
|
901
|
-
const value = result
|
|
961
|
+
for (let i = 0; i < result.length; i += 2) {
|
|
962
|
+
const key = result[i];
|
|
963
|
+
const value = result[i + 1];
|
|
902
964
|
try {
|
|
903
965
|
obj[key] = JSON.parse(value);
|
|
904
966
|
} catch {
|
|
@@ -1871,15 +1933,15 @@ var XPendingCommand = class extends Command {
|
|
|
1871
1933
|
function deserialize4(result) {
|
|
1872
1934
|
const obj = {};
|
|
1873
1935
|
for (const e of result) {
|
|
1874
|
-
|
|
1875
|
-
const streamId = e
|
|
1876
|
-
const entries = e
|
|
1936
|
+
for (let i = 0; i < e.length; i += 2) {
|
|
1937
|
+
const streamId = e[i];
|
|
1938
|
+
const entries = e[i + 1];
|
|
1877
1939
|
if (!(streamId in obj)) {
|
|
1878
1940
|
obj[streamId] = {};
|
|
1879
1941
|
}
|
|
1880
|
-
|
|
1881
|
-
const field = entries
|
|
1882
|
-
const value = entries
|
|
1942
|
+
for (let j = 0; j < entries.length; j += 2) {
|
|
1943
|
+
const field = entries[j];
|
|
1944
|
+
const value = entries[j + 1];
|
|
1883
1945
|
try {
|
|
1884
1946
|
obj[streamId][field] = JSON.parse(value);
|
|
1885
1947
|
} catch {
|
|
@@ -1968,15 +2030,15 @@ var XRevRangeCommand = class extends Command {
|
|
|
1968
2030
|
function deserialize5(result) {
|
|
1969
2031
|
const obj = {};
|
|
1970
2032
|
for (const e of result) {
|
|
1971
|
-
|
|
1972
|
-
const streamId = e
|
|
1973
|
-
const entries = e
|
|
2033
|
+
for (let i = 0; i < e.length; i += 2) {
|
|
2034
|
+
const streamId = e[i];
|
|
2035
|
+
const entries = e[i + 1];
|
|
1974
2036
|
if (!(streamId in obj)) {
|
|
1975
2037
|
obj[streamId] = {};
|
|
1976
2038
|
}
|
|
1977
|
-
|
|
1978
|
-
const field = entries
|
|
1979
|
-
const value = entries
|
|
2039
|
+
for (let j = 0; j < entries.length; j += 2) {
|
|
2040
|
+
const field = entries[j];
|
|
2041
|
+
const value = entries[j + 1];
|
|
1980
2042
|
try {
|
|
1981
2043
|
obj[streamId][field] = JSON.parse(value);
|
|
1982
2044
|
} catch {
|
|
@@ -2235,6 +2297,183 @@ var ZUnionStoreCommand = class extends Command {
|
|
|
2235
2297
|
}
|
|
2236
2298
|
};
|
|
2237
2299
|
|
|
2300
|
+
// pkg/commands/psubscribe.ts
|
|
2301
|
+
var PSubscribeCommand = class extends Command {
|
|
2302
|
+
constructor(cmd, opts) {
|
|
2303
|
+
const sseHeaders = {
|
|
2304
|
+
Accept: "text/event-stream",
|
|
2305
|
+
"Cache-Control": "no-cache",
|
|
2306
|
+
Connection: "keep-alive"
|
|
2307
|
+
};
|
|
2308
|
+
super([], {
|
|
2309
|
+
...opts,
|
|
2310
|
+
headers: sseHeaders,
|
|
2311
|
+
path: ["psubscribe", ...cmd],
|
|
2312
|
+
streamOptions: {
|
|
2313
|
+
isStreaming: true,
|
|
2314
|
+
onMessage: opts?.streamOptions?.onMessage,
|
|
2315
|
+
signal: opts?.streamOptions?.signal
|
|
2316
|
+
}
|
|
2317
|
+
});
|
|
2318
|
+
}
|
|
2319
|
+
};
|
|
2320
|
+
|
|
2321
|
+
// pkg/commands/subscribe.ts
|
|
2322
|
+
var Subscriber = class extends EventTarget {
|
|
2323
|
+
subscriptions;
|
|
2324
|
+
client;
|
|
2325
|
+
listeners;
|
|
2326
|
+
constructor(client, channels, isPattern = false) {
|
|
2327
|
+
super();
|
|
2328
|
+
this.client = client;
|
|
2329
|
+
this.subscriptions = /* @__PURE__ */ new Map();
|
|
2330
|
+
this.listeners = /* @__PURE__ */ new Map();
|
|
2331
|
+
for (const channel of channels) {
|
|
2332
|
+
if (isPattern) {
|
|
2333
|
+
this.subscribeToPattern(channel);
|
|
2334
|
+
} else {
|
|
2335
|
+
this.subscribeToChannel(channel);
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
subscribeToChannel(channel) {
|
|
2340
|
+
const controller = new AbortController();
|
|
2341
|
+
const command = new SubscribeCommand([channel], {
|
|
2342
|
+
streamOptions: {
|
|
2343
|
+
signal: controller.signal,
|
|
2344
|
+
onMessage: (data) => this.handleMessage(data, false)
|
|
2345
|
+
}
|
|
2346
|
+
});
|
|
2347
|
+
command.exec(this.client).catch((error) => {
|
|
2348
|
+
if (error.name !== "AbortError") {
|
|
2349
|
+
this.dispatchToListeners("error", error);
|
|
2350
|
+
}
|
|
2351
|
+
});
|
|
2352
|
+
this.subscriptions.set(channel, {
|
|
2353
|
+
command,
|
|
2354
|
+
controller,
|
|
2355
|
+
isPattern: false
|
|
2356
|
+
});
|
|
2357
|
+
}
|
|
2358
|
+
subscribeToPattern(pattern) {
|
|
2359
|
+
const controller = new AbortController();
|
|
2360
|
+
const command = new PSubscribeCommand([pattern], {
|
|
2361
|
+
streamOptions: {
|
|
2362
|
+
signal: controller.signal,
|
|
2363
|
+
onMessage: (data) => this.handleMessage(data, true)
|
|
2364
|
+
}
|
|
2365
|
+
});
|
|
2366
|
+
command.exec(this.client).catch((error) => {
|
|
2367
|
+
if (error.name !== "AbortError") {
|
|
2368
|
+
this.dispatchToListeners("error", error);
|
|
2369
|
+
}
|
|
2370
|
+
});
|
|
2371
|
+
this.subscriptions.set(pattern, {
|
|
2372
|
+
command,
|
|
2373
|
+
controller,
|
|
2374
|
+
isPattern: true
|
|
2375
|
+
});
|
|
2376
|
+
}
|
|
2377
|
+
handleMessage(data, isPattern) {
|
|
2378
|
+
const messageData = data.replace(/^data:\s*/, "");
|
|
2379
|
+
const firstCommaIndex = messageData.indexOf(",");
|
|
2380
|
+
const secondCommaIndex = messageData.indexOf(",", firstCommaIndex + 1);
|
|
2381
|
+
const thirdCommaIndex = isPattern ? messageData.indexOf(",", secondCommaIndex + 1) : -1;
|
|
2382
|
+
if (firstCommaIndex !== -1 && secondCommaIndex !== -1) {
|
|
2383
|
+
const type = messageData.slice(0, firstCommaIndex);
|
|
2384
|
+
if (isPattern && type === "pmessage" && thirdCommaIndex !== -1) {
|
|
2385
|
+
const pattern = messageData.slice(firstCommaIndex + 1, secondCommaIndex);
|
|
2386
|
+
const channel = messageData.slice(secondCommaIndex + 1, thirdCommaIndex);
|
|
2387
|
+
const messageStr = messageData.slice(thirdCommaIndex + 1);
|
|
2388
|
+
try {
|
|
2389
|
+
const message = JSON.parse(messageStr);
|
|
2390
|
+
this.dispatchToListeners("pmessage", { pattern, channel, message });
|
|
2391
|
+
this.dispatchToListeners(`pmessage:${pattern}`, { pattern, channel, message });
|
|
2392
|
+
} catch (error) {
|
|
2393
|
+
this.dispatchToListeners("error", new Error(`Failed to parse message: ${error}`));
|
|
2394
|
+
}
|
|
2395
|
+
} else {
|
|
2396
|
+
const channel = messageData.slice(firstCommaIndex + 1, secondCommaIndex);
|
|
2397
|
+
const messageStr = messageData.slice(secondCommaIndex + 1);
|
|
2398
|
+
try {
|
|
2399
|
+
if (type === "subscribe" || type === "psubscribe" || type === "unsubscribe" || type === "punsubscribe") {
|
|
2400
|
+
const count = Number.parseInt(messageStr);
|
|
2401
|
+
this.dispatchToListeners(type, count);
|
|
2402
|
+
} else {
|
|
2403
|
+
const message = JSON.parse(messageStr);
|
|
2404
|
+
this.dispatchToListeners(type, { channel, message });
|
|
2405
|
+
this.dispatchToListeners(`${type}:${channel}`, { channel, message });
|
|
2406
|
+
}
|
|
2407
|
+
} catch (error) {
|
|
2408
|
+
this.dispatchToListeners("error", new Error(`Failed to parse message: ${error}`));
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
dispatchToListeners(type, data) {
|
|
2414
|
+
const listeners = this.listeners.get(type);
|
|
2415
|
+
if (listeners) {
|
|
2416
|
+
for (const listener of listeners) {
|
|
2417
|
+
listener(data);
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
on(type, listener) {
|
|
2422
|
+
if (!this.listeners.has(type)) {
|
|
2423
|
+
this.listeners.set(type, /* @__PURE__ */ new Set());
|
|
2424
|
+
}
|
|
2425
|
+
this.listeners.get(type)?.add(listener);
|
|
2426
|
+
}
|
|
2427
|
+
removeAllListeners() {
|
|
2428
|
+
this.listeners.clear();
|
|
2429
|
+
}
|
|
2430
|
+
async unsubscribe(channels) {
|
|
2431
|
+
if (channels) {
|
|
2432
|
+
for (const channel of channels) {
|
|
2433
|
+
const subscription = this.subscriptions.get(channel);
|
|
2434
|
+
if (subscription) {
|
|
2435
|
+
try {
|
|
2436
|
+
subscription.controller.abort();
|
|
2437
|
+
} catch {
|
|
2438
|
+
}
|
|
2439
|
+
this.subscriptions.delete(channel);
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
} else {
|
|
2443
|
+
for (const subscription of this.subscriptions.values()) {
|
|
2444
|
+
try {
|
|
2445
|
+
subscription.controller.abort();
|
|
2446
|
+
} catch {
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
this.subscriptions.clear();
|
|
2450
|
+
this.removeAllListeners();
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
getSubscribedChannels() {
|
|
2454
|
+
return [...this.subscriptions.keys()];
|
|
2455
|
+
}
|
|
2456
|
+
};
|
|
2457
|
+
var SubscribeCommand = class extends Command {
|
|
2458
|
+
constructor(cmd, opts) {
|
|
2459
|
+
const sseHeaders = {
|
|
2460
|
+
Accept: "text/event-stream",
|
|
2461
|
+
"Cache-Control": "no-cache",
|
|
2462
|
+
Connection: "keep-alive"
|
|
2463
|
+
};
|
|
2464
|
+
super([], {
|
|
2465
|
+
...opts,
|
|
2466
|
+
headers: sseHeaders,
|
|
2467
|
+
path: ["subscribe", ...cmd],
|
|
2468
|
+
streamOptions: {
|
|
2469
|
+
isStreaming: true,
|
|
2470
|
+
onMessage: opts?.streamOptions?.onMessage,
|
|
2471
|
+
signal: opts?.streamOptions?.signal
|
|
2472
|
+
}
|
|
2473
|
+
});
|
|
2474
|
+
}
|
|
2475
|
+
};
|
|
2476
|
+
|
|
2238
2477
|
// pkg/commands/zdiffstore.ts
|
|
2239
2478
|
var ZDiffStoreCommand = class extends Command {
|
|
2240
2479
|
constructor(cmd, opts) {
|
|
@@ -3562,6 +3801,13 @@ var Redis = class {
|
|
|
3562
3801
|
* @see https://redis.io/commands/psetex
|
|
3563
3802
|
*/
|
|
3564
3803
|
psetex = (key, ttl, value) => new PSetEXCommand([key, ttl, value], this.opts).exec(this.client);
|
|
3804
|
+
/**
|
|
3805
|
+
* @see https://redis.io/commands/psubscribe
|
|
3806
|
+
*/
|
|
3807
|
+
psubscribe = (patterns) => {
|
|
3808
|
+
const patternArray = Array.isArray(patterns) ? patterns : [patterns];
|
|
3809
|
+
return new Subscriber(this.client, patternArray, true);
|
|
3810
|
+
};
|
|
3565
3811
|
/**
|
|
3566
3812
|
* @see https://redis.io/commands/pttl
|
|
3567
3813
|
*/
|
|
@@ -3690,6 +3936,13 @@ var Redis = class {
|
|
|
3690
3936
|
* @see https://redis.io/commands/strlen
|
|
3691
3937
|
*/
|
|
3692
3938
|
strlen = (...args) => new StrLenCommand(args, this.opts).exec(this.client);
|
|
3939
|
+
/**
|
|
3940
|
+
* @see https://redis.io/commands/subscribe
|
|
3941
|
+
*/
|
|
3942
|
+
subscribe = (channels) => {
|
|
3943
|
+
const channelArray = Array.isArray(channels) ? channels : [channels];
|
|
3944
|
+
return new Subscriber(this.client, channelArray);
|
|
3945
|
+
};
|
|
3693
3946
|
/**
|
|
3694
3947
|
* @see https://redis.io/commands/sunion
|
|
3695
3948
|
*/
|
|
@@ -3871,7 +4124,7 @@ var Redis = class {
|
|
|
3871
4124
|
};
|
|
3872
4125
|
|
|
3873
4126
|
// version.ts
|
|
3874
|
-
var VERSION = "v1.34.
|
|
4127
|
+
var VERSION = "v1.34.6";
|
|
3875
4128
|
|
|
3876
4129
|
// platforms/cloudflare.ts
|
|
3877
4130
|
var Redis2 = class _Redis extends Redis {
|
package/cloudflare.mjs
CHANGED
package/fastly.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand, f as BitOpCommand, g as BitPosCommand, C as CopyCommand, D as DBSizeCommand, i as DecrByCommand, h as DecrCommand, j as DelCommand, E as EchoCommand, k as EvalCommand, l as EvalshaCommand, m as ExistsCommand, o as ExpireAtCommand, n as ExpireCommand, F as FlushAllCommand, p as FlushDBCommand, G as GeoAddCommand, q as GeoAddCommandOptions, s as GeoDistCommand, t as GeoHashCommand, r as GeoMember, u as GeoPosCommand, v as GeoSearchCommand, w as GeoSearchStoreCommand, y as GetBitCommand, x as GetCommand, z as GetDelCommand, H as GetExCommand, I as GetRangeCommand, J as GetSetCommand, K as HDelCommand, L as HExistsCommand, N as HGetAllCommand, M as HGetCommand, O as HIncrByCommand, Q as HIncrByFloatCommand, S as HKeysCommand, T as HLenCommand, V as HMGetCommand, W as HMSetCommand, X as HRandFieldCommand, Y as HScanCommand, Z as HSetCommand, _ as HSetNXCommand, $ as HStrLenCommand, a0 as HValsCommand, a2 as IncrByCommand, a3 as IncrByFloatCommand, a1 as IncrCommand, a4 as JsonArrAppendCommand, a5 as JsonArrIndexCommand, a6 as JsonArrInsertCommand, a7 as JsonArrLenCommand, a8 as JsonArrPopCommand, a9 as JsonArrTrimCommand, aa as JsonClearCommand, ab as JsonDelCommand, ac as JsonForgetCommand, ad as JsonGetCommand, ae as JsonMGetCommand, af as JsonNumIncrByCommand, ag as JsonNumMultByCommand, ah as JsonObjKeysCommand, ai as JsonObjLenCommand, aj as JsonRespCommand, ak as JsonSetCommand, al as JsonStrAppendCommand, am as JsonStrLenCommand, an as JsonToggleCommand, ao as JsonTypeCommand, ap as KeysCommand, aq as LIndexCommand, ar as LInsertCommand, as as LLenCommand, at as LMoveCommand, au as LPopCommand, av as LPushCommand, aw as LPushXCommand, ax as LRangeCommand, ay as LRemCommand, az as LSetCommand, aA as LTrimCommand, aB as MGetCommand, aC as MSetCommand, aD as MSetNXCommand, aG as PExpireAtCommand, aF as PExpireCommand, aI as PSetEXCommand, aJ as PTtlCommand, aE as PersistCommand, aH as PingCommand, P as Pipeline, aK as PublishCommand, aO as RPopCommand, aP as RPushCommand, aQ as RPushXCommand, aL as RandomKeyCommand, aM as RenameCommand, aN as RenameNXCommand, d as Requester, aR as SAddCommand, aU as SCardCommand, aY as SDiffCommand, aZ as SDiffStoreCommand, b4 as SInterCommand, b5 as SInterStoreCommand, b6 as SIsMemberCommand, b8 as SMIsMemberCommand, b7 as SMembersCommand, b9 as SMoveCommand, ba as SPopCommand, bb as SRandMemberCommand, bc as SRemCommand, bd as SScanCommand, bf as SUnionCommand, bg as SUnionStoreCommand, aS as ScanCommand, aT as ScanCommandOptions, bp as ScoreMember, aV as ScriptExistsCommand, aW as ScriptFlushCommand, aX as ScriptLoadCommand, b0 as SetBitCommand, a_ as SetCommand, a$ as SetCommandOptions, b1 as SetExCommand, b2 as SetNxCommand, b3 as SetRangeCommand, be as StrLenCommand, bh as TimeCommand, bi as TouchCommand, bj as TtlCommand, bk as Type, bl as TypeCommand, bm as UnlinkCommand, U as UpstashRequest, c as UpstashResponse, bn as XAddCommand, bo as XRangeCommand, br as ZAddCommand, bq as ZAddCommandOptions, bs as ZCardCommand, bt as ZCountCommand, bu as ZDiffStoreCommand, bv as ZIncrByCommand, bw as ZInterStoreCommand, bx as ZInterStoreCommandOptions, by as ZLexCountCommand, bz as ZMScoreCommand, bA as ZPopMaxCommand, bB as ZPopMinCommand, bC as ZRangeCommand, bD as ZRangeCommandOptions, bE as ZRankCommand, bF as ZRemCommand, bG as ZRemRangeByLexCommand, bH as ZRemRangeByRankCommand, bI as ZRemRangeByScoreCommand, bJ as ZRevRankCommand, bK as ZScanCommand, bL as ZScoreCommand, bM as ZUnionCommand, bN as ZUnionCommandOptions, bO as ZUnionStoreCommand, bP as ZUnionStoreCommandOptions, e as errors } from './zmscore-
|
|
1
|
+
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-BdNsMd17.mjs';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, f as BitOpCommand, g as BitPosCommand, C as CopyCommand, D as DBSizeCommand, i as DecrByCommand, h as DecrCommand, j as DelCommand, E as EchoCommand, k as EvalCommand, l as EvalshaCommand, m as ExistsCommand, o as ExpireAtCommand, n as ExpireCommand, F as FlushAllCommand, p as FlushDBCommand, G as GeoAddCommand, q as GeoAddCommandOptions, s as GeoDistCommand, t as GeoHashCommand, r as GeoMember, u as GeoPosCommand, v as GeoSearchCommand, w as GeoSearchStoreCommand, y as GetBitCommand, x as GetCommand, z as GetDelCommand, H as GetExCommand, I as GetRangeCommand, J as GetSetCommand, K as HDelCommand, L as HExistsCommand, N as HGetAllCommand, M as HGetCommand, O as HIncrByCommand, Q as HIncrByFloatCommand, S as HKeysCommand, T as HLenCommand, V as HMGetCommand, W as HMSetCommand, X as HRandFieldCommand, Y as HScanCommand, Z as HSetCommand, _ as HSetNXCommand, $ as HStrLenCommand, a0 as HValsCommand, a2 as IncrByCommand, a3 as IncrByFloatCommand, a1 as IncrCommand, a4 as JsonArrAppendCommand, a5 as JsonArrIndexCommand, a6 as JsonArrInsertCommand, a7 as JsonArrLenCommand, a8 as JsonArrPopCommand, a9 as JsonArrTrimCommand, aa as JsonClearCommand, ab as JsonDelCommand, ac as JsonForgetCommand, ad as JsonGetCommand, ae as JsonMGetCommand, af as JsonNumIncrByCommand, ag as JsonNumMultByCommand, ah as JsonObjKeysCommand, ai as JsonObjLenCommand, aj as JsonRespCommand, ak as JsonSetCommand, al as JsonStrAppendCommand, am as JsonStrLenCommand, an as JsonToggleCommand, ao as JsonTypeCommand, ap as KeysCommand, aq as LIndexCommand, ar as LInsertCommand, as as LLenCommand, at as LMoveCommand, au as LPopCommand, av as LPushCommand, aw as LPushXCommand, ax as LRangeCommand, ay as LRemCommand, az as LSetCommand, aA as LTrimCommand, aB as MGetCommand, aC as MSetCommand, aD as MSetNXCommand, aG as PExpireAtCommand, aF as PExpireCommand, aI as PSetEXCommand, aJ as PTtlCommand, aE as PersistCommand, aH as PingCommand, P as Pipeline, aK as PublishCommand, aO as RPopCommand, aP as RPushCommand, aQ as RPushXCommand, aL as RandomKeyCommand, aM as RenameCommand, aN as RenameNXCommand, d as Requester, aR as SAddCommand, aU as SCardCommand, aY as SDiffCommand, aZ as SDiffStoreCommand, b4 as SInterCommand, b5 as SInterStoreCommand, b6 as SIsMemberCommand, b8 as SMIsMemberCommand, b7 as SMembersCommand, b9 as SMoveCommand, ba as SPopCommand, bb as SRandMemberCommand, bc as SRemCommand, bd as SScanCommand, bf as SUnionCommand, bg as SUnionStoreCommand, aS as ScanCommand, aT as ScanCommandOptions, bp as ScoreMember, aV as ScriptExistsCommand, aW as ScriptFlushCommand, aX as ScriptLoadCommand, b0 as SetBitCommand, a_ as SetCommand, a$ as SetCommandOptions, b1 as SetExCommand, b2 as SetNxCommand, b3 as SetRangeCommand, be as StrLenCommand, bh as TimeCommand, bi as TouchCommand, bj as TtlCommand, bk as Type, bl as TypeCommand, bm as UnlinkCommand, U as UpstashRequest, c as UpstashResponse, bn as XAddCommand, bo as XRangeCommand, br as ZAddCommand, bq as ZAddCommandOptions, bs as ZCardCommand, bt as ZCountCommand, bu as ZDiffStoreCommand, bv as ZIncrByCommand, bw as ZInterStoreCommand, bx as ZInterStoreCommandOptions, by as ZLexCountCommand, bz as ZMScoreCommand, bA as ZPopMaxCommand, bB as ZPopMinCommand, bC as ZRangeCommand, bD as ZRangeCommandOptions, bE as ZRankCommand, bF as ZRemCommand, bG as ZRemRangeByLexCommand, bH as ZRemRangeByRankCommand, bI as ZRemRangeByScoreCommand, bJ as ZRevRankCommand, bK as ZScanCommand, bL as ZScoreCommand, bM as ZUnionCommand, bN as ZUnionCommandOptions, bO as ZUnionStoreCommand, bP as ZUnionStoreCommandOptions, e as errors } from './zmscore-BdNsMd17.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Connection credentials for upstash redis.
|
package/fastly.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-
|
|
2
|
-
export { A as AppendCommand, B as BitCountCommand, f as BitOpCommand, g as BitPosCommand, C as CopyCommand, D as DBSizeCommand, i as DecrByCommand, h as DecrCommand, j as DelCommand, E as EchoCommand, k as EvalCommand, l as EvalshaCommand, m as ExistsCommand, o as ExpireAtCommand, n as ExpireCommand, F as FlushAllCommand, p as FlushDBCommand, G as GeoAddCommand, q as GeoAddCommandOptions, s as GeoDistCommand, t as GeoHashCommand, r as GeoMember, u as GeoPosCommand, v as GeoSearchCommand, w as GeoSearchStoreCommand, y as GetBitCommand, x as GetCommand, z as GetDelCommand, H as GetExCommand, I as GetRangeCommand, J as GetSetCommand, K as HDelCommand, L as HExistsCommand, N as HGetAllCommand, M as HGetCommand, O as HIncrByCommand, Q as HIncrByFloatCommand, S as HKeysCommand, T as HLenCommand, V as HMGetCommand, W as HMSetCommand, X as HRandFieldCommand, Y as HScanCommand, Z as HSetCommand, _ as HSetNXCommand, $ as HStrLenCommand, a0 as HValsCommand, a2 as IncrByCommand, a3 as IncrByFloatCommand, a1 as IncrCommand, a4 as JsonArrAppendCommand, a5 as JsonArrIndexCommand, a6 as JsonArrInsertCommand, a7 as JsonArrLenCommand, a8 as JsonArrPopCommand, a9 as JsonArrTrimCommand, aa as JsonClearCommand, ab as JsonDelCommand, ac as JsonForgetCommand, ad as JsonGetCommand, ae as JsonMGetCommand, af as JsonNumIncrByCommand, ag as JsonNumMultByCommand, ah as JsonObjKeysCommand, ai as JsonObjLenCommand, aj as JsonRespCommand, ak as JsonSetCommand, al as JsonStrAppendCommand, am as JsonStrLenCommand, an as JsonToggleCommand, ao as JsonTypeCommand, ap as KeysCommand, aq as LIndexCommand, ar as LInsertCommand, as as LLenCommand, at as LMoveCommand, au as LPopCommand, av as LPushCommand, aw as LPushXCommand, ax as LRangeCommand, ay as LRemCommand, az as LSetCommand, aA as LTrimCommand, aB as MGetCommand, aC as MSetCommand, aD as MSetNXCommand, aG as PExpireAtCommand, aF as PExpireCommand, aI as PSetEXCommand, aJ as PTtlCommand, aE as PersistCommand, aH as PingCommand, P as Pipeline, aK as PublishCommand, aO as RPopCommand, aP as RPushCommand, aQ as RPushXCommand, aL as RandomKeyCommand, aM as RenameCommand, aN as RenameNXCommand, d as Requester, aR as SAddCommand, aU as SCardCommand, aY as SDiffCommand, aZ as SDiffStoreCommand, b4 as SInterCommand, b5 as SInterStoreCommand, b6 as SIsMemberCommand, b8 as SMIsMemberCommand, b7 as SMembersCommand, b9 as SMoveCommand, ba as SPopCommand, bb as SRandMemberCommand, bc as SRemCommand, bd as SScanCommand, bf as SUnionCommand, bg as SUnionStoreCommand, aS as ScanCommand, aT as ScanCommandOptions, bp as ScoreMember, aV as ScriptExistsCommand, aW as ScriptFlushCommand, aX as ScriptLoadCommand, b0 as SetBitCommand, a_ as SetCommand, a$ as SetCommandOptions, b1 as SetExCommand, b2 as SetNxCommand, b3 as SetRangeCommand, be as StrLenCommand, bh as TimeCommand, bi as TouchCommand, bj as TtlCommand, bk as Type, bl as TypeCommand, bm as UnlinkCommand, U as UpstashRequest, c as UpstashResponse, bn as XAddCommand, bo as XRangeCommand, br as ZAddCommand, bq as ZAddCommandOptions, bs as ZCardCommand, bt as ZCountCommand, bu as ZDiffStoreCommand, bv as ZIncrByCommand, bw as ZInterStoreCommand, bx as ZInterStoreCommandOptions, by as ZLexCountCommand, bz as ZMScoreCommand, bA as ZPopMaxCommand, bB as ZPopMinCommand, bC as ZRangeCommand, bD as ZRangeCommandOptions, bE as ZRankCommand, bF as ZRemCommand, bG as ZRemRangeByLexCommand, bH as ZRemRangeByRankCommand, bI as ZRemRangeByScoreCommand, bJ as ZRevRankCommand, bK as ZScanCommand, bL as ZScoreCommand, bM as ZUnionCommand, bN as ZUnionCommandOptions, bO as ZUnionStoreCommand, bP as ZUnionStoreCommandOptions, e as errors } from './zmscore-
|
|
1
|
+
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-BdNsMd17.js';
|
|
2
|
+
export { A as AppendCommand, B as BitCountCommand, f as BitOpCommand, g as BitPosCommand, C as CopyCommand, D as DBSizeCommand, i as DecrByCommand, h as DecrCommand, j as DelCommand, E as EchoCommand, k as EvalCommand, l as EvalshaCommand, m as ExistsCommand, o as ExpireAtCommand, n as ExpireCommand, F as FlushAllCommand, p as FlushDBCommand, G as GeoAddCommand, q as GeoAddCommandOptions, s as GeoDistCommand, t as GeoHashCommand, r as GeoMember, u as GeoPosCommand, v as GeoSearchCommand, w as GeoSearchStoreCommand, y as GetBitCommand, x as GetCommand, z as GetDelCommand, H as GetExCommand, I as GetRangeCommand, J as GetSetCommand, K as HDelCommand, L as HExistsCommand, N as HGetAllCommand, M as HGetCommand, O as HIncrByCommand, Q as HIncrByFloatCommand, S as HKeysCommand, T as HLenCommand, V as HMGetCommand, W as HMSetCommand, X as HRandFieldCommand, Y as HScanCommand, Z as HSetCommand, _ as HSetNXCommand, $ as HStrLenCommand, a0 as HValsCommand, a2 as IncrByCommand, a3 as IncrByFloatCommand, a1 as IncrCommand, a4 as JsonArrAppendCommand, a5 as JsonArrIndexCommand, a6 as JsonArrInsertCommand, a7 as JsonArrLenCommand, a8 as JsonArrPopCommand, a9 as JsonArrTrimCommand, aa as JsonClearCommand, ab as JsonDelCommand, ac as JsonForgetCommand, ad as JsonGetCommand, ae as JsonMGetCommand, af as JsonNumIncrByCommand, ag as JsonNumMultByCommand, ah as JsonObjKeysCommand, ai as JsonObjLenCommand, aj as JsonRespCommand, ak as JsonSetCommand, al as JsonStrAppendCommand, am as JsonStrLenCommand, an as JsonToggleCommand, ao as JsonTypeCommand, ap as KeysCommand, aq as LIndexCommand, ar as LInsertCommand, as as LLenCommand, at as LMoveCommand, au as LPopCommand, av as LPushCommand, aw as LPushXCommand, ax as LRangeCommand, ay as LRemCommand, az as LSetCommand, aA as LTrimCommand, aB as MGetCommand, aC as MSetCommand, aD as MSetNXCommand, aG as PExpireAtCommand, aF as PExpireCommand, aI as PSetEXCommand, aJ as PTtlCommand, aE as PersistCommand, aH as PingCommand, P as Pipeline, aK as PublishCommand, aO as RPopCommand, aP as RPushCommand, aQ as RPushXCommand, aL as RandomKeyCommand, aM as RenameCommand, aN as RenameNXCommand, d as Requester, aR as SAddCommand, aU as SCardCommand, aY as SDiffCommand, aZ as SDiffStoreCommand, b4 as SInterCommand, b5 as SInterStoreCommand, b6 as SIsMemberCommand, b8 as SMIsMemberCommand, b7 as SMembersCommand, b9 as SMoveCommand, ba as SPopCommand, bb as SRandMemberCommand, bc as SRemCommand, bd as SScanCommand, bf as SUnionCommand, bg as SUnionStoreCommand, aS as ScanCommand, aT as ScanCommandOptions, bp as ScoreMember, aV as ScriptExistsCommand, aW as ScriptFlushCommand, aX as ScriptLoadCommand, b0 as SetBitCommand, a_ as SetCommand, a$ as SetCommandOptions, b1 as SetExCommand, b2 as SetNxCommand, b3 as SetRangeCommand, be as StrLenCommand, bh as TimeCommand, bi as TouchCommand, bj as TtlCommand, bk as Type, bl as TypeCommand, bm as UnlinkCommand, U as UpstashRequest, c as UpstashResponse, bn as XAddCommand, bo as XRangeCommand, br as ZAddCommand, bq as ZAddCommandOptions, bs as ZCardCommand, bt as ZCountCommand, bu as ZDiffStoreCommand, bv as ZIncrByCommand, bw as ZInterStoreCommand, bx as ZInterStoreCommandOptions, by as ZLexCountCommand, bz as ZMScoreCommand, bA as ZPopMaxCommand, bB as ZPopMinCommand, bC as ZRangeCommand, bD as ZRangeCommandOptions, bE as ZRankCommand, bF as ZRemCommand, bG as ZRemRangeByLexCommand, bH as ZRemRangeByRankCommand, bI as ZRemRangeByScoreCommand, bJ as ZRevRankCommand, bK as ZScanCommand, bL as ZScoreCommand, bM as ZUnionCommand, bN as ZUnionCommandOptions, bO as ZUnionStoreCommand, bP as ZUnionStoreCommandOptions, e as errors } from './zmscore-BdNsMd17.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Connection credentials for upstash redis.
|