@mikro-orm/nestjs 7.0.2-dev.2 → 7.0.2-dev.4
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/mikro-orm.providers.js +12 -2
- package/package.json +2 -2
- package/typings.d.ts +1 -1
package/mikro-orm.providers.js
CHANGED
|
@@ -52,7 +52,11 @@ export function createMikroOrmAsyncOptionsProvider(options) {
|
|
|
52
52
|
provide: MIKRO_ORM_MODULE_OPTIONS,
|
|
53
53
|
useFactory: async (...args) => {
|
|
54
54
|
const factoryOptions = await options.useFactory(...args);
|
|
55
|
-
return
|
|
55
|
+
return {
|
|
56
|
+
...options.contextName ? { contextName: options.contextName } : {},
|
|
57
|
+
...options.driver ? { driver: options.driver } : {},
|
|
58
|
+
...factoryOptions,
|
|
59
|
+
};
|
|
56
60
|
},
|
|
57
61
|
inject: options.inject || [],
|
|
58
62
|
};
|
|
@@ -63,7 +67,13 @@ export function createMikroOrmAsyncOptionsProvider(options) {
|
|
|
63
67
|
}
|
|
64
68
|
return {
|
|
65
69
|
provide: MIKRO_ORM_MODULE_OPTIONS,
|
|
66
|
-
useFactory: async (optionsFactory) =>
|
|
70
|
+
useFactory: async (optionsFactory) => {
|
|
71
|
+
const factoryOptions = await optionsFactory.createMikroOrmOptions(options.contextName);
|
|
72
|
+
return {
|
|
73
|
+
...options.driver ? { driver: options.driver } : {},
|
|
74
|
+
...factoryOptions,
|
|
75
|
+
};
|
|
76
|
+
},
|
|
67
77
|
inject,
|
|
68
78
|
};
|
|
69
79
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/nestjs",
|
|
3
|
-
"version": "7.0.2-dev.
|
|
3
|
+
"version": "7.0.2-dev.4",
|
|
4
4
|
"description": "NestJS module for MikroORM",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@vitest/coverage-v8": "^4.0.16",
|
|
68
68
|
"conventional-changelog": "^7.1.1",
|
|
69
69
|
"conventional-changelog-cli": "^5.0.0",
|
|
70
|
-
"oxfmt": "^0.
|
|
70
|
+
"oxfmt": "^0.41.0",
|
|
71
71
|
"oxlint": "^1.33.0",
|
|
72
72
|
"oxlint-tsgolint": "^0.17.0",
|
|
73
73
|
"reflect-metadata": "^0.2.2",
|
package/typings.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export type MikroOrmModuleOptions<D extends IDatabaseDriver = IDatabaseDriver> =
|
|
|
43
43
|
* @default false
|
|
44
44
|
*/
|
|
45
45
|
autoLoadEntities?: boolean;
|
|
46
|
-
} & Partial<Options<D>> & MikroOrmMiddlewareModuleOptions;
|
|
46
|
+
} & Partial<Options<D, any, any>> & MikroOrmMiddlewareModuleOptions;
|
|
47
47
|
export interface MikroOrmModuleFeatureOptions {
|
|
48
48
|
/**
|
|
49
49
|
* The entities to provide an EntityRepository for.
|