@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,275 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/fireflies-meeting-recorder.queries.ts
|
|
3
|
+
var TRANSCRIPTS_QUERY = `
|
|
4
|
+
query Transcripts(
|
|
5
|
+
$limit: Int
|
|
6
|
+
$skip: Int
|
|
7
|
+
$fromDate: DateTime
|
|
8
|
+
$toDate: DateTime
|
|
9
|
+
$keyword: String
|
|
10
|
+
$scope: TranscriptsQueryScope
|
|
11
|
+
) {
|
|
12
|
+
transcripts(
|
|
13
|
+
limit: $limit
|
|
14
|
+
skip: $skip
|
|
15
|
+
fromDate: $fromDate
|
|
16
|
+
toDate: $toDate
|
|
17
|
+
keyword: $keyword
|
|
18
|
+
scope: $scope
|
|
19
|
+
) {
|
|
20
|
+
id
|
|
21
|
+
title
|
|
22
|
+
organizer_email
|
|
23
|
+
participants
|
|
24
|
+
meeting_attendees {
|
|
25
|
+
name
|
|
26
|
+
email
|
|
27
|
+
displayName
|
|
28
|
+
}
|
|
29
|
+
dateString
|
|
30
|
+
duration
|
|
31
|
+
meeting_link
|
|
32
|
+
transcript_url
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
var TRANSCRIPT_QUERY = `
|
|
37
|
+
query Transcript($transcriptId: String!) {
|
|
38
|
+
transcript(id: $transcriptId) {
|
|
39
|
+
id
|
|
40
|
+
title
|
|
41
|
+
organizer_email
|
|
42
|
+
participants
|
|
43
|
+
meeting_attendees {
|
|
44
|
+
name
|
|
45
|
+
email
|
|
46
|
+
displayName
|
|
47
|
+
}
|
|
48
|
+
dateString
|
|
49
|
+
duration
|
|
50
|
+
meeting_link
|
|
51
|
+
transcript_url
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
var TRANSCRIPT_WITH_SEGMENTS_QUERY = `
|
|
56
|
+
query Transcript($transcriptId: String!) {
|
|
57
|
+
transcript(id: $transcriptId) {
|
|
58
|
+
id
|
|
59
|
+
title
|
|
60
|
+
organizer_email
|
|
61
|
+
participants
|
|
62
|
+
meeting_attendees {
|
|
63
|
+
name
|
|
64
|
+
email
|
|
65
|
+
displayName
|
|
66
|
+
}
|
|
67
|
+
dateString
|
|
68
|
+
duration
|
|
69
|
+
meeting_link
|
|
70
|
+
transcript_url
|
|
71
|
+
sentences {
|
|
72
|
+
index
|
|
73
|
+
speaker_name
|
|
74
|
+
speaker_id
|
|
75
|
+
text
|
|
76
|
+
start_time
|
|
77
|
+
end_time
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
// src/impls/fireflies-meeting-recorder.utils.ts
|
|
84
|
+
import { Buffer } from "buffer";
|
|
85
|
+
import { timingSafeEqual } from "crypto";
|
|
86
|
+
function parseSeconds(value) {
|
|
87
|
+
if (value == null)
|
|
88
|
+
return;
|
|
89
|
+
const num = typeof value === "number" ? value : Number(value);
|
|
90
|
+
if (!Number.isFinite(num))
|
|
91
|
+
return;
|
|
92
|
+
return num * 1000;
|
|
93
|
+
}
|
|
94
|
+
function normalizeHeader(headers, key) {
|
|
95
|
+
const header = headers[key] ?? headers[key.toLowerCase()] ?? headers[key.toUpperCase()];
|
|
96
|
+
if (Array.isArray(header))
|
|
97
|
+
return header[0];
|
|
98
|
+
return header;
|
|
99
|
+
}
|
|
100
|
+
function safeCompareHex(a, b) {
|
|
101
|
+
try {
|
|
102
|
+
const aBuffer = Buffer.from(a, "hex");
|
|
103
|
+
const bBuffer = Buffer.from(b, "hex");
|
|
104
|
+
if (aBuffer.length !== bBuffer.length)
|
|
105
|
+
return false;
|
|
106
|
+
return timingSafeEqual(aBuffer, bBuffer);
|
|
107
|
+
} catch {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async function safeReadError(response) {
|
|
112
|
+
try {
|
|
113
|
+
const data = await response.json();
|
|
114
|
+
return data?.message ?? response.statusText;
|
|
115
|
+
} catch {
|
|
116
|
+
return response.statusText;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// src/impls/fireflies-meeting-recorder.ts
|
|
121
|
+
import { createHmac } from "crypto";
|
|
122
|
+
var DEFAULT_BASE_URL = "https://api.fireflies.ai/graphql";
|
|
123
|
+
|
|
124
|
+
class FirefliesMeetingRecorderProvider {
|
|
125
|
+
apiKey;
|
|
126
|
+
baseUrl;
|
|
127
|
+
defaultPageSize;
|
|
128
|
+
webhookSecret;
|
|
129
|
+
constructor(options) {
|
|
130
|
+
this.apiKey = options.apiKey;
|
|
131
|
+
this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
132
|
+
this.defaultPageSize = options.pageSize;
|
|
133
|
+
this.webhookSecret = options.webhookSecret;
|
|
134
|
+
}
|
|
135
|
+
async listMeetings(params) {
|
|
136
|
+
const limit = params.pageSize ?? this.defaultPageSize ?? 25;
|
|
137
|
+
const skip = params.cursor ? Number(params.cursor) : 0;
|
|
138
|
+
const data = await this.query(TRANSCRIPTS_QUERY, {
|
|
139
|
+
limit,
|
|
140
|
+
skip: Number.isFinite(skip) ? skip : 0,
|
|
141
|
+
fromDate: params.from,
|
|
142
|
+
toDate: params.to,
|
|
143
|
+
keyword: params.query,
|
|
144
|
+
scope: params.query ? "all" : undefined
|
|
145
|
+
});
|
|
146
|
+
const meetings = data.transcripts.map((transcript) => this.mapTranscriptToMeeting(transcript, params));
|
|
147
|
+
const nextCursor = meetings.length === limit ? String(skip + limit) : undefined;
|
|
148
|
+
return {
|
|
149
|
+
meetings,
|
|
150
|
+
nextCursor,
|
|
151
|
+
hasMore: Boolean(nextCursor)
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
async getMeeting(params) {
|
|
155
|
+
const data = await this.query(TRANSCRIPT_QUERY, {
|
|
156
|
+
transcriptId: params.meetingId
|
|
157
|
+
});
|
|
158
|
+
return this.mapTranscriptToMeeting(data.transcript, params);
|
|
159
|
+
}
|
|
160
|
+
async getTranscript(params) {
|
|
161
|
+
const data = await this.query(TRANSCRIPT_WITH_SEGMENTS_QUERY, { transcriptId: params.meetingId });
|
|
162
|
+
const transcript = data.transcript;
|
|
163
|
+
const segments = (transcript.sentences ?? []).map((segment) => this.mapSentence(segment));
|
|
164
|
+
return {
|
|
165
|
+
id: transcript.id,
|
|
166
|
+
meetingId: transcript.id,
|
|
167
|
+
tenantId: params.tenantId,
|
|
168
|
+
connectionId: params.connectionId ?? "unknown",
|
|
169
|
+
externalId: transcript.id,
|
|
170
|
+
format: "segments",
|
|
171
|
+
text: segments.map((segment) => segment.text).join(`
|
|
172
|
+
`),
|
|
173
|
+
segments,
|
|
174
|
+
generatedAt: transcript.dateString ?? undefined,
|
|
175
|
+
sourceUrl: transcript.transcript_url ?? undefined,
|
|
176
|
+
metadata: {
|
|
177
|
+
meetingLink: transcript.meeting_link,
|
|
178
|
+
durationMinutes: transcript.duration
|
|
179
|
+
},
|
|
180
|
+
raw: transcript
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
async parseWebhook(request) {
|
|
184
|
+
const payload = request.parsedBody ?? JSON.parse(request.rawBody);
|
|
185
|
+
const body = payload;
|
|
186
|
+
const verified = this.webhookSecret ? await this.verifyWebhook(request) : undefined;
|
|
187
|
+
return {
|
|
188
|
+
providerKey: "meeting-recorder.fireflies",
|
|
189
|
+
eventType: body.eventType,
|
|
190
|
+
meetingId: body.meetingId,
|
|
191
|
+
transcriptId: body.meetingId,
|
|
192
|
+
verified,
|
|
193
|
+
payload,
|
|
194
|
+
metadata: {
|
|
195
|
+
clientReferenceId: body.clientReferenceId
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
async verifyWebhook(request) {
|
|
200
|
+
if (!this.webhookSecret)
|
|
201
|
+
return true;
|
|
202
|
+
const signatureHeader = normalizeHeader(request.headers, "x-hub-signature");
|
|
203
|
+
if (!signatureHeader)
|
|
204
|
+
return false;
|
|
205
|
+
const signature = signatureHeader.replace(/^sha256=/, "");
|
|
206
|
+
const digest = createHmac("sha256", this.webhookSecret).update(request.rawBody).digest("hex");
|
|
207
|
+
return safeCompareHex(digest, signature);
|
|
208
|
+
}
|
|
209
|
+
mapTranscriptToMeeting(transcript, params) {
|
|
210
|
+
const connectionId = params.connectionId ?? "unknown";
|
|
211
|
+
const organizer = transcript.organizer_email ? { email: transcript.organizer_email, role: "organizer" } : undefined;
|
|
212
|
+
const attendees = transcript.meeting_attendees?.length ? transcript.meeting_attendees.map((attendee) => this.mapAttendee(attendee)) : transcript.participants?.map((email) => ({ email, role: "attendee" }));
|
|
213
|
+
return {
|
|
214
|
+
id: transcript.id,
|
|
215
|
+
tenantId: params.tenantId,
|
|
216
|
+
connectionId,
|
|
217
|
+
externalId: transcript.id,
|
|
218
|
+
title: transcript.title ?? undefined,
|
|
219
|
+
organizer,
|
|
220
|
+
invitees: attendees,
|
|
221
|
+
participants: attendees,
|
|
222
|
+
scheduledStartAt: transcript.dateString ?? undefined,
|
|
223
|
+
recordingStartAt: transcript.dateString ?? undefined,
|
|
224
|
+
durationSeconds: transcript.duration ? transcript.duration * 60 : undefined,
|
|
225
|
+
meetingUrl: transcript.meeting_link ?? transcript.transcript_url ?? undefined,
|
|
226
|
+
transcriptAvailable: Boolean(transcript.transcript_url),
|
|
227
|
+
sourcePlatform: "fireflies",
|
|
228
|
+
metadata: {
|
|
229
|
+
transcriptUrl: transcript.transcript_url
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
mapAttendee(attendee) {
|
|
234
|
+
return {
|
|
235
|
+
name: attendee.name ?? attendee.displayName ?? undefined,
|
|
236
|
+
email: attendee.email ?? undefined,
|
|
237
|
+
role: "attendee"
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
mapSentence(segment) {
|
|
241
|
+
return {
|
|
242
|
+
index: segment.index ?? undefined,
|
|
243
|
+
speakerId: segment.speaker_id ?? undefined,
|
|
244
|
+
speakerName: segment.speaker_name ?? undefined,
|
|
245
|
+
text: segment.text,
|
|
246
|
+
startTimeMs: parseSeconds(segment.start_time),
|
|
247
|
+
endTimeMs: parseSeconds(segment.end_time)
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
async query(query, variables) {
|
|
251
|
+
const response = await fetch(this.baseUrl, {
|
|
252
|
+
method: "POST",
|
|
253
|
+
headers: {
|
|
254
|
+
"Content-Type": "application/json",
|
|
255
|
+
Authorization: `Bearer ${this.apiKey}`
|
|
256
|
+
},
|
|
257
|
+
body: JSON.stringify({ query, variables })
|
|
258
|
+
});
|
|
259
|
+
if (!response.ok) {
|
|
260
|
+
const message = await safeReadError(response);
|
|
261
|
+
throw new Error(`Fireflies API error (${response.status}): ${message}`);
|
|
262
|
+
}
|
|
263
|
+
const result = await response.json();
|
|
264
|
+
if (result.errors?.length) {
|
|
265
|
+
throw new Error(result.errors.map((error) => error.message).join("; "));
|
|
266
|
+
}
|
|
267
|
+
if (!result.data) {
|
|
268
|
+
throw new Error("Fireflies API returned empty data payload.");
|
|
269
|
+
}
|
|
270
|
+
return result.data;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
export {
|
|
274
|
+
FirefliesMeetingRecorderProvider
|
|
275
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const TRANSCRIPTS_QUERY = "\n query Transcripts(\n $limit: Int\n $skip: Int\n $fromDate: DateTime\n $toDate: DateTime\n $keyword: String\n $scope: TranscriptsQueryScope\n ) {\n transcripts(\n limit: $limit\n skip: $skip\n fromDate: $fromDate\n toDate: $toDate\n keyword: $keyword\n scope: $scope\n ) {\n id\n title\n organizer_email\n participants\n meeting_attendees {\n name\n email\n displayName\n }\n dateString\n duration\n meeting_link\n transcript_url\n }\n }\n";
|
|
2
|
+
export declare const TRANSCRIPT_QUERY = "\n query Transcript($transcriptId: String!) {\n transcript(id: $transcriptId) {\n id\n title\n organizer_email\n participants\n meeting_attendees {\n name\n email\n displayName\n }\n dateString\n duration\n meeting_link\n transcript_url\n }\n }\n";
|
|
3
|
+
export declare const TRANSCRIPT_WITH_SEGMENTS_QUERY = "\n query Transcript($transcriptId: String!) {\n transcript(id: $transcriptId) {\n id\n title\n organizer_email\n participants\n meeting_attendees {\n name\n email\n displayName\n }\n dateString\n duration\n meeting_link\n transcript_url\n sentences {\n index\n speaker_name\n speaker_id\n text\n start_time\n end_time\n }\n }\n }\n";
|
|
4
|
+
//# sourceMappingURL=fireflies-meeting-recorder.queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fireflies-meeting-recorder.queries.d.ts","sourceRoot":"","sources":["../../src/impls/fireflies-meeting-recorder.queries.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,ikBAgC7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,0UAkB5B,CAAC;AAEF,eAAO,MAAM,8BAA8B,mdA0B1C,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/fireflies-meeting-recorder.queries.ts
|
|
3
|
+
var TRANSCRIPTS_QUERY = `
|
|
4
|
+
query Transcripts(
|
|
5
|
+
$limit: Int
|
|
6
|
+
$skip: Int
|
|
7
|
+
$fromDate: DateTime
|
|
8
|
+
$toDate: DateTime
|
|
9
|
+
$keyword: String
|
|
10
|
+
$scope: TranscriptsQueryScope
|
|
11
|
+
) {
|
|
12
|
+
transcripts(
|
|
13
|
+
limit: $limit
|
|
14
|
+
skip: $skip
|
|
15
|
+
fromDate: $fromDate
|
|
16
|
+
toDate: $toDate
|
|
17
|
+
keyword: $keyword
|
|
18
|
+
scope: $scope
|
|
19
|
+
) {
|
|
20
|
+
id
|
|
21
|
+
title
|
|
22
|
+
organizer_email
|
|
23
|
+
participants
|
|
24
|
+
meeting_attendees {
|
|
25
|
+
name
|
|
26
|
+
email
|
|
27
|
+
displayName
|
|
28
|
+
}
|
|
29
|
+
dateString
|
|
30
|
+
duration
|
|
31
|
+
meeting_link
|
|
32
|
+
transcript_url
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
var TRANSCRIPT_QUERY = `
|
|
37
|
+
query Transcript($transcriptId: String!) {
|
|
38
|
+
transcript(id: $transcriptId) {
|
|
39
|
+
id
|
|
40
|
+
title
|
|
41
|
+
organizer_email
|
|
42
|
+
participants
|
|
43
|
+
meeting_attendees {
|
|
44
|
+
name
|
|
45
|
+
email
|
|
46
|
+
displayName
|
|
47
|
+
}
|
|
48
|
+
dateString
|
|
49
|
+
duration
|
|
50
|
+
meeting_link
|
|
51
|
+
transcript_url
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
var TRANSCRIPT_WITH_SEGMENTS_QUERY = `
|
|
56
|
+
query Transcript($transcriptId: String!) {
|
|
57
|
+
transcript(id: $transcriptId) {
|
|
58
|
+
id
|
|
59
|
+
title
|
|
60
|
+
organizer_email
|
|
61
|
+
participants
|
|
62
|
+
meeting_attendees {
|
|
63
|
+
name
|
|
64
|
+
email
|
|
65
|
+
displayName
|
|
66
|
+
}
|
|
67
|
+
dateString
|
|
68
|
+
duration
|
|
69
|
+
meeting_link
|
|
70
|
+
transcript_url
|
|
71
|
+
sentences {
|
|
72
|
+
index
|
|
73
|
+
speaker_name
|
|
74
|
+
speaker_id
|
|
75
|
+
text
|
|
76
|
+
start_time
|
|
77
|
+
end_time
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
export {
|
|
83
|
+
TRANSCRIPT_WITH_SEGMENTS_QUERY,
|
|
84
|
+
TRANSCRIPT_QUERY,
|
|
85
|
+
TRANSCRIPTS_QUERY
|
|
86
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface FirefliesTranscriptsResponse {
|
|
2
|
+
transcripts: FirefliesTranscript[];
|
|
3
|
+
}
|
|
4
|
+
export interface FirefliesTranscriptResponse {
|
|
5
|
+
transcript: FirefliesTranscript;
|
|
6
|
+
}
|
|
7
|
+
export interface FirefliesTranscript {
|
|
8
|
+
id: string;
|
|
9
|
+
title?: string | null;
|
|
10
|
+
organizer_email?: string | null;
|
|
11
|
+
participants?: string[] | null;
|
|
12
|
+
meeting_attendees?: FirefliesMeetingAttendee[] | null;
|
|
13
|
+
dateString?: string | null;
|
|
14
|
+
duration?: number | null;
|
|
15
|
+
meeting_link?: string | null;
|
|
16
|
+
transcript_url?: string | null;
|
|
17
|
+
sentences?: FirefliesSentence[] | null;
|
|
18
|
+
}
|
|
19
|
+
export interface FirefliesMeetingAttendee {
|
|
20
|
+
name?: string | null;
|
|
21
|
+
displayName?: string | null;
|
|
22
|
+
email?: string | null;
|
|
23
|
+
}
|
|
24
|
+
export interface FirefliesSentence {
|
|
25
|
+
index?: number | null;
|
|
26
|
+
speaker_id?: string | null;
|
|
27
|
+
speaker_name?: string | null;
|
|
28
|
+
text: string;
|
|
29
|
+
start_time?: string | number | null;
|
|
30
|
+
end_time?: string | number | null;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=fireflies-meeting-recorder.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fireflies-meeting-recorder.types.d.ts","sourceRoot":"","sources":["../../src/impls/fireflies-meeting-recorder.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,mBAAmB,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,wBAAwB,EAAE,GAAG,IAAI,CAAC;IACtD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function parseSeconds(value?: string | number | null): number | undefined;
|
|
2
|
+
export declare function normalizeHeader(headers: Record<string, string | string[] | undefined>, key: string): string | undefined;
|
|
3
|
+
export declare function safeCompareHex(a: string, b: string): boolean;
|
|
4
|
+
export declare function safeReadError(response: Response): Promise<string>;
|
|
5
|
+
//# sourceMappingURL=fireflies-meeting-recorder.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fireflies-meeting-recorder.utils.d.ts","sourceRoot":"","sources":["../../src/impls/fireflies-meeting-recorder.utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,CAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAC7B,MAAM,GAAG,SAAS,CAKpB;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,EACtD,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,SAAS,CAKpB;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAS5D;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAOvE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/fireflies-meeting-recorder.utils.ts
|
|
3
|
+
import { Buffer } from "buffer";
|
|
4
|
+
import { timingSafeEqual } from "crypto";
|
|
5
|
+
function parseSeconds(value) {
|
|
6
|
+
if (value == null)
|
|
7
|
+
return;
|
|
8
|
+
const num = typeof value === "number" ? value : Number(value);
|
|
9
|
+
if (!Number.isFinite(num))
|
|
10
|
+
return;
|
|
11
|
+
return num * 1000;
|
|
12
|
+
}
|
|
13
|
+
function normalizeHeader(headers, key) {
|
|
14
|
+
const header = headers[key] ?? headers[key.toLowerCase()] ?? headers[key.toUpperCase()];
|
|
15
|
+
if (Array.isArray(header))
|
|
16
|
+
return header[0];
|
|
17
|
+
return header;
|
|
18
|
+
}
|
|
19
|
+
function safeCompareHex(a, b) {
|
|
20
|
+
try {
|
|
21
|
+
const aBuffer = Buffer.from(a, "hex");
|
|
22
|
+
const bBuffer = Buffer.from(b, "hex");
|
|
23
|
+
if (aBuffer.length !== bBuffer.length)
|
|
24
|
+
return false;
|
|
25
|
+
return timingSafeEqual(aBuffer, bBuffer);
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function safeReadError(response) {
|
|
31
|
+
try {
|
|
32
|
+
const data = await response.json();
|
|
33
|
+
return data?.message ?? response.statusText;
|
|
34
|
+
} catch {
|
|
35
|
+
return response.statusText;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
safeReadError,
|
|
40
|
+
safeCompareHex,
|
|
41
|
+
parseSeconds,
|
|
42
|
+
normalizeHeader
|
|
43
|
+
};
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
storage?: Storage;
|
|
8
|
-
clientOptions?: StorageOptions;
|
|
1
|
+
import { Storage, type StorageOptions } from '@google-cloud/storage';
|
|
2
|
+
import type { ObjectStorageProvider, PutObjectInput, GetObjectResult, StorageObjectMetadata, ListObjectsQuery, ListObjectsResult, SignedUrlOptions, DeleteObjectInput } from '../storage';
|
|
3
|
+
export interface GoogleCloudStorageProviderOptions {
|
|
4
|
+
bucket: string;
|
|
5
|
+
storage?: Storage;
|
|
6
|
+
clientOptions?: StorageOptions;
|
|
9
7
|
}
|
|
10
|
-
declare class GoogleCloudStorageProvider implements
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
export declare class GoogleCloudStorageProvider implements ObjectStorageProvider {
|
|
9
|
+
private readonly storage;
|
|
10
|
+
private readonly bucketName;
|
|
11
|
+
constructor(options: GoogleCloudStorageProviderOptions);
|
|
12
|
+
putObject(input: PutObjectInput): Promise<StorageObjectMetadata>;
|
|
13
|
+
getObject(input: DeleteObjectInput): Promise<GetObjectResult | null>;
|
|
14
|
+
deleteObject(input: DeleteObjectInput): Promise<void>;
|
|
15
|
+
generateSignedUrl(options: SignedUrlOptions): Promise<{
|
|
16
|
+
url: string;
|
|
17
|
+
expiresAt: Date;
|
|
18
|
+
}>;
|
|
19
|
+
listObjects(query: ListObjectsQuery): Promise<ListObjectsResult>;
|
|
22
20
|
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { GoogleCloudStorageProvider, GoogleCloudStorageProviderOptions };
|
|
25
21
|
//# sourceMappingURL=gcs-storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcs-storage.d.ts","
|
|
1
|
+
{"version":3,"file":"gcs-storage.d.ts","sourceRoot":"","sources":["../../src/impls/gcs-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAED,qBAAa,0BAA2B,YAAW,qBAAqB;IACtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,OAAO,EAAE,iCAAiC;IAMhD,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAiBhE,SAAS,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAcpE,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOrD,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAC1D,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,IAAI,CAAC;KACjB,CAAC;IAcI,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAuBvE"}
|