WebhookDispatcher
Defined in: packages/webhook/src/services/webhook.dispatcher.ts:52
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WebhookDispatcher(
config,httpClient?):WebhookDispatcher
Defined in: packages/webhook/src/services/webhook.dispatcher.ts:58
Parameters
Section titled “Parameters”config
Section titled “config”httpClient?
Section titled “httpClient?”Returns
Section titled “Returns”WebhookDispatcher
Methods
Section titled “Methods”dispatch()
Section titled “dispatch()”dispatch(
event,endpoint):Promise<{attempts:object[];completedAt?:Date;createdAt:Date;endpointId:string;eventId:string;eventType?:MESSAGE_SENT|MESSAGE_DELIVERED|MESSAGE_FAILED|MESSAGE_CLICKED|MESSAGE_READ|TEMPLATE_CREATED|TEMPLATE_APPROVED|TEMPLATE_REJECTED|TEMPLATE_UPDATED|TEMPLATE_DELETED|CHANNEL_CREATED|CHANNEL_VERIFIED|SENDER_NUMBER_ADDED|SENDER_NUMBER_VERIFIED|QUOTA_WARNING|QUOTA_EXCEEDED|PROVIDER_ERROR|SYSTEM_MAINTENANCE|ANOMALY_DETECTED|THRESHOLD_EXCEEDED;headers:Record<string,string>;httpMethod:"POST"|"PUT"|"PATCH";id:string;nextRetryAt?:Date;payload:string;status:"failed"|"success"|"pending"|"exhausted";url:string; }>
Defined in: packages/webhook/src/services/webhook.dispatcher.ts:65
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”active
Section titled “active”boolean = ...
createdAt
Section titled “createdAt”Date = ...
description?
Section titled “description?”string = ...
events
Section titled “events”WebhookEventType[] = ...
filters?
Section titled “filters?”{ channelId?: string[]; providerId?: string[]; templateId?: string[]; } = ...
filters.channelId?
Section titled “filters.channelId?”string[] = ...
filters.providerId?
Section titled “filters.providerId?”string[] = ...
filters.templateId?
Section titled “filters.templateId?”string[] = ...
headers?
Section titled “headers?”Record<string, string> = ...
string = ...
lastTriggeredAt?
Section titled “lastTriggeredAt?”Date = ...
string = ...
retryConfig?
Section titled “retryConfig?”{ backoffMultiplier: number; maxRetries: number; retryDelayMs: number; } = ...
retryConfig.backoffMultiplier
Section titled “retryConfig.backoffMultiplier”number = ...
retryConfig.maxRetries
Section titled “retryConfig.maxRetries”number = ...
retryConfig.retryDelayMs
Section titled “retryConfig.retryDelayMs”number = ...
secret?
Section titled “secret?”string = ...
status
Section titled “status”"error" | "active" | "inactive" | "suspended" = ...
updatedAt
Section titled “updatedAt”Date = ...
string = ...
Returns
Section titled “Returns”Promise<{ attempts: object[]; completedAt?: Date; createdAt: Date; endpointId: string; eventId: string; eventType?: MESSAGE_SENT | MESSAGE_DELIVERED | MESSAGE_FAILED | MESSAGE_CLICKED | MESSAGE_READ | TEMPLATE_CREATED | TEMPLATE_APPROVED | TEMPLATE_REJECTED | TEMPLATE_UPDATED | TEMPLATE_DELETED | CHANNEL_CREATED | CHANNEL_VERIFIED | SENDER_NUMBER_ADDED | SENDER_NUMBER_VERIFIED | QUOTA_WARNING | QUOTA_EXCEEDED | PROVIDER_ERROR | SYSTEM_MAINTENANCE | ANOMALY_DETECTED | THRESHOLD_EXCEEDED; headers: Record<string, string>; httpMethod: "POST" | "PUT" | "PATCH"; id: string; nextRetryAt?: Date; payload: string; status: "failed" | "success" | "pending" | "exhausted"; url: string; }>
shutdown()
Section titled “shutdown()”shutdown():
Promise<void>
Defined in: packages/webhook/src/services/webhook.dispatcher.ts:278
Returns
Section titled “Returns”Promise<void>