@tsed/mikro-orm 7.0.0-beta.1 → 7.0.0-beta.10
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/jest.config.js +4 -4
- package/lib/cjs/MikroOrmModule.js +13 -11
- package/lib/cjs/MikroOrmModule.js.map +1 -1
- package/lib/cjs/decorators/entityManager.d.ts +6 -6
- package/lib/cjs/decorators/entityManager.js +6 -6
- package/lib/cjs/decorators/entityManager.js.map +1 -1
- package/lib/cjs/decorators/orm.d.ts +5 -0
- package/lib/cjs/decorators/orm.js +12 -0
- package/lib/cjs/decorators/orm.js.map +1 -0
- package/lib/cjs/decorators/transactional.d.ts +6 -2
- package/lib/cjs/decorators/transactional.js +6 -2
- package/lib/cjs/decorators/transactional.js.map +1 -1
- package/lib/cjs/filters/OptimisticLockErrorFilter.js +1 -1
- package/lib/cjs/index.d.ts +12 -4
- package/lib/cjs/index.js +13 -5
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interceptors/TransactionalInterceptor.d.ts +4 -2
- package/lib/cjs/interceptors/TransactionalInterceptor.js +39 -22
- package/lib/cjs/interceptors/TransactionalInterceptor.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/services/DBContext.d.ts +1 -1
- package/lib/cjs/services/DBContext.js +5 -5
- package/lib/cjs/services/DBContext.js.map +1 -1
- package/lib/cjs/services/MikroOrmFactory.d.ts +1 -1
- package/lib/cjs/services/MikroOrmFactory.js +5 -5
- package/lib/cjs/services/MikroOrmFactory.js.map +1 -1
- package/lib/cjs/services/MikroOrmRegistry.d.ts +5 -5
- package/lib/cjs/services/MikroOrmRegistry.js +26 -27
- package/lib/cjs/services/MikroOrmRegistry.js.map +1 -1
- package/lib/esm/MikroOrmModule.js +5 -3
- package/lib/esm/MikroOrmModule.js.map +1 -1
- package/lib/esm/decorators/entityManager.js +6 -6
- package/lib/esm/decorators/entityManager.js.map +1 -1
- package/lib/esm/decorators/orm.js +8 -0
- package/lib/esm/decorators/orm.js.map +1 -0
- package/lib/esm/decorators/transactional.js +6 -2
- package/lib/esm/decorators/transactional.js.map +1 -1
- package/lib/esm/index.js +13 -5
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interceptors/TransactionalInterceptor.js +31 -14
- package/lib/esm/interceptors/TransactionalInterceptor.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/DBContext.js +3 -3
- package/lib/esm/services/DBContext.js.map +1 -1
- package/lib/esm/services/MikroOrmFactory.js +3 -3
- package/lib/esm/services/MikroOrmFactory.js.map +1 -1
- package/lib/esm/services/MikroOrmRegistry.js +23 -24
- package/lib/esm/services/MikroOrmRegistry.js.map +1 -1
- package/lib/types/decorators/entityManager.d.ts +6 -6
- package/lib/types/decorators/orm.d.ts +5 -0
- package/lib/types/decorators/transactional.d.ts +6 -2
- package/lib/types/index.d.ts +12 -4
- package/lib/types/interceptors/TransactionalInterceptor.d.ts +4 -2
- package/lib/types/services/DBContext.d.ts +1 -1
- package/lib/types/services/MikroOrmFactory.d.ts +1 -1
- package/lib/types/services/MikroOrmRegistry.d.ts +5 -5
- package/package.json +17 -15
- package/readme.md +34 -42
- package/tsconfig.compile.esm.json +1 -12
- package/lib/cjs/decorators/connection.d.ts +0 -1
- package/lib/cjs/decorators/connection.js +0 -8
- package/lib/cjs/decorators/connection.js.map +0 -1
- package/lib/cjs/decorators/index.d.ts +0 -3
- package/lib/cjs/decorators/index.js +0 -7
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/filters/index.d.ts +0 -1
- package/lib/cjs/filters/index.js +0 -5
- package/lib/cjs/filters/index.js.map +0 -1
- package/lib/cjs/interceptors/index.d.ts +0 -1
- package/lib/cjs/interceptors/index.js +0 -5
- package/lib/cjs/interceptors/index.js.map +0 -1
- package/lib/cjs/services/index.d.ts +0 -4
- package/lib/cjs/services/index.js +0 -8
- package/lib/cjs/services/index.js.map +0 -1
- package/lib/esm/decorators/connection.js +0 -4
- package/lib/esm/decorators/connection.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -4
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/filters/index.js +0 -2
- package/lib/esm/filters/index.js.map +0 -1
- package/lib/esm/interceptors/index.js +0 -2
- package/lib/esm/interceptors/index.js.map +0 -1
- package/lib/esm/services/index.js +0 -5
- package/lib/esm/services/index.js.map +0 -1
- package/lib/types/decorators/connection.d.ts +0 -1
- package/lib/types/decorators/index.d.ts +0 -3
- package/lib/types/filters/index.d.ts +0 -1
- package/lib/types/interceptors/index.d.ts +0 -1
- package/lib/types/services/index.d.ts +0 -4
package/readme.md
CHANGED
|
@@ -33,13 +33,13 @@ A package of Ts.ED framework. See website: https://tsed.io/tutorials/mikro-orm
|
|
|
33
33
|
|
|
34
34
|
Currently, `@tsed/mikro-orm` allows you:
|
|
35
35
|
|
|
36
|
-
- Configure one or more
|
|
36
|
+
- Configure one or more MikroORM instances via the `@Configuration` decorator. All databases will be initialized
|
|
37
37
|
when the server starts during the server's `OnInit` phase.
|
|
38
|
-
- Use the Entity
|
|
38
|
+
- Use the Entity MikroORM as Model for Controllers, AJV Validation and Swagger.
|
|
39
39
|
|
|
40
40
|
## Installation
|
|
41
41
|
|
|
42
|
-
To begin, install the
|
|
42
|
+
To begin, install the MikroORM module for TS.ED:
|
|
43
43
|
|
|
44
44
|
<Tabs class="-code">
|
|
45
45
|
<Tab label="NPM">
|
|
@@ -81,7 +81,7 @@ import {MikroOrmModule} from "@tsed/mikro-orm";
|
|
|
81
81
|
...,
|
|
82
82
|
|
|
83
83
|
entities: [
|
|
84
|
-
|
|
84
|
+
`./entity/*{.ts,.js}`
|
|
85
85
|
]
|
|
86
86
|
},
|
|
87
87
|
{
|
|
@@ -96,32 +96,32 @@ export class Server {}
|
|
|
96
96
|
|
|
97
97
|
The `mikroOrm` options accepts the same configuration object as `init()` from the MikroORM package. Check [this page](https://mikro-orm.io/docs/configuration) for the complete configuration documentation.
|
|
98
98
|
|
|
99
|
-
## Obtain
|
|
99
|
+
## Obtain ORM instance
|
|
100
100
|
|
|
101
|
-
`@
|
|
101
|
+
`@Orm` decorator lets you retrieve an instance of MikroORM.
|
|
102
102
|
|
|
103
103
|
```typescript
|
|
104
104
|
import {Injectable, AfterRoutesInit} from "@tsed/common";
|
|
105
|
-
import {
|
|
105
|
+
import {Orm} from "@tsed/mikro-orm";
|
|
106
106
|
import {MikroORM} from "@mikro-orm/core";
|
|
107
107
|
|
|
108
108
|
@Injectable()
|
|
109
109
|
export class UsersService {
|
|
110
|
-
@
|
|
111
|
-
private readonly
|
|
110
|
+
@Orm()
|
|
111
|
+
private readonly orm!: MikroORM;
|
|
112
112
|
|
|
113
113
|
async create(user: User): Promise<User> {
|
|
114
114
|
// do something
|
|
115
115
|
// ...
|
|
116
116
|
// Then save
|
|
117
|
-
await this.
|
|
117
|
+
await this.orm.em.persistAndFlush(user);
|
|
118
118
|
console.log("Saved a new user with id: " + user.id);
|
|
119
119
|
|
|
120
120
|
return user;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
async find(): Promise<User[]> {
|
|
124
|
-
const users = await this.
|
|
124
|
+
const users = await this.orm.em.find(User, {});
|
|
125
125
|
console.log("Loaded users: ", users);
|
|
126
126
|
|
|
127
127
|
return users;
|
|
@@ -129,15 +129,15 @@ export class UsersService {
|
|
|
129
129
|
}
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
It's also possible to inject
|
|
132
|
+
It's also possible to inject an ORM by its context name:
|
|
133
133
|
|
|
134
134
|
```ts
|
|
135
135
|
import {Injectable} from "@tsed/di";
|
|
136
136
|
|
|
137
137
|
@Injectable()
|
|
138
138
|
export class MyService {
|
|
139
|
-
@
|
|
140
|
-
private readonly
|
|
139
|
+
@Orm("mongo")
|
|
140
|
+
private readonly orm!: MikroORM;
|
|
141
141
|
}
|
|
142
142
|
```
|
|
143
143
|
|
|
@@ -148,7 +148,7 @@ export class MyService {
|
|
|
148
148
|
```typescript
|
|
149
149
|
import {Injectable, AfterRoutesInit} from "@tsed/common";
|
|
150
150
|
import {Em} from "@tsed/mikro-orm";
|
|
151
|
-
import {EntityManager} from
|
|
151
|
+
import {EntityManager} from "@mikro-orm/mysql"; // Import EntityManager from your driver package or `@mikro-orm/knex`
|
|
152
152
|
|
|
153
153
|
@Injectable()
|
|
154
154
|
export class UsersService {
|
|
@@ -164,16 +164,16 @@ export class UsersService {
|
|
|
164
164
|
}
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
It's also possible to inject Entity manager by his
|
|
167
|
+
It's also possible to inject Entity manager by his context name:
|
|
168
168
|
|
|
169
169
|
```typescript
|
|
170
170
|
import {Injectable, AfterRoutesInit} from "@tsed/common";
|
|
171
171
|
import {Em} from "@tsed/mikro-orm";
|
|
172
|
-
import {EntityManager} from
|
|
172
|
+
import {EntityManager} from "@mikro-orm/mysql"; // Import EntityManager from your driver package or `@mikro-orm/knex`
|
|
173
173
|
|
|
174
174
|
@Injectable()
|
|
175
175
|
export class UsersService {
|
|
176
|
-
@Em("
|
|
176
|
+
@Em("contextName")
|
|
177
177
|
private readonly em!: EntityManager;
|
|
178
178
|
|
|
179
179
|
async create(user: User): Promise<User> {
|
|
@@ -187,7 +187,7 @@ export class UsersService {
|
|
|
187
187
|
|
|
188
188
|
## Use Entity with Controller
|
|
189
189
|
|
|
190
|
-
To begin, we need to define an Entity
|
|
190
|
+
To begin, we need to define an Entity MikroORM like this and use Ts.ED Decorator to define the JSON Schema.
|
|
191
191
|
|
|
192
192
|
```typescript
|
|
193
193
|
import {Property, MaxLength, Required} from "@tsed/common";
|
|
@@ -195,31 +195,30 @@ import {Entity, Property, PrimaryKey, Property as Column} from "@mikro-orm/core"
|
|
|
195
195
|
|
|
196
196
|
@Entity()
|
|
197
197
|
export class User {
|
|
198
|
-
|
|
199
198
|
@PrimaryKey()
|
|
200
199
|
@Property()
|
|
201
|
-
id
|
|
200
|
+
id!: number;
|
|
202
201
|
|
|
203
202
|
@Column()
|
|
204
203
|
@MaxLength(100)
|
|
205
204
|
@Required()
|
|
206
|
-
firstName
|
|
205
|
+
firstName!: string;
|
|
207
206
|
|
|
208
207
|
@Column()
|
|
209
208
|
@MaxLength(100)
|
|
210
209
|
@Required()
|
|
211
|
-
lastName
|
|
210
|
+
lastName!: string;
|
|
212
211
|
|
|
213
212
|
@Column()
|
|
214
213
|
@Mininum(0)
|
|
215
214
|
@Maximum(100)
|
|
216
|
-
age
|
|
215
|
+
age!: number;
|
|
217
216
|
}
|
|
218
217
|
```
|
|
219
218
|
|
|
220
219
|
Now, the model is correctly defined and can be used with a [Controller](https://tsed.io/docs/controllers.html)
|
|
221
220
|
, [AJV validation](tutorials/ajv.md),
|
|
222
|
-
[Swagger](tutorials/swagger.md) and [
|
|
221
|
+
[Swagger](tutorials/swagger.md) and [MikroORM](https://mikro-orm.io/docs/defining-entities).
|
|
223
222
|
|
|
224
223
|
We can use this model with a Controller like that:
|
|
225
224
|
|
|
@@ -229,7 +228,7 @@ import {Controller, Post, BodyParams, Inject, Post, Get} from "@tsed/common";
|
|
|
229
228
|
@Controller("/users")
|
|
230
229
|
export class UsersCtrl {
|
|
231
230
|
@Inject()
|
|
232
|
-
private usersService
|
|
231
|
+
private readonly usersService!: UsersService;
|
|
233
232
|
|
|
234
233
|
@Post("/")
|
|
235
234
|
create(@BodyParams() user: User): Promise<User> {
|
|
@@ -258,7 +257,7 @@ import {Transactional} from "@tsed/mikro-orm";
|
|
|
258
257
|
@Controller("/users")
|
|
259
258
|
export class UsersCtrl {
|
|
260
259
|
@Inject()
|
|
261
|
-
private usersService
|
|
260
|
+
private readonly usersService!: UsersService;
|
|
262
261
|
|
|
263
262
|
@Post("/")
|
|
264
263
|
@Transactional()
|
|
@@ -278,8 +277,8 @@ By default, the automatic retry policy is disabled. You can implement your own t
|
|
|
278
277
|
The `@Transactional()` decorator allows you to enable a retry policy for the particular resources. You just need to implement the `RetryStrategy` interface and use `registerProvider()` or `@OverrideProvider()` to register it in the IoC container. Below you can find an example to handle occurred optimistic locks based on [an exponential backoff retry strategy](https://en.wikipedia.org/wiki/Exponential_backoff).
|
|
279
278
|
|
|
280
279
|
```ts
|
|
281
|
-
import {
|
|
282
|
-
import {
|
|
280
|
+
import {OptimisticLockError} from "@mikro-orm/core";
|
|
281
|
+
import {RetryStrategy} from "@tsed/mikro-orm";
|
|
283
282
|
|
|
284
283
|
export interface ExponentialBackoffOptions {
|
|
285
284
|
maxDepth: number;
|
|
@@ -290,16 +289,11 @@ export class ExponentialBackoff implements RetryStrategy {
|
|
|
290
289
|
|
|
291
290
|
constructor(private readonly options: ExponentialBackoffOptions) {}
|
|
292
291
|
|
|
293
|
-
public async acquire<T extends (...args: unknown[]) => unknown>(
|
|
294
|
-
task: T
|
|
295
|
-
): Promise<ReturnType<T>> {
|
|
292
|
+
public async acquire<T extends (...args: unknown[]) => unknown>(task: T): Promise<ReturnType<T>> {
|
|
296
293
|
try {
|
|
297
294
|
return (await task()) as ReturnType<T>;
|
|
298
295
|
} catch (e) {
|
|
299
|
-
if (
|
|
300
|
-
this.shouldRetry(e as Error) &&
|
|
301
|
-
this.depth < this.options.maxDepth
|
|
302
|
-
) {
|
|
296
|
+
if (this.shouldRetry(e as Error) && this.depth < this.options.maxDepth) {
|
|
303
297
|
return this.retry(task);
|
|
304
298
|
}
|
|
305
299
|
|
|
@@ -311,9 +305,7 @@ export class ExponentialBackoff implements RetryStrategy {
|
|
|
311
305
|
return error instanceof OptimisticLockError;
|
|
312
306
|
}
|
|
313
307
|
|
|
314
|
-
private async retry<T extends (...args: unknown[]) => unknown>(
|
|
315
|
-
task: T
|
|
316
|
-
): Promise<ReturnType<T>> {
|
|
308
|
+
private async retry<T extends (...args: unknown[]) => unknown>(task: T): Promise<ReturnType<T>> {
|
|
317
309
|
await this.sleep(2 ** this.depth * 50);
|
|
318
310
|
|
|
319
311
|
this.depth += 1;
|
|
@@ -322,14 +314,14 @@ export class ExponentialBackoff implements RetryStrategy {
|
|
|
322
314
|
}
|
|
323
315
|
|
|
324
316
|
private sleep(milliseconds: number): Promise<void> {
|
|
325
|
-
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
|
317
|
+
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
326
318
|
}
|
|
327
319
|
}
|
|
328
320
|
|
|
329
321
|
registerProvider({
|
|
330
322
|
provide: RetryStrategy,
|
|
331
323
|
useFactory(): ExponentialBackoff {
|
|
332
|
-
return new ExponentialBackoff({maxDepth: 3})
|
|
324
|
+
return new ExponentialBackoff({maxDepth: 3});
|
|
333
325
|
}
|
|
334
326
|
});
|
|
335
327
|
```
|
|
@@ -345,7 +337,7 @@ import {Transactional} from "@tsed/mikro-orm";
|
|
|
345
337
|
@Controller("/users")
|
|
346
338
|
export class UsersCtrl {
|
|
347
339
|
@Inject()
|
|
348
|
-
private usersService
|
|
340
|
+
private readonly usersService!: UsersService;
|
|
349
341
|
|
|
350
342
|
@Post("/")
|
|
351
343
|
@Transactional({retry: true})
|
|
@@ -8,16 +8,5 @@
|
|
|
8
8
|
"declaration": true,
|
|
9
9
|
"declarationDir": "./lib/types"
|
|
10
10
|
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"node_modules",
|
|
13
|
-
"test",
|
|
14
|
-
"lib",
|
|
15
|
-
"benchmark",
|
|
16
|
-
"coverage",
|
|
17
|
-
"spec",
|
|
18
|
-
"**/*.benchmark.ts",
|
|
19
|
-
"**/*.spec.ts",
|
|
20
|
-
"keys",
|
|
21
|
-
"jest.config.js"
|
|
22
|
-
]
|
|
11
|
+
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
|
|
23
12
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Connection: (connectionName?: string | undefined) => PropertyDecorator;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Connection = void 0;
|
|
4
|
-
const services_1 = require("../services");
|
|
5
|
-
const di_1 = require("@tsed/di");
|
|
6
|
-
const Connection = (connectionName) => (0, di_1.Inject)(services_1.MikroOrmRegistry, (registry) => registry.get(connectionName));
|
|
7
|
-
exports.Connection = Connection;
|
|
8
|
-
//# sourceMappingURL=connection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/decorators/connection.ts"],"names":[],"mappings":";;;AAAA,0CAA6C;AAC7C,iCAAgC;AAEzB,MAAM,UAAU,GAAG,CAAC,cAAuB,EAAqB,EAAE,CACvE,IAAA,WAAM,EAAC,2BAAgB,EAAE,CAAC,QAA0B,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAsB,CAAC;AADjG,QAAA,UAAU,cACuF","sourcesContent":["import {MikroOrmRegistry} from \"../services\";\nimport {Inject} from \"@tsed/di\";\n\nexport const Connection = (connectionName?: string): PropertyDecorator =>\n Inject(MikroOrmRegistry, (registry: MikroOrmRegistry) => registry.get(connectionName)) as PropertyDecorator;\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./transactional"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./connection"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./entityManager"), exports);
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA,+DAAgC;AAChC,4DAA6B;AAC7B,+DAAgC","sourcesContent":["export * from \"./transactional\";\nexport * from \"./connection\";\nexport * from \"./entityManager\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./OptimisticLockErrorFilter";
|
package/lib/cjs/filters/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/filters/index.ts"],"names":[],"mappings":";;;AAAA,2EAA4C","sourcesContent":["export * from \"./OptimisticLockErrorFilter\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./TransactionalInterceptor";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interceptors/index.ts"],"names":[],"mappings":";;;AAAA,0EAA2C","sourcesContent":["export * from \"./TransactionalInterceptor\";\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./DBContext"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./MikroOrmFactory"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./MikroOrmRegistry"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./RetryStrategy"), exports);
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,2DAA4B;AAC5B,iEAAkC;AAClC,kEAAmC;AACnC,+DAAgC","sourcesContent":["export * from \"./DBContext\";\nexport * from \"./MikroOrmFactory\";\nexport * from \"./MikroOrmRegistry\";\nexport * from \"./RetryStrategy\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/decorators/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,cAAuB,EAAqB,EAAE,CACvE,MAAM,CAAC,gBAAgB,EAAE,CAAC,QAA0B,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAsB,CAAC","sourcesContent":["import {MikroOrmRegistry} from \"../services\";\nimport {Inject} from \"@tsed/di\";\n\nexport const Connection = (connectionName?: string): PropertyDecorator =>\n Inject(MikroOrmRegistry, (registry: MikroOrmRegistry) => registry.get(connectionName)) as PropertyDecorator;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./transactional\";\nexport * from \"./connection\";\nexport * from \"./entityManager\";\n"]}
|
package/lib/esm/filters/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC","sourcesContent":["export * from \"./OptimisticLockErrorFilter\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interceptors/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from \"./TransactionalInterceptor\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./DBContext\";\nexport * from \"./MikroOrmFactory\";\nexport * from \"./MikroOrmRegistry\";\nexport * from \"./RetryStrategy\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Connection: (connectionName?: string | undefined) => PropertyDecorator;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./OptimisticLockErrorFilter";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./TransactionalInterceptor";
|