2020-12-02 23:05:54 -08:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const eventOperations : INodeProperties [ ] = [
2020-12-02 23:05:54 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-12-02 23:05:54 -08:00
displayOptions : {
show : {
resource : [
'event' ,
] ,
} ,
} ,
options : [
{
name : 'Track' ,
value : 'track' ,
description : 'Record the actions a user perform' ,
2022-07-10 13:50:51 -07:00
action : 'Track an event' ,
2020-12-02 23:05:54 -08:00
} ,
] ,
default : 'track' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-12-02 23:05:54 -08:00
2021-12-03 00:44:16 -08:00
export const eventFields : INodeProperties [ ] = [
2020-12-02 23:05:54 -08:00
/* -------------------------------------------------------------------------- */
/* event:track */
/* -------------------------------------------------------------------------- */
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
resource : [
'event' ,
] ,
operation : [
'track' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The name of the event to track' ,
2020-12-02 23:05:54 -08:00
default : '' ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'event' ,
] ,
operation : [
'track' ,
] ,
} ,
} ,
options : [
{
displayName : 'Campaign ID' ,
name : 'campaignId' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Campaign tied to conversion' ,
2020-12-02 23:05:54 -08:00
} ,
{
displayName : 'Created At' ,
name : 'createdAt' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Time event happened' ,
2020-12-02 23:05:54 -08:00
} ,
{
displayName : 'Data Fields' ,
name : 'dataFieldsUi' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-12-02 23:05:54 -08:00
placeholder : 'Add Data Field' ,
typeOptions : {
multipleValues : true ,
} ,
options : [
{
name : 'dataFieldValues' ,
displayName : 'Data Field' ,
values : [
{
displayName : 'Key' ,
name : 'key' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The end event specified key of the event defined data' ,
2020-12-02 23:05:54 -08:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The end event specified value of the event defined data' ,
2020-12-02 23:05:54 -08:00
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-12-02 23:05:54 -08:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Either email or userId must be passed in to identify the user. If both are passed in, email takes precedence.' ,
2020-12-02 23:05:54 -08:00
} ,
{
displayName : 'ID' ,
name : 'id' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Optional event ID. If an event exists with that ID, the event will be updated. If none is specified, a new ID will automatically be generated and returned.' ,
2020-12-02 23:05:54 -08:00
} ,
{
displayName : 'Template ID' ,
name : 'templateId' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'User ID' ,
name : 'userId' ,
type : 'string' ,
default : '' ,
2022-06-03 10:23:49 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-lowercase-first-char
2022-05-06 14:01:25 -07:00
description : 'userId that was passed into the updateUser call' ,
2020-12-02 23:05:54 -08:00
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;