metal-orm 1.0.93 → 1.0.95

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.d.cts CHANGED
@@ -2716,6 +2716,58 @@ interface SimpleQueryRunner {
2716
2716
  */
2717
2717
  declare function createExecutorFromQueryRunner(runner: SimpleQueryRunner): DbExecutor;
2718
2718
 
2719
+ interface TransformContext {
2720
+ entityName: string;
2721
+ propertyName: string;
2722
+ columnType: ColumnType;
2723
+ isUpdate: boolean;
2724
+ originalValue?: unknown;
2725
+ autoTransform: boolean;
2726
+ }
2727
+ interface AutoTransformResult<T = unknown> {
2728
+ success: boolean;
2729
+ correctedValue?: T;
2730
+ message?: string;
2731
+ }
2732
+ interface PropertyTransformer<TInput = unknown, TOutput = unknown> {
2733
+ readonly name: string;
2734
+ transform(value: TInput, context: TransformContext): TOutput;
2735
+ }
2736
+ interface PropertyValidator<T = unknown> {
2737
+ readonly name: string;
2738
+ validate(value: T, context: TransformContext): ValidationResult$1;
2739
+ }
2740
+ interface PropertySanitizer<T = unknown> {
2741
+ readonly name: string;
2742
+ sanitize(value: T, context: TransformContext): T;
2743
+ }
2744
+ interface CompositeTransformer<TInput = unknown, TOutput = unknown> extends PropertyTransformer<TInput, TOutput>, PropertyValidator<TInput> {
2745
+ }
2746
+ interface AutoTransformableValidator<T = unknown> extends PropertyValidator<T> {
2747
+ /**
2748
+ * Attempts to automatically correct an invalid value.
2749
+ * Returns undefined if auto-correction is not possible.
2750
+ */
2751
+ autoTransform?(value: T, context: TransformContext): AutoTransformResult<T>;
2752
+ }
2753
+ interface ValidationResult$1 {
2754
+ isValid: boolean;
2755
+ error?: string;
2756
+ message?: string;
2757
+ }
2758
+ interface TransformerMetadata {
2759
+ propertyName: string;
2760
+ transformers: PropertyTransformer[];
2761
+ validators: PropertyValidator[];
2762
+ sanitizers: PropertySanitizer[];
2763
+ executionOrder: 'before-save' | 'after-load' | 'both';
2764
+ }
2765
+ interface TransformerConfig {
2766
+ auto?: boolean;
2767
+ execute?: 'before-save' | 'after-load' | 'both';
2768
+ stopOnFirstError?: boolean;
2769
+ }
2770
+
2719
2771
  /**
2720
2772
  * Constructor type for entities.
2721
2773
  * Supports any constructor signature for maximum flexibility with decorator-based entities.
@@ -6263,6 +6315,10 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
6263
6315
  private mapOp;
6264
6316
  }
6265
6317
 
6318
+ type ColumnTarget = TableDef | EntityConstructor;
6319
+ declare const getColumnType: (target: ColumnTarget, column: string) => ColumnType | undefined;
6320
+ declare const getDateKind: (target: ColumnTarget, column: string) => "date" | "date-time" | undefined;
6321
+
6266
6322
  type RelationKey<TTable extends TableDef> = Extract<keyof RelationMap<TTable>, string>;
6267
6323
  /**
6268
6324
  * Metadata stored on entity instances for ORM internal use
@@ -6771,6 +6827,10 @@ interface DecoratorMetadataBag {
6771
6827
  propertyName: string;
6772
6828
  relation: RelationMetadata;
6773
6829
  }>;
6830
+ transformers: Array<{
6831
+ propertyName: string;
6832
+ metadata: TransformerMetadata;
6833
+ }>;
6774
6834
  }
6775
6835
  /**
6776
6836
  * Public helper to read decorator metadata from a class constructor.
@@ -6779,6 +6839,174 @@ interface DecoratorMetadataBag {
6779
6839
  */
6780
6840
  declare const getDecoratorMetadata: (ctor: object) => DecoratorMetadataBag | undefined;
6781
6841
 
6842
+ declare function Trim(options?: {
6843
+ trimStart?: boolean;
6844
+ trimEnd?: boolean;
6845
+ trimAll?: boolean;
6846
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6847
+ declare function Lower(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6848
+ declare function Upper(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6849
+ declare function Capitalize(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6850
+ declare function Title(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6851
+ declare function Alphanumeric(options?: {
6852
+ allowSpaces?: boolean;
6853
+ allowUnderscores?: boolean;
6854
+ allowHyphens?: boolean;
6855
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6856
+ declare function Email(options?: {
6857
+ allowPlus?: boolean;
6858
+ requireTLD?: boolean;
6859
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6860
+ declare function Length(options: {
6861
+ min?: number;
6862
+ max?: number;
6863
+ exact?: number;
6864
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6865
+ declare function Pattern(options: {
6866
+ pattern: RegExp;
6867
+ flags?: string;
6868
+ errorMessage?: string;
6869
+ replacement?: string;
6870
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6871
+
6872
+ /**
6873
+ * Decorator to validate a Brazilian CPF number
6874
+ * @param options - Validation options
6875
+ * @returns Property decorator for CPF validation
6876
+ */
6877
+ declare function CPF(options?: {
6878
+ strict?: boolean;
6879
+ errorMessage?: string;
6880
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6881
+ /**
6882
+ * Decorator to validate a Brazilian CNPJ number
6883
+ * @param options - Validation options
6884
+ * @returns Property decorator for CNPJ validation
6885
+ */
6886
+ declare function CNPJ(options?: {
6887
+ strict?: boolean;
6888
+ errorMessage?: string;
6889
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6890
+ /**
6891
+ * Decorator to validate a Brazilian CEP number
6892
+ * @param options - Validation options
6893
+ * @returns Property decorator for CEP validation
6894
+ */
6895
+ declare function CEP(options?: {
6896
+ strict?: boolean;
6897
+ errorMessage?: string;
6898
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6899
+
6900
+ /**
6901
+ * Base interface for country-specific identifier validators
6902
+ */
6903
+ interface CountryValidator<T = string> {
6904
+ /** ISO 3166-1 alpha-2 country code (e.g., 'BR', 'US') */
6905
+ readonly countryCode: string;
6906
+ /** Identifier type (e.g., 'cpf', 'cnpj', 'ssn', 'zip') */
6907
+ readonly identifierType: string;
6908
+ /** Unique validator name (e.g., 'br-cpf', 'us-ssn') */
6909
+ readonly name: string;
6910
+ /**
6911
+ * Validates an identifier value
6912
+ * @param value - The identifier value to validate
6913
+ * @param options - Validation options
6914
+ * @returns Validation result with success status and optional error message
6915
+ */
6916
+ validate(value: T, options?: ValidationOptions): ValidationResult;
6917
+ /**
6918
+ * Normalizes an identifier value (removes formatting, standardizes)
6919
+ * @param value - The identifier value to normalize
6920
+ * @returns Normalized value (digits only, uppercase, etc.)
6921
+ */
6922
+ normalize(value: T): string;
6923
+ /**
6924
+ * Formats an identifier value according to country standards
6925
+ * @param value - The identifier value to format (can be normalized or formatted)
6926
+ * @returns Formatted value (e.g., '123.456.789-01' for CPF)
6927
+ */
6928
+ format(value: T): string;
6929
+ /**
6930
+ * Attempts to auto-correct an invalid value
6931
+ * @param value - The invalid value to correct
6932
+ * @returns Auto-correction result or undefined if not possible
6933
+ */
6934
+ autoCorrect?(value: T): AutoCorrectionResult<T>;
6935
+ }
6936
+ /**
6937
+ * Validation options for country identifiers
6938
+ */
6939
+ interface ValidationOptions {
6940
+ /** Whether to allow formatted input (e.g., '123.456.789-01') */
6941
+ allowFormatted?: boolean;
6942
+ /** Whether to allow normalized input (e.g., '12345678901') */
6943
+ allowNormalized?: boolean;
6944
+ /** Whether to perform strict validation (e.g., check for known invalid numbers) */
6945
+ strict?: boolean;
6946
+ /** Custom error message */
6947
+ errorMessage?: string;
6948
+ }
6949
+ /**
6950
+ * Validation result
6951
+ */
6952
+ interface ValidationResult {
6953
+ /** Whether validation passed */
6954
+ isValid: boolean;
6955
+ /** Error message if validation failed */
6956
+ error?: string;
6957
+ /** Normalized value (if validation passed) */
6958
+ normalizedValue?: string;
6959
+ /** Formatted value (if validation passed) */
6960
+ formattedValue?: string;
6961
+ }
6962
+ /**
6963
+ * Auto-correction result
6964
+ */
6965
+ interface AutoCorrectionResult<T = string> {
6966
+ /** Whether auto-correction was successful */
6967
+ success: boolean;
6968
+ /** Corrected value */
6969
+ correctedValue?: T;
6970
+ /** Description of what was corrected */
6971
+ message?: string;
6972
+ }
6973
+ type CountryValidatorFactory<T = string> = (options?: ValidatorFactoryOptions) => CountryValidator<T>;
6974
+ interface ValidatorFactoryOptions {
6975
+ /** Custom validation rules */
6976
+ customRules?: Record<string, unknown>;
6977
+ /** Whether to enable strict mode by default */
6978
+ strict?: boolean;
6979
+ /** Custom error messages */
6980
+ errorMessages?: Record<string, string>;
6981
+ }
6982
+
6983
+ /**
6984
+ * Registers a country validator factory
6985
+ * @param countryCode - ISO 3166-1 alpha-2 country code (e.g., 'BR', 'US')
6986
+ * @param identifierType - Identifier type (e.g., 'cpf', 'ssn')
6987
+ * @param factory - Factory function that creates a validator instance
6988
+ */
6989
+ declare const registerValidator: (countryCode: string, identifierType: string, factory: CountryValidatorFactory) => void;
6990
+ /**
6991
+ * Resolves a validator for a given country and identifier type
6992
+ * @param countryCode - ISO 3166-1 alpha-2 country code
6993
+ * @param identifierType - Identifier type
6994
+ * @returns Validator instance or undefined if not found
6995
+ */
6996
+ declare const resolveValidator: (countryCode: string, identifierType: string) => CountryValidator | undefined;
6997
+ /**
6998
+ * Gets all registered validator keys
6999
+ * @returns Array of validator keys (e.g., ['br-cpf', 'us-ssn'])
7000
+ */
7001
+ declare const getRegisteredValidators: () => string[];
7002
+ /**
7003
+ * Checks if a validator is registered
7004
+ * @param countryCode - ISO 3166-1 alpha-2 country code
7005
+ * @param identifierType - Identifier type
7006
+ * @returns True if validator is registered
7007
+ */
7008
+ declare const hasValidator: (countryCode: string, identifierType: string) => boolean;
7009
+
6782
7010
  /**
6783
7011
  * Strategy interface for materializing entity instances (Open/Closed Principle).
6784
7012
  */
@@ -7814,4 +8042,4 @@ declare const paginationParamsSchema: OpenApiSchema;
7814
8042
  declare function toPaginationParams(): OpenApiParameter[];
7815
8043
  declare function pagedResponseToOpenApiSchema<T extends OpenApiSchema>(itemSchema: T): OpenApiSchema;
7816
8044
 
7817
- export { type AliasRefNode, type AnyDomainEvent, type ApiRouteDefinition, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, type BelongsToRelation, type BetweenExpressionNode, BigIntTypeStrategy, type BinaryExpressionNode, type BitwiseExpressionNode, type BooleanFilter, BooleanTypeStrategy, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, type CollateExpressionNode, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type ComponentOptions, type ComponentReference, ConstructorMaterializationStrategy, type CreateDto, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DateFilter, DateTimeTypeStrategy, type DbExecutor, type DbExecutorFactory, DecimalTypeStrategy, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, DefaultTypeStrategy, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, type Dto, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type FieldFilter, type FilterOperator, type FilterValue, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneReferenceApi, 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, IntegerTypeStrategy, InterceptorPipeline, type IntrospectOptions, type JsonArray, type JsonObject, type JsonPathNode, type JsonValue, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NestedDtoOptions, type NullExpressionNode, type NumberFilter, type OpenApiComponent, type OpenApiDialect, type OpenApiDocument, type OpenApiDocumentInfo, type OpenApiDocumentOptions, type OpenApiOperation, type OpenApiParameter, type OpenApiParameterObject, type OpenApiResponseObject, type OpenApiSchema, type OpenApiType, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PagedResponse, type PaginatedResult, type PaginationParams, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, PrototypeMaterializationStrategy, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, type SimpleQueryRunner, type SimpleWhereInput, type Simplify, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type StringFilter, StringTypeStrategy, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TargetType, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type TrackedEntity, TypeMappingService, type TypeMappingStrategy, TypeScriptGenerator, type TypedExpression, type TypedLike, type UpdateDto, UpdateQueryBuilder, UuidTypeStrategy, type ValueOperandInput, type WhereInput, type WindowFunctionNode, type WithRelations, abs, acos, add, addDomainEvent, age, aliasRef, and, applyFilter, applyNullability, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterExpression, calculateTotalPages, canonicalizeSchema, caseWhen, cast, cbrt, ceil, ceiling, char, charLength, chr, clearExpressionDispatchers, clearOperandDispatchers, coalesce, col, collate, columnOperand, columnToFilterSchema, columnToOpenApiSchema, columnTypeToOpenApiFormat, columnTypeToOpenApiType, computePaginationMetadata, computeSchemaHash, concat, concatWs, correlateBy, cos, cot, count, countAll, createApiComponentsSection, createDeterministicNamingState, createDtoToOpenApiSchema, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createRef, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, deepCloneSchema, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, dtoToOpenApiSchema, endOfMonth, entityRef, entityRefs, eq, esel, exclude, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractReusableSchemas, firstValue, floor, fromUnixTime, generateComponentSchemas, generateCreateTableSql, generateOpenApiDocument, generateRelationComponents, generateSchemaSql, generateSchemaSqlFor, getColumn, getColumnMap, getDecoratorMetadata, getDeterministicComponentName, getOpenApiVersionForDialect, getSchemaIntrospector, getTableDefFromEntity, greatest, groupConcat, gt, gte, hasMany, hasNextPage as hasNextPageMeta, hasOne, hasPrevPage as hasPrevPageMeta, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isCollateExpressionNode, isComponentReference, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isNullableColumn, isOperandNode, isTableDef, isValueOperandInput, isWindowFunctionNode, jsonArrayAgg, jsonContains, jsonLength, jsonPath, jsonSet, jsonify, lag, lastValue, lead, least, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, localTime, localTimestamp, locate, log, log10, log2, logBase, lower, lpad, lt, lte, ltrim, mapFields, materializeAs, max, md5, mergeSchemas, min, minute, mod, month, mul, neq, nestedDtoToOpenApiSchema, nestedWhereInputToOpenApiSchema, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, nullif, octetLength, or, outerRef, pagedResponseToOpenApiSchema, paginationParamsSchema, parameterToRef, pi, pick, position, pow, power, quarter, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, relationFilterToOpenApiSchema, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, replaceWithRefs, responseToRef, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, schemaToRef, second, sel, selectFrom, selectFromEntity, setRelations, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toPagedResponse, toPagedResponseBuilder, toPaginationParams, toResponse, toResponseBuilder, toTableRef, trim, trunc, truncate, typeMappingService, unixTimestamp, update, updateDtoToOpenApiSchema, updateDtoWithRelationsToOpenApiSchema, upper, utcNow, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, whereInputToOpenApiSchema, whereInputWithRelationsToOpenApiSchema, windowFunction, withDefaults, withDefaultsBuilder, year };
8045
+ export { type AliasRefNode, Alphanumeric, type AnyDomainEvent, type ApiRouteDefinition, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, type AutoCorrectionResult, type AutoTransformResult, type AutoTransformableValidator, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, type BelongsToRelation, type BetweenExpressionNode, BigIntTypeStrategy, type BinaryExpressionNode, type BitwiseExpressionNode, type BooleanFilter, BooleanTypeStrategy, CEP, CNPJ, CPF, Capitalize, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, type CollateExpressionNode, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type ComponentOptions, type ComponentReference, type CompositeTransformer, ConstructorMaterializationStrategy, type ValidationResult as CountryValidationResult, type CountryValidator, type CountryValidatorFactory, type CreateDto, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DateFilter, DateTimeTypeStrategy, type DbExecutor, type DbExecutorFactory, DecimalTypeStrategy, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, DefaultTypeStrategy, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, type Dto, Email, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type FieldFilter, type FilterOperator, type FilterValue, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneReferenceApi, 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, IntegerTypeStrategy, InterceptorPipeline, type IntrospectOptions, type JsonArray, type JsonObject, type JsonPathNode, type JsonValue, type Jsonify, type JsonifyScalar, Length, type LiteralNode, type LiteralValue, type LogicalExpressionNode, Lower, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NestedDtoOptions, type NullExpressionNode, type NumberFilter, type OpenApiComponent, type OpenApiDialect, type OpenApiDocument, type OpenApiDocumentInfo, type OpenApiDocumentOptions, type OpenApiOperation, type OpenApiParameter, type OpenApiParameterObject, type OpenApiResponseObject, type OpenApiSchema, type OpenApiType, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PagedResponse, type PaginatedResult, type PaginationParams, Pattern, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, type PropertySanitizer, type PropertyTransformer, type PropertyValidator, PrototypeMaterializationStrategy, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, type SimpleQueryRunner, type SimpleWhereInput, type Simplify, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type StringFilter, StringTypeStrategy, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TargetType, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, Title, type TrackedEntity, type TransformContext, type TransformerConfig, type TransformerMetadata, Trim, TypeMappingService, type TypeMappingStrategy, TypeScriptGenerator, type TypedExpression, type TypedLike, type UpdateDto, UpdateQueryBuilder, Upper, UuidTypeStrategy, type ValidationOptions, type ValidationResult$1 as ValidationResult, type ValidatorFactoryOptions, type ValueOperandInput, type WhereInput, type WindowFunctionNode, type WithRelations, abs, acos, add, addDomainEvent, age, aliasRef, and, applyFilter, applyNullability, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterExpression, calculateTotalPages, canonicalizeSchema, caseWhen, cast, cbrt, ceil, ceiling, char, charLength, chr, clearExpressionDispatchers, clearOperandDispatchers, coalesce, col, collate, columnOperand, columnToFilterSchema, columnToOpenApiSchema, columnTypeToOpenApiFormat, columnTypeToOpenApiType, computePaginationMetadata, computeSchemaHash, concat, concatWs, correlateBy, cos, cot, count, countAll, createApiComponentsSection, createDeterministicNamingState, createDtoToOpenApiSchema, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createRef, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, deepCloneSchema, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, dtoToOpenApiSchema, endOfMonth, entityRef, entityRefs, eq, esel, exclude, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractReusableSchemas, firstValue, floor, fromUnixTime, generateComponentSchemas, generateCreateTableSql, generateOpenApiDocument, generateRelationComponents, generateSchemaSql, generateSchemaSqlFor, getColumn, getColumnMap, getColumnType, getDateKind, getDecoratorMetadata, getDeterministicComponentName, getOpenApiVersionForDialect, getRegisteredValidators, getSchemaIntrospector, getTableDefFromEntity, greatest, groupConcat, gt, gte, hasMany, hasNextPage as hasNextPageMeta, hasOne, hasPrevPage as hasPrevPageMeta, hasValidator, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isCollateExpressionNode, isComponentReference, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isNullableColumn, isOperandNode, isTableDef, isValueOperandInput, isWindowFunctionNode, jsonArrayAgg, jsonContains, jsonLength, jsonPath, jsonSet, jsonify, lag, lastValue, lead, least, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, localTime, localTimestamp, locate, log, log10, log2, logBase, lower, lpad, lt, lte, ltrim, mapFields, materializeAs, max, md5, mergeSchemas, min, minute, mod, month, mul, neq, nestedDtoToOpenApiSchema, nestedWhereInputToOpenApiSchema, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, nullif, octetLength, or, outerRef, pagedResponseToOpenApiSchema, paginationParamsSchema, parameterToRef, pi, pick, position, pow, power, quarter, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, registerValidator, relationFilterToOpenApiSchema, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, replaceWithRefs, resolveValidator, responseToRef, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, schemaToRef, second, sel, selectFrom, selectFromEntity, setRelations, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toPagedResponse, toPagedResponseBuilder, toPaginationParams, toResponse, toResponseBuilder, toTableRef, trim, trunc, truncate, typeMappingService, unixTimestamp, update, updateDtoToOpenApiSchema, updateDtoWithRelationsToOpenApiSchema, upper, utcNow, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, whereInputToOpenApiSchema, whereInputWithRelationsToOpenApiSchema, windowFunction, withDefaults, withDefaultsBuilder, year };
package/dist/index.d.ts CHANGED
@@ -2716,6 +2716,58 @@ interface SimpleQueryRunner {
2716
2716
  */
2717
2717
  declare function createExecutorFromQueryRunner(runner: SimpleQueryRunner): DbExecutor;
2718
2718
 
2719
+ interface TransformContext {
2720
+ entityName: string;
2721
+ propertyName: string;
2722
+ columnType: ColumnType;
2723
+ isUpdate: boolean;
2724
+ originalValue?: unknown;
2725
+ autoTransform: boolean;
2726
+ }
2727
+ interface AutoTransformResult<T = unknown> {
2728
+ success: boolean;
2729
+ correctedValue?: T;
2730
+ message?: string;
2731
+ }
2732
+ interface PropertyTransformer<TInput = unknown, TOutput = unknown> {
2733
+ readonly name: string;
2734
+ transform(value: TInput, context: TransformContext): TOutput;
2735
+ }
2736
+ interface PropertyValidator<T = unknown> {
2737
+ readonly name: string;
2738
+ validate(value: T, context: TransformContext): ValidationResult$1;
2739
+ }
2740
+ interface PropertySanitizer<T = unknown> {
2741
+ readonly name: string;
2742
+ sanitize(value: T, context: TransformContext): T;
2743
+ }
2744
+ interface CompositeTransformer<TInput = unknown, TOutput = unknown> extends PropertyTransformer<TInput, TOutput>, PropertyValidator<TInput> {
2745
+ }
2746
+ interface AutoTransformableValidator<T = unknown> extends PropertyValidator<T> {
2747
+ /**
2748
+ * Attempts to automatically correct an invalid value.
2749
+ * Returns undefined if auto-correction is not possible.
2750
+ */
2751
+ autoTransform?(value: T, context: TransformContext): AutoTransformResult<T>;
2752
+ }
2753
+ interface ValidationResult$1 {
2754
+ isValid: boolean;
2755
+ error?: string;
2756
+ message?: string;
2757
+ }
2758
+ interface TransformerMetadata {
2759
+ propertyName: string;
2760
+ transformers: PropertyTransformer[];
2761
+ validators: PropertyValidator[];
2762
+ sanitizers: PropertySanitizer[];
2763
+ executionOrder: 'before-save' | 'after-load' | 'both';
2764
+ }
2765
+ interface TransformerConfig {
2766
+ auto?: boolean;
2767
+ execute?: 'before-save' | 'after-load' | 'both';
2768
+ stopOnFirstError?: boolean;
2769
+ }
2770
+
2719
2771
  /**
2720
2772
  * Constructor type for entities.
2721
2773
  * Supports any constructor signature for maximum flexibility with decorator-based entities.
@@ -6263,6 +6315,10 @@ declare class TypeScriptGenerator implements ExpressionVisitor<string>, OperandV
6263
6315
  private mapOp;
6264
6316
  }
6265
6317
 
6318
+ type ColumnTarget = TableDef | EntityConstructor;
6319
+ declare const getColumnType: (target: ColumnTarget, column: string) => ColumnType | undefined;
6320
+ declare const getDateKind: (target: ColumnTarget, column: string) => "date" | "date-time" | undefined;
6321
+
6266
6322
  type RelationKey<TTable extends TableDef> = Extract<keyof RelationMap<TTable>, string>;
6267
6323
  /**
6268
6324
  * Metadata stored on entity instances for ORM internal use
@@ -6771,6 +6827,10 @@ interface DecoratorMetadataBag {
6771
6827
  propertyName: string;
6772
6828
  relation: RelationMetadata;
6773
6829
  }>;
6830
+ transformers: Array<{
6831
+ propertyName: string;
6832
+ metadata: TransformerMetadata;
6833
+ }>;
6774
6834
  }
6775
6835
  /**
6776
6836
  * Public helper to read decorator metadata from a class constructor.
@@ -6779,6 +6839,174 @@ interface DecoratorMetadataBag {
6779
6839
  */
6780
6840
  declare const getDecoratorMetadata: (ctor: object) => DecoratorMetadataBag | undefined;
6781
6841
 
6842
+ declare function Trim(options?: {
6843
+ trimStart?: boolean;
6844
+ trimEnd?: boolean;
6845
+ trimAll?: boolean;
6846
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6847
+ declare function Lower(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6848
+ declare function Upper(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6849
+ declare function Capitalize(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6850
+ declare function Title(): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6851
+ declare function Alphanumeric(options?: {
6852
+ allowSpaces?: boolean;
6853
+ allowUnderscores?: boolean;
6854
+ allowHyphens?: boolean;
6855
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6856
+ declare function Email(options?: {
6857
+ allowPlus?: boolean;
6858
+ requireTLD?: boolean;
6859
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6860
+ declare function Length(options: {
6861
+ min?: number;
6862
+ max?: number;
6863
+ exact?: number;
6864
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6865
+ declare function Pattern(options: {
6866
+ pattern: RegExp;
6867
+ flags?: string;
6868
+ errorMessage?: string;
6869
+ replacement?: string;
6870
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6871
+
6872
+ /**
6873
+ * Decorator to validate a Brazilian CPF number
6874
+ * @param options - Validation options
6875
+ * @returns Property decorator for CPF validation
6876
+ */
6877
+ declare function CPF(options?: {
6878
+ strict?: boolean;
6879
+ errorMessage?: string;
6880
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6881
+ /**
6882
+ * Decorator to validate a Brazilian CNPJ number
6883
+ * @param options - Validation options
6884
+ * @returns Property decorator for CNPJ validation
6885
+ */
6886
+ declare function CNPJ(options?: {
6887
+ strict?: boolean;
6888
+ errorMessage?: string;
6889
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6890
+ /**
6891
+ * Decorator to validate a Brazilian CEP number
6892
+ * @param options - Validation options
6893
+ * @returns Property decorator for CEP validation
6894
+ */
6895
+ declare function CEP(options?: {
6896
+ strict?: boolean;
6897
+ errorMessage?: string;
6898
+ }): (_value: unknown, context: ClassFieldDecoratorContext) => void;
6899
+
6900
+ /**
6901
+ * Base interface for country-specific identifier validators
6902
+ */
6903
+ interface CountryValidator<T = string> {
6904
+ /** ISO 3166-1 alpha-2 country code (e.g., 'BR', 'US') */
6905
+ readonly countryCode: string;
6906
+ /** Identifier type (e.g., 'cpf', 'cnpj', 'ssn', 'zip') */
6907
+ readonly identifierType: string;
6908
+ /** Unique validator name (e.g., 'br-cpf', 'us-ssn') */
6909
+ readonly name: string;
6910
+ /**
6911
+ * Validates an identifier value
6912
+ * @param value - The identifier value to validate
6913
+ * @param options - Validation options
6914
+ * @returns Validation result with success status and optional error message
6915
+ */
6916
+ validate(value: T, options?: ValidationOptions): ValidationResult;
6917
+ /**
6918
+ * Normalizes an identifier value (removes formatting, standardizes)
6919
+ * @param value - The identifier value to normalize
6920
+ * @returns Normalized value (digits only, uppercase, etc.)
6921
+ */
6922
+ normalize(value: T): string;
6923
+ /**
6924
+ * Formats an identifier value according to country standards
6925
+ * @param value - The identifier value to format (can be normalized or formatted)
6926
+ * @returns Formatted value (e.g., '123.456.789-01' for CPF)
6927
+ */
6928
+ format(value: T): string;
6929
+ /**
6930
+ * Attempts to auto-correct an invalid value
6931
+ * @param value - The invalid value to correct
6932
+ * @returns Auto-correction result or undefined if not possible
6933
+ */
6934
+ autoCorrect?(value: T): AutoCorrectionResult<T>;
6935
+ }
6936
+ /**
6937
+ * Validation options for country identifiers
6938
+ */
6939
+ interface ValidationOptions {
6940
+ /** Whether to allow formatted input (e.g., '123.456.789-01') */
6941
+ allowFormatted?: boolean;
6942
+ /** Whether to allow normalized input (e.g., '12345678901') */
6943
+ allowNormalized?: boolean;
6944
+ /** Whether to perform strict validation (e.g., check for known invalid numbers) */
6945
+ strict?: boolean;
6946
+ /** Custom error message */
6947
+ errorMessage?: string;
6948
+ }
6949
+ /**
6950
+ * Validation result
6951
+ */
6952
+ interface ValidationResult {
6953
+ /** Whether validation passed */
6954
+ isValid: boolean;
6955
+ /** Error message if validation failed */
6956
+ error?: string;
6957
+ /** Normalized value (if validation passed) */
6958
+ normalizedValue?: string;
6959
+ /** Formatted value (if validation passed) */
6960
+ formattedValue?: string;
6961
+ }
6962
+ /**
6963
+ * Auto-correction result
6964
+ */
6965
+ interface AutoCorrectionResult<T = string> {
6966
+ /** Whether auto-correction was successful */
6967
+ success: boolean;
6968
+ /** Corrected value */
6969
+ correctedValue?: T;
6970
+ /** Description of what was corrected */
6971
+ message?: string;
6972
+ }
6973
+ type CountryValidatorFactory<T = string> = (options?: ValidatorFactoryOptions) => CountryValidator<T>;
6974
+ interface ValidatorFactoryOptions {
6975
+ /** Custom validation rules */
6976
+ customRules?: Record<string, unknown>;
6977
+ /** Whether to enable strict mode by default */
6978
+ strict?: boolean;
6979
+ /** Custom error messages */
6980
+ errorMessages?: Record<string, string>;
6981
+ }
6982
+
6983
+ /**
6984
+ * Registers a country validator factory
6985
+ * @param countryCode - ISO 3166-1 alpha-2 country code (e.g., 'BR', 'US')
6986
+ * @param identifierType - Identifier type (e.g., 'cpf', 'ssn')
6987
+ * @param factory - Factory function that creates a validator instance
6988
+ */
6989
+ declare const registerValidator: (countryCode: string, identifierType: string, factory: CountryValidatorFactory) => void;
6990
+ /**
6991
+ * Resolves a validator for a given country and identifier type
6992
+ * @param countryCode - ISO 3166-1 alpha-2 country code
6993
+ * @param identifierType - Identifier type
6994
+ * @returns Validator instance or undefined if not found
6995
+ */
6996
+ declare const resolveValidator: (countryCode: string, identifierType: string) => CountryValidator | undefined;
6997
+ /**
6998
+ * Gets all registered validator keys
6999
+ * @returns Array of validator keys (e.g., ['br-cpf', 'us-ssn'])
7000
+ */
7001
+ declare const getRegisteredValidators: () => string[];
7002
+ /**
7003
+ * Checks if a validator is registered
7004
+ * @param countryCode - ISO 3166-1 alpha-2 country code
7005
+ * @param identifierType - Identifier type
7006
+ * @returns True if validator is registered
7007
+ */
7008
+ declare const hasValidator: (countryCode: string, identifierType: string) => boolean;
7009
+
6782
7010
  /**
6783
7011
  * Strategy interface for materializing entity instances (Open/Closed Principle).
6784
7012
  */
@@ -7814,4 +8042,4 @@ declare const paginationParamsSchema: OpenApiSchema;
7814
8042
  declare function toPaginationParams(): OpenApiParameter[];
7815
8043
  declare function pagedResponseToOpenApiSchema<T extends OpenApiSchema>(itemSchema: T): OpenApiSchema;
7816
8044
 
7817
- export { type AliasRefNode, type AnyDomainEvent, type ApiRouteDefinition, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, type BelongsToRelation, type BetweenExpressionNode, BigIntTypeStrategy, type BinaryExpressionNode, type BitwiseExpressionNode, type BooleanFilter, BooleanTypeStrategy, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, type CollateExpressionNode, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type ComponentOptions, type ComponentReference, ConstructorMaterializationStrategy, type CreateDto, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DateFilter, DateTimeTypeStrategy, type DbExecutor, type DbExecutorFactory, DecimalTypeStrategy, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, DefaultTypeStrategy, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, type Dto, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type FieldFilter, type FilterOperator, type FilterValue, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneReferenceApi, 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, IntegerTypeStrategy, InterceptorPipeline, type IntrospectOptions, type JsonArray, type JsonObject, type JsonPathNode, type JsonValue, type Jsonify, type JsonifyScalar, type LiteralNode, type LiteralValue, type LogicalExpressionNode, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NestedDtoOptions, type NullExpressionNode, type NumberFilter, type OpenApiComponent, type OpenApiDialect, type OpenApiDocument, type OpenApiDocumentInfo, type OpenApiDocumentOptions, type OpenApiOperation, type OpenApiParameter, type OpenApiParameterObject, type OpenApiResponseObject, type OpenApiSchema, type OpenApiType, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PagedResponse, type PaginatedResult, type PaginationParams, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, PrototypeMaterializationStrategy, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, type SimpleQueryRunner, type SimpleWhereInput, type Simplify, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type StringFilter, StringTypeStrategy, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TargetType, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type TrackedEntity, TypeMappingService, type TypeMappingStrategy, TypeScriptGenerator, type TypedExpression, type TypedLike, type UpdateDto, UpdateQueryBuilder, UuidTypeStrategy, type ValueOperandInput, type WhereInput, type WindowFunctionNode, type WithRelations, abs, acos, add, addDomainEvent, age, aliasRef, and, applyFilter, applyNullability, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterExpression, calculateTotalPages, canonicalizeSchema, caseWhen, cast, cbrt, ceil, ceiling, char, charLength, chr, clearExpressionDispatchers, clearOperandDispatchers, coalesce, col, collate, columnOperand, columnToFilterSchema, columnToOpenApiSchema, columnTypeToOpenApiFormat, columnTypeToOpenApiType, computePaginationMetadata, computeSchemaHash, concat, concatWs, correlateBy, cos, cot, count, countAll, createApiComponentsSection, createDeterministicNamingState, createDtoToOpenApiSchema, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createRef, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, deepCloneSchema, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, dtoToOpenApiSchema, endOfMonth, entityRef, entityRefs, eq, esel, exclude, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractReusableSchemas, firstValue, floor, fromUnixTime, generateComponentSchemas, generateCreateTableSql, generateOpenApiDocument, generateRelationComponents, generateSchemaSql, generateSchemaSqlFor, getColumn, getColumnMap, getDecoratorMetadata, getDeterministicComponentName, getOpenApiVersionForDialect, getSchemaIntrospector, getTableDefFromEntity, greatest, groupConcat, gt, gte, hasMany, hasNextPage as hasNextPageMeta, hasOne, hasPrevPage as hasPrevPageMeta, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isCollateExpressionNode, isComponentReference, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isNullableColumn, isOperandNode, isTableDef, isValueOperandInput, isWindowFunctionNode, jsonArrayAgg, jsonContains, jsonLength, jsonPath, jsonSet, jsonify, lag, lastValue, lead, least, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, localTime, localTimestamp, locate, log, log10, log2, logBase, lower, lpad, lt, lte, ltrim, mapFields, materializeAs, max, md5, mergeSchemas, min, minute, mod, month, mul, neq, nestedDtoToOpenApiSchema, nestedWhereInputToOpenApiSchema, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, nullif, octetLength, or, outerRef, pagedResponseToOpenApiSchema, paginationParamsSchema, parameterToRef, pi, pick, position, pow, power, quarter, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, relationFilterToOpenApiSchema, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, replaceWithRefs, responseToRef, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, schemaToRef, second, sel, selectFrom, selectFromEntity, setRelations, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toPagedResponse, toPagedResponseBuilder, toPaginationParams, toResponse, toResponseBuilder, toTableRef, trim, trunc, truncate, typeMappingService, unixTimestamp, update, updateDtoToOpenApiSchema, updateDtoWithRelationsToOpenApiSchema, upper, utcNow, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, whereInputToOpenApiSchema, whereInputWithRelationsToOpenApiSchema, windowFunction, withDefaults, withDefaultsBuilder, year };
8045
+ export { type AliasRefNode, Alphanumeric, type AnyDomainEvent, type ApiRouteDefinition, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, type AutoCorrectionResult, type AutoTransformResult, type AutoTransformableValidator, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, type BelongsToRelation, type BetweenExpressionNode, BigIntTypeStrategy, type BinaryExpressionNode, type BitwiseExpressionNode, type BooleanFilter, BooleanTypeStrategy, CEP, CNPJ, CPF, Capitalize, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, type CollateExpressionNode, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type ComponentOptions, type ComponentReference, type CompositeTransformer, ConstructorMaterializationStrategy, type ValidationResult as CountryValidationResult, type CountryValidator, type CountryValidatorFactory, type CreateDto, type CreateTediousClientOptions, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DateFilter, DateTimeTypeStrategy, type DbExecutor, type DbExecutorFactory, DecimalTypeStrategy, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, DefaultTypeStrategy, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, type Dto, Email, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type FieldFilter, type FilterOperator, type FilterValue, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneReferenceApi, 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, IntegerTypeStrategy, InterceptorPipeline, type IntrospectOptions, type JsonArray, type JsonObject, type JsonPathNode, type JsonValue, type Jsonify, type JsonifyScalar, Length, type LiteralNode, type LiteralValue, type LogicalExpressionNode, Lower, type ManyToManyCollection, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NestedDtoOptions, type NullExpressionNode, type NumberFilter, type OpenApiComponent, type OpenApiDialect, type OpenApiDocument, type OpenApiDocumentInfo, type OpenApiDocumentOptions, type OpenApiOperation, type OpenApiParameter, type OpenApiParameterObject, type OpenApiResponseObject, type OpenApiSchema, type OpenApiType, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PagedResponse, type PaginatedResult, type PaginationParams, Pattern, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, type PropertySanitizer, type PropertyTransformer, type PropertyValidator, PrototypeMaterializationStrategy, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, type SimpleQueryRunner, type SimpleWhereInput, type Simplify, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type StringFilter, StringTypeStrategy, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TargetType, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, Title, type TrackedEntity, type TransformContext, type TransformerConfig, type TransformerMetadata, Trim, TypeMappingService, type TypeMappingStrategy, TypeScriptGenerator, type TypedExpression, type TypedLike, type UpdateDto, UpdateQueryBuilder, Upper, UuidTypeStrategy, type ValidationOptions, type ValidationResult$1 as ValidationResult, type ValidatorFactoryOptions, type ValueOperandInput, type WhereInput, type WindowFunctionNode, type WithRelations, abs, acos, add, addDomainEvent, age, aliasRef, and, applyFilter, applyNullability, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterExpression, calculateTotalPages, canonicalizeSchema, caseWhen, cast, cbrt, ceil, ceiling, char, charLength, chr, clearExpressionDispatchers, clearOperandDispatchers, coalesce, col, collate, columnOperand, columnToFilterSchema, columnToOpenApiSchema, columnTypeToOpenApiFormat, columnTypeToOpenApiType, computePaginationMetadata, computeSchemaHash, concat, concatWs, correlateBy, cos, cot, count, countAll, createApiComponentsSection, createDeterministicNamingState, createDtoToOpenApiSchema, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createRef, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, deepCloneSchema, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, dtoToOpenApiSchema, endOfMonth, entityRef, entityRefs, eq, esel, exclude, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractReusableSchemas, firstValue, floor, fromUnixTime, generateComponentSchemas, generateCreateTableSql, generateOpenApiDocument, generateRelationComponents, generateSchemaSql, generateSchemaSqlFor, getColumn, getColumnMap, getColumnType, getDateKind, getDecoratorMetadata, getDeterministicComponentName, getOpenApiVersionForDialect, getRegisteredValidators, getSchemaIntrospector, getTableDefFromEntity, greatest, groupConcat, gt, gte, hasMany, hasNextPage as hasNextPageMeta, hasOne, hasPrevPage as hasPrevPageMeta, hasValidator, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isCollateExpressionNode, isComponentReference, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isNullableColumn, isOperandNode, isTableDef, isValueOperandInput, isWindowFunctionNode, jsonArrayAgg, jsonContains, jsonLength, jsonPath, jsonSet, jsonify, lag, lastValue, lead, least, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, localTime, localTimestamp, locate, log, log10, log2, logBase, lower, lpad, lt, lte, ltrim, mapFields, materializeAs, max, md5, mergeSchemas, min, minute, mod, month, mul, neq, nestedDtoToOpenApiSchema, nestedWhereInputToOpenApiSchema, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, nullif, octetLength, or, outerRef, pagedResponseToOpenApiSchema, paginationParamsSchema, parameterToRef, pi, pick, position, pow, power, quarter, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, registerValidator, relationFilterToOpenApiSchema, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, replaceWithRefs, resolveValidator, responseToRef, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, schemaToRef, second, sel, selectFrom, selectFromEntity, setRelations, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, toColumnRef, toPagedResponse, toPagedResponseBuilder, toPaginationParams, toResponse, toResponseBuilder, toTableRef, trim, trunc, truncate, typeMappingService, unixTimestamp, update, updateDtoToOpenApiSchema, updateDtoWithRelationsToOpenApiSchema, upper, utcNow, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, whereInputToOpenApiSchema, whereInputWithRelationsToOpenApiSchema, windowFunction, withDefaults, withDefaultsBuilder, year };