@mikro-orm/core
Advanced tools
@@ -11,3 +11,3 @@ import { type Ref } from './Reference.js'; | ||
| populated(populated?: boolean): void; | ||
| populate<Entity extends this = this, Hint extends string = never>(populate: AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity>): Promise<Loaded<Entity, Hint>>; | ||
| populate<Entity extends this = this, Hint extends string = never, Fields extends string = never>(populate: AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity, Fields>): Promise<Loaded<Entity, Hint>>; | ||
| toReference<Entity extends this = this>(): Ref<Entity> & LoadedReference<Loaded<Entity, AddEager<Entity>>>; | ||
@@ -14,0 +14,0 @@ /** |
@@ -1,11 +0,11 @@ | ||
| import type { AnyEntity, ConnectionType, EntityName, EntityProperty, FilterQuery, PopulateOptions } from '../typings.js'; | ||
| import type { AnyEntity, AutoPath, ConnectionType, EntityName, EntityProperty, FilterQuery, PopulateOptions } from '../typings.js'; | ||
| import type { EntityManager } from '../EntityManager.js'; | ||
| import { LoadStrategy, type LockMode, type PopulateHint, PopulatePath, type QueryOrderMap } from '../enums.js'; | ||
| import type { EntityField, FilterOptions } from '../drivers/IDatabaseDriver.js'; | ||
| import type { FilterOptions } from '../drivers/IDatabaseDriver.js'; | ||
| import type { LoggingOptions } from '../logging/Logger.js'; | ||
| export type EntityLoaderOptions<Entity, Fields extends string = PopulatePath.ALL, Excludes extends string = never> = { | ||
| export interface EntityLoaderOptions<Entity, Fields extends string = PopulatePath.ALL, Excludes extends string = never> { | ||
| fields?: readonly AutoPath<Entity, Fields, `${PopulatePath.ALL}`>[]; | ||
| exclude?: readonly AutoPath<Entity, Excludes>[]; | ||
| where?: FilterQuery<Entity>; | ||
| populateWhere?: PopulateHint | `${PopulateHint}`; | ||
| fields?: readonly EntityField<Entity, Fields>[]; | ||
| exclude?: readonly EntityField<Entity, Excludes>[]; | ||
| orderBy?: QueryOrderMap<Entity> | QueryOrderMap<Entity>[]; | ||
@@ -23,3 +23,3 @@ refresh?: boolean; | ||
| logging?: LoggingOptions; | ||
| }; | ||
| } | ||
| export declare class EntityLoader { | ||
@@ -26,0 +26,0 @@ private readonly em; |
@@ -153,3 +153,3 @@ import type { PopulatePath } from '../enums.js'; | ||
| */ | ||
| populate<Ent extends Entity | Entity[], Hint extends string = never, Naked extends FromEntityType<Entity> = FromEntityType<Entity>, Fields extends string = '*', Excludes extends string = never>(entities: Ent, populate: AutoPath<Naked, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Naked, Fields, Excludes>): Promise<Ent extends object[] ? MergeLoaded<ArrayElement<Ent>, Naked, Hint, Fields, Excludes>[] : MergeLoaded<Ent, Naked, Hint, Fields, Excludes>>; | ||
| populate<Ent extends Entity | Entity[], Hint extends string = never, Naked extends FromEntityType<Entity> = FromEntityType<Entity>, Fields extends string = never, Excludes extends string = never>(entities: Ent, populate: AutoPath<Naked, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Naked, Fields, Excludes>): Promise<Ent extends object[] ? MergeLoaded<ArrayElement<Ent>, Naked, Hint, Fields, Excludes>[] : MergeLoaded<Ent, Naked, Hint, Fields, Excludes>>; | ||
| /** | ||
@@ -156,0 +156,0 @@ * Creates new instance of given entity and populates it with given data. |
@@ -52,3 +52,3 @@ import type { PopulatePath } from '../enums.js'; | ||
| init<Hint extends string = never, Fields extends string = '*', Excludes extends string = never>(options?: FindOneOptions<Entity, Hint, Fields, Excludes>): Promise<Loaded<Entity, Hint, Fields, Excludes> | null>; | ||
| populate<Hint extends string = never>(populate: AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity>): Promise<Loaded<Entity, Hint>>; | ||
| populate<Hint extends string = never, Fields extends string = never>(populate: AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity, Fields>): Promise<Loaded<Entity, Hint>>; | ||
| hasPrimaryKey(): boolean; | ||
@@ -55,0 +55,0 @@ getPrimaryKey(convertCustomTypes?: boolean): Primary<Entity> | null; |
@@ -459,3 +459,3 @@ import { type Configuration } from './utils/Configuration.js'; | ||
| */ | ||
| populate<Entity extends object, Naked extends FromEntityType<UnboxArray<Entity>> = FromEntityType<UnboxArray<Entity>>, Hint extends string = never, Fields extends string = '*', Excludes extends string = never>(entities: Entity, populate: readonly AutoPath<Naked, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Naked, Fields, Excludes>): Promise<Entity extends object[] ? MergeLoaded<ArrayElement<Entity>, Naked, Hint, Fields, Excludes>[] : MergeLoaded<Entity, Naked, Hint, Fields, Excludes>>; | ||
| populate<Entity extends object, Naked extends FromEntityType<UnboxArray<Entity>> = FromEntityType<UnboxArray<Entity>>, Hint extends string = never, Fields extends string = never, Excludes extends string = never>(entities: Entity, populate: readonly AutoPath<Naked, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Naked, Fields, Excludes>): Promise<Entity extends object[] ? MergeLoaded<ArrayElement<Entity>, Naked, Hint, Fields, Excludes>[] : MergeLoaded<Entity, Naked, Hint, Fields, Excludes>>; | ||
| /** | ||
@@ -462,0 +462,0 @@ * Returns new EntityManager instance with its own identity map |
+1
-1
| { | ||
| "name": "@mikro-orm/core", | ||
| "type": "module", | ||
| "version": "7.0.0-dev.265", | ||
| "version": "7.0.0-dev.266", | ||
| "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.", | ||
@@ -6,0 +6,0 @@ "exports": { |
@@ -61,6 +61,8 @@ import { helper, wrap } from '../entity/wrap.js'; | ||
| const populated = root.isMarkedAsPopulated(meta.class, prop); | ||
| const partiallyLoaded = root.isPartiallyLoaded(meta.class, prop); | ||
| const isPrimary = includePrimaryKeys && meta.properties[prop].primary; | ||
| if (!partiallyLoaded && !populated && !isPrimary) { | ||
| continue; | ||
| if (!raw) { | ||
| const partiallyLoaded = root.isPartiallyLoaded(meta.class, prop); | ||
| const isPrimary = includePrimaryKeys && meta.properties[prop].primary; | ||
| if (!partiallyLoaded && !populated && !isPrimary) { | ||
| continue; | ||
| } | ||
| } | ||
@@ -67,0 +69,0 @@ const cycle = root.visit(meta.class, prop); |
+1
-1
@@ -250,3 +250,3 @@ import type { Transaction } from './connections/Connection.js'; | ||
| populated(populated?: boolean): void; | ||
| populate<Hint extends string = never>(populate: readonly AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity>): Promise<Loaded<Entity, Hint>>; | ||
| populate<Hint extends string = never, Fields extends string = never>(populate: readonly AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity, Fields>): Promise<Loaded<Entity, Hint>>; | ||
| 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>; | ||
@@ -253,0 +253,0 @@ toReference(): Ref<Entity> & LoadedReference<Loaded<Entity, AddEager<Entity>>>; |
+1
-1
@@ -126,3 +126,3 @@ import { clone } from './clone.js'; | ||
| static PK_SEPARATOR = '~~~'; | ||
| static #ORM_VERSION = '7.0.0-dev.265'; | ||
| static #ORM_VERSION = '7.0.0-dev.266'; | ||
| /** | ||
@@ -129,0 +129,0 @@ * Checks if the argument is instance of `Object`. Returns false for arrays. |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1272585
0.02%28080
0.01%94
-1.05%