@upstash/redis 1.16.0-next.2 → 1.16.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/getdel.js +9 -0
- package/esm/pkg/commands/mod.js +1 -0
- package/esm/pkg/http.js +2 -1
- package/esm/pkg/pipeline.js +10 -1
- package/esm/pkg/redis.js +10 -1
- package/esm/platforms/nodejs.js +1 -1
- package/package.json +2 -2
- package/script/pkg/commands/getdel.js +13 -0
- package/script/pkg/commands/mod.js +1 -0
- package/script/pkg/http.js +2 -1
- package/script/pkg/pipeline.js +9 -0
- package/script/pkg/redis.js +9 -0
- package/script/platforms/nodejs.js +1 -1
- package/types/pkg/commands/getdel.d.ts +7 -0
- package/types/pkg/commands/mod.d.ts +1 -0
- package/types/pkg/http.d.ts +2 -0
- package/types/pkg/pipeline.d.ts +4 -0
- package/types/pkg/redis.d.ts +4 -0
- package/types/platforms/nodejs.d.ts +1 -0
package/esm/pkg/commands/mod.js
CHANGED
package/esm/pkg/http.js
CHANGED
|
@@ -31,7 +31,7 @@ export class HttpClient {
|
|
|
31
31
|
"Upstash-Encoding": "base64",
|
|
32
32
|
...config.headers,
|
|
33
33
|
};
|
|
34
|
-
this.options = { backend: config.options?.backend };
|
|
34
|
+
this.options = { backend: config.options?.backend, agent: config.agent };
|
|
35
35
|
if (typeof config?.retry === "boolean" && config?.retry === false) {
|
|
36
36
|
this.retry = {
|
|
37
37
|
attempts: 1,
|
|
@@ -52,6 +52,7 @@ export class HttpClient {
|
|
|
52
52
|
headers: this.headers,
|
|
53
53
|
body: JSON.stringify(req.body),
|
|
54
54
|
keepalive: true,
|
|
55
|
+
agent: this.options?.agent,
|
|
55
56
|
/**
|
|
56
57
|
* Fastly specific
|
|
57
58
|
*/
|
package/esm/pkg/pipeline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, LPopCommand, LPosCommand, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PersistCommand, PExpireAtCommand, PExpireCommand, PingCommand, PSetEXCommand, PTtlCommand, PublishCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, RPopCommand, RPushCommand, RPushXCommand, SAddCommand, ScanCommand, SCardCommand, ScriptExistsCommand, ScriptFlushCommand, ScriptLoadCommand, SDiffCommand, SDiffStoreCommand, SetBitCommand, SetCommand, SetExCommand, SetNxCommand, SetRangeCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, StrLenCommand, SUnionCommand, SUnionStoreCommand, TimeCommand, TouchCommand, TtlCommand, TypeCommand, UnlinkCommand, ZAddCommand, ZCardCommand, ZCountCommand, ZIncrByCommand, ZInterStoreCommand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRangeCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand, ZUnionStoreCommand, } from "./commands/mod.js";
|
|
1
|
+
import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetDelCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, LPopCommand, LPosCommand, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PersistCommand, PExpireAtCommand, PExpireCommand, PingCommand, PSetEXCommand, PTtlCommand, PublishCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, RPopCommand, RPushCommand, RPushXCommand, SAddCommand, ScanCommand, SCardCommand, ScriptExistsCommand, ScriptFlushCommand, ScriptLoadCommand, SDiffCommand, SDiffStoreCommand, SetBitCommand, SetCommand, SetExCommand, SetNxCommand, SetRangeCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, StrLenCommand, SUnionCommand, SUnionStoreCommand, TimeCommand, TouchCommand, TtlCommand, TypeCommand, UnlinkCommand, ZAddCommand, ZCardCommand, ZCountCommand, ZIncrByCommand, ZInterStoreCommand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRangeCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand, ZUnionStoreCommand, } from "./commands/mod.js";
|
|
2
2
|
import { UpstashError } from "./error.js";
|
|
3
3
|
import { ZMScoreCommand } from "./commands/zmscore.js";
|
|
4
4
|
/**
|
|
@@ -258,6 +258,15 @@ export class Pipeline {
|
|
|
258
258
|
writable: true,
|
|
259
259
|
value: (...args) => this.chain(new GetBitCommand(args, this.commandOptions))
|
|
260
260
|
});
|
|
261
|
+
/**
|
|
262
|
+
* @see https://redis.io/commands/getdel
|
|
263
|
+
*/
|
|
264
|
+
Object.defineProperty(this, "getdel", {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
configurable: true,
|
|
267
|
+
writable: true,
|
|
268
|
+
value: (...args) => this.chain(new GetDelCommand(args, this.commandOptions))
|
|
269
|
+
});
|
|
261
270
|
/**
|
|
262
271
|
* @see https://redis.io/commands/getrange
|
|
263
272
|
*/
|
package/esm/pkg/redis.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, LPopCommand, LPosCommand, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PersistCommand, PExpireAtCommand, PExpireCommand, PingCommand, PSetEXCommand, PTtlCommand, PublishCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, RPopCommand, RPushCommand, RPushXCommand, SAddCommand, ScanCommand, SCardCommand, ScriptExistsCommand, ScriptFlushCommand, ScriptLoadCommand, SDiffCommand, SDiffStoreCommand, SetBitCommand, SetCommand, SetExCommand, SetNxCommand, SetRangeCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, StrLenCommand, SUnionCommand, SUnionStoreCommand, TimeCommand, TouchCommand, TtlCommand, TypeCommand, UnlinkCommand, ZAddCommand, ZCardCommand, ZCountCommand, ZIncrByCommand, ZInterStoreCommand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRangeCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand, ZUnionStoreCommand, } from "./commands/mod.js";
|
|
1
|
+
import { AppendCommand, BitCountCommand, BitOpCommand, BitPosCommand, DBSizeCommand, DecrByCommand, DecrCommand, DelCommand, EchoCommand, EvalCommand, EvalshaCommand, ExistsCommand, ExpireAtCommand, ExpireCommand, FlushAllCommand, FlushDBCommand, GetBitCommand, GetCommand, GetDelCommand, GetRangeCommand, GetSetCommand, HDelCommand, HExistsCommand, HGetAllCommand, HGetCommand, HIncrByCommand, HIncrByFloatCommand, HKeysCommand, HLenCommand, HMGetCommand, HMSetCommand, HScanCommand, HSetCommand, HSetNXCommand, HStrLenCommand, HValsCommand, IncrByCommand, IncrByFloatCommand, IncrCommand, KeysCommand, LIndexCommand, LInsertCommand, LLenCommand, LPopCommand, LPosCommand, LPushCommand, LPushXCommand, LRangeCommand, LRemCommand, LSetCommand, LTrimCommand, MGetCommand, MSetCommand, MSetNXCommand, PersistCommand, PExpireAtCommand, PExpireCommand, PingCommand, PSetEXCommand, PTtlCommand, PublishCommand, RandomKeyCommand, RenameCommand, RenameNXCommand, RPopCommand, RPushCommand, RPushXCommand, SAddCommand, ScanCommand, SCardCommand, ScriptExistsCommand, ScriptFlushCommand, ScriptLoadCommand, SDiffCommand, SDiffStoreCommand, SetBitCommand, SetCommand, SetExCommand, SetNxCommand, SetRangeCommand, SInterCommand, SInterStoreCommand, SIsMemberCommand, SMembersCommand, SMoveCommand, SPopCommand, SRandMemberCommand, SRemCommand, SScanCommand, StrLenCommand, SUnionCommand, SUnionStoreCommand, TimeCommand, TouchCommand, TtlCommand, TypeCommand, UnlinkCommand, ZAddCommand, ZCardCommand, ZCountCommand, ZIncrByCommand, ZInterStoreCommand, ZLexCountCommand, ZPopMaxCommand, ZPopMinCommand, ZRangeCommand, ZRankCommand, ZRemCommand, ZRemRangeByLexCommand, ZRemRangeByRankCommand, ZRemRangeByScoreCommand, ZRevRankCommand, ZScanCommand, ZScoreCommand, ZUnionStoreCommand, } from "./commands/mod.js";
|
|
2
2
|
import { Pipeline } from "./pipeline.js";
|
|
3
3
|
import { Script } from "./script.js";
|
|
4
4
|
import { ZMScoreCommand } from "./commands/zmscore.js";
|
|
@@ -238,6 +238,15 @@ export class Redis {
|
|
|
238
238
|
writable: true,
|
|
239
239
|
value: (...args) => new GetBitCommand(args, this.opts).exec(this.client)
|
|
240
240
|
});
|
|
241
|
+
/**
|
|
242
|
+
* @see https://redis.io/commands/getdel
|
|
243
|
+
*/
|
|
244
|
+
Object.defineProperty(this, "getdel", {
|
|
245
|
+
enumerable: true,
|
|
246
|
+
configurable: true,
|
|
247
|
+
writable: true,
|
|
248
|
+
value: (...args) => new GetDelCommand(args, this.opts).exec(this.client)
|
|
249
|
+
});
|
|
241
250
|
/**
|
|
242
251
|
* @see https://redis.io/commands/getrange
|
|
243
252
|
*/
|
package/esm/platforms/nodejs.js
CHANGED
|
@@ -24,7 +24,7 @@ export class Redis extends core.Redis {
|
|
|
24
24
|
baseUrl: configOrRequester.url,
|
|
25
25
|
retry: configOrRequester.retry,
|
|
26
26
|
headers: { authorization: `Bearer ${configOrRequester.token}` },
|
|
27
|
-
|
|
27
|
+
agent: configOrRequester.agent,
|
|
28
28
|
});
|
|
29
29
|
super(client, {
|
|
30
30
|
automaticDeserialization: configOrRequester.automaticDeserialization,
|
package/package.json
CHANGED
|
@@ -3,6 +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.16.0",
|
|
6
7
|
"description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
@@ -58,6 +59,5 @@
|
|
|
58
59
|
"require": "./script/platforms/node_with_fetch.js",
|
|
59
60
|
"types": "./types/platforms/node_with_fetch.d.ts"
|
|
60
61
|
}
|
|
61
|
-
}
|
|
62
|
-
"version": "1.16.0-next.2"
|
|
62
|
+
}
|
|
63
63
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetDelCommand = void 0;
|
|
4
|
+
const command_js_1 = require("./command.js");
|
|
5
|
+
/**
|
|
6
|
+
* @see https://redis.io/commands/getdel
|
|
7
|
+
*/
|
|
8
|
+
class GetDelCommand extends command_js_1.Command {
|
|
9
|
+
constructor(cmd, opts) {
|
|
10
|
+
super(["getdel", ...cmd], opts);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.GetDelCommand = GetDelCommand;
|
|
@@ -35,6 +35,7 @@ __exportStar(require("./get.js"), exports);
|
|
|
35
35
|
__exportStar(require("./getbit.js"), exports);
|
|
36
36
|
__exportStar(require("./getrange.js"), exports);
|
|
37
37
|
__exportStar(require("./getset.js"), exports);
|
|
38
|
+
__exportStar(require("./getdel.js"), exports);
|
|
38
39
|
__exportStar(require("./hdel.js"), exports);
|
|
39
40
|
__exportStar(require("./hexists.js"), exports);
|
|
40
41
|
__exportStar(require("./hget.js"), exports);
|
package/script/pkg/http.js
CHANGED
|
@@ -34,7 +34,7 @@ class HttpClient {
|
|
|
34
34
|
"Upstash-Encoding": "base64",
|
|
35
35
|
...config.headers,
|
|
36
36
|
};
|
|
37
|
-
this.options = { backend: config.options?.backend };
|
|
37
|
+
this.options = { backend: config.options?.backend, agent: config.agent };
|
|
38
38
|
if (typeof config?.retry === "boolean" && config?.retry === false) {
|
|
39
39
|
this.retry = {
|
|
40
40
|
attempts: 1,
|
|
@@ -55,6 +55,7 @@ class HttpClient {
|
|
|
55
55
|
headers: this.headers,
|
|
56
56
|
body: JSON.stringify(req.body),
|
|
57
57
|
keepalive: true,
|
|
58
|
+
agent: this.options?.agent,
|
|
58
59
|
/**
|
|
59
60
|
* Fastly specific
|
|
60
61
|
*/
|
package/script/pkg/pipeline.js
CHANGED
|
@@ -261,6 +261,15 @@ class Pipeline {
|
|
|
261
261
|
writable: true,
|
|
262
262
|
value: (...args) => this.chain(new mod_js_1.GetBitCommand(args, this.commandOptions))
|
|
263
263
|
});
|
|
264
|
+
/**
|
|
265
|
+
* @see https://redis.io/commands/getdel
|
|
266
|
+
*/
|
|
267
|
+
Object.defineProperty(this, "getdel", {
|
|
268
|
+
enumerable: true,
|
|
269
|
+
configurable: true,
|
|
270
|
+
writable: true,
|
|
271
|
+
value: (...args) => this.chain(new mod_js_1.GetDelCommand(args, this.commandOptions))
|
|
272
|
+
});
|
|
264
273
|
/**
|
|
265
274
|
* @see https://redis.io/commands/getrange
|
|
266
275
|
*/
|
package/script/pkg/redis.js
CHANGED
|
@@ -241,6 +241,15 @@ class Redis {
|
|
|
241
241
|
writable: true,
|
|
242
242
|
value: (...args) => new mod_js_1.GetBitCommand(args, this.opts).exec(this.client)
|
|
243
243
|
});
|
|
244
|
+
/**
|
|
245
|
+
* @see https://redis.io/commands/getdel
|
|
246
|
+
*/
|
|
247
|
+
Object.defineProperty(this, "getdel", {
|
|
248
|
+
enumerable: true,
|
|
249
|
+
configurable: true,
|
|
250
|
+
writable: true,
|
|
251
|
+
value: (...args) => new mod_js_1.GetDelCommand(args, this.opts).exec(this.client)
|
|
252
|
+
});
|
|
244
253
|
/**
|
|
245
254
|
* @see https://redis.io/commands/getrange
|
|
246
255
|
*/
|
|
@@ -50,7 +50,7 @@ class Redis extends core.Redis {
|
|
|
50
50
|
baseUrl: configOrRequester.url,
|
|
51
51
|
retry: configOrRequester.retry,
|
|
52
52
|
headers: { authorization: `Bearer ${configOrRequester.token}` },
|
|
53
|
-
|
|
53
|
+
agent: configOrRequester.agent,
|
|
54
54
|
});
|
|
55
55
|
super(client, {
|
|
56
56
|
automaticDeserialization: configOrRequester.automaticDeserialization,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command, CommandOptions } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://redis.io/commands/getdel
|
|
4
|
+
*/
|
|
5
|
+
export declare class GetDelCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
6
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
7
|
+
}
|
package/types/pkg/http.d.ts
CHANGED
|
@@ -37,12 +37,14 @@ export declare type HttpClientConfig = {
|
|
|
37
37
|
baseUrl: string;
|
|
38
38
|
options?: Options;
|
|
39
39
|
retry?: RetryConfig;
|
|
40
|
+
agent?: any;
|
|
40
41
|
};
|
|
41
42
|
export declare class HttpClient implements Requester {
|
|
42
43
|
baseUrl: string;
|
|
43
44
|
headers: Record<string, string>;
|
|
44
45
|
readonly options?: {
|
|
45
46
|
backend?: string;
|
|
47
|
+
agent: any;
|
|
46
48
|
};
|
|
47
49
|
readonly retry: {
|
|
48
50
|
attempts: number;
|
package/types/pkg/pipeline.d.ts
CHANGED
|
@@ -143,6 +143,10 @@ export declare class Pipeline {
|
|
|
143
143
|
* @see https://redis.io/commands/getbit
|
|
144
144
|
*/
|
|
145
145
|
getbit: (key: string, offset: number) => this;
|
|
146
|
+
/**
|
|
147
|
+
* @see https://redis.io/commands/getdel
|
|
148
|
+
*/
|
|
149
|
+
getdel: <TData>(key: string) => this;
|
|
146
150
|
/**
|
|
147
151
|
* @see https://redis.io/commands/getrange
|
|
148
152
|
*/
|
package/types/pkg/redis.d.ts
CHANGED
|
@@ -127,6 +127,10 @@ export declare class Redis {
|
|
|
127
127
|
* @see https://redis.io/commands/getbit
|
|
128
128
|
*/
|
|
129
129
|
getbit: (key: string, offset: number) => Promise<0 | 1>;
|
|
130
|
+
/**
|
|
131
|
+
* @see https://redis.io/commands/getdel
|
|
132
|
+
*/
|
|
133
|
+
getdel: <TData>(key: string) => Promise<TData | null>;
|
|
130
134
|
/**
|
|
131
135
|
* @see https://redis.io/commands/getrange
|
|
132
136
|
*/
|