@bedrijfsdatanl/n8n-nodes-prospectpro
Version:
n8n node for ProspectPro - Identify Dutch B2B ProspectPro in rapid time
292 lines • 12.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Prospectpro = void 0;
const GenericFunctions_1 = require("./GenericFunctions");
const ProspectsGet_properties_1 = require("./ProspectsGet.properties");
const ProspectsPatch_properties_1 = require("./ProspectsPatch.properties");
const ProspectsGetMany_properties_1 = require("./ProspectsGetMany.properties");
const PageviewsGetMany_properties_1 = require("./PageviewsGetMany.properties");
const ContactsGetMany_properties_1 = require("./ContactsGetMany.properties");
const ContactsCreate_properties_1 = require("./ContactsCreate.properties");
const ContactsUpdate_properties_1 = require("./ContactsUpdate.properties");
const ContactsDelete_properties_1 = require("./ContactsDelete.properties");
const EventsGetMany_properties_1 = require("./EventsGetMany.properties");
const EventsCreate_properties_1 = require("./EventsCreate.properties");
const EventsDelete_properties_1 = require("./EventsDelete.properties");
class Prospectpro {
constructor() {
this.description = {
name: 'prospectpro',
displayName: 'ProspectPro',
icon: 'file:logo.svg',
group: ['transform'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Get data from the ProspectPro API.',
defaults: {
name: 'ProspectPro',
},
inputs: ["main"],
outputs: ["main"],
credentials: [
{
name: 'prospectproApi',
required: true,
},
],
requestDefaults: {
baseURL: 'https://api.prospectpro.nl/v1.2',
qs: {
front: 30,
},
},
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Prospect',
value: 'prospects',
},
{
name: 'Contact',
value: 'contacts',
},
{
name: 'Event',
value: 'events'
},
{
name: 'Pageview',
value: 'pageviews',
},
],
default: 'prospects',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['prospects'],
},
},
options: [
{
name: 'Get',
value: 'get',
action: 'Get prospect',
description: 'Retrieve a prospect from ProspectPro',
routing: {
request: {
method: 'GET',
url: '/prospects'
},
},
},
{
name: 'Get Many',
value: 'get_many',
action: 'Get prospects',
description: 'Retrieve prospects from ProspectPro',
routing: {
request: {
method: 'GET',
url: '/prospects'
},
},
},
{
name: 'Update',
value: 'patch',
action: 'Update prospect',
description: 'Update a prospect in ProspectPro',
routing: {
request: {
method: 'PATCH',
url: '/prospects',
qs: {
no_header: 1
},
},
},
}
],
default: 'get_many',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['pageviews'],
},
},
options: [
{
name: 'Get Many',
value: 'get_many',
action: 'Get pageviews',
description: 'Retrieve pageviews from ProspectPro',
routing: {
request: {
method: 'GET',
url: '/pageviews'
}
},
},
],
default: 'get_many',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['contacts'],
},
},
options: [
{
name: 'Get Many',
value: 'get_many',
action: 'Get contacts',
description: 'Retrieve contacts from ProspectPro',
routing: {
request: {
method: 'GET',
url: '/contacts'
}
},
},
{
name: 'Create',
value: 'create',
action: 'Create contact',
description: 'Create a contact in ProspectPro',
routing: {
request: {
method: 'POST',
url: '/contacts',
qs: {
no_header: '={{ $value && $value === true ? undefined : 1 }}'
},
}
},
},
{
name: 'Update',
value: 'update',
action: 'Update contact',
description: 'Update a contact in ProspectPro',
routing: {
request: {
method: 'PATCH',
url: '/contacts',
qs: {
no_header: '={{ $value && $value === true ? undefined : 1 }}'
},
}
},
},
{
name: 'Delete',
value: 'delete',
action: 'Delete contact',
description: 'Delete a contact in ProspectPro',
routing: {
request: {
method: 'DELETE',
url: '/contacts'
}
},
},
],
default: 'get_many',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['events'],
},
},
options: [
{
name: 'Get Many',
value: 'get_many',
action: 'Get events',
description: 'Retrieve events from ProspectPro',
routing: {
request: {
method: 'GET',
url: '/events'
}
},
},
{
name: 'Create',
value: 'create',
action: 'Create event',
description: 'Create an event in ProspectPro',
routing: {
request: {
method: 'POST',
url: '/events',
qs: {
no_header: '={{ $value && $value === true ? undefined : 1 }}'
},
}
},
},
{
name: 'Delete',
value: 'delete',
action: 'Delete event',
description: 'Delete an event in ProspectPro',
routing: {
request: {
method: 'DELETE',
url: '/events'
}
},
},
],
default: 'get_many',
},
...ProspectsGet_properties_1.prospectsGetOperationProperties,
...ProspectsPatch_properties_1.prospectsPatchOperationProperties,
...ProspectsGetMany_properties_1.prospectsGetManyOperationProperties,
...PageviewsGetMany_properties_1.pageviewsGetManyOperationProperties,
...ContactsGetMany_properties_1.contactsGetManyOperationProperties,
...ContactsCreate_properties_1.contactsCreateOperationProperties,
...ContactsUpdate_properties_1.contactsUpdateOperationProperties,
...ContactsDelete_properties_1.contactsDeleteOperationProperties,
...EventsGetMany_properties_1.eventsGetManyOperationProperties,
...EventsCreate_properties_1.eventsCreateOperationProperties,
...EventsDelete_properties_1.eventsDeleteOperationProperties,
],
};
this.methods = {
loadOptions: {
getTags: GenericFunctions_1.getProspectProTags,
getAudiences: GenericFunctions_1.getProspectProAudiences,
getOwners: GenericFunctions_1.getProspectProOwners,
},
};
}
}
exports.Prospectpro = Prospectpro;
//# sourceMappingURL=Prospectpro.node.js.map