2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2020-11-25 04:08:59 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const fieldOperations: INodeProperties[] = [
|
2020-11-25 04:08:59 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-11-25 04:08:59 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['field'],
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all fields',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get all fields',
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
],
|
2020-11-25 04:09:58 -08:00
|
|
|
default: 'getAll',
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-11-25 04:08:59 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const fieldFields: INodeProperties[] = [
|
2020-11-25 04:08:59 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* field:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Table ID',
|
|
|
|
name: 'tableId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['field'],
|
|
|
|
operation: ['getAll'],
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'The table identifier',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['field'],
|
|
|
|
operation: ['getAll'],
|
2020-11-25 04:08:59 -08: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-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['field'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 100,
|
|
|
|
},
|
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Options',
|
|
|
|
name: 'options',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['field'],
|
|
|
|
operation: ['getAll'],
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Include Field Perms',
|
|
|
|
name: 'includeFieldPerms',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
2022-06-20 07:54:01 -07:00
|
|
|
description: 'Whether to get back the custom permissions for the field(s)',
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|