import { INodeProperties } from 'n8n-workflow'; export const activityOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', displayOptions: { show: { resource: [ 'activity', ], }, }, options: [ { name: 'Create', value: 'create', description: 'Create a activity', }, { name: 'Update', value: 'update', description: 'Update a activity', }, { name: 'Get', value: 'get', description: 'Get a activity', }, { name: 'Get All', value: 'getAll', description: 'Get all companies', }, { name: 'Delete', value: 'delete', description: 'Delete a activity', }, ], default: 'create', description: 'The operation to perform.', }, ] as INodeProperties[]; export const activityFields = [ /* -------------------------------------------------------------------------- */ /* activity:create */ /* -------------------------------------------------------------------------- */ { displayName: 'Title', name: 'title', type: 'string', default: '', displayOptions: { show: { resource: [ 'activity', ], operation: [ 'create', ], }, }, required: true, }, { displayName: 'Owner', name: 'owner', type: 'options', default: '', typeOptions: { loadOptionsMethod: 'getUsers', }, displayOptions: { show: { resource: [ 'activity', ], operation: [ 'create', ], }, }, required: true, }, { displayName: 'Type', name: 'type', type: 'string', default: '', displayOptions: { show: { resource: [ 'activity', ], operation: [ 'create', ], }, }, description: 'This field displays activity type such as call, meeting etc.', required: true, }, { displayName: 'RAW Data', name: 'rawData', type: 'boolean', displayOptions: { show: { resource: [ 'activity', ], operation: [ 'create', ], }, }, default: false, description: `If the data should include the fields details`, }, { displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', default: {}, displayOptions: { show: { resource: [ 'activity', ], operation: [ 'create', ], }, }, options: [ { displayName: 'Description', name: 'description', typeOptions: { alwaysOpenEditWindow: true, }, type: 'string', default: '', description: 'This field contains details related to the activity.', }, { displayName: 'Tags', name: 'tags', type: 'string', default: '', description: 'This field contains tags associated with an activity', }, { displayName: 'Due Date', name: 'dueDate', type: 'dateTime', default: '', description: 'Expiry date of an activity.', }, { displayName: 'Duration', name: 'duration', type: 'number', default: '', description: 'Time duration of an activity.', }, { displayName: 'Is Calendar Invite', name: 'isCalendarInvite', type: 'boolean', default: false, description: 'This field is used to send calendar invite.', }, { displayName: 'Is Completed', name: 'isCompleted', type: 'boolean', default: false, description: 'This field indicates whether the activity is completed or not.', }, ], }, /* -------------------------------------------------------------------------- */ /* activity:update */ /* -------------------------------------------------------------------------- */ { displayName: 'Activity ID', name: 'id', type: 'string', default: '', required: true, displayOptions: { show: { resource: [ 'activity', ], operation: [ 'update', ], }, }, description: 'activity ID', }, { displayName: 'RAW Data', name: 'rawData', type: 'boolean', displayOptions: { show: { resource: [ 'activity', ], operation: [ 'update', ], }, }, default: false, description: `If the data should include the fields details`, }, { displayName: 'Update Fields', name: 'updateFields', type: 'collection', placeholder: 'Add Field', default: {}, displayOptions: { show: { resource: [ 'activity', ], operation: [ 'update', ], }, }, options: [ { displayName: 'Title', name: 'title', type: 'string', default: '', }, { displayName: 'Type', name: 'type', type: 'string', default: '', }, { displayName: 'Owner', name: 'owner', type: 'string', default: '', }, { displayName: 'Description', name: 'description', typeOptions: { alwaysOpenEditWindow: true, }, type: 'string', default: '', description: 'This field contains details related to the activity.', }, { displayName: 'Tags', name: 'tags', type: 'string', default: '', description: 'This field contains tags associated with an activity', }, { displayName: 'Due Date', name: 'dueDate', type: 'dateTime', default: '', description: 'Expiry date of an activity.', }, { displayName: 'Duration', name: 'duration', type: 'number', default: '', description: 'Time duration of an activity.', }, { displayName: 'Is Calendar Invite', name: 'isCalendarInvite', type: 'boolean', default: false, description: 'This field is used to send calendar invite.', }, { displayName: 'Is Completed', name: 'isCompleted', type: 'boolean', default: false, description: 'This field indicates whether the activity is completed or not.', }, ], }, /* -------------------------------------------------------------------------- */ /* activity:get */ /* -------------------------------------------------------------------------- */ { displayName: 'Activity ID', name: 'id', type: 'string', default: '', required: true, displayOptions: { show: { resource: [ 'activity', ], operation: [ 'get', ], }, }, description: 'activity ID', }, { displayName: 'RAW Data', name: 'rawData', type: 'boolean', displayOptions: { show: { resource: [ 'activity', ], operation: [ 'get', ], }, }, default: false, description: `If the data should include the fields details`, }, /* -------------------------------------------------------------------------- */ /* activity:getAll */ /* -------------------------------------------------------------------------- */ { displayName: 'Return All', name: 'returnAll', type: 'boolean', displayOptions: { show: { resource: [ 'activity', ], operation: [ 'getAll', ], }, }, default: false, description: 'If all results should be returned or only up to a given limit.', }, { displayName: 'Limit', name: 'limit', type: 'number', displayOptions: { show: { resource: [ 'activity', ], operation: [ 'getAll', ], returnAll: [ false, ], }, }, typeOptions: { minValue: 1, maxValue: 25, }, default: 10, description: 'How many results to return.', }, { displayName: 'JSON Parameters', name: 'jsonParameters', type: 'boolean', default: false, description: '', displayOptions: { show: { operation: [ 'getAll', ], resource: [ 'activity', ], }, }, }, { displayName: 'Options', name: 'options', type: 'collection', placeholder: 'Add Option', default: {}, displayOptions: { show: { resource: [ 'activity', ], operation: [ 'getAll', ], }, }, options: [ { displayName: 'Fields', name: 'fields', type: 'string', default: '', }, { displayName: 'Sort By', name: 'sortBy', type: 'string', default: '', }, { displayName: 'Sort Order', name: 'sortOrder', type: 'options', options: [ { name: 'Asc', value: 'asc', }, { name: 'Desc', value: 'desc', }, ], default: 'desc', description: 'Sort order', } ], }, { displayName: 'Filters', name: 'filtersJson', type: 'json', typeOptions: { alwaysOpenEditWindow: true, }, default: '', displayOptions: { show: { operation: [ 'getAll', ], resource: [ 'activity', ], jsonParameters: [ true, ], }, }, }, { displayName: 'Filters', name: 'filters', placeholder: 'Add filter', type: 'fixedCollection', typeOptions: { multipleValues: false, }, displayOptions: { show: { resource: [ 'activity', ], operation: [ 'getAll', ], jsonParameters: [ false, ], }, }, default: {}, options: [ { name: 'filtersUi', displayName: 'Filters', values: [ { displayName: 'Operator', name: 'operator', type: 'options', options: [ { name: 'And', value: 'AND', }, { name: 'Or', value: 'OR', }, ], default: 'AND', }, { displayName: 'Conditions', name: 'conditions', placeholder: 'Add Condition', type: 'fixedCollection', typeOptions: { multipleValues: true, }, default: {}, options: [ { name: 'conditionsUi', displayName: 'Conditions', values: [ { displayName: 'Field', name: 'field', type: 'options', options: [ { name: 'Title', value: 'title', }, { name: 'Tags', value: 'tags', }, ], default: 'title', }, { displayName: 'Condition', name: 'condition', type: 'options', options: [ { name: 'Equals', value: 'EQUALS', }, { name: 'Not Equals', value: 'NOT_EQUALS', }, { name: 'Empty', value: 'EMPTY', }, { name: 'Not Empty', value: 'NOT_EMPTY', }, { name: 'CONTAINS', value: 'Contains', }, { name: 'Does Not Contains', value: 'DOES_NOT_CONTAINS', }, { name: 'Starts With', value: 'STARTS_WITH', }, { name: 'Ends With', value: 'ENDS_WITH', }, ], default: 'EQUALS', description: 'Value of the property to set.', }, { displayName: 'Value', name: 'value', type: 'string', default: '', } ] }, ], }, ] }, ], }, /* -------------------------------------------------------------------------- */ /* activity:delete */ /* -------------------------------------------------------------------------- */ { displayName: 'Activity ID', name: 'id', type: 'string', default: '', required: true, displayOptions: { show: { resource: [ 'activity', ], operation: [ 'delete', ], }, }, description: 'If more than one activity add them separated by ,', }, ] as INodeProperties[];