@midwayjs/typegoose 3.5.1 → 3.6.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.
@@ -10,12 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.TypegooseConfiguration = void 0;
13
- const decorator_1 = require("@midwayjs/decorator");
13
+ const core_1 = require("@midwayjs/core");
14
14
  const mongoose = require("@midwayjs/mongoose");
15
15
  const interface_1 = require("./interface");
16
16
  const typegoose_1 = require("@typegoose/typegoose");
17
17
  const mongo = require("mongoose");
18
- const core_1 = require("@midwayjs/core");
19
18
  let TypegooseConfiguration = class TypegooseConfiguration {
20
19
  constructor() {
21
20
  this.legacyMode = false;
@@ -38,10 +37,10 @@ let TypegooseConfiguration = class TypegooseConfiguration {
38
37
  }
39
38
  }
40
39
  }
41
- const Models = (0, decorator_1.listModule)(interface_1.ENTITY_MODEL_KEY);
40
+ const Models = (0, core_1.listModule)(interface_1.ENTITY_MODEL_KEY);
42
41
  // 兼容老代码
43
42
  for (const Model of Models) {
44
- const metadata = (_a = (0, decorator_1.getClassMetadata)(interface_1.ENTITY_MODEL_KEY, Model)) !== null && _a !== void 0 ? _a : {};
43
+ const metadata = (_a = (0, core_1.getClassMetadata)(interface_1.ENTITY_MODEL_KEY, Model)) !== null && _a !== void 0 ? _a : {};
45
44
  const connectionName = (_b = metadata.connectionName) !== null && _b !== void 0 ? _b : 'default';
46
45
  const conn = connectionFactory.getDataSource(connectionName);
47
46
  if (conn) {
@@ -65,25 +64,25 @@ let TypegooseConfiguration = class TypegooseConfiguration {
65
64
  }
66
65
  };
67
66
  __decorate([
68
- (0, decorator_1.Config)('mongoose'),
67
+ (0, core_1.Config)('mongoose'),
69
68
  __metadata("design:type", Object)
70
69
  ], TypegooseConfiguration.prototype, "oldMongooseConfig", void 0);
71
70
  __decorate([
72
- (0, decorator_1.App)(),
71
+ (0, core_1.App)(),
73
72
  __metadata("design:type", Object)
74
73
  ], TypegooseConfiguration.prototype, "app", void 0);
75
74
  __decorate([
76
- (0, decorator_1.Inject)(),
75
+ (0, core_1.Inject)(),
77
76
  __metadata("design:type", core_1.MidwayDecoratorService)
78
77
  ], TypegooseConfiguration.prototype, "decoratorService", void 0);
79
78
  __decorate([
80
- (0, decorator_1.Init)(),
79
+ (0, core_1.Init)(),
81
80
  __metadata("design:type", Function),
82
81
  __metadata("design:paramtypes", []),
83
82
  __metadata("design:returntype", Promise)
84
83
  ], TypegooseConfiguration.prototype, "init", null);
85
84
  TypegooseConfiguration = __decorate([
86
- (0, decorator_1.Configuration)({
85
+ (0, core_1.Configuration)({
87
86
  namespace: 'typegoose',
88
87
  imports: [mongoose],
89
88
  })
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EntityModel = void 0;
4
- const decorator_1 = require("@midwayjs/decorator");
4
+ const core_1 = require("@midwayjs/core");
5
5
  const interface_1 = require("../interface");
6
6
  function EntityModel(options) {
7
7
  return (target) => {
8
- (0, decorator_1.saveModule)(interface_1.ENTITY_MODEL_KEY, target);
9
- (0, decorator_1.saveClassMetadata)(interface_1.ENTITY_MODEL_KEY, options, target);
8
+ (0, core_1.saveModule)(interface_1.ENTITY_MODEL_KEY, target);
9
+ (0, core_1.saveClassMetadata)(interface_1.ENTITY_MODEL_KEY, options, target);
10
10
  };
11
11
  }
12
12
  exports.EntityModel = EntityModel;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InjectEntityModel = void 0;
4
- const decorator_1 = require("@midwayjs/decorator");
4
+ const core_1 = require("@midwayjs/core");
5
5
  const interface_1 = require("../interface");
6
6
  function InjectEntityModel(modelKey) {
7
- return (0, decorator_1.createCustomPropertyDecorator)(interface_1.ENTITY_MODEL_KEY, {
7
+ return (0, core_1.createCustomPropertyDecorator)(interface_1.ENTITY_MODEL_KEY, {
8
8
  modelKey,
9
9
  });
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/typegoose",
3
- "version": "3.5.1",
3
+ "version": "3.6.0",
4
4
  "description": "Midway Component for typegoose",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -22,14 +22,13 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@midwayjs/mongoose": "^3.5.1"
25
+ "@midwayjs/mongoose": "^3.6.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@midwayjs/core": "^3.5.1",
29
- "@midwayjs/decorator": "^3.4.11",
30
- "@midwayjs/mock": "^3.5.1",
31
- "@typegoose/typegoose": "9.11.2",
32
- "mongoose": "6.5.4"
28
+ "@midwayjs/core": "^3.6.0",
29
+ "@midwayjs/mock": "^3.6.0",
30
+ "@typegoose/typegoose": "9.12.1",
31
+ "mongoose": "6.6.5"
33
32
  },
34
- "gitHead": "3b63fc768617037644602dd5ad66d3734ce01b16"
33
+ "gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
35
34
  }