mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
0ecbb4a19d
* 🔨 prettier formated nodes - A * 🔨 prettier formated nodes - B * ⚡ prettier formated nodes - C * ⚡ prettier formated nodes - D * ⚡ prettier formated nodes - E-F * 🎨 Adjust nodes-base formatting command (#3805) * Format additional files in nodes A-F (#3811) * ⚡ fixes * 🎨 Add Mindee to ignored dirs Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
167 lines
3.6 KiB
TypeScript
167 lines
3.6 KiB
TypeScript
import { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const customerOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['customer'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create or Update',
|
|
value: 'upsert',
|
|
description:
|
|
'Create a new customer, or update the current one if it already exists (upsert)',
|
|
action: 'Create or update a customer',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Delete a customer',
|
|
action: 'Delete a customer',
|
|
},
|
|
],
|
|
default: 'upsert',
|
|
},
|
|
];
|
|
|
|
export const customerFields: INodeProperties[] = [
|
|
/* -------------------------------------------------------------------------- */
|
|
/* customer:delete */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'ID',
|
|
name: 'id',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['customer'],
|
|
operation: ['delete'],
|
|
},
|
|
},
|
|
description: 'The unique identifier for the customer',
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* customer:upsert */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'ID',
|
|
name: 'id',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['customer'],
|
|
operation: ['upsert'],
|
|
},
|
|
},
|
|
description: 'The unique identifier for the customer',
|
|
},
|
|
{
|
|
displayName: 'JSON Parameters',
|
|
name: 'jsonParameters',
|
|
type: 'boolean',
|
|
default: false,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['customer'],
|
|
operation: ['upsert'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Additional Fields',
|
|
name: 'additionalFieldsJson',
|
|
type: 'json',
|
|
typeOptions: {
|
|
alwaysOpenEditWindow: true,
|
|
},
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['customer'],
|
|
operation: ['upsert'],
|
|
jsonParameters: [true],
|
|
},
|
|
},
|
|
description:
|
|
'Object of values to set as described <a href="https://github.com/agilecrm/rest-api#1-companys---companies-api">here</a>',
|
|
},
|
|
{
|
|
displayName: 'Additional Fields',
|
|
name: 'additionalFields',
|
|
type: 'collection',
|
|
placeholder: 'Add Field',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['customer'],
|
|
operation: ['upsert'],
|
|
jsonParameters: [false],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Custom Properties',
|
|
name: 'customProperties',
|
|
type: 'fixedCollection',
|
|
default: {},
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Property',
|
|
name: 'customProperty',
|
|
values: [
|
|
{
|
|
displayName: 'Key',
|
|
name: 'key',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'Property name',
|
|
placeholder: 'Plan',
|
|
},
|
|
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'Property value',
|
|
placeholder: 'Basic',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Email',
|
|
name: 'email',
|
|
type: 'string',
|
|
placeholder: 'name@email.com',
|
|
default: '',
|
|
description: 'The email address of the user',
|
|
},
|
|
{
|
|
displayName: 'Created At',
|
|
name: 'createdAt',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description: 'The UNIX timestamp from when the user was created',
|
|
},
|
|
],
|
|
},
|
|
];
|