import { IntegrationService } from "@shared/types"; import { BaseTask } from "@server/queues/tasks/base/BaseTask"; import { Hook, PluginManager } from "@server/utils/PluginManager"; type Props = { headers: Record; payload: Record; teamId: string | null; }; export default class GitLabWebhookTask extends BaseTask { public async perform({ headers, payload, teamId }: Props): Promise { const plugins = PluginManager.getHooks(Hook.IssueProvider); const plugin = plugins.find( (p) => p.value.service === IntegrationService.GitLab ); if (!plugin) { return; } await plugin.value.handleWebhook({ headers, payload, teamId, }); } }