mirror of
https://github.com/immich-app/immich.git
synced 2026-01-29 23:23:45 -05:00
* feat: plugins * feat: table definition * feat: type and migration * feat: add repositories * feat: validate manifest with class-validator and load manifest info to database * feat: workflow/plugin controller/service layer * feat: implement workflow logic * feat: make trigger static * feat: dynamical instantiate plugin instances * fix: access control and helper script * feat: it works * chore: simplify * refactor: refactor and use queue for workflow execution * refactor: remove unsused property in plugin-schema * build wasm in prod * feat: plugin loader in transaction * fix: docker build arm64 * generated files * shell check * fix tests * fix: waiting for migration to finish before loading plugin * remove context reassignment * feat: use mise to manage extism tools (#23760) * pr feedback * refactor: create workflow now including create filters and actions * feat: workflow medium tests * fix: broken medium test * feat: medium tests * chore: unify workflow job * sign user id with jwt * chore: query plugin with filters and action * chore: read manifest in repository * chore: load manifest from server configs * merge main * feat: endpoint documentation * pr feedback * load plugin from absolute path * refactor:handle trigger * throw error and return early * pr feedback * unify plugin services * fix: plugins code * clean up * remove triggerConfig * clean up * displayName and methodName --------- Co-authored-by: Jason Rasmussen <jason@rasm.me> Co-authored-by: bo0tzz <git@bo0tzz.me>
98 lines
2.8 KiB
TypeScript
98 lines
2.8 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { QueueCommand, QueueName } from 'src/enum';
|
|
import { ValidateBoolean, ValidateEnum } from 'src/validation';
|
|
|
|
export class QueueNameParamDto {
|
|
@ValidateEnum({ enum: QueueName, name: 'QueueName' })
|
|
name!: QueueName;
|
|
}
|
|
|
|
export class QueueCommandDto {
|
|
@ValidateEnum({ enum: QueueCommand, name: 'QueueCommand' })
|
|
command!: QueueCommand;
|
|
|
|
@ValidateBoolean({ optional: true })
|
|
force?: boolean; // TODO: this uses undefined as a third state, which should be refactored to be more explicit
|
|
}
|
|
|
|
export class QueueStatisticsDto {
|
|
@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 QueueResponseDto {
|
|
@ApiProperty({ type: QueueStatisticsDto })
|
|
jobCounts!: QueueStatisticsDto;
|
|
|
|
@ApiProperty({ type: QueueStatusDto })
|
|
queueStatus!: QueueStatusDto;
|
|
}
|
|
|
|
export class QueuesResponseDto implements Record<QueueName, QueueResponseDto> {
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.ThumbnailGeneration]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.MetadataExtraction]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.VideoConversion]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.SmartSearch]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.StorageTemplateMigration]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.Migration]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.BackgroundTask]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.Search]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.DuplicateDetection]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.FaceDetection]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.FacialRecognition]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.Sidecar]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.Library]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.Notification]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.BackupDatabase]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.Ocr]!: QueueResponseDto;
|
|
|
|
@ApiProperty({ type: QueueResponseDto })
|
|
[QueueName.Workflow]!: QueueResponseDto;
|
|
}
|