livekit-client 0.17.2 → 0.17.5

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 (41) hide show
  1. package/dist/api/SignalClient.d.ts +2 -1
  2. package/dist/api/SignalClient.js +6 -1
  3. package/dist/api/SignalClient.js.map +1 -1
  4. package/dist/proto/google/protobuf/timestamp.d.ts +132 -0
  5. package/dist/proto/google/protobuf/timestamp.js +108 -0
  6. package/dist/proto/google/protobuf/timestamp.js.map +1 -0
  7. package/dist/proto/livekit_models.d.ts +596 -16
  8. package/dist/proto/livekit_models.js +1012 -642
  9. package/dist/proto/livekit_models.js.map +1 -1
  10. package/dist/proto/livekit_rtc.d.ts +3416 -29
  11. package/dist/proto/livekit_rtc.js +830 -1210
  12. package/dist/proto/livekit_rtc.js.map +1 -1
  13. package/dist/room/Room.d.ts +2 -1
  14. package/dist/room/Room.js +16 -1
  15. package/dist/room/Room.js.map +1 -1
  16. package/dist/room/events.d.ts +12 -2
  17. package/dist/room/events.js +10 -0
  18. package/dist/room/events.js.map +1 -1
  19. package/dist/room/participant/LocalParticipant.d.ts +4 -1
  20. package/dist/room/participant/LocalParticipant.js +18 -0
  21. package/dist/room/participant/LocalParticipant.js.map +1 -1
  22. package/dist/room/participant/Participant.d.ts +5 -1
  23. package/dist/room/participant/Participant.js +15 -1
  24. package/dist/room/participant/Participant.js.map +1 -1
  25. package/dist/room/track/Track.js +10 -3
  26. package/dist/room/track/Track.js.map +1 -1
  27. package/dist/room/track/options.d.ts +1 -1
  28. package/dist/version.d.ts +2 -2
  29. package/dist/version.js +2 -2
  30. package/package.json +2 -2
  31. package/src/api/SignalClient.ts +8 -1
  32. package/src/proto/google/protobuf/timestamp.ts +232 -0
  33. package/src/proto/livekit_models.ts +1134 -570
  34. package/src/proto/livekit_rtc.ts +834 -1135
  35. package/src/room/Room.ts +30 -9
  36. package/src/room/events.ts +12 -0
  37. package/src/room/participant/LocalParticipant.ts +25 -2
  38. package/src/room/participant/Participant.ts +22 -2
  39. package/src/room/track/Track.ts +10 -4
  40. package/src/room/track/options.ts +1 -1
  41. package/src/version.ts +2 -2
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  import Long from "long";
3
- import _m0 from "protobufjs/minimal";
3
+ import * as _m0 from "protobufjs/minimal";
4
4
  import {
5
5
  TrackType,
6
6
  TrackSource,
@@ -152,6 +152,8 @@ export interface SignalResponse {
152
152
  subscriptionPermissionUpdate?: SubscriptionPermissionUpdate | undefined;
153
153
  /** update the token the client was using, to prevent an active client from using an expired token */
154
154
  refreshToken: string | undefined;
155
+ /** server initiated track unpublish */
156
+ trackUnpublished?: TrackUnpublishedResponse | undefined;
155
157
  }
156
158
 
157
159
  export interface AddTrackRequest {
@@ -202,6 +204,10 @@ export interface TrackPublishedResponse {
202
204
  track?: TrackInfo;
203
205
  }
204
206
 
207
+ export interface TrackUnpublishedResponse {
208
+ trackSid: string;
209
+ }
210
+
205
211
  export interface SessionDescription {
206
212
  /** "answer" | "offer" | "pranswer" | "rollback" */
207
213
  type: string;
@@ -328,7 +334,22 @@ export interface SimulateScenario {
328
334
  serverLeave: boolean | undefined;
329
335
  }
330
336
 
331
- const baseSignalRequest: object = {};
337
+ function createBaseSignalRequest(): SignalRequest {
338
+ return {
339
+ offer: undefined,
340
+ answer: undefined,
341
+ trickle: undefined,
342
+ addTrack: undefined,
343
+ mute: undefined,
344
+ subscription: undefined,
345
+ trackSetting: undefined,
346
+ leave: undefined,
347
+ updateLayers: undefined,
348
+ subscriptionPermission: undefined,
349
+ syncState: undefined,
350
+ simulate: undefined,
351
+ };
352
+ }
332
353
 
333
354
  export const SignalRequest = {
334
355
  encode(
@@ -401,7 +422,7 @@ export const SignalRequest = {
401
422
  decode(input: _m0.Reader | Uint8Array, length?: number): SignalRequest {
402
423
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
403
424
  let end = length === undefined ? reader.len : reader.pos + length;
404
- const message = { ...baseSignalRequest } as SignalRequest;
425
+ const message = createBaseSignalRequest();
405
426
  while (reader.pos < end) {
406
427
  const tag = reader.uint32();
407
428
  switch (tag >>> 3) {
@@ -462,73 +483,44 @@ export const SignalRequest = {
462
483
  },
463
484
 
464
485
  fromJSON(object: any): SignalRequest {
465
- const message = { ...baseSignalRequest } as SignalRequest;
466
- if (object.offer !== undefined && object.offer !== null) {
467
- message.offer = SessionDescription.fromJSON(object.offer);
468
- } else {
469
- message.offer = undefined;
470
- }
471
- if (object.answer !== undefined && object.answer !== null) {
472
- message.answer = SessionDescription.fromJSON(object.answer);
473
- } else {
474
- message.answer = undefined;
475
- }
476
- if (object.trickle !== undefined && object.trickle !== null) {
477
- message.trickle = TrickleRequest.fromJSON(object.trickle);
478
- } else {
479
- message.trickle = undefined;
480
- }
481
- if (object.addTrack !== undefined && object.addTrack !== null) {
482
- message.addTrack = AddTrackRequest.fromJSON(object.addTrack);
483
- } else {
484
- message.addTrack = undefined;
485
- }
486
- if (object.mute !== undefined && object.mute !== null) {
487
- message.mute = MuteTrackRequest.fromJSON(object.mute);
488
- } else {
489
- message.mute = undefined;
490
- }
491
- if (object.subscription !== undefined && object.subscription !== null) {
492
- message.subscription = UpdateSubscription.fromJSON(object.subscription);
493
- } else {
494
- message.subscription = undefined;
495
- }
496
- if (object.trackSetting !== undefined && object.trackSetting !== null) {
497
- message.trackSetting = UpdateTrackSettings.fromJSON(object.trackSetting);
498
- } else {
499
- message.trackSetting = undefined;
500
- }
501
- if (object.leave !== undefined && object.leave !== null) {
502
- message.leave = LeaveRequest.fromJSON(object.leave);
503
- } else {
504
- message.leave = undefined;
505
- }
506
- if (object.updateLayers !== undefined && object.updateLayers !== null) {
507
- message.updateLayers = UpdateVideoLayers.fromJSON(object.updateLayers);
508
- } else {
509
- message.updateLayers = undefined;
510
- }
511
- if (
512
- object.subscriptionPermission !== undefined &&
513
- object.subscriptionPermission !== null
514
- ) {
515
- message.subscriptionPermission = SubscriptionPermission.fromJSON(
516
- object.subscriptionPermission
517
- );
518
- } else {
519
- message.subscriptionPermission = undefined;
520
- }
521
- if (object.syncState !== undefined && object.syncState !== null) {
522
- message.syncState = SyncState.fromJSON(object.syncState);
523
- } else {
524
- message.syncState = undefined;
525
- }
526
- if (object.simulate !== undefined && object.simulate !== null) {
527
- message.simulate = SimulateScenario.fromJSON(object.simulate);
528
- } else {
529
- message.simulate = undefined;
530
- }
531
- return message;
486
+ return {
487
+ offer: isSet(object.offer)
488
+ ? SessionDescription.fromJSON(object.offer)
489
+ : undefined,
490
+ answer: isSet(object.answer)
491
+ ? SessionDescription.fromJSON(object.answer)
492
+ : undefined,
493
+ trickle: isSet(object.trickle)
494
+ ? TrickleRequest.fromJSON(object.trickle)
495
+ : undefined,
496
+ addTrack: isSet(object.addTrack)
497
+ ? AddTrackRequest.fromJSON(object.addTrack)
498
+ : undefined,
499
+ mute: isSet(object.mute)
500
+ ? MuteTrackRequest.fromJSON(object.mute)
501
+ : undefined,
502
+ subscription: isSet(object.subscription)
503
+ ? UpdateSubscription.fromJSON(object.subscription)
504
+ : undefined,
505
+ trackSetting: isSet(object.trackSetting)
506
+ ? UpdateTrackSettings.fromJSON(object.trackSetting)
507
+ : undefined,
508
+ leave: isSet(object.leave)
509
+ ? LeaveRequest.fromJSON(object.leave)
510
+ : undefined,
511
+ updateLayers: isSet(object.updateLayers)
512
+ ? UpdateVideoLayers.fromJSON(object.updateLayers)
513
+ : undefined,
514
+ subscriptionPermission: isSet(object.subscriptionPermission)
515
+ ? SubscriptionPermission.fromJSON(object.subscriptionPermission)
516
+ : undefined,
517
+ syncState: isSet(object.syncState)
518
+ ? SyncState.fromJSON(object.syncState)
519
+ : undefined,
520
+ simulate: isSet(object.simulate)
521
+ ? SimulateScenario.fromJSON(object.simulate)
522
+ : undefined,
523
+ };
532
524
  },
533
525
 
534
526
  toJSON(message: SignalRequest): unknown {
@@ -584,82 +576,83 @@ export const SignalRequest = {
584
576
  return obj;
585
577
  },
586
578
 
587
- fromPartial(object: DeepPartial<SignalRequest>): SignalRequest {
588
- const message = { ...baseSignalRequest } as SignalRequest;
589
- if (object.offer !== undefined && object.offer !== null) {
590
- message.offer = SessionDescription.fromPartial(object.offer);
591
- } else {
592
- message.offer = undefined;
593
- }
594
- if (object.answer !== undefined && object.answer !== null) {
595
- message.answer = SessionDescription.fromPartial(object.answer);
596
- } else {
597
- message.answer = undefined;
598
- }
599
- if (object.trickle !== undefined && object.trickle !== null) {
600
- message.trickle = TrickleRequest.fromPartial(object.trickle);
601
- } else {
602
- message.trickle = undefined;
603
- }
604
- if (object.addTrack !== undefined && object.addTrack !== null) {
605
- message.addTrack = AddTrackRequest.fromPartial(object.addTrack);
606
- } else {
607
- message.addTrack = undefined;
608
- }
609
- if (object.mute !== undefined && object.mute !== null) {
610
- message.mute = MuteTrackRequest.fromPartial(object.mute);
611
- } else {
612
- message.mute = undefined;
613
- }
614
- if (object.subscription !== undefined && object.subscription !== null) {
615
- message.subscription = UpdateSubscription.fromPartial(
616
- object.subscription
617
- );
618
- } else {
619
- message.subscription = undefined;
620
- }
621
- if (object.trackSetting !== undefined && object.trackSetting !== null) {
622
- message.trackSetting = UpdateTrackSettings.fromPartial(
623
- object.trackSetting
624
- );
625
- } else {
626
- message.trackSetting = undefined;
627
- }
628
- if (object.leave !== undefined && object.leave !== null) {
629
- message.leave = LeaveRequest.fromPartial(object.leave);
630
- } else {
631
- message.leave = undefined;
632
- }
633
- if (object.updateLayers !== undefined && object.updateLayers !== null) {
634
- message.updateLayers = UpdateVideoLayers.fromPartial(object.updateLayers);
635
- } else {
636
- message.updateLayers = undefined;
637
- }
638
- if (
579
+ fromPartial<I extends Exact<DeepPartial<SignalRequest>, I>>(
580
+ object: I
581
+ ): SignalRequest {
582
+ const message = createBaseSignalRequest();
583
+ message.offer =
584
+ object.offer !== undefined && object.offer !== null
585
+ ? SessionDescription.fromPartial(object.offer)
586
+ : undefined;
587
+ message.answer =
588
+ object.answer !== undefined && object.answer !== null
589
+ ? SessionDescription.fromPartial(object.answer)
590
+ : undefined;
591
+ message.trickle =
592
+ object.trickle !== undefined && object.trickle !== null
593
+ ? TrickleRequest.fromPartial(object.trickle)
594
+ : undefined;
595
+ message.addTrack =
596
+ object.addTrack !== undefined && object.addTrack !== null
597
+ ? AddTrackRequest.fromPartial(object.addTrack)
598
+ : undefined;
599
+ message.mute =
600
+ object.mute !== undefined && object.mute !== null
601
+ ? MuteTrackRequest.fromPartial(object.mute)
602
+ : undefined;
603
+ message.subscription =
604
+ object.subscription !== undefined && object.subscription !== null
605
+ ? UpdateSubscription.fromPartial(object.subscription)
606
+ : undefined;
607
+ message.trackSetting =
608
+ object.trackSetting !== undefined && object.trackSetting !== null
609
+ ? UpdateTrackSettings.fromPartial(object.trackSetting)
610
+ : undefined;
611
+ message.leave =
612
+ object.leave !== undefined && object.leave !== null
613
+ ? LeaveRequest.fromPartial(object.leave)
614
+ : undefined;
615
+ message.updateLayers =
616
+ object.updateLayers !== undefined && object.updateLayers !== null
617
+ ? UpdateVideoLayers.fromPartial(object.updateLayers)
618
+ : undefined;
619
+ message.subscriptionPermission =
639
620
  object.subscriptionPermission !== undefined &&
640
621
  object.subscriptionPermission !== null
641
- ) {
642
- message.subscriptionPermission = SubscriptionPermission.fromPartial(
643
- object.subscriptionPermission
644
- );
645
- } else {
646
- message.subscriptionPermission = undefined;
647
- }
648
- if (object.syncState !== undefined && object.syncState !== null) {
649
- message.syncState = SyncState.fromPartial(object.syncState);
650
- } else {
651
- message.syncState = undefined;
652
- }
653
- if (object.simulate !== undefined && object.simulate !== null) {
654
- message.simulate = SimulateScenario.fromPartial(object.simulate);
655
- } else {
656
- message.simulate = undefined;
657
- }
622
+ ? SubscriptionPermission.fromPartial(object.subscriptionPermission)
623
+ : undefined;
624
+ message.syncState =
625
+ object.syncState !== undefined && object.syncState !== null
626
+ ? SyncState.fromPartial(object.syncState)
627
+ : undefined;
628
+ message.simulate =
629
+ object.simulate !== undefined && object.simulate !== null
630
+ ? SimulateScenario.fromPartial(object.simulate)
631
+ : undefined;
658
632
  return message;
659
633
  },
660
634
  };
661
635
 
662
- const baseSignalResponse: object = {};
636
+ function createBaseSignalResponse(): SignalResponse {
637
+ return {
638
+ join: undefined,
639
+ answer: undefined,
640
+ offer: undefined,
641
+ trickle: undefined,
642
+ update: undefined,
643
+ trackPublished: undefined,
644
+ leave: undefined,
645
+ mute: undefined,
646
+ speakersChanged: undefined,
647
+ roomUpdate: undefined,
648
+ connectionQuality: undefined,
649
+ streamStateUpdate: undefined,
650
+ subscribedQualityUpdate: undefined,
651
+ subscriptionPermissionUpdate: undefined,
652
+ refreshToken: undefined,
653
+ trackUnpublished: undefined,
654
+ };
655
+ }
663
656
 
664
657
  export const SignalResponse = {
665
658
  encode(
@@ -738,13 +731,19 @@ export const SignalResponse = {
738
731
  if (message.refreshToken !== undefined) {
739
732
  writer.uint32(130).string(message.refreshToken);
740
733
  }
734
+ if (message.trackUnpublished !== undefined) {
735
+ TrackUnpublishedResponse.encode(
736
+ message.trackUnpublished,
737
+ writer.uint32(138).fork()
738
+ ).ldelim();
739
+ }
741
740
  return writer;
742
741
  },
743
742
 
744
743
  decode(input: _m0.Reader | Uint8Array, length?: number): SignalResponse {
745
744
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
746
745
  let end = length === undefined ? reader.len : reader.pos + length;
747
- const message = { ...baseSignalResponse } as SignalResponse;
746
+ const message = createBaseSignalResponse();
748
747
  while (reader.pos < end) {
749
748
  const tag = reader.uint32();
750
749
  switch (tag >>> 3) {
@@ -809,6 +808,12 @@ export const SignalResponse = {
809
808
  case 16:
810
809
  message.refreshToken = reader.string();
811
810
  break;
811
+ case 17:
812
+ message.trackUnpublished = TrackUnpublishedResponse.decode(
813
+ reader,
814
+ reader.uint32()
815
+ );
816
+ break;
812
817
  default:
813
818
  reader.skipType(tag & 7);
814
819
  break;
@@ -818,111 +823,56 @@ export const SignalResponse = {
818
823
  },
819
824
 
820
825
  fromJSON(object: any): SignalResponse {
821
- const message = { ...baseSignalResponse } as SignalResponse;
822
- if (object.join !== undefined && object.join !== null) {
823
- message.join = JoinResponse.fromJSON(object.join);
824
- } else {
825
- message.join = undefined;
826
- }
827
- if (object.answer !== undefined && object.answer !== null) {
828
- message.answer = SessionDescription.fromJSON(object.answer);
829
- } else {
830
- message.answer = undefined;
831
- }
832
- if (object.offer !== undefined && object.offer !== null) {
833
- message.offer = SessionDescription.fromJSON(object.offer);
834
- } else {
835
- message.offer = undefined;
836
- }
837
- if (object.trickle !== undefined && object.trickle !== null) {
838
- message.trickle = TrickleRequest.fromJSON(object.trickle);
839
- } else {
840
- message.trickle = undefined;
841
- }
842
- if (object.update !== undefined && object.update !== null) {
843
- message.update = ParticipantUpdate.fromJSON(object.update);
844
- } else {
845
- message.update = undefined;
846
- }
847
- if (object.trackPublished !== undefined && object.trackPublished !== null) {
848
- message.trackPublished = TrackPublishedResponse.fromJSON(
849
- object.trackPublished
850
- );
851
- } else {
852
- message.trackPublished = undefined;
853
- }
854
- if (object.leave !== undefined && object.leave !== null) {
855
- message.leave = LeaveRequest.fromJSON(object.leave);
856
- } else {
857
- message.leave = undefined;
858
- }
859
- if (object.mute !== undefined && object.mute !== null) {
860
- message.mute = MuteTrackRequest.fromJSON(object.mute);
861
- } else {
862
- message.mute = undefined;
863
- }
864
- if (
865
- object.speakersChanged !== undefined &&
866
- object.speakersChanged !== null
867
- ) {
868
- message.speakersChanged = SpeakersChanged.fromJSON(
869
- object.speakersChanged
870
- );
871
- } else {
872
- message.speakersChanged = undefined;
873
- }
874
- if (object.roomUpdate !== undefined && object.roomUpdate !== null) {
875
- message.roomUpdate = RoomUpdate.fromJSON(object.roomUpdate);
876
- } else {
877
- message.roomUpdate = undefined;
878
- }
879
- if (
880
- object.connectionQuality !== undefined &&
881
- object.connectionQuality !== null
882
- ) {
883
- message.connectionQuality = ConnectionQualityUpdate.fromJSON(
884
- object.connectionQuality
885
- );
886
- } else {
887
- message.connectionQuality = undefined;
888
- }
889
- if (
890
- object.streamStateUpdate !== undefined &&
891
- object.streamStateUpdate !== null
892
- ) {
893
- message.streamStateUpdate = StreamStateUpdate.fromJSON(
894
- object.streamStateUpdate
895
- );
896
- } else {
897
- message.streamStateUpdate = undefined;
898
- }
899
- if (
900
- object.subscribedQualityUpdate !== undefined &&
901
- object.subscribedQualityUpdate !== null
902
- ) {
903
- message.subscribedQualityUpdate = SubscribedQualityUpdate.fromJSON(
904
- object.subscribedQualityUpdate
905
- );
906
- } else {
907
- message.subscribedQualityUpdate = undefined;
908
- }
909
- if (
910
- object.subscriptionPermissionUpdate !== undefined &&
911
- object.subscriptionPermissionUpdate !== null
912
- ) {
913
- message.subscriptionPermissionUpdate =
914
- SubscriptionPermissionUpdate.fromJSON(
915
- object.subscriptionPermissionUpdate
916
- );
917
- } else {
918
- message.subscriptionPermissionUpdate = undefined;
919
- }
920
- if (object.refreshToken !== undefined && object.refreshToken !== null) {
921
- message.refreshToken = String(object.refreshToken);
922
- } else {
923
- message.refreshToken = undefined;
924
- }
925
- return message;
826
+ return {
827
+ join: isSet(object.join) ? JoinResponse.fromJSON(object.join) : undefined,
828
+ answer: isSet(object.answer)
829
+ ? SessionDescription.fromJSON(object.answer)
830
+ : undefined,
831
+ offer: isSet(object.offer)
832
+ ? SessionDescription.fromJSON(object.offer)
833
+ : undefined,
834
+ trickle: isSet(object.trickle)
835
+ ? TrickleRequest.fromJSON(object.trickle)
836
+ : undefined,
837
+ update: isSet(object.update)
838
+ ? ParticipantUpdate.fromJSON(object.update)
839
+ : undefined,
840
+ trackPublished: isSet(object.trackPublished)
841
+ ? TrackPublishedResponse.fromJSON(object.trackPublished)
842
+ : undefined,
843
+ leave: isSet(object.leave)
844
+ ? LeaveRequest.fromJSON(object.leave)
845
+ : undefined,
846
+ mute: isSet(object.mute)
847
+ ? MuteTrackRequest.fromJSON(object.mute)
848
+ : undefined,
849
+ speakersChanged: isSet(object.speakersChanged)
850
+ ? SpeakersChanged.fromJSON(object.speakersChanged)
851
+ : undefined,
852
+ roomUpdate: isSet(object.roomUpdate)
853
+ ? RoomUpdate.fromJSON(object.roomUpdate)
854
+ : undefined,
855
+ connectionQuality: isSet(object.connectionQuality)
856
+ ? ConnectionQualityUpdate.fromJSON(object.connectionQuality)
857
+ : undefined,
858
+ streamStateUpdate: isSet(object.streamStateUpdate)
859
+ ? StreamStateUpdate.fromJSON(object.streamStateUpdate)
860
+ : undefined,
861
+ subscribedQualityUpdate: isSet(object.subscribedQualityUpdate)
862
+ ? SubscribedQualityUpdate.fromJSON(object.subscribedQualityUpdate)
863
+ : undefined,
864
+ subscriptionPermissionUpdate: isSet(object.subscriptionPermissionUpdate)
865
+ ? SubscriptionPermissionUpdate.fromJSON(
866
+ object.subscriptionPermissionUpdate
867
+ )
868
+ : undefined,
869
+ refreshToken: isSet(object.refreshToken)
870
+ ? String(object.refreshToken)
871
+ : undefined,
872
+ trackUnpublished: isSet(object.trackUnpublished)
873
+ ? TrackUnpublishedResponse.fromJSON(object.trackUnpublished)
874
+ : undefined,
875
+ };
926
876
  },
927
877
 
928
878
  toJSON(message: SignalResponse): unknown {
@@ -985,124 +935,101 @@ export const SignalResponse = {
985
935
  : undefined);
986
936
  message.refreshToken !== undefined &&
987
937
  (obj.refreshToken = message.refreshToken);
938
+ message.trackUnpublished !== undefined &&
939
+ (obj.trackUnpublished = message.trackUnpublished
940
+ ? TrackUnpublishedResponse.toJSON(message.trackUnpublished)
941
+ : undefined);
988
942
  return obj;
989
943
  },
990
944
 
991
- fromPartial(object: DeepPartial<SignalResponse>): SignalResponse {
992
- const message = { ...baseSignalResponse } as SignalResponse;
993
- if (object.join !== undefined && object.join !== null) {
994
- message.join = JoinResponse.fromPartial(object.join);
995
- } else {
996
- message.join = undefined;
997
- }
998
- if (object.answer !== undefined && object.answer !== null) {
999
- message.answer = SessionDescription.fromPartial(object.answer);
1000
- } else {
1001
- message.answer = undefined;
1002
- }
1003
- if (object.offer !== undefined && object.offer !== null) {
1004
- message.offer = SessionDescription.fromPartial(object.offer);
1005
- } else {
1006
- message.offer = undefined;
1007
- }
1008
- if (object.trickle !== undefined && object.trickle !== null) {
1009
- message.trickle = TrickleRequest.fromPartial(object.trickle);
1010
- } else {
1011
- message.trickle = undefined;
1012
- }
1013
- if (object.update !== undefined && object.update !== null) {
1014
- message.update = ParticipantUpdate.fromPartial(object.update);
1015
- } else {
1016
- message.update = undefined;
1017
- }
1018
- if (object.trackPublished !== undefined && object.trackPublished !== null) {
1019
- message.trackPublished = TrackPublishedResponse.fromPartial(
1020
- object.trackPublished
1021
- );
1022
- } else {
1023
- message.trackPublished = undefined;
1024
- }
1025
- if (object.leave !== undefined && object.leave !== null) {
1026
- message.leave = LeaveRequest.fromPartial(object.leave);
1027
- } else {
1028
- message.leave = undefined;
1029
- }
1030
- if (object.mute !== undefined && object.mute !== null) {
1031
- message.mute = MuteTrackRequest.fromPartial(object.mute);
1032
- } else {
1033
- message.mute = undefined;
1034
- }
1035
- if (
1036
- object.speakersChanged !== undefined &&
1037
- object.speakersChanged !== null
1038
- ) {
1039
- message.speakersChanged = SpeakersChanged.fromPartial(
1040
- object.speakersChanged
1041
- );
1042
- } else {
1043
- message.speakersChanged = undefined;
1044
- }
1045
- if (object.roomUpdate !== undefined && object.roomUpdate !== null) {
1046
- message.roomUpdate = RoomUpdate.fromPartial(object.roomUpdate);
1047
- } else {
1048
- message.roomUpdate = undefined;
1049
- }
1050
- if (
945
+ fromPartial<I extends Exact<DeepPartial<SignalResponse>, I>>(
946
+ object: I
947
+ ): SignalResponse {
948
+ const message = createBaseSignalResponse();
949
+ message.join =
950
+ object.join !== undefined && object.join !== null
951
+ ? JoinResponse.fromPartial(object.join)
952
+ : undefined;
953
+ message.answer =
954
+ object.answer !== undefined && object.answer !== null
955
+ ? SessionDescription.fromPartial(object.answer)
956
+ : undefined;
957
+ message.offer =
958
+ object.offer !== undefined && object.offer !== null
959
+ ? SessionDescription.fromPartial(object.offer)
960
+ : undefined;
961
+ message.trickle =
962
+ object.trickle !== undefined && object.trickle !== null
963
+ ? TrickleRequest.fromPartial(object.trickle)
964
+ : undefined;
965
+ message.update =
966
+ object.update !== undefined && object.update !== null
967
+ ? ParticipantUpdate.fromPartial(object.update)
968
+ : undefined;
969
+ message.trackPublished =
970
+ object.trackPublished !== undefined && object.trackPublished !== null
971
+ ? TrackPublishedResponse.fromPartial(object.trackPublished)
972
+ : undefined;
973
+ message.leave =
974
+ object.leave !== undefined && object.leave !== null
975
+ ? LeaveRequest.fromPartial(object.leave)
976
+ : undefined;
977
+ message.mute =
978
+ object.mute !== undefined && object.mute !== null
979
+ ? MuteTrackRequest.fromPartial(object.mute)
980
+ : undefined;
981
+ message.speakersChanged =
982
+ object.speakersChanged !== undefined && object.speakersChanged !== null
983
+ ? SpeakersChanged.fromPartial(object.speakersChanged)
984
+ : undefined;
985
+ message.roomUpdate =
986
+ object.roomUpdate !== undefined && object.roomUpdate !== null
987
+ ? RoomUpdate.fromPartial(object.roomUpdate)
988
+ : undefined;
989
+ message.connectionQuality =
1051
990
  object.connectionQuality !== undefined &&
1052
991
  object.connectionQuality !== null
1053
- ) {
1054
- message.connectionQuality = ConnectionQualityUpdate.fromPartial(
1055
- object.connectionQuality
1056
- );
1057
- } else {
1058
- message.connectionQuality = undefined;
1059
- }
1060
- if (
992
+ ? ConnectionQualityUpdate.fromPartial(object.connectionQuality)
993
+ : undefined;
994
+ message.streamStateUpdate =
1061
995
  object.streamStateUpdate !== undefined &&
1062
996
  object.streamStateUpdate !== null
1063
- ) {
1064
- message.streamStateUpdate = StreamStateUpdate.fromPartial(
1065
- object.streamStateUpdate
1066
- );
1067
- } else {
1068
- message.streamStateUpdate = undefined;
1069
- }
1070
- if (
997
+ ? StreamStateUpdate.fromPartial(object.streamStateUpdate)
998
+ : undefined;
999
+ message.subscribedQualityUpdate =
1071
1000
  object.subscribedQualityUpdate !== undefined &&
1072
1001
  object.subscribedQualityUpdate !== null
1073
- ) {
1074
- message.subscribedQualityUpdate = SubscribedQualityUpdate.fromPartial(
1075
- object.subscribedQualityUpdate
1076
- );
1077
- } else {
1078
- message.subscribedQualityUpdate = undefined;
1079
- }
1080
- if (
1002
+ ? SubscribedQualityUpdate.fromPartial(object.subscribedQualityUpdate)
1003
+ : undefined;
1004
+ message.subscriptionPermissionUpdate =
1081
1005
  object.subscriptionPermissionUpdate !== undefined &&
1082
1006
  object.subscriptionPermissionUpdate !== null
1083
- ) {
1084
- message.subscriptionPermissionUpdate =
1085
- SubscriptionPermissionUpdate.fromPartial(
1086
- object.subscriptionPermissionUpdate
1087
- );
1088
- } else {
1089
- message.subscriptionPermissionUpdate = undefined;
1090
- }
1007
+ ? SubscriptionPermissionUpdate.fromPartial(
1008
+ object.subscriptionPermissionUpdate
1009
+ )
1010
+ : undefined;
1091
1011
  message.refreshToken = object.refreshToken ?? undefined;
1012
+ message.trackUnpublished =
1013
+ object.trackUnpublished !== undefined && object.trackUnpublished !== null
1014
+ ? TrackUnpublishedResponse.fromPartial(object.trackUnpublished)
1015
+ : undefined;
1092
1016
  return message;
1093
1017
  },
1094
1018
  };
1095
1019
 
1096
- const baseAddTrackRequest: object = {
1097
- cid: "",
1098
- name: "",
1099
- type: 0,
1100
- width: 0,
1101
- height: 0,
1102
- muted: false,
1103
- disableDtx: false,
1104
- source: 0,
1105
- };
1020
+ function createBaseAddTrackRequest(): AddTrackRequest {
1021
+ return {
1022
+ cid: "",
1023
+ name: "",
1024
+ type: 0,
1025
+ width: 0,
1026
+ height: 0,
1027
+ muted: false,
1028
+ disableDtx: false,
1029
+ source: 0,
1030
+ layers: [],
1031
+ };
1032
+ }
1106
1033
 
1107
1034
  export const AddTrackRequest = {
1108
1035
  encode(
@@ -1142,8 +1069,7 @@ export const AddTrackRequest = {
1142
1069
  decode(input: _m0.Reader | Uint8Array, length?: number): AddTrackRequest {
1143
1070
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1144
1071
  let end = length === undefined ? reader.len : reader.pos + length;
1145
- const message = { ...baseAddTrackRequest } as AddTrackRequest;
1146
- message.layers = [];
1072
+ const message = createBaseAddTrackRequest();
1147
1073
  while (reader.pos < end) {
1148
1074
  const tag = reader.uint32();
1149
1075
  switch (tag >>> 3) {
@@ -1183,54 +1109,19 @@ export const AddTrackRequest = {
1183
1109
  },
1184
1110
 
1185
1111
  fromJSON(object: any): AddTrackRequest {
1186
- const message = { ...baseAddTrackRequest } as AddTrackRequest;
1187
- message.layers = [];
1188
- if (object.cid !== undefined && object.cid !== null) {
1189
- message.cid = String(object.cid);
1190
- } else {
1191
- message.cid = "";
1192
- }
1193
- if (object.name !== undefined && object.name !== null) {
1194
- message.name = String(object.name);
1195
- } else {
1196
- message.name = "";
1197
- }
1198
- if (object.type !== undefined && object.type !== null) {
1199
- message.type = trackTypeFromJSON(object.type);
1200
- } else {
1201
- message.type = 0;
1202
- }
1203
- if (object.width !== undefined && object.width !== null) {
1204
- message.width = Number(object.width);
1205
- } else {
1206
- message.width = 0;
1207
- }
1208
- if (object.height !== undefined && object.height !== null) {
1209
- message.height = Number(object.height);
1210
- } else {
1211
- message.height = 0;
1212
- }
1213
- if (object.muted !== undefined && object.muted !== null) {
1214
- message.muted = Boolean(object.muted);
1215
- } else {
1216
- message.muted = false;
1217
- }
1218
- if (object.disableDtx !== undefined && object.disableDtx !== null) {
1219
- message.disableDtx = Boolean(object.disableDtx);
1220
- } else {
1221
- message.disableDtx = false;
1222
- }
1223
- if (object.source !== undefined && object.source !== null) {
1224
- message.source = trackSourceFromJSON(object.source);
1225
- } else {
1226
- message.source = 0;
1227
- }
1228
- if (object.layers !== undefined && object.layers !== null) {
1229
- for (const e of object.layers) {
1230
- message.layers.push(VideoLayer.fromJSON(e));
1231
- }
1232
- }
1233
- return message;
1112
+ return {
1113
+ cid: isSet(object.cid) ? String(object.cid) : "",
1114
+ name: isSet(object.name) ? String(object.name) : "",
1115
+ type: isSet(object.type) ? trackTypeFromJSON(object.type) : 0,
1116
+ width: isSet(object.width) ? Number(object.width) : 0,
1117
+ height: isSet(object.height) ? Number(object.height) : 0,
1118
+ muted: isSet(object.muted) ? Boolean(object.muted) : false,
1119
+ disableDtx: isSet(object.disableDtx) ? Boolean(object.disableDtx) : false,
1120
+ source: isSet(object.source) ? trackSourceFromJSON(object.source) : 0,
1121
+ layers: Array.isArray(object?.layers)
1122
+ ? object.layers.map((e: any) => VideoLayer.fromJSON(e))
1123
+ : [],
1124
+ };
1234
1125
  },
1235
1126
 
1236
1127
  toJSON(message: AddTrackRequest): unknown {
@@ -1238,8 +1129,8 @@ export const AddTrackRequest = {
1238
1129
  message.cid !== undefined && (obj.cid = message.cid);
1239
1130
  message.name !== undefined && (obj.name = message.name);
1240
1131
  message.type !== undefined && (obj.type = trackTypeToJSON(message.type));
1241
- message.width !== undefined && (obj.width = message.width);
1242
- message.height !== undefined && (obj.height = message.height);
1132
+ message.width !== undefined && (obj.width = Math.round(message.width));
1133
+ message.height !== undefined && (obj.height = Math.round(message.height));
1243
1134
  message.muted !== undefined && (obj.muted = message.muted);
1244
1135
  message.disableDtx !== undefined && (obj.disableDtx = message.disableDtx);
1245
1136
  message.source !== undefined &&
@@ -1254,8 +1145,10 @@ export const AddTrackRequest = {
1254
1145
  return obj;
1255
1146
  },
1256
1147
 
1257
- fromPartial(object: DeepPartial<AddTrackRequest>): AddTrackRequest {
1258
- const message = { ...baseAddTrackRequest } as AddTrackRequest;
1148
+ fromPartial<I extends Exact<DeepPartial<AddTrackRequest>, I>>(
1149
+ object: I
1150
+ ): AddTrackRequest {
1151
+ const message = createBaseAddTrackRequest();
1259
1152
  message.cid = object.cid ?? "";
1260
1153
  message.name = object.name ?? "";
1261
1154
  message.type = object.type ?? 0;
@@ -1264,17 +1157,14 @@ export const AddTrackRequest = {
1264
1157
  message.muted = object.muted ?? false;
1265
1158
  message.disableDtx = object.disableDtx ?? false;
1266
1159
  message.source = object.source ?? 0;
1267
- message.layers = [];
1268
- if (object.layers !== undefined && object.layers !== null) {
1269
- for (const e of object.layers) {
1270
- message.layers.push(VideoLayer.fromPartial(e));
1271
- }
1272
- }
1160
+ message.layers = object.layers?.map((e) => VideoLayer.fromPartial(e)) || [];
1273
1161
  return message;
1274
1162
  },
1275
1163
  };
1276
1164
 
1277
- const baseTrickleRequest: object = { candidateInit: "", target: 0 };
1165
+ function createBaseTrickleRequest(): TrickleRequest {
1166
+ return { candidateInit: "", target: 0 };
1167
+ }
1278
1168
 
1279
1169
  export const TrickleRequest = {
1280
1170
  encode(
@@ -1293,7 +1183,7 @@ export const TrickleRequest = {
1293
1183
  decode(input: _m0.Reader | Uint8Array, length?: number): TrickleRequest {
1294
1184
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1295
1185
  let end = length === undefined ? reader.len : reader.pos + length;
1296
- const message = { ...baseTrickleRequest } as TrickleRequest;
1186
+ const message = createBaseTrickleRequest();
1297
1187
  while (reader.pos < end) {
1298
1188
  const tag = reader.uint32();
1299
1189
  switch (tag >>> 3) {
@@ -1312,18 +1202,12 @@ export const TrickleRequest = {
1312
1202
  },
1313
1203
 
1314
1204
  fromJSON(object: any): TrickleRequest {
1315
- const message = { ...baseTrickleRequest } as TrickleRequest;
1316
- if (object.candidateInit !== undefined && object.candidateInit !== null) {
1317
- message.candidateInit = String(object.candidateInit);
1318
- } else {
1319
- message.candidateInit = "";
1320
- }
1321
- if (object.target !== undefined && object.target !== null) {
1322
- message.target = signalTargetFromJSON(object.target);
1323
- } else {
1324
- message.target = 0;
1325
- }
1326
- return message;
1205
+ return {
1206
+ candidateInit: isSet(object.candidateInit)
1207
+ ? String(object.candidateInit)
1208
+ : "",
1209
+ target: isSet(object.target) ? signalTargetFromJSON(object.target) : 0,
1210
+ };
1327
1211
  },
1328
1212
 
1329
1213
  toJSON(message: TrickleRequest): unknown {
@@ -1335,15 +1219,19 @@ export const TrickleRequest = {
1335
1219
  return obj;
1336
1220
  },
1337
1221
 
1338
- fromPartial(object: DeepPartial<TrickleRequest>): TrickleRequest {
1339
- const message = { ...baseTrickleRequest } as TrickleRequest;
1222
+ fromPartial<I extends Exact<DeepPartial<TrickleRequest>, I>>(
1223
+ object: I
1224
+ ): TrickleRequest {
1225
+ const message = createBaseTrickleRequest();
1340
1226
  message.candidateInit = object.candidateInit ?? "";
1341
1227
  message.target = object.target ?? 0;
1342
1228
  return message;
1343
1229
  },
1344
1230
  };
1345
1231
 
1346
- const baseMuteTrackRequest: object = { sid: "", muted: false };
1232
+ function createBaseMuteTrackRequest(): MuteTrackRequest {
1233
+ return { sid: "", muted: false };
1234
+ }
1347
1235
 
1348
1236
  export const MuteTrackRequest = {
1349
1237
  encode(
@@ -1362,7 +1250,7 @@ export const MuteTrackRequest = {
1362
1250
  decode(input: _m0.Reader | Uint8Array, length?: number): MuteTrackRequest {
1363
1251
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1364
1252
  let end = length === undefined ? reader.len : reader.pos + length;
1365
- const message = { ...baseMuteTrackRequest } as MuteTrackRequest;
1253
+ const message = createBaseMuteTrackRequest();
1366
1254
  while (reader.pos < end) {
1367
1255
  const tag = reader.uint32();
1368
1256
  switch (tag >>> 3) {
@@ -1381,18 +1269,10 @@ export const MuteTrackRequest = {
1381
1269
  },
1382
1270
 
1383
1271
  fromJSON(object: any): MuteTrackRequest {
1384
- const message = { ...baseMuteTrackRequest } as MuteTrackRequest;
1385
- if (object.sid !== undefined && object.sid !== null) {
1386
- message.sid = String(object.sid);
1387
- } else {
1388
- message.sid = "";
1389
- }
1390
- if (object.muted !== undefined && object.muted !== null) {
1391
- message.muted = Boolean(object.muted);
1392
- } else {
1393
- message.muted = false;
1394
- }
1395
- return message;
1272
+ return {
1273
+ sid: isSet(object.sid) ? String(object.sid) : "",
1274
+ muted: isSet(object.muted) ? Boolean(object.muted) : false,
1275
+ };
1396
1276
  },
1397
1277
 
1398
1278
  toJSON(message: MuteTrackRequest): unknown {
@@ -1402,20 +1282,29 @@ export const MuteTrackRequest = {
1402
1282
  return obj;
1403
1283
  },
1404
1284
 
1405
- fromPartial(object: DeepPartial<MuteTrackRequest>): MuteTrackRequest {
1406
- const message = { ...baseMuteTrackRequest } as MuteTrackRequest;
1285
+ fromPartial<I extends Exact<DeepPartial<MuteTrackRequest>, I>>(
1286
+ object: I
1287
+ ): MuteTrackRequest {
1288
+ const message = createBaseMuteTrackRequest();
1407
1289
  message.sid = object.sid ?? "";
1408
1290
  message.muted = object.muted ?? false;
1409
1291
  return message;
1410
1292
  },
1411
1293
  };
1412
1294
 
1413
- const baseJoinResponse: object = {
1414
- serverVersion: "",
1415
- subscriberPrimary: false,
1416
- alternativeUrl: "",
1417
- serverRegion: "",
1418
- };
1295
+ function createBaseJoinResponse(): JoinResponse {
1296
+ return {
1297
+ room: undefined,
1298
+ participant: undefined,
1299
+ otherParticipants: [],
1300
+ serverVersion: "",
1301
+ iceServers: [],
1302
+ subscriberPrimary: false,
1303
+ alternativeUrl: "",
1304
+ clientConfiguration: undefined,
1305
+ serverRegion: "",
1306
+ };
1307
+ }
1419
1308
 
1420
1309
  export const JoinResponse = {
1421
1310
  encode(
@@ -1461,9 +1350,7 @@ export const JoinResponse = {
1461
1350
  decode(input: _m0.Reader | Uint8Array, length?: number): JoinResponse {
1462
1351
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1463
1352
  let end = length === undefined ? reader.len : reader.pos + length;
1464
- const message = { ...baseJoinResponse } as JoinResponse;
1465
- message.otherParticipants = [];
1466
- message.iceServers = [];
1353
+ const message = createBaseJoinResponse();
1467
1354
  while (reader.pos < end) {
1468
1355
  const tag = reader.uint32();
1469
1356
  switch (tag >>> 3) {
@@ -1508,66 +1395,33 @@ export const JoinResponse = {
1508
1395
  },
1509
1396
 
1510
1397
  fromJSON(object: any): JoinResponse {
1511
- const message = { ...baseJoinResponse } as JoinResponse;
1512
- message.otherParticipants = [];
1513
- message.iceServers = [];
1514
- if (object.room !== undefined && object.room !== null) {
1515
- message.room = Room.fromJSON(object.room);
1516
- } else {
1517
- message.room = undefined;
1518
- }
1519
- if (object.participant !== undefined && object.participant !== null) {
1520
- message.participant = ParticipantInfo.fromJSON(object.participant);
1521
- } else {
1522
- message.participant = undefined;
1523
- }
1524
- if (
1525
- object.otherParticipants !== undefined &&
1526
- object.otherParticipants !== null
1527
- ) {
1528
- for (const e of object.otherParticipants) {
1529
- message.otherParticipants.push(ParticipantInfo.fromJSON(e));
1530
- }
1531
- }
1532
- if (object.serverVersion !== undefined && object.serverVersion !== null) {
1533
- message.serverVersion = String(object.serverVersion);
1534
- } else {
1535
- message.serverVersion = "";
1536
- }
1537
- if (object.iceServers !== undefined && object.iceServers !== null) {
1538
- for (const e of object.iceServers) {
1539
- message.iceServers.push(ICEServer.fromJSON(e));
1540
- }
1541
- }
1542
- if (
1543
- object.subscriberPrimary !== undefined &&
1544
- object.subscriberPrimary !== null
1545
- ) {
1546
- message.subscriberPrimary = Boolean(object.subscriberPrimary);
1547
- } else {
1548
- message.subscriberPrimary = false;
1549
- }
1550
- if (object.alternativeUrl !== undefined && object.alternativeUrl !== null) {
1551
- message.alternativeUrl = String(object.alternativeUrl);
1552
- } else {
1553
- message.alternativeUrl = "";
1554
- }
1555
- if (
1556
- object.clientConfiguration !== undefined &&
1557
- object.clientConfiguration !== null
1558
- ) {
1559
- message.clientConfiguration = ClientConfiguration.fromJSON(
1560
- object.clientConfiguration
1561
- );
1562
- } else {
1563
- message.clientConfiguration = undefined;
1564
- }
1565
- if (object.serverRegion !== undefined && object.serverRegion !== null) {
1566
- message.serverRegion = String(object.serverRegion);
1567
- } else {
1568
- message.serverRegion = "";
1569
- }
1570
- return message;
1398
+ return {
1399
+ room: isSet(object.room) ? Room.fromJSON(object.room) : undefined,
1400
+ participant: isSet(object.participant)
1401
+ ? ParticipantInfo.fromJSON(object.participant)
1402
+ : undefined,
1403
+ otherParticipants: Array.isArray(object?.otherParticipants)
1404
+ ? object.otherParticipants.map((e: any) => ParticipantInfo.fromJSON(e))
1405
+ : [],
1406
+ serverVersion: isSet(object.serverVersion)
1407
+ ? String(object.serverVersion)
1408
+ : "",
1409
+ iceServers: Array.isArray(object?.iceServers)
1410
+ ? object.iceServers.map((e: any) => ICEServer.fromJSON(e))
1411
+ : [],
1412
+ subscriberPrimary: isSet(object.subscriberPrimary)
1413
+ ? Boolean(object.subscriberPrimary)
1414
+ : false,
1415
+ alternativeUrl: isSet(object.alternativeUrl)
1416
+ ? String(object.alternativeUrl)
1417
+ : "",
1418
+ clientConfiguration: isSet(object.clientConfiguration)
1419
+ ? ClientConfiguration.fromJSON(object.clientConfiguration)
1420
+ : undefined,
1421
+ serverRegion: isSet(object.serverRegion)
1422
+ ? String(object.serverRegion)
1423
+ : "",
1424
+ };
1571
1425
  },
1572
1426
 
1573
1427
  toJSON(message: JoinResponse): unknown {
@@ -1607,52 +1461,39 @@ export const JoinResponse = {
1607
1461
  return obj;
1608
1462
  },
1609
1463
 
1610
- fromPartial(object: DeepPartial<JoinResponse>): JoinResponse {
1611
- const message = { ...baseJoinResponse } as JoinResponse;
1612
- if (object.room !== undefined && object.room !== null) {
1613
- message.room = Room.fromPartial(object.room);
1614
- } else {
1615
- message.room = undefined;
1616
- }
1617
- if (object.participant !== undefined && object.participant !== null) {
1618
- message.participant = ParticipantInfo.fromPartial(object.participant);
1619
- } else {
1620
- message.participant = undefined;
1621
- }
1622
- message.otherParticipants = [];
1623
- if (
1624
- object.otherParticipants !== undefined &&
1625
- object.otherParticipants !== null
1626
- ) {
1627
- for (const e of object.otherParticipants) {
1628
- message.otherParticipants.push(ParticipantInfo.fromPartial(e));
1629
- }
1630
- }
1464
+ fromPartial<I extends Exact<DeepPartial<JoinResponse>, I>>(
1465
+ object: I
1466
+ ): JoinResponse {
1467
+ const message = createBaseJoinResponse();
1468
+ message.room =
1469
+ object.room !== undefined && object.room !== null
1470
+ ? Room.fromPartial(object.room)
1471
+ : undefined;
1472
+ message.participant =
1473
+ object.participant !== undefined && object.participant !== null
1474
+ ? ParticipantInfo.fromPartial(object.participant)
1475
+ : undefined;
1476
+ message.otherParticipants =
1477
+ object.otherParticipants?.map((e) => ParticipantInfo.fromPartial(e)) ||
1478
+ [];
1631
1479
  message.serverVersion = object.serverVersion ?? "";
1632
- message.iceServers = [];
1633
- if (object.iceServers !== undefined && object.iceServers !== null) {
1634
- for (const e of object.iceServers) {
1635
- message.iceServers.push(ICEServer.fromPartial(e));
1636
- }
1637
- }
1480
+ message.iceServers =
1481
+ object.iceServers?.map((e) => ICEServer.fromPartial(e)) || [];
1638
1482
  message.subscriberPrimary = object.subscriberPrimary ?? false;
1639
1483
  message.alternativeUrl = object.alternativeUrl ?? "";
1640
- if (
1484
+ message.clientConfiguration =
1641
1485
  object.clientConfiguration !== undefined &&
1642
1486
  object.clientConfiguration !== null
1643
- ) {
1644
- message.clientConfiguration = ClientConfiguration.fromPartial(
1645
- object.clientConfiguration
1646
- );
1647
- } else {
1648
- message.clientConfiguration = undefined;
1649
- }
1487
+ ? ClientConfiguration.fromPartial(object.clientConfiguration)
1488
+ : undefined;
1650
1489
  message.serverRegion = object.serverRegion ?? "";
1651
1490
  return message;
1652
1491
  },
1653
1492
  };
1654
1493
 
1655
- const baseTrackPublishedResponse: object = { cid: "" };
1494
+ function createBaseTrackPublishedResponse(): TrackPublishedResponse {
1495
+ return { cid: "", track: undefined };
1496
+ }
1656
1497
 
1657
1498
  export const TrackPublishedResponse = {
1658
1499
  encode(
@@ -1674,7 +1515,7 @@ export const TrackPublishedResponse = {
1674
1515
  ): TrackPublishedResponse {
1675
1516
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1676
1517
  let end = length === undefined ? reader.len : reader.pos + length;
1677
- const message = { ...baseTrackPublishedResponse } as TrackPublishedResponse;
1518
+ const message = createBaseTrackPublishedResponse();
1678
1519
  while (reader.pos < end) {
1679
1520
  const tag = reader.uint32();
1680
1521
  switch (tag >>> 3) {
@@ -1693,18 +1534,10 @@ export const TrackPublishedResponse = {
1693
1534
  },
1694
1535
 
1695
1536
  fromJSON(object: any): TrackPublishedResponse {
1696
- const message = { ...baseTrackPublishedResponse } as TrackPublishedResponse;
1697
- if (object.cid !== undefined && object.cid !== null) {
1698
- message.cid = String(object.cid);
1699
- } else {
1700
- message.cid = "";
1701
- }
1702
- if (object.track !== undefined && object.track !== null) {
1703
- message.track = TrackInfo.fromJSON(object.track);
1704
- } else {
1705
- message.track = undefined;
1706
- }
1707
- return message;
1537
+ return {
1538
+ cid: isSet(object.cid) ? String(object.cid) : "",
1539
+ track: isSet(object.track) ? TrackInfo.fromJSON(object.track) : undefined,
1540
+ };
1708
1541
  },
1709
1542
 
1710
1543
  toJSON(message: TrackPublishedResponse): unknown {
@@ -1715,21 +1548,79 @@ export const TrackPublishedResponse = {
1715
1548
  return obj;
1716
1549
  },
1717
1550
 
1718
- fromPartial(
1719
- object: DeepPartial<TrackPublishedResponse>
1551
+ fromPartial<I extends Exact<DeepPartial<TrackPublishedResponse>, I>>(
1552
+ object: I
1720
1553
  ): TrackPublishedResponse {
1721
- const message = { ...baseTrackPublishedResponse } as TrackPublishedResponse;
1554
+ const message = createBaseTrackPublishedResponse();
1722
1555
  message.cid = object.cid ?? "";
1723
- if (object.track !== undefined && object.track !== null) {
1724
- message.track = TrackInfo.fromPartial(object.track);
1725
- } else {
1726
- message.track = undefined;
1556
+ message.track =
1557
+ object.track !== undefined && object.track !== null
1558
+ ? TrackInfo.fromPartial(object.track)
1559
+ : undefined;
1560
+ return message;
1561
+ },
1562
+ };
1563
+
1564
+ function createBaseTrackUnpublishedResponse(): TrackUnpublishedResponse {
1565
+ return { trackSid: "" };
1566
+ }
1567
+
1568
+ export const TrackUnpublishedResponse = {
1569
+ encode(
1570
+ message: TrackUnpublishedResponse,
1571
+ writer: _m0.Writer = _m0.Writer.create()
1572
+ ): _m0.Writer {
1573
+ if (message.trackSid !== "") {
1574
+ writer.uint32(10).string(message.trackSid);
1575
+ }
1576
+ return writer;
1577
+ },
1578
+
1579
+ decode(
1580
+ input: _m0.Reader | Uint8Array,
1581
+ length?: number
1582
+ ): TrackUnpublishedResponse {
1583
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1584
+ let end = length === undefined ? reader.len : reader.pos + length;
1585
+ const message = createBaseTrackUnpublishedResponse();
1586
+ while (reader.pos < end) {
1587
+ const tag = reader.uint32();
1588
+ switch (tag >>> 3) {
1589
+ case 1:
1590
+ message.trackSid = reader.string();
1591
+ break;
1592
+ default:
1593
+ reader.skipType(tag & 7);
1594
+ break;
1595
+ }
1727
1596
  }
1728
1597
  return message;
1729
1598
  },
1599
+
1600
+ fromJSON(object: any): TrackUnpublishedResponse {
1601
+ return {
1602
+ trackSid: isSet(object.trackSid) ? String(object.trackSid) : "",
1603
+ };
1604
+ },
1605
+
1606
+ toJSON(message: TrackUnpublishedResponse): unknown {
1607
+ const obj: any = {};
1608
+ message.trackSid !== undefined && (obj.trackSid = message.trackSid);
1609
+ return obj;
1610
+ },
1611
+
1612
+ fromPartial<I extends Exact<DeepPartial<TrackUnpublishedResponse>, I>>(
1613
+ object: I
1614
+ ): TrackUnpublishedResponse {
1615
+ const message = createBaseTrackUnpublishedResponse();
1616
+ message.trackSid = object.trackSid ?? "";
1617
+ return message;
1618
+ },
1730
1619
  };
1731
1620
 
1732
- const baseSessionDescription: object = { type: "", sdp: "" };
1621
+ function createBaseSessionDescription(): SessionDescription {
1622
+ return { type: "", sdp: "" };
1623
+ }
1733
1624
 
1734
1625
  export const SessionDescription = {
1735
1626
  encode(
@@ -1748,7 +1639,7 @@ export const SessionDescription = {
1748
1639
  decode(input: _m0.Reader | Uint8Array, length?: number): SessionDescription {
1749
1640
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1750
1641
  let end = length === undefined ? reader.len : reader.pos + length;
1751
- const message = { ...baseSessionDescription } as SessionDescription;
1642
+ const message = createBaseSessionDescription();
1752
1643
  while (reader.pos < end) {
1753
1644
  const tag = reader.uint32();
1754
1645
  switch (tag >>> 3) {
@@ -1767,18 +1658,10 @@ export const SessionDescription = {
1767
1658
  },
1768
1659
 
1769
1660
  fromJSON(object: any): SessionDescription {
1770
- const message = { ...baseSessionDescription } as SessionDescription;
1771
- if (object.type !== undefined && object.type !== null) {
1772
- message.type = String(object.type);
1773
- } else {
1774
- message.type = "";
1775
- }
1776
- if (object.sdp !== undefined && object.sdp !== null) {
1777
- message.sdp = String(object.sdp);
1778
- } else {
1779
- message.sdp = "";
1780
- }
1781
- return message;
1661
+ return {
1662
+ type: isSet(object.type) ? String(object.type) : "",
1663
+ sdp: isSet(object.sdp) ? String(object.sdp) : "",
1664
+ };
1782
1665
  },
1783
1666
 
1784
1667
  toJSON(message: SessionDescription): unknown {
@@ -1788,15 +1671,19 @@ export const SessionDescription = {
1788
1671
  return obj;
1789
1672
  },
1790
1673
 
1791
- fromPartial(object: DeepPartial<SessionDescription>): SessionDescription {
1792
- const message = { ...baseSessionDescription } as SessionDescription;
1674
+ fromPartial<I extends Exact<DeepPartial<SessionDescription>, I>>(
1675
+ object: I
1676
+ ): SessionDescription {
1677
+ const message = createBaseSessionDescription();
1793
1678
  message.type = object.type ?? "";
1794
1679
  message.sdp = object.sdp ?? "";
1795
1680
  return message;
1796
1681
  },
1797
1682
  };
1798
1683
 
1799
- const baseParticipantUpdate: object = {};
1684
+ function createBaseParticipantUpdate(): ParticipantUpdate {
1685
+ return { participants: [] };
1686
+ }
1800
1687
 
1801
1688
  export const ParticipantUpdate = {
1802
1689
  encode(
@@ -1812,8 +1699,7 @@ export const ParticipantUpdate = {
1812
1699
  decode(input: _m0.Reader | Uint8Array, length?: number): ParticipantUpdate {
1813
1700
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1814
1701
  let end = length === undefined ? reader.len : reader.pos + length;
1815
- const message = { ...baseParticipantUpdate } as ParticipantUpdate;
1816
- message.participants = [];
1702
+ const message = createBaseParticipantUpdate();
1817
1703
  while (reader.pos < end) {
1818
1704
  const tag = reader.uint32();
1819
1705
  switch (tag >>> 3) {
@@ -1831,14 +1717,11 @@ export const ParticipantUpdate = {
1831
1717
  },
1832
1718
 
1833
1719
  fromJSON(object: any): ParticipantUpdate {
1834
- const message = { ...baseParticipantUpdate } as ParticipantUpdate;
1835
- message.participants = [];
1836
- if (object.participants !== undefined && object.participants !== null) {
1837
- for (const e of object.participants) {
1838
- message.participants.push(ParticipantInfo.fromJSON(e));
1839
- }
1840
- }
1841
- return message;
1720
+ return {
1721
+ participants: Array.isArray(object?.participants)
1722
+ ? object.participants.map((e: any) => ParticipantInfo.fromJSON(e))
1723
+ : [],
1724
+ };
1842
1725
  },
1843
1726
 
1844
1727
  toJSON(message: ParticipantUpdate): unknown {
@@ -1853,19 +1736,19 @@ export const ParticipantUpdate = {
1853
1736
  return obj;
1854
1737
  },
1855
1738
 
1856
- fromPartial(object: DeepPartial<ParticipantUpdate>): ParticipantUpdate {
1857
- const message = { ...baseParticipantUpdate } as ParticipantUpdate;
1858
- message.participants = [];
1859
- if (object.participants !== undefined && object.participants !== null) {
1860
- for (const e of object.participants) {
1861
- message.participants.push(ParticipantInfo.fromPartial(e));
1862
- }
1863
- }
1739
+ fromPartial<I extends Exact<DeepPartial<ParticipantUpdate>, I>>(
1740
+ object: I
1741
+ ): ParticipantUpdate {
1742
+ const message = createBaseParticipantUpdate();
1743
+ message.participants =
1744
+ object.participants?.map((e) => ParticipantInfo.fromPartial(e)) || [];
1864
1745
  return message;
1865
1746
  },
1866
1747
  };
1867
1748
 
1868
- const baseUpdateSubscription: object = { trackSids: "", subscribe: false };
1749
+ function createBaseUpdateSubscription(): UpdateSubscription {
1750
+ return { trackSids: [], subscribe: false, participantTracks: [] };
1751
+ }
1869
1752
 
1870
1753
  export const UpdateSubscription = {
1871
1754
  encode(
@@ -1887,9 +1770,7 @@ export const UpdateSubscription = {
1887
1770
  decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSubscription {
1888
1771
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1889
1772
  let end = length === undefined ? reader.len : reader.pos + length;
1890
- const message = { ...baseUpdateSubscription } as UpdateSubscription;
1891
- message.trackSids = [];
1892
- message.participantTracks = [];
1773
+ const message = createBaseUpdateSubscription();
1893
1774
  while (reader.pos < end) {
1894
1775
  const tag = reader.uint32();
1895
1776
  switch (tag >>> 3) {
@@ -1913,28 +1794,17 @@ export const UpdateSubscription = {
1913
1794
  },
1914
1795
 
1915
1796
  fromJSON(object: any): UpdateSubscription {
1916
- const message = { ...baseUpdateSubscription } as UpdateSubscription;
1917
- message.trackSids = [];
1918
- message.participantTracks = [];
1919
- if (object.trackSids !== undefined && object.trackSids !== null) {
1920
- for (const e of object.trackSids) {
1921
- message.trackSids.push(String(e));
1922
- }
1923
- }
1924
- if (object.subscribe !== undefined && object.subscribe !== null) {
1925
- message.subscribe = Boolean(object.subscribe);
1926
- } else {
1927
- message.subscribe = false;
1928
- }
1929
- if (
1930
- object.participantTracks !== undefined &&
1931
- object.participantTracks !== null
1932
- ) {
1933
- for (const e of object.participantTracks) {
1934
- message.participantTracks.push(ParticipantTracks.fromJSON(e));
1935
- }
1936
- }
1937
- return message;
1797
+ return {
1798
+ trackSids: Array.isArray(object?.trackSids)
1799
+ ? object.trackSids.map((e: any) => String(e))
1800
+ : [],
1801
+ subscribe: isSet(object.subscribe) ? Boolean(object.subscribe) : false,
1802
+ participantTracks: Array.isArray(object?.participantTracks)
1803
+ ? object.participantTracks.map((e: any) =>
1804
+ ParticipantTracks.fromJSON(e)
1805
+ )
1806
+ : [],
1807
+ };
1938
1808
  },
1939
1809
 
1940
1810
  toJSON(message: UpdateSubscription): unknown {
@@ -1955,35 +1825,22 @@ export const UpdateSubscription = {
1955
1825
  return obj;
1956
1826
  },
1957
1827
 
1958
- fromPartial(object: DeepPartial<UpdateSubscription>): UpdateSubscription {
1959
- const message = { ...baseUpdateSubscription } as UpdateSubscription;
1960
- message.trackSids = [];
1961
- if (object.trackSids !== undefined && object.trackSids !== null) {
1962
- for (const e of object.trackSids) {
1963
- message.trackSids.push(e);
1964
- }
1965
- }
1828
+ fromPartial<I extends Exact<DeepPartial<UpdateSubscription>, I>>(
1829
+ object: I
1830
+ ): UpdateSubscription {
1831
+ const message = createBaseUpdateSubscription();
1832
+ message.trackSids = object.trackSids?.map((e) => e) || [];
1966
1833
  message.subscribe = object.subscribe ?? false;
1967
- message.participantTracks = [];
1968
- if (
1969
- object.participantTracks !== undefined &&
1970
- object.participantTracks !== null
1971
- ) {
1972
- for (const e of object.participantTracks) {
1973
- message.participantTracks.push(ParticipantTracks.fromPartial(e));
1974
- }
1975
- }
1834
+ message.participantTracks =
1835
+ object.participantTracks?.map((e) => ParticipantTracks.fromPartial(e)) ||
1836
+ [];
1976
1837
  return message;
1977
1838
  },
1978
1839
  };
1979
1840
 
1980
- const baseUpdateTrackSettings: object = {
1981
- trackSids: "",
1982
- disabled: false,
1983
- quality: 0,
1984
- width: 0,
1985
- height: 0,
1986
- };
1841
+ function createBaseUpdateTrackSettings(): UpdateTrackSettings {
1842
+ return { trackSids: [], disabled: false, quality: 0, width: 0, height: 0 };
1843
+ }
1987
1844
 
1988
1845
  export const UpdateTrackSettings = {
1989
1846
  encode(
@@ -2011,8 +1868,7 @@ export const UpdateTrackSettings = {
2011
1868
  decode(input: _m0.Reader | Uint8Array, length?: number): UpdateTrackSettings {
2012
1869
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2013
1870
  let end = length === undefined ? reader.len : reader.pos + length;
2014
- const message = { ...baseUpdateTrackSettings } as UpdateTrackSettings;
2015
- message.trackSids = [];
1871
+ const message = createBaseUpdateTrackSettings();
2016
1872
  while (reader.pos < end) {
2017
1873
  const tag = reader.uint32();
2018
1874
  switch (tag >>> 3) {
@@ -2040,34 +1896,15 @@ export const UpdateTrackSettings = {
2040
1896
  },
2041
1897
 
2042
1898
  fromJSON(object: any): UpdateTrackSettings {
2043
- const message = { ...baseUpdateTrackSettings } as UpdateTrackSettings;
2044
- message.trackSids = [];
2045
- if (object.trackSids !== undefined && object.trackSids !== null) {
2046
- for (const e of object.trackSids) {
2047
- message.trackSids.push(String(e));
2048
- }
2049
- }
2050
- if (object.disabled !== undefined && object.disabled !== null) {
2051
- message.disabled = Boolean(object.disabled);
2052
- } else {
2053
- message.disabled = false;
2054
- }
2055
- if (object.quality !== undefined && object.quality !== null) {
2056
- message.quality = videoQualityFromJSON(object.quality);
2057
- } else {
2058
- message.quality = 0;
2059
- }
2060
- if (object.width !== undefined && object.width !== null) {
2061
- message.width = Number(object.width);
2062
- } else {
2063
- message.width = 0;
2064
- }
2065
- if (object.height !== undefined && object.height !== null) {
2066
- message.height = Number(object.height);
2067
- } else {
2068
- message.height = 0;
2069
- }
2070
- return message;
1899
+ return {
1900
+ trackSids: Array.isArray(object?.trackSids)
1901
+ ? object.trackSids.map((e: any) => String(e))
1902
+ : [],
1903
+ disabled: isSet(object.disabled) ? Boolean(object.disabled) : false,
1904
+ quality: isSet(object.quality) ? videoQualityFromJSON(object.quality) : 0,
1905
+ width: isSet(object.width) ? Number(object.width) : 0,
1906
+ height: isSet(object.height) ? Number(object.height) : 0,
1907
+ };
2071
1908
  },
2072
1909
 
2073
1910
  toJSON(message: UpdateTrackSettings): unknown {
@@ -2080,19 +1917,16 @@ export const UpdateTrackSettings = {
2080
1917
  message.disabled !== undefined && (obj.disabled = message.disabled);
2081
1918
  message.quality !== undefined &&
2082
1919
  (obj.quality = videoQualityToJSON(message.quality));
2083
- message.width !== undefined && (obj.width = message.width);
2084
- message.height !== undefined && (obj.height = message.height);
1920
+ message.width !== undefined && (obj.width = Math.round(message.width));
1921
+ message.height !== undefined && (obj.height = Math.round(message.height));
2085
1922
  return obj;
2086
1923
  },
2087
1924
 
2088
- fromPartial(object: DeepPartial<UpdateTrackSettings>): UpdateTrackSettings {
2089
- const message = { ...baseUpdateTrackSettings } as UpdateTrackSettings;
2090
- message.trackSids = [];
2091
- if (object.trackSids !== undefined && object.trackSids !== null) {
2092
- for (const e of object.trackSids) {
2093
- message.trackSids.push(e);
2094
- }
2095
- }
1925
+ fromPartial<I extends Exact<DeepPartial<UpdateTrackSettings>, I>>(
1926
+ object: I
1927
+ ): UpdateTrackSettings {
1928
+ const message = createBaseUpdateTrackSettings();
1929
+ message.trackSids = object.trackSids?.map((e) => e) || [];
2096
1930
  message.disabled = object.disabled ?? false;
2097
1931
  message.quality = object.quality ?? 0;
2098
1932
  message.width = object.width ?? 0;
@@ -2101,7 +1935,9 @@ export const UpdateTrackSettings = {
2101
1935
  },
2102
1936
  };
2103
1937
 
2104
- const baseLeaveRequest: object = { canReconnect: false };
1938
+ function createBaseLeaveRequest(): LeaveRequest {
1939
+ return { canReconnect: false };
1940
+ }
2105
1941
 
2106
1942
  export const LeaveRequest = {
2107
1943
  encode(
@@ -2117,7 +1953,7 @@ export const LeaveRequest = {
2117
1953
  decode(input: _m0.Reader | Uint8Array, length?: number): LeaveRequest {
2118
1954
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2119
1955
  let end = length === undefined ? reader.len : reader.pos + length;
2120
- const message = { ...baseLeaveRequest } as LeaveRequest;
1956
+ const message = createBaseLeaveRequest();
2121
1957
  while (reader.pos < end) {
2122
1958
  const tag = reader.uint32();
2123
1959
  switch (tag >>> 3) {
@@ -2133,13 +1969,11 @@ export const LeaveRequest = {
2133
1969
  },
2134
1970
 
2135
1971
  fromJSON(object: any): LeaveRequest {
2136
- const message = { ...baseLeaveRequest } as LeaveRequest;
2137
- if (object.canReconnect !== undefined && object.canReconnect !== null) {
2138
- message.canReconnect = Boolean(object.canReconnect);
2139
- } else {
2140
- message.canReconnect = false;
2141
- }
2142
- return message;
1972
+ return {
1973
+ canReconnect: isSet(object.canReconnect)
1974
+ ? Boolean(object.canReconnect)
1975
+ : false,
1976
+ };
2143
1977
  },
2144
1978
 
2145
1979
  toJSON(message: LeaveRequest): unknown {
@@ -2149,14 +1983,18 @@ export const LeaveRequest = {
2149
1983
  return obj;
2150
1984
  },
2151
1985
 
2152
- fromPartial(object: DeepPartial<LeaveRequest>): LeaveRequest {
2153
- const message = { ...baseLeaveRequest } as LeaveRequest;
1986
+ fromPartial<I extends Exact<DeepPartial<LeaveRequest>, I>>(
1987
+ object: I
1988
+ ): LeaveRequest {
1989
+ const message = createBaseLeaveRequest();
2154
1990
  message.canReconnect = object.canReconnect ?? false;
2155
1991
  return message;
2156
1992
  },
2157
1993
  };
2158
1994
 
2159
- const baseUpdateVideoLayers: object = { trackSid: "" };
1995
+ function createBaseUpdateVideoLayers(): UpdateVideoLayers {
1996
+ return { trackSid: "", layers: [] };
1997
+ }
2160
1998
 
2161
1999
  export const UpdateVideoLayers = {
2162
2000
  encode(
@@ -2175,8 +2013,7 @@ export const UpdateVideoLayers = {
2175
2013
  decode(input: _m0.Reader | Uint8Array, length?: number): UpdateVideoLayers {
2176
2014
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2177
2015
  let end = length === undefined ? reader.len : reader.pos + length;
2178
- const message = { ...baseUpdateVideoLayers } as UpdateVideoLayers;
2179
- message.layers = [];
2016
+ const message = createBaseUpdateVideoLayers();
2180
2017
  while (reader.pos < end) {
2181
2018
  const tag = reader.uint32();
2182
2019
  switch (tag >>> 3) {
@@ -2195,19 +2032,12 @@ export const UpdateVideoLayers = {
2195
2032
  },
2196
2033
 
2197
2034
  fromJSON(object: any): UpdateVideoLayers {
2198
- const message = { ...baseUpdateVideoLayers } as UpdateVideoLayers;
2199
- message.layers = [];
2200
- if (object.trackSid !== undefined && object.trackSid !== null) {
2201
- message.trackSid = String(object.trackSid);
2202
- } else {
2203
- message.trackSid = "";
2204
- }
2205
- if (object.layers !== undefined && object.layers !== null) {
2206
- for (const e of object.layers) {
2207
- message.layers.push(VideoLayer.fromJSON(e));
2208
- }
2209
- }
2210
- return message;
2035
+ return {
2036
+ trackSid: isSet(object.trackSid) ? String(object.trackSid) : "",
2037
+ layers: Array.isArray(object?.layers)
2038
+ ? object.layers.map((e: any) => VideoLayer.fromJSON(e))
2039
+ : [],
2040
+ };
2211
2041
  },
2212
2042
 
2213
2043
  toJSON(message: UpdateVideoLayers): unknown {
@@ -2223,20 +2053,19 @@ export const UpdateVideoLayers = {
2223
2053
  return obj;
2224
2054
  },
2225
2055
 
2226
- fromPartial(object: DeepPartial<UpdateVideoLayers>): UpdateVideoLayers {
2227
- const message = { ...baseUpdateVideoLayers } as UpdateVideoLayers;
2056
+ fromPartial<I extends Exact<DeepPartial<UpdateVideoLayers>, I>>(
2057
+ object: I
2058
+ ): UpdateVideoLayers {
2059
+ const message = createBaseUpdateVideoLayers();
2228
2060
  message.trackSid = object.trackSid ?? "";
2229
- message.layers = [];
2230
- if (object.layers !== undefined && object.layers !== null) {
2231
- for (const e of object.layers) {
2232
- message.layers.push(VideoLayer.fromPartial(e));
2233
- }
2234
- }
2061
+ message.layers = object.layers?.map((e) => VideoLayer.fromPartial(e)) || [];
2235
2062
  return message;
2236
2063
  },
2237
2064
  };
2238
2065
 
2239
- const baseICEServer: object = { urls: "", username: "", credential: "" };
2066
+ function createBaseICEServer(): ICEServer {
2067
+ return { urls: [], username: "", credential: "" };
2068
+ }
2240
2069
 
2241
2070
  export const ICEServer = {
2242
2071
  encode(
@@ -2258,8 +2087,7 @@ export const ICEServer = {
2258
2087
  decode(input: _m0.Reader | Uint8Array, length?: number): ICEServer {
2259
2088
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2260
2089
  let end = length === undefined ? reader.len : reader.pos + length;
2261
- const message = { ...baseICEServer } as ICEServer;
2262
- message.urls = [];
2090
+ const message = createBaseICEServer();
2263
2091
  while (reader.pos < end) {
2264
2092
  const tag = reader.uint32();
2265
2093
  switch (tag >>> 3) {
@@ -2281,24 +2109,13 @@ export const ICEServer = {
2281
2109
  },
2282
2110
 
2283
2111
  fromJSON(object: any): ICEServer {
2284
- const message = { ...baseICEServer } as ICEServer;
2285
- message.urls = [];
2286
- if (object.urls !== undefined && object.urls !== null) {
2287
- for (const e of object.urls) {
2288
- message.urls.push(String(e));
2289
- }
2290
- }
2291
- if (object.username !== undefined && object.username !== null) {
2292
- message.username = String(object.username);
2293
- } else {
2294
- message.username = "";
2295
- }
2296
- if (object.credential !== undefined && object.credential !== null) {
2297
- message.credential = String(object.credential);
2298
- } else {
2299
- message.credential = "";
2300
- }
2301
- return message;
2112
+ return {
2113
+ urls: Array.isArray(object?.urls)
2114
+ ? object.urls.map((e: any) => String(e))
2115
+ : [],
2116
+ username: isSet(object.username) ? String(object.username) : "",
2117
+ credential: isSet(object.credential) ? String(object.credential) : "",
2118
+ };
2302
2119
  },
2303
2120
 
2304
2121
  toJSON(message: ICEServer): unknown {
@@ -2313,21 +2130,20 @@ export const ICEServer = {
2313
2130
  return obj;
2314
2131
  },
2315
2132
 
2316
- fromPartial(object: DeepPartial<ICEServer>): ICEServer {
2317
- const message = { ...baseICEServer } as ICEServer;
2318
- message.urls = [];
2319
- if (object.urls !== undefined && object.urls !== null) {
2320
- for (const e of object.urls) {
2321
- message.urls.push(e);
2322
- }
2323
- }
2133
+ fromPartial<I extends Exact<DeepPartial<ICEServer>, I>>(
2134
+ object: I
2135
+ ): ICEServer {
2136
+ const message = createBaseICEServer();
2137
+ message.urls = object.urls?.map((e) => e) || [];
2324
2138
  message.username = object.username ?? "";
2325
2139
  message.credential = object.credential ?? "";
2326
2140
  return message;
2327
2141
  },
2328
2142
  };
2329
2143
 
2330
- const baseSpeakersChanged: object = {};
2144
+ function createBaseSpeakersChanged(): SpeakersChanged {
2145
+ return { speakers: [] };
2146
+ }
2331
2147
 
2332
2148
  export const SpeakersChanged = {
2333
2149
  encode(
@@ -2343,8 +2159,7 @@ export const SpeakersChanged = {
2343
2159
  decode(input: _m0.Reader | Uint8Array, length?: number): SpeakersChanged {
2344
2160
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2345
2161
  let end = length === undefined ? reader.len : reader.pos + length;
2346
- const message = { ...baseSpeakersChanged } as SpeakersChanged;
2347
- message.speakers = [];
2162
+ const message = createBaseSpeakersChanged();
2348
2163
  while (reader.pos < end) {
2349
2164
  const tag = reader.uint32();
2350
2165
  switch (tag >>> 3) {
@@ -2360,14 +2175,11 @@ export const SpeakersChanged = {
2360
2175
  },
2361
2176
 
2362
2177
  fromJSON(object: any): SpeakersChanged {
2363
- const message = { ...baseSpeakersChanged } as SpeakersChanged;
2364
- message.speakers = [];
2365
- if (object.speakers !== undefined && object.speakers !== null) {
2366
- for (const e of object.speakers) {
2367
- message.speakers.push(SpeakerInfo.fromJSON(e));
2368
- }
2369
- }
2370
- return message;
2178
+ return {
2179
+ speakers: Array.isArray(object?.speakers)
2180
+ ? object.speakers.map((e: any) => SpeakerInfo.fromJSON(e))
2181
+ : [],
2182
+ };
2371
2183
  },
2372
2184
 
2373
2185
  toJSON(message: SpeakersChanged): unknown {
@@ -2382,19 +2194,19 @@ export const SpeakersChanged = {
2382
2194
  return obj;
2383
2195
  },
2384
2196
 
2385
- fromPartial(object: DeepPartial<SpeakersChanged>): SpeakersChanged {
2386
- const message = { ...baseSpeakersChanged } as SpeakersChanged;
2387
- message.speakers = [];
2388
- if (object.speakers !== undefined && object.speakers !== null) {
2389
- for (const e of object.speakers) {
2390
- message.speakers.push(SpeakerInfo.fromPartial(e));
2391
- }
2392
- }
2197
+ fromPartial<I extends Exact<DeepPartial<SpeakersChanged>, I>>(
2198
+ object: I
2199
+ ): SpeakersChanged {
2200
+ const message = createBaseSpeakersChanged();
2201
+ message.speakers =
2202
+ object.speakers?.map((e) => SpeakerInfo.fromPartial(e)) || [];
2393
2203
  return message;
2394
2204
  },
2395
2205
  };
2396
2206
 
2397
- const baseRoomUpdate: object = {};
2207
+ function createBaseRoomUpdate(): RoomUpdate {
2208
+ return { room: undefined };
2209
+ }
2398
2210
 
2399
2211
  export const RoomUpdate = {
2400
2212
  encode(
@@ -2410,7 +2222,7 @@ export const RoomUpdate = {
2410
2222
  decode(input: _m0.Reader | Uint8Array, length?: number): RoomUpdate {
2411
2223
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2412
2224
  let end = length === undefined ? reader.len : reader.pos + length;
2413
- const message = { ...baseRoomUpdate } as RoomUpdate;
2225
+ const message = createBaseRoomUpdate();
2414
2226
  while (reader.pos < end) {
2415
2227
  const tag = reader.uint32();
2416
2228
  switch (tag >>> 3) {
@@ -2426,13 +2238,9 @@ export const RoomUpdate = {
2426
2238
  },
2427
2239
 
2428
2240
  fromJSON(object: any): RoomUpdate {
2429
- const message = { ...baseRoomUpdate } as RoomUpdate;
2430
- if (object.room !== undefined && object.room !== null) {
2431
- message.room = Room.fromJSON(object.room);
2432
- } else {
2433
- message.room = undefined;
2434
- }
2435
- return message;
2241
+ return {
2242
+ room: isSet(object.room) ? Room.fromJSON(object.room) : undefined,
2243
+ };
2436
2244
  },
2437
2245
 
2438
2246
  toJSON(message: RoomUpdate): unknown {
@@ -2442,22 +2250,21 @@ export const RoomUpdate = {
2442
2250
  return obj;
2443
2251
  },
2444
2252
 
2445
- fromPartial(object: DeepPartial<RoomUpdate>): RoomUpdate {
2446
- const message = { ...baseRoomUpdate } as RoomUpdate;
2447
- if (object.room !== undefined && object.room !== null) {
2448
- message.room = Room.fromPartial(object.room);
2449
- } else {
2450
- message.room = undefined;
2451
- }
2253
+ fromPartial<I extends Exact<DeepPartial<RoomUpdate>, I>>(
2254
+ object: I
2255
+ ): RoomUpdate {
2256
+ const message = createBaseRoomUpdate();
2257
+ message.room =
2258
+ object.room !== undefined && object.room !== null
2259
+ ? Room.fromPartial(object.room)
2260
+ : undefined;
2452
2261
  return message;
2453
2262
  },
2454
2263
  };
2455
2264
 
2456
- const baseConnectionQualityInfo: object = {
2457
- participantSid: "",
2458
- quality: 0,
2459
- score: 0,
2460
- };
2265
+ function createBaseConnectionQualityInfo(): ConnectionQualityInfo {
2266
+ return { participantSid: "", quality: 0, score: 0 };
2267
+ }
2461
2268
 
2462
2269
  export const ConnectionQualityInfo = {
2463
2270
  encode(
@@ -2482,7 +2289,7 @@ export const ConnectionQualityInfo = {
2482
2289
  ): ConnectionQualityInfo {
2483
2290
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2484
2291
  let end = length === undefined ? reader.len : reader.pos + length;
2485
- const message = { ...baseConnectionQualityInfo } as ConnectionQualityInfo;
2292
+ const message = createBaseConnectionQualityInfo();
2486
2293
  while (reader.pos < end) {
2487
2294
  const tag = reader.uint32();
2488
2295
  switch (tag >>> 3) {
@@ -2504,23 +2311,15 @@ export const ConnectionQualityInfo = {
2504
2311
  },
2505
2312
 
2506
2313
  fromJSON(object: any): ConnectionQualityInfo {
2507
- const message = { ...baseConnectionQualityInfo } as ConnectionQualityInfo;
2508
- if (object.participantSid !== undefined && object.participantSid !== null) {
2509
- message.participantSid = String(object.participantSid);
2510
- } else {
2511
- message.participantSid = "";
2512
- }
2513
- if (object.quality !== undefined && object.quality !== null) {
2514
- message.quality = connectionQualityFromJSON(object.quality);
2515
- } else {
2516
- message.quality = 0;
2517
- }
2518
- if (object.score !== undefined && object.score !== null) {
2519
- message.score = Number(object.score);
2520
- } else {
2521
- message.score = 0;
2522
- }
2523
- return message;
2314
+ return {
2315
+ participantSid: isSet(object.participantSid)
2316
+ ? String(object.participantSid)
2317
+ : "",
2318
+ quality: isSet(object.quality)
2319
+ ? connectionQualityFromJSON(object.quality)
2320
+ : 0,
2321
+ score: isSet(object.score) ? Number(object.score) : 0,
2322
+ };
2524
2323
  },
2525
2324
 
2526
2325
  toJSON(message: ConnectionQualityInfo): unknown {
@@ -2533,10 +2332,10 @@ export const ConnectionQualityInfo = {
2533
2332
  return obj;
2534
2333
  },
2535
2334
 
2536
- fromPartial(
2537
- object: DeepPartial<ConnectionQualityInfo>
2335
+ fromPartial<I extends Exact<DeepPartial<ConnectionQualityInfo>, I>>(
2336
+ object: I
2538
2337
  ): ConnectionQualityInfo {
2539
- const message = { ...baseConnectionQualityInfo } as ConnectionQualityInfo;
2338
+ const message = createBaseConnectionQualityInfo();
2540
2339
  message.participantSid = object.participantSid ?? "";
2541
2340
  message.quality = object.quality ?? 0;
2542
2341
  message.score = object.score ?? 0;
@@ -2544,7 +2343,9 @@ export const ConnectionQualityInfo = {
2544
2343
  },
2545
2344
  };
2546
2345
 
2547
- const baseConnectionQualityUpdate: object = {};
2346
+ function createBaseConnectionQualityUpdate(): ConnectionQualityUpdate {
2347
+ return { updates: [] };
2348
+ }
2548
2349
 
2549
2350
  export const ConnectionQualityUpdate = {
2550
2351
  encode(
@@ -2563,10 +2364,7 @@ export const ConnectionQualityUpdate = {
2563
2364
  ): ConnectionQualityUpdate {
2564
2365
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2565
2366
  let end = length === undefined ? reader.len : reader.pos + length;
2566
- const message = {
2567
- ...baseConnectionQualityUpdate,
2568
- } as ConnectionQualityUpdate;
2569
- message.updates = [];
2367
+ const message = createBaseConnectionQualityUpdate();
2570
2368
  while (reader.pos < end) {
2571
2369
  const tag = reader.uint32();
2572
2370
  switch (tag >>> 3) {
@@ -2584,16 +2382,11 @@ export const ConnectionQualityUpdate = {
2584
2382
  },
2585
2383
 
2586
2384
  fromJSON(object: any): ConnectionQualityUpdate {
2587
- const message = {
2588
- ...baseConnectionQualityUpdate,
2589
- } as ConnectionQualityUpdate;
2590
- message.updates = [];
2591
- if (object.updates !== undefined && object.updates !== null) {
2592
- for (const e of object.updates) {
2593
- message.updates.push(ConnectionQualityInfo.fromJSON(e));
2594
- }
2595
- }
2596
- return message;
2385
+ return {
2386
+ updates: Array.isArray(object?.updates)
2387
+ ? object.updates.map((e: any) => ConnectionQualityInfo.fromJSON(e))
2388
+ : [],
2389
+ };
2597
2390
  },
2598
2391
 
2599
2392
  toJSON(message: ConnectionQualityUpdate): unknown {
@@ -2608,27 +2401,19 @@ export const ConnectionQualityUpdate = {
2608
2401
  return obj;
2609
2402
  },
2610
2403
 
2611
- fromPartial(
2612
- object: DeepPartial<ConnectionQualityUpdate>
2404
+ fromPartial<I extends Exact<DeepPartial<ConnectionQualityUpdate>, I>>(
2405
+ object: I
2613
2406
  ): ConnectionQualityUpdate {
2614
- const message = {
2615
- ...baseConnectionQualityUpdate,
2616
- } as ConnectionQualityUpdate;
2617
- message.updates = [];
2618
- if (object.updates !== undefined && object.updates !== null) {
2619
- for (const e of object.updates) {
2620
- message.updates.push(ConnectionQualityInfo.fromPartial(e));
2621
- }
2622
- }
2407
+ const message = createBaseConnectionQualityUpdate();
2408
+ message.updates =
2409
+ object.updates?.map((e) => ConnectionQualityInfo.fromPartial(e)) || [];
2623
2410
  return message;
2624
2411
  },
2625
2412
  };
2626
2413
 
2627
- const baseStreamStateInfo: object = {
2628
- participantSid: "",
2629
- trackSid: "",
2630
- state: 0,
2631
- };
2414
+ function createBaseStreamStateInfo(): StreamStateInfo {
2415
+ return { participantSid: "", trackSid: "", state: 0 };
2416
+ }
2632
2417
 
2633
2418
  export const StreamStateInfo = {
2634
2419
  encode(
@@ -2650,7 +2435,7 @@ export const StreamStateInfo = {
2650
2435
  decode(input: _m0.Reader | Uint8Array, length?: number): StreamStateInfo {
2651
2436
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2652
2437
  let end = length === undefined ? reader.len : reader.pos + length;
2653
- const message = { ...baseStreamStateInfo } as StreamStateInfo;
2438
+ const message = createBaseStreamStateInfo();
2654
2439
  while (reader.pos < end) {
2655
2440
  const tag = reader.uint32();
2656
2441
  switch (tag >>> 3) {
@@ -2672,23 +2457,13 @@ export const StreamStateInfo = {
2672
2457
  },
2673
2458
 
2674
2459
  fromJSON(object: any): StreamStateInfo {
2675
- const message = { ...baseStreamStateInfo } as StreamStateInfo;
2676
- if (object.participantSid !== undefined && object.participantSid !== null) {
2677
- message.participantSid = String(object.participantSid);
2678
- } else {
2679
- message.participantSid = "";
2680
- }
2681
- if (object.trackSid !== undefined && object.trackSid !== null) {
2682
- message.trackSid = String(object.trackSid);
2683
- } else {
2684
- message.trackSid = "";
2685
- }
2686
- if (object.state !== undefined && object.state !== null) {
2687
- message.state = streamStateFromJSON(object.state);
2688
- } else {
2689
- message.state = 0;
2690
- }
2691
- return message;
2460
+ return {
2461
+ participantSid: isSet(object.participantSid)
2462
+ ? String(object.participantSid)
2463
+ : "",
2464
+ trackSid: isSet(object.trackSid) ? String(object.trackSid) : "",
2465
+ state: isSet(object.state) ? streamStateFromJSON(object.state) : 0,
2466
+ };
2692
2467
  },
2693
2468
 
2694
2469
  toJSON(message: StreamStateInfo): unknown {
@@ -2701,8 +2476,10 @@ export const StreamStateInfo = {
2701
2476
  return obj;
2702
2477
  },
2703
2478
 
2704
- fromPartial(object: DeepPartial<StreamStateInfo>): StreamStateInfo {
2705
- const message = { ...baseStreamStateInfo } as StreamStateInfo;
2479
+ fromPartial<I extends Exact<DeepPartial<StreamStateInfo>, I>>(
2480
+ object: I
2481
+ ): StreamStateInfo {
2482
+ const message = createBaseStreamStateInfo();
2706
2483
  message.participantSid = object.participantSid ?? "";
2707
2484
  message.trackSid = object.trackSid ?? "";
2708
2485
  message.state = object.state ?? 0;
@@ -2710,7 +2487,9 @@ export const StreamStateInfo = {
2710
2487
  },
2711
2488
  };
2712
2489
 
2713
- const baseStreamStateUpdate: object = {};
2490
+ function createBaseStreamStateUpdate(): StreamStateUpdate {
2491
+ return { streamStates: [] };
2492
+ }
2714
2493
 
2715
2494
  export const StreamStateUpdate = {
2716
2495
  encode(
@@ -2726,8 +2505,7 @@ export const StreamStateUpdate = {
2726
2505
  decode(input: _m0.Reader | Uint8Array, length?: number): StreamStateUpdate {
2727
2506
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2728
2507
  let end = length === undefined ? reader.len : reader.pos + length;
2729
- const message = { ...baseStreamStateUpdate } as StreamStateUpdate;
2730
- message.streamStates = [];
2508
+ const message = createBaseStreamStateUpdate();
2731
2509
  while (reader.pos < end) {
2732
2510
  const tag = reader.uint32();
2733
2511
  switch (tag >>> 3) {
@@ -2745,14 +2523,11 @@ export const StreamStateUpdate = {
2745
2523
  },
2746
2524
 
2747
2525
  fromJSON(object: any): StreamStateUpdate {
2748
- const message = { ...baseStreamStateUpdate } as StreamStateUpdate;
2749
- message.streamStates = [];
2750
- if (object.streamStates !== undefined && object.streamStates !== null) {
2751
- for (const e of object.streamStates) {
2752
- message.streamStates.push(StreamStateInfo.fromJSON(e));
2753
- }
2754
- }
2755
- return message;
2526
+ return {
2527
+ streamStates: Array.isArray(object?.streamStates)
2528
+ ? object.streamStates.map((e: any) => StreamStateInfo.fromJSON(e))
2529
+ : [],
2530
+ };
2756
2531
  },
2757
2532
 
2758
2533
  toJSON(message: StreamStateUpdate): unknown {
@@ -2767,19 +2542,19 @@ export const StreamStateUpdate = {
2767
2542
  return obj;
2768
2543
  },
2769
2544
 
2770
- fromPartial(object: DeepPartial<StreamStateUpdate>): StreamStateUpdate {
2771
- const message = { ...baseStreamStateUpdate } as StreamStateUpdate;
2772
- message.streamStates = [];
2773
- if (object.streamStates !== undefined && object.streamStates !== null) {
2774
- for (const e of object.streamStates) {
2775
- message.streamStates.push(StreamStateInfo.fromPartial(e));
2776
- }
2777
- }
2545
+ fromPartial<I extends Exact<DeepPartial<StreamStateUpdate>, I>>(
2546
+ object: I
2547
+ ): StreamStateUpdate {
2548
+ const message = createBaseStreamStateUpdate();
2549
+ message.streamStates =
2550
+ object.streamStates?.map((e) => StreamStateInfo.fromPartial(e)) || [];
2778
2551
  return message;
2779
2552
  },
2780
2553
  };
2781
2554
 
2782
- const baseSubscribedQuality: object = { quality: 0, enabled: false };
2555
+ function createBaseSubscribedQuality(): SubscribedQuality {
2556
+ return { quality: 0, enabled: false };
2557
+ }
2783
2558
 
2784
2559
  export const SubscribedQuality = {
2785
2560
  encode(
@@ -2798,7 +2573,7 @@ export const SubscribedQuality = {
2798
2573
  decode(input: _m0.Reader | Uint8Array, length?: number): SubscribedQuality {
2799
2574
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2800
2575
  let end = length === undefined ? reader.len : reader.pos + length;
2801
- const message = { ...baseSubscribedQuality } as SubscribedQuality;
2576
+ const message = createBaseSubscribedQuality();
2802
2577
  while (reader.pos < end) {
2803
2578
  const tag = reader.uint32();
2804
2579
  switch (tag >>> 3) {
@@ -2817,18 +2592,10 @@ export const SubscribedQuality = {
2817
2592
  },
2818
2593
 
2819
2594
  fromJSON(object: any): SubscribedQuality {
2820
- const message = { ...baseSubscribedQuality } as SubscribedQuality;
2821
- if (object.quality !== undefined && object.quality !== null) {
2822
- message.quality = videoQualityFromJSON(object.quality);
2823
- } else {
2824
- message.quality = 0;
2825
- }
2826
- if (object.enabled !== undefined && object.enabled !== null) {
2827
- message.enabled = Boolean(object.enabled);
2828
- } else {
2829
- message.enabled = false;
2830
- }
2831
- return message;
2595
+ return {
2596
+ quality: isSet(object.quality) ? videoQualityFromJSON(object.quality) : 0,
2597
+ enabled: isSet(object.enabled) ? Boolean(object.enabled) : false,
2598
+ };
2832
2599
  },
2833
2600
 
2834
2601
  toJSON(message: SubscribedQuality): unknown {
@@ -2839,15 +2606,19 @@ export const SubscribedQuality = {
2839
2606
  return obj;
2840
2607
  },
2841
2608
 
2842
- fromPartial(object: DeepPartial<SubscribedQuality>): SubscribedQuality {
2843
- const message = { ...baseSubscribedQuality } as SubscribedQuality;
2609
+ fromPartial<I extends Exact<DeepPartial<SubscribedQuality>, I>>(
2610
+ object: I
2611
+ ): SubscribedQuality {
2612
+ const message = createBaseSubscribedQuality();
2844
2613
  message.quality = object.quality ?? 0;
2845
2614
  message.enabled = object.enabled ?? false;
2846
2615
  return message;
2847
2616
  },
2848
2617
  };
2849
2618
 
2850
- const baseSubscribedQualityUpdate: object = { trackSid: "" };
2619
+ function createBaseSubscribedQualityUpdate(): SubscribedQualityUpdate {
2620
+ return { trackSid: "", subscribedQualities: [] };
2621
+ }
2851
2622
 
2852
2623
  export const SubscribedQualityUpdate = {
2853
2624
  encode(
@@ -2869,10 +2640,7 @@ export const SubscribedQualityUpdate = {
2869
2640
  ): SubscribedQualityUpdate {
2870
2641
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2871
2642
  let end = length === undefined ? reader.len : reader.pos + length;
2872
- const message = {
2873
- ...baseSubscribedQualityUpdate,
2874
- } as SubscribedQualityUpdate;
2875
- message.subscribedQualities = [];
2643
+ const message = createBaseSubscribedQualityUpdate();
2876
2644
  while (reader.pos < end) {
2877
2645
  const tag = reader.uint32();
2878
2646
  switch (tag >>> 3) {
@@ -2893,24 +2661,14 @@ export const SubscribedQualityUpdate = {
2893
2661
  },
2894
2662
 
2895
2663
  fromJSON(object: any): SubscribedQualityUpdate {
2896
- const message = {
2897
- ...baseSubscribedQualityUpdate,
2898
- } as SubscribedQualityUpdate;
2899
- message.subscribedQualities = [];
2900
- if (object.trackSid !== undefined && object.trackSid !== null) {
2901
- message.trackSid = String(object.trackSid);
2902
- } else {
2903
- message.trackSid = "";
2904
- }
2905
- if (
2906
- object.subscribedQualities !== undefined &&
2907
- object.subscribedQualities !== null
2908
- ) {
2909
- for (const e of object.subscribedQualities) {
2910
- message.subscribedQualities.push(SubscribedQuality.fromJSON(e));
2911
- }
2912
- }
2913
- return message;
2664
+ return {
2665
+ trackSid: isSet(object.trackSid) ? String(object.trackSid) : "",
2666
+ subscribedQualities: Array.isArray(object?.subscribedQualities)
2667
+ ? object.subscribedQualities.map((e: any) =>
2668
+ SubscribedQuality.fromJSON(e)
2669
+ )
2670
+ : [],
2671
+ };
2914
2672
  },
2915
2673
 
2916
2674
  toJSON(message: SubscribedQualityUpdate): unknown {
@@ -2926,31 +2684,22 @@ export const SubscribedQualityUpdate = {
2926
2684
  return obj;
2927
2685
  },
2928
2686
 
2929
- fromPartial(
2930
- object: DeepPartial<SubscribedQualityUpdate>
2687
+ fromPartial<I extends Exact<DeepPartial<SubscribedQualityUpdate>, I>>(
2688
+ object: I
2931
2689
  ): SubscribedQualityUpdate {
2932
- const message = {
2933
- ...baseSubscribedQualityUpdate,
2934
- } as SubscribedQualityUpdate;
2690
+ const message = createBaseSubscribedQualityUpdate();
2935
2691
  message.trackSid = object.trackSid ?? "";
2936
- message.subscribedQualities = [];
2937
- if (
2938
- object.subscribedQualities !== undefined &&
2939
- object.subscribedQualities !== null
2940
- ) {
2941
- for (const e of object.subscribedQualities) {
2942
- message.subscribedQualities.push(SubscribedQuality.fromPartial(e));
2943
- }
2944
- }
2692
+ message.subscribedQualities =
2693
+ object.subscribedQualities?.map((e) =>
2694
+ SubscribedQuality.fromPartial(e)
2695
+ ) || [];
2945
2696
  return message;
2946
2697
  },
2947
2698
  };
2948
2699
 
2949
- const baseTrackPermission: object = {
2950
- participantSid: "",
2951
- allTracks: false,
2952
- trackSids: "",
2953
- };
2700
+ function createBaseTrackPermission(): TrackPermission {
2701
+ return { participantSid: "", allTracks: false, trackSids: [] };
2702
+ }
2954
2703
 
2955
2704
  export const TrackPermission = {
2956
2705
  encode(
@@ -2972,8 +2721,7 @@ export const TrackPermission = {
2972
2721
  decode(input: _m0.Reader | Uint8Array, length?: number): TrackPermission {
2973
2722
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2974
2723
  let end = length === undefined ? reader.len : reader.pos + length;
2975
- const message = { ...baseTrackPermission } as TrackPermission;
2976
- message.trackSids = [];
2724
+ const message = createBaseTrackPermission();
2977
2725
  while (reader.pos < end) {
2978
2726
  const tag = reader.uint32();
2979
2727
  switch (tag >>> 3) {
@@ -2995,24 +2743,15 @@ export const TrackPermission = {
2995
2743
  },
2996
2744
 
2997
2745
  fromJSON(object: any): TrackPermission {
2998
- const message = { ...baseTrackPermission } as TrackPermission;
2999
- message.trackSids = [];
3000
- if (object.participantSid !== undefined && object.participantSid !== null) {
3001
- message.participantSid = String(object.participantSid);
3002
- } else {
3003
- message.participantSid = "";
3004
- }
3005
- if (object.allTracks !== undefined && object.allTracks !== null) {
3006
- message.allTracks = Boolean(object.allTracks);
3007
- } else {
3008
- message.allTracks = false;
3009
- }
3010
- if (object.trackSids !== undefined && object.trackSids !== null) {
3011
- for (const e of object.trackSids) {
3012
- message.trackSids.push(String(e));
3013
- }
3014
- }
3015
- return message;
2746
+ return {
2747
+ participantSid: isSet(object.participantSid)
2748
+ ? String(object.participantSid)
2749
+ : "",
2750
+ allTracks: isSet(object.allTracks) ? Boolean(object.allTracks) : false,
2751
+ trackSids: Array.isArray(object?.trackSids)
2752
+ ? object.trackSids.map((e: any) => String(e))
2753
+ : [],
2754
+ };
3016
2755
  },
3017
2756
 
3018
2757
  toJSON(message: TrackPermission): unknown {
@@ -3028,21 +2767,20 @@ export const TrackPermission = {
3028
2767
  return obj;
3029
2768
  },
3030
2769
 
3031
- fromPartial(object: DeepPartial<TrackPermission>): TrackPermission {
3032
- const message = { ...baseTrackPermission } as TrackPermission;
2770
+ fromPartial<I extends Exact<DeepPartial<TrackPermission>, I>>(
2771
+ object: I
2772
+ ): TrackPermission {
2773
+ const message = createBaseTrackPermission();
3033
2774
  message.participantSid = object.participantSid ?? "";
3034
2775
  message.allTracks = object.allTracks ?? false;
3035
- message.trackSids = [];
3036
- if (object.trackSids !== undefined && object.trackSids !== null) {
3037
- for (const e of object.trackSids) {
3038
- message.trackSids.push(e);
3039
- }
3040
- }
2776
+ message.trackSids = object.trackSids?.map((e) => e) || [];
3041
2777
  return message;
3042
2778
  },
3043
2779
  };
3044
2780
 
3045
- const baseSubscriptionPermission: object = { allParticipants: false };
2781
+ function createBaseSubscriptionPermission(): SubscriptionPermission {
2782
+ return { allParticipants: false, trackPermissions: [] };
2783
+ }
3046
2784
 
3047
2785
  export const SubscriptionPermission = {
3048
2786
  encode(
@@ -3064,8 +2802,7 @@ export const SubscriptionPermission = {
3064
2802
  ): SubscriptionPermission {
3065
2803
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3066
2804
  let end = length === undefined ? reader.len : reader.pos + length;
3067
- const message = { ...baseSubscriptionPermission } as SubscriptionPermission;
3068
- message.trackPermissions = [];
2805
+ const message = createBaseSubscriptionPermission();
3069
2806
  while (reader.pos < end) {
3070
2807
  const tag = reader.uint32();
3071
2808
  switch (tag >>> 3) {
@@ -3086,25 +2823,14 @@ export const SubscriptionPermission = {
3086
2823
  },
3087
2824
 
3088
2825
  fromJSON(object: any): SubscriptionPermission {
3089
- const message = { ...baseSubscriptionPermission } as SubscriptionPermission;
3090
- message.trackPermissions = [];
3091
- if (
3092
- object.allParticipants !== undefined &&
3093
- object.allParticipants !== null
3094
- ) {
3095
- message.allParticipants = Boolean(object.allParticipants);
3096
- } else {
3097
- message.allParticipants = false;
3098
- }
3099
- if (
3100
- object.trackPermissions !== undefined &&
3101
- object.trackPermissions !== null
3102
- ) {
3103
- for (const e of object.trackPermissions) {
3104
- message.trackPermissions.push(TrackPermission.fromJSON(e));
3105
- }
3106
- }
3107
- return message;
2826
+ return {
2827
+ allParticipants: isSet(object.allParticipants)
2828
+ ? Boolean(object.allParticipants)
2829
+ : false,
2830
+ trackPermissions: Array.isArray(object?.trackPermissions)
2831
+ ? object.trackPermissions.map((e: any) => TrackPermission.fromJSON(e))
2832
+ : [],
2833
+ };
3108
2834
  },
3109
2835
 
3110
2836
  toJSON(message: SubscriptionPermission): unknown {
@@ -3121,29 +2847,20 @@ export const SubscriptionPermission = {
3121
2847
  return obj;
3122
2848
  },
3123
2849
 
3124
- fromPartial(
3125
- object: DeepPartial<SubscriptionPermission>
2850
+ fromPartial<I extends Exact<DeepPartial<SubscriptionPermission>, I>>(
2851
+ object: I
3126
2852
  ): SubscriptionPermission {
3127
- const message = { ...baseSubscriptionPermission } as SubscriptionPermission;
2853
+ const message = createBaseSubscriptionPermission();
3128
2854
  message.allParticipants = object.allParticipants ?? false;
3129
- message.trackPermissions = [];
3130
- if (
3131
- object.trackPermissions !== undefined &&
3132
- object.trackPermissions !== null
3133
- ) {
3134
- for (const e of object.trackPermissions) {
3135
- message.trackPermissions.push(TrackPermission.fromPartial(e));
3136
- }
3137
- }
2855
+ message.trackPermissions =
2856
+ object.trackPermissions?.map((e) => TrackPermission.fromPartial(e)) || [];
3138
2857
  return message;
3139
2858
  },
3140
2859
  };
3141
2860
 
3142
- const baseSubscriptionPermissionUpdate: object = {
3143
- participantSid: "",
3144
- trackSid: "",
3145
- allowed: false,
3146
- };
2861
+ function createBaseSubscriptionPermissionUpdate(): SubscriptionPermissionUpdate {
2862
+ return { participantSid: "", trackSid: "", allowed: false };
2863
+ }
3147
2864
 
3148
2865
  export const SubscriptionPermissionUpdate = {
3149
2866
  encode(
@@ -3168,9 +2885,7 @@ export const SubscriptionPermissionUpdate = {
3168
2885
  ): SubscriptionPermissionUpdate {
3169
2886
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3170
2887
  let end = length === undefined ? reader.len : reader.pos + length;
3171
- const message = {
3172
- ...baseSubscriptionPermissionUpdate,
3173
- } as SubscriptionPermissionUpdate;
2888
+ const message = createBaseSubscriptionPermissionUpdate();
3174
2889
  while (reader.pos < end) {
3175
2890
  const tag = reader.uint32();
3176
2891
  switch (tag >>> 3) {
@@ -3192,25 +2907,13 @@ export const SubscriptionPermissionUpdate = {
3192
2907
  },
3193
2908
 
3194
2909
  fromJSON(object: any): SubscriptionPermissionUpdate {
3195
- const message = {
3196
- ...baseSubscriptionPermissionUpdate,
3197
- } as SubscriptionPermissionUpdate;
3198
- if (object.participantSid !== undefined && object.participantSid !== null) {
3199
- message.participantSid = String(object.participantSid);
3200
- } else {
3201
- message.participantSid = "";
3202
- }
3203
- if (object.trackSid !== undefined && object.trackSid !== null) {
3204
- message.trackSid = String(object.trackSid);
3205
- } else {
3206
- message.trackSid = "";
3207
- }
3208
- if (object.allowed !== undefined && object.allowed !== null) {
3209
- message.allowed = Boolean(object.allowed);
3210
- } else {
3211
- message.allowed = false;
3212
- }
3213
- return message;
2910
+ return {
2911
+ participantSid: isSet(object.participantSid)
2912
+ ? String(object.participantSid)
2913
+ : "",
2914
+ trackSid: isSet(object.trackSid) ? String(object.trackSid) : "",
2915
+ allowed: isSet(object.allowed) ? Boolean(object.allowed) : false,
2916
+ };
3214
2917
  },
3215
2918
 
3216
2919
  toJSON(message: SubscriptionPermissionUpdate): unknown {
@@ -3222,12 +2925,10 @@ export const SubscriptionPermissionUpdate = {
3222
2925
  return obj;
3223
2926
  },
3224
2927
 
3225
- fromPartial(
3226
- object: DeepPartial<SubscriptionPermissionUpdate>
2928
+ fromPartial<I extends Exact<DeepPartial<SubscriptionPermissionUpdate>, I>>(
2929
+ object: I
3227
2930
  ): SubscriptionPermissionUpdate {
3228
- const message = {
3229
- ...baseSubscriptionPermissionUpdate,
3230
- } as SubscriptionPermissionUpdate;
2931
+ const message = createBaseSubscriptionPermissionUpdate();
3231
2932
  message.participantSid = object.participantSid ?? "";
3232
2933
  message.trackSid = object.trackSid ?? "";
3233
2934
  message.allowed = object.allowed ?? false;
@@ -3235,7 +2936,14 @@ export const SubscriptionPermissionUpdate = {
3235
2936
  },
3236
2937
  };
3237
2938
 
3238
- const baseSyncState: object = {};
2939
+ function createBaseSyncState(): SyncState {
2940
+ return {
2941
+ answer: undefined,
2942
+ subscription: undefined,
2943
+ publishTracks: [],
2944
+ dataChannels: [],
2945
+ };
2946
+ }
3239
2947
 
3240
2948
  export const SyncState = {
3241
2949
  encode(
@@ -3266,9 +2974,7 @@ export const SyncState = {
3266
2974
  decode(input: _m0.Reader | Uint8Array, length?: number): SyncState {
3267
2975
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3268
2976
  let end = length === undefined ? reader.len : reader.pos + length;
3269
- const message = { ...baseSyncState } as SyncState;
3270
- message.publishTracks = [];
3271
- message.dataChannels = [];
2977
+ const message = createBaseSyncState();
3272
2978
  while (reader.pos < end) {
3273
2979
  const tag = reader.uint32();
3274
2980
  switch (tag >>> 3) {
@@ -3300,30 +3006,22 @@ export const SyncState = {
3300
3006
  },
3301
3007
 
3302
3008
  fromJSON(object: any): SyncState {
3303
- const message = { ...baseSyncState } as SyncState;
3304
- message.publishTracks = [];
3305
- message.dataChannels = [];
3306
- if (object.answer !== undefined && object.answer !== null) {
3307
- message.answer = SessionDescription.fromJSON(object.answer);
3308
- } else {
3309
- message.answer = undefined;
3310
- }
3311
- if (object.subscription !== undefined && object.subscription !== null) {
3312
- message.subscription = UpdateSubscription.fromJSON(object.subscription);
3313
- } else {
3314
- message.subscription = undefined;
3315
- }
3316
- if (object.publishTracks !== undefined && object.publishTracks !== null) {
3317
- for (const e of object.publishTracks) {
3318
- message.publishTracks.push(TrackPublishedResponse.fromJSON(e));
3319
- }
3320
- }
3321
- if (object.dataChannels !== undefined && object.dataChannels !== null) {
3322
- for (const e of object.dataChannels) {
3323
- message.dataChannels.push(DataChannelInfo.fromJSON(e));
3324
- }
3325
- }
3326
- return message;
3009
+ return {
3010
+ answer: isSet(object.answer)
3011
+ ? SessionDescription.fromJSON(object.answer)
3012
+ : undefined,
3013
+ subscription: isSet(object.subscription)
3014
+ ? UpdateSubscription.fromJSON(object.subscription)
3015
+ : undefined,
3016
+ publishTracks: Array.isArray(object?.publishTracks)
3017
+ ? object.publishTracks.map((e: any) =>
3018
+ TrackPublishedResponse.fromJSON(e)
3019
+ )
3020
+ : [],
3021
+ dataChannels: Array.isArray(object?.dataChannels)
3022
+ ? object.dataChannels.map((e: any) => DataChannelInfo.fromJSON(e))
3023
+ : [],
3024
+ };
3327
3025
  },
3328
3026
 
3329
3027
  toJSON(message: SyncState): unknown {
@@ -3353,37 +3051,30 @@ export const SyncState = {
3353
3051
  return obj;
3354
3052
  },
3355
3053
 
3356
- fromPartial(object: DeepPartial<SyncState>): SyncState {
3357
- const message = { ...baseSyncState } as SyncState;
3358
- if (object.answer !== undefined && object.answer !== null) {
3359
- message.answer = SessionDescription.fromPartial(object.answer);
3360
- } else {
3361
- message.answer = undefined;
3362
- }
3363
- if (object.subscription !== undefined && object.subscription !== null) {
3364
- message.subscription = UpdateSubscription.fromPartial(
3365
- object.subscription
3366
- );
3367
- } else {
3368
- message.subscription = undefined;
3369
- }
3370
- message.publishTracks = [];
3371
- if (object.publishTracks !== undefined && object.publishTracks !== null) {
3372
- for (const e of object.publishTracks) {
3373
- message.publishTracks.push(TrackPublishedResponse.fromPartial(e));
3374
- }
3375
- }
3376
- message.dataChannels = [];
3377
- if (object.dataChannels !== undefined && object.dataChannels !== null) {
3378
- for (const e of object.dataChannels) {
3379
- message.dataChannels.push(DataChannelInfo.fromPartial(e));
3380
- }
3381
- }
3054
+ fromPartial<I extends Exact<DeepPartial<SyncState>, I>>(
3055
+ object: I
3056
+ ): SyncState {
3057
+ const message = createBaseSyncState();
3058
+ message.answer =
3059
+ object.answer !== undefined && object.answer !== null
3060
+ ? SessionDescription.fromPartial(object.answer)
3061
+ : undefined;
3062
+ message.subscription =
3063
+ object.subscription !== undefined && object.subscription !== null
3064
+ ? UpdateSubscription.fromPartial(object.subscription)
3065
+ : undefined;
3066
+ message.publishTracks =
3067
+ object.publishTracks?.map((e) => TrackPublishedResponse.fromPartial(e)) ||
3068
+ [];
3069
+ message.dataChannels =
3070
+ object.dataChannels?.map((e) => DataChannelInfo.fromPartial(e)) || [];
3382
3071
  return message;
3383
3072
  },
3384
3073
  };
3385
3074
 
3386
- const baseDataChannelInfo: object = { label: "", id: 0 };
3075
+ function createBaseDataChannelInfo(): DataChannelInfo {
3076
+ return { label: "", id: 0 };
3077
+ }
3387
3078
 
3388
3079
  export const DataChannelInfo = {
3389
3080
  encode(
@@ -3402,7 +3093,7 @@ export const DataChannelInfo = {
3402
3093
  decode(input: _m0.Reader | Uint8Array, length?: number): DataChannelInfo {
3403
3094
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3404
3095
  let end = length === undefined ? reader.len : reader.pos + length;
3405
- const message = { ...baseDataChannelInfo } as DataChannelInfo;
3096
+ const message = createBaseDataChannelInfo();
3406
3097
  while (reader.pos < end) {
3407
3098
  const tag = reader.uint32();
3408
3099
  switch (tag >>> 3) {
@@ -3421,36 +3112,37 @@ export const DataChannelInfo = {
3421
3112
  },
3422
3113
 
3423
3114
  fromJSON(object: any): DataChannelInfo {
3424
- const message = { ...baseDataChannelInfo } as DataChannelInfo;
3425
- if (object.label !== undefined && object.label !== null) {
3426
- message.label = String(object.label);
3427
- } else {
3428
- message.label = "";
3429
- }
3430
- if (object.id !== undefined && object.id !== null) {
3431
- message.id = Number(object.id);
3432
- } else {
3433
- message.id = 0;
3434
- }
3435
- return message;
3115
+ return {
3116
+ label: isSet(object.label) ? String(object.label) : "",
3117
+ id: isSet(object.id) ? Number(object.id) : 0,
3118
+ };
3436
3119
  },
3437
3120
 
3438
3121
  toJSON(message: DataChannelInfo): unknown {
3439
3122
  const obj: any = {};
3440
3123
  message.label !== undefined && (obj.label = message.label);
3441
- message.id !== undefined && (obj.id = message.id);
3124
+ message.id !== undefined && (obj.id = Math.round(message.id));
3442
3125
  return obj;
3443
3126
  },
3444
3127
 
3445
- fromPartial(object: DeepPartial<DataChannelInfo>): DataChannelInfo {
3446
- const message = { ...baseDataChannelInfo } as DataChannelInfo;
3128
+ fromPartial<I extends Exact<DeepPartial<DataChannelInfo>, I>>(
3129
+ object: I
3130
+ ): DataChannelInfo {
3131
+ const message = createBaseDataChannelInfo();
3447
3132
  message.label = object.label ?? "";
3448
3133
  message.id = object.id ?? 0;
3449
3134
  return message;
3450
3135
  },
3451
3136
  };
3452
3137
 
3453
- const baseSimulateScenario: object = {};
3138
+ function createBaseSimulateScenario(): SimulateScenario {
3139
+ return {
3140
+ speakerUpdate: undefined,
3141
+ nodeFailure: undefined,
3142
+ migration: undefined,
3143
+ serverLeave: undefined,
3144
+ };
3145
+ }
3454
3146
 
3455
3147
  export const SimulateScenario = {
3456
3148
  encode(
@@ -3475,7 +3167,7 @@ export const SimulateScenario = {
3475
3167
  decode(input: _m0.Reader | Uint8Array, length?: number): SimulateScenario {
3476
3168
  const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3477
3169
  let end = length === undefined ? reader.len : reader.pos + length;
3478
- const message = { ...baseSimulateScenario } as SimulateScenario;
3170
+ const message = createBaseSimulateScenario();
3479
3171
  while (reader.pos < end) {
3480
3172
  const tag = reader.uint32();
3481
3173
  switch (tag >>> 3) {
@@ -3500,34 +3192,26 @@ export const SimulateScenario = {
3500
3192
  },
3501
3193
 
3502
3194
  fromJSON(object: any): SimulateScenario {
3503
- const message = { ...baseSimulateScenario } as SimulateScenario;
3504
- if (object.speakerUpdate !== undefined && object.speakerUpdate !== null) {
3505
- message.speakerUpdate = Number(object.speakerUpdate);
3506
- } else {
3507
- message.speakerUpdate = undefined;
3508
- }
3509
- if (object.nodeFailure !== undefined && object.nodeFailure !== null) {
3510
- message.nodeFailure = Boolean(object.nodeFailure);
3511
- } else {
3512
- message.nodeFailure = undefined;
3513
- }
3514
- if (object.migration !== undefined && object.migration !== null) {
3515
- message.migration = Boolean(object.migration);
3516
- } else {
3517
- message.migration = undefined;
3518
- }
3519
- if (object.serverLeave !== undefined && object.serverLeave !== null) {
3520
- message.serverLeave = Boolean(object.serverLeave);
3521
- } else {
3522
- message.serverLeave = undefined;
3523
- }
3524
- return message;
3195
+ return {
3196
+ speakerUpdate: isSet(object.speakerUpdate)
3197
+ ? Number(object.speakerUpdate)
3198
+ : undefined,
3199
+ nodeFailure: isSet(object.nodeFailure)
3200
+ ? Boolean(object.nodeFailure)
3201
+ : undefined,
3202
+ migration: isSet(object.migration)
3203
+ ? Boolean(object.migration)
3204
+ : undefined,
3205
+ serverLeave: isSet(object.serverLeave)
3206
+ ? Boolean(object.serverLeave)
3207
+ : undefined,
3208
+ };
3525
3209
  },
3526
3210
 
3527
3211
  toJSON(message: SimulateScenario): unknown {
3528
3212
  const obj: any = {};
3529
3213
  message.speakerUpdate !== undefined &&
3530
- (obj.speakerUpdate = message.speakerUpdate);
3214
+ (obj.speakerUpdate = Math.round(message.speakerUpdate));
3531
3215
  message.nodeFailure !== undefined &&
3532
3216
  (obj.nodeFailure = message.nodeFailure);
3533
3217
  message.migration !== undefined && (obj.migration = message.migration);
@@ -3536,8 +3220,10 @@ export const SimulateScenario = {
3536
3220
  return obj;
3537
3221
  },
3538
3222
 
3539
- fromPartial(object: DeepPartial<SimulateScenario>): SimulateScenario {
3540
- const message = { ...baseSimulateScenario } as SimulateScenario;
3223
+ fromPartial<I extends Exact<DeepPartial<SimulateScenario>, I>>(
3224
+ object: I
3225
+ ): SimulateScenario {
3226
+ const message = createBaseSimulateScenario();
3541
3227
  message.speakerUpdate = object.speakerUpdate ?? undefined;
3542
3228
  message.nodeFailure = object.nodeFailure ?? undefined;
3543
3229
  message.migration = object.migration ?? undefined;
@@ -3554,6 +3240,7 @@ type Builtin =
3554
3240
  | number
3555
3241
  | boolean
3556
3242
  | undefined;
3243
+
3557
3244
  export type DeepPartial<T> = T extends Builtin
3558
3245
  ? T
3559
3246
  : T extends Array<infer U>
@@ -3564,7 +3251,19 @@ export type DeepPartial<T> = T extends Builtin
3564
3251
  ? { [K in keyof T]?: DeepPartial<T[K]> }
3565
3252
  : Partial<T>;
3566
3253
 
3254
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
3255
+ export type Exact<P, I extends P> = P extends Builtin
3256
+ ? P
3257
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & Record<
3258
+ Exclude<keyof I, KeysOfUnion<P>>,
3259
+ never
3260
+ >;
3261
+
3567
3262
  if (_m0.util.Long !== Long) {
3568
3263
  _m0.util.Long = Long as any;
3569
3264
  _m0.configure();
3570
3265
  }
3266
+
3267
+ function isSet(value: any): boolean {
3268
+ return value !== null && value !== undefined;
3269
+ }