UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

67 lines (62 loc) 1.91 kB
/** * Rename Keys Node - Version 1 * Update item field names */ export interface RenameKeysV1Params { /** * Adds a key which should be renamed * @default {} */ keys?: { /** Key */ key?: Array<{ /** The current name of the key. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.currentKey". */ currentKey?: string | Expression<string> | PlaceholderValue; /** The name the key should be renamed to. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.newKey". */ newKey?: string | Expression<string> | PlaceholderValue; }>; }; additionalOptions?: { /** Adds a regular expression * @default {} */ regexReplacement?: { /** Replacement */ replacements?: Array<{ /** Regex to match the key name * @hint Learn more and test RegEx &lt;a href="https://regex101.com/"&gt;here&lt;/a&gt; */ searchRegex?: string | Expression<string> | PlaceholderValue; /** The name the key/s should be renamed to. It's possible to use regex captures e.g. $1, $2, ... */ replaceRegex?: string | Expression<string> | PlaceholderValue; /** Options * @default {} */ options?: { /** Whether to use case insensitive match * @default false */ caseInsensitive?: boolean | Expression<boolean>; /** Maximum depth to replace keys * @hint Specify number for depth level (-1 for unlimited, 0 for top level only) * @default -1 */ depth?: number | Expression<number>; }; }>; }; }; } interface RenameKeysV1NodeBase { type: 'n8n-nodes-base.renameKeys'; version: 1; } export type RenameKeysV1ParamsNode = RenameKeysV1NodeBase & { config: NodeConfig<RenameKeysV1Params>; }; export type RenameKeysV1Node = RenameKeysV1ParamsNode;