2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-02-14 08:56:34 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const eventOperations: INodeProperties[] = [
|
2021-02-14 08:56:34 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-02-14 08:56:34 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create an event',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create an event',
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-02-14 08:56:34 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const eventFields: INodeProperties[] = [
|
2021-02-14 08:56:34 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* event:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Event',
|
|
|
|
name: 'eventName',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['create'],
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The name of the event',
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Distinct ID',
|
|
|
|
name: 'distinctId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['create'],
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
description: "The user's distinct ID",
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['create'],
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Properties',
|
|
|
|
name: 'propertiesUi',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
placeholder: 'Add Property',
|
|
|
|
default: {},
|
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Property',
|
|
|
|
name: 'propertyValues',
|
|
|
|
values: [
|
|
|
|
{
|
|
|
|
displayName: 'Key',
|
|
|
|
name: 'key',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Timestamp',
|
|
|
|
name: 'timestamp',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
description: "If not set, it'll automatically be set to the current time",
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|