2024-12-02 07:55:01 -08:00
|
|
|
import type { IExecuteFunctions } from 'n8n-workflow';
|
2024-08-29 06:55:53 -07:00
|
|
|
import { getNodeInputsData } from '../helpers/utils';
|
2024-07-02 03:47:04 -07:00
|
|
|
import type { MergeType } from './node.type';
|
|
|
|
import * as mode from './mode';
|
|
|
|
|
|
|
|
export async function router(this: IExecuteFunctions) {
|
|
|
|
const inputsData = getNodeInputsData.call(this);
|
|
|
|
let operationMode = this.getNodeParameter('mode', 0) as string;
|
|
|
|
|
|
|
|
if (operationMode === 'combine') {
|
|
|
|
const combineBy = this.getNodeParameter('combineBy', 0) as string;
|
|
|
|
operationMode = combineBy;
|
|
|
|
}
|
|
|
|
|
2024-12-02 07:55:01 -08:00
|
|
|
return await mode[operationMode as MergeType].execute.call(this, inputsData);
|
2024-07-02 03:47:04 -07:00
|
|
|
}
|