Skip to content

Commit 2d394ca

Browse files
committed
fix(fathom): add type to nested trigger outputs and fix boolean coercion
- Add type: 'object' to recorded_by and default_summary trigger outputs - Use val === true || val === 'true' pattern for include flag coercion to safely handle both boolean and string values from providerConfig
1 parent 6e2cde7 commit 2d394ca

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

apps/sim/lib/webhooks/provider-subscriptions.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,13 +1399,18 @@ export async function createFathomWebhookSubscription(
13991399

14001400
const triggeredForValue = triggeredFor || 'my_recordings'
14011401

1402+
const toBool = (val: unknown, fallback: boolean): boolean => {
1403+
if (val === undefined) return fallback
1404+
return val === true || val === 'true'
1405+
}
1406+
14021407
const requestBody: Record<string, any> = {
14031408
destination_url: notificationUrl,
14041409
triggered_for: [triggeredForValue],
1405-
include_summary: includeSummary !== undefined ? Boolean(includeSummary) : true,
1406-
include_transcript: includeTranscript !== undefined ? Boolean(includeTranscript) : false,
1407-
include_action_items: includeActionItems !== undefined ? Boolean(includeActionItems) : false,
1408-
include_crm_matches: includeCrmMatches !== undefined ? Boolean(includeCrmMatches) : false,
1410+
include_summary: toBool(includeSummary, true),
1411+
include_transcript: toBool(includeTranscript, false),
1412+
include_action_items: toBool(includeActionItems, false),
1413+
include_crm_matches: toBool(includeCrmMatches, false),
14091414
}
14101415

14111416
fathomLogger.info(`[${requestId}] Creating Fathom webhook`, {

apps/sim/triggers/fathom/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export function buildMeetingOutputs(): Record<string, TriggerOutput> {
8383
description: 'Domain type: only_internal or one_or_more_external',
8484
},
8585
recorded_by: {
86+
type: 'object',
87+
description: 'Recorder details',
8688
name: { type: 'string', description: 'Name of the recorder' },
8789
email: { type: 'string', description: 'Email of the recorder' },
8890
},
@@ -91,6 +93,8 @@ export function buildMeetingOutputs(): Record<string, TriggerOutput> {
9193
description: 'Array of calendar invitees with name and email',
9294
},
9395
default_summary: {
96+
type: 'object',
97+
description: 'Meeting summary',
9498
template_name: { type: 'string', description: 'Summary template name' },
9599
markdown_formatted: { type: 'string', description: 'Markdown-formatted summary' },
96100
},

0 commit comments

Comments
 (0)