@mikro-orm/core 7.0.0-dev.62 → 7.0.0-dev.64
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/MikroORM.js +0 -7
- package/entity/defineEntity.d.ts +2 -8
- package/enums.d.ts +2 -0
- package/index.d.ts +1 -2
- package/index.js +0 -1
- package/metadata/EntitySchema.d.ts +1 -9
- package/metadata/MetadataDiscovery.js +1 -4
- package/metadata/MetadataProvider.d.ts +2 -2
- package/metadata/MetadataProvider.js +15 -0
- package/metadata/index.d.ts +1 -1
- package/metadata/index.js +1 -1
- package/metadata/types.d.ts +480 -0
- package/metadata/types.js +1 -0
- package/package.json +2 -3
- package/typings.d.ts +2 -10
- package/utils/Configuration.d.ts +5 -11
- package/utils/Configuration.js +3 -5
- package/utils/ConfigurationLoader.js +6 -3
- package/utils/Utils.d.ts +0 -4
- package/utils/Utils.js +0 -8
- package/decorators/Check.d.ts +0 -3
- package/decorators/Check.js +0 -13
- package/decorators/CreateRequestContext.d.ts +0 -3
- package/decorators/CreateRequestContext.js +0 -32
- package/decorators/Embeddable.d.ts +0 -10
- package/decorators/Embeddable.js +0 -11
- package/decorators/Embedded.d.ts +0 -12
- package/decorators/Embedded.js +0 -18
- package/decorators/Entity.d.ts +0 -35
- package/decorators/Entity.js +0 -12
- package/decorators/Enum.d.ts +0 -9
- package/decorators/Enum.js +0 -16
- package/decorators/Filter.d.ts +0 -2
- package/decorators/Filter.js +0 -8
- package/decorators/Formula.d.ts +0 -4
- package/decorators/Formula.js +0 -15
- package/decorators/Indexed.d.ts +0 -19
- package/decorators/Indexed.js +0 -20
- package/decorators/ManyToMany.d.ts +0 -42
- package/decorators/ManyToMany.js +0 -14
- package/decorators/ManyToOne.d.ts +0 -34
- package/decorators/ManyToOne.js +0 -14
- package/decorators/OneToMany.d.ts +0 -28
- package/decorators/OneToMany.js +0 -17
- package/decorators/OneToOne.d.ts +0 -28
- package/decorators/OneToOne.js +0 -7
- package/decorators/PrimaryKey.d.ts +0 -8
- package/decorators/PrimaryKey.js +0 -20
- package/decorators/Property.d.ts +0 -294
- package/decorators/Property.js +0 -32
- package/decorators/Transactional.d.ts +0 -15
- package/decorators/Transactional.js +0 -31
- package/decorators/hooks.d.ts +0 -16
- package/decorators/hooks.js +0 -47
- package/decorators/index.d.ts +0 -17
- package/decorators/index.js +0 -17
- package/metadata/ReflectMetadataProvider.d.ts +0 -8
- package/metadata/ReflectMetadataProvider.js +0 -44
- package/utils/resolveContextProvider.d.ts +0 -10
- package/utils/resolveContextProvider.js +0 -28
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from '../EntityManager.js';
|
|
2
|
-
import { MikroORM } from '../MikroORM.js';
|
|
3
|
-
import type { ContextProvider, MaybePromise } from '../typings.js';
|
|
4
|
-
/**
|
|
5
|
-
* Find `EntityManager` in provided context, or else in instance's `orm` or `em` properties.
|
|
6
|
-
*/
|
|
7
|
-
export declare function resolveContextProvider<T>(caller: T & {
|
|
8
|
-
orm?: MaybePromise<MikroORM>;
|
|
9
|
-
em?: MaybePromise<EntityManager>;
|
|
10
|
-
}, provider?: ContextProvider<T>): Promise<EntityManager | undefined>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { EntityRepository } from '../entity/EntityRepository.js';
|
|
2
|
-
import { EntityManager } from '../EntityManager.js';
|
|
3
|
-
import { MikroORM } from '../MikroORM.js';
|
|
4
|
-
function getEntityManager(caller, context) {
|
|
5
|
-
if (context instanceof EntityManager) {
|
|
6
|
-
return context;
|
|
7
|
-
}
|
|
8
|
-
if (context instanceof EntityRepository) {
|
|
9
|
-
return context.getEntityManager();
|
|
10
|
-
}
|
|
11
|
-
if (context instanceof MikroORM) {
|
|
12
|
-
return context.em;
|
|
13
|
-
}
|
|
14
|
-
if (caller.em instanceof EntityManager) {
|
|
15
|
-
return caller.em;
|
|
16
|
-
}
|
|
17
|
-
if (caller.orm instanceof MikroORM) {
|
|
18
|
-
return caller.orm.em;
|
|
19
|
-
}
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Find `EntityManager` in provided context, or else in instance's `orm` or `em` properties.
|
|
24
|
-
*/
|
|
25
|
-
export async function resolveContextProvider(caller, provider) {
|
|
26
|
-
const context = typeof provider === 'function' ? await provider(caller) : await provider;
|
|
27
|
-
return getEntityManager({ orm: await caller.orm, em: await caller.em }, context);
|
|
28
|
-
}
|