n8n/packages/nodes-base/nodes/Zoho/descriptions/LeadDescription.ts

489 lines
8.6 KiB
TypeScript
Raw Normal View History

2021-04-29 02:56:19 -07:00
import {
INodeProperties,
} from 'n8n-workflow';
import {
address,
makeCustomFieldsFixedCollection,
2021-04-29 02:56:19 -07:00
makeGetAllFields,
} from './SharedFields';
export const leadOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'lead',
],
},
},
options: [
{
name: 'Create',
value: 'create',
},
{
name: 'Delete',
value: 'delete',
},
{
name: 'Get',
value: 'get',
},
{
name: 'Get All',
value: 'getAll',
},
{
name: 'Update',
value: 'update',
},
2021-05-31 02:01:13 -07:00
{
name: 'Upsert',
value: 'upsert',
},
2021-04-29 02:56:19 -07:00
],
default: 'create',
description: 'Operation to perform',
},
] as INodeProperties[];
export const leadFields = [
// ----------------------------------------
2021-05-31 02:01:13 -07:00
// lead: create + upsert
2021-04-29 02:56:19 -07:00
// ----------------------------------------
{
displayName: 'Company',
name: 'Company',
description: 'Company at which the lead works.',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'create',
2021-05-31 02:01:13 -07:00
'upsert',
2021-04-29 02:56:19 -07:00
],
},
},
},
{
displayName: 'Last Name',
2021-05-10 05:22:07 -07:00
name: 'lastName',
2021-04-29 02:56:19 -07:00
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'create',
2021-05-31 02:01:13 -07:00
'upsert',
2021-04-29 02:56:19 -07:00
],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'create',
2021-05-31 02:01:13 -07:00
'upsert',
2021-04-29 02:56:19 -07:00
],
},
},
options: [
address,
{
displayName: 'Annual Revenue',
name: 'Annual_Revenue',
type: 'number',
default: '',
description: 'Annual revenue of the leads company.',
},
{
displayName: 'Currency',
name: 'Currency',
type: 'string',
default: '',
description: 'Symbol of the currency in which revenue is generated.',
},
makeCustomFieldsFixedCollection('lead'),
2021-04-29 02:56:19 -07:00
{
displayName: 'Description',
name: 'Description',
type: 'string',
default: '',
},
{
displayName: 'Designation',
name: 'Designation',
type: 'string',
default: '',
description: 'Position of the lead at their company.',
},
{
displayName: 'Email',
name: 'Email',
type: 'string',
default: '',
},
2021-05-10 02:11:11 -07:00
{
2021-05-10 05:22:07 -07:00
displayName: 'Email Opt Out',
2021-05-10 02:11:11 -07:00
name: 'Email_Opt_Out',
type: 'boolean',
default: false,
},
2021-04-29 02:56:19 -07:00
{
displayName: 'Fax',
name: 'Fax',
type: 'string',
default: '',
},
{
displayName: 'First Name',
name: 'First_Name',
type: 'string',
default: '',
},
{
displayName: 'Full Name',
name: 'Full_Name',
type: 'string',
default: '',
},
{
displayName: 'Industry',
name: 'Industry',
type: 'string',
default: '',
description: 'Industry to which the lead belongs.',
},
{
displayName: 'Industry Type',
name: 'Industry_Type',
type: 'string',
default: '',
description: 'Type of industry to which the lead belongs.',
},
{
displayName: 'Lead Source',
name: 'Lead_Source',
type: 'string',
default: '',
description: 'Source from which the lead was created.',
},
{
displayName: 'Lead Status',
name: 'Lead_Status',
type: 'string',
default: '',
},
{
displayName: 'Mobile',
name: 'Mobile',
type: 'string',
default: '',
},
{
displayName: 'Number of Employees',
name: 'No_of_Employees',
type: 'number',
default: '',
description: 'Number of employees in the leads company.',
},
{
displayName: 'Phone',
name: 'Phone',
type: 'string',
default: '',
},
{
displayName: 'Salutation',
name: 'Salutation',
type: 'string',
default: '',
},
{
displayName: 'Secondary Email',
name: 'Secondary_Email',
type: 'string',
default: '',
},
{
displayName: 'Skype ID',
name: 'Skype_ID',
type: 'string',
default: '',
},
{
displayName: 'Twitter',
name: 'Twitter',
type: 'string',
default: '',
},
{
displayName: 'Website',
name: 'Website',
type: 'string',
default: '',
},
],
},
// ----------------------------------------
// lead: delete
// ----------------------------------------
{
displayName: 'Lead ID',
name: 'leadId',
description: 'ID of the lead to delete.',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'delete',
],
},
},
},
// ----------------------------------------
// lead: get
// ----------------------------------------
{
displayName: 'Lead ID',
name: 'leadId',
description: 'ID of the lead to retrieve.',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'get',
],
},
},
},
// ----------------------------------------
// lead: getAll
// ----------------------------------------
...makeGetAllFields('lead'),
// ----------------------------------------
// lead: update
// ----------------------------------------
{
displayName: 'Lead ID',
name: 'leadId',
description: 'ID of the lead to update.',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'update',
],
},
},
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'update',
],
},
},
options: [
address,
{
displayName: 'Annual Revenue',
name: 'Annual_Revenue',
type: 'number',
default: '',
description: 'Annual revenue of the leads company.',
},
{
displayName: 'Company',
name: 'Company',
type: 'string',
default: '',
description: 'Company at which the lead works.',
},
{
displayName: 'Currency',
name: 'Currency',
type: 'string',
default: '',
description: 'Symbol of the currency in which revenue is generated.',
},
makeCustomFieldsFixedCollection('lead'),
2021-04-29 02:56:19 -07:00
{
displayName: 'Description',
name: 'Description',
type: 'string',
default: '',
},
{
displayName: 'Designation',
name: 'Designation',
type: 'string',
default: '',
description: 'Position of the lead at their company.',
},
{
displayName: 'Email',
name: 'Email',
type: 'string',
default: '',
},
2021-05-10 02:11:11 -07:00
{
2021-05-10 05:22:07 -07:00
displayName: 'Email Opt Out',
2021-05-10 02:11:11 -07:00
name: 'Email_Opt_Out',
type: 'boolean',
default: false,
},
2021-04-29 02:56:19 -07:00
{
displayName: 'Fax',
name: 'Fax',
type: 'string',
default: '',
},
{
displayName: 'First Name',
name: 'First_Name',
type: 'string',
default: '',
},
{
displayName: 'Full Name',
name: 'Full_Name',
type: 'string',
default: '',
},
{
displayName: 'Industry',
name: 'Industry',
type: 'string',
default: '',
description: 'Industry to which the lead belongs.',
},
{
displayName: 'Industry Type',
name: 'Industry_Type',
type: 'string',
default: '',
description: 'Type of industry to which the lead belongs.',
},
{
displayName: 'Last Name',
name: 'Last_Name',
type: 'string',
default: '',
},
{
displayName: 'Lead Source',
name: 'Lead_Source',
type: 'string',
default: '',
description: 'Source from which the lead was created.',
},
{
displayName: 'Lead Status',
name: 'Lead_Status',
type: 'string',
default: '',
},
{
displayName: 'Mobile',
name: 'Mobile',
type: 'string',
default: '',
},
{
displayName: 'Number of Employees',
name: 'No_of_Employees',
type: 'number',
default: '',
description: 'Number of employees in the leads company.',
},
{
displayName: 'Phone',
name: 'Phone',
type: 'string',
default: '',
},
{
displayName: 'Salutation',
name: 'Salutation',
type: 'string',
default: '',
},
{
displayName: 'Secondary Email',
name: 'Secondary_Email',
type: 'string',
default: '',
},
{
displayName: 'Skype ID',
name: 'Skype_ID',
type: 'string',
default: '',
},
{
displayName: 'Twitter',
name: 'Twitter',
type: 'string',
default: '',
},
{
displayName: 'Website',
name: 'Website',
type: 'string',
default: '',
},
],
},
] as INodeProperties[];