@mikro-orm/core 7.0.0-dev.2 → 7.0.0-dev.200
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 +111 -61
- package/EntityManager.js +346 -300
- package/MikroORM.d.ts +44 -35
- package/MikroORM.js +103 -143
- package/README.md +3 -2
- package/cache/FileCacheAdapter.d.ts +1 -1
- package/cache/FileCacheAdapter.js +8 -7
- package/cache/GeneratedCacheAdapter.d.ts +0 -1
- package/cache/GeneratedCacheAdapter.js +0 -2
- package/cache/index.d.ts +0 -1
- package/cache/index.js +0 -1
- package/connections/Connection.d.ts +16 -7
- package/connections/Connection.js +23 -14
- package/drivers/DatabaseDriver.d.ts +25 -16
- package/drivers/DatabaseDriver.js +80 -35
- package/drivers/IDatabaseDriver.d.ts +47 -17
- package/entity/BaseEntity.d.ts +2 -2
- package/entity/BaseEntity.js +0 -3
- package/entity/Collection.d.ts +95 -31
- package/entity/Collection.js +444 -102
- package/entity/EntityAssigner.d.ts +1 -1
- package/entity/EntityAssigner.js +26 -18
- package/entity/EntityFactory.d.ts +13 -1
- package/entity/EntityFactory.js +88 -54
- package/entity/EntityHelper.d.ts +2 -2
- package/entity/EntityHelper.js +38 -15
- package/entity/EntityLoader.d.ts +8 -7
- package/entity/EntityLoader.js +134 -80
- package/entity/EntityRepository.d.ts +24 -4
- package/entity/EntityRepository.js +8 -2
- package/entity/Reference.d.ts +9 -12
- package/entity/Reference.js +34 -9
- package/entity/WrappedEntity.d.ts +2 -7
- package/entity/WrappedEntity.js +3 -8
- package/entity/defineEntity.d.ts +585 -0
- package/entity/defineEntity.js +533 -0
- package/entity/index.d.ts +3 -2
- package/entity/index.js +3 -2
- package/entity/utils.d.ts +7 -0
- package/entity/utils.js +16 -4
- package/entity/validators.d.ts +11 -0
- package/entity/validators.js +65 -0
- package/enums.d.ts +22 -6
- package/enums.js +15 -1
- package/errors.d.ts +23 -9
- package/errors.js +59 -21
- package/events/EventManager.d.ts +2 -1
- package/events/EventManager.js +19 -11
- package/events/EventSubscriber.d.ts +3 -1
- package/hydration/Hydrator.js +1 -2
- package/hydration/ObjectHydrator.d.ts +4 -4
- package/hydration/ObjectHydrator.js +53 -33
- package/index.d.ts +2 -2
- package/index.js +1 -2
- package/logging/DefaultLogger.d.ts +1 -1
- package/logging/DefaultLogger.js +1 -0
- package/logging/SimpleLogger.d.ts +1 -1
- package/logging/colors.d.ts +1 -1
- package/logging/colors.js +7 -6
- package/logging/index.d.ts +1 -0
- package/logging/index.js +1 -0
- package/logging/inspect.d.ts +2 -0
- package/logging/inspect.js +11 -0
- package/metadata/EntitySchema.d.ts +26 -26
- package/metadata/EntitySchema.js +82 -51
- package/metadata/MetadataDiscovery.d.ts +7 -10
- package/metadata/MetadataDiscovery.js +408 -335
- package/metadata/MetadataProvider.d.ts +11 -2
- package/metadata/MetadataProvider.js +46 -2
- package/metadata/MetadataStorage.d.ts +13 -11
- package/metadata/MetadataStorage.js +70 -37
- package/metadata/MetadataValidator.d.ts +17 -9
- package/metadata/MetadataValidator.js +100 -42
- package/metadata/discover-entities.d.ts +5 -0
- package/metadata/discover-entities.js +40 -0
- package/metadata/index.d.ts +1 -1
- package/metadata/index.js +1 -1
- package/metadata/types.d.ts +502 -0
- package/metadata/types.js +1 -0
- package/naming-strategy/AbstractNamingStrategy.d.ts +12 -4
- package/naming-strategy/AbstractNamingStrategy.js +14 -2
- package/naming-strategy/EntityCaseNamingStrategy.d.ts +3 -3
- package/naming-strategy/EntityCaseNamingStrategy.js +6 -5
- package/naming-strategy/MongoNamingStrategy.d.ts +3 -3
- package/naming-strategy/MongoNamingStrategy.js +6 -6
- package/naming-strategy/NamingStrategy.d.ts +24 -4
- package/naming-strategy/UnderscoreNamingStrategy.d.ts +3 -3
- package/naming-strategy/UnderscoreNamingStrategy.js +6 -6
- package/not-supported.d.ts +2 -0
- package/not-supported.js +4 -0
- package/package.json +19 -11
- package/platforms/ExceptionConverter.js +1 -1
- package/platforms/Platform.d.ts +7 -13
- package/platforms/Platform.js +20 -43
- package/serialization/EntitySerializer.d.ts +5 -0
- package/serialization/EntitySerializer.js +47 -27
- package/serialization/EntityTransformer.js +28 -18
- package/serialization/SerializationContext.d.ts +6 -6
- package/serialization/SerializationContext.js +16 -13
- package/types/ArrayType.d.ts +1 -1
- package/types/ArrayType.js +2 -3
- package/types/BigIntType.d.ts +9 -6
- package/types/BigIntType.js +4 -1
- package/types/BlobType.d.ts +0 -1
- package/types/BlobType.js +0 -3
- package/types/BooleanType.d.ts +2 -1
- package/types/BooleanType.js +3 -0
- package/types/DecimalType.d.ts +6 -4
- package/types/DecimalType.js +3 -3
- package/types/DoubleType.js +2 -2
- package/types/EnumArrayType.js +1 -2
- package/types/JsonType.d.ts +1 -1
- package/types/JsonType.js +7 -2
- package/types/TinyIntType.js +1 -1
- package/types/Type.d.ts +2 -4
- package/types/Type.js +3 -3
- package/types/Uint8ArrayType.d.ts +0 -1
- package/types/Uint8ArrayType.js +1 -4
- package/types/index.d.ts +1 -1
- package/typings.d.ts +300 -140
- package/typings.js +62 -44
- package/unit-of-work/ChangeSet.d.ts +2 -6
- package/unit-of-work/ChangeSet.js +4 -5
- package/unit-of-work/ChangeSetComputer.d.ts +1 -3
- package/unit-of-work/ChangeSetComputer.js +26 -13
- package/unit-of-work/ChangeSetPersister.d.ts +5 -4
- package/unit-of-work/ChangeSetPersister.js +77 -35
- package/unit-of-work/CommitOrderCalculator.d.ts +12 -10
- package/unit-of-work/CommitOrderCalculator.js +13 -13
- package/unit-of-work/IdentityMap.d.ts +12 -0
- package/unit-of-work/IdentityMap.js +39 -1
- package/unit-of-work/UnitOfWork.d.ts +23 -3
- package/unit-of-work/UnitOfWork.js +199 -106
- package/utils/AbstractSchemaGenerator.d.ts +5 -5
- package/utils/AbstractSchemaGenerator.js +22 -17
- package/utils/AsyncContext.d.ts +6 -0
- package/utils/AsyncContext.js +42 -0
- package/utils/Configuration.d.ts +779 -207
- package/utils/Configuration.js +146 -190
- package/utils/ConfigurationLoader.d.ts +1 -54
- package/utils/ConfigurationLoader.js +1 -352
- package/utils/Cursor.d.ts +3 -6
- package/utils/Cursor.js +27 -11
- package/utils/DataloaderUtils.d.ts +15 -5
- package/utils/DataloaderUtils.js +65 -17
- package/utils/EntityComparator.d.ts +13 -9
- package/utils/EntityComparator.js +164 -89
- package/utils/QueryHelper.d.ts +14 -6
- package/utils/QueryHelper.js +88 -26
- package/utils/RawQueryFragment.d.ts +48 -25
- package/utils/RawQueryFragment.js +67 -66
- package/utils/RequestContext.js +2 -2
- package/utils/TransactionContext.js +2 -2
- package/utils/TransactionManager.d.ts +65 -0
- package/utils/TransactionManager.js +223 -0
- package/utils/Utils.d.ts +13 -120
- package/utils/Utils.js +104 -375
- package/utils/clone.js +8 -23
- package/utils/env-vars.d.ts +7 -0
- package/utils/env-vars.js +97 -0
- package/utils/fs-utils.d.ts +32 -0
- package/utils/fs-utils.js +178 -0
- package/utils/index.d.ts +2 -1
- package/utils/index.js +2 -1
- package/utils/upsert-utils.d.ts +9 -4
- package/utils/upsert-utils.js +55 -4
- package/decorators/Check.d.ts +0 -3
- package/decorators/Check.js +0 -13
- package/decorators/CreateRequestContext.d.ts +0 -3
- package/decorators/CreateRequestContext.js +0 -29
- package/decorators/Embeddable.d.ts +0 -8
- package/decorators/Embeddable.js +0 -11
- package/decorators/Embedded.d.ts +0 -18
- package/decorators/Embedded.js +0 -18
- package/decorators/Entity.d.ts +0 -18
- package/decorators/Entity.js +0 -13
- package/decorators/Enum.d.ts +0 -9
- package/decorators/Enum.js +0 -16
- package/decorators/Filter.d.ts +0 -2
- package/decorators/Filter.js +0 -8
- package/decorators/Formula.d.ts +0 -5
- package/decorators/Formula.js +0 -15
- package/decorators/Indexed.d.ts +0 -17
- package/decorators/Indexed.js +0 -20
- package/decorators/ManyToMany.d.ts +0 -40
- package/decorators/ManyToMany.js +0 -14
- package/decorators/ManyToOne.d.ts +0 -30
- package/decorators/ManyToOne.js +0 -14
- package/decorators/OneToMany.d.ts +0 -28
- package/decorators/OneToMany.js +0 -17
- package/decorators/OneToOne.d.ts +0 -24
- package/decorators/OneToOne.js +0 -7
- package/decorators/PrimaryKey.d.ts +0 -9
- package/decorators/PrimaryKey.js +0 -20
- package/decorators/Property.d.ts +0 -250
- package/decorators/Property.js +0 -32
- package/decorators/Transactional.d.ts +0 -13
- package/decorators/Transactional.js +0 -28
- package/decorators/hooks.d.ts +0 -16
- package/decorators/hooks.js +0 -47
- package/decorators/index.d.ts +0 -17
- package/decorators/index.js +0 -17
- package/entity/ArrayCollection.d.ts +0 -116
- package/entity/ArrayCollection.js +0 -395
- package/entity/EntityValidator.d.ts +0 -19
- package/entity/EntityValidator.js +0 -150
- package/metadata/ReflectMetadataProvider.d.ts +0 -8
- package/metadata/ReflectMetadataProvider.js +0 -44
- package/utils/resolveContextProvider.d.ts +0 -10
- package/utils/resolveContextProvider.js +0 -28
package/typings.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transaction } from './connections/Connection.js';
|
|
2
|
-
import { type Cascade, type DeferMode, type EventType, type LoadStrategy, type PopulatePath, type QueryOrderMap, ReferenceKind } from './enums.js';
|
|
2
|
+
import { type Cascade, type DeferMode, type EmbeddedPrefixMode, type EventType, type LoadStrategy, type PopulatePath, type QueryOrderMap, ReferenceKind } from './enums.js';
|
|
3
3
|
import { type AssignOptions } from './entity/EntityAssigner.js';
|
|
4
4
|
import { type EntityIdentifier } from './entity/EntityIdentifier.js';
|
|
5
5
|
import { type EntityLoaderOptions } from './entity/EntityLoader.js';
|
|
@@ -7,7 +7,6 @@ import { type Collection } from './entity/Collection.js';
|
|
|
7
7
|
import { type EntityFactory } from './entity/EntityFactory.js';
|
|
8
8
|
import { type EntityRepository } from './entity/EntityRepository.js';
|
|
9
9
|
import { Reference, type ScalarReference } from './entity/Reference.js';
|
|
10
|
-
import type { MikroORM } from './MikroORM.js';
|
|
11
10
|
import type { SerializationContext } from './serialization/SerializationContext.js';
|
|
12
11
|
import type { SerializeOptions } from './serialization/EntitySerializer.js';
|
|
13
12
|
import type { MetadataStorage } from './metadata/MetadataStorage.js';
|
|
@@ -15,11 +14,10 @@ import type { EntitySchema } from './metadata/EntitySchema.js';
|
|
|
15
14
|
import type { Type, types } from './types/index.js';
|
|
16
15
|
import type { Platform } from './platforms/Platform.js';
|
|
17
16
|
import type { Configuration } from './utils/Configuration.js';
|
|
18
|
-
import type {
|
|
17
|
+
import type { Raw } from './utils/RawQueryFragment.js';
|
|
19
18
|
import type { EntityManager } from './EntityManager.js';
|
|
20
|
-
import type { EmbeddedPrefixMode } from './decorators/Embedded.js';
|
|
21
19
|
import type { EventSubscriber } from './events/EventSubscriber.js';
|
|
22
|
-
import type { FindOneOptions, FindOptions, LoadHint } from './drivers/IDatabaseDriver.js';
|
|
20
|
+
import type { FilterOptions, FindOneOptions, FindOptions, LoadHint } from './drivers/IDatabaseDriver.js';
|
|
23
21
|
export type Constructor<T = unknown> = new (...args: any[]) => T;
|
|
24
22
|
export type Dictionary<T = any> = {
|
|
25
23
|
[k: string]: T;
|
|
@@ -28,6 +26,7 @@ export type EntityKey<T = unknown, B extends boolean = false> = string & {
|
|
|
28
26
|
[K in keyof T]-?: CleanKeys<T, K, B> extends never ? never : K;
|
|
29
27
|
}[keyof T];
|
|
30
28
|
export type EntityValue<T> = T[EntityKey<T>];
|
|
29
|
+
export type EntityDataValue<T> = EntityData<T>[EntityKey<T>];
|
|
31
30
|
export type FilterKey<T> = keyof FilterQuery<T>;
|
|
32
31
|
export type AsyncFunction<R = any, T = Dictionary> = (args: T) => Promise<T>;
|
|
33
32
|
export type Compute<T> = {
|
|
@@ -42,6 +41,60 @@ export type IsAny<T> = 0 extends (1 & T) ? true : false;
|
|
|
42
41
|
export type IsNever<T, True = true, False = false> = [T] extends [never] ? True : False;
|
|
43
42
|
export type MaybePromise<T> = T | Promise<T>;
|
|
44
43
|
export type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
44
|
+
/**
|
|
45
|
+
* Structural type for matching Collection without triggering full interface evaluation.
|
|
46
|
+
* Using `T extends CollectionShape` instead of `T extends Collection<any, any>` avoids
|
|
47
|
+
* forcing TypeScript to evaluate Collection's 30+ methods, preventing instantiation explosion
|
|
48
|
+
* (~133k → ~2k instantiations).
|
|
49
|
+
*
|
|
50
|
+
* Usage:
|
|
51
|
+
* - Matching only: `T extends CollectionShape`
|
|
52
|
+
* - With inference: `T extends CollectionShape<infer U>`
|
|
53
|
+
*/
|
|
54
|
+
type CollectionShape<T = any> = {
|
|
55
|
+
[k: number]: T;
|
|
56
|
+
readonly owner: object;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Structural type for matching LoadedCollection (extends CollectionShape with `$` property).
|
|
60
|
+
*
|
|
61
|
+
* Usage:
|
|
62
|
+
* - Matching only: `T extends LoadedCollectionShape`
|
|
63
|
+
* - With inference: `T extends LoadedCollectionShape<infer U>`
|
|
64
|
+
*/
|
|
65
|
+
type LoadedCollectionShape<T = any> = CollectionShape<T> & {
|
|
66
|
+
$: any;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Structural type for matching Reference without triggering full class evaluation.
|
|
70
|
+
* Using `T extends ReferenceShape` instead of `T extends Reference<any>` avoids
|
|
71
|
+
* forcing TypeScript to evaluate Reference's methods, preventing instantiation overhead
|
|
72
|
+
* (~800 → ~15 instantiations).
|
|
73
|
+
*
|
|
74
|
+
* Usage:
|
|
75
|
+
* - Matching only: `T extends ReferenceShape`
|
|
76
|
+
* - With inference: `T extends ReferenceShape<infer U>`
|
|
77
|
+
*/
|
|
78
|
+
type ReferenceShape<T = any> = {
|
|
79
|
+
unwrap(): T;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Structural type for matching LoadedReference (Reference with `$` property).
|
|
83
|
+
*/
|
|
84
|
+
type LoadedReferenceShape<T = any> = ReferenceShape<T> & {
|
|
85
|
+
$: T;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Structural type for matching any loadable relation (Collection, Reference, or array).
|
|
89
|
+
* Using this instead of `Loadable<any>` in conditional type checks prevents
|
|
90
|
+
* TypeScript from evaluating the full Collection/Reference interfaces.
|
|
91
|
+
*/
|
|
92
|
+
type LoadableShape = CollectionShape | ReferenceShape | readonly any[];
|
|
93
|
+
export type UnionKeys<T> = T extends any ? keyof T : never;
|
|
94
|
+
export type UnionPropertyType<T, K extends PropertyKey> = T extends any ? K extends keyof T ? T[K] : never : never;
|
|
95
|
+
export type MergeUnion<T> = [T] extends [object] ? T extends Scalar ? T : {
|
|
96
|
+
[K in UnionKeys<T>]: UnionPropertyType<T, K>;
|
|
97
|
+
} : T;
|
|
45
98
|
export type DeepPartial<T> = T & {
|
|
46
99
|
[P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial<U>[] : T[P] extends Readonly<infer U>[] ? Readonly<DeepPartial<U>>[] : DeepPartial<T[P]>;
|
|
47
100
|
};
|
|
@@ -51,36 +104,63 @@ export declare const OptionalProps: unique symbol;
|
|
|
51
104
|
export declare const EagerProps: unique symbol;
|
|
52
105
|
export declare const HiddenProps: unique symbol;
|
|
53
106
|
export declare const Config: unique symbol;
|
|
54
|
-
|
|
55
|
-
declare
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
107
|
+
export type Opt<T = unknown> = T & Opt.Brand;
|
|
108
|
+
export declare namespace Opt {
|
|
109
|
+
const __optional: unique symbol;
|
|
110
|
+
interface Brand {
|
|
111
|
+
[__optional]?: 1;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export type RequiredNullable<T = never> = (T & RequiredNullable.Brand) | null;
|
|
115
|
+
export declare namespace RequiredNullable {
|
|
116
|
+
const __requiredNullable: unique symbol;
|
|
117
|
+
interface Brand {
|
|
118
|
+
[__requiredNullable]?: 1;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export type Hidden<T = unknown> = T & Hidden.Brand;
|
|
122
|
+
export declare namespace Hidden {
|
|
123
|
+
const __hidden: unique symbol;
|
|
124
|
+
interface Brand {
|
|
125
|
+
[__hidden]?: 1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export type DefineConfig<T extends TypeConfig> = T & DefineConfig.Brand;
|
|
129
|
+
export declare namespace DefineConfig {
|
|
130
|
+
const __config: unique symbol;
|
|
131
|
+
interface Brand {
|
|
132
|
+
[__config]?: 1;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
66
135
|
export type CleanTypeConfig<T> = Compute<Pick<T, Extract<keyof T, keyof TypeConfig>>>;
|
|
67
136
|
export interface TypeConfig {
|
|
68
137
|
forceObject?: boolean;
|
|
69
138
|
}
|
|
70
|
-
|
|
139
|
+
declare const __selectedType: unique symbol;
|
|
140
|
+
declare const __loadedType: unique symbol;
|
|
141
|
+
declare const __loadHint: unique symbol;
|
|
142
|
+
/**
|
|
143
|
+
* Expands a populate hint into all its prefixes.
|
|
144
|
+
* e.g., Prefixes<'a.b.c'> = 'a' | 'a.b' | 'a.b.c'
|
|
145
|
+
* This reflects that loading 'a.b.c' means 'a' and 'a.b' are also loaded.
|
|
146
|
+
* Special case: '*' returns string to ensure Loaded<T, '*'> is assignable to any Loaded<T, Hint>.
|
|
147
|
+
*/
|
|
148
|
+
type Prefixes<S extends string> = S extends '*' ? string : S extends `${infer H}.${infer T}` ? H | `${H}.${Prefixes<T>}` : S;
|
|
149
|
+
export type UnwrapPrimary<T> = T extends Scalar ? T : T extends ReferenceShape<infer U> ? Primary<U> : Primary<T>;
|
|
71
150
|
type PrimaryPropToType<T, Keys extends (keyof T)[]> = {
|
|
72
151
|
[Index in keyof Keys]: UnwrapPrimary<T[Keys[Index]]>;
|
|
73
152
|
};
|
|
74
153
|
type ReadonlyPrimary<T> = T extends any[] ? Readonly<T> : T;
|
|
75
154
|
export type Primary<T> = IsAny<T> extends true ? any : T extends {
|
|
76
155
|
[PrimaryKeyProp]?: infer PK;
|
|
77
|
-
} ?
|
|
156
|
+
} ? PK extends undefined ? Omit<T, typeof PrimaryKeyProp> : PK extends keyof T ? ReadonlyPrimary<UnwrapPrimary<T[PK]>> : PK extends (keyof T)[] ? ReadonlyPrimary<PrimaryPropToType<T, PK>> : PK : T extends {
|
|
78
157
|
_id?: infer PK;
|
|
79
158
|
} ? ReadonlyPrimary<PK> | string : T extends {
|
|
80
|
-
uuid?: infer PK;
|
|
81
|
-
} ? ReadonlyPrimary<PK> : T extends {
|
|
82
159
|
id?: infer PK;
|
|
160
|
+
} ? ReadonlyPrimary<PK> : T extends {
|
|
161
|
+
uuid?: infer PK;
|
|
83
162
|
} ? ReadonlyPrimary<PK> : T;
|
|
163
|
+
/** @internal */
|
|
84
164
|
export type PrimaryProperty<T> = T extends {
|
|
85
165
|
[PrimaryKeyProp]?: infer PK;
|
|
86
166
|
} ? (PK extends keyof T ? PK : (PK extends any[] ? PK[number] : never)) : T extends {
|
|
@@ -88,10 +168,10 @@ export type PrimaryProperty<T> = T extends {
|
|
|
88
168
|
} ? (T extends {
|
|
89
169
|
id?: any;
|
|
90
170
|
} ? 'id' | '_id' : '_id') : T extends {
|
|
91
|
-
uuid?: any;
|
|
92
|
-
} ? 'uuid' : T extends {
|
|
93
171
|
id?: any;
|
|
94
|
-
} ? 'id' :
|
|
172
|
+
} ? 'id' : T extends {
|
|
173
|
+
uuid?: any;
|
|
174
|
+
} ? 'uuid' : never;
|
|
95
175
|
export type IPrimaryKeyValue = number | string | bigint | Date | {
|
|
96
176
|
toHexString(): string;
|
|
97
177
|
};
|
|
@@ -99,6 +179,7 @@ export type IPrimaryKey<T extends IPrimaryKeyValue = IPrimaryKeyValue> = T;
|
|
|
99
179
|
export type Scalar = boolean | number | string | bigint | symbol | Date | RegExp | Uint8Array | {
|
|
100
180
|
toHexString(): string;
|
|
101
181
|
};
|
|
182
|
+
type Primitive = boolean | number | string | bigint | symbol;
|
|
102
183
|
export type ExpandScalar<T> = null | (T extends string ? T | RegExp : T extends Date ? Date | string : T extends bigint ? bigint | string | number : T);
|
|
103
184
|
export type OperatorMap<T> = {
|
|
104
185
|
$and?: ExpandQuery<T>[];
|
|
@@ -111,6 +192,14 @@ export type OperatorMap<T> = {
|
|
|
111
192
|
$none?: ExpandQuery<T>;
|
|
112
193
|
$some?: ExpandQuery<T>;
|
|
113
194
|
$every?: ExpandQuery<T>;
|
|
195
|
+
$size?: number | {
|
|
196
|
+
$eq?: number;
|
|
197
|
+
$ne?: number;
|
|
198
|
+
$gt?: number;
|
|
199
|
+
$gte?: number;
|
|
200
|
+
$lt?: number;
|
|
201
|
+
$lte?: number;
|
|
202
|
+
};
|
|
114
203
|
$gt?: ExpandScalar<T>;
|
|
115
204
|
$gte?: ExpandScalar<T>;
|
|
116
205
|
$lt?: ExpandScalar<T>;
|
|
@@ -129,10 +218,11 @@ export type OperatorMap<T> = {
|
|
|
129
218
|
};
|
|
130
219
|
export type FilterItemValue<T> = T | ExpandScalar<T> | Primary<T>;
|
|
131
220
|
export type FilterValue<T> = OperatorMap<FilterItemValue<T>> | FilterItemValue<T> | FilterItemValue<T>[] | null;
|
|
221
|
+
type FilterObjectProp<T, K extends PropertyKey> = K extends keyof MergeUnion<T> ? MergeUnion<T>[K] : K extends keyof T ? T[K] : never;
|
|
222
|
+
type ExpandQueryMerged<T> = [T] extends [object] ? [T] extends [Scalar] ? never : FilterQuery<MergeUnion<T>> : FilterValue<T>;
|
|
132
223
|
export type FilterObject<T> = {
|
|
133
|
-
-readonly [K in EntityKey<T>]?: ExpandQuery<ExpandProperty<T
|
|
224
|
+
-readonly [K in EntityKey<T>]?: ExpandQuery<ExpandProperty<FilterObjectProp<T, K>>> | ExpandQueryMerged<ExpandProperty<FilterObjectProp<T, K>>> | FilterValue<ExpandProperty<FilterObjectProp<T, K>>> | null;
|
|
134
225
|
};
|
|
135
|
-
export type ExpandObject<T> = T extends object ? T extends Scalar ? never : FilterObject<T> : never;
|
|
136
226
|
export type ExpandQuery<T> = T extends object ? T extends Scalar ? never : FilterQuery<T> : FilterValue<T>;
|
|
137
227
|
export type EntityProps<T> = {
|
|
138
228
|
-readonly [K in EntityKey<T>]?: T[K];
|
|
@@ -142,10 +232,9 @@ export type FilterQuery<T> = ObjectQuery<T> | NonNullable<ExpandScalar<Primary<T
|
|
|
142
232
|
export type QBFilterQuery<T = any> = ObjectQuery<T> | Dictionary;
|
|
143
233
|
export interface IWrappedEntity<Entity extends object> {
|
|
144
234
|
isInitialized(): boolean;
|
|
145
|
-
isTouched(): boolean;
|
|
146
235
|
isManaged(): boolean;
|
|
147
236
|
populated(populated?: boolean): void;
|
|
148
|
-
populate<Hint extends string = never>(populate: AutoPath<Entity, Hint>[] | false, options?: EntityLoaderOptions<Entity>): Promise<Loaded<Entity, Hint>>;
|
|
237
|
+
populate<Hint extends string = never>(populate: readonly AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity>): Promise<Loaded<Entity, Hint>>;
|
|
149
238
|
init<Hint extends string = never, Fields extends string = '*', Exclude extends string = never>(options?: FindOneOptions<Entity, Hint, Fields, Exclude>): Promise<Loaded<Entity, Hint, Fields, Exclude> | null>;
|
|
150
239
|
toReference(): Ref<Entity> & LoadedReference<Loaded<Entity, AddEager<Entity>>>;
|
|
151
240
|
toObject(): EntityDTO<Entity>;
|
|
@@ -173,10 +262,9 @@ export interface IWrappedEntityInternal<Entity extends object> extends IWrappedE
|
|
|
173
262
|
__factory: EntityFactory;
|
|
174
263
|
__hydrator: IHydrator;
|
|
175
264
|
__initialized: boolean;
|
|
176
|
-
__touched: boolean;
|
|
177
265
|
__originalEntityData?: EntityData<Entity>;
|
|
178
266
|
__loadedProperties: Set<string>;
|
|
179
|
-
__identifier?: EntityIdentifier;
|
|
267
|
+
__identifier?: EntityIdentifier | EntityIdentifier[];
|
|
180
268
|
__managed: boolean;
|
|
181
269
|
__processing: boolean;
|
|
182
270
|
__schema?: string;
|
|
@@ -193,19 +281,13 @@ export interface IWrappedEntityInternal<Entity extends object> extends IWrappedE
|
|
|
193
281
|
};
|
|
194
282
|
}
|
|
195
283
|
export type AnyEntity<T = any> = Partial<T>;
|
|
196
|
-
export type EntityClass<T> = Function & {
|
|
284
|
+
export type EntityClass<T = any> = Function & {
|
|
197
285
|
prototype: T;
|
|
198
286
|
};
|
|
199
|
-
export type
|
|
200
|
-
entity: EntityClass<T>;
|
|
201
|
-
schema: EntityMetadata<T> | EntitySchema<T>;
|
|
202
|
-
};
|
|
203
|
-
export type EntityName<T> = string | EntityClass<T> | EntitySchema<T, any> | {
|
|
204
|
-
name: string;
|
|
205
|
-
};
|
|
287
|
+
export type EntityName<T = any> = EntityClass<T> | EntityCtor<T> | EntitySchema<T, any>;
|
|
206
288
|
export type GetRepository<Entity extends {
|
|
207
289
|
[k: PropertyKey]: any;
|
|
208
|
-
}, Fallback> = Entity[typeof EntityRepositoryType] extends EntityRepository<
|
|
290
|
+
}, Fallback> = Entity[typeof EntityRepositoryType] extends EntityRepository<any> | undefined ? NonNullable<Entity[typeof EntityRepositoryType]> : Fallback;
|
|
209
291
|
export type EntityDataPropValue<T> = T | Primary<T>;
|
|
210
292
|
type ExpandEntityProp<T, C extends boolean = false> = T extends Record<string, any> ? {
|
|
211
293
|
[K in keyof T as CleanKeys<T, K>]?: EntityDataProp<ExpandProperty<T[K]>, C> | EntityDataPropValue<ExpandProperty<T[K]>> | null;
|
|
@@ -216,14 +298,17 @@ type ExpandRequiredEntityPropObject<T, I = never, C extends boolean = false> = {
|
|
|
216
298
|
} & {
|
|
217
299
|
[K in keyof T as OptionalKeys<T, K, I>]?: RequiredEntityDataProp<ExpandProperty<T[K]>, T, C> | EntityDataPropValue<ExpandProperty<T[K]>> | null | undefined;
|
|
218
300
|
};
|
|
301
|
+
type NonArrayObject = object & {
|
|
302
|
+
[Symbol.iterator]?: never;
|
|
303
|
+
};
|
|
219
304
|
export type EntityDataProp<T, C extends boolean> = T extends Date ? string | Date : T extends Scalar ? T : T extends {
|
|
220
305
|
__runtime?: infer Runtime;
|
|
221
306
|
__raw?: infer Raw;
|
|
222
|
-
} ? (C extends true ? Raw : Runtime) : T extends
|
|
223
|
-
export type RequiredEntityDataProp<T, O, C extends boolean> = T extends Date ? string | Date : T extends Scalar ? T : T extends {
|
|
307
|
+
} ? (C extends true ? Raw : Runtime) : T extends ReferenceShape<infer U> ? EntityDataNested<U, C> : T extends ScalarReference<infer U> ? EntityDataProp<U, C> : T extends CollectionShape<infer U> ? U | U[] | EntityDataNested<U & object, C> | EntityDataNested<U & object, C>[] : T extends readonly (infer U)[] ? U extends NonArrayObject ? U | U[] | EntityDataNested<U, C> | EntityDataNested<U, C>[] : U[] | EntityDataNested<U, C>[] : EntityDataNested<T, C>;
|
|
308
|
+
export type RequiredEntityDataProp<T, O, C extends boolean> = T extends Date ? string | Date : Exclude<T, null> extends RequiredNullable.Brand ? T | null : T extends Scalar ? T : T extends {
|
|
224
309
|
__runtime?: infer Runtime;
|
|
225
310
|
__raw?: infer Raw;
|
|
226
|
-
} ? (C extends true ? Raw : Runtime) : T extends
|
|
311
|
+
} ? (C extends true ? Raw : Runtime) : T extends ReferenceShape<infer U> ? RequiredEntityDataNested<U, O, C> : T extends ScalarReference<infer U> ? RequiredEntityDataProp<U, O, C> : T extends CollectionShape<infer U> ? U | U[] | RequiredEntityDataNested<U & object, O, C> | RequiredEntityDataNested<U & object, O, C>[] : T extends readonly (infer U)[] ? U extends NonArrayObject ? U | U[] | RequiredEntityDataNested<U, O, C> | RequiredEntityDataNested<U, O, C>[] : U[] | RequiredEntityDataNested<U, O, C>[] : RequiredEntityDataNested<T, O, C>;
|
|
227
312
|
export type EntityDataNested<T, C extends boolean = false> = T extends undefined ? never : T extends any[] ? Readonly<T> : EntityData<T, C> | ExpandEntityProp<T, C>;
|
|
228
313
|
type EntityDataItem<T, C extends boolean> = C extends false ? T | EntityDataProp<T, C> | null : EntityDataProp<T, C> | null;
|
|
229
314
|
export type RequiredEntityDataNested<T, O, C extends boolean> = T extends any[] ? Readonly<T> : RequiredEntityData<T, O> | ExpandRequiredEntityProp<T, O, C>;
|
|
@@ -235,12 +320,15 @@ type ExplicitlyOptionalProps<T> = (T extends {
|
|
|
235
320
|
type NullableKeys<T, V = null> = {
|
|
236
321
|
[K in keyof T]: V extends T[K] ? K : never;
|
|
237
322
|
}[keyof T];
|
|
238
|
-
type
|
|
239
|
-
|
|
323
|
+
type RequiredNullableKeys<T> = {
|
|
324
|
+
[K in keyof T]: Exclude<T[K], null> extends RequiredNullable.Brand ? K : never;
|
|
325
|
+
}[keyof T];
|
|
326
|
+
type ProbablyOptionalProps<T> = PrimaryProperty<T> | ExplicitlyOptionalProps<T> | Exclude<NonNullable<NullableKeys<T, null | undefined>>, RequiredNullableKeys<T>>;
|
|
327
|
+
type IsOptional<T, K extends keyof T, I> = T[K] extends CollectionShape ? true : ExtractType<T[K]> extends I ? true : K extends ProbablyOptionalProps<T> ? true : false;
|
|
240
328
|
type RequiredKeys<T, K extends keyof T, I> = IsOptional<T, K, I> extends false ? CleanKeys<T, K> : never;
|
|
241
329
|
type OptionalKeys<T, K extends keyof T, I> = IsOptional<T, K, I> extends false ? never : CleanKeys<T, K>;
|
|
242
330
|
export type EntityData<T, C extends boolean = false> = {
|
|
243
|
-
[K in EntityKey<T>]?: EntityDataItem<T[K], C>;
|
|
331
|
+
[K in EntityKey<T>]?: EntityDataItem<T[K] & {}, C>;
|
|
244
332
|
};
|
|
245
333
|
export type RequiredEntityData<T, I = never, C extends boolean = false> = {
|
|
246
334
|
[K in keyof T as RequiredKeys<T, K, I>]: T[K] | RequiredEntityDataProp<T[K], T, C> | Primary<T[K]>;
|
|
@@ -270,7 +358,7 @@ export type Ref<T> = T extends any ? IsAny<T> extends true ? Reference<T & objec
|
|
|
270
358
|
type ExtractHiddenProps<T> = (T extends {
|
|
271
359
|
[HiddenProps]?: infer K;
|
|
272
360
|
} ? K : never) | ({
|
|
273
|
-
[K in keyof T]: T[K] extends Hidden ? K : never;
|
|
361
|
+
[K in keyof T]: T[K] extends Primitive ? (T[K] extends Hidden ? K : never) : never;
|
|
274
362
|
}[keyof T] & {});
|
|
275
363
|
type ExcludeHidden<T, K extends keyof T> = K extends ExtractHiddenProps<T> ? never : K;
|
|
276
364
|
type ExtractConfig<T> = T extends {
|
|
@@ -282,9 +370,12 @@ type PrimaryOrObject<T, U, C extends TypeConfig> = PreferExplicitConfig<C, Extra
|
|
|
282
370
|
} : Primary<U>;
|
|
283
371
|
export type EntityDTOProp<E, T, C extends TypeConfig = never> = T extends Scalar ? T : T extends {
|
|
284
372
|
__serialized?: infer U;
|
|
285
|
-
} ? U : T extends
|
|
286
|
-
type
|
|
287
|
-
|
|
373
|
+
} ? (IsUnknown<U> extends false ? U : T) : T extends LoadedReferenceShape<infer U> ? EntityDTO<U, C> : T extends ReferenceShape<infer U> ? PrimaryOrObject<E, U, C> : T extends ScalarReference<infer U> ? U : T extends LoadedCollectionShape<infer U> ? EntityDTO<U & object, C>[] : T extends CollectionShape<infer U> ? PrimaryOrObject<E, U & object, C>[] : T extends readonly (infer U)[] ? U extends Scalar ? T : EntityDTOProp<E, U, C>[] : T extends Relation<T> ? EntityDTO<T, C> : T;
|
|
374
|
+
type UnwrapLoadedEntity<T> = T extends {
|
|
375
|
+
[__loadedType]?: infer U;
|
|
376
|
+
} ? NonNullable<U> : T;
|
|
377
|
+
type DTOProbablyOptionalProps<T> = NonNullable<NullableKeys<UnwrapLoadedEntity<T>, undefined>>;
|
|
378
|
+
type DTOIsOptional<T, K extends keyof T> = T[K] extends LoadedCollectionShape ? false : K extends PrimaryProperty<UnwrapLoadedEntity<T>> ? false : K extends DTOProbablyOptionalProps<T> ? true : false;
|
|
288
379
|
type DTORequiredKeys<T, K extends keyof T> = DTOIsOptional<T, K> extends false ? ExcludeHidden<T, K> & CleanKeys<T, K> : never;
|
|
289
380
|
type DTOOptionalKeys<T, K extends keyof T> = DTOIsOptional<T, K> extends false ? never : ExcludeHidden<T, K> & CleanKeys<T, K>;
|
|
290
381
|
export type EntityDTO<T, C extends TypeConfig = never> = {
|
|
@@ -292,7 +383,23 @@ export type EntityDTO<T, C extends TypeConfig = never> = {
|
|
|
292
383
|
} & {
|
|
293
384
|
[K in keyof T as DTOOptionalKeys<T, K>]?: EntityDTOProp<T, T[K], C> | AddOptional<T[K]>;
|
|
294
385
|
};
|
|
295
|
-
|
|
386
|
+
type TargetKeys<T> = T extends EntityClass<infer P> ? keyof P : keyof T;
|
|
387
|
+
type PropertyName<T> = IsUnknown<T> extends false ? TargetKeys<T> : string;
|
|
388
|
+
type TableName = {
|
|
389
|
+
name: string;
|
|
390
|
+
schema?: string;
|
|
391
|
+
toString: () => string;
|
|
392
|
+
};
|
|
393
|
+
export type FormulaTable = {
|
|
394
|
+
alias: string;
|
|
395
|
+
name: string;
|
|
396
|
+
schema?: string;
|
|
397
|
+
qualifiedName: string;
|
|
398
|
+
toString: () => string;
|
|
399
|
+
};
|
|
400
|
+
export type IndexCallback<T> = (table: TableName, columns: Record<PropertyName<T>, string>, indexName: string) => string | Raw;
|
|
401
|
+
export type FormulaCallback<T> = (table: FormulaTable, columns: Record<PropertyName<T>, string>) => string;
|
|
402
|
+
export type CheckCallback<T> = (columns: Record<PropertyName<T>, string>) => string;
|
|
296
403
|
export type GeneratedColumnCallback<T> = (columns: Record<keyof T, string>) => string;
|
|
297
404
|
export interface CheckConstraint<T = any> {
|
|
298
405
|
name?: string;
|
|
@@ -303,6 +410,7 @@ export type AnyString = string & {};
|
|
|
303
410
|
export interface EntityProperty<Owner = any, Target = any> {
|
|
304
411
|
name: EntityKey<Owner>;
|
|
305
412
|
entity: () => EntityName<Owner>;
|
|
413
|
+
target: EntityClass<Target>;
|
|
306
414
|
type: keyof typeof types | AnyString;
|
|
307
415
|
runtimeType: 'number' | 'string' | 'boolean' | 'bigint' | 'Buffer' | 'Date' | 'object' | 'any' | AnyString;
|
|
308
416
|
targetMeta?: EntityMetadata<Target>;
|
|
@@ -328,7 +436,8 @@ export interface EntityProperty<Owner = any, Target = any> {
|
|
|
328
436
|
fieldNameRaw?: string;
|
|
329
437
|
default?: string | number | boolean | null;
|
|
330
438
|
defaultRaw?: string;
|
|
331
|
-
formula?:
|
|
439
|
+
formula?: FormulaCallback<Owner>;
|
|
440
|
+
filters?: FilterOptions;
|
|
332
441
|
prefix?: string | boolean;
|
|
333
442
|
prefixMode?: EmbeddedPrefixMode;
|
|
334
443
|
embedded?: [EntityKey<Owner>, EntityKey<Owner>];
|
|
@@ -341,11 +450,13 @@ export interface EntityProperty<Owner = any, Target = any> {
|
|
|
341
450
|
unique?: boolean | string;
|
|
342
451
|
nullable?: boolean;
|
|
343
452
|
inherited?: boolean;
|
|
453
|
+
renamedFrom?: string;
|
|
454
|
+
stiFieldNames?: string[];
|
|
455
|
+
stiFieldNameMap?: Dictionary<string>;
|
|
344
456
|
unsigned?: boolean;
|
|
345
457
|
mapToPk?: boolean;
|
|
346
458
|
persist?: boolean;
|
|
347
459
|
hydrate?: boolean;
|
|
348
|
-
trackChanges?: boolean;
|
|
349
460
|
hidden?: boolean;
|
|
350
461
|
enum?: boolean;
|
|
351
462
|
items?: (number | string)[];
|
|
@@ -356,6 +467,7 @@ export interface EntityProperty<Owner = any, Target = any> {
|
|
|
356
467
|
setter?: boolean;
|
|
357
468
|
getter?: boolean;
|
|
358
469
|
getterName?: keyof Owner;
|
|
470
|
+
accessor?: EntityKey<Owner>;
|
|
359
471
|
cascade: Cascade[];
|
|
360
472
|
orphanRemoval?: boolean;
|
|
361
473
|
onCreate?: (entity: Owner, em: EntityManager) => any;
|
|
@@ -372,13 +484,14 @@ export interface EntityProperty<Owner = any, Target = any> {
|
|
|
372
484
|
fixedOrder?: boolean;
|
|
373
485
|
fixedOrderColumn?: string;
|
|
374
486
|
pivotTable: string;
|
|
375
|
-
pivotEntity:
|
|
487
|
+
pivotEntity: EntityClass<Target>;
|
|
376
488
|
joinColumns: string[];
|
|
377
489
|
ownColumns: string[];
|
|
378
490
|
inverseJoinColumns: string[];
|
|
379
491
|
referencedColumnNames: string[];
|
|
380
492
|
referencedTableName: string;
|
|
381
493
|
referencedPKs: EntityKey<Owner>[];
|
|
494
|
+
targetKey?: string;
|
|
382
495
|
serializer?: (value: any, options?: SerializeOptions<any>) => any;
|
|
383
496
|
serializedName?: string;
|
|
384
497
|
comment?: string;
|
|
@@ -388,18 +501,22 @@ export interface EntityProperty<Owner = any, Target = any> {
|
|
|
388
501
|
optional?: boolean;
|
|
389
502
|
ignoreSchemaChanges?: ('type' | 'extra' | 'default')[];
|
|
390
503
|
deferMode?: DeferMode;
|
|
504
|
+
createForeignKeyConstraint: boolean;
|
|
505
|
+
foreignKeyName?: string;
|
|
391
506
|
}
|
|
392
|
-
export declare class EntityMetadata<
|
|
507
|
+
export declare class EntityMetadata<Entity = any, Class extends EntityCtor<Entity> = EntityCtor<Entity>> {
|
|
393
508
|
private static counter;
|
|
394
509
|
readonly _id: number;
|
|
395
510
|
readonly propertyOrder: Map<string, number>;
|
|
396
511
|
constructor(meta?: Partial<EntityMetadata>);
|
|
397
|
-
addProperty(prop: Partial<EntityProperty<
|
|
512
|
+
addProperty(prop: Partial<EntityProperty<Entity>>): void;
|
|
398
513
|
removeProperty(name: string, sync?: boolean): void;
|
|
399
|
-
getPrimaryProps(): EntityProperty<
|
|
400
|
-
getPrimaryProp(): EntityProperty<
|
|
514
|
+
getPrimaryProps(flatten?: boolean): EntityProperty<Entity>[];
|
|
515
|
+
getPrimaryProp(): EntityProperty<Entity>;
|
|
516
|
+
createColumnMappingObject(): Record<PropertyName<Entity>, string>;
|
|
401
517
|
get tableName(): string;
|
|
402
518
|
set tableName(name: string);
|
|
519
|
+
get uniqueName(): string;
|
|
403
520
|
sync(initIndexes?: boolean, config?: Configuration): void;
|
|
404
521
|
private initIndexes;
|
|
405
522
|
/** @internal */
|
|
@@ -409,67 +526,74 @@ export interface SimpleColumnMeta {
|
|
|
409
526
|
name: string;
|
|
410
527
|
type: string;
|
|
411
528
|
}
|
|
412
|
-
export
|
|
529
|
+
export type EntityCtor<T = any> = abstract new (...args: any[]) => T;
|
|
530
|
+
export interface EntityMetadata<Entity = any, Class extends EntityCtor<Entity> = EntityCtor<Entity>> {
|
|
413
531
|
name?: string;
|
|
414
532
|
className: string;
|
|
415
533
|
tableName: string;
|
|
416
534
|
schema?: string;
|
|
417
535
|
pivotTable?: boolean;
|
|
418
536
|
virtual?: boolean;
|
|
419
|
-
|
|
420
|
-
|
|
537
|
+
/** True if this entity represents a database view (not a virtual entity). */
|
|
538
|
+
view?: boolean;
|
|
539
|
+
/** True if this is a materialized view (PostgreSQL only). Requires `view: true`. */
|
|
540
|
+
materialized?: boolean;
|
|
541
|
+
/** For materialized views, whether data is populated on creation. Defaults to true. */
|
|
542
|
+
withData?: boolean;
|
|
543
|
+
expression?: string | ((em: any, where: ObjectQuery<Entity>, options: FindOptions<Entity, any, any, any>, stream?: boolean) => MaybePromise<Raw | object | string>);
|
|
544
|
+
discriminatorColumn?: EntityKey<Entity> | AnyString;
|
|
421
545
|
discriminatorValue?: number | string;
|
|
422
|
-
discriminatorMap?: Dictionary<
|
|
546
|
+
discriminatorMap?: Dictionary<EntityClass>;
|
|
423
547
|
embeddable: boolean;
|
|
424
|
-
constructorParams
|
|
548
|
+
constructorParams?: (keyof Entity)[];
|
|
425
549
|
forceConstructor: boolean;
|
|
426
|
-
|
|
427
|
-
extends: string;
|
|
550
|
+
extends?: EntityName<Entity>;
|
|
428
551
|
collection: string;
|
|
429
552
|
path: string;
|
|
430
|
-
primaryKeys: EntityKey<
|
|
553
|
+
primaryKeys: EntityKey<Entity>[];
|
|
431
554
|
simplePK: boolean;
|
|
432
555
|
compositePK: boolean;
|
|
433
|
-
versionProperty: EntityKey<
|
|
434
|
-
concurrencyCheckKeys: Set<EntityKey<
|
|
435
|
-
serializedPrimaryKey
|
|
556
|
+
versionProperty: EntityKey<Entity>;
|
|
557
|
+
concurrencyCheckKeys: Set<EntityKey<Entity>>;
|
|
558
|
+
serializedPrimaryKey?: EntityKey<Entity>;
|
|
436
559
|
properties: {
|
|
437
|
-
[K in EntityKey<
|
|
560
|
+
[K in EntityKey<Entity>]: EntityProperty<Entity>;
|
|
438
561
|
};
|
|
439
|
-
props: EntityProperty<
|
|
440
|
-
relations: EntityProperty<
|
|
441
|
-
bidirectionalRelations: EntityProperty<
|
|
562
|
+
props: EntityProperty<Entity>[];
|
|
563
|
+
relations: EntityProperty<Entity>[];
|
|
564
|
+
bidirectionalRelations: EntityProperty<Entity>[];
|
|
442
565
|
referencingProperties: {
|
|
443
|
-
meta: EntityMetadata<
|
|
444
|
-
prop: EntityProperty<
|
|
566
|
+
meta: EntityMetadata<Entity>;
|
|
567
|
+
prop: EntityProperty<Entity>;
|
|
445
568
|
}[];
|
|
446
|
-
comparableProps: EntityProperty<
|
|
447
|
-
trackingProps: EntityProperty<
|
|
448
|
-
hydrateProps: EntityProperty<
|
|
449
|
-
|
|
450
|
-
|
|
569
|
+
comparableProps: EntityProperty<Entity>[];
|
|
570
|
+
trackingProps: EntityProperty<Entity>[];
|
|
571
|
+
hydrateProps: EntityProperty<Entity>[];
|
|
572
|
+
validateProps: EntityProperty<Entity>[];
|
|
573
|
+
uniqueProps: EntityProperty<Entity>[];
|
|
574
|
+
getterProps: EntityProperty<Entity>[];
|
|
451
575
|
indexes: {
|
|
452
|
-
properties
|
|
576
|
+
properties?: EntityKey<Entity> | EntityKey<Entity>[];
|
|
453
577
|
name?: string;
|
|
454
578
|
type?: string;
|
|
455
579
|
options?: Dictionary;
|
|
456
|
-
expression?: string
|
|
580
|
+
expression?: string | IndexCallback<Entity>;
|
|
457
581
|
}[];
|
|
458
582
|
uniques: {
|
|
459
|
-
properties
|
|
583
|
+
properties?: EntityKey<Entity> | EntityKey<Entity>[];
|
|
460
584
|
name?: string;
|
|
461
585
|
options?: Dictionary;
|
|
462
|
-
expression?: string
|
|
463
|
-
deferMode?: DeferMode
|
|
586
|
+
expression?: string | IndexCallback<Entity>;
|
|
587
|
+
deferMode?: DeferMode | `${DeferMode}`;
|
|
464
588
|
}[];
|
|
465
|
-
checks: CheckConstraint<
|
|
589
|
+
checks: CheckConstraint<Entity>[];
|
|
466
590
|
repositoryClass?: string;
|
|
467
591
|
repository: () => EntityClass<EntityRepository<any>>;
|
|
468
592
|
hooks: {
|
|
469
|
-
[K in EventType]?: (keyof
|
|
593
|
+
[K in EventType]?: (keyof Entity | EventSubscriber<Entity>[EventType])[];
|
|
470
594
|
};
|
|
471
|
-
prototype:
|
|
472
|
-
class:
|
|
595
|
+
prototype: Entity;
|
|
596
|
+
class: Class;
|
|
473
597
|
abstract: boolean;
|
|
474
598
|
filters: Dictionary<FilterDef>;
|
|
475
599
|
comment?: string;
|
|
@@ -477,8 +601,9 @@ export interface EntityMetadata<T = any> {
|
|
|
477
601
|
hasUniqueProps?: boolean;
|
|
478
602
|
readonly?: boolean;
|
|
479
603
|
polymorphs?: EntityMetadata[];
|
|
480
|
-
root: EntityMetadata<
|
|
604
|
+
root: EntityMetadata<Entity>;
|
|
481
605
|
definedProperties: Dictionary;
|
|
606
|
+
hasTriggers?: boolean;
|
|
482
607
|
/** @internal can be used for computed numeric cache keys */
|
|
483
608
|
readonly _id: number;
|
|
484
609
|
}
|
|
@@ -489,6 +614,7 @@ export interface CreateSchemaOptions {
|
|
|
489
614
|
export interface ClearDatabaseOptions {
|
|
490
615
|
schema?: string;
|
|
491
616
|
truncate?: boolean;
|
|
617
|
+
clearIdentityMap?: boolean;
|
|
492
618
|
}
|
|
493
619
|
export interface EnsureDatabaseOptions extends CreateSchemaOptions, ClearDatabaseOptions {
|
|
494
620
|
clear?: boolean;
|
|
@@ -516,25 +642,25 @@ export interface RefreshDatabaseOptions extends CreateSchemaOptions {
|
|
|
516
642
|
createSchema?: boolean;
|
|
517
643
|
}
|
|
518
644
|
export interface ISchemaGenerator {
|
|
519
|
-
|
|
520
|
-
|
|
645
|
+
create(options?: CreateSchemaOptions): Promise<void>;
|
|
646
|
+
update(options?: UpdateSchemaOptions): Promise<void>;
|
|
647
|
+
drop(options?: DropSchemaOptions): Promise<void>;
|
|
648
|
+
refresh(options?: RefreshDatabaseOptions): Promise<void>;
|
|
649
|
+
clear(options?: ClearDatabaseOptions): Promise<void>;
|
|
650
|
+
execute(sql: string, options?: {
|
|
651
|
+
wrap?: boolean;
|
|
652
|
+
}): Promise<void>;
|
|
521
653
|
getCreateSchemaSQL(options?: CreateSchemaOptions): Promise<string>;
|
|
522
|
-
dropSchema(options?: DropSchemaOptions): Promise<void>;
|
|
523
654
|
getDropSchemaSQL(options?: Omit<DropSchemaOptions, 'dropDb'>): Promise<string>;
|
|
524
|
-
updateSchema(options?: UpdateSchemaOptions): Promise<void>;
|
|
525
655
|
getUpdateSchemaSQL(options?: UpdateSchemaOptions): Promise<string>;
|
|
526
656
|
getUpdateSchemaMigrationSQL(options?: UpdateSchemaOptions): Promise<{
|
|
527
657
|
up: string;
|
|
528
658
|
down: string;
|
|
529
659
|
}>;
|
|
660
|
+
ensureDatabase(options?: EnsureDatabaseOptions): Promise<boolean>;
|
|
530
661
|
createDatabase(name?: string): Promise<void>;
|
|
531
662
|
dropDatabase(name?: string): Promise<void>;
|
|
532
|
-
execute(sql: string, options?: {
|
|
533
|
-
wrap?: boolean;
|
|
534
|
-
}): Promise<void>;
|
|
535
663
|
ensureIndexes(): Promise<void>;
|
|
536
|
-
refreshDatabase(options?: RefreshDatabaseOptions): Promise<void>;
|
|
537
|
-
clearDatabase(options?: ClearDatabaseOptions): Promise<void>;
|
|
538
664
|
}
|
|
539
665
|
export type ImportsResolver = (alias: string, basePath: string, extension: '.js' | '', originFileName: string) => {
|
|
540
666
|
path: string;
|
|
@@ -551,7 +677,10 @@ export interface GenerateOptions {
|
|
|
551
677
|
undefinedDefaults?: boolean;
|
|
552
678
|
bidirectionalRelations?: boolean;
|
|
553
679
|
identifiedReferences?: boolean;
|
|
554
|
-
|
|
680
|
+
entityDefinition?: 'decorators' | 'defineEntity' | 'entitySchema';
|
|
681
|
+
decorators?: 'es' | 'legacy';
|
|
682
|
+
inferEntityType?: boolean;
|
|
683
|
+
enumMode?: 'ts-enum' | 'union-type' | 'dictionary';
|
|
555
684
|
esmImport?: boolean;
|
|
556
685
|
scalarTypeInDecorator?: boolean;
|
|
557
686
|
scalarPropertiesForRelations?: 'always' | 'never' | 'smart';
|
|
@@ -611,26 +740,26 @@ export interface IMigrator {
|
|
|
611
740
|
/**
|
|
612
741
|
* Checks current schema for changes, generates new migration if there are any.
|
|
613
742
|
*/
|
|
614
|
-
|
|
743
|
+
create(path?: string, blank?: boolean, initial?: boolean, name?: string): Promise<MigrationResult>;
|
|
615
744
|
/**
|
|
616
745
|
* Checks current schema for changes.
|
|
617
746
|
*/
|
|
618
|
-
|
|
747
|
+
checkSchema(): Promise<boolean>;
|
|
619
748
|
/**
|
|
620
749
|
* Creates initial migration. This generates the schema based on metadata, and checks whether all the tables
|
|
621
750
|
* are already present. If yes, it will also automatically log the migration as executed.
|
|
622
751
|
* Initial migration can be created only if the schema is already aligned with the metadata, or when no schema
|
|
623
752
|
* is present - in such case regular migration would have the same effect.
|
|
624
753
|
*/
|
|
625
|
-
|
|
754
|
+
createInitial(path?: string): Promise<MigrationResult>;
|
|
626
755
|
/**
|
|
627
756
|
* Returns list of already executed migrations.
|
|
628
757
|
*/
|
|
629
|
-
|
|
758
|
+
getExecuted(): Promise<MigrationRow[]>;
|
|
630
759
|
/**
|
|
631
760
|
* Returns list of pending (not yet executed) migrations found in the migration directory.
|
|
632
761
|
*/
|
|
633
|
-
|
|
762
|
+
getPending(): Promise<UmzugMigration[]>;
|
|
634
763
|
/**
|
|
635
764
|
* Executes specified migrations. Without parameter it will migrate up to the latest version.
|
|
636
765
|
*/
|
|
@@ -679,12 +808,17 @@ export interface MigrationObject {
|
|
|
679
808
|
name: string;
|
|
680
809
|
class: Constructor<Migration>;
|
|
681
810
|
}
|
|
682
|
-
|
|
811
|
+
type EntityFromInput<T> = T extends readonly EntityName<infer U>[] ? U : T extends EntityName<infer U> ? U : never;
|
|
812
|
+
type FilterDefResolved<T extends object = any> = {
|
|
683
813
|
name: string;
|
|
684
|
-
cond:
|
|
814
|
+
cond: FilterQuery<T> | ((args: Dictionary, type: 'read' | 'update' | 'delete', em: any, options?: FindOptions<T, any, any, any> | FindOneOptions<T, any, any, any>, entityName?: string) => MaybePromise<FilterQuery<T>>);
|
|
685
815
|
default?: boolean;
|
|
686
|
-
entity?:
|
|
816
|
+
entity?: EntityName<T> | EntityName<T>[];
|
|
687
817
|
args?: boolean;
|
|
818
|
+
strict?: boolean;
|
|
819
|
+
};
|
|
820
|
+
export type FilterDef<T extends EntityName | readonly EntityName[] = any> = FilterDefResolved<EntityFromInput<T>> & {
|
|
821
|
+
entity?: T;
|
|
688
822
|
};
|
|
689
823
|
export type Populate<T, P extends string = never> = readonly AutoPath<T, P, `${PopulatePath}`>[] | false;
|
|
690
824
|
export type PopulateOptions<T> = {
|
|
@@ -692,41 +826,60 @@ export type PopulateOptions<T> = {
|
|
|
692
826
|
strategy?: LoadStrategy;
|
|
693
827
|
all?: boolean;
|
|
694
828
|
filter?: boolean;
|
|
829
|
+
joinType?: 'inner join' | 'left join';
|
|
695
830
|
children?: PopulateOptions<T[keyof T]>[];
|
|
831
|
+
/** When true, ignores `mapToPk` on the property and returns full entity data instead of just PKs. */
|
|
832
|
+
dataOnly?: boolean;
|
|
696
833
|
};
|
|
697
|
-
type
|
|
698
|
-
type ExtractType<T> = T extends Loadable<infer U> ? U : T;
|
|
834
|
+
type ExtractType<T> = T extends CollectionShape<infer U> ? U : T extends ReferenceShape<infer U> ? U : T extends Ref<infer U> ? U : T extends readonly (infer U)[] ? U : T;
|
|
699
835
|
type ExtractStringKeys<T> = {
|
|
700
|
-
[K in keyof T]
|
|
836
|
+
[K in keyof T]-?: CleanKeys<T, K>;
|
|
701
837
|
}[keyof T] & {};
|
|
702
|
-
|
|
838
|
+
/**
|
|
839
|
+
* Extracts string keys from an entity type, handling Collection/Reference wrappers.
|
|
840
|
+
* Simplified to just check `T extends object` since ExtractType handles the unwrapping.
|
|
841
|
+
*/
|
|
842
|
+
type StringKeys<T, E extends string = never> = T extends object ? ExtractStringKeys<ExtractType<T>> | E : never;
|
|
703
843
|
type GetStringKey<T, K extends StringKeys<T, string>, E extends string> = K extends keyof T ? ExtractType<T[K]> : (K extends E ? keyof T : never);
|
|
704
844
|
type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
705
845
|
type CollectionKeys<T> = T extends object ? {
|
|
706
|
-
[K in keyof T]
|
|
846
|
+
[K in keyof T]-?: T[K] extends CollectionShape ? IsAny<T[K]> extends true ? never : K & string : never;
|
|
707
847
|
}[keyof T] & {} : never;
|
|
708
|
-
export type AutoPath<O, P extends string | boolean, E extends string = never, D extends Prev[number] = 9> = P extends boolean ? P : [D] extends [never] ? never : P extends any ? P extends string ?
|
|
848
|
+
export type AutoPath<O, P extends string | boolean, E extends string = never, D extends Prev[number] = 9> = P extends boolean ? P : [D] extends [never] ? never : P extends any ? P extends string ? P extends `${infer A}.${infer B}` ? A extends StringKeys<O, E> ? `${A}.${AutoPath<NonNullable<GetStringKey<O, A, E>>, B, E, Prev[D]>}` : never : P extends StringKeys<O, E> ? (NonNullable<GetStringKey<O, P & StringKeys<O, E>, E>> extends unknown ? Exclude<P, `${string}.`> : never) | (StringKeys<NonNullable<GetStringKey<O, P & StringKeys<O, E>, E>>, E> extends never ? never : `${P & string}.`) : StringKeys<O, E> | `${CollectionKeys<O>}:ref` : never : never;
|
|
709
849
|
export type UnboxArray<T> = T extends any[] ? ArrayElement<T> : T;
|
|
710
850
|
export type ArrayElement<ArrayType extends unknown[]> = ArrayType extends (infer ElementType)[] ? ElementType : never;
|
|
711
|
-
export type ExpandProperty<T> = T extends
|
|
712
|
-
type LoadedLoadable<T, E extends object> = T extends
|
|
851
|
+
export type ExpandProperty<T> = T extends ReferenceShape<infer U> ? NonNullable<U> : T extends CollectionShape<infer U> ? NonNullable<U> : T extends (infer U)[] ? NonNullable<U> : NonNullable<T>;
|
|
852
|
+
type LoadedLoadable<T, E extends object> = T extends CollectionShape ? LoadedCollection<E> : T extends ScalarReference<infer U> ? LoadedScalarReference<U> : T extends ReferenceShape ? T & LoadedReference<E> : T extends Scalar ? T : T extends (infer U)[] ? U extends Scalar ? T : E[] : E;
|
|
713
853
|
type IsTrue<T> = IsNever<T> extends true ? false : T extends boolean ? T extends true ? true : false : false;
|
|
714
854
|
type StringLiteral<T> = T extends string ? string extends T ? never : T : never;
|
|
715
855
|
type Prefix<T, K> = K extends `${infer S}.${string}` ? S : (K extends '*' ? keyof T : K);
|
|
716
856
|
type IsPrefixedExclude<T, K extends keyof T, E extends string> = K extends E ? never : K;
|
|
717
|
-
export type IsPrefixed<T, K extends keyof T, L extends string, E extends string = never> = IsNever<E> extends false ? IsPrefixedExclude<T, K, E> : K extends symbol ? never : IsTrue<L> extends true ? (T[K] & {} extends
|
|
857
|
+
export type IsPrefixed<T, K extends keyof T, L extends string, E extends string = never> = IsNever<E> extends false ? IsPrefixedExclude<T, K, E> : K extends symbol ? never : IsTrue<L> extends true ? (T[K] & {} extends LoadableShape ? K : never) : IsNever<StringLiteral<L>> extends true ? never : L extends '*' ? K : K extends Prefix<T, L> ? K : K extends PrimaryProperty<T> ? K : never;
|
|
718
858
|
type Suffix<Key, Hint extends string, All = true | '*'> = Hint extends `${infer Pref}.${infer Suf}` ? (Pref extends Key ? Suf : never) : Hint extends All ? Hint : never;
|
|
719
|
-
export type IsSubset<T, U> = keyof U extends keyof T ? {} :
|
|
859
|
+
export type IsSubset<T, U> = keyof U extends keyof T ? {} : string extends keyof U ? {} : {
|
|
720
860
|
[K in keyof U as K extends keyof T ? never : CleanKeys<U, K>]: never;
|
|
721
861
|
};
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
type
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
862
|
+
/**
|
|
863
|
+
* Fast check if T is a Loaded type by looking for the marker symbol.
|
|
864
|
+
* This is much cheaper than matching against the full Loaded structure.
|
|
865
|
+
*/
|
|
866
|
+
type IsLoadedType<T> = T extends {
|
|
867
|
+
[__loadedType]?: any;
|
|
868
|
+
} ? true : false;
|
|
869
|
+
/**
|
|
870
|
+
* Optimized MergeSelected using intersection instead of extraction.
|
|
871
|
+
* When T is already Loaded, we intersect with a new Loaded type for the selected fields.
|
|
872
|
+
* This avoids the expensive pattern matching needed to extract hints from Loaded types.
|
|
873
|
+
*/
|
|
874
|
+
export type MergeSelected<T, U, F extends string> = IsLoadedType<T> extends true ? T & Loaded<U, never, F, never> : T;
|
|
875
|
+
/**
|
|
876
|
+
* Optimized MergeLoaded using intersection instead of extraction.
|
|
877
|
+
* When T is already Loaded, we intersect with a new Loaded type for the additional hints.
|
|
878
|
+
* This avoids the expensive pattern matching needed to extract hints from Loaded types.
|
|
879
|
+
* Used for `em.populate` and `em.refresh`.
|
|
880
|
+
*/
|
|
881
|
+
export type MergeLoaded<T, U, P extends string, F extends string, E extends string, R extends boolean = false> = IsLoadedType<T> extends true ? T & Loaded<U, P, F, E> : Loaded<T, P, F, E>;
|
|
882
|
+
export type AddOptional<T> = undefined | null extends T ? null | undefined : null extends T ? null : undefined extends T ? undefined : never;
|
|
730
883
|
type LoadedProp<T, L extends string = never, F extends string = '*', E extends string = never> = LoadedLoadable<T, Loaded<ExtractType<T>, L, F, E>>;
|
|
731
884
|
export type AddEager<T> = ExtractEagerProps<T> & string;
|
|
732
885
|
export type ExpandHint<T, L extends string> = L | AddEager<T>;
|
|
@@ -753,9 +906,11 @@ type LoadedInternal<T, L extends string = never, F extends string = '*', E exten
|
|
|
753
906
|
} : Selected<T, L, F>;
|
|
754
907
|
/**
|
|
755
908
|
* Represents entity with its loaded relations (`populate` hint) and selected properties (`fields` hint).
|
|
909
|
+
* The __loadHint marker uses contravariance to ensure Loaded<A, 'b'> is NOT assignable to Loaded<A, 'b.c'>.
|
|
756
910
|
*/
|
|
757
911
|
export type Loaded<T, L extends string = never, F extends string = '*', E extends string = never> = LoadedInternal<T, L, F, E> & {
|
|
758
912
|
[__loadedType]?: T;
|
|
913
|
+
[__loadHint]?: (hint: Prefixes<L>) => void;
|
|
759
914
|
};
|
|
760
915
|
export interface LoadedReference<T> extends Reference<NonNullable<T>> {
|
|
761
916
|
$: NonNullable<T>;
|
|
@@ -775,23 +930,23 @@ export interface Highlighter {
|
|
|
775
930
|
highlight(text: string): string;
|
|
776
931
|
}
|
|
777
932
|
export interface IMetadataStorage {
|
|
778
|
-
getAll():
|
|
779
|
-
get<T = any>(entity:
|
|
780
|
-
find<T = any>(entity:
|
|
781
|
-
has(entity:
|
|
782
|
-
set(entity:
|
|
783
|
-
reset(entity:
|
|
933
|
+
getAll(): Map<EntityName, EntityMetadata>;
|
|
934
|
+
get<T = any>(entity: EntityName<T>, init?: boolean, validate?: boolean): EntityMetadata<T>;
|
|
935
|
+
find<T = any>(entity: EntityName<T>): EntityMetadata<T> | undefined;
|
|
936
|
+
has<T>(entity: EntityName<T>): boolean;
|
|
937
|
+
set<T>(entity: EntityName<T>, meta: EntityMetadata): EntityMetadata;
|
|
938
|
+
reset<T>(entity: EntityName<T>): void;
|
|
784
939
|
}
|
|
785
940
|
export interface IHydrator {
|
|
786
941
|
/**
|
|
787
942
|
* Hydrates the whole entity. This process handles custom type conversions, creating missing Collection instances,
|
|
788
943
|
* mapping FKs to entity instances, as well as merging those entities.
|
|
789
944
|
*/
|
|
790
|
-
hydrate<T extends object>(entity: T, meta: EntityMetadata<T>, data: EntityData<T>, factory: EntityFactory, type: 'full' | 'reference', newEntity?: boolean, convertCustomTypes?: boolean, schema?: string, parentSchema?: string): void;
|
|
945
|
+
hydrate<T extends object>(entity: T, meta: EntityMetadata<T>, data: EntityData<T>, factory: EntityFactory, type: 'full' | 'reference', newEntity?: boolean, convertCustomTypes?: boolean, schema?: string, parentSchema?: string, normalizeAccessors?: boolean): void;
|
|
791
946
|
/**
|
|
792
947
|
* Hydrates primary keys only
|
|
793
948
|
*/
|
|
794
|
-
hydrateReference<T extends object>(entity: T, meta: EntityMetadata<T>, data: EntityData<T>, factory: EntityFactory, convertCustomTypes?: boolean, schema?: string, parentSchema?: string): void;
|
|
949
|
+
hydrateReference<T extends object>(entity: T, meta: EntityMetadata<T>, data: EntityData<T>, factory: EntityFactory, convertCustomTypes?: boolean, schema?: string, parentSchema?: string, normalizeAccessors?: boolean): void;
|
|
795
950
|
isRunning(): boolean;
|
|
796
951
|
}
|
|
797
952
|
export interface HydratorConstructor {
|
|
@@ -801,17 +956,22 @@ export interface ISeedManager {
|
|
|
801
956
|
seed(...classNames: Constructor<Seeder>[]): Promise<void>;
|
|
802
957
|
/** @internal */
|
|
803
958
|
seedString(...classNames: string[]): Promise<void>;
|
|
804
|
-
|
|
959
|
+
create(className: string): Promise<string>;
|
|
805
960
|
}
|
|
806
961
|
export interface Seeder<T extends Dictionary = Dictionary> {
|
|
807
962
|
run(em: EntityManager, context?: T): void | Promise<void>;
|
|
808
963
|
}
|
|
809
964
|
export type ConnectionType = 'read' | 'write';
|
|
810
965
|
export type MetadataProcessor = (metadata: EntityMetadata[], platform: Platform) => MaybePromise<void>;
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
966
|
+
export type MaybeReturnType<T> = T extends (...args: any[]) => infer R ? R : T;
|
|
967
|
+
export interface EntitySchemaWithMeta<TName extends string = string, TTableName extends string = string, TEntity = any, TBase = never, TProperties extends Record<string, any> = Record<string, any>, TClass extends EntityCtor = EntityCtor<TEntity>> extends EntitySchema<TEntity, TBase, TClass> {
|
|
968
|
+
readonly name: TName;
|
|
969
|
+
readonly properties: TProperties;
|
|
970
|
+
readonly tableName: TTableName;
|
|
971
|
+
/** @internal Direct entity type access - avoids expensive pattern matching */
|
|
972
|
+
readonly '~entity': TEntity;
|
|
973
|
+
}
|
|
974
|
+
export type InferEntity<Schema> = Schema extends {
|
|
975
|
+
'~entity': infer E;
|
|
976
|
+
} ? E : Schema extends EntitySchema<infer Entity> ? Entity : Schema extends EntityClass<infer Entity> ? Entity : Schema;
|
|
817
977
|
export {};
|