@cometchat/calls-sdk-javascript 5.0.3 → 5.0.5

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/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ declare type AudioMode = {
19
19
  type: AudioModeType;
20
20
  selected: boolean;
21
21
  uid?: string;
22
+ name?: string;
22
23
  };
23
24
 
24
25
  declare type AudioModeType = 'BLUETOOTH' | 'EARPIECE' | 'HEADPHONES' | 'SPEAKER';
@@ -233,10 +234,22 @@ export declare class CallLog {
233
234
  * The time the call was initiated at.
234
235
  */
235
236
  private initiatedAt;
237
+ /**
238
+ * The time the call started at. Sent by the calls host in place of
239
+ * `initiatedAt`; read {@link getStartedAt} and fall back to
240
+ * {@link getInitiatedAt} when only one of the two is present.
241
+ */
242
+ private startedAt;
236
243
  /**
237
244
  * The call category of the call log.
238
245
  */
239
246
  private callCategory;
247
+ /**
248
+ * The mode of the call log. Sent by the calls host in place of
249
+ * `callCategory`; read {@link getMode} and fall back to
250
+ * {@link getCallCategory} when only one of the two is present.
251
+ */
252
+ private mode;
240
253
  /**
241
254
  * @type {CallUser}
242
255
  * The initiator of the call log.
@@ -285,6 +298,12 @@ export declare class CallLog {
285
298
  * The recordings of the call log.
286
299
  */
287
300
  private recordings;
301
+ /**
302
+ * @type {Transcription[]}
303
+ * The transcripts of the call log. Only populated when the request opted in
304
+ * via `CallLogRequestBuilder.setHasTranscriptions(true)`.
305
+ */
306
+ private transcriptions;
288
307
  /**
289
308
  * Creates a new instance of CallLog.
290
309
  * @param data - The data to initialize the call log with.
@@ -350,6 +369,26 @@ export declare class CallLog {
350
369
  * @param value - The time the call was initiated at.
351
370
  */
352
371
  setInitiatedAt(value: number): void;
372
+ /**
373
+ * Gets the time the call started at.
374
+ * @returns The time the call started at.
375
+ */
376
+ getStartedAt(): number;
377
+ /**
378
+ * Sets the time the call started at.
379
+ * @param value - The time the call started at.
380
+ */
381
+ setStartedAt(value: number): void;
382
+ /**
383
+ * Gets the mode of the call log.
384
+ * @returns The mode of the call log.
385
+ */
386
+ getMode(): string;
387
+ /**
388
+ * Sets the mode of the call log.
389
+ * @param value - The mode to set.
390
+ */
391
+ setMode(value: string): void;
353
392
  /**
354
393
  * Gets the call category of the call log.
355
394
  * @returns The call category of the call log.
@@ -470,6 +509,19 @@ export declare class CallLog {
470
509
  * @param value - The recordings to set.
471
510
  */
472
511
  setRecordings(value: Recording[]): void;
512
+ /**
513
+ * Gets the transcripts of the call log.
514
+ * @returns The transcripts of the call log, or an empty array when the server
515
+ * omitted them — never `undefined`. The array is absent unless the request
516
+ * opted in via `CallLogRequestBuilder.setHasTranscriptions(true)`, and the
517
+ * server currently omits it even then, so callers must not have to null-check.
518
+ */
519
+ getTranscriptions(): Transcription[];
520
+ /**
521
+ * Sets the transcripts of the call log.
522
+ * @param value - The transcripts to set.
523
+ */
524
+ setTranscriptions(value: Transcription[]): void;
473
525
  /**
474
526
  * Creates a new instance of CallLog from JSON data.
475
527
  * @param data - The JSON data to create the call log from.
@@ -506,6 +558,11 @@ declare class CallLogRequest {
506
558
  * Whether the call has a recording or not.
507
559
  */
508
560
  private hasRecording;
561
+ /**
562
+ * Whether to restrict the list to calls that have transcripts (and have the
563
+ * server attach each call's `transcriptions` array).
564
+ */
565
+ private hasTranscriptions;
509
566
  /**
510
567
  * The category of call to filter by.
511
568
  */
@@ -545,6 +602,16 @@ declare class CallLogRequest {
545
602
  * @returns A promise that resolves to an array of CallLog objects, or an empty array if there are no previous pages, or rejects with a CometChatCallsException if there was an error..
546
603
  */
547
604
  fetchPrevious(): Promise<CallLog[] | []>;
605
+ /**
606
+ * Gets the page the cursor currently sits on.
607
+ * @returns The current page, or `0` before the first successful fetch.
608
+ */
609
+ getCurrentPage(): number;
610
+ /**
611
+ * Gets the number of pages the server reported.
612
+ * @returns The total page count, or `0` before the first successful fetch.
613
+ */
614
+ getTotalPages(): number;
548
615
  /**
549
616
  * Makes an API call to fetch call logs.
550
617
  * @param isFetchNext Whether to fetch the next page of call logs.
@@ -573,6 +640,7 @@ declare class CallLogRequestBuilder {
573
640
  /** @private */ callType: string;
574
641
  /** @private */ callStatus: string;
575
642
  /** @private */ hasRecording: boolean;
643
+ /** @private */ hasTranscriptions: boolean;
576
644
  /** @private */ callCategory: string;
577
645
  /** @private */ callDirection: string;
578
646
  /** @private */ uid: string;
@@ -602,6 +670,14 @@ declare class CallLogRequestBuilder {
602
670
  * @returns The CallLogRequestBuilder object.
603
671
  */
604
672
  setHasRecording(hasRecording: boolean): this;
673
+ /**
674
+ * Sets whether only calls that have transcripts should be fetched. Opting in
675
+ * also makes the server attach each call's `transcriptions` array, readable
676
+ * via `CallLog.getTranscriptions()`.
677
+ * @param hasTranscriptions - Whether to restrict the list to transcribed calls.
678
+ * @returns The CallLogRequestBuilder object.
679
+ */
680
+ setHasTranscriptions(hasTranscriptions: boolean): this;
605
681
  /**
606
682
  * Sets the category of call to be fetched.
607
683
  * @param callCategory - The category of call to be fetched. Can be either 'call' or 'meet'.
@@ -935,6 +1011,67 @@ declare const CAMERA_FACING: {
935
1011
 
936
1012
  declare type CameraFacing = ValueOf<typeof CAMERA_FACING>;
937
1013
 
1014
+ declare const CAPTION_LANGUAGES: readonly [{
1015
+ readonly code: "en-US";
1016
+ readonly label: "English (United States)";
1017
+ }, {
1018
+ readonly code: "de-DE";
1019
+ readonly label: "German (Germany)";
1020
+ }, {
1021
+ readonly code: "en-GB";
1022
+ readonly label: "English (United Kingdom)";
1023
+ }, {
1024
+ readonly code: "es-ES";
1025
+ readonly label: "Spanish (Spain)";
1026
+ }, {
1027
+ readonly code: "fr-FR";
1028
+ readonly label: "French (France)";
1029
+ }, {
1030
+ readonly code: "hi-IN";
1031
+ readonly label: "Hindi (India)";
1032
+ }, {
1033
+ readonly code: "hu-HU";
1034
+ readonly label: "Hungarian (Hungary)";
1035
+ }, {
1036
+ readonly code: "it-IT";
1037
+ readonly label: "Italian (Italy)";
1038
+ }, {
1039
+ readonly code: "ja-JP";
1040
+ readonly label: "Japanese (Japan)";
1041
+ }, {
1042
+ readonly code: "ko-KR";
1043
+ readonly label: "Korean (South Korea)";
1044
+ }, {
1045
+ readonly code: "lt-LT";
1046
+ readonly label: "Lithuanian (Lithuania)";
1047
+ }, {
1048
+ readonly code: "ms-MY";
1049
+ readonly label: "Malay (Malaysia)";
1050
+ }, {
1051
+ readonly code: "nl-NL";
1052
+ readonly label: "Dutch (Netherlands)";
1053
+ }, {
1054
+ readonly code: "pt-PT";
1055
+ readonly label: "Portuguese (Portugal)";
1056
+ }, {
1057
+ readonly code: "ru-RU";
1058
+ readonly label: "Russian (Russia)";
1059
+ }, {
1060
+ readonly code: "sv-SE";
1061
+ readonly label: "Swedish (Sweden)";
1062
+ }, {
1063
+ readonly code: "tr-TR";
1064
+ readonly label: "Turkish (Turkey)";
1065
+ }, {
1066
+ readonly code: "zh";
1067
+ readonly label: "Chinese Mandarin (Simplified, China)";
1068
+ }, {
1069
+ readonly code: "zh-TW";
1070
+ readonly label: "Chinese Mandarin (Traditional, Taiwan)";
1071
+ }];
1072
+
1073
+ declare type CaptionLanguageCode = (typeof CAPTION_LANGUAGES)[number]['code'] | (string & {});
1074
+
938
1075
  declare interface CometChatAPIException extends Error {
939
1076
  readonly name: 'COMET_CHAT_API_ERROR' | 'NETWORK_ERROR' | 'VALIDATION_ERROR' | 'BAD_RESPONSE' | 'UNKNOWN_ERROR';
940
1077
  readonly details?: unknown;
@@ -963,6 +1100,7 @@ export declare class CometChatCalls extends SessionMethods {
963
1100
  };
964
1101
  };
965
1102
  static CallLogRequestBuilder: typeof CallLogRequestBuilder;
1103
+ static TranscriptRequestBuilder: typeof TranscriptRequestBuilder;
966
1104
  static CallLog: typeof CallLog;
967
1105
  /** @deprecated */
968
1106
  static MainVideoContainerSetting: typeof MainVideoContainerSetting;
@@ -1140,6 +1278,14 @@ declare type ConfigStateBoth = {
1140
1278
  * @default false
1141
1279
  */
1142
1280
  autoStartRecording: boolean;
1281
+ /**
1282
+ * Automatically starts live transcription as soon as the call begins,
1283
+ * without the user pressing the transcription button. Transcription must
1284
+ * be enabled for your app for this to take effect.
1285
+ *
1286
+ * @default false
1287
+ */
1288
+ autoStartTranscription: boolean;
1143
1289
  /**
1144
1290
  * Hides the recording button from the call controls, preventing the user
1145
1291
  * from manually starting or stopping recording from within the SDK UI.
@@ -1147,6 +1293,29 @@ declare type ConfigStateBoth = {
1147
1293
  * @default true
1148
1294
  */
1149
1295
  hideRecordingButton: boolean;
1296
+ /**
1297
+ * Hides the streaming button from the call controls, preventing the user
1298
+ * from manually starting or stopping a live stream from within the SDK UI.
1299
+ *
1300
+ * @default true
1301
+ */
1302
+ hideStreamingButton: boolean;
1303
+ /**
1304
+ * The RTMP URL to stream to when the user starts a live stream from the
1305
+ * call controls. When set, pressing the start-streaming button skips the
1306
+ * confirmation dialog (which normally asks for a URL and key) and starts
1307
+ * streaming to this URL immediately.
1308
+ *
1309
+ * @default undefined — the user is asked for a URL when starting a stream
1310
+ */
1311
+ streamUrl?: string;
1312
+ /**
1313
+ * The stream key sent along with `streamUrl` when a live stream is
1314
+ * started. Ignored when `streamUrl` is not set.
1315
+ *
1316
+ * @default undefined
1317
+ */
1318
+ streamKey?: string;
1150
1319
  /**
1151
1320
  * Hides the entire bottom control bar (mic, camera, leave, and every other
1152
1321
  * call control). Useful when the host app provides its own controls.
@@ -1233,6 +1402,13 @@ declare type ConfigStateBoth = {
1233
1402
  * @default false
1234
1403
  */
1235
1404
  hideRecordingStatusIndicator: boolean;
1405
+ /**
1406
+ * Hides the "streaming live" badge shown while the session is being
1407
+ * streamed. The stream itself is unaffected.
1408
+ *
1409
+ * @default false
1410
+ */
1411
+ hideStreamingStatusIndicator: boolean;
1236
1412
  /**
1237
1413
  * Hides the button that switches between the front and rear cameras.
1238
1414
  * Mainly relevant on mobile devices with more than one camera.
@@ -1240,6 +1416,28 @@ declare type ConfigStateBoth = {
1240
1416
  * @default false
1241
1417
  */
1242
1418
  hideSwitchCameraButton: boolean;
1419
+ /**
1420
+ * Hides the closed-caption button that lets the user show or hide live
1421
+ * captions on screen. Even when set to `false`, the button only appears
1422
+ * while transcription is running, since captions are produced from the
1423
+ * live transcript.
1424
+ *
1425
+ * @default true
1426
+ */
1427
+ hideClosedCaptionButton: boolean;
1428
+ /**
1429
+ * Hides the transcription button from the call controls, preventing the
1430
+ * user from manually starting or stopping live transcription from within
1431
+ * the SDK UI.
1432
+ *
1433
+ * @default true
1434
+ */
1435
+ hideTranscriptionButton: boolean;
1436
+ /**
1437
+ * The currently selected caption/transcription language code (e.g.
1438
+ * `en-US`). Selected from the closed-caption settings dropdown.
1439
+ */
1440
+ captionLanguage: CaptionLanguageCode;
1243
1441
  /**
1244
1442
  * Enables the per-participant context menu — opened by right-clicking (web)
1245
1443
  * or long-pressing (mobile) a participant's tile — that exposes actions such
@@ -1433,6 +1631,8 @@ declare const EVENT_LISTENER_METHODS: {
1433
1631
  readonly onVideoResumed: "onVideoResumed";
1434
1632
  readonly onRecordingStarted: "onRecordingStarted";
1435
1633
  readonly onRecordingStopped: "onRecordingStopped";
1634
+ readonly onStreamingStarted: "onStreamingStarted";
1635
+ readonly onStreamingStopped: "onStreamingStopped";
1436
1636
  readonly onScreenShareStarted: "onScreenShareStarted";
1437
1637
  readonly onScreenShareStopped: "onScreenShareStopped";
1438
1638
  };
@@ -1449,6 +1649,8 @@ declare const EVENT_LISTENER_METHODS: {
1449
1649
  readonly onParticipantStoppedScreenShare: "onParticipantStoppedScreenShare";
1450
1650
  readonly onParticipantStartedRecording: "onParticipantStartedRecording";
1451
1651
  readonly onParticipantStoppedRecording: "onParticipantStoppedRecording";
1652
+ readonly onParticipantStartedStreaming: "onParticipantStartedStreaming";
1653
+ readonly onParticipantStoppedStreaming: "onParticipantStoppedStreaming";
1452
1654
  readonly onDominantSpeakerChanged: "onDominantSpeakerChanged";
1453
1655
  readonly onParticipantListChanged: "onParticipantListChanged";
1454
1656
  };
@@ -2144,9 +2346,15 @@ declare class SessionMethods extends SessionMethodsCore {
2144
2346
 
2145
2347
  declare class SessionMethodsCore {
2146
2348
  /**
2147
- * Mutes the local user's audio during the call.
2349
+ * Mutes or unmutes the local user's audio during the call.
2350
+ *
2351
+ * The boolean parameter exists for backward compatibility with the v4 SDK,
2352
+ * where `muteAudio(false)` was the way to unmute. New code should prefer
2353
+ * {@link SessionMethodsCore.unmuteAudio} for clarity.
2354
+ *
2355
+ * @param muteAudio - `true` (default) mutes the local audio track, `false` unmutes it.
2148
2356
  */
2149
- static muteAudio(): void;
2357
+ static muteAudio(muteAudio?: boolean): void;
2150
2358
  /**
2151
2359
  * Unmutes the local user's audio during the call.
2152
2360
  */
@@ -2157,9 +2365,15 @@ declare class SessionMethodsCore {
2157
2365
  */
2158
2366
  static toggleAudio(): void;
2159
2367
  /**
2160
- * Pauses the local user's video stream.
2368
+ * Pauses or resumes the local user's video stream.
2369
+ *
2370
+ * The boolean parameter exists for backward compatibility with the v4 SDK,
2371
+ * where `pauseVideo(false)` was the way to resume. New code should prefer
2372
+ * {@link SessionMethodsCore.resumeVideo} for clarity.
2373
+ *
2374
+ * @param pauseVideo - `true` (default) pauses the local video track, `false` resumes it.
2161
2375
  */
2162
- static pauseVideo(): void;
2376
+ static pauseVideo(pauseVideo?: boolean): void;
2163
2377
  /**
2164
2378
  * Resumes the local user's video stream.
2165
2379
  */
@@ -2200,6 +2414,16 @@ declare class SessionMethodsCore {
2200
2414
  * @param layout - The type of layout to set (tile, sidebar or spotlight).
2201
2415
  */
2202
2416
  static setLayout(layout: Layout): void;
2417
+ /**
2418
+ * Starts streaming the call to the given RTMP destination.
2419
+ * @param streamUrl - The RTMP ingest URL (e.g., "rtmp://a.rtmp.youtube.com/live2").
2420
+ * @param streamKey - The stream key for the destination (e.g., "xxxx-xxxx-xxxx-xxxx-xxxx").
2421
+ */
2422
+ static startStreaming(streamUrl: string, streamKey: string): void;
2423
+ /**
2424
+ * Stops the ongoing call streaming.
2425
+ */
2426
+ static stopStreaming(): void;
2203
2427
  /**
2204
2428
  * Starts recording the call.
2205
2429
  */
@@ -2213,6 +2437,14 @@ declare class SessionMethodsCore {
2213
2437
  * If recording is active, it will be stopped, and vice versa.
2214
2438
  */
2215
2439
  static toggleRecording(): void;
2440
+ /**
2441
+ * Starts transcription of the call.
2442
+ */
2443
+ static startTranscription(): void;
2444
+ /**
2445
+ * Stops the ongoing call transcription.
2446
+ */
2447
+ static stopTranscription(): void;
2216
2448
  /**
2217
2449
  * Pins a participant's video to focus on them.
2218
2450
  * @param participantId - The ID of the participant to pin.
@@ -2283,6 +2515,252 @@ declare type THEX = `#${string}`;
2283
2515
 
2284
2516
  declare type TPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
2285
2517
 
2518
+ /**
2519
+ * A single meeting-transcript artifact returned by the paginated
2520
+ * `GET /calls/:sessionId/transcriptions` endpoint.
2521
+ *
2522
+ * A record is a *pointer* to a downloadable transcript file, not the transcript
2523
+ * text/utterances themselves — fetch {@link Transcript.transcriptUrl} separately
2524
+ * to retrieve the content.
2525
+ *
2526
+ * Every field is optional: the server strips keys whose value is empty, so a
2527
+ * sparse record (e.g. `mid` absent until the pipeline sends `uniqueMeetingId`)
2528
+ * is normal and must parse without error.
2529
+ */
2530
+ export declare interface Transcript {
2531
+ /** Transcript id. */
2532
+ tid?: string;
2533
+ /** Meeting id; absent until the pipeline sends `uniqueMeetingId`. */
2534
+ mid?: string;
2535
+ /** Room name. */
2536
+ roomName?: string;
2537
+ /** Meeting start time, epoch SECONDS. */
2538
+ startTime?: number;
2539
+ /** Meeting end time, epoch SECONDS. */
2540
+ endTime?: number;
2541
+ /** Meeting url. */
2542
+ url?: string;
2543
+ /** Transcript date. */
2544
+ transcriptDate?: string;
2545
+ /** Downloadable transcript JSON url. */
2546
+ transcriptUrl?: string;
2547
+ /** Arbitrary metadata bag. */
2548
+ metaData?: Record<string, unknown>;
2549
+ }
2550
+
2551
+ /**
2552
+ * Represents a transcript artifact attached to a call log.
2553
+ *
2554
+ * Only present when the list request opted in via
2555
+ * `CallLogRequestBuilder.setHasTranscriptions(true)` — the server omits the
2556
+ * `transcriptions` array otherwise.
2557
+ *
2558
+ * A record is a *pointer* to a downloadable transcript file, not the transcript
2559
+ * text itself: fetch {@link Transcription.getTranscriptURL} separately to
2560
+ * retrieve the content.
2561
+ */
2562
+ export declare class Transcription {
2563
+ /**
2564
+ * The transcript ID.
2565
+ */
2566
+ private tid;
2567
+ /**
2568
+ * The meeting ID; absent until the pipeline sends `uniqueMeetingId`.
2569
+ */
2570
+ private mid;
2571
+ /**
2572
+ * The room name of the meeting the transcript belongs to.
2573
+ */
2574
+ private roomName;
2575
+ /**
2576
+ * The start time of the transcribed meeting, in epoch seconds.
2577
+ */
2578
+ private startTime;
2579
+ /**
2580
+ * The end time of the transcribed meeting, in epoch seconds.
2581
+ */
2582
+ private endTime;
2583
+ /**
2584
+ * The transcript date.
2585
+ */
2586
+ private transcriptDate;
2587
+ /**
2588
+ * The URL of the downloadable transcript JSON.
2589
+ */
2590
+ private transcriptUrl;
2591
+ /**
2592
+ * Creates a new instance of the Transcription class.
2593
+ * @param data - The data to initialize the transcription object.
2594
+ */
2595
+ constructor(data: any);
2596
+ /**
2597
+ * Gets the transcript ID.
2598
+ * @returns The transcript ID.
2599
+ */
2600
+ getTid(): string;
2601
+ /**
2602
+ * Sets the transcript ID.
2603
+ * @param value - The transcript ID to set.
2604
+ */
2605
+ setTid(value: string): void;
2606
+ /**
2607
+ * Gets the meeting ID.
2608
+ * @returns The meeting ID.
2609
+ */
2610
+ getMid(): string;
2611
+ /**
2612
+ * Sets the meeting ID.
2613
+ * @param value - The meeting ID to set.
2614
+ */
2615
+ setMid(value: string): void;
2616
+ /**
2617
+ * Gets the room name.
2618
+ * @returns The room name.
2619
+ */
2620
+ getRoomName(): string;
2621
+ /**
2622
+ * Sets the room name.
2623
+ * @param value - The room name to set.
2624
+ */
2625
+ setRoomName(value: string): void;
2626
+ /**
2627
+ * Gets the start time of the transcribed meeting.
2628
+ * @returns The start time, in epoch seconds.
2629
+ */
2630
+ getStartTime(): number;
2631
+ /**
2632
+ * Sets the start time of the transcribed meeting.
2633
+ * @param value - The start time, in epoch seconds.
2634
+ */
2635
+ setStartTime(value: number): void;
2636
+ /**
2637
+ * Gets the end time of the transcribed meeting.
2638
+ * @returns The end time, in epoch seconds.
2639
+ */
2640
+ getEndTime(): number;
2641
+ /**
2642
+ * Sets the end time of the transcribed meeting.
2643
+ * @param value - The end time, in epoch seconds.
2644
+ */
2645
+ setEndTime(value: number): void;
2646
+ /**
2647
+ * Gets the transcript date.
2648
+ * @returns The transcript date.
2649
+ */
2650
+ getTranscriptDate(): string;
2651
+ /**
2652
+ * Sets the transcript date.
2653
+ * @param value - The transcript date to set.
2654
+ */
2655
+ setTranscriptDate(value: string): void;
2656
+ /**
2657
+ * Gets the URL of the downloadable transcript JSON.
2658
+ * @returns The transcript URL.
2659
+ */
2660
+ getTranscriptURL(): string;
2661
+ /**
2662
+ * Sets the URL of the downloadable transcript JSON.
2663
+ * @param value - The transcript URL to set.
2664
+ */
2665
+ setTranscriptURL(value: string): void;
2666
+ /**
2667
+ * Creates a new Transcription object from the given JSON data.
2668
+ *
2669
+ * Every key is passed through untouched, so newly-added server fields survive
2670
+ * without an SDK release.
2671
+ * @param data - The JSON data to create the Transcription object from.
2672
+ * @returns A new Transcription object.
2673
+ */
2674
+ static getTranscriptionFromJson(data: any): Transcription;
2675
+ }
2676
+
2677
+ /**
2678
+ * A single, stateful request for one meeting's transcript artifacts. Holds the
2679
+ * pagination cursor and drives the paginated endpoint via `fetchNext()` /
2680
+ * `fetchPrevious()`. Create one with {@link TranscriptRequestBuilder}.
2681
+ */
2682
+ declare class TranscriptRequest {
2683
+ private readonly limit;
2684
+ private readonly sessionId;
2685
+ private readonly config;
2686
+ /** Total pages reported by the server; `null` until a response reports one. */
2687
+ private totalPages;
2688
+ /** Page cursor; `0` before the first fetch. */
2689
+ private currentPage;
2690
+ /** Guards against overlapping in-flight fetches. */
2691
+ private inProgress;
2692
+ constructor(builder: TranscriptRequestBuilder, config: TranscriptRuntimeConfig);
2693
+ /**
2694
+ * Fetches the next page of transcripts.
2695
+ * @returns The page's transcripts, or `[]` when there are no more pages.
2696
+ * @throws {CometChatCallsException} on auth, concurrency, network or response errors.
2697
+ */
2698
+ fetchNext(): Promise<Transcript[]>;
2699
+ /**
2700
+ * Fetches the previous page of transcripts.
2701
+ * @returns The page's transcripts, or `[]` when already at the first page.
2702
+ * @throws {CometChatCallsException} on auth, concurrency, network or response errors.
2703
+ */
2704
+ fetchPrevious(): Promise<Transcript[] | []>;
2705
+ private makeAPICall;
2706
+ }
2707
+
2708
+ /**
2709
+ * Builder for a {@link TranscriptRequest}.
2710
+ *
2711
+ * @example
2712
+ * const request = new CometChatCalls.TranscriptRequestBuilder()
2713
+ * .setSessionId('v1.us.2547167fe69871fd.pranav')
2714
+ * .setLimit(10)
2715
+ * .build();
2716
+ * const page = await request.fetchNext();
2717
+ */
2718
+ declare class TranscriptRequestBuilder {
2719
+ /* Excluded from this release type: limit */
2720
+ /* Excluded from this release type: sessionId */
2721
+ /**
2722
+ * Sets the meeting/session id whose transcripts to fetch. Required.
2723
+ * @param sessionId - The session id (e.g. `v1.us.<appId>.<user>`).
2724
+ */
2725
+ setSessionId(sessionId: string): this;
2726
+ /**
2727
+ * Sets the page size. Optional; defaults to 30 and is clamped to `[1, 1000]`.
2728
+ * @param limit - Transcripts to fetch per page.
2729
+ */
2730
+ setLimit(limit: number): this;
2731
+ /**
2732
+ * Validates pre-flight state and builds the request.
2733
+ * @throws {CometChatCallsException} `NOT_INITIALIZED` if `init()` was not called,
2734
+ * or `SESSION_ID_REQUIRED` if no session id was set.
2735
+ */
2736
+ build(): TranscriptRequest;
2737
+ }
2738
+
2739
+ /**
2740
+ * Runtime context the transcript request needs but cannot reach on its own:
2741
+ * `getBaseURL('call')`, `appSettings` and `appId` are all private static on
2742
+ * `CometChatCalls`. The facade stashes this config at `finalizeInit()` (mirroring
2743
+ * how `APIHandler.setAppSettings({ host })` is already wired), and the request
2744
+ * reads it back here.
2745
+ *
2746
+ * The auth token is intentionally a live getter, not a captured value: the token
2747
+ * can change across a re-login, so it is read at fetch time from the public
2748
+ * `CometChatCalls.getUserAuthToken()`.
2749
+ */
2750
+ declare interface TranscriptRuntimeConfig {
2751
+ /**
2752
+ * Calls base URL — `getBaseURL('call')`, honours the `appSettings.host`
2753
+ * override. `/calls/:sessionId/transcriptions` is a sub-route of the same
2754
+ * `/calls` resource the call-log list uses, so it lives on the calls host
2755
+ * (`<appId>.call-<region>.cometchat.io`), NOT the chat admin api host.
2756
+ */
2757
+ callsBaseURL: string;
2758
+ /** App id from the init'd settings. */
2759
+ appId: string;
2760
+ /** Live auth-token accessor (from the logged-in user); `null` when logged out. */
2761
+ getAuthToken: () => string | null;
2762
+ }
2763
+
2286
2764
  declare type _TRegion = 'eu' | 'us' | 'in';
2287
2765
 
2288
2766
  declare type TRGB = `rgb(${number}, ${number}, ${number})`;