2022-08-01 13:47:55 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2020-07-02 13:41:59 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const customFieldOperations: INodeProperties[] = [
|
2020-07-02 13:41:59 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-07-02 13:41:59 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['customField'],
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
2020-08-05 18:55:53 -07:00
|
|
|
description: 'Create a field',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a custom field',
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
2020-08-05 18:55:53 -07:00
|
|
|
description: 'Delete a field',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a custom field',
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2020-07-02 13:41:59 -07:00
|
|
|
value: 'getAll',
|
2020-08-05 18:55:53 -07:00
|
|
|
description: 'Get all fields',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many custom fields',
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
2020-08-05 18:55:53 -07:00
|
|
|
description: 'Update a field',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update a custom field',
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'update',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-07-02 13:41:59 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const customFieldFields: INodeProperties[] = [
|
2020-07-02 13:41:59 -07:00
|
|
|
{
|
|
|
|
displayName: 'Field ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['customField'],
|
|
|
|
operation: ['update', 'delete'],
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of your custom field',
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Label',
|
|
|
|
name: 'label',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['customField'],
|
|
|
|
operation: ['update', 'create'],
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The label of the custom field',
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
2020-08-05 18:55:53 -07:00
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['customField'],
|
2020-08-05 18:55:53 -07: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-08-05 18:55:53 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['customField'],
|
|
|
|
returnAll: [false],
|
2020-08-05 18:55:53 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 500,
|
|
|
|
},
|
|
|
|
default: 100,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-08-05 18:55:53 -07:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|