@whereby.com/core 0.23.1 → 0.24.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.mjs CHANGED
@@ -43,7 +43,7 @@ const createReactor = (selectors, callback) => {
43
43
  });
44
44
  };
45
45
 
46
- const coreVersion = "0.23.1";
46
+ const coreVersion = "0.24.0";
47
47
 
48
48
  const initialState$f = {
49
49
  isNodeSdk: false,
@@ -90,6 +90,7 @@ const signalEvents = {
90
90
  clientLeft: createSignalEventAction("clientLeft"),
91
91
  clientKicked: createSignalEventAction("clientKicked"),
92
92
  clientMetadataReceived: createSignalEventAction("clientMetadataReceived"),
93
+ clientUnableToJoin: createSignalEventAction("clientUnableToJoin"),
93
94
  cloudRecordingStarted: createSignalEventAction("cloudRecordingStarted"),
94
95
  cloudRecordingStopped: createSignalEventAction("cloudRecordingStopped"),
95
96
  disconnect: createSignalEventAction("disconnect"),
@@ -245,6 +246,7 @@ function forwardSocketEvents(socket, dispatch) {
245
246
  socket.on("new_client", (payload) => dispatch(signalEvents.newClient(payload)));
246
247
  socket.on("client_left", (payload) => dispatch(signalEvents.clientLeft(payload)));
247
248
  socket.on("client_kicked", (payload) => dispatch(signalEvents.clientKicked(payload)));
249
+ socket.on("client_unable_to_join", (payload) => dispatch(signalEvents.clientUnableToJoin(payload)));
248
250
  socket.on("audio_enabled", (payload) => dispatch(signalEvents.audioEnabled(payload)));
249
251
  socket.on("video_enabled", (payload) => dispatch(signalEvents.videoEnabled(payload)));
250
252
  socket.on("audio_enable_requested", (payload) => dispatch(signalEvents.audioEnableRequested(payload)));
@@ -1386,19 +1388,13 @@ const remoteParticipantsSlice = createSlice({
1386
1388
  return state;
1387
1389
  const selfId = action.payload.selfId;
1388
1390
  const { clients } = action.payload.room;
1389
- return Object.assign(Object.assign({}, state), { remoteParticipants: clients
1390
- .filter((c) => c.id !== selfId)
1391
- .filter((c) => !NON_PERSON_ROLES.includes(c.role.roleName))
1392
- .map((c) => createRemoteParticipant(c)) });
1391
+ return Object.assign(Object.assign({}, state), { remoteParticipants: clients.filter((c) => c.id !== selfId).map((c) => createRemoteParticipant(c)) });
1393
1392
  });
1394
1393
  builder.addCase(rtcEvents.streamAdded, (state, action) => {
1395
1394
  return addStream(state, action.payload);
1396
1395
  });
1397
1396
  builder.addCase(signalEvents.newClient, (state, action) => {
1398
1397
  const { client } = action.payload;
1399
- if (NON_PERSON_ROLES.includes(client.role.roleName)) {
1400
- return state;
1401
- }
1402
1398
  return addParticipant(state, createRemoteParticipant(client, true));
1403
1399
  });
1404
1400
  builder.addCase(signalEvents.clientLeft, (state, action) => {
@@ -1817,6 +1813,19 @@ createReactor([selectSignalStatus], ({ dispatch, getState }, signalStatus) => {
1817
1813
  })));
1818
1814
  }
1819
1815
  });
1816
+ startAppListening({
1817
+ actionCreator: signalEvents.clientUnableToJoin,
1818
+ effect: (action, { dispatch }) => {
1819
+ var _a;
1820
+ if (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.error) === "room_full") {
1821
+ dispatch(doSetNotification(createNotificationEvent({
1822
+ type: "clientUnableToJoinFullRoom",
1823
+ message: "Someone tried to join but the room is full and at capacity.",
1824
+ props: {},
1825
+ })));
1826
+ }
1827
+ },
1828
+ });
1820
1829
 
1821
1830
  function isStreamerClient(client) {
1822
1831
  return client.roleName === "streamer";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@whereby.com/core",
3
3
  "description": "Core library for whereby.com sdk",
4
4
  "author": "Whereby AS",
5
- "version": "0.23.1",
5
+ "version": "0.24.0",
6
6
  "license": "MIT",
7
7
  "scripts": {
8
8
  "build": "rimraf dist && rollup -c rollup.config.js",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@reduxjs/toolkit": "^2.2.3",
50
- "@whereby.com/media": "1.10.1",
50
+ "@whereby.com/media": "1.11.0",
51
51
  "axios": "^1.2.3",
52
52
  "btoa": "^1.2.1",
53
53
  "events": "^3.3.0"