Cleanup of external hooks

This commit is contained in:
Jan Oberhauser
2020-06-10 13:00:28 +02:00
parent 6e1254fd54
commit 57b3a2e05e
5 changed files with 7 additions and 51 deletions

View File

@@ -6,7 +6,6 @@ import {
import * as config from '../config';
// export EXTERNAL_HOOK_FILES=/data/packages/cli/dist/src/externalHooksTemp/test-hooks.js
class ExternalHooksClass implements IExternalHooksClass {

View File

@@ -34,7 +34,7 @@ import {
IExecutionsListResponse,
IExecutionsStopData,
IExecutionsSummary,
IExternalHooks,
IExternalHooksClass,
IN8nUISettings,
IPackageVersions,
IWorkflowBase,
@@ -94,7 +94,7 @@ class App {
testWebhooks: TestWebhooks.TestWebhooks;
endpointWebhook: string;
endpointWebhookTest: string;
externalHooks: IExternalHooks;
externalHooks: IExternalHooksClass;
saveDataErrorExecution: string;
saveDataSuccessExecution: string;
saveManualExecutions: boolean;

View File

@@ -1,45 +0,0 @@
import {
WorkflowExecuteMode,
} from 'n8n-workflow';
import {
IExternalHooks,
IExternalHooksFunctions,
IWorkflowBase,
IWorkflowDb,
} from '../';
export = {
credentials: {
create: [
async function (this: IExternalHooksFunctions) {
// Here any additional code can run or the creation blocked
// throw new Error('No additional credentials can be created.');
},
],
},
workflow: {
execute: [
async function (this: IExternalHooksFunctions, workflowData: IWorkflowDb, mode: WorkflowExecuteMode) {
console.log('execute: ' + mode);
// if (mode === 'integrated') {
// throw new Error('Workflow can not be executed.');
// }
}
],
update: [
async function (this: IExternalHooksFunctions, workflowData: IWorkflowBase) {
console.log('update workflow hook');
// const responseData = await this.dbCollections.Workflow!.findOne(workflowData.id);
// console.log('workflowData');
// console.log(responseData);
// console.log(workflowData);
// Here any additional code can run or the creation blocked
// throw new Error('Workflow can not be updated.');
},
],
},
} as IExternalHooks;