@tsed/mikro-orm 8.0.0-rc.4 → 8.0.0-rc.6
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/lib/esm/MikroOrmModule.js +6 -4
- package/lib/esm/MikroOrmModule.js.map +1 -1
- package/package.json +12 -12
- package/vitest.config.mts +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata, __param } from "tslib";
|
|
2
2
|
import "./services/MikroOrmFactory.js";
|
|
3
3
|
import { classOf, isFunction, Store } from "@tsed/core";
|
|
4
|
-
import { Constant, Inject, InjectorService, LocalsContainer, Module,
|
|
4
|
+
import { Constant, Inject, InjectorService, LocalsContainer, Module, registerProvider } from "@tsed/di";
|
|
5
5
|
import { DEFAULT_CONTEXT_NAME, SUBSCRIBER_INJECTION_TYPE } from "./constants.js";
|
|
6
6
|
import { OptimisticLockErrorFilter } from "./filters/OptimisticLockErrorFilter.js";
|
|
7
7
|
import { RetryStrategy } from "./interfaces/RetryStrategy.js";
|
|
@@ -13,7 +13,10 @@ let MikroOrmModule = class MikroOrmModule {
|
|
|
13
13
|
}
|
|
14
14
|
async $onInit() {
|
|
15
15
|
const container = new LocalsContainer();
|
|
16
|
-
await Promise.all(this.settings.map((opts) => this.registry.register({
|
|
16
|
+
await Promise.all(this.settings.map((opts) => this.registry.register({
|
|
17
|
+
...opts,
|
|
18
|
+
subscribers: this.getSubscribers(opts, container)
|
|
19
|
+
})));
|
|
17
20
|
}
|
|
18
21
|
$onDestroy() {
|
|
19
22
|
return this.registry.clear();
|
|
@@ -25,12 +28,11 @@ let MikroOrmModule = class MikroOrmModule {
|
|
|
25
28
|
return [...this.getUnmanagedSubscribers(opts, container), ...this.getManagedSubscribers(opts.contextName)];
|
|
26
29
|
}
|
|
27
30
|
getUnmanagedSubscribers(opts, container) {
|
|
28
|
-
const diOpts = { scope: ProviderScope.INSTANCE };
|
|
29
31
|
return (opts.subscribers ?? []).map((subscriber) => {
|
|
30
32
|
// Starting from https://github.com/mikro-orm/mikro-orm/issues/4231 mikro-orm
|
|
31
33
|
// accept also accepts class reference, not just instances.
|
|
32
34
|
if (isFunction(subscriber)) {
|
|
33
|
-
return this.injector.invoke(subscriber, container
|
|
35
|
+
return this.injector.invoke(subscriber, { locals: container });
|
|
34
36
|
}
|
|
35
37
|
return subscriber;
|
|
36
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MikroOrmModule.js","sourceRoot":"","sources":["../../src/MikroOrmModule.ts"],"names":[],"mappings":";AAAA,OAAO,+BAA+B,CAAC;AAGvC,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,YAAY,CAAC;AACtD,OAAO,EAEL,QAAQ,EACR,MAAM,EACN,eAAe,EACf,eAAe,EACf,MAAM,
|
|
1
|
+
{"version":3,"file":"MikroOrmModule.js","sourceRoot":"","sources":["../../src/MikroOrmModule.ts"],"names":[],"mappings":";AAAA,OAAO,+BAA+B,CAAC;AAGvC,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,YAAY,CAAC;AACtD,OAAO,EAEL,QAAQ,EACR,MAAM,EACN,eAAe,EACf,eAAe,EACf,MAAM,EAIN,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAC,oBAAoB,EAAE,yBAAyB,EAAC,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAC,yBAAyB,EAAC,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AAiBzD,IAAM,cAAc,GAApB,MAAM,cAAc;IAazB,YAAuD,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAElF,KAAK,CAAC,OAAO;QAClB,MAAM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O,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,yBAAyB,CAAC,EAAE,WAAW,KAAK,WAAW,CAAC,CAAC;IAC1I,CAAC;IAEO,aAAa,CAAC,IAAqC;QACzD,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAEhD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF,CAAA;AA5DkB;IADhB,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC;;gDACa;AAGrB;IADhB,MAAM,EAAE;8BACmB,gBAAgB;gDAAC;AAG5B;IADhB,MAAM,EAAE;8BACkB,eAAe;+CAAC;AAG1B;IADhB,MAAM,EAAE;8BACmB,eAAe;gDAAC;AAXjC,cAAc;IAH1B,MAAM,CAAC;QACN,eAAe,EAAE,CAAC,yBAAyB,CAAC;KAC7C,CAAC;IAca,WAAA,MAAM,CAAC,yBAAyB,CAAC,CAAA;;GAbnC,cAAc,CA8D1B;;AAED,uGAAuG;AACvG,gBAAgB,CAAC,EAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/mikro-orm",
|
|
3
3
|
"description": "MikroORM package for Ts.ED framework",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.0.0-rc.
|
|
5
|
+
"version": "8.0.0-rc.6",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@mikro-orm/core": "6.3.12",
|
|
29
29
|
"@mikro-orm/mongodb": "6.3.12",
|
|
30
|
-
"@tsed/barrels": "8.0.0-rc.
|
|
31
|
-
"@tsed/core": "8.0.0-rc.
|
|
32
|
-
"@tsed/di": "8.0.0-rc.
|
|
33
|
-
"@tsed/json-mapper": "8.0.0-rc.
|
|
30
|
+
"@tsed/barrels": "8.0.0-rc.6",
|
|
31
|
+
"@tsed/core": "8.0.0-rc.6",
|
|
32
|
+
"@tsed/di": "8.0.0-rc.6",
|
|
33
|
+
"@tsed/json-mapper": "8.0.0-rc.6",
|
|
34
34
|
"@tsed/logger": "^6.7.8",
|
|
35
|
-
"@tsed/platform-http": "8.0.0-rc.
|
|
36
|
-
"@tsed/schema": "8.0.0-rc.
|
|
37
|
-
"@tsed/testcontainers-mongo": "8.0.0-rc.
|
|
38
|
-
"@tsed/typescript": "8.0.0-rc.
|
|
35
|
+
"@tsed/platform-http": "8.0.0-rc.6",
|
|
36
|
+
"@tsed/schema": "8.0.0-rc.6",
|
|
37
|
+
"@tsed/testcontainers-mongo": "8.0.0-rc.6",
|
|
38
|
+
"@tsed/typescript": "8.0.0-rc.6",
|
|
39
39
|
"cross-env": "7.0.3",
|
|
40
40
|
"eslint": "9.12.0",
|
|
41
41
|
"ts-mockito": "^2.6.1",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@mikro-orm/core": ">=4.5.9",
|
|
47
|
-
"@tsed/core": "8.0.0-rc.
|
|
48
|
-
"@tsed/di": "8.0.0-rc.
|
|
47
|
+
"@tsed/core": "8.0.0-rc.6",
|
|
48
|
+
"@tsed/di": "8.0.0-rc.6",
|
|
49
49
|
"@tsed/logger": ">=6.7.5",
|
|
50
|
-
"@tsed/platform-http": "8.0.0-rc.
|
|
50
|
+
"@tsed/platform-http": "8.0.0-rc.6"
|
|
51
51
|
},
|
|
52
52
|
"repository": "https://github.com/tsedio/tsed",
|
|
53
53
|
"bugs": {
|
package/vitest.config.mts
CHANGED