metal-orm 1.0.54 → 1.0.56
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/dist/index.cjs +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +96 -2
- package/dist/index.d.ts +96 -2
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/decorators/decorator-metadata.ts +21 -0
- package/src/decorators/index.ts +1 -0
- package/src/index.ts +4 -4
- package/src/orm/orm-session.ts +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -2353,6 +2353,80 @@ type EntityOrTableTarget = EntityConstructor | TableDef;
|
|
|
2353
2353
|
* Resolver for entity or table target, can be direct or function.
|
|
2354
2354
|
*/
|
|
2355
2355
|
type EntityOrTableTargetResolver = EntityOrTableTarget | (() => EntityOrTableTarget);
|
|
2356
|
+
/**
|
|
2357
|
+
* Simplified column definition structure used during metadata registration.
|
|
2358
|
+
* @template T - Concrete column definition type being extended
|
|
2359
|
+
*/
|
|
2360
|
+
type ColumnDefLike<T extends ColumnDef = ColumnDef> = Omit<T, 'name' | 'table'>;
|
|
2361
|
+
/**
|
|
2362
|
+
* Common properties shared by all relation metadata types.
|
|
2363
|
+
*/
|
|
2364
|
+
interface BaseRelationMetadata {
|
|
2365
|
+
/** The property key for the relation */
|
|
2366
|
+
propertyKey: string;
|
|
2367
|
+
/** The target entity or table */
|
|
2368
|
+
target: EntityOrTableTargetResolver;
|
|
2369
|
+
/** Optional cascade mode */
|
|
2370
|
+
cascade?: CascadeMode;
|
|
2371
|
+
}
|
|
2372
|
+
/**
|
|
2373
|
+
* Metadata for has many relations.
|
|
2374
|
+
*/
|
|
2375
|
+
interface HasManyRelationMetadata extends BaseRelationMetadata {
|
|
2376
|
+
/** The relation kind */
|
|
2377
|
+
kind: typeof RelationKinds.HasMany;
|
|
2378
|
+
/** The foreign key */
|
|
2379
|
+
foreignKey: string;
|
|
2380
|
+
/** Optional local key */
|
|
2381
|
+
localKey?: string;
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Metadata for has one relations.
|
|
2385
|
+
*/
|
|
2386
|
+
interface HasOneRelationMetadata extends BaseRelationMetadata {
|
|
2387
|
+
/** The relation kind */
|
|
2388
|
+
kind: typeof RelationKinds.HasOne;
|
|
2389
|
+
/** The foreign key */
|
|
2390
|
+
foreignKey: string;
|
|
2391
|
+
/** Optional local key */
|
|
2392
|
+
localKey?: string;
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* Metadata for belongs to relations.
|
|
2396
|
+
*/
|
|
2397
|
+
interface BelongsToRelationMetadata extends BaseRelationMetadata {
|
|
2398
|
+
/** The relation kind */
|
|
2399
|
+
kind: typeof RelationKinds.BelongsTo;
|
|
2400
|
+
/** The foreign key */
|
|
2401
|
+
foreignKey: string;
|
|
2402
|
+
/** Optional local key */
|
|
2403
|
+
localKey?: string;
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
* Metadata for belongs to many relations.
|
|
2407
|
+
*/
|
|
2408
|
+
interface BelongsToManyRelationMetadata extends BaseRelationMetadata {
|
|
2409
|
+
/** The relation kind */
|
|
2410
|
+
kind: typeof RelationKinds.BelongsToMany;
|
|
2411
|
+
/** The pivot table */
|
|
2412
|
+
pivotTable: EntityOrTableTargetResolver;
|
|
2413
|
+
/** The pivot foreign key to root */
|
|
2414
|
+
pivotForeignKeyToRoot: string;
|
|
2415
|
+
/** The pivot foreign key to target */
|
|
2416
|
+
pivotForeignKeyToTarget: string;
|
|
2417
|
+
/** Optional local key */
|
|
2418
|
+
localKey?: string;
|
|
2419
|
+
/** Optional target key */
|
|
2420
|
+
targetKey?: string;
|
|
2421
|
+
/** Optional pivot primary key */
|
|
2422
|
+
pivotPrimaryKey?: string;
|
|
2423
|
+
/** Optional default pivot columns */
|
|
2424
|
+
defaultPivotColumns?: string[];
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
* Union type for all relation metadata.
|
|
2428
|
+
*/
|
|
2429
|
+
type RelationMetadata = HasManyRelationMetadata | HasOneRelationMetadata | BelongsToRelationMetadata | BelongsToManyRelationMetadata;
|
|
2356
2430
|
|
|
2357
2431
|
/**
|
|
2358
2432
|
* Entity status enum representing the lifecycle state of an entity
|
|
@@ -3215,7 +3289,7 @@ declare class OrmSession<E extends DomainEvent = OrmDomainEvent> implements Enti
|
|
|
3215
3289
|
*/
|
|
3216
3290
|
remove(entity: object): Promise<void>;
|
|
3217
3291
|
/**
|
|
3218
|
-
* Flushes pending changes to the database.
|
|
3292
|
+
* Flushes pending changes to the database without session hooks, relation processing, or domain events.
|
|
3219
3293
|
*/
|
|
3220
3294
|
flush(): Promise<void>;
|
|
3221
3295
|
/**
|
|
@@ -5343,6 +5417,26 @@ interface DualModeClassDecorator {
|
|
|
5343
5417
|
<TFunction extends Function>(value: TFunction): void | TFunction;
|
|
5344
5418
|
<TFunction extends Function>(value: TFunction, context: StandardDecoratorContext): void | TFunction;
|
|
5345
5419
|
}
|
|
5420
|
+
/**
|
|
5421
|
+
* Bag for storing decorator metadata during the decoration phase.
|
|
5422
|
+
*/
|
|
5423
|
+
interface DecoratorMetadataBag {
|
|
5424
|
+
columns: Array<{
|
|
5425
|
+
propertyName: string;
|
|
5426
|
+
column: ColumnDefLike;
|
|
5427
|
+
}>;
|
|
5428
|
+
relations: Array<{
|
|
5429
|
+
propertyName: string;
|
|
5430
|
+
relation: RelationMetadata;
|
|
5431
|
+
}>;
|
|
5432
|
+
}
|
|
5433
|
+
/**
|
|
5434
|
+
* Public helper to read decorator metadata from a class constructor.
|
|
5435
|
+
* Standard decorators only; legacy metadata is intentionally ignored.
|
|
5436
|
+
* @param ctor - The entity constructor.
|
|
5437
|
+
* @returns The metadata bag if present.
|
|
5438
|
+
*/
|
|
5439
|
+
declare const getDecoratorMetadata: (ctor: object) => DecoratorMetadataBag | undefined;
|
|
5346
5440
|
|
|
5347
5441
|
/**
|
|
5348
5442
|
* Options for defining an entity.
|
|
@@ -5618,4 +5712,4 @@ type PooledExecutorFactoryOptions<TConn> = {
|
|
|
5618
5712
|
*/
|
|
5619
5713
|
declare function createPooledExecutorFactory<TConn>(opts: PooledExecutorFactoryOptions<TConn>): DbExecutorFactory;
|
|
5620
5714
|
|
|
5621
|
-
export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToRelation, type BetweenExpressionNode, type BinaryExpressionNode, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, DefaultBelongsToReference, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityOptions, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, type IntrospectOptions, type JsonPathNode, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SimpleQueryRunner, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type TrackedEntity, TypeScriptGenerator, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, aliasRef, and, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bootstrapEntities, caseWhen, cast, ceil, ceiling, char, charLength, clearExpressionDispatchers, clearOperandDispatchers, col, columnOperand, concat, concatWs, correlateBy, cos, cot, count, countAll, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, defineTable, degrees, denseRank, diffSchema, div, endOfMonth, entityRef, eq, esel, executeHydrated, executeHydratedWithContexts, exists, exp, extract, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, getColumn, getSchemaIntrospector, getTableDefFromEntity, groupConcat, gt, gte, hasMany, hasOne, hydrateRows, inList, inSubquery, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isOperandNode, isValueOperandInput, isWindowFunctionNode, jsonPath, jsonify, lag, lastValue, lead, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, locate, log, log10, logBase, lower, lpad, lt, lte, ltrim, max, min, mod, month, mul, neq, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, or, outerRef, pi, position, pow, power, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, renderColumnDefinition, renderTypeWithArgs, repeat, replace, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, sel, selectFromEntity, sign, sin, space, sqrt, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, upper, utcNow, valueToOperand, visitExpression, visitOperand, weekOfYear, windowFunction, year };
|
|
5715
|
+
export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToRelation, type BetweenExpressionNode, type BinaryExpressionNode, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, DefaultBelongsToReference, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityOptions, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, type IntrospectOptions, type JsonPathNode, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SimpleQueryRunner, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type TrackedEntity, TypeScriptGenerator, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, aliasRef, and, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bootstrapEntities, caseWhen, cast, ceil, ceiling, char, charLength, clearExpressionDispatchers, clearOperandDispatchers, col, columnOperand, concat, concatWs, correlateBy, cos, cot, count, countAll, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, defineTable, degrees, denseRank, diffSchema, div, endOfMonth, entityRef, eq, esel, executeHydrated, executeHydratedWithContexts, exists, exp, extract, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, getColumn, getDecoratorMetadata, getSchemaIntrospector, getTableDefFromEntity, groupConcat, gt, gte, hasMany, hasOne, hydrateRows, inList, inSubquery, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isOperandNode, isValueOperandInput, isWindowFunctionNode, jsonPath, jsonify, lag, lastValue, lead, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, locate, log, log10, logBase, lower, lpad, lt, lte, ltrim, max, min, mod, month, mul, neq, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, or, outerRef, pi, position, pow, power, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, renderColumnDefinition, renderTypeWithArgs, repeat, replace, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, sel, selectFromEntity, sign, sin, space, sqrt, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, upper, utcNow, valueToOperand, visitExpression, visitOperand, weekOfYear, windowFunction, year };
|
package/dist/index.d.ts
CHANGED
|
@@ -2353,6 +2353,80 @@ type EntityOrTableTarget = EntityConstructor | TableDef;
|
|
|
2353
2353
|
* Resolver for entity or table target, can be direct or function.
|
|
2354
2354
|
*/
|
|
2355
2355
|
type EntityOrTableTargetResolver = EntityOrTableTarget | (() => EntityOrTableTarget);
|
|
2356
|
+
/**
|
|
2357
|
+
* Simplified column definition structure used during metadata registration.
|
|
2358
|
+
* @template T - Concrete column definition type being extended
|
|
2359
|
+
*/
|
|
2360
|
+
type ColumnDefLike<T extends ColumnDef = ColumnDef> = Omit<T, 'name' | 'table'>;
|
|
2361
|
+
/**
|
|
2362
|
+
* Common properties shared by all relation metadata types.
|
|
2363
|
+
*/
|
|
2364
|
+
interface BaseRelationMetadata {
|
|
2365
|
+
/** The property key for the relation */
|
|
2366
|
+
propertyKey: string;
|
|
2367
|
+
/** The target entity or table */
|
|
2368
|
+
target: EntityOrTableTargetResolver;
|
|
2369
|
+
/** Optional cascade mode */
|
|
2370
|
+
cascade?: CascadeMode;
|
|
2371
|
+
}
|
|
2372
|
+
/**
|
|
2373
|
+
* Metadata for has many relations.
|
|
2374
|
+
*/
|
|
2375
|
+
interface HasManyRelationMetadata extends BaseRelationMetadata {
|
|
2376
|
+
/** The relation kind */
|
|
2377
|
+
kind: typeof RelationKinds.HasMany;
|
|
2378
|
+
/** The foreign key */
|
|
2379
|
+
foreignKey: string;
|
|
2380
|
+
/** Optional local key */
|
|
2381
|
+
localKey?: string;
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Metadata for has one relations.
|
|
2385
|
+
*/
|
|
2386
|
+
interface HasOneRelationMetadata extends BaseRelationMetadata {
|
|
2387
|
+
/** The relation kind */
|
|
2388
|
+
kind: typeof RelationKinds.HasOne;
|
|
2389
|
+
/** The foreign key */
|
|
2390
|
+
foreignKey: string;
|
|
2391
|
+
/** Optional local key */
|
|
2392
|
+
localKey?: string;
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* Metadata for belongs to relations.
|
|
2396
|
+
*/
|
|
2397
|
+
interface BelongsToRelationMetadata extends BaseRelationMetadata {
|
|
2398
|
+
/** The relation kind */
|
|
2399
|
+
kind: typeof RelationKinds.BelongsTo;
|
|
2400
|
+
/** The foreign key */
|
|
2401
|
+
foreignKey: string;
|
|
2402
|
+
/** Optional local key */
|
|
2403
|
+
localKey?: string;
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
* Metadata for belongs to many relations.
|
|
2407
|
+
*/
|
|
2408
|
+
interface BelongsToManyRelationMetadata extends BaseRelationMetadata {
|
|
2409
|
+
/** The relation kind */
|
|
2410
|
+
kind: typeof RelationKinds.BelongsToMany;
|
|
2411
|
+
/** The pivot table */
|
|
2412
|
+
pivotTable: EntityOrTableTargetResolver;
|
|
2413
|
+
/** The pivot foreign key to root */
|
|
2414
|
+
pivotForeignKeyToRoot: string;
|
|
2415
|
+
/** The pivot foreign key to target */
|
|
2416
|
+
pivotForeignKeyToTarget: string;
|
|
2417
|
+
/** Optional local key */
|
|
2418
|
+
localKey?: string;
|
|
2419
|
+
/** Optional target key */
|
|
2420
|
+
targetKey?: string;
|
|
2421
|
+
/** Optional pivot primary key */
|
|
2422
|
+
pivotPrimaryKey?: string;
|
|
2423
|
+
/** Optional default pivot columns */
|
|
2424
|
+
defaultPivotColumns?: string[];
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
* Union type for all relation metadata.
|
|
2428
|
+
*/
|
|
2429
|
+
type RelationMetadata = HasManyRelationMetadata | HasOneRelationMetadata | BelongsToRelationMetadata | BelongsToManyRelationMetadata;
|
|
2356
2430
|
|
|
2357
2431
|
/**
|
|
2358
2432
|
* Entity status enum representing the lifecycle state of an entity
|
|
@@ -3215,7 +3289,7 @@ declare class OrmSession<E extends DomainEvent = OrmDomainEvent> implements Enti
|
|
|
3215
3289
|
*/
|
|
3216
3290
|
remove(entity: object): Promise<void>;
|
|
3217
3291
|
/**
|
|
3218
|
-
* Flushes pending changes to the database.
|
|
3292
|
+
* Flushes pending changes to the database without session hooks, relation processing, or domain events.
|
|
3219
3293
|
*/
|
|
3220
3294
|
flush(): Promise<void>;
|
|
3221
3295
|
/**
|
|
@@ -5343,6 +5417,26 @@ interface DualModeClassDecorator {
|
|
|
5343
5417
|
<TFunction extends Function>(value: TFunction): void | TFunction;
|
|
5344
5418
|
<TFunction extends Function>(value: TFunction, context: StandardDecoratorContext): void | TFunction;
|
|
5345
5419
|
}
|
|
5420
|
+
/**
|
|
5421
|
+
* Bag for storing decorator metadata during the decoration phase.
|
|
5422
|
+
*/
|
|
5423
|
+
interface DecoratorMetadataBag {
|
|
5424
|
+
columns: Array<{
|
|
5425
|
+
propertyName: string;
|
|
5426
|
+
column: ColumnDefLike;
|
|
5427
|
+
}>;
|
|
5428
|
+
relations: Array<{
|
|
5429
|
+
propertyName: string;
|
|
5430
|
+
relation: RelationMetadata;
|
|
5431
|
+
}>;
|
|
5432
|
+
}
|
|
5433
|
+
/**
|
|
5434
|
+
* Public helper to read decorator metadata from a class constructor.
|
|
5435
|
+
* Standard decorators only; legacy metadata is intentionally ignored.
|
|
5436
|
+
* @param ctor - The entity constructor.
|
|
5437
|
+
* @returns The metadata bag if present.
|
|
5438
|
+
*/
|
|
5439
|
+
declare const getDecoratorMetadata: (ctor: object) => DecoratorMetadataBag | undefined;
|
|
5346
5440
|
|
|
5347
5441
|
/**
|
|
5348
5442
|
* Options for defining an entity.
|
|
@@ -5618,4 +5712,4 @@ type PooledExecutorFactoryOptions<TConn> = {
|
|
|
5618
5712
|
*/
|
|
5619
5713
|
declare function createPooledExecutorFactory<TConn>(opts: PooledExecutorFactoryOptions<TConn>): DbExecutorFactory;
|
|
5620
5714
|
|
|
5621
|
-
export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToRelation, type BetweenExpressionNode, type BinaryExpressionNode, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, DefaultBelongsToReference, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityOptions, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, type IntrospectOptions, type JsonPathNode, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SimpleQueryRunner, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type TrackedEntity, TypeScriptGenerator, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, aliasRef, and, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bootstrapEntities, caseWhen, cast, ceil, ceiling, char, charLength, clearExpressionDispatchers, clearOperandDispatchers, col, columnOperand, concat, concatWs, correlateBy, cos, cot, count, countAll, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, defineTable, degrees, denseRank, diffSchema, div, endOfMonth, entityRef, eq, esel, executeHydrated, executeHydratedWithContexts, exists, exp, extract, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, getColumn, getSchemaIntrospector, getTableDefFromEntity, groupConcat, gt, gte, hasMany, hasOne, hydrateRows, inList, inSubquery, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isOperandNode, isValueOperandInput, isWindowFunctionNode, jsonPath, jsonify, lag, lastValue, lead, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, locate, log, log10, logBase, lower, lpad, lt, lte, ltrim, max, min, mod, month, mul, neq, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, or, outerRef, pi, position, pow, power, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, renderColumnDefinition, renderTypeWithArgs, repeat, replace, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, sel, selectFromEntity, sign, sin, space, sqrt, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, upper, utcNow, valueToOperand, visitExpression, visitOperand, weekOfYear, windowFunction, year };
|
|
5715
|
+
export { type AliasRefNode, type AnyDomainEvent, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToRelation, type BetweenExpressionNode, type BinaryExpressionNode, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DbExecutor, type DbExecutorFactory, DefaultBelongsToReference, DefaultHasManyCollection, DefaultManyToManyCollection, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, Entity, type EntityContext, type EntityInstance, type EntityOptions, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, type IntrospectOptions, type JsonPathNode, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NullExpressionNode, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SimpleQueryRunner, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type TrackedEntity, TypeScriptGenerator, UpdateQueryBuilder, type ValueOperandInput, type WindowFunctionNode, abs, acos, add, addDomainEvent, aliasRef, and, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bootstrapEntities, caseWhen, cast, ceil, ceiling, char, charLength, clearExpressionDispatchers, clearOperandDispatchers, col, columnOperand, concat, concatWs, correlateBy, cos, cot, count, countAll, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, defineTable, degrees, denseRank, diffSchema, div, endOfMonth, entityRef, eq, esel, executeHydrated, executeHydratedWithContexts, exists, exp, extract, firstValue, floor, fromUnixTime, generateCreateTableSql, generateSchemaSql, getColumn, getDecoratorMetadata, getSchemaIntrospector, getTableDefFromEntity, groupConcat, gt, gte, hasMany, hasOne, hydrateRows, inList, inSubquery, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isOperandNode, isValueOperandInput, isWindowFunctionNode, jsonPath, jsonify, lag, lastValue, lead, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, locate, log, log10, logBase, lower, lpad, lt, lte, ltrim, max, min, mod, month, mul, neq, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, or, outerRef, pi, position, pow, power, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, renderColumnDefinition, renderTypeWithArgs, repeat, replace, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, sel, selectFromEntity, sign, sin, space, sqrt, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toTableRef, trim, trunc, truncate, unixTimestamp, upper, utcNow, valueToOperand, visitExpression, visitOperand, weekOfYear, windowFunction, year };
|
package/dist/index.js
CHANGED
|
@@ -9759,7 +9759,7 @@ var OrmSession = class {
|
|
|
9759
9759
|
this.markRemoved(entity);
|
|
9760
9760
|
}
|
|
9761
9761
|
/**
|
|
9762
|
-
* Flushes pending changes to the database.
|
|
9762
|
+
* Flushes pending changes to the database without session hooks, relation processing, or domain events.
|
|
9763
9763
|
*/
|
|
9764
9764
|
async flush() {
|
|
9765
9765
|
await this.unitOfWork.flush();
|
|
@@ -9951,6 +9951,13 @@ var getOrCreateMetadataBag = (context) => {
|
|
|
9951
9951
|
var readMetadataBag = (context) => {
|
|
9952
9952
|
return context.metadata?.[METADATA_KEY];
|
|
9953
9953
|
};
|
|
9954
|
+
var readMetadataBagFromConstructor = (ctor) => {
|
|
9955
|
+
const metadataSymbol = Symbol.metadata;
|
|
9956
|
+
if (!metadataSymbol) return void 0;
|
|
9957
|
+
const metadata = Reflect.get(ctor, metadataSymbol);
|
|
9958
|
+
return metadata?.[METADATA_KEY];
|
|
9959
|
+
};
|
|
9960
|
+
var getDecoratorMetadata = (ctor) => readMetadataBagFromConstructor(ctor);
|
|
9954
9961
|
|
|
9955
9962
|
// src/decorators/entity.ts
|
|
9956
9963
|
var toSnakeCase = (value) => {
|
|
@@ -10795,6 +10802,7 @@ export {
|
|
|
10795
10802
|
generateCreateTableSql,
|
|
10796
10803
|
generateSchemaSql,
|
|
10797
10804
|
getColumn,
|
|
10805
|
+
getDecoratorMetadata,
|
|
10798
10806
|
getSchemaIntrospector,
|
|
10799
10807
|
getTableDefFromEntity,
|
|
10800
10808
|
groupConcat,
|