@tsed/mikro-orm 7.0.0-beta.1 → 7.0.0-beta.12
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 +21 -16
- package/readme.md +36 -43
- 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
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
[](https://badge.fury.io/js/%40tsed%2Fcommon)
|
|
12
12
|
[](https://github.com/semantic-release/semantic-release)
|
|
13
13
|
[](https://github.com/prettier/prettier)
|
|
14
|
-
[](https://github.com/sponsors/romakita)
|
|
15
|
+
[](https://opencollective.com/tsed)
|
|
15
16
|
|
|
16
17
|
</div>
|
|
17
18
|
|
|
@@ -33,13 +34,13 @@ A package of Ts.ED framework. See website: https://tsed.io/tutorials/mikro-orm
|
|
|
33
34
|
|
|
34
35
|
Currently, `@tsed/mikro-orm` allows you:
|
|
35
36
|
|
|
36
|
-
- Configure one or more
|
|
37
|
+
- Configure one or more MikroORM instances via the `@Configuration` decorator. All databases will be initialized
|
|
37
38
|
when the server starts during the server's `OnInit` phase.
|
|
38
|
-
- Use the Entity
|
|
39
|
+
- Use the Entity MikroORM as Model for Controllers, AJV Validation and Swagger.
|
|
39
40
|
|
|
40
41
|
## Installation
|
|
41
42
|
|
|
42
|
-
To begin, install the
|
|
43
|
+
To begin, install the MikroORM module for TS.ED:
|
|
43
44
|
|
|
44
45
|
<Tabs class="-code">
|
|
45
46
|
<Tab label="NPM">
|
|
@@ -81,7 +82,7 @@ import {MikroOrmModule} from "@tsed/mikro-orm";
|
|
|
81
82
|
...,
|
|
82
83
|
|
|
83
84
|
entities: [
|
|
84
|
-
|
|
85
|
+
`./entity/*{.ts,.js}`
|
|
85
86
|
]
|
|
86
87
|
},
|
|
87
88
|
{
|
|
@@ -96,32 +97,32 @@ export class Server {}
|
|
|
96
97
|
|
|
97
98
|
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
99
|
|
|
99
|
-
## Obtain
|
|
100
|
+
## Obtain ORM instance
|
|
100
101
|
|
|
101
|
-
`@
|
|
102
|
+
`@Orm` decorator lets you retrieve an instance of MikroORM.
|
|
102
103
|
|
|
103
104
|
```typescript
|
|
104
105
|
import {Injectable, AfterRoutesInit} from "@tsed/common";
|
|
105
|
-
import {
|
|
106
|
+
import {Orm} from "@tsed/mikro-orm";
|
|
106
107
|
import {MikroORM} from "@mikro-orm/core";
|
|
107
108
|
|
|
108
109
|
@Injectable()
|
|
109
110
|
export class UsersService {
|
|
110
|
-
@
|
|
111
|
-
private readonly
|
|
111
|
+
@Orm()
|
|
112
|
+
private readonly orm!: MikroORM;
|
|
112
113
|
|
|
113
114
|
async create(user: User): Promise<User> {
|
|
114
115
|
// do something
|
|
115
116
|
// ...
|
|
116
117
|
// Then save
|
|
117
|
-
await this.
|
|
118
|
+
await this.orm.em.persistAndFlush(user);
|
|
118
119
|
console.log("Saved a new user with id: " + user.id);
|
|
119
120
|
|
|
120
121
|
return user;
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
async find(): Promise<User[]> {
|
|
124
|
-
const users = await this.
|
|
125
|
+
const users = await this.orm.em.find(User, {});
|
|
125
126
|
console.log("Loaded users: ", users);
|
|
126
127
|
|
|
127
128
|
return users;
|
|
@@ -129,15 +130,15 @@ export class UsersService {
|
|
|
129
130
|
}
|
|
130
131
|
```
|
|
131
132
|
|
|
132
|
-
It's also possible to inject
|
|
133
|
+
It's also possible to inject an ORM by its context name:
|
|
133
134
|
|
|
134
135
|
```ts
|
|
135
136
|
import {Injectable} from "@tsed/di";
|
|
136
137
|
|
|
137
138
|
@Injectable()
|
|
138
139
|
export class MyService {
|
|
139
|
-
@
|
|
140
|
-
private readonly
|
|
140
|
+
@Orm("mongo")
|
|
141
|
+
private readonly orm!: MikroORM;
|
|
141
142
|
}
|
|
142
143
|
```
|
|
143
144
|
|
|
@@ -148,7 +149,7 @@ export class MyService {
|
|
|
148
149
|
```typescript
|
|
149
150
|
import {Injectable, AfterRoutesInit} from "@tsed/common";
|
|
150
151
|
import {Em} from "@tsed/mikro-orm";
|
|
151
|
-
import {EntityManager} from
|
|
152
|
+
import {EntityManager} from "@mikro-orm/mysql"; // Import EntityManager from your driver package or `@mikro-orm/knex`
|
|
152
153
|
|
|
153
154
|
@Injectable()
|
|
154
155
|
export class UsersService {
|
|
@@ -164,16 +165,16 @@ export class UsersService {
|
|
|
164
165
|
}
|
|
165
166
|
```
|
|
166
167
|
|
|
167
|
-
It's also possible to inject Entity manager by his
|
|
168
|
+
It's also possible to inject Entity manager by his context name:
|
|
168
169
|
|
|
169
170
|
```typescript
|
|
170
171
|
import {Injectable, AfterRoutesInit} from "@tsed/common";
|
|
171
172
|
import {Em} from "@tsed/mikro-orm";
|
|
172
|
-
import {EntityManager} from
|
|
173
|
+
import {EntityManager} from "@mikro-orm/mysql"; // Import EntityManager from your driver package or `@mikro-orm/knex`
|
|
173
174
|
|
|
174
175
|
@Injectable()
|
|
175
176
|
export class UsersService {
|
|
176
|
-
@Em("
|
|
177
|
+
@Em("contextName")
|
|
177
178
|
private readonly em!: EntityManager;
|
|
178
179
|
|
|
179
180
|
async create(user: User): Promise<User> {
|
|
@@ -187,7 +188,7 @@ export class UsersService {
|
|
|
187
188
|
|
|
188
189
|
## Use Entity with Controller
|
|
189
190
|
|
|
190
|
-
To begin, we need to define an Entity
|
|
191
|
+
To begin, we need to define an Entity MikroORM like this and use Ts.ED Decorator to define the JSON Schema.
|
|
191
192
|
|
|
192
193
|
```typescript
|
|
193
194
|
import {Property, MaxLength, Required} from "@tsed/common";
|
|
@@ -195,31 +196,30 @@ import {Entity, Property, PrimaryKey, Property as Column} from "@mikro-orm/core"
|
|
|
195
196
|
|
|
196
197
|
@Entity()
|
|
197
198
|
export class User {
|
|
198
|
-
|
|
199
199
|
@PrimaryKey()
|
|
200
200
|
@Property()
|
|
201
|
-
id
|
|
201
|
+
id!: number;
|
|
202
202
|
|
|
203
203
|
@Column()
|
|
204
204
|
@MaxLength(100)
|
|
205
205
|
@Required()
|
|
206
|
-
firstName
|
|
206
|
+
firstName!: string;
|
|
207
207
|
|
|
208
208
|
@Column()
|
|
209
209
|
@MaxLength(100)
|
|
210
210
|
@Required()
|
|
211
|
-
lastName
|
|
211
|
+
lastName!: string;
|
|
212
212
|
|
|
213
213
|
@Column()
|
|
214
214
|
@Mininum(0)
|
|
215
215
|
@Maximum(100)
|
|
216
|
-
age
|
|
216
|
+
age!: number;
|
|
217
217
|
}
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
Now, the model is correctly defined and can be used with a [Controller](https://tsed.io/docs/controllers.html)
|
|
221
221
|
, [AJV validation](tutorials/ajv.md),
|
|
222
|
-
[Swagger](tutorials/swagger.md) and [
|
|
222
|
+
[Swagger](tutorials/swagger.md) and [MikroORM](https://mikro-orm.io/docs/defining-entities).
|
|
223
223
|
|
|
224
224
|
We can use this model with a Controller like that:
|
|
225
225
|
|
|
@@ -229,7 +229,7 @@ import {Controller, Post, BodyParams, Inject, Post, Get} from "@tsed/common";
|
|
|
229
229
|
@Controller("/users")
|
|
230
230
|
export class UsersCtrl {
|
|
231
231
|
@Inject()
|
|
232
|
-
private usersService
|
|
232
|
+
private readonly usersService!: UsersService;
|
|
233
233
|
|
|
234
234
|
@Post("/")
|
|
235
235
|
create(@BodyParams() user: User): Promise<User> {
|
|
@@ -258,7 +258,7 @@ import {Transactional} from "@tsed/mikro-orm";
|
|
|
258
258
|
@Controller("/users")
|
|
259
259
|
export class UsersCtrl {
|
|
260
260
|
@Inject()
|
|
261
|
-
private usersService
|
|
261
|
+
private readonly usersService!: UsersService;
|
|
262
262
|
|
|
263
263
|
@Post("/")
|
|
264
264
|
@Transactional()
|
|
@@ -278,8 +278,8 @@ By default, the automatic retry policy is disabled. You can implement your own t
|
|
|
278
278
|
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
279
|
|
|
280
280
|
```ts
|
|
281
|
-
import {
|
|
282
|
-
import {
|
|
281
|
+
import {OptimisticLockError} from "@mikro-orm/core";
|
|
282
|
+
import {RetryStrategy} from "@tsed/mikro-orm";
|
|
283
283
|
|
|
284
284
|
export interface ExponentialBackoffOptions {
|
|
285
285
|
maxDepth: number;
|
|
@@ -290,16 +290,11 @@ export class ExponentialBackoff implements RetryStrategy {
|
|
|
290
290
|
|
|
291
291
|
constructor(private readonly options: ExponentialBackoffOptions) {}
|
|
292
292
|
|
|
293
|
-
public async acquire<T extends (...args: unknown[]) => unknown>(
|
|
294
|
-
task: T
|
|
295
|
-
): Promise<ReturnType<T>> {
|
|
293
|
+
public async acquire<T extends (...args: unknown[]) => unknown>(task: T): Promise<ReturnType<T>> {
|
|
296
294
|
try {
|
|
297
295
|
return (await task()) as ReturnType<T>;
|
|
298
296
|
} catch (e) {
|
|
299
|
-
if (
|
|
300
|
-
this.shouldRetry(e as Error) &&
|
|
301
|
-
this.depth < this.options.maxDepth
|
|
302
|
-
) {
|
|
297
|
+
if (this.shouldRetry(e as Error) && this.depth < this.options.maxDepth) {
|
|
303
298
|
return this.retry(task);
|
|
304
299
|
}
|
|
305
300
|
|
|
@@ -311,9 +306,7 @@ export class ExponentialBackoff implements RetryStrategy {
|
|
|
311
306
|
return error instanceof OptimisticLockError;
|
|
312
307
|
}
|
|
313
308
|
|
|
314
|
-
private async retry<T extends (...args: unknown[]) => unknown>(
|
|
315
|
-
task: T
|
|
316
|
-
): Promise<ReturnType<T>> {
|
|
309
|
+
private async retry<T extends (...args: unknown[]) => unknown>(task: T): Promise<ReturnType<T>> {
|
|
317
310
|
await this.sleep(2 ** this.depth * 50);
|
|
318
311
|
|
|
319
312
|
this.depth += 1;
|
|
@@ -322,14 +315,14 @@ export class ExponentialBackoff implements RetryStrategy {
|
|
|
322
315
|
}
|
|
323
316
|
|
|
324
317
|
private sleep(milliseconds: number): Promise<void> {
|
|
325
|
-
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
|
318
|
+
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
326
319
|
}
|
|
327
320
|
}
|
|
328
321
|
|
|
329
322
|
registerProvider({
|
|
330
323
|
provide: RetryStrategy,
|
|
331
324
|
useFactory(): ExponentialBackoff {
|
|
332
|
-
return new ExponentialBackoff({maxDepth: 3})
|
|
325
|
+
return new ExponentialBackoff({maxDepth: 3});
|
|
333
326
|
}
|
|
334
327
|
});
|
|
335
328
|
```
|
|
@@ -345,7 +338,7 @@ import {Transactional} from "@tsed/mikro-orm";
|
|
|
345
338
|
@Controller("/users")
|
|
346
339
|
export class UsersCtrl {
|
|
347
340
|
@Inject()
|
|
348
|
-
private usersService
|
|
341
|
+
private readonly usersService!: UsersService;
|
|
349
342
|
|
|
350
343
|
@Post("/")
|
|
351
344
|
@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";
|