@upstash/redis 1.20.1 → 1.20.3
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/esm/pkg/http.js +3 -1
- package/esm/platforms/nodejs.js +1 -0
- package/esm/version.js +1 -1
- package/package.json +1 -1
- package/script/pkg/http.js +3 -1
- package/script/platforms/nodejs.js +1 -0
- package/script/version.js +1 -1
- package/types/pkg/http.d.ts +4 -0
- package/types/version.d.ts +1 -1
package/esm/pkg/http.js
CHANGED
|
@@ -28,7 +28,8 @@ export class HttpClient {
|
|
|
28
28
|
this.options = {
|
|
29
29
|
backend: config.options?.backend,
|
|
30
30
|
agent: config.agent,
|
|
31
|
-
responseEncoding: config.responseEncoding ?? "base64",
|
|
31
|
+
responseEncoding: config.responseEncoding ?? "base64",
|
|
32
|
+
cache: config.cache,
|
|
32
33
|
};
|
|
33
34
|
this.baseUrl = config.baseUrl.replace(/\/$/, "");
|
|
34
35
|
this.headers = {
|
|
@@ -71,6 +72,7 @@ export class HttpClient {
|
|
|
71
72
|
}
|
|
72
73
|
async request(req) {
|
|
73
74
|
const requestOptions = {
|
|
75
|
+
cache: this.options.cache,
|
|
74
76
|
method: "POST",
|
|
75
77
|
headers: this.headers,
|
|
76
78
|
body: JSON.stringify(req.body),
|
package/esm/platforms/nodejs.js
CHANGED
|
@@ -35,6 +35,7 @@ export class Redis extends core.Redis {
|
|
|
35
35
|
headers: { authorization: `Bearer ${configOrRequester.token}` },
|
|
36
36
|
agent: configOrRequester.agent,
|
|
37
37
|
responseEncoding: configOrRequester.responseEncoding,
|
|
38
|
+
cache: "no-store",
|
|
38
39
|
});
|
|
39
40
|
super(client, {
|
|
40
41
|
automaticDeserialization: configOrRequester.automaticDeserialization,
|
package/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "v1.20.
|
|
1
|
+
export const VERSION = "v1.20.3";
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main": "./script/platforms/nodejs.js",
|
|
4
4
|
"types": "./types/platforms/nodejs.d.ts",
|
|
5
5
|
"name": "@upstash/redis",
|
|
6
|
-
"version": "v1.20.
|
|
6
|
+
"version": "v1.20.3",
|
|
7
7
|
"description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
package/script/pkg/http.js
CHANGED
|
@@ -31,7 +31,8 @@ class HttpClient {
|
|
|
31
31
|
this.options = {
|
|
32
32
|
backend: config.options?.backend,
|
|
33
33
|
agent: config.agent,
|
|
34
|
-
responseEncoding: config.responseEncoding ?? "base64",
|
|
34
|
+
responseEncoding: config.responseEncoding ?? "base64",
|
|
35
|
+
cache: config.cache,
|
|
35
36
|
};
|
|
36
37
|
this.baseUrl = config.baseUrl.replace(/\/$/, "");
|
|
37
38
|
this.headers = {
|
|
@@ -74,6 +75,7 @@ class HttpClient {
|
|
|
74
75
|
}
|
|
75
76
|
async request(req) {
|
|
76
77
|
const requestOptions = {
|
|
78
|
+
cache: this.options.cache,
|
|
77
79
|
method: "POST",
|
|
78
80
|
headers: this.headers,
|
|
79
81
|
body: JSON.stringify(req.body),
|
|
@@ -61,6 +61,7 @@ class Redis extends core.Redis {
|
|
|
61
61
|
headers: { authorization: `Bearer ${configOrRequester.token}` },
|
|
62
62
|
agent: configOrRequester.agent,
|
|
63
63
|
responseEncoding: configOrRequester.responseEncoding,
|
|
64
|
+
cache: "no-store",
|
|
64
65
|
});
|
|
65
66
|
super(client, {
|
|
66
67
|
automaticDeserialization: configOrRequester.automaticDeserialization,
|
package/script/version.js
CHANGED
package/types/pkg/http.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Telemetry } from "./types.js";
|
|
2
|
+
type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
|
|
2
3
|
export type UpstashRequest = {
|
|
3
4
|
path?: string[];
|
|
4
5
|
/**
|
|
@@ -68,6 +69,7 @@ export type HttpClientConfig = {
|
|
|
68
69
|
options?: Options;
|
|
69
70
|
retry?: RetryConfig;
|
|
70
71
|
agent?: any;
|
|
72
|
+
cache?: CacheSetting;
|
|
71
73
|
} & RequesterConfig;
|
|
72
74
|
export declare class HttpClient implements Requester {
|
|
73
75
|
baseUrl: string;
|
|
@@ -76,6 +78,7 @@ export declare class HttpClient implements Requester {
|
|
|
76
78
|
backend?: string;
|
|
77
79
|
agent: any;
|
|
78
80
|
responseEncoding?: false | "base64";
|
|
81
|
+
cache?: CacheSetting;
|
|
79
82
|
};
|
|
80
83
|
readonly retry: {
|
|
81
84
|
attempts: number;
|
|
@@ -85,3 +88,4 @@ export declare class HttpClient implements Requester {
|
|
|
85
88
|
mergeTelemetry(telemetry: Telemetry): void;
|
|
86
89
|
request<TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>>;
|
|
87
90
|
}
|
|
91
|
+
export {};
|
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "v1.20.
|
|
1
|
+
export declare const VERSION = "v1.20.3";
|