n8n/packages/nodes-base/nodes/ConvertKit/CustomFieldDescription.ts

125 lines
1.9 KiB
TypeScript
Raw Normal View History

import {
2020-08-05 18:55:53 -07:00
INodeProperties,
} from 'n8n-workflow';
export const customFieldOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
2020-08-05 18:55:53 -07:00
'customField',
],
},
},
options: [
{
name: 'Create',
value: 'create',
2020-08-05 18:55:53 -07:00
description: 'Create a field',
},
{
name: 'Delete',
value: 'delete',
2020-08-05 18:55:53 -07:00
description: 'Delete a field',
},
{
name: 'Get All',
value: 'getAll',
2020-08-05 18:55:53 -07:00
description: 'Get all fields',
},
{
name: 'Update',
value: 'update',
2020-08-05 18:55:53 -07:00
description: 'Update a field',
},
],
default: 'update',
description: 'The operation to perform.',
},
];
export const customFieldFields: INodeProperties[] = [
{
displayName: 'Field ID',
name: 'id',
type: 'string',
required: true,
displayOptions: {
show: {
resource: [
2020-08-05 18:55:53 -07:00
'customField',
],
operation: [
'update',
'delete',
],
},
},
default: '',
description: 'The ID of your custom field',
},
{
displayName: 'Label',
name: 'label',
type: 'string',
required: true,
displayOptions: {
show: {
resource: [
2020-08-05 18:55:53 -07:00
'customField',
],
operation: [
'update',
'create',
],
},
},
default: '',
description: 'The label of the custom field',
},
2020-08-05 18:55:53 -07:00
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'customField',
],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
2020-08-05 18:55:53 -07:00
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'customField',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'Max number of results to return',
2020-08-05 18:55:53 -07:00
},
];