Feature/thehive trigger improvements (#1259)

* Add support for TheHive3 webhook events

* Add Log Updated & Log Deleted events

* Remove configuration field

*  Small change (#1235)

* 👕 Fix lint issue

Co-authored-by: Mika Luhta <12100880+mluhta@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Ricardo Espinoza 2020-12-19 12:19:12 -05:00 committed by GitHub
parent 48830eda77
commit aafbe5af40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,6 +111,16 @@ export class TheHiveTrigger implements INodeType {
value: 'case_task_log_create',
description: 'Triggered when a task log is created',
},
{
name: 'Log Updated',
value: 'case_task_log_update',
description: 'Triggered when a task log is updated',
},
{
name: 'Log Deleted',
value: 'case_task_log_delete',
description: 'Triggered when a task log is deleted',
},
],
},
],
@ -140,7 +150,9 @@ export class TheHiveTrigger implements INodeType {
}
// Don't start the workflow if the event is not fired
const event = `${(bodyData.objectType as string).toLowerCase()}_${(bodyData.operation as string).toLowerCase()}`;
// Replace Creation with Create for TheHive 3 support
const operation = (bodyData.operation as string).replace('Creation', 'Create');
const event = `${(bodyData.objectType as string).toLowerCase()}_${operation.toLowerCase()}`;
if (events.indexOf('*') === -1 && events.indexOf(event) === -1) {
return {};
}