mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Consolidate execution lifecycle hooks even more + additional tests (#12898)
This commit is contained in:
committed by
GitHub
parent
9bcbc2c2cc
commit
65ec6ae0c8
@@ -2284,7 +2284,7 @@ export interface IWorkflowExecutionDataProcess {
|
||||
executionData?: IRunExecutionData;
|
||||
runData?: IRunData;
|
||||
pinData?: IPinData;
|
||||
retryOf?: string;
|
||||
retryOf?: string | null;
|
||||
pushRef?: string;
|
||||
startNodes?: StartNodeData[];
|
||||
workflowData: IWorkflowBase;
|
||||
@@ -2407,11 +2407,6 @@ export type WorkflowActivateMode =
|
||||
| 'manual' // unused
|
||||
| 'leadershipChange';
|
||||
|
||||
export interface IWorkflowHooksOptionalParameters {
|
||||
retryOf?: string;
|
||||
pushRef?: string;
|
||||
}
|
||||
|
||||
export namespace WorkflowSettings {
|
||||
export type CallerPolicy = 'any' | 'none' | 'workflowsFromAList' | 'workflowsFromSameOwner';
|
||||
export type SaveDataExecution = 'DEFAULT' | 'all' | 'none';
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import type {
|
||||
IWorkflowBase,
|
||||
IWorkflowExecuteHooks,
|
||||
IWorkflowHooksOptionalParameters,
|
||||
WorkflowExecuteMode,
|
||||
} from './Interfaces';
|
||||
import type { IWorkflowBase, IWorkflowExecuteHooks, WorkflowExecuteMode } from './Interfaces';
|
||||
|
||||
export class WorkflowHooks {
|
||||
mode: WorkflowExecuteMode;
|
||||
@@ -12,10 +7,6 @@ export class WorkflowHooks {
|
||||
|
||||
executionId: string;
|
||||
|
||||
pushRef?: string;
|
||||
|
||||
retryOf?: string;
|
||||
|
||||
hookFunctions: IWorkflowExecuteHooks;
|
||||
|
||||
constructor(
|
||||
@@ -23,18 +14,11 @@ export class WorkflowHooks {
|
||||
mode: WorkflowExecuteMode,
|
||||
executionId: string,
|
||||
workflowData: IWorkflowBase,
|
||||
optionalParameters?: IWorkflowHooksOptionalParameters,
|
||||
) {
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||
optionalParameters = optionalParameters || {};
|
||||
|
||||
this.hookFunctions = hookFunctions;
|
||||
this.mode = mode;
|
||||
this.executionId = executionId;
|
||||
this.workflowData = workflowData;
|
||||
this.pushRef = optionalParameters.pushRef;
|
||||
// retryOf might be `null` from TypeORM
|
||||
this.retryOf = optionalParameters.retryOf ?? undefined;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
Reference in New Issue
Block a user