@rtpaulino/entity 0.28.2 → 0.28.4

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/property.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-wrapper-object-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isEqual } from 'lodash-es';\nimport {\n AnyCtor,\n type CtorLike,\n type InstanceOfCtorLike,\n PROPERTY_METADATA_KEY,\n PROPERTY_OPTIONS_METADATA_KEY,\n POLYMORPHIC_PROPERTY_METADATA_KEY,\n PropertyOptions,\n} from './types.js';\nimport {\n enumValidator,\n intValidator,\n minLengthValidator,\n maxLengthValidator,\n patternValidator,\n minValidator,\n maxValidator,\n arrayMinLengthValidator,\n arrayMaxLengthValidator,\n} from './validators.js';\nimport { PolymorphicRegistry } from './polymorphic-registry.js';\nimport { deserializeNumberFromBigInt } from './primitive-deserializers.js';\n\n/**\n * Property decorator that marks class properties with metadata.\n * This decorator can be used to identify and track properties within classes.\n *\n * @param options - Configuration for the property (type is required)\n *\n * @example\n * class User {\n * @Property({ type: () => String })\n * name: string;\n *\n * @Property({ type: () => String, equals: (a, b) => a.toLowerCase() === b.toLowerCase() })\n * email: string;\n *\n * @Property({ type: () => Number })\n * age: number;\n * }\n */\nexport function Property<T, C extends CtorLike<T>>(\n options: PropertyOptions<T, C>,\n): PropertyDecorator {\n return (target: object, propertyKey: string | symbol): void => {\n if (typeof propertyKey !== 'string') {\n return;\n }\n\n const existingProperties: string[] =\n Reflect.getOwnMetadata(PROPERTY_METADATA_KEY, target) || [];\n\n if (!existingProperties.includes(propertyKey)) {\n existingProperties.push(propertyKey);\n }\n\n Reflect.defineMetadata(PROPERTY_METADATA_KEY, existingProperties, target);\n\n if (options.passthrough === true) {\n if (options.array === true) {\n throw new Error(\n `Property '${propertyKey}' has passthrough: true and array: true. Passthrough cannot be combined with array.`,\n );\n }\n if (options.optional === true) {\n throw new Error(\n `Property '${propertyKey}' has passthrough: true and optional: true. Passthrough cannot be combined with optional.`,\n );\n }\n if (options.sparse === true) {\n throw new Error(\n `Property '${propertyKey}' has passthrough: true and sparse: true. Passthrough cannot be combined with sparse.`,\n );\n }\n if (\n options.serialize !== undefined ||\n options.deserialize !== undefined\n ) {\n throw new Error(\n `Property '${propertyKey}' has passthrough: true and custom serialize/deserialize functions. Passthrough cannot be combined with serialize or deserialize.`,\n );\n }\n }\n\n if (options.sparse === true && options.array !== true) {\n throw new Error(\n `Property '${propertyKey}' has sparse: true but array is not true. The sparse option only applies to arrays.`,\n );\n }\n\n if (options.arrayValidators && options.array !== true) {\n throw new Error(\n `Property '${propertyKey}' has arrayValidators defined but array is not true. The arrayValidators option only applies to arrays.`,\n );\n }\n\n // Validate serialize/deserialize pairing\n const hasSerialize = options.serialize !== undefined;\n const hasDeserialize = options.deserialize !== undefined;\n if (hasSerialize !== hasDeserialize) {\n throw new Error(\n `Property '${propertyKey}' must define both serialize and deserialize functions, or neither. Found only ${hasSerialize ? 'serialize' : 'deserialize'}.`,\n );\n }\n\n const existingOptions: Record<\n string,\n PropertyOptions<any, any>\n > = Reflect.getOwnMetadata(PROPERTY_OPTIONS_METADATA_KEY, target) || {};\n\n existingOptions[propertyKey] = options;\n\n Reflect.defineMetadata(\n PROPERTY_OPTIONS_METADATA_KEY,\n existingOptions,\n target,\n );\n };\n}\n\n/**\n * Helper decorator for string properties\n * @example\n * class User {\n * @StringProperty()\n * name!: string;\n *\n * @StringProperty({ optional: true })\n * nickname?: string;\n *\n * @StringProperty({ minLength: 3, maxLength: 50 })\n * username!: string;\n *\n * @StringProperty({ pattern: /^[a-z]+$/ })\n * slug!: string;\n * }\n */\n/**\n * Creates property options for a string property with optional validation\n * Used internally by StringProperty decorator and Props.String helper\n */\nexport function stringPropertyOptions(\n options?: Omit<PropertyOptions<string, StringConstructor>, 'type'> & {\n minLength?: number;\n maxLength?: number;\n pattern?: RegExp;\n patternMessage?: string;\n },\n): PropertyOptions<string, StringConstructor> {\n const validators = [...(options?.validators || [])];\n\n if (options?.minLength !== undefined) {\n validators.unshift(minLengthValidator(options.minLength));\n }\n if (options?.maxLength !== undefined) {\n validators.unshift(maxLengthValidator(options.maxLength));\n }\n if (options?.pattern !== undefined) {\n validators.unshift(\n patternValidator(options.pattern, options.patternMessage),\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { minLength, maxLength, pattern, patternMessage, ...restOptions } =\n options || {};\n\n return {\n ...restOptions,\n type: () => String,\n validators: validators.length > 0 ? validators : undefined,\n };\n}\n\n/**\n * Helper decorator for string properties\n * @example\n * class User {\n * @StringProperty()\n * name!: string;\n *\n * @StringProperty({ optional: true })\n * nickname?: string;\n *\n * @StringProperty({ minLength: 2, maxLength: 50 })\n * username!: string;\n *\n * @StringProperty({ pattern: /^[a-z]+$/, patternMessage: 'Must be lowercase letters only' })\n * slug!: string;\n * }\n */\nexport function StringProperty(\n options?: Omit<PropertyOptions<string, StringConstructor>, 'type'> & {\n minLength?: number;\n maxLength?: number;\n pattern?: RegExp;\n patternMessage?: string;\n },\n): PropertyDecorator {\n return Property(stringPropertyOptions(options));\n}\n\n/**\n * Creates property options for an enum property\n * Used internally by EnumProperty decorator and Props.Enum helper\n */\nexport function enumPropertyOptions<T extends Record<string, string>>(\n enumType: T,\n options?: Omit<PropertyOptions<string, StringConstructor>, 'type'>,\n): PropertyOptions<string, StringConstructor> {\n const validators = options?.validators\n ? [enumValidator(enumType), ...options.validators]\n : [enumValidator(enumType)];\n\n return { ...options, type: () => String, validators };\n}\n\n/**\n * Helper decorator for enum properties (string enums)\n * Validates that the string value matches one of the enum values\n * @param enumType - The enum object (e.g., MyEnum)\n * @param options - Additional property options\n * @example\n * enum Status {\n * Active = 'active',\n * Inactive = 'inactive'\n * }\n *\n * class User {\n * @EnumProperty(Status)\n * status!: Status;\n *\n * @EnumProperty(Status, { optional: true })\n * previousStatus?: Status;\n * }\n */\nexport function EnumProperty<T extends Record<string, string>>(\n enumType: T,\n options?: Omit<PropertyOptions<string, StringConstructor>, 'type'>,\n): PropertyDecorator {\n return Property(enumPropertyOptions(enumType, options));\n}\n\n/**\n * Creates property options for a number property\n * Used internally by NumberProperty decorator and Props.Number helper\n */\nexport function numberPropertyOptions(\n options?: Omit<PropertyOptions<number, NumberConstructor>, 'type'> & {\n min?: number;\n max?: number;\n\n /**\n * When `true`, `bigint` values and integer-formatted strings (e.g. `\"-42\"`) will\n * be coerced to `number` during deserialization.\n *\n * @warning Information may be lost if the `BigInt` value exceeds the safe integer\n * range for `number` (`Number.MAX_SAFE_INTEGER` / `Number.MIN_SAFE_INTEGER`).\n */\n parseBigInt?: boolean;\n },\n): PropertyOptions<number, NumberConstructor> {\n const validators = [...(options?.validators || [])];\n\n if (options?.min !== undefined) {\n validators.unshift(minValidator(options.min));\n }\n if (options?.max !== undefined) {\n validators.unshift(maxValidator(options.max));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { min, max, parseBigInt, ...restOptions } = options || {};\n\n const deserialize = parseBigInt ? deserializeNumberFromBigInt : undefined;\n\n return {\n ...restOptions,\n type: () => Number,\n validators: validators.length > 0 ? validators : undefined,\n ...(deserialize ? { serialize: (v: number) => v, deserialize } : {}),\n };\n}\n\n/**\n * Helper decorator for number properties\n * @example\n * class User {\n * @NumberProperty()\n * age!: number;\n *\n * @NumberProperty({ optional: true })\n * score?: number;\n *\n * @NumberProperty({ min: 0, max: 100 })\n * percentage!: number;\n * }\n */\nexport function NumberProperty(\n options?: Omit<PropertyOptions<number, NumberConstructor>, 'type'> & {\n min?: number;\n max?: number;\n /**\n * When `true`, `bigint` values and integer-formatted strings (e.g. `\"-42\"`) will\n * be coerced to `number` during deserialization.\n *\n * @warning Information may be lost if the `BigInt` value exceeds the safe integer\n * range for `number` (`Number.MAX_SAFE_INTEGER` / `Number.MIN_SAFE_INTEGER`).\n */\n parseBigInt?: boolean;\n },\n): PropertyDecorator {\n return Property(numberPropertyOptions(options));\n}\n\n/**\n * Creates property options for an integer property\n * Used internally by IntProperty decorator and Props.Int helper\n */\nexport function intPropertyOptions(\n options?: Omit<PropertyOptions<number, NumberConstructor>, 'type'> & {\n min?: number;\n max?: number;\n /**\n * When `true`, `bigint` values and integer-formatted strings (e.g. `\"-42\"`) will\n * be coerced to `number` during deserialization.\n *\n * @warning Information may be lost if the `BigInt` value exceeds the safe integer\n * range for `number` (`Number.MAX_SAFE_INTEGER` / `Number.MIN_SAFE_INTEGER`).\n */\n parseBigInt?: boolean;\n },\n): PropertyOptions<number, NumberConstructor> {\n const validators = [...(options?.validators || [])];\n\n if (options?.min !== undefined) {\n validators.unshift(minValidator(options.min));\n }\n if (options?.max !== undefined) {\n validators.unshift(maxValidator(options.max));\n }\n\n validators.unshift(intValidator());\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { min, max, parseBigInt, ...restOptions } = options || {};\n\n const deserialize = parseBigInt ? deserializeNumberFromBigInt : undefined;\n\n return {\n ...restOptions,\n type: () => Number,\n validators: validators.length > 0 ? validators : undefined,\n ...(deserialize ? { serialize: (v: number) => v, deserialize } : {}),\n };\n}\n\n/**\n * Helper decorator for integer properties\n * Validates that the number is an integer (no decimal places)\n * @example\n * class User {\n * @IntProperty()\n * age!: number;\n *\n * @IntProperty({ optional: true })\n * count?: number;\n *\n * @IntProperty({ min: 0, max: 100 })\n * percentage!: number;\n * }\n */\nexport function IntProperty(\n options?: Omit<PropertyOptions<number, NumberConstructor>, 'type'> & {\n min?: number;\n max?: number;\n /**\n * When `true`, `bigint` values and integer-formatted strings (e.g. `\"-42\"`) will\n * be coerced to `number` during deserialization.\n *\n * @warning Information may be lost if the `BigInt` value exceeds the safe integer\n * range for `number` (`Number.MAX_SAFE_INTEGER` / `Number.MIN_SAFE_INTEGER`).\n */\n parseBigInt?: boolean;\n },\n): PropertyDecorator {\n return Property(intPropertyOptions(options));\n}\n\n/**\n * Creates property options for a boolean property\n * Used internally by BooleanProperty decorator and Props.Boolean helper\n */\nexport function booleanPropertyOptions(\n options?: Omit<PropertyOptions<boolean, BooleanConstructor>, 'type'>,\n): PropertyOptions<boolean, BooleanConstructor> {\n return { ...options, type: () => Boolean };\n}\n\n/**\n * Helper decorator for boolean properties\n * @example\n * class User {\n * @BooleanProperty()\n * active!: boolean;\n *\n * @BooleanProperty({ optional: true })\n * verified?: boolean;\n * }\n */\nexport function BooleanProperty(\n options?: Omit<PropertyOptions<boolean, BooleanConstructor>, 'type'>,\n): PropertyDecorator {\n return Property(booleanPropertyOptions(options));\n}\n\n/**\n * Creates property options for a Date property\n * Used internally by DateProperty decorator and Props.Date helper\n */\nexport function datePropertyOptions(\n options?: Omit<PropertyOptions<Date, DateConstructor>, 'type'>,\n): PropertyOptions<Date, DateConstructor> {\n return { ...options, type: () => Date };\n}\n\n/**\n * Helper decorator for Date properties\n * @example\n * class User {\n * @DateProperty()\n * createdAt!: Date;\n *\n * @DateProperty({ optional: true })\n * deletedAt?: Date;\n * }\n */\nexport function DateProperty(\n options?: Omit<PropertyOptions<Date, DateConstructor>, 'type'>,\n): PropertyDecorator {\n return Property(datePropertyOptions(options));\n}\n\n/**\n * Creates property options for a BigInt property\n * Used internally by BigIntProperty decorator and Props.BigInt helper\n */\nexport function bigIntPropertyOptions(\n options?: Omit<PropertyOptions<bigint, BigIntConstructor>, 'type'>,\n): PropertyOptions<bigint, BigIntConstructor> {\n return { ...options, type: () => BigInt };\n}\n\n/**\n * Helper decorator for BigInt properties\n * @example\n * class User {\n * @BigIntProperty()\n * id!: bigint;\n *\n * @BigIntProperty({ optional: true })\n * balance?: bigint;\n * }\n */\nexport function BigIntProperty(\n options?: Omit<PropertyOptions<bigint, BigIntConstructor>, 'type'>,\n): PropertyDecorator {\n return Property(bigIntPropertyOptions(options));\n}\n\n/**\n * Creates property options for an entity property\n * Used internally by EntityProperty decorator and Props.Entity helper\n */\nexport function entityPropertyOptions<\n T,\n C extends AnyCtor<T> & { new (data: any): T },\n>(\n type: () => C,\n options?: Omit<PropertyOptions<T, C>, 'type'>,\n): PropertyOptions<T, C> {\n return { ...options, type };\n}\n\n/**\n * Helper decorator for entity properties\n * @example\n * class User {\n * @EntityProperty(() => Address)\n * address!: Address;\n *\n * @EntityProperty(() => Profile, { optional: true })\n * profile?: Profile;\n * }\n */\nexport function EntityProperty<\n T,\n C extends AnyCtor<T> & { new (data: any): T },\n>(\n type: () => C,\n options?: Omit<PropertyOptions<T, C>, 'type'>,\n): PropertyDecorator {\n return Property<T, C>(entityPropertyOptions(type, options));\n}\n\n/**\n * Creates property options for an array property\n * Used internally by ArrayProperty decorator and Props.Array helper\n */\nexport function arrayPropertyOptions<T, C extends CtorLike<T>>(\n type: () => C,\n options?: Omit<PropertyOptions<T, C>, 'type' | 'array'> & {\n minLength?: number;\n maxLength?: number;\n },\n): PropertyOptions<T, C> {\n const validators = [...(options?.arrayValidators || [])];\n\n if (options?.minLength !== undefined) {\n validators.unshift(arrayMinLengthValidator(options.minLength));\n }\n if (options?.maxLength !== undefined) {\n validators.unshift(arrayMaxLengthValidator(options.maxLength));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { minLength, maxLength, ...restOptions } = options || {};\n\n return {\n ...restOptions,\n type,\n array: true,\n arrayValidators: validators.length > 0 ? validators : undefined,\n };\n}\n\n/**\n * Helper decorator for array properties\n * @example\n * class User {\n * @ArrayProperty(() => String)\n * tags!: string[];\n *\n * @ArrayProperty(() => Phone)\n * phones!: Phone[];\n *\n * @ArrayProperty(() => Number, { optional: true })\n * scores?: number[];\n *\n * @ArrayProperty(() => String, { sparse: true })\n * sparseList!: (string | null)[];\n *\n * @ArrayProperty(() => String, { minLength: 1, maxLength: 10 })\n * limitedList!: string[];\n * }\n */\nexport function ArrayProperty<T, C extends CtorLike<T>>(\n type: () => C,\n options?: Omit<PropertyOptions<T, C>, 'type' | 'array'> & {\n minLength?: number;\n maxLength?: number;\n },\n): PropertyDecorator {\n const arrayValidators = [...(options?.arrayValidators || [])];\n\n if (options?.minLength !== undefined) {\n arrayValidators.unshift(arrayMinLengthValidator(options.minLength));\n }\n if (options?.maxLength !== undefined) {\n arrayValidators.unshift(arrayMaxLengthValidator(options.maxLength));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { minLength, maxLength, ...restOptions } = options || {};\n\n return Property({\n ...restOptions,\n type,\n array: true,\n arrayValidators: arrayValidators.length > 0 ? arrayValidators : undefined,\n });\n}\n\n/**\n * Creates property options for a passthrough property\n * Used internally by PassthroughProperty decorator and Props.Passthrough helper\n */\nexport function passthroughPropertyOptions(\n options?: Omit<PropertyOptions, 'type' | 'passthrough'>,\n): PropertyOptions {\n return { ...options, type: () => Object, passthrough: true };\n}\n\n/**\n * Helper decorator for passthrough properties that bypass type validation.\n * Use this for generic types like Record<string, unknown>, any, or custom objects.\n * @example\n * class Config {\n * @PassthroughProperty()\n * metadata!: Record<string, unknown>;\n *\n * @PassthroughProperty()\n * customData!: any;\n * }\n */\nexport function PassthroughProperty(): PropertyDecorator {\n return Property(passthroughPropertyOptions());\n}\n\n/**\n * Property options for stringifiable types (types with toString() and static parse())\n * Used internally by StringifiableProperty decorator and EntityProps.Stringifiable helper\n */\nexport function stringifiablePropertyOptions<\n T extends { equals?(other: T): boolean; toString(): string },\n C extends CtorLike<T> & { parse(value: string): T },\n>(\n type: () => C,\n options?: Omit<\n PropertyOptions<T, C>,\n 'serialize' | 'deserialize' | 'passthrough' | 'type' | 'equals'\n >,\n): PropertyOptions<T, C> {\n return {\n ...options,\n type,\n equals: (a, b) => (a.equals ? a.equals(b) : a.toString() === b.toString()),\n serialize: (value) => value.toString(),\n deserialize: (value) => {\n if (typeof value === 'string') {\n return type().parse(value) as InstanceOfCtorLike<C>;\n }\n throw new Error(`Invalid value ${type().name}: ${String(value)}`);\n },\n };\n}\n\nexport const StringifiableProperty = <\n T extends { equals?(other: T): boolean; toString(): string },\n C extends CtorLike<T> & { parse(value: string): T },\n>(\n type: () => C,\n data: Omit<\n PropertyOptions<T, C>,\n 'serialize' | 'deserialize' | 'passthrough' | 'type' | 'equals'\n > = {},\n): PropertyDecorator =>\n Property<T, C>(stringifiablePropertyOptions(type, data));\n\nexport const SerializableProperty = <\n T extends { equals?(other: T): boolean; toJSON(): unknown },\n C extends CtorLike<T> & { parse(value: unknown): T },\n>(\n type: () => C,\n data: Omit<\n PropertyOptions<T, C>,\n 'serialize' | 'deserialize' | 'passthrough' | 'type' | 'equals'\n > = {},\n) =>\n Property({\n ...data,\n type,\n equals: (a: T, b: T) =>\n a.equals ? a.equals(b) : isEqual(a.toJSON(), b.toJSON()),\n serialize: (value: T) => value.toJSON(),\n deserialize: (value: unknown) => {\n return type().parse(value) as InstanceOfCtorLike<C>;\n },\n });\n\n/**\n * Helper decorator for discriminated entity properties.\n * The entity type is determined at runtime using a discriminator property.\n * Unlike EntityProperty, this does not require the type parameter upfront.\n *\n * @param options - Configuration for the discriminated property\n *\n * @example\n * ```typescript\n * // Define entity types\n * @Entity({ name: 'Circle' })\n * class Circle {\n * @StringProperty() readonly type = 'Circle';\n * @NumberProperty() radius!: number;\n * constructor(data: Partial<Circle>) { Object.assign(this, data); }\n * }\n *\n * @Entity({ name: 'Rectangle' })\n * class Rectangle {\n * @StringProperty() readonly type = 'Rectangle';\n * @NumberProperty() width!: number;\n * @NumberProperty() height!: number;\n * constructor(data: Partial<Rectangle>) { Object.assign(this, data); }\n * }\n *\n * // Use discriminated property\n * @Entity()\n * class Drawing {\n * @DiscriminatedEntityProperty()\n * shape!: Circle | Rectangle;\n *\n * @DiscriminatedEntityProperty({ discriminatorProperty: 'entityType' })\n * item!: BaseItem;\n * }\n *\n * // When serialized, the discriminator is included inline:\n * // { shape: { __type: 'Circle', radius: 5 } }\n *\n * // When deserialized, the discriminator is used to determine the type:\n * const drawing = await EntityUtils.parse(Drawing, {\n * shape: { __type: 'Circle', radius: 5 }\n * });\n * // drawing.shape is a Circle instance\n * ```\n */\n/**\n * Creates property options for a discriminated entity property\n * Used internally by DiscriminatedEntityProperty decorator and EntityProps.DiscriminatedEntity helper\n */\nexport function discriminatedEntityPropertyOptions(\n options?: Omit<PropertyOptions<any, any>, 'type' | 'discriminated'> & {\n discriminatorProperty?: string;\n },\n): PropertyOptions<any, any> {\n const discriminatorProperty = options?.discriminatorProperty ?? '__type';\n\n return {\n ...options,\n discriminated: true,\n discriminatorProperty,\n };\n}\n\nexport function DiscriminatedEntityProperty(\n options?: Omit<PropertyOptions<any, any>, 'type' | 'discriminated'> & {\n discriminatorProperty?: string;\n },\n): PropertyDecorator {\n return Property(discriminatedEntityPropertyOptions(options));\n}\n\n/**\n * Decorator that marks a property as a polymorphic discriminator.\n *\n * Used for class hierarchies where an abstract base class has multiple concrete implementations,\n * and the discriminator property value determines which subclass to instantiate.\n *\n * The discriminator is a regular class property (not injected during serialization like @DiscriminatedEntityProperty).\n *\n * This decorator can be used standalone (it will treat the property as a string) or combined\n * with another type decorator for more specific typing.\n *\n * @param enumType - Optional enum, union type, or stringifiable type for the discriminator (used for validation and schema generation)\n *\n * @example\n * ```typescript\n * // With regular enum\n * enum SchemaPropertyType {\n * STRING = 'string',\n * NUMBER = 'number',\n * }\n *\n * @Entity()\n * abstract class SchemaProperty {\n * @StringProperty({ minLength: 1 })\n * name!: string;\n *\n * @PolymorphicProperty(SchemaPropertyType)\n * type!: SchemaPropertyType;\n * }\n *\n * @Entity()\n * @PolymorphicVariant(SchemaProperty, SchemaPropertyType.STRING)\n * class StringSchemaProperty extends SchemaProperty {\n * type = SchemaPropertyType.STRING;\n *\n * @IntProperty({ optional: true })\n * minLength?: number;\n * }\n *\n * // With stringifiable type\n * class Status {\n * static ACTIVE = new Status('active');\n * static INACTIVE = new Status('inactive');\n *\n * constructor(private value: string) {}\n * toString() { return this.value; }\n * static parse(value: string) {\n * if (value === 'active') return Status.ACTIVE;\n * if (value === 'inactive') return Status.INACTIVE;\n * throw new Error('Invalid status');\n * }\n * }\n *\n * @Entity()\n * abstract class Record {\n * @PolymorphicProperty(() => Status)\n * status!: Status;\n * }\n *\n * // Parsing automatically instantiates the correct subclass\n * const data = { name: 'age', type: 'string', minLength: 5 };\n * const prop = await EntityUtils.parse(SchemaProperty, data);\n * // prop is StringSchemaProperty instance\n * ```\n */\nexport function PolymorphicProperty<\n T extends { equals?(other: T): boolean; toString(): string },\n C extends CtorLike<T> & { parse(value: string): T },\n>(enumTypeOrFactory?: Record<string, string> | (() => C)): PropertyDecorator {\n return (target: object, propertyKey: string | symbol): void => {\n if (typeof propertyKey !== 'string') {\n return;\n }\n\n // Store the polymorphic property metadata\n Reflect.defineMetadata(\n POLYMORPHIC_PROPERTY_METADATA_KEY,\n propertyKey,\n target.constructor,\n );\n\n // Register in PolymorphicRegistry\n PolymorphicRegistry.setDiscriminatorProperty(\n target.constructor,\n propertyKey,\n );\n\n // Check if property already has options (from another decorator)\n const existingOptions: PropertyOptions | undefined = Reflect.getOwnMetadata(\n PROPERTY_OPTIONS_METADATA_KEY,\n target,\n propertyKey,\n );\n\n if (existingOptions) {\n // Update existing options to add polymorphic flags\n const updatedOptions: PropertyOptions = {\n ...existingOptions,\n polymorphicDiscriminator: true,\n polymorphicEnumType: enumTypeOrFactory,\n };\n\n Reflect.defineMetadata(\n PROPERTY_OPTIONS_METADATA_KEY,\n updatedOptions,\n target,\n propertyKey,\n );\n } else {\n // No existing decorator - check if it's a stringifiable type or enum\n const isStringifiable = typeof enumTypeOrFactory === 'function';\n\n if (isStringifiable) {\n // Apply StringifiableProperty decorator with polymorphic flags\n const stringifiableOpts = stringifiablePropertyOptions(\n enumTypeOrFactory as () => C,\n );\n const options: PropertyOptions = {\n ...stringifiableOpts,\n polymorphicDiscriminator: true,\n polymorphicEnumType: enumTypeOrFactory,\n };\n\n Property(options)(target, propertyKey);\n } else {\n // Apply Property decorator with string type (for enum discriminators)\n const options: PropertyOptions = {\n type: () => String,\n polymorphicDiscriminator: true,\n polymorphicEnumType: enumTypeOrFactory,\n };\n\n Property(options)(target, propertyKey);\n }\n }\n };\n}\n"],"names":["isEqual","PROPERTY_METADATA_KEY","PROPERTY_OPTIONS_METADATA_KEY","POLYMORPHIC_PROPERTY_METADATA_KEY","enumValidator","intValidator","minLengthValidator","maxLengthValidator","patternValidator","minValidator","maxValidator","arrayMinLengthValidator","arrayMaxLengthValidator","PolymorphicRegistry","deserializeNumberFromBigInt","Property","options","target","propertyKey","existingProperties","Reflect","getOwnMetadata","includes","push","defineMetadata","passthrough","array","Error","optional","sparse","serialize","undefined","deserialize","arrayValidators","hasSerialize","hasDeserialize","existingOptions","stringPropertyOptions","validators","minLength","unshift","maxLength","pattern","patternMessage","restOptions","type","String","length","StringProperty","enumPropertyOptions","enumType","EnumProperty","numberPropertyOptions","min","max","parseBigInt","Number","v","NumberProperty","intPropertyOptions","IntProperty","booleanPropertyOptions","Boolean","BooleanProperty","datePropertyOptions","Date","DateProperty","bigIntPropertyOptions","BigInt","BigIntProperty","entityPropertyOptions","EntityProperty","arrayPropertyOptions","ArrayProperty","passthroughPropertyOptions","Object","PassthroughProperty","stringifiablePropertyOptions","equals","a","b","toString","value","parse","name","StringifiableProperty","data","SerializableProperty","toJSON","discriminatedEntityPropertyOptions","discriminatorProperty","discriminated","DiscriminatedEntityProperty","PolymorphicProperty","enumTypeOrFactory","setDiscriminatorProperty","updatedOptions","polymorphicDiscriminator","polymorphicEnumType","isStringifiable","stringifiableOpts"],"mappings":"AAAA,6DAA6D,GAC7D,qDAAqD,GACrD,SAASA,OAAO,QAAQ,YAAY;AACpC,SAIEC,qBAAqB,EACrBC,6BAA6B,EAC7BC,iCAAiC,QAE5B,aAAa;AACpB,SACEC,aAAa,EACbC,YAAY,EACZC,kBAAkB,EAClBC,kBAAkB,EAClBC,gBAAgB,EAChBC,YAAY,EACZC,YAAY,EACZC,uBAAuB,EACvBC,uBAAuB,QAClB,kBAAkB;AACzB,SAASC,mBAAmB,QAAQ,4BAA4B;AAChE,SAASC,2BAA2B,QAAQ,+BAA+B;AAE3E;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,SAASC,SACd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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEC,GACD,OAAO,SAAS6E,oBAGdC,iBAAsD;IACtD,OAAO,CAAC7E,QAAgBC;QACtB,IAAI,OAAOA,gBAAgB,UAAU;YACnC;QACF;QAEA,0CAA0C;QAC1CE,QAAQI,cAAc,CACpBrB,mCACAe,aACAD,OAAO,WAAW;QAGpB,kCAAkC;QAClCJ,oBAAoBkF,wBAAwB,CAC1C9E,OAAO,WAAW,EAClBC;QAGF,iEAAiE;QACjE,MAAMkB,kBAA+ChB,QAAQC,cAAc,CACzEnB,+BACAe,QACAC;QAGF,IAAIkB,iBAAiB;YACnB,mDAAmD;YACnD,MAAM4D,iBAAkC;gBACtC,GAAG5D,eAAe;gBAClB6D,0BAA0B;gBAC1BC,qBAAqBJ;YACvB;YAEA1E,QAAQI,cAAc,CACpBtB,+BACA8F,gBACA/E,QACAC;QAEJ,OAAO;YACL,qEAAqE;YACrE,MAAMiF,kBAAkB,OAAOL,sBAAsB;YAErD,IAAIK,iBAAiB;gBACnB,+DAA+D;gBAC/D,MAAMC,oBAAoBvB,6BACxBiB;gBAEF,MAAM9E,UAA2B;oBAC/B,GAAGoF,iBAAiB;oBACpBH,0BAA0B;oBAC1BC,qBAAqBJ;gBACvB;gBAEA/E,SAASC,SAASC,QAAQC;YAC5B,OAAO;gBACL,sEAAsE;gBACtE,MAAMF,UAA2B;oBAC/B6B,MAAM,IAAMC;oBACZmD,0BAA0B;oBAC1BC,qBAAqBJ;gBACvB;gBAEA/E,SAASC,SAASC,QAAQC;YAC5B;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/lib/property.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-wrapper-object-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isEqual } from 'lodash-es';\nimport {\n AnyCtor,\n type CtorLike,\n type InstanceOfCtorLike,\n PROPERTY_METADATA_KEY,\n PROPERTY_OPTIONS_METADATA_KEY,\n POLYMORPHIC_PROPERTY_METADATA_KEY,\n PropertyOptions,\n} from './types.js';\nimport {\n enumValidator,\n intValidator,\n minLengthValidator,\n maxLengthValidator,\n patternValidator,\n minValidator,\n maxValidator,\n arrayMinLengthValidator,\n arrayMaxLengthValidator,\n} from './validators.js';\nimport { PolymorphicRegistry } from './polymorphic-registry.js';\nimport { deserializeNumberFromBigInt } from './primitive-deserializers.js';\n\n/**\n * Property decorator that marks class properties with metadata.\n * This decorator can be used to identify and track properties within classes.\n *\n * @param options - Configuration for the property (type is required)\n *\n * @example\n * class User {\n * @Property({ type: () => String })\n * name: string;\n *\n * @Property({ type: () => String, equals: (a, b) => a.toLowerCase() === b.toLowerCase() })\n * email: string;\n *\n * @Property({ type: () => Number })\n * age: number;\n * }\n */\nexport function Property<T, C extends CtorLike<T>>(\n options: PropertyOptions<T, C>,\n): PropertyDecorator {\n return (target: object, propertyKey: string | symbol): void => {\n if (typeof propertyKey !== 'string') {\n return;\n }\n\n const existingProperties: string[] =\n Reflect.getOwnMetadata(PROPERTY_METADATA_KEY, target) || [];\n\n if (!existingProperties.includes(propertyKey)) {\n existingProperties.push(propertyKey);\n }\n\n Reflect.defineMetadata(PROPERTY_METADATA_KEY, existingProperties, target);\n\n if (options.passthrough === true) {\n if (options.array === true) {\n throw new Error(\n `Property '${propertyKey}' has passthrough: true and array: true. Passthrough cannot be combined with array.`,\n );\n }\n if (options.optional === true) {\n throw new Error(\n `Property '${propertyKey}' has passthrough: true and optional: true. Passthrough cannot be combined with optional.`,\n );\n }\n if (options.sparse === true) {\n throw new Error(\n `Property '${propertyKey}' has passthrough: true and sparse: true. Passthrough cannot be combined with sparse.`,\n );\n }\n if (\n options.serialize !== undefined ||\n options.deserialize !== undefined\n ) {\n throw new Error(\n `Property '${propertyKey}' has passthrough: true and custom serialize/deserialize functions. Passthrough cannot be combined with serialize or deserialize.`,\n );\n }\n }\n\n if (options.sparse === true && options.array !== true) {\n throw new Error(\n `Property '${propertyKey}' has sparse: true but array is not true. The sparse option only applies to arrays.`,\n );\n }\n\n if (options.arrayValidators && options.array !== true) {\n throw new Error(\n `Property '${propertyKey}' has arrayValidators defined but array is not true. The arrayValidators option only applies to arrays.`,\n );\n }\n\n // Validate serialize/deserialize pairing\n const hasSerialize = options.serialize !== undefined;\n const hasDeserialize = options.deserialize !== undefined;\n if (hasSerialize !== hasDeserialize) {\n throw new Error(\n `Property '${propertyKey}' must define both serialize and deserialize functions, or neither. Found only ${hasSerialize ? 'serialize' : 'deserialize'}.`,\n );\n }\n\n const existingOptions: Record<\n string,\n PropertyOptions<any, any>\n > = Reflect.getOwnMetadata(PROPERTY_OPTIONS_METADATA_KEY, target) || {};\n\n existingOptions[propertyKey] = options;\n\n Reflect.defineMetadata(\n PROPERTY_OPTIONS_METADATA_KEY,\n existingOptions,\n target,\n );\n };\n}\n\n/**\n * Helper decorator for string properties\n * @example\n * class User {\n * @StringProperty()\n * name!: string;\n *\n * @StringProperty({ optional: true })\n * nickname?: string;\n *\n * @StringProperty({ minLength: 3, maxLength: 50 })\n * username!: string;\n *\n * @StringProperty({ pattern: /^[a-z]+$/ })\n * slug!: string;\n * }\n */\n/**\n * Creates property options for a string property with optional validation\n * Used internally by StringProperty decorator and Props.String helper\n */\nexport function stringPropertyOptions(\n options?: Omit<PropertyOptions<string, StringConstructor>, 'type'> & {\n minLength?: number;\n maxLength?: number;\n pattern?: RegExp;\n patternMessage?: string;\n },\n): PropertyOptions<string, StringConstructor> {\n const validators = [...(options?.validators || [])];\n\n if (options?.minLength !== undefined) {\n validators.unshift(minLengthValidator(options.minLength));\n }\n if (options?.maxLength !== undefined) {\n validators.unshift(maxLengthValidator(options.maxLength));\n }\n if (options?.pattern !== undefined) {\n validators.unshift(\n patternValidator(options.pattern, options.patternMessage),\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { minLength, maxLength, pattern, patternMessage, ...restOptions } =\n options || {};\n\n return {\n ...restOptions,\n type: () => String,\n validators: validators.length > 0 ? validators : undefined,\n };\n}\n\n/**\n * Helper decorator for string properties\n * @example\n * class User {\n * @StringProperty()\n * name!: string;\n *\n * @StringProperty({ optional: true })\n * nickname?: string;\n *\n * @StringProperty({ minLength: 2, maxLength: 50 })\n * username!: string;\n *\n * @StringProperty({ pattern: /^[a-z]+$/, patternMessage: 'Must be lowercase letters only' })\n * slug!: string;\n * }\n */\nexport function StringProperty(\n options?: Omit<PropertyOptions<string, StringConstructor>, 'type'> & {\n minLength?: number;\n maxLength?: number;\n pattern?: RegExp;\n patternMessage?: string;\n },\n): PropertyDecorator {\n return Property(stringPropertyOptions(options));\n}\n\n/**\n * Creates property options for an enum property\n * Used internally by EnumProperty decorator and Props.Enum helper\n */\nexport function enumPropertyOptions<T extends Record<string, string>>(\n enumType: T,\n options?: Omit<PropertyOptions<string, StringConstructor>, 'type'>,\n): PropertyOptions<string, StringConstructor> {\n const validators = options?.validators\n ? [enumValidator(enumType), ...options.validators]\n : [enumValidator(enumType)];\n\n return { ...options, type: () => String, validators };\n}\n\n/**\n * Helper decorator for enum properties (string enums)\n * Validates that the string value matches one of the enum values\n * @param enumType - The enum object (e.g., MyEnum)\n * @param options - Additional property options\n * @example\n * enum Status {\n * Active = 'active',\n * Inactive = 'inactive'\n * }\n *\n * class User {\n * @EnumProperty(Status)\n * status!: Status;\n *\n * @EnumProperty(Status, { optional: true })\n * previousStatus?: Status;\n * }\n */\nexport function EnumProperty<T extends Record<string, string>>(\n enumType: T,\n options?: Omit<PropertyOptions<string, StringConstructor>, 'type'>,\n): PropertyDecorator {\n return Property(enumPropertyOptions(enumType, options));\n}\n\n/**\n * Creates property options for a number property\n * Used internally by NumberProperty decorator and Props.Number helper\n */\nexport function numberPropertyOptions(\n options?: Omit<PropertyOptions<number, NumberConstructor>, 'type'> & {\n min?: number;\n max?: number;\n\n /**\n * When `true`, `bigint` values and integer-formatted strings (e.g. `\"-42\"`) will\n * be coerced to `number` during deserialization.\n *\n * @warning Information may be lost if the `BigInt` value exceeds the safe integer\n * range for `number` (`Number.MAX_SAFE_INTEGER` / `Number.MIN_SAFE_INTEGER`).\n */\n parseBigInt?: boolean;\n },\n): PropertyOptions<number, NumberConstructor> {\n const validators = [...(options?.validators || [])];\n\n if (options?.min !== undefined) {\n validators.unshift(minValidator(options.min));\n }\n if (options?.max !== undefined) {\n validators.unshift(maxValidator(options.max));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { min, max, parseBigInt, ...restOptions } = options || {};\n\n const deserialize = parseBigInt ? deserializeNumberFromBigInt : undefined;\n\n return {\n ...restOptions,\n type: () => Number,\n validators: validators.length > 0 ? validators : undefined,\n ...(deserialize ? { serialize: (v: number) => v, deserialize } : {}),\n };\n}\n\n/**\n * Helper decorator for number properties\n * @example\n * class User {\n * @NumberProperty()\n * age!: number;\n *\n * @NumberProperty({ optional: true })\n * score?: number;\n *\n * @NumberProperty({ min: 0, max: 100 })\n * percentage!: number;\n * }\n */\nexport function NumberProperty(\n options?: Omit<PropertyOptions<number, NumberConstructor>, 'type'> & {\n min?: number;\n max?: number;\n /**\n * When `true`, `bigint` values and integer-formatted strings (e.g. `\"-42\"`) will\n * be coerced to `number` during deserialization.\n *\n * @warning Information may be lost if the `BigInt` value exceeds the safe integer\n * range for `number` (`Number.MAX_SAFE_INTEGER` / `Number.MIN_SAFE_INTEGER`).\n */\n parseBigInt?: boolean;\n },\n): PropertyDecorator {\n return Property(numberPropertyOptions(options));\n}\n\n/**\n * Creates property options for an integer property\n * Used internally by IntProperty decorator and Props.Int helper\n */\nexport function intPropertyOptions(\n options?: Omit<PropertyOptions<number, NumberConstructor>, 'type'> & {\n min?: number;\n max?: number;\n /**\n * When `true`, `bigint` values and integer-formatted strings (e.g. `\"-42\"`) will\n * be coerced to `number` during deserialization.\n *\n * @warning Information may be lost if the `BigInt` value exceeds the safe integer\n * range for `number` (`Number.MAX_SAFE_INTEGER` / `Number.MIN_SAFE_INTEGER`).\n */\n parseBigInt?: boolean;\n },\n): PropertyOptions<number, NumberConstructor> {\n const validators = [...(options?.validators || [])];\n\n if (options?.min !== undefined) {\n validators.unshift(minValidator(options.min));\n }\n if (options?.max !== undefined) {\n validators.unshift(maxValidator(options.max));\n }\n\n validators.unshift(intValidator());\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { min, max, parseBigInt, ...restOptions } = options || {};\n\n const deserialize = parseBigInt ? deserializeNumberFromBigInt : undefined;\n\n return {\n ...restOptions,\n type: () => Number,\n validators: validators.length > 0 ? validators : undefined,\n ...(deserialize ? { serialize: (v: number) => v, deserialize } : {}),\n };\n}\n\n/**\n * Helper decorator for integer properties\n * Validates that the number is an integer (no decimal places)\n * @example\n * class User {\n * @IntProperty()\n * age!: number;\n *\n * @IntProperty({ optional: true })\n * count?: number;\n *\n * @IntProperty({ min: 0, max: 100 })\n * percentage!: number;\n * }\n */\nexport function IntProperty(\n options?: Omit<PropertyOptions<number, NumberConstructor>, 'type'> & {\n min?: number;\n max?: number;\n /**\n * When `true`, `bigint` values and integer-formatted strings (e.g. `\"-42\"`) will\n * be coerced to `number` during deserialization.\n *\n * @warning Information may be lost if the `BigInt` value exceeds the safe integer\n * range for `number` (`Number.MAX_SAFE_INTEGER` / `Number.MIN_SAFE_INTEGER`).\n */\n parseBigInt?: boolean;\n },\n): PropertyDecorator {\n return Property(intPropertyOptions(options));\n}\n\n/**\n * Creates property options for a boolean property\n * Used internally by BooleanProperty decorator and Props.Boolean helper\n */\nexport function booleanPropertyOptions(\n options?: Omit<PropertyOptions<boolean, BooleanConstructor>, 'type'>,\n): PropertyOptions<boolean, BooleanConstructor> {\n return { ...options, type: () => Boolean };\n}\n\n/**\n * Helper decorator for boolean properties\n * @example\n * class User {\n * @BooleanProperty()\n * active!: boolean;\n *\n * @BooleanProperty({ optional: true })\n * verified?: boolean;\n * }\n */\nexport function BooleanProperty(\n options?: Omit<PropertyOptions<boolean, BooleanConstructor>, 'type'>,\n): PropertyDecorator {\n return Property(booleanPropertyOptions(options));\n}\n\n/**\n * Creates property options for a Date property\n * Used internally by DateProperty decorator and Props.Date helper\n */\nexport function datePropertyOptions(\n options?: Omit<PropertyOptions<Date, DateConstructor>, 'type'>,\n): PropertyOptions<Date, DateConstructor> {\n return { ...options, type: () => Date };\n}\n\n/**\n * Helper decorator for Date properties\n * @example\n * class User {\n * @DateProperty()\n * createdAt!: Date;\n *\n * @DateProperty({ optional: true })\n * deletedAt?: Date;\n * }\n */\nexport function DateProperty(\n options?: Omit<PropertyOptions<Date, DateConstructor>, 'type'>,\n): PropertyDecorator {\n return Property(datePropertyOptions(options));\n}\n\n/**\n * Creates property options for a BigInt property\n * Used internally by BigIntProperty decorator and Props.BigInt helper\n */\nexport function bigIntPropertyOptions(\n options?: Omit<PropertyOptions<bigint, BigIntConstructor>, 'type'>,\n): PropertyOptions<bigint, BigIntConstructor> {\n return { ...options, type: () => BigInt };\n}\n\n/**\n * Helper decorator for BigInt properties\n * @example\n * class User {\n * @BigIntProperty()\n * id!: bigint;\n *\n * @BigIntProperty({ optional: true })\n * balance?: bigint;\n * }\n */\nexport function BigIntProperty(\n options?: Omit<PropertyOptions<bigint, BigIntConstructor>, 'type'>,\n): PropertyDecorator {\n return Property(bigIntPropertyOptions(options));\n}\n\n/**\n * Creates property options for a Buffer property\n * Used internally by BufferProperty decorator and Props.Buffer helper\n */\nexport function bufferPropertyOptions(\n options?: Omit<PropertyOptions<Buffer, BufferConstructor>, 'type'>,\n): PropertyOptions<Buffer, BufferConstructor> {\n return { ...options, type: () => Buffer };\n}\n\n/**\n * Helper decorator for Buffer properties.\n * Serialized to JSON as a base64 string; deserialized from a base64 string,\n * a Buffer or a Uint8Array.\n * @example\n * class Document {\n * @BufferProperty()\n * content!: Buffer;\n *\n * @BufferProperty({ optional: true })\n * thumbnail?: Buffer;\n * }\n */\nexport function BufferProperty(\n options?: Omit<PropertyOptions<Buffer, BufferConstructor>, 'type'>,\n): PropertyDecorator {\n return Property(bufferPropertyOptions(options));\n}\n\n/**\n * Creates property options for an entity property\n * Used internally by EntityProperty decorator and Props.Entity helper\n */\nexport function entityPropertyOptions<\n T,\n C extends AnyCtor<T> & { new (data: any): T },\n>(\n type: () => C,\n options?: Omit<PropertyOptions<T, C>, 'type'>,\n): PropertyOptions<T, C> {\n return { ...options, type };\n}\n\n/**\n * Helper decorator for entity properties\n * @example\n * class User {\n * @EntityProperty(() => Address)\n * address!: Address;\n *\n * @EntityProperty(() => Profile, { optional: true })\n * profile?: Profile;\n * }\n */\nexport function EntityProperty<\n T,\n C extends AnyCtor<T> & { new (data: any): T },\n>(\n type: () => C,\n options?: Omit<PropertyOptions<T, C>, 'type'>,\n): PropertyDecorator {\n return Property<T, C>(entityPropertyOptions(type, options));\n}\n\n/**\n * Creates property options for an array property\n * Used internally by ArrayProperty decorator and Props.Array helper\n */\nexport function arrayPropertyOptions<T, C extends CtorLike<T>>(\n type: () => C,\n options?: Omit<PropertyOptions<T, C>, 'type' | 'array'> & {\n minLength?: number;\n maxLength?: number;\n },\n): PropertyOptions<T, C> {\n const validators = [...(options?.arrayValidators || [])];\n\n if (options?.minLength !== undefined) {\n validators.unshift(arrayMinLengthValidator(options.minLength));\n }\n if (options?.maxLength !== undefined) {\n validators.unshift(arrayMaxLengthValidator(options.maxLength));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { minLength, maxLength, ...restOptions } = options || {};\n\n return {\n ...restOptions,\n type,\n array: true,\n arrayValidators: validators.length > 0 ? validators : undefined,\n };\n}\n\n/**\n * Helper decorator for array properties\n * @example\n * class User {\n * @ArrayProperty(() => String)\n * tags!: string[];\n *\n * @ArrayProperty(() => Phone)\n * phones!: Phone[];\n *\n * @ArrayProperty(() => Number, { optional: true })\n * scores?: number[];\n *\n * @ArrayProperty(() => String, { sparse: true })\n * sparseList!: (string | null)[];\n *\n * @ArrayProperty(() => String, { minLength: 1, maxLength: 10 })\n * limitedList!: string[];\n * }\n */\nexport function ArrayProperty<T, C extends CtorLike<T>>(\n type: () => C,\n options?: Omit<PropertyOptions<T, C>, 'type' | 'array'> & {\n minLength?: number;\n maxLength?: number;\n },\n): PropertyDecorator {\n const arrayValidators = [...(options?.arrayValidators || [])];\n\n if (options?.minLength !== undefined) {\n arrayValidators.unshift(arrayMinLengthValidator(options.minLength));\n }\n if (options?.maxLength !== undefined) {\n arrayValidators.unshift(arrayMaxLengthValidator(options.maxLength));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { minLength, maxLength, ...restOptions } = options || {};\n\n return Property({\n ...restOptions,\n type,\n array: true,\n arrayValidators: arrayValidators.length > 0 ? arrayValidators : undefined,\n });\n}\n\n/**\n * Creates property options for a passthrough property\n * Used internally by PassthroughProperty decorator and Props.Passthrough helper\n */\nexport function passthroughPropertyOptions(\n options?: Omit<PropertyOptions, 'type' | 'passthrough'>,\n): PropertyOptions {\n return { ...options, type: () => Object, passthrough: true };\n}\n\n/**\n * Helper decorator for passthrough properties that bypass type validation.\n * Use this for generic types like Record<string, unknown>, any, or custom objects.\n * @example\n * class Config {\n * @PassthroughProperty()\n * metadata!: Record<string, unknown>;\n *\n * @PassthroughProperty()\n * customData!: any;\n * }\n */\nexport function PassthroughProperty(): PropertyDecorator {\n return Property(passthroughPropertyOptions());\n}\n\n/**\n * Property options for stringifiable types (types with toString() and static parse())\n * Used internally by StringifiableProperty decorator and EntityProps.Stringifiable helper\n */\nexport function stringifiablePropertyOptions<\n T extends { equals?(other: T): boolean; toString(): string },\n C extends CtorLike<T> & { parse(value: string): T },\n>(\n type: () => C,\n options?: Omit<\n PropertyOptions<T, C>,\n 'serialize' | 'deserialize' | 'passthrough' | 'type' | 'equals'\n >,\n): PropertyOptions<T, C> {\n return {\n ...options,\n type,\n equals: (a, b) => (a.equals ? a.equals(b) : a.toString() === b.toString()),\n serialize: (value) => value.toString(),\n deserialize: (value) => {\n if (typeof value === 'string') {\n return type().parse(value) as InstanceOfCtorLike<C>;\n }\n throw new Error(`Invalid value ${type().name}: ${String(value)}`);\n },\n };\n}\n\nexport const StringifiableProperty = <\n T extends { equals?(other: T): boolean; toString(): string },\n C extends CtorLike<T> & { parse(value: string): T },\n>(\n type: () => C,\n data: Omit<\n PropertyOptions<T, C>,\n 'serialize' | 'deserialize' | 'passthrough' | 'type' | 'equals'\n > = {},\n): PropertyDecorator =>\n Property<T, C>(stringifiablePropertyOptions(type, data));\n\nexport const SerializableProperty = <\n T extends { equals?(other: T): boolean; toJSON(): unknown },\n C extends CtorLike<T> & { parse(value: unknown): T },\n>(\n type: () => C,\n data: Omit<\n PropertyOptions<T, C>,\n 'serialize' | 'deserialize' | 'passthrough' | 'type' | 'equals'\n > = {},\n) =>\n Property({\n ...data,\n type,\n equals: (a: T, b: T) =>\n a.equals ? a.equals(b) : isEqual(a.toJSON(), b.toJSON()),\n serialize: (value: T) => value.toJSON(),\n deserialize: (value: unknown) => {\n return type().parse(value) as InstanceOfCtorLike<C>;\n },\n });\n\n/**\n * Helper decorator for discriminated entity properties.\n * The entity type is determined at runtime using a discriminator property.\n * Unlike EntityProperty, this does not require the type parameter upfront.\n *\n * @param options - Configuration for the discriminated property\n *\n * @example\n * ```typescript\n * // Define entity types\n * @Entity({ name: 'Circle' })\n * class Circle {\n * @StringProperty() readonly type = 'Circle';\n * @NumberProperty() radius!: number;\n * constructor(data: Partial<Circle>) { Object.assign(this, data); }\n * }\n *\n * @Entity({ name: 'Rectangle' })\n * class Rectangle {\n * @StringProperty() readonly type = 'Rectangle';\n * @NumberProperty() width!: number;\n * @NumberProperty() height!: number;\n * constructor(data: Partial<Rectangle>) { Object.assign(this, data); }\n * }\n *\n * // Use discriminated property\n * @Entity()\n * class Drawing {\n * @DiscriminatedEntityProperty()\n * shape!: Circle | Rectangle;\n *\n * @DiscriminatedEntityProperty({ discriminatorProperty: 'entityType' })\n * item!: BaseItem;\n * }\n *\n * // When serialized, the discriminator is included inline:\n * // { shape: { __type: 'Circle', radius: 5 } }\n *\n * // When deserialized, the discriminator is used to determine the type:\n * const drawing = await EntityUtils.parse(Drawing, {\n * shape: { __type: 'Circle', radius: 5 }\n * });\n * // drawing.shape is a Circle instance\n * ```\n */\n/**\n * Creates property options for a discriminated entity property\n * Used internally by DiscriminatedEntityProperty decorator and EntityProps.DiscriminatedEntity helper\n */\nexport function discriminatedEntityPropertyOptions(\n options?: Omit<PropertyOptions<any, any>, 'type' | 'discriminated'> & {\n discriminatorProperty?: string;\n },\n): PropertyOptions<any, any> {\n const discriminatorProperty = options?.discriminatorProperty ?? '__type';\n\n return {\n ...options,\n discriminated: true,\n discriminatorProperty,\n };\n}\n\nexport function DiscriminatedEntityProperty(\n options?: Omit<PropertyOptions<any, any>, 'type' | 'discriminated'> & {\n discriminatorProperty?: string;\n },\n): PropertyDecorator {\n return Property(discriminatedEntityPropertyOptions(options));\n}\n\n/**\n * Decorator that marks a property as a polymorphic discriminator.\n *\n * Used for class hierarchies where an abstract base class has multiple concrete implementations,\n * and the discriminator property value determines which subclass to instantiate.\n *\n * The discriminator is a regular class property (not injected during serialization like @DiscriminatedEntityProperty).\n *\n * This decorator can be used standalone (it will treat the property as a string) or combined\n * with another type decorator for more specific typing.\n *\n * @param enumType - Optional enum, union type, or stringifiable type for the discriminator (used for validation and schema generation)\n *\n * @example\n * ```typescript\n * // With regular enum\n * enum SchemaPropertyType {\n * STRING = 'string',\n * NUMBER = 'number',\n * }\n *\n * @Entity()\n * abstract class SchemaProperty {\n * @StringProperty({ minLength: 1 })\n * name!: string;\n *\n * @PolymorphicProperty(SchemaPropertyType)\n * type!: SchemaPropertyType;\n * }\n *\n * @Entity()\n * @PolymorphicVariant(SchemaProperty, SchemaPropertyType.STRING)\n * class StringSchemaProperty extends SchemaProperty {\n * type = SchemaPropertyType.STRING;\n *\n * @IntProperty({ optional: true })\n * minLength?: number;\n * }\n *\n * // With stringifiable type\n * class Status {\n * static ACTIVE = new Status('active');\n * static INACTIVE = new Status('inactive');\n *\n * constructor(private value: string) {}\n * toString() { return this.value; }\n * static parse(value: string) {\n * if (value === 'active') return Status.ACTIVE;\n * if (value === 'inactive') return Status.INACTIVE;\n * throw new Error('Invalid status');\n * }\n * }\n *\n * @Entity()\n * abstract class Record {\n * @PolymorphicProperty(() => Status)\n * status!: Status;\n * }\n *\n * // Parsing automatically instantiates the correct subclass\n * const data = { name: 'age', type: 'string', minLength: 5 };\n * const prop = await EntityUtils.parse(SchemaProperty, data);\n * // prop is StringSchemaProperty instance\n * ```\n */\nexport function PolymorphicProperty<\n T extends { equals?(other: T): boolean; toString(): string },\n C extends CtorLike<T> & { parse(value: string): T },\n>(enumTypeOrFactory?: Record<string, string> | (() => C)): PropertyDecorator {\n return (target: object, propertyKey: string | symbol): void => {\n if (typeof propertyKey !== 'string') {\n return;\n }\n\n // Store the polymorphic property metadata\n Reflect.defineMetadata(\n POLYMORPHIC_PROPERTY_METADATA_KEY,\n propertyKey,\n target.constructor,\n );\n\n // Register in PolymorphicRegistry\n PolymorphicRegistry.setDiscriminatorProperty(\n target.constructor,\n propertyKey,\n );\n\n // Check if property already has options (from another decorator)\n const existingOptions: PropertyOptions | undefined = Reflect.getOwnMetadata(\n PROPERTY_OPTIONS_METADATA_KEY,\n target,\n propertyKey,\n );\n\n if (existingOptions) {\n // Update existing options to add polymorphic flags\n const updatedOptions: PropertyOptions = {\n ...existingOptions,\n polymorphicDiscriminator: true,\n polymorphicEnumType: enumTypeOrFactory,\n };\n\n Reflect.defineMetadata(\n PROPERTY_OPTIONS_METADATA_KEY,\n updatedOptions,\n target,\n propertyKey,\n );\n } else {\n // No existing decorator - check if it's a stringifiable type or enum\n const isStringifiable = typeof enumTypeOrFactory === 'function';\n\n if (isStringifiable) {\n // Apply StringifiableProperty decorator with polymorphic flags\n const stringifiableOpts = stringifiablePropertyOptions(\n enumTypeOrFactory as () => C,\n );\n const options: PropertyOptions = {\n ...stringifiableOpts,\n polymorphicDiscriminator: true,\n polymorphicEnumType: enumTypeOrFactory,\n };\n\n Property(options)(target, propertyKey);\n } else {\n // Apply Property decorator with string type (for enum discriminators)\n const options: PropertyOptions = {\n type: () => String,\n polymorphicDiscriminator: true,\n polymorphicEnumType: enumTypeOrFactory,\n };\n\n Property(options)(target, propertyKey);\n }\n }\n };\n}\n"],"names":["isEqual","PROPERTY_METADATA_KEY","PROPERTY_OPTIONS_METADATA_KEY","POLYMORPHIC_PROPERTY_METADATA_KEY","enumValidator","intValidator","minLengthValidator","maxLengthValidator","patternValidator","minValidator","maxValidator","arrayMinLengthValidator","arrayMaxLengthValidator","PolymorphicRegistry","deserializeNumberFromBigInt","Property","options","target","propertyKey","existingProperties","Reflect","getOwnMetadata","includes","push","defineMetadata","passthrough","array","Error","optional","sparse","serialize","undefined","deserialize","arrayValidators","hasSerialize","hasDeserialize","existingOptions","stringPropertyOptions","validators","minLength","unshift","maxLength","pattern","patternMessage","restOptions","type","String","length","StringProperty","enumPropertyOptions","enumType","EnumProperty","numberPropertyOptions","min","max","parseBigInt","Number","v","NumberProperty","intPropertyOptions","IntProperty","booleanPropertyOptions","Boolean","BooleanProperty","datePropertyOptions","Date","DateProperty","bigIntPropertyOptions","BigInt","BigIntProperty","bufferPropertyOptions","Buffer","BufferProperty","entityPropertyOptions","EntityProperty","arrayPropertyOptions","ArrayProperty","passthroughPropertyOptions","Object","PassthroughProperty","stringifiablePropertyOptions","equals","a","b","toString","value","parse","name","StringifiableProperty","data","SerializableProperty","toJSON","discriminatedEntityPropertyOptions","discriminatorProperty","discriminated","DiscriminatedEntityProperty","PolymorphicProperty","enumTypeOrFactory","setDiscriminatorProperty","updatedOptions","polymorphicDiscriminator","polymorphicEnumType","isStringifiable","stringifiableOpts"],"mappings":"AAAA,6DAA6D,GAC7D,qDAAqD,GACrD,SAASA,OAAO,QAAQ,YAAY;AACpC,SAIEC,qBAAqB,EACrBC,6BAA6B,EAC7BC,iCAAiC,QAE5B,aAAa;AACpB,SACEC,aAAa,EACbC,YAAY,EACZC,kBAAkB,EAClBC,kBAAkB,EAClBC,gBAAgB,EAChBC,YAAY,EACZC,YAAY,EACZC,uBAAuB,EACvBC,uBAAuB,QAClB,kBAAkB;A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AAMC;oBACZsD,0BAA0B;oBAC1BC,qBAAqBJ;gBACvB;gBAEAlF,SAASC,SAASC,QAAQC;YAC5B;QACF;IACF;AACF"}
@@ -94,6 +94,20 @@ export declare class OptionalFieldsEntity {
94
94
  requiredBoolean: boolean;
95
95
  });
96
96
  }
97
+ /**
98
+ * Entity with properties whose serialized JSON key differs from the property name
99
+ * Features: serializedKey option, optional property with serializedKey
100
+ */
101
+ export declare class EntityWithSerializedKey {
102
+ firstName: string;
103
+ lastName?: string;
104
+ age: number;
105
+ constructor(data: {
106
+ firstName: string;
107
+ lastName?: string;
108
+ age: number;
109
+ });
110
+ }
97
111
  /**
98
112
  * Entity with various default value strategies
99
113
  * Features: Static defaults, factory defaults, async factory defaults
@@ -1 +1 @@
1
- {"version":3,"file":"test-entities.d.ts","sourceRoot":"","sources":["../../src/lib/test-entities.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAyB1B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAMvC;;;GAGG;AACH,qBACa,QAAQ;IACD,IAAI,EAAG,MAAM,CAAC;IACd,GAAG,EAAG,MAAM,CAAC;IACZ,MAAM,EAAG,OAAO,CAAC;gBAExB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE;CAKjE;AAED;;;GAGG;AACH,qBACa,WAAW;IACJ,EAAE,EAAG,MAAM,CAAC;IACZ,IAAI,EAAG,MAAM,CAAC;IACd,KAAK,EAAG,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;gBAErB,IAAI,EAAE;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,IAAI,CAAC;KACjB;CAOF;AAMD;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,CAAC;QACjB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC;IAgBD,gBAAgB,IAAI,OAAO,EAAE;CAW9B;AAMD,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAMD;;;GAGG;AACH,qBACa,qBAAqB;IACO,MAAM,EAAG,MAAM,CAAC;IACnB,KAAK,EAAG,MAAM,CAAC;gBAEvC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;CAIpD"}
@@ -229,6 +229,37 @@ OptionalFieldsEntity = _ts_decorate([
229
229
  Object
230
230
  ])
231
231
  ], OptionalFieldsEntity);
232
+ export class EntityWithSerializedKey {
233
+ constructor(data){
234
+ this.firstName = data.firstName;
235
+ this.lastName = data.lastName;
236
+ this.age = data.age;
237
+ }
238
+ }
239
+ _ts_decorate([
240
+ StringProperty({
241
+ serializedKey: 'first_name'
242
+ }),
243
+ _ts_metadata("design:type", String)
244
+ ], EntityWithSerializedKey.prototype, "firstName", void 0);
245
+ _ts_decorate([
246
+ StringProperty({
247
+ serializedKey: 'last_name',
248
+ optional: true
249
+ }),
250
+ _ts_metadata("design:type", String)
251
+ ], EntityWithSerializedKey.prototype, "lastName", void 0);
252
+ _ts_decorate([
253
+ NumberProperty(),
254
+ _ts_metadata("design:type", Number)
255
+ ], EntityWithSerializedKey.prototype, "age", void 0);
256
+ EntityWithSerializedKey = _ts_decorate([
257
+ Entity(),
258
+ _ts_metadata("design:type", Function),
259
+ _ts_metadata("design:paramtypes", [
260
+ Object
261
+ ])
262
+ ], EntityWithSerializedKey);
232
263
  // ============================================================================
233
264
  // ENTITIES WITH DEFAULT VALUES
234
265
  // ============================================================================
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/test-entities.ts"],"sourcesContent":["import 'reflect-metadata';\nimport { z } from 'zod';\nimport {\n Entity,\n CollectionEntity,\n Stringifiable,\n EntityValidator,\n} from './entity.js';\nimport {\n Property,\n StringProperty,\n NumberProperty,\n IntProperty,\n BooleanProperty,\n DateProperty,\n BigIntProperty,\n EnumProperty,\n EntityProperty,\n ArrayProperty,\n PassthroughProperty,\n SerializableProperty,\n StringifiableProperty,\n} from './property.js';\nimport { InjectedProperty } from './injected-property.js';\nimport { ZodProperty } from './zod-property.js';\nimport { Problem } from './problem.js';\n\n// ============================================================================\n// SIMPLE ENTITIES WITH PRIMITIVES\n// ============================================================================\n\n/**\n * Basic entity with common primitive types\n * Features: String, Number, Boolean properties\n */\n@Entity()\nexport class TestUser {\n @StringProperty() name!: string;\n @NumberProperty() age!: number;\n @BooleanProperty() active!: boolean;\n\n constructor(data: { name: string; age: number; active: boolean }) {\n this.name = data.name;\n this.age = data.age;\n this.active = data.active;\n }\n}\n\n/**\n * Entity with different primitive combinations\n * Features: String, Number, Int, Date properties\n */\n@Entity()\nexport class TestProduct {\n @StringProperty() id!: string;\n @StringProperty() name!: string;\n @NumberProperty() price!: number;\n @IntProperty() quantity!: number;\n @DateProperty() createdAt!: Date;\n\n constructor(data: {\n id: string;\n name: string;\n price: number;\n quantity: number;\n createdAt: Date;\n }) {\n this.id = data.id;\n this.name = data.name;\n this.price = data.price;\n this.quantity = data.quantity;\n this.createdAt = data.createdAt;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH SPECIAL TYPES\n// ============================================================================\n\n/**\n * Entity with Date and BigInt types\n * Features: DateProperty, BigIntProperty\n */\n@Entity()\nexport class EntityWithSpecialTypes {\n @DateProperty() timestamp!: Date;\n @BigIntProperty() largeNumber!: bigint;\n @StringProperty() label!: string;\n\n constructor(data: { timestamp: Date; largeNumber: bigint; label: string }) {\n this.timestamp = data.timestamp;\n this.largeNumber = data.largeNumber;\n this.label = data.label;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH VALIDATION\n// ============================================================================\n\n/**\n * Entity with property-level validators\n * Features: String validators (minLength, maxLength, pattern)\n */\n@Entity()\nexport class ValidatedEntity {\n @StringProperty({\n minLength: 3,\n maxLength: 20,\n })\n username!: string;\n\n @StringProperty({\n pattern: /^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$/i,\n })\n email!: string;\n\n @NumberProperty({ min: 0, max: 150 })\n age!: number;\n\n constructor(data: { username: string; email: string; age: number }) {\n this.username = data.username;\n this.email = data.email;\n this.age = data.age;\n }\n}\n\n/**\n * Entity with cross-property validation\n * Features: @EntityValidator decorator\n */\n@Entity()\nexport class CrossValidatedEntity {\n @StringProperty() password!: string;\n @StringProperty() confirmPassword!: string;\n @DateProperty() startDate!: Date;\n @DateProperty() endDate!: Date;\n\n constructor(data: {\n password: string;\n confirmPassword: string;\n startDate: Date;\n endDate: Date;\n }) {\n this.password = data.password;\n this.confirmPassword = data.confirmPassword;\n this.startDate = data.startDate;\n this.endDate = data.endDate;\n }\n\n @EntityValidator()\n validatePasswords(): Problem[] {\n if (this.password !== this.confirmPassword) {\n return [\n new Problem({\n property: 'confirmPassword',\n message: 'Passwords do not match',\n }),\n ];\n }\n return [];\n }\n\n @EntityValidator()\n validateDates(): Problem[] {\n if (this.startDate >= this.endDate) {\n return [\n new Problem({\n property: 'endDate',\n message: 'End date must be after start date',\n }),\n ];\n }\n return [];\n }\n}\n\n// ============================================================================\n// ENTITIES WITH OPTIONAL/REQUIRED FIELDS\n// ============================================================================\n\n/**\n * Entity with mix of optional and required properties\n * Features: optional flag\n */\n@Entity()\nexport class OptionalFieldsEntity {\n @StringProperty() requiredField!: string;\n @StringProperty({ optional: true }) optionalField?: string;\n @NumberProperty({ optional: true }) optionalNumber?: number;\n @BooleanProperty() requiredBoolean!: boolean;\n\n constructor(data: {\n requiredField: string;\n optionalField?: string;\n optionalNumber?: number;\n requiredBoolean: boolean;\n }) {\n this.requiredField = data.requiredField;\n this.optionalField = data.optionalField;\n this.optionalNumber = data.optionalNumber;\n this.requiredBoolean = data.requiredBoolean;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH DEFAULT VALUES\n// ============================================================================\n\nlet factoryCallCount = 0;\n\n/**\n * Entity with various default value strategies\n * Features: Static defaults, factory defaults, async factory defaults\n */\n@Entity()\nexport class EntityWithDefaults {\n @StringProperty({ default: 'default-name' })\n name!: string;\n\n @NumberProperty({ default: () => factoryCallCount++ })\n counter!: number;\n\n @DateProperty({ default: () => new Date('2025-01-01') })\n timestamp!: Date;\n\n @StringProperty({ default: async () => 'async-value' })\n asyncField!: string;\n\n @BooleanProperty({ default: true })\n enabled!: boolean;\n\n constructor(data: {\n name?: string;\n counter?: number;\n timestamp?: Date;\n asyncField?: string;\n enabled?: boolean;\n }) {\n this.name = data.name!;\n this.counter = data.counter!;\n this.timestamp = data.timestamp!;\n this.asyncField = data.asyncField!;\n this.enabled = data.enabled!;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH ARRAYS\n// ============================================================================\n\n/**\n * Entity with various array configurations\n * Features: Regular arrays, sparse arrays, array validators\n */\n@Entity()\nexport class EntityWithArrays {\n @ArrayProperty(() => String)\n tags!: string[];\n\n @ArrayProperty(() => Number, {\n minLength: 1,\n maxLength: 5,\n })\n ratings!: number[];\n\n @ArrayProperty(() => String, { sparse: true })\n sparseArray!: (string | null | undefined)[];\n\n @ArrayProperty(() => TestUser)\n users!: TestUser[];\n\n constructor(data: {\n tags: string[];\n ratings: number[];\n sparseArray: (string | null | undefined)[];\n users: TestUser[];\n }) {\n this.tags = data.tags;\n this.ratings = data.ratings;\n this.sparseArray = data.sparseArray;\n this.users = data.users;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH ENUMS\n// ============================================================================\n\nexport enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n GUEST = 'guest',\n}\n\nexport enum ProductStatus {\n DRAFT = 'draft',\n PUBLISHED = 'published',\n ARCHIVED = 'archived',\n}\n\n/**\n * Entity with enum properties\n * Features: EnumProperty decorator\n */\n@Entity()\nexport class EntityWithEnum {\n @StringProperty() name!: string;\n @EnumProperty(UserRole) role!: UserRole;\n @EnumProperty(ProductStatus) status!: ProductStatus;\n\n constructor(data: { name: string; role: UserRole; status: ProductStatus }) {\n this.name = data.name;\n this.role = data.role;\n this.status = data.status;\n }\n}\n\n// ============================================================================\n// NESTED ENTITIES (2-3 LEVELS)\n// ============================================================================\n\n/**\n * Level 1: Simple address entity\n * Features: Basic nested entity\n */\n@Entity()\nexport class TestAddress {\n @StringProperty() street!: string;\n @StringProperty() city!: string;\n @StringProperty() country!: string;\n @IntProperty() zipCode!: number;\n\n constructor(data: {\n street: string;\n city: string;\n country: string;\n zipCode: number;\n }) {\n this.street = data.street;\n this.city = data.city;\n this.country = data.country;\n this.zipCode = data.zipCode;\n }\n}\n\n/**\n * Level 2: Company with nested address\n * Features: 1-level nesting\n */\n@Entity()\nexport class TestCompany {\n @StringProperty() name!: string;\n @EntityProperty(() => TestAddress) address!: TestAddress;\n @IntProperty() employeeCount!: number;\n\n constructor(data: {\n name: string;\n address: TestAddress;\n employeeCount: number;\n }) {\n this.name = data.name;\n this.address = data.address;\n this.employeeCount = data.employeeCount;\n }\n}\n\n/**\n * Level 3: Employee with nested company (which has nested address)\n * Features: 2-level nesting\n */\n@Entity()\nexport class TestEmployee {\n @StringProperty() name!: string;\n @StringProperty() email!: string;\n @EntityProperty(() => TestCompany) company!: TestCompany;\n @NumberProperty() salary!: number;\n @DateProperty() hireDate!: Date;\n\n constructor(data: {\n name: string;\n email: string;\n company: TestCompany;\n salary: number;\n hireDate: Date;\n }) {\n this.name = data.name;\n this.email = data.email;\n this.company = data.company;\n this.salary = data.salary;\n this.hireDate = data.hireDate;\n }\n}\n\n/**\n * Entity with optional nested entities\n * Features: Optional nested entities\n */\n@Entity()\nexport class EntityWithOptionalNested {\n @StringProperty() id!: string;\n @EntityProperty(() => TestAddress, { optional: true })\n billingAddress?: TestAddress;\n @EntityProperty(() => TestAddress, { optional: true })\n shippingAddress?: TestAddress;\n\n constructor(data: {\n id: string;\n billingAddress?: TestAddress;\n shippingAddress?: TestAddress;\n }) {\n this.id = data.id;\n this.billingAddress = data.billingAddress;\n this.shippingAddress = data.shippingAddress;\n }\n}\n\n// ============================================================================\n// COLLECTION ENTITIES\n// ============================================================================\n\n/**\n * Collection entity wrapping string array\n * Features: @CollectionEntity decorator, unwraps to array\n */\n@CollectionEntity()\nexport class TestTags {\n @ArrayProperty(() => String)\n readonly collection: string[];\n\n constructor(data: { collection: string[] }) {\n this.collection = data.collection;\n }\n}\n\n/**\n * Collection entity wrapping number array\n * Features: @CollectionEntity with numbers\n */\n@CollectionEntity()\nexport class TestIdList {\n @ArrayProperty(() => Number)\n readonly collection: number[];\n\n constructor(data: { collection: number[] }) {\n this.collection = data.collection;\n }\n}\n\n/**\n * Collection entity with entity items\n * Features: @CollectionEntity with nested entities\n */\n@CollectionEntity()\nexport class TestUserCollection {\n @ArrayProperty(() => TestUser)\n readonly collection: TestUser[];\n\n constructor(data: { collection: TestUser[] }) {\n this.collection = data.collection;\n }\n}\n\n// ============================================================================\n// STRINGIFIABLE ENTITIES\n// ============================================================================\n\n/**\n * Stringifiable entity for user IDs\n * Features: @Stringifiable decorator, unwraps to string\n */\n@Stringifiable()\nexport class TestUserId {\n @StringProperty() readonly value: string;\n\n constructor(data: { value: string }) {\n this.value = data.value;\n }\n}\n\n/**\n * Stringifiable entity for emails with validation\n * Features: @Stringifiable with validation\n */\n@Stringifiable()\nexport class TestEmail {\n @StringProperty({\n pattern: /^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$/i,\n })\n readonly value: string;\n\n constructor(data: { value: string }) {\n this.value = data.value;\n }\n}\n\n/**\n * Entity using stringifiable properties\n * Features: Properties that are stringifiable entities\n */\n@Entity()\nexport class EntityWithStringifiable {\n @EntityProperty(() => TestUserId) userId!: TestUserId;\n @EntityProperty(() => TestEmail) email!: TestEmail;\n @StringProperty() name!: string;\n\n constructor(data: { userId: TestUserId; email: TestEmail; name: string }) {\n this.userId = data.userId;\n this.email = data.email;\n this.name = data.name;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH DEPENDENCY INJECTION\n// ============================================================================\n\nexport interface ILogger {\n log(message: string): void;\n}\n\nexport const LOGGER_TOKEN = Symbol('Logger');\n\n/**\n * Entity with injected properties\n * Features: @InjectedProperty decorator\n */\n@Entity()\nexport class EntityWithDI {\n @StringProperty() name!: string;\n @InjectedProperty(LOGGER_TOKEN) logger!: ILogger;\n\n constructor(data: { name: string; logger?: ILogger }) {\n this.name = data.name;\n if (data.logger) {\n this.logger = data.logger;\n }\n }\n\n logName(): void {\n this.logger.log(`Name is: ${this.name}`);\n }\n}\n\n// ============================================================================\n// ENTITIES WITH PASSTHROUGH\n// ============================================================================\n\n/**\n * Entity with passthrough properties\n * Features: @PassthroughProperty for unknown types\n */\n@Entity()\nexport class EntityWithPassthrough {\n @StringProperty() id!: string;\n @PassthroughProperty() metadata!: Record<string, unknown>;\n @PassthroughProperty() config!: unknown;\n\n constructor(data: {\n id: string;\n metadata: Record<string, unknown>;\n config: unknown;\n }) {\n this.id = data.id;\n this.metadata = data.metadata;\n this.config = data.config;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH CUSTOM SERIALIZATION\n// ============================================================================\n\n/**\n * Custom serializable class\n */\nexport class CustomValue {\n constructor(\n public x: number,\n public y: number,\n ) {}\n\n toData() {\n return { x: this.x, y: this.y };\n }\n\n static fromData(data: { x: number; y: number }): CustomValue {\n return new CustomValue(data.x, data.y);\n }\n}\n\n/**\n * Entity with custom serialize/deserialize\n * Features: Custom serialization functions\n */\n@Entity()\nexport class EntityWithCustomSerialization {\n @StringProperty() name!: string;\n\n @Property({\n type: () => CustomValue,\n serialize: (v: CustomValue) => v.toData(),\n deserialize: (d: unknown) =>\n CustomValue.fromData(d as { x: number; y: number }),\n })\n position!: CustomValue;\n\n constructor(data: { name: string; position: CustomValue }) {\n this.name = data.name;\n this.position = data.position;\n }\n}\n\n/**\n * Entity to verify serialize/deserialize context is passed correctly\n * Features: Context-aware serialization using propertyName and sibling values\n */\n@Entity()\nexport class EntityWithContextSerialization {\n @StringProperty() id!: string;\n\n @Property({\n type: () => String,\n serialize: (v: string, context) =>\n `${context.propertyName}:${v}:${context.entity['id']}`,\n deserialize: (raw: unknown, context) =>\n `${raw}-from-${context.rawObject['id']}`,\n })\n label!: string;\n\n constructor(data: { id: string; label: string }) {\n this.id = data.id;\n this.label = data.label;\n }\n}\n\n/**\n * Custom class with equals method\n */\nexport class CustomPoint {\n constructor(\n public x: number,\n public y: number,\n ) {}\n\n equals(other: CustomPoint): boolean {\n return this.x === other.x && this.y === other.y;\n }\n\n toString(): string {\n return `${this.x},${this.y}`;\n }\n\n static fromString(str: string): CustomPoint {\n const [x, y] = str.split(',').map(Number);\n return new CustomPoint(x, y);\n }\n}\n\n/**\n * Entity with custom equals function\n * Features: Custom equality comparison\n */\n@Entity()\nexport class EntityWithCustomEquals {\n @StringProperty() id!: string;\n\n @Property({\n type: () => CustomPoint,\n serialize: (v: CustomPoint) => v.toString(),\n deserialize: (d: unknown) => CustomPoint.fromString(d as string),\n equals: (a: CustomPoint, b: CustomPoint) => a.equals(b),\n })\n location!: CustomPoint;\n\n constructor(data: { id: string; location: CustomPoint }) {\n this.id = data.id;\n this.location = data.location;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH SERIALIZABLE/PARSEABLE PROPERTIES\n// ============================================================================\n\n/**\n * Custom class implementing Serializable interface\n */\nexport class SerializableValue {\n constructor(public data: string) {}\n\n toJSON(): string {\n return this.data;\n }\n\n equals(other: SerializableValue): boolean {\n return this.data === other.data;\n }\n\n static parse(json: unknown): SerializableValue {\n return new SerializableValue(json as string);\n }\n}\n\n/**\n * Entity using SerializableProperty\n * Features: @SerializableProperty decorator\n */\n@Entity()\nexport class EntityWithSerializable {\n @StringProperty() name!: string;\n @SerializableProperty(() => SerializableValue)\n value!: SerializableValue;\n\n constructor(data: { name: string; value: SerializableValue }) {\n this.name = data.name;\n this.value = data.value;\n }\n}\n\n/**\n * Custom class implementing Parseable interface\n */\nexport class ParseableValue {\n constructor(public data: number) {}\n\n toString(): string {\n return String(this.data);\n }\n\n equals(other: ParseableValue): boolean {\n return this.data === other.data;\n }\n\n static parse(str: string): ParseableValue {\n return new ParseableValue(Number(str));\n }\n}\n\n/**\n * Entity using StringifiableProperty\n * Features: @StringifiableProperty decorator\n */\n@Entity()\nexport class EntityWithParseable {\n @StringProperty() label!: string;\n @StringifiableProperty(() => ParseableValue)\n value!: ParseableValue;\n\n constructor(data: { label: string; value: ParseableValue }) {\n this.label = data.label;\n this.value = data.value;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH ZOD VALIDATION\n// ============================================================================\n\nconst emailSchema = z.string().email();\nconst positiveIntSchema = z.number().int().positive();\n\n/**\n * Entity with Zod validation\n * Features: @ZodProperty decorator\n */\n@Entity()\nexport class EntityWithZod {\n @ZodProperty(z.string().min(3).max(20))\n username!: string;\n\n @ZodProperty(emailSchema)\n email!: string;\n\n @ZodProperty(positiveIntSchema)\n count!: number;\n\n constructor(data: { username: string; email: string; count: number }) {\n this.username = data.username;\n this.email = data.email;\n this.count = data.count;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH IMMUTABLE PROPERTIES\n// ============================================================================\n\n/**\n * Entity with immutable (preventUpdates) properties\n * Features: preventUpdates flag\n */\n@Entity()\nexport class EntityWithImmutable {\n @StringProperty({ preventUpdates: true })\n readonly id: string;\n\n @StringProperty() name!: string;\n\n @DateProperty({ preventUpdates: true })\n readonly createdAt: Date;\n\n @NumberProperty() value!: number;\n\n constructor(data: {\n id: string;\n name: string;\n createdAt: Date;\n value: number;\n }) {\n this.id = data.id;\n this.name = data.name;\n this.createdAt = data.createdAt;\n this.value = data.value;\n }\n}\n\n// ============================================================================\n// COMPLEX ENTITY (COMBINING MULTIPLE FEATURES)\n// ============================================================================\n\n/**\n * Complex entity combining multiple features\n * Features: All common features in one entity\n * - Primitives, enums, nested entities, arrays\n * - Optional fields, defaults, validation\n * - Custom serialization, stringifiable properties\n */\n@Entity()\nexport class ComplexEntity {\n @StringProperty({ preventUpdates: true })\n readonly id: string;\n\n @StringProperty({ minLength: 2, maxLength: 50 })\n name!: string;\n\n @EnumProperty(UserRole)\n role!: UserRole;\n\n @EntityProperty(() => TestUserId)\n userId!: TestUserId;\n\n @EntityProperty(() => TestAddress)\n address!: TestAddress;\n\n @ArrayProperty(() => String, { minLength: 0, maxLength: 10 })\n tags!: string[];\n\n @ArrayProperty(() => TestProduct)\n products!: TestProduct[];\n\n @NumberProperty({ optional: true, min: 0 })\n score?: number;\n\n @DateProperty({ default: () => new Date() })\n createdAt!: Date;\n\n @DateProperty({ optional: true })\n updatedAt?: Date;\n\n @BooleanProperty({ default: true })\n active!: boolean;\n\n @PassthroughProperty()\n metadata!: Record<string, unknown>;\n\n constructor(data: {\n id: string;\n name: string;\n role: UserRole;\n userId: TestUserId;\n address: TestAddress;\n tags: string[];\n products: TestProduct[];\n score?: number;\n createdAt?: Date;\n updatedAt?: Date;\n active?: boolean;\n metadata: Record<string, unknown>;\n }) {\n this.id = data.id;\n this.name = data.name;\n this.role = data.role;\n this.userId = data.userId;\n this.address = data.address;\n this.tags = data.tags;\n this.products = data.products;\n this.score = data.score;\n this.createdAt = data.createdAt!;\n this.updatedAt = data.updatedAt;\n this.active = data.active!;\n this.metadata = data.metadata;\n }\n\n @EntityValidator()\n validateProducts(): Problem[] {\n if (this.products.length === 0 && this.active) {\n return [\n new Problem({\n property: 'products',\n message: 'Active entity must have at least one product',\n }),\n ];\n }\n return [];\n }\n}\n\n// ============================================================================\n// HELPER TO RESET FACTORY COUNTER (FOR TESTING)\n// ============================================================================\n\nexport function resetFactoryCallCount(): void {\n factoryCallCount = 0;\n}\n\n// ============================================================================\n// ENTITIES FOR parseBigInt TESTING\n// ============================================================================\n\n/**\n * Entity with NumberProperty and IntProperty configured with parseBigInt: true\n * Features: coercion from bigint / integer string to number\n */\n@Entity()\nexport class EntityWithParseBigInt {\n @NumberProperty({ parseBigInt: true }) amount!: number;\n @IntProperty({ parseBigInt: true }) count!: number;\n\n constructor(data: { amount: number; count: number }) {\n this.amount = data.amount;\n this.count = data.count;\n }\n}\n"],"names":["z","Entity","CollectionEntity","Stringifiable","EntityValidator","Property","StringProperty","NumberProperty","IntProperty","BooleanProperty","DateProperty","BigIntProperty","EnumProperty","EntityProperty","ArrayProperty","PassthroughProperty","SerializableProperty","StringifiableProperty","InjectedProperty","ZodProperty","Problem","TestUser","data","name","age","active","TestProduct","id","price","quantity","createdAt","EntityWithSpecialTypes","timestamp","largeNumber","label","ValidatedEntity","username","email","minLength","maxLength","pattern","min","max","CrossValidatedEntity","password","confirmPassword","startDate","endDate","validatePasswords","property","message","validateDates","OptionalFieldsEntity","requiredField","optionalField","optionalNumber","requiredBoolean","optional","factoryCallCount","EntityWithDefaults","counter","asyncField","enabled","default","Date","EntityWithArrays","tags","ratings","sparseArray","users","String","Number","sparse","UserRole","ProductStatus","EntityWithEnum","role","status","TestAddress","street","city","country","zipCode","TestCompany","address","employeeCount","TestEmployee","company","salary","hireDate","EntityWithOptionalNested","billingAddress","shippingAddress","TestTags","collection","TestIdList","TestUserCollection","TestUserId","value","TestEmail","EntityWithStringifiable","userId","LOGGER_TOKEN","Symbol","EntityWithDI","logger","logName","log","EntityWithPassthrough","metadata","config","CustomValue","x","y","toData","fromData","EntityWithCustomSerialization","position","type","serialize","v","deserialize","d","EntityWithContextSerialization","context","propertyName","entity","raw","rawObject","CustomPoint","equals","other","toString","fromString","str","split","map","EntityWithCustomEquals","location","a","b","SerializableValue","toJSON","parse","json","EntityWithSerializable","ParseableValue","EntityWithParseable","emailSchema","string","positiveIntSchema","number","int","positive","EntityWithZod","count","EntityWithImmutable","preventUpdates","ComplexEntity","products","score","updatedAt","validateProducts","length","resetFactoryCallCount","EntityWithParseBigInt","amount","parseBigInt"],"mappings":";;AAAA,OAAO,mBAAmB;AAC1B,SAASA,CAAC,QAAQ,MAAM;AACxB,SACEC,MAAM,EACNC,gBAAgB,EAChBC,aAAa,EACbC,eAAe,QACV,cAAc;AACrB,SACEC,QAAQ,EACR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APoBY,aAAa;;;;;;QAChBA,aAAa"}
1
+ {"version":3,"sources":["../../src/lib/test-entities.ts"],"sourcesContent":["import 'reflect-metadata';\nimport { z } from 'zod';\nimport {\n Entity,\n CollectionEntity,\n Stringifiable,\n EntityValidator,\n} from './entity.js';\nimport {\n Property,\n StringProperty,\n NumberProperty,\n IntProperty,\n BooleanProperty,\n DateProperty,\n BigIntProperty,\n EnumProperty,\n EntityProperty,\n ArrayProperty,\n PassthroughProperty,\n SerializableProperty,\n StringifiableProperty,\n} from './property.js';\nimport { InjectedProperty } from './injected-property.js';\nimport { ZodProperty } from './zod-property.js';\nimport { Problem } from './problem.js';\n\n// ============================================================================\n// SIMPLE ENTITIES WITH PRIMITIVES\n// ============================================================================\n\n/**\n * Basic entity with common primitive types\n * Features: String, Number, Boolean properties\n */\n@Entity()\nexport class TestUser {\n @StringProperty() name!: string;\n @NumberProperty() age!: number;\n @BooleanProperty() active!: boolean;\n\n constructor(data: { name: string; age: number; active: boolean }) {\n this.name = data.name;\n this.age = data.age;\n this.active = data.active;\n }\n}\n\n/**\n * Entity with different primitive combinations\n * Features: String, Number, Int, Date properties\n */\n@Entity()\nexport class TestProduct {\n @StringProperty() id!: string;\n @StringProperty() name!: string;\n @NumberProperty() price!: number;\n @IntProperty() quantity!: number;\n @DateProperty() createdAt!: Date;\n\n constructor(data: {\n id: string;\n name: string;\n price: number;\n quantity: number;\n createdAt: Date;\n }) {\n this.id = data.id;\n this.name = data.name;\n this.price = data.price;\n this.quantity = data.quantity;\n this.createdAt = data.createdAt;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH SPECIAL TYPES\n// ============================================================================\n\n/**\n * Entity with Date and BigInt types\n * Features: DateProperty, BigIntProperty\n */\n@Entity()\nexport class EntityWithSpecialTypes {\n @DateProperty() timestamp!: Date;\n @BigIntProperty() largeNumber!: bigint;\n @StringProperty() label!: string;\n\n constructor(data: { timestamp: Date; largeNumber: bigint; label: string }) {\n this.timestamp = data.timestamp;\n this.largeNumber = data.largeNumber;\n this.label = data.label;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH VALIDATION\n// ============================================================================\n\n/**\n * Entity with property-level validators\n * Features: String validators (minLength, maxLength, pattern)\n */\n@Entity()\nexport class ValidatedEntity {\n @StringProperty({\n minLength: 3,\n maxLength: 20,\n })\n username!: string;\n\n @StringProperty({\n pattern: /^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$/i,\n })\n email!: string;\n\n @NumberProperty({ min: 0, max: 150 })\n age!: number;\n\n constructor(data: { username: string; email: string; age: number }) {\n this.username = data.username;\n this.email = data.email;\n this.age = data.age;\n }\n}\n\n/**\n * Entity with cross-property validation\n * Features: @EntityValidator decorator\n */\n@Entity()\nexport class CrossValidatedEntity {\n @StringProperty() password!: string;\n @StringProperty() confirmPassword!: string;\n @DateProperty() startDate!: Date;\n @DateProperty() endDate!: Date;\n\n constructor(data: {\n password: string;\n confirmPassword: string;\n startDate: Date;\n endDate: Date;\n }) {\n this.password = data.password;\n this.confirmPassword = data.confirmPassword;\n this.startDate = data.startDate;\n this.endDate = data.endDate;\n }\n\n @EntityValidator()\n validatePasswords(): Problem[] {\n if (this.password !== this.confirmPassword) {\n return [\n new Problem({\n property: 'confirmPassword',\n message: 'Passwords do not match',\n }),\n ];\n }\n return [];\n }\n\n @EntityValidator()\n validateDates(): Problem[] {\n if (this.startDate >= this.endDate) {\n return [\n new Problem({\n property: 'endDate',\n message: 'End date must be after start date',\n }),\n ];\n }\n return [];\n }\n}\n\n// ============================================================================\n// ENTITIES WITH OPTIONAL/REQUIRED FIELDS\n// ============================================================================\n\n/**\n * Entity with mix of optional and required properties\n * Features: optional flag\n */\n@Entity()\nexport class OptionalFieldsEntity {\n @StringProperty() requiredField!: string;\n @StringProperty({ optional: true }) optionalField?: string;\n @NumberProperty({ optional: true }) optionalNumber?: number;\n @BooleanProperty() requiredBoolean!: boolean;\n\n constructor(data: {\n requiredField: string;\n optionalField?: string;\n optionalNumber?: number;\n requiredBoolean: boolean;\n }) {\n this.requiredField = data.requiredField;\n this.optionalField = data.optionalField;\n this.optionalNumber = data.optionalNumber;\n this.requiredBoolean = data.requiredBoolean;\n }\n}\n\n/**\n * Entity with properties whose serialized JSON key differs from the property name\n * Features: serializedKey option, optional property with serializedKey\n */\n@Entity()\nexport class EntityWithSerializedKey {\n @StringProperty({ serializedKey: 'first_name' })\n firstName!: string;\n\n @StringProperty({ serializedKey: 'last_name', optional: true })\n lastName?: string;\n\n @NumberProperty()\n age!: number;\n\n constructor(data: { firstName: string; lastName?: string; age: number }) {\n this.firstName = data.firstName;\n this.lastName = data.lastName;\n this.age = data.age;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH DEFAULT VALUES\n// ============================================================================\n\nlet factoryCallCount = 0;\n\n/**\n * Entity with various default value strategies\n * Features: Static defaults, factory defaults, async factory defaults\n */\n@Entity()\nexport class EntityWithDefaults {\n @StringProperty({ default: 'default-name' })\n name!: string;\n\n @NumberProperty({ default: () => factoryCallCount++ })\n counter!: number;\n\n @DateProperty({ default: () => new Date('2025-01-01') })\n timestamp!: Date;\n\n @StringProperty({ default: async () => 'async-value' })\n asyncField!: string;\n\n @BooleanProperty({ default: true })\n enabled!: boolean;\n\n constructor(data: {\n name?: string;\n counter?: number;\n timestamp?: Date;\n asyncField?: string;\n enabled?: boolean;\n }) {\n this.name = data.name!;\n this.counter = data.counter!;\n this.timestamp = data.timestamp!;\n this.asyncField = data.asyncField!;\n this.enabled = data.enabled!;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH ARRAYS\n// ============================================================================\n\n/**\n * Entity with various array configurations\n * Features: Regular arrays, sparse arrays, array validators\n */\n@Entity()\nexport class EntityWithArrays {\n @ArrayProperty(() => String)\n tags!: string[];\n\n @ArrayProperty(() => Number, {\n minLength: 1,\n maxLength: 5,\n })\n ratings!: number[];\n\n @ArrayProperty(() => String, { sparse: true })\n sparseArray!: (string | null | undefined)[];\n\n @ArrayProperty(() => TestUser)\n users!: TestUser[];\n\n constructor(data: {\n tags: string[];\n ratings: number[];\n sparseArray: (string | null | undefined)[];\n users: TestUser[];\n }) {\n this.tags = data.tags;\n this.ratings = data.ratings;\n this.sparseArray = data.sparseArray;\n this.users = data.users;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH ENUMS\n// ============================================================================\n\nexport enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n GUEST = 'guest',\n}\n\nexport enum ProductStatus {\n DRAFT = 'draft',\n PUBLISHED = 'published',\n ARCHIVED = 'archived',\n}\n\n/**\n * Entity with enum properties\n * Features: EnumProperty decorator\n */\n@Entity()\nexport class EntityWithEnum {\n @StringProperty() name!: string;\n @EnumProperty(UserRole) role!: UserRole;\n @EnumProperty(ProductStatus) status!: ProductStatus;\n\n constructor(data: { name: string; role: UserRole; status: ProductStatus }) {\n this.name = data.name;\n this.role = data.role;\n this.status = data.status;\n }\n}\n\n// ============================================================================\n// NESTED ENTITIES (2-3 LEVELS)\n// ============================================================================\n\n/**\n * Level 1: Simple address entity\n * Features: Basic nested entity\n */\n@Entity()\nexport class TestAddress {\n @StringProperty() street!: string;\n @StringProperty() city!: string;\n @StringProperty() country!: string;\n @IntProperty() zipCode!: number;\n\n constructor(data: {\n street: string;\n city: string;\n country: string;\n zipCode: number;\n }) {\n this.street = data.street;\n this.city = data.city;\n this.country = data.country;\n this.zipCode = data.zipCode;\n }\n}\n\n/**\n * Level 2: Company with nested address\n * Features: 1-level nesting\n */\n@Entity()\nexport class TestCompany {\n @StringProperty() name!: string;\n @EntityProperty(() => TestAddress) address!: TestAddress;\n @IntProperty() employeeCount!: number;\n\n constructor(data: {\n name: string;\n address: TestAddress;\n employeeCount: number;\n }) {\n this.name = data.name;\n this.address = data.address;\n this.employeeCount = data.employeeCount;\n }\n}\n\n/**\n * Level 3: Employee with nested company (which has nested address)\n * Features: 2-level nesting\n */\n@Entity()\nexport class TestEmployee {\n @StringProperty() name!: string;\n @StringProperty() email!: string;\n @EntityProperty(() => TestCompany) company!: TestCompany;\n @NumberProperty() salary!: number;\n @DateProperty() hireDate!: Date;\n\n constructor(data: {\n name: string;\n email: string;\n company: TestCompany;\n salary: number;\n hireDate: Date;\n }) {\n this.name = data.name;\n this.email = data.email;\n this.company = data.company;\n this.salary = data.salary;\n this.hireDate = data.hireDate;\n }\n}\n\n/**\n * Entity with optional nested entities\n * Features: Optional nested entities\n */\n@Entity()\nexport class EntityWithOptionalNested {\n @StringProperty() id!: string;\n @EntityProperty(() => TestAddress, { optional: true })\n billingAddress?: TestAddress;\n @EntityProperty(() => TestAddress, { optional: true })\n shippingAddress?: TestAddress;\n\n constructor(data: {\n id: string;\n billingAddress?: TestAddress;\n shippingAddress?: TestAddress;\n }) {\n this.id = data.id;\n this.billingAddress = data.billingAddress;\n this.shippingAddress = data.shippingAddress;\n }\n}\n\n// ============================================================================\n// COLLECTION ENTITIES\n// ============================================================================\n\n/**\n * Collection entity wrapping string array\n * Features: @CollectionEntity decorator, unwraps to array\n */\n@CollectionEntity()\nexport class TestTags {\n @ArrayProperty(() => String)\n readonly collection: string[];\n\n constructor(data: { collection: string[] }) {\n this.collection = data.collection;\n }\n}\n\n/**\n * Collection entity wrapping number array\n * Features: @CollectionEntity with numbers\n */\n@CollectionEntity()\nexport class TestIdList {\n @ArrayProperty(() => Number)\n readonly collection: number[];\n\n constructor(data: { collection: number[] }) {\n this.collection = data.collection;\n }\n}\n\n/**\n * Collection entity with entity items\n * Features: @CollectionEntity with nested entities\n */\n@CollectionEntity()\nexport class TestUserCollection {\n @ArrayProperty(() => TestUser)\n readonly collection: TestUser[];\n\n constructor(data: { collection: TestUser[] }) {\n this.collection = data.collection;\n }\n}\n\n// ============================================================================\n// STRINGIFIABLE ENTITIES\n// ============================================================================\n\n/**\n * Stringifiable entity for user IDs\n * Features: @Stringifiable decorator, unwraps to string\n */\n@Stringifiable()\nexport class TestUserId {\n @StringProperty() readonly value: string;\n\n constructor(data: { value: string }) {\n this.value = data.value;\n }\n}\n\n/**\n * Stringifiable entity for emails with validation\n * Features: @Stringifiable with validation\n */\n@Stringifiable()\nexport class TestEmail {\n @StringProperty({\n pattern: /^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$/i,\n })\n readonly value: string;\n\n constructor(data: { value: string }) {\n this.value = data.value;\n }\n}\n\n/**\n * Entity using stringifiable properties\n * Features: Properties that are stringifiable entities\n */\n@Entity()\nexport class EntityWithStringifiable {\n @EntityProperty(() => TestUserId) userId!: TestUserId;\n @EntityProperty(() => TestEmail) email!: TestEmail;\n @StringProperty() name!: string;\n\n constructor(data: { userId: TestUserId; email: TestEmail; name: string }) {\n this.userId = data.userId;\n this.email = data.email;\n this.name = data.name;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH DEPENDENCY INJECTION\n// ============================================================================\n\nexport interface ILogger {\n log(message: string): void;\n}\n\nexport const LOGGER_TOKEN = Symbol('Logger');\n\n/**\n * Entity with injected properties\n * Features: @InjectedProperty decorator\n */\n@Entity()\nexport class EntityWithDI {\n @StringProperty() name!: string;\n @InjectedProperty(LOGGER_TOKEN) logger!: ILogger;\n\n constructor(data: { name: string; logger?: ILogger }) {\n this.name = data.name;\n if (data.logger) {\n this.logger = data.logger;\n }\n }\n\n logName(): void {\n this.logger.log(`Name is: ${this.name}`);\n }\n}\n\n// ============================================================================\n// ENTITIES WITH PASSTHROUGH\n// ============================================================================\n\n/**\n * Entity with passthrough properties\n * Features: @PassthroughProperty for unknown types\n */\n@Entity()\nexport class EntityWithPassthrough {\n @StringProperty() id!: string;\n @PassthroughProperty() metadata!: Record<string, unknown>;\n @PassthroughProperty() config!: unknown;\n\n constructor(data: {\n id: string;\n metadata: Record<string, unknown>;\n config: unknown;\n }) {\n this.id = data.id;\n this.metadata = data.metadata;\n this.config = data.config;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH CUSTOM SERIALIZATION\n// ============================================================================\n\n/**\n * Custom serializable class\n */\nexport class CustomValue {\n constructor(\n public x: number,\n public y: number,\n ) {}\n\n toData() {\n return { x: this.x, y: this.y };\n }\n\n static fromData(data: { x: number; y: number }): CustomValue {\n return new CustomValue(data.x, data.y);\n }\n}\n\n/**\n * Entity with custom serialize/deserialize\n * Features: Custom serialization functions\n */\n@Entity()\nexport class EntityWithCustomSerialization {\n @StringProperty() name!: string;\n\n @Property({\n type: () => CustomValue,\n serialize: (v: CustomValue) => v.toData(),\n deserialize: (d: unknown) =>\n CustomValue.fromData(d as { x: number; y: number }),\n })\n position!: CustomValue;\n\n constructor(data: { name: string; position: CustomValue }) {\n this.name = data.name;\n this.position = data.position;\n }\n}\n\n/**\n * Entity to verify serialize/deserialize context is passed correctly\n * Features: Context-aware serialization using propertyName and sibling values\n */\n@Entity()\nexport class EntityWithContextSerialization {\n @StringProperty() id!: string;\n\n @Property({\n type: () => String,\n serialize: (v: string, context) =>\n `${context.propertyName}:${v}:${context.entity['id']}`,\n deserialize: (raw: unknown, context) =>\n `${raw}-from-${context.rawObject['id']}`,\n })\n label!: string;\n\n constructor(data: { id: string; label: string }) {\n this.id = data.id;\n this.label = data.label;\n }\n}\n\n/**\n * Custom class with equals method\n */\nexport class CustomPoint {\n constructor(\n public x: number,\n public y: number,\n ) {}\n\n equals(other: CustomPoint): boolean {\n return this.x === other.x && this.y === other.y;\n }\n\n toString(): string {\n return `${this.x},${this.y}`;\n }\n\n static fromString(str: string): CustomPoint {\n const [x, y] = str.split(',').map(Number);\n return new CustomPoint(x, y);\n }\n}\n\n/**\n * Entity with custom equals function\n * Features: Custom equality comparison\n */\n@Entity()\nexport class EntityWithCustomEquals {\n @StringProperty() id!: string;\n\n @Property({\n type: () => CustomPoint,\n serialize: (v: CustomPoint) => v.toString(),\n deserialize: (d: unknown) => CustomPoint.fromString(d as string),\n equals: (a: CustomPoint, b: CustomPoint) => a.equals(b),\n })\n location!: CustomPoint;\n\n constructor(data: { id: string; location: CustomPoint }) {\n this.id = data.id;\n this.location = data.location;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH SERIALIZABLE/PARSEABLE PROPERTIES\n// ============================================================================\n\n/**\n * Custom class implementing Serializable interface\n */\nexport class SerializableValue {\n constructor(public data: string) {}\n\n toJSON(): string {\n return this.data;\n }\n\n equals(other: SerializableValue): boolean {\n return this.data === other.data;\n }\n\n static parse(json: unknown): SerializableValue {\n return new SerializableValue(json as string);\n }\n}\n\n/**\n * Entity using SerializableProperty\n * Features: @SerializableProperty decorator\n */\n@Entity()\nexport class EntityWithSerializable {\n @StringProperty() name!: string;\n @SerializableProperty(() => SerializableValue)\n value!: SerializableValue;\n\n constructor(data: { name: string; value: SerializableValue }) {\n this.name = data.name;\n this.value = data.value;\n }\n}\n\n/**\n * Custom class implementing Parseable interface\n */\nexport class ParseableValue {\n constructor(public data: number) {}\n\n toString(): string {\n return String(this.data);\n }\n\n equals(other: ParseableValue): boolean {\n return this.data === other.data;\n }\n\n static parse(str: string): ParseableValue {\n return new ParseableValue(Number(str));\n }\n}\n\n/**\n * Entity using StringifiableProperty\n * Features: @StringifiableProperty decorator\n */\n@Entity()\nexport class EntityWithParseable {\n @StringProperty() label!: string;\n @StringifiableProperty(() => ParseableValue)\n value!: ParseableValue;\n\n constructor(data: { label: string; value: ParseableValue }) {\n this.label = data.label;\n this.value = data.value;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH ZOD VALIDATION\n// ============================================================================\n\nconst emailSchema = z.string().email();\nconst positiveIntSchema = z.number().int().positive();\n\n/**\n * Entity with Zod validation\n * Features: @ZodProperty decorator\n */\n@Entity()\nexport class EntityWithZod {\n @ZodProperty(z.string().min(3).max(20))\n username!: string;\n\n @ZodProperty(emailSchema)\n email!: string;\n\n @ZodProperty(positiveIntSchema)\n count!: number;\n\n constructor(data: { username: string; email: string; count: number }) {\n this.username = data.username;\n this.email = data.email;\n this.count = data.count;\n }\n}\n\n// ============================================================================\n// ENTITIES WITH IMMUTABLE PROPERTIES\n// ============================================================================\n\n/**\n * Entity with immutable (preventUpdates) properties\n * Features: preventUpdates flag\n */\n@Entity()\nexport class EntityWithImmutable {\n @StringProperty({ preventUpdates: true })\n readonly id: string;\n\n @StringProperty() name!: string;\n\n @DateProperty({ preventUpdates: true })\n readonly createdAt: Date;\n\n @NumberProperty() value!: number;\n\n constructor(data: {\n id: string;\n name: string;\n createdAt: Date;\n value: number;\n }) {\n this.id = data.id;\n this.name = data.name;\n this.createdAt = data.createdAt;\n this.value = data.value;\n }\n}\n\n// ============================================================================\n// COMPLEX ENTITY (COMBINING MULTIPLE FEATURES)\n// ============================================================================\n\n/**\n * Complex entity combining multiple features\n * Features: All common features in one entity\n * - Primitives, enums, nested entities, arrays\n * - Optional fields, defaults, validation\n * - Custom serialization, stringifiable properties\n */\n@Entity()\nexport class ComplexEntity {\n @StringProperty({ preventUpdates: true })\n readonly id: string;\n\n @StringProperty({ minLength: 2, maxLength: 50 })\n name!: string;\n\n @EnumProperty(UserRole)\n role!: UserRole;\n\n @EntityProperty(() => TestUserId)\n userId!: TestUserId;\n\n @EntityProperty(() => TestAddress)\n address!: TestAddress;\n\n @ArrayProperty(() => String, { minLength: 0, maxLength: 10 })\n tags!: string[];\n\n @ArrayProperty(() => TestProduct)\n products!: TestProduct[];\n\n @NumberProperty({ optional: true, min: 0 })\n score?: number;\n\n @DateProperty({ default: () => new Date() })\n createdAt!: Date;\n\n @DateProperty({ optional: true })\n updatedAt?: Date;\n\n @BooleanProperty({ default: true })\n active!: boolean;\n\n @PassthroughProperty()\n metadata!: Record<string, unknown>;\n\n constructor(data: {\n id: string;\n name: string;\n role: UserRole;\n userId: TestUserId;\n address: TestAddress;\n tags: string[];\n products: TestProduct[];\n score?: number;\n createdAt?: Date;\n updatedAt?: Date;\n active?: boolean;\n metadata: Record<string, unknown>;\n }) {\n this.id = data.id;\n this.name = data.name;\n this.role = data.role;\n this.userId = data.userId;\n this.address = data.address;\n this.tags = data.tags;\n this.products = data.products;\n this.score = data.score;\n this.createdAt = data.createdAt!;\n this.updatedAt = data.updatedAt;\n this.active = data.active!;\n this.metadata = data.metadata;\n }\n\n @EntityValidator()\n validateProducts(): Problem[] {\n if (this.products.length === 0 && this.active) {\n return [\n new Problem({\n property: 'products',\n message: 'Active entity must have at least one product',\n }),\n ];\n }\n return [];\n }\n}\n\n// ============================================================================\n// HELPER TO RESET FACTORY COUNTER (FOR TESTING)\n// ============================================================================\n\nexport function resetFactoryCallCount(): void {\n factoryCallCount = 0;\n}\n\n// ============================================================================\n// ENTITIES FOR parseBigInt TESTING\n// ============================================================================\n\n/**\n * Entity with NumberProperty and IntProperty configured with parseBigInt: true\n * Features: coercion from bigint / integer string to number\n */\n@Entity()\nexport class EntityWithParseBigInt {\n @NumberProperty({ parseBigInt: true }) amount!: number;\n @IntProperty({ parseBigInt: true }) count!: number;\n\n constructor(data: { amount: number; count: number }) {\n this.amount = data.amount;\n this.count = data.count;\n }\n}\n"],"names":["z","Entity","CollectionEntity","Stringifiable","EntityValidator","Property","StringProperty","NumberProperty","IntProperty","BooleanProperty","DateProperty","BigIntProperty","EnumProperty","EntityProperty","ArrayProperty","PassthroughProperty","SerializableProperty","StringifiableProperty","InjectedProperty","ZodProperty","Problem","TestUser","data","name","age","active","TestProduct","id","price","quantity","createdAt","EntityWithSpecialTypes","timestamp","largeNumber","label","ValidatedEntity","username","email","minLength","maxLength","pattern","min","max","CrossValidatedEntity","password","confirmPassword","startDate","endDate","validatePasswords","property","message","validateDates","OptionalFieldsEntity","requiredField","optionalField","optionalNumber","requiredBoolean","optional","EntityWithSerializedKey","firstName","lastName","serializedKey","factoryCallCount","EntityWithDefaults","counter","asyncField","enabled","default","Date","EntityWithArrays","tags","ratings","sparseArray","users","String","Number","sparse","UserRole","ProductStatus","EntityWithEnum","role","status","TestAddress","street","city","country","zipCode","TestCompany","address","employeeCount","TestEmployee","company","salary","hireDate","EntityWithOptionalNested","billingAddress","shippingAddress","TestTags","collection","TestIdList","TestUserCollection","TestUserId","value","TestEmail","EntityWithStringifiable","userId","LOGGER_TOKEN","Symbol","EntityWithDI","logger","logName","log","EntityWithPassthrough","metadata","config","CustomValue","x","y","toData","fromData","EntityWithCustomSerialization","position","type","serialize","v","deserialize","d","EntityWithContextSerialization","context","propertyName","entity","raw","rawObject","CustomPoint","equals","other","toString","fromString","str","split","map","EntityWithCustomEquals","location","a","b","SerializableValue","toJSON","parse","json","EntityWithSerializable","ParseableValue","EntityWithParseable","emailSchema","string","positiveIntSchema","number","int","positive","EntityWithZod","count","EntityWithImmutable","preventUpdates","ComplexEntity","products","score","updatedAt","validateProducts","length","resetFactoryCallCount","EntityWithParseBigInt","amount","parseBigInt"],"mappings":";;AAAA,OAAO,mBAAmB;AAC1B,SAASA,CAAC,QAAQ,MAAM;AACxB,SACEC,MAAM,EACNC,gBAAgB,EAChBC,aAAa,EACbC,eAAe,QACV,cAAc;AACrB,SACEC,QAAQ,EACRC,cAAc,EACdC,cAAc,EACdC,WAAW,EACXC,eAAe,EACfC,YAAY,EACZC,cAAc,EACdC,YAAY,EACZC,cAAc,EACdC,aAAa,EACbC,mBAAmB,EACnBC,oBAAoB,EACpBC,qBAAqB,QAChB,gBAAgB;AACvB,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,OAAO,QAAQ,eAAe;AAWvC,OAAO,MAAMC;IAKX,YAAYC,IAAoD,CAAE;QAChE,IAAI,CAACC,IAAI,GAAGD,KAAKC,IAAI;QACrB,IAAI,CAACC,GAAG,GAAGF,KAAKE,GAAG;QACnB,IAAI,CAACC,MAAM,GAAGH,KAAKG,MAAM;IAC3B;AACF;;;;;;;;;;;;;;;;;;;;AAOA,OAAO,MAAMC;IAOX,YAAYJ,IAMX,CAAE;QACD,IAAI,CAACK,EAAE,GAAGL,KAAKK,EAAE;QACjB,IAAI,CAACJ,IAAI,GAAGD,KAAKC,IAAI;QACrB,IAAI,CAACK,KAAK,GAAGN,KAAKM,KAAK;QACvB,IAAI,CAACC,QAAQ,GAAGP,KAAKO,QAAQ;QAC7B,IAAI,CAACC,SAAS,GAAGR,KAAKQ,SAAS;IACjC;AACF;;;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D,mBAA8B;QAC5B,IAAI,IAAI,CAACH,QAAQ,CAACI,MAAM,KAAK,KAAK,IAAI,CAAC9I,MAAM,EAAE;YAC7C,OAAO;gBACL,IAAIL,QAAQ;oBACV6B,UAAU;oBACVC,SAAS;gBACX;aACD;QACH;QACA,OAAO,EAAE;IACX;AACF;;;QA5EoB+G,gBAAgB;;;;;;QAGhB3H,WAAW;QAAGC,WAAW;;;;;;;;;uBAMrB8D;;;;uBAGAnB;;;;sBAGDR;QAAUpC,WAAW;QAAGC,WAAW;;;;;sBAGnCb;;;;;QAGH+B,UAAU;QAAMhB,KAAK;;;;;;QAGvB0B,SAAS,IAAM,IAAIC;;;;;;QAGnBX,UAAU;;;;;;QAGPU,SAAS;;;;;;;;;;;;;;;;;;;;;AAgD9B,+EAA+E;AAC/E,gDAAgD;AAChD,+EAA+E;AAE/E,OAAO,SAASqG;IACd1G,mBAAmB;AACrB;AAWA,OAAO,MAAM2G;IAIX,YAAYnJ,IAAuC,CAAE;QACnD,IAAI,CAACoJ,MAAM,GAAGpJ,KAAKoJ,MAAM;QACzB,IAAI,CAACX,KAAK,GAAGzI,KAAKyI,KAAK;IACzB;AACF;;;QAPoBY,aAAa;;;;;;QAChBA,aAAa"}
@@ -38,14 +38,14 @@ export declare const INJECTED_PROPERTY_OPTIONS_METADATA_KEY: unique symbol;
38
38
  export type AnyCtor<T = any> = Function & {
39
39
  prototype: T;
40
40
  };
41
- export type BuiltinCtors = StringConstructor | NumberConstructor | BooleanConstructor | BigIntConstructor | SymbolConstructor | DateConstructor;
41
+ export type BuiltinCtors = StringConstructor | NumberConstructor | BooleanConstructor | BigIntConstructor | SymbolConstructor | DateConstructor | BufferConstructor;
42
42
  /**
43
43
  * Type constructors for primitive types that can be deserialized
44
44
  * (excludes Symbol which cannot be deserialized from JSON)
45
45
  */
46
- export type PrimitiveConstructor = StringConstructor | NumberConstructor | BooleanConstructor | BigIntConstructor | DateConstructor;
46
+ export type PrimitiveConstructor = StringConstructor | NumberConstructor | BooleanConstructor | BigIntConstructor | DateConstructor | BufferConstructor;
47
47
  export type CtorLike<T> = AnyCtor<T> | BuiltinCtors;
48
- export type InstanceOfCtorLike<C> = C extends StringConstructor ? string : C extends NumberConstructor ? number : C extends BooleanConstructor ? boolean : C extends BigIntConstructor ? bigint : C extends SymbolConstructor ? symbol : C extends DateConstructor ? Date : C extends AnyCtor<infer T> ? T : never;
48
+ export type InstanceOfCtorLike<C> = C extends StringConstructor ? string : C extends NumberConstructor ? number : C extends BooleanConstructor ? boolean : C extends BigIntConstructor ? bigint : C extends SymbolConstructor ? symbol : C extends DateConstructor ? Date : C extends BufferConstructor ? Buffer : C extends AnyCtor<infer T> ? T : never;
49
49
  /**
50
50
  * Context passed to a custom serialize callback.
51
51
  */
@@ -220,6 +220,15 @@ export interface PropertyOptions<T = any, C extends CtorLike<T> = AnyCtor<T> | B
220
220
  * item!: BaseItem; // Could be ItemA or ItemB at runtime
221
221
  */
222
222
  discriminated?: boolean;
223
+ /**
224
+ * The key to use for this property in the serialized JSON representation.
225
+ * Defaults to the property's own name. Use this to map a property to a
226
+ * differently-named field on the wire (e.g. camelCase in code, snake_case in JSON).
227
+ * @example
228
+ * @Property({ type: () => String, serializedKey: 'first_name' })
229
+ * firstName!: string;
230
+ */
231
+ serializedKey?: string;
223
232
  /**
224
233
  * The property name to use as the discriminator for discriminated entity properties.
225
234
  * Defaults to '__type' if not specified.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,qBAAqB,eAA8B,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,6BAA6B,eAEzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,eAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,2BAA2B,eAAoC,CAAC;AAE7E;;GAEG;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