@midwayjs/typeorm 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.
@@ -11,13 +11,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OrmConfiguration = void 0;
13
13
  const core_1 = require("@midwayjs/core");
14
- const decorator_1 = require("@midwayjs/decorator");
15
- const decorator_2 = require("./decorator");
14
+ const decorator_1 = require("./decorator");
16
15
  const dataSourceManager_1 = require("./dataSourceManager");
17
16
  const typeorm_1 = require("typeorm");
18
17
  let OrmConfiguration = class OrmConfiguration {
19
18
  async init() {
20
- this.decoratorService.registerPropertyHandler(decorator_2.ORM_MODEL_KEY, (propertyName, meta) => {
19
+ this.decoratorService.registerPropertyHandler(decorator_1.ORM_MODEL_KEY, (propertyName, meta) => {
21
20
  return this.dataSourceManager
22
21
  .getDataSource(meta.connectionName ||
23
22
  this.dataSourceManager.getDataSourceNameByModel(meta.modelKey))
@@ -34,21 +33,21 @@ let OrmConfiguration = class OrmConfiguration {
34
33
  }
35
34
  };
36
35
  __decorate([
37
- (0, decorator_1.App)(),
36
+ (0, core_1.App)(),
38
37
  __metadata("design:type", Object)
39
38
  ], OrmConfiguration.prototype, "app", void 0);
40
39
  __decorate([
41
- (0, decorator_1.Inject)(),
40
+ (0, core_1.Inject)(),
42
41
  __metadata("design:type", core_1.MidwayDecoratorService)
43
42
  ], OrmConfiguration.prototype, "decoratorService", void 0);
44
43
  __decorate([
45
- (0, decorator_1.Init)(),
44
+ (0, core_1.Init)(),
46
45
  __metadata("design:type", Function),
47
46
  __metadata("design:paramtypes", []),
48
47
  __metadata("design:returntype", Promise)
49
48
  ], OrmConfiguration.prototype, "init", null);
50
49
  OrmConfiguration = __decorate([
51
- (0, decorator_1.Configuration)({
50
+ (0, core_1.Configuration)({
52
51
  importConfigs: [
53
52
  {
54
53
  default: {
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.TypeORMDataSourceManager = void 0;
13
- const decorator_1 = require("@midwayjs/decorator");
14
13
  const core_1 = require("@midwayjs/core");
15
14
  const typeorm_1 = require("typeorm");
16
15
  let TypeORMDataSourceManager = class TypeORMDataSourceManager extends core_1.DataSourceManager {
@@ -35,26 +34,26 @@ let TypeORMDataSourceManager = class TypeORMDataSourceManager extends core_1.Dat
35
34
  }
36
35
  };
37
36
  __decorate([
38
- (0, decorator_1.Config)('typeorm'),
37
+ (0, core_1.Config)('typeorm'),
39
38
  __metadata("design:type", Object)
40
39
  ], TypeORMDataSourceManager.prototype, "typeormConfig", void 0);
41
40
  __decorate([
42
- (0, decorator_1.ApplicationContext)(),
41
+ (0, core_1.ApplicationContext)(),
43
42
  __metadata("design:type", Object)
44
43
  ], TypeORMDataSourceManager.prototype, "applicationContext", void 0);
45
44
  __decorate([
46
- (0, decorator_1.Inject)(),
45
+ (0, core_1.Inject)(),
47
46
  __metadata("design:type", String)
48
47
  ], TypeORMDataSourceManager.prototype, "baseDir", void 0);
49
48
  __decorate([
50
- (0, decorator_1.Init)(),
49
+ (0, core_1.Init)(),
51
50
  __metadata("design:type", Function),
52
51
  __metadata("design:paramtypes", []),
53
52
  __metadata("design:returntype", Promise)
54
53
  ], TypeORMDataSourceManager.prototype, "init", null);
55
54
  TypeORMDataSourceManager = __decorate([
56
- (0, decorator_1.Provide)(),
57
- (0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
55
+ (0, core_1.Provide)(),
56
+ (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
58
57
  ], TypeORMDataSourceManager);
59
58
  exports.TypeORMDataSourceManager = TypeORMDataSourceManager;
60
59
  //# sourceMappingURL=dataSourceManager.js.map
package/dist/decorator.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventSubscriberModel = exports.InjectEntityModel = exports.ORM_MODEL_KEY = exports.EVENT_SUBSCRIBER_KEY = exports.ENTITY_MODEL_KEY = void 0;
4
- const decorator_1 = require("@midwayjs/decorator");
4
+ const core_1 = require("@midwayjs/core");
5
5
  const typeorm_1 = require("typeorm");
6
6
  exports.ENTITY_MODEL_KEY = 'typeorm:entity_model_key';
7
7
  exports.EVENT_SUBSCRIBER_KEY = 'typeorm:event_subscriber_key';
8
8
  exports.ORM_MODEL_KEY = 'typeorm:orm_model_key';
9
9
  function InjectEntityModel(modelKey, connectionName) {
10
- return (0, decorator_1.createCustomPropertyDecorator)(exports.ORM_MODEL_KEY, {
10
+ return (0, core_1.createCustomPropertyDecorator)(exports.ORM_MODEL_KEY, {
11
11
  modelKey,
12
12
  connectionName,
13
13
  });
@@ -19,8 +19,8 @@ exports.InjectEntityModel = InjectEntityModel;
19
19
  */
20
20
  function EventSubscriberModel() {
21
21
  return function (target) {
22
- (0, decorator_1.Provide)()(target);
23
- (0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)(target);
22
+ (0, core_1.Provide)()(target);
23
+ (0, core_1.Scope)(core_1.ScopeEnum.Singleton)(target);
24
24
  (0, typeorm_1.EventSubscriber)()(target);
25
25
  };
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/typeorm",
3
- "version": "3.5.1",
3
+ "version": "3.6.0",
4
4
  "main": "dist/index",
5
5
  "typings": "index.d.ts",
6
6
  "files": [
@@ -9,11 +9,10 @@
9
9
  "index.d.ts"
10
10
  ],
11
11
  "devDependencies": {
12
- "@midwayjs/core": "^3.5.1",
13
- "@midwayjs/decorator": "^3.4.11",
14
- "@midwayjs/mock": "^3.5.1",
15
- "sqlite3": "5.0.11",
16
- "typeorm": "0.3.9"
12
+ "@midwayjs/core": "^3.6.0",
13
+ "@midwayjs/mock": "^3.6.0",
14
+ "sqlite3": "5.1.2",
15
+ "typeorm": "0.3.10"
17
16
  },
18
17
  "author": {
19
18
  "name": "czy88840616",
@@ -32,5 +31,5 @@
32
31
  "type": "git",
33
32
  "url": "http://github.com/midwayjs/midway.git"
34
33
  },
35
- "gitHead": "3b63fc768617037644602dd5ad66d3734ce01b16"
34
+ "gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
36
35
  }