Skip to content

Commit a7e661a

Browse files
committed
fix(sendblue): keep is_outbound routing map local to the webhook handler
Avoids a webhook-providers -> triggers cross-subgraph import (single source of truth in the handler, its only runtime consumer).
1 parent c59f868 commit a7e661a

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

apps/sim/lib/webhooks/providers/sendblue.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@ import type {
66
FormatInputResult,
77
WebhookProviderHandler,
88
} from '@/lib/webhooks/providers/types'
9-
import { SENDBLUE_TRIGGER_IS_OUTBOUND } from '@/triggers/sendblue/utils'
109

1110
const logger = createLogger('WebhookProvider:Sendblue')
1211

12+
/**
13+
* Maps Sendblue trigger IDs to the expected value of the webhook payload's
14+
* `is_outbound` flag, used to route inbound vs. outbound status events.
15+
* The handler is the only runtime consumer, so the map lives here (single
16+
* source of truth) rather than crossing from the triggers graph into the
17+
* webhook-providers graph.
18+
*/
19+
const SENDBLUE_TRIGGER_IS_OUTBOUND: Record<string, boolean> = {
20+
sendblue_message_received: false,
21+
sendblue_message_status_updated: true,
22+
}
23+
1324
export const sendblueHandler: WebhookProviderHandler = {
1425
matchEvent({ body, webhook, requestId }: EventMatchContext): boolean {
1526
const providerConfig = getProviderConfig(webhook)

apps/sim/triggers/sendblue/utils.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
import type { TriggerOutput } from '@/triggers/types'
22

3-
/**
4-
* Maps Sendblue trigger IDs to the expected value of the webhook payload's
5-
* `is_outbound` flag, used to route inbound vs. outbound status events.
6-
* Imported by the webhook provider handler so routing lives in one place.
7-
*/
8-
export const SENDBLUE_TRIGGER_IS_OUTBOUND: Record<string, boolean> = {
9-
sendblue_message_received: false,
10-
sendblue_message_status_updated: true,
11-
}
12-
133
export const sendblueTriggerOptions = [
144
{ label: 'Message Received', id: 'sendblue_message_received' },
155
{ label: 'Message Status Updated', id: 'sendblue_message_status_updated' },

0 commit comments

Comments
 (0)