2020-07-02 13:41:59 -07:00
|
|
|
import {
|
2020-08-05 18:55:53 -07:00
|
|
|
INodeProperties,
|
2020-07-02 13:41:59 -07:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
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: {
|
|
|
|
resource: [
|
2020-08-05 18:55:53 -07:00
|
|
|
'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',
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
2020-08-05 18:55:53 -07:00
|
|
|
description: 'Delete a field',
|
2020-07-02 13:41:59 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
2020-08-05 18:55:53 -07:00
|
|
|
description: 'Get all 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',
|
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: {
|
|
|
|
resource: [
|
2020-08-05 18:55:53 -07:00
|
|
|
'customField',
|
2020-07-02 13:41:59 -07:00
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
|
|
|
resource: [
|
2020-08-05 18:55:53 -07:00
|
|
|
'customField',
|
2020-07-02 13:41:59 -07:00
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'customField',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'customField',
|
|
|
|
],
|
|
|
|
returnAll: [
|
|
|
|
false,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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
|
|
|
];
|