2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2021-02-14 08:56:34 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const trackOperations: 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: ['track'],
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Page',
|
|
|
|
value: 'page',
|
|
|
|
description: 'Track a page',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Track a page',
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Screen',
|
|
|
|
value: 'screen',
|
|
|
|
description: 'Track a screen',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Track a screen',
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'page',
|
|
|
|
},
|
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 trackFields: INodeProperties[] = [
|
2021-02-14 08:56:34 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* track:page */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['track'],
|
|
|
|
operation: ['page', 'screen'],
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Distinct ID',
|
|
|
|
name: 'distinctId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['track'],
|
|
|
|
operation: ['page', 'screen'],
|
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: ['track'],
|
|
|
|
operation: ['page', 'screen'],
|
2021-02-14 08:56:34 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Category',
|
|
|
|
name: 'category',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Context',
|
|
|
|
name: 'contextUi',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
placeholder: 'Add Property',
|
|
|
|
default: {},
|
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Context',
|
|
|
|
name: 'contextValues',
|
|
|
|
values: [
|
|
|
|
{
|
|
|
|
displayName: 'Key',
|
|
|
|
name: 'key',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Message ID',
|
|
|
|
name: 'messageId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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
|
|
|
];
|