livekit-client 1.6.6 → 1.6.8

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 (57) hide show
  1. package/dist/livekit-client.esm.mjs +508 -317
  2. package/dist/livekit-client.esm.mjs.map +1 -1
  3. package/dist/livekit-client.umd.js +1 -1
  4. package/dist/livekit-client.umd.js.map +1 -1
  5. package/dist/src/proto/google/protobuf/timestamp.d.ts +9 -2
  6. package/dist/src/proto/google/protobuf/timestamp.d.ts.map +1 -1
  7. package/dist/src/proto/livekit_models.d.ts +958 -58
  8. package/dist/src/proto/livekit_models.d.ts.map +1 -1
  9. package/dist/src/proto/livekit_rtc.d.ts +8394 -3725
  10. package/dist/src/proto/livekit_rtc.d.ts.map +1 -1
  11. package/dist/src/room/PCTransport.d.ts.map +1 -1
  12. package/dist/src/room/RTCEngine.d.ts +10 -3
  13. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  14. package/dist/src/room/Room.d.ts +1 -1
  15. package/dist/src/room/Room.d.ts.map +1 -1
  16. package/dist/src/room/events.d.ts +1 -1
  17. package/dist/src/room/participant/LocalParticipant.d.ts +18 -0
  18. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  19. package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
  20. package/dist/src/room/track/RemoteTrackPublication.d.ts +1 -1
  21. package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
  22. package/dist/src/room/track/RemoteVideoTrack.d.ts.map +1 -1
  23. package/dist/src/room/track/Track.d.ts +2 -1
  24. package/dist/src/room/track/Track.d.ts.map +1 -1
  25. package/dist/src/room/track/options.d.ts +10 -2
  26. package/dist/src/room/track/options.d.ts.map +1 -1
  27. package/dist/src/room/types.d.ts +7 -0
  28. package/dist/src/room/types.d.ts.map +1 -1
  29. package/dist/src/version.d.ts +1 -1
  30. package/dist/ts4.2/src/proto/google/protobuf/timestamp.d.ts +11 -2
  31. package/dist/ts4.2/src/proto/livekit_models.d.ts +1199 -177
  32. package/dist/ts4.2/src/proto/livekit_rtc.d.ts +9260 -4023
  33. package/dist/ts4.2/src/room/RTCEngine.d.ts +10 -3
  34. package/dist/ts4.2/src/room/Room.d.ts +1 -1
  35. package/dist/ts4.2/src/room/events.d.ts +1 -1
  36. package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +18 -0
  37. package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +1 -1
  38. package/dist/ts4.2/src/room/track/Track.d.ts +2 -1
  39. package/dist/ts4.2/src/room/track/options.d.ts +10 -2
  40. package/dist/ts4.2/src/room/types.d.ts +7 -0
  41. package/dist/ts4.2/src/version.d.ts +1 -1
  42. package/package.json +14 -14
  43. package/src/proto/google/protobuf/timestamp.ts +4 -0
  44. package/src/proto/livekit_models.ts +128 -31
  45. package/src/proto/livekit_rtc.ts +262 -161
  46. package/src/room/PCTransport.ts +2 -0
  47. package/src/room/RTCEngine.ts +50 -55
  48. package/src/room/Room.ts +60 -43
  49. package/src/room/events.ts +1 -1
  50. package/src/room/participant/LocalParticipant.ts +118 -28
  51. package/src/room/participant/RemoteParticipant.ts +2 -3
  52. package/src/room/track/RemoteTrackPublication.ts +3 -2
  53. package/src/room/track/RemoteVideoTrack.ts +0 -3
  54. package/src/room/track/Track.ts +2 -1
  55. package/src/room/track/options.ts +14 -2
  56. package/src/room/types.ts +9 -0
  57. package/src/version.ts +1 -1
@@ -243,9 +243,6 @@ export interface JoinResponse {
243
243
  export interface ReconnectResponse {
244
244
  iceServers: ICEServer[];
245
245
  clientConfiguration?: ClientConfiguration;
246
- room?: Room;
247
- participant?: ParticipantInfo;
248
- otherParticipants: ParticipantInfo[];
249
246
  }
250
247
 
251
248
  export interface TrackPublishedResponse {
@@ -427,50 +424,52 @@ function createBaseSignalRequest(): SignalRequest {
427
424
 
428
425
  export const SignalRequest = {
429
426
  encode(message: SignalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
430
- if (message.message?.$case === "offer") {
431
- SessionDescription.encode(message.message.offer, writer.uint32(10).fork()).ldelim();
432
- }
433
- if (message.message?.$case === "answer") {
434
- SessionDescription.encode(message.message.answer, writer.uint32(18).fork()).ldelim();
435
- }
436
- if (message.message?.$case === "trickle") {
437
- TrickleRequest.encode(message.message.trickle, writer.uint32(26).fork()).ldelim();
438
- }
439
- if (message.message?.$case === "addTrack") {
440
- AddTrackRequest.encode(message.message.addTrack, writer.uint32(34).fork()).ldelim();
441
- }
442
- if (message.message?.$case === "mute") {
443
- MuteTrackRequest.encode(message.message.mute, writer.uint32(42).fork()).ldelim();
444
- }
445
- if (message.message?.$case === "subscription") {
446
- UpdateSubscription.encode(message.message.subscription, writer.uint32(50).fork()).ldelim();
447
- }
448
- if (message.message?.$case === "trackSetting") {
449
- UpdateTrackSettings.encode(message.message.trackSetting, writer.uint32(58).fork()).ldelim();
450
- }
451
- if (message.message?.$case === "leave") {
452
- LeaveRequest.encode(message.message.leave, writer.uint32(66).fork()).ldelim();
453
- }
454
- if (message.message?.$case === "updateLayers") {
455
- UpdateVideoLayers.encode(message.message.updateLayers, writer.uint32(82).fork()).ldelim();
456
- }
457
- if (message.message?.$case === "subscriptionPermission") {
458
- SubscriptionPermission.encode(message.message.subscriptionPermission, writer.uint32(90).fork()).ldelim();
459
- }
460
- if (message.message?.$case === "syncState") {
461
- SyncState.encode(message.message.syncState, writer.uint32(98).fork()).ldelim();
462
- }
463
- if (message.message?.$case === "simulate") {
464
- SimulateScenario.encode(message.message.simulate, writer.uint32(106).fork()).ldelim();
465
- }
466
- if (message.message?.$case === "ping") {
467
- writer.uint32(112).int64(message.message.ping);
468
- }
469
- if (message.message?.$case === "updateMetadata") {
470
- UpdateParticipantMetadata.encode(message.message.updateMetadata, writer.uint32(122).fork()).ldelim();
471
- }
472
- if (message.message?.$case === "pingReq") {
473
- Ping.encode(message.message.pingReq, writer.uint32(130).fork()).ldelim();
427
+ switch (message.message?.$case) {
428
+ case "offer":
429
+ SessionDescription.encode(message.message.offer, writer.uint32(10).fork()).ldelim();
430
+ break;
431
+ case "answer":
432
+ SessionDescription.encode(message.message.answer, writer.uint32(18).fork()).ldelim();
433
+ break;
434
+ case "trickle":
435
+ TrickleRequest.encode(message.message.trickle, writer.uint32(26).fork()).ldelim();
436
+ break;
437
+ case "addTrack":
438
+ AddTrackRequest.encode(message.message.addTrack, writer.uint32(34).fork()).ldelim();
439
+ break;
440
+ case "mute":
441
+ MuteTrackRequest.encode(message.message.mute, writer.uint32(42).fork()).ldelim();
442
+ break;
443
+ case "subscription":
444
+ UpdateSubscription.encode(message.message.subscription, writer.uint32(50).fork()).ldelim();
445
+ break;
446
+ case "trackSetting":
447
+ UpdateTrackSettings.encode(message.message.trackSetting, writer.uint32(58).fork()).ldelim();
448
+ break;
449
+ case "leave":
450
+ LeaveRequest.encode(message.message.leave, writer.uint32(66).fork()).ldelim();
451
+ break;
452
+ case "updateLayers":
453
+ UpdateVideoLayers.encode(message.message.updateLayers, writer.uint32(82).fork()).ldelim();
454
+ break;
455
+ case "subscriptionPermission":
456
+ SubscriptionPermission.encode(message.message.subscriptionPermission, writer.uint32(90).fork()).ldelim();
457
+ break;
458
+ case "syncState":
459
+ SyncState.encode(message.message.syncState, writer.uint32(98).fork()).ldelim();
460
+ break;
461
+ case "simulate":
462
+ SimulateScenario.encode(message.message.simulate, writer.uint32(106).fork()).ldelim();
463
+ break;
464
+ case "ping":
465
+ writer.uint32(112).int64(message.message.ping);
466
+ break;
467
+ case "updateMetadata":
468
+ UpdateParticipantMetadata.encode(message.message.updateMetadata, writer.uint32(122).fork()).ldelim();
469
+ break;
470
+ case "pingReq":
471
+ Ping.encode(message.message.pingReq, writer.uint32(130).fork()).ldelim();
472
+ break;
474
473
  }
475
474
  return writer;
476
475
  },
@@ -623,6 +622,10 @@ export const SignalRequest = {
623
622
  return obj;
624
623
  },
625
624
 
625
+ create<I extends Exact<DeepPartial<SignalRequest>, I>>(base?: I): SignalRequest {
626
+ return SignalRequest.fromPartial(base ?? {});
627
+ },
628
+
626
629
  fromPartial<I extends Exact<DeepPartial<SignalRequest>, I>>(object: I): SignalRequest {
627
630
  const message = createBaseSignalRequest();
628
631
  if (object.message?.$case === "offer" && object.message?.offer !== undefined && object.message?.offer !== null) {
@@ -731,63 +734,65 @@ function createBaseSignalResponse(): SignalResponse {
731
734
 
732
735
  export const SignalResponse = {
733
736
  encode(message: SignalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
734
- if (message.message?.$case === "join") {
735
- JoinResponse.encode(message.message.join, writer.uint32(10).fork()).ldelim();
736
- }
737
- if (message.message?.$case === "answer") {
738
- SessionDescription.encode(message.message.answer, writer.uint32(18).fork()).ldelim();
739
- }
740
- if (message.message?.$case === "offer") {
741
- SessionDescription.encode(message.message.offer, writer.uint32(26).fork()).ldelim();
742
- }
743
- if (message.message?.$case === "trickle") {
744
- TrickleRequest.encode(message.message.trickle, writer.uint32(34).fork()).ldelim();
745
- }
746
- if (message.message?.$case === "update") {
747
- ParticipantUpdate.encode(message.message.update, writer.uint32(42).fork()).ldelim();
748
- }
749
- if (message.message?.$case === "trackPublished") {
750
- TrackPublishedResponse.encode(message.message.trackPublished, writer.uint32(50).fork()).ldelim();
751
- }
752
- if (message.message?.$case === "leave") {
753
- LeaveRequest.encode(message.message.leave, writer.uint32(66).fork()).ldelim();
754
- }
755
- if (message.message?.$case === "mute") {
756
- MuteTrackRequest.encode(message.message.mute, writer.uint32(74).fork()).ldelim();
757
- }
758
- if (message.message?.$case === "speakersChanged") {
759
- SpeakersChanged.encode(message.message.speakersChanged, writer.uint32(82).fork()).ldelim();
760
- }
761
- if (message.message?.$case === "roomUpdate") {
762
- RoomUpdate.encode(message.message.roomUpdate, writer.uint32(90).fork()).ldelim();
763
- }
764
- if (message.message?.$case === "connectionQuality") {
765
- ConnectionQualityUpdate.encode(message.message.connectionQuality, writer.uint32(98).fork()).ldelim();
766
- }
767
- if (message.message?.$case === "streamStateUpdate") {
768
- StreamStateUpdate.encode(message.message.streamStateUpdate, writer.uint32(106).fork()).ldelim();
769
- }
770
- if (message.message?.$case === "subscribedQualityUpdate") {
771
- SubscribedQualityUpdate.encode(message.message.subscribedQualityUpdate, writer.uint32(114).fork()).ldelim();
772
- }
773
- if (message.message?.$case === "subscriptionPermissionUpdate") {
774
- SubscriptionPermissionUpdate.encode(message.message.subscriptionPermissionUpdate, writer.uint32(122).fork())
775
- .ldelim();
776
- }
777
- if (message.message?.$case === "refreshToken") {
778
- writer.uint32(130).string(message.message.refreshToken);
779
- }
780
- if (message.message?.$case === "trackUnpublished") {
781
- TrackUnpublishedResponse.encode(message.message.trackUnpublished, writer.uint32(138).fork()).ldelim();
782
- }
783
- if (message.message?.$case === "pong") {
784
- writer.uint32(144).int64(message.message.pong);
785
- }
786
- if (message.message?.$case === "reconnect") {
787
- ReconnectResponse.encode(message.message.reconnect, writer.uint32(154).fork()).ldelim();
788
- }
789
- if (message.message?.$case === "pongResp") {
790
- Pong.encode(message.message.pongResp, writer.uint32(162).fork()).ldelim();
737
+ switch (message.message?.$case) {
738
+ case "join":
739
+ JoinResponse.encode(message.message.join, writer.uint32(10).fork()).ldelim();
740
+ break;
741
+ case "answer":
742
+ SessionDescription.encode(message.message.answer, writer.uint32(18).fork()).ldelim();
743
+ break;
744
+ case "offer":
745
+ SessionDescription.encode(message.message.offer, writer.uint32(26).fork()).ldelim();
746
+ break;
747
+ case "trickle":
748
+ TrickleRequest.encode(message.message.trickle, writer.uint32(34).fork()).ldelim();
749
+ break;
750
+ case "update":
751
+ ParticipantUpdate.encode(message.message.update, writer.uint32(42).fork()).ldelim();
752
+ break;
753
+ case "trackPublished":
754
+ TrackPublishedResponse.encode(message.message.trackPublished, writer.uint32(50).fork()).ldelim();
755
+ break;
756
+ case "leave":
757
+ LeaveRequest.encode(message.message.leave, writer.uint32(66).fork()).ldelim();
758
+ break;
759
+ case "mute":
760
+ MuteTrackRequest.encode(message.message.mute, writer.uint32(74).fork()).ldelim();
761
+ break;
762
+ case "speakersChanged":
763
+ SpeakersChanged.encode(message.message.speakersChanged, writer.uint32(82).fork()).ldelim();
764
+ break;
765
+ case "roomUpdate":
766
+ RoomUpdate.encode(message.message.roomUpdate, writer.uint32(90).fork()).ldelim();
767
+ break;
768
+ case "connectionQuality":
769
+ ConnectionQualityUpdate.encode(message.message.connectionQuality, writer.uint32(98).fork()).ldelim();
770
+ break;
771
+ case "streamStateUpdate":
772
+ StreamStateUpdate.encode(message.message.streamStateUpdate, writer.uint32(106).fork()).ldelim();
773
+ break;
774
+ case "subscribedQualityUpdate":
775
+ SubscribedQualityUpdate.encode(message.message.subscribedQualityUpdate, writer.uint32(114).fork()).ldelim();
776
+ break;
777
+ case "subscriptionPermissionUpdate":
778
+ SubscriptionPermissionUpdate.encode(message.message.subscriptionPermissionUpdate, writer.uint32(122).fork())
779
+ .ldelim();
780
+ break;
781
+ case "refreshToken":
782
+ writer.uint32(130).string(message.message.refreshToken);
783
+ break;
784
+ case "trackUnpublished":
785
+ TrackUnpublishedResponse.encode(message.message.trackUnpublished, writer.uint32(138).fork()).ldelim();
786
+ break;
787
+ case "pong":
788
+ writer.uint32(144).int64(message.message.pong);
789
+ break;
790
+ case "reconnect":
791
+ ReconnectResponse.encode(message.message.reconnect, writer.uint32(154).fork()).ldelim();
792
+ break;
793
+ case "pongResp":
794
+ Pong.encode(message.message.pongResp, writer.uint32(162).fork()).ldelim();
795
+ break;
791
796
  }
792
797
  return writer;
793
798
  },
@@ -985,6 +990,10 @@ export const SignalResponse = {
985
990
  return obj;
986
991
  },
987
992
 
993
+ create<I extends Exact<DeepPartial<SignalResponse>, I>>(base?: I): SignalResponse {
994
+ return SignalResponse.fromPartial(base ?? {});
995
+ },
996
+
988
997
  fromPartial<I extends Exact<DeepPartial<SignalResponse>, I>>(object: I): SignalResponse {
989
998
  const message = createBaseSignalResponse();
990
999
  if (object.message?.$case === "join" && object.message?.join !== undefined && object.message?.join !== null) {
@@ -1175,6 +1184,10 @@ export const SimulcastCodec = {
1175
1184
  return obj;
1176
1185
  },
1177
1186
 
1187
+ create<I extends Exact<DeepPartial<SimulcastCodec>, I>>(base?: I): SimulcastCodec {
1188
+ return SimulcastCodec.fromPartial(base ?? {});
1189
+ },
1190
+
1178
1191
  fromPartial<I extends Exact<DeepPartial<SimulcastCodec>, I>>(object: I): SimulcastCodec {
1179
1192
  const message = createBaseSimulcastCodec();
1180
1193
  message.codec = object.codec ?? "";
@@ -1355,6 +1368,10 @@ export const AddTrackRequest = {
1355
1368
  return obj;
1356
1369
  },
1357
1370
 
1371
+ create<I extends Exact<DeepPartial<AddTrackRequest>, I>>(base?: I): AddTrackRequest {
1372
+ return AddTrackRequest.fromPartial(base ?? {});
1373
+ },
1374
+
1358
1375
  fromPartial<I extends Exact<DeepPartial<AddTrackRequest>, I>>(object: I): AddTrackRequest {
1359
1376
  const message = createBaseAddTrackRequest();
1360
1377
  message.cid = object.cid ?? "";
@@ -1425,6 +1442,10 @@ export const TrickleRequest = {
1425
1442
  return obj;
1426
1443
  },
1427
1444
 
1445
+ create<I extends Exact<DeepPartial<TrickleRequest>, I>>(base?: I): TrickleRequest {
1446
+ return TrickleRequest.fromPartial(base ?? {});
1447
+ },
1448
+
1428
1449
  fromPartial<I extends Exact<DeepPartial<TrickleRequest>, I>>(object: I): TrickleRequest {
1429
1450
  const message = createBaseTrickleRequest();
1430
1451
  message.candidateInit = object.candidateInit ?? "";
@@ -1483,6 +1504,10 @@ export const MuteTrackRequest = {
1483
1504
  return obj;
1484
1505
  },
1485
1506
 
1507
+ create<I extends Exact<DeepPartial<MuteTrackRequest>, I>>(base?: I): MuteTrackRequest {
1508
+ return MuteTrackRequest.fromPartial(base ?? {});
1509
+ },
1510
+
1486
1511
  fromPartial<I extends Exact<DeepPartial<MuteTrackRequest>, I>>(object: I): MuteTrackRequest {
1487
1512
  const message = createBaseMuteTrackRequest();
1488
1513
  message.sid = object.sid ?? "";
@@ -1650,6 +1675,10 @@ export const JoinResponse = {
1650
1675
  return obj;
1651
1676
  },
1652
1677
 
1678
+ create<I extends Exact<DeepPartial<JoinResponse>, I>>(base?: I): JoinResponse {
1679
+ return JoinResponse.fromPartial(base ?? {});
1680
+ },
1681
+
1653
1682
  fromPartial<I extends Exact<DeepPartial<JoinResponse>, I>>(object: I): JoinResponse {
1654
1683
  const message = createBaseJoinResponse();
1655
1684
  message.room = (object.room !== undefined && object.room !== null) ? Room.fromPartial(object.room) : undefined;
@@ -1675,13 +1704,7 @@ export const JoinResponse = {
1675
1704
  };
1676
1705
 
1677
1706
  function createBaseReconnectResponse(): ReconnectResponse {
1678
- return {
1679
- iceServers: [],
1680
- clientConfiguration: undefined,
1681
- room: undefined,
1682
- participant: undefined,
1683
- otherParticipants: [],
1684
- };
1707
+ return { iceServers: [], clientConfiguration: undefined };
1685
1708
  }
1686
1709
 
1687
1710
  export const ReconnectResponse = {
@@ -1692,15 +1715,6 @@ export const ReconnectResponse = {
1692
1715
  if (message.clientConfiguration !== undefined) {
1693
1716
  ClientConfiguration.encode(message.clientConfiguration, writer.uint32(18).fork()).ldelim();
1694
1717
  }
1695
- if (message.room !== undefined) {
1696
- Room.encode(message.room, writer.uint32(26).fork()).ldelim();
1697
- }
1698
- if (message.participant !== undefined) {
1699
- ParticipantInfo.encode(message.participant, writer.uint32(34).fork()).ldelim();
1700
- }
1701
- for (const v of message.otherParticipants) {
1702
- ParticipantInfo.encode(v!, writer.uint32(42).fork()).ldelim();
1703
- }
1704
1718
  return writer;
1705
1719
  },
1706
1720
 
@@ -1717,15 +1731,6 @@ export const ReconnectResponse = {
1717
1731
  case 2:
1718
1732
  message.clientConfiguration = ClientConfiguration.decode(reader, reader.uint32());
1719
1733
  break;
1720
- case 3:
1721
- message.room = Room.decode(reader, reader.uint32());
1722
- break;
1723
- case 4:
1724
- message.participant = ParticipantInfo.decode(reader, reader.uint32());
1725
- break;
1726
- case 5:
1727
- message.otherParticipants.push(ParticipantInfo.decode(reader, reader.uint32()));
1728
- break;
1729
1734
  default:
1730
1735
  reader.skipType(tag & 7);
1731
1736
  break;
@@ -1740,11 +1745,6 @@ export const ReconnectResponse = {
1740
1745
  clientConfiguration: isSet(object.clientConfiguration)
1741
1746
  ? ClientConfiguration.fromJSON(object.clientConfiguration)
1742
1747
  : undefined,
1743
- room: isSet(object.room) ? Room.fromJSON(object.room) : undefined,
1744
- participant: isSet(object.participant) ? ParticipantInfo.fromJSON(object.participant) : undefined,
1745
- otherParticipants: Array.isArray(object?.otherParticipants)
1746
- ? object.otherParticipants.map((e: any) => ParticipantInfo.fromJSON(e))
1747
- : [],
1748
1748
  };
1749
1749
  },
1750
1750
 
@@ -1758,28 +1758,19 @@ export const ReconnectResponse = {
1758
1758
  message.clientConfiguration !== undefined && (obj.clientConfiguration = message.clientConfiguration
1759
1759
  ? ClientConfiguration.toJSON(message.clientConfiguration)
1760
1760
  : undefined);
1761
- message.room !== undefined && (obj.room = message.room ? Room.toJSON(message.room) : undefined);
1762
- message.participant !== undefined &&
1763
- (obj.participant = message.participant ? ParticipantInfo.toJSON(message.participant) : undefined);
1764
- if (message.otherParticipants) {
1765
- obj.otherParticipants = message.otherParticipants.map((e) => e ? ParticipantInfo.toJSON(e) : undefined);
1766
- } else {
1767
- obj.otherParticipants = [];
1768
- }
1769
1761
  return obj;
1770
1762
  },
1771
1763
 
1764
+ create<I extends Exact<DeepPartial<ReconnectResponse>, I>>(base?: I): ReconnectResponse {
1765
+ return ReconnectResponse.fromPartial(base ?? {});
1766
+ },
1767
+
1772
1768
  fromPartial<I extends Exact<DeepPartial<ReconnectResponse>, I>>(object: I): ReconnectResponse {
1773
1769
  const message = createBaseReconnectResponse();
1774
1770
  message.iceServers = object.iceServers?.map((e) => ICEServer.fromPartial(e)) || [];
1775
1771
  message.clientConfiguration = (object.clientConfiguration !== undefined && object.clientConfiguration !== null)
1776
1772
  ? ClientConfiguration.fromPartial(object.clientConfiguration)
1777
1773
  : undefined;
1778
- message.room = (object.room !== undefined && object.room !== null) ? Room.fromPartial(object.room) : undefined;
1779
- message.participant = (object.participant !== undefined && object.participant !== null)
1780
- ? ParticipantInfo.fromPartial(object.participant)
1781
- : undefined;
1782
- message.otherParticipants = object.otherParticipants?.map((e) => ParticipantInfo.fromPartial(e)) || [];
1783
1774
  return message;
1784
1775
  },
1785
1776
  };
@@ -1834,6 +1825,10 @@ export const TrackPublishedResponse = {
1834
1825
  return obj;
1835
1826
  },
1836
1827
 
1828
+ create<I extends Exact<DeepPartial<TrackPublishedResponse>, I>>(base?: I): TrackPublishedResponse {
1829
+ return TrackPublishedResponse.fromPartial(base ?? {});
1830
+ },
1831
+
1837
1832
  fromPartial<I extends Exact<DeepPartial<TrackPublishedResponse>, I>>(object: I): TrackPublishedResponse {
1838
1833
  const message = createBaseTrackPublishedResponse();
1839
1834
  message.cid = object.cid ?? "";
@@ -1884,6 +1879,10 @@ export const TrackUnpublishedResponse = {
1884
1879
  return obj;
1885
1880
  },
1886
1881
 
1882
+ create<I extends Exact<DeepPartial<TrackUnpublishedResponse>, I>>(base?: I): TrackUnpublishedResponse {
1883
+ return TrackUnpublishedResponse.fromPartial(base ?? {});
1884
+ },
1885
+
1887
1886
  fromPartial<I extends Exact<DeepPartial<TrackUnpublishedResponse>, I>>(object: I): TrackUnpublishedResponse {
1888
1887
  const message = createBaseTrackUnpublishedResponse();
1889
1888
  message.trackSid = object.trackSid ?? "";
@@ -1938,6 +1937,10 @@ export const SessionDescription = {
1938
1937
  return obj;
1939
1938
  },
1940
1939
 
1940
+ create<I extends Exact<DeepPartial<SessionDescription>, I>>(base?: I): SessionDescription {
1941
+ return SessionDescription.fromPartial(base ?? {});
1942
+ },
1943
+
1941
1944
  fromPartial<I extends Exact<DeepPartial<SessionDescription>, I>>(object: I): SessionDescription {
1942
1945
  const message = createBaseSessionDescription();
1943
1946
  message.type = object.type ?? "";
@@ -1994,6 +1997,10 @@ export const ParticipantUpdate = {
1994
1997
  return obj;
1995
1998
  },
1996
1999
 
2000
+ create<I extends Exact<DeepPartial<ParticipantUpdate>, I>>(base?: I): ParticipantUpdate {
2001
+ return ParticipantUpdate.fromPartial(base ?? {});
2002
+ },
2003
+
1997
2004
  fromPartial<I extends Exact<DeepPartial<ParticipantUpdate>, I>>(object: I): ParticipantUpdate {
1998
2005
  const message = createBaseParticipantUpdate();
1999
2006
  message.participants = object.participants?.map((e) => ParticipantInfo.fromPartial(e)) || [];
@@ -2069,6 +2076,10 @@ export const UpdateSubscription = {
2069
2076
  return obj;
2070
2077
  },
2071
2078
 
2079
+ create<I extends Exact<DeepPartial<UpdateSubscription>, I>>(base?: I): UpdateSubscription {
2080
+ return UpdateSubscription.fromPartial(base ?? {});
2081
+ },
2082
+
2072
2083
  fromPartial<I extends Exact<DeepPartial<UpdateSubscription>, I>>(object: I): UpdateSubscription {
2073
2084
  const message = createBaseUpdateSubscription();
2074
2085
  message.trackSids = object.trackSids?.map((e) => e) || [];
@@ -2172,6 +2183,10 @@ export const UpdateTrackSettings = {
2172
2183
  return obj;
2173
2184
  },
2174
2185
 
2186
+ create<I extends Exact<DeepPartial<UpdateTrackSettings>, I>>(base?: I): UpdateTrackSettings {
2187
+ return UpdateTrackSettings.fromPartial(base ?? {});
2188
+ },
2189
+
2175
2190
  fromPartial<I extends Exact<DeepPartial<UpdateTrackSettings>, I>>(object: I): UpdateTrackSettings {
2176
2191
  const message = createBaseUpdateTrackSettings();
2177
2192
  message.trackSids = object.trackSids?.map((e) => e) || [];
@@ -2235,6 +2250,10 @@ export const LeaveRequest = {
2235
2250
  return obj;
2236
2251
  },
2237
2252
 
2253
+ create<I extends Exact<DeepPartial<LeaveRequest>, I>>(base?: I): LeaveRequest {
2254
+ return LeaveRequest.fromPartial(base ?? {});
2255
+ },
2256
+
2238
2257
  fromPartial<I extends Exact<DeepPartial<LeaveRequest>, I>>(object: I): LeaveRequest {
2239
2258
  const message = createBaseLeaveRequest();
2240
2259
  message.canReconnect = object.canReconnect ?? false;
@@ -2297,6 +2316,10 @@ export const UpdateVideoLayers = {
2297
2316
  return obj;
2298
2317
  },
2299
2318
 
2319
+ create<I extends Exact<DeepPartial<UpdateVideoLayers>, I>>(base?: I): UpdateVideoLayers {
2320
+ return UpdateVideoLayers.fromPartial(base ?? {});
2321
+ },
2322
+
2300
2323
  fromPartial<I extends Exact<DeepPartial<UpdateVideoLayers>, I>>(object: I): UpdateVideoLayers {
2301
2324
  const message = createBaseUpdateVideoLayers();
2302
2325
  message.trackSid = object.trackSid ?? "";
@@ -2345,6 +2368,10 @@ export const UpdateParticipantMetadata = {
2345
2368
  return obj;
2346
2369
  },
2347
2370
 
2371
+ create<I extends Exact<DeepPartial<UpdateParticipantMetadata>, I>>(base?: I): UpdateParticipantMetadata {
2372
+ return UpdateParticipantMetadata.fromPartial(base ?? {});
2373
+ },
2374
+
2348
2375
  fromPartial<I extends Exact<DeepPartial<UpdateParticipantMetadata>, I>>(object: I): UpdateParticipantMetadata {
2349
2376
  const message = createBaseUpdateParticipantMetadata();
2350
2377
  message.metadata = object.metadata ?? "";
@@ -2414,6 +2441,10 @@ export const ICEServer = {
2414
2441
  return obj;
2415
2442
  },
2416
2443
 
2444
+ create<I extends Exact<DeepPartial<ICEServer>, I>>(base?: I): ICEServer {
2445
+ return ICEServer.fromPartial(base ?? {});
2446
+ },
2447
+
2417
2448
  fromPartial<I extends Exact<DeepPartial<ICEServer>, I>>(object: I): ICEServer {
2418
2449
  const message = createBaseICEServer();
2419
2450
  message.urls = object.urls?.map((e) => e) || [];
@@ -2469,6 +2500,10 @@ export const SpeakersChanged = {
2469
2500
  return obj;
2470
2501
  },
2471
2502
 
2503
+ create<I extends Exact<DeepPartial<SpeakersChanged>, I>>(base?: I): SpeakersChanged {
2504
+ return SpeakersChanged.fromPartial(base ?? {});
2505
+ },
2506
+
2472
2507
  fromPartial<I extends Exact<DeepPartial<SpeakersChanged>, I>>(object: I): SpeakersChanged {
2473
2508
  const message = createBaseSpeakersChanged();
2474
2509
  message.speakers = object.speakers?.map((e) => SpeakerInfo.fromPartial(e)) || [];
@@ -2516,6 +2551,10 @@ export const RoomUpdate = {
2516
2551
  return obj;
2517
2552
  },
2518
2553
 
2554
+ create<I extends Exact<DeepPartial<RoomUpdate>, I>>(base?: I): RoomUpdate {
2555
+ return RoomUpdate.fromPartial(base ?? {});
2556
+ },
2557
+
2519
2558
  fromPartial<I extends Exact<DeepPartial<RoomUpdate>, I>>(object: I): RoomUpdate {
2520
2559
  const message = createBaseRoomUpdate();
2521
2560
  message.room = (object.room !== undefined && object.room !== null) ? Room.fromPartial(object.room) : undefined;
@@ -2581,6 +2620,10 @@ export const ConnectionQualityInfo = {
2581
2620
  return obj;
2582
2621
  },
2583
2622
 
2623
+ create<I extends Exact<DeepPartial<ConnectionQualityInfo>, I>>(base?: I): ConnectionQualityInfo {
2624
+ return ConnectionQualityInfo.fromPartial(base ?? {});
2625
+ },
2626
+
2584
2627
  fromPartial<I extends Exact<DeepPartial<ConnectionQualityInfo>, I>>(object: I): ConnectionQualityInfo {
2585
2628
  const message = createBaseConnectionQualityInfo();
2586
2629
  message.participantSid = object.participantSid ?? "";
@@ -2636,6 +2679,10 @@ export const ConnectionQualityUpdate = {
2636
2679
  return obj;
2637
2680
  },
2638
2681
 
2682
+ create<I extends Exact<DeepPartial<ConnectionQualityUpdate>, I>>(base?: I): ConnectionQualityUpdate {
2683
+ return ConnectionQualityUpdate.fromPartial(base ?? {});
2684
+ },
2685
+
2639
2686
  fromPartial<I extends Exact<DeepPartial<ConnectionQualityUpdate>, I>>(object: I): ConnectionQualityUpdate {
2640
2687
  const message = createBaseConnectionQualityUpdate();
2641
2688
  message.updates = object.updates?.map((e) => ConnectionQualityInfo.fromPartial(e)) || [];
@@ -2701,6 +2748,10 @@ export const StreamStateInfo = {
2701
2748
  return obj;
2702
2749
  },
2703
2750
 
2751
+ create<I extends Exact<DeepPartial<StreamStateInfo>, I>>(base?: I): StreamStateInfo {
2752
+ return StreamStateInfo.fromPartial(base ?? {});
2753
+ },
2754
+
2704
2755
  fromPartial<I extends Exact<DeepPartial<StreamStateInfo>, I>>(object: I): StreamStateInfo {
2705
2756
  const message = createBaseStreamStateInfo();
2706
2757
  message.participantSid = object.participantSid ?? "";
@@ -2758,6 +2809,10 @@ export const StreamStateUpdate = {
2758
2809
  return obj;
2759
2810
  },
2760
2811
 
2812
+ create<I extends Exact<DeepPartial<StreamStateUpdate>, I>>(base?: I): StreamStateUpdate {
2813
+ return StreamStateUpdate.fromPartial(base ?? {});
2814
+ },
2815
+
2761
2816
  fromPartial<I extends Exact<DeepPartial<StreamStateUpdate>, I>>(object: I): StreamStateUpdate {
2762
2817
  const message = createBaseStreamStateUpdate();
2763
2818
  message.streamStates = object.streamStates?.map((e) => StreamStateInfo.fromPartial(e)) || [];
@@ -2815,6 +2870,10 @@ export const SubscribedQuality = {
2815
2870
  return obj;
2816
2871
  },
2817
2872
 
2873
+ create<I extends Exact<DeepPartial<SubscribedQuality>, I>>(base?: I): SubscribedQuality {
2874
+ return SubscribedQuality.fromPartial(base ?? {});
2875
+ },
2876
+
2818
2877
  fromPartial<I extends Exact<DeepPartial<SubscribedQuality>, I>>(object: I): SubscribedQuality {
2819
2878
  const message = createBaseSubscribedQuality();
2820
2879
  message.quality = object.quality ?? 0;
@@ -2879,6 +2938,10 @@ export const SubscribedCodec = {
2879
2938
  return obj;
2880
2939
  },
2881
2940
 
2941
+ create<I extends Exact<DeepPartial<SubscribedCodec>, I>>(base?: I): SubscribedCodec {
2942
+ return SubscribedCodec.fromPartial(base ?? {});
2943
+ },
2944
+
2882
2945
  fromPartial<I extends Exact<DeepPartial<SubscribedCodec>, I>>(object: I): SubscribedCodec {
2883
2946
  const message = createBaseSubscribedCodec();
2884
2947
  message.codec = object.codec ?? "";
@@ -2957,6 +3020,10 @@ export const SubscribedQualityUpdate = {
2957
3020
  return obj;
2958
3021
  },
2959
3022
 
3023
+ create<I extends Exact<DeepPartial<SubscribedQualityUpdate>, I>>(base?: I): SubscribedQualityUpdate {
3024
+ return SubscribedQualityUpdate.fromPartial(base ?? {});
3025
+ },
3026
+
2960
3027
  fromPartial<I extends Exact<DeepPartial<SubscribedQualityUpdate>, I>>(object: I): SubscribedQualityUpdate {
2961
3028
  const message = createBaseSubscribedQualityUpdate();
2962
3029
  message.trackSid = object.trackSid ?? "";
@@ -3036,6 +3103,10 @@ export const TrackPermission = {
3036
3103
  return obj;
3037
3104
  },
3038
3105
 
3106
+ create<I extends Exact<DeepPartial<TrackPermission>, I>>(base?: I): TrackPermission {
3107
+ return TrackPermission.fromPartial(base ?? {});
3108
+ },
3109
+
3039
3110
  fromPartial<I extends Exact<DeepPartial<TrackPermission>, I>>(object: I): TrackPermission {
3040
3111
  const message = createBaseTrackPermission();
3041
3112
  message.participantSid = object.participantSid ?? "";
@@ -3102,6 +3173,10 @@ export const SubscriptionPermission = {
3102
3173
  return obj;
3103
3174
  },
3104
3175
 
3176
+ create<I extends Exact<DeepPartial<SubscriptionPermission>, I>>(base?: I): SubscriptionPermission {
3177
+ return SubscriptionPermission.fromPartial(base ?? {});
3178
+ },
3179
+
3105
3180
  fromPartial<I extends Exact<DeepPartial<SubscriptionPermission>, I>>(object: I): SubscriptionPermission {
3106
3181
  const message = createBaseSubscriptionPermission();
3107
3182
  message.allParticipants = object.allParticipants ?? false;
@@ -3168,6 +3243,10 @@ export const SubscriptionPermissionUpdate = {
3168
3243
  return obj;
3169
3244
  },
3170
3245
 
3246
+ create<I extends Exact<DeepPartial<SubscriptionPermissionUpdate>, I>>(base?: I): SubscriptionPermissionUpdate {
3247
+ return SubscriptionPermissionUpdate.fromPartial(base ?? {});
3248
+ },
3249
+
3171
3250
  fromPartial<I extends Exact<DeepPartial<SubscriptionPermissionUpdate>, I>>(object: I): SubscriptionPermissionUpdate {
3172
3251
  const message = createBaseSubscriptionPermissionUpdate();
3173
3252
  message.participantSid = object.participantSid ?? "";
@@ -3265,6 +3344,10 @@ export const SyncState = {
3265
3344
  return obj;
3266
3345
  },
3267
3346
 
3347
+ create<I extends Exact<DeepPartial<SyncState>, I>>(base?: I): SyncState {
3348
+ return SyncState.fromPartial(base ?? {});
3349
+ },
3350
+
3268
3351
  fromPartial<I extends Exact<DeepPartial<SyncState>, I>>(object: I): SyncState {
3269
3352
  const message = createBaseSyncState();
3270
3353
  message.answer = (object.answer !== undefined && object.answer !== null)
@@ -3340,6 +3423,10 @@ export const DataChannelInfo = {
3340
3423
  return obj;
3341
3424
  },
3342
3425
 
3426
+ create<I extends Exact<DeepPartial<DataChannelInfo>, I>>(base?: I): DataChannelInfo {
3427
+ return DataChannelInfo.fromPartial(base ?? {});
3428
+ },
3429
+
3343
3430
  fromPartial<I extends Exact<DeepPartial<DataChannelInfo>, I>>(object: I): DataChannelInfo {
3344
3431
  const message = createBaseDataChannelInfo();
3345
3432
  message.label = object.label ?? "";
@@ -3355,20 +3442,22 @@ function createBaseSimulateScenario(): SimulateScenario {
3355
3442
 
3356
3443
  export const SimulateScenario = {
3357
3444
  encode(message: SimulateScenario, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3358
- if (message.scenario?.$case === "speakerUpdate") {
3359
- writer.uint32(8).int32(message.scenario.speakerUpdate);
3360
- }
3361
- if (message.scenario?.$case === "nodeFailure") {
3362
- writer.uint32(16).bool(message.scenario.nodeFailure);
3363
- }
3364
- if (message.scenario?.$case === "migration") {
3365
- writer.uint32(24).bool(message.scenario.migration);
3366
- }
3367
- if (message.scenario?.$case === "serverLeave") {
3368
- writer.uint32(32).bool(message.scenario.serverLeave);
3369
- }
3370
- if (message.scenario?.$case === "switchCandidateProtocol") {
3371
- writer.uint32(40).int32(message.scenario.switchCandidateProtocol);
3445
+ switch (message.scenario?.$case) {
3446
+ case "speakerUpdate":
3447
+ writer.uint32(8).int32(message.scenario.speakerUpdate);
3448
+ break;
3449
+ case "nodeFailure":
3450
+ writer.uint32(16).bool(message.scenario.nodeFailure);
3451
+ break;
3452
+ case "migration":
3453
+ writer.uint32(24).bool(message.scenario.migration);
3454
+ break;
3455
+ case "serverLeave":
3456
+ writer.uint32(32).bool(message.scenario.serverLeave);
3457
+ break;
3458
+ case "switchCandidateProtocol":
3459
+ writer.uint32(40).int32(message.scenario.switchCandidateProtocol);
3460
+ break;
3372
3461
  }
3373
3462
  return writer;
3374
3463
  },
@@ -3435,6 +3524,10 @@ export const SimulateScenario = {
3435
3524
  return obj;
3436
3525
  },
3437
3526
 
3527
+ create<I extends Exact<DeepPartial<SimulateScenario>, I>>(base?: I): SimulateScenario {
3528
+ return SimulateScenario.fromPartial(base ?? {});
3529
+ },
3530
+
3438
3531
  fromPartial<I extends Exact<DeepPartial<SimulateScenario>, I>>(object: I): SimulateScenario {
3439
3532
  const message = createBaseSimulateScenario();
3440
3533
  if (
@@ -3529,6 +3622,10 @@ export const Ping = {
3529
3622
  return obj;
3530
3623
  },
3531
3624
 
3625
+ create<I extends Exact<DeepPartial<Ping>, I>>(base?: I): Ping {
3626
+ return Ping.fromPartial(base ?? {});
3627
+ },
3628
+
3532
3629
  fromPartial<I extends Exact<DeepPartial<Ping>, I>>(object: I): Ping {
3533
3630
  const message = createBasePing();
3534
3631
  message.timestamp = object.timestamp ?? 0;
@@ -3587,6 +3684,10 @@ export const Pong = {
3587
3684
  return obj;
3588
3685
  },
3589
3686
 
3687
+ create<I extends Exact<DeepPartial<Pong>, I>>(base?: I): Pong {
3688
+ return Pong.fromPartial(base ?? {});
3689
+ },
3690
+
3590
3691
  fromPartial<I extends Exact<DeepPartial<Pong>, I>>(object: I): Pong {
3591
3692
  const message = createBasePong();
3592
3693
  message.lastPingTimestamp = object.lastPingTimestamp ?? 0;