2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2019-12-03 13:48:17 -08:00
2021-12-03 00:44:16 -08:00
export const dealOperations : INodeProperties [ ] = [
2019-12-03 13:48:17 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2019-12-03 13:48:17 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
2019-12-03 13:48:17 -08:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a deal' ,
2022-07-10 13:50:51 -07:00
action : 'Create a deal' ,
2019-12-03 13:48:17 -08:00
} ,
2019-12-04 09:21:02 -08:00
{
2020-04-07 21:35:50 -07:00
name : 'Delete' ,
value : 'delete' ,
2020-07-24 03:56:41 -07:00
description : 'Delete a deal' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a deal' ,
2019-12-04 09:21:02 -08:00
} ,
2019-12-03 13:48:17 -08:00
{
name : 'Get' ,
value : 'get' ,
description : 'Get a deal' ,
2022-07-10 13:50:51 -07:00
action : 'Get a deal' ,
2019-12-03 13:48:17 -08:00
} ,
2019-12-04 09:21:02 -08:00
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2019-12-04 09:21:02 -08:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many deals' ,
2022-09-08 08:10:13 -07:00
action : 'Get many deals' ,
2019-12-04 09:21:02 -08:00
} ,
{
2023-05-08 06:15:13 -07:00
name : 'Get Recently Created/Updated' ,
value : 'getRecentlyCreatedUpdated' ,
description : 'Get recently created/updated deals' ,
action : 'Get recently created/updated deals' ,
2019-12-04 09:21:02 -08:00
} ,
2020-12-02 04:25:13 -08:00
{
name : 'Search' ,
value : 'search' ,
description : 'Search deals' ,
2022-07-10 13:50:51 -07:00
action : 'Search for deals' ,
2020-12-02 04:25:13 -08:00
} ,
2020-04-07 21:35:50 -07:00
{
name : 'Update' ,
value : 'update' ,
description : 'Update a deal' ,
2022-07-10 13:50:51 -07:00
action : 'Update a deal' ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-03 13:48:17 -08:00
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2019-12-03 13:48:17 -08:00
2021-12-03 00:44:16 -08:00
export const dealFields : INodeProperties [ ] = [
2020-12-02 04:25:13 -08:00
/* -------------------------------------------------------------------------- */
/* deal:create */
/* -------------------------------------------------------------------------- */
2019-12-03 13:48:17 -08:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Deal Stage Name or ID' ,
2019-12-03 19:21:52 -08:00
name : 'stage' ,
2019-12-03 13:48:17 -08:00
type : 'options' ,
required : true ,
typeOptions : {
2020-10-22 06:46:03 -07:00
loadOptionsMethod : 'getDealStages' ,
2019-12-03 13:48:17 -08:00
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'create' ] ,
2019-12-03 13:48:17 -08:00
} ,
} ,
default : '' ,
options : [ ] ,
2022-08-17 08:50:24 -07:00
description :
2023-05-08 06:15:13 -07:00
'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>.' ,
2019-12-03 13:48:17 -08:00
} ,
{
2023-05-08 06:15:13 -07:00
displayName : 'Deal Properties' ,
2019-12-03 13:48:17 -08:00
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'create' ] ,
2019-12-03 13:48:17 -08:00
} ,
} ,
options : [
{
displayName : 'Amount' ,
name : 'amount' ,
type : 'string' ,
default : '' ,
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Associated Company Names or IDs' ,
2019-12-03 13:48:17 -08:00
name : 'associatedCompany' ,
type : 'multiOptions' ,
2022-08-17 08:50:24 -07:00
description :
2023-05-08 06:15:13 -07:00
'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>.' ,
2019-12-03 13:48:17 -08:00
typeOptions : {
2020-12-02 04:25:13 -08:00
loadOptionsMethod : 'getCompanies' ,
2019-12-03 13:48:17 -08:00
} ,
default : [ ] ,
} ,
{
2022-06-23 10:45:56 -07:00
displayName : 'Associated Vid Names or IDs' ,
2019-12-03 13:48:17 -08:00
name : 'associatedVids' ,
type : 'multiOptions' ,
2022-08-17 08:50:24 -07:00
description :
2023-05-08 06:15:13 -07:00
'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>.' ,
2019-12-03 13:48:17 -08:00
typeOptions : {
2020-12-02 04:25:13 -08:00
loadOptionsMethod : 'getContacts' ,
2019-12-03 13:48:17 -08:00
} ,
default : [ ] ,
} ,
2020-11-08 08:14:43 -08:00
{
displayName : 'Close Date' ,
name : 'closeDate' ,
type : 'dateTime' ,
default : '' ,
2023-05-08 06:15:13 -07:00
description :
'When using expressions, the time should be specified in YYYY-MM-DD hh-mm-ss format' ,
2020-11-08 08:14:43 -08:00
} ,
2020-11-08 05:43:16 -08:00
{
displayName : 'Custom Properties' ,
name : 'customPropertiesUi' ,
placeholder : 'Add Custom Property' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
name : 'customPropertiesValues' ,
displayName : 'Custom Property' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Property Name or ID' ,
2020-11-08 05:43:16 -08:00
name : 'property' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getDealCustomProperties' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
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>.' ,
2020-11-08 05:43:16 -08:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2023-05-08 06:15:13 -07:00
required : true ,
2020-11-08 05:43:16 -08:00
description : 'Value of the property' ,
} ,
] ,
} ,
] ,
2020-11-08 08:14:43 -08:00
} ,
2021-01-28 09:38:57 -08:00
{
displayName : 'Deal Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
} ,
2020-11-08 08:14:43 -08:00
{
displayName : 'Deal Name' ,
name : 'dealName' ,
type : 'string' ,
default : '' ,
} ,
2023-05-08 06:15:13 -07:00
{
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' ,
} ,
2020-11-08 08:14:43 -08:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Deal Type Name or ID' ,
2020-11-08 08:14:43 -08:00
name : 'dealType' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-11-08 08:14:43 -08:00
typeOptions : {
loadOptionsMethod : 'getDealTypes' ,
} ,
default : '' ,
} ,
{
2023-05-08 06:15:13 -07:00
displayName : 'Pipeline Name or ID' ,
2020-11-08 08:14:43 -08:00
name : 'pipeline' ,
2023-05-08 06:15:13 -07:00
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' ,
} ,
2020-11-08 08:14:43 -08:00
default : '' ,
} ,
2020-10-22 06:46:03 -07:00
] ,
2019-12-03 13:48:17 -08:00
} ,
2020-12-02 04:25:13 -08:00
/* -------------------------------------------------------------------------- */
/* deal:update */
/* -------------------------------------------------------------------------- */
2020-04-07 21:35:50 -07:00
{
2023-05-08 06:15:13 -07:00
displayName : 'Deal to Update' ,
2020-04-07 21:35:50 -07:00
name : 'dealId' ,
2023-05-08 06:15:13 -07:00
type : 'resourceLocator' ,
default : { mode : 'list' , value : '' } ,
2020-04-07 21:35:50 -07:00
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'update' ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2023-05-08 06:15:13 -07:00
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' ,
} ,
} ,
] ,
} ,
] ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Update Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'update' ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
options : [
{
2020-11-08 08:14:43 -08:00
displayName : 'Amount' ,
name : 'amount' ,
2020-04-07 21:35:50 -07:00
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Close Date' ,
name : 'closeDate' ,
type : 'dateTime' ,
default : '' ,
2023-05-08 06:15:13 -07:00
description :
'When using expressions, the time should be specified in YYYY-MM-DD hh-mm-ss format' ,
2020-04-07 21:35:50 -07:00
} ,
2020-11-08 05:43:16 -08:00
{
displayName : 'Custom Properties' ,
name : 'customPropertiesUi' ,
placeholder : 'Add Custom Property' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
name : 'customPropertiesValues' ,
displayName : 'Custom Property' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Property Name or ID' ,
2020-11-08 05:43:16 -08:00
name : 'property' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getDealCustomProperties' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
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>.' ,
2020-11-08 05:43:16 -08:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2023-05-08 06:15:13 -07:00
required : true ,
2020-11-08 05:43:16 -08:00
description : 'Value of the property' ,
} ,
] ,
} ,
] ,
2020-11-08 08:14:43 -08:00
} ,
2021-03-08 05:44:37 -08:00
{
displayName : 'Deal Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
} ,
2020-11-08 08:14:43 -08:00
{
displayName : 'Deal Name' ,
name : 'dealName' ,
type : 'string' ,
default : '' ,
} ,
2023-05-08 06:15:13 -07:00
{
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' ,
} ,
2020-11-08 08:14:43 -08:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Deal Stage Name or ID' ,
2020-11-08 08:14:43 -08:00
name : 'stage' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getDealStages' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2023-05-08 06:15:13 -07:00
'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>.' ,
2020-11-08 08:14:43 -08:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Deal Type Name or ID' ,
2020-11-08 08:14:43 -08:00
name : 'dealType' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-11-08 08:14:43 -08:00
typeOptions : {
loadOptionsMethod : 'getDealTypes' ,
} ,
default : '' ,
} ,
{
displayName : 'Pipeline' ,
name : 'pipeline' ,
type : 'string' ,
default : '' ,
} ,
2020-10-22 06:46:03 -07:00
] ,
2019-12-04 09:21:02 -08:00
} ,
2020-12-02 04:25:13 -08:00
/* -------------------------------------------------------------------------- */
/* deal:get */
/* -------------------------------------------------------------------------- */
2020-04-07 21:35:50 -07:00
{
2023-05-08 06:15:13 -07:00
displayName : 'Deal to Get' ,
2020-04-07 21:35:50 -07:00
name : 'dealId' ,
2023-05-08 06:15:13 -07:00
type : 'resourceLocator' ,
default : { mode : 'list' , value : '' } ,
2020-04-07 21:35:50 -07:00
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'get' ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2023-05-08 06:15:13 -07:00
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' ,
} ,
} ,
] ,
} ,
] ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
{
2023-05-08 06:15:13 -07:00
displayName : 'Filters' ,
name : 'filters' ,
2020-04-07 21:35:50 -07:00
type : 'collection' ,
2023-05-08 06:15:13 -07:00
placeholder : 'Add Filter' ,
2020-04-07 21:35:50 -07:00
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'get' ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
options : [
{
2022-05-20 14:47:24 -07:00
displayName : 'Include Property Versions' ,
2020-04-07 21:35:50 -07:00
name : 'includePropertyVersions' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2022-08-17 08:50:24 -07:00
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.' ,
2020-04-07 21:35:50 -07:00
} ,
2023-05-08 06:15:13 -07:00
{
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>.' ,
} ,
2020-10-22 06:46:03 -07:00
] ,
2019-12-04 09:21:02 -08:00
} ,
2020-12-02 04:25:13 -08:00
/* -------------------------------------------------------------------------- */
/* deal:getAll */
/* -------------------------------------------------------------------------- */
2020-04-07 21:35:50 -07:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'getAll' ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
typeOptions : {
minValue : 1 ,
maxValue : 250 ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
{
2023-05-08 06:15:13 -07:00
displayName : 'Options' ,
2020-04-07 21:35:50 -07:00
name : 'filters' ,
type : 'collection' ,
2023-05-08 06:15:13 -07:00
placeholder : 'Add Option' ,
2020-04-07 21:35:50 -07:00
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'getAll' ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
options : [
{
displayName : 'Include Associations' ,
name : 'includeAssociations' ,
type : 'boolean' ,
default : false ,
2022-08-17 08:50:24 -07:00
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.' ,
2020-04-07 21:35:50 -07:00
} ,
{
2023-05-08 06:15:13 -07:00
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' ,
} ,
] ,
} ,
] ,
2022-08-17 08:50:24 -07:00
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>.' ,
2020-04-07 21:35:50 -07:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-04-07 21:35:50 -07:00
} ,
2020-12-02 04:25:13 -08:00
/* -------------------------------------------------------------------------- */
/* deal:delete */
/* -------------------------------------------------------------------------- */
2020-04-07 21:35:50 -07:00
{
2023-05-08 06:15:13 -07:00
displayName : 'Deal to Delete' ,
2020-04-07 21:35:50 -07:00
name : 'dealId' ,
2023-05-08 06:15:13 -07:00
type : 'resourceLocator' ,
default : { mode : 'list' , value : '' } ,
2020-04-07 21:35:50 -07:00
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'delete' ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2023-05-08 06:15:13 -07:00
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' ,
} ,
} ,
] ,
} ,
] ,
2019-12-04 09:21:02 -08:00
} ,
2020-12-02 04:25:13 -08:00
/* -------------------------------------------------------------------------- */
2023-05-08 06:15:13 -07:00
/* deal:getRecentDeals */
2020-12-02 04:25:13 -08:00
/* -------------------------------------------------------------------------- */
2020-04-07 21:35:50 -07:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
2023-05-08 06:15:13 -07:00
operation : [ 'getRecentlyCreatedUpdated' ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
2023-05-08 06:15:13 -07:00
operation : [ 'getRecentlyCreatedUpdated' ] ,
2022-08-17 08:50:24 -07:00
returnAll : [ false ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
typeOptions : {
minValue : 1 ,
maxValue : 250 ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
{
2023-05-08 06:15:13 -07:00
displayName : 'Options' ,
2020-04-07 21:35:50 -07:00
name : 'filters' ,
type : 'collection' ,
2023-05-08 06:15:13 -07:00
placeholder : 'Add Option' ,
2020-04-07 21:35:50 -07:00
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
2023-05-08 06:15:13 -07:00
operation : [ 'getRecentlyCreatedUpdated' ] ,
2020-04-07 21:35:50 -07:00
} ,
2019-12-04 09:21:02 -08:00
} ,
2020-04-07 21:35:50 -07:00
options : [
{
displayName : 'Since' ,
name : 'since' ,
type : 'dateTime' ,
default : '' ,
2023-05-08 06:15:13 -07:00
description :
'Only return deals created after timestamp x. When using expressions, the time should be specified in YYYY-MM-DD hh-mm-ss format.' ,
2020-04-07 21:35:50 -07:00
} ,
{
displayName : 'Include Property Versions' ,
name : 'includePropertyVersions' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2022-08-17 08:50:24 -07:00
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.' ,
2020-04-07 21:35:50 -07:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-04-07 21:35:50 -07:00
} ,
2020-12-02 04:25:13 -08:00
/*--------------------------------------------------------------------------- */
/* deal:search */
/* -------------------------------------------------------------------------- */
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'search' ] ,
2020-12-02 04:25:13 -08:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-12-02 04:25:13 -08:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'search' ] ,
returnAll : [ false ] ,
2020-12-02 04:25:13 -08:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 250 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-12-02 04:25:13 -08:00
} ,
{
displayName : 'Filter Groups' ,
name : 'filterGroupsUi' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-12-02 04:25:13 -08:00
placeholder : 'Add Filter Group' ,
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'search' ] ,
2020-12-02 04:25:13 -08:00
} ,
} ,
options : [
{
name : 'filterGroupsValues' ,
displayName : 'Filter Group' ,
values : [
{
displayName : 'Filters' ,
name : 'filtersUi' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-12-02 04:25:13 -08:00
placeholder : 'Add Filter' ,
typeOptions : {
multipleValues : true ,
} ,
options : [
{
name : 'filterValues' ,
displayName : 'Filter' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Property Name or ID' ,
2020-12-02 04:25:13 -08:00
name : 'propertyName' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-12-02 04:25:13 -08:00
typeOptions : {
loadOptionsMethod : 'getDealProperties' ,
} ,
default : '' ,
} ,
2023-05-08 06:15:13 -07:00
{
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' ,
} ,
2020-12-02 04:25:13 -08:00
{
displayName : 'Operator' ,
name : 'operator' ,
type : 'options' ,
2023-05-08 06:15:13 -07:00
displayOptions : {
show : {
type : [ 'number' ] ,
} ,
} ,
2020-12-02 04:25:13 -08:00
options : [
{
2022-06-03 10:23:49 -07:00
name : 'Contains Exactly' ,
2022-10-11 00:49:25 -07:00
value : 'CONTAINS_TOKEN' ,
2020-12-02 04:25:13 -08:00
} ,
{
2022-06-03 10:23:49 -07:00
name : 'Equal' ,
value : 'EQ' ,
2020-12-02 04:25:13 -08:00
} ,
{
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' ,
} ,
{
2022-06-03 10:23:49 -07:00
name : 'Less Than' ,
value : 'LT' ,
2020-12-02 04:25:13 -08:00
} ,
{
2022-06-03 10:23:49 -07:00
name : 'Less Than Or Equal' ,
value : 'LTE' ,
} ,
{
name : 'Not Equal' ,
value : 'NEQ' ,
2020-12-02 04:25:13 -08:00
} ,
] ,
default : 'EQ' ,
} ,
{
displayName : 'Value' ,
name : 'value' ,
displayOptions : {
hide : {
2022-08-17 08:50:24 -07:00
operator : [ 'HAS_PROPERTY' , 'NOT_HAS_PROPERTY' ] ,
2020-12-02 04:25:13 -08:00
} ,
} ,
2023-05-08 06:15:13 -07:00
required : true ,
2020-12-02 04:25:13 -08:00
type : 'string' ,
default : '' ,
} ,
] ,
} ,
] ,
2022-08-17 08:50:24 -07:00
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>.' ,
2020-12-02 04:25:13 -08:00
} ,
] ,
} ,
] ,
2022-08-17 08:50:24 -07:00
description :
2023-05-08 06:15:13 -07:00
'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>' ,
2020-12-02 04:25:13 -08:00
} ,
{
2023-05-08 06:15:13 -07:00
displayName : 'Options' ,
2020-12-02 04:25:13 -08:00
name : 'additionalFields' ,
type : 'collection' ,
2023-05-08 06:15:13 -07:00
placeholder : 'Add Option' ,
2020-12-02 04:25:13 -08:00
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'deal' ] ,
operation : [ 'search' ] ,
2020-12-02 04:25:13 -08:00
} ,
} ,
options : [
{
displayName : 'Direction' ,
name : 'direction' ,
type : 'options' ,
options : [
{
2023-05-08 06:15:13 -07:00
name : 'Ascending' ,
2020-12-02 04:25:13 -08:00
value : 'ASCENDING' ,
} ,
{
2023-05-08 06:15:13 -07:00
name : 'Descending' ,
2020-12-02 04:25:13 -08:00
value : 'DESCENDING' ,
} ,
] ,
default : 'DESCENDING' ,
2022-08-17 08:50:24 -07:00
description :
2023-05-08 06:15:13 -07:00
'Defines the direction in which search results are ordered. Default value is Descending.' ,
2020-12-02 04:25:13 -08:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Field Names or IDs' ,
2020-12-02 04:25:13 -08:00
name : 'properties' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getDealProperties' ,
} ,
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
2023-05-08 06:15:13 -07:00
'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>.' ,
2020-12-02 04:25:13 -08:00
} ,
{
displayName : 'Query' ,
name : 'query' ,
type : 'string' ,
default : '' ,
description : 'Perform a text search against all property values for an object type' ,
} ,
{
2022-06-03 10:23:49 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
2020-12-02 04:25:13 -08:00
displayName : 'Sort By' ,
name : 'sortBy' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-12-02 04:25:13 -08:00
typeOptions : {
loadOptionsMethod : 'getDealProperties' ,
} ,
default : 'createdate' ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;