Small improvements to Hubspot Trigger Node

This commit is contained in:
Jan Oberhauser
2020-03-13 12:09:09 +01:00
parent e213387103
commit 3d2e90ed18
2 changed files with 10 additions and 17 deletions

View File

@@ -191,7 +191,7 @@ export class HubspotTrigger implements INodeType {
'deal.propertyChange',
];
let endpoint = `/webhooks/v1/${app}/settings`;
let body = {
let body: IDataObject = {
webhookUrl,
maxConcurrentRequests: additionalFields.maxConcurrentRequests || 5,
};
@@ -199,7 +199,6 @@ export class HubspotTrigger implements INodeType {
endpoint = `/webhooks/v1/${app}/subscriptions`;
body = {
//@ts-ignore
subscriptionDetails: {
subscriptionType: event,
},
@@ -246,11 +245,11 @@ export class HubspotTrigger implements INodeType {
async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
const credentials = this.getCredentials('hubspotDeveloperApi');
const req = this.getRequestObject()
const req = this.getRequestObject();
const bodyData = req.body;
const headerData = this.getHeaderData();
//@ts-ignore
if (headerData['x-hubspot-signature'] == undefined) {
if (headerData['x-hubspot-signature'] === undefined) {
return {};
}
const hash = `${credentials!.clientSecret}${JSON.stringify(bodyData)}`;