feat(core): Node hints(warnings) system (#8954)
This commit is contained in:
@@ -392,7 +392,7 @@ export interface IGetExecuteTriggerFunctions {
|
||||
}
|
||||
|
||||
export interface IRunNodeResponse {
|
||||
data: INodeExecutionData[][] | null | undefined;
|
||||
data: INodeExecutionData[][] | NodeExecutionOutput | null | undefined;
|
||||
closeFunction?: CloseFunction;
|
||||
}
|
||||
export interface IGetExecuteFunctions {
|
||||
@@ -1423,6 +1423,20 @@ export interface SupplyData {
|
||||
closeFunction?: CloseFunction;
|
||||
}
|
||||
|
||||
export class NodeExecutionOutput extends Array {
|
||||
private hints: NodeExecutionHint[];
|
||||
|
||||
constructor(data: INodeExecutionData[][], hints: NodeExecutionHint[] = []) {
|
||||
super();
|
||||
this.push(...data);
|
||||
this.hints = hints;
|
||||
}
|
||||
|
||||
public getHints(): NodeExecutionHint[] {
|
||||
return this.hints;
|
||||
}
|
||||
}
|
||||
|
||||
export interface INodeType {
|
||||
description: INodeTypeDescription;
|
||||
supplyData?(this: IAllExecuteFunctions, itemIndex: number): Promise<SupplyData>;
|
||||
@@ -1745,9 +1759,20 @@ export interface INodeTypeDescription extends INodeTypeBaseDescription {
|
||||
}
|
||||
| boolean;
|
||||
extendsCredential?: string;
|
||||
hints?: NodeHint[];
|
||||
__loadOptionsMethods?: string[]; // only for validation during build
|
||||
}
|
||||
|
||||
export type NodeHint = {
|
||||
message: string;
|
||||
type?: 'info' | 'warning' | 'danger';
|
||||
location?: 'outputPane' | 'inputPane' | 'ndv';
|
||||
displayCondition?: string;
|
||||
whenToDisplay?: 'always' | 'beforeExecution' | 'afterExecution';
|
||||
};
|
||||
|
||||
export type NodeExecutionHint = Omit<NodeHint, 'whenToDisplay' | 'displayCondition'>;
|
||||
|
||||
export interface INodeHookDescription {
|
||||
method: string;
|
||||
}
|
||||
@@ -1929,6 +1954,7 @@ export interface ITaskData {
|
||||
data?: ITaskDataConnections;
|
||||
inputOverride?: ITaskDataConnections;
|
||||
error?: ExecutionError;
|
||||
hints?: NodeExecutionHint[];
|
||||
source: Array<ISourceData | null>; // Is an array as nodes have multiple inputs
|
||||
metadata?: ITaskMetadata;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user