@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.
Files changed (261) hide show
  1. package/EntityManager.d.ts +18 -13
  2. package/EntityManager.js +202 -202
  3. package/MikroORM.d.ts +7 -6
  4. package/MikroORM.js +33 -45
  5. package/cache/CacheAdapter.js +1 -2
  6. package/cache/FileCacheAdapter.d.ts +1 -1
  7. package/cache/FileCacheAdapter.js +18 -26
  8. package/cache/GeneratedCacheAdapter.d.ts +2 -2
  9. package/cache/GeneratedCacheAdapter.js +1 -5
  10. package/cache/MemoryCacheAdapter.d.ts +1 -1
  11. package/cache/MemoryCacheAdapter.js +1 -5
  12. package/cache/NullCacheAdapter.d.ts +1 -1
  13. package/cache/NullCacheAdapter.js +1 -5
  14. package/cache/index.d.ts +5 -5
  15. package/cache/index.js +5 -21
  16. package/connections/Connection.d.ts +7 -7
  17. package/connections/Connection.js +8 -12
  18. package/connections/index.d.ts +1 -1
  19. package/connections/index.js +1 -17
  20. package/decorators/Check.d.ts +1 -1
  21. package/decorators/Check.js +5 -8
  22. package/decorators/CreateRequestContext.d.ts +1 -1
  23. package/decorators/CreateRequestContext.js +9 -13
  24. package/decorators/Embeddable.d.ts +1 -1
  25. package/decorators/Embeddable.js +3 -6
  26. package/decorators/Embedded.d.ts +1 -1
  27. package/decorators/Embedded.js +10 -12
  28. package/decorators/Entity.d.ts +2 -2
  29. package/decorators/Entity.js +5 -8
  30. package/decorators/Enum.d.ts +2 -2
  31. package/decorators/Enum.js +7 -10
  32. package/decorators/Filter.d.ts +1 -1
  33. package/decorators/Filter.js +3 -6
  34. package/decorators/Formula.d.ts +2 -2
  35. package/decorators/Formula.js +7 -10
  36. package/decorators/Indexed.d.ts +2 -2
  37. package/decorators/Indexed.js +6 -10
  38. package/decorators/ManyToMany.d.ts +3 -3
  39. package/decorators/ManyToMany.js +10 -12
  40. package/decorators/ManyToOne.d.ts +3 -3
  41. package/decorators/ManyToOne.js +10 -12
  42. package/decorators/OneToMany.d.ts +3 -3
  43. package/decorators/OneToMany.js +11 -14
  44. package/decorators/OneToOne.d.ts +4 -4
  45. package/decorators/OneToOne.js +4 -7
  46. package/decorators/PrimaryKey.d.ts +2 -2
  47. package/decorators/PrimaryKey.js +10 -13
  48. package/decorators/Property.d.ts +5 -5
  49. package/decorators/Property.js +10 -12
  50. package/decorators/Transactional.d.ts +2 -2
  51. package/decorators/Transactional.js +7 -10
  52. package/decorators/hooks.js +23 -35
  53. package/decorators/index.d.ts +17 -17
  54. package/decorators/index.js +17 -36
  55. package/drivers/DatabaseDriver.d.ts +13 -12
  56. package/drivers/DatabaseDriver.js +60 -64
  57. package/drivers/IDatabaseDriver.d.ts +12 -12
  58. package/drivers/IDatabaseDriver.js +1 -4
  59. package/drivers/index.d.ts +2 -2
  60. package/drivers/index.js +2 -18
  61. package/entity/ArrayCollection.d.ts +2 -2
  62. package/entity/ArrayCollection.js +29 -33
  63. package/entity/BaseEntity.d.ts +6 -6
  64. package/entity/BaseEntity.js +17 -21
  65. package/entity/Collection.d.ts +6 -6
  66. package/entity/Collection.js +40 -44
  67. package/entity/EntityAssigner.d.ts +2 -2
  68. package/entity/EntityAssigner.js +58 -63
  69. package/entity/EntityFactory.d.ts +3 -3
  70. package/entity/EntityFactory.js +58 -62
  71. package/entity/EntityHelper.d.ts +2 -2
  72. package/entity/EntityHelper.js +41 -45
  73. package/entity/EntityIdentifier.d.ts +1 -1
  74. package/entity/EntityIdentifier.js +1 -5
  75. package/entity/EntityLoader.d.ts +5 -5
  76. package/entity/EntityLoader.js +92 -96
  77. package/entity/EntityRepository.d.ts +7 -7
  78. package/entity/EntityRepository.js +7 -11
  79. package/entity/EntityValidator.d.ts +1 -1
  80. package/entity/EntityValidator.js +25 -29
  81. package/entity/Reference.d.ts +2 -2
  82. package/entity/Reference.js +35 -42
  83. package/entity/WrappedEntity.d.ts +12 -12
  84. package/entity/WrappedEntity.js +23 -27
  85. package/entity/index.d.ts +13 -13
  86. package/entity/index.js +13 -29
  87. package/entity/utils.d.ts +1 -1
  88. package/entity/utils.js +9 -12
  89. package/entity/wrap.d.ts +1 -1
  90. package/entity/wrap.js +2 -6
  91. package/enums.d.ts +3 -3
  92. package/enums.js +37 -41
  93. package/errors.d.ts +1 -1
  94. package/errors.js +15 -24
  95. package/events/EventManager.d.ts +3 -3
  96. package/events/EventManager.js +8 -12
  97. package/events/EventSubscriber.d.ts +5 -4
  98. package/events/EventSubscriber.js +1 -2
  99. package/events/TransactionEventBroadcaster.d.ts +3 -3
  100. package/events/TransactionEventBroadcaster.js +1 -5
  101. package/events/index.d.ts +3 -3
  102. package/events/index.js +3 -19
  103. package/exceptions.js +18 -39
  104. package/hydration/Hydrator.d.ts +5 -5
  105. package/hydration/Hydrator.js +3 -6
  106. package/hydration/ObjectHydrator.d.ts +3 -3
  107. package/hydration/ObjectHydrator.js +25 -28
  108. package/hydration/index.d.ts +2 -2
  109. package/hydration/index.js +2 -18
  110. package/index.d.ts +21 -21
  111. package/index.js +21 -46
  112. package/logging/DefaultLogger.d.ts +1 -1
  113. package/logging/DefaultLogger.js +9 -13
  114. package/logging/Logger.d.ts +1 -1
  115. package/logging/Logger.js +1 -2
  116. package/logging/SimpleLogger.d.ts +2 -2
  117. package/logging/SimpleLogger.js +2 -6
  118. package/logging/colors.js +1 -5
  119. package/logging/index.d.ts +4 -4
  120. package/logging/index.js +4 -20
  121. package/metadata/EntitySchema.d.ts +12 -4
  122. package/metadata/EntitySchema.js +41 -45
  123. package/metadata/MetadataDiscovery.d.ts +7 -7
  124. package/metadata/MetadataDiscovery.js +174 -177
  125. package/metadata/MetadataProvider.d.ts +2 -2
  126. package/metadata/MetadataProvider.js +4 -7
  127. package/metadata/MetadataStorage.d.ts +2 -2
  128. package/metadata/MetadataStorage.js +15 -19
  129. package/metadata/MetadataValidator.d.ts +4 -4
  130. package/metadata/MetadataValidator.js +49 -53
  131. package/metadata/ReflectMetadataProvider.d.ts +2 -2
  132. package/metadata/ReflectMetadataProvider.js +8 -12
  133. package/metadata/index.d.ts +6 -6
  134. package/metadata/index.js +6 -22
  135. package/naming-strategy/AbstractNamingStrategy.d.ts +2 -2
  136. package/naming-strategy/AbstractNamingStrategy.js +4 -8
  137. package/naming-strategy/EntityCaseNamingStrategy.d.ts +1 -1
  138. package/naming-strategy/EntityCaseNamingStrategy.js +2 -6
  139. package/naming-strategy/MongoNamingStrategy.d.ts +1 -1
  140. package/naming-strategy/MongoNamingStrategy.js +2 -6
  141. package/naming-strategy/NamingStrategy.d.ts +1 -1
  142. package/naming-strategy/NamingStrategy.js +1 -2
  143. package/naming-strategy/UnderscoreNamingStrategy.d.ts +1 -1
  144. package/naming-strategy/UnderscoreNamingStrategy.js +2 -6
  145. package/naming-strategy/index.d.ts +5 -5
  146. package/naming-strategy/index.js +5 -21
  147. package/package.json +5 -14
  148. package/platforms/ExceptionConverter.d.ts +2 -2
  149. package/platforms/ExceptionConverter.js +4 -8
  150. package/platforms/Platform.d.ts +10 -10
  151. package/platforms/Platform.js +57 -61
  152. package/platforms/index.d.ts +2 -2
  153. package/platforms/index.js +2 -18
  154. package/serialization/EntitySerializer.d.ts +2 -2
  155. package/serialization/EntitySerializer.js +36 -41
  156. package/serialization/EntityTransformer.d.ts +1 -1
  157. package/serialization/EntityTransformer.js +27 -31
  158. package/serialization/SerializationContext.d.ts +2 -2
  159. package/serialization/SerializationContext.js +10 -14
  160. package/serialization/index.d.ts +3 -3
  161. package/serialization/index.js +3 -19
  162. package/types/ArrayType.d.ts +3 -3
  163. package/types/ArrayType.js +7 -11
  164. package/types/BigIntType.d.ts +3 -3
  165. package/types/BigIntType.js +3 -6
  166. package/types/BlobType.d.ts +3 -3
  167. package/types/BlobType.js +2 -8
  168. package/types/BooleanType.d.ts +3 -3
  169. package/types/BooleanType.js +2 -6
  170. package/types/CharacterType.d.ts +3 -3
  171. package/types/CharacterType.js +2 -6
  172. package/types/DateTimeType.d.ts +3 -3
  173. package/types/DateTimeType.js +2 -6
  174. package/types/DateType.d.ts +3 -3
  175. package/types/DateType.js +2 -6
  176. package/types/DecimalType.d.ts +3 -3
  177. package/types/DecimalType.js +4 -7
  178. package/types/DoubleType.d.ts +3 -3
  179. package/types/DoubleType.js +3 -6
  180. package/types/EnumArrayType.d.ts +4 -4
  181. package/types/EnumArrayType.js +5 -10
  182. package/types/EnumType.d.ts +3 -3
  183. package/types/EnumType.js +2 -6
  184. package/types/FloatType.d.ts +3 -3
  185. package/types/FloatType.js +2 -6
  186. package/types/IntegerType.d.ts +3 -3
  187. package/types/IntegerType.js +2 -6
  188. package/types/IntervalType.d.ts +3 -3
  189. package/types/IntervalType.js +2 -6
  190. package/types/JsonType.d.ts +3 -3
  191. package/types/JsonType.js +2 -6
  192. package/types/MediumIntType.d.ts +3 -3
  193. package/types/MediumIntType.js +2 -6
  194. package/types/SmallIntType.d.ts +3 -3
  195. package/types/SmallIntType.js +2 -6
  196. package/types/StringType.d.ts +3 -3
  197. package/types/StringType.js +2 -6
  198. package/types/TextType.d.ts +3 -3
  199. package/types/TextType.js +2 -6
  200. package/types/TimeType.d.ts +3 -3
  201. package/types/TimeType.js +4 -8
  202. package/types/TinyIntType.d.ts +3 -3
  203. package/types/TinyIntType.js +3 -6
  204. package/types/Type.d.ts +2 -2
  205. package/types/Type.js +5 -9
  206. package/types/Uint8ArrayType.d.ts +3 -3
  207. package/types/Uint8ArrayType.js +3 -9
  208. package/types/UnknownType.d.ts +3 -3
  209. package/types/UnknownType.js +2 -6
  210. package/types/UuidType.d.ts +3 -3
  211. package/types/UuidType.js +2 -6
  212. package/types/index.d.ts +25 -25
  213. package/types/index.js +52 -79
  214. package/typings.d.ts +22 -20
  215. package/typings.js +34 -38
  216. package/unit-of-work/ChangeSet.d.ts +1 -1
  217. package/unit-of-work/ChangeSet.js +13 -17
  218. package/unit-of-work/ChangeSetComputer.d.ts +8 -7
  219. package/unit-of-work/ChangeSetComputer.js +26 -30
  220. package/unit-of-work/ChangeSetPersister.d.ts +7 -6
  221. package/unit-of-work/ChangeSetPersister.js +44 -47
  222. package/unit-of-work/CommitOrderCalculator.d.ts +1 -1
  223. package/unit-of-work/CommitOrderCalculator.js +6 -10
  224. package/unit-of-work/IdentityMap.d.ts +1 -1
  225. package/unit-of-work/IdentityMap.js +1 -5
  226. package/unit-of-work/UnitOfWork.d.ts +8 -7
  227. package/unit-of-work/UnitOfWork.js +171 -172
  228. package/unit-of-work/index.d.ts +6 -6
  229. package/unit-of-work/index.js +6 -22
  230. package/utils/AbstractSchemaGenerator.d.ts +6 -6
  231. package/utils/AbstractSchemaGenerator.js +7 -11
  232. package/utils/Configuration.d.ts +26 -27
  233. package/utils/Configuration.js +50 -55
  234. package/utils/ConfigurationLoader.d.ts +9 -8
  235. package/utils/ConfigurationLoader.js +71 -86
  236. package/utils/Cursor.d.ts +3 -3
  237. package/utils/Cursor.js +22 -25
  238. package/utils/DataloaderUtils.d.ts +4 -4
  239. package/utils/DataloaderUtils.js +12 -16
  240. package/utils/EntityComparator.d.ts +2 -2
  241. package/utils/EntityComparator.js +48 -52
  242. package/utils/NullHighlighter.d.ts +1 -1
  243. package/utils/NullHighlighter.js +1 -5
  244. package/utils/QueryHelper.d.ts +3 -3
  245. package/utils/QueryHelper.js +47 -51
  246. package/utils/RawQueryFragment.d.ts +1 -1
  247. package/utils/RawQueryFragment.js +16 -24
  248. package/utils/RequestContext.d.ts +2 -2
  249. package/utils/RequestContext.js +3 -7
  250. package/utils/TransactionContext.d.ts +1 -1
  251. package/utils/TransactionContext.js +4 -8
  252. package/utils/Utils.d.ts +16 -12
  253. package/utils/Utils.js +89 -93
  254. package/utils/clone.js +8 -11
  255. package/utils/index.d.ts +13 -13
  256. package/utils/index.js +13 -29
  257. package/utils/resolveContextProvider.d.ts +3 -3
  258. package/utils/resolveContextProvider.js +9 -12
  259. package/utils/upsert-utils.d.ts +3 -3
  260. package/utils/upsert-utils.js +5 -9
  261. package/index.mjs +0 -199
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class EnumType extends Type<string | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  compareAsType(): string;
package/types/EnumType.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EnumType = void 0;
4
- const Type_1 = require("./Type");
5
- class EnumType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class EnumType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  if (prop.nativeEnumName) {
8
5
  return prop.nativeEnumName;
@@ -16,4 +13,3 @@ class EnumType extends Type_1.Type {
16
13
  return false;
17
14
  }
18
15
  }
19
- exports.EnumType = EnumType;
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class FloatType extends Type<number | null | undefined, number | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  compareAsType(): string;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FloatType = void 0;
4
- const Type_1 = require("./Type");
5
- class FloatType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class FloatType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  return platform.getFloatDeclarationSQL();
8
5
  }
@@ -13,4 +10,3 @@ class FloatType extends Type_1.Type {
13
10
  return false;
14
11
  }
15
12
  }
16
- exports.FloatType = FloatType;
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class IntegerType extends Type<number | null | undefined, number | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  compareAsType(): string;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IntegerType = void 0;
4
- const Type_1 = require("./Type");
5
- class IntegerType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class IntegerType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  return platform.getIntegerTypeDeclarationSQL(prop);
8
5
  }
@@ -13,4 +10,3 @@ class IntegerType extends Type_1.Type {
13
10
  return false;
14
11
  }
15
12
  }
16
- exports.IntegerType = IntegerType;
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class IntervalType extends Type<string | null | undefined, string | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  convertToJSValue(value: string | null | undefined, platform: Platform): string | null | undefined;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IntervalType = void 0;
4
- const Type_1 = require("./Type");
5
- class IntervalType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class IntervalType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  return platform.getIntervalTypeDeclarationSQL(prop);
8
5
  }
@@ -16,4 +13,3 @@ class IntervalType extends Type_1.Type {
16
13
  return platform.getDefaultDateTimeLength();
17
14
  }
18
15
  }
19
- exports.IntervalType = IntervalType;
@@ -1,6 +1,6 @@
1
- import { Type, type TransformContext } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityMetadata, EntityProperty } from '../typings';
1
+ import { Type, type TransformContext } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityMetadata, EntityProperty } from '../typings.js';
4
4
  export declare class JsonType extends Type<unknown, string | null> {
5
5
  convertToDatabaseValue(value: unknown, platform: Platform, context?: TransformContext): string | null;
6
6
  convertToJSValueSQL(key: string, platform: Platform): string;
package/types/JsonType.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JsonType = void 0;
4
- const Type_1 = require("./Type");
5
- class JsonType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class JsonType extends Type {
6
3
  convertToDatabaseValue(value, platform, context) {
7
4
  if (value == null) {
8
5
  return value;
@@ -31,4 +28,3 @@ class JsonType extends Type_1.Type {
31
28
  return 'any';
32
29
  }
33
30
  }
34
- exports.JsonType = JsonType;
@@ -1,6 +1,6 @@
1
- import type { Platform } from '../platforms';
2
- import type { EntityProperty } from '../typings';
3
- import { IntegerType } from './IntegerType';
1
+ import type { Platform } from '../platforms/Platform.js';
2
+ import type { EntityProperty } from '../typings.js';
3
+ import { IntegerType } from './IntegerType.js';
4
4
  export declare class MediumIntType extends IntegerType {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  }
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MediumIntType = void 0;
4
- const IntegerType_1 = require("./IntegerType");
5
- class MediumIntType extends IntegerType_1.IntegerType {
1
+ import { IntegerType } from './IntegerType.js';
2
+ export class MediumIntType extends IntegerType {
6
3
  getColumnType(prop, platform) {
7
4
  return platform.getMediumIntTypeDeclarationSQL(prop);
8
5
  }
9
6
  }
10
- exports.MediumIntType = MediumIntType;
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class SmallIntType extends Type<number | null | undefined, number | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  compareAsType(): string;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SmallIntType = void 0;
4
- const Type_1 = require("./Type");
5
- class SmallIntType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class SmallIntType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  return platform.getSmallIntTypeDeclarationSQL(prop);
8
5
  }
@@ -13,4 +10,3 @@ class SmallIntType extends Type_1.Type {
13
10
  return false;
14
11
  }
15
12
  }
16
- exports.SmallIntType = SmallIntType;
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class StringType extends Type<string | null | undefined, string | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  compareAsType(): string;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StringType = void 0;
4
- const Type_1 = require("./Type");
5
- class StringType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class StringType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  return platform.getVarcharTypeDeclarationSQL(prop);
8
5
  }
@@ -16,4 +13,3 @@ class StringType extends Type_1.Type {
16
13
  return platform.getDefaultVarcharLength();
17
14
  }
18
15
  }
19
- exports.StringType = StringType;
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class TextType extends Type<string | null | undefined, string | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  compareAsType(): string;
package/types/TextType.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextType = void 0;
4
- const Type_1 = require("./Type");
5
- class TextType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class TextType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  return platform.getTextTypeDeclarationSQL(prop);
8
5
  }
@@ -13,4 +10,3 @@ class TextType extends Type_1.Type {
13
10
  return false;
14
11
  }
15
12
  }
16
- exports.TextType = TextType;
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class TimeType extends Type {
5
5
  convertToDatabaseValue(value: any, platform: Platform): string;
6
6
  compareAsType(): string;
package/types/TimeType.js CHANGED
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimeType = void 0;
4
- const Type_1 = require("./Type");
5
- const errors_1 = require("../errors");
6
- class TimeType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ import { ValidationError } from '../errors.js';
3
+ export class TimeType extends Type {
7
4
  convertToDatabaseValue(value, platform) {
8
5
  if (value && !value.toString().match(/^\d{2,}:(?:[0-5]\d):(?:[0-5]\d)$/)) {
9
- throw errors_1.ValidationError.invalidType(TimeType, value, 'JS');
6
+ throw ValidationError.invalidType(TimeType, value, 'JS');
10
7
  }
11
8
  return super.convertToDatabaseValue(value, platform);
12
9
  }
@@ -23,4 +20,3 @@ class TimeType extends Type_1.Type {
23
20
  return platform.getDefaultDateTimeLength();
24
21
  }
25
22
  }
26
- exports.TimeType = TimeType;
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class TinyIntType extends Type<number | null | undefined, number | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  compareAsType(): string;
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TinyIntType = void 0;
4
- const Type_1 = require("./Type");
5
- class TinyIntType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class TinyIntType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  return platform.getTinyIntTypeDeclarationSQL(prop);
8
5
  }
9
6
  compareAsType() {
10
7
  return 'number';
11
8
  }
9
+ /* v8 ignore next 3 */
12
10
  ensureComparable() {
13
11
  return false;
14
12
  }
15
13
  }
16
- exports.TinyIntType = TinyIntType;
package/types/Type.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { inspect } from 'node:util';
2
- import type { Platform } from '../platforms';
3
- import type { Constructor, EntityMetadata, EntityProperty } from '../typings';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { Constructor, EntityMetadata, EntityProperty } from '../typings.js';
4
4
  export interface TransformContext {
5
5
  fromQuery?: boolean;
6
6
  key?: string;
package/types/Type.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Type = void 0;
4
- const node_util_1 = require("node:util");
5
- class Type {
1
+ import { inspect } from 'node:util';
2
+ export class Type {
6
3
  static types = new Map();
7
4
  platform;
8
5
  meta;
@@ -68,17 +65,16 @@ class Type {
68
65
  return !!data?.__mappedType;
69
66
  }
70
67
  /** @ignore */
71
- [node_util_1.inspect.custom](depth = 2) {
68
+ [inspect.custom](depth = 2) {
72
69
  const object = { ...this };
73
70
  const hidden = ['prop', 'platform', 'meta'];
74
71
  hidden.forEach(k => delete object[k]);
75
- const ret = (0, node_util_1.inspect)(object, { depth });
72
+ const ret = inspect(object, { depth });
76
73
  const name = this.constructor.name;
77
- /* istanbul ignore next */
74
+ /* v8 ignore next */
78
75
  return ret === '[Object]' ? `[${name}]` : name + ' ' + ret;
79
76
  }
80
77
  }
81
- exports.Type = Type;
82
78
  Object.defineProperties(Type.prototype, {
83
79
  __mappedType: { value: true, enumerable: false, writable: false },
84
80
  });
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class Uint8ArrayType extends Type<Uint8Array | null> {
5
5
  convertToDatabaseValue(value: Uint8Array): Buffer;
6
6
  convertToJSValue(value: Buffer): Uint8Array | null;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Uint8ArrayType = void 0;
4
- const Type_1 = require("./Type");
5
- class Uint8ArrayType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class Uint8ArrayType extends Type {
6
3
  convertToDatabaseValue(value) {
7
4
  if (!value) {
8
5
  return value;
@@ -10,18 +7,16 @@ class Uint8ArrayType extends Type_1.Type {
10
7
  return Buffer.from(value);
11
8
  }
12
9
  convertToJSValue(value) {
10
+ /* v8 ignore next 3 */
13
11
  if (!value) {
14
12
  return value;
15
13
  }
16
- /* istanbul ignore else */
17
14
  if (value instanceof Buffer) {
18
15
  return new Uint8Array(value);
19
16
  }
20
- /* istanbul ignore else */
21
17
  if (value.buffer instanceof Buffer) {
22
18
  return new Uint8Array(value.buffer);
23
19
  }
24
- /* istanbul ignore next */
25
20
  return new Uint8Array(Buffer.from(value));
26
21
  }
27
22
  compareAsType() {
@@ -34,4 +29,3 @@ class Uint8ArrayType extends Type_1.Type {
34
29
  return platform.getBlobDeclarationSQL();
35
30
  }
36
31
  }
37
- exports.Uint8ArrayType = Uint8ArrayType;
@@ -1,6 +1,6 @@
1
- import type { EntityProperty } from '../typings';
2
- import type { Platform } from '../platforms/Platform';
3
- import { Type } from './Type';
1
+ import type { EntityProperty } from '../typings.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import { Type } from './Type.js';
4
4
  export declare class UnknownType extends Type<unknown | null | undefined, unknown | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  get runtimeType(): string;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnknownType = void 0;
4
- const Type_1 = require("./Type");
5
- class UnknownType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class UnknownType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  return prop.columnTypes?.[0] ?? platform.getVarcharTypeDeclarationSQL(prop);
8
5
  }
@@ -16,4 +13,3 @@ class UnknownType extends Type_1.Type {
16
13
  return false;
17
14
  }
18
15
  }
19
- exports.UnknownType = UnknownType;
@@ -1,6 +1,6 @@
1
- import { Type } from './Type';
2
- import type { Platform } from '../platforms';
3
- import type { EntityProperty } from '../typings';
1
+ import { Type } from './Type.js';
2
+ import type { Platform } from '../platforms/Platform.js';
3
+ import type { EntityProperty } from '../typings.js';
4
4
  export declare class UuidType extends Type<string | null | undefined> {
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  compareAsType(): string;
package/types/UuidType.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UuidType = void 0;
4
- const Type_1 = require("./Type");
5
- class UuidType extends Type_1.Type {
1
+ import { Type } from './Type.js';
2
+ export class UuidType extends Type {
6
3
  getColumnType(prop, platform) {
7
4
  return platform.getUuidTypeDeclarationSQL(prop);
8
5
  }
@@ -13,4 +10,3 @@ class UuidType extends Type_1.Type {
13
10
  return false;
14
11
  }
15
12
  }
16
- exports.UuidType = UuidType;
package/types/index.d.ts CHANGED
@@ -1,28 +1,28 @@
1
- import { ArrayType } from './ArrayType';
2
- import { BigIntType } from './BigIntType';
3
- import { BlobType } from './BlobType';
4
- import { BooleanType } from './BooleanType';
5
- import { DateTimeType } from './DateTimeType';
6
- import { DateType } from './DateType';
7
- import { DecimalType } from './DecimalType';
8
- import { DoubleType } from './DoubleType';
9
- import { EnumArrayType } from './EnumArrayType';
10
- import { EnumType } from './EnumType';
11
- import { CharacterType } from './CharacterType';
12
- import { FloatType } from './FloatType';
13
- import { IntegerType } from './IntegerType';
14
- import { IntervalType } from './IntervalType';
15
- import { JsonType } from './JsonType';
16
- import { MediumIntType } from './MediumIntType';
17
- import { SmallIntType } from './SmallIntType';
18
- import { StringType } from './StringType';
19
- import { TextType } from './TextType';
20
- import { TimeType } from './TimeType';
21
- import { TinyIntType } from './TinyIntType';
22
- import { IType, TransformContext, Type } from './Type';
23
- import { Uint8ArrayType } from './Uint8ArrayType';
24
- import { UnknownType } from './UnknownType';
25
- import { UuidType } from './UuidType';
1
+ import { ArrayType } from './ArrayType.js';
2
+ import { BigIntType } from './BigIntType.js';
3
+ import { BlobType } from './BlobType.js';
4
+ import { BooleanType } from './BooleanType.js';
5
+ import { DateTimeType } from './DateTimeType.js';
6
+ import { DateType } from './DateType.js';
7
+ import { DecimalType } from './DecimalType.js';
8
+ import { DoubleType } from './DoubleType.js';
9
+ import { EnumArrayType } from './EnumArrayType.js';
10
+ import { EnumType } from './EnumType.js';
11
+ import { CharacterType } from './CharacterType.js';
12
+ import { FloatType } from './FloatType.js';
13
+ import { IntegerType } from './IntegerType.js';
14
+ import { IntervalType } from './IntervalType.js';
15
+ import { JsonType } from './JsonType.js';
16
+ import { MediumIntType } from './MediumIntType.js';
17
+ import { SmallIntType } from './SmallIntType.js';
18
+ import { StringType } from './StringType.js';
19
+ import { TextType } from './TextType.js';
20
+ import { TimeType } from './TimeType.js';
21
+ import { TinyIntType } from './TinyIntType.js';
22
+ import { IType, TransformContext, Type } from './Type.js';
23
+ import { Uint8ArrayType } from './Uint8ArrayType.js';
24
+ import { UnknownType } from './UnknownType.js';
25
+ import { UuidType } from './UuidType.js';
26
26
  export { Type, DateType, TimeType, DateTimeType, BigIntType, BlobType, Uint8ArrayType, ArrayType, EnumArrayType, EnumType, JsonType, IntegerType, SmallIntType, TinyIntType, MediumIntType, FloatType, DoubleType, BooleanType, DecimalType, StringType, UuidType, TextType, UnknownType, TransformContext, IntervalType, IType, CharacterType, };
27
27
  export declare const types: {
28
28
  readonly date: typeof DateType;