@upstash/redis 0.0.0-ci.fbd851d5174af0f471e681ec296b0b4802b3b460 → 0.0.0-ci.fbead4fb2ed281bdc04ec90c263e6380eed1465b-20251021062126

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/fastly.mjs CHANGED
@@ -1 +1,66 @@
1
- import{a as t,b as s,c as r}from"./chunk-I4N2IZLH.mjs";var o=class extends s{constructor(e){(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let n=new t({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},options:{backend:e.backend},responseEncoding:e.responseEncoding});super(n,{automaticDeserialization:e.automaticDeserialization}),this.addTelemetry({sdk:`@upstash/redis@${r}`,platform:"fastly"})}};export{o as Redis};
1
+ import {
2
+ HttpClient,
3
+ Redis,
4
+ VERSION,
5
+ error_exports
6
+ } from "./chunk-WTYE7OV3.mjs";
7
+
8
+ // platforms/fastly.ts
9
+ var Redis2 = class extends Redis {
10
+ /**
11
+ * Create a new redis client
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const redis = new Redis({
16
+ * url: "<UPSTASH_REDIS_REST_URL>",
17
+ * token: "<UPSTASH_REDIS_REST_TOKEN>",
18
+ * backend: "upstash-db",
19
+ * });
20
+ * ```
21
+ */
22
+ constructor(config) {
23
+ if (!config.url) {
24
+ console.warn(
25
+ `[Upstash Redis] The 'url' property is missing or undefined in your Redis config.`
26
+ );
27
+ } else if (config.url.startsWith(" ") || config.url.endsWith(" ") || /\r|\n/.test(config.url)) {
28
+ console.warn(
29
+ "[Upstash Redis] The redis url contains whitespace or newline, which can cause errors!"
30
+ );
31
+ }
32
+ if (!config.token) {
33
+ console.warn(
34
+ `[Upstash Redis] The 'token' property is missing or undefined in your Redis config.`
35
+ );
36
+ } else if (config.token.startsWith(" ") || config.token.endsWith(" ") || /\r|\n/.test(config.token)) {
37
+ console.warn(
38
+ "[Upstash Redis] The redis token contains whitespace or newline, which can cause errors!"
39
+ );
40
+ }
41
+ const client = new HttpClient({
42
+ baseUrl: config.url,
43
+ retry: config.retry,
44
+ headers: { authorization: `Bearer ${config.token}` },
45
+ options: { backend: config.backend },
46
+ responseEncoding: config.responseEncoding,
47
+ keepAlive: config.keepAlive,
48
+ readYourWrites: config.readYourWrites
49
+ });
50
+ super(client, {
51
+ automaticDeserialization: config.automaticDeserialization,
52
+ enableAutoPipelining: config.enableAutoPipelining
53
+ });
54
+ this.addTelemetry({
55
+ sdk: `@upstash/redis@${VERSION}`,
56
+ platform: "fastly"
57
+ });
58
+ if (this.enableAutoPipelining) {
59
+ return this.autoPipeline();
60
+ }
61
+ }
62
+ };
63
+ export {
64
+ Redis2 as Redis,
65
+ error_exports as errors
66
+ };
package/nodejs.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RedisOptions, a as RequesterConfig, b as Redis$1, c as Requester } from './zmscore-10fd3773.js';
2
- export { A as AppendCommand, B as BitCountCommand, e as BitOpCommand, f as BitPosCommand, C as CopyCommand, D as DBSizeCommand, h as DecrByCommand, g as DecrCommand, i as DelCommand, E as EchoCommand, j as EvalCommand, k as EvalshaCommand, l as ExistsCommand, n as ExpireAtCommand, m as ExpireCommand, F as FlushAllCommand, o as FlushDBCommand, G as GeoAddCommand, p as GeoAddCommandOptions, r as GeoDistCommand, s as GeoHashCommand, q as GeoMember, t as GeoPosCommand, u as GeoSearchCommand, v as GeoSearchStoreCommand, x as GetBitCommand, w as GetCommand, y as GetDelCommand, z as GetRangeCommand, H as GetSetCommand, I as HDelCommand, J as HExistsCommand, L as HGetAllCommand, K as HGetCommand, M as HIncrByCommand, N as HIncrByFloatCommand, O as HKeysCommand, P as HLenCommand, Q as HMGetCommand, S as HMSetCommand, T as HRandFieldCommand, V as HScanCommand, W as HSetCommand, X as HSetNXCommand, Y as HStrLenCommand, Z as HValsCommand, $ as IncrByCommand, a0 as IncrByFloatCommand, _ as IncrCommand, a1 as JsonArrAppendCommand, a2 as JsonArrIndexCommand, a3 as JsonArrInsertCommand, a4 as JsonArrLenCommand, a5 as JsonArrPopCommand, a6 as JsonArrTrimCommand, a7 as JsonClearCommand, a8 as JsonDelCommand, a9 as JsonForgetCommand, aa as JsonGetCommand, ab as JsonMGetCommand, ac as JsonNumIncrByCommand, ad as JsonNumMultByCommand, ae as JsonObjKeysCommand, af as JsonObjLenCommand, ag as JsonRespCommand, ah as JsonSetCommand, ai as JsonStrAppendCommand, aj as JsonStrLenCommand, ak as JsonToggleCommand, al as JsonTypeCommand, am as KeysCommand, an as LIndexCommand, ao as LInsertCommand, ap as LLenCommand, aq as LMoveCommand, ar as LPopCommand, as as LPushCommand, at as LPushXCommand, au as LRangeCommand, av as LRemCommand, aw as LSetCommand, ax as LTrimCommand, ay as MGetCommand, az as MSetCommand, aA as MSetNXCommand, aD as PExpireAtCommand, aC as PExpireCommand, aF as PSetEXCommand, aG as PTtlCommand, aB as PersistCommand, aE as PingCommand, aH as PublishCommand, aL as RPopCommand, aM as RPushCommand, aN as RPushXCommand, aI as RandomKeyCommand, aJ as RenameCommand, aK as RenameNXCommand, aO as SAddCommand, aR as SCardCommand, aV as SDiffCommand, aW as SDiffStoreCommand, b1 as SInterCommand, b2 as SInterStoreCommand, b3 as SIsMemberCommand, b5 as SMIsMemberCommand, b4 as SMembersCommand, b6 as SMoveCommand, b7 as SPopCommand, b8 as SRandMemberCommand, b9 as SRemCommand, ba as SScanCommand, bc as SUnionCommand, bd as SUnionStoreCommand, aP as ScanCommand, aQ as ScanCommandOptions, bm as ScoreMember, aS as ScriptExistsCommand, aT as ScriptFlushCommand, aU as ScriptLoadCommand, aZ as SetBitCommand, aX as SetCommand, aY as SetCommandOptions, a_ as SetExCommand, a$ as SetNxCommand, b0 as SetRangeCommand, bb as StrLenCommand, be as TimeCommand, bf as TouchCommand, bg as TtlCommand, bh as Type, bi as TypeCommand, bj as UnlinkCommand, U as UpstashRequest, d as UpstashResponse, bk as XAddCommand, bl as XRangeCommand, bp as ZAddCommand, bn as ZAddCommandOptions, bo as ZAddCommandOptionsWithIncr, bq as ZCardCommand, br as ZCountCommand, bs as ZDiffStoreCommand, bt as ZIncrByCommand, bu as ZInterStoreCommand, bv as ZInterStoreCommandOptions, bw as ZLexCountCommand, bx as ZMScoreCommand, by as ZPopMaxCommand, bz as ZPopMinCommand, bA as ZRangeCommand, bB as ZRangeCommandOptions, bC as ZRankCommand, bD as ZRemCommand, bE as ZRemRangeByLexCommand, bF as ZRemRangeByRankCommand, bG as ZRemRangeByScoreCommand, bH as ZRevRankCommand, bI as ZScanCommand, bJ as ZScoreCommand, bK as ZUnionCommand, bL as ZUnionCommandOptions, bM as ZUnionStoreCommand, bN as ZUnionStoreCommandOptions } from './zmscore-10fd3773.js';
1
+ import { H as HttpClientConfig, R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-Cq_Bzgy4.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, d 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, c 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-Cq_Bzgy4.mjs';
3
3
 
4
4
  /**
5
5
  * Connection credentials for upstash redis.
@@ -9,11 +9,11 @@ type RedisConfigNodejs = {
9
9
  /**
10
10
  * UPSTASH_REDIS_REST_URL
11
11
  */
12
- url: string;
12
+ url: string | undefined;
13
13
  /**
14
14
  * UPSTASH_REDIS_REST_TOKEN
15
15
  */
16
- token: string;
16
+ token: string | undefined;
17
17
  /**
18
18
  * An agent allows you to reuse connections to reduce latency for multiple sequential requests.
19
19
  *
@@ -29,7 +29,18 @@ type RedisConfigNodejs = {
29
29
  * }
30
30
  * ```
31
31
  */
32
- agent?: any;
32
+ /**
33
+ * The signal will allow aborting requests on the fly.
34
+ * For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
35
+ */
36
+ signal?: HttpClientConfig["signal"];
37
+ latencyLogging?: boolean;
38
+ agent?: unknown;
39
+ keepAlive?: boolean;
40
+ /**
41
+ * When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client.
42
+ */
43
+ readYourWrites?: boolean;
33
44
  } & RedisOptions & RequesterConfig;
34
45
  /**
35
46
  * Serverless redis client for upstash.
@@ -47,34 +58,20 @@ declare class Redis extends Redis$1 {
47
58
  * ```
48
59
  */
49
60
  constructor(config: RedisConfigNodejs);
50
- /**
51
- * Create a new redis client by providing a custom `Requester` implementation
52
- *
53
- * @example
54
- * ```ts
55
- *
56
- * import { UpstashRequest, Requester, UpstashResponse, Redis } from "@upstash/redis"
57
- *
58
- * const requester: Requester = {
59
- * request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
60
- * // ...
61
- * }
62
- * }
63
- *
64
- * const redis = new Redis(requester)
65
- * ```
66
- */
67
- constructor(requesters: Requester);
68
61
  /**
69
62
  * Create a new Upstash Redis instance from environment variables.
70
63
  *
71
64
  * Use this to automatically load connection secrets from your environment
72
65
  * variables. For instance when using the Vercel integration.
73
66
  *
74
- * This tries to load `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from
75
- * your environment using `process.env`.
67
+ * This tries to load connection details from your environment using `process.env`:
68
+ * - URL: `UPSTASH_REDIS_REST_URL` or fallback to `KV_REST_API_URL`
69
+ * - Token: `UPSTASH_REDIS_REST_TOKEN` or fallback to `KV_REST_API_TOKEN`
70
+ *
71
+ * The fallback variables provide compatibility with Vercel KV and other platforms
72
+ * that may use different naming conventions.
76
73
  */
77
74
  static fromEnv(config?: Omit<RedisConfigNodejs, "url" | "token">): Redis;
78
75
  }
79
76
 
80
- export { Redis, RedisConfigNodejs, Requester };
77
+ export { Redis, type RedisConfigNodejs };
package/nodejs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RedisOptions, a as RequesterConfig, b as Redis$1, c as Requester } from './zmscore-10fd3773.js';
2
- export { A as AppendCommand, B as BitCountCommand, e as BitOpCommand, f as BitPosCommand, C as CopyCommand, D as DBSizeCommand, h as DecrByCommand, g as DecrCommand, i as DelCommand, E as EchoCommand, j as EvalCommand, k as EvalshaCommand, l as ExistsCommand, n as ExpireAtCommand, m as ExpireCommand, F as FlushAllCommand, o as FlushDBCommand, G as GeoAddCommand, p as GeoAddCommandOptions, r as GeoDistCommand, s as GeoHashCommand, q as GeoMember, t as GeoPosCommand, u as GeoSearchCommand, v as GeoSearchStoreCommand, x as GetBitCommand, w as GetCommand, y as GetDelCommand, z as GetRangeCommand, H as GetSetCommand, I as HDelCommand, J as HExistsCommand, L as HGetAllCommand, K as HGetCommand, M as HIncrByCommand, N as HIncrByFloatCommand, O as HKeysCommand, P as HLenCommand, Q as HMGetCommand, S as HMSetCommand, T as HRandFieldCommand, V as HScanCommand, W as HSetCommand, X as HSetNXCommand, Y as HStrLenCommand, Z as HValsCommand, $ as IncrByCommand, a0 as IncrByFloatCommand, _ as IncrCommand, a1 as JsonArrAppendCommand, a2 as JsonArrIndexCommand, a3 as JsonArrInsertCommand, a4 as JsonArrLenCommand, a5 as JsonArrPopCommand, a6 as JsonArrTrimCommand, a7 as JsonClearCommand, a8 as JsonDelCommand, a9 as JsonForgetCommand, aa as JsonGetCommand, ab as JsonMGetCommand, ac as JsonNumIncrByCommand, ad as JsonNumMultByCommand, ae as JsonObjKeysCommand, af as JsonObjLenCommand, ag as JsonRespCommand, ah as JsonSetCommand, ai as JsonStrAppendCommand, aj as JsonStrLenCommand, ak as JsonToggleCommand, al as JsonTypeCommand, am as KeysCommand, an as LIndexCommand, ao as LInsertCommand, ap as LLenCommand, aq as LMoveCommand, ar as LPopCommand, as as LPushCommand, at as LPushXCommand, au as LRangeCommand, av as LRemCommand, aw as LSetCommand, ax as LTrimCommand, ay as MGetCommand, az as MSetCommand, aA as MSetNXCommand, aD as PExpireAtCommand, aC as PExpireCommand, aF as PSetEXCommand, aG as PTtlCommand, aB as PersistCommand, aE as PingCommand, aH as PublishCommand, aL as RPopCommand, aM as RPushCommand, aN as RPushXCommand, aI as RandomKeyCommand, aJ as RenameCommand, aK as RenameNXCommand, aO as SAddCommand, aR as SCardCommand, aV as SDiffCommand, aW as SDiffStoreCommand, b1 as SInterCommand, b2 as SInterStoreCommand, b3 as SIsMemberCommand, b5 as SMIsMemberCommand, b4 as SMembersCommand, b6 as SMoveCommand, b7 as SPopCommand, b8 as SRandMemberCommand, b9 as SRemCommand, ba as SScanCommand, bc as SUnionCommand, bd as SUnionStoreCommand, aP as ScanCommand, aQ as ScanCommandOptions, bm as ScoreMember, aS as ScriptExistsCommand, aT as ScriptFlushCommand, aU as ScriptLoadCommand, aZ as SetBitCommand, aX as SetCommand, aY as SetCommandOptions, a_ as SetExCommand, a$ as SetNxCommand, b0 as SetRangeCommand, bb as StrLenCommand, be as TimeCommand, bf as TouchCommand, bg as TtlCommand, bh as Type, bi as TypeCommand, bj as UnlinkCommand, U as UpstashRequest, d as UpstashResponse, bk as XAddCommand, bl as XRangeCommand, bp as ZAddCommand, bn as ZAddCommandOptions, bo as ZAddCommandOptionsWithIncr, bq as ZCardCommand, br as ZCountCommand, bs as ZDiffStoreCommand, bt as ZIncrByCommand, bu as ZInterStoreCommand, bv as ZInterStoreCommandOptions, bw as ZLexCountCommand, bx as ZMScoreCommand, by as ZPopMaxCommand, bz as ZPopMinCommand, bA as ZRangeCommand, bB as ZRangeCommandOptions, bC as ZRankCommand, bD as ZRemCommand, bE as ZRemRangeByLexCommand, bF as ZRemRangeByRankCommand, bG as ZRemRangeByScoreCommand, bH as ZRevRankCommand, bI as ZScanCommand, bJ as ZScoreCommand, bK as ZUnionCommand, bL as ZUnionCommandOptions, bM as ZUnionStoreCommand, bN as ZUnionStoreCommandOptions } from './zmscore-10fd3773.js';
1
+ import { H as HttpClientConfig, R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-Cq_Bzgy4.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, d 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, c 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-Cq_Bzgy4.js';
3
3
 
4
4
  /**
5
5
  * Connection credentials for upstash redis.
@@ -9,11 +9,11 @@ type RedisConfigNodejs = {
9
9
  /**
10
10
  * UPSTASH_REDIS_REST_URL
11
11
  */
12
- url: string;
12
+ url: string | undefined;
13
13
  /**
14
14
  * UPSTASH_REDIS_REST_TOKEN
15
15
  */
16
- token: string;
16
+ token: string | undefined;
17
17
  /**
18
18
  * An agent allows you to reuse connections to reduce latency for multiple sequential requests.
19
19
  *
@@ -29,7 +29,18 @@ type RedisConfigNodejs = {
29
29
  * }
30
30
  * ```
31
31
  */
32
- agent?: any;
32
+ /**
33
+ * The signal will allow aborting requests on the fly.
34
+ * For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
35
+ */
36
+ signal?: HttpClientConfig["signal"];
37
+ latencyLogging?: boolean;
38
+ agent?: unknown;
39
+ keepAlive?: boolean;
40
+ /**
41
+ * When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client.
42
+ */
43
+ readYourWrites?: boolean;
33
44
  } & RedisOptions & RequesterConfig;
34
45
  /**
35
46
  * Serverless redis client for upstash.
@@ -47,34 +58,20 @@ declare class Redis extends Redis$1 {
47
58
  * ```
48
59
  */
49
60
  constructor(config: RedisConfigNodejs);
50
- /**
51
- * Create a new redis client by providing a custom `Requester` implementation
52
- *
53
- * @example
54
- * ```ts
55
- *
56
- * import { UpstashRequest, Requester, UpstashResponse, Redis } from "@upstash/redis"
57
- *
58
- * const requester: Requester = {
59
- * request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
60
- * // ...
61
- * }
62
- * }
63
- *
64
- * const redis = new Redis(requester)
65
- * ```
66
- */
67
- constructor(requesters: Requester);
68
61
  /**
69
62
  * Create a new Upstash Redis instance from environment variables.
70
63
  *
71
64
  * Use this to automatically load connection secrets from your environment
72
65
  * variables. For instance when using the Vercel integration.
73
66
  *
74
- * This tries to load `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from
75
- * your environment using `process.env`.
67
+ * This tries to load connection details from your environment using `process.env`:
68
+ * - URL: `UPSTASH_REDIS_REST_URL` or fallback to `KV_REST_API_URL`
69
+ * - Token: `UPSTASH_REDIS_REST_TOKEN` or fallback to `KV_REST_API_TOKEN`
70
+ *
71
+ * The fallback variables provide compatibility with Vercel KV and other platforms
72
+ * that may use different naming conventions.
76
73
  */
77
74
  static fromEnv(config?: Omit<RedisConfigNodejs, "url" | "token">): Redis;
78
75
  }
79
76
 
80
- export { Redis, RedisConfigNodejs, Requester };
77
+ export { Redis, type RedisConfigNodejs };