mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 09:15:05 +03:00
* feat: workflow ui * wip * wip * wip * pr feedback * refactor: picker field * use showDialog directly * better test * refactor step selection modal * move enable button to info form * use for Props * pr feedback * refactor ActionItem * refactor ActionItem * more refactor * fix: new schemaformfield has value of the same type * chore: clean up
48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
import { Controller, Get, Param } from '@nestjs/common';
|
|
import { ApiTags } from '@nestjs/swagger';
|
|
import { Endpoint, HistoryBuilder } from 'src/decorators';
|
|
import { PluginResponseDto, PluginTriggerResponseDto } from 'src/dtos/plugin.dto';
|
|
import { Permission } from 'src/enum';
|
|
import { Authenticated } from 'src/middleware/auth.guard';
|
|
import { PluginService } from 'src/services/plugin.service';
|
|
import { UUIDParamDto } from 'src/validation';
|
|
|
|
@ApiTags('Plugins')
|
|
@Controller('plugins')
|
|
export class PluginController {
|
|
constructor(private service: PluginService) {}
|
|
|
|
@Get('triggers')
|
|
@Authenticated({ permission: Permission.PluginRead })
|
|
@Endpoint({
|
|
summary: 'List all plugin triggers',
|
|
description: 'Retrieve a list of all available plugin triggers.',
|
|
history: new HistoryBuilder().added('v2.3.0').alpha('v2.3.0'),
|
|
})
|
|
getPluginTriggers(): PluginTriggerResponseDto[] {
|
|
return this.service.getTriggers();
|
|
}
|
|
|
|
@Get()
|
|
@Authenticated({ permission: Permission.PluginRead })
|
|
@Endpoint({
|
|
summary: 'List all plugins',
|
|
description: 'Retrieve a list of plugins available to the authenticated user.',
|
|
history: new HistoryBuilder().added('v2.3.0').alpha('v2.3.0'),
|
|
})
|
|
getPlugins(): Promise<PluginResponseDto[]> {
|
|
return this.service.getAll();
|
|
}
|
|
|
|
@Get(':id')
|
|
@Authenticated({ permission: Permission.PluginRead })
|
|
@Endpoint({
|
|
summary: 'Retrieve a plugin',
|
|
description: 'Retrieve information about a specific plugin by its ID.',
|
|
history: new HistoryBuilder().added('v2.3.0').alpha('v2.3.0'),
|
|
})
|
|
getPlugin(@Param() { id }: UUIDParamDto): Promise<PluginResponseDto> {
|
|
return this.service.get(id);
|
|
}
|
|
}
|