mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-11 07:04:06 -08:00
2913e676e6
* 🎨 Change current defualt ressource to contact * Change display name for list membership * 🎨 Change display name for ressource properties * 🔥 Remove Name & ID in Display name * 🐛 Fix simplify data where behavior was wrong * 🎨 Move simplfy output to additional fields * Change data type from string to number for IDs * Add tooltip for contact ID * 🎨 Change tooltip for list of Id's * Change name of fields and reorgaized options * 🥅 Add clearer errors for some specific cases * 🎨 changed filters in Deal get all * Deprecate form ressource * ✨ add pipeline dropdown to auto fetch * 🎨 Change direction's name * 🎨 Change description of filter groups * 🎨 Add validation and errors for maximum filters * ✨ Add ressource locator to all ressources * 🎨 add tooltip for timestamp when using expressions * ✨add versioning * 🐛 fixes small bugs and ui problems * remove show options that was breaking custom prop * ✨ add ownership to deals * ✨ add notice for credential depreciation * 🎨 Refactor names for RLC * 🎨 Fixes to Deal * ✨ Inprove delete confirmation message * 🎨 Fixe titles of fields * 🎨 Fixe correct ressource hint * 🎨 Improve error when requesting non existing ressource * ⚡️ Improve get deal * ✨ Improve search by domain for companies * ✨ Improve getting recently created deals * 🎨 Improve versioning file structure * 🥅 Improve error for unknown ids * ✨ Add filters to recently search for companies * ✨ Uniformize including properties for contact * ✨ Improve get all operation for Companies * 🎨 Change filters name * 🎨 Remove useless descriptions * 🎨Improve description * ✨ Dynamically retrieve the correct operator for the properties * 🥅 Improve error handeling * 🥅 improve error when not finding the id * ⚡️Add searchable feature to Deal and contacts * 🚨 Fix linting issues * 🚨 Fix linting issues for V1 Hubspot * 🐛 Fix pairedItem for v2 hubspot * 🚨 Fix linting in HubSpot Description * 🚨 More linting fixes * Fix error handling * Update endpoint for deleting object * Fix label for recent actions * 🐛 fix listMemberships typo in V1 and V2 * docs: Stop assuming the user's gender in code comments (after merge)c87262a312
* fixing V1 GenericFunctions.ts api query limit as number * Update description for ticket * Add type to RLC * Revert "Add type to RLC" This reverts commit578dacfb97
. * Add type to RLC engagement --------- Co-authored-by: Marcus <marcus@n8n.io>
1005 lines
26 KiB
TypeScript
1005 lines
26 KiB
TypeScript
import type { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const dealOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create a deal',
|
|
action: 'Create a deal',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Delete a deal',
|
|
action: 'Delete a deal',
|
|
},
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Get a deal',
|
|
action: 'Get a deal',
|
|
},
|
|
{
|
|
name: 'Get Many',
|
|
value: 'getAll',
|
|
description: 'Get many deals',
|
|
action: 'Get many deals',
|
|
},
|
|
{
|
|
name: 'Get Recently Created/Updated',
|
|
value: 'getRecentlyCreatedUpdated',
|
|
description: 'Get recently created/updated deals',
|
|
action: 'Get recently created/updated deals',
|
|
},
|
|
{
|
|
name: 'Search',
|
|
value: 'search',
|
|
description: 'Search deals',
|
|
action: 'Search for deals',
|
|
},
|
|
{
|
|
name: 'Update',
|
|
value: 'update',
|
|
description: 'Update a deal',
|
|
action: 'Update a deal',
|
|
},
|
|
],
|
|
default: 'create',
|
|
},
|
|
];
|
|
|
|
export const dealFields: INodeProperties[] = [
|
|
/* -------------------------------------------------------------------------- */
|
|
/* deal:create */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Deal Stage Name or ID',
|
|
name: 'stage',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealStages',
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['create'],
|
|
},
|
|
},
|
|
default: '',
|
|
options: [],
|
|
description:
|
|
'The deal stage is required when creating a deal. See the CRM Pipelines API for details on managing pipelines and stages. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
{
|
|
displayName: 'Deal Properties',
|
|
name: 'additionalFields',
|
|
type: 'collection',
|
|
placeholder: 'Add Field',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['create'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Amount',
|
|
name: 'amount',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Associated Company Names or IDs',
|
|
name: 'associatedCompany',
|
|
type: 'multiOptions',
|
|
description:
|
|
'Whether to include specific Associated Company properties in the returned results. Choose from a list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getCompanies',
|
|
},
|
|
default: [],
|
|
},
|
|
{
|
|
displayName: 'Associated Vid Names or IDs',
|
|
name: 'associatedVids',
|
|
type: 'multiOptions',
|
|
description:
|
|
'Whether to include specific Associated Vid in the returned results. Choose from a list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getContacts',
|
|
},
|
|
default: [],
|
|
},
|
|
{
|
|
displayName: 'Close Date',
|
|
name: 'closeDate',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description:
|
|
'When using expressions, the time should be specified in YYYY-MM-DD hh-mm-ss format',
|
|
},
|
|
{
|
|
displayName: 'Custom Properties',
|
|
name: 'customPropertiesUi',
|
|
placeholder: 'Add Custom Property',
|
|
type: 'fixedCollection',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
default: {},
|
|
options: [
|
|
{
|
|
name: 'customPropertiesValues',
|
|
displayName: 'Custom Property',
|
|
values: [
|
|
{
|
|
displayName: 'Property Name or ID',
|
|
name: 'property',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealCustomProperties',
|
|
},
|
|
default: '',
|
|
description:
|
|
'Name of the property. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
description: 'Value of the property',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Deal Description',
|
|
name: 'description',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Deal Name',
|
|
name: 'dealName',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Deal Owner',
|
|
name: 'dealOwner',
|
|
type: 'resourceLocator',
|
|
default: { mode: 'list', value: '' },
|
|
modes: [
|
|
{
|
|
displayName: 'From List',
|
|
name: 'list',
|
|
type: 'list',
|
|
placeholder: 'Select from the list',
|
|
typeOptions: {
|
|
searchListMethod: 'searchOwners',
|
|
},
|
|
},
|
|
{
|
|
displayName: 'By Id',
|
|
name: 'id',
|
|
type: 'string',
|
|
placeholder: '58539222',
|
|
validation: [
|
|
{
|
|
type: 'regex',
|
|
properties: {
|
|
regex: '[0-9]+',
|
|
errorMessage: 'Not a valid HubSpot Owner ID',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
description: 'The HubSpot user to be assigned to the deal',
|
|
},
|
|
{
|
|
displayName: 'Deal Type Name or ID',
|
|
name: 'dealType',
|
|
type: 'options',
|
|
description:
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealTypes',
|
|
},
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Pipeline Name or ID',
|
|
name: 'pipeline',
|
|
type: 'options',
|
|
description:
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealPipelines',
|
|
},
|
|
default: '',
|
|
},
|
|
],
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* deal:update */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Deal to Update',
|
|
name: 'dealId',
|
|
type: 'resourceLocator',
|
|
default: { mode: 'list', value: '' },
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
modes: [
|
|
{
|
|
displayName: 'From List',
|
|
name: 'list',
|
|
type: 'list',
|
|
placeholder: 'Select from the list',
|
|
typeOptions: {
|
|
searchListMethod: 'searchDeals',
|
|
searchable: true,
|
|
},
|
|
},
|
|
{
|
|
displayName: 'By Id',
|
|
name: 'id',
|
|
type: 'string',
|
|
placeholder: '58539222',
|
|
validation: [
|
|
{
|
|
type: 'regex',
|
|
properties: {
|
|
regex: '[0-9]+',
|
|
errorMessage: 'Not a valid HubSpot Deal ID',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Update Fields',
|
|
name: 'updateFields',
|
|
type: 'collection',
|
|
placeholder: 'Add Update Field',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Amount',
|
|
name: 'amount',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Close Date',
|
|
name: 'closeDate',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description:
|
|
'When using expressions, the time should be specified in YYYY-MM-DD hh-mm-ss format',
|
|
},
|
|
{
|
|
displayName: 'Custom Properties',
|
|
name: 'customPropertiesUi',
|
|
placeholder: 'Add Custom Property',
|
|
type: 'fixedCollection',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
default: {},
|
|
options: [
|
|
{
|
|
name: 'customPropertiesValues',
|
|
displayName: 'Custom Property',
|
|
values: [
|
|
{
|
|
displayName: 'Property Name or ID',
|
|
name: 'property',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealCustomProperties',
|
|
},
|
|
default: '',
|
|
description:
|
|
'Name of the property. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
description: 'Value of the property',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Deal Description',
|
|
name: 'description',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Deal Name',
|
|
name: 'dealName',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Deal Owner',
|
|
name: 'dealOwner',
|
|
type: 'resourceLocator',
|
|
default: { mode: 'list', value: '' },
|
|
modes: [
|
|
{
|
|
displayName: 'From List',
|
|
name: 'list',
|
|
type: 'list',
|
|
placeholder: 'Select from the list',
|
|
typeOptions: {
|
|
searchListMethod: 'searchOwners',
|
|
},
|
|
},
|
|
{
|
|
displayName: 'By Id',
|
|
name: 'id',
|
|
type: 'string',
|
|
placeholder: '58539222',
|
|
validation: [
|
|
{
|
|
type: 'regex',
|
|
properties: {
|
|
regex: '[0-9]+',
|
|
errorMessage: 'Not a valid HubSpot Owner ID',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
description: 'The HubSpot user to be assigned to the deal',
|
|
},
|
|
{
|
|
displayName: 'Deal Stage Name or ID',
|
|
name: 'stage',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealStages',
|
|
},
|
|
default: '',
|
|
description:
|
|
'The deal stage is required when creating a deal. See the CRM Pipelines API for details on managing pipelines and stages. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
{
|
|
displayName: 'Deal Type Name or ID',
|
|
name: 'dealType',
|
|
type: 'options',
|
|
description:
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealTypes',
|
|
},
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Pipeline',
|
|
name: 'pipeline',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
],
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* deal:get */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Deal to Get',
|
|
name: 'dealId',
|
|
type: 'resourceLocator',
|
|
default: { mode: 'list', value: '' },
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['get'],
|
|
},
|
|
},
|
|
modes: [
|
|
{
|
|
displayName: 'From List',
|
|
name: 'list',
|
|
type: 'list',
|
|
placeholder: 'Select from the list',
|
|
typeOptions: {
|
|
searchListMethod: 'searchDeals',
|
|
searchable: true,
|
|
},
|
|
},
|
|
{
|
|
displayName: 'By Id',
|
|
name: 'id',
|
|
type: 'string',
|
|
placeholder: '58539222',
|
|
validation: [
|
|
{
|
|
type: 'regex',
|
|
properties: {
|
|
regex: '[0-9]+',
|
|
errorMessage: 'Not a valid HubSpot Deal ID',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Filters',
|
|
name: 'filters',
|
|
type: 'collection',
|
|
placeholder: 'Add Filter',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['get'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Include Property Versions',
|
|
name: 'includePropertyVersions',
|
|
type: 'boolean',
|
|
default: false,
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
|
|
description:
|
|
'By default, you will only get data for the most recent version of a property in the "versions" data. If you include this parameter, you will get data for all previous versions.',
|
|
},
|
|
{
|
|
displayName: 'Deal Properties to Include',
|
|
name: 'propertiesCollection',
|
|
type: 'fixedCollection',
|
|
default: {},
|
|
options: [
|
|
{
|
|
name: 'propertiesValues',
|
|
displayName: 'Deal Properties to Include',
|
|
values: [
|
|
{
|
|
displayName: 'Deal Properties to Include',
|
|
name: 'properties',
|
|
type: 'multiOptions',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealProperties',
|
|
},
|
|
default: [],
|
|
description:
|
|
'Whether to include specific Deal properties in the returned results. Choose from a list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
{
|
|
displayName: 'Include',
|
|
name: 'propertyMode',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
name: 'Value And History',
|
|
value: 'valueAndHistory',
|
|
},
|
|
{
|
|
name: 'Value Only',
|
|
value: 'valueOnly',
|
|
},
|
|
],
|
|
default: 'valueAndHistory',
|
|
description:
|
|
'Specify if the current value for a property should be fetched, or the value and all the historical values for that property',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
description:
|
|
'<p>Used to include specific deal properties in the results. By default, the results will only include Deal ID and will not include the values for any properties for your Deals.</p><p>Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties separated by a comma: <code>,</code>.</p>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
],
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* deal:getAll */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
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: ['deal'],
|
|
operation: ['getAll'],
|
|
returnAll: [false],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 250,
|
|
},
|
|
default: 100,
|
|
description: 'Max number of results to return',
|
|
},
|
|
{
|
|
displayName: 'Options',
|
|
name: 'filters',
|
|
type: 'collection',
|
|
placeholder: 'Add Option',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['getAll'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Include Associations',
|
|
name: 'includeAssociations',
|
|
type: 'boolean',
|
|
default: false,
|
|
description:
|
|
'Whether to include the IDs of the associated contacts and companies in the results. This will also automatically include the num_associated_contacts property.',
|
|
},
|
|
{
|
|
displayName: 'Deal Properties to Include',
|
|
name: 'propertiesCollection',
|
|
type: 'fixedCollection',
|
|
default: {},
|
|
options: [
|
|
{
|
|
name: 'propertiesValues',
|
|
displayName: 'Deal Properties to Include',
|
|
values: [
|
|
{
|
|
displayName: 'Deal Properties to Include',
|
|
name: 'properties',
|
|
type: 'multiOptions',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealPropertiesWithType',
|
|
},
|
|
default: [],
|
|
description:
|
|
'Whether to include specific Deal properties in the returned results. Choose from a list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
{
|
|
displayName: 'Include',
|
|
name: 'propertyMode',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
name: 'Value And History',
|
|
value: 'valueAndHistory',
|
|
},
|
|
{
|
|
name: 'Value Only',
|
|
value: 'valueOnly',
|
|
},
|
|
],
|
|
default: 'valueAndHistory',
|
|
description:
|
|
'Specify if the current value for a property should be fetched, or the value and all the historical values for that property',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
description:
|
|
'<p>Used to include specific deal properties in the results. By default, the results will only include Deal ID and will not include the values for any properties for your Deals.</p><p>Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties separated by a comma: <code>,</code>.</p>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
],
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* deal:delete */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Deal to Delete',
|
|
name: 'dealId',
|
|
type: 'resourceLocator',
|
|
default: { mode: 'list', value: '' },
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['delete'],
|
|
},
|
|
},
|
|
modes: [
|
|
{
|
|
displayName: 'From List',
|
|
name: 'list',
|
|
type: 'list',
|
|
placeholder: 'Select from the list',
|
|
typeOptions: {
|
|
searchListMethod: 'searchDeals',
|
|
searchable: true,
|
|
},
|
|
},
|
|
{
|
|
displayName: 'By Id',
|
|
name: 'id',
|
|
type: 'string',
|
|
placeholder: '58539222',
|
|
validation: [
|
|
{
|
|
type: 'regex',
|
|
properties: {
|
|
regex: '[0-9]+',
|
|
errorMessage: 'Not a valid HubSpot Deal ID',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* deal:getRecentDeals */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['getRecentlyCreatedUpdated'],
|
|
},
|
|
},
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['getRecentlyCreatedUpdated'],
|
|
returnAll: [false],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 250,
|
|
},
|
|
default: 100,
|
|
description: 'Max number of results to return',
|
|
},
|
|
{
|
|
displayName: 'Options',
|
|
name: 'filters',
|
|
type: 'collection',
|
|
placeholder: 'Add Option',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['getRecentlyCreatedUpdated'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Since',
|
|
name: 'since',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description:
|
|
'Only return deals created after timestamp x. When using expressions, the time should be specified in YYYY-MM-DD hh-mm-ss format.',
|
|
},
|
|
{
|
|
displayName: 'Include Property Versions',
|
|
name: 'includePropertyVersions',
|
|
type: 'boolean',
|
|
default: false,
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
|
|
description:
|
|
'By default, you will only get data for the most recent version of a property in the "versions" data. If you include this parameter, you will get data for all previous versions.',
|
|
},
|
|
],
|
|
},
|
|
|
|
/*--------------------------------------------------------------------------- */
|
|
/* deal:search */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['search'],
|
|
},
|
|
},
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['search'],
|
|
returnAll: [false],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 250,
|
|
},
|
|
default: 100,
|
|
description: 'Max number of results to return',
|
|
},
|
|
{
|
|
displayName: 'Filter Groups',
|
|
name: 'filterGroupsUi',
|
|
type: 'fixedCollection',
|
|
default: {},
|
|
placeholder: 'Add Filter Group',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['search'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'filterGroupsValues',
|
|
displayName: 'Filter Group',
|
|
values: [
|
|
{
|
|
displayName: 'Filters',
|
|
name: 'filtersUi',
|
|
type: 'fixedCollection',
|
|
default: {},
|
|
placeholder: 'Add Filter',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
options: [
|
|
{
|
|
name: 'filterValues',
|
|
displayName: 'Filter',
|
|
values: [
|
|
{
|
|
displayName: 'Property Name or ID',
|
|
name: 'propertyName',
|
|
type: 'options',
|
|
description:
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealProperties',
|
|
},
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Type',
|
|
name: 'type',
|
|
type: 'hidden',
|
|
default: '={{$parameter["&propertyName"].split("|")[1]}}',
|
|
},
|
|
{
|
|
displayName: 'Operator',
|
|
name: 'operator',
|
|
type: 'options',
|
|
displayOptions: {
|
|
hide: {
|
|
type: ['number'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Contains Exactly',
|
|
value: 'CONTAINS_TOKEN',
|
|
},
|
|
{
|
|
name: 'Equal',
|
|
value: 'EQ',
|
|
},
|
|
{
|
|
name: 'Is Known',
|
|
value: 'HAS_PROPERTY',
|
|
},
|
|
{
|
|
name: 'Is Unknown',
|
|
value: 'NOT_HAS_PROPERTY',
|
|
},
|
|
{
|
|
name: 'Not Equal',
|
|
value: 'NEQ',
|
|
},
|
|
],
|
|
default: 'EQ',
|
|
},
|
|
{
|
|
displayName: 'Operator',
|
|
name: 'operator',
|
|
type: 'options',
|
|
displayOptions: {
|
|
show: {
|
|
type: ['number'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Contains Exactly',
|
|
value: 'CONTAINS_TOKEN',
|
|
},
|
|
{
|
|
name: 'Equal',
|
|
value: 'EQ',
|
|
},
|
|
{
|
|
name: 'Greater Than',
|
|
value: 'GT',
|
|
},
|
|
{
|
|
name: 'Greater Than Or Equal',
|
|
value: 'GTE',
|
|
},
|
|
{
|
|
name: 'Is Known',
|
|
value: 'HAS_PROPERTY',
|
|
},
|
|
{
|
|
name: 'Is Unknown',
|
|
value: 'NOT_HAS_PROPERTY',
|
|
},
|
|
{
|
|
name: 'Less Than',
|
|
value: 'LT',
|
|
},
|
|
{
|
|
name: 'Less Than Or Equal',
|
|
value: 'LTE',
|
|
},
|
|
{
|
|
name: 'Not Equal',
|
|
value: 'NEQ',
|
|
},
|
|
],
|
|
default: 'EQ',
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
displayOptions: {
|
|
hide: {
|
|
operator: ['HAS_PROPERTY', 'NOT_HAS_PROPERTY'],
|
|
},
|
|
},
|
|
required: true,
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
description:
|
|
'Use filters to limit the results to only CRM objects with matching property values. More info <a href="https://developers.hubspot.com/docs/api/crm/search">here</a>.',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
description:
|
|
'When multiple filters are provided within a Filter Group, they will be combined using a logical AND operator. When multiple Filter Groups are provided, they will be combined using a logical OR operator. The system supports a maximum of three Filter Groups with up to three filters each. More info <a href="https://developers.hubspot.com/docs/api/crm/search">here</a>',
|
|
},
|
|
{
|
|
displayName: 'Options',
|
|
name: 'additionalFields',
|
|
type: 'collection',
|
|
placeholder: 'Add Option',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['deal'],
|
|
operation: ['search'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Direction',
|
|
name: 'direction',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
name: 'Ascending',
|
|
value: 'ASCENDING',
|
|
},
|
|
{
|
|
name: 'Descending',
|
|
value: 'DESCENDING',
|
|
},
|
|
],
|
|
default: 'DESCENDING',
|
|
description:
|
|
'Defines the direction in which search results are ordered. Default value is Descending.',
|
|
},
|
|
{
|
|
displayName: 'Field Names or IDs',
|
|
name: 'properties',
|
|
type: 'multiOptions',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealProperties',
|
|
},
|
|
default: [],
|
|
description:
|
|
'Whether to include specific Deal properties in the returned results. Choose from a list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
{
|
|
displayName: 'Query',
|
|
name: 'query',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Perform a text search against all property values for an object type',
|
|
},
|
|
{
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
|
displayName: 'Sort By',
|
|
name: 'sortBy',
|
|
type: 'options',
|
|
description:
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getDealProperties',
|
|
},
|
|
default: 'createdate',
|
|
},
|
|
],
|
|
},
|
|
];
|