373 lines
7.5 KiB
TypeScript
373 lines
7.5 KiB
TypeScript
import {
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export const companiesOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create a new company',
|
|
action: 'Create a company',
|
|
},
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Get companies',
|
|
action: 'Get a company',
|
|
},
|
|
{
|
|
name: 'Update',
|
|
value: 'update',
|
|
description: 'Update a company',
|
|
action: 'Update a company',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Delete a company',
|
|
action: 'Delete a company',
|
|
},
|
|
],
|
|
default: 'create',
|
|
},
|
|
];
|
|
|
|
export const companiesDescription: INodeProperties[] = [
|
|
{
|
|
displayName: 'Company ID',
|
|
name: '_id',
|
|
type: 'string',
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'update',
|
|
'delete',
|
|
'get',
|
|
],
|
|
},
|
|
},
|
|
description: 'ID of Company',
|
|
},
|
|
{
|
|
displayName: 'Title',
|
|
name: 'title',
|
|
type: 'string',
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'create',
|
|
'update',
|
|
'get',
|
|
],
|
|
},
|
|
},
|
|
description: 'Company Name or Title',
|
|
},
|
|
{
|
|
displayName: 'Industry',
|
|
name: 'industry',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Company Industry',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'get',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Options',
|
|
name: 'options',
|
|
type: 'collection',
|
|
placeholder: 'Add Option',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'create',
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Industry',
|
|
name: 'industry',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Company Industry',
|
|
},
|
|
{
|
|
displayName: 'Custom Fields',
|
|
name: 'customFields',
|
|
type: 'fixedCollection',
|
|
placeholder: 'Add Custom Field',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
description: 'Key value pairs containing the name and value of the custom field. Only dates in the format YYYY-MM-DD are accepted as input for custom date fields.',
|
|
default: [],
|
|
options: [
|
|
{
|
|
displayName: 'Custom Field',
|
|
name: 'customField',
|
|
values: [
|
|
{
|
|
displayName: 'Custom Field Name or ID',
|
|
name: '_id',
|
|
type: 'options',
|
|
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getCompanyCustomField',
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Value Name or ID',
|
|
name: 'value',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Custom Field\'s values',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Billing Custom Fields',
|
|
name: 'billingCustomFields',
|
|
type: 'fixedCollection',
|
|
placeholder: 'Add Billing Custom Field',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
description: 'Key value pairs containing the name and value of the custom field. Only dates in the format YYYY-MM-DD are accepted as input for custom date fields.',
|
|
default: [],
|
|
options: [
|
|
{
|
|
displayName: 'Custom Field',
|
|
name: 'customField',
|
|
values: [
|
|
{
|
|
displayName: 'Key',
|
|
name: 'key',
|
|
type: 'string',
|
|
description: 'Billing Custom Field Key',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Billing Custom Field values',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Contact Phones',
|
|
name: 'phones',
|
|
type: 'fixedCollection',
|
|
default: [],
|
|
placeholder: 'Add Contact Phones',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Contact Phone',
|
|
name: 'phone',
|
|
values: [
|
|
{
|
|
displayName: 'Phone Number',
|
|
name: 'number',
|
|
type: 'string',
|
|
description: 'Enter Phone Number',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Type',
|
|
name: 'type',
|
|
type: 'string',
|
|
description: 'Phone Number Type',
|
|
default: 'phone',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
description: 'Company phone number. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
|
|
},
|
|
{
|
|
displayName: 'Contact Emails',
|
|
name: 'emails',
|
|
type: 'fixedCollection',
|
|
default: [],
|
|
placeholder: 'Add Contact Emails',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Contact Email',
|
|
name: 'email',
|
|
values: [
|
|
{
|
|
displayName: 'Email Address',
|
|
name: 'address',
|
|
type: 'string',
|
|
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Type',
|
|
name: 'type',
|
|
type: 'string',
|
|
description: 'Email Type',
|
|
default: 'email',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
description: 'Company Email Address. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Address',
|
|
name: 'address',
|
|
type: 'fixedCollection',
|
|
placeholder: 'Enter Address',
|
|
typeOptions: {
|
|
multipleValues: false,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'create',
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
description: 'Enter Street, City, Country, Zip-Code',
|
|
default: [],
|
|
options: [
|
|
{
|
|
displayName: 'Address',
|
|
name: 'address',
|
|
values: [
|
|
{
|
|
displayName: 'Street',
|
|
name: 'street',
|
|
type: 'string',
|
|
description: 'Enter Street',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'City',
|
|
name: 'city',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Enter City',
|
|
},
|
|
{
|
|
displayName: 'Country',
|
|
name: 'country',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Enter Country',
|
|
},
|
|
{
|
|
displayName: 'Zip Code',
|
|
name: 'zipCode',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Enter Zip Code',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'People',
|
|
name: 'people',
|
|
type: 'fixedCollection',
|
|
placeholder: 'Add People',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'create',
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
description: 'Add People',
|
|
default: [],
|
|
options: [
|
|
{
|
|
displayName: 'People',
|
|
name: 'person',
|
|
values: [
|
|
{
|
|
displayName: 'Name or ID',
|
|
name: '_id',
|
|
type: 'options',
|
|
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getUsers',
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Role',
|
|
name: 'role',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Person\'s Role',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
];
|