@tsed/mikro-orm 7.0.0-beta.1 → 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.
Files changed (89) hide show
  1. package/jest.config.js +4 -4
  2. package/lib/cjs/MikroOrmModule.js +13 -11
  3. package/lib/cjs/MikroOrmModule.js.map +1 -1
  4. package/lib/cjs/decorators/entityManager.d.ts +6 -6
  5. package/lib/cjs/decorators/entityManager.js +6 -6
  6. package/lib/cjs/decorators/entityManager.js.map +1 -1
  7. package/lib/cjs/decorators/orm.d.ts +11 -0
  8. package/lib/cjs/decorators/orm.js +18 -0
  9. package/lib/cjs/decorators/orm.js.map +1 -0
  10. package/lib/cjs/decorators/transactional.d.ts +6 -2
  11. package/lib/cjs/decorators/transactional.js +6 -2
  12. package/lib/cjs/decorators/transactional.js.map +1 -1
  13. package/lib/cjs/filters/OptimisticLockErrorFilter.js +1 -1
  14. package/lib/cjs/index.d.ts +12 -4
  15. package/lib/cjs/index.js +13 -5
  16. package/lib/cjs/index.js.map +1 -1
  17. package/lib/cjs/interceptors/TransactionalInterceptor.d.ts +8 -2
  18. package/lib/cjs/interceptors/TransactionalInterceptor.js +39 -22
  19. package/lib/cjs/interceptors/TransactionalInterceptor.js.map +1 -1
  20. package/lib/cjs/package.json +3 -0
  21. package/lib/cjs/services/DBContext.d.ts +4 -0
  22. package/lib/cjs/services/DBContext.js +11 -5
  23. package/lib/cjs/services/DBContext.js.map +1 -1
  24. package/lib/cjs/services/MikroOrmFactory.d.ts +1 -1
  25. package/lib/cjs/services/MikroOrmFactory.js +5 -5
  26. package/lib/cjs/services/MikroOrmFactory.js.map +1 -1
  27. package/lib/cjs/services/MikroOrmRegistry.d.ts +12 -4
  28. package/lib/cjs/services/MikroOrmRegistry.js +42 -31
  29. package/lib/cjs/services/MikroOrmRegistry.js.map +1 -1
  30. package/lib/esm/MikroOrmModule.js +5 -3
  31. package/lib/esm/MikroOrmModule.js.map +1 -1
  32. package/lib/esm/decorators/entityManager.js +6 -6
  33. package/lib/esm/decorators/entityManager.js.map +1 -1
  34. package/lib/esm/decorators/orm.js +14 -0
  35. package/lib/esm/decorators/orm.js.map +1 -0
  36. package/lib/esm/decorators/transactional.js +6 -2
  37. package/lib/esm/decorators/transactional.js.map +1 -1
  38. package/lib/esm/index.js +13 -5
  39. package/lib/esm/index.js.map +1 -1
  40. package/lib/esm/interceptors/TransactionalInterceptor.js +31 -14
  41. package/lib/esm/interceptors/TransactionalInterceptor.js.map +1 -1
  42. package/lib/esm/package.json +3 -0
  43. package/lib/esm/services/DBContext.js +9 -3
  44. package/lib/esm/services/DBContext.js.map +1 -1
  45. package/lib/esm/services/MikroOrmFactory.js +3 -3
  46. package/lib/esm/services/MikroOrmFactory.js.map +1 -1
  47. package/lib/esm/services/MikroOrmRegistry.js +39 -28
  48. package/lib/esm/services/MikroOrmRegistry.js.map +1 -1
  49. package/lib/types/decorators/entityManager.d.ts +6 -6
  50. package/lib/types/decorators/orm.d.ts +11 -0
  51. package/lib/types/decorators/transactional.d.ts +6 -2
  52. package/lib/types/index.d.ts +12 -4
  53. package/lib/types/interceptors/TransactionalInterceptor.d.ts +8 -2
  54. package/lib/types/services/DBContext.d.ts +4 -0
  55. package/lib/types/services/MikroOrmFactory.d.ts +1 -1
  56. package/lib/types/services/MikroOrmRegistry.d.ts +12 -4
  57. package/package.json +17 -15
  58. package/readme.md +34 -42
  59. package/tsconfig.compile.esm.json +1 -12
  60. package/lib/cjs/decorators/connection.d.ts +0 -1
  61. package/lib/cjs/decorators/connection.js +0 -8
  62. package/lib/cjs/decorators/connection.js.map +0 -1
  63. package/lib/cjs/decorators/index.d.ts +0 -3
  64. package/lib/cjs/decorators/index.js +0 -7
  65. package/lib/cjs/decorators/index.js.map +0 -1
  66. package/lib/cjs/filters/index.d.ts +0 -1
  67. package/lib/cjs/filters/index.js +0 -5
  68. package/lib/cjs/filters/index.js.map +0 -1
  69. package/lib/cjs/interceptors/index.d.ts +0 -1
  70. package/lib/cjs/interceptors/index.js +0 -5
  71. package/lib/cjs/interceptors/index.js.map +0 -1
  72. package/lib/cjs/services/index.d.ts +0 -4
  73. package/lib/cjs/services/index.js +0 -8
  74. package/lib/cjs/services/index.js.map +0 -1
  75. package/lib/esm/decorators/connection.js +0 -4
  76. package/lib/esm/decorators/connection.js.map +0 -1
  77. package/lib/esm/decorators/index.js +0 -4
  78. package/lib/esm/decorators/index.js.map +0 -1
  79. package/lib/esm/filters/index.js +0 -2
  80. package/lib/esm/filters/index.js.map +0 -1
  81. package/lib/esm/interceptors/index.js +0 -2
  82. package/lib/esm/interceptors/index.js.map +0 -1
  83. package/lib/esm/services/index.js +0 -5
  84. package/lib/esm/services/index.js.map +0 -1
  85. package/lib/types/decorators/connection.d.ts +0 -1
  86. package/lib/types/decorators/index.d.ts +0 -3
  87. package/lib/types/filters/index.d.ts +0 -1
  88. package/lib/types/interceptors/index.d.ts +0 -1
  89. package/lib/types/services/index.d.ts +0 -4
@@ -1,9 +1,15 @@
1
- import { DBContext, MikroOrmRegistry, RetryStrategy } from "../services";
2
1
  import { InterceptorContext, InterceptorMethods, InterceptorNext } from "@tsed/di";
3
2
  import { Logger } from "@tsed/logger";
3
+ import { MikroOrmRegistry } from "../services/MikroOrmRegistry";
4
+ import { DBContext } from "../services/DBContext";
5
+ import { RetryStrategy } from "../services/RetryStrategy";
4
6
  export interface TransactionOptions {
5
- connectionName?: string;
6
7
  retry?: boolean;
8
+ contextName?: string;
9
+ /**
10
+ * @deprecated Since 2022-02-01. Use {@link contextName} instead
11
+ */
12
+ connectionName?: string;
7
13
  }
8
14
  export declare class TransactionalInterceptor implements InterceptorMethods {
9
15
  private readonly registry;
@@ -3,6 +3,10 @@ export declare class DBContext {
3
3
  private readonly storage;
4
4
  constructor();
5
5
  run<R>(ctx: Map<string, EntityManager>, callback: (...args: any[]) => R): R;
6
+ entries(): Map<string, EntityManager> | undefined;
7
+ /**
8
+ * @deprecated Since 2022-02-01. Use {@link entries} instead
9
+ */
6
10
  getContext(): Map<string, EntityManager> | undefined;
7
11
  get(contextName: string): EntityManager | undefined;
8
12
  has(contextName: string): boolean;
@@ -1,5 +1,5 @@
1
1
  import { MikroORM, Options } from "@mikro-orm/core";
2
2
  export declare class MikroOrmFactory {
3
3
  private readonly dbContext;
4
- create(connectionOptions: Options): Promise<MikroORM>;
4
+ create(options: Options): Promise<MikroORM>;
5
5
  }
@@ -4,11 +4,19 @@ import { Logger } from "@tsed/logger";
4
4
  export declare class MikroOrmRegistry {
5
5
  private readonly logger;
6
6
  private readonly mikroOrmFactory;
7
- private readonly connections;
7
+ private readonly instances;
8
8
  constructor(logger: Logger, mikroOrmFactory: MikroOrmFactory);
9
- createConnection<T extends DatabaseDriver>(connectionOptions: Options<T>): Promise<MikroORM>;
10
- get(id?: string): MikroORM;
11
- has(id?: string): boolean;
9
+ register<T extends DatabaseDriver>(options: Options<T>): Promise<MikroORM>;
10
+ /**
11
+ * @deprecated Since 2022-02-01. Use {@link register} instead
12
+ */
13
+ createConnection<T extends DatabaseDriver>(options: Options<T>): Promise<MikroORM>;
14
+ get(contextName?: string): MikroORM | undefined;
15
+ has(contextName?: string): boolean;
16
+ clear(): Promise<void>;
17
+ /**
18
+ * @deprecated Since 2022-02-01. Use {@link clear} instead
19
+ */
12
20
  closeConnections(): Promise<void>;
13
21
  private dispose;
14
22
  }
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tsed/mikro-orm",
3
- "version": "7.0.0-beta.1",
3
+ "version": "7.0.0-beta.4",
4
4
  "description": "MikroORM package for Ts.ED framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/cjs/index.js",
8
+ "module": "./lib/esm/index.js",
8
9
  "typings": "./lib/types/index.d.ts",
9
10
  "exports": {
10
11
  "types": "./lib/types/index.d.ts",
@@ -13,38 +14,39 @@
13
14
  "default": "./lib/esm/index.js"
14
15
  },
15
16
  "scripts": {
16
- "build": "yarn run build:esm && yarn run build:cjs",
17
+ "build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
17
18
  "build:cjs": "tsc --build tsconfig.compile.json",
18
19
  "build:esm": "tsc --build tsconfig.compile.esm.json",
20
+ "barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
19
21
  "test": "cross-env NODE_ENV=test jest"
20
22
  },
21
23
  "dependencies": {
22
- "tslib": "2.2.0"
24
+ "tslib": "2.3.1"
23
25
  },
24
26
  "devDependencies": {
25
27
  "@mikro-orm/core": "^4.5.9",
26
28
  "@mikro-orm/mongodb": "^4.5.9",
27
- "@tsed/common": "7.0.0-beta.1",
28
- "@tsed/core": "7.0.0-beta.1",
29
- "@tsed/di": "7.0.0-beta.1",
30
- "@tsed/json-mapper": "7.0.0-beta.1",
31
- "@tsed/logger": "^6.0.0",
32
- "@tsed/schema": "7.0.0-beta.1",
33
- "@tsed/testing-mongoose": "7.0.0-beta.1",
29
+ "@tsed/common": "7.0.0-beta.4",
30
+ "@tsed/core": "7.0.0-beta.4",
31
+ "@tsed/di": "7.0.0-beta.4",
32
+ "@tsed/json-mapper": "7.0.0-beta.4",
33
+ "@tsed/logger": ">=6.1.1",
34
+ "@tsed/schema": "7.0.0-beta.4",
35
+ "@tsed/testing-mongoose": "7.0.0-beta.4",
34
36
  "ts-mockito": "^2.6.1"
35
37
  },
36
38
  "peerDependencies": {
37
39
  "@mikro-orm/core": ">=4.5.9",
38
- "@tsed/common": "^7.0.0-beta.1",
39
- "@tsed/core": "^7.0.0-beta.1",
40
- "@tsed/di": "^7.0.0-beta.1",
41
- "@tsed/logger": "^6.0.0"
40
+ "@tsed/common": "^7.0.0-beta.4",
41
+ "@tsed/core": "^7.0.0-beta.4",
42
+ "@tsed/di": "^7.0.0-beta.4",
43
+ "@tsed/logger": ">=6.1.1"
42
44
  },
43
45
  "repository": "https://github.com/tsedio/tsed",
44
46
  "bugs": {
45
47
  "url": "https://github.com/tsedio/tsed/issues"
46
48
  },
47
- "homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/orm/mikro-orm",
49
+ "homepage": "https://github.com/tsedio/tsed/tree/production/packages/orm/mikro-orm",
48
50
  "author": "Romain Lenzotti",
49
51
  "license": "MIT"
50
52
  }
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 MikroOrm connections via the `@Configuration` decorator. All databases will be initialized
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 MikroOrm as Model for Controllers, AJV Validation and Swagger.
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 MikroOrm module for TS.ED:
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
- `${__dirname}/entity/*{.ts,.js}`
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 a connection
99
+ ## Obtain ORM instance
100
100
 
101
- `@Connection` decorator lets you retrieve an instance of MikroOrm Connection.
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 {Connection} from "@tsed/mikro-orm";
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
- @Connection()
111
- private readonly connection!: MikroORM;
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.connection.em.persistAndFlush(user);
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.connection.em.find(User, {});
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 a connection by his name:
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
- @Connection("mongo")
140
- private readonly connection!: MikroORM;
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 '@mikro-orm/mysql'; // Import EntityManager from your driver package or `@mikro-orm/knex`
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 connection name:
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 '@mikro-orm/mysql'; // Import EntityManager from your driver package or `@mikro-orm/knex`
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("connectionName")
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 MikroOrm like this and use Ts.ED Decorator to define the JSON Schema.
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: number;
200
+ id!: number;
202
201
 
203
202
  @Column()
204
203
  @MaxLength(100)
205
204
  @Required()
206
- firstName: string;
205
+ firstName!: string;
207
206
 
208
207
  @Column()
209
208
  @MaxLength(100)
210
209
  @Required()
211
- lastName: string;
210
+ lastName!: string;
212
211
 
213
212
  @Column()
214
213
  @Mininum(0)
215
214
  @Maximum(100)
216
- age: number;
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 [MikroOrm](https://mikro-orm.io/docs/defining-entities).
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: 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: 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 { OptimisticLockError } from '@mikro-orm/core';
282
- import { RetryStrategy } from '@tsed/mikro-orm';
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: 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,3 +0,0 @@
1
- export * from "./transactional";
2
- export * from "./connection";
3
- export * from "./entityManager";
@@ -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";
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./OptimisticLockErrorFilter"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -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,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./TransactionalInterceptor"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -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,4 +0,0 @@
1
- export * from "./DBContext";
2
- export * from "./MikroOrmFactory";
3
- export * from "./MikroOrmRegistry";
4
- export * from "./RetryStrategy";
@@ -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,4 +0,0 @@
1
- import { MikroOrmRegistry } from "../services";
2
- import { Inject } from "@tsed/di";
3
- export const Connection = (connectionName) => Inject(MikroOrmRegistry, (registry) => registry.get(connectionName));
4
- //# sourceMappingURL=connection.js.map
@@ -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,4 +0,0 @@
1
- export * from "./transactional";
2
- export * from "./connection";
3
- export * from "./entityManager";
4
- //# sourceMappingURL=index.js.map
@@ -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"]}
@@ -1,2 +0,0 @@
1
- export * from "./OptimisticLockErrorFilter";
2
- //# sourceMappingURL=index.js.map
@@ -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,2 +0,0 @@
1
- export * from "./TransactionalInterceptor";
2
- //# sourceMappingURL=index.js.map
@@ -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,5 +0,0 @@
1
- export * from "./DBContext";
2
- export * from "./MikroOrmFactory";
3
- export * from "./MikroOrmRegistry";
4
- export * from "./RetryStrategy";
5
- //# sourceMappingURL=index.js.map
@@ -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,3 +0,0 @@
1
- export * from "./transactional";
2
- export * from "./connection";
3
- export * from "./entityManager";
@@ -1 +0,0 @@
1
- export * from "./OptimisticLockErrorFilter";
@@ -1 +0,0 @@
1
- export * from "./TransactionalInterceptor";
@@ -1,4 +0,0 @@
1
- export * from "./DBContext";
2
- export * from "./MikroOrmFactory";
3
- export * from "./MikroOrmRegistry";
4
- export * from "./RetryStrategy";