livekit-server-sdk 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "protocol"]
2
+ path = protocol
3
+ url = https://github.com/livekit/protocol
@@ -42,7 +42,13 @@ export declare class RoomServiceClient {
42
42
  * @param options
43
43
  */
44
44
  createRoom(options: CreateOptions): Promise<Room>;
45
- listRooms(): Promise<Room[]>;
45
+ /**
46
+ * List active rooms
47
+ * @param names when undefined or empty, list all rooms.
48
+ * otherwise returns rooms with matching names
49
+ * @returns
50
+ */
51
+ listRooms(names?: string[]): Promise<Room[]>;
46
52
  deleteRoom(room: string): Promise<void>;
47
53
  /**
48
54
  * Update metadata of a room
@@ -42,9 +42,15 @@ class RoomServiceClient {
42
42
  return livekit_models_1.Room.fromJSON(data);
43
43
  });
44
44
  }
45
- listRooms() {
45
+ /**
46
+ * List active rooms
47
+ * @param names when undefined or empty, list all rooms.
48
+ * otherwise returns rooms with matching names
49
+ * @returns
50
+ */
51
+ listRooms(names) {
46
52
  return __awaiter(this, void 0, void 0, function* () {
47
- const data = yield this.rpc.request(svc, 'ListRooms', livekit_room_1.ListRoomsRequest.toJSON({}), this.authHeader({ roomList: true }));
53
+ const data = yield this.rpc.request(svc, 'ListRooms', livekit_room_1.ListRoomsRequest.toJSON({ names: names !== null && names !== void 0 ? names : [] }), this.authHeader({ roomList: true }));
48
54
  const res = livekit_room_1.ListRoomsResponse.fromJSON(data);
49
55
  return res.rooms;
50
56
  });
@@ -153,6 +159,7 @@ class RoomServiceClient {
153
159
  identity,
154
160
  trackSids,
155
161
  subscribe,
162
+ participantTracks: [],
156
163
  });
157
164
  yield this.rpc.request(svc, 'UpdateSubscriptions', req, this.authHeader({ roomAdmin: true, room }));
158
165
  });
@@ -1 +1 @@
1
- {"version":3,"file":"RoomServiceClient.js","sourceRoot":"","sources":["../src/RoomServiceClient.ts"],"names":[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;QACnB,OAAO;YACL,aAAa,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;SACtC,CAAC;IACJ,CAAC;CACF;AAtPD,8CAsPC"}
@@ -3,5 +3,12 @@ export declare const authorizeHeader = "Authorize";
3
3
  export declare class WebhookReceiver {
4
4
  private verifier;
5
5
  constructor(apiKey: string, apiSecret: string);
6
+ /**
7
+ *
8
+ * @param body string of the posted body
9
+ * @param authHeader `Authorization` header from the request
10
+ * @param skipAuth true to skip auth validation
11
+ * @returns
12
+ */
6
13
  receive(body: string, authHeader?: string, skipAuth?: boolean): WebhookEvent;
7
14
  }
@@ -12,6 +12,13 @@ class WebhookReceiver {
12
12
  constructor(apiKey, apiSecret) {
13
13
  this.verifier = new AccessToken_1.TokenVerifier(apiKey, apiSecret);
14
14
  }
15
+ /**
16
+ *
17
+ * @param body string of the posted body
18
+ * @param authHeader `Authorization` header from the request
19
+ * @param skipAuth true to skip auth validation
20
+ * @returns
21
+ */
15
22
  receive(body, authHeader, skipAuth = false) {
16
23
  // verify token
17
24
  if (!skipAuth) {
@@ -1 +1 @@
1
- {"version":3,"file":"WebhookReceiver.js","sourceRoot":"","sources":["../src/WebhookReceiver.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,+CAA8C;AAC9C,6DAAuD;AAE1C,QAAA,eAAe,GAAG,WAAW,CAAC;AAE3C,MAAa,eAAe;IAG1B,YAAY,MAAc,EAAE,SAAiB;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,2BAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,UAAmB,EAAE,WAAoB,KAAK;QAClE,eAAe;QACf,IAAI,CAAC,QAAQ,EAAE;YACb,IAAI,CAAC,UAAU,EAAE;gBACf,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;aAClD;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,U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,CAAC,wCAAwC,CAAC,CAAC;aAC3D;SACF;QAED,OAAO,8BAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC;CACF;AAhCD,0CAgCC"}
@@ -18,6 +18,14 @@ export declare enum TrackSource {
18
18
  }
19
19
  export declare function trackSourceFromJSON(object: any): TrackSource;
20
20
  export declare function trackSourceToJSON(object: TrackSource): string;
21
+ export declare enum VideoQuality {
22
+ LOW = 0,
23
+ MEDIUM = 1,
24
+ HIGH = 2,
25
+ UNRECOGNIZED = -1
26
+ }
27
+ export declare function videoQualityFromJSON(object: any): VideoQuality;
28
+ export declare function videoQualityToJSON(object: VideoQuality): string;
21
29
  export declare enum ConnectionQuality {
22
30
  POOR = 0,
23
31
  GOOD = 1,
@@ -52,6 +60,7 @@ export interface ParticipantInfo {
52
60
  joinedAt: number;
53
61
  hidden: boolean;
54
62
  recorder: boolean;
63
+ name: string;
55
64
  }
56
65
  export declare enum ParticipantInfo_State {
57
66
  /** JOINING - websocket' connected, but not offered yet */
@@ -84,6 +93,18 @@ export interface TrackInfo {
84
93
  disableDtx: boolean;
85
94
  /** source of media */
86
95
  source: TrackSource;
96
+ layers: VideoLayer[];
97
+ /** mime type of codec */
98
+ mimeType: string;
99
+ }
100
+ /** provide information about available spatial layers */
101
+ export interface VideoLayer {
102
+ /** for tracks with a single layer, this should be HIGH */
103
+ quality: VideoQuality;
104
+ width: number;
105
+ height: number;
106
+ /** target bitrate, server will measure actual */
107
+ bitrate: number;
87
108
  }
88
109
  /** new DataPacket API */
89
110
  export interface DataPacket {
@@ -116,6 +137,11 @@ export interface UserPacket {
116
137
  /** the ID of the participants who will receive the message (the message will be sent to all the people in the room if this variable is empty) */
117
138
  destinationSids: string[];
118
139
  }
140
+ export interface ParticipantTracks {
141
+ /** participant ID of participant to whom the tracks belong */
142
+ participantSid: string;
143
+ trackSids: string[];
144
+ }
119
145
  export declare const Room: {
120
146
  encode(message: Room, writer?: _m0.Writer): _m0.Writer;
121
147
  decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Room;
@@ -144,6 +170,13 @@ export declare const TrackInfo: {
144
170
  toJSON(message: TrackInfo): unknown;
145
171
  fromPartial(object: DeepPartial<TrackInfo>): TrackInfo;
146
172
  };
173
+ export declare const VideoLayer: {
174
+ encode(message: VideoLayer, writer?: _m0.Writer): _m0.Writer;
175
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): VideoLayer;
176
+ fromJSON(object: any): VideoLayer;
177
+ toJSON(message: VideoLayer): unknown;
178
+ fromPartial(object: DeepPartial<VideoLayer>): VideoLayer;
179
+ };
147
180
  export declare const DataPacket: {
148
181
  encode(message: DataPacket, writer?: _m0.Writer): _m0.Writer;
149
182
  decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DataPacket;
@@ -172,6 +205,13 @@ export declare const UserPacket: {
172
205
  toJSON(message: UserPacket): unknown;
173
206
  fromPartial(object: DeepPartial<UserPacket>): UserPacket;
174
207
  };
208
+ export declare const ParticipantTracks: {
209
+ encode(message: ParticipantTracks, writer?: _m0.Writer): _m0.Writer;
210
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ParticipantTracks;
211
+ fromJSON(object: any): ParticipantTracks;
212
+ toJSON(message: ParticipantTracks): unknown;
213
+ fromPartial(object: DeepPartial<ParticipantTracks>): ParticipantTracks;
214
+ };
175
215
  declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
176
216
  export declare type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
177
217
  [K in keyof T]?: DeepPartial<T[K]>;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UserPacket = exports.SpeakerInfo = exports.ActiveSpeakerUpdate = exports.DataPacket = exports.TrackInfo = exports.ParticipantInfo = exports.Codec = exports.Room = exports.dataPacket_KindToJSON = exports.dataPacket_KindFromJSON = exports.DataPacket_Kind = exports.participantInfo_StateToJSON = exports.participantInfo_StateFromJSON = exports.ParticipantInfo_State = exports.connectionQualityToJSON = exports.connectionQualityFromJSON = exports.ConnectionQuality = exports.trackSourceToJSON = exports.trackSourceFromJSON = exports.TrackSource = exports.trackTypeToJSON = exports.trackTypeFromJSON = exports.TrackType = exports.protobufPackage = void 0;
6
+ exports.ParticipantTracks = exports.UserPacket = exports.SpeakerInfo = exports.ActiveSpeakerUpdate = exports.DataPacket = exports.VideoLayer = exports.TrackInfo = exports.ParticipantInfo = exports.Codec = exports.Room = exports.dataPacket_KindToJSON = exports.dataPacket_KindFromJSON = exports.DataPacket_Kind = exports.participantInfo_StateToJSON = exports.participantInfo_StateFromJSON = exports.ParticipantInfo_State = exports.connectionQualityToJSON = exports.connectionQualityFromJSON = exports.ConnectionQuality = exports.videoQualityToJSON = exports.videoQualityFromJSON = exports.VideoQuality = exports.trackSourceToJSON = exports.trackSourceFromJSON = exports.TrackSource = exports.trackTypeToJSON = exports.trackTypeFromJSON = exports.TrackType = exports.protobufPackage = void 0;
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
@@ -96,6 +96,44 @@ function trackSourceToJSON(object) {
96
96
  }
97
97
  }
98
98
  exports.trackSourceToJSON = trackSourceToJSON;
99
+ var VideoQuality;
100
+ (function (VideoQuality) {
101
+ VideoQuality[VideoQuality["LOW"] = 0] = "LOW";
102
+ VideoQuality[VideoQuality["MEDIUM"] = 1] = "MEDIUM";
103
+ VideoQuality[VideoQuality["HIGH"] = 2] = "HIGH";
104
+ VideoQuality[VideoQuality["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
105
+ })(VideoQuality = exports.VideoQuality || (exports.VideoQuality = {}));
106
+ function videoQualityFromJSON(object) {
107
+ switch (object) {
108
+ case 0:
109
+ case "LOW":
110
+ return VideoQuality.LOW;
111
+ case 1:
112
+ case "MEDIUM":
113
+ return VideoQuality.MEDIUM;
114
+ case 2:
115
+ case "HIGH":
116
+ return VideoQuality.HIGH;
117
+ case -1:
118
+ case "UNRECOGNIZED":
119
+ default:
120
+ return VideoQuality.UNRECOGNIZED;
121
+ }
122
+ }
123
+ exports.videoQualityFromJSON = videoQualityFromJSON;
124
+ function videoQualityToJSON(object) {
125
+ switch (object) {
126
+ case VideoQuality.LOW:
127
+ return "LOW";
128
+ case VideoQuality.MEDIUM:
129
+ return "MEDIUM";
130
+ case VideoQuality.HIGH:
131
+ return "HIGH";
132
+ default:
133
+ return "UNKNOWN";
134
+ }
135
+ }
136
+ exports.videoQualityToJSON = videoQualityToJSON;
99
137
  var ConnectionQuality;
100
138
  (function (ConnectionQuality) {
101
139
  ConnectionQuality[ConnectionQuality["POOR"] = 0] = "POOR";
@@ -542,6 +580,7 @@ const baseParticipantInfo = {
542
580
  joinedAt: 0,
543
581
  hidden: false,
544
582
  recorder: false,
583
+ name: "",
545
584
  };
546
585
  exports.ParticipantInfo = {
547
586
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -569,6 +608,9 @@ exports.ParticipantInfo = {
569
608
  if (message.recorder === true) {
570
609
  writer.uint32(64).bool(message.recorder);
571
610
  }
611
+ if (message.name !== "") {
612
+ writer.uint32(74).string(message.name);
613
+ }
572
614
  return writer;
573
615
  },
574
616
  decode(input, length) {
@@ -603,6 +645,9 @@ exports.ParticipantInfo = {
603
645
  case 8:
604
646
  message.recorder = reader.bool();
605
647
  break;
648
+ case 9:
649
+ message.name = reader.string();
650
+ break;
606
651
  default:
607
652
  reader.skipType(tag & 7);
608
653
  break;
@@ -660,6 +705,12 @@ exports.ParticipantInfo = {
660
705
  else {
661
706
  message.recorder = false;
662
707
  }
708
+ if (object.name !== undefined && object.name !== null) {
709
+ message.name = String(object.name);
710
+ }
711
+ else {
712
+ message.name = "";
713
+ }
663
714
  return message;
664
715
  },
665
716
  toJSON(message) {
@@ -678,6 +729,7 @@ exports.ParticipantInfo = {
678
729
  message.joinedAt !== undefined && (obj.joinedAt = message.joinedAt);
679
730
  message.hidden !== undefined && (obj.hidden = message.hidden);
680
731
  message.recorder !== undefined && (obj.recorder = message.recorder);
732
+ message.name !== undefined && (obj.name = message.name);
681
733
  return obj;
682
734
  },
683
735
  fromPartial(object) {
@@ -730,6 +782,12 @@ exports.ParticipantInfo = {
730
782
  else {
731
783
  message.recorder = false;
732
784
  }
785
+ if (object.name !== undefined && object.name !== null) {
786
+ message.name = object.name;
787
+ }
788
+ else {
789
+ message.name = "";
790
+ }
733
791
  return message;
734
792
  },
735
793
  };
@@ -743,6 +801,7 @@ const baseTrackInfo = {
743
801
  simulcast: false,
744
802
  disableDtx: false,
745
803
  source: 0,
804
+ mimeType: "",
746
805
  };
747
806
  exports.TrackInfo = {
748
807
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -773,12 +832,19 @@ exports.TrackInfo = {
773
832
  if (message.source !== 0) {
774
833
  writer.uint32(72).int32(message.source);
775
834
  }
835
+ for (const v of message.layers) {
836
+ exports.VideoLayer.encode(v, writer.uint32(82).fork()).ldelim();
837
+ }
838
+ if (message.mimeType !== "") {
839
+ writer.uint32(90).string(message.mimeType);
840
+ }
776
841
  return writer;
777
842
  },
778
843
  decode(input, length) {
779
844
  const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
780
845
  let end = length === undefined ? reader.len : reader.pos + length;
781
846
  const message = Object.assign({}, baseTrackInfo);
847
+ message.layers = [];
782
848
  while (reader.pos < end) {
783
849
  const tag = reader.uint32();
784
850
  switch (tag >>> 3) {
@@ -809,6 +875,12 @@ exports.TrackInfo = {
809
875
  case 9:
810
876
  message.source = reader.int32();
811
877
  break;
878
+ case 10:
879
+ message.layers.push(exports.VideoLayer.decode(reader, reader.uint32()));
880
+ break;
881
+ case 11:
882
+ message.mimeType = reader.string();
883
+ break;
812
884
  default:
813
885
  reader.skipType(tag & 7);
814
886
  break;
@@ -818,6 +890,7 @@ exports.TrackInfo = {
818
890
  },
819
891
  fromJSON(object) {
820
892
  const message = Object.assign({}, baseTrackInfo);
893
+ message.layers = [];
821
894
  if (object.sid !== undefined && object.sid !== null) {
822
895
  message.sid = String(object.sid);
823
896
  }
@@ -872,6 +945,17 @@ exports.TrackInfo = {
872
945
  else {
873
946
  message.source = 0;
874
947
  }
948
+ if (object.layers !== undefined && object.layers !== null) {
949
+ for (const e of object.layers) {
950
+ message.layers.push(exports.VideoLayer.fromJSON(e));
951
+ }
952
+ }
953
+ if (object.mimeType !== undefined && object.mimeType !== null) {
954
+ message.mimeType = String(object.mimeType);
955
+ }
956
+ else {
957
+ message.mimeType = "";
958
+ }
875
959
  return message;
876
960
  },
877
961
  toJSON(message) {
@@ -886,10 +970,18 @@ exports.TrackInfo = {
886
970
  message.disableDtx !== undefined && (obj.disableDtx = message.disableDtx);
887
971
  message.source !== undefined &&
888
972
  (obj.source = trackSourceToJSON(message.source));
973
+ if (message.layers) {
974
+ obj.layers = message.layers.map((e) => e ? exports.VideoLayer.toJSON(e) : undefined);
975
+ }
976
+ else {
977
+ obj.layers = [];
978
+ }
979
+ message.mimeType !== undefined && (obj.mimeType = message.mimeType);
889
980
  return obj;
890
981
  },
891
982
  fromPartial(object) {
892
983
  const message = Object.assign({}, baseTrackInfo);
984
+ message.layers = [];
893
985
  if (object.sid !== undefined && object.sid !== null) {
894
986
  message.sid = object.sid;
895
987
  }
@@ -944,6 +1036,126 @@ exports.TrackInfo = {
944
1036
  else {
945
1037
  message.source = 0;
946
1038
  }
1039
+ if (object.layers !== undefined && object.layers !== null) {
1040
+ for (const e of object.layers) {
1041
+ message.layers.push(exports.VideoLayer.fromPartial(e));
1042
+ }
1043
+ }
1044
+ if (object.mimeType !== undefined && object.mimeType !== null) {
1045
+ message.mimeType = object.mimeType;
1046
+ }
1047
+ else {
1048
+ message.mimeType = "";
1049
+ }
1050
+ return message;
1051
+ },
1052
+ };
1053
+ const baseVideoLayer = { quality: 0, width: 0, height: 0, bitrate: 0 };
1054
+ exports.VideoLayer = {
1055
+ encode(message, writer = minimal_1.default.Writer.create()) {
1056
+ if (message.quality !== 0) {
1057
+ writer.uint32(8).int32(message.quality);
1058
+ }
1059
+ if (message.width !== 0) {
1060
+ writer.uint32(16).uint32(message.width);
1061
+ }
1062
+ if (message.height !== 0) {
1063
+ writer.uint32(24).uint32(message.height);
1064
+ }
1065
+ if (message.bitrate !== 0) {
1066
+ writer.uint32(32).uint32(message.bitrate);
1067
+ }
1068
+ return writer;
1069
+ },
1070
+ decode(input, length) {
1071
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1072
+ let end = length === undefined ? reader.len : reader.pos + length;
1073
+ const message = Object.assign({}, baseVideoLayer);
1074
+ while (reader.pos < end) {
1075
+ const tag = reader.uint32();
1076
+ switch (tag >>> 3) {
1077
+ case 1:
1078
+ message.quality = reader.int32();
1079
+ break;
1080
+ case 2:
1081
+ message.width = reader.uint32();
1082
+ break;
1083
+ case 3:
1084
+ message.height = reader.uint32();
1085
+ break;
1086
+ case 4:
1087
+ message.bitrate = reader.uint32();
1088
+ break;
1089
+ default:
1090
+ reader.skipType(tag & 7);
1091
+ break;
1092
+ }
1093
+ }
1094
+ return message;
1095
+ },
1096
+ fromJSON(object) {
1097
+ const message = Object.assign({}, baseVideoLayer);
1098
+ if (object.quality !== undefined && object.quality !== null) {
1099
+ message.quality = videoQualityFromJSON(object.quality);
1100
+ }
1101
+ else {
1102
+ message.quality = 0;
1103
+ }
1104
+ if (object.width !== undefined && object.width !== null) {
1105
+ message.width = Number(object.width);
1106
+ }
1107
+ else {
1108
+ message.width = 0;
1109
+ }
1110
+ if (object.height !== undefined && object.height !== null) {
1111
+ message.height = Number(object.height);
1112
+ }
1113
+ else {
1114
+ message.height = 0;
1115
+ }
1116
+ if (object.bitrate !== undefined && object.bitrate !== null) {
1117
+ message.bitrate = Number(object.bitrate);
1118
+ }
1119
+ else {
1120
+ message.bitrate = 0;
1121
+ }
1122
+ return message;
1123
+ },
1124
+ toJSON(message) {
1125
+ const obj = {};
1126
+ message.quality !== undefined &&
1127
+ (obj.quality = videoQualityToJSON(message.quality));
1128
+ message.width !== undefined && (obj.width = message.width);
1129
+ message.height !== undefined && (obj.height = message.height);
1130
+ message.bitrate !== undefined && (obj.bitrate = message.bitrate);
1131
+ return obj;
1132
+ },
1133
+ fromPartial(object) {
1134
+ const message = Object.assign({}, baseVideoLayer);
1135
+ if (object.quality !== undefined && object.quality !== null) {
1136
+ message.quality = object.quality;
1137
+ }
1138
+ else {
1139
+ message.quality = 0;
1140
+ }
1141
+ if (object.width !== undefined && object.width !== null) {
1142
+ message.width = object.width;
1143
+ }
1144
+ else {
1145
+ message.width = 0;
1146
+ }
1147
+ if (object.height !== undefined && object.height !== null) {
1148
+ message.height = object.height;
1149
+ }
1150
+ else {
1151
+ message.height = 0;
1152
+ }
1153
+ if (object.bitrate !== undefined && object.bitrate !== null) {
1154
+ message.bitrate = object.bitrate;
1155
+ }
1156
+ else {
1157
+ message.bitrate = 0;
1158
+ }
947
1159
  return message;
948
1160
  },
949
1161
  };
@@ -1285,6 +1497,83 @@ exports.UserPacket = {
1285
1497
  return message;
1286
1498
  },
1287
1499
  };
1500
+ const baseParticipantTracks = { participantSid: "", trackSids: "" };
1501
+ exports.ParticipantTracks = {
1502
+ encode(message, writer = minimal_1.default.Writer.create()) {
1503
+ if (message.participantSid !== "") {
1504
+ writer.uint32(10).string(message.participantSid);
1505
+ }
1506
+ for (const v of message.trackSids) {
1507
+ writer.uint32(18).string(v);
1508
+ }
1509
+ return writer;
1510
+ },
1511
+ decode(input, length) {
1512
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
1513
+ let end = length === undefined ? reader.len : reader.pos + length;
1514
+ const message = Object.assign({}, baseParticipantTracks);
1515
+ message.trackSids = [];
1516
+ while (reader.pos < end) {
1517
+ const tag = reader.uint32();
1518
+ switch (tag >>> 3) {
1519
+ case 1:
1520
+ message.participantSid = reader.string();
1521
+ break;
1522
+ case 2:
1523
+ message.trackSids.push(reader.string());
1524
+ break;
1525
+ default:
1526
+ reader.skipType(tag & 7);
1527
+ break;
1528
+ }
1529
+ }
1530
+ return message;
1531
+ },
1532
+ fromJSON(object) {
1533
+ const message = Object.assign({}, baseParticipantTracks);
1534
+ message.trackSids = [];
1535
+ if (object.participantSid !== undefined && object.participantSid !== null) {
1536
+ message.participantSid = String(object.participantSid);
1537
+ }
1538
+ else {
1539
+ message.participantSid = "";
1540
+ }
1541
+ if (object.trackSids !== undefined && object.trackSids !== null) {
1542
+ for (const e of object.trackSids) {
1543
+ message.trackSids.push(String(e));
1544
+ }
1545
+ }
1546
+ return message;
1547
+ },
1548
+ toJSON(message) {
1549
+ const obj = {};
1550
+ message.participantSid !== undefined &&
1551
+ (obj.participantSid = message.participantSid);
1552
+ if (message.trackSids) {
1553
+ obj.trackSids = message.trackSids.map((e) => e);
1554
+ }
1555
+ else {
1556
+ obj.trackSids = [];
1557
+ }
1558
+ return obj;
1559
+ },
1560
+ fromPartial(object) {
1561
+ const message = Object.assign({}, baseParticipantTracks);
1562
+ message.trackSids = [];
1563
+ if (object.participantSid !== undefined && object.participantSid !== null) {
1564
+ message.participantSid = object.participantSid;
1565
+ }
1566
+ else {
1567
+ message.participantSid = "";
1568
+ }
1569
+ if (object.trackSids !== undefined && object.trackSids !== null) {
1570
+ for (const e of object.trackSids) {
1571
+ message.trackSids.push(e);
1572
+ }
1573
+ }
1574
+ return message;
1575
+ },
1576
+ };
1288
1577
  var globalThis = (() => {
1289
1578
  if (typeof globalThis !== "undefined")
1290
1579
  return globalThis;
@@ -1310,8 +1599,8 @@ const btoa = globalThis.btoa ||
1310
1599
  ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
1311
1600
  function base64FromBytes(arr) {
1312
1601
  const bin = [];
1313
- for (let i = 0; i < arr.byteLength; ++i) {
1314
- bin.push(String.fromCharCode(arr[i]));
1602
+ for (const byte of arr) {
1603
+ bin.push(String.fromCharCode(byte));
1315
1604
  }
1316
1605
  return btoa(bin.join(""));
1317
1606
  }