@upstash/redis 0.0.0-ci.5cd8bd7f → 0.0.0-ci.608697de-20221127

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 (85) hide show
  1. package/README.md +38 -281
  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/getdel.js +9 -0
  8. package/esm/pkg/commands/hgetall.js +0 -4
  9. package/esm/pkg/commands/hrandfield.js +39 -0
  10. package/esm/pkg/commands/lpos.js +19 -0
  11. package/esm/pkg/commands/mod.js +3 -0
  12. package/esm/pkg/commands/scan.js +3 -0
  13. package/esm/pkg/commands/script_exists.js +1 -10
  14. package/esm/pkg/commands/sdiffstore.js +1 -1
  15. package/esm/pkg/commands/set.js +16 -4
  16. package/esm/pkg/commands/zmscore.js +10 -0
  17. package/esm/pkg/commands/zrange.js +6 -0
  18. package/esm/pkg/http.js +116 -8
  19. package/esm/pkg/pipeline.js +52 -6
  20. package/esm/pkg/redis.js +79 -2
  21. package/esm/pkg/script.js +77 -0
  22. package/esm/platforms/cloudflare.js +14 -26
  23. package/esm/platforms/fastly.js +5 -25
  24. package/esm/platforms/node_with_fetch.js +18 -26
  25. package/esm/platforms/nodejs.js +18 -26
  26. package/esm/version.js +1 -0
  27. package/package.json +10 -37
  28. package/script/deps/deno.land/x/base64@v0.2.1/base.js +104 -0
  29. package/script/deps/deno.land/x/base64@v0.2.1/base64url.js +13 -0
  30. package/script/deps/deno.land/x/sha1@v1.0.3/deps.js +6 -0
  31. package/script/deps/deno.land/x/sha1@v1.0.3/mod.js +196 -0
  32. package/script/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +55 -0
  33. package/script/pkg/commands/getdel.js +13 -0
  34. package/script/pkg/commands/hgetall.js +0 -4
  35. package/script/pkg/commands/hrandfield.js +43 -0
  36. package/script/pkg/commands/lpos.js +23 -0
  37. package/script/pkg/commands/mod.js +3 -0
  38. package/script/pkg/commands/scan.js +3 -0
  39. package/script/pkg/commands/script_exists.js +1 -10
  40. package/script/pkg/commands/sdiffstore.js +1 -1
  41. package/script/pkg/commands/set.js +16 -4
  42. package/script/pkg/commands/zmscore.js +14 -0
  43. package/script/pkg/commands/zrange.js +6 -0
  44. package/script/pkg/http.js +116 -8
  45. package/script/pkg/pipeline.js +51 -5
  46. package/script/pkg/redis.js +78 -1
  47. package/script/pkg/script.js +81 -0
  48. package/script/platforms/cloudflare.js +14 -26
  49. package/script/platforms/fastly.js +5 -25
  50. package/script/platforms/node_with_fetch.js +18 -26
  51. package/script/platforms/nodejs.js +18 -26
  52. package/script/version.js +4 -0
  53. package/types/deps/deno.land/x/base64@v0.2.1/base.d.ts +5 -0
  54. package/types/deps/deno.land/x/base64@v0.2.1/base64url.d.ts +1 -0
  55. package/types/deps/deno.land/x/sha1@v1.0.3/deps.d.ts +1 -0
  56. package/types/deps/deno.land/x/sha1@v1.0.3/mod.d.ts +26 -0
  57. package/types/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.d.ts +3 -0
  58. package/types/pkg/commands/bitop.d.ts +0 -1
  59. package/types/pkg/commands/bitpos.d.ts +1 -1
  60. package/types/pkg/commands/getdel.d.ts +7 -0
  61. package/types/pkg/commands/hmset.d.ts +2 -2
  62. package/types/pkg/commands/hrandfield.d.ts +9 -0
  63. package/types/pkg/commands/lpop.d.ts +1 -1
  64. package/types/pkg/commands/lpos.d.ts +15 -0
  65. package/types/pkg/commands/mget.d.ts +1 -1
  66. package/types/pkg/commands/mod.d.ts +3 -0
  67. package/types/pkg/commands/rpop.d.ts +2 -2
  68. package/types/pkg/commands/scan.d.ts +1 -0
  69. package/types/pkg/commands/script_exists.d.ts +2 -4
  70. package/types/pkg/commands/sdiffstore.d.ts +1 -1
  71. package/types/pkg/commands/set.d.ts +31 -2
  72. package/types/pkg/commands/sinterstore.d.ts +2 -2
  73. package/types/pkg/commands/spop.d.ts +2 -2
  74. package/types/pkg/commands/zadd.d.ts +1 -1
  75. package/types/pkg/commands/zmscore.d.ts +7 -0
  76. package/types/pkg/commands/zrange.d.ts +7 -0
  77. package/types/pkg/http.d.ts +76 -4
  78. package/types/pkg/pipeline.d.ts +34 -9
  79. package/types/pkg/redis.d.ts +51 -11
  80. package/types/pkg/script.d.ts +42 -0
  81. package/types/platforms/cloudflare.d.ts +8 -3
  82. package/types/platforms/fastly.d.ts +2 -2
  83. package/types/platforms/node_with_fetch.d.ts +2 -2
  84. package/types/platforms/nodejs.d.ts +18 -2
  85. package/types/version.d.ts +1 -0
@@ -1,5 +1,9 @@
1
1
  import * as core from "../pkg/redis.js";
2
2
  import type { Requester, UpstashRequest, UpstashResponse } from "../pkg/http.js";
3
+ import { RequesterConfig } from "../pkg/http.js";
4
+ declare type Env = {
5
+ UPSTASH_DISABLE_TELEMETRY?: string;
6
+ };
3
7
  export type { Requester, UpstashRequest, UpstashResponse };
4
8
  /**
5
9
  * Connection credentials for upstash redis.
@@ -14,7 +18,7 @@ export declare type RedisConfigCloudflare = {
14
18
  * UPSTASH_REDIS_REST_TOKEN
15
19
  */
16
20
  token: string;
17
- } & core.RedisOptions;
21
+ } & core.RedisOptions & RequesterConfig & Env;
18
22
  /**
19
23
  * Serverless redis client for upstash.
20
24
  */
@@ -30,9 +34,10 @@ export declare class Redis extends core.Redis {
30
34
  * });
31
35
  * ```
32
36
  */
33
- constructor(config: RedisConfigCloudflare);
37
+ constructor(config: RedisConfigCloudflare, env?: Env);
34
38
  static fromEnv(env?: {
35
39
  UPSTASH_REDIS_REST_URL: string;
36
40
  UPSTASH_REDIS_REST_TOKEN: string;
37
- }): Redis;
41
+ UPSTASH_DISABLE_TELEMETRY?: string;
42
+ }, opts?: Omit<RedisConfigCloudflare, "url" | "token">): Redis;
38
43
  }
@@ -1,5 +1,5 @@
1
1
  import * as core from "../pkg/redis.js";
2
- import type { Requester, UpstashRequest, UpstashResponse } from "../pkg/http.js";
2
+ import type { Requester, RequesterConfig, UpstashRequest, UpstashResponse } from "../pkg/http.js";
3
3
  export type { Requester, UpstashRequest, UpstashResponse };
4
4
  /**
5
5
  * Connection credentials for upstash redis.
@@ -20,7 +20,7 @@ export declare type RedisConfigFastly = {
20
20
  * referenced by name.
21
21
  */
22
22
  backend: string;
23
- } & core.RedisOptions;
23
+ } & core.RedisOptions & RequesterConfig;
24
24
  /**
25
25
  * Serverless redis client for upstash.
26
26
  */
@@ -1,5 +1,5 @@
1
1
  import * as core from "../pkg/redis.js";
2
- import { Requester, UpstashRequest, UpstashResponse } from "../pkg/http.js";
2
+ import { Requester, RequesterConfig, UpstashRequest, UpstashResponse } from "../pkg/http.js";
3
3
  import "isomorphic-fetch";
4
4
  export type { Requester, UpstashRequest, UpstashResponse };
5
5
  /**
@@ -15,7 +15,7 @@ export declare type RedisConfigNodejs = {
15
15
  * UPSTASH_REDIS_REST_TOKEN
16
16
  */
17
17
  token: string;
18
- } & core.RedisOptions;
18
+ } & core.RedisOptions & RequesterConfig;
19
19
  /**
20
20
  * Serverless redis client for upstash.
21
21
  */
@@ -1,5 +1,5 @@
1
1
  import * as core from "../pkg/redis.js";
2
- import { Requester, UpstashRequest, UpstashResponse } from "../pkg/http.js";
2
+ import { Requester, RequesterConfig, UpstashRequest, UpstashResponse } from "../pkg/http.js";
3
3
  export type { Requester, UpstashRequest, UpstashResponse };
4
4
  /**
5
5
  * Connection credentials for upstash redis.
@@ -14,7 +14,23 @@ export declare type RedisConfigNodejs = {
14
14
  * UPSTASH_REDIS_REST_TOKEN
15
15
  */
16
16
  token: string;
17
- } & core.RedisOptions;
17
+ /**
18
+ * An agent allows you to reuse connections to reduce latency for multiple sequential requests.
19
+ *
20
+ * This is a node specific implementation and is not supported in various runtimes like Vercel
21
+ * edge functions.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import https from "https"
26
+ *
27
+ * const options: RedisConfigNodejs = {
28
+ * agent: new https.Agent({ keepAlive: true })
29
+ * }
30
+ * ```
31
+ */
32
+ agent?: any;
33
+ } & core.RedisOptions & RequesterConfig;
18
34
  /**
19
35
  * Serverless redis client for upstash.
20
36
  */
@@ -0,0 +1 @@
1
+ export declare const VERSION = "v0.0.0-ci.608697de-20221127";