@mikro-orm/core 7.0.0-dev.1 → 7.0.0-dev.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/EntityManager.d.ts +18 -13
- package/EntityManager.js +203 -203
- package/MikroORM.d.ts +7 -6
- package/MikroORM.js +33 -45
- package/cache/CacheAdapter.js +1 -2
- package/cache/FileCacheAdapter.d.ts +1 -1
- package/cache/FileCacheAdapter.js +18 -26
- package/cache/GeneratedCacheAdapter.d.ts +2 -2
- package/cache/GeneratedCacheAdapter.js +1 -5
- package/cache/MemoryCacheAdapter.d.ts +1 -1
- package/cache/MemoryCacheAdapter.js +1 -5
- package/cache/NullCacheAdapter.d.ts +1 -1
- package/cache/NullCacheAdapter.js +1 -5
- package/cache/index.d.ts +5 -5
- package/cache/index.js +5 -21
- package/connections/Connection.d.ts +7 -7
- package/connections/Connection.js +8 -12
- package/connections/index.d.ts +1 -1
- package/connections/index.js +1 -17
- package/decorators/Check.d.ts +1 -1
- package/decorators/Check.js +5 -8
- package/decorators/CreateRequestContext.d.ts +1 -1
- package/decorators/CreateRequestContext.js +13 -14
- package/decorators/Embeddable.d.ts +1 -1
- package/decorators/Embeddable.js +3 -6
- package/decorators/Embedded.d.ts +1 -1
- package/decorators/Embedded.js +10 -12
- package/decorators/Entity.d.ts +2 -2
- package/decorators/Entity.js +5 -8
- package/decorators/Enum.d.ts +2 -2
- package/decorators/Enum.js +7 -10
- package/decorators/Filter.d.ts +1 -1
- package/decorators/Filter.js +3 -6
- package/decorators/Formula.d.ts +2 -2
- package/decorators/Formula.js +7 -10
- package/decorators/Indexed.d.ts +2 -2
- package/decorators/Indexed.js +6 -10
- package/decorators/ManyToMany.d.ts +3 -3
- package/decorators/ManyToMany.js +10 -12
- package/decorators/ManyToOne.d.ts +3 -3
- package/decorators/ManyToOne.js +10 -12
- package/decorators/OneToMany.d.ts +3 -3
- package/decorators/OneToMany.js +11 -14
- package/decorators/OneToOne.d.ts +4 -4
- package/decorators/OneToOne.js +4 -7
- package/decorators/PrimaryKey.d.ts +2 -2
- package/decorators/PrimaryKey.js +10 -13
- package/decorators/Property.d.ts +5 -5
- package/decorators/Property.js +10 -12
- package/decorators/Transactional.d.ts +2 -2
- package/decorators/Transactional.js +7 -10
- package/decorators/hooks.js +23 -35
- package/decorators/index.d.ts +17 -17
- package/decorators/index.js +17 -36
- package/drivers/DatabaseDriver.d.ts +13 -12
- package/drivers/DatabaseDriver.js +60 -64
- package/drivers/IDatabaseDriver.d.ts +12 -12
- package/drivers/IDatabaseDriver.js +1 -4
- package/drivers/index.d.ts +2 -2
- package/drivers/index.js +2 -18
- package/entity/ArrayCollection.d.ts +2 -2
- package/entity/ArrayCollection.js +29 -33
- package/entity/BaseEntity.d.ts +6 -6
- package/entity/BaseEntity.js +17 -21
- package/entity/Collection.d.ts +6 -6
- package/entity/Collection.js +40 -44
- package/entity/EntityAssigner.d.ts +2 -2
- package/entity/EntityAssigner.js +58 -63
- package/entity/EntityFactory.d.ts +3 -3
- package/entity/EntityFactory.js +58 -62
- package/entity/EntityHelper.d.ts +2 -2
- package/entity/EntityHelper.js +41 -45
- package/entity/EntityIdentifier.d.ts +1 -1
- package/entity/EntityIdentifier.js +1 -5
- package/entity/EntityLoader.d.ts +5 -5
- package/entity/EntityLoader.js +92 -96
- package/entity/EntityRepository.d.ts +7 -7
- package/entity/EntityRepository.js +7 -11
- package/entity/EntityValidator.d.ts +1 -1
- package/entity/EntityValidator.js +25 -29
- package/entity/Reference.d.ts +2 -2
- package/entity/Reference.js +35 -42
- package/entity/WrappedEntity.d.ts +12 -12
- package/entity/WrappedEntity.js +23 -27
- package/entity/index.d.ts +13 -13
- package/entity/index.js +13 -29
- package/entity/utils.d.ts +1 -1
- package/entity/utils.js +9 -12
- package/entity/wrap.d.ts +1 -1
- package/entity/wrap.js +2 -6
- package/enums.d.ts +3 -3
- package/enums.js +37 -41
- package/errors.d.ts +1 -1
- package/errors.js +15 -24
- package/events/EventManager.d.ts +3 -3
- package/events/EventManager.js +8 -12
- package/events/EventSubscriber.d.ts +5 -4
- package/events/EventSubscriber.js +1 -2
- package/events/TransactionEventBroadcaster.d.ts +3 -3
- package/events/TransactionEventBroadcaster.js +1 -5
- package/events/index.d.ts +3 -3
- package/events/index.js +3 -19
- package/exceptions.js +18 -39
- package/hydration/Hydrator.d.ts +5 -5
- package/hydration/Hydrator.js +3 -6
- package/hydration/ObjectHydrator.d.ts +3 -3
- package/hydration/ObjectHydrator.js +25 -28
- package/hydration/index.d.ts +2 -2
- package/hydration/index.js +2 -18
- package/index.d.ts +21 -21
- package/index.js +21 -46
- package/logging/DefaultLogger.d.ts +1 -1
- package/logging/DefaultLogger.js +9 -13
- package/logging/Logger.d.ts +1 -1
- package/logging/Logger.js +1 -2
- package/logging/SimpleLogger.d.ts +2 -2
- package/logging/SimpleLogger.js +2 -6
- package/logging/colors.js +1 -5
- package/logging/index.d.ts +4 -4
- package/logging/index.js +4 -20
- package/metadata/EntitySchema.d.ts +12 -4
- package/metadata/EntitySchema.js +41 -45
- package/metadata/MetadataDiscovery.d.ts +7 -7
- package/metadata/MetadataDiscovery.js +174 -177
- package/metadata/MetadataProvider.d.ts +2 -2
- package/metadata/MetadataProvider.js +4 -7
- package/metadata/MetadataStorage.d.ts +2 -2
- package/metadata/MetadataStorage.js +15 -19
- package/metadata/MetadataValidator.d.ts +4 -4
- package/metadata/MetadataValidator.js +49 -53
- package/metadata/ReflectMetadataProvider.d.ts +2 -2
- package/metadata/ReflectMetadataProvider.js +8 -12
- package/metadata/index.d.ts +6 -6
- package/metadata/index.js +6 -22
- package/naming-strategy/AbstractNamingStrategy.d.ts +2 -2
- package/naming-strategy/AbstractNamingStrategy.js +4 -8
- package/naming-strategy/EntityCaseNamingStrategy.d.ts +1 -1
- package/naming-strategy/EntityCaseNamingStrategy.js +2 -6
- package/naming-strategy/MongoNamingStrategy.d.ts +1 -1
- package/naming-strategy/MongoNamingStrategy.js +2 -6
- package/naming-strategy/NamingStrategy.d.ts +1 -1
- package/naming-strategy/NamingStrategy.js +1 -2
- package/naming-strategy/UnderscoreNamingStrategy.d.ts +1 -1
- package/naming-strategy/UnderscoreNamingStrategy.js +2 -6
- package/naming-strategy/index.d.ts +5 -5
- package/naming-strategy/index.js +5 -21
- package/package.json +5 -14
- package/platforms/ExceptionConverter.d.ts +2 -2
- package/platforms/ExceptionConverter.js +4 -8
- package/platforms/Platform.d.ts +10 -10
- package/platforms/Platform.js +57 -61
- package/platforms/index.d.ts +2 -2
- package/platforms/index.js +2 -18
- package/serialization/EntitySerializer.d.ts +2 -2
- package/serialization/EntitySerializer.js +36 -41
- package/serialization/EntityTransformer.d.ts +1 -1
- package/serialization/EntityTransformer.js +27 -31
- package/serialization/SerializationContext.d.ts +2 -2
- package/serialization/SerializationContext.js +10 -14
- package/serialization/index.d.ts +3 -3
- package/serialization/index.js +3 -19
- package/types/ArrayType.d.ts +3 -3
- package/types/ArrayType.js +7 -11
- package/types/BigIntType.d.ts +3 -3
- package/types/BigIntType.js +3 -6
- package/types/BlobType.d.ts +3 -3
- package/types/BlobType.js +2 -8
- package/types/BooleanType.d.ts +3 -3
- package/types/BooleanType.js +2 -6
- package/types/CharacterType.d.ts +3 -3
- package/types/CharacterType.js +2 -6
- package/types/DateTimeType.d.ts +3 -3
- package/types/DateTimeType.js +2 -6
- package/types/DateType.d.ts +3 -3
- package/types/DateType.js +2 -6
- package/types/DecimalType.d.ts +3 -3
- package/types/DecimalType.js +4 -7
- package/types/DoubleType.d.ts +3 -3
- package/types/DoubleType.js +3 -6
- package/types/EnumArrayType.d.ts +4 -4
- package/types/EnumArrayType.js +5 -10
- package/types/EnumType.d.ts +3 -3
- package/types/EnumType.js +2 -6
- package/types/FloatType.d.ts +3 -3
- package/types/FloatType.js +2 -6
- package/types/IntegerType.d.ts +3 -3
- package/types/IntegerType.js +2 -6
- package/types/IntervalType.d.ts +3 -3
- package/types/IntervalType.js +2 -6
- package/types/JsonType.d.ts +3 -3
- package/types/JsonType.js +2 -6
- package/types/MediumIntType.d.ts +3 -3
- package/types/MediumIntType.js +2 -6
- package/types/SmallIntType.d.ts +3 -3
- package/types/SmallIntType.js +2 -6
- package/types/StringType.d.ts +3 -3
- package/types/StringType.js +2 -6
- package/types/TextType.d.ts +3 -3
- package/types/TextType.js +2 -6
- package/types/TimeType.d.ts +3 -3
- package/types/TimeType.js +4 -8
- package/types/TinyIntType.d.ts +3 -3
- package/types/TinyIntType.js +3 -6
- package/types/Type.d.ts +2 -2
- package/types/Type.js +5 -9
- package/types/Uint8ArrayType.d.ts +3 -3
- package/types/Uint8ArrayType.js +3 -9
- package/types/UnknownType.d.ts +3 -3
- package/types/UnknownType.js +2 -6
- package/types/UuidType.d.ts +3 -3
- package/types/UuidType.js +2 -6
- package/types/index.d.ts +25 -25
- package/types/index.js +52 -79
- package/typings.d.ts +22 -20
- package/typings.js +34 -38
- package/unit-of-work/ChangeSet.d.ts +1 -1
- package/unit-of-work/ChangeSet.js +13 -17
- package/unit-of-work/ChangeSetComputer.d.ts +8 -7
- package/unit-of-work/ChangeSetComputer.js +26 -30
- package/unit-of-work/ChangeSetPersister.d.ts +7 -6
- package/unit-of-work/ChangeSetPersister.js +44 -47
- package/unit-of-work/CommitOrderCalculator.d.ts +1 -1
- package/unit-of-work/CommitOrderCalculator.js +6 -10
- package/unit-of-work/IdentityMap.d.ts +1 -1
- package/unit-of-work/IdentityMap.js +1 -5
- package/unit-of-work/UnitOfWork.d.ts +8 -7
- package/unit-of-work/UnitOfWork.js +171 -172
- package/unit-of-work/index.d.ts +6 -6
- package/unit-of-work/index.js +6 -22
- package/utils/AbstractSchemaGenerator.d.ts +6 -6
- package/utils/AbstractSchemaGenerator.js +7 -11
- package/utils/Configuration.d.ts +26 -27
- package/utils/Configuration.js +50 -55
- package/utils/ConfigurationLoader.d.ts +9 -8
- package/utils/ConfigurationLoader.js +71 -86
- package/utils/Cursor.d.ts +3 -3
- package/utils/Cursor.js +22 -25
- package/utils/DataloaderUtils.d.ts +4 -4
- package/utils/DataloaderUtils.js +12 -16
- package/utils/EntityComparator.d.ts +2 -2
- package/utils/EntityComparator.js +48 -52
- package/utils/NullHighlighter.d.ts +1 -1
- package/utils/NullHighlighter.js +1 -5
- package/utils/QueryHelper.d.ts +3 -3
- package/utils/QueryHelper.js +47 -51
- package/utils/RawQueryFragment.d.ts +1 -1
- package/utils/RawQueryFragment.js +16 -24
- package/utils/RequestContext.d.ts +2 -2
- package/utils/RequestContext.js +3 -7
- package/utils/TransactionContext.d.ts +1 -1
- package/utils/TransactionContext.js +4 -8
- package/utils/Utils.d.ts +16 -12
- package/utils/Utils.js +89 -93
- package/utils/clone.js +8 -11
- package/utils/index.d.ts +13 -13
- package/utils/index.js +13 -29
- package/utils/resolveContextProvider.d.ts +3 -3
- package/utils/resolveContextProvider.js +9 -12
- package/utils/upsert-utils.d.ts +3 -3
- package/utils/upsert-utils.js +5 -9
- package/index.mjs +0 -199
package/decorators/Embedded.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const enums_1 = require("../enums");
|
|
7
|
-
function Embedded(type = {}, options = {}) {
|
|
1
|
+
import { MetadataValidator } from '../metadata/MetadataValidator.js';
|
|
2
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
3
|
+
import { Utils } from '../utils/Utils.js';
|
|
4
|
+
import { ReferenceKind } from '../enums.js';
|
|
5
|
+
export function Embedded(type = {}, options = {}) {
|
|
8
6
|
return function (target, propertyName) {
|
|
9
|
-
const meta =
|
|
10
|
-
|
|
7
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
|
|
8
|
+
MetadataValidator.validateSingleDecorator(meta, propertyName, ReferenceKind.EMBEDDED);
|
|
11
9
|
options = type instanceof Function ? { entity: type, ...options } : { ...type, ...options };
|
|
12
|
-
|
|
10
|
+
Utils.defaultValue(options, 'prefix', true);
|
|
13
11
|
meta.properties[propertyName] = {
|
|
14
12
|
name: propertyName,
|
|
15
|
-
kind:
|
|
13
|
+
kind: ReferenceKind.EMBEDDED,
|
|
16
14
|
...options,
|
|
17
15
|
};
|
|
18
|
-
return
|
|
16
|
+
return Utils.propertyDecoratorReturnValue();
|
|
19
17
|
};
|
|
20
18
|
}
|
package/decorators/Entity.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Constructor, Dictionary, FilterQuery } from '../typings';
|
|
2
|
-
import type { FindOptions } from '../drivers/IDatabaseDriver';
|
|
1
|
+
import type { Constructor, Dictionary, FilterQuery } from '../typings.js';
|
|
2
|
+
import type { FindOptions } from '../drivers/IDatabaseDriver.js';
|
|
3
3
|
export declare function Entity(options?: EntityOptions<any>): <T>(target: T & Dictionary) => T & Dictionary;
|
|
4
4
|
export type EntityOptions<T> = {
|
|
5
5
|
tableName?: string;
|
package/decorators/Entity.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const metadata_1 = require("../metadata");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
function Entity(options = {}) {
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { Utils } from '../utils/Utils.js';
|
|
3
|
+
export function Entity(options = {}) {
|
|
7
4
|
return function (target) {
|
|
8
|
-
const meta =
|
|
9
|
-
|
|
5
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target);
|
|
6
|
+
Utils.mergeConfig(meta, options);
|
|
10
7
|
meta.class = target;
|
|
11
8
|
if (!options.abstract || meta.discriminatorColumn) {
|
|
12
9
|
meta.name = target.name;
|
package/decorators/Enum.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PropertyOptions } from './Property';
|
|
2
|
-
import type { AnyEntity, Dictionary } from '../typings';
|
|
1
|
+
import type { PropertyOptions } from './Property.js';
|
|
2
|
+
import type { AnyEntity, Dictionary } from '../typings.js';
|
|
3
3
|
export declare function Enum<T extends object>(options?: EnumOptions<AnyEntity> | (() => Dictionary)): (target: AnyEntity, propertyName: string) => any;
|
|
4
4
|
export interface EnumOptions<T> extends PropertyOptions<T> {
|
|
5
5
|
items?: (number | string)[] | (() => Dictionary);
|
package/decorators/Enum.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const enums_1 = require("../enums");
|
|
6
|
-
const Utils_1 = require("../utils/Utils");
|
|
7
|
-
function Enum(options = {}) {
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { ReferenceKind } from '../enums.js';
|
|
3
|
+
import { Utils } from '../utils/Utils.js';
|
|
4
|
+
export function Enum(options = {}) {
|
|
8
5
|
return function (target, propertyName) {
|
|
9
|
-
const meta =
|
|
6
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
|
|
10
7
|
options = options instanceof Function ? { items: options } : options;
|
|
11
8
|
meta.properties[propertyName] = {
|
|
12
9
|
name: propertyName,
|
|
13
|
-
kind:
|
|
10
|
+
kind: ReferenceKind.SCALAR,
|
|
14
11
|
enum: true,
|
|
15
12
|
...options,
|
|
16
13
|
};
|
|
17
|
-
return
|
|
14
|
+
return Utils.propertyDecoratorReturnValue();
|
|
18
15
|
};
|
|
19
16
|
}
|
package/decorators/Filter.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Dictionary, FilterDef } from '../typings';
|
|
1
|
+
import type { Dictionary, FilterDef } from '../typings.js';
|
|
2
2
|
export declare function Filter<T>(options: FilterDef): <U>(target: U & Dictionary) => U & Dictionary;
|
package/decorators/Filter.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Filter = Filter;
|
|
4
|
-
const metadata_1 = require("../metadata");
|
|
5
|
-
function Filter(options) {
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
export function Filter(options) {
|
|
6
3
|
return function (target) {
|
|
7
|
-
const meta =
|
|
4
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target);
|
|
8
5
|
meta.filters[options.name] = options;
|
|
9
6
|
return target;
|
|
10
7
|
};
|
package/decorators/Formula.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnyEntity } from '../typings';
|
|
2
|
-
import type { PropertyOptions } from './Property';
|
|
1
|
+
import type { AnyEntity } from '../typings.js';
|
|
2
|
+
import type { PropertyOptions } from './Property.js';
|
|
3
3
|
export declare function Formula<T extends object>(formula: string | ((alias: string) => string), options?: FormulaOptions<T>): (target: AnyEntity, propertyName: string) => any;
|
|
4
4
|
export interface FormulaOptions<T> extends PropertyOptions<T> {
|
|
5
5
|
}
|
package/decorators/Formula.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const enums_1 = require("../enums");
|
|
6
|
-
const Utils_1 = require("../utils/Utils");
|
|
7
|
-
function Formula(formula, options = {}) {
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { ReferenceKind } from '../enums.js';
|
|
3
|
+
import { Utils } from '../utils/Utils.js';
|
|
4
|
+
export function Formula(formula, options = {}) {
|
|
8
5
|
return function (target, propertyName) {
|
|
9
|
-
const meta =
|
|
6
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
|
|
10
7
|
meta.properties[propertyName] = {
|
|
11
8
|
name: propertyName,
|
|
12
|
-
kind:
|
|
9
|
+
kind: ReferenceKind.SCALAR,
|
|
13
10
|
formula,
|
|
14
11
|
...options,
|
|
15
12
|
};
|
|
16
|
-
return
|
|
13
|
+
return Utils.propertyDecoratorReturnValue();
|
|
17
14
|
};
|
|
18
15
|
}
|
package/decorators/Indexed.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnyEntity, Dictionary } from '../typings';
|
|
2
|
-
import type { DeferMode } from '../enums';
|
|
1
|
+
import type { AnyEntity, Dictionary } from '../typings.js';
|
|
2
|
+
import type { DeferMode } from '../enums.js';
|
|
3
3
|
export declare function Index<T>(options?: IndexOptions<T>): (target: AnyEntity, propertyName?: string) => any;
|
|
4
4
|
export declare function Unique<T>(options?: UniqueOptions<T>): (target: AnyEntity, propertyName?: string) => any;
|
|
5
5
|
interface BaseOptions<T> {
|
package/decorators/Indexed.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Index = Index;
|
|
4
|
-
exports.Unique = Unique;
|
|
5
|
-
const metadata_1 = require("../metadata");
|
|
6
|
-
const Utils_1 = require("../utils/Utils");
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { Utils } from '../utils/Utils.js';
|
|
7
3
|
function createDecorator(options, unique) {
|
|
8
4
|
return function (target, propertyName) {
|
|
9
|
-
const meta =
|
|
5
|
+
const meta = MetadataStorage.getMetadataFromDecorator(propertyName ? target.constructor : target);
|
|
10
6
|
options.properties = options.properties || propertyName;
|
|
11
7
|
const key = unique ? 'uniques' : 'indexes';
|
|
12
8
|
meta[key].push(options);
|
|
13
9
|
if (!propertyName) {
|
|
14
10
|
return target;
|
|
15
11
|
}
|
|
16
|
-
return
|
|
12
|
+
return Utils.propertyDecoratorReturnValue();
|
|
17
13
|
};
|
|
18
14
|
}
|
|
19
|
-
function Index(options = {}) {
|
|
15
|
+
export function Index(options = {}) {
|
|
20
16
|
return createDecorator(options, false);
|
|
21
17
|
}
|
|
22
|
-
function Unique(options = {}) {
|
|
18
|
+
export function Unique(options = {}) {
|
|
23
19
|
return createDecorator(options, true);
|
|
24
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReferenceOptions } from './Property';
|
|
2
|
-
import type { EntityName, AnyEntity, FilterQuery, AnyString } from '../typings';
|
|
3
|
-
import { type QueryOrderMap } from '../enums';
|
|
1
|
+
import type { ReferenceOptions } from './Property.js';
|
|
2
|
+
import type { EntityName, AnyEntity, FilterQuery, AnyString } from '../typings.js';
|
|
3
|
+
import { type QueryOrderMap } from '../enums.js';
|
|
4
4
|
export declare function ManyToMany<T extends object, O>(entity?: ManyToManyOptions<T, O> | string | (() => EntityName<T>), mappedBy?: (string & keyof T) | ((e: T) => any), options?: Partial<ManyToManyOptions<T, O>>): (target: AnyEntity, propertyName: string) => any;
|
|
5
5
|
export interface ManyToManyOptions<Owner, Target> extends ReferenceOptions<Owner, Target> {
|
|
6
6
|
/** Set this side as owning. Owning side is where the foreign key is defined. This option is not required if you use `inversedBy` or `mappedBy` to distinguish owning and inverse side. */
|
package/decorators/ManyToMany.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const enums_1 = require("../enums");
|
|
7
|
-
function ManyToMany(entity, mappedBy, options = {}) {
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { MetadataValidator } from '../metadata/MetadataValidator.js';
|
|
3
|
+
import { Utils } from '../utils/Utils.js';
|
|
4
|
+
import { ReferenceKind } from '../enums.js';
|
|
5
|
+
export function ManyToMany(entity, mappedBy, options = {}) {
|
|
8
6
|
return function (target, propertyName) {
|
|
9
|
-
options =
|
|
10
|
-
const meta =
|
|
11
|
-
|
|
12
|
-
const property = { name: propertyName, kind:
|
|
7
|
+
options = Utils.processDecoratorParameters({ entity, mappedBy, options });
|
|
8
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
|
|
9
|
+
MetadataValidator.validateSingleDecorator(meta, propertyName, ReferenceKind.MANY_TO_MANY);
|
|
10
|
+
const property = { name: propertyName, kind: ReferenceKind.MANY_TO_MANY };
|
|
13
11
|
meta.properties[propertyName] = Object.assign(meta.properties[propertyName] ?? {}, property, options);
|
|
14
|
-
return
|
|
12
|
+
return Utils.propertyDecoratorReturnValue();
|
|
15
13
|
};
|
|
16
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReferenceOptions } from './Property';
|
|
2
|
-
import { type DeferMode } from '../enums';
|
|
3
|
-
import type { AnyEntity, AnyString, EntityName } from '../typings';
|
|
1
|
+
import type { ReferenceOptions } from './Property.js';
|
|
2
|
+
import { type DeferMode } from '../enums.js';
|
|
3
|
+
import type { AnyEntity, AnyString, EntityName } from '../typings.js';
|
|
4
4
|
export declare function ManyToOne<T extends object, O>(entity?: ManyToOneOptions<T, O> | string | ((e?: any) => EntityName<T>), options?: Partial<ManyToOneOptions<T, O>>): (target: AnyEntity, propertyName: string) => any;
|
|
5
5
|
export interface ManyToOneOptions<Owner, Target> extends ReferenceOptions<Owner, Target> {
|
|
6
6
|
/** Point to the inverse side property name. */
|
package/decorators/ManyToOne.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const enums_1 = require("../enums");
|
|
7
|
-
function ManyToOne(entity = {}, options = {}) {
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { MetadataValidator } from '../metadata/MetadataValidator.js';
|
|
3
|
+
import { Utils } from '../utils/Utils.js';
|
|
4
|
+
import { ReferenceKind } from '../enums.js';
|
|
5
|
+
export function ManyToOne(entity = {}, options = {}) {
|
|
8
6
|
return function (target, propertyName) {
|
|
9
|
-
options =
|
|
10
|
-
const meta =
|
|
11
|
-
|
|
12
|
-
const property = { name: propertyName, kind:
|
|
7
|
+
options = Utils.processDecoratorParameters({ entity, options });
|
|
8
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
|
|
9
|
+
MetadataValidator.validateSingleDecorator(meta, propertyName, ReferenceKind.MANY_TO_ONE);
|
|
10
|
+
const property = { name: propertyName, kind: ReferenceKind.MANY_TO_ONE };
|
|
13
11
|
meta.properties[propertyName] = Object.assign(meta.properties[propertyName] ?? {}, property, options);
|
|
14
|
-
return
|
|
12
|
+
return Utils.propertyDecoratorReturnValue();
|
|
15
13
|
};
|
|
16
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReferenceOptions } from './Property';
|
|
2
|
-
import { ReferenceKind, type QueryOrderMap } from '../enums';
|
|
3
|
-
import type { EntityName, AnyEntity, FilterQuery } from '../typings';
|
|
1
|
+
import type { ReferenceOptions } from './Property.js';
|
|
2
|
+
import { ReferenceKind, type QueryOrderMap } from '../enums.js';
|
|
3
|
+
import type { EntityName, AnyEntity, FilterQuery } from '../typings.js';
|
|
4
4
|
export declare function createOneToDecorator<Target, Owner>(entity: OneToManyOptions<Owner, Target> | string | ((e?: any) => EntityName<Target>), mappedBy: (string & keyof Target) | ((e: Target) => any) | undefined, options: Partial<OneToManyOptions<Owner, Target>>, kind: ReferenceKind): (target: AnyEntity, propertyName: string) => any;
|
|
5
5
|
export declare function OneToMany<Target, Owner>(entity: string | ((e?: any) => EntityName<Target>), mappedBy: (string & keyof Target) | ((e: Target) => any), options?: Partial<OneToManyOptions<Owner, Target>>): (target: AnyEntity, propertyName: string) => void;
|
|
6
6
|
export declare function OneToMany<Target, Owner>(options: OneToManyOptions<Owner, Target>): (target: AnyEntity, propertyName: string) => void;
|
package/decorators/OneToMany.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
const enums_1 = require("../enums");
|
|
8
|
-
function createOneToDecorator(entity, mappedBy, options, kind) {
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { MetadataValidator } from '../metadata/MetadataValidator.js';
|
|
3
|
+
import { Utils } from '../utils/Utils.js';
|
|
4
|
+
import { ReferenceKind } from '../enums.js';
|
|
5
|
+
export function createOneToDecorator(entity, mappedBy, options, kind) {
|
|
9
6
|
return function (target, propertyName) {
|
|
10
|
-
options =
|
|
11
|
-
const meta =
|
|
12
|
-
|
|
7
|
+
options = Utils.processDecoratorParameters({ entity, mappedBy, options });
|
|
8
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
|
|
9
|
+
MetadataValidator.validateSingleDecorator(meta, propertyName, kind);
|
|
13
10
|
const property = { name: propertyName, kind };
|
|
14
11
|
meta.properties[propertyName] = Object.assign(meta.properties[propertyName] ?? {}, property, options);
|
|
15
|
-
return
|
|
12
|
+
return Utils.propertyDecoratorReturnValue();
|
|
16
13
|
};
|
|
17
14
|
}
|
|
18
|
-
function OneToMany(entity, mappedBy, options = {}) {
|
|
19
|
-
return createOneToDecorator(entity, mappedBy, options,
|
|
15
|
+
export function OneToMany(entity, mappedBy, options = {}) {
|
|
16
|
+
return createOneToDecorator(entity, mappedBy, options, ReferenceKind.ONE_TO_MANY);
|
|
20
17
|
}
|
package/decorators/OneToOne.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type DeferMode } from '../enums';
|
|
2
|
-
import { type OneToManyOptions } from './OneToMany';
|
|
3
|
-
import type { AnyString, EntityName } from '../typings';
|
|
4
|
-
export declare function OneToOne<Target, Owner>(entity?: OneToOneOptions<Owner, Target> | string | ((e: Owner) => EntityName<Target>), mappedByOrOptions?: (string & keyof Target) | ((e: Target) => any) | Partial<OneToOneOptions<Owner, Target>>, options?: Partial<OneToOneOptions<Owner, Target>>): (target: import("../typings").AnyEntity, propertyName: string) => any;
|
|
1
|
+
import { type DeferMode } from '../enums.js';
|
|
2
|
+
import { type OneToManyOptions } from './OneToMany.js';
|
|
3
|
+
import type { AnyString, EntityName } from '../typings.js';
|
|
4
|
+
export declare function OneToOne<Target, Owner>(entity?: OneToOneOptions<Owner, Target> | string | ((e: Owner) => EntityName<Target>), mappedByOrOptions?: (string & keyof Target) | ((e: Target) => any) | Partial<OneToOneOptions<Owner, Target>>, options?: Partial<OneToOneOptions<Owner, Target>>): (target: import("../typings.js").AnyEntity, propertyName: string) => any;
|
|
5
5
|
export interface OneToOneOptions<Owner, Target> extends Partial<Omit<OneToManyOptions<Owner, Target>, 'orderBy'>> {
|
|
6
6
|
/** Set this side as owning. Owning side is where the foreign key is defined. This option is not required if you use `inversedBy` or `mappedBy` to distinguish owning and inverse side. */
|
|
7
7
|
owner?: boolean;
|
package/decorators/OneToOne.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_1 = require("../enums");
|
|
5
|
-
const OneToMany_1 = require("./OneToMany");
|
|
6
|
-
function OneToOne(entity, mappedByOrOptions, options = {}) {
|
|
1
|
+
import { ReferenceKind } from '../enums.js';
|
|
2
|
+
import { createOneToDecorator } from './OneToMany.js';
|
|
3
|
+
export function OneToOne(entity, mappedByOrOptions, options = {}) {
|
|
7
4
|
const mappedBy = typeof mappedByOrOptions === 'object' ? mappedByOrOptions.mappedBy : mappedByOrOptions;
|
|
8
5
|
options = typeof mappedByOrOptions === 'object' ? { ...mappedByOrOptions, ...options } : options;
|
|
9
|
-
return
|
|
6
|
+
return createOneToDecorator(entity, mappedBy, options, ReferenceKind.ONE_TO_ONE);
|
|
10
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PropertyOptions } from './Property';
|
|
2
|
-
import type { AnyEntity } from '../typings';
|
|
1
|
+
import type { PropertyOptions } from './Property.js';
|
|
2
|
+
import type { AnyEntity } from '../typings.js';
|
|
3
3
|
export declare function PrimaryKey<T extends object>(options?: PrimaryKeyOptions<T>): (target: AnyEntity, propertyName: string) => any;
|
|
4
4
|
export declare function SerializedPrimaryKey<T extends object>(options?: SerializedPrimaryKeyOptions<T>): (target: AnyEntity, propertyName: string) => any;
|
|
5
5
|
export interface PrimaryKeyOptions<T> extends PropertyOptions<T> {
|
package/decorators/PrimaryKey.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const metadata_1 = require("../metadata");
|
|
6
|
-
const enums_1 = require("../enums");
|
|
7
|
-
const Utils_1 = require("../utils/Utils");
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { MetadataValidator } from '../metadata/MetadataValidator.js';
|
|
3
|
+
import { ReferenceKind } from '../enums.js';
|
|
4
|
+
import { Utils } from '../utils/Utils.js';
|
|
8
5
|
function createDecorator(options, serialized) {
|
|
9
6
|
return function (target, propertyName) {
|
|
10
|
-
const meta =
|
|
11
|
-
|
|
7
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
|
|
8
|
+
MetadataValidator.validateSingleDecorator(meta, propertyName, ReferenceKind.SCALAR);
|
|
12
9
|
const k = serialized ? 'serializedPrimaryKey' : 'primary';
|
|
13
10
|
options[k] = true;
|
|
14
|
-
meta.properties[propertyName] = { name: propertyName, kind:
|
|
15
|
-
return
|
|
11
|
+
meta.properties[propertyName] = { name: propertyName, kind: ReferenceKind.SCALAR, ...options };
|
|
12
|
+
return Utils.propertyDecoratorReturnValue();
|
|
16
13
|
};
|
|
17
14
|
}
|
|
18
|
-
function PrimaryKey(options = {}) {
|
|
15
|
+
export function PrimaryKey(options = {}) {
|
|
19
16
|
return createDecorator(options, false);
|
|
20
17
|
}
|
|
21
|
-
function SerializedPrimaryKey(options = {}) {
|
|
18
|
+
export function SerializedPrimaryKey(options = {}) {
|
|
22
19
|
return createDecorator(options, true);
|
|
23
20
|
}
|
package/decorators/Property.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Cascade, type LoadStrategy } from '../enums';
|
|
2
|
-
import type { EntityName, Constructor, CheckCallback, GeneratedColumnCallback, AnyString, AnyEntity } from '../typings';
|
|
3
|
-
import type { Type, types } from '../types';
|
|
4
|
-
import type { EntityManager } from '../EntityManager';
|
|
5
|
-
import type { SerializeOptions } from '../serialization/EntitySerializer';
|
|
1
|
+
import { type Cascade, type LoadStrategy } from '../enums.js';
|
|
2
|
+
import type { EntityName, Constructor, CheckCallback, GeneratedColumnCallback, AnyString, AnyEntity } from '../typings.js';
|
|
3
|
+
import type { Type, types } from '../types/index.js';
|
|
4
|
+
import type { EntityManager } from '../EntityManager.js';
|
|
5
|
+
import type { SerializeOptions } from '../serialization/EntitySerializer.js';
|
|
6
6
|
export declare function Property<T extends object>(options?: PropertyOptions<T>): (target: any, propertyName: string) => any;
|
|
7
7
|
export interface PropertyOptions<Owner> {
|
|
8
8
|
/**
|
package/decorators/Property.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const enums_1 = require("../enums");
|
|
7
|
-
function Property(options = {}) {
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { MetadataValidator } from '../metadata/MetadataValidator.js';
|
|
3
|
+
import { Utils } from '../utils/Utils.js';
|
|
4
|
+
import { ReferenceKind } from '../enums.js';
|
|
5
|
+
export function Property(options = {}) {
|
|
8
6
|
return function (target, propertyName) {
|
|
9
|
-
const meta =
|
|
7
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
|
|
10
8
|
const desc = Object.getOwnPropertyDescriptor(target, propertyName) || {};
|
|
11
|
-
|
|
9
|
+
MetadataValidator.validateSingleDecorator(meta, propertyName, ReferenceKind.SCALAR);
|
|
12
10
|
const name = options.name || propertyName;
|
|
13
11
|
if (propertyName !== name && !(desc.value instanceof Function)) {
|
|
14
|
-
|
|
12
|
+
Utils.renameKey(options, 'name', 'fieldName');
|
|
15
13
|
}
|
|
16
14
|
options.name = propertyName;
|
|
17
15
|
const { check, ...opts } = options;
|
|
18
|
-
const prop = { kind:
|
|
16
|
+
const prop = { kind: ReferenceKind.SCALAR, ...opts };
|
|
19
17
|
prop.getter = !!desc.get;
|
|
20
18
|
prop.setter = !!desc.set;
|
|
21
19
|
if (desc.value instanceof Function) {
|
|
@@ -29,6 +27,6 @@ function Property(options = {}) {
|
|
|
29
27
|
meta.checks.push({ property: prop.name, expression: check });
|
|
30
28
|
}
|
|
31
29
|
meta.properties[prop.name] = prop;
|
|
32
|
-
return
|
|
30
|
+
return Utils.propertyDecoratorReturnValue();
|
|
33
31
|
};
|
|
34
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TransactionOptions } from '../enums';
|
|
2
|
-
import type { ContextProvider } from '../typings';
|
|
1
|
+
import type { TransactionOptions } from '../enums.js';
|
|
2
|
+
import type { ContextProvider } from '../typings.js';
|
|
3
3
|
type TransactionalOptions<T> = TransactionOptions & {
|
|
4
4
|
context?: ContextProvider<T>;
|
|
5
5
|
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const RequestContext_1 = require("../utils/RequestContext");
|
|
5
|
-
const resolveContextProvider_1 = require("../utils/resolveContextProvider");
|
|
6
|
-
const TransactionContext_1 = require("../utils/TransactionContext");
|
|
1
|
+
import { RequestContext } from '../utils/RequestContext.js';
|
|
2
|
+
import { resolveContextProvider } from '../utils/resolveContextProvider.js';
|
|
3
|
+
import { TransactionContext } from '../utils/TransactionContext.js';
|
|
7
4
|
/**
|
|
8
5
|
* This decorator wraps the method with `em.transactional()`, so you can provide `TransactionOptions` just like with `em.transactional()`.
|
|
9
6
|
* The difference is that you can specify the context in which the transaction begins by providing `context` option,
|
|
10
7
|
* and if omitted, the transaction will begin in the current context implicitly.
|
|
11
8
|
* It works on async functions and can be nested with `em.transactional()`.
|
|
12
9
|
*/
|
|
13
|
-
function Transactional(options = {}) {
|
|
10
|
+
export function Transactional(options = {}) {
|
|
14
11
|
return function (target, propertyKey, descriptor) {
|
|
15
12
|
const originalMethod = descriptor.value;
|
|
16
13
|
if (originalMethod.constructor.name !== 'AsyncFunction') {
|
|
@@ -18,9 +15,9 @@ function Transactional(options = {}) {
|
|
|
18
15
|
}
|
|
19
16
|
descriptor.value = async function (...args) {
|
|
20
17
|
const { context, ...txOptions } = options;
|
|
21
|
-
const em = await
|
|
22
|
-
||
|
|
23
|
-
||
|
|
18
|
+
const em = (await resolveContextProvider(this, context))
|
|
19
|
+
|| TransactionContext.getEntityManager()
|
|
20
|
+
|| RequestContext.getEntityManager();
|
|
24
21
|
if (!em) {
|
|
25
22
|
throw new Error(`@Transactional() decorator can only be applied to methods of classes with \`orm: MikroORM\` property, \`em: EntityManager\` property, or with a callback parameter like \`@Transactional(() => orm)\` that returns one of those types. The parameter will contain a reference to current \`this\`. Returning an EntityRepository from it is also supported.`);
|
|
26
23
|
}
|
package/decorators/hooks.js
CHANGED
|
@@ -1,59 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BeforeCreate = BeforeCreate;
|
|
4
|
-
exports.AfterCreate = AfterCreate;
|
|
5
|
-
exports.BeforeUpdate = BeforeUpdate;
|
|
6
|
-
exports.AfterUpdate = AfterUpdate;
|
|
7
|
-
exports.BeforeUpsert = BeforeUpsert;
|
|
8
|
-
exports.AfterUpsert = AfterUpsert;
|
|
9
|
-
exports.OnInit = OnInit;
|
|
10
|
-
exports.OnLoad = OnLoad;
|
|
11
|
-
exports.BeforeDelete = BeforeDelete;
|
|
12
|
-
exports.AfterDelete = AfterDelete;
|
|
13
|
-
const metadata_1 = require("../metadata");
|
|
14
|
-
const enums_1 = require("../enums");
|
|
1
|
+
import { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
2
|
+
import { EventType } from '../enums.js';
|
|
15
3
|
function hook(type) {
|
|
16
4
|
return function (target, method) {
|
|
17
|
-
const meta =
|
|
5
|
+
const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
|
|
18
6
|
if (!meta.hooks[type]) {
|
|
19
7
|
meta.hooks[type] = [];
|
|
20
8
|
}
|
|
21
9
|
meta.hooks[type].push(method);
|
|
22
10
|
};
|
|
23
11
|
}
|
|
24
|
-
function BeforeCreate() {
|
|
25
|
-
return hook(
|
|
12
|
+
export function BeforeCreate() {
|
|
13
|
+
return hook(EventType.beforeCreate);
|
|
26
14
|
}
|
|
27
|
-
function AfterCreate() {
|
|
28
|
-
return hook(
|
|
15
|
+
export function AfterCreate() {
|
|
16
|
+
return hook(EventType.afterCreate);
|
|
29
17
|
}
|
|
30
|
-
function BeforeUpdate() {
|
|
31
|
-
return hook(
|
|
18
|
+
export function BeforeUpdate() {
|
|
19
|
+
return hook(EventType.beforeUpdate);
|
|
32
20
|
}
|
|
33
|
-
function AfterUpdate() {
|
|
34
|
-
return hook(
|
|
21
|
+
export function AfterUpdate() {
|
|
22
|
+
return hook(EventType.afterUpdate);
|
|
35
23
|
}
|
|
36
|
-
function BeforeUpsert() {
|
|
37
|
-
return hook(
|
|
24
|
+
export function BeforeUpsert() {
|
|
25
|
+
return hook(EventType.beforeUpsert);
|
|
38
26
|
}
|
|
39
|
-
function AfterUpsert() {
|
|
40
|
-
return hook(
|
|
27
|
+
export function AfterUpsert() {
|
|
28
|
+
return hook(EventType.afterUpsert);
|
|
41
29
|
}
|
|
42
|
-
function OnInit() {
|
|
43
|
-
return hook(
|
|
30
|
+
export function OnInit() {
|
|
31
|
+
return hook(EventType.onInit);
|
|
44
32
|
}
|
|
45
|
-
function OnLoad() {
|
|
46
|
-
return hook(
|
|
33
|
+
export function OnLoad() {
|
|
34
|
+
return hook(EventType.onLoad);
|
|
47
35
|
}
|
|
48
36
|
/**
|
|
49
37
|
* Called before deleting entity, but only when providing initialized entity to EM#remove()
|
|
50
38
|
*/
|
|
51
|
-
function BeforeDelete() {
|
|
52
|
-
return hook(
|
|
39
|
+
export function BeforeDelete() {
|
|
40
|
+
return hook(EventType.beforeDelete);
|
|
53
41
|
}
|
|
54
42
|
/**
|
|
55
43
|
* Called after deleting entity, but only when providing initialized entity to EM#remove()
|
|
56
44
|
*/
|
|
57
|
-
function AfterDelete() {
|
|
58
|
-
return hook(
|
|
45
|
+
export function AfterDelete() {
|
|
46
|
+
return hook(EventType.afterDelete);
|
|
59
47
|
}
|
package/decorators/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export * from './PrimaryKey';
|
|
2
|
-
export * from './Entity';
|
|
3
|
-
export * from './OneToOne';
|
|
4
|
-
export * from './ManyToOne';
|
|
5
|
-
export * from './ManyToMany';
|
|
6
|
-
export { OneToMany, OneToManyOptions } from './OneToMany';
|
|
7
|
-
export * from './Property';
|
|
8
|
-
export * from './Check';
|
|
9
|
-
export * from './Enum';
|
|
10
|
-
export * from './Formula';
|
|
11
|
-
export * from './Indexed';
|
|
12
|
-
export * from './Embeddable';
|
|
13
|
-
export * from './Embedded';
|
|
14
|
-
export * from './Filter';
|
|
15
|
-
export * from './CreateRequestContext';
|
|
16
|
-
export * from './hooks';
|
|
17
|
-
export * from './Transactional';
|
|
1
|
+
export * from './PrimaryKey.js';
|
|
2
|
+
export * from './Entity.js';
|
|
3
|
+
export * from './OneToOne.js';
|
|
4
|
+
export * from './ManyToOne.js';
|
|
5
|
+
export * from './ManyToMany.js';
|
|
6
|
+
export { OneToMany, OneToManyOptions } from './OneToMany.js';
|
|
7
|
+
export * from './Property.js';
|
|
8
|
+
export * from './Check.js';
|
|
9
|
+
export * from './Enum.js';
|
|
10
|
+
export * from './Formula.js';
|
|
11
|
+
export * from './Indexed.js';
|
|
12
|
+
export * from './Embeddable.js';
|
|
13
|
+
export * from './Embedded.js';
|
|
14
|
+
export * from './Filter.js';
|
|
15
|
+
export * from './CreateRequestContext.js';
|
|
16
|
+
export * from './hooks.js';
|
|
17
|
+
export * from './Transactional.js';
|