@mikro-orm/core 6.6.3-dev.1 → 6.6.3-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/entity/defineEntity.d.ts +26 -7
- package/package.json +2 -2
package/entity/defineEntity.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ManyToOneOptions } from '../decorators/ManyToOne';
|
|
|
6
6
|
import type { OneToManyOptions } from '../decorators/OneToMany';
|
|
7
7
|
import type { OneToOneOptions } from '../decorators/OneToOne';
|
|
8
8
|
import type { ManyToManyOptions } from '../decorators/ManyToMany';
|
|
9
|
-
import type { AnyString, GeneratedColumnCallback, Constructor, CheckCallback, FilterQuery, EntityName, Dictionary, EntityMetadata, PrimaryKeyProp, Hidden, Opt, Primary, EntityClass, Ref } from '../typings';
|
|
9
|
+
import type { AnyString, GeneratedColumnCallback, Constructor, CheckCallback, FilterQuery, EntityName, Dictionary, EntityMetadata, PrimaryKeyProp, Hidden, Opt, Primary, EntityClass, Ref, IndexCallback } from '../typings';
|
|
10
10
|
import type { ScalarReference } from './Reference';
|
|
11
11
|
import type { SerializeOptions } from '../serialization/EntitySerializer';
|
|
12
12
|
import type { Cascade, DeferMode, EventType, LoadStrategy, QueryOrderMap } from '../enums';
|
|
@@ -416,13 +416,32 @@ declare const propertyBuilders: {
|
|
|
416
416
|
interval: () => UniversalPropertyOptionsBuilder<string, EmptyOptions, IncludeKeysForProperty>;
|
|
417
417
|
unknown: () => UniversalPropertyOptionsBuilder<{}, EmptyOptions, IncludeKeysForProperty>;
|
|
418
418
|
};
|
|
419
|
-
export
|
|
419
|
+
export interface EntityMetadataWithProperties<TProperties extends Record<string, any>, TPK extends (keyof TProperties)[] | undefined = undefined, TBase = never> extends Omit<Partial<EntityMetadata<InferEntityFromProperties<TProperties, TPK>>>, 'properties' | 'extends' | 'primaryKeys' | 'hooks' | 'discriminatorColumn' | 'versionProperty' | 'concurrencyCheckKeys' | 'serializedPrimaryKey' | 'indexes' | 'uniques'> {
|
|
420
420
|
name: string;
|
|
421
|
-
extends?: EntityName<
|
|
422
|
-
properties:
|
|
423
|
-
primaryKeys?:
|
|
424
|
-
hooks?: DefineEntityHooks<InferEntityFromProperties<
|
|
425
|
-
|
|
421
|
+
extends?: EntityName<TBase>;
|
|
422
|
+
properties: TProperties | ((properties: typeof propertyBuilders) => TProperties);
|
|
423
|
+
primaryKeys?: TPK & InferPrimaryKey<TProperties>[];
|
|
424
|
+
hooks?: DefineEntityHooks<InferEntityFromProperties<TProperties, TPK>>;
|
|
425
|
+
discriminatorColumn?: keyof TProperties;
|
|
426
|
+
versionProperty?: keyof TProperties;
|
|
427
|
+
concurrencyCheckKeys?: Set<keyof TProperties>;
|
|
428
|
+
serializedPrimaryKey?: keyof TProperties;
|
|
429
|
+
indexes?: {
|
|
430
|
+
properties?: keyof TProperties | (keyof TProperties)[];
|
|
431
|
+
name?: string;
|
|
432
|
+
type?: string;
|
|
433
|
+
options?: Dictionary;
|
|
434
|
+
expression?: string | IndexCallback<InferEntityFromProperties<TProperties, TPK>>;
|
|
435
|
+
}[];
|
|
436
|
+
uniques?: {
|
|
437
|
+
properties?: keyof TProperties | (keyof TProperties)[];
|
|
438
|
+
name?: string;
|
|
439
|
+
options?: Dictionary;
|
|
440
|
+
expression?: string | IndexCallback<InferEntityFromProperties<TProperties, TPK>>;
|
|
441
|
+
deferMode?: DeferMode | `${DeferMode}`;
|
|
442
|
+
}[];
|
|
443
|
+
}
|
|
444
|
+
export declare function defineEntity<TProperties extends Record<string, any>, const TPK extends (keyof TProperties)[] | undefined = undefined, TBase = never>(meta: EntityMetadataWithProperties<TProperties, TPK, TBase>): EntitySchema<InferEntityFromProperties<TProperties, TPK>, TBase>;
|
|
426
445
|
export declare function defineEntity<Entity = any, Base = never>(meta: Omit<Partial<EntityMetadata<Entity>>, 'properties' | 'extends'> & {
|
|
427
446
|
class: EntityClass<Entity>;
|
|
428
447
|
extends?: EntityName<Base>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "6.6.3-dev.
|
|
3
|
+
"version": "6.6.3-dev.2",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"esprima": "4.0.1",
|
|
65
65
|
"fs-extra": "11.3.2",
|
|
66
66
|
"globby": "11.1.0",
|
|
67
|
-
"mikro-orm": "6.6.3-dev.
|
|
67
|
+
"mikro-orm": "6.6.3-dev.2",
|
|
68
68
|
"reflect-metadata": "0.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|