@mikro-orm/core 6.2.10-dev.57 → 6.2.10-dev.59
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 +0 -1
- package/decorators/Check.js +1 -2
- package/decorators/CreateRequestContext.js +2 -3
- package/decorators/Embeddable.js +1 -2
- package/decorators/Embedded.js +1 -2
- package/decorators/Entity.js +1 -2
- package/decorators/Enum.js +1 -2
- package/decorators/Filter.js +1 -2
- package/decorators/Formula.js +1 -2
- package/decorators/Indexed.d.ts +3 -3
- package/decorators/Indexed.js +2 -3
- package/decorators/ManyToMany.js +1 -2
- package/decorators/ManyToOne.js +1 -2
- package/decorators/OneToMany.js +2 -3
- package/decorators/OneToOne.d.ts +1 -1
- package/decorators/OneToOne.js +1 -2
- package/decorators/PrimaryKey.d.ts +3 -2
- package/decorators/PrimaryKey.js +2 -3
- package/decorators/Property.js +1 -2
- package/decorators/hooks.js +10 -11
- package/entity/ArrayCollection.d.ts +0 -1
- package/entity/EntityIdentifier.d.ts +1 -1
- package/entity/Reference.d.ts +0 -1
- package/entity/Reference.js +3 -3
- package/entity/WrappedEntity.d.ts +0 -1
- package/entity/wrap.js +2 -3
- package/events/TransactionEventBroadcaster.d.ts +2 -2
- package/package.json +2 -2
- package/serialization/EntitySerializer.js +2 -2
- package/types/BigIntType.d.ts +2 -2
- package/types/BlobType.d.ts +0 -1
- package/types/DecimalType.d.ts +2 -2
- package/types/Type.d.ts +0 -1
- package/types/Uint8ArrayType.d.ts +0 -1
- package/unit-of-work/ChangeSet.d.ts +0 -1
- package/utils/Configuration.js +2 -2
- package/utils/Cursor.d.ts +0 -1
- package/utils/RawQueryFragment.d.ts +1 -2
- package/utils/RawQueryFragment.js +4 -4
- package/utils/Utils.d.ts +0 -2
- package/utils/Utils.js +7 -7
- package/utils/clone.js +1 -2
- package/utils/upsert-utils.js +2 -3
package/EntityManager.d.ts
CHANGED
package/decorators/Check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Check =
|
|
3
|
+
exports.Check = Check;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
const Utils_1 = require("../utils/Utils");
|
|
6
6
|
function Check(options) {
|
|
@@ -14,4 +14,3 @@ function Check(options) {
|
|
|
14
14
|
return Utils_1.Utils.propertyDecoratorReturnValue();
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
exports.Check = Check;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CreateRequestContext = CreateRequestContext;
|
|
4
|
+
exports.EnsureRequestContext = EnsureRequestContext;
|
|
4
5
|
const MikroORM_1 = require("../MikroORM");
|
|
5
6
|
const RequestContext_1 = require("../utils/RequestContext");
|
|
6
7
|
const EntityManager_1 = require("../EntityManager");
|
|
@@ -47,8 +48,6 @@ function CreateRequestContext(getContext, respectExistingContext = false) {
|
|
|
47
48
|
return descriptor;
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
|
-
exports.CreateRequestContext = CreateRequestContext;
|
|
51
51
|
function EnsureRequestContext(getContext) {
|
|
52
52
|
return CreateRequestContext(getContext, true);
|
|
53
53
|
}
|
|
54
|
-
exports.EnsureRequestContext = EnsureRequestContext;
|
package/decorators/Embeddable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Embeddable =
|
|
3
|
+
exports.Embeddable = Embeddable;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
function Embeddable(options = {}) {
|
|
6
6
|
return function (target) {
|
|
@@ -12,4 +12,3 @@ function Embeddable(options = {}) {
|
|
|
12
12
|
return target;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
exports.Embeddable = Embeddable;
|
package/decorators/Embedded.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Embedded =
|
|
3
|
+
exports.Embedded = Embedded;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const enums_1 = require("../enums");
|
|
@@ -18,4 +18,3 @@ function Embedded(type = {}, options = {}) {
|
|
|
18
18
|
return utils_1.Utils.propertyDecoratorReturnValue();
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
exports.Embedded = Embedded;
|
package/decorators/Entity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Entity =
|
|
3
|
+
exports.Entity = Entity;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
function Entity(options = {}) {
|
|
@@ -14,4 +14,3 @@ function Entity(options = {}) {
|
|
|
14
14
|
return target;
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
exports.Entity = Entity;
|
package/decorators/Enum.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Enum =
|
|
3
|
+
exports.Enum = Enum;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
const Utils_1 = require("../utils/Utils");
|
|
@@ -17,4 +17,3 @@ function Enum(options = {}) {
|
|
|
17
17
|
return Utils_1.Utils.propertyDecoratorReturnValue();
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.Enum = Enum;
|
package/decorators/Filter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Filter =
|
|
3
|
+
exports.Filter = Filter;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
function Filter(options) {
|
|
6
6
|
return function (target) {
|
|
@@ -9,4 +9,3 @@ function Filter(options) {
|
|
|
9
9
|
return target;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
exports.Filter = Filter;
|
package/decorators/Formula.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Formula =
|
|
3
|
+
exports.Formula = Formula;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
const Utils_1 = require("../utils/Utils");
|
|
@@ -16,4 +16,3 @@ function Formula(formula, options = {}) {
|
|
|
16
16
|
return Utils_1.Utils.propertyDecoratorReturnValue();
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
exports.Formula = Formula;
|
package/decorators/Indexed.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Dictionary } from '../typings';
|
|
1
|
+
import type { AnyEntity, Dictionary } from '../typings';
|
|
2
2
|
import type { DeferMode } from '../enums';
|
|
3
|
-
export declare function Index<T>(options?: IndexOptions<T>): (target:
|
|
4
|
-
export declare function Unique<T>(options?: UniqueOptions<T>): (target:
|
|
3
|
+
export declare function Index<T>(options?: IndexOptions<T>): (target: AnyEntity, propertyName?: string) => any;
|
|
4
|
+
export declare function Unique<T>(options?: UniqueOptions<T>): (target: AnyEntity, propertyName?: string) => any;
|
|
5
5
|
interface BaseOptions<T> {
|
|
6
6
|
name?: string;
|
|
7
7
|
properties?: keyof T | (keyof T)[];
|
package/decorators/Indexed.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Index = Index;
|
|
4
|
+
exports.Unique = Unique;
|
|
4
5
|
const metadata_1 = require("../metadata");
|
|
5
6
|
const Utils_1 = require("../utils/Utils");
|
|
6
7
|
function createDecorator(options, unique) {
|
|
@@ -18,8 +19,6 @@ function createDecorator(options, unique) {
|
|
|
18
19
|
function Index(options = {}) {
|
|
19
20
|
return createDecorator(options, false);
|
|
20
21
|
}
|
|
21
|
-
exports.Index = Index;
|
|
22
22
|
function Unique(options = {}) {
|
|
23
23
|
return createDecorator(options, true);
|
|
24
24
|
}
|
|
25
|
-
exports.Unique = Unique;
|
package/decorators/ManyToMany.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ManyToMany =
|
|
3
|
+
exports.ManyToMany = ManyToMany;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const enums_1 = require("../enums");
|
|
@@ -14,4 +14,3 @@ function ManyToMany(entity, mappedBy, options = {}) {
|
|
|
14
14
|
return utils_1.Utils.propertyDecoratorReturnValue();
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
exports.ManyToMany = ManyToMany;
|
package/decorators/ManyToOne.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ManyToOne =
|
|
3
|
+
exports.ManyToOne = ManyToOne;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const enums_1 = require("../enums");
|
|
@@ -14,4 +14,3 @@ function ManyToOne(entity = {}, options = {}) {
|
|
|
14
14
|
return utils_1.Utils.propertyDecoratorReturnValue();
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
exports.ManyToOne = ManyToOne;
|
package/decorators/OneToMany.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createOneToDecorator = createOneToDecorator;
|
|
4
|
+
exports.OneToMany = OneToMany;
|
|
4
5
|
const metadata_1 = require("../metadata");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
const enums_1 = require("../enums");
|
|
@@ -14,8 +15,6 @@ function createOneToDecorator(entity, mappedBy, options, kind) {
|
|
|
14
15
|
return utils_1.Utils.propertyDecoratorReturnValue();
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
|
-
exports.createOneToDecorator = createOneToDecorator;
|
|
18
18
|
function OneToMany(entity, mappedBy, options = {}) {
|
|
19
19
|
return createOneToDecorator(entity, mappedBy, options, enums_1.ReferenceKind.ONE_TO_MANY);
|
|
20
20
|
}
|
|
21
|
-
exports.OneToMany = OneToMany;
|
package/decorators/OneToOne.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DeferMode } from '../enums';
|
|
2
2
|
import { type OneToManyOptions } from './OneToMany';
|
|
3
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:
|
|
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;
|
|
5
5
|
export interface OneToOneOptions<Owner, Target> extends Partial<Omit<OneToManyOptions<Owner, Target>, 'orderBy'>> {
|
|
6
6
|
owner?: boolean;
|
|
7
7
|
inversedBy?: (string & keyof Target) | ((e: Target) => any);
|
package/decorators/OneToOne.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OneToOne =
|
|
3
|
+
exports.OneToOne = OneToOne;
|
|
4
4
|
const enums_1 = require("../enums");
|
|
5
5
|
const OneToMany_1 = require("./OneToMany");
|
|
6
6
|
function OneToOne(entity, mappedByOrOptions, options = {}) {
|
|
@@ -8,4 +8,3 @@ function OneToOne(entity, mappedByOrOptions, options = {}) {
|
|
|
8
8
|
options = typeof mappedByOrOptions === 'object' ? { ...mappedByOrOptions, ...options } : options;
|
|
9
9
|
return (0, OneToMany_1.createOneToDecorator)(entity, mappedBy, options, enums_1.ReferenceKind.ONE_TO_ONE);
|
|
10
10
|
}
|
|
11
|
-
exports.OneToOne = OneToOne;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PropertyOptions } from './Property';
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
2
|
+
import type { AnyEntity } from '../typings';
|
|
3
|
+
export declare function PrimaryKey<T extends object>(options?: PrimaryKeyOptions<T>): (target: AnyEntity, propertyName: string) => any;
|
|
4
|
+
export declare function SerializedPrimaryKey<T extends object>(options?: SerializedPrimaryKeyOptions<T>): (target: AnyEntity, propertyName: string) => any;
|
|
4
5
|
export interface PrimaryKeyOptions<T> extends PropertyOptions<T> {
|
|
5
6
|
}
|
|
6
7
|
export interface SerializedPrimaryKeyOptions<T> extends PropertyOptions<T> {
|
package/decorators/PrimaryKey.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PrimaryKey = PrimaryKey;
|
|
4
|
+
exports.SerializedPrimaryKey = SerializedPrimaryKey;
|
|
4
5
|
const metadata_1 = require("../metadata");
|
|
5
6
|
const enums_1 = require("../enums");
|
|
6
7
|
const Utils_1 = require("../utils/Utils");
|
|
@@ -17,8 +18,6 @@ function createDecorator(options, serialized) {
|
|
|
17
18
|
function PrimaryKey(options = {}) {
|
|
18
19
|
return createDecorator(options, false);
|
|
19
20
|
}
|
|
20
|
-
exports.PrimaryKey = PrimaryKey;
|
|
21
21
|
function SerializedPrimaryKey(options = {}) {
|
|
22
22
|
return createDecorator(options, true);
|
|
23
23
|
}
|
|
24
|
-
exports.SerializedPrimaryKey = SerializedPrimaryKey;
|
package/decorators/Property.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Property =
|
|
3
|
+
exports.Property = Property;
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const enums_1 = require("../enums");
|
|
@@ -32,4 +32,3 @@ function Property(options = {}) {
|
|
|
32
32
|
return utils_1.Utils.propertyDecoratorReturnValue();
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
exports.Property = Property;
|
package/decorators/hooks.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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;
|
|
4
13
|
const metadata_1 = require("../metadata");
|
|
5
14
|
const enums_1 = require("../enums");
|
|
6
15
|
function hook(type) {
|
|
@@ -15,46 +24,36 @@ function hook(type) {
|
|
|
15
24
|
function BeforeCreate() {
|
|
16
25
|
return hook(enums_1.EventType.beforeCreate);
|
|
17
26
|
}
|
|
18
|
-
exports.BeforeCreate = BeforeCreate;
|
|
19
27
|
function AfterCreate() {
|
|
20
28
|
return hook(enums_1.EventType.afterCreate);
|
|
21
29
|
}
|
|
22
|
-
exports.AfterCreate = AfterCreate;
|
|
23
30
|
function BeforeUpdate() {
|
|
24
31
|
return hook(enums_1.EventType.beforeUpdate);
|
|
25
32
|
}
|
|
26
|
-
exports.BeforeUpdate = BeforeUpdate;
|
|
27
33
|
function AfterUpdate() {
|
|
28
34
|
return hook(enums_1.EventType.afterUpdate);
|
|
29
35
|
}
|
|
30
|
-
exports.AfterUpdate = AfterUpdate;
|
|
31
36
|
function BeforeUpsert() {
|
|
32
37
|
return hook(enums_1.EventType.beforeUpsert);
|
|
33
38
|
}
|
|
34
|
-
exports.BeforeUpsert = BeforeUpsert;
|
|
35
39
|
function AfterUpsert() {
|
|
36
40
|
return hook(enums_1.EventType.afterUpsert);
|
|
37
41
|
}
|
|
38
|
-
exports.AfterUpsert = AfterUpsert;
|
|
39
42
|
function OnInit() {
|
|
40
43
|
return hook(enums_1.EventType.onInit);
|
|
41
44
|
}
|
|
42
|
-
exports.OnInit = OnInit;
|
|
43
45
|
function OnLoad() {
|
|
44
46
|
return hook(enums_1.EventType.onLoad);
|
|
45
47
|
}
|
|
46
|
-
exports.OnLoad = OnLoad;
|
|
47
48
|
/**
|
|
48
49
|
* Called before deleting entity, but only when providing initialized entity to EM#remove()
|
|
49
50
|
*/
|
|
50
51
|
function BeforeDelete() {
|
|
51
52
|
return hook(enums_1.EventType.beforeDelete);
|
|
52
53
|
}
|
|
53
|
-
exports.BeforeDelete = BeforeDelete;
|
|
54
54
|
/**
|
|
55
55
|
* Called after deleting entity, but only when providing initialized entity to EM#remove()
|
|
56
56
|
*/
|
|
57
57
|
function AfterDelete() {
|
|
58
58
|
return hook(enums_1.EventType.afterDelete);
|
|
59
59
|
}
|
|
60
|
-
exports.AfterDelete = AfterDelete;
|
|
@@ -4,7 +4,7 @@ import type { IPrimaryKey } from '../typings';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class EntityIdentifier {
|
|
6
6
|
private value?;
|
|
7
|
-
constructor(value?:
|
|
7
|
+
constructor(value?: IPrimaryKey | undefined);
|
|
8
8
|
setValue(value: IPrimaryKey): void;
|
|
9
9
|
getValue<T extends IPrimaryKey = IPrimaryKey>(): T;
|
|
10
10
|
}
|
package/entity/Reference.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { inspect } from 'util';
|
|
3
2
|
import type { AddEager, Dictionary, EntityClass, EntityKey, EntityProperty, Loaded, LoadedReference, Primary, Ref } from '../typings';
|
|
4
3
|
import type { FindOneOptions, FindOneOrFailOptions } from '../drivers/IDatabaseDriver';
|
package/entity/Reference.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Ref = exports.
|
|
3
|
+
exports.Ref = exports.ScalarReference = exports.Reference = void 0;
|
|
4
|
+
exports.ref = ref;
|
|
5
|
+
exports.rel = rel;
|
|
4
6
|
const util_1 = require("util");
|
|
5
7
|
const enums_1 = require("../enums");
|
|
6
8
|
const wrap_1 = require("./wrap");
|
|
@@ -232,7 +234,6 @@ function ref(entityOrType, pk) {
|
|
|
232
234
|
}
|
|
233
235
|
return Reference.createFromPK(entityOrType, pk);
|
|
234
236
|
}
|
|
235
|
-
exports.ref = ref;
|
|
236
237
|
/**
|
|
237
238
|
* shortcut for `Reference.createNakedFromPK(entityType, pk)`
|
|
238
239
|
*/
|
|
@@ -242,4 +243,3 @@ function rel(entityType, pk) {
|
|
|
242
243
|
}
|
|
243
244
|
return Reference.createNakedFromPK(entityType, pk);
|
|
244
245
|
}
|
|
245
|
-
exports.rel = rel;
|
package/entity/wrap.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.wrap = wrap;
|
|
4
|
+
exports.helper = helper;
|
|
4
5
|
/**
|
|
5
6
|
* wraps entity type with WrappedEntity internal properties and helpers like init/isInitialized/populated/toJSON
|
|
6
7
|
* use `preferHelper = true` to have access to the internal `__` properties like `__meta` or `__em`
|
|
@@ -14,7 +15,6 @@ function wrap(entity, preferHelper = false) {
|
|
|
14
15
|
}
|
|
15
16
|
return entity.__helper ?? entity;
|
|
16
17
|
}
|
|
17
|
-
exports.wrap = wrap;
|
|
18
18
|
/**
|
|
19
19
|
* wraps entity type with WrappedEntity internal properties and helpers like init/isInitialized/populated/toJSON
|
|
20
20
|
* use `preferHelper = true` to have access to the internal `__` properties like `__meta` or `__em`
|
|
@@ -23,4 +23,3 @@ exports.wrap = wrap;
|
|
|
23
23
|
function helper(entity) {
|
|
24
24
|
return entity.__helper;
|
|
25
25
|
}
|
|
26
|
-
exports.helper = helper;
|
|
@@ -6,11 +6,11 @@ export declare class TransactionEventBroadcaster {
|
|
|
6
6
|
private readonly em;
|
|
7
7
|
private readonly uow?;
|
|
8
8
|
readonly context?: {
|
|
9
|
-
topLevelTransaction?: boolean
|
|
9
|
+
topLevelTransaction?: boolean;
|
|
10
10
|
} | undefined;
|
|
11
11
|
private readonly eventManager;
|
|
12
12
|
constructor(em: EntityManager, uow?: UnitOfWork | undefined, context?: {
|
|
13
|
-
topLevelTransaction?: boolean
|
|
13
|
+
topLevelTransaction?: boolean;
|
|
14
14
|
} | undefined);
|
|
15
15
|
dispatchEvent(event: TransactionEventType, transaction?: Transaction): Promise<void>;
|
|
16
16
|
isTopLevel(): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "6.2.10-dev.
|
|
3
|
+
"version": "6.2.10-dev.59",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"esprima": "4.0.1",
|
|
65
65
|
"fs-extra": "11.2.0",
|
|
66
66
|
"globby": "11.1.0",
|
|
67
|
-
"mikro-orm": "6.2.10-dev.
|
|
67
|
+
"mikro-orm": "6.2.10-dev.59",
|
|
68
68
|
"reflect-metadata": "0.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.EntitySerializer = void 0;
|
|
4
|
+
exports.serialize = serialize;
|
|
4
5
|
const wrap_1 = require("../entity/wrap");
|
|
5
6
|
const Utils_1 = require("../utils/Utils");
|
|
6
7
|
const enums_1 = require("../enums");
|
|
@@ -210,4 +211,3 @@ function serialize(entities, options) {
|
|
|
210
211
|
}
|
|
211
212
|
return EntitySerializer.serialize(entities, options);
|
|
212
213
|
}
|
|
213
|
-
exports.serialize = serialize;
|
package/types/BigIntType.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import type { EntityProperty } from '../typings';
|
|
|
6
6
|
* or numbers (safe only for values up to `Number.MAX_SAFE_INTEGER`), or strings, depending on the `mode`.
|
|
7
7
|
*/
|
|
8
8
|
export declare class BigIntType extends Type<string | bigint | number | null | undefined, string | null | undefined> {
|
|
9
|
-
mode?: "
|
|
10
|
-
constructor(mode?: "
|
|
9
|
+
mode?: ("bigint" | "number" | "string") | undefined;
|
|
10
|
+
constructor(mode?: ("bigint" | "number" | "string") | undefined);
|
|
11
11
|
convertToDatabaseValue(value: string | bigint | null | undefined): string | null | undefined;
|
|
12
12
|
convertToJSValue(value: string | bigint | null | undefined): bigint | number | string | null | undefined;
|
|
13
13
|
toJSON(value: string | bigint | null | undefined): string | bigint | null | undefined;
|
package/types/BlobType.d.ts
CHANGED
package/types/DecimalType.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import type { EntityProperty } from '../typings';
|
|
|
5
5
|
* Type that maps an SQL DECIMAL to a JS string or number.
|
|
6
6
|
*/
|
|
7
7
|
export declare class DecimalType extends Type<string | number, string> {
|
|
8
|
-
mode?: "
|
|
9
|
-
constructor(mode?: "
|
|
8
|
+
mode?: ("number" | "string") | undefined;
|
|
9
|
+
constructor(mode?: ("number" | "string") | undefined);
|
|
10
10
|
convertToJSValue(value: string): number | string;
|
|
11
11
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
12
12
|
compareAsType(): string;
|
package/types/Type.d.ts
CHANGED
package/utils/Configuration.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Configuration = void 0;
|
|
4
|
+
exports.defineConfig = defineConfig;
|
|
4
5
|
const fs_extra_1 = require("fs-extra");
|
|
5
6
|
const cache_1 = require("../cache");
|
|
6
7
|
const hydration_1 = require("../hydration");
|
|
@@ -373,4 +374,3 @@ exports.Configuration = Configuration;
|
|
|
373
374
|
function defineConfig(options) {
|
|
374
375
|
return options;
|
|
375
376
|
}
|
|
376
|
-
exports.defineConfig = defineConfig;
|
package/utils/Cursor.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { inspect } from 'util';
|
|
3
2
|
import type { AnyString, Dictionary, EntityKey } from '../typings';
|
|
4
3
|
export declare class RawQueryFragment {
|
|
@@ -89,7 +88,7 @@ export declare function raw<T extends object = any, R = any>(sql: EntityKey<T> |
|
|
|
89
88
|
export declare function sql(sql: readonly string[], ...values: unknown[]): any;
|
|
90
89
|
export declare namespace sql {
|
|
91
90
|
var ref: <T extends object>(...keys: string[]) => RawQueryFragment;
|
|
92
|
-
var now: (length?: number
|
|
91
|
+
var now: (length?: number) => string;
|
|
93
92
|
var lower: <T extends object>(key: string | ((alias: string) => string)) => string;
|
|
94
93
|
var upper: <T extends object>(key: string | ((alias: string) => string)) => string;
|
|
95
94
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ALIAS_REPLACEMENT_RE = exports.ALIAS_REPLACEMENT = exports.RawQueryFragment = void 0;
|
|
4
|
+
exports.raw = raw;
|
|
5
|
+
exports.sql = sql;
|
|
6
|
+
exports.createSqlFunction = createSqlFunction;
|
|
4
7
|
const util_1 = require("util");
|
|
5
8
|
const Utils_1 = require("./Utils");
|
|
6
9
|
class RawQueryFragment {
|
|
@@ -152,7 +155,6 @@ function raw(sql, params) {
|
|
|
152
155
|
}
|
|
153
156
|
return new RawQueryFragment(sql, params);
|
|
154
157
|
}
|
|
155
|
-
exports.raw = raw;
|
|
156
158
|
/**
|
|
157
159
|
* Alternative to the `raw()` helper allowing to use it as a tagged template function for the simple cases.
|
|
158
160
|
*
|
|
@@ -174,14 +176,12 @@ function sql(sql, ...values) {
|
|
|
174
176
|
return valueExists ? text + '?' : text;
|
|
175
177
|
}, ''), values);
|
|
176
178
|
}
|
|
177
|
-
exports.sql = sql;
|
|
178
179
|
function createSqlFunction(func, key) {
|
|
179
180
|
if (typeof key === 'string') {
|
|
180
181
|
return raw(`${func}(${key})`);
|
|
181
182
|
}
|
|
182
183
|
return raw(a => `${func}(${(key(a))})`);
|
|
183
184
|
}
|
|
184
|
-
exports.createSqlFunction = createSqlFunction;
|
|
185
185
|
sql.ref = (...keys) => raw('??', [keys.join('.')]);
|
|
186
186
|
sql.now = (length) => raw('current_timestamp' + (length == null ? '' : `(${length})`));
|
|
187
187
|
sql.lower = (key) => createSqlFunction('lower', key);
|
package/utils/Utils.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { type GlobbyOptions } from 'globby';
|
|
4
2
|
import { type URL } from 'url';
|
|
5
3
|
import type { Dictionary, EntityData, EntityDictionary, EntityKey, EntityMetadata, EntityName, EntityProperty, IMetadataStorage, Primary } from '../typings';
|
package/utils/Utils.js
CHANGED
|
@@ -3,7 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Utils = exports.
|
|
6
|
+
exports.Utils = exports.ObjectBindingPattern = void 0;
|
|
7
|
+
exports.compareObjects = compareObjects;
|
|
8
|
+
exports.compareArrays = compareArrays;
|
|
9
|
+
exports.compareBooleans = compareBooleans;
|
|
10
|
+
exports.compareBuffers = compareBuffers;
|
|
11
|
+
exports.equals = equals;
|
|
12
|
+
exports.parseJsonSafe = parseJsonSafe;
|
|
7
13
|
const module_1 = require("module");
|
|
8
14
|
const globby_1 = __importDefault(require("globby"));
|
|
9
15
|
const path_1 = require("path");
|
|
@@ -67,7 +73,6 @@ function compareObjects(a, b) {
|
|
|
67
73
|
}
|
|
68
74
|
return true;
|
|
69
75
|
}
|
|
70
|
-
exports.compareObjects = compareObjects;
|
|
71
76
|
function compareArrays(a, b) {
|
|
72
77
|
const length = a.length;
|
|
73
78
|
if (length !== b.length) {
|
|
@@ -81,13 +86,11 @@ function compareArrays(a, b) {
|
|
|
81
86
|
}
|
|
82
87
|
return true;
|
|
83
88
|
}
|
|
84
|
-
exports.compareArrays = compareArrays;
|
|
85
89
|
function compareBooleans(a, b) {
|
|
86
90
|
a = typeof a === 'number' ? Boolean(a) : a;
|
|
87
91
|
b = typeof b === 'number' ? Boolean(b) : b;
|
|
88
92
|
return a === b;
|
|
89
93
|
}
|
|
90
|
-
exports.compareBooleans = compareBooleans;
|
|
91
94
|
function compareBuffers(a, b) {
|
|
92
95
|
const length = a.length;
|
|
93
96
|
if (length !== b.length) {
|
|
@@ -100,7 +103,6 @@ function compareBuffers(a, b) {
|
|
|
100
103
|
}
|
|
101
104
|
return true;
|
|
102
105
|
}
|
|
103
|
-
exports.compareBuffers = compareBuffers;
|
|
104
106
|
/**
|
|
105
107
|
* Checks if arguments are deeply (but not strictly) equal.
|
|
106
108
|
*/
|
|
@@ -119,7 +121,6 @@ function equals(a, b) {
|
|
|
119
121
|
}
|
|
120
122
|
return Number.isNaN(a) && Number.isNaN(b);
|
|
121
123
|
}
|
|
122
|
-
exports.equals = equals;
|
|
123
124
|
const equalsFn = equals;
|
|
124
125
|
function parseJsonSafe(value) {
|
|
125
126
|
if (typeof value === 'string') {
|
|
@@ -133,7 +134,6 @@ function parseJsonSafe(value) {
|
|
|
133
134
|
}
|
|
134
135
|
return value;
|
|
135
136
|
}
|
|
136
|
-
exports.parseJsonSafe = parseJsonSafe;
|
|
137
137
|
class Utils {
|
|
138
138
|
static PK_SEPARATOR = '~~~';
|
|
139
139
|
/* istanbul ignore next */
|
package/utils/clone.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.clone =
|
|
8
|
+
exports.clone = clone;
|
|
9
9
|
const events_1 = require("events");
|
|
10
10
|
const RawQueryFragment_1 = require("./RawQueryFragment");
|
|
11
11
|
function clone(parent, respectCustomCloneMethod = true) {
|
|
@@ -124,4 +124,3 @@ function clone(parent, respectCustomCloneMethod = true) {
|
|
|
124
124
|
}
|
|
125
125
|
return _clone(parent);
|
|
126
126
|
}
|
|
127
|
-
exports.clone = clone;
|
package/utils/upsert-utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getOnConflictFields = getOnConflictFields;
|
|
4
|
+
exports.getOnConflictReturningFields = getOnConflictReturningFields;
|
|
4
5
|
/** @internal */
|
|
5
6
|
function getOnConflictFields(meta, data, uniqueFields, options) {
|
|
6
7
|
if (options.onConflictMergeFields) {
|
|
@@ -14,7 +15,6 @@ function getOnConflictFields(meta, data, uniqueFields, options) {
|
|
|
14
15
|
}
|
|
15
16
|
return keys;
|
|
16
17
|
}
|
|
17
|
-
exports.getOnConflictFields = getOnConflictFields;
|
|
18
18
|
/** @internal */
|
|
19
19
|
function getOnConflictReturningFields(meta, data, uniqueFields, options) {
|
|
20
20
|
if (!meta) {
|
|
@@ -35,4 +35,3 @@ function getOnConflictReturningFields(meta, data, uniqueFields, options) {
|
|
|
35
35
|
}
|
|
36
36
|
return keys.filter(key => !(key in data));
|
|
37
37
|
}
|
|
38
|
-
exports.getOnConflictReturningFields = getOnConflictReturningFields;
|