2022-08-01 13:47:55 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2020-02-25 11:50:42 -08:00
2021-12-03 00:44:16 -08:00
export const personOperations : INodeProperties [ ] = [
2020-02-25 11:50:42 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-02-25 11:50:42 -08:00
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a person' ,
2022-07-10 13:50:51 -07:00
action : 'Create a person' ,
2020-02-25 11:50:42 -08:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a person' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a person' ,
2020-02-25 11:50:42 -08:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get a person' ,
2022-07-10 13:50:51 -07:00
action : 'Get a person' ,
2020-02-25 11:50:42 -08:00
} ,
{
name : 'Get All' ,
value : 'getAll' ,
description : 'Get all persons' ,
2022-07-10 13:50:51 -07:00
action : 'Get all people' ,
2020-02-25 11:50:42 -08:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update a person' ,
2022-07-10 13:50:51 -07:00
action : 'Update a person' ,
2020-02-25 11:50:42 -08:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-02-25 11:50:42 -08:00
2021-12-03 00:44:16 -08:00
export const personFields : INodeProperties [ ] = [
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* person:create */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Fist Name' ,
name : 'firstName' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'create' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The first name of the person' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Last Name' ,
name : 'lastName' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'create' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The last name of the person' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'create' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
2022-06-20 07:54:01 -07:00
displayName : 'Organization Names or IDs' ,
2020-02-25 11:50:42 -08:00
name : 'organizations' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getOrganizations' ,
} ,
default : [ ] ,
2022-08-01 13:47:55 -07:00
description :
'Organizations that the person is associated with. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-25 11:50:42 -08:00
} ,
] ,
} ,
{
displayName : 'Emails' ,
name : 'emails' ,
type : 'string' ,
description : 'The email addresses of the person' ,
typeOptions : {
multipleValues : true ,
multipleValueButtonText : 'Add To Email' ,
} ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'create' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
placeholder : 'info@example.com' ,
default : [ ] ,
} ,
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* person:update */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Person ID' ,
name : 'personId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'update' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier for the person' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'update' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
displayName : 'Fist Name' ,
name : 'firstName' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The first name of the person' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Last Name' ,
name : 'lastName' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The last name of the person' ,
2020-02-25 11:50:42 -08:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Organization Names or IDs' ,
2020-02-25 11:50:42 -08:00
name : 'organizations' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getOrganizations' ,
} ,
default : [ ] ,
2022-08-01 13:47:55 -07:00
description :
'Organizations that the person is associated with. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-25 11:50:42 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Emails' ,
name : 'emails' ,
type : 'string' ,
description : 'The email addresses of the person' ,
typeOptions : {
multipleValues : true ,
multipleValueButtonText : 'Add To Email' ,
} ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'update' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
placeholder : 'info@example.com' ,
default : [ ] ,
} ,
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* person:get */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Person ID' ,
name : 'personId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'get' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier for the person' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Option' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'get' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
displayName : 'With Interaction Dates' ,
name : 'withInteractionDates' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether interaction dates will be present on the returned resources' ,
2020-02-25 11:50:42 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-25 11:50:42 -08:00
} ,
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* person:getAll */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'getAll' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 10 ,
} ,
default : 5 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Option' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'getAll' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
displayName : 'Term' ,
name : 'term' ,
type : 'string' ,
default : '' ,
2022-08-01 13:47:55 -07:00
description :
'A string used to search all the persons in your team’ s address book. This could be an email address, a first name or a last name.' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'With Interaction Dates' ,
name : 'withInteractionDates' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether interaction dates will be present on the returned resources' ,
2020-02-25 11:50:42 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-25 11:50:42 -08:00
} ,
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* person:delete */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Person ID' ,
name : 'personId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'person' ] ,
operation : [ 'delete' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier for the person' ,
2020-02-25 11:50:42 -08:00
} ,
2021-12-03 00:44:16 -08:00
] ;