Reorganize logic function files (#17766)

reorganize according to

<img width="1243" height="725" alt="Pasted Graphic"
src="https://github.com/user-attachments/assets/ba65dd10-8eec-4b13-ad49-9726edd3b79c"
/>

Not working yet
This commit is contained in:
martmull
2026-02-09 12:36:39 +01:00
committed by GitHub
parent bf4c348c8b
commit 9162685b2e
149 changed files with 1715 additions and 5272 deletions
@@ -1,10 +1,10 @@
import { Module } from '@nestjs/common';
import { LogicFunctionExecutorModule } from 'src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.module';
import { LogicFunctionModule } from 'src/engine/core-modules/logic-function/logic-function.module';
import { CodeWorkflowAction } from 'src/modules/workflow/workflow-executor/workflow-actions/code/code.workflow-action';
@Module({
imports: [LogicFunctionExecutorModule],
imports: [LogicFunctionModule],
providers: [CodeWorkflowAction],
exports: [CodeWorkflowAction],
})
@@ -4,7 +4,6 @@ import { resolveInput } from 'twenty-shared/utils';
import { type WorkflowAction } from 'src/modules/workflow/workflow-executor/interfaces/workflow-action.interface';
import { LogicFunctionExecutorService } from 'src/engine/core-modules/logic-function/logic-function-executor/services/logic-function-executor.service';
import {
WorkflowStepExecutorException,
WorkflowStepExecutorExceptionCode,
@@ -14,6 +13,7 @@ import { type WorkflowActionOutput } from 'src/modules/workflow/workflow-executo
import { findStepOrThrow } from 'src/modules/workflow/workflow-executor/utils/find-step-or-throw.util';
import { isWorkflowCodeAction } from 'src/modules/workflow/workflow-executor/workflow-actions/code/guards/is-workflow-code-action.guard';
import { type WorkflowCodeActionInput } from 'src/modules/workflow/workflow-executor/workflow-actions/code/types/workflow-code-action-input.type';
import { LogicFunctionExecutorService } from 'src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service';
@Injectable()
export class CodeWorkflowAction implements WorkflowAction {
@@ -47,12 +47,11 @@ export class CodeWorkflowAction implements WorkflowAction {
try {
const { workspaceId } = runInfo;
const result =
await this.logicFunctionExecutorService.executeOneLogicFunction({
id: workflowActionInput.logicFunctionId,
workspaceId,
payload: workflowActionInput.logicFunctionInput,
});
const result = await this.logicFunctionExecutorService.execute({
logicFunctionId: workflowActionInput.logicFunctionId,
workspaceId,
payload: workflowActionInput.logicFunctionInput,
});
if (result.error) {
return { error: result.error.errorMessage };
@@ -1,14 +1,10 @@
import { Module } from '@nestjs/common';
import { LogicFunctionExecutorModule } from 'src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.module';
import { WorkspaceManyOrAllFlatEntityMapsCacheModule } from 'src/engine/metadata-modules/flat-entity/services/workspace-many-or-all-flat-entity-maps-cache.module';
import { LogicFunctionWorkflowAction } from 'src/modules/workflow/workflow-executor/workflow-actions/logic-function/logic-function.workflow-action';
@Module({
imports: [
LogicFunctionExecutorModule,
WorkspaceManyOrAllFlatEntityMapsCacheModule,
],
imports: [WorkspaceManyOrAllFlatEntityMapsCacheModule],
providers: [LogicFunctionWorkflowAction],
exports: [LogicFunctionWorkflowAction],
})
@@ -4,7 +4,6 @@ import { resolveInput } from 'twenty-shared/utils';
import { type WorkflowAction } from 'src/modules/workflow/workflow-executor/interfaces/workflow-action.interface';
import { LogicFunctionExecutorService } from 'src/engine/core-modules/logic-function/logic-function-executor/services/logic-function-executor.service';
import { findFlatEntityByIdInFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps.util';
import { WorkspaceManyOrAllFlatEntityMapsCacheService } from 'src/engine/metadata-modules/flat-entity/services/workspace-many-or-all-flat-entity-maps-cache.service';
import {
@@ -16,6 +15,7 @@ import { type WorkflowActionOutput } from 'src/modules/workflow/workflow-executo
import { findStepOrThrow } from 'src/modules/workflow/workflow-executor/utils/find-step-or-throw.util';
import { isWorkflowLogicFunctionAction } from 'src/modules/workflow/workflow-executor/workflow-actions/logic-function/guards/is-workflow-logic-function-action.guard';
import { WorkflowLogicFunctionActionInput } from 'src/modules/workflow/workflow-executor/workflow-actions/logic-function/types/workflow-logic-function-action-input.type';
import { LogicFunctionExecutorService } from 'src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service';
@Injectable()
export class LogicFunctionWorkflowAction implements WorkflowAction {
@@ -70,12 +70,11 @@ export class LogicFunctionWorkflowAction implements WorkflowAction {
);
}
const result =
await this.logicFunctionExecutorService.executeOneLogicFunction({
id: workflowActionInput.logicFunctionId,
workspaceId,
payload: workflowActionInput.logicFunctionInput,
});
const result = await this.logicFunctionExecutorService.execute({
logicFunctionId: workflowActionInput.logicFunctionId,
workspaceId,
payload: workflowActionInput.logicFunctionInput,
});
if (result.error) {
return { error: result.error.errorMessage };