@hg-ts/redis 0.1.32 → 0.1.34

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/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":1720303596669,"results":"7","hashOfConfig":"6"},{"size":1143,"mtime":1720303334382,"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
+ [{"/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":1720303596669,"results":"7","hashOfConfig":"6"},{"size":843,"mtime":1720308380705,"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 +1 @@
1
- {"version":3,"file":"redis.module.d.ts","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":"AACA,OAAO,EACN,aAAa,EAGb,WAAW,EACX,MAAM,YAAY,CAAC;AAWpB,qBA6Ba,WAAW;WACT,QAAQ,CAAC,YAAY,EAAE,WAAW,GAAG,aAAa;CAMhE"}
1
+ {"version":3,"file":"redis.module.d.ts","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":"AACA,OAAO,EACN,aAAa,EAGb,WAAW,EACX,MAAM,YAAY,CAAC;AAOpB,qBAoBa,WAAW;WACT,QAAQ,CAAC,YAAY,EAAE,WAAW,GAAG,aAAa;CAMhE"}
@@ -5,7 +5,7 @@ exports.RedisModule = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const config_loader_1 = require("@hg-ts/config-loader");
7
7
  const ioc_1 = require("@hg-ts/ioc");
8
- const nestjs_redis_1 = require("@liaoliaots/nestjs-redis");
8
+ const ioredis_1 = require("ioredis");
9
9
  const config_1 = require("./config");
10
10
  const redis_client_1 = require("./redis.client");
11
11
  let RedisModule = RedisModule_1 = class RedisModule {
@@ -20,29 +20,19 @@ exports.RedisModule = RedisModule;
20
20
  exports.RedisModule = RedisModule = RedisModule_1 = tslib_1.__decorate([
21
21
  (0, ioc_1.Global)(),
22
22
  (0, ioc_1.Module)({
23
- imports: [
24
- nestjs_redis_1.RedisModule.forRootAsync({
25
- async useFactory(configLoader) {
26
- const config = await configLoader.load(config_1.REDIS_CONFIG_SCHEMA, 'redis');
27
- return {
28
- commonOptions: { enableReadyCheck: true },
29
- config: {
30
- host: config.host,
31
- port: config.port,
32
- db: config.database,
33
- },
34
- };
35
- },
36
- inject: [config_loader_1.ConfigLoader],
37
- }),
38
- ],
39
23
  providers: [
40
24
  {
41
25
  provide: redis_client_1.RedisClient,
42
- useFactory(redisService) {
43
- return redisService.getClient();
26
+ async useFactory(configLoader) {
27
+ const config = await configLoader.load(config_1.REDIS_CONFIG_SCHEMA, 'redis');
28
+ return new ioredis_1.Redis({
29
+ host: config.host,
30
+ port: config.port,
31
+ db: config.database,
32
+ enableReadyCheck: true,
33
+ });
44
34
  },
45
- inject: [nestjs_redis_1.RedisService],
35
+ inject: [config_loader_1.ConfigLoader],
46
36
  },
47
37
  ],
48
38
  exports: [redis_client_1.RedisClient],
@@ -1 +1 @@
1
- {"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":";;;;;AAAA,wDAAoD;AACpD,oCAKoB;AAEpB,2DAIkC;AAElC,qCAA+C;AAC/C,iDAA6C;AA+BtC,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAChB,MAAM,CAAC,QAAQ,CAAC,YAAyB;QAC/C,OAAO;YACN,MAAM,EAAE,aAAW;YACnB,OAAO,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,YAAM,EAAC;QACP,SAAS,EAAE;YACV;gBACC,OAAO,EAAE,0BAAW;gBACpB,KAAK,CAAC,UAAU,CAAC,YAA0B;oBAC1C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,4BAAmB,EAAE,OAAO,CAAC,CAAC;oBAErE,OAAO,IAAI,eAAK,CAAC;wBAChB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,EAAE,EAAE,MAAM,CAAC,QAAQ;wBACnB,gBAAgB,EAAE,IAAI;qBACtB,CAAC,CAAC;gBACJ,CAAC;gBACD,MAAM,EAAE,CAAC,4BAAY,CAAC;aACtB;SACD;QACD,OAAO,EAAE,CAAC,0BAAW,CAAC;KACtB,CAAC;GACW,WAAW,CAOvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"redis.module.d.ts","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":"AACA,OAAO,EACN,aAAa,EAGb,WAAW,EACX,MAAM,YAAY,CAAC;AAWpB,qBA6Ba,WAAW;WACT,QAAQ,CAAC,YAAY,EAAE,WAAW,GAAG,aAAa;CAMhE"}
1
+ {"version":3,"file":"redis.module.d.ts","sourceRoot":"","sources":["../src/redis.module.ts"],"names":[],"mappings":"AACA,OAAO,EACN,aAAa,EAGb,WAAW,EACX,MAAM,YAAY,CAAC;AAOpB,qBAoBa,WAAW;WACT,QAAQ,CAAC,YAAY,EAAE,WAAW,GAAG,aAAa;CAMhE"}
@@ -2,7 +2,7 @@ var RedisModule_1;
2
2
  import { __decorate } from "tslib";
3
3
  import { ConfigLoader } from '@hg-ts/config-loader';
4
4
  import { Global, Module, } from '@hg-ts/ioc';
5
- import { RedisModule as RawRedisModule, RedisService, } from '@liaoliaots/nestjs-redis';
5
+ import { Redis } from 'ioredis';
6
6
  import { REDIS_CONFIG_SCHEMA } from './config';
7
7
  import { RedisClient } from './redis.client';
8
8
  let RedisModule = RedisModule_1 = class RedisModule {
@@ -16,29 +16,19 @@ let RedisModule = RedisModule_1 = class RedisModule {
16
16
  RedisModule = RedisModule_1 = __decorate([
17
17
  Global(),
18
18
  Module({
19
- imports: [
20
- RawRedisModule.forRootAsync({
21
- async useFactory(configLoader) {
22
- const config = await configLoader.load(REDIS_CONFIG_SCHEMA, 'redis');
23
- return {
24
- commonOptions: { enableReadyCheck: true },
25
- config: {
26
- host: config.host,
27
- port: config.port,
28
- db: config.database,
29
- },
30
- };
31
- },
32
- inject: [ConfigLoader],
33
- }),
34
- ],
35
19
  providers: [
36
20
  {
37
21
  provide: RedisClient,
38
- useFactory(redisService) {
39
- return redisService.getClient();
22
+ async useFactory(configLoader) {
23
+ const config = await configLoader.load(REDIS_CONFIG_SCHEMA, 'redis');
24
+ return new Redis({
25
+ host: config.host,
26
+ port: config.port,
27
+ db: config.database,
28
+ enableReadyCheck: true,
29
+ });
40
30
  },
41
- inject: [RedisService],
31
+ inject: [ConfigLoader],
42
32
  },
43
33
  ],
44
34
  exports: [RedisClient],
@@ -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,GAEN,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,mBAAjB,MAAM,WAAW;IAChB,MAAM,CAAC,QAAQ,CAAC,YAAyB;QAC/C,OAAO;YACN,MAAM,EAAE,aAAW;YACnB,OAAO,EAAE,CAAC,YAAY,CAAC;SACvB,CAAC;IACH,CAAC;CACD,CAAA;AAPY,WAAW;IA7BvB,MAAM,EAAE;IACR,MAAM,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IApBvB,MAAM,EAAE;IACR,MAAM,CAAC;QACP,SAAS,EAAE;YACV;gBACC,OAAO,EAAE,WAAW;gBACpB,KAAK,CAAC,UAAU,CAAC,YAA0B;oBAC1C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;oBAErE,OAAO,IAAI,KAAK,CAAC;wBAChB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,EAAE,EAAE,MAAM,CAAC,QAAQ;wBACnB,gBAAgB,EAAE,IAAI;qBACtB,CAAC,CAAC;gBACJ,CAAC;gBACD,MAAM,EAAE,CAAC,YAAY,CAAC;aACtB;SACD;QACD,OAAO,EAAE,CAAC,WAAW,CAAC;KACtB,CAAC;GACW,WAAW,CAOvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hg-ts/redis",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
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.32",
16
- "@hg-ts-config/typescript": "0.1.32",
17
- "@hg-ts/cli": "0.1.32",
18
- "@hg-ts/config-loader": "0.1.32",
19
- "@hg-ts/exception": "0.1.32",
20
- "@hg-ts/ioc": "0.1.32",
21
- "@hg-ts/types": "0.1.32",
22
- "@hg-ts/validation": "0.1.32",
15
+ "@hg-ts-config/eslint-config": "0.1.34",
16
+ "@hg-ts-config/typescript": "0.1.34",
17
+ "@hg-ts/cli": "0.1.34",
18
+ "@hg-ts/config-loader": "0.1.34",
19
+ "@hg-ts/exception": "0.1.34",
20
+ "@hg-ts/ioc": "0.1.34",
21
+ "@hg-ts/types": "0.1.34",
22
+ "@hg-ts/validation": "0.1.34",
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,15 +31,14 @@
31
31
  "typescript": "5.2.2"
32
32
  },
33
33
  "peerDependencies": {
34
- "@hg-ts/config-loader": "0.1.32",
35
- "@hg-ts/ioc": "0.1.32",
36
- "@hg-ts/validation": "0.1.32",
34
+ "@hg-ts/config-loader": "0.1.34",
35
+ "@hg-ts/ioc": "0.1.34",
36
+ "@hg-ts/validation": "0.1.34",
37
37
  "reflect-metadata": "*",
38
38
  "rxjs": "*",
39
39
  "tslib": "*"
40
40
  },
41
41
  "dependencies": {
42
- "@liaoliaots/nestjs-redis": "9.0.5",
43
42
  "@nestjs/common": "10.2.7",
44
43
  "@nestjs/core": "10.2.7",
45
44
  "ioredis": "5.4.1"
@@ -6,40 +6,27 @@ import {
6
6
  ModuleToken,
7
7
  } from '@hg-ts/ioc';
8
8
 
9
- import {
10
- RedisModule as RawRedisModule,
11
- RedisModuleOptions,
12
- RedisService,
13
- } from '@liaoliaots/nestjs-redis';
9
+ import { Redis } from 'ioredis';
14
10
 
15
11
  import { REDIS_CONFIG_SCHEMA } from './config';
16
12
  import { RedisClient } from './redis.client';
17
13
 
18
14
  @Global()
19
15
  @Module({
20
- imports: [
21
- RawRedisModule.forRootAsync({
22
- async useFactory(configLoader: ConfigLoader): Promise<RedisModuleOptions> {
23
- const config = await configLoader.load(REDIS_CONFIG_SCHEMA, 'redis');
24
- return {
25
- commonOptions: { enableReadyCheck: true },
26
- config: {
27
- host: config.host,
28
- port: config.port,
29
- db: config.database,
30
- },
31
- };
32
- },
33
- inject: [ConfigLoader],
34
- }),
35
- ],
36
16
  providers: [
37
17
  {
38
18
  provide: RedisClient,
39
- useFactory(redisService: RedisService): RedisClient {
40
- return redisService.getClient();
19
+ async useFactory(configLoader: ConfigLoader): Promise<RedisClient> {
20
+ const config = await configLoader.load(REDIS_CONFIG_SCHEMA, 'redis');
21
+
22
+ return new Redis({
23
+ host: config.host,
24
+ port: config.port,
25
+ db: config.database,
26
+ enableReadyCheck: true,
27
+ });
41
28
  },
42
- inject: [RedisService],
29
+ inject: [ConfigLoader],
43
30
  },
44
31
  ],
45
32
  exports: [RedisClient],