n8n/packages/nodes-base/nodes/Merge/v3/actions/mode/index.ts
Michael Kret af69c80bf5
feat(Merge Node): Overhaul, v3 (#9528)
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
Co-authored-by: Shireen Missi <94372015+ShireenMissi@users.noreply.github.com>
2024-07-02 13:47:04 +03:00

78 lines
1.9 KiB
TypeScript

import type { INodeProperties } from 'n8n-workflow';
import * as append from './append';
import * as chooseBranch from './chooseBranch';
import * as combineAll from './combineAll';
import * as combineByFields from './combineByFields';
import * as combineBySql from './combineBySql';
import * as combineByPosition from './combineByPosition';
export { append, chooseBranch, combineAll, combineByFields, combineBySql, combineByPosition };
export const description: INodeProperties[] = [
{
displayName: 'Mode',
name: 'mode',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Append',
value: 'append',
description: 'Output items of each input, one after the other',
},
{
name: 'Combine',
value: 'combine',
description: 'Merge matching items together',
},
{
name: 'SQL Query',
value: 'combineBySql',
description: 'Write a query to do the merge',
},
{
name: 'Choose Branch',
value: 'chooseBranch',
description: 'Output data from a specific branch, without modifying it',
},
],
default: 'append',
description: 'How input data should be merged',
},
{
displayName: 'Combine By',
name: 'combineBy',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Matching Fields',
value: 'combineByFields',
description: 'Combine items with the same field values',
},
{
name: 'Position',
value: 'combineByPosition',
description: 'Combine items based on their order',
},
{
name: 'All Possible Combinations',
value: 'combineAll',
description: 'Every pairing of every two items (cross join)',
},
],
default: 'combineByFields',
description: 'How input data should be merged',
displayOptions: {
show: { mode: ['combine'] },
},
},
...append.description,
...combineAll.description,
...combineByFields.description,
...combineBySql.description,
...combineByPosition.description,
...chooseBranch.description,
];