import { IsOptional } from 'class-validator' ; import { Expose , Transform } from 'class-transformer' ; export class FileIds { @ IsOptional ( ) @ Expose ( { name : 'file_data' , toPlainOnly : true } ) @ Transform ( ( ids ) => ids ?. map ( ( id ) => ( { file_uid : id } ) ) ?? [ ] , { toPlainOnly : true } ) @ Transform ( ( ids ) => ids ?. map ( ( val ) => val ?. file_uid ?? val ) ?? [ ] , { toClassOnly : true } ) files ? : string [ ] ; }