@tsed/mikro-orm 7.18.2 → 7.18.3
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/.eslintignore +13 -0
- package/.eslintrc.js +1 -0
- package/jest.config.js +3 -2
- package/lib/cjs/MikroOrmModule.js.map +1 -1
- package/lib/cjs/decorators/entityManager.js.map +1 -1
- package/lib/cjs/decorators/orm.js.map +1 -1
- package/lib/cjs/decorators/transactional.js.map +1 -1
- package/lib/cjs/filters/OptimisticLockErrorFilter.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interceptors/TransactionalInterceptor.js +1 -1
- package/lib/cjs/interceptors/TransactionalInterceptor.js.map +1 -1
- package/lib/cjs/services/MikroOrmContext.js.map +1 -1
- package/lib/cjs/services/MikroOrmFactory.js.map +1 -1
- package/lib/cjs/services/MikroOrmRegistry.js.map +1 -1
- package/lib/cjs/services/RetryStrategy.js.map +1 -1
- package/lib/esm/MikroOrmModule.js.map +1 -1
- package/lib/esm/decorators/entityManager.js.map +1 -1
- package/lib/esm/decorators/orm.js.map +1 -1
- package/lib/esm/decorators/transactional.js.map +1 -1
- package/lib/esm/filters/OptimisticLockErrorFilter.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interceptors/TransactionalInterceptor.js +1 -1
- package/lib/esm/interceptors/TransactionalInterceptor.js.map +1 -1
- package/lib/esm/services/MikroOrmContext.js.map +1 -1
- package/lib/esm/services/MikroOrmFactory.js.map +1 -1
- package/lib/esm/services/MikroOrmRegistry.js.map +1 -1
- package/lib/esm/services/RetryStrategy.js.map +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +19 -15
- package/tsconfig.esm.json +48 -0
- package/lib/cjs/MikroOrmModule.d.ts +0 -23
- package/lib/cjs/decorators/entityManager.d.ts +0 -14
- package/lib/cjs/decorators/orm.d.ts +0 -5
- package/lib/cjs/decorators/transactional.d.ts +0 -6
- package/lib/cjs/filters/OptimisticLockErrorFilter.d.ts +0 -5
- package/lib/cjs/index.d.ts +0 -13
- package/lib/cjs/interceptors/TransactionalInterceptor.d.ts +0 -25
- package/lib/cjs/services/MikroOrmContext.d.ts +0 -9
- package/lib/cjs/services/MikroOrmFactory.d.ts +0 -7
- package/lib/cjs/services/MikroOrmRegistry.d.ts +0 -16
- package/lib/cjs/services/RetryStrategy.d.ts +0 -4
- package/tsconfig.compile.esm.json +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/mikro-orm",
|
|
3
|
-
"version": "7.18.
|
|
3
|
+
"version": "7.18.3",
|
|
4
4
|
"description": "MikroORM package for Ts.ED framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -14,32 +14,36 @@
|
|
|
14
14
|
"default": "./lib/esm/index.js"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "yarn barrels && yarn
|
|
18
|
-
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
19
|
-
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
17
|
+
"build": "yarn barrels && yarn build:ts",
|
|
20
18
|
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
|
|
21
|
-
"test": "cross-env NODE_ENV=test jest"
|
|
19
|
+
"test": "cross-env NODE_ENV=test jest",
|
|
20
|
+
"build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json",
|
|
21
|
+
"lint": "eslint '**/*.{ts,js}'",
|
|
22
|
+
"lint:fix": "eslint '**/*.{ts,js}' --fix"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"tslib": "2.
|
|
25
|
+
"tslib": "2.5.0"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@mikro-orm/core": "^5.2.2",
|
|
28
29
|
"@mikro-orm/mongodb": "^5.2.2",
|
|
29
|
-
"@tsed/common": "7.18.
|
|
30
|
-
"@tsed/core": "7.18.
|
|
31
|
-
"@tsed/di": "7.18.
|
|
32
|
-
"@tsed/
|
|
30
|
+
"@tsed/common": "7.18.3",
|
|
31
|
+
"@tsed/core": "7.18.3",
|
|
32
|
+
"@tsed/di": "7.18.3",
|
|
33
|
+
"@tsed/eslint": "7.18.3",
|
|
34
|
+
"@tsed/json-mapper": "7.18.3",
|
|
33
35
|
"@tsed/logger": ">=6.1.1",
|
|
34
|
-
"@tsed/schema": "7.18.
|
|
35
|
-
"@tsed/testing-mongoose": "7.18.
|
|
36
|
+
"@tsed/schema": "7.18.3",
|
|
37
|
+
"@tsed/testing-mongoose": "7.18.3",
|
|
38
|
+
"@tsed/typescript": "7.18.3",
|
|
39
|
+
"eslint": "^8.12.0",
|
|
36
40
|
"ts-mockito": "^2.6.1"
|
|
37
41
|
},
|
|
38
42
|
"peerDependencies": {
|
|
39
43
|
"@mikro-orm/core": ">=4.5.9",
|
|
40
|
-
"@tsed/common": "^7.18.
|
|
41
|
-
"@tsed/core": "^7.18.
|
|
42
|
-
"@tsed/di": "^7.18.
|
|
44
|
+
"@tsed/common": "^7.18.3",
|
|
45
|
+
"@tsed/core": "^7.18.3",
|
|
46
|
+
"@tsed/di": "^7.18.3",
|
|
43
47
|
"@tsed/logger": ">=6.2.2"
|
|
44
48
|
},
|
|
45
49
|
"repository": "https://github.com/tsedio/tsed",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsed/typescript/tsconfig.node.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"module": "ES2020",
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"outDir": "./lib/esm",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationDir": "./lib/types",
|
|
10
|
+
"composite": true,
|
|
11
|
+
"noEmit": false
|
|
12
|
+
},
|
|
13
|
+
"include": ["src", "src/**/*.json"],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"node_modules",
|
|
16
|
+
"test",
|
|
17
|
+
"lib",
|
|
18
|
+
"benchmark",
|
|
19
|
+
"coverage",
|
|
20
|
+
"spec",
|
|
21
|
+
"**/*.benchmark.ts",
|
|
22
|
+
"**/*.spec.ts",
|
|
23
|
+
"keys",
|
|
24
|
+
"jest.config.js",
|
|
25
|
+
"**/__mock__/**",
|
|
26
|
+
"webpack.config.js"
|
|
27
|
+
],
|
|
28
|
+
"references": [
|
|
29
|
+
{
|
|
30
|
+
"path": "../../platform/common"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"path": "../../core"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"path": "../../di"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../specs/json-mapper"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "../../specs/schema"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": "../testing-mongoose"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import "./services/MikroOrmFactory";
|
|
2
|
-
import { AlterRunInContext, OnDestroy, OnInit } from "@tsed/di";
|
|
3
|
-
import { Options } from "@mikro-orm/core";
|
|
4
|
-
declare global {
|
|
5
|
-
namespace TsED {
|
|
6
|
-
interface Configuration {
|
|
7
|
-
/**
|
|
8
|
-
* The the ORM configuration, entity metadata.
|
|
9
|
-
* If you omit the `options` parameter, your CLI config will be used.
|
|
10
|
-
*/
|
|
11
|
-
mikroOrm?: Options[];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare class MikroOrmModule implements OnDestroy, OnInit, AlterRunInContext {
|
|
16
|
-
private readonly settings;
|
|
17
|
-
private readonly registry;
|
|
18
|
-
private readonly context;
|
|
19
|
-
$onInit(): Promise<void>;
|
|
20
|
-
$onDestroy(): Promise<void>;
|
|
21
|
-
$alterRunInContext(next: (...args: unknown[]) => unknown): () => unknown | Promise<() => unknown>;
|
|
22
|
-
private createContext;
|
|
23
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the entity manager for the given context name.
|
|
3
|
-
* @param {String} contextName
|
|
4
|
-
* @decorator
|
|
5
|
-
* @mikroOrm
|
|
6
|
-
*/
|
|
7
|
-
export declare const EntityManager: (contextName?: string) => PropertyDecorator;
|
|
8
|
-
/**
|
|
9
|
-
* Get the entity manager for the given context name.
|
|
10
|
-
* @param {String} connectionName
|
|
11
|
-
* @decorator
|
|
12
|
-
* @mikroOrm
|
|
13
|
-
*/
|
|
14
|
-
export declare const Em: (contextName?: string) => PropertyDecorator;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TransactionOptions } from "../interceptors/TransactionalInterceptor";
|
|
2
|
-
/**
|
|
3
|
-
* Register a new request context for your method and execute it inside the context.
|
|
4
|
-
* @param {String | TransactionOptions} contextNameOrOptions
|
|
5
|
-
*/
|
|
6
|
-
export declare const Transactional: (contextNameOrOptions?: string | TransactionOptions) => MethodDecorator;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ExceptionFilterMethods, PlatformContext } from "@tsed/common";
|
|
2
|
-
import { OptimisticLockError } from "@mikro-orm/core";
|
|
3
|
-
export declare class OptimisticLockErrorFilter implements ExceptionFilterMethods<OptimisticLockError> {
|
|
4
|
-
catch(exception: OptimisticLockError, ctx: PlatformContext): void;
|
|
5
|
-
}
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Automatically generated by barrelsby.
|
|
3
|
-
*/
|
|
4
|
-
export * from "./MikroOrmModule";
|
|
5
|
-
export * from "./decorators/entityManager";
|
|
6
|
-
export * from "./decorators/orm";
|
|
7
|
-
export * from "./decorators/transactional";
|
|
8
|
-
export * from "./filters/OptimisticLockErrorFilter";
|
|
9
|
-
export * from "./interceptors/TransactionalInterceptor";
|
|
10
|
-
export * from "./services/MikroOrmContext";
|
|
11
|
-
export * from "./services/MikroOrmFactory";
|
|
12
|
-
export * from "./services/MikroOrmRegistry";
|
|
13
|
-
export * from "./services/RetryStrategy";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { InterceptorContext, InterceptorMethods, InterceptorNext } from "@tsed/di";
|
|
2
|
-
import { Logger } from "@tsed/logger";
|
|
3
|
-
import { RetryStrategy } from "../services/RetryStrategy";
|
|
4
|
-
import { MikroOrmContext } from "../services/MikroOrmContext";
|
|
5
|
-
import { MikroOrmRegistry } from "../services/MikroOrmRegistry";
|
|
6
|
-
import { FlushMode, IsolationLevel } from "@mikro-orm/core";
|
|
7
|
-
export interface TransactionOptions {
|
|
8
|
-
retry?: boolean;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
isolationLevel?: IsolationLevel;
|
|
11
|
-
flushMode?: FlushMode;
|
|
12
|
-
contextName?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class TransactionalInterceptor implements InterceptorMethods {
|
|
15
|
-
private readonly registry;
|
|
16
|
-
private readonly context;
|
|
17
|
-
private readonly logger;
|
|
18
|
-
private readonly retryStrategy?;
|
|
19
|
-
constructor(registry: MikroOrmRegistry, context: MikroOrmContext, logger: Logger, retryStrategy?: RetryStrategy | undefined);
|
|
20
|
-
intercept(context: InterceptorContext<unknown>, next: InterceptorNext): Promise<unknown>;
|
|
21
|
-
private runWithinCtx;
|
|
22
|
-
private runWithinNewCtx;
|
|
23
|
-
private extractContextName;
|
|
24
|
-
private executeInTransaction;
|
|
25
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from "@mikro-orm/core";
|
|
2
|
-
/**
|
|
3
|
-
* @internal Since 2022-06-20.
|
|
4
|
-
*/
|
|
5
|
-
export declare class MikroOrmContext {
|
|
6
|
-
run(managers: EntityManager[], task: (...args: unknown[]) => unknown): Promise<unknown>;
|
|
7
|
-
get(contextName?: string): EntityManager | undefined;
|
|
8
|
-
has(contextName?: string): boolean;
|
|
9
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MikroORM, Options } from "@mikro-orm/core";
|
|
2
|
-
import { MikroOrmContext } from "./MikroOrmContext";
|
|
3
|
-
export declare class MikroOrmFactory {
|
|
4
|
-
private readonly context;
|
|
5
|
-
constructor(context: MikroOrmContext);
|
|
6
|
-
create(options: Options): Promise<MikroORM>;
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MikroOrmFactory } from "./MikroOrmFactory";
|
|
2
|
-
import { IDatabaseDriver as DatabaseDriver, MikroORM, Options } from "@mikro-orm/core";
|
|
3
|
-
import { Logger } from "@tsed/logger";
|
|
4
|
-
export declare class MikroOrmRegistry {
|
|
5
|
-
private readonly logger;
|
|
6
|
-
private readonly mikroOrmFactory;
|
|
7
|
-
private readonly DEFAULT_CONTEXT_NAME;
|
|
8
|
-
private readonly instances;
|
|
9
|
-
constructor(logger: Logger, mikroOrmFactory: MikroOrmFactory);
|
|
10
|
-
register<T extends DatabaseDriver>(options: Options<T>): Promise<MikroORM>;
|
|
11
|
-
get(contextName?: string): MikroORM | undefined;
|
|
12
|
-
has(contextName?: string): boolean;
|
|
13
|
-
values(): IterableIterator<MikroORM>;
|
|
14
|
-
clear(): Promise<void>;
|
|
15
|
-
private dispose;
|
|
16
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.compile.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"module": "ES2020",
|
|
6
|
-
"rootDir": "src",
|
|
7
|
-
"outDir": "./lib/esm",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationDir": "./lib/types"
|
|
10
|
-
},
|
|
11
|
-
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
|
|
12
|
-
}
|