@upstash/redis 0.0.0-ci.b1b216d3-20230414 → 0.0.0-ci.b3f07153-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 (39) hide show
  1. package/esm/pkg/commands/geo_add.js +27 -0
  2. package/esm/pkg/commands/geo_dist.js +11 -0
  3. package/esm/pkg/commands/hgetall.js +9 -1
  4. package/esm/pkg/commands/mod.js +5 -0
  5. package/esm/pkg/commands/set.js +1 -1
  6. package/esm/pkg/commands/xadd.js +26 -0
  7. package/esm/pkg/commands/xrange.js +36 -0
  8. package/esm/pkg/commands/zunion.js +30 -0
  9. package/esm/pkg/http.js +16 -9
  10. package/esm/pkg/pipeline.js +32 -8
  11. package/esm/pkg/redis.js +36 -1
  12. package/esm/platforms/nodejs.js +4 -2
  13. package/esm/version.js +1 -1
  14. package/package.json +13 -5
  15. package/script/pkg/commands/geo_add.js +31 -0
  16. package/script/pkg/commands/geo_dist.js +15 -0
  17. package/script/pkg/commands/hgetall.js +9 -1
  18. package/script/pkg/commands/mod.js +5 -0
  19. package/script/pkg/commands/set.js +1 -1
  20. package/script/pkg/commands/xadd.js +30 -0
  21. package/script/pkg/commands/xrange.js +40 -0
  22. package/script/pkg/commands/zunion.js +34 -0
  23. package/script/pkg/http.js +16 -9
  24. package/script/pkg/pipeline.js +31 -7
  25. package/script/pkg/redis.js +35 -0
  26. package/script/platforms/nodejs.js +4 -2
  27. package/script/version.js +1 -1
  28. package/types/pkg/commands/geo_add.d.ts +25 -0
  29. package/types/pkg/commands/geo_dist.d.ts +12 -0
  30. package/types/pkg/commands/hdel.d.ts +1 -1
  31. package/types/pkg/commands/mod.d.ts +5 -0
  32. package/types/pkg/commands/set.d.ts +2 -2
  33. package/types/pkg/commands/xadd.d.ts +31 -0
  34. package/types/pkg/commands/xrange.d.ts +9 -0
  35. package/types/pkg/commands/zunion.d.ts +29 -0
  36. package/types/pkg/http.d.ts +5 -1
  37. package/types/pkg/pipeline.d.ts +241 -150
  38. package/types/pkg/redis.d.ts +42 -4
  39. package/types/version.d.ts +1 -1
@@ -3,7 +3,8 @@ 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 { RedisOptions, Telemetry } from "./types.js";
6
+ import type { RedisOptions, Telemetry } from "./types.js";
7
+ export type { RedisOptions } from "./types.js";
7
8
  /**
8
9
  * Serverless redis client for upstash.
9
10
  */
@@ -60,6 +61,14 @@ export declare class Redis {
60
61
  * @see https://redis.io/commands/json.forget
61
62
  */
62
63
  forget: (key: string, path?: string | undefined) => Promise<number>;
64
+ /**
65
+ * @see https://redis.io/commands/geoadd
66
+ */
67
+ geoadd: (args_0: string, args_1: import("./commands/geo_add.js").GeoAddCommandOptions | import("./commands/geo_add.js").GeoMember<unknown>, ...args_2: import("./commands/geo_add.js").GeoMember<unknown>[]) => Promise<number | null>;
68
+ /**
69
+ * @see https://redis.io/commands/geodist
70
+ */
71
+ geodist: (key: string, member1: string, member2: string, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
63
72
  /**
64
73
  * @see https://redis.io/commands/json.get
65
74
  */
@@ -129,7 +138,7 @@ export declare class Redis {
129
138
  *
130
139
  * @see {@link Pipeline}
131
140
  */
132
- pipeline: () => Pipeline;
141
+ pipeline: () => Pipeline<[]>;
133
142
  /**
134
143
  * Create a new transaction to allow executing multiple steps atomically.
135
144
  *
@@ -139,7 +148,7 @@ export declare class Redis {
139
148
  *
140
149
  * @see {@link Pipeline}
141
150
  */
142
- multi: () => Pipeline;
151
+ multi: () => Pipeline<[]>;
143
152
  /**
144
153
  * @see https://redis.io/commands/append
145
154
  */
@@ -232,7 +241,7 @@ export declare class Redis {
232
241
  /**
233
242
  * @see https://redis.io/commands/hdel
234
243
  */
235
- hdel: (key: string, field: string) => Promise<0 | 1>;
244
+ hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
236
245
  /**
237
246
  * @see https://redis.io/commands/hexists
238
247
  */
@@ -561,6 +570,31 @@ export declare class Redis {
561
570
  * @see https://redis.io/commands/unlink
562
571
  */
563
572
  unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
573
+ /**
574
+ * @see https://redis.io/commands/xadd
575
+ */
576
+ xadd: (key: string, id: string, entries: {
577
+ [field: string]: unknown;
578
+ }, opts?: {
579
+ nomkStream?: boolean | undefined;
580
+ trim?: (({
581
+ type: "MAXLEN" | "maxlen";
582
+ threshold: number;
583
+ } | {
584
+ type: "MINID" | "minid";
585
+ threshold: string;
586
+ }) & ({
587
+ comparison: "~";
588
+ limit?: number | undefined;
589
+ } | {
590
+ comparison: "=";
591
+ limit?: undefined;
592
+ })) | undefined;
593
+ } | undefined) => Promise<string>;
594
+ /**
595
+ * @see https://redis.io/commands/xrange
596
+ */
597
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
564
598
  /**
565
599
  * @see https://redis.io/commands/zadd
566
600
  */
@@ -651,6 +685,10 @@ export declare class Redis {
651
685
  * @see https://redis.io/commands/zscore
652
686
  */
653
687
  zscore: <TData>(key: string, member: TData) => Promise<number | null>;
688
+ /**
689
+ * @see https://redis.io/commands/zunion
690
+ */
691
+ zunion: (numKeys: number, keys: string[], opts?: import("./commands/zunion.js").ZUnionCommandOptions | undefined) => Promise<any>;
654
692
  /**
655
693
  * @see https://redis.io/commands/zunionstore
656
694
  */
@@ -1 +1 @@
1
- export declare const VERSION = "v0.0.0-ci.b1b216d3-20230414";
1
+ export declare const VERSION = "v0.0.0-ci.b3f07153-20231018";