@mikro-orm/nestjs 5.1.5 → 5.1.7

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.
@@ -122,7 +122,7 @@ let MikroOrmCoreModule = MikroOrmCoreModule_1 = class MikroOrmCoreModule {
122
122
  return config.getDriver().createEntityManager();
123
123
  }
124
124
  if ('useFactory' in options) {
125
- const config = new core_1.Configuration(options.useFactory(), false);
125
+ const config = new core_1.Configuration(await options.useFactory(), false);
126
126
  return config.getDriver().createEntityManager();
127
127
  }
128
128
  }
@@ -17,6 +17,7 @@ export declare class MikroOrmMiddlewareModule {
17
17
  inject: string[];
18
18
  useValue?: undefined;
19
19
  })[];
20
+ exports: string[];
20
21
  };
21
22
  configure(consumer: MiddlewareConsumer): void;
22
23
  }
@@ -37,6 +37,7 @@ let MikroOrmMiddlewareModule = MikroOrmMiddlewareModule_1 = class MikroOrmMiddle
37
37
  inject,
38
38
  },
39
39
  ],
40
+ exports: ['MikroORMs'],
40
41
  };
41
42
  }
42
43
  configure(consumer) {
@@ -14,7 +14,6 @@ function createMikroOrmProvider(contextName) {
14
14
  options.entitiesTs = [...(options.entitiesTs || []), ...mikro_orm_entities_storage_1.MikroOrmEntitiesStorage.getEntities(contextName)];
15
15
  delete options.autoLoadEntities;
16
16
  }
17
- mikro_orm_entities_storage_1.MikroOrmEntitiesStorage.clear(contextName);
18
17
  if (!options || Object.keys(options).length === 0) {
19
18
  const config = await core_1.ConfigurationLoader.getConfiguration();
20
19
  config.set('logger', mikro_orm_common_1.logger.log.bind(mikro_orm_common_1.logger));
@@ -86,9 +85,10 @@ function createMikroOrmRepositoryProviders(entities, contextName) {
86
85
  const inject = contextName ? (0, mikro_orm_common_1.getEntityManagerToken)(contextName) : core_1.EntityManager;
87
86
  (entities || []).forEach(entity => {
88
87
  const meta = metadata.find(meta => meta.class === entity);
89
- if (meta?.customRepository) {
88
+ const repository = (meta?.repository ?? meta?.customRepository);
89
+ if (repository) {
90
90
  providers.push({
91
- provide: meta.customRepository(),
91
+ provide: repository(),
92
92
  useFactory: em => em.getRepository(entity),
93
93
  inject: [inject],
94
94
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/nestjs",
3
- "version": "5.1.5",
3
+ "version": "5.1.7",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Martin Adamek",
@@ -54,8 +54,8 @@
54
54
  "@types/jest": "^29.2.4",
55
55
  "@types/node": "^18.11.17",
56
56
  "@types/supertest": "^2.0.12",
57
- "@typescript-eslint/eslint-plugin": "~5.46.1",
58
- "@typescript-eslint/parser": "~5.46.1",
57
+ "@typescript-eslint/eslint-plugin": "~5.51.0",
58
+ "@typescript-eslint/parser": "~5.51.0",
59
59
  "conventional-changelog": "^3.1.25",
60
60
  "conventional-changelog-cli": "^2.2.2",
61
61
  "eslint": "^8.30.0",
@@ -64,7 +64,7 @@
64
64
  "supertest": "^6.3.3",
65
65
  "ts-jest": "^29.0.3",
66
66
  "ts-node": "^10.9.1",
67
- "typescript": "4.9.4"
67
+ "typescript": "4.9.5"
68
68
  },
69
69
  "commitlint": {
70
70
  "extends": [
@@ -104,5 +104,5 @@
104
104
  "engines": {
105
105
  "node": ">= 14.0.0"
106
106
  },
107
- "packageManager": "yarn@3.3.0"
107
+ "packageManager": "yarn@3.4.1"
108
108
  }