prime-sdk 2.0.1 → 2.0.5-beta.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/dist/external/redis/interfaces/redis.interface.d.ts +2 -0
- package/dist/external/redis/interfaces/redis.interface.js.map +1 -1
- package/dist/external/redis/redis.service.d.ts +2 -0
- package/dist/external/redis/redis.service.js +6 -0
- package/dist/external/redis/redis.service.js.map +1 -1
- package/dist/external/redis/types/ioredis.types.d.ts +5 -1
- package/dist/external/redis/types/ioredis.types.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/cache/cache.d.ts +2 -0
- package/dist/lib/cache/cache.js +3 -0
- package/dist/lib/cache/cache.js.map +1 -1
- package/dist/lib/cache/interfaces/cache.interface.d.ts +2 -0
- package/dist/lib/cache/interfaces/cache.interface.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/external/redis/interfaces/redis.interface.ts +4 -0
- package/src/external/redis/redis.service.ts +8 -0
- package/src/external/redis/types/ioredis.types.ts +11 -1
- package/src/index.ts +2 -0
- package/src/lib/cache/cache.ts +5 -0
- package/src/lib/cache/interfaces/cache.interface.ts +4 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { PubSubRedis } from '../types/ioredis.types';
|
|
2
3
|
export interface IRedisService {
|
|
3
4
|
setRedisKey(key: string, value: Date | number | Buffer | string, ttl?: number): Promise<void>;
|
|
4
5
|
getRedisKey(key: string): Promise<string>;
|
|
5
6
|
deleteRedisKey(key: string): Promise<void>;
|
|
7
|
+
createPubSubClient(): Promise<PubSubRedis>;
|
|
6
8
|
}
|
|
7
9
|
export declare const IRedisService: unique symbol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.interface.js","sourceRoot":"","sources":["../../../../src/external/redis/interfaces/redis.interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"redis.interface.js","sourceRoot":"","sources":["../../../../src/external/redis/interfaces/redis.interface.ts"],"names":[],"mappings":";;;AAgBa,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Cluster, Redis } from 'ioredis';
|
|
3
3
|
import { IRedisService } from './interfaces/redis.interface';
|
|
4
|
+
import { PubSubRedis } from './types/ioredis.types';
|
|
4
5
|
export declare class RedisService implements IRedisService {
|
|
5
6
|
private readonly client;
|
|
6
7
|
constructor(client: Cluster | Redis);
|
|
7
8
|
setRedisKey(key: string, value: Date | number | Buffer | string, ttl?: number): Promise<void>;
|
|
8
9
|
getRedisKey(key: string): Promise<string>;
|
|
9
10
|
deleteRedisKey(key: string): Promise<void>;
|
|
11
|
+
createPubSubClient(): Promise<PubSubRedis>;
|
|
10
12
|
}
|
|
@@ -35,6 +35,12 @@ let RedisService = class RedisService {
|
|
|
35
35
|
async deleteRedisKey(key) {
|
|
36
36
|
await this.client.del(key);
|
|
37
37
|
}
|
|
38
|
+
async createPubSubClient() {
|
|
39
|
+
return {
|
|
40
|
+
pub: this.client,
|
|
41
|
+
sub: this.client.duplicate(),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
38
44
|
};
|
|
39
45
|
exports.RedisService = RedisService;
|
|
40
46
|
exports.RedisService = RedisService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.service.js","sourceRoot":"","sources":["../../../src/external/redis/redis.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;
|
|
1
|
+
{"version":3,"file":"redis.service.js","sourceRoot":"","sources":["../../../src/external/redis/redis.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AAM7C,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YAC+C,MAAuB;QAAvB,WAAM,GAAN,MAAM,CAAiB;IACnE,CAAC;IAEJ,KAAK,CAAC,WAAW,CACf,GAAW,EACX,KAAsC,EACtC,GAAY;QAEZ,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;YAC1B,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,GAAW;QAC3B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,GAAW;QAC9B,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,MAAM;YAChB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;SAC7B,CAAC;IACJ,CAAC;CACF,CAAA;AAjCY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;;GAFlB,YAAY,CAiCxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClusterOptions, RedisOptions } from 'ioredis';
|
|
1
|
+
import { type Cluster, type Redis, ClusterOptions, RedisOptions } from 'ioredis';
|
|
2
2
|
export declare enum TypeRedis {
|
|
3
3
|
SIMPLE = "simple",
|
|
4
4
|
CLUSTER = "cluster"
|
|
@@ -17,3 +17,7 @@ export type ClusterRedisSetup = {
|
|
|
17
17
|
nodes: Connection[];
|
|
18
18
|
clusterOptions?: ClusterOptions;
|
|
19
19
|
};
|
|
20
|
+
export type PubSubRedis = {
|
|
21
|
+
pub: Redis | Cluster;
|
|
22
|
+
sub: Redis | Cluster;
|
|
23
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ioredis.types.js","sourceRoot":"","sources":["../../../../src/external/redis/types/ioredis.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ioredis.types.js","sourceRoot":"","sources":["../../../../src/external/redis/types/ioredis.types.ts"],"names":[],"mappings":";;;AAOA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACrB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ import { ICrypto } from './lib/crypto/interfaces/crypto.interface';
|
|
|
16
16
|
import { CacheModule } from './lib/cache/cache.module';
|
|
17
17
|
import { Cache } from './lib/cache/cache';
|
|
18
18
|
import { ICache } from './lib/cache/interfaces/cache.interface';
|
|
19
|
-
import { SimpleRedisSetup, ClusterRedisSetup, TypeRedis } from './external/redis/types/ioredis.types';
|
|
20
|
-
export { QueueModule, Queue, IConsumer, StorageModule, Storage, IStorage, EventModule, Events, IEvent, EmailModule, Email, IEmail, CryptoModule, Crypto, ICrypto, CacheModule, Cache, ICache, SimpleRedisSetup, ClusterRedisSetup, TypeRedis, };
|
|
19
|
+
import { SimpleRedisSetup, ClusterRedisSetup, TypeRedis, PubSubRedis } from './external/redis/types/ioredis.types';
|
|
20
|
+
export { QueueModule, Queue, IConsumer, StorageModule, Storage, IStorage, EventModule, Events, IEvent, EmailModule, Email, IEmail, CryptoModule, Crypto, ICrypto, CacheModule, Cache, ICache, SimpleRedisSetup, ClusterRedisSetup, TypeRedis, PubSubRedis, };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AA+BrD,4FA/BO,0BAAW,OA+BP;AA9Bb,6CAA0C;AA+BxC,sFA/BO,aAAK,OA+BP;AA9BP,kFAAsE;AA+BpE,0FA/BO,8BAAS,OA+BP;AA7BX,iEAA6D;AA8B3D,8FA9BO,8BAAa,OA8BP;AA7Bf,mDAAgD;AA8B9C,wFA9BO,iBAAO,OA8BP;AA7BT,kFAAsE;AA8BpE,yFA9BO,4BAAQ,OA8BP;AA5BV,4DAAwD;AA6BtD,4FA7BO,0BAAW,OA6BP;AA5Bb,gDAA6C;AA6B3C,uFA7BO,eAAM,OA6BP;AA5BR,6EAAiE;AA6B/D,uFA7BO,wBAAM,OA6BP;AA3BR,2DAAuD;AA4BrD,4FA5BO,0BAAW,OA4BP;AA3Bb,6CAA0C;AA4BxC,sFA5BO,aAAK,OA4BP;AA3BP,4EAAgE;AA4B9D,uFA5BO,wBAAM,OA4BP;AA1BR,8DAA0D;AA2BxD,6FA3BO,4BAAY,OA2BP;AA1Bd,gDAA6C;AA2B3C,uFA3BO,eAAM,OA2BP;AA1BR,+EAAmE;AA2BjE,wFA3BO,0BAAO,OA2BP;AAzBT,2DAAuD;AA0BrD,4FA1BO,0BAAW,OA0BP;AAzBb,6CAA0C;AA0BxC,sFA1BO,aAAK,OA0BP;AAzBP,4EAAgE;AA0B9D,uFA1BO,wBAAM,OA0BP;AAzBR,wEAK8C;AAuB5C,0FAzBA,yBAAS,OAyBA"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ICache } from './interfaces/cache.interface';
|
|
3
3
|
import { IRedisService } from 'src/external/redis/interfaces/redis.interface';
|
|
4
|
+
import { PubSubRedis } from 'src/external/redis/types/ioredis.types';
|
|
4
5
|
export declare class Cache implements ICache {
|
|
5
6
|
private readonly client;
|
|
6
7
|
constructor(client: IRedisService);
|
|
7
8
|
set(key: string, value: string | number | Date | Buffer, ttl?: number): Promise<void>;
|
|
8
9
|
get(key: string): Promise<string>;
|
|
9
10
|
delete(key: string): Promise<void>;
|
|
11
|
+
createPubSubClient(): Promise<PubSubRedis>;
|
|
10
12
|
}
|
package/dist/lib/cache/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/lib/cache/cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AAEpD,qFAA8E;
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/lib/cache/cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AAEpD,qFAA8E;AAIvE,IAAM,KAAK,GAAX,MAAM,KAAK;IAChB,YAAoD,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAC7E,KAAK,CAAC,GAAG,CACP,GAAW,EACX,KAAsC,EACtC,GAAY;QAEZ,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACjD,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;IAChD,CAAC;CACF,CAAA;AApBY,sBAAK;gBAAL,KAAK;IADjB,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,eAAM,EAAC,+BAAa,CAAC,CAAA;;GADvB,KAAK,CAoBjB"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { PubSubRedis } from 'src/external/redis/types/ioredis.types';
|
|
2
3
|
export interface ICache {
|
|
3
4
|
set(key: string, value: Date | number | Buffer | string, ttl?: number): Promise<void>;
|
|
4
5
|
get(key: string): Promise<string>;
|
|
5
6
|
delete(key: string): Promise<void>;
|
|
7
|
+
createPubSubClient(): Promise<PubSubRedis>;
|
|
6
8
|
}
|
|
7
9
|
export declare const ICache: unique symbol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.interface.js","sourceRoot":"","sources":["../../../../src/lib/cache/interfaces/cache.interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"cache.interface.js","sourceRoot":"","sources":["../../../../src/lib/cache/interfaces/cache.interface.ts"],"names":[],"mappings":";;;AAgBa,QAAA,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC"}
|