refactor: Use NodeConnectionType consistently across the code base (no-changelog) (#10595)

This commit is contained in:
Ricardo Espinoza
2024-08-29 09:55:53 -04:00
committed by GitHub
parent 1491cbd228
commit c4eb3746d7
521 changed files with 2259 additions and 1999 deletions

View File

@@ -910,7 +910,7 @@ export type IExecuteFunctions = ExecuteFunctions.GetNodeParameterFn &
parentCallbackManager?: CallbackManager,
): Promise<any>;
getInputConnectionData(
inputName: ConnectionTypes,
inputName: NodeConnectionType,
itemIndex: number,
inputIndex?: number,
): Promise<unknown>;
@@ -923,12 +923,12 @@ export type IExecuteFunctions = ExecuteFunctions.GetNodeParameterFn &
// TODO: Make this one then only available in the new config one
addInputData(
connectionType: ConnectionTypes,
connectionType: NodeConnectionType,
data: INodeExecutionData[][] | ExecutionError,
runIndex?: number,
): { index: number };
addOutputData(
connectionType: ConnectionTypes,
connectionType: NodeConnectionType,
currentNodeRunIndex: number,
data: INodeExecutionData[][] | ExecutionError,
): void;
@@ -1049,7 +1049,7 @@ export interface IWebhookFunctions extends FunctionsBaseWithRequiredKeys<'getMod
getBodyData(): IDataObject;
getHeaderData(): IncomingHttpHeaders;
getInputConnectionData(
inputName: ConnectionTypes,
inputName: NodeConnectionType,
itemIndex: number,
inputIndex?: number,
): Promise<unknown>;
@@ -1758,21 +1758,6 @@ export interface IPostReceiveSort extends IPostReceiveBase {
};
}
export type ConnectionTypes =
| 'ai_agent'
| 'ai_chain'
| 'ai_document'
| 'ai_embedding'
| 'ai_languageModel'
| 'ai_memory'
| 'ai_outputParser'
| 'ai_retriever'
| 'ai_textSplitter'
| 'ai_tool'
| 'ai_vectorRetriever'
| 'ai_vectorStore'
| 'main';
export const enum NodeConnectionType {
AiAgent = 'ai_agent',
@@ -1825,7 +1810,7 @@ export interface INodeInputConfiguration {
category?: string;
displayName?: string;
required?: boolean;
type: ConnectionTypes;
type: NodeConnectionType;
filter?: INodeInputFilter;
maxConnections?: number;
}
@@ -1835,7 +1820,7 @@ export interface INodeOutputConfiguration {
displayName?: string;
maxConnections?: number;
required?: boolean;
type: ConnectionTypes;
type: NodeConnectionType;
}
export type ExpressionString = `={{${string}}}`;
@@ -1853,10 +1838,10 @@ export interface INodeTypeDescription extends INodeTypeBaseDescription {
defaults: NodeDefaults;
eventTriggerDescription?: string;
activationMessage?: string;
inputs: Array<ConnectionTypes | INodeInputConfiguration> | ExpressionString;
inputs: Array<NodeConnectionType | INodeInputConfiguration> | ExpressionString;
requiredInputs?: string | number[] | number; // Ony available with executionOrder => "v1"
inputNames?: string[];
outputs: Array<ConnectionTypes | INodeOutputConfiguration> | ExpressionString;
outputs: Array<NodeConnectionType | INodeOutputConfiguration> | ExpressionString;
outputNames?: string[];
properties: INodeProperties[];
credentials?: INodeCredentialDescription[];