2023-03-30 21:38:55 +02:00
|
|
|
import { AssetType } from '@app/infra/entities';
|
2023-03-03 03:47:08 +01:00
|
|
|
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 {
|
2023-03-18 14:44:42 +01:00
|
|
|
@IsString()
|
|
|
|
@IsNotEmpty()
|
|
|
|
@IsOptional()
|
|
|
|
q?: string;
|
|
|
|
|
2023-03-03 03:47:08 +01:00
|
|
|
@IsString()
|
|
|
|
@IsNotEmpty()
|
|
|
|
@IsOptional()
|
|
|
|
query?: string;
|
|
|
|
|
2023-03-18 14:44:42 +01:00
|
|
|
@IsBoolean()
|
|
|
|
@IsOptional()
|
|
|
|
@Transform(toBoolean)
|
|
|
|
clip?: boolean;
|
|
|
|
|
2023-03-03 03:47:08 +01:00
|
|
|
@IsEnum(AssetType)
|
|
|
|
@IsOptional()
|
|
|
|
type?: AssetType;
|
|
|
|
|
|
|
|
@IsBoolean()
|
|
|
|
@IsOptional()
|
|
|
|
@Transform(toBoolean)
|
|
|
|
isFavorite?: boolean;
|
|
|
|
|
2023-04-12 17:37:52 +02:00
|
|
|
@IsBoolean()
|
|
|
|
@IsOptional()
|
|
|
|
@Transform(toBoolean)
|
|
|
|
isArchived?: boolean;
|
|
|
|
|
2023-03-03 03:47:08 +01:00
|
|
|
@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[];
|
2023-03-05 21:44:31 +01:00
|
|
|
|
|
|
|
@IsBoolean()
|
|
|
|
@IsOptional()
|
|
|
|
@Transform(toBoolean)
|
|
|
|
recent?: boolean;
|
|
|
|
|
|
|
|
@IsBoolean()
|
|
|
|
@IsOptional()
|
|
|
|
@Transform(toBoolean)
|
|
|
|
motion?: boolean;
|
2023-03-03 03:47:08 +01:00
|
|
|
}
|