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:
@ -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;
|
||||
};
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
type WorkflowError = {
|
||||
errorType: string;
|
||||
errorMessage: string;
|
||||
stackTrace: string;
|
||||
};
|
||||
|
||||
export type WorkflowResult = {
|
||||
data: object | null;
|
||||
error?: WorkflowError;
|
||||
};
|
||||
@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user