@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/chunk-7YUZYRJS.mjs +29 -0
- package/chunk-FJSI5EBJ.mjs +38 -0
- package/chunk-U7OXAQMQ.mjs +37 -0
- package/{dist/index.mjs → chunk-Y5TC4HX2.mjs} +10 -70
- package/{dist/chunk-RYSRH3HC.mjs → chunk-ZIB6XPPC.mjs} +4 -27
- package/cloudflare.d.ts +38 -0
- package/cloudflare.js +1738 -0
- package/cloudflare.mjs +35 -0
- package/{dist/commands.d.ts → commands.d.ts} +3 -2
- package/{dist/commands.js → commands.js} +1 -1
- package/{dist/commands.mjs → commands.mjs} +2 -1
- package/fastly.d.ts +44 -0
- package/fastly.js +1728 -0
- package/fastly.mjs +25 -0
- package/http.d.ts +29 -0
- package/http.js +84 -0
- package/http.mjs +7 -0
- package/index.d.ts +13 -0
- package/{dist/index.js → index.js} +62 -68
- package/index.mjs +13 -0
- package/nodejs.d.ts +47 -0
- package/nodejs.js +1742 -0
- package/nodejs.mjs +10 -0
- package/package.json +1 -1
- package/{dist/index.d.ts → redis-dd052782.d.ts} +4 -43
- package/{dist/zunionstore-f1aa0b4a.d.ts → zunionstore-dffa797d.d.ts} +2 -21
- package/LICENSE +0 -21
package/nodejs.mjs
ADDED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "name": "@upstash/redis", "version": "v1.0.0-alpha.
|
|
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 {
|
|
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(
|
|
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
|
-
|
|
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 {
|
|
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.
|