@midwayjs/mongoose 2.13.4 → 3.0.0-beta.11
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 +89 -2
- package/README.md +1 -1
- package/dist/configuration.d.ts +1 -3
- package/dist/configuration.js +9 -12
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/interface.d.ts +19 -0
- package/dist/interface.js +3 -0
- package/dist/manager.js +2 -2
- package/package.json +6 -6
- package/dist/config.default.d.ts +0 -2
- package/dist/config.default.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,99 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [3.0.0-beta.11](https://github.com/midwayjs/midway/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2021-12-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @midwayjs/mongoose
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.0.0-beta.10](https://github.com/midwayjs/midway/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2021-12-20)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @midwayjs/mongoose
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @midwayjs/mongoose
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* express routing middleware takes effect at the controller level ([#1364](https://github.com/midwayjs/midway/issues/1364)) ([b9272e0](https://github.com/midwayjs/midway/commit/b9272e0971003443304b0c53815be31a0061b4bd))
|
|
36
|
+
* mongoose remote config bug ([#1399](https://github.com/midwayjs/midway/issues/1399)) ([e37602d](https://github.com/midwayjs/midway/commit/e37602d54ae503aeee48afa320709aae3d18b329))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
|
|
43
|
+
|
|
44
|
+
**Note:** Version bump only for package @midwayjs/mongoose
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
|
|
51
|
+
|
|
52
|
+
**Note:** Version bump only for package @midwayjs/mongoose
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
|
|
59
|
+
|
|
60
|
+
**Note:** Version bump only for package @midwayjs/mongoose
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
|
|
67
|
+
|
|
68
|
+
**Note:** Version bump only for package @midwayjs/mongoose
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Features
|
|
78
|
+
|
|
79
|
+
* add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
|
|
86
|
+
|
|
87
|
+
**Note:** Version bump only for package @midwayjs/mongoose
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
# [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
|
|
7
94
|
|
|
8
95
|
|
|
9
96
|
### Features
|
|
10
97
|
|
|
11
|
-
* add mongoose component and support multi-instance for typegoose ([#1334](https://github.com/midwayjs/midway/issues/1334)) ([
|
|
98
|
+
* add mongoose component and support multi-instance for typegoose ([#1334](https://github.com/midwayjs/midway/issues/1334)) ([ca0b73f](https://github.com/midwayjs/midway/commit/ca0b73fec77e8871e4001b4c9d3e45397ce32450))
|
|
12
99
|
|
|
13
100
|
|
|
14
101
|
|
package/README.md
CHANGED
package/dist/configuration.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ILifeCycle, IMidwayContainer } from '@midwayjs/core';
|
|
2
|
-
import { MongooseConnectionServiceFactory } from './manager';
|
|
3
2
|
export declare class MongooseConfiguration implements ILifeCycle {
|
|
4
|
-
factoryService: MongooseConnectionServiceFactory;
|
|
5
3
|
onReady(container: IMidwayContainer): Promise<void>;
|
|
6
|
-
onStop(): Promise<void>;
|
|
4
|
+
onStop(container: IMidwayContainer): Promise<void>;
|
|
7
5
|
}
|
|
8
6
|
//# sourceMappingURL=configuration.d.ts.map
|
package/dist/configuration.js
CHANGED
|
@@ -5,30 +5,27 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
9
|
exports.MongooseConfiguration = void 0;
|
|
13
10
|
const decorator_1 = require("@midwayjs/decorator");
|
|
14
|
-
const DefaultConfig = require("./config.default");
|
|
15
11
|
const manager_1 = require("./manager");
|
|
16
12
|
let MongooseConfiguration = class MongooseConfiguration {
|
|
17
|
-
async onReady(container) {
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
async onReady(container) {
|
|
14
|
+
await container.getAsync(manager_1.MongooseConnectionServiceFactory);
|
|
15
|
+
}
|
|
16
|
+
async onStop(container) {
|
|
17
|
+
const factory = await container.getAsync(manager_1.MongooseConnectionServiceFactory);
|
|
18
|
+
await factory.stop();
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, decorator_1.Inject)(),
|
|
24
|
-
__metadata("design:type", manager_1.MongooseConnectionServiceFactory)
|
|
25
|
-
], MongooseConfiguration.prototype, "factoryService", void 0);
|
|
26
21
|
MongooseConfiguration = __decorate([
|
|
27
22
|
(0, decorator_1.Configuration)({
|
|
28
23
|
namespace: 'mongoose',
|
|
29
24
|
importConfigs: [
|
|
30
25
|
{
|
|
31
|
-
default:
|
|
26
|
+
default: {
|
|
27
|
+
mongoose: {},
|
|
28
|
+
},
|
|
32
29
|
},
|
|
33
30
|
],
|
|
34
31
|
})
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -13,5 +13,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.Configuration = void 0;
|
|
14
14
|
var configuration_1 = require("./configuration");
|
|
15
15
|
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.MongooseConfiguration; } });
|
|
16
|
+
__exportStar(require("./interface"), exports);
|
|
16
17
|
__exportStar(require("./manager"), exports);
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as mongoose from 'mongoose';
|
|
2
|
+
interface M5 {
|
|
3
|
+
ConnectionOptions: unknown;
|
|
4
|
+
}
|
|
5
|
+
interface M6 {
|
|
6
|
+
ConnectOptions: unknown;
|
|
7
|
+
}
|
|
8
|
+
declare type ExtractConnectionOptions<T> = T extends M5 ? T['ConnectionOptions'] : T extends M6 ? T['ConnectOptions'] : never;
|
|
9
|
+
declare type ConnectionOptions = ExtractConnectionOptions<typeof mongoose>;
|
|
10
|
+
declare module '@midwayjs/core/dist/interface' {
|
|
11
|
+
interface MidwayConfig {
|
|
12
|
+
mongoose?: ServiceFactoryConfigOption<{
|
|
13
|
+
uri: string;
|
|
14
|
+
options: ConnectionOptions;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=interface.d.ts.map
|
package/dist/manager.js
CHANGED
|
@@ -59,7 +59,7 @@ __decorate([
|
|
|
59
59
|
], MongooseConnectionServiceFactory.prototype, "init", null);
|
|
60
60
|
MongooseConnectionServiceFactory = __decorate([
|
|
61
61
|
(0, decorator_1.Provide)(),
|
|
62
|
-
(0, decorator_1.Scope)(
|
|
62
|
+
(0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
|
|
63
63
|
], MongooseConnectionServiceFactory);
|
|
64
64
|
exports.MongooseConnectionServiceFactory = MongooseConnectionServiceFactory;
|
|
65
65
|
let MongooseConnectionService = class MongooseConnectionService {
|
|
@@ -79,7 +79,7 @@ __decorate([
|
|
|
79
79
|
], MongooseConnectionService.prototype, "init", null);
|
|
80
80
|
MongooseConnectionService = __decorate([
|
|
81
81
|
(0, decorator_1.Provide)(),
|
|
82
|
-
(0, decorator_1.Scope)(
|
|
82
|
+
(0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
|
|
83
83
|
], MongooseConnectionService);
|
|
84
84
|
exports.MongooseConnectionService = MongooseConnectionService;
|
|
85
85
|
(0, core_1.delegateTargetMethod)(MongooseConnectionService, [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/mongoose",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.11",
|
|
4
4
|
"description": "Midway Component for mongoose",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"dist/**/*.d.ts"
|
|
18
18
|
],
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
20
|
+
"node": ">=12"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@midwayjs/core": "^
|
|
25
|
-
"@midwayjs/decorator": "^
|
|
26
|
-
"@midwayjs/mock": "^
|
|
24
|
+
"@midwayjs/core": "^3.0.0-beta.11",
|
|
25
|
+
"@midwayjs/decorator": "^3.0.0-beta.11",
|
|
26
|
+
"@midwayjs/mock": "^3.0.0-beta.11",
|
|
27
27
|
"mongoose": "~6.0.11"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"mongoose": "*"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "a2b066fd500e815e799e7f421cd216f12e0e9f8e"
|
|
33
33
|
}
|
package/dist/config.default.d.ts
DELETED