2020-10-23 00:31:32 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const contactSegmentOperations: INodeProperties[] = [
|
2020-10-23 00:31:32 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-10-23 00:31:32 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
2021-07-08 01:12:19 -07:00
|
|
|
'contactSegment',
|
2020-10-23 00:31:32 -07:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Add',
|
|
|
|
value: 'add',
|
2021-07-08 01:12:19 -07:00
|
|
|
description: 'Add contact to a segment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Add a contact to a segment',
|
2020-10-23 00:31:32 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Remove',
|
|
|
|
value: 'remove',
|
2021-07-08 01:12:19 -07:00
|
|
|
description: 'Remove contact from a segment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Remove a contact from a segment',
|
2020-10-23 00:31:32 -07:00
|
|
|
},
|
|
|
|
],
|
2021-07-08 01:12:19 -07:00
|
|
|
default: 'add',
|
2020-10-23 00:31:32 -07:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-10-23 00:31:32 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const contactSegmentFields: INodeProperties[] = [
|
2020-10-23 00:31:32 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2021-07-08 01:12:19 -07:00
|
|
|
/* contactSegment:add */
|
2020-10-23 00:31:32 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Contact ID',
|
|
|
|
name: 'contactId',
|
|
|
|
type: 'string',
|
2021-07-08 01:12:19 -07:00
|
|
|
required: true,
|
2020-10-23 00:31:32 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
2021-07-08 01:12:19 -07:00
|
|
|
'contactSegment',
|
2020-10-23 00:31:32 -07:00
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2021-07-08 01:12:19 -07:00
|
|
|
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Segment Name or ID',
|
2021-07-08 01:12:19 -07:00
|
|
|
name: 'segmentId',
|
|
|
|
type: 'options',
|
2022-07-14 13:05:11 -07:00
|
|
|
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2021-07-08 01:12:19 -07:00
|
|
|
required: true,
|
2020-10-23 00:31:32 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
2021-07-08 01:12:19 -07:00
|
|
|
'contactSegment',
|
2020-10-23 00:31:32 -07:00
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2021-07-08 01:12:19 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSegments',
|
|
|
|
},
|
2020-10-23 00:31:32 -07:00
|
|
|
default: '',
|
2021-07-08 01:12:19 -07:00
|
|
|
|
2020-10-23 00:31:32 -07:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|