n8n/packages/frontend/@n8n/rest-api-client/src/api/webhooks.ts

19 lines
485 B
TypeScript

import type { IHttpRequestMethods } from 'n8n-workflow';
import type { IRestApiContext } from '../types';
import { makeRestApiRequest } from '../utils';
type WebhookData = {
workflowId: string;
webhookPath: string;
method: IHttpRequestMethods;
node: string;
};
export const findWebhook = async (
context: IRestApiContext,
data: { path: string; method: string },
): Promise<WebhookData | null> => {
return await makeRestApiRequest(context, 'POST', '/webhooks/find', data);
};