@mikro-orm/core 7.2.6-dev.20 → 7.2.6-dev.22
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 +16 -11
- package/package.json +1 -1
- package/utils/Utils.js +1 -1
package/entity/defineEntity.d.ts
CHANGED
|
@@ -630,6 +630,21 @@ type AllKeys<TProperties, TBase> = keyof TProperties | (IsNever<TBase> extends t
|
|
|
630
630
|
type PartialWhere<TProperties, TBase> = string | FilterQuery<{
|
|
631
631
|
[K in AllKeys<TProperties, TBase> & string]?: unknown;
|
|
632
632
|
}>;
|
|
633
|
+
type DefineEntityFilterMap = Dictionary<{
|
|
634
|
+
name: string;
|
|
635
|
+
cond: Dictionary | ((args: Dictionary, type: 'read' | 'update' | 'delete', em: any, options?: FindOptions<any, any, any, any> | FindOneOptions<any, any, any, any>, entityName?: string) => MaybePromise<FilterQuery<any>>);
|
|
636
|
+
default?: boolean;
|
|
637
|
+
entity?: EntityName<any> | EntityName<any>[];
|
|
638
|
+
args?: boolean;
|
|
639
|
+
strict?: boolean;
|
|
640
|
+
rls?: boolean | {
|
|
641
|
+
setting?: string;
|
|
642
|
+
};
|
|
643
|
+
}>;
|
|
644
|
+
type DefineEntityFilterMapLoose = Dictionary<{
|
|
645
|
+
name: string;
|
|
646
|
+
cond: Dictionary;
|
|
647
|
+
}>;
|
|
633
648
|
/** Metadata descriptor for `defineEntity()`, combining entity options with property definitions. */
|
|
634
649
|
export interface EntityMetadataWithProperties<TName extends string, TTableName extends string, TProperties extends Record<string, any>, TPK extends (keyof TProperties)[] | undefined = undefined, TBase = never, TRepository = never, TForceObject extends boolean = false, TDiscriminatorColumn extends string | undefined = undefined, TDiscriminatorValue extends string | number | undefined = undefined, TBaseDiscriminatorColumn extends string | undefined = undefined, TEmbeddable extends boolean = false> extends Omit<Partial<EntityMetadata<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>>>, 'properties' | 'extends' | 'primaryKeys' | 'hooks' | 'discriminator' | 'discriminatorColumn' | 'discriminatorValue' | 'versionProperty' | 'concurrencyCheckKeys' | 'serializedPrimaryKey' | 'indexes' | 'uniques' | 'triggers' | 'repository' | 'filters' | 'orderBy'> {
|
|
635
650
|
name: TName;
|
|
@@ -644,17 +659,7 @@ export interface EntityMetadataWithProperties<TName extends string, TTableName e
|
|
|
644
659
|
primaryKeys?: TPK & NoInfer<InferPrimaryKeyConstraint<TProperties>>[];
|
|
645
660
|
hooks?: DefineEntityHooks;
|
|
646
661
|
repository?: () => TRepository;
|
|
647
|
-
filters?:
|
|
648
|
-
name: string;
|
|
649
|
-
cond: Dictionary | ((args: Dictionary, type: 'read' | 'update' | 'delete', em: any, options?: FindOptions<any, any, any, any> | FindOneOptions<any, any, any, any>, entityName?: string) => MaybePromise<FilterQuery<any>>);
|
|
650
|
-
default?: boolean;
|
|
651
|
-
entity?: EntityName<any> | EntityName<any>[];
|
|
652
|
-
args?: boolean;
|
|
653
|
-
strict?: boolean;
|
|
654
|
-
rls?: boolean | {
|
|
655
|
-
setting?: string;
|
|
656
|
-
};
|
|
657
|
-
}>;
|
|
662
|
+
filters?: DefineEntityFilterMap | IsNever<TRepository, never, DefineEntityFilterMapLoose>;
|
|
658
663
|
forceObject?: TForceObject;
|
|
659
664
|
embeddable?: TEmbeddable;
|
|
660
665
|
inheritance?: 'tpt';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "7.2.6-dev.
|
|
3
|
+
"version": "7.2.6-dev.22",
|
|
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
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
package/utils/Utils.js
CHANGED
|
@@ -153,7 +153,7 @@ export function parseJsonSafe(value) {
|
|
|
153
153
|
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
154
154
|
export class Utils {
|
|
155
155
|
static PK_SEPARATOR = '~~~';
|
|
156
|
-
static #ORM_VERSION = '7.2.6-dev.
|
|
156
|
+
static #ORM_VERSION = '7.2.6-dev.22';
|
|
157
157
|
/** Default session variable name backing an RLS filter argument (`current_setting('mikro.<filter>.<arg>')`). */
|
|
158
158
|
static getRlsSettingName(filterName, argName) {
|
|
159
159
|
return `mikro.${filterName}.${argName}`;
|