@common-stack/core 8.2.5-alpha.35 → 8.3.1-alpha.0
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/package.json +2 -2
- package/lib/redis-client/index.d.ts +0 -2
- package/lib/redis-client/index.js +0 -1
- package/lib/redis-client/index.js.map +0 -1
- package/lib/redis-client/ioredis.d.ts +0 -15
- package/lib/redis-client/ioredis.js +0 -27
- package/lib/redis-client/ioredis.js.map +0 -1
- package/lib/redis-client/upstash-redis.d.ts +0 -14
- package/lib/redis-client/upstash-redis.js +0 -23
- package/lib/redis-client/upstash-redis.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/core",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.1-alpha.0",
|
|
4
4
|
"description": "Common core for higher packages to depend on",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"typescript": {
|
|
33
33
|
"definition": "lib/index.d.ts"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "896a0a80a57b2ec62925bdda9ed35e61cd5c1e9f"
|
|
36
36
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{IORedisClient}from'./ioredis.js';export{UpstashRedisClient}from'./upstash-redis.js';//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import Redis from 'ioredis';
|
|
2
|
-
import { Redis as RedisClient } from '../interfaces/redis';
|
|
3
|
-
export declare class IORedisClient implements RedisClient {
|
|
4
|
-
private redis;
|
|
5
|
-
constructor(config: {
|
|
6
|
-
url: string;
|
|
7
|
-
});
|
|
8
|
-
get(key: string): Promise<any | null>;
|
|
9
|
-
set(key: string, value: string, options?: {
|
|
10
|
-
ex?: number;
|
|
11
|
-
}): Promise<string>;
|
|
12
|
-
delMulti(keys: string[]): Promise<any>;
|
|
13
|
-
del(key: string): Promise<number>;
|
|
14
|
-
on(event: string, cb: (...args: any[]) => void): Redis;
|
|
15
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import Redis from'ioredis';class IORedisClient {
|
|
2
|
-
redis;
|
|
3
|
-
constructor(config) {
|
|
4
|
-
this.redis = new Redis(config.url);
|
|
5
|
-
}
|
|
6
|
-
async get(key) {
|
|
7
|
-
const data = await this.redis.get(key);
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
|
-
async set(key, value, options) {
|
|
11
|
-
if (options?.ex) {
|
|
12
|
-
return await this.redis.set(key, value, 'EX', options?.ex);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
return await this.redis.set(key, value);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
async delMulti(keys) {
|
|
19
|
-
return await this.redis.del(keys);
|
|
20
|
-
}
|
|
21
|
-
async del(key) {
|
|
22
|
-
return await this.redis.del(key);
|
|
23
|
-
}
|
|
24
|
-
on(event, cb) {
|
|
25
|
-
return this.redis.on(event, cb);
|
|
26
|
-
}
|
|
27
|
-
}export{IORedisClient};//# sourceMappingURL=ioredis.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ioredis.js","sources":["../../src/redis-client/ioredis.ts"],"sourcesContent":[null],"names":[],"mappings":"iCAGa,aAAa,CAAA;AACd,IAAA,KAAK,CAAQ;AAErB,IAAA,WAAA,CAAY,MAAuB,EAAA;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KACtC;IAED,MAAM,GAAG,CAAC,GAAW,EAAA;QACjB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACvC,QAAA,OAAO,IAAI,CAAC;KACf;AAED,IAAA,MAAM,GAAG,CAAC,GAAW,EAAE,KAAa,EAAE,OAAyB,EAAA;AAC3D,QAAA,IAAI,OAAO,EAAE,EAAE,EAAE;AACb,YAAA,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;SAC9D;aAAM;YACH,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC3C;KACJ;IAED,MAAM,QAAQ,CAAC,IAAc,EAAA;QACzB,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACrC;IAED,MAAM,GAAG,CAAC,GAAW,EAAA;QACjB,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACpC;IAED,EAAE,CAAC,KAAa,EAAE,EAA4B,EAAA;QAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;KACnC;AACJ"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Redis as RedisClient } from '../interfaces/redis';
|
|
2
|
-
export declare class UpstashRedisClient implements RedisClient {
|
|
3
|
-
private redis;
|
|
4
|
-
constructor(config: {
|
|
5
|
-
url: string;
|
|
6
|
-
token?: string;
|
|
7
|
-
});
|
|
8
|
-
get(key: string): Promise<any | null>;
|
|
9
|
-
set(key: string, value: string, options?: {
|
|
10
|
-
ex?: number;
|
|
11
|
-
}): Promise<string>;
|
|
12
|
-
delMulti(keys: string[]): Promise<any>;
|
|
13
|
-
del(key: string): Promise<number>;
|
|
14
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {Redis}from'@upstash/redis/cloudflare';class UpstashRedisClient {
|
|
2
|
-
redis;
|
|
3
|
-
constructor(config) {
|
|
4
|
-
this.redis = new Redis({ url: config.url, token: config.token });
|
|
5
|
-
}
|
|
6
|
-
async get(key) {
|
|
7
|
-
return await this.redis.get(key);
|
|
8
|
-
}
|
|
9
|
-
async set(key, value, options) {
|
|
10
|
-
if (options?.ex) {
|
|
11
|
-
return await this.redis.set(key, value, { ex: options?.ex });
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
return await this.redis.set(key, value);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
async delMulti(keys) {
|
|
18
|
-
return await Promise.all(keys.map((key) => this.redis.del(key)));
|
|
19
|
-
}
|
|
20
|
-
async del(key) {
|
|
21
|
-
return await this.redis.del(key);
|
|
22
|
-
}
|
|
23
|
-
}export{UpstashRedisClient};//# sourceMappingURL=upstash-redis.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upstash-redis.js","sources":["../../src/redis-client/upstash-redis.ts"],"sourcesContent":[null],"names":[],"mappings":"oDAGa,kBAAkB,CAAA;AACnB,IAAA,KAAK,CAAQ;AAErB,IAAA,WAAA,CAAY,MAAuC,EAAA;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;KACpE;IAED,MAAM,GAAG,CAAC,GAAW,EAAA;QACjB,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACpC;AAED,IAAA,MAAM,GAAG,CAAC,GAAW,EAAE,KAAa,EAAE,OAAyB,EAAA;AAC3D,QAAA,IAAI,OAAO,EAAE,EAAE,EAAE;AACb,YAAA,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;SAChE;aAAM;YACH,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC3C;KACJ;IAED,MAAM,QAAQ,CAAC,IAAc,EAAA;QACzB,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KACpE;IAED,MAAM,GAAG,CAAC,GAAW,EAAA;QACjB,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACpC;AACJ"}
|