@nest-boot/mikro-orm 7.0.0-beta.3 → 7.0.0-beta.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.
|
@@ -4,9 +4,9 @@ import { DynamicModule, OnModuleInit } from "@nestjs/common";
|
|
|
4
4
|
import { MikroOrmModuleOptions } from "./interfaces/mikro-orm-module-options.interface";
|
|
5
5
|
import { ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, OPTIONS_TYPE } from "./mikro-orm.module-definition";
|
|
6
6
|
export declare class MikroOrmModule extends ConfigurableModuleClass implements OnModuleInit {
|
|
7
|
-
#private;
|
|
8
7
|
private readonly orm;
|
|
9
8
|
constructor(orm: MikroORM);
|
|
9
|
+
private static patchDynamicModule;
|
|
10
10
|
static forRoot(options: typeof OPTIONS_TYPE): DynamicModule;
|
|
11
11
|
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE & Pick<MikroOrmModuleOptions, "driver">): DynamicModule;
|
|
12
12
|
static forFeature(...args: Parameters<typeof BaseMikroOrmModule.forFeature>): DynamicModule;
|
package/dist/mikro-orm.module.js
CHANGED
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
if (typeof
|
|
5
|
-
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
6
10
|
};
|
|
7
|
-
var _a, _MikroOrmModule_patchDynamicModule;
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.MikroOrmModule = void 0;
|
|
10
13
|
const core_1 = require("@mikro-orm/core");
|
|
11
14
|
const nestjs_1 = require("@mikro-orm/nestjs");
|
|
12
15
|
const request_context_1 = require("@nest-boot/request-context");
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
13
17
|
const mikro_orm_module_definition_1 = require("./mikro-orm.module-definition");
|
|
14
|
-
class MikroOrmModule extends mikro_orm_module_definition_1.ConfigurableModuleClass {
|
|
18
|
+
let MikroOrmModule = class MikroOrmModule extends mikro_orm_module_definition_1.ConfigurableModuleClass {
|
|
15
19
|
constructor(orm) {
|
|
16
20
|
super();
|
|
17
21
|
this.orm = orm;
|
|
18
22
|
}
|
|
23
|
+
static patchDynamicModule(options, dynamicModule) {
|
|
24
|
+
dynamicModule.global = true;
|
|
25
|
+
dynamicModule.imports = [
|
|
26
|
+
request_context_1.RequestContextModule,
|
|
27
|
+
nestjs_1.MikroOrmModule.forRootAsync({
|
|
28
|
+
driver: options.driver,
|
|
29
|
+
inject: [mikro_orm_module_definition_1.MODULE_OPTIONS_TOKEN],
|
|
30
|
+
useFactory: (options) => {
|
|
31
|
+
return {
|
|
32
|
+
dataloader: core_1.DataloaderType.ALL,
|
|
33
|
+
registerRequestContext: false,
|
|
34
|
+
...options,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
];
|
|
39
|
+
dynamicModule.exports = dynamicModule.providers;
|
|
40
|
+
return dynamicModule;
|
|
41
|
+
}
|
|
19
42
|
static forRoot(options) {
|
|
20
|
-
return
|
|
43
|
+
return this.patchDynamicModule(options, super.forRoot(options));
|
|
21
44
|
}
|
|
22
45
|
static forRootAsync(options) {
|
|
23
|
-
return
|
|
46
|
+
return this.patchDynamicModule(options, super.forRootAsync(options));
|
|
24
47
|
}
|
|
25
48
|
static forFeature(...args) {
|
|
26
49
|
return nestjs_1.MikroOrmModule.forFeature(...args);
|
|
@@ -38,25 +61,10 @@ class MikroOrmModule extends mikro_orm_module_definition_1.ConfigurableModuleCla
|
|
|
38
61
|
return next();
|
|
39
62
|
}, ["logger"]);
|
|
40
63
|
}
|
|
41
|
-
}
|
|
42
|
-
exports.MikroOrmModule = MikroOrmModule;
|
|
43
|
-
_a = MikroOrmModule, _MikroOrmModule_patchDynamicModule = function _MikroOrmModule_patchDynamicModule(options, dynamicModule) {
|
|
44
|
-
dynamicModule.global = true;
|
|
45
|
-
dynamicModule.imports = [
|
|
46
|
-
request_context_1.RequestContextModule,
|
|
47
|
-
nestjs_1.MikroOrmModule.forRootAsync({
|
|
48
|
-
driver: options.driver,
|
|
49
|
-
inject: [mikro_orm_module_definition_1.MODULE_OPTIONS_TOKEN],
|
|
50
|
-
useFactory: (options) => {
|
|
51
|
-
return {
|
|
52
|
-
dataloader: core_1.DataloaderType.ALL,
|
|
53
|
-
registerRequestContext: false,
|
|
54
|
-
...options,
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
}),
|
|
58
|
-
];
|
|
59
|
-
dynamicModule.exports = dynamicModule.providers;
|
|
60
|
-
return dynamicModule;
|
|
61
64
|
};
|
|
65
|
+
exports.MikroOrmModule = MikroOrmModule;
|
|
66
|
+
exports.MikroOrmModule = MikroOrmModule = __decorate([
|
|
67
|
+
(0, common_1.Module)({}),
|
|
68
|
+
__metadata("design:paramtypes", [core_1.MikroORM])
|
|
69
|
+
], MikroOrmModule);
|
|
62
70
|
//# sourceMappingURL=mikro-orm.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mikro-orm.module.js","sourceRoot":"","sources":["../src/mikro-orm.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mikro-orm.module.js","sourceRoot":"","sources":["../src/mikro-orm.module.ts"],"names":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