mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-03 02:07:06 +02:00
19 lines
485 B
TypeScript
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);
|
|
};
|