@midwayjs/mongoose 2.14.2 → 3.0.0-beta.12

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 CHANGED
@@ -3,35 +3,110 @@
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
- ## [2.14.2](https://github.com/midwayjs/midway/compare/v2.14.1...v2.14.2) (2021-12-28)
6
+ # [3.0.0-beta.12](https://github.com/midwayjs/midway/compare/v3.0.0-beta.11...v3.0.0-beta.12) (2021-12-28)
7
7
 
8
8
 
9
- ### Bug Fixes
9
+ ### Features
10
+
11
+ * custom error code & add @Files/@Fields ([#1438](https://github.com/midwayjs/midway/issues/1438)) ([b0032af](https://github.com/midwayjs/midway/commit/b0032afd2fa9ea0416fe69f4bd0c1a58bea5314e))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.0.0-beta.11](https://github.com/midwayjs/midway/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2021-12-21)
18
+
19
+ **Note:** Version bump only for package @midwayjs/mongoose
20
+
21
+
22
+
23
+
24
+
25
+ # [3.0.0-beta.10](https://github.com/midwayjs/midway/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2021-12-20)
26
+
27
+ **Note:** Version bump only for package @midwayjs/mongoose
10
28
 
11
- * generate middleware typings ([#1442](https://github.com/midwayjs/midway/issues/1442)) ([1b2f99b](https://github.com/midwayjs/midway/commit/1b2f99b0fcfa6d87fa216ac9277d9f1240ef26a2))
12
29
 
13
30
 
14
31
 
15
32
 
33
+ # [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
16
34
 
17
- # [2.14.0](https://github.com/midwayjs/midway/compare/v2.13.5...v2.14.0) (2021-12-06)
35
+ **Note:** Version bump only for package @midwayjs/mongoose
36
+
37
+
38
+
39
+
40
+
41
+ # [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
18
42
 
19
43
 
20
44
  ### Bug Fixes
21
45
 
22
- * express routing middleware takes effect at the controller level ([#1364](https://github.com/midwayjs/midway/issues/1364)) ([5d5f299](https://github.com/midwayjs/midway/commit/5d5f2992be116ca71b21f01fd782e3a2ac072496))
23
- * mongoose init before config load ([#1401](https://github.com/midwayjs/midway/issues/1401)) ([34d2ab8](https://github.com/midwayjs/midway/commit/34d2ab8b5bcfc9bddf52b9a93d6f3b44960ef537))
46
+ * 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))
47
+ * mongoose remote config bug ([#1399](https://github.com/midwayjs/midway/issues/1399)) ([e37602d](https://github.com/midwayjs/midway/commit/e37602d54ae503aeee48afa320709aae3d18b329))
48
+
49
+
50
+
51
+
52
+
53
+ # [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
54
+
55
+ **Note:** Version bump only for package @midwayjs/mongoose
56
+
57
+
58
+
59
+
60
+
61
+ # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
62
+
63
+ **Note:** Version bump only for package @midwayjs/mongoose
64
+
65
+
66
+
67
+
68
+
69
+ # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
70
+
71
+ **Note:** Version bump only for package @midwayjs/mongoose
72
+
73
+
74
+
75
+
76
+
77
+ # [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
78
+
79
+ **Note:** Version bump only for package @midwayjs/mongoose
80
+
81
+
82
+
83
+
84
+
85
+ # [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
86
+
87
+
88
+ ### Features
89
+
90
+ * add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
91
+
92
+
93
+
94
+
95
+
96
+ # [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
97
+
98
+ **Note:** Version bump only for package @midwayjs/mongoose
24
99
 
25
100
 
26
101
 
27
102
 
28
103
 
29
- ## [2.13.4](https://github.com/midwayjs/midway/compare/v2.13.3...v2.13.4) (2021-10-21)
104
+ # [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
30
105
 
31
106
 
32
107
  ### Features
33
108
 
34
- * add mongoose component and support multi-instance for typegoose ([#1334](https://github.com/midwayjs/midway/issues/1334)) ([ec54224](https://github.com/midwayjs/midway/commit/ec54224d775a3cfde3ff280538c8db79bcff4610))
109
+ * 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))
35
110
 
36
111
 
37
112
 
@@ -8,15 +8,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.MongooseConfiguration = void 0;
10
10
  const decorator_1 = require("@midwayjs/decorator");
11
- const DefaultConfig = require("./config.default");
12
11
  const manager_1 = require("./manager");
13
12
  let MongooseConfiguration = class MongooseConfiguration {
14
13
  async onReady(container) {
15
14
  await container.getAsync(manager_1.MongooseConnectionServiceFactory);
16
15
  }
17
16
  async onStop(container) {
18
- const factoryService = await container.getAsync(manager_1.MongooseConnectionServiceFactory);
19
- await factoryService.stop();
17
+ const factory = await container.getAsync(manager_1.MongooseConnectionServiceFactory);
18
+ await factory.stop();
20
19
  }
21
20
  };
22
21
  MongooseConfiguration = __decorate([
@@ -24,7 +23,9 @@ MongooseConfiguration = __decorate([
24
23
  namespace: 'mongoose',
25
24
  importConfigs: [
26
25
  {
27
- default: DefaultConfig,
26
+ default: {
27
+ mongoose: {},
28
+ },
28
29
  },
29
30
  ],
30
31
  })
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { MongooseConfiguration as Configuration } from './configuration';
2
+ export * from './interface';
2
3
  export * from './manager';
3
4
  //# sourceMappingURL=index.d.ts.map
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
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=interface.js.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)(core_1.ScopeEnum.Singleton)
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)(core_1.ScopeEnum.Singleton)
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": "2.14.2",
3
+ "version": "3.0.0-beta.12",
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": ">= 12.13.0"
20
+ "node": ">=12"
21
21
  },
22
22
  "license": "MIT",
23
23
  "devDependencies": {
24
- "@midwayjs/core": "^2.14.0",
25
- "@midwayjs/decorator": "^2.14.0",
26
- "@midwayjs/mock": "^2.14.0",
24
+ "@midwayjs/core": "^3.0.0-beta.12",
25
+ "@midwayjs/decorator": "^3.0.0-beta.12",
26
+ "@midwayjs/mock": "^3.0.0-beta.12",
27
27
  "mongoose": "^6.1.3"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "mongoose": "*"
31
31
  },
32
- "gitHead": "68b7fd9182619e8428f353f24a52254abce6e5bf"
32
+ "gitHead": "1c46e53eb934248007eeb7fe3920f5ac24e272c6"
33
33
  }
@@ -1,2 +0,0 @@
1
- export declare const mongoose: {};
2
- //# sourceMappingURL=config.default.d.ts.map
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mongoose = void 0;
4
- exports.mongoose = {};
5
- //# sourceMappingURL=config.default.js.map