@mikro-orm/core 7.0.0-dev.0 → 7.0.0-dev.2
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 +202 -202
- 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 +9 -13
- 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/entity/wrap.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wrap = wrap;
|
|
4
|
-
exports.helper = helper;
|
|
5
1
|
/**
|
|
6
2
|
* wraps entity type with WrappedEntity internal properties and helpers like init/isInitialized/populated/toJSON
|
|
7
3
|
* use `preferHelper = true` to have access to the internal `__` properties like `__meta` or `__em`
|
|
8
4
|
*/
|
|
9
|
-
function wrap(entity, preferHelper = false) {
|
|
5
|
+
export function wrap(entity, preferHelper = false) {
|
|
10
6
|
if (!entity) {
|
|
11
7
|
return entity;
|
|
12
8
|
}
|
|
@@ -20,6 +16,6 @@ function wrap(entity, preferHelper = false) {
|
|
|
20
16
|
* use `preferHelper = true` to have access to the internal `__` properties like `__meta` or `__em`
|
|
21
17
|
* @internal
|
|
22
18
|
*/
|
|
23
|
-
function helper(entity) {
|
|
19
|
+
export function helper(entity) {
|
|
24
20
|
return entity.__helper;
|
|
25
21
|
}
|
package/enums.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Dictionary, EntityKey, ExpandProperty } from './typings';
|
|
2
|
-
import type { Transaction } from './connections';
|
|
3
|
-
import type { LogContext } from './logging';
|
|
1
|
+
import type { Dictionary, EntityKey, ExpandProperty } from './typings.js';
|
|
2
|
+
import type { Transaction } from './connections/Connection.js';
|
|
3
|
+
import type { LogContext } from './logging/Logger.js';
|
|
4
4
|
export declare enum FlushMode {
|
|
5
5
|
/** The `EntityManager` delays the flush until the current Transaction is committed. */
|
|
6
6
|
COMMIT = "commit",
|
package/enums.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeferMode = exports.PlainObject = exports.EventTypeMap = exports.EventType = exports.IsolationLevel = exports.LockMode = exports.DataloaderType = exports.LoadStrategy = exports.Cascade = exports.ReferenceKind = exports.SCALAR_TYPES = exports.QueryFlag = exports.QueryOrderNumeric = exports.QueryOrder = exports.JSON_KEY_OPERATORS = exports.ARRAY_OPERATORS = exports.QueryOperator = exports.GroupOperator = exports.PopulatePath = exports.PopulateHint = exports.FlushMode = void 0;
|
|
4
|
-
var FlushMode;
|
|
1
|
+
export var FlushMode;
|
|
5
2
|
(function (FlushMode) {
|
|
6
3
|
/** The `EntityManager` delays the flush until the current Transaction is committed. */
|
|
7
4
|
FlushMode["COMMIT"] = "commit";
|
|
@@ -9,23 +6,23 @@ var FlushMode;
|
|
|
9
6
|
FlushMode["AUTO"] = "auto";
|
|
10
7
|
/** Flushes the `EntityManager` before every query. */
|
|
11
8
|
FlushMode["ALWAYS"] = "always";
|
|
12
|
-
})(FlushMode || (
|
|
13
|
-
var PopulateHint;
|
|
9
|
+
})(FlushMode || (FlushMode = {}));
|
|
10
|
+
export var PopulateHint;
|
|
14
11
|
(function (PopulateHint) {
|
|
15
12
|
PopulateHint["INFER"] = "infer";
|
|
16
13
|
PopulateHint["ALL"] = "all";
|
|
17
|
-
})(PopulateHint || (
|
|
18
|
-
var PopulatePath;
|
|
14
|
+
})(PopulateHint || (PopulateHint = {}));
|
|
15
|
+
export var PopulatePath;
|
|
19
16
|
(function (PopulatePath) {
|
|
20
17
|
PopulatePath["INFER"] = "$infer";
|
|
21
18
|
PopulatePath["ALL"] = "*";
|
|
22
|
-
})(PopulatePath || (
|
|
23
|
-
var GroupOperator;
|
|
19
|
+
})(PopulatePath || (PopulatePath = {}));
|
|
20
|
+
export var GroupOperator;
|
|
24
21
|
(function (GroupOperator) {
|
|
25
22
|
GroupOperator["$and"] = "and";
|
|
26
23
|
GroupOperator["$or"] = "or";
|
|
27
|
-
})(GroupOperator || (
|
|
28
|
-
var QueryOperator;
|
|
24
|
+
})(GroupOperator || (GroupOperator = {}));
|
|
25
|
+
export var QueryOperator;
|
|
29
26
|
(function (QueryOperator) {
|
|
30
27
|
QueryOperator["$eq"] = "=";
|
|
31
28
|
QueryOperator["$in"] = "in";
|
|
@@ -50,8 +47,8 @@ var QueryOperator;
|
|
|
50
47
|
QueryOperator["$hasKey"] = "?";
|
|
51
48
|
QueryOperator["$hasKeys"] = "?&";
|
|
52
49
|
QueryOperator["$hasSomeKeys"] = "?|";
|
|
53
|
-
})(QueryOperator || (
|
|
54
|
-
|
|
50
|
+
})(QueryOperator || (QueryOperator = {}));
|
|
51
|
+
export const ARRAY_OPERATORS = [
|
|
55
52
|
'$eq',
|
|
56
53
|
'$gt',
|
|
57
54
|
'$gte',
|
|
@@ -62,12 +59,12 @@ exports.ARRAY_OPERATORS = [
|
|
|
62
59
|
'$contains',
|
|
63
60
|
'$contained',
|
|
64
61
|
];
|
|
65
|
-
|
|
62
|
+
export const JSON_KEY_OPERATORS = [
|
|
66
63
|
'$hasKey',
|
|
67
64
|
'$hasKeys',
|
|
68
65
|
'$hasSomeKeys',
|
|
69
66
|
];
|
|
70
|
-
var QueryOrder;
|
|
67
|
+
export var QueryOrder;
|
|
71
68
|
(function (QueryOrder) {
|
|
72
69
|
QueryOrder["ASC"] = "ASC";
|
|
73
70
|
QueryOrder["ASC_NULLS_LAST"] = "ASC NULLS LAST";
|
|
@@ -81,13 +78,13 @@ var QueryOrder;
|
|
|
81
78
|
QueryOrder["desc"] = "desc";
|
|
82
79
|
QueryOrder["desc_nulls_last"] = "desc nulls last";
|
|
83
80
|
QueryOrder["desc_nulls_first"] = "desc nulls first";
|
|
84
|
-
})(QueryOrder || (
|
|
85
|
-
var QueryOrderNumeric;
|
|
81
|
+
})(QueryOrder || (QueryOrder = {}));
|
|
82
|
+
export var QueryOrderNumeric;
|
|
86
83
|
(function (QueryOrderNumeric) {
|
|
87
84
|
QueryOrderNumeric[QueryOrderNumeric["ASC"] = 1] = "ASC";
|
|
88
85
|
QueryOrderNumeric[QueryOrderNumeric["DESC"] = -1] = "DESC";
|
|
89
|
-
})(QueryOrderNumeric || (
|
|
90
|
-
var QueryFlag;
|
|
86
|
+
})(QueryOrderNumeric || (QueryOrderNumeric = {}));
|
|
87
|
+
export var QueryFlag;
|
|
91
88
|
(function (QueryFlag) {
|
|
92
89
|
QueryFlag["DISTINCT"] = "DISTINCT";
|
|
93
90
|
QueryFlag["PAGINATE"] = "PAGINATE";
|
|
@@ -99,9 +96,9 @@ var QueryFlag;
|
|
|
99
96
|
QueryFlag["AUTO_JOIN_ONE_TO_ONE_OWNER"] = "AUTO_JOIN_ONE_TO_ONE_OWNER";
|
|
100
97
|
QueryFlag["INFER_POPULATE"] = "INFER_POPULATE";
|
|
101
98
|
QueryFlag["IDENTITY_INSERT"] = "IDENTITY_INSERT";
|
|
102
|
-
})(QueryFlag || (
|
|
103
|
-
|
|
104
|
-
var ReferenceKind;
|
|
99
|
+
})(QueryFlag || (QueryFlag = {}));
|
|
100
|
+
export const SCALAR_TYPES = ['string', 'number', 'boolean', 'bigint', 'Date', 'Buffer', 'RegExp'];
|
|
101
|
+
export var ReferenceKind;
|
|
105
102
|
(function (ReferenceKind) {
|
|
106
103
|
ReferenceKind["SCALAR"] = "scalar";
|
|
107
104
|
ReferenceKind["ONE_TO_ONE"] = "1:1";
|
|
@@ -109,8 +106,8 @@ var ReferenceKind;
|
|
|
109
106
|
ReferenceKind["MANY_TO_ONE"] = "m:1";
|
|
110
107
|
ReferenceKind["MANY_TO_MANY"] = "m:n";
|
|
111
108
|
ReferenceKind["EMBEDDED"] = "embedded";
|
|
112
|
-
})(ReferenceKind || (
|
|
113
|
-
var Cascade;
|
|
109
|
+
})(ReferenceKind || (ReferenceKind = {}));
|
|
110
|
+
export var Cascade;
|
|
114
111
|
(function (Cascade) {
|
|
115
112
|
Cascade["PERSIST"] = "persist";
|
|
116
113
|
Cascade["MERGE"] = "merge";
|
|
@@ -120,20 +117,20 @@ var Cascade;
|
|
|
120
117
|
Cascade["SCHEDULE_ORPHAN_REMOVAL"] = "schedule_orphan_removal";
|
|
121
118
|
/** @internal */
|
|
122
119
|
Cascade["CANCEL_ORPHAN_REMOVAL"] = "cancel_orphan_removal";
|
|
123
|
-
})(Cascade || (
|
|
124
|
-
var LoadStrategy;
|
|
120
|
+
})(Cascade || (Cascade = {}));
|
|
121
|
+
export var LoadStrategy;
|
|
125
122
|
(function (LoadStrategy) {
|
|
126
123
|
LoadStrategy["SELECT_IN"] = "select-in";
|
|
127
124
|
LoadStrategy["JOINED"] = "joined";
|
|
128
|
-
})(LoadStrategy || (
|
|
129
|
-
var DataloaderType;
|
|
125
|
+
})(LoadStrategy || (LoadStrategy = {}));
|
|
126
|
+
export var DataloaderType;
|
|
130
127
|
(function (DataloaderType) {
|
|
131
128
|
DataloaderType[DataloaderType["NONE"] = 0] = "NONE";
|
|
132
129
|
DataloaderType[DataloaderType["REFERENCE"] = 1] = "REFERENCE";
|
|
133
130
|
DataloaderType[DataloaderType["COLLECTION"] = 2] = "COLLECTION";
|
|
134
131
|
DataloaderType[DataloaderType["ALL"] = 3] = "ALL";
|
|
135
|
-
})(DataloaderType || (
|
|
136
|
-
var LockMode;
|
|
132
|
+
})(DataloaderType || (DataloaderType = {}));
|
|
133
|
+
export var LockMode;
|
|
137
134
|
(function (LockMode) {
|
|
138
135
|
LockMode[LockMode["NONE"] = 0] = "NONE";
|
|
139
136
|
LockMode[LockMode["OPTIMISTIC"] = 1] = "OPTIMISTIC";
|
|
@@ -143,16 +140,16 @@ var LockMode;
|
|
|
143
140
|
LockMode[LockMode["PESSIMISTIC_WRITE_OR_FAIL"] = 5] = "PESSIMISTIC_WRITE_OR_FAIL";
|
|
144
141
|
LockMode[LockMode["PESSIMISTIC_PARTIAL_READ"] = 6] = "PESSIMISTIC_PARTIAL_READ";
|
|
145
142
|
LockMode[LockMode["PESSIMISTIC_READ_OR_FAIL"] = 7] = "PESSIMISTIC_READ_OR_FAIL";
|
|
146
|
-
})(LockMode || (
|
|
147
|
-
var IsolationLevel;
|
|
143
|
+
})(LockMode || (LockMode = {}));
|
|
144
|
+
export var IsolationLevel;
|
|
148
145
|
(function (IsolationLevel) {
|
|
149
146
|
IsolationLevel["READ_UNCOMMITTED"] = "read uncommitted";
|
|
150
147
|
IsolationLevel["READ_COMMITTED"] = "read committed";
|
|
151
148
|
IsolationLevel["SNAPSHOT"] = "snapshot";
|
|
152
149
|
IsolationLevel["REPEATABLE_READ"] = "repeatable read";
|
|
153
150
|
IsolationLevel["SERIALIZABLE"] = "serializable";
|
|
154
|
-
})(IsolationLevel || (
|
|
155
|
-
var EventType;
|
|
151
|
+
})(IsolationLevel || (IsolationLevel = {}));
|
|
152
|
+
export var EventType;
|
|
156
153
|
(function (EventType) {
|
|
157
154
|
EventType["onInit"] = "onInit";
|
|
158
155
|
EventType["onLoad"] = "onLoad";
|
|
@@ -173,16 +170,15 @@ var EventType;
|
|
|
173
170
|
EventType["afterTransactionCommit"] = "afterTransactionCommit";
|
|
174
171
|
EventType["beforeTransactionRollback"] = "beforeTransactionRollback";
|
|
175
172
|
EventType["afterTransactionRollback"] = "afterTransactionRollback";
|
|
176
|
-
})(EventType || (
|
|
177
|
-
|
|
173
|
+
})(EventType || (EventType = {}));
|
|
174
|
+
export const EventTypeMap = Object.keys(EventType).reduce((a, b, i) => {
|
|
178
175
|
a[b] = i;
|
|
179
176
|
return a;
|
|
180
177
|
}, {});
|
|
181
|
-
class PlainObject {
|
|
178
|
+
export class PlainObject {
|
|
182
179
|
}
|
|
183
|
-
|
|
184
|
-
var DeferMode;
|
|
180
|
+
export var DeferMode;
|
|
185
181
|
(function (DeferMode) {
|
|
186
182
|
DeferMode["INITIALLY_IMMEDIATE"] = "immediate";
|
|
187
183
|
DeferMode["INITIALLY_DEFERRED"] = "deferred";
|
|
188
|
-
})(DeferMode || (
|
|
184
|
+
})(DeferMode || (DeferMode = {}));
|
package/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyEntity, Constructor, Dictionary, EntityMetadata, EntityProperty, IPrimaryKey } from './typings';
|
|
1
|
+
import type { AnyEntity, Constructor, Dictionary, EntityMetadata, EntityProperty, IPrimaryKey } from './typings.js';
|
|
2
2
|
export declare class ValidationError<T extends AnyEntity = AnyEntity> extends Error {
|
|
3
3
|
readonly entity?: T | undefined;
|
|
4
4
|
constructor(message: string, entity?: T | undefined);
|
package/errors.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.NotFoundError = exports.MetadataError = exports.OptimisticLockError = exports.CursorError = exports.ValidationError = void 0;
|
|
4
|
-
const node_util_1 = require("node:util");
|
|
5
|
-
class ValidationError extends Error {
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
export class ValidationError extends Error {
|
|
6
3
|
entity;
|
|
7
4
|
constructor(message, entity) {
|
|
8
5
|
super(message);
|
|
@@ -19,7 +16,7 @@ class ValidationError extends Error {
|
|
|
19
16
|
}
|
|
20
17
|
static fromWrongPropertyType(entity, property, expectedType, givenType, givenValue) {
|
|
21
18
|
const entityName = entity.constructor.name;
|
|
22
|
-
const msg = `Trying to set ${entityName}.${property} of type '${expectedType}' to ${
|
|
19
|
+
const msg = `Trying to set ${entityName}.${property} of type '${expectedType}' to ${inspect(givenValue)} of type '${givenType}'`;
|
|
23
20
|
return new ValidationError(msg);
|
|
24
21
|
}
|
|
25
22
|
static fromWrongRepositoryType(entityName, repoType, method) {
|
|
@@ -42,13 +39,12 @@ class ValidationError extends Error {
|
|
|
42
39
|
}
|
|
43
40
|
static notEntity(owner, prop, data) {
|
|
44
41
|
const type = Object.prototype.toString.call(data).match(/\[object (\w+)]/)[1].toLowerCase();
|
|
45
|
-
return new ValidationError(`Entity of type ${prop.type} expected for property ${owner.constructor.name}.${prop.name}, ${
|
|
42
|
+
return new ValidationError(`Entity of type ${prop.type} expected for property ${owner.constructor.name}.${prop.name}, ${inspect(data)} of type ${type} given. If you are using Object.assign(entity, data), use em.assign(entity, data) instead.`);
|
|
46
43
|
}
|
|
47
44
|
static notDiscoveredEntity(data, meta, action = 'persist') {
|
|
48
|
-
/*
|
|
45
|
+
/* v8 ignore next */
|
|
49
46
|
const type = meta?.className ?? Object.prototype.toString.call(data).match(/\[object (\w+)]/)[1].toLowerCase();
|
|
50
47
|
let err = `Trying to ${action} not discovered entity of type ${type}.`;
|
|
51
|
-
/* istanbul ignore else */
|
|
52
48
|
if (meta) {
|
|
53
49
|
err += ` Entity with this name was discovered, but not the prototype you are passing to the ORM. If using EntitySchema, be sure to point to the implementation via \`class\`.`;
|
|
54
50
|
}
|
|
@@ -66,7 +62,7 @@ class ValidationError extends Error {
|
|
|
66
62
|
}
|
|
67
63
|
static propertyRequired(entity, property) {
|
|
68
64
|
const entityName = entity.__meta.className;
|
|
69
|
-
return new ValidationError(`Value for ${entityName}.${property.name} is required, '${entity[property.name]}' found\nentity: ${
|
|
65
|
+
return new ValidationError(`Value for ${entityName}.${property.name} is required, '${entity[property.name]}' found\nentity: ${inspect(entity)}`, entity);
|
|
70
66
|
}
|
|
71
67
|
static cannotModifyInverseCollection(owner, property) {
|
|
72
68
|
const inverseCollection = `${owner.constructor.name}.${property.name}`;
|
|
@@ -96,14 +92,13 @@ class ValidationError extends Error {
|
|
|
96
92
|
return new ValidationError('Using global EntityManager instance methods for context specific actions is disallowed. If you need to work with the global instance\'s identity map, use `allowGlobalContext` configuration option or `fork()` instead.');
|
|
97
93
|
}
|
|
98
94
|
static cannotUseOperatorsInsideEmbeddables(className, propName, payload) {
|
|
99
|
-
return new ValidationError(`Using operators inside embeddables is not allowed, move the operator above. (property: ${className}.${propName}, payload: ${
|
|
95
|
+
return new ValidationError(`Using operators inside embeddables is not allowed, move the operator above. (property: ${className}.${propName}, payload: ${inspect(payload)})`);
|
|
100
96
|
}
|
|
101
97
|
static invalidEmbeddableQuery(className, propName, embeddableType) {
|
|
102
98
|
return new ValidationError(`Invalid query for entity '${className}', property '${propName}' does not exist in embeddable '${embeddableType}'`);
|
|
103
99
|
}
|
|
104
100
|
}
|
|
105
|
-
|
|
106
|
-
class CursorError extends ValidationError {
|
|
101
|
+
export class CursorError extends ValidationError {
|
|
107
102
|
static entityNotPopulated(entity, prop) {
|
|
108
103
|
return new CursorError(`Cannot create cursor, value for '${entity.constructor.name}.${prop}' is missing.`);
|
|
109
104
|
}
|
|
@@ -111,8 +106,7 @@ class CursorError extends ValidationError {
|
|
|
111
106
|
return new CursorError(`Invalid cursor condition, value for '${entityName}.${prop}' is missing.`);
|
|
112
107
|
}
|
|
113
108
|
}
|
|
114
|
-
|
|
115
|
-
class OptimisticLockError extends ValidationError {
|
|
109
|
+
export class OptimisticLockError extends ValidationError {
|
|
116
110
|
static notVersioned(meta) {
|
|
117
111
|
return new OptimisticLockError(`Cannot obtain optimistic lock on unversioned entity ${meta.className}`);
|
|
118
112
|
}
|
|
@@ -127,8 +121,7 @@ class OptimisticLockError extends ValidationError {
|
|
|
127
121
|
return new OptimisticLockError(`The optimistic lock failed, version ${expectedLockVersion} was expected, but is actually ${actualLockVersion}`, entity);
|
|
128
122
|
}
|
|
129
123
|
}
|
|
130
|
-
|
|
131
|
-
class MetadataError extends ValidationError {
|
|
124
|
+
export class MetadataError extends ValidationError {
|
|
132
125
|
static fromMissingPrimaryKey(meta) {
|
|
133
126
|
return new MetadataError(`${meta.className} entity is missing @PrimaryKey()`);
|
|
134
127
|
}
|
|
@@ -158,7 +151,7 @@ class MetadataError extends ValidationError {
|
|
|
158
151
|
static fromInversideSidePrimary(meta, owner, prop) {
|
|
159
152
|
return new MetadataError(`${meta.className}.${prop.name} cannot be primary key as it is defined as inverse side. Maybe you should swap the use of 'inversedBy' and 'mappedBy'.`);
|
|
160
153
|
}
|
|
161
|
-
/*
|
|
154
|
+
/* v8 ignore next 3 */
|
|
162
155
|
static entityNotFound(name, path) {
|
|
163
156
|
return new MetadataError(`Entity '${name}' not found in ${path}`);
|
|
164
157
|
}
|
|
@@ -208,7 +201,7 @@ class MetadataError extends ValidationError {
|
|
|
208
201
|
return this.fromMessage(meta, prop, `is non-persistent relation which targets composite primary key. This is not supported and will cause issues, 'persist: false' should be added to the properties representing single columns instead.`);
|
|
209
202
|
}
|
|
210
203
|
static propertyTargetsEntityType(meta, prop, target) {
|
|
211
|
-
/*
|
|
204
|
+
/* v8 ignore next */
|
|
212
205
|
const suggestion = target.embeddable ? 'Embedded' : 'ManyToOne';
|
|
213
206
|
return this.fromMessage(meta, prop, `is defined as scalar @Property(), but its type is a discovered entity ${target.className}. Maybe you want to use @${suggestion}() decorator instead?`);
|
|
214
207
|
}
|
|
@@ -219,13 +212,11 @@ class MetadataError extends ValidationError {
|
|
|
219
212
|
return new MetadataError(`${meta.className}.${prop.name} ${message}`);
|
|
220
213
|
}
|
|
221
214
|
}
|
|
222
|
-
|
|
223
|
-
class NotFoundError extends ValidationError {
|
|
215
|
+
export class NotFoundError extends ValidationError {
|
|
224
216
|
static findOneFailed(name, where) {
|
|
225
|
-
return new NotFoundError(`${name} not found (${
|
|
217
|
+
return new NotFoundError(`${name} not found (${inspect(where)})`);
|
|
226
218
|
}
|
|
227
219
|
static findExactlyOneFailed(name, where) {
|
|
228
|
-
return new NotFoundError(`Wrong number of ${name} entities found for query ${
|
|
220
|
+
return new NotFoundError(`Wrong number of ${name} entities found for query ${inspect(where)}, expected exactly one`);
|
|
229
221
|
}
|
|
230
222
|
}
|
|
231
|
-
exports.NotFoundError = NotFoundError;
|
package/events/EventManager.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { EntityMetadata } from '../typings';
|
|
2
|
-
import type { EventArgs, EventSubscriber, FlushEventArgs, TransactionEventArgs } from './EventSubscriber';
|
|
3
|
-
import { EventType, type TransactionEventType } from '../enums';
|
|
1
|
+
import type { EntityMetadata } from '../typings.js';
|
|
2
|
+
import type { EventArgs, EventSubscriber, FlushEventArgs, TransactionEventArgs } from './EventSubscriber.js';
|
|
3
|
+
import { EventType, type TransactionEventType } from '../enums.js';
|
|
4
4
|
export declare class EventManager {
|
|
5
5
|
private readonly listeners;
|
|
6
6
|
private readonly entities;
|
package/events/EventManager.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const Utils_1 = require("../utils/Utils");
|
|
5
|
-
const enums_1 = require("../enums");
|
|
6
|
-
class EventManager {
|
|
1
|
+
import { Utils } from '../utils/Utils.js';
|
|
2
|
+
import { EventType, EventTypeMap } from '../enums.js';
|
|
3
|
+
export class EventManager {
|
|
7
4
|
listeners = {};
|
|
8
5
|
entities = new Map();
|
|
9
6
|
cache = new Map();
|
|
@@ -15,7 +12,7 @@ class EventManager {
|
|
|
15
12
|
this.subscribers.push(subscriber);
|
|
16
13
|
this.entities.set(subscriber, this.getSubscribedEntities(subscriber));
|
|
17
14
|
this.cache.clear();
|
|
18
|
-
|
|
15
|
+
Utils.keys(EventType)
|
|
19
16
|
.filter(event => event in subscriber)
|
|
20
17
|
.forEach(event => {
|
|
21
18
|
this.listeners[event] ??= [];
|
|
@@ -39,13 +36,13 @@ class EventManager {
|
|
|
39
36
|
listeners.push(listener[event].bind(listener));
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
|
-
if (event ===
|
|
39
|
+
if (event === EventType.onInit) {
|
|
43
40
|
return listeners.forEach(listener => listener(args));
|
|
44
41
|
}
|
|
45
|
-
return
|
|
42
|
+
return Utils.runSerial(listeners, listener => listener(args));
|
|
46
43
|
}
|
|
47
44
|
hasListeners(event, meta) {
|
|
48
|
-
const cacheKey = meta._id +
|
|
45
|
+
const cacheKey = meta._id + EventTypeMap[event];
|
|
49
46
|
if (this.cache.has(cacheKey)) {
|
|
50
47
|
return this.cache.get(cacheKey);
|
|
51
48
|
}
|
|
@@ -71,7 +68,6 @@ class EventManager {
|
|
|
71
68
|
if (!listener.getSubscribedEntities) {
|
|
72
69
|
return [];
|
|
73
70
|
}
|
|
74
|
-
return listener.getSubscribedEntities().map(name =>
|
|
71
|
+
return listener.getSubscribedEntities().map(name => Utils.className(name));
|
|
75
72
|
}
|
|
76
73
|
}
|
|
77
|
-
exports.EventManager = EventManager;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { EntityName, EntityMetadata } from '../typings';
|
|
2
|
-
import type { EntityManager } from '../EntityManager';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { EntityName, EntityMetadata } from '../typings.js';
|
|
2
|
+
import type { EntityManager } from '../EntityManager.js';
|
|
3
|
+
import type { UnitOfWork } from '../unit-of-work/UnitOfWork.js';
|
|
4
|
+
import type { ChangeSet } from '../unit-of-work/ChangeSet.js';
|
|
5
|
+
import type { Transaction } from '../connections/Connection.js';
|
|
5
6
|
export interface EventArgs<T> {
|
|
6
7
|
entity: T;
|
|
7
8
|
em: EntityManager;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Transaction } from '../connections';
|
|
2
|
-
import type { EntityManager } from '../EntityManager';
|
|
3
|
-
import type { TransactionEventType } from '../enums';
|
|
1
|
+
import type { Transaction } from '../connections/Connection.js';
|
|
2
|
+
import type { EntityManager } from '../EntityManager.js';
|
|
3
|
+
import type { TransactionEventType } from '../enums.js';
|
|
4
4
|
export declare class TransactionEventBroadcaster {
|
|
5
5
|
private readonly em;
|
|
6
6
|
readonly context?: {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionEventBroadcaster = void 0;
|
|
4
|
-
class TransactionEventBroadcaster {
|
|
1
|
+
export class TransactionEventBroadcaster {
|
|
5
2
|
em;
|
|
6
3
|
context;
|
|
7
4
|
constructor(em, context) {
|
|
@@ -16,4 +13,3 @@ class TransactionEventBroadcaster {
|
|
|
16
13
|
});
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.TransactionEventBroadcaster = TransactionEventBroadcaster;
|
package/events/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './EventSubscriber';
|
|
2
|
-
export * from './EventManager';
|
|
3
|
-
export * from './TransactionEventBroadcaster';
|
|
1
|
+
export * from './EventSubscriber.js';
|
|
2
|
+
export * from './EventManager.js';
|
|
3
|
+
export * from './TransactionEventBroadcaster.js';
|
package/events/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./EventSubscriber"), exports);
|
|
18
|
-
__exportStar(require("./EventManager"), exports);
|
|
19
|
-
__exportStar(require("./TransactionEventBroadcaster"), exports);
|
|
1
|
+
export * from './EventSubscriber.js';
|
|
2
|
+
export * from './EventManager.js';
|
|
3
|
+
export * from './TransactionEventBroadcaster.js';
|
package/exceptions.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UniqueConstraintViolationException = exports.TableNotFoundException = exports.TableExistsException = exports.SyntaxErrorException = exports.ReadOnlyException = exports.NotNullConstraintViolationException = exports.NonUniqueFieldNameException = exports.LockWaitTimeoutException = exports.InvalidFieldNameException = exports.CheckConstraintViolationException = exports.ForeignKeyConstraintViolationException = exports.DeadlockException = exports.DatabaseObjectNotFoundException = exports.DatabaseObjectExistsException = exports.ConstraintViolationException = exports.ServerException = exports.ConnectionException = exports.DriverException = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Base class for all errors detected in the driver.
|
|
6
3
|
*/
|
|
7
|
-
class DriverException extends Error {
|
|
4
|
+
export class DriverException extends Error {
|
|
8
5
|
code;
|
|
9
6
|
errno;
|
|
10
7
|
sqlState;
|
|
@@ -18,25 +15,21 @@ class DriverException extends Error {
|
|
|
18
15
|
this.stack += '\n\n' + previous.stack.split('\n').filter(l => l.trim().startsWith('at ')).join('\n');
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
exports.DriverException = DriverException;
|
|
22
18
|
/**
|
|
23
19
|
* Base class for all connection related errors detected in the driver.
|
|
24
20
|
*/
|
|
25
|
-
class ConnectionException extends DriverException {
|
|
21
|
+
export class ConnectionException extends DriverException {
|
|
26
22
|
}
|
|
27
|
-
exports.ConnectionException = ConnectionException;
|
|
28
23
|
/**
|
|
29
24
|
* Base class for all server related errors detected in the driver.
|
|
30
25
|
*/
|
|
31
|
-
class ServerException extends DriverException {
|
|
26
|
+
export class ServerException extends DriverException {
|
|
32
27
|
}
|
|
33
|
-
exports.ServerException = ServerException;
|
|
34
28
|
/**
|
|
35
29
|
* Base class for all constraint violation related errors detected in the driver.
|
|
36
30
|
*/
|
|
37
|
-
class ConstraintViolationException extends ServerException {
|
|
31
|
+
export class ConstraintViolationException extends ServerException {
|
|
38
32
|
}
|
|
39
|
-
exports.ConstraintViolationException = ConstraintViolationException;
|
|
40
33
|
/**
|
|
41
34
|
* Base class for all already existing database object related errors detected in the driver.
|
|
42
35
|
*
|
|
@@ -44,9 +37,8 @@ exports.ConstraintViolationException = ConstraintViolationException;
|
|
|
44
37
|
* such as schemas, tables, views, sequences, triggers, constraints, indexes,
|
|
45
38
|
* functions, stored procedures etc.
|
|
46
39
|
*/
|
|
47
|
-
class DatabaseObjectExistsException extends ServerException {
|
|
40
|
+
export class DatabaseObjectExistsException extends ServerException {
|
|
48
41
|
}
|
|
49
|
-
exports.DatabaseObjectExistsException = DatabaseObjectExistsException;
|
|
50
42
|
/**
|
|
51
43
|
* Base class for all unknown database object related errors detected in the driver.
|
|
52
44
|
*
|
|
@@ -54,78 +46,65 @@ exports.DatabaseObjectExistsException = DatabaseObjectExistsException;
|
|
|
54
46
|
* such as schemas, tables, views, sequences, triggers, constraints, indexes,
|
|
55
47
|
* functions, stored procedures etc.
|
|
56
48
|
*/
|
|
57
|
-
class DatabaseObjectNotFoundException extends ServerException {
|
|
49
|
+
export class DatabaseObjectNotFoundException extends ServerException {
|
|
58
50
|
}
|
|
59
|
-
exports.DatabaseObjectNotFoundException = DatabaseObjectNotFoundException;
|
|
60
51
|
/**
|
|
61
52
|
* Exception for a deadlock error of a transaction detected in the driver.
|
|
62
53
|
*/
|
|
63
|
-
class DeadlockException extends ServerException {
|
|
54
|
+
export class DeadlockException extends ServerException {
|
|
64
55
|
}
|
|
65
|
-
exports.DeadlockException = DeadlockException;
|
|
66
56
|
/**
|
|
67
57
|
* Exception for a foreign key constraint violation detected in the driver.
|
|
68
58
|
*/
|
|
69
|
-
class ForeignKeyConstraintViolationException extends ConstraintViolationException {
|
|
59
|
+
export class ForeignKeyConstraintViolationException extends ConstraintViolationException {
|
|
70
60
|
}
|
|
71
|
-
exports.ForeignKeyConstraintViolationException = ForeignKeyConstraintViolationException;
|
|
72
61
|
/**
|
|
73
62
|
* Exception for a check constraint violation detected in the driver.
|
|
74
63
|
*/
|
|
75
|
-
class CheckConstraintViolationException extends ConstraintViolationException {
|
|
64
|
+
export class CheckConstraintViolationException extends ConstraintViolationException {
|
|
76
65
|
}
|
|
77
|
-
exports.CheckConstraintViolationException = CheckConstraintViolationException;
|
|
78
66
|
/**
|
|
79
67
|
* Exception for an invalid specified field name in a statement detected in the driver.
|
|
80
68
|
*/
|
|
81
|
-
class InvalidFieldNameException extends ServerException {
|
|
69
|
+
export class InvalidFieldNameException extends ServerException {
|
|
82
70
|
}
|
|
83
|
-
exports.InvalidFieldNameException = InvalidFieldNameException;
|
|
84
71
|
/**
|
|
85
72
|
* Exception for a lock wait timeout error of a transaction detected in the driver.
|
|
86
73
|
*/
|
|
87
|
-
class LockWaitTimeoutException extends ServerException {
|
|
74
|
+
export class LockWaitTimeoutException extends ServerException {
|
|
88
75
|
}
|
|
89
|
-
exports.LockWaitTimeoutException = LockWaitTimeoutException;
|
|
90
76
|
/**
|
|
91
77
|
* Exception for a non-unique/ambiguous specified field name in a statement detected in the driver.
|
|
92
78
|
*/
|
|
93
|
-
class NonUniqueFieldNameException extends ServerException {
|
|
79
|
+
export class NonUniqueFieldNameException extends ServerException {
|
|
94
80
|
}
|
|
95
|
-
exports.NonUniqueFieldNameException = NonUniqueFieldNameException;
|
|
96
81
|
/**
|
|
97
82
|
* Exception for a NOT NULL constraint violation detected in the driver.
|
|
98
83
|
*/
|
|
99
|
-
class NotNullConstraintViolationException extends ConstraintViolationException {
|
|
84
|
+
export class NotNullConstraintViolationException extends ConstraintViolationException {
|
|
100
85
|
}
|
|
101
|
-
exports.NotNullConstraintViolationException = NotNullConstraintViolationException;
|
|
102
86
|
/**
|
|
103
87
|
* Exception for a write operation attempt on a read-only database element detected in the driver.
|
|
104
88
|
*/
|
|
105
|
-
class ReadOnlyException extends ServerException {
|
|
89
|
+
export class ReadOnlyException extends ServerException {
|
|
106
90
|
}
|
|
107
|
-
exports.ReadOnlyException = ReadOnlyException;
|
|
108
91
|
/**
|
|
109
92
|
* Exception for a syntax error in a statement detected in the driver.
|
|
110
93
|
*/
|
|
111
|
-
class SyntaxErrorException extends ServerException {
|
|
94
|
+
export class SyntaxErrorException extends ServerException {
|
|
112
95
|
}
|
|
113
|
-
exports.SyntaxErrorException = SyntaxErrorException;
|
|
114
96
|
/**
|
|
115
97
|
* Exception for an already existing table referenced in a statement detected in the driver.
|
|
116
98
|
*/
|
|
117
|
-
class TableExistsException extends DatabaseObjectExistsException {
|
|
99
|
+
export class TableExistsException extends DatabaseObjectExistsException {
|
|
118
100
|
}
|
|
119
|
-
exports.TableExistsException = TableExistsException;
|
|
120
101
|
/**
|
|
121
102
|
* Exception for an unknown table referenced in a statement detected in the driver.
|
|
122
103
|
*/
|
|
123
|
-
class TableNotFoundException extends DatabaseObjectNotFoundException {
|
|
104
|
+
export class TableNotFoundException extends DatabaseObjectNotFoundException {
|
|
124
105
|
}
|
|
125
|
-
exports.TableNotFoundException = TableNotFoundException;
|
|
126
106
|
/**
|
|
127
107
|
* Exception for a unique constraint violation detected in the driver.
|
|
128
108
|
*/
|
|
129
|
-
class UniqueConstraintViolationException extends ConstraintViolationException {
|
|
109
|
+
export class UniqueConstraintViolationException extends ConstraintViolationException {
|
|
130
110
|
}
|
|
131
|
-
exports.UniqueConstraintViolationException = UniqueConstraintViolationException;
|
package/hydration/Hydrator.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { EntityData, EntityMetadata, EntityProperty, IHydrator } from '../typings';
|
|
2
|
-
import type { EntityFactory } from '../entity/EntityFactory';
|
|
3
|
-
import type { Platform } from '../platforms/Platform';
|
|
4
|
-
import type { MetadataStorage } from '../metadata/MetadataStorage';
|
|
5
|
-
import type { Configuration } from '../utils/Configuration';
|
|
1
|
+
import type { EntityData, EntityMetadata, EntityProperty, IHydrator } from '../typings.js';
|
|
2
|
+
import type { EntityFactory } from '../entity/EntityFactory.js';
|
|
3
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
4
|
+
import type { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
5
|
+
import type { Configuration } from '../utils/Configuration.js';
|
|
6
6
|
export declare abstract class Hydrator implements IHydrator {
|
|
7
7
|
protected readonly metadata: MetadataStorage;
|
|
8
8
|
protected readonly platform: Platform;
|
package/hydration/Hydrator.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Hydrator = void 0;
|
|
4
|
-
/* istanbul ignore next */
|
|
5
|
-
class Hydrator {
|
|
1
|
+
/* v8 ignore start */
|
|
2
|
+
export class Hydrator {
|
|
6
3
|
metadata;
|
|
7
4
|
platform;
|
|
8
5
|
config;
|
|
@@ -48,4 +45,4 @@ class Hydrator {
|
|
|
48
45
|
entity[prop.name] = data[prop.name];
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
|
-
|
|
48
|
+
/* v8 ignore stop */
|