@midwayjs/redis 3.5.3 → 3.7.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.
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.RedisConfiguration = void 0;
10
- const decorator_1 = require("@midwayjs/decorator");
10
+ const core_1 = require("@midwayjs/core");
11
11
  const manager_1 = require("./manager");
12
12
  let RedisConfiguration = class RedisConfiguration {
13
13
  async onReady(container) {
@@ -19,7 +19,7 @@ let RedisConfiguration = class RedisConfiguration {
19
19
  }
20
20
  };
21
21
  RedisConfiguration = __decorate([
22
- (0, decorator_1.Configuration)({
22
+ (0, core_1.Configuration)({
23
23
  namespace: 'redis',
24
24
  importConfigs: [
25
25
  {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { RedisConfiguration as Configuration } from './configuration';
2
2
  export * from './manager';
3
+ export * from './interface';
3
4
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -18,4 +18,5 @@ exports.Configuration = void 0;
18
18
  var configuration_1 = require("./configuration");
19
19
  Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.RedisConfiguration; } });
20
20
  __exportStar(require("./manager"), exports);
21
+ __exportStar(require("./interface"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ import * as Redis from 'ioredis';
2
+ import { ClusterNode, ClusterOptions } from 'ioredis';
3
+ export declare type RedisConfigOptions = Redis.RedisOptions | ({
4
+ cluster?: boolean;
5
+ nodes?: ClusterNode[];
6
+ } & ClusterOptions);
7
+ //# sourceMappingURL=interface.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=interface.js.map
package/dist/manager.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { ServiceFactory } from '@midwayjs/core';
1
+ import { ServiceFactory, ServiceFactoryConfigOption } from '@midwayjs/core';
2
2
  import Redis from 'ioredis';
3
+ import { RedisConfigOptions } from './interface';
3
4
  export declare class RedisServiceFactory extends ServiceFactory<Redis> {
4
- redisConfig: any;
5
+ redisConfig: ServiceFactoryConfigOption<RedisConfigOptions>;
5
6
  init(): Promise<void>;
6
7
  logger: any;
7
8
  createClient(config: any): Promise<Redis>;
package/dist/manager.js CHANGED
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RedisService = exports.RedisServiceFactory = void 0;
13
- const decorator_1 = require("@midwayjs/decorator");
14
13
  const core_1 = require("@midwayjs/core");
15
14
  const ioredis_1 = require("ioredis");
16
15
  const assert = require("assert");
@@ -66,22 +65,22 @@ let RedisServiceFactory = class RedisServiceFactory extends core_1.ServiceFactor
66
65
  }
67
66
  };
68
67
  __decorate([
69
- (0, decorator_1.Config)('redis'),
68
+ (0, core_1.Config)('redis'),
70
69
  __metadata("design:type", Object)
71
70
  ], RedisServiceFactory.prototype, "redisConfig", void 0);
72
71
  __decorate([
73
- (0, decorator_1.Init)(),
72
+ (0, core_1.Init)(),
74
73
  __metadata("design:type", Function),
75
74
  __metadata("design:paramtypes", []),
76
75
  __metadata("design:returntype", Promise)
77
76
  ], RedisServiceFactory.prototype, "init", null);
78
77
  __decorate([
79
- (0, decorator_1.Logger)('coreLogger'),
78
+ (0, core_1.Logger)('coreLogger'),
80
79
  __metadata("design:type", Object)
81
80
  ], RedisServiceFactory.prototype, "logger", void 0);
82
81
  RedisServiceFactory = __decorate([
83
- (0, decorator_1.Provide)(),
84
- (0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
82
+ (0, core_1.Provide)(),
83
+ (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
85
84
  ], RedisServiceFactory);
86
85
  exports.RedisServiceFactory = RedisServiceFactory;
87
86
  let RedisService = class RedisService {
@@ -93,18 +92,18 @@ let RedisService = class RedisService {
93
92
  }
94
93
  };
95
94
  __decorate([
96
- (0, decorator_1.Inject)(),
95
+ (0, core_1.Inject)(),
97
96
  __metadata("design:type", RedisServiceFactory)
98
97
  ], RedisService.prototype, "serviceFactory", void 0);
99
98
  __decorate([
100
- (0, decorator_1.Init)(),
99
+ (0, core_1.Init)(),
101
100
  __metadata("design:type", Function),
102
101
  __metadata("design:paramtypes", []),
103
102
  __metadata("design:returntype", Promise)
104
103
  ], RedisService.prototype, "init", null);
105
104
  RedisService = __decorate([
106
- (0, decorator_1.Provide)(),
107
- (0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
105
+ (0, core_1.Provide)(),
106
+ (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
108
107
  ], RedisService);
109
108
  exports.RedisService = RedisService;
110
109
  (0, core_1.delegateTargetAllPrototypeMethod)(RedisService, ioredis_1.default);
package/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { ClusterNode, ClusterOptions } from 'ioredis';
2
+ import * as Redis from 'ioredis';
3
+ import { RedisConfigOptions } from './dist';
2
4
 
3
5
  export * from './dist/index';
4
6
 
5
- import * as Redis from 'ioredis';
6
-
7
7
  // Single Redis
8
8
  // client: {
9
9
  // host: 'host',
@@ -51,12 +51,6 @@ import * as Redis from 'ioredis';
51
51
 
52
52
  declare module '@midwayjs/core/dist/interface' {
53
53
  interface MidwayConfig {
54
- redis?: ServiceFactoryConfigOption<
55
- | Redis.RedisOptions
56
- | ({
57
- cluster?: boolean;
58
- nodes?: ClusterNode[];
59
- } & ClusterOptions)
60
- >;
54
+ redis?: ServiceFactoryConfigOption<RedisConfigOptions>;
61
55
  }
62
56
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midwayjs/redis",
3
3
  "description": "midway redis component",
4
- "version": "3.5.3",
4
+ "version": "3.7.0",
5
5
  "main": "dist/index",
6
6
  "typings": "index.d.ts",
7
7
  "files": [
@@ -10,9 +10,8 @@
10
10
  "index.d.ts"
11
11
  ],
12
12
  "devDependencies": {
13
- "@midwayjs/core": "^3.5.3",
14
- "@midwayjs/decorator": "^3.4.11",
15
- "@midwayjs/mock": "^3.5.3"
13
+ "@midwayjs/core": "^3.7.0",
14
+ "@midwayjs/mock": "^3.7.0"
16
15
  },
17
16
  "dependencies": {
18
17
  "ioredis": "^5.0.0"
@@ -36,5 +35,5 @@
36
35
  "type": "git",
37
36
  "url": "https://github.com/midwayjs/midway.git"
38
37
  },
39
- "gitHead": "32356484664846984f6d3d65a3a75dea015e8dcc"
38
+ "gitHead": "99386083ee26b386fd508b9c892091c914e77535"
40
39
  }