@tsed/mikro-orm 7.67.7 → 7.68.0

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,12 +4,20 @@ exports.MikroOrmContext = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const di_1 = require("@tsed/di");
6
6
  const core_1 = require("@mikro-orm/core");
7
+ const core_2 = require("@tsed/core");
7
8
  /**
8
9
  * @internal Since 2022-06-20.
9
10
  */
10
11
  let MikroOrmContext = class MikroOrmContext {
11
12
  run(managers, task) {
12
- return core_1.RequestContext.createAsync(managers, task);
13
+ // @ts-expect-error `RequestContext.createAsync` has been removed in favour of `RequestContext.create` since mikro-orm v6.0.0
14
+ if ((0, core_2.isFunction)(core_1.RequestContext.createAsync)) {
15
+ // @ts-expect-error see above
16
+ return core_1.RequestContext.createAsync(managers, task);
17
+ }
18
+ else {
19
+ return core_1.RequestContext.create(managers, task);
20
+ }
13
21
  }
14
22
  get(contextName) {
15
23
  return core_1.RequestContext.getEntityManager(contextName);
@@ -1 +1 @@
1
- {"version":3,"file":"MikroOrmContext.js","sourceRoot":"","sources":["../../../src/services/MikroOrmContext.ts"],"names":[],"mappings":";;;;AAAA,iCAAoC;AACpC,0CAA8D;AAE9D;;GAEG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IACnB,GAAG,CAAC,QAAyB,EAAE,IAAqC;QACzE,OAAO,qBAAc,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAW,CAAC,CAAC;IAC3D,CAAC;IAEM,GAAG,CAAC,WAAoB;QAC7B,OAAO,qBAAc,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC;IAEM,GAAG,CAAC,WAAoB;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAEtC,OAAO,CAAC,CAAC,OAAO,CAAC;IACnB,CAAC;CACF,CAAA;AAdY,eAAe;IAD3B,IAAA,eAAU,GAAE;GACA,eAAe,CAc3B;AAdY,0CAAe"}
1
+ {"version":3,"file":"MikroOrmContext.js","sourceRoot":"","sources":["../../../src/services/MikroOrmContext.ts"],"names":[],"mappings":";;;;AAAA,iCAAoC;AACpC,0CAA8D;AAC9D,qCAAsC;AAEtC;;GAEG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IACnB,GAAG,CAAC,QAAyB,EAAE,IAAqC;QACzE,6HAA6H;QAC7H,IAAI,IAAA,iBAAU,EAAC,qBAAc,CAAC,WAAW,CAAC,EAAE;YAC1C,6BAA6B;YAC7B,OAAO,qBAAc,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SACnD;aAAM;YACL,OAAO,qBAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAqB,CAAC;SAClE;IACH,CAAC;IAEM,GAAG,CAAC,WAAoB;QAC7B,OAAO,qBAAc,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC;IAEM,GAAG,CAAC,WAAoB;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAEtC,OAAO,CAAC,CAAC,OAAO,CAAC;IACnB,CAAC;CACF,CAAA;AApBY,eAAe;IAD3B,IAAA,eAAU,GAAE;GACA,eAAe,CAoB3B;AApBY,0CAAe"}
@@ -1,12 +1,20 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { Injectable } from "@tsed/di";
3
3
  import { RequestContext } from "@mikro-orm/core";
4
+ import { isFunction } from "@tsed/core";
4
5
  /**
5
6
  * @internal Since 2022-06-20.
6
7
  */
7
8
  let MikroOrmContext = class MikroOrmContext {
8
9
  run(managers, task) {
9
- return RequestContext.createAsync(managers, task);
10
+ // @ts-expect-error `RequestContext.createAsync` has been removed in favour of `RequestContext.create` since mikro-orm v6.0.0
11
+ if (isFunction(RequestContext.createAsync)) {
12
+ // @ts-expect-error see above
13
+ return RequestContext.createAsync(managers, task);
14
+ }
15
+ else {
16
+ return RequestContext.create(managers, task);
17
+ }
10
18
  }
11
19
  get(contextName) {
12
20
  return RequestContext.getEntityManager(contextName);
@@ -1 +1 @@
1
- {"version":3,"file":"MikroOrmContext.js","sourceRoot":"","sources":["../../../src/services/MikroOrmContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAgB,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAE9D;;GAEG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IACnB,GAAG,CAAC,QAAyB,EAAE,IAAqC;QACzE,OAAO,cAAc,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAW,CAAC,CAAC;IAC3D,CAAC;IAEM,GAAG,CAAC,WAAoB;QAC7B,OAAO,cAAc,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC;IAEM,GAAG,CAAC,WAAoB;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAEtC,OAAO,CAAC,CAAC,OAAO,CAAC;IACnB,CAAC;CACF,CAAA;AAdY,eAAe;IAD3B,UAAU,EAAE;GACA,eAAe,CAc3B;SAdY,eAAe"}
1
+ {"version":3,"file":"MikroOrmContext.js","sourceRoot":"","sources":["../../../src/services/MikroOrmContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAgB,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAEtC;;GAEG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IACnB,GAAG,CAAC,QAAyB,EAAE,IAAqC;QACzE,6HAA6H;QAC7H,IAAI,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;YAC1C,6BAA6B;YAC7B,OAAO,cAAc,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SACnD;aAAM;YACL,OAAO,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAqB,CAAC;SAClE;IACH,CAAC;IAEM,GAAG,CAAC,WAAoB;QAC7B,OAAO,cAAc,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC;IAEM,GAAG,CAAC,WAAoB;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAEtC,OAAO,CAAC,CAAC,OAAO,CAAC;IACnB,CAAC;CACF,CAAA;AApBY,eAAe;IAD3B,UAAU,EAAE;GACA,eAAe,CAoB3B;SApBY,eAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/mikro-orm",
3
- "version": "7.67.7",
3
+ "version": "7.68.0",
4
4
  "description": "MikroORM package for Ts.ED framework",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/cjs/index.js",
@@ -22,16 +22,16 @@
22
22
  "tslib": "2.6.1"
23
23
  },
24
24
  "devDependencies": {
25
- "@mikro-orm/core": "5.9.8",
26
- "@mikro-orm/mongodb": "5.9.8",
27
- "@tsed/common": "7.67.7",
28
- "@tsed/core": "7.67.7",
29
- "@tsed/di": "7.67.7",
30
- "@tsed/json-mapper": "7.67.7",
25
+ "@mikro-orm/core": "6.2.2",
26
+ "@mikro-orm/mongodb": "6.2.2",
27
+ "@tsed/common": "7.68.0",
28
+ "@tsed/core": "7.68.0",
29
+ "@tsed/di": "7.68.0",
30
+ "@tsed/json-mapper": "7.68.0",
31
31
  "@tsed/logger": ">=6.7.5",
32
- "@tsed/schema": "7.67.7",
33
- "@tsed/testing-mongoose": "7.67.7",
34
- "@tsed/typescript": "7.67.7",
32
+ "@tsed/schema": "7.68.0",
33
+ "@tsed/testing-mongoose": "7.68.0",
34
+ "@tsed/typescript": "7.68.0",
35
35
  "barrelsby": "^2.8.1",
36
36
  "cross-env": "7.0.3",
37
37
  "eslint": "^8.57.0",
@@ -40,9 +40,9 @@
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@mikro-orm/core": ">=4.5.9",
43
- "@tsed/common": "7.67.7",
44
- "@tsed/core": "7.67.7",
45
- "@tsed/di": "7.67.7",
43
+ "@tsed/common": "7.68.0",
44
+ "@tsed/core": "7.68.0",
45
+ "@tsed/di": "7.68.0",
46
46
  "@tsed/logger": ">=6.7.5"
47
47
  },
48
48
  "repository": "https://github.com/tsedio/tsed",