@traien/n8n-nodes-espocrm
Version:
n8n integration with EspoCRM
403 lines • 13.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.contactFields = exports.contactOperations = void 0;
const types_1 = require("../../types");
exports.contactOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['contact'],
},
},
options: types_1.operations,
default: 'create',
},
];
exports.contactFields = [
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
default: '',
displayOptions: {
show: {
resource: ['contact'],
operation: ['create'],
},
},
description: 'First name of the contact',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
default: '',
displayOptions: {
show: {
resource: ['contact'],
operation: ['create'],
},
},
required: true,
description: 'Last name of the contact',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['contact'],
operation: ['create'],
},
},
options: [
{
displayName: 'Email Address',
name: 'emailAddress',
type: 'string',
default: '',
description: 'Primary email address of the contact',
},
{
displayName: 'Phone Number',
name: 'phoneNumber',
type: 'string',
default: '',
description: 'Phone number of the contact',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'Job title of the contact',
},
{
displayName: 'Account ID',
name: 'accountId',
type: 'string',
default: '',
description: 'ID of the associated account',
},
{
displayName: 'Description',
name: 'description',
type: 'string',
typeOptions: {
rows: 4,
},
default: '',
description: 'Description of the contact',
},
{
displayName: 'Address',
name: 'address',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
default: {},
options: [
{
name: 'details',
displayName: 'Address Details',
values: [
{
displayName: 'Street',
name: 'street',
type: 'string',
default: '',
description: 'Street address of the contact',
},
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
description: 'City of the contact',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
description: 'State/province of the contact',
},
{
displayName: 'Country',
name: 'country',
type: 'string',
default: '',
description: 'Country of the contact',
},
{
displayName: 'Postal Code',
name: 'postalCode',
type: 'string',
default: '',
description: 'Postal code of the contact',
},
],
},
],
description: 'Address of the contact',
},
],
},
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['contact'],
operation: ['get', 'update', 'delete'],
},
},
description: 'ID of the contact',
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['contact'],
operation: ['update'],
},
},
options: [
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
default: '',
description: 'First name of the contact',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
default: '',
description: 'Last name of the contact',
},
{
displayName: 'Email Address',
name: 'emailAddress',
type: 'string',
default: '',
description: 'Primary email address of the contact',
},
{
displayName: 'Phone Number',
name: 'phoneNumber',
type: 'string',
default: '',
description: 'Phone number of the contact',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'Job title of the contact',
},
{
displayName: 'Account ID',
name: 'accountId',
type: 'string',
default: '',
description: 'ID of the associated account',
},
{
displayName: 'Description',
name: 'description',
type: 'string',
typeOptions: {
rows: 4,
},
default: '',
description: 'Description of the contact',
},
{
displayName: 'Address',
name: 'address',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
default: {},
options: [
{
name: 'details',
displayName: 'Address Details',
values: [
{
displayName: 'Street',
name: 'street',
type: 'string',
default: '',
description: 'Street address of the contact',
},
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
description: 'City of the contact',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
description: 'State/province of the contact',
},
{
displayName: 'Country',
name: 'country',
type: 'string',
default: '',
description: 'Country of the contact',
},
{
displayName: 'Postal Code',
name: 'postalCode',
type: 'string',
default: '',
description: 'Postal code of the contact',
},
],
},
],
description: 'Address of the contact',
},
],
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['contact'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['contact'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
},
{
displayName: 'Filter Options',
name: 'filterOptions',
type: 'collection',
placeholder: 'Add Filter Option',
default: {},
displayOptions: {
show: {
resource: ['contact'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Where (Filter Conditions)',
name: 'where',
type: 'json',
default: '[]',
description: 'Filter conditions for the query as defined in the EspoCRM API',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'string',
default: '',
placeholder: 'createdAt',
description: 'Field to sort results by',
},
{
displayName: 'Order Direction',
name: 'order',
type: 'options',
options: [
{
name: 'Ascending',
value: 'asc',
},
{
name: 'Descending',
value: 'desc',
},
],
default: 'asc',
description: 'Direction to sort results by',
},
{
displayName: 'Select Fields',
name: 'select',
type: 'string',
default: '',
placeholder: 'id,name,emailAddress',
description: 'Comma-separated list of fields to return',
},
{
displayName: 'Offset',
name: 'offset',
type: 'number',
default: 0,
description: 'Number of results to skip (for pagination)',
},
{
displayName: 'Skip Total Count',
name: 'skipTotalCount',
type: 'boolean',
default: false,
description: 'Whether to skip calculating total count for large datasets to improve performance',
},
{
displayName: 'Boolean Filter List',
name: 'boolFilterList',
type: 'string',
default: '',
placeholder: 'onlyMy,followed',
description: 'Comma-separated list of predefined boolean filters',
},
{
displayName: 'Primary Filter',
name: 'primaryFilter',
type: 'string',
default: '',
description: 'Context-specific base filter to apply',
},
],
},
];
//# sourceMappingURL=contact.operations.js.map