@upstash/redis 1.35.7 → 1.35.8-canary
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-TBGBPMGD.mjs → chunk-TWTIJU7S.mjs} +1 -1
- package/cloudflare.js +11 -3
- package/cloudflare.mjs +11 -3
- package/fastly.js +1 -1
- package/fastly.mjs +1 -1
- package/nodejs.js +7 -5
- package/nodejs.mjs +7 -5
- package/package.json +1 -1
package/cloudflare.js
CHANGED
|
@@ -4531,7 +4531,7 @@ var Redis = class {
|
|
|
4531
4531
|
};
|
|
4532
4532
|
|
|
4533
4533
|
// version.ts
|
|
4534
|
-
var VERSION = "v1.35.
|
|
4534
|
+
var VERSION = "v1.35.8-canary";
|
|
4535
4535
|
|
|
4536
4536
|
// platforms/cloudflare.ts
|
|
4537
4537
|
var Redis2 = class _Redis extends Redis {
|
|
@@ -4600,8 +4600,16 @@ var Redis2 = class _Redis extends Redis {
|
|
|
4600
4600
|
* ```
|
|
4601
4601
|
*/
|
|
4602
4602
|
static fromEnv(env, opts) {
|
|
4603
|
-
const url = env?.UPSTASH_REDIS_REST_URL ??
|
|
4604
|
-
|
|
4603
|
+
const url = env?.UPSTASH_REDIS_REST_URL ?? // @ts-expect-error These will be defined by cloudflare
|
|
4604
|
+
(typeof UPSTASH_REDIS_REST_URL === "string" ? (
|
|
4605
|
+
// @ts-expect-error These will be defined by cloudflare
|
|
4606
|
+
UPSTASH_REDIS_REST_URL
|
|
4607
|
+
) : void 0);
|
|
4608
|
+
const token = env?.UPSTASH_REDIS_REST_TOKEN ?? // @ts-expect-error These will be defined by cloudflare
|
|
4609
|
+
(typeof UPSTASH_REDIS_REST_TOKEN === "string" ? (
|
|
4610
|
+
// @ts-expect-error These will be defined by cloudflare
|
|
4611
|
+
UPSTASH_REDIS_REST_TOKEN
|
|
4612
|
+
) : void 0);
|
|
4605
4613
|
if (!url) {
|
|
4606
4614
|
console.warn(
|
|
4607
4615
|
"[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`"
|
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-TWTIJU7S.mjs";
|
|
7
7
|
|
|
8
8
|
// platforms/cloudflare.ts
|
|
9
9
|
var Redis2 = class _Redis extends Redis {
|
|
@@ -72,8 +72,16 @@ var Redis2 = class _Redis extends Redis {
|
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
74
|
static fromEnv(env, opts) {
|
|
75
|
-
const url = env?.UPSTASH_REDIS_REST_URL ??
|
|
76
|
-
|
|
75
|
+
const url = env?.UPSTASH_REDIS_REST_URL ?? // @ts-expect-error These will be defined by cloudflare
|
|
76
|
+
(typeof UPSTASH_REDIS_REST_URL === "string" ? (
|
|
77
|
+
// @ts-expect-error These will be defined by cloudflare
|
|
78
|
+
UPSTASH_REDIS_REST_URL
|
|
79
|
+
) : void 0);
|
|
80
|
+
const token = env?.UPSTASH_REDIS_REST_TOKEN ?? // @ts-expect-error These will be defined by cloudflare
|
|
81
|
+
(typeof UPSTASH_REDIS_REST_TOKEN === "string" ? (
|
|
82
|
+
// @ts-expect-error These will be defined by cloudflare
|
|
83
|
+
UPSTASH_REDIS_REST_TOKEN
|
|
84
|
+
) : void 0);
|
|
77
85
|
if (!url) {
|
|
78
86
|
console.warn(
|
|
79
87
|
"[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`"
|
package/fastly.js
CHANGED
package/fastly.mjs
CHANGED
package/nodejs.js
CHANGED
|
@@ -4531,7 +4531,7 @@ var Redis = class {
|
|
|
4531
4531
|
};
|
|
4532
4532
|
|
|
4533
4533
|
// version.ts
|
|
4534
|
-
var VERSION = "v1.35.
|
|
4534
|
+
var VERSION = "v1.35.8-canary";
|
|
4535
4535
|
|
|
4536
4536
|
// platforms/nodejs.ts
|
|
4537
4537
|
if (typeof atob === "undefined") {
|
|
@@ -4589,18 +4589,20 @@ var Redis2 = class _Redis extends Redis {
|
|
|
4589
4589
|
keepAlive: configOrRequester.keepAlive,
|
|
4590
4590
|
readYourWrites: configOrRequester.readYourWrites
|
|
4591
4591
|
});
|
|
4592
|
+
const safeEnv = typeof process === "object" && process && typeof process.env === "object" && process.env ? process.env : {};
|
|
4592
4593
|
super(client, {
|
|
4593
4594
|
automaticDeserialization: configOrRequester.automaticDeserialization,
|
|
4594
|
-
enableTelemetry: configOrRequester.enableTelemetry ?? !
|
|
4595
|
+
enableTelemetry: configOrRequester.enableTelemetry ?? !safeEnv.UPSTASH_DISABLE_TELEMETRY,
|
|
4595
4596
|
latencyLogging: configOrRequester.latencyLogging,
|
|
4596
4597
|
enableAutoPipelining: configOrRequester.enableAutoPipelining
|
|
4597
4598
|
});
|
|
4599
|
+
const nodeVersion = typeof process === "object" && process ? process.version : void 0;
|
|
4598
4600
|
this.addTelemetry({
|
|
4599
4601
|
runtime: (
|
|
4600
4602
|
// @ts-expect-error to silence compiler
|
|
4601
|
-
typeof EdgeRuntime === "string" ? "edge-light" : `node@${
|
|
4603
|
+
typeof EdgeRuntime === "string" ? "edge-light" : nodeVersion ? `node@${nodeVersion}` : "unknown"
|
|
4602
4604
|
),
|
|
4603
|
-
platform:
|
|
4605
|
+
platform: safeEnv.UPSTASH_CONSOLE ? "console" : safeEnv.VERCEL ? "vercel" : safeEnv.AWS_REGION ? "aws" : "unknown",
|
|
4604
4606
|
sdk: `@upstash/redis@${VERSION}`
|
|
4605
4607
|
});
|
|
4606
4608
|
if (this.enableAutoPipelining) {
|
|
@@ -4621,7 +4623,7 @@ var Redis2 = class _Redis extends Redis {
|
|
|
4621
4623
|
* that may use different naming conventions.
|
|
4622
4624
|
*/
|
|
4623
4625
|
static fromEnv(config) {
|
|
4624
|
-
if (process.env
|
|
4626
|
+
if (typeof process !== "object" || !process || typeof process.env !== "object" || !process.env) {
|
|
4625
4627
|
throw new TypeError(
|
|
4626
4628
|
'[Upstash Redis] Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead'
|
|
4627
4629
|
);
|
package/nodejs.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Redis,
|
|
4
4
|
VERSION,
|
|
5
5
|
error_exports
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TWTIJU7S.mjs";
|
|
7
7
|
|
|
8
8
|
// platforms/nodejs.ts
|
|
9
9
|
if (typeof atob === "undefined") {
|
|
@@ -61,18 +61,20 @@ var Redis2 = class _Redis extends Redis {
|
|
|
61
61
|
keepAlive: configOrRequester.keepAlive,
|
|
62
62
|
readYourWrites: configOrRequester.readYourWrites
|
|
63
63
|
});
|
|
64
|
+
const safeEnv = typeof process === "object" && process && typeof process.env === "object" && process.env ? process.env : {};
|
|
64
65
|
super(client, {
|
|
65
66
|
automaticDeserialization: configOrRequester.automaticDeserialization,
|
|
66
|
-
enableTelemetry: configOrRequester.enableTelemetry ?? !
|
|
67
|
+
enableTelemetry: configOrRequester.enableTelemetry ?? !safeEnv.UPSTASH_DISABLE_TELEMETRY,
|
|
67
68
|
latencyLogging: configOrRequester.latencyLogging,
|
|
68
69
|
enableAutoPipelining: configOrRequester.enableAutoPipelining
|
|
69
70
|
});
|
|
71
|
+
const nodeVersion = typeof process === "object" && process ? process.version : void 0;
|
|
70
72
|
this.addTelemetry({
|
|
71
73
|
runtime: (
|
|
72
74
|
// @ts-expect-error to silence compiler
|
|
73
|
-
typeof EdgeRuntime === "string" ? "edge-light" : `node@${
|
|
75
|
+
typeof EdgeRuntime === "string" ? "edge-light" : nodeVersion ? `node@${nodeVersion}` : "unknown"
|
|
74
76
|
),
|
|
75
|
-
platform:
|
|
77
|
+
platform: safeEnv.UPSTASH_CONSOLE ? "console" : safeEnv.VERCEL ? "vercel" : safeEnv.AWS_REGION ? "aws" : "unknown",
|
|
76
78
|
sdk: `@upstash/redis@${VERSION}`
|
|
77
79
|
});
|
|
78
80
|
if (this.enableAutoPipelining) {
|
|
@@ -93,7 +95,7 @@ var Redis2 = class _Redis extends Redis {
|
|
|
93
95
|
* that may use different naming conventions.
|
|
94
96
|
*/
|
|
95
97
|
static fromEnv(config) {
|
|
96
|
-
if (process.env
|
|
98
|
+
if (typeof process !== "object" || !process || typeof process.env !== "object" || !process.env) {
|
|
97
99
|
throw new TypeError(
|
|
98
100
|
'[Upstash Redis] Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead'
|
|
99
101
|
);
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@upstash/redis","version":"v1.35.
|
|
1
|
+
{"name":"@upstash/redis","version":"v1.35.8-canary","main":"./nodejs.js","module":"./nodejs.mjs","types":"./nodejs.d.ts","exports":{".":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./node":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.js":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.mjs":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./fastly":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.js":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.mjs":{"import":"./fastly.mjs","require":"./fastly.js"}},"description":"An HTTP/REST based Redis client built on top of Upstash REST API.","repository":{"type":"git","url":"git+https://github.com/upstash/upstash-redis.git"},"keywords":["redis","database","serverless","edge","upstash"],"files":["./*"],"scripts":{"build":"tsup && cp package.json README.md LICENSE dist/","test":"bun test pkg","fmt":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","lint":"eslint \"**/*.{js,ts,tsx}\" --quiet --fix","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","lint:fix":"eslint . -c .ts,.tsx,.js,.jsx --fix","commit":"cz","lint:format":"bun run lint:fix && bun run format","check-exports":"bun run build && cd dist && attw -P"},"author":"Andreas Thomas <dev@chronark.com>","license":"MIT","bugs":{"url":"https://github.com/upstash/upstash-redis/issues"},"homepage":"https://github.com/upstash/upstash-redis#readme","devDependencies":{"@biomejs/biome":"latest","@commitlint/cli":"^19.3.0","@commitlint/config-conventional":"^19.2.2","@typescript-eslint/eslint-plugin":"8.4.0","@typescript-eslint/parser":"8.4.0","bun-types":"1.0.33","eslint":"9.10.0","eslint-plugin-unicorn":"55.0.0","husky":"^9.1.1","prettier":"^3.3.3","tsup":"^8.2.3","typescript":"latest"},"dependencies":{"uncrypto":"^0.1.3"}}
|