2021-03-04 01:25:47 -08:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const leadOperations : INodeProperties [ ] = [
2021-03-04 01:25:47 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-03-04 01:25:47 -08:00
default : 'create' ,
options : [
{
name : 'Create' ,
value : 'create' ,
} ,
{
name : 'Delete' ,
value : 'delete' ,
} ,
{
name : 'Get' ,
value : 'get' ,
} ,
{
name : 'Unsubscribe' ,
value : 'unsubscribe' ,
} ,
] ,
displayOptions : {
show : {
resource : [
'lead' ,
] ,
} ,
} ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-03-04 01:25:47 -08:00
2021-12-03 00:44:16 -08:00
export const leadFields : INodeProperties [ ] = [
2021-03-04 01:25:47 -08:00
// ----------------------------------
// lead: create
// ----------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'Campaign Name or ID' ,
2021-03-04 01:25:47 -08:00
name : 'campaignId' ,
type : 'options' ,
required : true ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getCampaigns' ,
} ,
2022-06-03 10:23:49 -07:00
description : 'ID of the campaign to create the lead under. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-03-04 01:25:47 -08:00
displayOptions : {
show : {
resource : [
'lead' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2021-03-04 01:25:47 -08:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email of the lead to create' ,
2021-03-04 01:25:47 -08:00
displayOptions : {
show : {
resource : [
'lead' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'lead' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
options : [
{
displayName : 'Company Name' ,
name : 'companyName' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Company name of the lead to create' ,
2021-03-04 01:25:47 -08:00
} ,
{
displayName : 'Deduplicate' ,
name : 'deduplicate' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether to do not insert if this email is already present in another campaign' ,
2021-03-04 01:25:47 -08:00
} ,
{
displayName : 'First Name' ,
name : 'firstName' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'First name of the lead to create' ,
2021-03-04 01:25:47 -08:00
} ,
{
displayName : 'Last Name' ,
name : 'lastName' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Last name of the lead to create' ,
2021-03-04 01:25:47 -08:00
} ,
2021-11-03 21:47:41 -07:00
{
displayName : 'Icebreaker' ,
name : 'icebreaker' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Icebreaker of the lead to create' ,
2021-11-03 21:47:41 -07:00
} ,
{
displayName : 'Phone' ,
name : 'phone' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Phone number of the lead to create' ,
2021-11-03 21:47:41 -07:00
} ,
{
displayName : 'Picture URL' ,
name : 'picture' ,
type : 'string' ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'Picture URL of the lead to create' ,
2021-11-03 21:47:41 -07:00
} ,
{
displayName : 'LinkedIn URL' ,
name : 'linkedinUrl' ,
type : 'string' ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'LinkedIn URL of the lead to create' ,
2021-11-03 21:47:41 -07:00
} ,
2021-03-04 01:25:47 -08:00
] ,
} ,
// ----------------------------------
// lead: delete
// ----------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'Campaign Name or ID' ,
2021-03-04 01:25:47 -08:00
name : 'campaignId' ,
type : 'options' ,
required : true ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getCampaigns' ,
} ,
2022-06-03 10:23:49 -07:00
description : 'ID of the campaign to remove the lead from. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-03-04 01:25:47 -08:00
displayOptions : {
show : {
resource : [
'lead' ,
] ,
operation : [
'delete' ,
] ,
} ,
} ,
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2021-03-04 01:25:47 -08:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email of the lead to delete' ,
2021-03-04 01:25:47 -08:00
displayOptions : {
show : {
resource : [
'lead' ,
] ,
operation : [
'delete' ,
] ,
} ,
} ,
} ,
// ----------------------------------
// lead: get
// ----------------------------------
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2021-03-04 01:25:47 -08:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email of the lead to retrieve' ,
2021-03-04 01:25:47 -08:00
displayOptions : {
show : {
resource : [
'lead' ,
] ,
operation : [
'get' ,
] ,
} ,
} ,
} ,
// ----------------------------------
// lead: unsubscribe
// ----------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'Campaign Name or ID' ,
2021-03-04 01:25:47 -08:00
name : 'campaignId' ,
type : 'options' ,
required : true ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getCampaigns' ,
} ,
2022-06-03 10:23:49 -07:00
description : 'ID of the campaign to unsubscribe the lead from. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-03-04 01:25:47 -08:00
displayOptions : {
show : {
resource : [
'lead' ,
] ,
operation : [
'unsubscribe' ,
] ,
} ,
} ,
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2021-03-04 01:25:47 -08:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email of the lead to unsubscribe' ,
2021-03-04 01:25:47 -08:00
displayOptions : {
show : {
resource : [
'lead' ,
] ,
operation : [
'unsubscribe' ,
] ,
} ,
} ,
} ,
2021-12-03 00:44:16 -08:00
] ;