2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2021-09-28 11:50:15 -07:00
|
|
|
|
|
|
|
export const searchConfigurationOperations: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
noDataExpression: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['searchConfiguration'],
|
2021-09-28 11:50:15 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete a search configuration',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a search configuration',
|
2021-09-28 11:50:15 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Retrieve a search configuration',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a search configuration',
|
2021-09-28 11:50:15 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2021-09-28 11:50:15 -07:00
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
description: 'Retrieve many search configurations',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many search configurations',
|
2021-09-28 11:50:15 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'delete',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const searchConfigurationFields: INodeProperties[] = [
|
|
|
|
// ----------------------------------------
|
|
|
|
// searchConfiguration: delete
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Search Configuration ID',
|
|
|
|
name: 'searchConfigurationId',
|
|
|
|
description: 'ID of the search configuration to delete',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['searchConfiguration'],
|
|
|
|
operation: ['delete'],
|
2021-09-28 11:50:15 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// searchConfiguration: get
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Search Configuration ID',
|
|
|
|
name: 'searchConfigurationId',
|
|
|
|
description: 'ID of the search configuration to retrieve',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['searchConfiguration'],
|
|
|
|
operation: ['get'],
|
2021-09-28 11:50:15 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// searchConfiguration: getAll
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['searchConfiguration'],
|
|
|
|
operation: ['getAll'],
|
2021-09-28 11:50:15 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
default: 50,
|
|
|
|
description: 'Max number of results to return',
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['searchConfiguration'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2021-09-28 11:50:15 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Options',
|
|
|
|
name: 'options',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Option',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['searchConfiguration'],
|
|
|
|
operation: ['getAll'],
|
2021-09-28 11:50:15 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Add Orphan Field',
|
|
|
|
name: 'add_orphan_field',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Whether to include a boolean value for each saved search to show whether the search is orphaned, meaning that it has no valid owner',
|
2021-09-28 11:50:15 -07:00
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'List Default Actions',
|
|
|
|
name: 'listDefaultActionArgs',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|