@signalwire/js 3.29.1 → 3.29.2

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 (34) hide show
  1. package/dist/core/src/BaseSession.d.ts.map +1 -1
  2. package/dist/core/src/types/fabricRoomSession.d.ts +22 -1
  3. package/dist/core/src/types/fabricRoomSession.d.ts.map +1 -1
  4. package/dist/core/src/utils/interfaces.d.ts +1 -1
  5. package/dist/core/src/utils/interfaces.d.ts.map +1 -1
  6. package/dist/index.esm.js +26 -6
  7. package/dist/index.esm.js.map +2 -2
  8. package/dist/index.js +28 -6
  9. package/dist/index.js.map +2 -2
  10. package/dist/index.umd.js +4 -4
  11. package/dist/index.umd.js.map +1 -1
  12. package/dist/js/src/buildVideoElement.d.ts.map +1 -1
  13. package/dist/js/src/fabric/FabricRoomSession.d.ts +1 -0
  14. package/dist/js/src/fabric/FabricRoomSession.d.ts.map +1 -1
  15. package/dist/js/src/fabric/utils/eventMappers.d.ts +4 -4
  16. package/dist/js/src/fabric/utils/validationProxy.d.ts.map +1 -1
  17. package/dist/js/src/fabric/utils/validators.d.ts +1 -0
  18. package/dist/js/src/fabric/utils/validators.d.ts.map +1 -1
  19. package/dist/js/tsconfig.build.tsbuildinfo +1 -1
  20. package/dist/webrtc/src/BaseConnection.d.ts.map +1 -1
  21. package/dist/webrtc/src/RTCPeer.d.ts +10 -0
  22. package/dist/webrtc/src/RTCPeer.d.ts.map +1 -1
  23. package/dist/webrtc/src/RTCPeerConnectionManager.d.ts.map +1 -1
  24. package/dist/webrtc/src/connectionPoolManager.d.ts.map +1 -1
  25. package/dist/webrtc/src/utils/index.d.ts +1 -0
  26. package/dist/webrtc/src/utils/index.d.ts.map +1 -1
  27. package/dist/webrtc/src/utils/sdpHelpers.d.ts.map +1 -1
  28. package/dist/webrtc/src/workers/roomSubscribedWorker.d.ts.map +1 -1
  29. package/package.json +3 -3
  30. package/src/buildVideoElement.ts +7 -1
  31. package/src/fabric/FabricRoomSession.ts +7 -0
  32. package/src/fabric/utils/validationProxy.ts +2 -0
  33. package/src/fabric/utils/validators.ts +7 -0
  34. package/src/utils/videoElement.ts +3 -3
package/dist/index.js CHANGED
@@ -2074,6 +2074,13 @@ function validateSetAudioFlags(params) {
2074
2074
  );
2075
2075
  }
2076
2076
  }
2077
+ function validateEnd() {
2078
+ var _a;
2079
+ const capability = (_a = this.capabilities) == null ? void 0 : _a.end;
2080
+ if (!capability) {
2081
+ throw new import_core26.CapabilityError("Missing 'end' capability");
2082
+ }
2083
+ }
2077
2084
 
2078
2085
  // src/fabric/utils/validationProxy.ts
2079
2086
  var validationsMap = {
@@ -2092,7 +2099,8 @@ var validationsMap = {
2092
2099
  setPositions: validateSetPositions,
2093
2100
  lock: validateLock,
2094
2101
  unlock: validateUnlock,
2095
- setAudioFlags: validateSetAudioFlags
2102
+ setAudioFlags: validateSetAudioFlags,
2103
+ end: validateEnd
2096
2104
  };
2097
2105
  function createFabricRoomSessionValidateProxy(instance) {
2098
2106
  return new Proxy(instance, {
@@ -2461,6 +2469,14 @@ var FabricRoomSessionConnection = class _FabricRoomSessionConnection extends Bas
2461
2469
  });
2462
2470
  });
2463
2471
  }
2472
+ end(params) {
2473
+ return __async(this, null, function* () {
2474
+ return this.executeAction({
2475
+ method: "call.end",
2476
+ memberId: params == null ? void 0 : params.memberId
2477
+ });
2478
+ });
2479
+ }
2464
2480
  };
2465
2481
  var isFabricRoomSession = (room) => {
2466
2482
  return room instanceof FabricRoomSessionConnection;
@@ -2678,7 +2694,7 @@ var makeLayoutChangedHandler = (params) => {
2678
2694
  let myLayerEl = localVideoOverlay.domElement;
2679
2695
  currentOverlayIds.add(overlayId);
2680
2696
  if (!location) {
2681
- (0, import_core29.getLogger)().warn("Local video overlay location not found");
2697
+ (0, import_core29.getLogger)().warn("Local video overlay location not found", memberId);
2682
2698
  localVideoOverlay.status = "hidden";
2683
2699
  if (myLayerEl) {
2684
2700
  localVideoOverlay.hide();
@@ -2722,10 +2738,10 @@ var makeLayoutChangedHandler = (params) => {
2722
2738
  currentOverlayIds.add(overlayId);
2723
2739
  let overlay = overlayMap.get(overlayId);
2724
2740
  if (overlay && overlay.domElement) {
2725
- (0, import_core29.getLogger)().debug("Update an overlay for ", memberIdInLocation);
2741
+ (0, import_core29.getLogger)().debug("Update an overlay for", memberIdInLocation);
2726
2742
  _updateLayer({ location, element: overlay.domElement });
2727
2743
  } else {
2728
- (0, import_core29.getLogger)().debug("Build an overlay for ", memberIdInLocation);
2744
+ (0, import_core29.getLogger)().debug("Build an overlay for", memberIdInLocation);
2729
2745
  overlay = new UserOverlay({ id: overlayId });
2730
2746
  overlayMap.set(overlayId, overlay);
2731
2747
  const newLayer = _buildLayer({ location });
@@ -2867,13 +2883,19 @@ var buildVideoElement = (params) => __async(void 0, null, function* () {
2867
2883
  });
2868
2884
  const processLayoutChanged = (params2) => {
2869
2885
  var _a2;
2870
- if (((_a2 = room.peer) == null ? void 0 : _a2.hasVideoSender) && room.localStream) {
2886
+ const hasVideoSender = (_a2 = room.peer) == null ? void 0 : _a2.hasVideoSender;
2887
+ if (hasVideoSender && room.localStream) {
2871
2888
  makeLayout({
2872
2889
  layout: params2.layout,
2873
2890
  localStream: room.localStream,
2874
2891
  memberId: room.memberId
2875
2892
  });
2876
2893
  } else {
2894
+ (0, import_core30.getLogger)().debug(
2895
+ "No local video sender or local stream, hiding local video overlay",
2896
+ hasVideoSender,
2897
+ room.localStream
2898
+ );
2877
2899
  localVideoOverlay.hide();
2878
2900
  }
2879
2901
  };
@@ -3168,7 +3190,7 @@ var JWTSession = class extends import_core33.BaseJWTSession {
3168
3190
  this.options = options;
3169
3191
  __publicField(this, "WebSocketConstructor", WebSocket);
3170
3192
  __publicField(this, "CloseEventConstructor", SwCloseEvent);
3171
- __publicField(this, "agent", "@signalwire/js/browser/3.29.1");
3193
+ __publicField(this, "agent", "@signalwire/js/browser/3.29.2");
3172
3194
  __publicField(this, "tokenTyp");
3173
3195
  this.tokenTyp = (_a = decodedJwt.typ) != null ? _a : "VRT";
3174
3196
  }