@upstash/redis 0.0.0-ci.e3757170 → 0.0.0-ci.e4fa3be6-20231018

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 (174) hide show
  1. package/README.md +42 -278
  2. package/esm/deps/deno.land/x/base64@v0.2.1/base.js +100 -0
  3. package/esm/deps/deno.land/x/base64@v0.2.1/base64url.js +9 -0
  4. package/esm/deps/deno.land/x/sha1@v1.0.3/deps.js +1 -0
  5. package/esm/deps/deno.land/x/sha1@v1.0.3/mod.js +191 -0
  6. package/esm/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +50 -0
  7. package/esm/pkg/commands/command.js +12 -3
  8. package/esm/pkg/commands/geo_add.js +27 -0
  9. package/esm/pkg/commands/getdel.js +9 -0
  10. package/esm/pkg/commands/hgetall.js +0 -4
  11. package/esm/pkg/commands/hrandfield.js +39 -0
  12. package/esm/pkg/commands/json_arrappend.js +9 -0
  13. package/esm/pkg/commands/json_arrindex.js +9 -0
  14. package/esm/pkg/commands/json_arrinsert.js +9 -0
  15. package/esm/pkg/commands/json_arrlen.js +9 -0
  16. package/esm/pkg/commands/json_arrpop.js +9 -0
  17. package/esm/pkg/commands/json_arrtrim.js +12 -0
  18. package/esm/pkg/commands/json_clear.js +9 -0
  19. package/esm/pkg/commands/json_del.js +9 -0
  20. package/esm/pkg/commands/json_forget.js +9 -0
  21. package/esm/pkg/commands/json_get.js +30 -0
  22. package/esm/pkg/commands/json_mget.js +9 -0
  23. package/esm/pkg/commands/json_numincrby.js +9 -0
  24. package/esm/pkg/commands/json_nummultby.js +9 -0
  25. package/esm/pkg/commands/json_objkeys.js +9 -0
  26. package/esm/pkg/commands/json_objlen.js +9 -0
  27. package/esm/pkg/commands/json_resp.js +9 -0
  28. package/esm/pkg/commands/json_set.js +18 -0
  29. package/esm/pkg/commands/json_strappend.js +9 -0
  30. package/esm/pkg/commands/json_strlen.js +9 -0
  31. package/esm/pkg/commands/json_toggle.js +9 -0
  32. package/esm/pkg/commands/json_type.js +9 -0
  33. package/esm/pkg/commands/lmove.js +9 -0
  34. package/esm/pkg/commands/lpos.js +19 -0
  35. package/esm/pkg/commands/mod.js +30 -0
  36. package/esm/pkg/commands/scan.js +3 -0
  37. package/esm/pkg/commands/sdiffstore.js +1 -1
  38. package/esm/pkg/commands/set.js +16 -4
  39. package/esm/pkg/commands/smismember.js +9 -0
  40. package/esm/pkg/commands/xadd.js +26 -0
  41. package/esm/pkg/commands/xrange.js +36 -0
  42. package/esm/pkg/commands/zdiffstore.js +9 -0
  43. package/esm/pkg/commands/zmscore.js +10 -0
  44. package/esm/pkg/commands/zrange.js +6 -0
  45. package/esm/pkg/commands/zunion.js +30 -0
  46. package/esm/pkg/http.js +100 -3
  47. package/esm/pkg/pipeline.js +194 -12
  48. package/esm/pkg/redis.js +260 -3
  49. package/esm/pkg/script.js +77 -0
  50. package/esm/platforms/cloudflare.js +10 -2
  51. package/esm/platforms/fastly.js +6 -0
  52. package/esm/platforms/node_with_fetch.js +26 -1
  53. package/esm/platforms/nodejs.js +24 -1
  54. package/esm/version.js +1 -0
  55. package/package.json +53 -58
  56. package/script/deps/deno.land/x/base64@v0.2.1/base.js +104 -0
  57. package/script/deps/deno.land/x/base64@v0.2.1/base64url.js +13 -0
  58. package/script/deps/deno.land/x/sha1@v1.0.3/deps.js +6 -0
  59. package/script/deps/deno.land/x/sha1@v1.0.3/mod.js +196 -0
  60. package/script/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +55 -0
  61. package/script/pkg/commands/command.js +12 -3
  62. package/script/pkg/commands/geo_add.js +31 -0
  63. package/script/pkg/commands/getdel.js +13 -0
  64. package/script/pkg/commands/hgetall.js +0 -4
  65. package/script/pkg/commands/hrandfield.js +43 -0
  66. package/script/pkg/commands/json_arrappend.js +13 -0
  67. package/script/pkg/commands/json_arrindex.js +13 -0
  68. package/script/pkg/commands/json_arrinsert.js +13 -0
  69. package/script/pkg/commands/json_arrlen.js +13 -0
  70. package/script/pkg/commands/json_arrpop.js +13 -0
  71. package/script/pkg/commands/json_arrtrim.js +16 -0
  72. package/script/pkg/commands/json_clear.js +13 -0
  73. package/script/pkg/commands/json_del.js +13 -0
  74. package/script/pkg/commands/json_forget.js +13 -0
  75. package/script/pkg/commands/json_get.js +34 -0
  76. package/script/pkg/commands/json_mget.js +13 -0
  77. package/script/pkg/commands/json_numincrby.js +13 -0
  78. package/script/pkg/commands/json_nummultby.js +13 -0
  79. package/script/pkg/commands/json_objkeys.js +13 -0
  80. package/script/pkg/commands/json_objlen.js +13 -0
  81. package/script/pkg/commands/json_resp.js +13 -0
  82. package/script/pkg/commands/json_set.js +22 -0
  83. package/script/pkg/commands/json_strappend.js +13 -0
  84. package/script/pkg/commands/json_strlen.js +13 -0
  85. package/script/pkg/commands/json_toggle.js +13 -0
  86. package/script/pkg/commands/json_type.js +13 -0
  87. package/script/pkg/commands/lmove.js +13 -0
  88. package/script/pkg/commands/lpos.js +23 -0
  89. package/script/pkg/commands/mod.js +30 -0
  90. package/script/pkg/commands/scan.js +3 -0
  91. package/script/pkg/commands/sdiffstore.js +1 -1
  92. package/script/pkg/commands/set.js +16 -4
  93. package/script/pkg/commands/smismember.js +13 -0
  94. package/script/pkg/commands/xadd.js +30 -0
  95. package/script/pkg/commands/xrange.js +40 -0
  96. package/script/pkg/commands/zdiffstore.js +13 -0
  97. package/script/pkg/commands/zmscore.js +14 -0
  98. package/script/pkg/commands/zrange.js +6 -0
  99. package/script/pkg/commands/zunion.js +34 -0
  100. package/script/pkg/http.js +100 -3
  101. package/script/pkg/pipeline.js +193 -11
  102. package/script/pkg/redis.js +259 -2
  103. package/script/pkg/script.js +81 -0
  104. package/script/platforms/cloudflare.js +10 -2
  105. package/script/platforms/fastly.js +6 -0
  106. package/script/platforms/node_with_fetch.js +26 -1
  107. package/script/platforms/nodejs.js +24 -1
  108. package/script/version.js +4 -0
  109. package/types/deps/deno.land/x/base64@v0.2.1/base.d.ts +5 -0
  110. package/types/deps/deno.land/x/base64@v0.2.1/base64url.d.ts +1 -0
  111. package/types/deps/deno.land/x/sha1@v1.0.3/deps.d.ts +1 -0
  112. package/types/deps/deno.land/x/sha1@v1.0.3/mod.d.ts +26 -0
  113. package/types/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.d.ts +3 -0
  114. package/types/pkg/commands/bitop.d.ts +0 -1
  115. package/types/pkg/commands/bitpos.d.ts +1 -1
  116. package/types/pkg/commands/command.d.ts +5 -5
  117. package/types/pkg/commands/geo_add.d.ts +25 -0
  118. package/types/pkg/commands/getdel.d.ts +7 -0
  119. package/types/pkg/commands/hdel.d.ts +1 -1
  120. package/types/pkg/commands/hrandfield.d.ts +9 -0
  121. package/types/pkg/commands/json_arrappend.d.ts +7 -0
  122. package/types/pkg/commands/json_arrindex.d.ts +13 -0
  123. package/types/pkg/commands/json_arrinsert.d.ts +7 -0
  124. package/types/pkg/commands/json_arrlen.d.ts +7 -0
  125. package/types/pkg/commands/json_arrpop.d.ts +7 -0
  126. package/types/pkg/commands/json_arrtrim.d.ts +7 -0
  127. package/types/pkg/commands/json_clear.d.ts +7 -0
  128. package/types/pkg/commands/json_del.d.ts +7 -0
  129. package/types/pkg/commands/json_forget.d.ts +7 -0
  130. package/types/pkg/commands/json_get.d.ts +15 -0
  131. package/types/pkg/commands/json_mget.d.ts +7 -0
  132. package/types/pkg/commands/json_numincrby.d.ts +7 -0
  133. package/types/pkg/commands/json_nummultby.d.ts +7 -0
  134. package/types/pkg/commands/json_objkeys.d.ts +7 -0
  135. package/types/pkg/commands/json_objlen.d.ts +7 -0
  136. package/types/pkg/commands/json_resp.d.ts +7 -0
  137. package/types/pkg/commands/json_set.d.ts +18 -0
  138. package/types/pkg/commands/json_strappend.d.ts +7 -0
  139. package/types/pkg/commands/json_strlen.d.ts +7 -0
  140. package/types/pkg/commands/json_toggle.d.ts +7 -0
  141. package/types/pkg/commands/json_type.d.ts +7 -0
  142. package/types/pkg/commands/lmove.d.ts +12 -0
  143. package/types/pkg/commands/lpop.d.ts +1 -1
  144. package/types/pkg/commands/lpos.d.ts +15 -0
  145. package/types/pkg/commands/mget.d.ts +1 -1
  146. package/types/pkg/commands/mod.d.ts +30 -0
  147. package/types/pkg/commands/rpop.d.ts +2 -2
  148. package/types/pkg/commands/scan.d.ts +2 -1
  149. package/types/pkg/commands/script_flush.d.ts +1 -1
  150. package/types/pkg/commands/sdiffstore.d.ts +1 -1
  151. package/types/pkg/commands/set.d.ts +31 -2
  152. package/types/pkg/commands/smembers.d.ts +2 -2
  153. package/types/pkg/commands/smismember.d.ts +7 -0
  154. package/types/pkg/commands/spop.d.ts +2 -2
  155. package/types/pkg/commands/type.d.ts +1 -1
  156. package/types/pkg/commands/xadd.d.ts +31 -0
  157. package/types/pkg/commands/xrange.d.ts +9 -0
  158. package/types/pkg/commands/zadd.d.ts +4 -4
  159. package/types/pkg/commands/zdiffstore.d.ts +7 -0
  160. package/types/pkg/commands/zinterstore.d.ts +1 -1
  161. package/types/pkg/commands/zmscore.d.ts +7 -0
  162. package/types/pkg/commands/zrange.d.ts +8 -1
  163. package/types/pkg/commands/zunion.d.ts +29 -0
  164. package/types/pkg/commands/zunionstore.d.ts +1 -1
  165. package/types/pkg/http.d.ts +48 -7
  166. package/types/pkg/pipeline.d.ts +270 -124
  167. package/types/pkg/redis.d.ts +195 -19
  168. package/types/pkg/script.d.ts +42 -0
  169. package/types/pkg/types.d.ts +27 -1
  170. package/types/platforms/cloudflare.d.ts +9 -8
  171. package/types/platforms/fastly.d.ts +3 -7
  172. package/types/platforms/node_with_fetch.d.ts +3 -22
  173. package/types/platforms/nodejs.d.ts +4 -7
  174. package/types/version.d.ts +1 -0
@@ -1,7 +1,7 @@
1
1
  import { Requester } from "../http.js";
2
- declare type Serialize = (data: unknown) => string;
3
- declare type Deserialize<TResult, TData> = (result: TResult) => TData;
4
- export declare type CommandOptions<TResult, TData> = {
2
+ type Serialize = (data: unknown) => string | number | boolean;
3
+ type Deserialize<TResult, TData> = (result: TResult) => TData;
4
+ export type CommandOptions<TResult, TData> = {
5
5
  /**
6
6
  * Custom deserializer
7
7
  */
@@ -20,7 +20,7 @@ export declare type CommandOptions<TResult, TData> = {
20
20
  * TResult is the raw data returned from upstash, which may need to be transformed or parsed.
21
21
  */
22
22
  export declare class Command<TResult, TData> {
23
- readonly command: string[];
23
+ readonly command: (string | number | boolean)[];
24
24
  readonly serialize: Serialize;
25
25
  readonly deserialize: Deserialize<TResult, TData>;
26
26
  /**
@@ -28,7 +28,7 @@ export declare class Command<TResult, TData> {
28
28
  *
29
29
  * You can define a custom `deserialize` function. By default we try to deserialize as json.
30
30
  */
31
- constructor(command: (string | unknown)[], opts?: CommandOptions<TResult, TData>);
31
+ constructor(command: (string | boolean | number | unknown)[], opts?: CommandOptions<TResult, TData>);
32
32
  /**
33
33
  * Execute the command using a client.
34
34
  */
@@ -0,0 +1,25 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ export type GeoAddCommandOptions = {
3
+ nx?: boolean;
4
+ xx?: never;
5
+ } | ({
6
+ nx?: never;
7
+ xx?: boolean;
8
+ } & {
9
+ ch?: boolean;
10
+ });
11
+ export interface GeoMember<TMemberType> {
12
+ latitude: number;
13
+ longitude: number;
14
+ member: TMemberType;
15
+ }
16
+ /**
17
+ * @see https://redis.io/commands/geoadd
18
+ */
19
+ export declare class GeoAddCommand<TMemberType = string> extends Command<number | null, number | null> {
20
+ constructor([key, arg1, ...arg2]: [
21
+ string,
22
+ GeoMember<TMemberType> | GeoAddCommandOptions,
23
+ ...GeoMember<TMemberType>[]
24
+ ], opts?: CommandOptions<number | null, number | null>);
25
+ }
@@ -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
+ }
@@ -3,5 +3,5 @@ import { Command, CommandOptions } from "./command.js";
3
3
  * @see https://redis.io/commands/hdel
4
4
  */
5
5
  export declare class HDelCommand extends Command<"0" | "1", 0 | 1> {
6
- constructor(cmd: [key: string, field: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
6
+ constructor(cmd: [key: string, ...fields: string[]], opts?: CommandOptions<"0" | "1", 0 | 1>);
7
7
  }
@@ -0,0 +1,9 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/hrandfield
4
+ */
5
+ export declare class HRandFieldCommand<TData extends string | string[] | Record<string, unknown>> extends Command<string | string[], TData> {
6
+ constructor(cmd: [key: string], opts?: CommandOptions<string, string>);
7
+ constructor(cmd: [key: string, count: number], opts?: CommandOptions<string[], string[]>);
8
+ constructor(cmd: [key: string, count: number, withValues: boolean], opts?: CommandOptions<string[], Partial<TData>>);
9
+ }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/json.arrappend
4
+ */
5
+ export declare class JsonArrAppendCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
6
+ constructor(cmd: [key: string, path: string, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
7
+ }
@@ -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
+ }
@@ -0,0 +1,12 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/lmove
4
+ */
5
+ export declare class LMoveCommand<TData = string> extends Command<TData, TData> {
6
+ constructor(cmd: [
7
+ source: string,
8
+ destination: string,
9
+ whereFrom: "left" | "right",
10
+ whereTo: "left" | "right"
11
+ ], opts?: CommandOptions<TData, TData>);
12
+ }
@@ -3,5 +3,5 @@ import { Command, CommandOptions } from "./command.js";
3
3
  * @see https://redis.io/commands/lpop
4
4
  */
5
5
  export declare class LPopCommand<TData = string> extends Command<unknown | null, TData | null> {
6
- constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
6
+ constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
7
7
  }
@@ -0,0 +1,15 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/lpos
4
+ */
5
+ export declare class LPosCommand<TData = number> extends Command<TData, TData> {
6
+ constructor(cmd: [
7
+ key: string,
8
+ element: unknown,
9
+ opts?: {
10
+ rank?: number;
11
+ count?: number;
12
+ maxLen?: number;
13
+ }
14
+ ], opts?: CommandOptions<TData, TData>);
15
+ }
@@ -3,5 +3,5 @@ import { Command, CommandOptions } from "./command.js";
3
3
  * @see https://redis.io/commands/mget
4
4
  */
5
5
  export declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
6
- constructor(cmd: [...keys: [string, ...string[]]], opts?: CommandOptions<(string | null)[], TData>);
6
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<(string | null)[], TData>);
7
7
  }
@@ -15,8 +15,10 @@ export * from "./expire.js";
15
15
  export * from "./expireat.js";
16
16
  export * from "./flushall.js";
17
17
  export * from "./flushdb.js";
18
+ export * from "./geo_add.js";
18
19
  export * from "./get.js";
19
20
  export * from "./getbit.js";
21
+ export * from "./getdel.js";
20
22
  export * from "./getrange.js";
21
23
  export * from "./getset.js";
22
24
  export * from "./hdel.js";
@@ -29,6 +31,7 @@ export * from "./hkeys.js";
29
31
  export * from "./hlen.js";
30
32
  export * from "./hmget.js";
31
33
  export * from "./hmset.js";
34
+ export * from "./hrandfield.js";
32
35
  export * from "./hscan.js";
33
36
  export * from "./hset.js";
34
37
  export * from "./hsetnx.js";
@@ -37,11 +40,34 @@ export * from "./hvals.js";
37
40
  export * from "./incr.js";
38
41
  export * from "./incrby.js";
39
42
  export * from "./incrbyfloat.js";
43
+ export * from "./json_arrappend.js";
44
+ export * from "./json_arrindex.js";
45
+ export * from "./json_arrinsert.js";
46
+ export * from "./json_arrlen.js";
47
+ export * from "./json_arrpop.js";
48
+ export * from "./json_arrtrim.js";
49
+ export * from "./json_clear.js";
50
+ export * from "./json_del.js";
51
+ export * from "./json_forget.js";
52
+ export * from "./json_get.js";
53
+ export * from "./json_mget.js";
54
+ export * from "./json_numincrby.js";
55
+ export * from "./json_nummultby.js";
56
+ export * from "./json_objkeys.js";
57
+ export * from "./json_objlen.js";
58
+ export * from "./json_resp.js";
59
+ export * from "./json_set.js";
60
+ export * from "./json_strappend.js";
61
+ export * from "./json_strlen.js";
62
+ export * from "./json_toggle.js";
63
+ export * from "./json_type.js";
40
64
  export * from "./keys.js";
41
65
  export * from "./lindex.js";
42
66
  export * from "./linsert.js";
43
67
  export * from "./llen.js";
68
+ export * from "./lmove.js";
44
69
  export * from "./lpop.js";
70
+ export * from "./lpos.js";
45
71
  export * from "./lpush.js";
46
72
  export * from "./lpushx.js";
47
73
  export * from "./lrange.js";
@@ -81,6 +107,7 @@ export * from "./sinter.js";
81
107
  export * from "./sinterstore.js";
82
108
  export * from "./sismember.js";
83
109
  export * from "./smembers.js";
110
+ export * from "./smismember.js";
84
111
  export * from "./smove.js";
85
112
  export * from "./spop.js";
86
113
  export * from "./srandmember.js";
@@ -111,4 +138,7 @@ export * from "./zremrangebyscore.js";
111
138
  export * from "./zrevrank.js";
112
139
  export * from "./zscan.js";
113
140
  export * from "./zscore.js";
141
+ export * from "./zunion.js";
114
142
  export * from "./zunionstore.js";
143
+ export * from "./xadd.js";
144
+ export * from "./xrange.js";
@@ -2,6 +2,6 @@ import { Command, CommandOptions } from "./command.js";
2
2
  /**
3
3
  * @see https://redis.io/commands/rpop
4
4
  */
5
- export declare class RPopCommand<TData = string> extends Command<unknown | null, TData | null> {
6
- constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
5
+ export declare class RPopCommand<TData extends unknown | unknown[] = string> extends Command<unknown | null, TData | null> {
6
+ constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
7
7
  }
@@ -1,7 +1,8 @@
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
+ type?: string;
5
6
  };
6
7
  /**
7
8
  * @see https://redis.io/commands/scan
@@ -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,6 +1,6 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
2
  /**
3
- * @see https://redis.io/commands/sdiffstpre
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>);
@@ -1,13 +1,42 @@
1
1
  import { Command, CommandOptions } from "./command.js";
2
- export declare type SetCommandOptions = ({
2
+ export type SetCommandOptions = {
3
+ get?: boolean;
4
+ } & ({
3
5
  ex: number;
4
6
  px?: never;
7
+ exat?: never;
8
+ pxat?: never;
9
+ keepTtl?: never;
5
10
  } | {
6
11
  ex?: never;
7
12
  px: number;
13
+ exat?: never;
14
+ pxat?: never;
15
+ keepTtl?: never;
8
16
  } | {
9
17
  ex?: never;
10
18
  px?: never;
19
+ exat: number;
20
+ pxat?: never;
21
+ keepTtl?: never;
22
+ } | {
23
+ ex?: never;
24
+ px?: never;
25
+ exat?: never;
26
+ pxat: number;
27
+ keepTtl?: never;
28
+ } | {
29
+ ex?: never;
30
+ px?: never;
31
+ exat?: never;
32
+ pxat?: never;
33
+ keepTtl: true;
34
+ } | {
35
+ ex?: never;
36
+ px?: never;
37
+ exat?: never;
38
+ pxat?: never;
39
+ keepTtl?: never;
11
40
  }) & ({
12
41
  nx: true;
13
42
  xx?: never;
@@ -21,6 +50,6 @@ export declare type SetCommandOptions = ({
21
50
  /**
22
51
  * @see https://redis.io/commands/set
23
52
  */
24
- export declare class SetCommand<TData, TResult = "OK"> extends Command<TResult, TData> {
53
+ export declare class SetCommand<TData, TResult = TData | "OK" | null> extends Command<TResult, TData | "OK" | null> {
25
54
  constructor([key, value, opts]: [key: string, value: TData, opts?: SetCommandOptions], cmdOpts?: CommandOptions<TResult, TData>);
26
55
  }
@@ -2,6 +2,6 @@ import { Command, CommandOptions } from "./command.js";
2
2
  /**
3
3
  * @see https://redis.io/commands/smembers
4
4
  */
5
- export declare class SMembersCommand<TData = string> extends Command<unknown[], TData[]> {
6
- constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData[]>);
5
+ export declare class SMembersCommand<TData extends unknown[] = string[]> extends Command<unknown[], TData> {
6
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
7
7
  }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/smismember
4
+ */
5
+ export declare class SMIsMemberCommand<TMembers extends unknown[]> extends Command<("0" | "1")[], (0 | 1)[]> {
6
+ constructor(cmd: [key: string, members: TMembers], opts?: CommandOptions<("0" | "1")[], (0 | 1)[]>);
7
+ }
@@ -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
  }
@@ -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
  */
@@ -0,0 +1,31 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ type XAddCommandOptions = {
3
+ nomkStream?: boolean;
4
+ trim?: ({
5
+ type: "MAXLEN" | "maxlen";
6
+ threshold: number;
7
+ } | {
8
+ type: "MINID" | "minid";
9
+ threshold: string;
10
+ }) & ({
11
+ comparison: "~";
12
+ limit?: number;
13
+ } | {
14
+ comparison: "=";
15
+ limit?: never;
16
+ });
17
+ };
18
+ /**
19
+ * @see https://redis.io/commands/xadd
20
+ */
21
+ export declare class XAddCommand extends Command<string, string> {
22
+ constructor([key, id, entries, opts]: [
23
+ key: string,
24
+ id: "*" | string,
25
+ entries: {
26
+ [field: string]: unknown;
27
+ },
28
+ opts?: XAddCommandOptions
29
+ ], commandOptions?: CommandOptions<string, string>);
30
+ }
31
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ export declare class XRangeCommand<TData extends Record<string, Record<string, unknown>>> extends Command<string[][], TData> {
3
+ constructor([key, start, end, count]: [
4
+ key: string,
5
+ start: string,
6
+ end: string,
7
+ count?: number
8
+ ], opts?: CommandOptions<unknown[], TData[]>);
9
+ }
@@ -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
  };
@@ -30,6 +30,6 @@ export declare class ZAddCommand<TData = string> extends Command<number | null,
30
30
  constructor(cmd: [
31
31
  key: string,
32
32
  opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr,
33
- ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
33
+ ...scoreMemberPairs: ScoreMember<TData>[]
34
34
  ], opts?: CommandOptions<number | null, number | null>);
35
35
  }
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/zdiffstore
4
+ */
5
+ export declare class ZDiffStoreCommand extends Command<number, number> {
6
+ constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
7
+ }
@@ -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;
@@ -0,0 +1,7 @@
1
+ import { Command, CommandOptions } from "./command.js";
2
+ /**
3
+ * @see https://redis.io/commands/zmscore
4
+ */
5
+ export declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
6
+ constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
7
+ }