2023-10-25 05:34:47 -07:00
|
|
|
import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
|
|
|
|
import { VersionedNodeType } from 'n8n-workflow';
|
|
|
|
|
|
|
|
import { SwitchV1 } from './V1/SwitchV1.node';
|
|
|
|
import { SwitchV2 } from './V2/SwitchV2.node';
|
2024-01-04 01:03:03 -08:00
|
|
|
import { SwitchV3 } from './V3/SwitchV3.node';
|
2023-10-25 05:34:47 -07:00
|
|
|
|
|
|
|
export class Switch extends VersionedNodeType {
|
|
|
|
constructor() {
|
|
|
|
const baseDescription: INodeTypeBaseDescription = {
|
|
|
|
displayName: 'Switch',
|
|
|
|
name: 'switch',
|
|
|
|
icon: 'fa:map-signs',
|
|
|
|
group: ['transform'],
|
|
|
|
description: 'Route items depending on defined expression or rules',
|
2024-01-04 01:03:03 -08:00
|
|
|
defaultVersion: 3,
|
2019-12-15 17:46:37 -08:00
|
|
|
};
|
|
|
|
|
2023-10-25 05:34:47 -07:00
|
|
|
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
|
|
|
1: new SwitchV1(baseDescription),
|
|
|
|
2: new SwitchV2(baseDescription),
|
2024-01-04 01:03:03 -08:00
|
|
|
3: new SwitchV3(baseDescription),
|
2021-04-16 09:33:36 -07:00
|
|
|
};
|
2019-12-15 17:46:37 -08:00
|
|
|
|
2023-10-25 05:34:47 -07:00
|
|
|
super(nodeVersions, baseDescription);
|
2019-12-15 17:46:37 -08:00
|
|
|
}
|
|
|
|
}
|