import { INodeProperties, } from 'n8n-workflow'; export const peopleOperations: INodeProperties[] = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, required: true, displayOptions: { show: { resource: [ 'people', ], }, }, options: [ { name: 'Create', value: 'create', description: 'Create a new people', action: 'Create a people', }, { name: 'Get', value: 'get', description: 'Get people', action: 'Get a people', }, { name: 'Update', value: 'update', description: 'Update a people', action: 'Update a people', }, { name: 'Delete', value: 'delete', description: 'Delete a people', action: 'Delete a people', }, ], default: 'create', }, ]; export const peopleDescription: INodeProperties[] = [ { displayName: 'ID', name: '_id', type: 'string', default: '', displayOptions: { show: { resource: [ 'people', ], operation: [ 'update', 'delete', 'get', ], }, }, description: 'ID of Person', }, { displayName: 'Name', name: 'name', type: 'fixedCollection', placeholder: 'Enter Name', typeOptions: { multipleValues: false, }, description: 'Enter First name & Last name', default: [], displayOptions: { show: { resource: [ 'people', ], operation: [ 'create', 'update', ], }, }, options: [ { displayName: 'Name', name: 'customName', values: [ { displayName: 'First Name', name: 'first', type: 'string', description: 'Enter First Name', default: '', }, { displayName: 'Last Name', name: 'last', type: 'string', default: '', description: 'Enter Last Name', }, ], }, ], }, { displayName: 'Role', name: 'role', type: 'string', default: '', description: 'Enter Role', displayOptions: { show: { resource: [ 'people', ], operation: [ 'create', 'update', 'get', ], }, }, }, { displayName: 'Options', name: 'options', type: 'collection', placeholder: 'Add Option', default: {}, displayOptions: { show: { resource: [ 'people', ], operation: [ 'create', 'update', ], }, }, options: [ { displayName: 'Company', name: 'company', type: 'string', default: '', description: 'Company Name', }, { displayName: 'Status', name: 'status', type: 'options', description: 'Enter Status', default: 'active', options: [ { name: 'Active', value: 'active', }, { name: 'Inactive', value: 'inactive', }, { name: 'Archive', value: 'archive', }, { name: 'Pending', value: 'pending', }, ], }, { displayName: 'Custom Fields', name: 'customFields', type: 'fixedCollection', placeholder: 'Add Custom Field', typeOptions: { multipleValues: true, }, description: 'Key value pairs containing the name and value of the custom field. Only dates in the format YYYY-MM-DD are accepted as input for custom date fields.', default: [], options: [ { displayName: 'Custom Field', name: 'customField', values: [ { displayName: 'Custom Field Name or ID', name: '_id', type: 'options', description: 'Choose from the list, or specify an ID using an expression', default: '', typeOptions: { loadOptionsMethod: 'getPeopleCustomField', }, }, { displayName: 'Value Name or ID', name: 'value', type: 'string', default: '', description: 'Custom Field\'s values', }, ], }, ], }, { displayName: 'Contact Phones', name: 'phones', type: 'fixedCollection', default: [], placeholder: 'Add Contact Phones', typeOptions: { multipleValues: true, }, options: [ { displayName: 'Contact Phone', name: 'phone', values: [ { displayName: 'Phone Number', name: 'number', type: 'string', description: 'Enter Phone Number', default: '', }, { displayName: 'Type', name: 'type', type: 'options', description: 'Email Type', default: 'phone', options: [ { name: 'Phone', value: 'phone', }, { name: 'Work', value: 'work', }, { name: 'Alternative', value: 'alternative', }, { name: 'Mobile', value: 'mobile', }, ], }, ], }, ], description: 'Emter phone number', }, { displayName: 'Contact Emails', name: 'emails', type: 'fixedCollection', default: [], placeholder: 'Add Contact Emails', typeOptions: { multipleValues: true, }, options: [ { displayName: 'Contact Email', name: 'email', values: [ { displayName: 'Email Address', name: 'address', type: 'string', description: 'Enter Email Address', default: '', }, { displayName: 'Type', name: 'type', type: 'options', description: 'Email Type', default: 'email', options: [ { name: 'Email', value: 'email', }, { name: 'Work', value: 'work', }, { name: 'Alternative', value: 'alternative', }, ], }, ], }, ], description: 'Enter Email Address', }, ], }, ];