@podkopaev-tech/nest-infra-modules 0.0.2 → 0.0.4
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.
|
@@ -5,7 +5,7 @@ const ioredis_1 = require("ioredis");
|
|
|
5
5
|
class RedisModule {
|
|
6
6
|
static async forRootAsync(options) {
|
|
7
7
|
const clientProviders = [];
|
|
8
|
-
for (const { token,
|
|
8
|
+
for (const { token, options: clientOptions } of options) {
|
|
9
9
|
const client = new ioredis_1.default(clientOptions);
|
|
10
10
|
await client.ping();
|
|
11
11
|
clientProviders.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../../../../src/modules/redis/redis.module.ts"],"names":[],"mappings":";;;AACA,qCAA4B;AAG5B,MAAa,WAAW;IACtB,MAAM,CAAC,KAAK,CAAC,YAAY,CACvB,OAA2B;QAE3B,MAAM,eAAe,GAAG,EAAE,CAAC;QAC3B,KAAK,MAAM,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../../../../src/modules/redis/redis.module.ts"],"names":[],"mappings":";;;AACA,qCAA4B;AAG5B,MAAa,WAAW;IACtB,MAAM,CAAC,KAAK,CAAC,YAAY,CACvB,OAA2B;QAE3B,MAAM,eAAe,GAAG,EAAE,CAAC;QAC3B,KAAK,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,OAAO,EAAE,CAAC;YACxD,MAAM,MAAM,GAAG,IAAI,iBAAK,CAAC,aAAa,CAAC,CAAC;YACxC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YACpB,eAAe,CAAC,IAAI,CAAC;gBACnB,KAAK;gBACL,QAAQ,EAAE,MAAM;aACjB,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,eAAe;YACxB,SAAS,EAAE,eAAe;SAC3B,CAAC;IACJ,CAAC;CACF;AAtBD,kCAsBC"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import type RedisOptions from 'ioredis';
|
|
2
1
|
import type Redis from 'ioredis';
|
|
3
|
-
export type RedisModuleOptions =
|
|
2
|
+
export type RedisModuleOptions = {
|
|
4
3
|
token: string | symbol;
|
|
4
|
+
options: RedisClientOptions;
|
|
5
5
|
}[];
|
|
6
6
|
export type RedisClient = Redis;
|
|
7
|
+
export interface RedisClientOptions {
|
|
8
|
+
host: string;
|
|
9
|
+
port: number;
|
|
10
|
+
url: string;
|
|
11
|
+
username: string;
|
|
12
|
+
password: string;
|
|
13
|
+
db: number;
|
|
14
|
+
enableReadyCheck: boolean;
|
|
15
|
+
collectRedisInfo: boolean;
|
|
16
|
+
}
|