n8n-nodes-base
Version:
Base nodes of n8n
96 lines (91 loc) • 4.29 kB
text/typescript
/**
* Remove Duplicates Node - Version 2
* Delete items with matching field values
*/
export interface RemoveDuplicatesV2Params {
operation?: 'removeDuplicateInputItems' | 'removeItemsSeenInPreviousExecutions' | 'clearDeduplicationHistory';
/**
* The fields of the input items to compare to see if they are the same
* @displayOptions.show { operation: ["removeDuplicateInputItems"] }
* @default allFields
*/
compare?: 'allFields' | 'allFieldsExcept' | 'selectedFields' | Expression<string>;
/**
* Fields in the input to exclude from the comparison
* @displayOptions.show { compare: ["allFieldsExcept"] }
*/
fieldsToExclude?: string | Expression<string> | PlaceholderValue;
/**
* Fields in the input to add to the comparison
* @displayOptions.show { compare: ["selectedFields"] }
*/
fieldsToCompare?: string | Expression<string> | PlaceholderValue;
/**
* How to select input items to remove by comparing them with key values previously processed
* @displayOptions.show { operation: ["removeItemsSeenInPreviousExecutions"] }
* @default removeItemsWithAlreadySeenKeyValues
*/
logic?: 'removeItemsWithAlreadySeenKeyValues' | 'removeItemsUpToStoredIncrementalKey' | 'removeItemsUpToStoredDate';
/**
* Use an input field (or a combination of fields) that has a unique ID value
* @hint The input field value to compare between items
* @displayOptions.show { logic: ["removeItemsWithAlreadySeenKeyValues"], /operation: ["removeItemsSeenInPreviousExecutions"] }
*/
dedupeValue?: string | Expression<string> | PlaceholderValue;
/**
* Use an input field (or a combination of fields) that has an incremental value
* @hint The input field value to compare between items, an incremental value is expected
* @displayOptions.show { logic: ["removeItemsUpToStoredIncrementalKey"], /operation: ["removeItemsSeenInPreviousExecutions"] }
*/
incrementalDedupeValue?: number | Expression<number>;
/**
* Use an input field that has a date value in ISO format
* @hint The input field value to compare between items, a date is expected
* @displayOptions.show { logic: ["removeItemsUpToStoredDate"], /operation: ["removeItemsSeenInPreviousExecutions"] }
*/
dateDedupeValue?: string | Expression<string>;
/**
* How you want to modify the key values stored on the database. None of these modes removes input items.
* @displayOptions.show { operation: ["clearDeduplicationHistory"] }
* @default cleanDatabase
*/
mode?: 'cleanDatabase' | Expression<string>;
/**
* Options
* @displayOptions.show { operation: ["removeDuplicateInputItems", "removeItemsSeenInPreviousExecutions", "clearDeduplicationHistory"] }
* @default {}
*/
options?: {
/** Whether to disallow referencing child fields using `parent.child` in the field name
* @displayOptions.show { /operation: ["removeDuplicateInputItems"] }
* @displayOptions.hide { /compare: ["allFields"] }
* @default false
*/
disableDotNotation?: boolean | Expression<boolean>;
/** Whether to remove any fields that are not being compared. If disabled, will keep the values from the first of the duplicates.
* @displayOptions.show { /operation: ["removeDuplicateInputItems"] }
* @displayOptions.hide { /compare: ["allFields"] }
* @default false
*/
removeOtherFields?: boolean | Expression<boolean>;
/** If set to ‘workflow,’ key values will be shared across all nodes in the workflow. If set to ‘node,’ key values will be specific to this node.
* @displayOptions.show { /operation: ["clearDeduplicationHistory", "removeItemsSeenInPreviousExecutions"] }
* @default node
*/
scope?: 'workflow' | 'node' | Expression<string>;
/** History Size
* @hint The max number of past items to store for deduplication
* @displayOptions.show { /logic: ["removeItemsWithAlreadySeenKeyValues"], /operation: ["removeItemsSeenInPreviousExecutions"] }
* @default 10000
*/
historySize?: number | Expression<number>;
};
}
interface RemoveDuplicatesV2NodeBase {
type: 'n8n-nodes-base.removeDuplicates';
version: 2;
}
export type RemoveDuplicatesV2ParamsNode = RemoveDuplicatesV2NodeBase & {
config: NodeConfig<RemoveDuplicatesV2Params>;
};
export type RemoveDuplicatesV2Node = RemoveDuplicatesV2ParamsNode;