mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-16 01:24:05 -08:00
9c94050deb
* refactor: replace Vue.extend with defineComponent in editor-ui * fix: change $externalHooks extractions from mixins * fix: refactor externalHooks mixin
13 lines
409 B
TypeScript
13 lines
409 B
TypeScript
import type { IExternalHooks } from '@/Interface';
|
|
import type { IDataObject } from 'n8n-workflow';
|
|
import { useWebhooksStore } from '@/stores';
|
|
import { runExternalHook } from '@/utils';
|
|
|
|
export function useExternalHooks(): IExternalHooks {
|
|
return {
|
|
async run(eventName: string, metadata?: IDataObject): Promise<void> {
|
|
return await runExternalHook(eventName, useWebhooksStore(), metadata);
|
|
},
|
|
};
|
|
}
|