UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

96 lines (91 loc) 2.98 kB
/** * Filter Node - Version 1 * Remove items matching a condition */ export interface FilterV1Params { /** * The type of values to compare * @default {} */ conditions?: { /** Boolean */ boolean?: Array<{ /** The value to compare with the second one * @default false */ value1?: boolean | Expression<boolean>; /** Operation to decide where the data should be mapped to * @default equal */ operation?: 'equal' | 'notEqual' | Expression<string>; /** The value to compare with the first one * @default false */ value2?: boolean | Expression<boolean>; }>; /** Date & Time */ dateTime?: Array<{ /** The value to compare with the second one */ value1?: string | Expression<string>; /** Operation to decide where the data should be mapped to * @default after */ operation?: 'after' | 'before' | Expression<string>; /** The value to compare with the first one */ value2?: string | Expression<string>; }>; /** Number */ number?: Array<{ /** The value to compare with the second one * @default 0 */ value1?: number | Expression<number>; /** Operation to decide where the data should be mapped to * @default smaller */ operation?: 'smaller' | 'smallerEqual' | 'equal' | 'notEqual' | 'larger' | 'largerEqual' | 'isEmpty' | 'isNotEmpty'; /** The value to compare with the first one * @displayOptions.hide { operation: ["isEmpty", "isNotEmpty"] } * @default 0 */ value2?: number | Expression<number>; }>; /** String */ string?: Array<{ /** The value to compare with the second one */ value1?: string | Expression<string> | PlaceholderValue; /** Operation to decide where the data should be mapped to * @default equal */ operation?: 'contains' | 'notContains' | 'endsWith' | 'notEndsWith' | 'equal' | 'notEqual' | 'regex' | 'notRegex' | 'startsWith' | 'notStartsWith' | 'isEmpty' | 'isNotEmpty'; /** The value to compare with the first one * @displayOptions.hide { operation: ["isEmpty", "isNotEmpty", "regex", "notRegex"] } */ value2?: string | Expression<string> | PlaceholderValue; /** The regex which has to match * @displayOptions.show { operation: ["regex", "notRegex"] } */ value2?: string | Expression<string> | PlaceholderValue; }>; }; /** * How to combine the conditions: AND requires all conditions to be true, OR requires at least one condition to be true * @default AND */ combineConditions?: 'AND' | 'OR' | Expression<string>; } interface FilterV1NodeBase { type: 'n8n-nodes-base.filter'; version: 1; } export type FilterV1ParamsNode = FilterV1NodeBase & { config: NodeConfig<FilterV1Params>; }; export type FilterV1Node = FilterV1ParamsNode;