n8n/packages/nodes-base/nodes/CustomerIo/CustomerDescription.ts
Iván Ovejero 6f95121fac
refactor: Add action to all operations on all nodes (#3655)
* 👕 Add `action` to `INodePropertyOptions`

* 👕 Apply `node-param-operation-option-without-action`

* ✏️ Fix add/remove phrasing

* ✏️ Fix email template phrasing

* ✏️ Fix add/remove phrasing

* ✏️ Fix custom fields phrasing

* ✏️ Fix job report phrasing

* ✏️ Fix query phrasing

* ✏️ Various phrasing fixes

* ✏️ Fix final phrasings

* ✏️ Remove `conversation`

* ✏️ Fix plural
2022-07-10 23:50:51 +03:00

192 lines
3.7 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',
},
],
},
];