@upstash/redis 0.0.0-ci.d3170677a5859e31d40407781286bdf17d64ca72-20250220114636 → 0.0.0-ci.d3985e1d3f7f296ee10dff2746b51fa88dddc9a9-20251222113217
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-AQ2U77ZI.mjs → chunk-LU3F3BSG.mjs} +667 -74
- package/cloudflare.d.mts +3 -3
- package/cloudflare.d.ts +3 -3
- package/cloudflare.js +683 -96
- package/cloudflare.mjs +15 -11
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +669 -86
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +14 -6
- package/nodejs.d.ts +14 -6
- package/nodejs.js +681 -92
- package/nodejs.mjs +13 -7
- package/package.json +1 -1
- package/{zmscore-BnJuTB6j.d.mts → zmscore-CSYwsf1L.d.mts} +515 -57
- package/{zmscore-BnJuTB6j.d.ts → zmscore-CSYwsf1L.d.ts} +515 -57
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-LU3F3BSG.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: !
|
|
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) {
|
|
@@ -85,11 +87,15 @@ var Redis2 = class _Redis extends Redis {
|
|
|
85
87
|
* Use this to automatically load connection secrets from your environment
|
|
86
88
|
* variables. For instance when using the Vercel integration.
|
|
87
89
|
*
|
|
88
|
-
* This tries to load
|
|
89
|
-
*
|
|
90
|
+
* This tries to load connection details from your environment using `process.env`:
|
|
91
|
+
* - URL: `UPSTASH_REDIS_REST_URL` or fallback to `KV_REST_API_URL`
|
|
92
|
+
* - Token: `UPSTASH_REDIS_REST_TOKEN` or fallback to `KV_REST_API_TOKEN`
|
|
93
|
+
*
|
|
94
|
+
* The fallback variables provide compatibility with Vercel KV and other platforms
|
|
95
|
+
* that may use different naming conventions.
|
|
90
96
|
*/
|
|
91
97
|
static fromEnv(config) {
|
|
92
|
-
if (process.env
|
|
98
|
+
if (typeof process !== "object" || !process || typeof process.env !== "object" || !process.env) {
|
|
93
99
|
throw new TypeError(
|
|
94
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'
|
|
95
101
|
);
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@upstash/redis","version":"v0.0.0-ci.
|
|
1
|
+
{"name":"@upstash/redis","version":"v0.0.0-ci.d3985e1d3f7f296ee10dff2746b51fa88dddc9a9-20251222113217","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"}}
|