Improve cal.com Trigger Node

This commit is contained in:
Jan Oberhauser 2022-06-05 19:43:00 +02:00
parent 1fa445e0e7
commit 6bdc7c1f7a

View file

@ -51,16 +51,16 @@ export class CalTrigger implements INodeType {
name: 'events', name: 'events',
type: 'multiOptions', type: 'multiOptions',
options: [ options: [
{
name: 'Booking Created',
value: 'BOOKING_CREATED',
description: 'Receive notifications when a new Cal event is created',
},
{ {
name: 'Booking Cancelled', name: 'Booking Cancelled',
value: 'BOOKING_CANCELLED', value: 'BOOKING_CANCELLED',
description: 'Receive notifications when a Cal event is canceled', description: 'Receive notifications when a Cal event is canceled',
}, },
{
name: 'Booking Created',
value: 'BOOKING_CREATED',
description: 'Receive notifications when a new Cal event is created',
},
{ {
name: 'Booking Rescheduled', name: 'Booking Rescheduled',
value: 'BOOKING_RESCHEDULED', value: 'BOOKING_RESCHEDULED',
@ -81,6 +81,7 @@ export class CalTrigger implements INodeType {
displayName: 'App ID', displayName: 'App ID',
name: 'appId', name: 'appId',
type: 'string', type: 'string',
description: 'The ID of the App to monitor',
default: '', default: '',
}, },
{ {
@ -90,14 +91,17 @@ export class CalTrigger implements INodeType {
typeOptions: { typeOptions: {
loadOptionsMethod: 'getEventTypes', loadOptionsMethod: 'getEventTypes',
}, },
description: 'The EventType to monitor. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
default: '', default: '',
}, },
{ {
displayName: 'Payload Template', displayName: 'Payload Template',
name: 'payloadTemplate', name: 'payloadTemplate',
type: 'string', type: 'string',
description: 'Template to customize the webhook payload',
default: '', default: '',
typeOptions: { typeOptions: {
alwaysOpenEditWindow: true,
rows: 4, rows: 4,
} }
} }
@ -199,7 +203,11 @@ export class CalTrigger implements INodeType {
const req = this.getRequestObject(); const req = this.getRequestObject();
return { return {
workflowData: [ workflowData: [
this.helpers.returnJsonArray(req.body), this.helpers.returnJsonArray({
triggerEvent: req.body.triggerEvent,
createdAt: req.body.createdAt,
...req.body.payload
}),
], ],
}; };
} }