mirror of
				https://github.com/n8n-io/n8n-nodes-starter.git
				synced 2025-11-03 23:52:26 -06:00 
			
		
		
		
	
		
			
	
	
		
			82 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			82 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| 
								 | 
							
								import {
							 | 
						||
| 
								 | 
							
									INodeProperties,
							 | 
						||
| 
								 | 
							
								} from 'n8n-workflow';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								export const contactOperations = [
							 | 
						||
| 
								 | 
							
									{
							 | 
						||
| 
								 | 
							
										displayName: 'Operation',
							 | 
						||
| 
								 | 
							
										name: 'operation',
							 | 
						||
| 
								 | 
							
										type: 'options',
							 | 
						||
| 
								 | 
							
										displayOptions: {
							 | 
						||
| 
								 | 
							
											show: {
							 | 
						||
| 
								 | 
							
												resource: [
							 | 
						||
| 
								 | 
							
													'contact',
							 | 
						||
| 
								 | 
							
												],
							 | 
						||
| 
								 | 
							
											},
							 | 
						||
| 
								 | 
							
										},
							 | 
						||
| 
								 | 
							
										options: [
							 | 
						||
| 
								 | 
							
											{
							 | 
						||
| 
								 | 
							
												name: 'Create',
							 | 
						||
| 
								 | 
							
												value: 'create',
							 | 
						||
| 
								 | 
							
												description: 'Create a contact',
							 | 
						||
| 
								 | 
							
											},
							 | 
						||
| 
								 | 
							
										],
							 | 
						||
| 
								 | 
							
										default: 'create',
							 | 
						||
| 
								 | 
							
										description: 'The operation to perform.',
							 | 
						||
| 
								 | 
							
									},
							 | 
						||
| 
								 | 
							
								] as INodeProperties[];
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								export const contactFields = [
							 | 
						||
| 
								 | 
							
									/*-------------------------------------------------------------------------- */
							 | 
						||
| 
								 | 
							
									/*                                contact:create                             */
							 | 
						||
| 
								 | 
							
									/* ------------------------------------------------------------------------- */
							 | 
						||
| 
								 | 
							
									{
							 | 
						||
| 
								 | 
							
										displayName: 'Email',
							 | 
						||
| 
								 | 
							
										name: 'email',
							 | 
						||
| 
								 | 
							
										type: 'string',
							 | 
						||
| 
								 | 
							
										required: true,
							 | 
						||
| 
								 | 
							
										displayOptions: {
							 | 
						||
| 
								 | 
							
											show: {
							 | 
						||
| 
								 | 
							
												operation: [
							 | 
						||
| 
								 | 
							
													'create',
							 | 
						||
| 
								 | 
							
												],
							 | 
						||
| 
								 | 
							
												resource: [
							 | 
						||
| 
								 | 
							
													'contact',
							 | 
						||
| 
								 | 
							
												],
							 | 
						||
| 
								 | 
							
											},
							 | 
						||
| 
								 | 
							
										},
							 | 
						||
| 
								 | 
							
										default:'',
							 | 
						||
| 
								 | 
							
										description:'Primary email for the contact',
							 | 
						||
| 
								 | 
							
									},
							 | 
						||
| 
								 | 
							
									{
							 | 
						||
| 
								 | 
							
										displayName: 'Additional Fields',
							 | 
						||
| 
								 | 
							
										name: 'additionalFields',
							 | 
						||
| 
								 | 
							
										type: 'collection',
							 | 
						||
| 
								 | 
							
										placeholder: 'Add Field',
							 | 
						||
| 
								 | 
							
										default: {},
							 | 
						||
| 
								 | 
							
										displayOptions: {
							 | 
						||
| 
								 | 
							
											show: {
							 | 
						||
| 
								 | 
							
												resource: [
							 | 
						||
| 
								 | 
							
													'contact',
							 | 
						||
| 
								 | 
							
												],
							 | 
						||
| 
								 | 
							
												operation: [
							 | 
						||
| 
								 | 
							
													'create',
							 | 
						||
| 
								 | 
							
												],
							 | 
						||
| 
								 | 
							
											},
							 | 
						||
| 
								 | 
							
										},
							 | 
						||
| 
								 | 
							
										options: [
							 | 
						||
| 
								 | 
							
											{
							 | 
						||
| 
								 | 
							
												displayName: 'First Name',
							 | 
						||
| 
								 | 
							
												name: 'firstName',
							 | 
						||
| 
								 | 
							
												type: 'string',
							 | 
						||
| 
								 | 
							
												default: '',
							 | 
						||
| 
								 | 
							
											},
							 | 
						||
| 
								 | 
							
											{
							 | 
						||
| 
								 | 
							
												displayName: 'Last Name',
							 | 
						||
| 
								 | 
							
												name: 'lastName',
							 | 
						||
| 
								 | 
							
												type: 'string',
							 | 
						||
| 
								 | 
							
												default: '',
							 | 
						||
| 
								 | 
							
											},
							 | 
						||
| 
								 | 
							
										],
							 | 
						||
| 
								 | 
							
									},
							 | 
						||
| 
								 | 
							
								] as INodeProperties[];
							 |