refactor(core): Make external hooks type-safe, and add tests (#12893)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-01-29 10:33:39 +01:00
committed by GitHub
parent 3d27a14987
commit 05b5f95331
17 changed files with 289 additions and 150 deletions

View File

@@ -436,22 +436,13 @@ function hookFunctionsSaveWorker(): IWorkflowExecuteHooks {
},
async function (this: WorkflowHooks, fullRunData: IRun) {
const externalHooks = Container.get(ExternalHooks);
if (externalHooks.exists('workflow.postExecute')) {
try {
await externalHooks.run('workflow.postExecute', [
fullRunData,
this.workflowData,
this.executionId,
]);
} catch (error) {
Container.get(ErrorReporter).error(error);
Container.get(Logger).error(
'There was a problem running hook "workflow.postExecute"',
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
error,
);
}
}
try {
await externalHooks.run('workflow.postExecute', [
fullRunData,
this.workflowData,
this.executionId,
]);
} catch {}
},
],
nodeFetchedData: [