Improve typing definition (#6481)

- added typing for workflow-runner results
- fix workflow typing
- add a `workflow-action-runner` submodule that contains factories for
action runners
- added code-action-runner
- simplified code
This commit is contained in:
martmull
2024-08-01 11:38:31 +02:00
committed by GitHub
parent 0f69106558
commit ae423f5e75
9 changed files with 151 additions and 65 deletions

View File

@ -1,14 +1,20 @@
import { WorkflowSettingsType } from 'src/modules/workflow/common/types/workflow-settings.type';
import { WorkflowCodeSettingsType } from 'src/modules/workflow/common/types/workflow-settings.type';
export enum WorkflowActionType {
CODE = 'CODE',
}
export type WorkflowAction = {
type CommonWorkflowAction = {
name: string;
displayName: string;
type: WorkflowActionType;
valid: boolean;
settings: WorkflowSettingsType;
nextAction?: WorkflowAction;
};
type WorkflowCodeAction = CommonWorkflowAction & {
type: WorkflowActionType.CODE;
settings: WorkflowCodeSettingsType;
};
export type WorkflowAction = WorkflowCodeAction & {
nextAction: WorkflowAction;
};

View File

@ -0,0 +1,10 @@
type WorkflowError = {
errorType: string;
errorMessage: string;
stackTrace: string;
};
export type WorkflowResult = {
data: object | null;
error?: WorkflowError;
};

View File

@ -1,8 +1,4 @@
export type WorkflowCodeSettingsType = {
serverlessFunctionId: string;
};
export type WorkflowSettingsType = {
type WorkflowBaseSettingsType = {
errorHandlingOptions: {
retryOnFailure: {
value: boolean;
@ -11,4 +7,8 @@ export type WorkflowSettingsType = {
value: boolean;
};
};
} & WorkflowCodeSettingsType;
};
export type WorkflowCodeSettingsType = WorkflowBaseSettingsType & {
serverlessFunctionId: string;
};