2023-03-30 15:38:55 -04:00
|
|
|
import { SystemConfig } from '@app/infra/entities';
|
2023-04-03 06:24:18 +02:00
|
|
|
import { Type } from 'class-transformer';
|
|
|
|
import { IsObject, ValidateNested } from 'class-validator';
|
2022-12-09 15:51:42 -05:00
|
|
|
import { SystemConfigFFmpegDto } from './system-config-ffmpeg.dto';
|
|
|
|
import { SystemConfigOAuthDto } from './system-config-oauth.dto';
|
2023-01-09 16:32:58 -05:00
|
|
|
import { SystemConfigPasswordLoginDto } from './system-config-password-login.dto';
|
2022-12-16 14:26:12 -06:00
|
|
|
import { SystemConfigStorageTemplateDto } from './system-config-storage-template.dto';
|
2022-12-09 15:51:42 -05:00
|
|
|
|
|
|
|
export class SystemConfigDto {
|
2023-04-03 06:24:18 +02:00
|
|
|
@Type(() => SystemConfigFFmpegDto)
|
2022-12-09 15:51:42 -05:00
|
|
|
@ValidateNested()
|
2023-04-03 06:24:18 +02:00
|
|
|
@IsObject()
|
2022-12-09 15:51:42 -05:00
|
|
|
ffmpeg!: SystemConfigFFmpegDto;
|
|
|
|
|
2023-04-03 06:24:18 +02:00
|
|
|
@Type(() => SystemConfigOAuthDto)
|
2022-12-09 15:51:42 -05:00
|
|
|
@ValidateNested()
|
2023-04-03 06:24:18 +02:00
|
|
|
@IsObject()
|
2022-12-09 15:51:42 -05:00
|
|
|
oauth!: SystemConfigOAuthDto;
|
2022-12-16 14:26:12 -06:00
|
|
|
|
2023-04-03 06:24:18 +02:00
|
|
|
@Type(() => SystemConfigPasswordLoginDto)
|
2023-01-09 16:32:58 -05:00
|
|
|
@ValidateNested()
|
2023-04-03 06:24:18 +02:00
|
|
|
@IsObject()
|
2023-01-09 16:32:58 -05:00
|
|
|
passwordLogin!: SystemConfigPasswordLoginDto;
|
|
|
|
|
2023-04-03 06:24:18 +02:00
|
|
|
@Type(() => SystemConfigStorageTemplateDto)
|
2022-12-16 14:26:12 -06:00
|
|
|
@ValidateNested()
|
2023-04-03 06:24:18 +02:00
|
|
|
@IsObject()
|
2022-12-16 14:26:12 -06:00
|
|
|
storageTemplate!: SystemConfigStorageTemplateDto;
|
2022-12-09 15:51:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export function mapConfig(config: SystemConfig): SystemConfigDto {
|
|
|
|
return config;
|
|
|
|
}
|