@midwayjs/typeorm 3.19.0 → 4.0.0-alpha.1
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/dist/configuration.js +4 -4
- package/dist/dataSourceManager.js +2 -2
- package/dist/decorator.js +2 -2
- package/package.json +6 -6
package/dist/configuration.js
CHANGED
|
@@ -23,7 +23,7 @@ let OrmConfiguration = class OrmConfiguration {
|
|
|
23
23
|
if (!dataSource) {
|
|
24
24
|
throw new core_1.MidwayCommonError(`DataSource ${meta.connectionName} not found with current model ${meta.modelKey}, please check it.`);
|
|
25
25
|
}
|
|
26
|
-
const type = (
|
|
26
|
+
const type = core_1.MetadataManager.transformTypeFromTSDesign(core_1.MetadataManager.getPropertyType(instance, propertyName));
|
|
27
27
|
if (type.originDesign === typeorm_1.Repository) {
|
|
28
28
|
return dataSource.getRepository(meta.modelKey);
|
|
29
29
|
}
|
|
@@ -51,8 +51,9 @@ let OrmConfiguration = class OrmConfiguration {
|
|
|
51
51
|
await dataSourceManager.stop();
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
+
exports.OrmConfiguration = OrmConfiguration;
|
|
54
55
|
__decorate([
|
|
55
|
-
(0, core_1.
|
|
56
|
+
(0, core_1.MainApp)(),
|
|
56
57
|
__metadata("design:type", Object)
|
|
57
58
|
], OrmConfiguration.prototype, "app", void 0);
|
|
58
59
|
__decorate([
|
|
@@ -65,7 +66,7 @@ __decorate([
|
|
|
65
66
|
__metadata("design:paramtypes", []),
|
|
66
67
|
__metadata("design:returntype", Promise)
|
|
67
68
|
], OrmConfiguration.prototype, "init", null);
|
|
68
|
-
OrmConfiguration = __decorate([
|
|
69
|
+
exports.OrmConfiguration = OrmConfiguration = __decorate([
|
|
69
70
|
(0, core_1.Configuration)({
|
|
70
71
|
importConfigs: [
|
|
71
72
|
{
|
|
@@ -87,5 +88,4 @@ OrmConfiguration = __decorate([
|
|
|
87
88
|
namespace: 'typeorm',
|
|
88
89
|
})
|
|
89
90
|
], OrmConfiguration);
|
|
90
|
-
exports.OrmConfiguration = OrmConfiguration;
|
|
91
91
|
//# sourceMappingURL=configuration.js.map
|
|
@@ -40,6 +40,7 @@ let TypeORMDataSourceManager = class TypeORMDataSourceManager extends core_1.Dat
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
+
exports.TypeORMDataSourceManager = TypeORMDataSourceManager;
|
|
43
44
|
__decorate([
|
|
44
45
|
(0, core_1.Config)('typeorm'),
|
|
45
46
|
__metadata("design:type", Object)
|
|
@@ -62,9 +63,8 @@ __decorate([
|
|
|
62
63
|
__metadata("design:paramtypes", []),
|
|
63
64
|
__metadata("design:returntype", Promise)
|
|
64
65
|
], TypeORMDataSourceManager.prototype, "init", null);
|
|
65
|
-
TypeORMDataSourceManager = __decorate([
|
|
66
|
+
exports.TypeORMDataSourceManager = TypeORMDataSourceManager = __decorate([
|
|
66
67
|
(0, core_1.Provide)(),
|
|
67
68
|
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
68
69
|
], TypeORMDataSourceManager);
|
|
69
|
-
exports.TypeORMDataSourceManager = TypeORMDataSourceManager;
|
|
70
70
|
//# sourceMappingURL=dataSourceManager.js.map
|
package/dist/decorator.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.EVENT_SUBSCRIBER_KEY = 'typeorm:event_subscriber_key';
|
|
|
8
8
|
exports.ORM_MODEL_KEY = 'typeorm:orm_model_key';
|
|
9
9
|
exports.ORM_DATA_SOURCE_KEY = 'typeorm:data_source_key';
|
|
10
10
|
function InjectEntityModel(modelKey, connectionName) {
|
|
11
|
-
return
|
|
11
|
+
return core_1.DecoratorManager.createCustomPropertyDecorator(exports.ORM_MODEL_KEY, {
|
|
12
12
|
modelKey,
|
|
13
13
|
connectionName,
|
|
14
14
|
});
|
|
@@ -27,7 +27,7 @@ function EventSubscriberModel() {
|
|
|
27
27
|
}
|
|
28
28
|
exports.EventSubscriberModel = EventSubscriberModel;
|
|
29
29
|
function InjectDataSource(dataSourceName) {
|
|
30
|
-
return
|
|
30
|
+
return core_1.DecoratorManager.createCustomPropertyDecorator(exports.ORM_DATA_SOURCE_KEY, {
|
|
31
31
|
dataSourceName,
|
|
32
32
|
});
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/typeorm",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"index.d.ts"
|
|
14
14
|
],
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@midwayjs/core": "^
|
|
17
|
-
"@midwayjs/mock": "^
|
|
16
|
+
"@midwayjs/core": "^4.0.0-alpha.1",
|
|
17
|
+
"@midwayjs/mock": "^4.0.0-alpha.1",
|
|
18
18
|
"sqlite3": "5.1.7",
|
|
19
19
|
"typeorm": "0.3.20"
|
|
20
20
|
},
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsc",
|
|
31
|
-
"test": "node
|
|
32
|
-
"cov": "node
|
|
31
|
+
"test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand",
|
|
32
|
+
"cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
36
|
"url": "https://github.com/midwayjs/midway.git"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "14bb4da91805a1cf52f190c0d37a74b395dd6372"
|
|
39
39
|
}
|