@upstash/redis 1.0.0-alpha.0 → 1.0.0-alpha.3

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/nodejs.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ Redis
3
+ } from "./chunk-FJSI5EBJ.mjs";
4
+ import "./chunk-Y5TC4HX2.mjs";
5
+ import "./chunk-ZIB6XPPC.mjs";
6
+ import "./chunk-U7OXAQMQ.mjs";
7
+ import "./chunk-7YUZYRJS.mjs";
8
+ export {
9
+ Redis
10
+ };
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "@upstash/redis", "version": "v1.0.0-alpha.0", "engines": { "node": ">=10" }, "description": "An HTTP/REST based Redis client built on top of Upstash REST API.", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "exports": { ".": { "require": "./dist/index.js", "import": "./dist/index.mjs", "types": "./dist/index.d.ts" } }, "files": [ "package.json", "dist" ], "scripts": { "test": "jest -i", "fmt": "pnpm lint && pnpm prettier --write .", "lint": "eslint --ext .ts --fix --ignore-path .gitignore .", "build": "tsup && pnpm size-limit" }, "repository": { "type": "git", "url": "git+https://github.com/upstash/upstash-redis.git" }, "keywords": [ "redis", "database", "serverless", "edge", "upstash" ], "author": "Andreas Thomas <andreas.thomas@chronark.com>", "license": "MIT", "bugs": { "url": "https://github.com/upstash/upstash-redis/issues" }, "homepage": "https://github.com/upstash/upstash-redis#readme", "directories": { "examples": "examples" }, "devDependencies": { "@jest/globals": "^27.4.6", "@size-limit/preset-small-lib": "^7.0.8", "@trivago/prettier-plugin-sort-imports": "^3.2.0", "@types/jest": "^27.4.0", "@types/node": "^17.0.8", "@typescript-eslint/eslint-plugin": "^5.9.1", "@typescript-eslint/parser": "^5.9.1", "dotenv": "^12.0.3", "eslint": "^8.6.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^27.4.7", "prettier": "^2.5.1", "size-limit": "^7.0.8", "ts-jest": "^27.1.3", "tsup": "^5.11.11", "typescript": "^4.5.5" }, "dependencies": { "isomorphic-fetch": "^3.0.0" }, "browser": { "isomorphic-fetch": false }, "size-limit": [ { "path": "dist/index.js", "limit": "5 KB" }, { "path": "dist/index.mjs", "limit": "5 KB" } ] }
1
+ { "name": "@upstash/redis", "version": "v1.0.0-alpha.3", "engines": { "node": ">=10" }, "description": "An HTTP/REST based Redis client built on top of Upstash REST API.", "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "scripts": { "test": "jest -i", "fmt": "pnpm lint && pnpm prettier --write .", "lint": "eslint --ext .ts --fix --ignore-path .gitignore .", "build": "tsup && cp package.json ./dist/ && pnpm size-limit" }, "repository": { "type": "git", "url": "git+https://github.com/upstash/upstash-redis.git" }, "keywords": [ "redis", "database", "serverless", "edge", "upstash" ], "author": "Andreas Thomas <andreas.thomas@chronark.com>", "license": "MIT", "bugs": { "url": "https://github.com/upstash/upstash-redis/issues" }, "homepage": "https://github.com/upstash/upstash-redis#readme", "directories": { "examples": "examples" }, "devDependencies": { "@jest/globals": "^27.4.6", "@size-limit/preset-small-lib": "^7.0.8", "@trivago/prettier-plugin-sort-imports": "^3.2.0", "@types/jest": "^27.4.0", "@types/node": "^17.0.8", "@typescript-eslint/eslint-plugin": "^5.9.1", "@typescript-eslint/parser": "^5.9.1", "dotenv": "^12.0.3", "eslint": "^8.6.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^27.4.7", "prettier": "^2.5.1", "size-limit": "^7.0.8", "ts-jest": "^27.1.3", "tsup": "^5.11.11", "typescript": "^4.5.5" }, "dependencies": { "isomorphic-fetch": "^3.0.0" }, "browser": { "isomorphic-fetch": false }, "size-limit": [ { "path": "dist/index.js", "limit": "5 KB" }, { "path": "dist/index.mjs", "limit": "5 KB" } ] }
@@ -1,4 +1,5 @@
1
- import { H as HttpClient, C as CommandArgs, A as AppendCommand, B as BitCountCommand, a as BitPosCommand, D as DecrCommand, b as DecrByCommand, c as DelCommand, E as EchoCommand, d as ExistsCommand, e as ExpireCommand, f as ExpireAtCommand, F as FlushAllCommand, g as FlushDBCommand, G as GetCommand, h as GetBitCommand, i as GetRangeCommand, j as HDelCommand, k as HExistsCommand, l as HGetCommand, m as HGetAllCommand, n as HIncrByCommand, o as HIncrByFloatCommand, p as HKeysCommand, q as HLenCommand, r as HMGetCommand, s as HScanCommand, t as HStrLenCommand, u as HValsCommand, I as IncrCommand, v as IncrByCommand, w as IncrByFloatCommand, K as KeysCommand, L as LIndexCommand, x as LLenCommand, y as LPopCommand, N as NonEmptyArray, z as LRangeCommand, J as LTrimCommand, M as MGetCommand, P as PersistCommand, O as PExpireCommand, Q as PExpireAtCommand, R as PingCommand, S as PTtlCommand, T as RenameCommand, U as RenameNXCommand, V as RPopCommand, W as ScanCommand, X as SCardCommand, Y as SDiffCommand, Z as SDiffStoreCommand, _ as SetCommandOptions, $ as SetBitCommand, a0 as SetRangeCommand, a1 as SInterCommand, a2 as SInterStoreCommand, a3 as SMembersCommand, a4 as SPopCommand, a5 as SRandMemberCommand, a6 as SScanCommand, a7 as StrLenCommand, a8 as SUnionCommand, a9 as SUnionStoreCommand, aa as TouchCommand, ab as TtlCommand, ac as TypeCommand, ad as UnlinkCommand, ae as ScoreMember, af as ZAddCommandOptions, ag as ZAddCommandOptionsWithIncr, ah as ZCardCommand, ai as ZCountCommand, aj as ZInterStoreCommand, ak as ZLexCountCommand, al as ZPopMaxCommand, am as ZPopMinCommand, an as ZRangeCommand, ao as ZRemRangeByLexCommand, ap as ZRemRangeByRankCommand, aq as ZRemRangeByScoreCommand, ar as ZScanCommand, as as ZUnionStoreCommand, at as Type } from './zunionstore-f1aa0b4a';
1
+ import { C as CommandArgs, A as AppendCommand, B as BitCountCommand, a as BitPosCommand, D as DecrCommand, b as DecrByCommand, c as DelCommand, E as EchoCommand, d as ExistsCommand, e as ExpireCommand, f as ExpireAtCommand, F as FlushAllCommand, g as FlushDBCommand, G as GetCommand, h as GetBitCommand, i as GetRangeCommand, H as HDelCommand, j as HExistsCommand, k as HGetCommand, l as HGetAllCommand, m as HIncrByCommand, n as HIncrByFloatCommand, o as HKeysCommand, p as HLenCommand, q as HMGetCommand, r as HScanCommand, s as HStrLenCommand, t as HValsCommand, I as IncrCommand, u as IncrByCommand, v as IncrByFloatCommand, K as KeysCommand, L as LIndexCommand, w as LLenCommand, x as LPopCommand, N as NonEmptyArray, y as LRangeCommand, z as LTrimCommand, M as MGetCommand, P as PersistCommand, J as PExpireCommand, O as PExpireAtCommand, Q as PingCommand, R as PTtlCommand, S as RenameCommand, T as RenameNXCommand, U as RPopCommand, V as ScanCommand, W as SCardCommand, X as SDiffCommand, Y as SDiffStoreCommand, Z as SetCommandOptions, _ as SetBitCommand, $ as SetRangeCommand, a0 as SInterCommand, a1 as SInterStoreCommand, a2 as SMembersCommand, a3 as SPopCommand, a4 as SRandMemberCommand, a5 as SScanCommand, a6 as StrLenCommand, a7 as SUnionCommand, a8 as SUnionStoreCommand, a9 as TouchCommand, aa as TtlCommand, ab as TypeCommand, ac as UnlinkCommand, ad as ScoreMember, ae as ZAddCommandOptions, af as ZAddCommandOptionsWithIncr, ag as ZCardCommand, ah as ZCountCommand, ai as ZInterStoreCommand, aj as ZLexCountCommand, ak as ZPopMaxCommand, al as ZPopMinCommand, am as ZRangeCommand, an as ZRemRangeByLexCommand, ao as ZRemRangeByRankCommand, ap as ZRemRangeByScoreCommand, aq as ZScanCommand, ar as ZUnionStoreCommand, as as Type } from './zunionstore-dffa797d';
2
+ import { HttpClient } from './http';
2
3
 
3
4
  /**
4
5
  * Upstash REST API supports command pipelining to send multiple commands in
@@ -497,20 +498,6 @@ declare class Pipeline {
497
498
  zunionstore(...args: CommandArgs<typeof ZUnionStoreCommand>): this;
498
499
  }
499
500
 
500
- /**
501
- * Connection credentials for upstash redis.
502
- * Get them from https://console.upstash.com/redis/<uuid>
503
- */
504
- declare type RedisConfig = {
505
- /**
506
- * UPSTASH_REDIS_REST_URL
507
- */
508
- url: string;
509
- /**
510
- * UPSTASH_REDIS_REST_TOKEN
511
- */
512
- token: string;
513
- };
514
501
  /**
515
502
  * Serverless redis client for upstash.
516
503
  */
@@ -527,26 +514,7 @@ declare class Redis {
527
514
  * });
528
515
  * ```
529
516
  */
530
- constructor(config: RedisConfig);
531
- /**
532
- * Create a new Upstash Redis instance from environment variables.
533
- *
534
- * Use this to automatically load connection secrets from your environment
535
- * variables. For instance when using the Vercel integration.
536
- *
537
- * This tries to load `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from
538
- * your environment.
539
- *
540
- * If you are using Cloudflare, please use `fromCloudflareEnv()` instead.
541
- */
542
- static fromEnv(): Redis;
543
- /**
544
- * Create a new Upstash Redis instance from environment variables on cloudflare.
545
- *
546
- * This tries to load `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from
547
- * the global namespace
548
- */
549
- static fromCloudflareEnv(): Redis;
517
+ constructor(client: HttpClient);
550
518
  /**
551
519
  * Create a new pipeline that allows you to send requests in bulk.
552
520
  *
@@ -991,11 +959,4 @@ declare class Redis {
991
959
  zunionstore(...args: CommandArgs<typeof ZUnionStoreCommand>): Promise<number>;
992
960
  }
993
961
 
994
- /**
995
- * Result of a bad request to upstash
996
- */
997
- declare class UpstashError extends Error {
998
- constructor(message: string);
999
- }
1000
-
1001
- export { Redis, RedisConfig, UpstashError };
962
+ export { Redis as R };
@@ -1,23 +1,4 @@
1
- declare type HttpRequest = {
2
- path?: string[];
3
- /**
4
- * Request body will be serialized to json
5
- */
6
- body?: unknown;
7
- headers?: Record<string, string>;
8
- retries?: number;
9
- };
10
- declare type HttpClientConfig = {
11
- headers?: Record<string, string>;
12
- baseUrl: string;
13
- };
14
- declare class HttpClient {
15
- baseUrl: string;
16
- headers: Record<string, string>;
17
- constructor(config: HttpClientConfig);
18
- private request;
19
- post<TResponse>(req: HttpRequest): Promise<TResponse>;
20
- }
1
+ import { HttpClient } from './http';
21
2
 
22
3
  /**
23
4
  * Command offers default (de)serialization and the exec method to all commands.
@@ -686,4 +667,4 @@ declare class ZUnionStoreCommand extends Command<number, number> {
686
667
  constructor(destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions);
687
668
  }
688
669
 
689
- export { SetBitCommand as $, AppendCommand as A, BitCountCommand as B, CommandArgs as C, DecrCommand as D, EchoCommand as E, FlushAllCommand as F, GetCommand as G, HttpClient as H, IncrCommand as I, LTrimCommand as J, KeysCommand as K, LIndexCommand as L, MGetCommand as M, NonEmptyArray as N, PExpireCommand as O, PersistCommand as P, PExpireAtCommand as Q, PingCommand as R, PTtlCommand as S, RenameCommand as T, RenameNXCommand as U, RPopCommand as V, ScanCommand as W, SCardCommand as X, SDiffCommand as Y, SDiffStoreCommand as Z, SetCommandOptions as _, BitPosCommand as a, SetRangeCommand as a0, SInterCommand as a1, SInterStoreCommand as a2, SMembersCommand as a3, SPopCommand as a4, SRandMemberCommand as a5, SScanCommand as a6, StrLenCommand as a7, SUnionCommand as a8, SUnionStoreCommand as a9, ZUnionStoreCommandOptions as aA, TouchCommand as aa, TtlCommand as ab, TypeCommand as ac, UnlinkCommand as ad, ScoreMember as ae, ZAddCommandOptions as af, ZAddCommandOptionsWithIncr as ag, ZCardCommand as ah, ZCountCommand as ai, ZInterStoreCommand as aj, ZLexCountCommand as ak, ZPopMaxCommand as al, ZPopMinCommand as am, ZRangeCommand as an, ZRemRangeByLexCommand as ao, ZRemRangeByRankCommand as ap, ZRemRangeByScoreCommand as aq, ZScanCommand as ar, ZUnionStoreCommand as as, Type as at, Command as au, ScanCommandOptions as av, SetCommand as aw, ZAddCommand as ax, ZInterStoreCommandOptions as ay, ZRangeCommandOptions as az, DecrByCommand as b, DelCommand as c, ExistsCommand as d, ExpireCommand as e, ExpireAtCommand as f, FlushDBCommand as g, GetBitCommand as h, GetRangeCommand as i, HDelCommand as j, HExistsCommand as k, HGetCommand as l, HGetAllCommand as m, HIncrByCommand as n, HIncrByFloatCommand as o, HKeysCommand as p, HLenCommand as q, HMGetCommand as r, HScanCommand as s, HStrLenCommand as t, HValsCommand as u, IncrByCommand as v, IncrByFloatCommand as w, LLenCommand as x, LPopCommand as y, LRangeCommand as z };
670
+ export { SetRangeCommand as $, AppendCommand as A, BitCountCommand as B, CommandArgs as C, DecrCommand as D, EchoCommand as E, FlushAllCommand as F, GetCommand as G, HDelCommand as H, IncrCommand as I, PExpireCommand as J, KeysCommand as K, LIndexCommand as L, MGetCommand as M, NonEmptyArray as N, PExpireAtCommand as O, PersistCommand as P, PingCommand as Q, PTtlCommand as R, RenameCommand as S, RenameNXCommand as T, RPopCommand as U, ScanCommand as V, SCardCommand as W, SDiffCommand as X, SDiffStoreCommand as Y, SetCommandOptions as Z, SetBitCommand as _, BitPosCommand as a, SInterCommand as a0, SInterStoreCommand as a1, SMembersCommand as a2, SPopCommand as a3, SRandMemberCommand as a4, SScanCommand as a5, StrLenCommand as a6, SUnionCommand as a7, SUnionStoreCommand as a8, TouchCommand as a9, TtlCommand as aa, TypeCommand as ab, UnlinkCommand as ac, ScoreMember as ad, ZAddCommandOptions as ae, ZAddCommandOptionsWithIncr as af, ZCardCommand as ag, ZCountCommand as ah, ZInterStoreCommand as ai, ZLexCountCommand as aj, ZPopMaxCommand as ak, ZPopMinCommand as al, ZRangeCommand as am, ZRemRangeByLexCommand as an, ZRemRangeByRankCommand as ao, ZRemRangeByScoreCommand as ap, ZScanCommand as aq, ZUnionStoreCommand as ar, Type as as, Command as at, ScanCommandOptions as au, SetCommand as av, ZAddCommand as aw, ZInterStoreCommandOptions as ax, ZRangeCommandOptions as ay, ZUnionStoreCommandOptions as az, DecrByCommand as b, DelCommand as c, ExistsCommand as d, ExpireCommand as e, ExpireAtCommand as f, FlushDBCommand as g, GetBitCommand as h, GetRangeCommand as i, HExistsCommand as j, HGetCommand as k, HGetAllCommand as l, HIncrByCommand as m, HIncrByFloatCommand as n, HKeysCommand as o, HLenCommand as p, HMGetCommand as q, HScanCommand as r, HStrLenCommand as s, HValsCommand as t, IncrByCommand as u, IncrByFloatCommand as v, LLenCommand as w, LPopCommand as x, LRangeCommand as y, LTrimCommand as z };
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2021 Upstash, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.