@hg-ts/redis 0.1.20 → 0.1.22

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/.eslintcache CHANGED
@@ -1 +1 @@
1
- [{"/Volumes/Work/ts/hg/framework/packages/server/src/index.ts":"1","/Volumes/Work/ts/hg/framework/packages/server/src/server.module.ts":"2","/Volumes/Work/ts/hg/framework/packages/server/src/controllers/controller-explorer.service.ts":"3","/Volumes/Work/ts/hg/framework/packages/server/src/controllers/controller.caller.ts":"4","/Volumes/Work/ts/hg/framework/packages/server/src/controllers/index.ts":"5","/Volumes/Work/ts/hg/framework/packages/server/src/decorators/context.decorator.ts":"6","/Volumes/Work/ts/hg/framework/packages/server/src/decorators/controller.decorator.ts":"7","/Volumes/Work/ts/hg/framework/packages/server/src/decorators/create-param-decorator.ts":"8","/Volumes/Work/ts/hg/framework/packages/server/src/decorators/index.ts":"9","/Volumes/Work/ts/hg/framework/packages/server/src/decorators/middleware-data.decorator.ts":"10","/Volumes/Work/ts/hg/framework/packages/server/src/execution-context/execution-context.provider.ts":"11","/Volumes/Work/ts/hg/framework/packages/server/src/execution-context/execution-context.ts":"12","/Volumes/Work/ts/hg/framework/packages/server/src/execution-context/index.ts":"13","/Volumes/Work/ts/hg/framework/packages/server/src/server/base.handler-map.ts":"14","/Volumes/Work/ts/hg/framework/packages/server/src/server/base.server.ts":"15","/Volumes/Work/ts/hg/framework/packages/server/src/server/index.ts":"16","/Volumes/Work/ts/hg/framework/packages/server/src/server/request.handler.ts":"17","/Volumes/Work/ts/hg/framework/packages/server/src/tests/controllers/consts.ts":"18","/Volumes/Work/ts/hg/framework/packages/server/src/tests/controllers/controller.test-suite.ts":"19","/Volumes/Work/ts/hg/framework/packages/server/src/tests/controllers/test.controller.ts":"20","/Volumes/Work/ts/hg/framework/packages/server/src/tests/controllers/test.execution-context.ts":"21","/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/server.test-suite.ts":"22","/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test-handler.decorator.ts":"23","/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.body.ts":"24","/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.controller.ts":"25","/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.execution-context.ts":"26","/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.handler-map.ts":"27","/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.module.ts":"28","/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.server.ts":"29","/Volumes/Work/ts/hg/framework/packages/server/src/utils.ts":"30","/Volumes/Work/ts/hg/framework/packages/redis/src/config.ts":"31","/Volumes/Work/ts/hg/framework/packages/redis/src/index.ts":"32","/Volumes/Work/ts/hg/framework/packages/redis/src/redis.module.ts":"33","/Volumes/Work/ts/hg/framework/packages/redis/src/redis.client.ts":"34"},{"size":0,"mtime":1708838426330,"results":"35","hashOfConfig":"36"},{"size":489,"mtime":1704693489346,"results":"37","hashOfConfig":"36"},{"size":898,"mtime":1704693194902,"results":"38","hashOfConfig":"36"},{"size":1301,"mtime":1704693356706,"results":"39","hashOfConfig":"36"},{"size":84,"mtime":1704693160554,"results":"40","hashOfConfig":"36"},{"size":213,"mtime":1698022585971,"results":"41","hashOfConfig":"36"},{"size":1229,"mtime":1698022585972,"results":"42","hashOfConfig":"36"},{"size":2312,"mtime":1698022585972,"results":"43","hashOfConfig":"36"},{"size":165,"mtime":1698022585972,"results":"44","hashOfConfig":"36"},{"size":241,"mtime":1698022585972,"results":"45","hashOfConfig":"36"},{"size":212,"mtime":1708838426328,"results":"46","hashOfConfig":"36"},{"size":2730,"mtime":1708838426329,"results":"47","hashOfConfig":"36"},{"size":83,"mtime":1704692942783,"results":"48","hashOfConfig":"36"},{"size":880,"mtime":1708838426331,"results":"49","hashOfConfig":"36"},{"size":2385,"mtime":1708838426332,"results":"50","hashOfConfig":"36"},{"size":102,"mtime":1704693390851,"results":"51","hashOfConfig":"36"},{"size":405,"mtime":1704693489344,"results":"52","hashOfConfig":"36"},{"size":56,"mtime":1698022585973,"results":"53","hashOfConfig":"36"},{"size":1902,"mtime":1704692991785,"results":"54","hashOfConfig":"36"},{"size":603,"mtime":1704693160564,"results":"55","hashOfConfig":"36"},{"size":197,"mtime":1704692991779,"results":"56","hashOfConfig":"36"},{"size":971,"mtime":1713131798111,"results":"57","hashOfConfig":"36"},{"size":695,"mtime":1704693160551,"results":"58","hashOfConfig":"36"},{"size":229,"mtime":1704693160570,"results":"59","hashOfConfig":"36"},{"size":330,"mtime":1704693160566,"results":"60","hashOfConfig":"36"},{"size":261,"mtime":1704693160562,"results":"61","hashOfConfig":"36"},{"size":659,"mtime":1704693489341,"results":"62","hashOfConfig":"36"},{"size":295,"mtime":1704692907521,"results":"63","hashOfConfig":"36"},{"size":1536,"mtime":1704693489349,"results":"64","hashOfConfig":"36"},{"size":873,"mtime":1704693356704,"results":"65","hashOfConfig":"36"},{"size":285,"mtime":1714393426191,"results":"66","hashOfConfig":"67"},{"size":64,"mtime":1714388145937,"results":"68","hashOfConfig":"67"},{"size":1200,"mtime":1714388123663,"results":"69","hashOfConfig":"67"},{"size":72,"mtime":1714388100835,"results":"70","hashOfConfig":"67"},{"filePath":"71","messages":"72","suppressedMessages":"73","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1prrhjb",{"filePath":"74","messages":"75","suppressedMessages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","suppressedMessages":"85","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"86","messages":"87","suppressedMessages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","suppressedMessages":"91","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","suppressedMessages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","suppressedMessages":"97","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","suppressedMessages":"100","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","suppressedMessages":"103","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","suppressedMessages":"106","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"107","messages":"108","suppressedMessages":"109","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","suppressedMessages":"112","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"113","messages":"114","suppressedMessages":"115","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","suppressedMessages":"118","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"119","messages":"120","suppressedMessages":"121","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","suppressedMessages":"124","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"125","messages":"126","suppressedMessages":"127","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","suppressedMessages":"130","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"131","messages":"132","suppressedMessages":"133","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","suppressedMessages":"136","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"137","messages":"138","suppressedMessages":"139","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","suppressedMessages":"142","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"143","messages":"144","suppressedMessages":"145","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","suppressedMessages":"148","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"149","messages":"150","suppressedMessages":"151","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","suppressedMessages":"154","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"155","messages":"156","suppressedMessages":"157","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","suppressedMessages":"160","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"161","messages":"162","suppressedMessages":"163","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"fwzekl",{"filePath":"164","messages":"165","suppressedMessages":"166","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"167","messages":"168","suppressedMessages":"169","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","suppressedMessages":"172","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Volumes/Work/ts/hg/framework/packages/server/src/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/server.module.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/controllers/controller-explorer.service.ts",[],["173"],"/Volumes/Work/ts/hg/framework/packages/server/src/controllers/controller.caller.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/controllers/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/decorators/context.decorator.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/decorators/controller.decorator.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/decorators/create-param-decorator.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/decorators/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/decorators/middleware-data.decorator.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/execution-context/execution-context.provider.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/execution-context/execution-context.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/execution-context/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/server/base.handler-map.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/server/base.server.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/server/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/server/request.handler.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/controllers/consts.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/controllers/controller.test-suite.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/controllers/test.controller.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/controllers/test.execution-context.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/server.test-suite.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test-handler.decorator.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.body.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.controller.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.execution-context.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.handler-map.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.module.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/tests/server/test.server.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/server/src/utils.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/redis/src/config.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/redis/src/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/redis/src/redis.module.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/redis/src/redis.client.ts",[],[],{"ruleId":"174","severity":2,"message":"175","line":23,"column":37,"nodeType":"176","messageId":"177","endLine":23,"endColumn":50,"suppressions":"178"},"@typescript-eslint/no-unnecessary-condition","Unnecessary conditional, value is always truthy.","MemberExpression","alwaysTruthy",["179"],{"kind":"180","justification":"181"},"directive",""]
1
+ [{"/Volumes/Work/ts/hg/framework/packages/redis/src/config.ts":"1","/Volumes/Work/ts/hg/framework/packages/redis/src/index.ts":"2","/Volumes/Work/ts/hg/framework/packages/redis/src/redis.module.ts":"3","/Volumes/Work/ts/hg/framework/packages/redis/src/redis.client.ts":"4"},{"size":285,"mtime":1714393426191,"results":"5","hashOfConfig":"6"},{"size":64,"mtime":1714388145937,"results":"7","hashOfConfig":"6"},{"size":973,"mtime":1714395538930,"results":"8","hashOfConfig":"6"},{"size":72,"mtime":1714388100835,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","suppressedMessages":"12","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"oaf58b",{"filePath":"13","messages":"14","suppressedMessages":"15","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","suppressedMessages":"18","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"19","messages":"20","suppressedMessages":"21","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Volumes/Work/ts/hg/framework/packages/redis/src/config.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/redis/src/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/redis/src/redis.module.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/redis/src/redis.client.ts",[],[]]
@@ -1,5 +1,3 @@
1
- import { DynamicModule } from '@hg-ts/ioc';
2
1
  export declare class RedisModule {
3
- static forRootAsync(options: Pick<DynamicModule, 'imports'>): DynamicModule;
4
2
  }
5
3
  //# sourceMappingURL=redis.module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"redis.module.d.ts","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":"AACA,OAAO,EACN,aAAa,EAGb,MAAM,YAAY,CAAC;AAWpB,qBAEa,WAAW;WACT,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG,aAAa;CAiClF"}
1
+ {"version":3,"file":"redis.module.d.ts","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":"AAeA,qBA6Ba,WAAW;CAAG"}
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var RedisModule_1;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.RedisModule = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -8,43 +7,38 @@ const ioc_1 = require("@hg-ts/ioc");
8
7
  const nestjs_redis_1 = require("@liaoliaots/nestjs-redis");
9
8
  const config_1 = require("./config");
10
9
  const redis_client_1 = require("./redis.client");
11
- let RedisModule = RedisModule_1 = class RedisModule {
12
- static forRootAsync(options) {
13
- const redisModule = nestjs_redis_1.RedisModule.forRootAsync({
14
- ...options,
15
- async useFactory(configLoader) {
16
- const config = await configLoader.load(config_1.REDIS_CONFIG_SCHEMA, 'redis');
17
- return {
18
- commonOptions: { enableReadyCheck: true },
19
- config: {
20
- host: config.host,
21
- port: config.port,
22
- db: config.database,
23
- },
24
- };
25
- },
26
- inject: [config_loader_1.ConfigLoader],
27
- });
28
- return {
29
- module: RedisModule_1,
30
- imports: [redisModule],
31
- providers: [
32
- {
33
- provide: redis_client_1.RedisClient,
34
- useFactory(redisService) {
35
- return redisService.getClient();
36
- },
37
- inject: [nestjs_redis_1.RedisService],
38
- },
39
- ],
40
- exports: [redis_client_1.RedisClient],
41
- global: true,
42
- };
43
- }
10
+ let RedisModule = class RedisModule {
44
11
  };
45
12
  exports.RedisModule = RedisModule;
46
- exports.RedisModule = RedisModule = RedisModule_1 = tslib_1.__decorate([
13
+ exports.RedisModule = RedisModule = tslib_1.__decorate([
47
14
  (0, ioc_1.Global)(),
48
- (0, ioc_1.Module)()
15
+ (0, ioc_1.Module)({
16
+ imports: [
17
+ nestjs_redis_1.RedisModule.forRootAsync({
18
+ async useFactory(configLoader) {
19
+ const config = await configLoader.load(config_1.REDIS_CONFIG_SCHEMA, 'redis');
20
+ return {
21
+ commonOptions: { enableReadyCheck: true },
22
+ config: {
23
+ host: config.host,
24
+ port: config.port,
25
+ db: config.database,
26
+ },
27
+ };
28
+ },
29
+ inject: [config_loader_1.ConfigLoader],
30
+ }),
31
+ ],
32
+ providers: [
33
+ {
34
+ provide: redis_client_1.RedisClient,
35
+ useFactory(redisService) {
36
+ return redisService.getClient();
37
+ },
38
+ inject: [nestjs_redis_1.RedisService],
39
+ },
40
+ ],
41
+ exports: [redis_client_1.RedisClient],
42
+ })
49
43
  ], RedisModule);
50
44
  //# sourceMappingURL=redis.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":";;;;;AAAA,wDAAoD;AACpD,oCAIoB;AAEpB,2DAIkC;AAElC,qCAA+C;AAC/C,iDAA6C;AAItC,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAChB,MAAM,CAAC,YAAY,CAAC,OAAuC;QACjE,MAAM,WAAW,GAAG,0BAAc,CAAC,YAAY,CAAC;YAC/C,GAAG,OAAO;YACV,KAAK,CAAC,UAAU,CAAC,YAA0B;gBAC1C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,4BAAmB,EAAE,OAAO,CAAC,CAAC;gBACrE,OAAO;oBACN,aAAa,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE;oBACzC,MAAM,EAAE;wBACP,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,EAAE,EAAE,MAAM,CAAC,QAAQ;qBACnB;iBACD,CAAC;YACH,CAAC;YACD,MAAM,EAAE,CAAC,4BAAY,CAAC;SACtB,CAAC,CAAC;QAEH,OAAO;YACN,MAAM,EAAE,aAAW;YACnB,OAAO,EAAE,CAAC,WAAW,CAAC;YACtB,SAAS,EAAE;gBACV;oBACC,OAAO,EAAE,0BAAW;oBACpB,UAAU,CAAC,YAA0B;wBACpC,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC;oBACjC,CAAC;oBACD,MAAM,EAAE,CAAC,2BAAY,CAAC;iBACtB;aACD;YACD,OAAO,EAAE,CAAC,0BAAW,CAAC;YACtB,MAAM,EAAE,IAAI;SACZ,CAAC;IACH,CAAC;CACD,CAAA;AAlCY,kCAAW;sBAAX,WAAW;IAFvB,IAAA,YAAM,GAAE;IACR,IAAA,YAAM,GAAE;GACI,WAAW,CAkCvB"}
1
+ {"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":";;;;AAAA,wDAAoD;AACpD,oCAGoB;AAEpB,2DAIkC;AAElC,qCAA+C;AAC/C,iDAA6C;AA+BtC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IA7BvB,IAAA,YAAM,GAAE;IACR,IAAA,YAAM,EAAC;QACP,OAAO,EAAE;YACR,0BAAc,CAAC,YAAY,CAAC;gBAC3B,KAAK,CAAC,UAAU,CAAC,YAA0B;oBAC1C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,4BAAmB,EAAE,OAAO,CAAC,CAAC;oBACrE,OAAO;wBACN,aAAa,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE;wBACzC,MAAM,EAAE;4BACP,IAAI,EAAE,MAAM,CAAC,IAAI;4BACjB,IAAI,EAAE,MAAM,CAAC,IAAI;4BACjB,EAAE,EAAE,MAAM,CAAC,QAAQ;yBACnB;qBACD,CAAC;gBACH,CAAC;gBACD,MAAM,EAAE,CAAC,4BAAY,CAAC;aACtB,CAAC;SACF;QACD,SAAS,EAAE;YACV;gBACC,OAAO,EAAE,0BAAW;gBACpB,UAAU,CAAC,YAA0B;oBACpC,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC;gBACjC,CAAC;gBACD,MAAM,EAAE,CAAC,2BAAY,CAAC;aACtB;SACD;QACD,OAAO,EAAE,CAAC,0BAAW,CAAC;KACtB,CAAC;GACW,WAAW,CAAG"}
@@ -1,5 +1,3 @@
1
- import { DynamicModule } from '@hg-ts/ioc';
2
1
  export declare class RedisModule {
3
- static forRootAsync(options: Pick<DynamicModule, 'imports'>): DynamicModule;
4
2
  }
5
3
  //# sourceMappingURL=redis.module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"redis.module.d.ts","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":"AACA,OAAO,EACN,aAAa,EAGb,MAAM,YAAY,CAAC;AAWpB,qBAEa,WAAW;WACT,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG,aAAa;CAiClF"}
1
+ {"version":3,"file":"redis.module.d.ts","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":"AAeA,qBA6Ba,WAAW;CAAG"}
@@ -1,47 +1,41 @@
1
- var RedisModule_1;
2
1
  import { __decorate } from "tslib";
3
2
  import { ConfigLoader } from '@hg-ts/config-loader';
4
3
  import { Global, Module, } from '@hg-ts/ioc';
5
4
  import { RedisModule as RawRedisModule, RedisService, } from '@liaoliaots/nestjs-redis';
6
5
  import { REDIS_CONFIG_SCHEMA } from './config';
7
6
  import { RedisClient } from './redis.client';
8
- let RedisModule = RedisModule_1 = class RedisModule {
9
- static forRootAsync(options) {
10
- const redisModule = RawRedisModule.forRootAsync({
11
- ...options,
12
- async useFactory(configLoader) {
13
- const config = await configLoader.load(REDIS_CONFIG_SCHEMA, 'redis');
14
- return {
15
- commonOptions: { enableReadyCheck: true },
16
- config: {
17
- host: config.host,
18
- port: config.port,
19
- db: config.database,
20
- },
21
- };
22
- },
23
- inject: [ConfigLoader],
24
- });
25
- return {
26
- module: RedisModule_1,
27
- imports: [redisModule],
28
- providers: [
29
- {
30
- provide: RedisClient,
31
- useFactory(redisService) {
32
- return redisService.getClient();
33
- },
34
- inject: [RedisService],
35
- },
36
- ],
37
- exports: [RedisClient],
38
- global: true,
39
- };
40
- }
7
+ let RedisModule = class RedisModule {
41
8
  };
42
- RedisModule = RedisModule_1 = __decorate([
9
+ RedisModule = __decorate([
43
10
  Global(),
44
- Module()
11
+ Module({
12
+ imports: [
13
+ RawRedisModule.forRootAsync({
14
+ async useFactory(configLoader) {
15
+ const config = await configLoader.load(REDIS_CONFIG_SCHEMA, 'redis');
16
+ return {
17
+ commonOptions: { enableReadyCheck: true },
18
+ config: {
19
+ host: config.host,
20
+ port: config.port,
21
+ db: config.database,
22
+ },
23
+ };
24
+ },
25
+ inject: [ConfigLoader],
26
+ }),
27
+ ],
28
+ providers: [
29
+ {
30
+ provide: RedisClient,
31
+ useFactory(redisService) {
32
+ return redisService.getClient();
33
+ },
34
+ inject: [RedisService],
35
+ },
36
+ ],
37
+ exports: [RedisClient],
38
+ })
45
39
  ], RedisModule);
46
40
  export { RedisModule };
47
41
  //# sourceMappingURL=redis.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAEN,MAAM,EACN,MAAM,GACN,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,WAAW,IAAI,cAAc,EAE7B,YAAY,GACZ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAItC,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAChB,MAAM,CAAC,YAAY,CAAC,OAAuC;QACjE,MAAM,WAAW,GAAG,cAAc,CAAC,YAAY,CAAC;YAC/C,GAAG,OAAO;YACV,KAAK,CAAC,UAAU,CAAC,YAA0B;gBAC1C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;gBACrE,OAAO;oBACN,aAAa,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE;oBACzC,MAAM,EAAE;wBACP,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,EAAE,EAAE,MAAM,CAAC,QAAQ;qBACnB;iBACD,CAAC;YACH,CAAC;YACD,MAAM,EAAE,CAAC,YAAY,CAAC;SACtB,CAAC,CAAC;QAEH,OAAO;YACN,MAAM,EAAE,aAAW;YACnB,OAAO,EAAE,CAAC,WAAW,CAAC;YACtB,SAAS,EAAE;gBACV;oBACC,OAAO,EAAE,WAAW;oBACpB,UAAU,CAAC,YAA0B;wBACpC,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC;oBACjC,CAAC;oBACD,MAAM,EAAE,CAAC,YAAY,CAAC;iBACtB;aACD;YACD,OAAO,EAAE,CAAC,WAAW,CAAC;YACtB,MAAM,EAAE,IAAI;SACZ,CAAC;IACH,CAAC;CACD,CAAA;AAlCY,WAAW;IAFvB,MAAM,EAAE;IACR,MAAM,EAAE;GACI,WAAW,CAkCvB"}
1
+ {"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACN,MAAM,EACN,MAAM,GACN,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,WAAW,IAAI,cAAc,EAE7B,YAAY,GACZ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA+BtC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IA7BvB,MAAM,EAAE;IACR,MAAM,CAAC;QACP,OAAO,EAAE;YACR,cAAc,CAAC,YAAY,CAAC;gBAC3B,KAAK,CAAC,UAAU,CAAC,YAA0B;oBAC1C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;oBACrE,OAAO;wBACN,aAAa,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE;wBACzC,MAAM,EAAE;4BACP,IAAI,EAAE,MAAM,CAAC,IAAI;4BACjB,IAAI,EAAE,MAAM,CAAC,IAAI;4BACjB,EAAE,EAAE,MAAM,CAAC,QAAQ;yBACnB;qBACD,CAAC;gBACH,CAAC;gBACD,MAAM,EAAE,CAAC,YAAY,CAAC;aACtB,CAAC;SACF;QACD,SAAS,EAAE;YACV;gBACC,OAAO,EAAE,WAAW;gBACpB,UAAU,CAAC,YAA0B;oBACpC,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC;gBACjC,CAAC;gBACD,MAAM,EAAE,CAAC,YAAY,CAAC;aACtB;SACD;QACD,OAAO,EAAE,CAAC,WAAW,CAAC;KACtB,CAAC;GACW,WAAW,CAAG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hg-ts/redis",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist-esm/index.js",
6
6
  "repository": "git@gitlab.com:hyper-graph/framework.git",
@@ -12,14 +12,14 @@
12
12
  "lint:fix": "hg lint:fix"
13
13
  },
14
14
  "devDependencies": {
15
- "@hg-ts-config/eslint-config": "0.1.20",
16
- "@hg-ts-config/typescript": "0.1.20",
17
- "@hg-ts/cli": "0.1.20",
18
- "@hg-ts/config-loader": "0.1.20",
19
- "@hg-ts/exception": "0.1.20",
20
- "@hg-ts/ioc": "0.1.20",
21
- "@hg-ts/types": "0.1.20",
22
- "@hg-ts/validation": "0.1.20",
15
+ "@hg-ts-config/eslint-config": "0.1.22",
16
+ "@hg-ts-config/typescript": "0.1.22",
17
+ "@hg-ts/cli": "0.1.22",
18
+ "@hg-ts/config-loader": "0.1.22",
19
+ "@hg-ts/exception": "0.1.22",
20
+ "@hg-ts/ioc": "0.1.22",
21
+ "@hg-ts/types": "0.1.22",
22
+ "@hg-ts/validation": "0.1.22",
23
23
  "@types/node": "20.8.7",
24
24
  "@typescript-eslint/eslint-plugin": "6.8.0",
25
25
  "@typescript-eslint/parser": "6.8.0",
@@ -31,9 +31,9 @@
31
31
  "typescript": "5.2.2"
32
32
  },
33
33
  "peerDependencies": {
34
- "@hg-ts/config-loader": "0.1.20",
35
- "@hg-ts/ioc": "0.1.20",
36
- "@hg-ts/validation": "0.1.20",
34
+ "@hg-ts/config-loader": "0.1.22",
35
+ "@hg-ts/ioc": "0.1.22",
36
+ "@hg-ts/validation": "0.1.22",
37
37
  "reflect-metadata": "*",
38
38
  "rxjs": "*",
39
39
  "tslib": "*"
@@ -1,6 +1,5 @@
1
1
  import { ConfigLoader } from '@hg-ts/config-loader';
2
2
  import {
3
- DynamicModule,
4
3
  Global,
5
4
  Module,
6
5
  } from '@hg-ts/ioc';
@@ -15,11 +14,9 @@ import { REDIS_CONFIG_SCHEMA } from './config';
15
14
  import { RedisClient } from './redis.client';
16
15
 
17
16
  @Global()
18
- @Module()
19
- export class RedisModule {
20
- public static forRootAsync(options: Pick<DynamicModule, 'imports'>): DynamicModule {
21
- const redisModule = RawRedisModule.forRootAsync({
22
- ...options,
17
+ @Module({
18
+ imports: [
19
+ RawRedisModule.forRootAsync({
23
20
  async useFactory(configLoader: ConfigLoader): Promise<RedisModuleOptions> {
24
21
  const config = await configLoader.load(REDIS_CONFIG_SCHEMA, 'redis');
25
22
  return {
@@ -32,22 +29,17 @@ export class RedisModule {
32
29
  };
33
30
  },
34
31
  inject: [ConfigLoader],
35
- });
36
-
37
- return {
38
- module: RedisModule,
39
- imports: [redisModule],
40
- providers: [
41
- {
42
- provide: RedisClient,
43
- useFactory(redisService: RedisService): RedisClient {
44
- return redisService.getClient();
45
- },
46
- inject: [RedisService],
47
- },
48
- ],
49
- exports: [RedisClient],
50
- global: true,
51
- };
52
- }
53
- }
32
+ }),
33
+ ],
34
+ providers: [
35
+ {
36
+ provide: RedisClient,
37
+ useFactory(redisService: RedisService): RedisClient {
38
+ return redisService.getClient();
39
+ },
40
+ inject: [RedisService],
41
+ },
42
+ ],
43
+ exports: [RedisClient],
44
+ })
45
+ export class RedisModule {}