fireflies-api 0.5.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 (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -0
  3. package/dist/action-items-CC9yUxHY.d.cts +380 -0
  4. package/dist/action-items-CC9yUxHY.d.ts +380 -0
  5. package/dist/cli/index.cjs +3909 -0
  6. package/dist/cli/index.cjs.map +1 -0
  7. package/dist/cli/index.d.cts +2 -0
  8. package/dist/cli/index.d.ts +2 -0
  9. package/dist/cli/index.js +3906 -0
  10. package/dist/cli/index.js.map +1 -0
  11. package/dist/index.cjs +3389 -0
  12. package/dist/index.cjs.map +1 -0
  13. package/dist/index.d.cts +966 -0
  14. package/dist/index.d.ts +966 -0
  15. package/dist/index.js +3344 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/middleware/express.cjs +2491 -0
  18. package/dist/middleware/express.cjs.map +1 -0
  19. package/dist/middleware/express.d.cts +36 -0
  20. package/dist/middleware/express.d.ts +36 -0
  21. package/dist/middleware/express.js +2489 -0
  22. package/dist/middleware/express.js.map +1 -0
  23. package/dist/middleware/fastify.cjs +2501 -0
  24. package/dist/middleware/fastify.cjs.map +1 -0
  25. package/dist/middleware/fastify.d.cts +66 -0
  26. package/dist/middleware/fastify.d.ts +66 -0
  27. package/dist/middleware/fastify.js +2498 -0
  28. package/dist/middleware/fastify.js.map +1 -0
  29. package/dist/middleware/hono.cjs +2493 -0
  30. package/dist/middleware/hono.cjs.map +1 -0
  31. package/dist/middleware/hono.d.cts +37 -0
  32. package/dist/middleware/hono.d.ts +37 -0
  33. package/dist/middleware/hono.js +2490 -0
  34. package/dist/middleware/hono.js.map +1 -0
  35. package/dist/schemas/index.cjs +307 -0
  36. package/dist/schemas/index.cjs.map +1 -0
  37. package/dist/schemas/index.d.cts +926 -0
  38. package/dist/schemas/index.d.ts +926 -0
  39. package/dist/schemas/index.js +268 -0
  40. package/dist/schemas/index.js.map +1 -0
  41. package/dist/speaker-analytics-Dr46LKyP.d.ts +275 -0
  42. package/dist/speaker-analytics-l45LXqO1.d.cts +275 -0
  43. package/dist/types-BX-3JcRI.d.cts +41 -0
  44. package/dist/types-C_XxdRd1.d.cts +1546 -0
  45. package/dist/types-CaHcwnKw.d.ts +41 -0
  46. package/dist/types-DIPZmUl3.d.ts +1546 -0
  47. package/package.json +126 -0
@@ -0,0 +1,1546 @@
1
+ import { T as Transcript, b as ActionItem, l as Summary } from './action-items-CC9yUxHY.cjs';
2
+
3
+ /**
4
+ * Meeting state for active meetings.
5
+ */
6
+ type MeetingState = 'active' | 'paused';
7
+ /**
8
+ * Privacy setting for meetings.
9
+ */
10
+ type MeetingPrivacy = 'public' | 'team' | 'private';
11
+ /**
12
+ * Active meeting in progress.
13
+ */
14
+ interface ActiveMeeting {
15
+ id: string;
16
+ title: string;
17
+ organizer_email: string;
18
+ meeting_link?: string;
19
+ start_time?: string;
20
+ end_time?: string;
21
+ privacy?: MeetingPrivacy;
22
+ state: MeetingState;
23
+ }
24
+
25
+ /**
26
+ * Scope for transcript search queries.
27
+ */
28
+ type TranscriptsQueryScope = 'title' | 'sentences' | 'all';
29
+ /**
30
+ * Parameters for listing transcripts.
31
+ */
32
+ interface TranscriptsListParams {
33
+ /**
34
+ * Search keyword. Searches title and/or content based on scope.
35
+ * This is the recommended search parameter (replaces title).
36
+ */
37
+ keyword?: string;
38
+ /**
39
+ * Where to search for the keyword.
40
+ * - 'title': Search only in titles
41
+ * - 'sentences': Search only in transcript content
42
+ * - 'all': Search in both title and content
43
+ * @default 'all'
44
+ */
45
+ scope?: TranscriptsQueryScope;
46
+ /**
47
+ * Filter by organizer emails (array).
48
+ * Use this instead of the deprecated organizer_email.
49
+ */
50
+ organizers?: string[];
51
+ /**
52
+ * Filter by participant emails (array).
53
+ * Use this instead of the deprecated participant_email.
54
+ */
55
+ participants?: string[];
56
+ /**
57
+ * Filter by specific user ID.
58
+ */
59
+ user_id?: string;
60
+ /**
61
+ * Only return transcripts owned by the authenticated user.
62
+ */
63
+ mine?: boolean;
64
+ /**
65
+ * Filter by channel ID (v2.11.0+).
66
+ */
67
+ channel_id?: string;
68
+ /**
69
+ * Start of date range (ISO 8601 string).
70
+ * Returns transcripts from this date onwards.
71
+ */
72
+ fromDate?: string;
73
+ /**
74
+ * End of date range (ISO 8601 string).
75
+ * Returns transcripts up to this date.
76
+ */
77
+ toDate?: string;
78
+ /**
79
+ * Maximum number of transcripts to return.
80
+ * @default 50
81
+ * @max 50
82
+ */
83
+ limit?: number;
84
+ /**
85
+ * Number of transcripts to skip (for pagination).
86
+ * @default 0
87
+ */
88
+ skip?: number;
89
+ /**
90
+ * Search by title only.
91
+ * @deprecated Use keyword with scope='title' instead.
92
+ */
93
+ title?: string;
94
+ /**
95
+ * Filter by host email.
96
+ * @deprecated Use organizers instead.
97
+ */
98
+ host_email?: string;
99
+ /**
100
+ * Filter by organizer email (single).
101
+ * @deprecated Use organizers array instead.
102
+ */
103
+ organizer_email?: string;
104
+ /**
105
+ * Filter by participant email (single).
106
+ * @deprecated Use participants array instead.
107
+ */
108
+ participant_email?: string;
109
+ /**
110
+ * Filter by date (Unix timestamp).
111
+ * @deprecated Use fromDate and toDate instead.
112
+ */
113
+ date?: number;
114
+ }
115
+ /**
116
+ * Parameters for transcript insights analysis.
117
+ * Combines filtering options (for fetching) with analysis options.
118
+ */
119
+ interface TranscriptsInsightsParams {
120
+ /** Start of date range (ISO 8601 string) */
121
+ fromDate?: string;
122
+ /** End of date range (ISO 8601 string) */
123
+ toDate?: string;
124
+ /** Only analyze transcripts owned by the authenticated user */
125
+ mine?: boolean;
126
+ /** Filter by organizer emails */
127
+ organizers?: string[];
128
+ /** Filter by participant emails */
129
+ participants?: string[];
130
+ /** Filter by specific user ID */
131
+ user_id?: string;
132
+ /** Filter by channel ID */
133
+ channel_id?: string;
134
+ /** Maximum number of transcripts to analyze (default: no limit) */
135
+ limit?: number;
136
+ /**
137
+ * Only include meetings with external participants.
138
+ * External means participants whose email domain differs from the current user's domain.
139
+ * When true, fetches the current user's email to determine the internal domain.
140
+ */
141
+ external?: boolean;
142
+ /**
143
+ * Only include stats for these speakers.
144
+ * Speaker names must match exactly (case-sensitive).
145
+ */
146
+ speakers?: string[];
147
+ /**
148
+ * Group results by time period.
149
+ * - 'day': Group by calendar day
150
+ * - 'week': Group by ISO week
151
+ * - 'month': Group by month
152
+ */
153
+ groupBy?: 'day' | 'week' | 'month';
154
+ /** Number of top speakers to include (default: 10) */
155
+ topSpeakersCount?: number;
156
+ /** Number of top participants to include (default: 10) */
157
+ topParticipantsCount?: number;
158
+ }
159
+ /**
160
+ * Parameters for getting a single transcript.
161
+ */
162
+ interface TranscriptGetParams {
163
+ /**
164
+ * Include the full sentences array.
165
+ * Set to false for faster response when you only need metadata.
166
+ * @default true
167
+ */
168
+ includeSentences?: boolean;
169
+ /**
170
+ * Include the summary object.
171
+ * @default true
172
+ */
173
+ includeSummary?: boolean;
174
+ }
175
+ /**
176
+ * Parameters for listing bites.
177
+ */
178
+ interface BitesListParams {
179
+ /** Filter by transcript ID */
180
+ transcript_id?: string;
181
+ /** Only my bites */
182
+ mine?: boolean;
183
+ /** All team bites */
184
+ my_team?: boolean;
185
+ /** Max results (max 50) */
186
+ limit?: number;
187
+ /** Pagination offset */
188
+ skip?: number;
189
+ }
190
+ /**
191
+ * Parameters for creating a bite.
192
+ */
193
+ interface CreateBiteParams {
194
+ /** Transcript ID */
195
+ transcript_id: string;
196
+ /** Start time in seconds */
197
+ start_time: number;
198
+ /** End time in seconds */
199
+ end_time: number;
200
+ /** Bite name (max 256 chars) */
201
+ name?: string;
202
+ /** Media type: 'video' or 'audio' */
203
+ media_type?: 'video' | 'audio';
204
+ /** Summary (max 500 chars) */
205
+ summary?: string;
206
+ /** Privacy settings */
207
+ privacies?: Array<'public' | 'team' | 'participants'>;
208
+ }
209
+ /**
210
+ * Parameters for listing active meetings.
211
+ */
212
+ interface ActiveMeetingsParams {
213
+ /** Filter by user email (admin only for other users) */
214
+ email?: string;
215
+ /** Filter by state */
216
+ states?: MeetingState[];
217
+ }
218
+ /**
219
+ * Parameters for adding a bot to a meeting.
220
+ */
221
+ interface AddBotParams {
222
+ /** Meeting URL (Zoom, Google Meet, etc.) */
223
+ meeting_link: string;
224
+ /** Meeting title (max 256 chars) */
225
+ title?: string;
226
+ /** Meeting password (max 32 chars) */
227
+ password?: string;
228
+ /** Duration in minutes (15-120, default 60) */
229
+ duration?: number;
230
+ /** Language code */
231
+ language?: string;
232
+ }
233
+ /**
234
+ * Attendee for audio upload.
235
+ */
236
+ interface UploadAudioAttendee {
237
+ displayName?: string;
238
+ email?: string;
239
+ phoneNumber?: string;
240
+ }
241
+ /**
242
+ * Parameters for uploading audio for transcription.
243
+ */
244
+ interface UploadAudioParams {
245
+ /** Public URL of audio/video file */
246
+ url: string;
247
+ /** Title for the transcript (max 256 chars) */
248
+ title?: string;
249
+ /** Webhook URL for completion notification */
250
+ webhook?: string;
251
+ /** Language code */
252
+ custom_language?: string;
253
+ /** Save video if applicable */
254
+ save_video?: boolean;
255
+ /** Meeting attendees */
256
+ attendees?: UploadAudioAttendee[];
257
+ /** Custom reference ID (max 128 chars) */
258
+ client_reference_id?: string;
259
+ /** Allow files < 50kb */
260
+ bypass_size_check?: boolean;
261
+ }
262
+ /**
263
+ * Parameters for listing AI App outputs.
264
+ */
265
+ interface AIAppsListParams {
266
+ /** Filter by app ID */
267
+ app_id?: string;
268
+ /** Filter by transcript ID */
269
+ transcript_id?: string;
270
+ /** Max results (max 10) */
271
+ limit?: number;
272
+ /** Pagination offset */
273
+ skip?: number;
274
+ }
275
+
276
+ /**
277
+ * Configuration options for the Fireflies client.
278
+ */
279
+ interface FirefliesConfig {
280
+ /**
281
+ * Your Fireflies API key.
282
+ * Get one from: https://app.fireflies.ai/integrations/custom/fireflies
283
+ */
284
+ apiKey: string;
285
+ /**
286
+ * Base URL for the GraphQL API.
287
+ * @default 'https://api.fireflies.ai/graphql'
288
+ */
289
+ baseUrl?: string;
290
+ /**
291
+ * Request timeout in milliseconds.
292
+ * @default 30000
293
+ */
294
+ timeout?: number;
295
+ /**
296
+ * Retry configuration for transient failures.
297
+ */
298
+ retry?: RetryConfig;
299
+ /**
300
+ * Rate limit tracking and throttling configuration.
301
+ * Optional - if not provided, rate limit headers are not tracked.
302
+ */
303
+ rateLimit?: RateLimitConfig;
304
+ }
305
+ /**
306
+ * Configuration for retry behavior on transient failures.
307
+ */
308
+ interface RetryConfig {
309
+ /**
310
+ * Maximum number of retry attempts.
311
+ * @default 3
312
+ */
313
+ maxRetries?: number;
314
+ /**
315
+ * Base delay between retries in milliseconds.
316
+ * @default 1000
317
+ */
318
+ baseDelay?: number;
319
+ /**
320
+ * Maximum delay between retries in milliseconds.
321
+ * @default 30000
322
+ */
323
+ maxDelay?: number;
324
+ }
325
+ /**
326
+ * Current rate limit state from API responses.
327
+ */
328
+ interface RateLimitState {
329
+ /**
330
+ * Remaining requests in current window (from x-ratelimit-remaining-api header).
331
+ * Undefined if header was not present in the last response.
332
+ */
333
+ remaining?: number;
334
+ /**
335
+ * Maximum requests allowed in current window (from x-ratelimit-limit-api header).
336
+ * Undefined if header was not present in the last response.
337
+ */
338
+ limit?: number;
339
+ /**
340
+ * Seconds until the rate limit window resets (from x-ratelimit-reset-api header).
341
+ * Undefined if header was not present in the last response.
342
+ */
343
+ resetInSeconds?: number;
344
+ /**
345
+ * Timestamp (ms since epoch) when this state was last updated.
346
+ */
347
+ updatedAt: number;
348
+ }
349
+ /**
350
+ * Configuration for adaptive throttling behavior.
351
+ * When enabled, requests are proactively delayed when approaching rate limits.
352
+ */
353
+ interface ThrottleConfig {
354
+ /**
355
+ * Enable adaptive throttling.
356
+ * Must be explicitly set to true to enable.
357
+ */
358
+ enabled: boolean;
359
+ /**
360
+ * Start throttling when remaining requests falls below this threshold.
361
+ * @default 20
362
+ */
363
+ startThreshold?: number;
364
+ /**
365
+ * Minimum delay between requests in milliseconds.
366
+ * @default 100
367
+ */
368
+ minDelay?: number;
369
+ /**
370
+ * Maximum delay when nearly exhausted in milliseconds.
371
+ * @default 2000
372
+ */
373
+ maxDelay?: number;
374
+ }
375
+ /**
376
+ * Configuration for rate limit tracking and callbacks.
377
+ */
378
+ interface RateLimitConfig {
379
+ /**
380
+ * Called after each request with the updated rate limit state.
381
+ */
382
+ onUpdate?: (state: RateLimitState) => void;
383
+ /**
384
+ * Called when remaining requests falls below the warning threshold.
385
+ */
386
+ onWarning?: (state: RateLimitState) => void;
387
+ /**
388
+ * Called when a 429 rate limit error is received.
389
+ * @param state - Current rate limit state
390
+ * @param retryAfter - Seconds to wait before retrying (if provided by server)
391
+ */
392
+ onRateLimited?: (state: RateLimitState, retryAfter?: number) => void;
393
+ /**
394
+ * Warning threshold for remaining requests.
395
+ * When remaining falls below this, onWarning is called.
396
+ * @default 10
397
+ */
398
+ warningThreshold?: number;
399
+ /**
400
+ * Optional adaptive throttling configuration.
401
+ * Disabled by default.
402
+ */
403
+ throttle?: ThrottleConfig;
404
+ }
405
+
406
+ /**
407
+ * Result from audio upload.
408
+ */
409
+ interface UploadAudioResult {
410
+ success: boolean;
411
+ title: string;
412
+ message: string;
413
+ }
414
+ /**
415
+ * API for audio operations.
416
+ */
417
+ interface AudioAPI {
418
+ /**
419
+ * Upload audio/video file for transcription.
420
+ *
421
+ * @param params - Upload parameters
422
+ * @returns Upload result
423
+ */
424
+ upload(params: UploadAudioParams): Promise<UploadAudioResult>;
425
+ }
426
+
427
+ /**
428
+ * API for transcript mutations.
429
+ */
430
+ interface TranscriptsMutationsAPI {
431
+ /**
432
+ * Delete a transcript.
433
+ *
434
+ * Rate limit: 10/min
435
+ *
436
+ * @param id - Transcript ID to delete
437
+ * @returns Deleted transcript (partial fields)
438
+ */
439
+ delete(id: string): Promise<Transcript>;
440
+ }
441
+
442
+ /**
443
+ * User role in Fireflies.
444
+ */
445
+ type UserRole = 'admin' | 'user';
446
+ /**
447
+ * User group member.
448
+ */
449
+ interface UserGroupMember {
450
+ user_id: string;
451
+ email: string;
452
+ }
453
+ /**
454
+ * User group.
455
+ */
456
+ interface UserGroup {
457
+ id: string;
458
+ name: string;
459
+ handle: string;
460
+ members: UserGroupMember[];
461
+ }
462
+ /**
463
+ * Full user profile.
464
+ */
465
+ interface UserProfile {
466
+ /** User ID */
467
+ user_id: string;
468
+ /** Also returned as 'id' by setUserRole mutation */
469
+ id?: string;
470
+ /** User's email address */
471
+ email: string;
472
+ /** User's display name */
473
+ name: string;
474
+ /** Role (returned by setUserRole) */
475
+ role?: UserRole;
476
+ /** Number of transcripts */
477
+ num_transcripts?: number;
478
+ /** Recent meeting timestamp */
479
+ recent_meeting?: string;
480
+ /** Recent transcript ID */
481
+ recent_transcript?: string;
482
+ /** Minutes consumed */
483
+ minutes_consumed?: number;
484
+ /** Whether user is admin */
485
+ is_admin?: boolean;
486
+ /** Connected integrations */
487
+ integrations?: string[] | null;
488
+ /** User groups */
489
+ user_groups?: UserGroup[];
490
+ }
491
+
492
+ /**
493
+ * API for user mutations.
494
+ */
495
+ interface UsersMutationsAPI {
496
+ /**
497
+ * Set user role (admin or user).
498
+ *
499
+ * @param userId - User ID to update
500
+ * @param role - New role
501
+ * @returns Updated user (partial fields)
502
+ */
503
+ setRole(userId: string, role: UserRole): Promise<UserProfile>;
504
+ }
505
+
506
+ /**
507
+ * AI App output for a transcript.
508
+ */
509
+ interface AIApp {
510
+ transcript_id: string;
511
+ user_id: string;
512
+ app_id: string;
513
+ created_at: string;
514
+ title: string;
515
+ prompt: string;
516
+ response: string;
517
+ }
518
+
519
+ /**
520
+ * API for AI Apps operations.
521
+ */
522
+ interface AIAppsAPI {
523
+ /**
524
+ * List AI App outputs.
525
+ *
526
+ * @param params - Optional filter and pagination parameters
527
+ * @returns Array of AI App outputs
528
+ */
529
+ list(params?: AIAppsListParams): Promise<AIApp[]>;
530
+ /**
531
+ * Iterate through all AI App outputs matching the filter.
532
+ * Automatically handles pagination.
533
+ *
534
+ * @param params - Filter options (skip and limit are ignored)
535
+ * @returns Async iterable of AI App outputs
536
+ */
537
+ listAll(params?: Omit<AIAppsListParams, 'skip' | 'limit'>): AsyncIterable<AIApp>;
538
+ }
539
+
540
+ /**
541
+ * Caption entry in a bite.
542
+ */
543
+ interface BiteCaption {
544
+ index: number;
545
+ text: string;
546
+ start_time: number;
547
+ end_time: number;
548
+ speaker_id: string;
549
+ speaker_name: string;
550
+ }
551
+ /**
552
+ * Media source for a bite.
553
+ */
554
+ interface BiteSource {
555
+ src: string;
556
+ type: string;
557
+ }
558
+ /**
559
+ * User info in bite.
560
+ */
561
+ interface BiteUser {
562
+ id: string;
563
+ name: string;
564
+ first_name: string;
565
+ last_name: string;
566
+ picture?: string;
567
+ }
568
+ /**
569
+ * Creation source info.
570
+ */
571
+ interface BiteCreatedFrom {
572
+ id: string;
573
+ name: string;
574
+ type: string;
575
+ description?: string;
576
+ duration?: number;
577
+ }
578
+ /**
579
+ * Soundbite/clip from a transcript.
580
+ */
581
+ interface Bite {
582
+ id: string;
583
+ transcript_id: string;
584
+ user_id: string;
585
+ name: string;
586
+ status: string;
587
+ summary?: string;
588
+ summary_status?: string;
589
+ media_type: string;
590
+ start_time: number;
591
+ end_time: number;
592
+ created_at: string;
593
+ thumbnail?: string;
594
+ preview?: string;
595
+ captions: BiteCaption[];
596
+ sources: BiteSource[];
597
+ user?: BiteUser;
598
+ created_from?: BiteCreatedFrom;
599
+ privacies?: string[];
600
+ }
601
+
602
+ /**
603
+ * API for bite (soundbite/clip) operations.
604
+ */
605
+ interface BitesAPI {
606
+ /**
607
+ * Get a single bite by ID.
608
+ *
609
+ * @param id - Bite ID
610
+ * @returns Bite details
611
+ */
612
+ get(id: string): Promise<Bite>;
613
+ /**
614
+ * List bites with filtering.
615
+ *
616
+ * @param params - Filter and pagination options
617
+ * @returns Array of bites (max 50 per call)
618
+ */
619
+ list(params: BitesListParams): Promise<Bite[]>;
620
+ /**
621
+ * Iterate through all bites matching the filter.
622
+ * Automatically handles pagination.
623
+ *
624
+ * @param params - Filter options (skip and limit are ignored)
625
+ * @returns Async iterable of bites
626
+ */
627
+ listAll(params: Omit<BitesListParams, 'skip' | 'limit'>): AsyncIterable<Bite>;
628
+ /**
629
+ * Create a new bite from a transcript.
630
+ *
631
+ * @param params - Bite creation parameters
632
+ * @returns Created bite (partial fields)
633
+ */
634
+ create(params: CreateBiteParams): Promise<Bite>;
635
+ }
636
+
637
+ /**
638
+ * API for meeting operations.
639
+ */
640
+ interface MeetingsAPI {
641
+ /**
642
+ * List active meetings in progress.
643
+ *
644
+ * @param params - Optional filter parameters
645
+ * @returns Array of active meetings
646
+ */
647
+ active(params?: ActiveMeetingsParams): Promise<ActiveMeeting[]>;
648
+ /**
649
+ * Add Fireflies bot to a live meeting.
650
+ *
651
+ * @param params - Meeting parameters
652
+ * @returns Success result
653
+ */
654
+ addBot(params: AddBotParams): Promise<{
655
+ success: boolean;
656
+ }>;
657
+ }
658
+
659
+ /**
660
+ * Style for formatting action items in Markdown.
661
+ */
662
+ type ActionItemStyle = 'checkbox' | 'bullet' | 'numbered';
663
+ /**
664
+ * How to group action items in output.
665
+ */
666
+ type ActionItemGrouping = 'none' | 'assignee' | 'transcript' | 'date';
667
+ /**
668
+ * Preset formatting styles for different tools.
669
+ */
670
+ type ActionItemPreset = 'default' | 'notion' | 'obsidian' | 'github';
671
+ /**
672
+ * Options for formatting action items as Markdown.
673
+ */
674
+ interface ActionItemsMarkdownOptions {
675
+ /** List item style: checkbox (- [ ]), bullet (-), or numbered (1.) */
676
+ style?: ActionItemStyle;
677
+ /** Group items by: none, assignee, transcript, or date */
678
+ groupBy?: ActionItemGrouping;
679
+ /** Show assignee inline (e.g., @Alice) */
680
+ includeAssignee?: boolean;
681
+ /** Show due date inline (e.g., due: Friday) */
682
+ includeDueDate?: boolean;
683
+ /** Show meeting title for each item */
684
+ includeMeetingTitle?: boolean;
685
+ /** Include summary statistics at the top */
686
+ includeSummary?: boolean;
687
+ /** Formatting preset for specific tools */
688
+ preset?: ActionItemPreset;
689
+ }
690
+ /**
691
+ * Options for filtering action items.
692
+ */
693
+ interface ActionItemsFilterOptions {
694
+ /** Filter to items assigned to these people (case-insensitive) */
695
+ assignees?: string[];
696
+ /** Only include items with an assignee */
697
+ assignedOnly?: boolean;
698
+ /** Only include items with a due date */
699
+ datedOnly?: boolean;
700
+ }
701
+ /**
702
+ * An action item with metadata from its source transcript.
703
+ */
704
+ interface AggregatedActionItem extends ActionItem {
705
+ /** ID of the source transcript */
706
+ transcriptId: string;
707
+ /** Title of the source transcript */
708
+ transcriptTitle: string;
709
+ /** Date string of the source transcript (YYYY-MM-DD format or similar) */
710
+ transcriptDate: string;
711
+ }
712
+ /**
713
+ * Result of aggregating action items across multiple transcripts.
714
+ */
715
+ interface AggregatedActionItemsResult {
716
+ /** All aggregated action items */
717
+ items: AggregatedActionItem[];
718
+ /** Total count of action items */
719
+ totalItems: number;
720
+ /** Number of transcripts processed */
721
+ transcriptsProcessed: number;
722
+ /** Number of transcripts that had action items */
723
+ transcriptsWithItems: number;
724
+ /** Count of items with assignees */
725
+ assignedItems: number;
726
+ /** Count of items with due dates */
727
+ datedItems: number;
728
+ /** Unique assignees found across all items */
729
+ assignees: string[];
730
+ /** Date range of source transcripts */
731
+ dateRange: {
732
+ earliest: string;
733
+ latest: string;
734
+ };
735
+ }
736
+ /**
737
+ * Parameters for exporting action items via SDK.
738
+ */
739
+ interface ExportActionItemsParams {
740
+ /** Start date for transcript filter (ISO 8601) */
741
+ fromDate?: string;
742
+ /** End date for transcript filter (ISO 8601) */
743
+ toDate?: string;
744
+ /** Only transcripts owned by authenticated user */
745
+ mine?: boolean;
746
+ /** Filter by organizer emails */
747
+ organizers?: string[];
748
+ /** Filter by participant emails */
749
+ participants?: string[];
750
+ /** Maximum transcripts to process */
751
+ limit?: number;
752
+ /** Filter options for action items themselves */
753
+ filterOptions?: ActionItemsFilterOptions;
754
+ }
755
+
756
+ /**
757
+ * Options for the analyzeMeetings helper function.
758
+ */
759
+ interface MeetingInsightsOptions {
760
+ /**
761
+ * Only include stats for these speakers.
762
+ * Speaker names must match exactly (case-sensitive).
763
+ */
764
+ speakers?: string[];
765
+ /**
766
+ * Group results by time period.
767
+ * - 'day': Group by calendar day (YYYY-MM-DD)
768
+ * - 'week': Group by ISO week (YYYY-Www)
769
+ * - 'month': Group by month (YYYY-MM)
770
+ */
771
+ groupBy?: 'day' | 'week' | 'month';
772
+ /**
773
+ * Number of top speakers to include in results.
774
+ * @default 10
775
+ */
776
+ topSpeakersCount?: number;
777
+ /**
778
+ * Number of top participants to include in results.
779
+ * @default 10
780
+ */
781
+ topParticipantsCount?: number;
782
+ }
783
+ /**
784
+ * Aggregate meeting statistics across multiple transcripts.
785
+ */
786
+ interface MeetingInsights {
787
+ /** Total number of meetings analyzed */
788
+ totalMeetings: number;
789
+ /** Sum of all meeting durations in minutes */
790
+ totalDurationMinutes: number;
791
+ /** Average meeting duration in minutes */
792
+ averageDurationMinutes: number;
793
+ /** Meeting distribution by day of week */
794
+ byDayOfWeek: DayOfWeekStats;
795
+ /** Meeting distribution by time period (if groupBy specified) */
796
+ byTimeGroup?: TimeGroupStats[];
797
+ /** Number of unique participants across all meetings */
798
+ totalUniqueParticipants: number;
799
+ /** Average number of participants per meeting */
800
+ averageParticipantsPerMeeting: number;
801
+ /** Top participants by meeting count */
802
+ topParticipants: ParticipantStats[];
803
+ /** Number of unique speakers across all meetings */
804
+ totalUniqueSpeakers: number;
805
+ /** Top speakers by talk time */
806
+ topSpeakers: SpeakerInsightStats[];
807
+ /** ISO date of the earliest meeting */
808
+ earliestMeeting: string;
809
+ /** ISO date of the latest meeting */
810
+ latestMeeting: string;
811
+ }
812
+ /**
813
+ * Meeting statistics grouped by day of week.
814
+ */
815
+ interface DayOfWeekStats {
816
+ monday: DayStats;
817
+ tuesday: DayStats;
818
+ wednesday: DayStats;
819
+ thursday: DayStats;
820
+ friday: DayStats;
821
+ saturday: DayStats;
822
+ sunday: DayStats;
823
+ }
824
+ /**
825
+ * Statistics for a single day of week.
826
+ */
827
+ interface DayStats {
828
+ /** Number of meetings on this day */
829
+ count: number;
830
+ /** Total duration of meetings on this day in minutes */
831
+ totalMinutes: number;
832
+ }
833
+ /**
834
+ * Meeting statistics grouped by time period.
835
+ */
836
+ interface TimeGroupStats {
837
+ /**
838
+ * Period identifier:
839
+ * - For 'day': "YYYY-MM-DD" (e.g., "2024-01-15")
840
+ * - For 'week': "YYYY-Www" (e.g., "2024-W03")
841
+ * - For 'month': "YYYY-MM" (e.g., "2024-01")
842
+ */
843
+ period: string;
844
+ /** Number of meetings in this period */
845
+ count: number;
846
+ /** Total duration of meetings in this period in minutes */
847
+ totalMinutes: number;
848
+ /** Average meeting duration in this period in minutes */
849
+ averageMinutes: number;
850
+ }
851
+ /**
852
+ * Statistics for a single participant.
853
+ */
854
+ interface ParticipantStats {
855
+ /** Participant email address */
856
+ email: string;
857
+ /** Number of meetings this participant attended */
858
+ meetingCount: number;
859
+ /** Total time spent in meetings in minutes */
860
+ totalMinutes: number;
861
+ }
862
+ /**
863
+ * Statistics for a single speaker.
864
+ */
865
+ interface SpeakerInsightStats {
866
+ /** Speaker name from transcript */
867
+ name: string;
868
+ /** Number of meetings where this speaker spoke */
869
+ meetingCount: number;
870
+ /** Total talk time in seconds */
871
+ totalTalkTimeSeconds: number;
872
+ /** Average talk time per meeting in seconds */
873
+ averageTalkTimeSeconds: number;
874
+ }
875
+
876
+ /**
877
+ * Search-related types for searching across transcript content.
878
+ */
879
+ /**
880
+ * Options for searching transcripts.
881
+ */
882
+ interface SearchParams {
883
+ /**
884
+ * Whether to match case when searching.
885
+ * @default false
886
+ */
887
+ caseSensitive?: boolean;
888
+ /**
889
+ * Where to search: 'title' searches transcript titles only,
890
+ * 'sentences' searches transcript content, 'all' searches both.
891
+ * @default 'sentences'
892
+ */
893
+ scope?: 'title' | 'sentences' | 'all';
894
+ /**
895
+ * Filter results to only include sentences from these speakers.
896
+ * Case-insensitive matching.
897
+ */
898
+ speakers?: string[];
899
+ /**
900
+ * Only include sentences marked as questions by AI.
901
+ */
902
+ filterQuestions?: boolean;
903
+ /**
904
+ * Only include sentences marked as tasks/action items by AI.
905
+ */
906
+ filterTasks?: boolean;
907
+ /**
908
+ * Number of sentences to include before and after each match.
909
+ * @default 1
910
+ */
911
+ contextLines?: number;
912
+ /**
913
+ * Filter transcripts from this date (ISO 8601 format).
914
+ */
915
+ fromDate?: string;
916
+ /**
917
+ * Filter transcripts to this date (ISO 8601 format).
918
+ */
919
+ toDate?: string;
920
+ /**
921
+ * Only include transcripts owned by the authenticated user.
922
+ */
923
+ mine?: boolean;
924
+ /**
925
+ * Filter by organizer email addresses.
926
+ */
927
+ organizers?: string[];
928
+ /**
929
+ * Filter by participant email addresses.
930
+ */
931
+ participants?: string[];
932
+ /**
933
+ * Filter by user ID.
934
+ */
935
+ user_id?: string;
936
+ /**
937
+ * Filter by channel ID.
938
+ */
939
+ channel_id?: string;
940
+ /**
941
+ * Maximum number of transcripts to search.
942
+ * If not specified, searches all matching transcripts.
943
+ */
944
+ limit?: number;
945
+ }
946
+ /**
947
+ * Options for the pure searchTranscript helper function.
948
+ */
949
+ interface SearchTranscriptOptions {
950
+ /**
951
+ * The search query string.
952
+ */
953
+ query: string;
954
+ /**
955
+ * Whether to match case when searching.
956
+ * @default false
957
+ */
958
+ caseSensitive?: boolean;
959
+ /**
960
+ * Filter results to only include sentences from these speakers.
961
+ * Case-insensitive matching.
962
+ */
963
+ speakers?: string[];
964
+ /**
965
+ * Only include sentences marked as questions by AI.
966
+ */
967
+ filterQuestions?: boolean;
968
+ /**
969
+ * Only include sentences marked as tasks/action items by AI.
970
+ */
971
+ filterTasks?: boolean;
972
+ /**
973
+ * Number of sentences to include before and after each match.
974
+ * @default 1
975
+ */
976
+ contextLines?: number;
977
+ }
978
+ /**
979
+ * A single matched sentence with context from a transcript search.
980
+ */
981
+ interface SearchMatch {
982
+ /**
983
+ * ID of the transcript containing the match.
984
+ */
985
+ transcriptId: string;
986
+ /**
987
+ * Title of the transcript containing the match.
988
+ */
989
+ transcriptTitle: string;
990
+ /**
991
+ * Date of the transcript (ISO 8601 format).
992
+ */
993
+ transcriptDate: string;
994
+ /**
995
+ * URL to view the transcript on Fireflies.ai.
996
+ */
997
+ transcriptUrl: string;
998
+ /**
999
+ * The matched sentence details.
1000
+ */
1001
+ sentence: {
1002
+ /**
1003
+ * Index of the sentence in the transcript (0-based).
1004
+ */
1005
+ index: number;
1006
+ /**
1007
+ * Text content of the sentence.
1008
+ */
1009
+ text: string;
1010
+ /**
1011
+ * Name of the speaker.
1012
+ */
1013
+ speakerName: string;
1014
+ /**
1015
+ * Start time in seconds.
1016
+ */
1017
+ startTime: number;
1018
+ /**
1019
+ * End time in seconds.
1020
+ */
1021
+ endTime: number;
1022
+ /**
1023
+ * Whether the AI marked this sentence as a question.
1024
+ */
1025
+ isQuestion: boolean;
1026
+ /**
1027
+ * Whether the AI marked this sentence as a task/action item.
1028
+ */
1029
+ isTask: boolean;
1030
+ };
1031
+ /**
1032
+ * Context sentences before and after the match.
1033
+ */
1034
+ context: {
1035
+ /**
1036
+ * Sentences appearing before the match.
1037
+ */
1038
+ before: Array<{
1039
+ speakerName: string;
1040
+ text: string;
1041
+ }>;
1042
+ /**
1043
+ * Sentences appearing after the match.
1044
+ */
1045
+ after: Array<{
1046
+ speakerName: string;
1047
+ text: string;
1048
+ }>;
1049
+ };
1050
+ }
1051
+ /**
1052
+ * Results from a transcript search operation.
1053
+ */
1054
+ interface SearchResults {
1055
+ /**
1056
+ * The original search query.
1057
+ */
1058
+ query: string;
1059
+ /**
1060
+ * The search options that were used.
1061
+ */
1062
+ options: SearchParams;
1063
+ /**
1064
+ * Total number of matching sentences found.
1065
+ */
1066
+ totalMatches: number;
1067
+ /**
1068
+ * Number of transcripts that were searched.
1069
+ */
1070
+ transcriptsSearched: number;
1071
+ /**
1072
+ * Number of transcripts that had at least one match.
1073
+ */
1074
+ transcriptsWithMatches: number;
1075
+ /**
1076
+ * All matching sentences with context.
1077
+ */
1078
+ matches: SearchMatch[];
1079
+ }
1080
+
1081
+ /**
1082
+ * API for transcript operations.
1083
+ */
1084
+ interface TranscriptsAPI {
1085
+ /**
1086
+ * Get a single transcript by ID.
1087
+ *
1088
+ * @param id - Transcript ID
1089
+ * @param params - Optional parameters to exclude heavy fields
1090
+ * @returns Transcript (fields depend on params)
1091
+ * @throws NotFoundError if transcript doesn't exist
1092
+ *
1093
+ * @example
1094
+ * ```typescript
1095
+ * // Full transcript with all fields
1096
+ * const full = await client.transcripts.get('id');
1097
+ *
1098
+ * // Metadata only (faster, smaller response)
1099
+ * const meta = await client.transcripts.get('id', {
1100
+ * includeSentences: false,
1101
+ * includeSummary: false,
1102
+ * });
1103
+ * ```
1104
+ */
1105
+ get(id: string, params?: TranscriptGetParams): Promise<Transcript>;
1106
+ /**
1107
+ * List transcripts with optional filtering.
1108
+ *
1109
+ * @param params - Filter and pagination options
1110
+ * @returns Array of transcripts (max 50 per call)
1111
+ */
1112
+ list(params?: TranscriptsListParams): Promise<Transcript[]>;
1113
+ /**
1114
+ * Get just the summary for a transcript.
1115
+ * Lighter weight than fetching the full transcript.
1116
+ *
1117
+ * @param id - Transcript ID
1118
+ * @returns Summary object
1119
+ */
1120
+ getSummary(id: string): Promise<Summary | null>;
1121
+ /**
1122
+ * Iterate through all transcripts matching the filter.
1123
+ * Automatically handles pagination.
1124
+ *
1125
+ * @param params - Filter options (skip and limit are ignored)
1126
+ * @returns Async iterable of transcripts
1127
+ *
1128
+ * @example
1129
+ * ```typescript
1130
+ * for await (const transcript of client.transcripts.listAll({ mine: true })) {
1131
+ * console.log(transcript.title);
1132
+ * }
1133
+ * ```
1134
+ */
1135
+ listAll(params?: Omit<TranscriptsListParams, 'skip' | 'limit'>): AsyncIterable<Transcript>;
1136
+ /**
1137
+ * Search across transcripts for matching sentences.
1138
+ *
1139
+ * This method first queries for transcripts matching the keyword,
1140
+ * then fetches each transcript with sentences and searches locally
1141
+ * for detailed matches with speaker filtering, question/task filtering,
1142
+ * and context extraction.
1143
+ *
1144
+ * @param query - The search query string
1145
+ * @param params - Search options including filters and context settings
1146
+ * @returns Search results with matches grouped by transcript
1147
+ *
1148
+ * @example
1149
+ * ```typescript
1150
+ * const results = await client.transcripts.search('budget', {
1151
+ * speakers: ['Alice'],
1152
+ * filterQuestions: true,
1153
+ * fromDate: '2024-01-01',
1154
+ * contextLines: 2,
1155
+ * });
1156
+ *
1157
+ * console.log(`Found ${results.totalMatches} matches`);
1158
+ * for (const match of results.matches) {
1159
+ * console.log(`${match.sentence.speakerName}: ${match.sentence.text}`);
1160
+ * }
1161
+ * ```
1162
+ */
1163
+ search(query: string, params?: SearchParams): Promise<SearchResults>;
1164
+ /**
1165
+ * Compute aggregate meeting insights across transcripts.
1166
+ *
1167
+ * Fetches transcripts matching the filter criteria and computes
1168
+ * aggregate statistics including duration totals, day of week
1169
+ * distribution, participant counts, and speaker talk times.
1170
+ *
1171
+ * @param params - Filtering and analysis options
1172
+ * @returns Aggregate meeting insights
1173
+ *
1174
+ * @example
1175
+ * ```typescript
1176
+ * const insights = await client.transcripts.insights({
1177
+ * fromDate: '2024-01-01',
1178
+ * toDate: '2024-01-31',
1179
+ * mine: true,
1180
+ * groupBy: 'week',
1181
+ * });
1182
+ *
1183
+ * console.log(`${insights.totalMeetings} meetings`);
1184
+ * console.log(`${insights.totalDurationMinutes} total minutes`);
1185
+ * console.log(`Busiest day: ${getBusiestDay(insights.byDayOfWeek)}`);
1186
+ * ```
1187
+ */
1188
+ insights(params?: TranscriptsInsightsParams): Promise<MeetingInsights>;
1189
+ /**
1190
+ * Export action items from multiple transcripts.
1191
+ *
1192
+ * Fetches transcripts matching the filter criteria, extracts action
1193
+ * items from each, and aggregates them with source metadata.
1194
+ *
1195
+ * @param params - Filtering options for transcripts and action items
1196
+ * @returns Aggregated action items with statistics
1197
+ *
1198
+ * @example
1199
+ * ```typescript
1200
+ * const result = await client.transcripts.exportActionItems({
1201
+ * fromDate: '2024-01-01',
1202
+ * mine: true,
1203
+ * filterOptions: { assignedOnly: true },
1204
+ * });
1205
+ *
1206
+ * console.log(`${result.totalItems} action items from ${result.transcriptsProcessed} meetings`);
1207
+ * for (const item of result.items) {
1208
+ * console.log(`${item.text} (${item.transcriptTitle})`);
1209
+ * }
1210
+ * ```
1211
+ */
1212
+ exportActionItems(params?: ExportActionItemsParams): Promise<AggregatedActionItemsResult>;
1213
+ }
1214
+
1215
+ /**
1216
+ * API for user operations.
1217
+ */
1218
+ interface UsersAPI {
1219
+ /**
1220
+ * Get current user (API key owner).
1221
+ *
1222
+ * @returns Current user profile
1223
+ */
1224
+ me(): Promise<UserProfile>;
1225
+ /**
1226
+ * Get user by ID.
1227
+ *
1228
+ * @param id - User ID
1229
+ * @returns User profile
1230
+ */
1231
+ get(id: string): Promise<UserProfile>;
1232
+ /**
1233
+ * List all team users.
1234
+ *
1235
+ * @returns Array of user profiles
1236
+ */
1237
+ list(): Promise<UserProfile[]>;
1238
+ }
1239
+
1240
+ /**
1241
+ * A single transcription chunk from the realtime stream.
1242
+ *
1243
+ * Chunks are sent progressively as speech is transcribed.
1244
+ * The same chunk_id will be sent multiple times with updated text.
1245
+ * Use `isFinal` to determine if a chunk is complete.
1246
+ */
1247
+ interface TranscriptionChunk {
1248
+ /** Unique identifier - same ID means this is an update to a previous chunk */
1249
+ chunk_id: string;
1250
+ /** Name of the speaker */
1251
+ speaker_name: string;
1252
+ /** Transcribed text (grows as more words are recognized) */
1253
+ text: string;
1254
+ /** Start time in seconds */
1255
+ start_time: number;
1256
+ /** End time in seconds */
1257
+ end_time: number;
1258
+ /** True if this is the final version of the chunk (next chunk_id has appeared) */
1259
+ isFinal: boolean;
1260
+ }
1261
+ /**
1262
+ * Realtime connection configuration.
1263
+ */
1264
+ interface RealtimeConfig {
1265
+ /** API key for authentication */
1266
+ apiKey: string;
1267
+ /** Transcript/meeting ID to stream */
1268
+ transcriptId: string;
1269
+ /** WebSocket base URL (default: wss://api.fireflies.ai) */
1270
+ wsUrl?: string;
1271
+ /** Socket.IO path (default: /ws/realtime) */
1272
+ wsPath?: string;
1273
+ /** Connection timeout in ms (default: 20000) */
1274
+ timeout?: number;
1275
+ /** Chunk inactivity timeout in ms - reconnect if no chunks for this long (default: 20000) */
1276
+ chunkTimeout?: number;
1277
+ /** Auto-reconnect on disconnect (default: true) */
1278
+ reconnect?: boolean;
1279
+ /** Max reconnection attempts (default: 10) */
1280
+ maxReconnectAttempts?: number;
1281
+ /** Base delay between reconnects in ms (default: 5000) */
1282
+ reconnectDelay?: number;
1283
+ /** Max delay between reconnects in ms (default: 60000) */
1284
+ maxReconnectDelay?: number;
1285
+ }
1286
+ /**
1287
+ * Events emitted by RealtimeStream.
1288
+ */
1289
+ interface RealtimeEvents {
1290
+ /** Connection established */
1291
+ connected: () => void;
1292
+ /** Transcription chunk received */
1293
+ chunk: (chunk: TranscriptionChunk) => void;
1294
+ /** Connection closed */
1295
+ disconnected: (reason: string) => void;
1296
+ /** Error occurred */
1297
+ error: (error: Error) => void;
1298
+ /** Reconnecting after disconnect */
1299
+ reconnecting: (attempt: number) => void;
1300
+ }
1301
+
1302
+ type EventHandler<K extends keyof RealtimeEvents> = RealtimeEvents[K];
1303
+ /**
1304
+ * Realtime transcription stream.
1305
+ *
1306
+ * Chunks are emitted progressively as speech is transcribed. The same chunk_id
1307
+ * will be emitted multiple times with updated text. Use `chunk.isFinal` to
1308
+ * determine if a chunk is complete (the next chunk_id has appeared).
1309
+ *
1310
+ * @example Event-based (all updates)
1311
+ * ```typescript
1312
+ * stream.on('chunk', (chunk) => {
1313
+ * // Updates display in real-time
1314
+ * updateDisplay(chunk.chunk_id, chunk.text);
1315
+ * });
1316
+ * ```
1317
+ *
1318
+ * @example Event-based (final chunks only)
1319
+ * ```typescript
1320
+ * stream.on('chunk', (chunk) => {
1321
+ * if (chunk.isFinal) {
1322
+ * console.log(`[${chunk.speaker_name}]: ${chunk.text}`);
1323
+ * }
1324
+ * });
1325
+ * ```
1326
+ *
1327
+ * @example Async iterator
1328
+ * ```typescript
1329
+ * for await (const chunk of stream) {
1330
+ * console.log(`[${chunk.speaker_name}]: ${chunk.text}`);
1331
+ * }
1332
+ * ```
1333
+ */
1334
+ declare class RealtimeStream implements AsyncIterable<TranscriptionChunk> {
1335
+ private connection;
1336
+ private listeners;
1337
+ private buffer;
1338
+ private waiters;
1339
+ private closed;
1340
+ private lastChunkId;
1341
+ private lastChunk;
1342
+ constructor(config: RealtimeConfig);
1343
+ /**
1344
+ * Connect to the realtime stream.
1345
+ * @throws AuthenticationError if authentication fails
1346
+ * @throws ConnectionError if connection fails
1347
+ * @throws TimeoutError if connection times out
1348
+ */
1349
+ connect(): Promise<void>;
1350
+ private setupHandlers;
1351
+ /**
1352
+ * Register an event listener.
1353
+ * @param event - Event name
1354
+ * @param handler - Event handler
1355
+ */
1356
+ on<K extends keyof RealtimeEvents>(event: K, handler: EventHandler<K>): this;
1357
+ /**
1358
+ * Remove an event listener.
1359
+ * @param event - Event name
1360
+ * @param handler - Event handler to remove
1361
+ */
1362
+ off<K extends keyof RealtimeEvents>(event: K, handler: EventHandler<K>): this;
1363
+ /**
1364
+ * Emit a chunk to both event listeners and async iterator buffer.
1365
+ * Used for final chunks that should be yielded by the iterator.
1366
+ */
1367
+ private emitChunk;
1368
+ private emit;
1369
+ /**
1370
+ * AsyncIterable implementation for `for await` loops.
1371
+ */
1372
+ [Symbol.asyncIterator](): AsyncIterator<TranscriptionChunk>;
1373
+ /**
1374
+ * Close the stream and disconnect.
1375
+ */
1376
+ close(): void;
1377
+ /**
1378
+ * Whether the stream is currently connected.
1379
+ */
1380
+ get connected(): boolean;
1381
+ }
1382
+
1383
+ /**
1384
+ * API for realtime transcription streaming.
1385
+ */
1386
+ interface RealtimeAPI {
1387
+ /**
1388
+ * Connect to a live transcription stream.
1389
+ *
1390
+ * @param transcriptId - The meeting/transcript ID to stream
1391
+ * @returns Connected RealtimeStream
1392
+ *
1393
+ * @example Event-based
1394
+ * ```typescript
1395
+ * const stream = await client.realtime.connect('meeting-123');
1396
+ * stream.on('chunk', (chunk) => {
1397
+ * console.log(`[${chunk.speaker_name}]: ${chunk.text}`);
1398
+ * });
1399
+ * ```
1400
+ */
1401
+ connect(transcriptId: string): Promise<RealtimeStream>;
1402
+ /**
1403
+ * Stream transcription chunks as an async iterable.
1404
+ * Handles connection automatically.
1405
+ *
1406
+ * @param transcriptId - The meeting/transcript ID to stream
1407
+ * @returns AsyncIterable of transcription chunks
1408
+ *
1409
+ * @example
1410
+ * ```typescript
1411
+ * for await (const chunk of client.realtime.stream('meeting-123')) {
1412
+ * console.log(`[${chunk.speaker_name}]: ${chunk.text}`);
1413
+ * }
1414
+ * ```
1415
+ */
1416
+ stream(transcriptId: string): AsyncIterable<TranscriptionChunk>;
1417
+ }
1418
+
1419
+ /**
1420
+ * Main client for the Fireflies API.
1421
+ *
1422
+ * @example
1423
+ * ```typescript
1424
+ * import { FirefliesClient } from 'fireflies-api';
1425
+ *
1426
+ * const client = new FirefliesClient({
1427
+ * apiKey: process.env.FIREFLIES_API_KEY!,
1428
+ * });
1429
+ *
1430
+ * // List recent transcripts
1431
+ * const transcripts = await client.transcripts.list({ limit: 10 });
1432
+ *
1433
+ * // Get a specific transcript
1434
+ * const transcript = await client.transcripts.get('transcript-id');
1435
+ *
1436
+ * // Get current user
1437
+ * const me = await client.users.me();
1438
+ *
1439
+ * // List team members
1440
+ * const team = await client.users.list();
1441
+ *
1442
+ * // List bites
1443
+ * const bites = await client.bites.list({ mine: true });
1444
+ *
1445
+ * // Check active meetings
1446
+ * const meetings = await client.meetings.active();
1447
+ *
1448
+ * // List AI App outputs
1449
+ * const apps = await client.aiApps.list({ transcript_id: 'abc123' });
1450
+ * ```
1451
+ */
1452
+ declare class FirefliesClient {
1453
+ private readonly graphql;
1454
+ /**
1455
+ * Transcript operations: list, get, search, delete.
1456
+ */
1457
+ readonly transcripts: TranscriptsAPI & TranscriptsMutationsAPI;
1458
+ /**
1459
+ * User operations: me, get, list, setRole.
1460
+ */
1461
+ readonly users: UsersAPI & UsersMutationsAPI;
1462
+ /**
1463
+ * Bite operations: get, list, create.
1464
+ */
1465
+ readonly bites: BitesAPI;
1466
+ /**
1467
+ * Meeting operations: active meetings, add bot.
1468
+ */
1469
+ readonly meetings: MeetingsAPI;
1470
+ /**
1471
+ * Audio operations: upload audio for transcription.
1472
+ */
1473
+ readonly audio: AudioAPI;
1474
+ /**
1475
+ * AI Apps operations: list outputs.
1476
+ */
1477
+ readonly aiApps: AIAppsAPI;
1478
+ /**
1479
+ * Realtime transcription streaming.
1480
+ */
1481
+ readonly realtime: RealtimeAPI;
1482
+ /**
1483
+ * Create a new Fireflies client.
1484
+ *
1485
+ * @param config - Client configuration
1486
+ * @throws FirefliesError if API key is missing
1487
+ */
1488
+ constructor(config: FirefliesConfig);
1489
+ /**
1490
+ * Get the current rate limit state.
1491
+ * Returns undefined if rate limit tracking is not configured.
1492
+ *
1493
+ * @example
1494
+ * ```typescript
1495
+ * const client = new FirefliesClient({
1496
+ * apiKey: '...',
1497
+ * rateLimit: { warningThreshold: 10 }
1498
+ * });
1499
+ *
1500
+ * await client.users.me();
1501
+ * console.log(client.rateLimits);
1502
+ * // { remaining: 59, limit: 60, resetInSeconds: 60, updatedAt: 1706299500000 }
1503
+ * ```
1504
+ */
1505
+ get rateLimits(): RateLimitState | undefined;
1506
+ }
1507
+
1508
+ /**
1509
+ * Webhook event types supported by Fireflies.
1510
+ * Currently only "Transcription completed" is available.
1511
+ */
1512
+ type WebhookEventType = 'Transcription completed';
1513
+ /**
1514
+ * Webhook payload received from Fireflies.
1515
+ * Sent when configured webhook events occur.
1516
+ */
1517
+ interface WebhookPayload {
1518
+ /** Meeting/transcript ID */
1519
+ meetingId: string;
1520
+ /** The event that triggered this webhook */
1521
+ eventType: WebhookEventType;
1522
+ /** Custom reference ID set during upload (optional) */
1523
+ clientReferenceId?: string;
1524
+ }
1525
+ /**
1526
+ * Options for verifying a webhook signature.
1527
+ */
1528
+ interface VerifyOptions {
1529
+ /** Raw request body (string) or parsed payload (object) */
1530
+ payload: string | object;
1531
+ /** x-hub-signature header value */
1532
+ signature: string;
1533
+ /** Your webhook secret (16-32 characters) */
1534
+ secret: string;
1535
+ }
1536
+ /**
1537
+ * Options for parsing a webhook payload with optional verification.
1538
+ */
1539
+ interface ParseOptions {
1540
+ /** x-hub-signature header value for verification */
1541
+ signature?: string;
1542
+ /** Your webhook secret for verification */
1543
+ secret?: string;
1544
+ }
1545
+
1546
+ export { type TranscriptsAPI as $, type ActionItemsFilterOptions as A, type Bite as B, type CreateBiteParams as C, type DayOfWeekStats as D, type ExportActionItemsParams as E, FirefliesClient as F, type MeetingsAPI as G, type ParticipantStats as H, type RateLimitState as I, type RealtimeAPI as J, type RealtimeConfig as K, type RealtimeEvents as L, type MeetingInsightsOptions as M, RealtimeStream as N, type RetryConfig as O, type ParseOptions as P, type SearchParams as Q, type RateLimitConfig as R, type SearchTranscriptOptions as S, type TranscriptionChunk as T, type SearchResults as U, type VerifyOptions as V, type WebhookPayload as W, type SpeakerInsightStats as X, type ThrottleConfig as Y, type TimeGroupStats as Z, type TranscriptGetParams as _, type AggregatedActionItemsResult as a, type TranscriptsInsightsParams as a0, type TranscriptsMutationsAPI as a1, type TranscriptsQueryScope as a2, type UploadAudioAttendee as a3, type UploadAudioParams as a4, type UserGroup as a5, type UserGroupMember as a6, type UserProfile as a7, type UserRole as a8, type UsersAPI as a9, type UsersMutationsAPI as aa, type WebhookEventType as ab, type ActionItemsMarkdownOptions as b, type MeetingInsights as c, type TranscriptsListParams as d, type SearchMatch as e, type AIApp as f, type AIAppsAPI as g, type AIAppsListParams as h, type ActionItemGrouping as i, type ActionItemPreset as j, type ActionItemStyle as k, type ActiveMeeting as l, type ActiveMeetingsParams as m, type AddBotParams as n, type AggregatedActionItem as o, type AudioAPI as p, type BiteCaption as q, type BiteCreatedFrom as r, type BiteSource as s, type BiteUser as t, type BitesAPI as u, type BitesListParams as v, type DayStats as w, type FirefliesConfig as x, type MeetingPrivacy as y, type MeetingState as z };