2023-12-13 05:45:22 -08:00
|
|
|
import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
|
|
|
|
import { VersionedNodeType } from 'n8n-workflow';
|
|
|
|
|
|
|
|
import { IfV1 } from './V1/IfV1.node';
|
|
|
|
import { IfV2 } from './V2/IfV2.node';
|
|
|
|
|
|
|
|
export class If extends VersionedNodeType {
|
|
|
|
constructor() {
|
|
|
|
const baseDescription: INodeTypeBaseDescription = {
|
|
|
|
displayName: 'If',
|
|
|
|
name: 'if',
|
|
|
|
icon: 'fa:map-signs',
|
2024-06-06 04:34:30 -07:00
|
|
|
iconColor: 'green',
|
2023-12-13 05:45:22 -08:00
|
|
|
group: ['transform'],
|
|
|
|
description: 'Route items to different branches (true/false)',
|
2024-08-19 09:01:33 -07:00
|
|
|
defaultVersion: 2.1,
|
2019-06-23 03:35:23 -07:00
|
|
|
};
|
|
|
|
|
2023-12-13 05:45:22 -08:00
|
|
|
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
|
|
|
1: new IfV1(baseDescription),
|
|
|
|
2: new IfV2(baseDescription),
|
2024-08-19 09:01:33 -07:00
|
|
|
2.1: new IfV2(baseDescription),
|
2021-04-16 09:33:36 -07:00
|
|
|
};
|
2021-02-27 03:54:45 -08:00
|
|
|
|
2023-12-13 05:45:22 -08:00
|
|
|
super(nodeVersions, baseDescription);
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
}
|