2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-07-10 04:44:23 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const eventOperations: INodeProperties[] = [
|
2021-07-10 04:44:23 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-07-10 04:44:23 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
2021-07-28 04:27:46 -07:00
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create an event',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create an event',
|
2021-07-28 04:27:46 -07:00
|
|
|
},
|
2021-07-10 04:44:23 -07:00
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2021-07-10 04:44:23 -07:00
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all events',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many events',
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'getAll',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-07-10 04:44:23 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const eventFields: INodeProperties[] = [
|
2021-07-10 04:44:23 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* event:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['event'],
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['event'],
|
|
|
|
returnAll: [false],
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 100,
|
|
|
|
},
|
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2021-07-28 04:27:46 -07:00
|
|
|
/* event:create */
|
2021-07-10 04:44:23 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Event Type',
|
|
|
|
name: 'eventType',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['event'],
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The Entity ID for which an event will be created',
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Event Attributes',
|
|
|
|
name: 'eventAttributes',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
placeholder: 'Add Attribute',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['event'],
|
|
|
|
operation: ['create'],
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Attributes',
|
|
|
|
name: 'attributes',
|
|
|
|
values: [
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Name of the attribute',
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Value of the attribute',
|
2021-07-10 04:44:23 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|