2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2019-12-17 12:33:28 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const eventOperations: INodeProperties[] = [
|
2019-12-17 12:33:28 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2019-12-17 12:33:28 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Track',
|
|
|
|
value: 'track',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Track an event for a specific customer',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Track an event',
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'track',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2019-12-17 12:33:28 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const eventFields: INodeProperties[] = [
|
2022-08-17 08:50:24 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* event:track */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2019-12-17 12:33:28 -08:00
|
|
|
|
|
|
|
{
|
|
|
|
displayName: 'ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['track'],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'The unique identifier of the customer',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Email',
|
|
|
|
name: 'email',
|
|
|
|
type: 'string',
|
2022-06-20 07:54:01 -07:00
|
|
|
placeholder: 'name@email.com',
|
2019-12-17 12:33:28 -08:00
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['track'],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Event Name',
|
|
|
|
name: 'eventName',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['track'],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The name of the event tracked',
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'JSON Parameters',
|
|
|
|
name: 'jsonParameters',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['track'],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Data',
|
|
|
|
name: 'dataAttributesUi',
|
|
|
|
placeholder: 'Add Data',
|
2022-06-03 10:23:49 -07:00
|
|
|
description: 'Key value pairs that represent any properties you want to track with this event',
|
2019-12-17 12:33:28 -08:00
|
|
|
type: 'fixedCollection',
|
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['track'],
|
|
|
|
jsonParameters: [false],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'dataAttributesValues',
|
|
|
|
displayName: 'Data',
|
|
|
|
values: [
|
|
|
|
{
|
|
|
|
displayName: 'Key',
|
|
|
|
name: 'key',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Name of the property to set',
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Value of the property to set',
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
2020-10-22 06:46:03 -07:00
|
|
|
],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Extra',
|
|
|
|
name: 'extraAttributesUi',
|
|
|
|
placeholder: 'Add Extra',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Key value pairs that represent reserved, Vero-specific operators. Refer to the note on “deduplication” below.',
|
2019-12-17 12:33:28 -08:00
|
|
|
type: 'fixedCollection',
|
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['track'],
|
|
|
|
jsonParameters: [false],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'extraAttributesValues',
|
|
|
|
displayName: 'Extra',
|
|
|
|
values: [
|
|
|
|
{
|
|
|
|
displayName: 'Key',
|
|
|
|
name: 'key',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Name of the property to set',
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Value of the property to set',
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
2020-10-22 06:46:03 -07:00
|
|
|
],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Data',
|
|
|
|
name: 'dataAttributesJson',
|
|
|
|
type: 'json',
|
|
|
|
default: '',
|
|
|
|
typeOptions: {
|
|
|
|
alwaysOpenEditWindow: true,
|
|
|
|
},
|
2022-06-03 10:23:49 -07:00
|
|
|
description: 'Key value pairs that represent the custom user properties you want to update',
|
2019-12-17 12:33:28 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['track'],
|
|
|
|
jsonParameters: [true],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Extra',
|
|
|
|
name: 'extraAttributesJson',
|
|
|
|
type: 'json',
|
|
|
|
default: '',
|
|
|
|
typeOptions: {
|
|
|
|
alwaysOpenEditWindow: true,
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Key value pairs that represent reserved, Vero-specific operators. Refer to the note on “deduplication” below.',
|
2019-12-17 12:33:28 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['track'],
|
|
|
|
jsonParameters: [true],
|
2019-12-17 12:33:28 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|