2019-12-03 13:48:17 -08:00
|
|
|
import { INodeProperties } from "n8n-workflow";
|
|
|
|
|
|
|
|
export const dealOperations = [
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'deal',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a deal',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a deal',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
description: 'The operation to perform.',
|
|
|
|
},
|
|
|
|
] as INodeProperties[];
|
|
|
|
|
|
|
|
export const dealFields = [
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* deal:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
{
|
2019-12-03 19:21:52 -08:00
|
|
|
displayName: 'Stage',
|
|
|
|
name: 'stage',
|
2019-12-03 13:48:17 -08:00
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getDealStages'
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'deal',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
options: [],
|
|
|
|
description: 'The dealstage is required when creating a deal. See the CRM Pipelines API for details on managing pipelines and stages.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'deal',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Deal Name',
|
|
|
|
name: 'dealName',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Deal Stage',
|
|
|
|
name: 'dealStage',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Pipeline',
|
|
|
|
name: 'pipeline',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Close Date',
|
|
|
|
name: 'closeDate',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Amount',
|
|
|
|
name: 'amount',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Deal Type',
|
|
|
|
name: 'dealType',
|
2019-12-03 19:21:52 -08:00
|
|
|
type: 'options',
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getDealTypes',
|
|
|
|
},
|
|
|
|
default: [],
|
2019-12-03 13:48:17 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Associated Company',
|
|
|
|
name: 'associatedCompany',
|
|
|
|
type: 'multiOptions',
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod:'getCompanies' ,
|
|
|
|
},
|
|
|
|
default: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Associated Vids',
|
|
|
|
name: 'associatedVids',
|
|
|
|
type: 'multiOptions',
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod:'getContacts' ,
|
|
|
|
},
|
|
|
|
default: [],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
|
|
|
] as INodeProperties[];
|