mirror of
https://github.com/immich-app/immich.git
synced 2025-01-10 13:56:47 +01:00
58 lines
1.1 KiB
TypeScript
58 lines
1.1 KiB
TypeScript
|
import { AssetType } from '@app/infra/db/entities';
|
||
|
import { Transform } from 'class-transformer';
|
||
|
import { IsArray, IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||
|
import { toBoolean } from '../../../../../apps/immich/src/utils/transform.util';
|
||
|
|
||
|
export class SearchDto {
|
||
|
@IsString()
|
||
|
@IsNotEmpty()
|
||
|
@IsOptional()
|
||
|
query?: string;
|
||
|
|
||
|
@IsEnum(AssetType)
|
||
|
@IsOptional()
|
||
|
type?: AssetType;
|
||
|
|
||
|
@IsBoolean()
|
||
|
@IsOptional()
|
||
|
@Transform(toBoolean)
|
||
|
isFavorite?: boolean;
|
||
|
|
||
|
@IsString()
|
||
|
@IsNotEmpty()
|
||
|
@IsOptional()
|
||
|
'exifInfo.city'?: string;
|
||
|
|
||
|
@IsString()
|
||
|
@IsNotEmpty()
|
||
|
@IsOptional()
|
||
|
'exifInfo.state'?: string;
|
||
|
|
||
|
@IsString()
|
||
|
@IsNotEmpty()
|
||
|
@IsOptional()
|
||
|
'exifInfo.country'?: string;
|
||
|
|
||
|
@IsString()
|
||
|
@IsNotEmpty()
|
||
|
@IsOptional()
|
||
|
'exifInfo.make'?: string;
|
||
|
|
||
|
@IsString()
|
||
|
@IsNotEmpty()
|
||
|
@IsOptional()
|
||
|
'exifInfo.model'?: string;
|
||
|
|
||
|
@IsString({ each: true })
|
||
|
@IsArray()
|
||
|
@IsOptional()
|
||
|
@Transform(({ value }) => value.split(','))
|
||
|
'smartInfo.objects'?: string[];
|
||
|
|
||
|
@IsString({ each: true })
|
||
|
@IsArray()
|
||
|
@IsOptional()
|
||
|
@Transform(({ value }) => value.split(','))
|
||
|
'smartInfo.tags'?: string[];
|
||
|
}
|