@contractspec/integration.providers-impls 1.56.1 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -1
- package/dist/analytics.d.ts +2 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +3 -0
- package/dist/calendar.d.ts +1 -7
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +3 -3
- package/dist/database.d.ts +2 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +3 -0
- package/dist/email.d.ts +1 -7
- package/dist/email.d.ts.map +1 -1
- package/dist/email.js +3 -3
- package/dist/embedding.d.ts +1 -7
- package/dist/embedding.d.ts.map +1 -1
- package/dist/embedding.js +3 -3
- package/dist/impls/elevenlabs-voice.d.ts +14 -18
- package/dist/impls/elevenlabs-voice.d.ts.map +1 -1
- package/dist/impls/elevenlabs-voice.js +98 -88
- package/dist/impls/fal-voice.d.ts +25 -0
- package/dist/impls/fal-voice.d.ts.map +1 -0
- package/dist/impls/fal-voice.js +113 -0
- package/dist/impls/fathom-meeting-recorder.d.ts +38 -0
- package/dist/impls/fathom-meeting-recorder.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.js +288 -0
- package/dist/impls/fathom-meeting-recorder.mapper.d.ts +5 -0
- package/dist/impls/fathom-meeting-recorder.mapper.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.mapper.js +106 -0
- package/dist/impls/fathom-meeting-recorder.types.d.ts +20 -0
- package/dist/impls/fathom-meeting-recorder.types.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.types.js +1 -0
- package/dist/impls/fathom-meeting-recorder.utils.d.ts +11 -0
- package/dist/impls/fathom-meeting-recorder.utils.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.utils.js +73 -0
- package/dist/impls/fathom-meeting-recorder.webhooks.d.ts +4 -0
- package/dist/impls/fathom-meeting-recorder.webhooks.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.webhooks.js +30 -0
- package/dist/impls/fireflies-meeting-recorder.d.ts +24 -0
- package/dist/impls/fireflies-meeting-recorder.d.ts.map +1 -0
- package/dist/impls/fireflies-meeting-recorder.js +275 -0
- package/dist/impls/fireflies-meeting-recorder.queries.d.ts +4 -0
- package/dist/impls/fireflies-meeting-recorder.queries.d.ts.map +1 -0
- package/dist/impls/fireflies-meeting-recorder.queries.js +86 -0
- package/dist/impls/fireflies-meeting-recorder.types.d.ts +32 -0
- package/dist/impls/fireflies-meeting-recorder.types.d.ts.map +1 -0
- package/dist/impls/fireflies-meeting-recorder.types.js +1 -0
- package/dist/impls/fireflies-meeting-recorder.utils.d.ts +5 -0
- package/dist/impls/fireflies-meeting-recorder.utils.d.ts.map +1 -0
- package/dist/impls/fireflies-meeting-recorder.utils.js +43 -0
- package/dist/impls/gcs-storage.d.ts +18 -22
- package/dist/impls/gcs-storage.d.ts.map +1 -1
- package/dist/impls/gcs-storage.js +92 -84
- package/dist/impls/gmail-inbound.d.ts +20 -24
- package/dist/impls/gmail-inbound.d.ts.map +1 -1
- package/dist/impls/gmail-inbound.js +212 -185
- package/dist/impls/gmail-outbound.d.ts +12 -16
- package/dist/impls/gmail-outbound.d.ts.map +1 -1
- package/dist/impls/gmail-outbound.js +126 -92
- package/dist/impls/google-calendar.d.ts +17 -21
- package/dist/impls/google-calendar.d.ts.map +1 -1
- package/dist/impls/google-calendar.js +182 -145
- package/dist/impls/gradium-voice.d.ts +24 -0
- package/dist/impls/gradium-voice.d.ts.map +1 -0
- package/dist/impls/gradium-voice.js +91 -0
- package/dist/impls/granola-meeting-recorder.d.ts +34 -0
- package/dist/impls/granola-meeting-recorder.d.ts.map +1 -0
- package/dist/impls/granola-meeting-recorder.js +513 -0
- package/dist/impls/granola-meeting-recorder.mcp.d.ts +25 -0
- package/dist/impls/granola-meeting-recorder.mcp.d.ts.map +1 -0
- package/dist/impls/granola-meeting-recorder.mcp.js +279 -0
- package/dist/impls/granola-meeting-recorder.types.d.ts +61 -0
- package/dist/impls/granola-meeting-recorder.types.d.ts.map +1 -0
- package/dist/impls/granola-meeting-recorder.types.js +1 -0
- package/dist/impls/index.d.ts +28 -15
- package/dist/impls/index.d.ts.map +1 -0
- package/dist/impls/index.js +4659 -16
- package/dist/impls/jira.d.ts +21 -0
- package/dist/impls/jira.d.ts.map +1 -0
- package/dist/impls/jira.js +125 -0
- package/dist/impls/linear.d.ts +20 -0
- package/dist/impls/linear.d.ts.map +1 -0
- package/dist/impls/linear.js +84 -0
- package/dist/impls/mistral-embedding.d.ts +17 -21
- package/dist/impls/mistral-embedding.d.ts.map +1 -1
- package/dist/impls/mistral-embedding.js +41 -39
- package/dist/impls/mistral-llm.d.ts +25 -29
- package/dist/impls/mistral-llm.d.ts.map +1 -1
- package/dist/impls/mistral-llm.js +266 -244
- package/dist/impls/notion.d.ts +23 -0
- package/dist/impls/notion.d.ts.map +1 -0
- package/dist/impls/notion.js +161 -0
- package/dist/impls/posthog-reader.d.ts +22 -0
- package/dist/impls/posthog-reader.d.ts.map +1 -0
- package/dist/impls/posthog-reader.js +160 -0
- package/dist/impls/posthog-utils.d.ts +5 -0
- package/dist/impls/posthog-utils.d.ts.map +1 -0
- package/dist/impls/posthog-utils.js +39 -0
- package/dist/impls/posthog.d.ts +36 -0
- package/dist/impls/posthog.d.ts.map +1 -0
- package/dist/impls/posthog.js +323 -0
- package/dist/impls/postmark-email.d.ts +13 -17
- package/dist/impls/postmark-email.d.ts.map +1 -1
- package/dist/impls/postmark-email.js +55 -50
- package/dist/impls/powens-client.d.ts +111 -114
- package/dist/impls/powens-client.d.ts.map +1 -1
- package/dist/impls/powens-client.js +194 -170
- package/dist/impls/powens-openbanking.d.ts +22 -26
- package/dist/impls/powens-openbanking.d.ts.map +1 -1
- package/dist/impls/powens-openbanking.js +425 -217
- package/dist/impls/provider-factory.d.ts +29 -25
- package/dist/impls/provider-factory.d.ts.map +1 -1
- package/dist/impls/provider-factory.js +4074 -136
- package/dist/impls/qdrant-vector.d.ts +18 -22
- package/dist/impls/qdrant-vector.d.ts.map +1 -1
- package/dist/impls/qdrant-vector.js +76 -69
- package/dist/impls/stripe-payments.d.ts +22 -26
- package/dist/impls/stripe-payments.d.ts.map +1 -1
- package/dist/impls/stripe-payments.js +219 -193
- package/dist/impls/supabase-psql.d.ts +24 -0
- package/dist/impls/supabase-psql.d.ts.map +1 -0
- package/dist/impls/supabase-psql.js +151 -0
- package/dist/impls/supabase-vector.d.ts +32 -0
- package/dist/impls/supabase-vector.d.ts.map +1 -0
- package/dist/impls/supabase-vector.js +324 -0
- package/dist/impls/tldv-meeting-recorder.d.ts +21 -0
- package/dist/impls/tldv-meeting-recorder.d.ts.map +1 -0
- package/dist/impls/tldv-meeting-recorder.js +146 -0
- package/dist/impls/twilio-sms.d.ts +14 -17
- package/dist/impls/twilio-sms.d.ts.map +1 -1
- package/dist/impls/twilio-sms.js +62 -55
- package/dist/index.d.ts +15 -43
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4700 -69
- package/dist/llm.d.ts +1 -7
- package/dist/llm.d.ts.map +1 -1
- package/dist/llm.js +3 -3
- package/dist/meeting-recorder.d.ts +2 -0
- package/dist/meeting-recorder.d.ts.map +1 -0
- package/dist/meeting-recorder.js +3 -0
- package/dist/node/analytics.js +2 -0
- package/dist/node/calendar.js +2 -0
- package/dist/node/database.js +2 -0
- package/dist/node/email.js +2 -0
- package/dist/node/embedding.js +2 -0
- package/dist/node/impls/elevenlabs-voice.js +102 -0
- package/dist/node/impls/fal-voice.js +112 -0
- package/dist/node/impls/fathom-meeting-recorder.js +287 -0
- package/dist/node/impls/fathom-meeting-recorder.mapper.js +105 -0
- package/dist/node/impls/fathom-meeting-recorder.types.js +0 -0
- package/dist/node/impls/fathom-meeting-recorder.utils.js +72 -0
- package/dist/node/impls/fathom-meeting-recorder.webhooks.js +29 -0
- package/dist/node/impls/fireflies-meeting-recorder.js +274 -0
- package/dist/node/impls/fireflies-meeting-recorder.queries.js +85 -0
- package/dist/node/impls/fireflies-meeting-recorder.types.js +0 -0
- package/dist/node/impls/fireflies-meeting-recorder.utils.js +42 -0
- package/dist/node/impls/gcs-storage.js +97 -0
- package/dist/node/impls/gmail-inbound.js +227 -0
- package/dist/node/impls/gmail-outbound.js +139 -0
- package/dist/node/impls/google-calendar.js +191 -0
- package/dist/node/impls/gradium-voice.js +90 -0
- package/dist/node/impls/granola-meeting-recorder.js +512 -0
- package/dist/node/impls/granola-meeting-recorder.mcp.js +278 -0
- package/dist/node/impls/granola-meeting-recorder.types.js +0 -0
- package/dist/node/impls/index.js +4658 -0
- package/dist/node/impls/jira.js +124 -0
- package/dist/node/impls/linear.js +83 -0
- package/dist/node/impls/mistral-embedding.js +43 -0
- package/dist/node/impls/mistral-llm.js +269 -0
- package/dist/node/impls/notion.js +160 -0
- package/dist/node/impls/posthog-reader.js +159 -0
- package/dist/node/impls/posthog-utils.js +38 -0
- package/dist/node/impls/posthog.js +322 -0
- package/dist/node/impls/postmark-email.js +60 -0
- package/dist/node/impls/powens-client.js +195 -0
- package/dist/node/impls/powens-openbanking.js +426 -0
- package/dist/node/impls/provider-factory.js +4080 -0
- package/dist/node/impls/qdrant-vector.js +78 -0
- package/dist/node/impls/stripe-payments.js +228 -0
- package/dist/node/impls/supabase-psql.js +150 -0
- package/dist/node/impls/supabase-vector.js +323 -0
- package/dist/node/impls/tldv-meeting-recorder.js +145 -0
- package/dist/node/impls/twilio-sms.js +65 -0
- package/dist/node/index.js +4699 -0
- package/dist/node/llm.js +2 -0
- package/dist/node/meeting-recorder.js +2 -0
- package/dist/node/openbanking.js +2 -0
- package/dist/node/payments.js +2 -0
- package/dist/node/project-management.js +2 -0
- package/dist/node/runtime.js +0 -0
- package/dist/node/secrets/provider.js +11 -0
- package/dist/node/sms.js +2 -0
- package/dist/node/storage.js +2 -0
- package/dist/node/vector-store.js +2 -0
- package/dist/node/voice.js +2 -0
- package/dist/openbanking.d.ts +1 -7
- package/dist/openbanking.d.ts.map +1 -1
- package/dist/openbanking.js +3 -3
- package/dist/payments.d.ts +1 -7
- package/dist/payments.d.ts.map +1 -1
- package/dist/payments.js +3 -3
- package/dist/project-management.d.ts +2 -0
- package/dist/project-management.d.ts.map +1 -0
- package/dist/project-management.js +3 -0
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/secrets/provider.d.ts +3 -2
- package/dist/secrets/provider.d.ts.map +1 -0
- package/dist/secrets/provider.js +12 -3
- package/dist/sms.d.ts +1 -7
- package/dist/sms.d.ts.map +1 -1
- package/dist/sms.js +3 -3
- package/dist/storage.d.ts +1 -7
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +3 -3
- package/dist/vector-store.d.ts +1 -7
- package/dist/vector-store.d.ts.map +1 -1
- package/dist/vector-store.js +3 -3
- package/dist/voice.d.ts +1 -7
- package/dist/voice.d.ts.map +1 -1
- package/dist/voice.js +3 -3
- package/package.json +419 -76
- package/dist/_virtual/rolldown_runtime.js +0 -36
- package/dist/impls/elevenlabs-voice.js.map +0 -1
- package/dist/impls/gcs-storage.js.map +0 -1
- package/dist/impls/gmail-inbound.js.map +0 -1
- package/dist/impls/gmail-outbound.js.map +0 -1
- package/dist/impls/google-calendar.js.map +0 -1
- package/dist/impls/mistral-embedding.js.map +0 -1
- package/dist/impls/mistral-llm.js.map +0 -1
- package/dist/impls/postmark-email.js.map +0 -1
- package/dist/impls/powens-client.js.map +0 -1
- package/dist/impls/powens-openbanking.js.map +0 -1
- package/dist/impls/provider-factory.js.map +0 -1
- package/dist/impls/qdrant-vector.js.map +0 -1
- package/dist/impls/stripe-payments.js.map +0 -1
- package/dist/impls/twilio-sms.js.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/fathom-meeting-recorder.utils.ts
|
|
3
|
+
function extractItems(page) {
|
|
4
|
+
if (Array.isArray(page.items))
|
|
5
|
+
return page.items;
|
|
6
|
+
if (Array.isArray(page.data)) {
|
|
7
|
+
return page.data;
|
|
8
|
+
}
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
function extractNextCursor(page) {
|
|
12
|
+
return page.nextCursor ?? page.next_cursor ?? undefined;
|
|
13
|
+
}
|
|
14
|
+
function mapInvitee(invitee) {
|
|
15
|
+
const email = invitee.email;
|
|
16
|
+
const name = invitee.name;
|
|
17
|
+
if (!email && !name)
|
|
18
|
+
return;
|
|
19
|
+
return {
|
|
20
|
+
email,
|
|
21
|
+
name,
|
|
22
|
+
role: "attendee",
|
|
23
|
+
isExternal: invitee.is_external
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function matchRecordingId(meeting, targetId) {
|
|
27
|
+
return meeting.recordingId === targetId;
|
|
28
|
+
}
|
|
29
|
+
function durationSeconds(start, end) {
|
|
30
|
+
if (!start || !end)
|
|
31
|
+
return;
|
|
32
|
+
const startDate = start instanceof Date ? start : new Date(start);
|
|
33
|
+
const endDate = end instanceof Date ? end : new Date(end);
|
|
34
|
+
if (Number.isNaN(startDate.valueOf()) || Number.isNaN(endDate.valueOf())) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
return Math.max(0, (endDate.valueOf() - startDate.valueOf()) / 1000);
|
|
38
|
+
}
|
|
39
|
+
function mapTranscriptSegment(segment, index) {
|
|
40
|
+
return {
|
|
41
|
+
index,
|
|
42
|
+
speakerName: segment.speaker?.display_name ?? undefined,
|
|
43
|
+
speakerEmail: segment.speaker?.matched_calendar_invitee_email ?? undefined,
|
|
44
|
+
text: segment.text,
|
|
45
|
+
startTimeMs: parseTimestamp(segment.timestamp)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function parseTimestamp(value) {
|
|
49
|
+
const parts = value.split(":").map((part) => Number(part));
|
|
50
|
+
if (parts.length !== 3 || parts.some((part) => Number.isNaN(part))) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const [hours = 0, minutes = 0, seconds = 0] = parts;
|
|
54
|
+
return (hours * 3600 + minutes * 60 + seconds) * 1000;
|
|
55
|
+
}
|
|
56
|
+
async function safeReadError(response) {
|
|
57
|
+
try {
|
|
58
|
+
const data = await response.json();
|
|
59
|
+
return data?.message ?? response.statusText;
|
|
60
|
+
} catch {
|
|
61
|
+
return response.statusText;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/impls/fathom-meeting-recorder.mapper.ts
|
|
66
|
+
var mapFathomMeetingInvites = (invitees) => {
|
|
67
|
+
return invitees.map((invitee) => ({
|
|
68
|
+
...invitee,
|
|
69
|
+
name: invitee.name ?? undefined,
|
|
70
|
+
email: invitee.email ?? undefined
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
function mapFathomMeeting(meeting, params) {
|
|
74
|
+
const connectionId = params.connectionId ?? "unknown";
|
|
75
|
+
return {
|
|
76
|
+
id: meeting.recordingId.toString(),
|
|
77
|
+
tenantId: params.tenantId,
|
|
78
|
+
connectionId,
|
|
79
|
+
externalId: meeting.recordingId.toString(),
|
|
80
|
+
title: meeting.title ?? meeting.meetingTitle,
|
|
81
|
+
organizer: meeting.recordedBy ? {
|
|
82
|
+
name: meeting.recordedBy.name ?? undefined,
|
|
83
|
+
email: meeting.recordedBy.email ?? undefined,
|
|
84
|
+
role: "organizer"
|
|
85
|
+
} : undefined,
|
|
86
|
+
invitees: meeting.calendarInvitees.length ? mapFathomMeetingInvites(meeting.calendarInvitees) : undefined,
|
|
87
|
+
participants: meeting.calendarInvitees.length ? mapFathomMeetingInvites(meeting.calendarInvitees) : undefined,
|
|
88
|
+
scheduledStartAt: meeting.scheduledStartTime?.toISOString(),
|
|
89
|
+
scheduledEndAt: meeting.scheduledEndTime?.toISOString(),
|
|
90
|
+
recordingStartAt: meeting.recordingStartTime?.toISOString(),
|
|
91
|
+
recordingEndAt: meeting.recordingEndTime?.toISOString(),
|
|
92
|
+
durationSeconds: durationSeconds(meeting.recordingStartTime, meeting.recordingEndTime),
|
|
93
|
+
meetingUrl: meeting.url ?? undefined,
|
|
94
|
+
shareUrl: meeting.shareUrl ?? undefined,
|
|
95
|
+
transcriptAvailable: Array.isArray(meeting.transcript),
|
|
96
|
+
sourcePlatform: "fathom",
|
|
97
|
+
language: meeting.transcriptLanguage,
|
|
98
|
+
metadata: {
|
|
99
|
+
calendarInviteesDomainsType: meeting.calendarInviteesDomainsType
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/impls/fathom-meeting-recorder.webhooks.ts
|
|
105
|
+
import { TriggeredFor } from "fathom-typescript/sdk/models/operations";
|
|
106
|
+
function normalizeWebhookHeaders(headers) {
|
|
107
|
+
const normalized = {};
|
|
108
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
109
|
+
if (value == null)
|
|
110
|
+
continue;
|
|
111
|
+
const normalizedKey = key.toLowerCase();
|
|
112
|
+
if (Array.isArray(value)) {
|
|
113
|
+
if (value.length === 0)
|
|
114
|
+
continue;
|
|
115
|
+
normalized[normalizedKey] = value.join(", ");
|
|
116
|
+
} else {
|
|
117
|
+
normalized[normalizedKey] = value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return normalized;
|
|
121
|
+
}
|
|
122
|
+
function normalizeTriggeredFor(values) {
|
|
123
|
+
if (!values)
|
|
124
|
+
return;
|
|
125
|
+
const allowed = new Set(Object.values(TriggeredFor));
|
|
126
|
+
const normalized = values.map((value) => value.trim()).filter((value) => allowed.has(value));
|
|
127
|
+
return normalized.length ? normalized : undefined;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/impls/fathom-meeting-recorder.ts
|
|
131
|
+
import { Fathom } from "fathom-typescript";
|
|
132
|
+
import { TriggeredFor as TriggeredFor2 } from "fathom-typescript/sdk/models/operations";
|
|
133
|
+
var DEFAULT_BASE_URL = "https://api.fathom.ai/external/v1";
|
|
134
|
+
|
|
135
|
+
class FathomMeetingRecorderProvider {
|
|
136
|
+
client;
|
|
137
|
+
apiKey;
|
|
138
|
+
baseUrl;
|
|
139
|
+
includeTranscript;
|
|
140
|
+
includeSummary;
|
|
141
|
+
includeActionItems;
|
|
142
|
+
includeCrmMatches;
|
|
143
|
+
triggeredFor;
|
|
144
|
+
webhookSecret;
|
|
145
|
+
maxPages;
|
|
146
|
+
constructor(options) {
|
|
147
|
+
this.apiKey = options.apiKey;
|
|
148
|
+
this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
149
|
+
this.includeTranscript = options.includeTranscript ?? false;
|
|
150
|
+
this.includeSummary = options.includeSummary ?? false;
|
|
151
|
+
this.includeActionItems = options.includeActionItems ?? false;
|
|
152
|
+
this.includeCrmMatches = options.includeCrmMatches ?? false;
|
|
153
|
+
this.triggeredFor = options.triggeredFor;
|
|
154
|
+
this.webhookSecret = options.webhookSecret;
|
|
155
|
+
this.maxPages = options.maxPages ?? 5;
|
|
156
|
+
this.client = options.client ?? new Fathom({
|
|
157
|
+
serverURL: this.baseUrl,
|
|
158
|
+
security: {
|
|
159
|
+
apiKeyAuth: this.apiKey
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
async listMeetings(params) {
|
|
164
|
+
const request = {
|
|
165
|
+
cursor: params.cursor,
|
|
166
|
+
createdAfter: params.from,
|
|
167
|
+
createdBefore: params.to,
|
|
168
|
+
includeTranscript: params.includeTranscript ?? this.includeTranscript,
|
|
169
|
+
includeSummary: params.includeSummary ?? this.includeSummary,
|
|
170
|
+
includeActionItems: this.includeActionItems,
|
|
171
|
+
includeCrmMatches: this.includeCrmMatches
|
|
172
|
+
};
|
|
173
|
+
const result = await this.client.listMeetings(request);
|
|
174
|
+
let firstPage;
|
|
175
|
+
for await (const page of result) {
|
|
176
|
+
firstPage = page;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
if (!firstPage) {
|
|
180
|
+
return { meetings: [] };
|
|
181
|
+
}
|
|
182
|
+
const rawItems = extractItems(firstPage);
|
|
183
|
+
const meetings = rawItems.map((meeting) => mapFathomMeeting(meeting, params));
|
|
184
|
+
return {
|
|
185
|
+
meetings,
|
|
186
|
+
nextCursor: extractNextCursor(firstPage) ?? undefined,
|
|
187
|
+
hasMore: Boolean(extractNextCursor(firstPage))
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
async getMeeting(params) {
|
|
191
|
+
const result = await this.client.listMeetings({
|
|
192
|
+
includeTranscript: params.includeTranscript ?? this.includeTranscript,
|
|
193
|
+
includeSummary: params.includeSummary ?? this.includeSummary,
|
|
194
|
+
includeActionItems: this.includeActionItems,
|
|
195
|
+
includeCrmMatches: this.includeCrmMatches
|
|
196
|
+
});
|
|
197
|
+
let pageCount = 0;
|
|
198
|
+
const targetId = Number.parseInt(params.meetingId, 10);
|
|
199
|
+
for await (const page of result) {
|
|
200
|
+
pageCount += 1;
|
|
201
|
+
const match = extractItems(page).find((meeting) => matchRecordingId(meeting, targetId));
|
|
202
|
+
if (match) {
|
|
203
|
+
return mapFathomMeeting(match, params);
|
|
204
|
+
}
|
|
205
|
+
if (pageCount >= this.maxPages) {
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
throw new Error(`Fathom meeting "${targetId}" not found.`);
|
|
210
|
+
}
|
|
211
|
+
async getTranscript(params) {
|
|
212
|
+
const response = await this.request(`/recordings/${encodeURIComponent(params.meetingId)}/transcript`);
|
|
213
|
+
if (!Array.isArray(response.transcript)) {
|
|
214
|
+
throw new Error("Fathom transcript response did not include transcript.");
|
|
215
|
+
}
|
|
216
|
+
const segments = response.transcript.map((segment, index) => mapTranscriptSegment(segment, index));
|
|
217
|
+
return {
|
|
218
|
+
id: params.meetingId,
|
|
219
|
+
meetingId: params.meetingId,
|
|
220
|
+
tenantId: params.tenantId,
|
|
221
|
+
connectionId: params.connectionId ?? "unknown",
|
|
222
|
+
externalId: params.meetingId,
|
|
223
|
+
format: "segments",
|
|
224
|
+
text: segments.map((segment) => segment.text).join(`
|
|
225
|
+
`),
|
|
226
|
+
segments,
|
|
227
|
+
metadata: {
|
|
228
|
+
provider: "fathom"
|
|
229
|
+
},
|
|
230
|
+
raw: response.transcript
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
async parseWebhook(request) {
|
|
234
|
+
const payload = request.parsedBody ?? JSON.parse(request.rawBody);
|
|
235
|
+
const body = payload;
|
|
236
|
+
const recordingId = body.recording_id ?? body.recordingId ?? body.meeting_id ?? body.meetingId;
|
|
237
|
+
const verified = this.webhookSecret ? await this.verifyWebhook(request) : undefined;
|
|
238
|
+
return {
|
|
239
|
+
providerKey: "meeting-recorder.fathom",
|
|
240
|
+
eventType: body.event_type ?? body.eventType,
|
|
241
|
+
meetingId: recordingId,
|
|
242
|
+
recordingId,
|
|
243
|
+
verified,
|
|
244
|
+
payload
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
async verifyWebhook(request) {
|
|
248
|
+
if (!this.webhookSecret)
|
|
249
|
+
return true;
|
|
250
|
+
const headers = normalizeWebhookHeaders(request.headers);
|
|
251
|
+
try {
|
|
252
|
+
return Boolean(Fathom.verifyWebhook(this.webhookSecret, headers, request.rawBody));
|
|
253
|
+
} catch {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async registerWebhook(registration) {
|
|
258
|
+
const triggeredFor = normalizeTriggeredFor(registration.triggeredFor) ?? normalizeTriggeredFor(this.triggeredFor) ?? [TriggeredFor2.MyRecordings];
|
|
259
|
+
const webhook = await this.client.createWebhook({
|
|
260
|
+
destinationUrl: registration.url,
|
|
261
|
+
includeTranscript: registration.includeTranscript ?? true,
|
|
262
|
+
includeSummary: registration.includeSummary ?? false,
|
|
263
|
+
includeActionItems: registration.includeActionItems ?? false,
|
|
264
|
+
includeCrmMatches: registration.includeCrmMatches ?? false,
|
|
265
|
+
triggeredFor
|
|
266
|
+
});
|
|
267
|
+
return {
|
|
268
|
+
id: webhook.id,
|
|
269
|
+
secret: webhook.secret
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
async request(path) {
|
|
273
|
+
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
274
|
+
headers: {
|
|
275
|
+
"Content-Type": "application/json",
|
|
276
|
+
"X-Api-Key": this.apiKey
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
if (!response.ok) {
|
|
280
|
+
const message = await safeReadError(response);
|
|
281
|
+
throw new Error(`Fathom API error (${response.status}): ${message}`);
|
|
282
|
+
}
|
|
283
|
+
return await response.json();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
export {
|
|
287
|
+
FathomMeetingRecorderProvider
|
|
288
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MeetingParticipant, MeetingRecord, MeetingRecorderGetMeetingParams, MeetingRecorderListMeetingsParams } from '../meeting-recorder';
|
|
2
|
+
import type { FathomMeeting, FathomMeetingInvitee } from './fathom-meeting-recorder.types';
|
|
3
|
+
export declare const mapFathomMeetingInvites: (invitees: FathomMeetingInvitee[]) => MeetingParticipant[];
|
|
4
|
+
export declare function mapFathomMeeting(meeting: FathomMeeting, params: MeetingRecorderListMeetingsParams | MeetingRecorderGetMeetingParams): MeetingRecord;
|
|
5
|
+
//# sourceMappingURL=fathom-meeting-recorder.mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fathom-meeting-recorder.mapper.d.ts","sourceRoot":"","sources":["../../src/impls/fathom-meeting-recorder.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,+BAA+B,EAC/B,iCAAiC,EAClC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAGzC,eAAO,MAAM,uBAAuB,GAClC,UAAU,oBAAoB,EAAE,KAC/B,kBAAkB,EAMpB,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,iCAAiC,GAAG,+BAA+B,GAC1E,aAAa,CAsCf"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/fathom-meeting-recorder.utils.ts
|
|
3
|
+
function extractItems(page) {
|
|
4
|
+
if (Array.isArray(page.items))
|
|
5
|
+
return page.items;
|
|
6
|
+
if (Array.isArray(page.data)) {
|
|
7
|
+
return page.data;
|
|
8
|
+
}
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
function extractNextCursor(page) {
|
|
12
|
+
return page.nextCursor ?? page.next_cursor ?? undefined;
|
|
13
|
+
}
|
|
14
|
+
function mapInvitee(invitee) {
|
|
15
|
+
const email = invitee.email;
|
|
16
|
+
const name = invitee.name;
|
|
17
|
+
if (!email && !name)
|
|
18
|
+
return;
|
|
19
|
+
return {
|
|
20
|
+
email,
|
|
21
|
+
name,
|
|
22
|
+
role: "attendee",
|
|
23
|
+
isExternal: invitee.is_external
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function matchRecordingId(meeting, targetId) {
|
|
27
|
+
return meeting.recordingId === targetId;
|
|
28
|
+
}
|
|
29
|
+
function durationSeconds(start, end) {
|
|
30
|
+
if (!start || !end)
|
|
31
|
+
return;
|
|
32
|
+
const startDate = start instanceof Date ? start : new Date(start);
|
|
33
|
+
const endDate = end instanceof Date ? end : new Date(end);
|
|
34
|
+
if (Number.isNaN(startDate.valueOf()) || Number.isNaN(endDate.valueOf())) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
return Math.max(0, (endDate.valueOf() - startDate.valueOf()) / 1000);
|
|
38
|
+
}
|
|
39
|
+
function mapTranscriptSegment(segment, index) {
|
|
40
|
+
return {
|
|
41
|
+
index,
|
|
42
|
+
speakerName: segment.speaker?.display_name ?? undefined,
|
|
43
|
+
speakerEmail: segment.speaker?.matched_calendar_invitee_email ?? undefined,
|
|
44
|
+
text: segment.text,
|
|
45
|
+
startTimeMs: parseTimestamp(segment.timestamp)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function parseTimestamp(value) {
|
|
49
|
+
const parts = value.split(":").map((part) => Number(part));
|
|
50
|
+
if (parts.length !== 3 || parts.some((part) => Number.isNaN(part))) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const [hours = 0, minutes = 0, seconds = 0] = parts;
|
|
54
|
+
return (hours * 3600 + minutes * 60 + seconds) * 1000;
|
|
55
|
+
}
|
|
56
|
+
async function safeReadError(response) {
|
|
57
|
+
try {
|
|
58
|
+
const data = await response.json();
|
|
59
|
+
return data?.message ?? response.statusText;
|
|
60
|
+
} catch {
|
|
61
|
+
return response.statusText;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/impls/fathom-meeting-recorder.mapper.ts
|
|
66
|
+
var mapFathomMeetingInvites = (invitees) => {
|
|
67
|
+
return invitees.map((invitee) => ({
|
|
68
|
+
...invitee,
|
|
69
|
+
name: invitee.name ?? undefined,
|
|
70
|
+
email: invitee.email ?? undefined
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
function mapFathomMeeting(meeting, params) {
|
|
74
|
+
const connectionId = params.connectionId ?? "unknown";
|
|
75
|
+
return {
|
|
76
|
+
id: meeting.recordingId.toString(),
|
|
77
|
+
tenantId: params.tenantId,
|
|
78
|
+
connectionId,
|
|
79
|
+
externalId: meeting.recordingId.toString(),
|
|
80
|
+
title: meeting.title ?? meeting.meetingTitle,
|
|
81
|
+
organizer: meeting.recordedBy ? {
|
|
82
|
+
name: meeting.recordedBy.name ?? undefined,
|
|
83
|
+
email: meeting.recordedBy.email ?? undefined,
|
|
84
|
+
role: "organizer"
|
|
85
|
+
} : undefined,
|
|
86
|
+
invitees: meeting.calendarInvitees.length ? mapFathomMeetingInvites(meeting.calendarInvitees) : undefined,
|
|
87
|
+
participants: meeting.calendarInvitees.length ? mapFathomMeetingInvites(meeting.calendarInvitees) : undefined,
|
|
88
|
+
scheduledStartAt: meeting.scheduledStartTime?.toISOString(),
|
|
89
|
+
scheduledEndAt: meeting.scheduledEndTime?.toISOString(),
|
|
90
|
+
recordingStartAt: meeting.recordingStartTime?.toISOString(),
|
|
91
|
+
recordingEndAt: meeting.recordingEndTime?.toISOString(),
|
|
92
|
+
durationSeconds: durationSeconds(meeting.recordingStartTime, meeting.recordingEndTime),
|
|
93
|
+
meetingUrl: meeting.url ?? undefined,
|
|
94
|
+
shareUrl: meeting.shareUrl ?? undefined,
|
|
95
|
+
transcriptAvailable: Array.isArray(meeting.transcript),
|
|
96
|
+
sourcePlatform: "fathom",
|
|
97
|
+
language: meeting.transcriptLanguage,
|
|
98
|
+
metadata: {
|
|
99
|
+
calendarInviteesDomainsType: meeting.calendarInviteesDomainsType
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
mapFathomMeetingInvites,
|
|
105
|
+
mapFathomMeeting
|
|
106
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Invitee, Meeting } from 'fathom-typescript/sdk/models/shared';
|
|
2
|
+
export type FathomMeeting = Meeting;
|
|
3
|
+
export type FathomMeetingInvitee = Invitee;
|
|
4
|
+
export interface FathomMeetingListPage {
|
|
5
|
+
items?: FathomMeeting[];
|
|
6
|
+
nextCursor?: string | null;
|
|
7
|
+
next_cursor?: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface FathomTranscriptResponse {
|
|
10
|
+
transcript?: FathomTranscriptSegment[];
|
|
11
|
+
}
|
|
12
|
+
export interface FathomTranscriptSegment {
|
|
13
|
+
speaker?: {
|
|
14
|
+
display_name?: string;
|
|
15
|
+
matched_calendar_invitee_email?: string;
|
|
16
|
+
};
|
|
17
|
+
text: string;
|
|
18
|
+
timestamp: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=fathom-meeting-recorder.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fathom-meeting-recorder.types.d.ts","sourceRoot":"","sources":["../../src/impls/fathom-meeting-recorder.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAE5E,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;AACpC,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAE3C,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,8BAA8B,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MeetingParticipant, MeetingTranscriptSegment } from '../meeting-recorder';
|
|
2
|
+
import type { FathomMeeting, FathomMeetingListPage, FathomTranscriptSegment } from './fathom-meeting-recorder.types';
|
|
3
|
+
export declare function extractItems(page: FathomMeetingListPage): FathomMeeting[];
|
|
4
|
+
export declare function extractNextCursor(page: FathomMeetingListPage): string | null | undefined;
|
|
5
|
+
export declare function mapInvitee(invitee: Record<string, unknown>): MeetingParticipant | undefined;
|
|
6
|
+
export declare function matchRecordingId(meeting: FathomMeeting, targetId: number): boolean;
|
|
7
|
+
export declare function durationSeconds(start?: Date | string | null, end?: Date | string | null): number | undefined;
|
|
8
|
+
export declare function mapTranscriptSegment(segment: FathomTranscriptSegment, index: number): MeetingTranscriptSegment;
|
|
9
|
+
export declare function parseTimestamp(value: string): number | undefined;
|
|
10
|
+
export declare function safeReadError(response: Response): Promise<string>;
|
|
11
|
+
//# sourceMappingURL=fathom-meeting-recorder.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fathom-meeting-recorder.utils.d.ts","sourceRoot":"","sources":["../../src/impls/fathom-meeting-recorder.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,iCAAiC,CAAC;AAEzC,wBAAgB,YAAY,CAAC,IAAI,EAAE,qBAAqB,GAAG,aAAa,EAAE,CAMzE;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,qBAAqB,GAC1B,MAAM,GAAG,IAAI,GAAG,SAAS,CAE3B;AAED,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,kBAAkB,GAAG,SAAS,CAUhC;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,GACf,OAAO,CAET;AAED,wBAAgB,eAAe,CAC7B,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,EAC5B,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,GACzB,MAAM,GAAG,SAAS,CAQpB;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,uBAAuB,EAChC,KAAK,EAAE,MAAM,GACZ,wBAAwB,CAQ1B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOhE;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAOvE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/fathom-meeting-recorder.utils.ts
|
|
3
|
+
function extractItems(page) {
|
|
4
|
+
if (Array.isArray(page.items))
|
|
5
|
+
return page.items;
|
|
6
|
+
if (Array.isArray(page.data)) {
|
|
7
|
+
return page.data;
|
|
8
|
+
}
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
function extractNextCursor(page) {
|
|
12
|
+
return page.nextCursor ?? page.next_cursor ?? undefined;
|
|
13
|
+
}
|
|
14
|
+
function mapInvitee(invitee) {
|
|
15
|
+
const email = invitee.email;
|
|
16
|
+
const name = invitee.name;
|
|
17
|
+
if (!email && !name)
|
|
18
|
+
return;
|
|
19
|
+
return {
|
|
20
|
+
email,
|
|
21
|
+
name,
|
|
22
|
+
role: "attendee",
|
|
23
|
+
isExternal: invitee.is_external
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function matchRecordingId(meeting, targetId) {
|
|
27
|
+
return meeting.recordingId === targetId;
|
|
28
|
+
}
|
|
29
|
+
function durationSeconds(start, end) {
|
|
30
|
+
if (!start || !end)
|
|
31
|
+
return;
|
|
32
|
+
const startDate = start instanceof Date ? start : new Date(start);
|
|
33
|
+
const endDate = end instanceof Date ? end : new Date(end);
|
|
34
|
+
if (Number.isNaN(startDate.valueOf()) || Number.isNaN(endDate.valueOf())) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
return Math.max(0, (endDate.valueOf() - startDate.valueOf()) / 1000);
|
|
38
|
+
}
|
|
39
|
+
function mapTranscriptSegment(segment, index) {
|
|
40
|
+
return {
|
|
41
|
+
index,
|
|
42
|
+
speakerName: segment.speaker?.display_name ?? undefined,
|
|
43
|
+
speakerEmail: segment.speaker?.matched_calendar_invitee_email ?? undefined,
|
|
44
|
+
text: segment.text,
|
|
45
|
+
startTimeMs: parseTimestamp(segment.timestamp)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function parseTimestamp(value) {
|
|
49
|
+
const parts = value.split(":").map((part) => Number(part));
|
|
50
|
+
if (parts.length !== 3 || parts.some((part) => Number.isNaN(part))) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const [hours = 0, minutes = 0, seconds = 0] = parts;
|
|
54
|
+
return (hours * 3600 + minutes * 60 + seconds) * 1000;
|
|
55
|
+
}
|
|
56
|
+
async function safeReadError(response) {
|
|
57
|
+
try {
|
|
58
|
+
const data = await response.json();
|
|
59
|
+
return data?.message ?? response.statusText;
|
|
60
|
+
} catch {
|
|
61
|
+
return response.statusText;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
safeReadError,
|
|
66
|
+
parseTimestamp,
|
|
67
|
+
matchRecordingId,
|
|
68
|
+
mapTranscriptSegment,
|
|
69
|
+
mapInvitee,
|
|
70
|
+
extractNextCursor,
|
|
71
|
+
extractItems,
|
|
72
|
+
durationSeconds
|
|
73
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TriggeredFor } from 'fathom-typescript/sdk/models/operations';
|
|
2
|
+
export declare function normalizeWebhookHeaders(headers: Record<string, string | string[] | undefined>): Record<string, string>;
|
|
3
|
+
export declare function normalizeTriggeredFor(values?: string[]): TriggeredFor[] | undefined;
|
|
4
|
+
//# sourceMappingURL=fathom-meeting-recorder.webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fathom-meeting-recorder.webhooks.d.ts","sourceRoot":"","sources":["../../src/impls/fathom-meeting-recorder.webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GACrD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,YAAY,EAAE,GAAG,SAAS,CAS5B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/fathom-meeting-recorder.webhooks.ts
|
|
3
|
+
import { TriggeredFor } from "fathom-typescript/sdk/models/operations";
|
|
4
|
+
function normalizeWebhookHeaders(headers) {
|
|
5
|
+
const normalized = {};
|
|
6
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
7
|
+
if (value == null)
|
|
8
|
+
continue;
|
|
9
|
+
const normalizedKey = key.toLowerCase();
|
|
10
|
+
if (Array.isArray(value)) {
|
|
11
|
+
if (value.length === 0)
|
|
12
|
+
continue;
|
|
13
|
+
normalized[normalizedKey] = value.join(", ");
|
|
14
|
+
} else {
|
|
15
|
+
normalized[normalizedKey] = value;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return normalized;
|
|
19
|
+
}
|
|
20
|
+
function normalizeTriggeredFor(values) {
|
|
21
|
+
if (!values)
|
|
22
|
+
return;
|
|
23
|
+
const allowed = new Set(Object.values(TriggeredFor));
|
|
24
|
+
const normalized = values.map((value) => value.trim()).filter((value) => allowed.has(value));
|
|
25
|
+
return normalized.length ? normalized : undefined;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
normalizeWebhookHeaders,
|
|
29
|
+
normalizeTriggeredFor
|
|
30
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MeetingRecord, MeetingRecorderGetMeetingParams, MeetingRecorderGetTranscriptParams, MeetingRecorderListMeetingsParams, MeetingRecorderListMeetingsResult, MeetingRecorderProvider, MeetingRecorderWebhookEvent, MeetingRecorderWebhookRequest, MeetingTranscriptRecord } from '../meeting-recorder';
|
|
2
|
+
export interface FirefliesMeetingRecorderProviderOptions {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
pageSize?: number;
|
|
6
|
+
webhookSecret?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class FirefliesMeetingRecorderProvider implements MeetingRecorderProvider {
|
|
9
|
+
private readonly apiKey;
|
|
10
|
+
private readonly baseUrl;
|
|
11
|
+
private readonly defaultPageSize?;
|
|
12
|
+
private readonly webhookSecret?;
|
|
13
|
+
constructor(options: FirefliesMeetingRecorderProviderOptions);
|
|
14
|
+
listMeetings(params: MeetingRecorderListMeetingsParams): Promise<MeetingRecorderListMeetingsResult>;
|
|
15
|
+
getMeeting(params: MeetingRecorderGetMeetingParams): Promise<MeetingRecord>;
|
|
16
|
+
getTranscript(params: MeetingRecorderGetTranscriptParams): Promise<MeetingTranscriptRecord>;
|
|
17
|
+
parseWebhook(request: MeetingRecorderWebhookRequest): Promise<MeetingRecorderWebhookEvent>;
|
|
18
|
+
verifyWebhook(request: MeetingRecorderWebhookRequest): Promise<boolean>;
|
|
19
|
+
private mapTranscriptToMeeting;
|
|
20
|
+
private mapAttendee;
|
|
21
|
+
private mapSentence;
|
|
22
|
+
private query;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=fireflies-meeting-recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fireflies-meeting-recorder.d.ts","sourceRoot":"","sources":["../../src/impls/fireflies-meeting-recorder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,aAAa,EACb,+BAA+B,EAC/B,kCAAkC,EAClC,iCAAiC,EACjC,iCAAiC,EACjC,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,uBAAuB,EAExB,MAAM,qBAAqB,CAAC;AAoB7B,MAAM,WAAW,uCAAuC;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAID,qBAAa,gCAAiC,YAAW,uBAAuB;IAC9E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;gBAE5B,OAAO,EAAE,uCAAuC;IAOtD,YAAY,CAChB,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,iCAAiC,CAAC;IA0BvC,UAAU,CACd,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,aAAa,CAAC;IAUnB,aAAa,CACjB,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,uBAAuB,CAAC;IA4B7B,YAAY,CAChB,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,2BAA2B,CAAC;IAuBjC,aAAa,CACjB,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC;IAWnB,OAAO,CAAC,sBAAsB;IAqC9B,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,WAAW;YAWL,KAAK;CAyBpB"}
|