mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
✨ Add Customer.io-Node (#833)
* 🚧 Descriptions, node function, generic function changes * ✅ Finished functionality, added icon * ⚡ Added new campaign operations, acommodated for 2 different authentications * ⚡ Fixed number defaults not being numbers but empty strings
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
apiRequest,
|
||||
customerIoApiRequest,
|
||||
eventExists,
|
||||
} from './GenericFunctions';
|
||||
|
||||
@@ -34,7 +34,7 @@ export class CustomerIoTrigger implements INodeType {
|
||||
description: 'Starts the workflow on a Customer.io update. (Beta)',
|
||||
defaults: {
|
||||
name: 'Customer.io Trigger',
|
||||
color: '#7131ff',
|
||||
color: '#ffcd00',
|
||||
},
|
||||
inputs: [],
|
||||
outputs: ['main'],
|
||||
@@ -237,7 +237,7 @@ export class CustomerIoTrigger implements INodeType {
|
||||
|
||||
const endpoint = '/reporting_webhooks';
|
||||
|
||||
let { reporting_webhooks: webhooks } = await apiRequest.call(this, 'GET', endpoint, {});
|
||||
let { reporting_webhooks: webhooks } = await customerIoApiRequest.call(this, 'GET', endpoint, {}, 'beta');
|
||||
|
||||
if (webhooks === null) {
|
||||
webhooks = [];
|
||||
@@ -295,7 +295,7 @@ export class CustomerIoTrigger implements INodeType {
|
||||
events: data,
|
||||
};
|
||||
|
||||
webhook = await apiRequest.call(this, 'POST', endpoint, body);
|
||||
webhook = await customerIoApiRequest.call(this, 'POST', endpoint, body, 'beta');
|
||||
|
||||
const webhookData = this.getWorkflowStaticData('node');
|
||||
webhookData.webhookId = webhook.id as string;
|
||||
@@ -307,7 +307,7 @@ export class CustomerIoTrigger implements INodeType {
|
||||
if (webhookData.webhookId !== undefined) {
|
||||
const endpoint = `/reporting_webhooks/${webhookData.webhookId}`;
|
||||
try {
|
||||
await apiRequest.call(this, 'DELETE', endpoint, {});
|
||||
await customerIoApiRequest.call(this, 'DELETE', endpoint, {}, 'beta');
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user