@whereby.com/core 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import { EventEmitter } from 'events';
3
- import { LiveCaptionEvent, RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, KnockResponse, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
3
+ import { LiveCaptionEvent, RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, RoomMode, KnockResponse, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
4
4
  export { ChatFileShare, KnockResponse, KnockResponseSender, RoomJoinedSuccess } from '@whereby.com/media';
5
5
  import * as redux_thunk from 'redux-thunk';
6
6
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
@@ -558,6 +558,14 @@ interface StickyReactionEventProps {
558
558
  } | null;
559
559
  }
560
560
  type StickyReactionEvent = NotificationEvent<"remoteHandRaised" | "remoteHandLowered", StickyReactionEventProps>;
561
+ interface BreakoutTimerEventProps {
562
+ }
563
+ type BreakoutTimerEvent = NotificationEvent<"breakoutTimerEnding" | "breakoutTimerEnded" | "breakoutTimerExtended", BreakoutTimerEventProps>;
564
+ interface BreakoutGroupAssignedEventProps {
565
+ group: string;
566
+ groupName: string;
567
+ }
568
+ type BreakoutGroupAssignedEvent = NotificationEvent<"breakoutGroupAssigned", BreakoutGroupAssignedEventProps>;
561
569
  type NotificationEventTypes = {
562
570
  ["requestAudioEnable"]: RequestAudioEvent;
563
571
  ["requestAudioDisable"]: RequestAudioEvent;
@@ -569,6 +577,10 @@ type NotificationEventTypes = {
569
577
  ["clientUnableToJoinFullRoom"]: SignalClientEvent;
570
578
  ["requestVideoEnable"]: RequestVideoEvent;
571
579
  ["requestVideoDisable"]: RequestVideoEvent;
580
+ ["breakoutTimerEnding"]: BreakoutTimerEvent;
581
+ ["breakoutTimerEnded"]: BreakoutTimerEvent;
582
+ ["breakoutTimerExtended"]: BreakoutTimerEvent;
583
+ ["breakoutGroupAssigned"]: BreakoutGroupAssignedEvent;
572
584
  };
573
585
  type NotificationEvents = NotificationEventTypes[keyof NotificationEventTypes];
574
586
  type NotificationEventMap = {
@@ -674,9 +686,41 @@ interface AuthorizationState {
674
686
  roleName: RoleName;
675
687
  }
676
688
 
689
+ declare const DEFAULT_BREAKOUT_TIMER_DURATION = 1800;
677
690
  interface BreakoutState$1 extends BreakoutConfig {
678
- groupId: string | null;
691
+ error: string | null;
692
+ }
693
+ declare const BREAKOUT_UNAVAILABLE_ERROR = "Breakout groups are not available in peer-to-peer rooms";
694
+ interface BreakoutSessionSettings {
695
+ enforceAssignment?: boolean;
696
+ autoMoveToGroup?: boolean;
697
+ autoMoveToMain?: boolean;
698
+ moveToGroupGracePeriod?: number | null;
699
+ moveToMainGracePeriod?: number | null;
700
+ breakoutTimerSetting?: boolean;
701
+ breakoutTimerDuration?: number;
702
+ }
703
+ interface StartBreakoutSessionOptions extends BreakoutSessionSettings {
704
+ groups: {
705
+ [groupId: string]: string;
706
+ };
707
+ assignments?: {
708
+ [clientId: string]: string;
709
+ };
679
710
  }
711
+ interface UpdateBreakoutSessionOptions extends BreakoutSessionSettings {
712
+ groups?: {
713
+ [groupId: string]: string;
714
+ };
715
+ assignments?: {
716
+ [clientId: string]: string;
717
+ };
718
+ }
719
+ declare const BREAKOUT_GROUPS_MIN_MAX: [number, number];
720
+ declare function defaultBreakoutGroupName(groupId: string): string;
721
+ declare function createBreakoutGroups(count?: number): {
722
+ [groupId: string]: string;
723
+ };
680
724
 
681
725
  interface ConnectionMonitorState {
682
726
  running: boolean;
@@ -717,6 +761,7 @@ type ClientView = {
717
761
 
718
762
  interface RoomState {
719
763
  isLocked: boolean;
764
+ mode: RoomMode | null;
720
765
  }
721
766
 
722
767
  type LocalMediaOptions$1 = {
@@ -1113,11 +1158,14 @@ interface WherebyClientOptions {
1113
1158
  externalId?: string | null;
1114
1159
  isNodeSdk?: boolean;
1115
1160
  }
1116
- type RemoteParticipantState = Omit<RemoteParticipant, "newJoiner" | "streams">;
1161
+ type RemoteParticipantState = Omit<RemoteParticipant, "newJoiner" | "streams"> & {
1162
+ breakoutGroupAssigned: string;
1163
+ };
1117
1164
  interface LocalParticipantState extends LocalParticipant {
1118
1165
  isScreenSharing: boolean;
1119
1166
  roleName: RoleName;
1120
1167
  clientClaim?: string;
1168
+ breakoutGroupAssigned: string;
1121
1169
  }
1122
1170
  interface WaitingParticipantState {
1123
1171
  id: string;
@@ -1156,11 +1204,27 @@ type LiveStreamState = {
1156
1204
  startedAt?: number;
1157
1205
  };
1158
1206
  type BreakoutState = {
1207
+ isAvailable: boolean;
1208
+ error: string | null;
1159
1209
  isActive: boolean;
1160
1210
  currentGroup: {
1161
1211
  id: string | null;
1162
1212
  name: string;
1163
1213
  } | null;
1214
+ groups: {
1215
+ [groupId: string]: string;
1216
+ } | null;
1217
+ enforceAssignment: boolean;
1218
+ autoMoveToGroup: boolean;
1219
+ moveToGroupGracePeriod: number | null;
1220
+ autoMoveToMain: boolean;
1221
+ moveToMainGracePeriod: number | null;
1222
+ breakoutTimerSetting: boolean;
1223
+ breakoutTimerDuration: number;
1224
+ startedAt: Date | null;
1225
+ endTime: number | null;
1226
+ moveToGroupAt: number | null;
1227
+ moveToMainAt: number | null;
1164
1228
  groupedParticipants: {
1165
1229
  clients: ClientView[];
1166
1230
  group: {
@@ -1169,6 +1233,7 @@ type BreakoutState = {
1169
1233
  } | null;
1170
1234
  }[];
1171
1235
  participantsInCurrentGroup: ClientView[];
1236
+ broadcastingParticipants: ClientView[];
1172
1237
  };
1173
1238
  interface RoomConnectionState {
1174
1239
  connectionStatus: ConnectionStatus;
@@ -1289,7 +1354,7 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
1289
1354
  getNotificationsEventEmitter(): NotificationsEventEmitter;
1290
1355
  initialize(options: WherebyClientOptions): void;
1291
1356
  joinRoom(): Promise<RoomJoinedSuccess>;
1292
- sendChatMessage(text: string, parentId?: string): void;
1357
+ sendChatMessage(text: string, parentId?: string, isBroadcast?: boolean): void;
1293
1358
  removeChatMessage(id: string, sig?: string | null): void;
1294
1359
  sendFiles(files: File[]): void;
1295
1360
  downloadFile(file: ChatFileShare): Promise<Blob>;
@@ -1325,6 +1390,19 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
1325
1390
  endMeeting(stayBehind?: boolean): void;
1326
1391
  joinBreakoutGroup(group: string): void;
1327
1392
  joinBreakoutMainRoom(): void;
1393
+ startBreakoutSession(options: StartBreakoutSessionOptions): void;
1394
+ updateBreakoutSession(options: UpdateBreakoutSessionOptions): void;
1395
+ stopBreakoutSession(): void;
1396
+ assignBreakoutParticipants(assignments: {
1397
+ [clientId: string]: string;
1398
+ }): void;
1399
+ assignAllBreakoutParticipants(): void;
1400
+ unassignAllBreakoutParticipants(): void;
1401
+ shuffleBreakoutParticipants(): void;
1402
+ extendBreakoutTimer(seconds?: number): void;
1403
+ stopBreakoutTimer(): void;
1404
+ broadcastToGroups(participantId: string): void;
1405
+ stopBroadcastToGroups(participantId: string): void;
1328
1406
  reportStreamResolution(streamId: string, width: number, height: number): void;
1329
1407
  switchCameraEffect(effectId: string): Promise<void>;
1330
1408
  switchCameraEffectCustom(imageUrl: string): Promise<void>;
@@ -1348,5 +1426,5 @@ declare class WherebyClient {
1348
1426
  destroy(): void;
1349
1427
  }
1350
1428
 
1351
- export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createServices, debounce, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
1352
- export type { AppConfig, BreakoutState, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FullOrganizationPermissions, GridEvents, GridState, LiveCaptionsState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, Screenshare, ScreenshareState, SignalClientEvent, SignalStatusEvent, StickyReaction, StickyReactionEvent, StreamState, WaitingParticipant, WaitingParticipantState, WherebyClientOptions };
1429
+ export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, BREAKOUT_GROUPS_MIN_MAX, BREAKOUT_UNAVAILABLE_ERROR, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, DEFAULT_BREAKOUT_TIMER_DURATION, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createBreakoutGroups, createServices, debounce, defaultBreakoutGroupName, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
1430
+ export type { AppConfig, BreakoutSessionSettings, BreakoutState, BreakoutTimerEvent, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FullOrganizationPermissions, GridEvents, GridState, LiveCaptionsState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, Screenshare, ScreenshareState, SignalClientEvent, SignalStatusEvent, StartBreakoutSessionOptions, StickyReaction, StickyReactionEvent, StreamState, UpdateBreakoutSessionOptions, WaitingParticipant, WaitingParticipantState, WherebyClientOptions };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import { EventEmitter } from 'events';
3
- import { LiveCaptionEvent, RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, KnockResponse, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
3
+ import { LiveCaptionEvent, RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, RoomMode, KnockResponse, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
4
4
  export { ChatFileShare, KnockResponse, KnockResponseSender, RoomJoinedSuccess } from '@whereby.com/media';
5
5
  import * as redux_thunk from 'redux-thunk';
6
6
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
@@ -558,6 +558,14 @@ interface StickyReactionEventProps {
558
558
  } | null;
559
559
  }
560
560
  type StickyReactionEvent = NotificationEvent<"remoteHandRaised" | "remoteHandLowered", StickyReactionEventProps>;
561
+ interface BreakoutTimerEventProps {
562
+ }
563
+ type BreakoutTimerEvent = NotificationEvent<"breakoutTimerEnding" | "breakoutTimerEnded" | "breakoutTimerExtended", BreakoutTimerEventProps>;
564
+ interface BreakoutGroupAssignedEventProps {
565
+ group: string;
566
+ groupName: string;
567
+ }
568
+ type BreakoutGroupAssignedEvent = NotificationEvent<"breakoutGroupAssigned", BreakoutGroupAssignedEventProps>;
561
569
  type NotificationEventTypes = {
562
570
  ["requestAudioEnable"]: RequestAudioEvent;
563
571
  ["requestAudioDisable"]: RequestAudioEvent;
@@ -569,6 +577,10 @@ type NotificationEventTypes = {
569
577
  ["clientUnableToJoinFullRoom"]: SignalClientEvent;
570
578
  ["requestVideoEnable"]: RequestVideoEvent;
571
579
  ["requestVideoDisable"]: RequestVideoEvent;
580
+ ["breakoutTimerEnding"]: BreakoutTimerEvent;
581
+ ["breakoutTimerEnded"]: BreakoutTimerEvent;
582
+ ["breakoutTimerExtended"]: BreakoutTimerEvent;
583
+ ["breakoutGroupAssigned"]: BreakoutGroupAssignedEvent;
572
584
  };
573
585
  type NotificationEvents = NotificationEventTypes[keyof NotificationEventTypes];
574
586
  type NotificationEventMap = {
@@ -674,9 +686,41 @@ interface AuthorizationState {
674
686
  roleName: RoleName;
675
687
  }
676
688
 
689
+ declare const DEFAULT_BREAKOUT_TIMER_DURATION = 1800;
677
690
  interface BreakoutState$1 extends BreakoutConfig {
678
- groupId: string | null;
691
+ error: string | null;
692
+ }
693
+ declare const BREAKOUT_UNAVAILABLE_ERROR = "Breakout groups are not available in peer-to-peer rooms";
694
+ interface BreakoutSessionSettings {
695
+ enforceAssignment?: boolean;
696
+ autoMoveToGroup?: boolean;
697
+ autoMoveToMain?: boolean;
698
+ moveToGroupGracePeriod?: number | null;
699
+ moveToMainGracePeriod?: number | null;
700
+ breakoutTimerSetting?: boolean;
701
+ breakoutTimerDuration?: number;
702
+ }
703
+ interface StartBreakoutSessionOptions extends BreakoutSessionSettings {
704
+ groups: {
705
+ [groupId: string]: string;
706
+ };
707
+ assignments?: {
708
+ [clientId: string]: string;
709
+ };
679
710
  }
711
+ interface UpdateBreakoutSessionOptions extends BreakoutSessionSettings {
712
+ groups?: {
713
+ [groupId: string]: string;
714
+ };
715
+ assignments?: {
716
+ [clientId: string]: string;
717
+ };
718
+ }
719
+ declare const BREAKOUT_GROUPS_MIN_MAX: [number, number];
720
+ declare function defaultBreakoutGroupName(groupId: string): string;
721
+ declare function createBreakoutGroups(count?: number): {
722
+ [groupId: string]: string;
723
+ };
680
724
 
681
725
  interface ConnectionMonitorState {
682
726
  running: boolean;
@@ -717,6 +761,7 @@ type ClientView = {
717
761
 
718
762
  interface RoomState {
719
763
  isLocked: boolean;
764
+ mode: RoomMode | null;
720
765
  }
721
766
 
722
767
  type LocalMediaOptions$1 = {
@@ -1113,11 +1158,14 @@ interface WherebyClientOptions {
1113
1158
  externalId?: string | null;
1114
1159
  isNodeSdk?: boolean;
1115
1160
  }
1116
- type RemoteParticipantState = Omit<RemoteParticipant, "newJoiner" | "streams">;
1161
+ type RemoteParticipantState = Omit<RemoteParticipant, "newJoiner" | "streams"> & {
1162
+ breakoutGroupAssigned: string;
1163
+ };
1117
1164
  interface LocalParticipantState extends LocalParticipant {
1118
1165
  isScreenSharing: boolean;
1119
1166
  roleName: RoleName;
1120
1167
  clientClaim?: string;
1168
+ breakoutGroupAssigned: string;
1121
1169
  }
1122
1170
  interface WaitingParticipantState {
1123
1171
  id: string;
@@ -1156,11 +1204,27 @@ type LiveStreamState = {
1156
1204
  startedAt?: number;
1157
1205
  };
1158
1206
  type BreakoutState = {
1207
+ isAvailable: boolean;
1208
+ error: string | null;
1159
1209
  isActive: boolean;
1160
1210
  currentGroup: {
1161
1211
  id: string | null;
1162
1212
  name: string;
1163
1213
  } | null;
1214
+ groups: {
1215
+ [groupId: string]: string;
1216
+ } | null;
1217
+ enforceAssignment: boolean;
1218
+ autoMoveToGroup: boolean;
1219
+ moveToGroupGracePeriod: number | null;
1220
+ autoMoveToMain: boolean;
1221
+ moveToMainGracePeriod: number | null;
1222
+ breakoutTimerSetting: boolean;
1223
+ breakoutTimerDuration: number;
1224
+ startedAt: Date | null;
1225
+ endTime: number | null;
1226
+ moveToGroupAt: number | null;
1227
+ moveToMainAt: number | null;
1164
1228
  groupedParticipants: {
1165
1229
  clients: ClientView[];
1166
1230
  group: {
@@ -1169,6 +1233,7 @@ type BreakoutState = {
1169
1233
  } | null;
1170
1234
  }[];
1171
1235
  participantsInCurrentGroup: ClientView[];
1236
+ broadcastingParticipants: ClientView[];
1172
1237
  };
1173
1238
  interface RoomConnectionState {
1174
1239
  connectionStatus: ConnectionStatus;
@@ -1289,7 +1354,7 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
1289
1354
  getNotificationsEventEmitter(): NotificationsEventEmitter;
1290
1355
  initialize(options: WherebyClientOptions): void;
1291
1356
  joinRoom(): Promise<RoomJoinedSuccess>;
1292
- sendChatMessage(text: string, parentId?: string): void;
1357
+ sendChatMessage(text: string, parentId?: string, isBroadcast?: boolean): void;
1293
1358
  removeChatMessage(id: string, sig?: string | null): void;
1294
1359
  sendFiles(files: File[]): void;
1295
1360
  downloadFile(file: ChatFileShare): Promise<Blob>;
@@ -1325,6 +1390,19 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
1325
1390
  endMeeting(stayBehind?: boolean): void;
1326
1391
  joinBreakoutGroup(group: string): void;
1327
1392
  joinBreakoutMainRoom(): void;
1393
+ startBreakoutSession(options: StartBreakoutSessionOptions): void;
1394
+ updateBreakoutSession(options: UpdateBreakoutSessionOptions): void;
1395
+ stopBreakoutSession(): void;
1396
+ assignBreakoutParticipants(assignments: {
1397
+ [clientId: string]: string;
1398
+ }): void;
1399
+ assignAllBreakoutParticipants(): void;
1400
+ unassignAllBreakoutParticipants(): void;
1401
+ shuffleBreakoutParticipants(): void;
1402
+ extendBreakoutTimer(seconds?: number): void;
1403
+ stopBreakoutTimer(): void;
1404
+ broadcastToGroups(participantId: string): void;
1405
+ stopBroadcastToGroups(participantId: string): void;
1328
1406
  reportStreamResolution(streamId: string, width: number, height: number): void;
1329
1407
  switchCameraEffect(effectId: string): Promise<void>;
1330
1408
  switchCameraEffectCustom(imageUrl: string): Promise<void>;
@@ -1348,5 +1426,5 @@ declare class WherebyClient {
1348
1426
  destroy(): void;
1349
1427
  }
1350
1428
 
1351
- export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createServices, debounce, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
1352
- export type { AppConfig, BreakoutState, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FullOrganizationPermissions, GridEvents, GridState, LiveCaptionsState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, Screenshare, ScreenshareState, SignalClientEvent, SignalStatusEvent, StickyReaction, StickyReactionEvent, StreamState, WaitingParticipant, WaitingParticipantState, WherebyClientOptions };
1429
+ export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, BREAKOUT_GROUPS_MIN_MAX, BREAKOUT_UNAVAILABLE_ERROR, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, DEFAULT_BREAKOUT_TIMER_DURATION, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createBreakoutGroups, createServices, debounce, defaultBreakoutGroupName, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
1430
+ export type { AppConfig, BreakoutSessionSettings, BreakoutState, BreakoutTimerEvent, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FullOrganizationPermissions, GridEvents, GridState, LiveCaptionsState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, Screenshare, ScreenshareState, SignalClientEvent, SignalStatusEvent, StartBreakoutSessionOptions, StickyReaction, StickyReactionEvent, StreamState, UpdateBreakoutSessionOptions, WaitingParticipant, WaitingParticipantState, WherebyClientOptions };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import { EventEmitter } from 'events';
3
- import { LiveCaptionEvent, RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, KnockResponse, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
3
+ import { LiveCaptionEvent, RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, RoomMode, KnockResponse, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
4
4
  export { ChatFileShare, KnockResponse, KnockResponseSender, RoomJoinedSuccess } from '@whereby.com/media';
5
5
  import * as redux_thunk from 'redux-thunk';
6
6
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
@@ -558,6 +558,14 @@ interface StickyReactionEventProps {
558
558
  } | null;
559
559
  }
560
560
  type StickyReactionEvent = NotificationEvent<"remoteHandRaised" | "remoteHandLowered", StickyReactionEventProps>;
561
+ interface BreakoutTimerEventProps {
562
+ }
563
+ type BreakoutTimerEvent = NotificationEvent<"breakoutTimerEnding" | "breakoutTimerEnded" | "breakoutTimerExtended", BreakoutTimerEventProps>;
564
+ interface BreakoutGroupAssignedEventProps {
565
+ group: string;
566
+ groupName: string;
567
+ }
568
+ type BreakoutGroupAssignedEvent = NotificationEvent<"breakoutGroupAssigned", BreakoutGroupAssignedEventProps>;
561
569
  type NotificationEventTypes = {
562
570
  ["requestAudioEnable"]: RequestAudioEvent;
563
571
  ["requestAudioDisable"]: RequestAudioEvent;
@@ -569,6 +577,10 @@ type NotificationEventTypes = {
569
577
  ["clientUnableToJoinFullRoom"]: SignalClientEvent;
570
578
  ["requestVideoEnable"]: RequestVideoEvent;
571
579
  ["requestVideoDisable"]: RequestVideoEvent;
580
+ ["breakoutTimerEnding"]: BreakoutTimerEvent;
581
+ ["breakoutTimerEnded"]: BreakoutTimerEvent;
582
+ ["breakoutTimerExtended"]: BreakoutTimerEvent;
583
+ ["breakoutGroupAssigned"]: BreakoutGroupAssignedEvent;
572
584
  };
573
585
  type NotificationEvents = NotificationEventTypes[keyof NotificationEventTypes];
574
586
  type NotificationEventMap = {
@@ -674,9 +686,41 @@ interface AuthorizationState {
674
686
  roleName: RoleName;
675
687
  }
676
688
 
689
+ declare const DEFAULT_BREAKOUT_TIMER_DURATION = 1800;
677
690
  interface BreakoutState$1 extends BreakoutConfig {
678
- groupId: string | null;
691
+ error: string | null;
692
+ }
693
+ declare const BREAKOUT_UNAVAILABLE_ERROR = "Breakout groups are not available in peer-to-peer rooms";
694
+ interface BreakoutSessionSettings {
695
+ enforceAssignment?: boolean;
696
+ autoMoveToGroup?: boolean;
697
+ autoMoveToMain?: boolean;
698
+ moveToGroupGracePeriod?: number | null;
699
+ moveToMainGracePeriod?: number | null;
700
+ breakoutTimerSetting?: boolean;
701
+ breakoutTimerDuration?: number;
702
+ }
703
+ interface StartBreakoutSessionOptions extends BreakoutSessionSettings {
704
+ groups: {
705
+ [groupId: string]: string;
706
+ };
707
+ assignments?: {
708
+ [clientId: string]: string;
709
+ };
679
710
  }
711
+ interface UpdateBreakoutSessionOptions extends BreakoutSessionSettings {
712
+ groups?: {
713
+ [groupId: string]: string;
714
+ };
715
+ assignments?: {
716
+ [clientId: string]: string;
717
+ };
718
+ }
719
+ declare const BREAKOUT_GROUPS_MIN_MAX: [number, number];
720
+ declare function defaultBreakoutGroupName(groupId: string): string;
721
+ declare function createBreakoutGroups(count?: number): {
722
+ [groupId: string]: string;
723
+ };
680
724
 
681
725
  interface ConnectionMonitorState {
682
726
  running: boolean;
@@ -717,6 +761,7 @@ type ClientView = {
717
761
 
718
762
  interface RoomState {
719
763
  isLocked: boolean;
764
+ mode: RoomMode | null;
720
765
  }
721
766
 
722
767
  type LocalMediaOptions$1 = {
@@ -1113,11 +1158,14 @@ interface WherebyClientOptions {
1113
1158
  externalId?: string | null;
1114
1159
  isNodeSdk?: boolean;
1115
1160
  }
1116
- type RemoteParticipantState = Omit<RemoteParticipant, "newJoiner" | "streams">;
1161
+ type RemoteParticipantState = Omit<RemoteParticipant, "newJoiner" | "streams"> & {
1162
+ breakoutGroupAssigned: string;
1163
+ };
1117
1164
  interface LocalParticipantState extends LocalParticipant {
1118
1165
  isScreenSharing: boolean;
1119
1166
  roleName: RoleName;
1120
1167
  clientClaim?: string;
1168
+ breakoutGroupAssigned: string;
1121
1169
  }
1122
1170
  interface WaitingParticipantState {
1123
1171
  id: string;
@@ -1156,11 +1204,27 @@ type LiveStreamState = {
1156
1204
  startedAt?: number;
1157
1205
  };
1158
1206
  type BreakoutState = {
1207
+ isAvailable: boolean;
1208
+ error: string | null;
1159
1209
  isActive: boolean;
1160
1210
  currentGroup: {
1161
1211
  id: string | null;
1162
1212
  name: string;
1163
1213
  } | null;
1214
+ groups: {
1215
+ [groupId: string]: string;
1216
+ } | null;
1217
+ enforceAssignment: boolean;
1218
+ autoMoveToGroup: boolean;
1219
+ moveToGroupGracePeriod: number | null;
1220
+ autoMoveToMain: boolean;
1221
+ moveToMainGracePeriod: number | null;
1222
+ breakoutTimerSetting: boolean;
1223
+ breakoutTimerDuration: number;
1224
+ startedAt: Date | null;
1225
+ endTime: number | null;
1226
+ moveToGroupAt: number | null;
1227
+ moveToMainAt: number | null;
1164
1228
  groupedParticipants: {
1165
1229
  clients: ClientView[];
1166
1230
  group: {
@@ -1169,6 +1233,7 @@ type BreakoutState = {
1169
1233
  } | null;
1170
1234
  }[];
1171
1235
  participantsInCurrentGroup: ClientView[];
1236
+ broadcastingParticipants: ClientView[];
1172
1237
  };
1173
1238
  interface RoomConnectionState {
1174
1239
  connectionStatus: ConnectionStatus;
@@ -1289,7 +1354,7 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
1289
1354
  getNotificationsEventEmitter(): NotificationsEventEmitter;
1290
1355
  initialize(options: WherebyClientOptions): void;
1291
1356
  joinRoom(): Promise<RoomJoinedSuccess>;
1292
- sendChatMessage(text: string, parentId?: string): void;
1357
+ sendChatMessage(text: string, parentId?: string, isBroadcast?: boolean): void;
1293
1358
  removeChatMessage(id: string, sig?: string | null): void;
1294
1359
  sendFiles(files: File[]): void;
1295
1360
  downloadFile(file: ChatFileShare): Promise<Blob>;
@@ -1325,6 +1390,19 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
1325
1390
  endMeeting(stayBehind?: boolean): void;
1326
1391
  joinBreakoutGroup(group: string): void;
1327
1392
  joinBreakoutMainRoom(): void;
1393
+ startBreakoutSession(options: StartBreakoutSessionOptions): void;
1394
+ updateBreakoutSession(options: UpdateBreakoutSessionOptions): void;
1395
+ stopBreakoutSession(): void;
1396
+ assignBreakoutParticipants(assignments: {
1397
+ [clientId: string]: string;
1398
+ }): void;
1399
+ assignAllBreakoutParticipants(): void;
1400
+ unassignAllBreakoutParticipants(): void;
1401
+ shuffleBreakoutParticipants(): void;
1402
+ extendBreakoutTimer(seconds?: number): void;
1403
+ stopBreakoutTimer(): void;
1404
+ broadcastToGroups(participantId: string): void;
1405
+ stopBroadcastToGroups(participantId: string): void;
1328
1406
  reportStreamResolution(streamId: string, width: number, height: number): void;
1329
1407
  switchCameraEffect(effectId: string): Promise<void>;
1330
1408
  switchCameraEffectCustom(imageUrl: string): Promise<void>;
@@ -1348,5 +1426,5 @@ declare class WherebyClient {
1348
1426
  destroy(): void;
1349
1427
  }
1350
1428
 
1351
- export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createServices, debounce, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
1352
- export type { AppConfig, BreakoutState, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FullOrganizationPermissions, GridEvents, GridState, LiveCaptionsState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, Screenshare, ScreenshareState, SignalClientEvent, SignalStatusEvent, StickyReaction, StickyReactionEvent, StreamState, WaitingParticipant, WaitingParticipantState, WherebyClientOptions };
1429
+ export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, BREAKOUT_GROUPS_MIN_MAX, BREAKOUT_UNAVAILABLE_ERROR, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_STATE_CHANGED, CHAT_NEW_MESSAGE, CLIENT_VIEW_CHANGED, CLIENT_VIEW_SPOTLIGHTS_CHANGED, CLOUD_RECORDING_STATUS_CHANGED, CONNECTION_ERROR_CHANGED, CONNECTION_STATUS_CHANGED, CURRENT_CAMERA_CHANGED, CURRENT_MICROPHONE_CHANGED, CURRENT_SPEAKER_CHANGED, Credentials, CredentialsService, DEFAULT_BREAKOUT_TIMER_DURATION, GridClient, IS_SETTING_CAMERA_DEVICE, IS_SETTING_MICROPHONE_DEVICE, LIVE_CAPTIONS_STATUS_CHANGED, LIVE_TRANSCRIPTION_STATUS_CHANGED, LOCAL_MEDIA_STARTING, LOCAL_MEDIA_START_ERROR_CHANGED, LOCAL_PARTICIPANT_CHANGED, LOCAL_SCREENSHARE_STATUS_CHANGED, LOCAL_STREAM_CHANGED, LiveCaption, LocalMediaClient, LocalParticipant, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, MICROPHONE_DEVICES_CHANGED, MICROPHONE_DEVICE_ERROR_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_JOINED, ROOM_JOINED_ERROR, RoomConnectionClient, RoomService, SCREENSHARE_STARTED, SCREENSHARE_STOPPED, SPEAKER_DEVICES_CHANGED, SPOTLIGHT_PARTICIPANT_ADDED, SPOTLIGHT_PARTICIPANT_REMOVED, STREAMING_STARTED, STREAMING_STOPPED, WAITING_PARTICIPANT_JOINED, WAITING_PARTICIPANT_LEFT, WherebyClient, createBreakoutGroups, createServices, debounce, defaultBreakoutGroupName, getAudioTrack, getFakeMediaStream, getUsableCameraEffectPresets, getVideoTrack, hasValue, isAudioDenoiserSupported, parseUnverifiedRoomKeyData };
1430
+ export type { AppConfig, BreakoutSessionSettings, BreakoutState, BreakoutTimerEvent, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FullOrganizationPermissions, GridEvents, GridState, LiveCaptionsState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, Screenshare, ScreenshareState, SignalClientEvent, SignalStatusEvent, StartBreakoutSessionOptions, StickyReaction, StickyReactionEvent, StreamState, UpdateBreakoutSessionOptions, WaitingParticipant, WaitingParticipantState, WherebyClientOptions };