2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-08-08 00:51:44 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const activityOperations: INodeProperties[] = [
|
2021-08-08 00:51:44 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-08-08 00:51:44 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create an activity',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create an activity',
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete an activity',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete an activity',
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Retrieve an activity',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get an activity',
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2021-08-08 00:51:44 -07:00
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
description: 'Retrieve many activities',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many activities',
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update an activity',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update an activity',
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-08-08 00:51:44 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const activityFields: INodeProperties[] = [
|
2021-08-08 00:51:44 -07:00
|
|
|
// ----------------------------------------
|
|
|
|
// activity: create
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Activity Type Name or ID',
|
2021-08-08 00:51:44 -07:00
|
|
|
name: 'activityTypeId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2021-08-08 00:51:44 -07:00
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getActivityTypes',
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['create'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Contacts',
|
|
|
|
name: 'contacts',
|
|
|
|
description: 'Comma-separated list of IDs of the contacts to associate the activity with',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['create'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Happened At',
|
|
|
|
name: 'happenedAt',
|
|
|
|
description: 'Date when the activity happened',
|
|
|
|
type: 'dateTime',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['create'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Summary',
|
|
|
|
name: 'summary',
|
|
|
|
description: 'Brief description of the activity - max 255 characters',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['create'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['create'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'Description of the activity - max 100,000 characters',
|
|
|
|
typeOptions: {
|
|
|
|
alwaysOpenEditWindow: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// activity: delete
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Activity ID',
|
|
|
|
name: 'activityId',
|
|
|
|
description: 'ID of the activity to delete',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['delete'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// activity: get
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Activity ID',
|
|
|
|
name: 'activityId',
|
|
|
|
description: 'ID of the activity to retrieve',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['get'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// activity: getAll
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['getAll'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-08-08 00:51:44 -07:00
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// activity: update
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Activity ID',
|
|
|
|
name: 'activityId',
|
|
|
|
description: 'ID of the activity to update',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['update'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['activity'],
|
|
|
|
operation: ['update'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Activity Type Name or ID',
|
2021-08-08 00:51:44 -07:00
|
|
|
name: 'activity_type_id',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2021-08-08 00:51:44 -07:00
|
|
|
default: '',
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getActivityTypes',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Contacts',
|
|
|
|
name: 'contacts',
|
|
|
|
description: 'IDs of the contacts to associate the activity with',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'Description to add more details on the activity - max 100,000 characters',
|
|
|
|
typeOptions: {
|
|
|
|
alwaysOpenEditWindow: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Happened At',
|
|
|
|
name: 'happened_at',
|
|
|
|
description: 'Date when the activity happened',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Summary',
|
|
|
|
name: 'summary',
|
|
|
|
description: 'Brief description of the activity - max 255 characters',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|