@upstash/redis 1.9.0 → 1.10.0
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/commands/sdiffstore.js +1 -1
- package/esm/pkg/redis.js +13 -0
- package/package.json +1 -1
- package/script/pkg/commands/sdiffstore.js +1 -1
- package/script/pkg/redis.js +13 -0
- package/types/pkg/commands/sdiffstore.d.ts +1 -1
- package/types/pkg/commands/spop.d.ts +2 -2
- package/types/pkg/redis.d.ts +6 -2
package/esm/pkg/redis.js
CHANGED
|
@@ -28,6 +28,19 @@ export class Redis {
|
|
|
28
28
|
writable: true,
|
|
29
29
|
value: void 0
|
|
30
30
|
});
|
|
31
|
+
/**
|
|
32
|
+
* Wrap a new middleware around the HTTP client.
|
|
33
|
+
*/
|
|
34
|
+
Object.defineProperty(this, "use", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
configurable: true,
|
|
37
|
+
writable: true,
|
|
38
|
+
value: (middleware) => {
|
|
39
|
+
console.warn("use");
|
|
40
|
+
const makeRequest = this.client.request.bind(this.client);
|
|
41
|
+
this.client.request = (req) => middleware(req, makeRequest);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
31
44
|
/**
|
|
32
45
|
* Create a new pipeline that allows you to send requests in bulk.
|
|
33
46
|
*
|
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.
|
|
6
|
+
"version": "v1.10.0",
|
|
7
7
|
"description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SDiffStoreCommand = void 0;
|
|
4
4
|
const command_js_1 = require("./command.js");
|
|
5
5
|
/**
|
|
6
|
-
* @see https://redis.io/commands/
|
|
6
|
+
* @see https://redis.io/commands/sdiffstore
|
|
7
7
|
*/
|
|
8
8
|
class SDiffStoreCommand extends command_js_1.Command {
|
|
9
9
|
constructor(cmd, opts) {
|
package/script/pkg/redis.js
CHANGED
|
@@ -31,6 +31,19 @@ class Redis {
|
|
|
31
31
|
writable: true,
|
|
32
32
|
value: void 0
|
|
33
33
|
});
|
|
34
|
+
/**
|
|
35
|
+
* Wrap a new middleware around the HTTP client.
|
|
36
|
+
*/
|
|
37
|
+
Object.defineProperty(this, "use", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: (middleware) => {
|
|
42
|
+
console.warn("use");
|
|
43
|
+
const makeRequest = this.client.request.bind(this.client);
|
|
44
|
+
this.client.request = (req) => middleware(req, makeRequest);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
34
47
|
/**
|
|
35
48
|
* Create a new pipeline that allows you to send requests in bulk.
|
|
36
49
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, CommandOptions } from "./command.js";
|
|
2
2
|
/**
|
|
3
|
-
* @see https://redis.io/commands/
|
|
3
|
+
* @see https://redis.io/commands/sdiffstore
|
|
4
4
|
*/
|
|
5
5
|
export declare class SDiffStoreCommand extends Command<number, number> {
|
|
6
6
|
constructor(cmd: [destination: string, ...keys: string[]], opts?: CommandOptions<number, number>);
|
|
@@ -2,6 +2,6 @@ import { Command, CommandOptions } from "./command.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* @see https://redis.io/commands/spop
|
|
4
4
|
*/
|
|
5
|
-
export declare class SPopCommand<TData> extends Command<string | null, TData | null> {
|
|
6
|
-
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | null, TData | null>);
|
|
5
|
+
export declare class SPopCommand<TData> extends Command<string | string[] | null, TData | null> {
|
|
6
|
+
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | string[] | null, TData | null>);
|
|
7
7
|
}
|
package/types/pkg/redis.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandOptions, DelCommand, ExistsCommand, FlushAllCommand, PingCommand, ScoreMember, ScriptExistsCommand, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
|
|
2
|
-
import { Requester } from "./http.js";
|
|
2
|
+
import { Requester, UpstashRequest, UpstashResponse } from "./http.js";
|
|
3
3
|
import { Pipeline } from "./pipeline.js";
|
|
4
4
|
import type { CommandArgs } from "./types.js";
|
|
5
5
|
export declare type RedisOptions = {
|
|
@@ -14,7 +14,7 @@ export declare type RedisOptions = {
|
|
|
14
14
|
* Serverless redis client for upstash.
|
|
15
15
|
*/
|
|
16
16
|
export declare class Redis {
|
|
17
|
-
protected
|
|
17
|
+
protected client: Requester;
|
|
18
18
|
protected opts?: CommandOptions<any, any>;
|
|
19
19
|
/**
|
|
20
20
|
* Create a new redis client
|
|
@@ -28,6 +28,10 @@ export declare class Redis {
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
constructor(client: Requester, opts?: RedisOptions);
|
|
31
|
+
/**
|
|
32
|
+
* Wrap a new middleware around the HTTP client.
|
|
33
|
+
*/
|
|
34
|
+
use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
|
|
31
35
|
/**
|
|
32
36
|
* Create a new pipeline that allows you to send requests in bulk.
|
|
33
37
|
*
|