mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-26 14:57:42 +00:00
* remove image tagging * updated lock * fixed tests, improved logging * be nice * fixed tests
85 lines
2.2 KiB
TypeScript
85 lines
2.2 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsBoolean, IsEnum, IsNotEmpty } from 'class-validator';
|
|
import { Optional } from '../domain.util';
|
|
import { JobCommand, QueueName } from './job.constants';
|
|
|
|
export class JobIdParamDto {
|
|
@IsNotEmpty()
|
|
@IsEnum(QueueName)
|
|
@ApiProperty({ type: String, enum: QueueName, enumName: 'JobName' })
|
|
id!: QueueName;
|
|
}
|
|
|
|
export class JobCommandDto {
|
|
@IsNotEmpty()
|
|
@IsEnum(JobCommand)
|
|
@ApiProperty({ type: 'string', enum: JobCommand, enumName: 'JobCommand' })
|
|
command!: JobCommand;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
force!: boolean;
|
|
}
|
|
|
|
export class JobCountsDto {
|
|
@ApiProperty({ type: 'integer' })
|
|
active!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
completed!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
failed!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
delayed!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
waiting!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
paused!: number;
|
|
}
|
|
|
|
export class QueueStatusDto {
|
|
isActive!: boolean;
|
|
isPaused!: boolean;
|
|
}
|
|
|
|
export class JobStatusDto {
|
|
@ApiProperty({ type: JobCountsDto })
|
|
jobCounts!: JobCountsDto;
|
|
|
|
@ApiProperty({ type: QueueStatusDto })
|
|
queueStatus!: QueueStatusDto;
|
|
}
|
|
|
|
export class AllJobStatusResponseDto implements Record<QueueName, JobStatusDto> {
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.THUMBNAIL_GENERATION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.METADATA_EXTRACTION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.VIDEO_CONVERSION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.SMART_SEARCH]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.STORAGE_TEMPLATE_MIGRATION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.MIGRATION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.BACKGROUND_TASK]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.SEARCH]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.RECOGNIZE_FACES]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.SIDECAR]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.LIBRARY]!: JobStatusDto;
|
|
}
|