@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.
Files changed (238) hide show
  1. package/README.md +115 -1
  2. package/dist/analytics.d.ts +2 -0
  3. package/dist/analytics.d.ts.map +1 -0
  4. package/dist/analytics.js +3 -0
  5. package/dist/calendar.d.ts +1 -7
  6. package/dist/calendar.d.ts.map +1 -1
  7. package/dist/calendar.js +3 -3
  8. package/dist/database.d.ts +2 -0
  9. package/dist/database.d.ts.map +1 -0
  10. package/dist/database.js +3 -0
  11. package/dist/email.d.ts +1 -7
  12. package/dist/email.d.ts.map +1 -1
  13. package/dist/email.js +3 -3
  14. package/dist/embedding.d.ts +1 -7
  15. package/dist/embedding.d.ts.map +1 -1
  16. package/dist/embedding.js +3 -3
  17. package/dist/impls/elevenlabs-voice.d.ts +14 -18
  18. package/dist/impls/elevenlabs-voice.d.ts.map +1 -1
  19. package/dist/impls/elevenlabs-voice.js +98 -88
  20. package/dist/impls/fal-voice.d.ts +25 -0
  21. package/dist/impls/fal-voice.d.ts.map +1 -0
  22. package/dist/impls/fal-voice.js +113 -0
  23. package/dist/impls/fathom-meeting-recorder.d.ts +38 -0
  24. package/dist/impls/fathom-meeting-recorder.d.ts.map +1 -0
  25. package/dist/impls/fathom-meeting-recorder.js +288 -0
  26. package/dist/impls/fathom-meeting-recorder.mapper.d.ts +5 -0
  27. package/dist/impls/fathom-meeting-recorder.mapper.d.ts.map +1 -0
  28. package/dist/impls/fathom-meeting-recorder.mapper.js +106 -0
  29. package/dist/impls/fathom-meeting-recorder.types.d.ts +20 -0
  30. package/dist/impls/fathom-meeting-recorder.types.d.ts.map +1 -0
  31. package/dist/impls/fathom-meeting-recorder.types.js +1 -0
  32. package/dist/impls/fathom-meeting-recorder.utils.d.ts +11 -0
  33. package/dist/impls/fathom-meeting-recorder.utils.d.ts.map +1 -0
  34. package/dist/impls/fathom-meeting-recorder.utils.js +73 -0
  35. package/dist/impls/fathom-meeting-recorder.webhooks.d.ts +4 -0
  36. package/dist/impls/fathom-meeting-recorder.webhooks.d.ts.map +1 -0
  37. package/dist/impls/fathom-meeting-recorder.webhooks.js +30 -0
  38. package/dist/impls/fireflies-meeting-recorder.d.ts +24 -0
  39. package/dist/impls/fireflies-meeting-recorder.d.ts.map +1 -0
  40. package/dist/impls/fireflies-meeting-recorder.js +275 -0
  41. package/dist/impls/fireflies-meeting-recorder.queries.d.ts +4 -0
  42. package/dist/impls/fireflies-meeting-recorder.queries.d.ts.map +1 -0
  43. package/dist/impls/fireflies-meeting-recorder.queries.js +86 -0
  44. package/dist/impls/fireflies-meeting-recorder.types.d.ts +32 -0
  45. package/dist/impls/fireflies-meeting-recorder.types.d.ts.map +1 -0
  46. package/dist/impls/fireflies-meeting-recorder.types.js +1 -0
  47. package/dist/impls/fireflies-meeting-recorder.utils.d.ts +5 -0
  48. package/dist/impls/fireflies-meeting-recorder.utils.d.ts.map +1 -0
  49. package/dist/impls/fireflies-meeting-recorder.utils.js +43 -0
  50. package/dist/impls/gcs-storage.d.ts +18 -22
  51. package/dist/impls/gcs-storage.d.ts.map +1 -1
  52. package/dist/impls/gcs-storage.js +92 -84
  53. package/dist/impls/gmail-inbound.d.ts +20 -24
  54. package/dist/impls/gmail-inbound.d.ts.map +1 -1
  55. package/dist/impls/gmail-inbound.js +212 -185
  56. package/dist/impls/gmail-outbound.d.ts +12 -16
  57. package/dist/impls/gmail-outbound.d.ts.map +1 -1
  58. package/dist/impls/gmail-outbound.js +126 -92
  59. package/dist/impls/google-calendar.d.ts +17 -21
  60. package/dist/impls/google-calendar.d.ts.map +1 -1
  61. package/dist/impls/google-calendar.js +182 -145
  62. package/dist/impls/gradium-voice.d.ts +24 -0
  63. package/dist/impls/gradium-voice.d.ts.map +1 -0
  64. package/dist/impls/gradium-voice.js +91 -0
  65. package/dist/impls/granola-meeting-recorder.d.ts +34 -0
  66. package/dist/impls/granola-meeting-recorder.d.ts.map +1 -0
  67. package/dist/impls/granola-meeting-recorder.js +513 -0
  68. package/dist/impls/granola-meeting-recorder.mcp.d.ts +25 -0
  69. package/dist/impls/granola-meeting-recorder.mcp.d.ts.map +1 -0
  70. package/dist/impls/granola-meeting-recorder.mcp.js +279 -0
  71. package/dist/impls/granola-meeting-recorder.types.d.ts +61 -0
  72. package/dist/impls/granola-meeting-recorder.types.d.ts.map +1 -0
  73. package/dist/impls/granola-meeting-recorder.types.js +1 -0
  74. package/dist/impls/index.d.ts +28 -15
  75. package/dist/impls/index.d.ts.map +1 -0
  76. package/dist/impls/index.js +4659 -16
  77. package/dist/impls/jira.d.ts +21 -0
  78. package/dist/impls/jira.d.ts.map +1 -0
  79. package/dist/impls/jira.js +125 -0
  80. package/dist/impls/linear.d.ts +20 -0
  81. package/dist/impls/linear.d.ts.map +1 -0
  82. package/dist/impls/linear.js +84 -0
  83. package/dist/impls/mistral-embedding.d.ts +17 -21
  84. package/dist/impls/mistral-embedding.d.ts.map +1 -1
  85. package/dist/impls/mistral-embedding.js +41 -39
  86. package/dist/impls/mistral-llm.d.ts +25 -29
  87. package/dist/impls/mistral-llm.d.ts.map +1 -1
  88. package/dist/impls/mistral-llm.js +266 -244
  89. package/dist/impls/notion.d.ts +23 -0
  90. package/dist/impls/notion.d.ts.map +1 -0
  91. package/dist/impls/notion.js +161 -0
  92. package/dist/impls/posthog-reader.d.ts +22 -0
  93. package/dist/impls/posthog-reader.d.ts.map +1 -0
  94. package/dist/impls/posthog-reader.js +160 -0
  95. package/dist/impls/posthog-utils.d.ts +5 -0
  96. package/dist/impls/posthog-utils.d.ts.map +1 -0
  97. package/dist/impls/posthog-utils.js +39 -0
  98. package/dist/impls/posthog.d.ts +36 -0
  99. package/dist/impls/posthog.d.ts.map +1 -0
  100. package/dist/impls/posthog.js +323 -0
  101. package/dist/impls/postmark-email.d.ts +13 -17
  102. package/dist/impls/postmark-email.d.ts.map +1 -1
  103. package/dist/impls/postmark-email.js +55 -50
  104. package/dist/impls/powens-client.d.ts +111 -114
  105. package/dist/impls/powens-client.d.ts.map +1 -1
  106. package/dist/impls/powens-client.js +194 -170
  107. package/dist/impls/powens-openbanking.d.ts +22 -26
  108. package/dist/impls/powens-openbanking.d.ts.map +1 -1
  109. package/dist/impls/powens-openbanking.js +425 -217
  110. package/dist/impls/provider-factory.d.ts +29 -25
  111. package/dist/impls/provider-factory.d.ts.map +1 -1
  112. package/dist/impls/provider-factory.js +4074 -136
  113. package/dist/impls/qdrant-vector.d.ts +18 -22
  114. package/dist/impls/qdrant-vector.d.ts.map +1 -1
  115. package/dist/impls/qdrant-vector.js +76 -69
  116. package/dist/impls/stripe-payments.d.ts +22 -26
  117. package/dist/impls/stripe-payments.d.ts.map +1 -1
  118. package/dist/impls/stripe-payments.js +219 -193
  119. package/dist/impls/supabase-psql.d.ts +24 -0
  120. package/dist/impls/supabase-psql.d.ts.map +1 -0
  121. package/dist/impls/supabase-psql.js +151 -0
  122. package/dist/impls/supabase-vector.d.ts +32 -0
  123. package/dist/impls/supabase-vector.d.ts.map +1 -0
  124. package/dist/impls/supabase-vector.js +324 -0
  125. package/dist/impls/tldv-meeting-recorder.d.ts +21 -0
  126. package/dist/impls/tldv-meeting-recorder.d.ts.map +1 -0
  127. package/dist/impls/tldv-meeting-recorder.js +146 -0
  128. package/dist/impls/twilio-sms.d.ts +14 -17
  129. package/dist/impls/twilio-sms.d.ts.map +1 -1
  130. package/dist/impls/twilio-sms.js +62 -55
  131. package/dist/index.d.ts +15 -43
  132. package/dist/index.d.ts.map +1 -1
  133. package/dist/index.js +4700 -69
  134. package/dist/llm.d.ts +1 -7
  135. package/dist/llm.d.ts.map +1 -1
  136. package/dist/llm.js +3 -3
  137. package/dist/meeting-recorder.d.ts +2 -0
  138. package/dist/meeting-recorder.d.ts.map +1 -0
  139. package/dist/meeting-recorder.js +3 -0
  140. package/dist/node/analytics.js +2 -0
  141. package/dist/node/calendar.js +2 -0
  142. package/dist/node/database.js +2 -0
  143. package/dist/node/email.js +2 -0
  144. package/dist/node/embedding.js +2 -0
  145. package/dist/node/impls/elevenlabs-voice.js +102 -0
  146. package/dist/node/impls/fal-voice.js +112 -0
  147. package/dist/node/impls/fathom-meeting-recorder.js +287 -0
  148. package/dist/node/impls/fathom-meeting-recorder.mapper.js +105 -0
  149. package/dist/node/impls/fathom-meeting-recorder.types.js +0 -0
  150. package/dist/node/impls/fathom-meeting-recorder.utils.js +72 -0
  151. package/dist/node/impls/fathom-meeting-recorder.webhooks.js +29 -0
  152. package/dist/node/impls/fireflies-meeting-recorder.js +274 -0
  153. package/dist/node/impls/fireflies-meeting-recorder.queries.js +85 -0
  154. package/dist/node/impls/fireflies-meeting-recorder.types.js +0 -0
  155. package/dist/node/impls/fireflies-meeting-recorder.utils.js +42 -0
  156. package/dist/node/impls/gcs-storage.js +97 -0
  157. package/dist/node/impls/gmail-inbound.js +227 -0
  158. package/dist/node/impls/gmail-outbound.js +139 -0
  159. package/dist/node/impls/google-calendar.js +191 -0
  160. package/dist/node/impls/gradium-voice.js +90 -0
  161. package/dist/node/impls/granola-meeting-recorder.js +512 -0
  162. package/dist/node/impls/granola-meeting-recorder.mcp.js +278 -0
  163. package/dist/node/impls/granola-meeting-recorder.types.js +0 -0
  164. package/dist/node/impls/index.js +4658 -0
  165. package/dist/node/impls/jira.js +124 -0
  166. package/dist/node/impls/linear.js +83 -0
  167. package/dist/node/impls/mistral-embedding.js +43 -0
  168. package/dist/node/impls/mistral-llm.js +269 -0
  169. package/dist/node/impls/notion.js +160 -0
  170. package/dist/node/impls/posthog-reader.js +159 -0
  171. package/dist/node/impls/posthog-utils.js +38 -0
  172. package/dist/node/impls/posthog.js +322 -0
  173. package/dist/node/impls/postmark-email.js +60 -0
  174. package/dist/node/impls/powens-client.js +195 -0
  175. package/dist/node/impls/powens-openbanking.js +426 -0
  176. package/dist/node/impls/provider-factory.js +4080 -0
  177. package/dist/node/impls/qdrant-vector.js +78 -0
  178. package/dist/node/impls/stripe-payments.js +228 -0
  179. package/dist/node/impls/supabase-psql.js +150 -0
  180. package/dist/node/impls/supabase-vector.js +323 -0
  181. package/dist/node/impls/tldv-meeting-recorder.js +145 -0
  182. package/dist/node/impls/twilio-sms.js +65 -0
  183. package/dist/node/index.js +4699 -0
  184. package/dist/node/llm.js +2 -0
  185. package/dist/node/meeting-recorder.js +2 -0
  186. package/dist/node/openbanking.js +2 -0
  187. package/dist/node/payments.js +2 -0
  188. package/dist/node/project-management.js +2 -0
  189. package/dist/node/runtime.js +0 -0
  190. package/dist/node/secrets/provider.js +11 -0
  191. package/dist/node/sms.js +2 -0
  192. package/dist/node/storage.js +2 -0
  193. package/dist/node/vector-store.js +2 -0
  194. package/dist/node/voice.js +2 -0
  195. package/dist/openbanking.d.ts +1 -7
  196. package/dist/openbanking.d.ts.map +1 -1
  197. package/dist/openbanking.js +3 -3
  198. package/dist/payments.d.ts +1 -7
  199. package/dist/payments.d.ts.map +1 -1
  200. package/dist/payments.js +3 -3
  201. package/dist/project-management.d.ts +2 -0
  202. package/dist/project-management.d.ts.map +1 -0
  203. package/dist/project-management.js +3 -0
  204. package/dist/runtime.d.ts +2 -2
  205. package/dist/runtime.d.ts.map +1 -0
  206. package/dist/runtime.js +1 -0
  207. package/dist/secrets/provider.d.ts +3 -2
  208. package/dist/secrets/provider.d.ts.map +1 -0
  209. package/dist/secrets/provider.js +12 -3
  210. package/dist/sms.d.ts +1 -7
  211. package/dist/sms.d.ts.map +1 -1
  212. package/dist/sms.js +3 -3
  213. package/dist/storage.d.ts +1 -7
  214. package/dist/storage.d.ts.map +1 -1
  215. package/dist/storage.js +3 -3
  216. package/dist/vector-store.d.ts +1 -7
  217. package/dist/vector-store.d.ts.map +1 -1
  218. package/dist/vector-store.js +3 -3
  219. package/dist/voice.d.ts +1 -7
  220. package/dist/voice.d.ts.map +1 -1
  221. package/dist/voice.js +3 -3
  222. package/package.json +419 -76
  223. package/dist/_virtual/rolldown_runtime.js +0 -36
  224. package/dist/impls/elevenlabs-voice.js.map +0 -1
  225. package/dist/impls/gcs-storage.js.map +0 -1
  226. package/dist/impls/gmail-inbound.js.map +0 -1
  227. package/dist/impls/gmail-outbound.js.map +0 -1
  228. package/dist/impls/google-calendar.js.map +0 -1
  229. package/dist/impls/mistral-embedding.js.map +0 -1
  230. package/dist/impls/mistral-llm.js.map +0 -1
  231. package/dist/impls/postmark-email.js.map +0 -1
  232. package/dist/impls/powens-client.js.map +0 -1
  233. package/dist/impls/powens-openbanking.js.map +0 -1
  234. package/dist/impls/provider-factory.js.map +0 -1
  235. package/dist/impls/qdrant-vector.js.map +0 -1
  236. package/dist/impls/stripe-payments.js.map +0 -1
  237. package/dist/impls/twilio-sms.js.map +0 -1
  238. 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 { storage_d_exports } from "../storage.js";
2
- import { Storage, StorageOptions } from "@google-cloud/storage";
3
-
4
- //#region src/impls/gcs-storage.d.ts
5
- interface GoogleCloudStorageProviderOptions {
6
- bucket: string;
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 storage_d_exports.ObjectStorageProvider {
11
- private readonly storage;
12
- private readonly bucketName;
13
- constructor(options: GoogleCloudStorageProviderOptions);
14
- putObject(input: storage_d_exports.PutObjectInput): Promise<storage_d_exports.StorageObjectMetadata>;
15
- getObject(input: storage_d_exports.DeleteObjectInput): Promise<storage_d_exports.GetObjectResult | null>;
16
- deleteObject(input: storage_d_exports.DeleteObjectInput): Promise<void>;
17
- generateSignedUrl(options: storage_d_exports.SignedUrlOptions): Promise<{
18
- url: string;
19
- expiresAt: Date;
20
- }>;
21
- listObjects(query: storage_d_exports.ListObjectsQuery): Promise<storage_d_exports.ListObjectsResult>;
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","names":[],"sources":["../../src/impls/gcs-storage.ts"],"sourcesContent":[],"mappings":";;;;UAaiB,iCAAA;;EAAA,OAAA,CAAA,EAEL,OAFK;EAMJ,aAAA,CAAA,EAHK,cAGsB;;AAUf,cAVZ,0BAAA,YAAsC,iBAAA,CAAA,qBAU1B,CAAA;EAAyB,iBAAA,OAAA;EAAR,iBAAA,UAAA;EAiBjB,WAAA,CAAA,OAAA,EAvBF,iCAuBE;EAA4B,SAAA,CAAA,KAAA,EAjB5B,iBAAA,CAAA,cAiB4B,CAAA,EAjBX,OAiBW,CAjBH,iBAAA,CAAA,qBAiBG,CAAA;EAAR,SAAA,CAAA,KAAA,EAApB,iBAAA,CAAA,iBAAoB,CAAA,EAAA,OAAA,CAAQ,iBAAA,CAAA,eAAR,GAAA,IAAA,CAAA;EAcjB,YAAA,CAAA,KAAA,EAAA,iBAAA,CAAA,iBAAA,CAAA,EAAoB,OAApB,CAAA,IAAA,CAAA;EAAoB,iBAAA,CAAA,OAAA,EAOb,iBAAA,CAAA,gBAPa,CAAA,EAOM,OAPN,CAAA;IAOb,GAAA,EAAA,MAAA;IAEpB,SAAA,EAAA,IAAA;EAFuC,CAAA,CAAA;EAiB3B,WAAA,CAAA,KAAA,EAAA,iBAAA,CAAA,gBAAA,CAAA,EAAmB,OAAnB,CAA2B,iBAAA,CAAA,iBAA3B,CAAA"}
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"}