@midwayjs/mongoose 2.13.0 → 3.0.0-beta.10

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,6 +3,96 @@
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
+ # [3.0.0-beta.10](https://github.com/midwayjs/midway/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2021-12-20)
7
+
8
+ **Note:** Version bump only for package @midwayjs/mongoose
9
+
10
+
11
+
12
+
13
+
14
+ # [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
15
+
16
+ **Note:** Version bump only for package @midwayjs/mongoose
17
+
18
+
19
+
20
+
21
+
22
+ # [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * 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))
28
+ * mongoose remote config bug ([#1399](https://github.com/midwayjs/midway/issues/1399)) ([e37602d](https://github.com/midwayjs/midway/commit/e37602d54ae503aeee48afa320709aae3d18b329))
29
+
30
+
31
+
32
+
33
+
34
+ # [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
35
+
36
+ **Note:** Version bump only for package @midwayjs/mongoose
37
+
38
+
39
+
40
+
41
+
42
+ # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
43
+
44
+ **Note:** Version bump only for package @midwayjs/mongoose
45
+
46
+
47
+
48
+
49
+
50
+ # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
51
+
52
+ **Note:** Version bump only for package @midwayjs/mongoose
53
+
54
+
55
+
56
+
57
+
58
+ # [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
59
+
60
+ **Note:** Version bump only for package @midwayjs/mongoose
61
+
62
+
63
+
64
+
65
+
66
+ # [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
67
+
68
+
69
+ ### Features
70
+
71
+ * add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
72
+
73
+
74
+
75
+
76
+
77
+ # [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
78
+
79
+ **Note:** Version bump only for package @midwayjs/mongoose
80
+
81
+
82
+
83
+
84
+
85
+ # [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
86
+
87
+
88
+ ### Features
89
+
90
+ * 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))
91
+
92
+
93
+
94
+
95
+
6
96
  ## [2.13.3](https://github.com/midwayjs/midway/compare/v2.13.2...v2.13.3) (2021-09-28)
7
97
 
8
98
  **Note:** Version bump only for package @midwayjs/typegoose
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2013 - Now midwayjs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  this is a sub package for midway.
7
7
 
8
- Document: [https://midwayjs.org/midway](https://midwayjs.org/midway)
8
+ Document: [https://midwayjs.org](https://midwayjs.org)
9
9
 
10
10
  ## License
11
11
 
@@ -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
@@ -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
- async onStop() {
19
- await this.factoryService.stop();
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: DefaultConfig,
26
+ default: {
27
+ mongoose: {},
28
+ },
32
29
  },
33
30
  ],
34
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.13.0",
3
+ "version": "3.0.0-beta.10",
4
4
  "description": "Midway Component for mongoose",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -17,16 +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.13.3",
25
- "@midwayjs/decorator": "^2.13.2",
26
- "@midwayjs/mock": "^2.13.3",
24
+ "@midwayjs/core": "^3.0.0-beta.10",
25
+ "@midwayjs/decorator": "^3.0.0-beta.10",
26
+ "@midwayjs/mock": "^3.0.0-beta.10",
27
27
  "mongoose": "~6.0.11"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "mongoose": "*"
31
- }
31
+ },
32
+ "gitHead": "153870f2e2dd6b17673ec7591e49224a6bd51b36"
32
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