@upstash/redis 1.3.3-alpha.0 → 1.3.4
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 +3 -7
- package/esm/platforms/nodejs.js +5 -1
- package/package.json +2 -1
- package/script/platforms/nodejs.js +5 -1
- package/types/pkg/redis.d.ts +3 -3
- package/types/platforms/nodejs.d.ts +0 -18
package/README.md
CHANGED
|
@@ -324,19 +324,15 @@ details.
|
|
|
324
324
|
|
|
325
325
|
## Contributing
|
|
326
326
|
|
|
327
|
-
###
|
|
328
|
-
|
|
329
|
-
```bash
|
|
330
|
-
pnpm install
|
|
331
|
-
```
|
|
327
|
+
### [Install Deno](https://deno.land/#installation)
|
|
332
328
|
|
|
333
329
|
### Database
|
|
334
330
|
|
|
335
331
|
Create a new redis database on [upstash](https://console.upstash.com/) and copy
|
|
336
|
-
the url and token
|
|
332
|
+
the url and token
|
|
337
333
|
|
|
338
334
|
### Running tests
|
|
339
335
|
|
|
340
336
|
```sh
|
|
341
|
-
|
|
337
|
+
UPSTASH_REDIS_REST_URL=".." UPSTASH_REDIS_REST_TOKEN=".." deno test -A
|
|
342
338
|
```
|
package/esm/platforms/nodejs.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// deno-lint-ignore-file
|
|
2
2
|
import * as core from "../pkg/redis.js";
|
|
3
3
|
import { UpstashError } from "../pkg/error.js";
|
|
4
|
+
// @ts-ignore Deno can't compile
|
|
5
|
+
// import https from "https";
|
|
6
|
+
// @ts-ignore Deno can't compile
|
|
7
|
+
// import http from "http";
|
|
4
8
|
import "isomorphic-fetch";
|
|
5
9
|
/**
|
|
6
10
|
* Serverless redis client for upstash.
|
|
@@ -14,7 +18,7 @@ export class Redis extends core.Redis {
|
|
|
14
18
|
const client = defaultRequester({
|
|
15
19
|
baseUrl: configOrRequester.url,
|
|
16
20
|
headers: { authorization: `Bearer ${configOrRequester.token}` },
|
|
17
|
-
agent: configOrRequester.agent,
|
|
21
|
+
// agent: configOrRequester.agent,
|
|
18
22
|
});
|
|
19
23
|
super(client, {
|
|
20
24
|
automaticDeserialization: configOrRequester.automaticDeserialization,
|
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.3.
|
|
6
|
+
"version": "v1.3.4",
|
|
7
7
|
"description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"https": false
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"encoding": "latest",
|
|
31
32
|
"isomorphic-fetch": "^3.0.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
@@ -27,6 +27,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
27
|
exports.Redis = void 0;
|
|
28
28
|
const core = __importStar(require("../pkg/redis.js"));
|
|
29
29
|
const error_js_1 = require("../pkg/error.js");
|
|
30
|
+
// @ts-ignore Deno can't compile
|
|
31
|
+
// import https from "https";
|
|
32
|
+
// @ts-ignore Deno can't compile
|
|
33
|
+
// import http from "http";
|
|
30
34
|
require("isomorphic-fetch");
|
|
31
35
|
/**
|
|
32
36
|
* Serverless redis client for upstash.
|
|
@@ -40,7 +44,7 @@ class Redis extends core.Redis {
|
|
|
40
44
|
const client = defaultRequester({
|
|
41
45
|
baseUrl: configOrRequester.url,
|
|
42
46
|
headers: { authorization: `Bearer ${configOrRequester.token}` },
|
|
43
|
-
agent: configOrRequester.agent,
|
|
47
|
+
// agent: configOrRequester.agent,
|
|
44
48
|
});
|
|
45
49
|
super(client, {
|
|
46
50
|
automaticDeserialization: configOrRequester.automaticDeserialization,
|
package/types/pkg/redis.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DelCommand, ExistsCommand, FlushAllCommand, PingCommand, ScoreMember, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
|
|
1
|
+
import { CommandOptions, DelCommand, ExistsCommand, FlushAllCommand, PingCommand, ScoreMember, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
|
|
2
2
|
import { Requester } from "./http.js";
|
|
3
3
|
import { Pipeline } from "./pipeline.js";
|
|
4
4
|
import type { CommandArgs } from "./types.js";
|
|
@@ -14,8 +14,8 @@ export declare type RedisOptions = {
|
|
|
14
14
|
* Serverless redis client for upstash.
|
|
15
15
|
*/
|
|
16
16
|
export declare class Redis {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
protected readonly client: Requester;
|
|
18
|
+
protected opts?: CommandOptions<any, any>;
|
|
19
19
|
/**
|
|
20
20
|
* Create a new redis client
|
|
21
21
|
*
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as core from "../pkg/redis.js";
|
|
2
2
|
import { Requester, UpstashRequest, UpstashResponse } from "../pkg/http.js";
|
|
3
|
-
import https from "https";
|
|
4
|
-
import http from "http";
|
|
5
3
|
import "isomorphic-fetch";
|
|
6
4
|
export type { Requester, UpstashRequest, UpstashResponse };
|
|
7
5
|
/**
|
|
@@ -17,22 +15,6 @@ export declare type RedisConfigNodejs = {
|
|
|
17
15
|
* UPSTASH_REDIS_REST_TOKEN
|
|
18
16
|
*/
|
|
19
17
|
token: string;
|
|
20
|
-
/**
|
|
21
|
-
* An agent allows you to reuse connections to reduce latency for multiple sequential requests.
|
|
22
|
-
*
|
|
23
|
-
* This is a node specific implementation and is not supported in various runtimes like Vercel
|
|
24
|
-
* edge functions.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* import https from "https"
|
|
29
|
-
*
|
|
30
|
-
* const options: RedisConfigNodejs = {
|
|
31
|
-
* agent: new https.Agent({ keepAlive: true })
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
agent?: http.Agent | https.Agent;
|
|
36
18
|
} & core.RedisOptions;
|
|
37
19
|
/**
|
|
38
20
|
* Serverless redis client for upstash.
|