mirror of
https://github.com/immich-app/immich.git
synced 2025-01-10 05:46:46 +01:00
46 lines
812 B
TypeScript
46 lines
812 B
TypeScript
import { AssetType } from '@app/infra/entities';
|
|
import { Transform } from 'class-transformer';
|
|
import { IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
|
import { Optional, toBoolean } from '../../domain.util';
|
|
|
|
export class SearchDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@Optional()
|
|
q?: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@Optional()
|
|
query?: string;
|
|
|
|
@IsBoolean()
|
|
@Optional()
|
|
@Transform(toBoolean)
|
|
clip?: boolean;
|
|
|
|
@IsEnum(AssetType)
|
|
@Optional()
|
|
type?: AssetType;
|
|
|
|
@IsBoolean()
|
|
@Optional()
|
|
@Transform(toBoolean)
|
|
recent?: boolean;
|
|
|
|
@IsBoolean()
|
|
@Optional()
|
|
@Transform(toBoolean)
|
|
motion?: boolean;
|
|
}
|
|
|
|
export class SearchPeopleDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
name!: string;
|
|
|
|
@IsBoolean()
|
|
@Transform(toBoolean)
|
|
@Optional()
|
|
withHidden?: boolean;
|
|
}
|