@upstash/redis 1.19.3 → 1.20.0-canary.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.
Files changed (94) hide show
  1. package/README.md +1 -1
  2. package/esm/pkg/commands/command.js +12 -3
  3. package/esm/pkg/commands/json_arrappend.js +9 -0
  4. package/esm/pkg/commands/json_arrindex.js +9 -0
  5. package/esm/pkg/commands/json_arrinsert.js +9 -0
  6. package/esm/pkg/commands/json_arrlen.js +9 -0
  7. package/esm/pkg/commands/json_arrpop.js +9 -0
  8. package/esm/pkg/commands/json_arrtrim.js +12 -0
  9. package/esm/pkg/commands/json_clear.js +9 -0
  10. package/esm/pkg/commands/json_del.js +9 -0
  11. package/esm/pkg/commands/json_forget.js +9 -0
  12. package/esm/pkg/commands/json_get.js +30 -0
  13. package/esm/pkg/commands/json_mget.js +9 -0
  14. package/esm/pkg/commands/json_numincrby.js +9 -0
  15. package/esm/pkg/commands/json_nummultby.js +9 -0
  16. package/esm/pkg/commands/json_objkeys.js +9 -0
  17. package/esm/pkg/commands/json_objlen.js +9 -0
  18. package/esm/pkg/commands/json_resp.js +9 -0
  19. package/esm/pkg/commands/json_set.js +18 -0
  20. package/esm/pkg/commands/json_strappend.js +9 -0
  21. package/esm/pkg/commands/json_strlen.js +9 -0
  22. package/esm/pkg/commands/json_toggle.js +9 -0
  23. package/esm/pkg/commands/json_type.js +9 -0
  24. package/esm/pkg/commands/mod.js +22 -1
  25. package/esm/pkg/pipeline.js +93 -1
  26. package/esm/pkg/redis.js +89 -1
  27. package/esm/version.js +1 -1
  28. package/package.json +41 -16
  29. package/script/pkg/commands/command.js +12 -3
  30. package/script/pkg/commands/json_arrappend.js +13 -0
  31. package/script/pkg/commands/json_arrindex.js +13 -0
  32. package/script/pkg/commands/json_arrinsert.js +13 -0
  33. package/script/pkg/commands/json_arrlen.js +13 -0
  34. package/script/pkg/commands/json_arrpop.js +13 -0
  35. package/script/pkg/commands/json_arrtrim.js +16 -0
  36. package/script/pkg/commands/json_clear.js +13 -0
  37. package/script/pkg/commands/json_del.js +13 -0
  38. package/script/pkg/commands/json_forget.js +13 -0
  39. package/script/pkg/commands/json_get.js +34 -0
  40. package/script/pkg/commands/json_mget.js +13 -0
  41. package/script/pkg/commands/json_numincrby.js +13 -0
  42. package/script/pkg/commands/json_nummultby.js +13 -0
  43. package/script/pkg/commands/json_objkeys.js +13 -0
  44. package/script/pkg/commands/json_objlen.js +13 -0
  45. package/script/pkg/commands/json_resp.js +13 -0
  46. package/script/pkg/commands/json_set.js +22 -0
  47. package/script/pkg/commands/json_strappend.js +13 -0
  48. package/script/pkg/commands/json_strlen.js +13 -0
  49. package/script/pkg/commands/json_toggle.js +13 -0
  50. package/script/pkg/commands/json_type.js +13 -0
  51. package/script/pkg/commands/mod.js +22 -1
  52. package/script/pkg/pipeline.js +92 -0
  53. package/script/pkg/redis.js +88 -0
  54. package/script/version.js +1 -1
  55. package/types/pkg/commands/command.d.ts +5 -5
  56. package/types/pkg/commands/json_arrappend.d.ts +7 -0
  57. package/types/pkg/commands/json_arrindex.d.ts +13 -0
  58. package/types/pkg/commands/json_arrinsert.d.ts +7 -0
  59. package/types/pkg/commands/json_arrlen.d.ts +7 -0
  60. package/types/pkg/commands/json_arrpop.d.ts +7 -0
  61. package/types/pkg/commands/json_arrtrim.d.ts +7 -0
  62. package/types/pkg/commands/json_clear.d.ts +7 -0
  63. package/types/pkg/commands/json_del.d.ts +7 -0
  64. package/types/pkg/commands/json_forget.d.ts +7 -0
  65. package/types/pkg/commands/json_get.d.ts +15 -0
  66. package/types/pkg/commands/json_mget.d.ts +7 -0
  67. package/types/pkg/commands/json_numincrby.d.ts +7 -0
  68. package/types/pkg/commands/json_nummultby.d.ts +7 -0
  69. package/types/pkg/commands/json_objkeys.d.ts +7 -0
  70. package/types/pkg/commands/json_objlen.d.ts +7 -0
  71. package/types/pkg/commands/json_resp.d.ts +7 -0
  72. package/types/pkg/commands/json_set.d.ts +18 -0
  73. package/types/pkg/commands/json_strappend.d.ts +7 -0
  74. package/types/pkg/commands/json_strlen.d.ts +7 -0
  75. package/types/pkg/commands/json_toggle.d.ts +7 -0
  76. package/types/pkg/commands/json_type.d.ts +7 -0
  77. package/types/pkg/commands/mod.d.ts +22 -1
  78. package/types/pkg/commands/scan.d.ts +1 -1
  79. package/types/pkg/commands/script_flush.d.ts +1 -1
  80. package/types/pkg/commands/set.d.ts +1 -1
  81. package/types/pkg/commands/type.d.ts +1 -1
  82. package/types/pkg/commands/zadd.d.ts +3 -3
  83. package/types/pkg/commands/zinterstore.d.ts +1 -1
  84. package/types/pkg/commands/zrange.d.ts +1 -1
  85. package/types/pkg/commands/zunionstore.d.ts +1 -1
  86. package/types/pkg/http.d.ts +6 -6
  87. package/types/pkg/pipeline.d.ts +27 -1
  88. package/types/pkg/redis.d.ts +94 -11
  89. package/types/pkg/types.d.ts +11 -2
  90. package/types/platforms/cloudflare.d.ts +2 -2
  91. package/types/platforms/fastly.d.ts +1 -1
  92. package/types/platforms/node_with_fetch.d.ts +1 -1
  93. package/types/platforms/nodejs.d.ts +1 -1
  94. package/types/version.d.ts +1 -1
@@ -0,0 +1,13 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.arrindex
4
+ */
5
+ export declare class JsonArrIndexCommand<TValue extends unknown> extends Command<(null | string)[], (null | number)[]> {
6
+ constructor(cmd: [
7
+ key: string,
8
+ path: string,
9
+ value: TValue,
10
+ start?: number,
11
+ stop?: number
12
+ ], opts?: CommandOptions<(null | string)[], (null | number)[]>);
13
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.arrinsert
4
+ */
5
+ export declare class JsonArrInsertCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
6
+ constructor(cmd: [key: string, path: string, index: number, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.arrlen
4
+ */
5
+ export declare class JsonArrLenCommand<TValue extends unknown> extends Command<(null | string)[], (null | number)[]> {
6
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.arrpop
4
+ */
5
+ export declare class JsonArrPopCommand<TData extends unknown> extends Command<(null | string)[], (TData | null)[]> {
6
+ constructor(cmd: [key: string, path?: string, index?: number], opts?: CommandOptions<(null | string)[], (TData | null)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.arrtrim
4
+ */
5
+ export declare class JsonArrTrimCommand extends Command<(null | string)[], (null | number)[]> {
6
+ constructor(cmd: [key: string, path?: string, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.clear
4
+ */
5
+ export declare class JsonClearCommand extends Command<number, number> {
6
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.del
4
+ */
5
+ export declare class JsonDelCommand extends Command<number, number> {
6
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.forget
4
+ */
5
+ export declare class JsonForgetCommand extends Command<number, number> {
6
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
7
+ }
@@ -0,0 +1,15 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.get
4
+ */
5
+ export declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) | (unknown | Record<string, unknown>)[]> extends Command<TData | null, TData | null> {
6
+ constructor(cmd: [
7
+ key: string,
8
+ opts?: {
9
+ indent?: string;
10
+ newline?: string;
11
+ space?: string;
12
+ },
13
+ ...path: string[]
14
+ ] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
15
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.mget
4
+ */
5
+ export declare class JsonMGetCommand<TData extends (unknown | Record<string, unknown>)[]> extends Command<TData, TData> {
6
+ constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.numincrby
4
+ */
5
+ export declare class JsonNumIncrByCommand extends Command<(null | string)[], (null | number)[]> {
6
+ constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.nummultby
4
+ */
5
+ export declare class JsonNumMultByCommand extends Command<(null | string)[], (null | number)[]> {
6
+ constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.objkeys
4
+ */
5
+ export declare class JsonObjKeysCommand extends Command<(string[] | null)[], (string[] | null)[]> {
6
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(string[] | null)[], (string[] | null)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.objlen
4
+ */
5
+ export declare class JsonObjLenCommand extends Command<(number | null)[], (number | null)[]> {
6
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.resp
4
+ */
5
+ export declare class JsonRespCommand<TData extends unknown[]> extends Command<TData, TData> {
6
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<TData, TData>);
7
+ }
@@ -0,0 +1,18 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.set
4
+ */
5
+ export declare class JsonSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
6
+ constructor(cmd: [
7
+ key: string,
8
+ path: string,
9
+ value: TData,
10
+ opts?: {
11
+ nx: true;
12
+ xx?: never;
13
+ } | {
14
+ nx?: never;
15
+ xx: true;
16
+ }
17
+ ], opts?: CommandOptions<"OK" | null, "OK" | null>);
18
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.strappend
4
+ */
5
+ export declare class JsonStrAppendCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
6
+ constructor(cmd: [key: string, path: string, value: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.strlen
4
+ */
5
+ export declare class JsonStrLenCommand extends Command<(number | null)[], (number | null)[]> {
6
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.toggle
4
+ */
5
+ export declare class JsonToggleCommand extends Command<number[], number[]> {
6
+ constructor(cmd: [key: string, path: string], opts?: CommandOptions<number[], number[]>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.type
4
+ */
5
+ export declare class JsonTypeCommand extends Command<string[], string[]> {
6
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<string[], string[]>);
7
+ }
@@ -23,7 +23,6 @@ export * from "./getset.js";
23
23
  export * from "./hdel.js";
24
24
  export * from "./hexists.js";
25
25
  export * from "./hget.js";
26
- export * from "./smismember.js";
27
26
  export * from "./hgetall.js";
28
27
  export * from "./hincrby.js";
29
28
  export * from "./hincrbyfloat.js";
@@ -40,6 +39,27 @@ export * from "./hvals.js";
40
39
  export * from "./incr.js";
41
40
  export * from "./incrby.js";
42
41
  export * from "./incrbyfloat.js";
42
+ export * from "./json_arrappend.js";
43
+ export * from "./json_arrindex.js";
44
+ export * from "./json_arrinsert.js";
45
+ export * from "./json_arrlen.js";
46
+ export * from "./json_arrpop.js";
47
+ export * from "./json_arrtrim.js";
48
+ export * from "./json_clear.js";
49
+ export * from "./json_del.js";
50
+ export * from "./json_forget.js";
51
+ export * from "./json_get.js";
52
+ export * from "./json_mget.js";
53
+ export * from "./json_numincrby.js";
54
+ export * from "./json_nummultby.js";
55
+ export * from "./json_objkeys.js";
56
+ export * from "./json_objlen.js";
57
+ export * from "./json_resp.js";
58
+ export * from "./json_set.js";
59
+ export * from "./json_strappend.js";
60
+ export * from "./json_strlen.js";
61
+ export * from "./json_toggle.js";
62
+ export * from "./json_type.js";
43
63
  export * from "./keys.js";
44
64
  export * from "./lindex.js";
45
65
  export * from "./linsert.js";
@@ -86,6 +106,7 @@ export * from "./sinter.js";
86
106
  export * from "./sinterstore.js";
87
107
  export * from "./sismember.js";
88
108
  export * from "./smembers.js";
109
+ export * from "./smismember.js";
89
110
  export * from "./smove.js";
90
111
  export * from "./spop.js";
91
112
  export * from "./srandmember.js";
@@ -1,5 +1,5 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
- export declare type ScanCommandOptions = {
2
+ export type ScanCommandOptions = {
3
3
  match?: string;
4
4
  count?: number;
5
5
  type?: string;
@@ -1,5 +1,5 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
- export declare type ScriptFlushCommandOptions = {
2
+ export type ScriptFlushCommandOptions = {
3
3
  sync: true;
4
4
  async?: never;
5
5
  } | {
@@ -1,5 +1,5 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
- export declare type SetCommandOptions = {
2
+ export type SetCommandOptions = {
3
3
  get: boolean;
4
4
  } | ({
5
5
  ex: number;
@@ -1,5 +1,5 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
- export declare type Type = "string" | "list" | "set" | "zset" | "hash" | "none";
2
+ export type Type = "string" | "list" | "set" | "zset" | "hash" | "none";
3
3
  /**
4
4
  * @see https://redis.io/commands/type
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
- export declare type ZAddCommandOptions = ({
2
+ export type ZAddCommandOptions = ({
3
3
  nx: true;
4
4
  xx?: never;
5
5
  } | {
@@ -11,10 +11,10 @@ export declare type ZAddCommandOptions = ({
11
11
  }) & {
12
12
  ch?: true;
13
13
  };
14
- export declare type ZAddCommandOptionsWithIncr = ZAddCommandOptions & {
14
+ export type ZAddCommandOptionsWithIncr = ZAddCommandOptions & {
15
15
  incr: true;
16
16
  };
17
- export declare type ScoreMember<TData> = {
17
+ export type ScoreMember<TData> = {
18
18
  score: number;
19
19
  member: TData;
20
20
  };
@@ -1,5 +1,5 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
- export declare type ZInterStoreCommandOptions = {
2
+ export type ZInterStoreCommandOptions = {
3
3
  aggregate?: "sum" | "min" | "max";
4
4
  } & ({
5
5
  weight: number;
@@ -1,5 +1,5 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
- export declare type ZRangeCommandOptions = {
2
+ export type ZRangeCommandOptions = {
3
3
  withScores?: boolean;
4
4
  rev?: boolean;
5
5
  } & ({
@@ -1,5 +1,5 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
- export declare type ZUnionStoreCommandOptions = {
2
+ export type ZUnionStoreCommandOptions = {
3
3
  aggregate?: "sum" | "min" | "max";
4
4
  } & ({
5
5
  weight: number;
@@ -1,19 +1,19 @@
1
1
  import { Telemetry } from "./types.js";
2
- export declare type UpstashRequest = {
2
+ export type UpstashRequest = {
3
3
  path?: string[];
4
4
  /**
5
5
  * Request body will be serialized to json
6
6
  */
7
7
  body?: unknown;
8
8
  };
9
- export declare type UpstashResponse<TResult> = {
9
+ export type UpstashResponse<TResult> = {
10
10
  result?: TResult;
11
11
  error?: string;
12
12
  };
13
13
  export interface Requester {
14
14
  request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
15
15
  }
16
- export declare type RetryConfig = false | {
16
+ export type RetryConfig = false | {
17
17
  /**
18
18
  * The number of retries to attempt before giving up.
19
19
  *
@@ -30,10 +30,10 @@ export declare type RetryConfig = false | {
30
30
  */
31
31
  backoff?: (retryCount: number) => number;
32
32
  };
33
- export declare type Options = {
33
+ export type Options = {
34
34
  backend?: string;
35
35
  };
36
- export declare type RequesterConfig = {
36
+ export type RequesterConfig = {
37
37
  /**
38
38
  * Configure the retry behaviour in case of network errors
39
39
  */
@@ -62,7 +62,7 @@ export declare type RequesterConfig = {
62
62
  */
63
63
  responseEncoding?: false | "base64";
64
64
  };
65
- export declare type HttpClientConfig = {
65
+ export type HttpClientConfig = {
66
66
  headers?: Record<string, string>;
67
67
  baseUrl: string;
68
68
  options?: Options;
@@ -1,4 +1,4 @@
1
- import { DelCommand, ExistsCommand, FlushAllCommand, MGetCommand, PingCommand, ScoreMember, ScriptExistsCommand, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
1
+ import { DelCommand, ExistsCommand, FlushAllCommand, JsonArrAppendCommand, JsonArrIndexCommand, JsonArrInsertCommand, JsonArrLenCommand, JsonArrPopCommand, JsonArrTrimCommand, JsonClearCommand, JsonDelCommand, JsonForgetCommand, JsonGetCommand, JsonMGetCommand, JsonNumIncrByCommand, JsonNumMultByCommand, JsonObjKeysCommand, JsonObjLenCommand, JsonRespCommand, JsonSetCommand, JsonStrAppendCommand, JsonStrLenCommand, JsonToggleCommand, JsonTypeCommand, MGetCommand, PingCommand, ScoreMember, ScriptExistsCommand, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
2
2
  import { CommandOptions } from "./commands/command.js";
3
3
  import { Requester } from "./http.js";
4
4
  import { CommandArgs } from "./types.js";
@@ -574,4 +574,30 @@ export declare class Pipeline {
574
574
  * @see https://redis.io/commands/zunionstore
575
575
  */
576
576
  zunionstore: (destination: string, numKeys: number, keys: string[], opts?: import("./commands/zunionstore.js").ZUnionStoreCommandOptions | undefined) => this;
577
+ /**
578
+ * @see https://redis.io/commands/?group=json
579
+ */
580
+ get json(): {
581
+ arrappend: (...args: CommandArgs<typeof JsonArrAppendCommand>) => Pipeline;
582
+ arrindex: (...args: CommandArgs<typeof JsonArrIndexCommand>) => Pipeline;
583
+ arrinsert: (...args: CommandArgs<typeof JsonArrInsertCommand>) => Pipeline;
584
+ arrlen: (...args: CommandArgs<typeof JsonArrLenCommand>) => Pipeline;
585
+ arrpop: (...args: CommandArgs<typeof JsonArrPopCommand>) => Pipeline;
586
+ arrtrim: (...args: CommandArgs<typeof JsonArrTrimCommand>) => Pipeline;
587
+ clear: (...args: CommandArgs<typeof JsonClearCommand>) => Pipeline;
588
+ del: (...args: CommandArgs<typeof JsonDelCommand>) => Pipeline;
589
+ forget: (...args: CommandArgs<typeof JsonForgetCommand>) => Pipeline;
590
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline;
591
+ mget: (...args: CommandArgs<typeof JsonMGetCommand>) => Pipeline;
592
+ numincrby: (...args: CommandArgs<typeof JsonNumIncrByCommand>) => Pipeline;
593
+ nummultby: (...args: CommandArgs<typeof JsonNumMultByCommand>) => Pipeline;
594
+ objkeys: (...args: CommandArgs<typeof JsonObjKeysCommand>) => Pipeline;
595
+ objlen: (...args: CommandArgs<typeof JsonObjLenCommand>) => Pipeline;
596
+ resp: (...args: CommandArgs<typeof JsonRespCommand>) => Pipeline;
597
+ set: (...args: CommandArgs<typeof JsonSetCommand>) => Pipeline;
598
+ strappend: (...args: CommandArgs<typeof JsonStrAppendCommand>) => Pipeline;
599
+ strlen: (...args: CommandArgs<typeof JsonStrLenCommand>) => Pipeline;
600
+ toggle: (...args: CommandArgs<typeof JsonToggleCommand>) => Pipeline;
601
+ type: (...args: CommandArgs<typeof JsonTypeCommand>) => Pipeline;
602
+ };
577
603
  }
@@ -1,18 +1,9 @@
1
- import { CommandOptions, DelCommand, ExistsCommand, FlushAllCommand, MGetCommand, PingCommand, ScoreMember, ScriptExistsCommand, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
1
+ import { CommandOptions, DelCommand, ExistsCommand, FlushAllCommand, JsonGetCommand, MGetCommand, PingCommand, ScoreMember, ScriptExistsCommand, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
2
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
  import { Script } from "./script.js";
6
- import { Telemetry } from "./types.js";
7
- export declare type RedisOptions = {
8
- /**
9
- * Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
10
- *
11
- * @default true
12
- */
13
- automaticDeserialization?: boolean;
14
- enableTelemetry?: boolean;
15
- };
6
+ import { RedisOptions, Telemetry } from "./types.js";
16
7
  /**
17
8
  * Serverless redis client for upstash.
18
9
  */
@@ -32,6 +23,98 @@ export declare class Redis {
32
23
  * ```
33
24
  */
34
25
  constructor(client: Requester, opts?: RedisOptions);
26
+ get json(): {
27
+ /**
28
+ * @see https://redis.io/commands/json.arrappend
29
+ */
30
+ arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
31
+ /**
32
+ * @see https://redis.io/commands/json.arrindex
33
+ */
34
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
35
+ /**
36
+ * @see https://redis.io/commands/json.arrinsert
37
+ */
38
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
39
+ /**
40
+ * @see https://redis.io/commands/json.arrlen
41
+ */
42
+ arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
43
+ /**
44
+ * @see https://redis.io/commands/json.arrpop
45
+ */
46
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
47
+ /**
48
+ * @see https://redis.io/commands/json.arrtrim
49
+ */
50
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
51
+ /**
52
+ * @see https://redis.io/commands/json.clear
53
+ */
54
+ clear: (key: string, path?: string | undefined) => Promise<number>;
55
+ /**
56
+ * @see https://redis.io/commands/json.del
57
+ */
58
+ del: (key: string, path?: string | undefined) => Promise<number>;
59
+ /**
60
+ * @see https://redis.io/commands/json.forget
61
+ */
62
+ forget: (key: string, path?: string | undefined) => Promise<number>;
63
+ /**
64
+ * @see https://redis.io/commands/json.get
65
+ */
66
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Promise<any>;
67
+ /**
68
+ * @see https://redis.io/commands/json.mget
69
+ */
70
+ mget: (keys: string[], path: string) => Promise<any>;
71
+ /**
72
+ * @see https://redis.io/commands/json.numincrby
73
+ */
74
+ numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
75
+ /**
76
+ * @see https://redis.io/commands/json.nummultby
77
+ */
78
+ nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
79
+ /**
80
+ * @see https://redis.io/commands/json.objkeys
81
+ */
82
+ objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
83
+ /**
84
+ * @see https://redis.io/commands/json.objlen
85
+ */
86
+ objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
87
+ /**
88
+ * @see https://redis.io/commands/json.resp
89
+ */
90
+ resp: (key: string, path?: string | undefined) => Promise<any>;
91
+ /**
92
+ * @see https://redis.io/commands/json.set
93
+ */
94
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
95
+ nx: true;
96
+ xx?: undefined;
97
+ } | {
98
+ nx?: undefined;
99
+ xx: true;
100
+ } | undefined) => Promise<"OK" | null>;
101
+ /**
102
+ * @see https://redis.io/commands/json.strappend
103
+ */
104
+ strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
105
+ /**
106
+ * @see https://redis.io/commands/json.strlen
107
+ */
108
+ strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
109
+ /**
110
+ * @see https://redis.io/commands/json.toggle
111
+ */
112
+ toggle: (key: string, path: string) => Promise<number[]>;
113
+ /**
114
+ * @see https://redis.io/commands/json.type
115
+ */
116
+ type: (key: string, path?: string | undefined) => Promise<string[]>;
117
+ };
35
118
  /**
36
119
  * Wrap a new middleware around the HTTP client.
37
120
  */
@@ -1,5 +1,5 @@
1
- export declare type CommandArgs<TCommand extends new (...args: any) => any> = ConstructorParameters<TCommand>[0];
2
- export declare type Telemetry = {
1
+ export type CommandArgs<TCommand extends new (...args: any) => any> = ConstructorParameters<TCommand>[0];
2
+ export type Telemetry = {
3
3
  /**
4
4
  * Upstash-Telemetry-Sdk
5
5
  * @example @upstash/redis@v1.1.1
@@ -16,3 +16,12 @@ export declare type Telemetry = {
16
16
  */
17
17
  runtime?: string;
18
18
  };
19
+ export type RedisOptions = {
20
+ /**
21
+ * Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
22
+ *
23
+ * @default true
24
+ */
25
+ automaticDeserialization?: boolean;
26
+ enableTelemetry?: boolean;
27
+ };
@@ -1,7 +1,7 @@
1
1
  import * as core from "../pkg/redis.js";
2
2
  import type { Requester, UpstashRequest, UpstashResponse } from "../pkg/http.js";
3
3
  import { RequesterConfig } from "../pkg/http.js";
4
- declare type Env = {
4
+ type Env = {
5
5
  UPSTASH_DISABLE_TELEMETRY?: string;
6
6
  };
7
7
  export type { Requester, UpstashRequest, UpstashResponse };
@@ -9,7 +9,7 @@ export type { Requester, UpstashRequest, UpstashResponse };
9
9
  * Connection credentials for upstash redis.
10
10
  * Get them from https://console.upstash.com/redis/<uuid>
11
11
  */
12
- export declare type RedisConfigCloudflare = {
12
+ export type RedisConfigCloudflare = {
13
13
  /**
14
14
  * UPSTASH_REDIS_REST_URL
15
15
  */
@@ -5,7 +5,7 @@ export type { Requester, UpstashRequest, UpstashResponse };
5
5
  * Connection credentials for upstash redis.
6
6
  * Get them from https://console.upstash.com/redis/<uuid>
7
7
  */
8
- export declare type RedisConfigFastly = {
8
+ export type RedisConfigFastly = {
9
9
  /**
10
10
  * UPSTASH_REDIS_REST_URL
11
11
  */
@@ -6,7 +6,7 @@ export type { Requester, UpstashRequest, UpstashResponse };
6
6
  * Connection credentials for upstash redis.
7
7
  * Get them from https://console.upstash.com/redis/<uuid>
8
8
  */
9
- export declare type RedisConfigNodejs = {
9
+ export type RedisConfigNodejs = {
10
10
  /**
11
11
  * UPSTASH_REDIS_REST_URL
12
12
  */
@@ -5,7 +5,7 @@ export type { Requester, UpstashRequest, UpstashResponse };
5
5
  * Connection credentials for upstash redis.
6
6
  * Get them from https://console.upstash.com/redis/<uuid>
7
7
  */
8
- export declare type RedisConfigNodejs = {
8
+ export type RedisConfigNodejs = {
9
9
  /**
10
10
  * UPSTASH_REDIS_REST_URL
11
11
  */
@@ -1 +1 @@
1
- export declare const VERSION = "v1.19.3";
1
+ export declare const VERSION = "v1.20.0-canary.0";