n8n-nodes-base
Version:
Base nodes of n8n
71 lines (66 loc) • 2.09 kB
text/typescript
/**
* Set Node - Version 1
* Sets values on items and optionally remove other values
*/
export interface SetV1Params {
/**
* Whether only the values set on this node should be kept and all others removed
* @default false
*/
keepOnlySet?: boolean | Expression<boolean>;
/**
* The value to set
* @default {}
*/
values?: {
/** Boolean
*/
boolean?: Array<{
/** Name of the property to write data to. Supports dot-notation. Example: "data.person[0].name"
* @default propertyName
*/
name?: string | Expression<string> | PlaceholderValue;
/** The boolean value to write in the property
* @default false
*/
value?: boolean | Expression<boolean>;
}>;
/** Number
*/
number?: Array<{
/** Name of the property to write data to. Supports dot-notation. Example: "data.person[0].name"
* @default propertyName
*/
name?: string | Expression<string> | PlaceholderValue;
/** The number value to write in the property
* @default 0
*/
value?: number | Expression<number>;
}>;
/** String
*/
string?: Array<{
/** Name of the property to write data to. Supports dot-notation. Example: "data.person[0].name"
* @default propertyName
*/
name?: string | Expression<string> | PlaceholderValue;
/** The string value to write in the property
*/
value?: string | Expression<string> | PlaceholderValue;
}>;
};
options?: {
/** <p>By default, dot-notation is used in property names. This means that "a.b" will set the property "b" underneath "a" so { "a": { "b": value} }.<p></p>If that is not intended this can be deactivated, it will then set { "a.b": value } instead.</p>.
* @default true
*/
dotNotation?: boolean | Expression<boolean>;
};
}
interface SetV1NodeBase {
type: 'n8n-nodes-base.set';
version: 1;
}
export type SetV1ParamsNode = SetV1NodeBase & {
config: NodeConfig<SetV1Params>;
};
export type SetV1Node = SetV1ParamsNode;