n8n
Version:
n8n Workflow Automation Tool
31 lines (30 loc) • 2.05 kB
TypeScript
import { Logger } from 'n8n-core';
import type { IHttpRequestMethods, INode, IRunExecutionData, IWebhookData, IWebhookResponseData, IWorkflowExecuteAdditionalData, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow';
import type { WebhookEntity } from '../databases/entities/webhook-entity';
import { WebhookRepository } from '../databases/repositories/webhook.repository';
import { NodeTypes } from '../node-types';
import { CacheService } from '../services/cache/cache.service';
type Method = NonNullable<IHttpRequestMethods>;
export declare class WebhookService {
private readonly logger;
private readonly webhookRepository;
private readonly cacheService;
private readonly nodeTypes;
constructor(logger: Logger, webhookRepository: WebhookRepository, cacheService: CacheService, nodeTypes: NodeTypes);
populateCache(): Promise<void>;
private findCached;
private findStaticWebhook;
private findDynamicWebhook;
findWebhook(method: Method, path: string): Promise<WebhookEntity | null>;
storeWebhook(webhook: WebhookEntity): Promise<void>;
createWebhook(data: Partial<WebhookEntity>): WebhookEntity;
deleteWorkflowWebhooks(workflowId: string): Promise<WebhookEntity[]>;
private deleteWebhooks;
getWebhookMethods(path: string): Promise<IHttpRequestMethods[]>;
getNodeWebhooks(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, ignoreRestartWebhooks?: boolean): IWebhookData[];
createWebhookIfNotExists(workflow: Workflow, webhookData: IWebhookData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): Promise<void>;
deleteWebhook(workflow: Workflow, webhookData: IWebhookData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): Promise<void>;
private runWebhookMethod;
runWebhook(workflow: Workflow, webhookData: IWebhookData, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, runExecutionData: IRunExecutionData | null): Promise<IWebhookResponseData>;
}
export {};