@midwayjs/redis 3.0.0-alpha.43 → 3.0.0-beta.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.
- package/CHANGELOG.md +39 -0
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +12 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/index.d.ts +62 -0
- package/package.json +11 -7
- package/dist/config.default.d.ts +0 -5
- package/dist/config.default.js +0 -54
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @midwayjs/redis
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @midwayjs/redis
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* add cos component ([#1271](https://github.com/midwayjs/midway/issues/1271)) ([c18e597](https://github.com/midwayjs/midway/commit/c18e597d55a6452188cc7daecd0062bf161028cc))
|
|
39
|
+
* add redis component ([#1270](https://github.com/midwayjs/midway/issues/1270)) ([09c993a](https://github.com/midwayjs/midway/commit/09c993ac308d26fa9c742a659471c3f4cf5c5782))
|
package/dist/configuration.d.ts
CHANGED
package/dist/configuration.js
CHANGED
|
@@ -6,11 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.RedisConfiguration = void 0;
|
|
10
10
|
const decorator_1 = require("@midwayjs/decorator");
|
|
11
|
-
const path_1 = require("path");
|
|
12
11
|
const manager_1 = require("./manager");
|
|
13
|
-
let
|
|
12
|
+
let RedisConfiguration = class RedisConfiguration {
|
|
14
13
|
async onReady(container) {
|
|
15
14
|
await container.getAsync(manager_1.RedisServiceFactory);
|
|
16
15
|
}
|
|
@@ -19,11 +18,17 @@ let AutoConfiguration = class AutoConfiguration {
|
|
|
19
18
|
await factory.stop();
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
|
-
|
|
21
|
+
RedisConfiguration = __decorate([
|
|
23
22
|
(0, decorator_1.Configuration)({
|
|
24
23
|
namespace: 'redis',
|
|
25
|
-
importConfigs: [
|
|
24
|
+
importConfigs: [
|
|
25
|
+
{
|
|
26
|
+
default: {
|
|
27
|
+
redis: {},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
],
|
|
26
31
|
})
|
|
27
|
-
],
|
|
28
|
-
exports.
|
|
32
|
+
], RedisConfiguration);
|
|
33
|
+
exports.RedisConfiguration = RedisConfiguration;
|
|
29
34
|
//# sourceMappingURL=configuration.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -12,6 +12,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.Configuration = void 0;
|
|
14
14
|
var configuration_1 = require("./configuration");
|
|
15
|
-
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.
|
|
15
|
+
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.RedisConfiguration; } });
|
|
16
16
|
__exportStar(require("./manager"), exports);
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ClusterNode, ClusterOptions } from 'ioredis';
|
|
2
|
+
|
|
3
|
+
export * from './dist/index';
|
|
4
|
+
|
|
5
|
+
import * as Redis from 'ioredis';
|
|
6
|
+
|
|
7
|
+
// Single Redis
|
|
8
|
+
// client: {
|
|
9
|
+
// host: 'host',
|
|
10
|
+
// port: 'port',
|
|
11
|
+
// family: 'user',
|
|
12
|
+
// password: 'password',
|
|
13
|
+
// db: 'db',
|
|
14
|
+
// },
|
|
15
|
+
|
|
16
|
+
// Cluster Redis
|
|
17
|
+
// client: {
|
|
18
|
+
// cluster: true,
|
|
19
|
+
// nodes: [{
|
|
20
|
+
// host: 'host',
|
|
21
|
+
// port: 'port',
|
|
22
|
+
// family: 'user',
|
|
23
|
+
// password: 'password',
|
|
24
|
+
// db: 'db',
|
|
25
|
+
// },{
|
|
26
|
+
// host: 'host',
|
|
27
|
+
// port: 'port',
|
|
28
|
+
// family: 'user',
|
|
29
|
+
// password: 'password',
|
|
30
|
+
// db: 'db',
|
|
31
|
+
// },
|
|
32
|
+
// ]},
|
|
33
|
+
|
|
34
|
+
// Multi Redis
|
|
35
|
+
// clients: {
|
|
36
|
+
// instance1: {
|
|
37
|
+
// host: 'host',
|
|
38
|
+
// port: 'port',
|
|
39
|
+
// family: 'user',
|
|
40
|
+
// password: 'password',
|
|
41
|
+
// db: 'db',
|
|
42
|
+
// },
|
|
43
|
+
// instance2: {
|
|
44
|
+
// host: 'host',
|
|
45
|
+
// port: 'port',
|
|
46
|
+
// family: 'user',
|
|
47
|
+
// password: 'password',
|
|
48
|
+
// db: 'db',
|
|
49
|
+
// },
|
|
50
|
+
// },
|
|
51
|
+
|
|
52
|
+
declare module '@midwayjs/core/dist/interface' {
|
|
53
|
+
interface MidwayConfig {
|
|
54
|
+
redis?: ServiceFactoryConfigOption<
|
|
55
|
+
| Redis.RedisOptions
|
|
56
|
+
| ({
|
|
57
|
+
cluster?: boolean;
|
|
58
|
+
nodes?: ClusterNode[];
|
|
59
|
+
} & ClusterOptions)
|
|
60
|
+
>;
|
|
61
|
+
}
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/redis",
|
|
3
3
|
"description": "midway redis component",
|
|
4
|
-
"version": "3.0.0-
|
|
4
|
+
"version": "3.0.0-beta.4",
|
|
5
5
|
"main": "dist/index",
|
|
6
|
-
"typings": "
|
|
6
|
+
"typings": "index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist/**/*.js",
|
|
9
|
-
"dist/**/*.d.ts"
|
|
9
|
+
"dist/**/*.d.ts",
|
|
10
|
+
"index.d.ts"
|
|
10
11
|
],
|
|
11
12
|
"devDependencies": {
|
|
12
|
-
"@midwayjs/core": "^3.0.0-
|
|
13
|
-
"@midwayjs/decorator": "^3.0.0-
|
|
14
|
-
"@midwayjs/mock": "^3.0.0-
|
|
13
|
+
"@midwayjs/core": "^3.0.0-beta.4",
|
|
14
|
+
"@midwayjs/decorator": "^3.0.0-beta.4",
|
|
15
|
+
"@midwayjs/mock": "^3.0.0-beta.4",
|
|
15
16
|
"@types/ioredis": "^4.27.1"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
@@ -29,9 +30,12 @@
|
|
|
29
30
|
"ci": "npm run test",
|
|
30
31
|
"lint": "mwts check"
|
|
31
32
|
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=12"
|
|
35
|
+
},
|
|
32
36
|
"repository": {
|
|
33
37
|
"type": "git",
|
|
34
38
|
"url": "https://github.com/midwayjs/midway.git"
|
|
35
39
|
},
|
|
36
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "02e2144e302f807770b512b0d89da3145b1cbf2e"
|
|
37
41
|
}
|
package/dist/config.default.d.ts
DELETED
package/dist/config.default.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.redis = void 0;
|
|
4
|
-
exports.redis = {
|
|
5
|
-
default: {},
|
|
6
|
-
// redis client will try to use TIME command to detect client is ready or not
|
|
7
|
-
// if your redis server not support TIME command, please set this config to false
|
|
8
|
-
// see https://redis.io/commands/time
|
|
9
|
-
supportTimeCommand: true,
|
|
10
|
-
// Redis: require('ioredis'), // customize ioredis version, only set when you needed
|
|
11
|
-
// Single Redis
|
|
12
|
-
// client: {
|
|
13
|
-
// host: 'host',
|
|
14
|
-
// port: 'port',
|
|
15
|
-
// family: 'user',
|
|
16
|
-
// password: 'password',
|
|
17
|
-
// db: 'db',
|
|
18
|
-
// },
|
|
19
|
-
// Cluster Redis
|
|
20
|
-
// client: {
|
|
21
|
-
// cluster: true,
|
|
22
|
-
// nodes: [{
|
|
23
|
-
// host: 'host',
|
|
24
|
-
// port: 'port',
|
|
25
|
-
// family: 'user',
|
|
26
|
-
// password: 'password',
|
|
27
|
-
// db: 'db',
|
|
28
|
-
// },{
|
|
29
|
-
// host: 'host',
|
|
30
|
-
// port: 'port',
|
|
31
|
-
// family: 'user',
|
|
32
|
-
// password: 'password',
|
|
33
|
-
// db: 'db',
|
|
34
|
-
// },
|
|
35
|
-
// ]},
|
|
36
|
-
// Multi Redis
|
|
37
|
-
// clients: {
|
|
38
|
-
// instance1: {
|
|
39
|
-
// host: 'host',
|
|
40
|
-
// port: 'port',
|
|
41
|
-
// family: 'user',
|
|
42
|
-
// password: 'password',
|
|
43
|
-
// db: 'db',
|
|
44
|
-
// },
|
|
45
|
-
// instance2: {
|
|
46
|
-
// host: 'host',
|
|
47
|
-
// port: 'port',
|
|
48
|
-
// family: 'user',
|
|
49
|
-
// password: 'password',
|
|
50
|
-
// db: 'db',
|
|
51
|
-
// },
|
|
52
|
-
// },
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=config.default.js.map
|