@whereby.com/core 1.21.2 → 1.22.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.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import { EventEmitter } from 'events';
3
- import { LiveCaptionEvent, RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, RoomMode, KnockResponse, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
4
- export { ChatFileShare, KnockResponse, KnockResponseSender, RoomJoinedSuccess } from '@whereby.com/media';
3
+ import { LiveCaptionEvent, RoomIntegrationProps, RoleName, ChatMessage as ChatMessage$2, ChatFileShare, FileShareErrorCode, BreakoutConfig, RoomMode, KnockResponse, RoomIntegrationErrorCode, RtcManager, RtcManagerDispatcher, ServerSocket, RoomJoinedErrors, RoomJoinedSuccess } from '@whereby.com/media';
4
+ export { ChatFileShare, KnockResponse, KnockResponseSender, RoomIntegrationProps, RoomJoinedSuccess } from '@whereby.com/media';
5
5
  import * as redux_thunk from 'redux-thunk';
6
6
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
7
7
  import * as redux from 'redux';
@@ -385,6 +385,48 @@ declare class RoomService {
385
385
  }): any;
386
386
  }
387
387
 
388
+ interface RoomIntegrationResponse {
389
+ roomIntegrationId: number | string;
390
+ name: string;
391
+ title: string;
392
+ description: string;
393
+ type: string;
394
+ icons: {
395
+ small: string;
396
+ large: string;
397
+ };
398
+ link: {
399
+ href: string;
400
+ text: string;
401
+ };
402
+ entrypoint: string;
403
+ webview: string;
404
+ matcher: string;
405
+ version?: string;
406
+ isEmbeddable?: boolean;
407
+ }
408
+ interface FindRoomIntegrationsResponse {
409
+ enabledRoomIntegrations: RoomIntegrationResponse[];
410
+ disabledRoomIntegrations: RoomIntegrationResponse[];
411
+ unavailableRoomIntegrations: RoomIntegrationResponse[];
412
+ }
413
+ declare class RoomIntegrationService {
414
+ private _apiClient;
415
+ constructor({ apiClient }: {
416
+ apiClient: ApiClient;
417
+ });
418
+ findRoomIntegrations({ organizationId, roomName, }: {
419
+ organizationId: string;
420
+ roomName: string;
421
+ }): Promise<FindRoomIntegrationsResponse>;
422
+ toggleRoomIntegration({ organizationId, roomName, roomIntegrationId, enable, }: {
423
+ organizationId: string;
424
+ roomName: string;
425
+ roomIntegrationId: number;
426
+ enable: boolean;
427
+ }): Promise<void>;
428
+ }
429
+
388
430
  declare class LiveCaption {
389
431
  resultId: string;
390
432
  participantId: string;
@@ -396,6 +438,30 @@ declare class LiveCaption {
396
438
  declare function getUsableCameraEffectPresets(): Promise<string[]>;
397
439
  declare function isAudioDenoiserSupported(): Promise<boolean>;
398
440
 
441
+ interface RoomIntegrationContent {
442
+ tagName: string;
443
+ shareUrl: string;
444
+ props: RoomIntegrationProps;
445
+ }
446
+ declare function roomIntegrationContentTagName(integrationName: string): string;
447
+ interface YouTubeContentMetadata {
448
+ aspectRatio?: number;
449
+ isLive?: boolean;
450
+ title?: string;
451
+ }
452
+ declare function youtube({ url, startAt, metadata, }: {
453
+ url: string;
454
+ startAt?: number;
455
+ metadata?: YouTubeContentMetadata;
456
+ }): RoomIntegrationContent | null;
457
+ declare function miro({ accessLink }: {
458
+ accessLink: string;
459
+ }): RoomIntegrationContent | null;
460
+ declare const roomIntegrationContent: {
461
+ youtube: typeof youtube;
462
+ miro: typeof miro;
463
+ };
464
+
399
465
  interface StickyReaction {
400
466
  reaction: string;
401
467
  timestamp: string;
@@ -476,6 +542,7 @@ declare function createServices(): {
476
542
  credentialsService: CredentialsService;
477
543
  apiClient: ApiClient;
478
544
  organizationService: OrganizationService;
545
+ roomIntegrationService: RoomIntegrationService;
479
546
  fetchOrganizationFromRoomUrl: (roomUrl: string) => Promise<Organization | null>;
480
547
  };
481
548
 
@@ -854,6 +921,72 @@ interface RoomConnectionState$1 {
854
921
  knockResponse: KnockResponse | null;
855
922
  }
856
923
 
924
+ interface RoomIntegration {
925
+ roomIntegrationId: string;
926
+ name: string;
927
+ title: string;
928
+ description: string;
929
+ type: string;
930
+ icons: {
931
+ small: string;
932
+ large: string;
933
+ };
934
+ link: {
935
+ href: string;
936
+ text: string;
937
+ };
938
+ contentTagName: string;
939
+ entrypoint: string;
940
+ webview: string;
941
+ matcher: RegExp;
942
+ isEmbeddable: boolean;
943
+ }
944
+ interface RoomIntegrationSession {
945
+ roomIntegrationSessionId: string;
946
+ roomIntegrationId: string;
947
+ breakoutGroupId: string;
948
+ tagName: string;
949
+ shareUrl: string;
950
+ props: RoomIntegrationProps;
951
+ clientId: string;
952
+ roomIntegrationSessionStartedAt: number | null;
953
+ }
954
+ interface RoomIntegrationSessionView extends RoomIntegrationSession {
955
+ integration: RoomIntegration;
956
+ isPresenter: boolean;
957
+ presenterDisplayName: string | null;
958
+ canStop: boolean;
959
+ }
960
+ type RoomIntegrationError = RoomIntegrationErrorCode | "unknown_integration" | "integration_not_enabled" | "not_allowed_to_stop" | "invalid_content" | "unknown";
961
+ interface RoomIntegrationErrorDetail {
962
+ code: RoomIntegrationError;
963
+ message: string;
964
+ }
965
+ interface RoomIntegrationsState$1 {
966
+ available: RoomIntegration[];
967
+ unavailable: RoomIntegration[];
968
+ enabled: string[];
969
+ running: RoomIntegrationSession[];
970
+ isFetching: boolean;
971
+ hasFetched: boolean;
972
+ error: RoomIntegrationErrorDetail | null;
973
+ }
974
+ declare const ROOM_INTEGRATION_PICKER_MESSAGES: {
975
+ readonly FORM_SUBMIT: "whereby:formSubmit";
976
+ readonly FORM_CLOSE: "whereby:formClose";
977
+ readonly ERROR: "whereby:bootstrapError";
978
+ };
979
+ interface RoomIntegrationPickerResult {
980
+ tagName: string;
981
+ shareUrl: string;
982
+ props: RoomIntegrationProps;
983
+ }
984
+ declare function roomIntegrationPickerUrl({ integration, parentOrigin, featureSource, }: {
985
+ integration: Pick<RoomIntegration, "webview">;
986
+ parentOrigin: string;
987
+ featureSource?: string;
988
+ }): string;
989
+
857
990
  interface StreamResolutionUpdate {
858
991
  streamId: string;
859
992
  width: number;
@@ -908,6 +1041,7 @@ declare const appReducer: redux.Reducer<{
908
1041
  remoteParticipants: RemoteParticipantSliceState;
909
1042
  room: RoomState;
910
1043
  roomConnection: RoomConnectionState$1;
1044
+ roomIntegrations: RoomIntegrationsState$1;
911
1045
  rtcAnalytics: rtcAnalyticsState;
912
1046
  rtcConnection: RtcConnectionState;
913
1047
  signalConnection: SignalConnectionState;
@@ -935,6 +1069,7 @@ declare const appReducer: redux.Reducer<{
935
1069
  remoteParticipants: RemoteParticipantSliceState | undefined;
936
1070
  room: RoomState | undefined;
937
1071
  roomConnection: RoomConnectionState$1 | undefined;
1072
+ roomIntegrations: RoomIntegrationsState$1 | undefined;
938
1073
  rtcAnalytics: rtcAnalyticsState | undefined;
939
1074
  rtcConnection: RtcConnectionState | undefined;
940
1075
  signalConnection: SignalConnectionState | undefined;
@@ -966,6 +1101,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
966
1101
  remoteParticipants: RemoteParticipantSliceState;
967
1102
  room: RoomState;
968
1103
  roomConnection: RoomConnectionState$1;
1104
+ roomIntegrations: RoomIntegrationsState$1;
969
1105
  rtcAnalytics: rtcAnalyticsState;
970
1106
  rtcConnection: RtcConnectionState;
971
1107
  signalConnection: SignalConnectionState;
@@ -994,6 +1130,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
994
1130
  remoteParticipants: RemoteParticipantSliceState;
995
1131
  room: RoomState;
996
1132
  roomConnection: RoomConnectionState$1;
1133
+ roomIntegrations: RoomIntegrationsState$1;
997
1134
  rtcAnalytics: rtcAnalyticsState;
998
1135
  rtcConnection: RtcConnectionState;
999
1136
  signalConnection: SignalConnectionState;
@@ -1005,6 +1142,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
1005
1142
  credentialsService: CredentialsService;
1006
1143
  apiClient: ApiClient;
1007
1144
  organizationService: OrganizationService;
1145
+ roomIntegrationService: RoomIntegrationService;
1008
1146
  fetchOrganizationFromRoomUrl: (roomUrl: string) => Promise<Organization | null>;
1009
1147
  };
1010
1148
  }, redux.UnknownAction>;
@@ -1015,16 +1153,19 @@ type Store = ReturnType<typeof createStore>;
1015
1153
  declare const CLIENT_VIEW_CHANGED = "grid:client-view-changed";
1016
1154
  declare const CLIENT_VIEW_SPOTLIGHTS_CHANGED = "grid:client-view-spotlights-changed";
1017
1155
  declare const NUMBER_OF_CLIENT_VIEWS_CHANGED = "grid:number-of-client-views-changed";
1156
+ declare const RUNNING_ROOM_INTEGRATIONS_CHANGED = "grid:running-room-integrations-changed";
1018
1157
  type GridEvents = {
1019
1158
  [CLIENT_VIEW_CHANGED]: [clientViews: ClientView[]];
1020
1159
  [CLIENT_VIEW_SPOTLIGHTS_CHANGED]: [clientViews: ClientView[]];
1021
1160
  [NUMBER_OF_CLIENT_VIEWS_CHANGED]: [numClients: number];
1161
+ [RUNNING_ROOM_INTEGRATIONS_CHANGED]: [sessions: RoomIntegrationSessionView[]];
1022
1162
  };
1023
1163
 
1024
1164
  interface GridState {
1025
1165
  allClientViews: ClientView[];
1026
1166
  spotlightedParticipants: ClientView[];
1027
1167
  numParticipants: number;
1168
+ runningRoomIntegrations: RoomIntegrationSessionView[];
1028
1169
  }
1029
1170
 
1030
1171
  declare abstract class BaseClient<TState, TEvents extends Record<string, unknown[]>> extends EventEmitter<TEvents> {
@@ -1043,12 +1184,14 @@ declare class GridClient extends BaseClient<GridState, GridEvents> {
1043
1184
  private clientViewSubscribers;
1044
1185
  private spotlightedSubscribers;
1045
1186
  private numberOfClientViewsSubscribers;
1187
+ private runningRoomIntegrationsSubscribers;
1046
1188
  constructor(store: Store);
1047
1189
  protected handleStateChanges(state: GridState, previousState: GridState): void;
1048
1190
  getState(): GridState;
1049
1191
  subscribeClientViews(callback: (clientViews: ClientView[]) => void): () => void;
1050
1192
  subscribeSpotlightedParticipants(callback: (spotlighted: ClientView[]) => void): () => void;
1051
1193
  subscribeNumberOfClientViews(callback: (num: number) => void): () => void;
1194
+ subscribeRunningRoomIntegrations(callback: (sessions: RoomIntegrationSessionView[]) => void): () => void;
1052
1195
  spotlightParticipant(id: string): void;
1053
1196
  removeSpotlight(id: string): void;
1054
1197
  destroy(): void;
@@ -1268,6 +1411,14 @@ type BreakoutState = {
1268
1411
  participantsInCurrentGroup: ClientView[];
1269
1412
  broadcastingParticipants: ClientView[];
1270
1413
  };
1414
+ type RoomIntegrationsState = {
1415
+ hasFetched: boolean;
1416
+ isFetching: boolean;
1417
+ error: RoomIntegrationErrorDetail | null;
1418
+ embeddable: RoomIntegration[];
1419
+ enabled: RoomIntegration[];
1420
+ running: RoomIntegrationSessionView[];
1421
+ };
1271
1422
  interface RoomConnectionState {
1272
1423
  connectionStatus: ConnectionStatus;
1273
1424
  connectionError: string | null;
@@ -1286,6 +1437,7 @@ interface RoomConnectionState {
1286
1437
  localScreenshare?: LocalScreenshareState;
1287
1438
  localParticipant?: LocalParticipantState;
1288
1439
  remoteParticipants: RemoteParticipantState[];
1440
+ roomIntegrations: RoomIntegrationsState;
1289
1441
  screenshares: Screenshare[];
1290
1442
  waitingParticipants: WaitingParticipantState[];
1291
1443
  spotlightedParticipants: ClientView[];
@@ -1428,6 +1580,20 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
1428
1580
  removeSpotlight(participantId: string): void;
1429
1581
  kickParticipant(participantId: string): void;
1430
1582
  endMeeting(stayBehind?: boolean): void;
1583
+ startRoomIntegration(options: {
1584
+ roomIntegrationId: string;
1585
+ tagName: string;
1586
+ shareUrl: string;
1587
+ props?: RoomIntegrationProps;
1588
+ }): void;
1589
+ stopRoomIntegration(options: {
1590
+ roomIntegrationSessionId: string;
1591
+ intent?: "stop" | "end";
1592
+ }): void;
1593
+ updateRoomIntegrationProps(options: {
1594
+ roomIntegrationSessionId: string;
1595
+ props: RoomIntegrationProps;
1596
+ }): void;
1431
1597
  joinBreakoutGroup(group: string): void;
1432
1598
  joinBreakoutMainRoom(): void;
1433
1599
  startBreakoutSession(options: StartBreakoutSessionOptions): void;
@@ -1466,5 +1632,5 @@ declare class WherebyClient {
1466
1632
  destroy(): void;
1467
1633
  }
1468
1634
 
1469
- export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, BREAKOUT_GROUPS_MIN_MAX, BREAKOUT_UNAVAILABLE_ERROR, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_ENABLED_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_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_ENABLED_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 };
1470
- export type { AppConfig, BreakoutSessionSettings, BreakoutState, BreakoutTimerEvent, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FullOrganizationPermissions, GridEvents, GridState, InitialMuteStates, LiveCaptionsState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestScreenshareEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, Screenshare, ScreenshareState, SendFilesOptions, SignalClientEvent, SignalStatusEvent, StartBreakoutSessionOptions, StickyReaction, StickyReactionEvent, StreamState, UpdateBreakoutSessionOptions, WaitingParticipant, WaitingParticipantState, WherebyClientOptions };
1635
+ export { ACCEPTED_FILE_TYPES, ApiClient, BREAKOUT_CONFIG_CHANGED, BREAKOUT_GROUPS_MIN_MAX, BREAKOUT_UNAVAILABLE_ERROR, CAMERA_DEVICES_CHANGED, CAMERA_DEVICE_ERROR_CHANGED, CAMERA_ENABLED_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_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_ENABLED_CHANGED, MICROPHONE_STATE_CHANGED, NUMBER_OF_CLIENT_VIEWS_CHANGED, Organization, OrganizationApiClient, OrganizationService, OrganizationServiceCache, REMOTE_PARTICIPANTS_CHANGED, ROOM_INTEGRATION_PICKER_MESSAGES, ROOM_JOINED, ROOM_JOINED_ERROR, RUNNING_ROOM_INTEGRATIONS_CHANGED, RoomConnectionClient, RoomIntegrationService, 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, miro, parseUnverifiedRoomKeyData, roomIntegrationContent, roomIntegrationContentTagName, roomIntegrationPickerUrl, youtube };
1636
+ export type { AppConfig, BreakoutSessionSettings, BreakoutState, BreakoutTimerEvent, ChatMessage, ChatMessageEvent, ChatMessageState, ClientView, CloudRecordingState, ConnectionStatus, FileShareError, FileUpload, FindRoomIntegrationsResponse, FullOrganizationPermissions, GridEvents, GridState, InitialMuteStates, LiveCaptionsState, LiveStreamState, LiveTranscriptionState, LocalMediaEvents, LocalMediaOptions, LocalMediaState, LocalParticipantState, LocalScreenshareState, LocalScreenshareStatus, NotificationEvents, NotificationsEventEmitter, OrganizationLimits, OrganizationOnboardingSurvey, OrganizationPermissionAction, OrganizationPermissions, OrganizationPreferences, RemoteParticipant, RemoteParticipantData, RemoteParticipantState, RequestAudioEvent, RequestScreenshareEvent, RequestVideoEvent, RoomConnectionEvents, RoomConnectionState, RoomIntegration, RoomIntegrationContent, RoomIntegrationError, RoomIntegrationErrorDetail, RoomIntegrationPickerResult, RoomIntegrationResponse, RoomIntegrationSession, RoomIntegrationSessionView, RoomIntegrationsState, Screenshare, ScreenshareState, SendFilesOptions, SignalClientEvent, SignalStatusEvent, StartBreakoutSessionOptions, StickyReaction, StickyReactionEvent, StreamState, UpdateBreakoutSessionOptions, WaitingParticipant, WaitingParticipantState, WherebyClientOptions, YouTubeContentMetadata };