refactor: Migrate NodeConnectionType to const object type (no-changelog) (#14078)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Alex Grozav
2025-03-21 14:01:26 +02:00
committed by GitHub
parent 7e8179b848
commit 8215e0b59f
703 changed files with 3104 additions and 3018 deletions

View File

@@ -3,7 +3,8 @@ import { DateTime, Duration, Interval } from 'luxon';
import { ensureError } from '@/errors/ensure-error';
import { ExpressionError } from '@/errors/expression.error';
import {
NodeConnectionType,
NodeConnectionTypes,
type NodeConnectionType,
type IExecuteData,
type INode,
type IPinData,
@@ -38,7 +39,7 @@ const getProxyFromFixture = (
) => {
const taskData = run?.data.resultData.runData[activeNode]?.[opts?.runIndex ?? 0];
const lastNodeConnectionInputData =
taskData?.data?.[opts?.connectionType ?? NodeConnectionType.Main]?.[0];
taskData?.data?.[opts?.connectionType ?? NodeConnectionTypes.Main]?.[0];
let executeData: IExecuteData | undefined;
@@ -47,7 +48,7 @@ const getProxyFromFixture = (
data: taskData.data!,
node: workflow.nodes.find((node) => node.name === activeNode) as INode,
source: {
[opts?.connectionType ?? NodeConnectionType.Main]: taskData.source,
[opts?.connectionType ?? NodeConnectionTypes.Main]: taskData.source,
},
};
}
@@ -519,7 +520,7 @@ describe('WorkflowDataProxy', () => {
const fixture = loadFixture('from_ai_multiple_items');
const getFromAIProxy = (runIndex = 0) =>
getProxyFromFixture(fixture.workflow, fixture.run, 'Google Sheets1', 'manual', {
connectionType: NodeConnectionType.AiTool,
connectionType: NodeConnectionTypes.AiTool,
throwOnMissingExecutionData: false,
runIndex,
});
@@ -555,7 +556,7 @@ describe('WorkflowDataProxy', () => {
describe('$rawParameter', () => {
const fixture = loadFixture('rawParameter');
const proxy = getProxyFromFixture(fixture.workflow, fixture.run, 'Execute Workflow', 'manual', {
connectionType: NodeConnectionType.Main,
connectionType: NodeConnectionTypes.Main,
throwOnMissingExecutionData: false,
runIndex: 0,
});
@@ -582,7 +583,7 @@ describe('WorkflowDataProxy', () => {
'Execute Workflow',
'manual',
{
connectionType: NodeConnectionType.Main,
connectionType: NodeConnectionTypes.Main,
throwOnMissingExecutionData: false,
runIndex: 0,
},