@stream-io/video-client 0.0.1-alpha.7

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 (157) hide show
  1. package/LICENSE +219 -0
  2. package/README.md +14 -0
  3. package/dist/index.d.ts +23 -0
  4. package/dist/index.js +14663 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/src/Batcher.d.ts +12 -0
  7. package/dist/src/CallDropScheduler.d.ts +44 -0
  8. package/dist/src/StreamSfuClient.d.ts +25 -0
  9. package/dist/src/StreamVideoClient.d.ts +145 -0
  10. package/dist/src/__tests__/StreamVideoClient.test.d.ts +1 -0
  11. package/dist/src/config/defaultConfigs.d.ts +2 -0
  12. package/dist/src/config/types.d.ts +29 -0
  13. package/dist/src/coordinator/StreamCoordinatorClient.d.ts +19 -0
  14. package/dist/src/coordinator/connection/base64.d.ts +2 -0
  15. package/dist/src/coordinator/connection/client.d.ts +174 -0
  16. package/dist/src/coordinator/connection/connection.d.ts +139 -0
  17. package/dist/src/coordinator/connection/connection_fallback.d.ts +38 -0
  18. package/dist/src/coordinator/connection/errors.d.ts +16 -0
  19. package/dist/src/coordinator/connection/events.d.ts +7 -0
  20. package/dist/src/coordinator/connection/insights.d.ts +58 -0
  21. package/dist/src/coordinator/connection/signing.d.ts +30 -0
  22. package/dist/src/coordinator/connection/token_manager.d.ts +39 -0
  23. package/dist/src/coordinator/connection/types.d.ts +96 -0
  24. package/dist/src/coordinator/connection/utils.d.ts +25 -0
  25. package/dist/src/devices.d.ts +79 -0
  26. package/dist/src/events/call.d.ts +26 -0
  27. package/dist/src/events/internal.d.ts +8 -0
  28. package/dist/src/events/participant.d.ts +21 -0
  29. package/dist/src/events/speaker.d.ts +10 -0
  30. package/dist/src/gen/coordinator/index.d.ts +1664 -0
  31. package/dist/src/gen/google/protobuf/descriptor.d.ts +1650 -0
  32. package/dist/src/gen/google/protobuf/duration.d.ts +113 -0
  33. package/dist/src/gen/google/protobuf/struct.d.ts +184 -0
  34. package/dist/src/gen/google/protobuf/timestamp.d.ts +158 -0
  35. package/dist/src/gen/video/coordinator/broadcast_v1/broadcast.d.ts +66 -0
  36. package/dist/src/gen/video/coordinator/call_v1/call.d.ts +254 -0
  37. package/dist/src/gen/video/coordinator/client_v1_rpc/client_rpc.client.d.ts +351 -0
  38. package/dist/src/gen/video/coordinator/client_v1_rpc/client_rpc.d.ts +1488 -0
  39. package/dist/src/gen/video/coordinator/client_v1_rpc/envelopes.d.ts +143 -0
  40. package/dist/src/gen/video/coordinator/client_v1_rpc/websocket.d.ts +292 -0
  41. package/dist/src/gen/video/coordinator/edge_v1/edge.d.ts +183 -0
  42. package/dist/src/gen/video/coordinator/event_v1/event.d.ts +411 -0
  43. package/dist/src/gen/video/coordinator/geofence_v1/geofence.d.ts +63 -0
  44. package/dist/src/gen/video/coordinator/member_v1/member.d.ts +59 -0
  45. package/dist/src/gen/video/coordinator/participant_v1/participant.d.ts +103 -0
  46. package/dist/src/gen/video/coordinator/push_v1/push.d.ts +240 -0
  47. package/dist/src/gen/video/coordinator/stat_v1/stat.d.ts +308 -0
  48. package/dist/src/gen/video/coordinator/user_v1/user.d.ts +112 -0
  49. package/dist/src/gen/video/coordinator/utils_v1/utils.d.ts +47 -0
  50. package/dist/src/gen/video/sfu/event/events.d.ts +736 -0
  51. package/dist/src/gen/video/sfu/models/models.d.ts +460 -0
  52. package/dist/src/gen/video/sfu/signal_rpc/signal.client.d.ts +89 -0
  53. package/dist/src/gen/video/sfu/signal_rpc/signal.d.ts +320 -0
  54. package/dist/src/helpers/browsers.d.ts +8 -0
  55. package/dist/src/helpers/sound-detector.d.ts +34 -0
  56. package/dist/src/rpc/createClient.d.ts +10 -0
  57. package/dist/src/rpc/index.d.ts +2 -0
  58. package/dist/src/rpc/latency.d.ts +9 -0
  59. package/dist/src/rtc/Call.d.ts +180 -0
  60. package/dist/src/rtc/CallMetadata.d.ts +9 -0
  61. package/dist/src/rtc/Dispatcher.d.ts +9 -0
  62. package/dist/src/rtc/IceTrickleBuffer.d.ts +11 -0
  63. package/dist/src/rtc/callEventHandlers.d.ts +5 -0
  64. package/dist/src/rtc/codecs.d.ts +2 -0
  65. package/dist/src/rtc/helpers/iceCandidate.d.ts +2 -0
  66. package/dist/src/rtc/helpers/tracks.d.ts +3 -0
  67. package/dist/src/rtc/publisher.d.ts +53 -0
  68. package/dist/src/rtc/signal.d.ts +5 -0
  69. package/dist/src/rtc/subscriber.d.ts +7 -0
  70. package/dist/src/rtc/types.d.ts +84 -0
  71. package/dist/src/rtc/videoLayers.d.ts +17 -0
  72. package/dist/src/stats/coordinator-stats-reporter.d.ts +10 -0
  73. package/dist/src/stats/state-store-stats-reporter.d.ts +57 -0
  74. package/dist/src/stats/types.d.ts +42 -0
  75. package/dist/src/store/index.d.ts +2 -0
  76. package/dist/src/store/rxUtils.d.ts +18 -0
  77. package/dist/src/store/stateStore.d.ts +182 -0
  78. package/generate-openapi.sh +32 -0
  79. package/index.ts +30 -0
  80. package/openapitools.json +7 -0
  81. package/package.json +54 -0
  82. package/rollup.config.mjs +48 -0
  83. package/src/Batcher.ts +43 -0
  84. package/src/CallDropScheduler.ts +192 -0
  85. package/src/StreamSfuClient.ts +185 -0
  86. package/src/StreamVideoClient.ts +487 -0
  87. package/src/__tests__/StreamVideoClient.test.ts +83 -0
  88. package/src/config/defaultConfigs.ts +15 -0
  89. package/src/config/types.ts +30 -0
  90. package/src/coordinator/StreamCoordinatorClient.ts +111 -0
  91. package/src/coordinator/connection/base64.ts +80 -0
  92. package/src/coordinator/connection/client.ts +815 -0
  93. package/src/coordinator/connection/connection.ts +750 -0
  94. package/src/coordinator/connection/connection_fallback.ts +239 -0
  95. package/src/coordinator/connection/errors.ts +70 -0
  96. package/src/coordinator/connection/events.ts +10 -0
  97. package/src/coordinator/connection/insights.ts +88 -0
  98. package/src/coordinator/connection/signing.ts +104 -0
  99. package/src/coordinator/connection/token_manager.ts +160 -0
  100. package/src/coordinator/connection/types.ts +120 -0
  101. package/src/coordinator/connection/utils.ts +148 -0
  102. package/src/devices.ts +266 -0
  103. package/src/events/call.ts +166 -0
  104. package/src/events/internal.ts +47 -0
  105. package/src/events/participant.ts +97 -0
  106. package/src/events/speaker.ts +62 -0
  107. package/src/gen/coordinator/index.ts +1653 -0
  108. package/src/gen/google/protobuf/descriptor.ts +3466 -0
  109. package/src/gen/google/protobuf/duration.ts +232 -0
  110. package/src/gen/google/protobuf/struct.ts +481 -0
  111. package/src/gen/google/protobuf/timestamp.ts +291 -0
  112. package/src/gen/video/coordinator/broadcast_v1/broadcast.ts +154 -0
  113. package/src/gen/video/coordinator/call_v1/call.ts +651 -0
  114. package/src/gen/video/coordinator/client_v1_rpc/client_rpc.client.ts +463 -0
  115. package/src/gen/video/coordinator/client_v1_rpc/client_rpc.ts +3819 -0
  116. package/src/gen/video/coordinator/client_v1_rpc/envelopes.ts +424 -0
  117. package/src/gen/video/coordinator/client_v1_rpc/websocket.ts +719 -0
  118. package/src/gen/video/coordinator/edge_v1/edge.ts +532 -0
  119. package/src/gen/video/coordinator/event_v1/event.ts +1171 -0
  120. package/src/gen/video/coordinator/geofence_v1/geofence.ts +128 -0
  121. package/src/gen/video/coordinator/member_v1/member.ts +138 -0
  122. package/src/gen/video/coordinator/participant_v1/participant.ts +261 -0
  123. package/src/gen/video/coordinator/push_v1/push.ts +651 -0
  124. package/src/gen/video/coordinator/stat_v1/stat.ts +656 -0
  125. package/src/gen/video/coordinator/user_v1/user.ts +277 -0
  126. package/src/gen/video/coordinator/utils_v1/utils.ts +98 -0
  127. package/src/gen/video/sfu/event/events.ts +1962 -0
  128. package/src/gen/video/sfu/models/models.ts +1062 -0
  129. package/src/gen/video/sfu/signal_rpc/signal.client.ts +108 -0
  130. package/src/gen/video/sfu/signal_rpc/signal.ts +906 -0
  131. package/src/helpers/browsers.ts +13 -0
  132. package/src/helpers/sound-detector.ts +85 -0
  133. package/src/rpc/createClient.ts +50 -0
  134. package/src/rpc/index.ts +2 -0
  135. package/src/rpc/latency.ts +43 -0
  136. package/src/rtc/Call.ts +585 -0
  137. package/src/rtc/CallMetadata.ts +24 -0
  138. package/src/rtc/Dispatcher.ts +46 -0
  139. package/src/rtc/IceTrickleBuffer.ts +21 -0
  140. package/src/rtc/callEventHandlers.ts +37 -0
  141. package/src/rtc/codecs.ts +61 -0
  142. package/src/rtc/helpers/iceCandidate.ts +16 -0
  143. package/src/rtc/helpers/tracks.ts +18 -0
  144. package/src/rtc/publisher.ts +305 -0
  145. package/src/rtc/signal.ts +34 -0
  146. package/src/rtc/subscriber.ts +85 -0
  147. package/src/rtc/types.ts +105 -0
  148. package/src/rtc/videoLayers.ts +103 -0
  149. package/src/stats/coordinator-stats-reporter.ts +167 -0
  150. package/src/stats/state-store-stats-reporter.ts +364 -0
  151. package/src/stats/types.ts +46 -0
  152. package/src/store/index.ts +2 -0
  153. package/src/store/rxUtils.ts +42 -0
  154. package/src/store/stateStore.ts +341 -0
  155. package/tsconfig.json +25 -0
  156. package/typedoc.json +11 -0
  157. package/vite.config.ts +11 -0
@@ -0,0 +1,651 @@
1
+ /* eslint-disable */
2
+ // @generated by protobuf-ts 2.8.1 with parameter long_type_string,client_generic,server_none,eslint_disable
3
+ // @generated from protobuf file "video/coordinator/call_v1/call.proto" (package "stream.video.coordinator.call_v1", syntax proto3)
4
+ // tslint:disable
5
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
6
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
7
+ import { WireType } from "@protobuf-ts/runtime";
8
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
9
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
10
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
+ import type { PartialMessage } from "@protobuf-ts/runtime";
12
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
13
+ import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
14
+ import { MessageType } from "@protobuf-ts/runtime";
15
+ import { Member } from "../member_v1/member";
16
+ import { Timestamp } from "../../../google/protobuf/timestamp";
17
+ /**
18
+ * @generated from protobuf message stream.video.coordinator.call_v1.CallType
19
+ */
20
+ export interface CallType {
21
+ /**
22
+ * The unique name for the call type.
23
+ *
24
+ * @generated from protobuf field: string name = 1;
25
+ */
26
+ name: string;
27
+ /**
28
+ * @generated from protobuf field: stream.video.coordinator.call_v1.CallSettings settings = 2;
29
+ */
30
+ settings?: CallSettings;
31
+ /**
32
+ * @generated from protobuf field: google.protobuf.Timestamp created_at = 3;
33
+ */
34
+ createdAt?: Timestamp;
35
+ /**
36
+ * @generated from protobuf field: google.protobuf.Timestamp updated_at = 4;
37
+ */
38
+ updatedAt?: Timestamp;
39
+ }
40
+ /**
41
+ * @generated from protobuf message stream.video.coordinator.call_v1.Call
42
+ */
43
+ export interface Call {
44
+ /**
45
+ * The call type.
46
+ *
47
+ * @generated from protobuf field: string type = 1;
48
+ */
49
+ type: string;
50
+ /**
51
+ * The call id.
52
+ *
53
+ * @generated from protobuf field: string id = 2;
54
+ */
55
+ id: string;
56
+ /**
57
+ * A concatenation of call type and call id with ":" inbetween
58
+ *
59
+ * @generated from protobuf field: string call_cid = 3;
60
+ */
61
+ callCid: string;
62
+ /**
63
+ * The id of the user that created this call.
64
+ *
65
+ * @generated from protobuf field: string created_by_user_id = 4;
66
+ */
67
+ createdByUserId: string;
68
+ /**
69
+ * @generated from protobuf field: bytes custom_json = 5;
70
+ */
71
+ customJson: Uint8Array;
72
+ /**
73
+ * Call settings overrides that are set explicitly in this call
74
+ * This set of settings does not include CallType settings
75
+ *
76
+ * @generated from protobuf field: stream.video.coordinator.call_v1.CallSettings settings_overrides = 6;
77
+ */
78
+ settingsOverrides?: CallSettings;
79
+ /**
80
+ * @generated from protobuf field: google.protobuf.Timestamp created_at = 7;
81
+ */
82
+ createdAt?: Timestamp;
83
+ /**
84
+ * @generated from protobuf field: google.protobuf.Timestamp updated_at = 8;
85
+ */
86
+ updatedAt?: Timestamp;
87
+ /**
88
+ * If true, the call is currently recording
89
+ *
90
+ * @generated from protobuf field: bool recording_active = 9;
91
+ */
92
+ recordingActive: boolean;
93
+ /**
94
+ * If true, the call is currently broadcasting
95
+ *
96
+ * @generated from protobuf field: bool broadcasting_active = 10;
97
+ */
98
+ broadcastingActive: boolean;
99
+ }
100
+ /**
101
+ * CallDetails contains call additional details
102
+ *
103
+ * @generated from protobuf message stream.video.coordinator.call_v1.CallDetails
104
+ */
105
+ export interface CallDetails {
106
+ /**
107
+ * Call settings_overrides merged with CallType settings
108
+ *
109
+ * @generated from protobuf field: stream.video.coordinator.call_v1.CallSettings settings = 1;
110
+ */
111
+ settings?: CallSettings;
112
+ /**
113
+ * Ordered list of member user IDs
114
+ *
115
+ * @generated from protobuf field: repeated string member_user_ids = 2;
116
+ */
117
+ memberUserIds: string[];
118
+ /**
119
+ * Call members map indexed by Member.user_id
120
+ * Cannot have more than 100 members
121
+ *
122
+ * @generated from protobuf field: map<string, stream.video.coordinator.member_v1.Member> members = 3;
123
+ */
124
+ members: {
125
+ [key: string]: Member;
126
+ };
127
+ }
128
+ /**
129
+ * CallSettings contains all options available to change for a CallType
130
+ * Settings can also be set on the call level where they will be merged with call options using `json.Merge`
131
+ * To make sure options can be overridden on the call level, all underlying option fields should be optional
132
+ *
133
+ * @generated from protobuf message stream.video.coordinator.call_v1.CallSettings
134
+ */
135
+ export interface CallSettings {
136
+ /**
137
+ * @generated from protobuf field: stream.video.coordinator.call_v1.RecordingSettings recording = 1;
138
+ */
139
+ recording?: RecordingSettings;
140
+ /**
141
+ * @generated from protobuf field: stream.video.coordinator.call_v1.BroadcastingSettings broadcasting = 2;
142
+ */
143
+ broadcasting?: BroadcastingSettings;
144
+ /**
145
+ * @generated from protobuf field: stream.video.coordinator.call_v1.GeofencingSettings geofencing = 3;
146
+ */
147
+ geofencing?: GeofencingSettings;
148
+ }
149
+ /**
150
+ * Contains all settings regarding to call recording
151
+ *
152
+ * @generated from protobuf message stream.video.coordinator.call_v1.RecordingSettings
153
+ */
154
+ export interface RecordingSettings {
155
+ /**
156
+ * Whether recording feature is enabled
157
+ * Default: false
158
+ *
159
+ * @generated from protobuf field: optional bool enabled = 1;
160
+ */
161
+ enabled?: boolean;
162
+ }
163
+ /**
164
+ * Contains all settings regarding to call broadcasting
165
+ *
166
+ * @generated from protobuf message stream.video.coordinator.call_v1.BroadcastingSettings
167
+ */
168
+ export interface BroadcastingSettings {
169
+ /**
170
+ * Whether broadcasting feature is enabled
171
+ * Default: false
172
+ *
173
+ * @generated from protobuf field: optional bool enabled = 1;
174
+ */
175
+ enabled?: boolean;
176
+ }
177
+ /**
178
+ * Contains all settings regarding to call geofencing
179
+ * Initialization of geofencing enables the feature
180
+ *
181
+ * @generated from protobuf message stream.video.coordinator.call_v1.GeofencingSettings
182
+ */
183
+ export interface GeofencingSettings {
184
+ /**
185
+ * Names of the geofences that are selected
186
+ *
187
+ * @generated from protobuf field: repeated string names = 1;
188
+ */
189
+ names: string[];
190
+ }
191
+ // @generated message type with reflection information, may provide speed optimized methods
192
+ class CallType$Type extends MessageType<CallType> {
193
+ constructor() {
194
+ super("stream.video.coordinator.call_v1.CallType", [
195
+ { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
196
+ { no: 2, name: "settings", kind: "message", T: () => CallSettings },
197
+ { no: 3, name: "created_at", kind: "message", T: () => Timestamp },
198
+ { no: 4, name: "updated_at", kind: "message", T: () => Timestamp }
199
+ ]);
200
+ }
201
+ create(value?: PartialMessage<CallType>): CallType {
202
+ const message = { name: "" };
203
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
204
+ if (value !== undefined)
205
+ reflectionMergePartial<CallType>(this, message, value);
206
+ return message;
207
+ }
208
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CallType): CallType {
209
+ let message = target ?? this.create(), end = reader.pos + length;
210
+ while (reader.pos < end) {
211
+ let [fieldNo, wireType] = reader.tag();
212
+ switch (fieldNo) {
213
+ case /* string name */ 1:
214
+ message.name = reader.string();
215
+ break;
216
+ case /* stream.video.coordinator.call_v1.CallSettings settings */ 2:
217
+ message.settings = CallSettings.internalBinaryRead(reader, reader.uint32(), options, message.settings);
218
+ break;
219
+ case /* google.protobuf.Timestamp created_at */ 3:
220
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
221
+ break;
222
+ case /* google.protobuf.Timestamp updated_at */ 4:
223
+ message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
224
+ break;
225
+ default:
226
+ let u = options.readUnknownField;
227
+ if (u === "throw")
228
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
229
+ let d = reader.skip(wireType);
230
+ if (u !== false)
231
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
232
+ }
233
+ }
234
+ return message;
235
+ }
236
+ internalBinaryWrite(message: CallType, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
237
+ /* string name = 1; */
238
+ if (message.name !== "")
239
+ writer.tag(1, WireType.LengthDelimited).string(message.name);
240
+ /* stream.video.coordinator.call_v1.CallSettings settings = 2; */
241
+ if (message.settings)
242
+ CallSettings.internalBinaryWrite(message.settings, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
243
+ /* google.protobuf.Timestamp created_at = 3; */
244
+ if (message.createdAt)
245
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
246
+ /* google.protobuf.Timestamp updated_at = 4; */
247
+ if (message.updatedAt)
248
+ Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
249
+ let u = options.writeUnknownFields;
250
+ if (u !== false)
251
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
252
+ return writer;
253
+ }
254
+ }
255
+ /**
256
+ * @generated MessageType for protobuf message stream.video.coordinator.call_v1.CallType
257
+ */
258
+ export const CallType = new CallType$Type();
259
+ // @generated message type with reflection information, may provide speed optimized methods
260
+ class Call$Type extends MessageType<Call> {
261
+ constructor() {
262
+ super("stream.video.coordinator.call_v1.Call", [
263
+ { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
264
+ { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
265
+ { no: 3, name: "call_cid", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
266
+ { no: 4, name: "created_by_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
267
+ { no: 5, name: "custom_json", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
268
+ { no: 6, name: "settings_overrides", kind: "message", T: () => CallSettings },
269
+ { no: 7, name: "created_at", kind: "message", T: () => Timestamp },
270
+ { no: 8, name: "updated_at", kind: "message", T: () => Timestamp },
271
+ { no: 9, name: "recording_active", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
272
+ { no: 10, name: "broadcasting_active", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
273
+ ]);
274
+ }
275
+ create(value?: PartialMessage<Call>): Call {
276
+ const message = { type: "", id: "", callCid: "", createdByUserId: "", customJson: new Uint8Array(0), recordingActive: false, broadcastingActive: false };
277
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
278
+ if (value !== undefined)
279
+ reflectionMergePartial<Call>(this, message, value);
280
+ return message;
281
+ }
282
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Call): Call {
283
+ let message = target ?? this.create(), end = reader.pos + length;
284
+ while (reader.pos < end) {
285
+ let [fieldNo, wireType] = reader.tag();
286
+ switch (fieldNo) {
287
+ case /* string type */ 1:
288
+ message.type = reader.string();
289
+ break;
290
+ case /* string id */ 2:
291
+ message.id = reader.string();
292
+ break;
293
+ case /* string call_cid */ 3:
294
+ message.callCid = reader.string();
295
+ break;
296
+ case /* string created_by_user_id */ 4:
297
+ message.createdByUserId = reader.string();
298
+ break;
299
+ case /* bytes custom_json */ 5:
300
+ message.customJson = reader.bytes();
301
+ break;
302
+ case /* stream.video.coordinator.call_v1.CallSettings settings_overrides */ 6:
303
+ message.settingsOverrides = CallSettings.internalBinaryRead(reader, reader.uint32(), options, message.settingsOverrides);
304
+ break;
305
+ case /* google.protobuf.Timestamp created_at */ 7:
306
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
307
+ break;
308
+ case /* google.protobuf.Timestamp updated_at */ 8:
309
+ message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
310
+ break;
311
+ case /* bool recording_active */ 9:
312
+ message.recordingActive = reader.bool();
313
+ break;
314
+ case /* bool broadcasting_active */ 10:
315
+ message.broadcastingActive = reader.bool();
316
+ break;
317
+ default:
318
+ let u = options.readUnknownField;
319
+ if (u === "throw")
320
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
321
+ let d = reader.skip(wireType);
322
+ if (u !== false)
323
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
324
+ }
325
+ }
326
+ return message;
327
+ }
328
+ internalBinaryWrite(message: Call, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
329
+ /* string type = 1; */
330
+ if (message.type !== "")
331
+ writer.tag(1, WireType.LengthDelimited).string(message.type);
332
+ /* string id = 2; */
333
+ if (message.id !== "")
334
+ writer.tag(2, WireType.LengthDelimited).string(message.id);
335
+ /* string call_cid = 3; */
336
+ if (message.callCid !== "")
337
+ writer.tag(3, WireType.LengthDelimited).string(message.callCid);
338
+ /* string created_by_user_id = 4; */
339
+ if (message.createdByUserId !== "")
340
+ writer.tag(4, WireType.LengthDelimited).string(message.createdByUserId);
341
+ /* bytes custom_json = 5; */
342
+ if (message.customJson.length)
343
+ writer.tag(5, WireType.LengthDelimited).bytes(message.customJson);
344
+ /* stream.video.coordinator.call_v1.CallSettings settings_overrides = 6; */
345
+ if (message.settingsOverrides)
346
+ CallSettings.internalBinaryWrite(message.settingsOverrides, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
347
+ /* google.protobuf.Timestamp created_at = 7; */
348
+ if (message.createdAt)
349
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
350
+ /* google.protobuf.Timestamp updated_at = 8; */
351
+ if (message.updatedAt)
352
+ Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
353
+ /* bool recording_active = 9; */
354
+ if (message.recordingActive !== false)
355
+ writer.tag(9, WireType.Varint).bool(message.recordingActive);
356
+ /* bool broadcasting_active = 10; */
357
+ if (message.broadcastingActive !== false)
358
+ writer.tag(10, WireType.Varint).bool(message.broadcastingActive);
359
+ let u = options.writeUnknownFields;
360
+ if (u !== false)
361
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
362
+ return writer;
363
+ }
364
+ }
365
+ /**
366
+ * @generated MessageType for protobuf message stream.video.coordinator.call_v1.Call
367
+ */
368
+ export const Call = new Call$Type();
369
+ // @generated message type with reflection information, may provide speed optimized methods
370
+ class CallDetails$Type extends MessageType<CallDetails> {
371
+ constructor() {
372
+ super("stream.video.coordinator.call_v1.CallDetails", [
373
+ { no: 1, name: "settings", kind: "message", T: () => CallSettings },
374
+ { no: 2, name: "member_user_ids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
375
+ { no: 3, name: "members", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Member } }
376
+ ]);
377
+ }
378
+ create(value?: PartialMessage<CallDetails>): CallDetails {
379
+ const message = { memberUserIds: [], members: {} };
380
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
381
+ if (value !== undefined)
382
+ reflectionMergePartial<CallDetails>(this, message, value);
383
+ return message;
384
+ }
385
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CallDetails): CallDetails {
386
+ let message = target ?? this.create(), end = reader.pos + length;
387
+ while (reader.pos < end) {
388
+ let [fieldNo, wireType] = reader.tag();
389
+ switch (fieldNo) {
390
+ case /* stream.video.coordinator.call_v1.CallSettings settings */ 1:
391
+ message.settings = CallSettings.internalBinaryRead(reader, reader.uint32(), options, message.settings);
392
+ break;
393
+ case /* repeated string member_user_ids */ 2:
394
+ message.memberUserIds.push(reader.string());
395
+ break;
396
+ case /* map<string, stream.video.coordinator.member_v1.Member> members */ 3:
397
+ this.binaryReadMap3(message.members, reader, options);
398
+ break;
399
+ default:
400
+ let u = options.readUnknownField;
401
+ if (u === "throw")
402
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
403
+ let d = reader.skip(wireType);
404
+ if (u !== false)
405
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
406
+ }
407
+ }
408
+ return message;
409
+ }
410
+ private binaryReadMap3(map: CallDetails["members"], reader: IBinaryReader, options: BinaryReadOptions): void {
411
+ let len = reader.uint32(), end = reader.pos + len, key: keyof CallDetails["members"] | undefined, val: CallDetails["members"][any] | undefined;
412
+ while (reader.pos < end) {
413
+ let [fieldNo, wireType] = reader.tag();
414
+ switch (fieldNo) {
415
+ case 1:
416
+ key = reader.string();
417
+ break;
418
+ case 2:
419
+ val = Member.internalBinaryRead(reader, reader.uint32(), options);
420
+ break;
421
+ default: throw new globalThis.Error("unknown map entry field for field stream.video.coordinator.call_v1.CallDetails.members");
422
+ }
423
+ }
424
+ map[key ?? ""] = val ?? Member.create();
425
+ }
426
+ internalBinaryWrite(message: CallDetails, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
427
+ /* stream.video.coordinator.call_v1.CallSettings settings = 1; */
428
+ if (message.settings)
429
+ CallSettings.internalBinaryWrite(message.settings, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
430
+ /* repeated string member_user_ids = 2; */
431
+ for (let i = 0; i < message.memberUserIds.length; i++)
432
+ writer.tag(2, WireType.LengthDelimited).string(message.memberUserIds[i]);
433
+ /* map<string, stream.video.coordinator.member_v1.Member> members = 3; */
434
+ for (let k of Object.keys(message.members)) {
435
+ writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
436
+ writer.tag(2, WireType.LengthDelimited).fork();
437
+ Member.internalBinaryWrite(message.members[k], writer, options);
438
+ writer.join().join();
439
+ }
440
+ let u = options.writeUnknownFields;
441
+ if (u !== false)
442
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
443
+ return writer;
444
+ }
445
+ }
446
+ /**
447
+ * @generated MessageType for protobuf message stream.video.coordinator.call_v1.CallDetails
448
+ */
449
+ export const CallDetails = new CallDetails$Type();
450
+ // @generated message type with reflection information, may provide speed optimized methods
451
+ class CallSettings$Type extends MessageType<CallSettings> {
452
+ constructor() {
453
+ super("stream.video.coordinator.call_v1.CallSettings", [
454
+ { no: 1, name: "recording", kind: "message", T: () => RecordingSettings },
455
+ { no: 2, name: "broadcasting", kind: "message", T: () => BroadcastingSettings },
456
+ { no: 3, name: "geofencing", kind: "message", T: () => GeofencingSettings }
457
+ ]);
458
+ }
459
+ create(value?: PartialMessage<CallSettings>): CallSettings {
460
+ const message = {};
461
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
462
+ if (value !== undefined)
463
+ reflectionMergePartial<CallSettings>(this, message, value);
464
+ return message;
465
+ }
466
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CallSettings): CallSettings {
467
+ let message = target ?? this.create(), end = reader.pos + length;
468
+ while (reader.pos < end) {
469
+ let [fieldNo, wireType] = reader.tag();
470
+ switch (fieldNo) {
471
+ case /* stream.video.coordinator.call_v1.RecordingSettings recording */ 1:
472
+ message.recording = RecordingSettings.internalBinaryRead(reader, reader.uint32(), options, message.recording);
473
+ break;
474
+ case /* stream.video.coordinator.call_v1.BroadcastingSettings broadcasting */ 2:
475
+ message.broadcasting = BroadcastingSettings.internalBinaryRead(reader, reader.uint32(), options, message.broadcasting);
476
+ break;
477
+ case /* stream.video.coordinator.call_v1.GeofencingSettings geofencing */ 3:
478
+ message.geofencing = GeofencingSettings.internalBinaryRead(reader, reader.uint32(), options, message.geofencing);
479
+ break;
480
+ default:
481
+ let u = options.readUnknownField;
482
+ if (u === "throw")
483
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
484
+ let d = reader.skip(wireType);
485
+ if (u !== false)
486
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
487
+ }
488
+ }
489
+ return message;
490
+ }
491
+ internalBinaryWrite(message: CallSettings, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
492
+ /* stream.video.coordinator.call_v1.RecordingSettings recording = 1; */
493
+ if (message.recording)
494
+ RecordingSettings.internalBinaryWrite(message.recording, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
495
+ /* stream.video.coordinator.call_v1.BroadcastingSettings broadcasting = 2; */
496
+ if (message.broadcasting)
497
+ BroadcastingSettings.internalBinaryWrite(message.broadcasting, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
498
+ /* stream.video.coordinator.call_v1.GeofencingSettings geofencing = 3; */
499
+ if (message.geofencing)
500
+ GeofencingSettings.internalBinaryWrite(message.geofencing, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
501
+ let u = options.writeUnknownFields;
502
+ if (u !== false)
503
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
504
+ return writer;
505
+ }
506
+ }
507
+ /**
508
+ * @generated MessageType for protobuf message stream.video.coordinator.call_v1.CallSettings
509
+ */
510
+ export const CallSettings = new CallSettings$Type();
511
+ // @generated message type with reflection information, may provide speed optimized methods
512
+ class RecordingSettings$Type extends MessageType<RecordingSettings> {
513
+ constructor() {
514
+ super("stream.video.coordinator.call_v1.RecordingSettings", [
515
+ { no: 1, name: "enabled", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
516
+ ]);
517
+ }
518
+ create(value?: PartialMessage<RecordingSettings>): RecordingSettings {
519
+ const message = {};
520
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
521
+ if (value !== undefined)
522
+ reflectionMergePartial<RecordingSettings>(this, message, value);
523
+ return message;
524
+ }
525
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RecordingSettings): RecordingSettings {
526
+ let message = target ?? this.create(), end = reader.pos + length;
527
+ while (reader.pos < end) {
528
+ let [fieldNo, wireType] = reader.tag();
529
+ switch (fieldNo) {
530
+ case /* optional bool enabled */ 1:
531
+ message.enabled = reader.bool();
532
+ break;
533
+ default:
534
+ let u = options.readUnknownField;
535
+ if (u === "throw")
536
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
537
+ let d = reader.skip(wireType);
538
+ if (u !== false)
539
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
540
+ }
541
+ }
542
+ return message;
543
+ }
544
+ internalBinaryWrite(message: RecordingSettings, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
545
+ /* optional bool enabled = 1; */
546
+ if (message.enabled !== undefined)
547
+ writer.tag(1, WireType.Varint).bool(message.enabled);
548
+ let u = options.writeUnknownFields;
549
+ if (u !== false)
550
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
551
+ return writer;
552
+ }
553
+ }
554
+ /**
555
+ * @generated MessageType for protobuf message stream.video.coordinator.call_v1.RecordingSettings
556
+ */
557
+ export const RecordingSettings = new RecordingSettings$Type();
558
+ // @generated message type with reflection information, may provide speed optimized methods
559
+ class BroadcastingSettings$Type extends MessageType<BroadcastingSettings> {
560
+ constructor() {
561
+ super("stream.video.coordinator.call_v1.BroadcastingSettings", [
562
+ { no: 1, name: "enabled", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
563
+ ]);
564
+ }
565
+ create(value?: PartialMessage<BroadcastingSettings>): BroadcastingSettings {
566
+ const message = {};
567
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
568
+ if (value !== undefined)
569
+ reflectionMergePartial<BroadcastingSettings>(this, message, value);
570
+ return message;
571
+ }
572
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BroadcastingSettings): BroadcastingSettings {
573
+ let message = target ?? this.create(), end = reader.pos + length;
574
+ while (reader.pos < end) {
575
+ let [fieldNo, wireType] = reader.tag();
576
+ switch (fieldNo) {
577
+ case /* optional bool enabled */ 1:
578
+ message.enabled = reader.bool();
579
+ break;
580
+ default:
581
+ let u = options.readUnknownField;
582
+ if (u === "throw")
583
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
584
+ let d = reader.skip(wireType);
585
+ if (u !== false)
586
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
587
+ }
588
+ }
589
+ return message;
590
+ }
591
+ internalBinaryWrite(message: BroadcastingSettings, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
592
+ /* optional bool enabled = 1; */
593
+ if (message.enabled !== undefined)
594
+ writer.tag(1, WireType.Varint).bool(message.enabled);
595
+ let u = options.writeUnknownFields;
596
+ if (u !== false)
597
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
598
+ return writer;
599
+ }
600
+ }
601
+ /**
602
+ * @generated MessageType for protobuf message stream.video.coordinator.call_v1.BroadcastingSettings
603
+ */
604
+ export const BroadcastingSettings = new BroadcastingSettings$Type();
605
+ // @generated message type with reflection information, may provide speed optimized methods
606
+ class GeofencingSettings$Type extends MessageType<GeofencingSettings> {
607
+ constructor() {
608
+ super("stream.video.coordinator.call_v1.GeofencingSettings", [
609
+ { no: 1, name: "names", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
610
+ ]);
611
+ }
612
+ create(value?: PartialMessage<GeofencingSettings>): GeofencingSettings {
613
+ const message = { names: [] };
614
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
615
+ if (value !== undefined)
616
+ reflectionMergePartial<GeofencingSettings>(this, message, value);
617
+ return message;
618
+ }
619
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GeofencingSettings): GeofencingSettings {
620
+ let message = target ?? this.create(), end = reader.pos + length;
621
+ while (reader.pos < end) {
622
+ let [fieldNo, wireType] = reader.tag();
623
+ switch (fieldNo) {
624
+ case /* repeated string names */ 1:
625
+ message.names.push(reader.string());
626
+ break;
627
+ default:
628
+ let u = options.readUnknownField;
629
+ if (u === "throw")
630
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
631
+ let d = reader.skip(wireType);
632
+ if (u !== false)
633
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
634
+ }
635
+ }
636
+ return message;
637
+ }
638
+ internalBinaryWrite(message: GeofencingSettings, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
639
+ /* repeated string names = 1; */
640
+ for (let i = 0; i < message.names.length; i++)
641
+ writer.tag(1, WireType.LengthDelimited).string(message.names[i]);
642
+ let u = options.writeUnknownFields;
643
+ if (u !== false)
644
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
645
+ return writer;
646
+ }
647
+ }
648
+ /**
649
+ * @generated MessageType for protobuf message stream.video.coordinator.call_v1.GeofencingSettings
650
+ */
651
+ export const GeofencingSettings = new GeofencingSettings$Type();