mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
61ac0c7775
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
30 lines
881 B
TypeScript
30 lines
881 B
TypeScript
import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
|
|
import { VersionedNodeType } from 'n8n-workflow';
|
|
|
|
import { SwitchV1 } from './V1/SwitchV1.node';
|
|
import { SwitchV2 } from './V2/SwitchV2.node';
|
|
import { SwitchV3 } from './V3/SwitchV3.node';
|
|
|
|
export class Switch extends VersionedNodeType {
|
|
constructor() {
|
|
const baseDescription: INodeTypeBaseDescription = {
|
|
displayName: 'Switch',
|
|
name: 'switch',
|
|
icon: 'fa:map-signs',
|
|
iconColor: 'light-blue',
|
|
group: ['transform'],
|
|
description: 'Route items depending on defined expression or rules',
|
|
defaultVersion: 3.1,
|
|
};
|
|
|
|
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
|
1: new SwitchV1(baseDescription),
|
|
2: new SwitchV2(baseDescription),
|
|
3: new SwitchV3(baseDescription),
|
|
3.1: new SwitchV3(baseDescription),
|
|
};
|
|
|
|
super(nodeVersions, baseDescription);
|
|
}
|
|
}
|