@upstash/redis 0.0.0-ci.998046a844b4998e6b7de8c128d5f41be5545cdf-20241002104435 → 0.0.0-ci.9a0f7fcd9dc38c0a4ce2b192f3f9c3542ccc791c-20251125190254
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/{chunk-K53GSI5K.mjs → chunk-WTYE7OV3.mjs} +807 -90
- package/cloudflare.d.mts +3 -3
- package/cloudflare.d.ts +3 -3
- package/cloudflare.js +822 -113
- package/cloudflare.mjs +16 -14
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +817 -108
- package/fastly.mjs +11 -9
- package/nodejs.d.mts +14 -6
- package/nodejs.d.ts +14 -6
- package/nodejs.js +832 -118
- package/nodejs.mjs +26 -19
- package/package.json +1 -1
- package/{zmscore-BLgYk16R.d.mts → zmscore-xbfRql7X.d.mts} +626 -56
- package/{zmscore-BLgYk16R.d.ts → zmscore-xbfRql7X.d.ts} +626 -56
package/cloudflare.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Redis,
|
|
4
4
|
VERSION,
|
|
5
5
|
error_exports
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WTYE7OV3.mjs";
|
|
7
7
|
|
|
8
8
|
// platforms/cloudflare.ts
|
|
9
9
|
var Redis2 = class _Redis extends Redis {
|
|
@@ -20,20 +20,22 @@ var Redis2 = class _Redis extends Redis {
|
|
|
20
20
|
*/
|
|
21
21
|
constructor(config, env) {
|
|
22
22
|
if (!config.url) {
|
|
23
|
-
|
|
23
|
+
console.warn(
|
|
24
24
|
`[Upstash Redis] The 'url' property is missing or undefined in your Redis config.`
|
|
25
25
|
);
|
|
26
|
+
} else if (config.url.startsWith(" ") || config.url.endsWith(" ") || /\r|\n/.test(config.url)) {
|
|
27
|
+
console.warn(
|
|
28
|
+
"[Upstash Redis] The redis url contains whitespace or newline, which can cause errors!"
|
|
29
|
+
);
|
|
26
30
|
}
|
|
27
31
|
if (!config.token) {
|
|
28
|
-
|
|
32
|
+
console.warn(
|
|
29
33
|
`[Upstash Redis] The 'token' property is missing or undefined in your Redis config.`
|
|
30
34
|
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (config.token.startsWith(" ") || config.token.endsWith(" ") || /\r|\n/.test(config.token)) {
|
|
36
|
-
console.warn("The redis token contains whitespace or newline, which can cause errors!");
|
|
35
|
+
} else if (config.token.startsWith(" ") || config.token.endsWith(" ") || /\r|\n/.test(config.token)) {
|
|
36
|
+
console.warn(
|
|
37
|
+
"[Upstash Redis] The redis token contains whitespace or newline, which can cause errors!"
|
|
38
|
+
);
|
|
37
39
|
}
|
|
38
40
|
const client = new HttpClient({
|
|
39
41
|
retry: config.retry,
|
|
@@ -45,7 +47,7 @@ var Redis2 = class _Redis extends Redis {
|
|
|
45
47
|
readYourWrites: config.readYourWrites
|
|
46
48
|
});
|
|
47
49
|
super(client, {
|
|
48
|
-
enableTelemetry: !env?.UPSTASH_DISABLE_TELEMETRY,
|
|
50
|
+
enableTelemetry: config.enableTelemetry ?? !env?.UPSTASH_DISABLE_TELEMETRY,
|
|
49
51
|
automaticDeserialization: config.automaticDeserialization,
|
|
50
52
|
latencyLogging: config.latencyLogging,
|
|
51
53
|
enableAutoPipelining: config.enableAutoPipelining
|
|
@@ -73,13 +75,13 @@ var Redis2 = class _Redis extends Redis {
|
|
|
73
75
|
const url = env?.UPSTASH_REDIS_REST_URL ?? UPSTASH_REDIS_REST_URL;
|
|
74
76
|
const token = env?.UPSTASH_REDIS_REST_TOKEN ?? UPSTASH_REDIS_REST_TOKEN;
|
|
75
77
|
if (!url) {
|
|
76
|
-
|
|
77
|
-
"Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`"
|
|
78
|
+
console.warn(
|
|
79
|
+
"[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`"
|
|
78
80
|
);
|
|
79
81
|
}
|
|
80
82
|
if (!token) {
|
|
81
|
-
|
|
82
|
-
"Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_TOKEN`"
|
|
83
|
+
console.warn(
|
|
84
|
+
"[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_TOKEN`"
|
|
83
85
|
);
|
|
84
86
|
}
|
|
85
87
|
return new _Redis({ ...opts, url, token }, env);
|
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,
|
|
1
|
+
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-xbfRql7X.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, l as EvalCommand, k as EvalROCommand, n as EvalshaCommand, m as EvalshaROCommand, o as ExistsCommand, r as ExpireAtCommand, p as ExpireCommand, q as ExpireOption, F as FlushAllCommand, s as FlushDBCommand, G as GeoAddCommand, t as GeoAddCommandOptions, v as GeoDistCommand, w as GeoHashCommand, u as GeoMember, x as GeoPosCommand, y as GeoSearchCommand, z as GeoSearchStoreCommand, J as GetBitCommand, I as GetCommand, K as GetDelCommand, L as GetExCommand, M as GetRangeCommand, N as GetSetCommand, O as HDelCommand, Q as HExistsCommand, T as HExpireAtCommand, S as HExpireCommand, V as HExpireTimeCommand, a1 as HGetAllCommand, a0 as HGetCommand, a2 as HIncrByCommand, a3 as HIncrByFloatCommand, a4 as HKeysCommand, a5 as HLenCommand, a6 as HMGetCommand, a7 as HMSetCommand, Y as HPExpireAtCommand, X as HPExpireCommand, Z as HPExpireTimeCommand, _ as HPTtlCommand, $ as HPersistCommand, a8 as HRandFieldCommand, a9 as HScanCommand, aa as HSetCommand, ab as HSetNXCommand, ac as HStrLenCommand, W as HTtlCommand, ad as HValsCommand, af as IncrByCommand, ag as IncrByFloatCommand, ae as IncrCommand, ah as JsonArrAppendCommand, ai as JsonArrIndexCommand, aj as JsonArrInsertCommand, ak as JsonArrLenCommand, al as JsonArrPopCommand, am as JsonArrTrimCommand, an as JsonClearCommand, ao as JsonDelCommand, ap as JsonForgetCommand, aq as JsonGetCommand, as as JsonMGetCommand, ar as JsonMergeCommand, at as JsonNumIncrByCommand, au as JsonNumMultByCommand, av as JsonObjKeysCommand, aw as JsonObjLenCommand, ax as JsonRespCommand, ay as JsonSetCommand, az as JsonStrAppendCommand, aA as JsonStrLenCommand, aB as JsonToggleCommand, aC as JsonTypeCommand, aD as KeysCommand, aE as LIndexCommand, aF as LInsertCommand, aG as LLenCommand, aH as LMoveCommand, aI as LPopCommand, aJ as LPushCommand, aK as LPushXCommand, aL as LRangeCommand, aM as LRemCommand, aN as LSetCommand, aO as LTrimCommand, aP as MGetCommand, aQ as MSetCommand, aR as MSetNXCommand, aU as PExpireAtCommand, aT as PExpireCommand, aW as PSetEXCommand, aX as PTtlCommand, aS as PersistCommand, aV as PingCommand, P as Pipeline, aY as PublishCommand, b0 as RPopCommand, b1 as RPushCommand, b2 as RPushXCommand, aZ as RandomKeyCommand, a_ as RenameCommand, a$ as RenameNXCommand, c as Requester, b3 as SAddCommand, b6 as SCardCommand, ba as SDiffCommand, bb as SDiffStoreCommand, bi as SInterCommand, bj as SInterStoreCommand, bk as SIsMemberCommand, bm as SMIsMemberCommand, bl as SMembersCommand, bn as SMoveCommand, bo as SPopCommand, bp as SRandMemberCommand, bq as SRemCommand, br as SScanCommand, bt as SUnionCommand, bu as SUnionStoreCommand, b4 as ScanCommand, b5 as ScanCommandOptions, bD as ScoreMember, b7 as ScriptExistsCommand, b8 as ScriptFlushCommand, b9 as ScriptLoadCommand, be as SetBitCommand, bc as SetCommand, bd as SetCommandOptions, bf as SetExCommand, bg as SetNxCommand, bh as SetRangeCommand, bs as StrLenCommand, bv as TimeCommand, bw as TouchCommand, bx as TtlCommand, by as Type, bz as TypeCommand, bA as UnlinkCommand, U as UpstashRequest, d as UpstashResponse, bB as XAddCommand, bC as XRangeCommand, bF as ZAddCommand, bE as ZAddCommandOptions, bG as ZCardCommand, bH as ZCountCommand, bI as ZDiffStoreCommand, bJ as ZIncrByCommand, bK as ZInterStoreCommand, bL as ZInterStoreCommandOptions, bM as ZLexCountCommand, bN as ZMScoreCommand, bO as ZPopMaxCommand, bP as ZPopMinCommand, bQ as ZRangeCommand, bR as ZRangeCommandOptions, bS as ZRankCommand, bT as ZRemCommand, bU as ZRemRangeByLexCommand, bV as ZRemRangeByRankCommand, bW as ZRemRangeByScoreCommand, bX as ZRevRankCommand, bY as ZScanCommand, bZ as ZScoreCommand, b_ as ZUnionCommand, b$ as ZUnionCommandOptions, c0 as ZUnionStoreCommand, c1 as ZUnionStoreCommandOptions, e as errors } from './zmscore-xbfRql7X.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,
|
|
1
|
+
import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-xbfRql7X.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, l as EvalCommand, k as EvalROCommand, n as EvalshaCommand, m as EvalshaROCommand, o as ExistsCommand, r as ExpireAtCommand, p as ExpireCommand, q as ExpireOption, F as FlushAllCommand, s as FlushDBCommand, G as GeoAddCommand, t as GeoAddCommandOptions, v as GeoDistCommand, w as GeoHashCommand, u as GeoMember, x as GeoPosCommand, y as GeoSearchCommand, z as GeoSearchStoreCommand, J as GetBitCommand, I as GetCommand, K as GetDelCommand, L as GetExCommand, M as GetRangeCommand, N as GetSetCommand, O as HDelCommand, Q as HExistsCommand, T as HExpireAtCommand, S as HExpireCommand, V as HExpireTimeCommand, a1 as HGetAllCommand, a0 as HGetCommand, a2 as HIncrByCommand, a3 as HIncrByFloatCommand, a4 as HKeysCommand, a5 as HLenCommand, a6 as HMGetCommand, a7 as HMSetCommand, Y as HPExpireAtCommand, X as HPExpireCommand, Z as HPExpireTimeCommand, _ as HPTtlCommand, $ as HPersistCommand, a8 as HRandFieldCommand, a9 as HScanCommand, aa as HSetCommand, ab as HSetNXCommand, ac as HStrLenCommand, W as HTtlCommand, ad as HValsCommand, af as IncrByCommand, ag as IncrByFloatCommand, ae as IncrCommand, ah as JsonArrAppendCommand, ai as JsonArrIndexCommand, aj as JsonArrInsertCommand, ak as JsonArrLenCommand, al as JsonArrPopCommand, am as JsonArrTrimCommand, an as JsonClearCommand, ao as JsonDelCommand, ap as JsonForgetCommand, aq as JsonGetCommand, as as JsonMGetCommand, ar as JsonMergeCommand, at as JsonNumIncrByCommand, au as JsonNumMultByCommand, av as JsonObjKeysCommand, aw as JsonObjLenCommand, ax as JsonRespCommand, ay as JsonSetCommand, az as JsonStrAppendCommand, aA as JsonStrLenCommand, aB as JsonToggleCommand, aC as JsonTypeCommand, aD as KeysCommand, aE as LIndexCommand, aF as LInsertCommand, aG as LLenCommand, aH as LMoveCommand, aI as LPopCommand, aJ as LPushCommand, aK as LPushXCommand, aL as LRangeCommand, aM as LRemCommand, aN as LSetCommand, aO as LTrimCommand, aP as MGetCommand, aQ as MSetCommand, aR as MSetNXCommand, aU as PExpireAtCommand, aT as PExpireCommand, aW as PSetEXCommand, aX as PTtlCommand, aS as PersistCommand, aV as PingCommand, P as Pipeline, aY as PublishCommand, b0 as RPopCommand, b1 as RPushCommand, b2 as RPushXCommand, aZ as RandomKeyCommand, a_ as RenameCommand, a$ as RenameNXCommand, c as Requester, b3 as SAddCommand, b6 as SCardCommand, ba as SDiffCommand, bb as SDiffStoreCommand, bi as SInterCommand, bj as SInterStoreCommand, bk as SIsMemberCommand, bm as SMIsMemberCommand, bl as SMembersCommand, bn as SMoveCommand, bo as SPopCommand, bp as SRandMemberCommand, bq as SRemCommand, br as SScanCommand, bt as SUnionCommand, bu as SUnionStoreCommand, b4 as ScanCommand, b5 as ScanCommandOptions, bD as ScoreMember, b7 as ScriptExistsCommand, b8 as ScriptFlushCommand, b9 as ScriptLoadCommand, be as SetBitCommand, bc as SetCommand, bd as SetCommandOptions, bf as SetExCommand, bg as SetNxCommand, bh as SetRangeCommand, bs as StrLenCommand, bv as TimeCommand, bw as TouchCommand, bx as TtlCommand, by as Type, bz as TypeCommand, bA as UnlinkCommand, U as UpstashRequest, d as UpstashResponse, bB as XAddCommand, bC as XRangeCommand, bF as ZAddCommand, bE as ZAddCommandOptions, bG as ZCardCommand, bH as ZCountCommand, bI as ZDiffStoreCommand, bJ as ZIncrByCommand, bK as ZInterStoreCommand, bL as ZInterStoreCommandOptions, bM as ZLexCountCommand, bN as ZMScoreCommand, bO as ZPopMaxCommand, bP as ZPopMinCommand, bQ as ZRangeCommand, bR as ZRangeCommandOptions, bS as ZRankCommand, bT as ZRemCommand, bU as ZRemRangeByLexCommand, bV as ZRemRangeByRankCommand, bW as ZRemRangeByScoreCommand, bX as ZRevRankCommand, bY as ZScanCommand, bZ as ZScoreCommand, b_ as ZUnionCommand, b$ as ZUnionCommandOptions, c0 as ZUnionStoreCommand, c1 as ZUnionStoreCommandOptions, e as errors } from './zmscore-xbfRql7X.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Connection credentials for upstash redis.
|