@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.
- package/LICENSE +219 -0
- package/README.md +14 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +14663 -0
- package/dist/index.js.map +1 -0
- package/dist/src/Batcher.d.ts +12 -0
- package/dist/src/CallDropScheduler.d.ts +44 -0
- package/dist/src/StreamSfuClient.d.ts +25 -0
- package/dist/src/StreamVideoClient.d.ts +145 -0
- package/dist/src/__tests__/StreamVideoClient.test.d.ts +1 -0
- package/dist/src/config/defaultConfigs.d.ts +2 -0
- package/dist/src/config/types.d.ts +29 -0
- package/dist/src/coordinator/StreamCoordinatorClient.d.ts +19 -0
- package/dist/src/coordinator/connection/base64.d.ts +2 -0
- package/dist/src/coordinator/connection/client.d.ts +174 -0
- package/dist/src/coordinator/connection/connection.d.ts +139 -0
- package/dist/src/coordinator/connection/connection_fallback.d.ts +38 -0
- package/dist/src/coordinator/connection/errors.d.ts +16 -0
- package/dist/src/coordinator/connection/events.d.ts +7 -0
- package/dist/src/coordinator/connection/insights.d.ts +58 -0
- package/dist/src/coordinator/connection/signing.d.ts +30 -0
- package/dist/src/coordinator/connection/token_manager.d.ts +39 -0
- package/dist/src/coordinator/connection/types.d.ts +96 -0
- package/dist/src/coordinator/connection/utils.d.ts +25 -0
- package/dist/src/devices.d.ts +79 -0
- package/dist/src/events/call.d.ts +26 -0
- package/dist/src/events/internal.d.ts +8 -0
- package/dist/src/events/participant.d.ts +21 -0
- package/dist/src/events/speaker.d.ts +10 -0
- package/dist/src/gen/coordinator/index.d.ts +1664 -0
- package/dist/src/gen/google/protobuf/descriptor.d.ts +1650 -0
- package/dist/src/gen/google/protobuf/duration.d.ts +113 -0
- package/dist/src/gen/google/protobuf/struct.d.ts +184 -0
- package/dist/src/gen/google/protobuf/timestamp.d.ts +158 -0
- package/dist/src/gen/video/coordinator/broadcast_v1/broadcast.d.ts +66 -0
- package/dist/src/gen/video/coordinator/call_v1/call.d.ts +254 -0
- package/dist/src/gen/video/coordinator/client_v1_rpc/client_rpc.client.d.ts +351 -0
- package/dist/src/gen/video/coordinator/client_v1_rpc/client_rpc.d.ts +1488 -0
- package/dist/src/gen/video/coordinator/client_v1_rpc/envelopes.d.ts +143 -0
- package/dist/src/gen/video/coordinator/client_v1_rpc/websocket.d.ts +292 -0
- package/dist/src/gen/video/coordinator/edge_v1/edge.d.ts +183 -0
- package/dist/src/gen/video/coordinator/event_v1/event.d.ts +411 -0
- package/dist/src/gen/video/coordinator/geofence_v1/geofence.d.ts +63 -0
- package/dist/src/gen/video/coordinator/member_v1/member.d.ts +59 -0
- package/dist/src/gen/video/coordinator/participant_v1/participant.d.ts +103 -0
- package/dist/src/gen/video/coordinator/push_v1/push.d.ts +240 -0
- package/dist/src/gen/video/coordinator/stat_v1/stat.d.ts +308 -0
- package/dist/src/gen/video/coordinator/user_v1/user.d.ts +112 -0
- package/dist/src/gen/video/coordinator/utils_v1/utils.d.ts +47 -0
- package/dist/src/gen/video/sfu/event/events.d.ts +736 -0
- package/dist/src/gen/video/sfu/models/models.d.ts +460 -0
- package/dist/src/gen/video/sfu/signal_rpc/signal.client.d.ts +89 -0
- package/dist/src/gen/video/sfu/signal_rpc/signal.d.ts +320 -0
- package/dist/src/helpers/browsers.d.ts +8 -0
- package/dist/src/helpers/sound-detector.d.ts +34 -0
- package/dist/src/rpc/createClient.d.ts +10 -0
- package/dist/src/rpc/index.d.ts +2 -0
- package/dist/src/rpc/latency.d.ts +9 -0
- package/dist/src/rtc/Call.d.ts +180 -0
- package/dist/src/rtc/CallMetadata.d.ts +9 -0
- package/dist/src/rtc/Dispatcher.d.ts +9 -0
- package/dist/src/rtc/IceTrickleBuffer.d.ts +11 -0
- package/dist/src/rtc/callEventHandlers.d.ts +5 -0
- package/dist/src/rtc/codecs.d.ts +2 -0
- package/dist/src/rtc/helpers/iceCandidate.d.ts +2 -0
- package/dist/src/rtc/helpers/tracks.d.ts +3 -0
- package/dist/src/rtc/publisher.d.ts +53 -0
- package/dist/src/rtc/signal.d.ts +5 -0
- package/dist/src/rtc/subscriber.d.ts +7 -0
- package/dist/src/rtc/types.d.ts +84 -0
- package/dist/src/rtc/videoLayers.d.ts +17 -0
- package/dist/src/stats/coordinator-stats-reporter.d.ts +10 -0
- package/dist/src/stats/state-store-stats-reporter.d.ts +57 -0
- package/dist/src/stats/types.d.ts +42 -0
- package/dist/src/store/index.d.ts +2 -0
- package/dist/src/store/rxUtils.d.ts +18 -0
- package/dist/src/store/stateStore.d.ts +182 -0
- package/generate-openapi.sh +32 -0
- package/index.ts +30 -0
- package/openapitools.json +7 -0
- package/package.json +54 -0
- package/rollup.config.mjs +48 -0
- package/src/Batcher.ts +43 -0
- package/src/CallDropScheduler.ts +192 -0
- package/src/StreamSfuClient.ts +185 -0
- package/src/StreamVideoClient.ts +487 -0
- package/src/__tests__/StreamVideoClient.test.ts +83 -0
- package/src/config/defaultConfigs.ts +15 -0
- package/src/config/types.ts +30 -0
- package/src/coordinator/StreamCoordinatorClient.ts +111 -0
- package/src/coordinator/connection/base64.ts +80 -0
- package/src/coordinator/connection/client.ts +815 -0
- package/src/coordinator/connection/connection.ts +750 -0
- package/src/coordinator/connection/connection_fallback.ts +239 -0
- package/src/coordinator/connection/errors.ts +70 -0
- package/src/coordinator/connection/events.ts +10 -0
- package/src/coordinator/connection/insights.ts +88 -0
- package/src/coordinator/connection/signing.ts +104 -0
- package/src/coordinator/connection/token_manager.ts +160 -0
- package/src/coordinator/connection/types.ts +120 -0
- package/src/coordinator/connection/utils.ts +148 -0
- package/src/devices.ts +266 -0
- package/src/events/call.ts +166 -0
- package/src/events/internal.ts +47 -0
- package/src/events/participant.ts +97 -0
- package/src/events/speaker.ts +62 -0
- package/src/gen/coordinator/index.ts +1653 -0
- package/src/gen/google/protobuf/descriptor.ts +3466 -0
- package/src/gen/google/protobuf/duration.ts +232 -0
- package/src/gen/google/protobuf/struct.ts +481 -0
- package/src/gen/google/protobuf/timestamp.ts +291 -0
- package/src/gen/video/coordinator/broadcast_v1/broadcast.ts +154 -0
- package/src/gen/video/coordinator/call_v1/call.ts +651 -0
- package/src/gen/video/coordinator/client_v1_rpc/client_rpc.client.ts +463 -0
- package/src/gen/video/coordinator/client_v1_rpc/client_rpc.ts +3819 -0
- package/src/gen/video/coordinator/client_v1_rpc/envelopes.ts +424 -0
- package/src/gen/video/coordinator/client_v1_rpc/websocket.ts +719 -0
- package/src/gen/video/coordinator/edge_v1/edge.ts +532 -0
- package/src/gen/video/coordinator/event_v1/event.ts +1171 -0
- package/src/gen/video/coordinator/geofence_v1/geofence.ts +128 -0
- package/src/gen/video/coordinator/member_v1/member.ts +138 -0
- package/src/gen/video/coordinator/participant_v1/participant.ts +261 -0
- package/src/gen/video/coordinator/push_v1/push.ts +651 -0
- package/src/gen/video/coordinator/stat_v1/stat.ts +656 -0
- package/src/gen/video/coordinator/user_v1/user.ts +277 -0
- package/src/gen/video/coordinator/utils_v1/utils.ts +98 -0
- package/src/gen/video/sfu/event/events.ts +1962 -0
- package/src/gen/video/sfu/models/models.ts +1062 -0
- package/src/gen/video/sfu/signal_rpc/signal.client.ts +108 -0
- package/src/gen/video/sfu/signal_rpc/signal.ts +906 -0
- package/src/helpers/browsers.ts +13 -0
- package/src/helpers/sound-detector.ts +85 -0
- package/src/rpc/createClient.ts +50 -0
- package/src/rpc/index.ts +2 -0
- package/src/rpc/latency.ts +43 -0
- package/src/rtc/Call.ts +585 -0
- package/src/rtc/CallMetadata.ts +24 -0
- package/src/rtc/Dispatcher.ts +46 -0
- package/src/rtc/IceTrickleBuffer.ts +21 -0
- package/src/rtc/callEventHandlers.ts +37 -0
- package/src/rtc/codecs.ts +61 -0
- package/src/rtc/helpers/iceCandidate.ts +16 -0
- package/src/rtc/helpers/tracks.ts +18 -0
- package/src/rtc/publisher.ts +305 -0
- package/src/rtc/signal.ts +34 -0
- package/src/rtc/subscriber.ts +85 -0
- package/src/rtc/types.ts +105 -0
- package/src/rtc/videoLayers.ts +103 -0
- package/src/stats/coordinator-stats-reporter.ts +167 -0
- package/src/stats/state-store-stats-reporter.ts +364 -0
- package/src/stats/types.ts +46 -0
- package/src/store/index.ts +2 -0
- package/src/store/rxUtils.ts +42 -0
- package/src/store/stateStore.ts +341 -0
- package/tsconfig.json +25 -0
- package/typedoc.json +11 -0
- package/vite.config.ts +11 -0
|
@@ -0,0 +1,424 @@
|
|
|
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/client_v1_rpc/envelopes.proto" (package "stream.video.coordinator.client_v1_rpc", 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 { CallDetails } from "../call_v1/call";
|
|
17
|
+
import { Call } from "../call_v1/call";
|
|
18
|
+
import { User } from "../user_v1/user";
|
|
19
|
+
/**
|
|
20
|
+
* CallEnvelope contains Call and all related information to it
|
|
21
|
+
* Only used in reponse types that return a single call
|
|
22
|
+
*
|
|
23
|
+
* @generated from protobuf message stream.video.coordinator.client_v1_rpc.CallEnvelope
|
|
24
|
+
*/
|
|
25
|
+
export interface CallEnvelope {
|
|
26
|
+
/**
|
|
27
|
+
* All users referenced in the response
|
|
28
|
+
*
|
|
29
|
+
* @generated from protobuf field: map<string, stream.video.coordinator.user_v1.User> users = 1;
|
|
30
|
+
*/
|
|
31
|
+
users: {
|
|
32
|
+
[key: string]: User;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Call object
|
|
36
|
+
*
|
|
37
|
+
* @generated from protobuf field: stream.video.coordinator.call_v1.Call call = 2;
|
|
38
|
+
*/
|
|
39
|
+
call?: Call;
|
|
40
|
+
/**
|
|
41
|
+
* Call details
|
|
42
|
+
*
|
|
43
|
+
* @generated from protobuf field: stream.video.coordinator.call_v1.CallDetails details = 3;
|
|
44
|
+
*/
|
|
45
|
+
details?: CallDetails;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* CallsEnvelope contains list of calls and all related information to them
|
|
49
|
+
* Only used in response types that return list of calls
|
|
50
|
+
*
|
|
51
|
+
* @generated from protobuf message stream.video.coordinator.client_v1_rpc.CallsEnvelope
|
|
52
|
+
*/
|
|
53
|
+
export interface CallsEnvelope {
|
|
54
|
+
/**
|
|
55
|
+
* All users referenced in the response
|
|
56
|
+
*
|
|
57
|
+
* @generated from protobuf field: map<string, stream.video.coordinator.user_v1.User> users = 1;
|
|
58
|
+
*/
|
|
59
|
+
users: {
|
|
60
|
+
[key: string]: User;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Ordered list of Call.call_cid
|
|
64
|
+
*
|
|
65
|
+
* @generated from protobuf field: repeated string call_cids = 2;
|
|
66
|
+
*/
|
|
67
|
+
callCids: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Call objects, indexed by Call.call_cid
|
|
70
|
+
*
|
|
71
|
+
* @generated from protobuf field: map<string, stream.video.coordinator.call_v1.Call> calls = 3;
|
|
72
|
+
*/
|
|
73
|
+
calls: {
|
|
74
|
+
[key: string]: Call;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Call details, indexed by Call.call_cid
|
|
78
|
+
*
|
|
79
|
+
* @generated from protobuf field: map<string, stream.video.coordinator.call_v1.CallDetails> details = 4;
|
|
80
|
+
*/
|
|
81
|
+
details: {
|
|
82
|
+
[key: string]: CallDetails;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* CallsEnvelope contains list of members and all related information to them
|
|
87
|
+
* Only used in response types that return list of members
|
|
88
|
+
*
|
|
89
|
+
* @generated from protobuf message stream.video.coordinator.client_v1_rpc.MembersEnvelope
|
|
90
|
+
*/
|
|
91
|
+
export interface MembersEnvelope {
|
|
92
|
+
/**
|
|
93
|
+
* All users referenced in the response
|
|
94
|
+
*
|
|
95
|
+
* @generated from protobuf field: map<string, stream.video.coordinator.user_v1.User> users = 1;
|
|
96
|
+
*/
|
|
97
|
+
users: {
|
|
98
|
+
[key: string]: User;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Ordered list of Member.user_id
|
|
102
|
+
*
|
|
103
|
+
* @generated from protobuf field: repeated string member_user_ids = 2;
|
|
104
|
+
*/
|
|
105
|
+
memberUserIds: string[];
|
|
106
|
+
/**
|
|
107
|
+
* Map of members indexed by Member.user_id
|
|
108
|
+
*
|
|
109
|
+
* @generated from protobuf field: map<string, stream.video.coordinator.member_v1.Member> members = 3;
|
|
110
|
+
*/
|
|
111
|
+
members: {
|
|
112
|
+
[key: string]: Member;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
116
|
+
class CallEnvelope$Type extends MessageType<CallEnvelope> {
|
|
117
|
+
constructor() {
|
|
118
|
+
super("stream.video.coordinator.client_v1_rpc.CallEnvelope", [
|
|
119
|
+
{ no: 1, name: "users", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => User } },
|
|
120
|
+
{ no: 2, name: "call", kind: "message", T: () => Call },
|
|
121
|
+
{ no: 3, name: "details", kind: "message", T: () => CallDetails }
|
|
122
|
+
]);
|
|
123
|
+
}
|
|
124
|
+
create(value?: PartialMessage<CallEnvelope>): CallEnvelope {
|
|
125
|
+
const message = { users: {} };
|
|
126
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
127
|
+
if (value !== undefined)
|
|
128
|
+
reflectionMergePartial<CallEnvelope>(this, message, value);
|
|
129
|
+
return message;
|
|
130
|
+
}
|
|
131
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CallEnvelope): CallEnvelope {
|
|
132
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
133
|
+
while (reader.pos < end) {
|
|
134
|
+
let [fieldNo, wireType] = reader.tag();
|
|
135
|
+
switch (fieldNo) {
|
|
136
|
+
case /* map<string, stream.video.coordinator.user_v1.User> users */ 1:
|
|
137
|
+
this.binaryReadMap1(message.users, reader, options);
|
|
138
|
+
break;
|
|
139
|
+
case /* stream.video.coordinator.call_v1.Call call */ 2:
|
|
140
|
+
message.call = Call.internalBinaryRead(reader, reader.uint32(), options, message.call);
|
|
141
|
+
break;
|
|
142
|
+
case /* stream.video.coordinator.call_v1.CallDetails details */ 3:
|
|
143
|
+
message.details = CallDetails.internalBinaryRead(reader, reader.uint32(), options, message.details);
|
|
144
|
+
break;
|
|
145
|
+
default:
|
|
146
|
+
let u = options.readUnknownField;
|
|
147
|
+
if (u === "throw")
|
|
148
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
149
|
+
let d = reader.skip(wireType);
|
|
150
|
+
if (u !== false)
|
|
151
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return message;
|
|
155
|
+
}
|
|
156
|
+
private binaryReadMap1(map: CallEnvelope["users"], reader: IBinaryReader, options: BinaryReadOptions): void {
|
|
157
|
+
let len = reader.uint32(), end = reader.pos + len, key: keyof CallEnvelope["users"] | undefined, val: CallEnvelope["users"][any] | undefined;
|
|
158
|
+
while (reader.pos < end) {
|
|
159
|
+
let [fieldNo, wireType] = reader.tag();
|
|
160
|
+
switch (fieldNo) {
|
|
161
|
+
case 1:
|
|
162
|
+
key = reader.string();
|
|
163
|
+
break;
|
|
164
|
+
case 2:
|
|
165
|
+
val = User.internalBinaryRead(reader, reader.uint32(), options);
|
|
166
|
+
break;
|
|
167
|
+
default: throw new globalThis.Error("unknown map entry field for field stream.video.coordinator.client_v1_rpc.CallEnvelope.users");
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
map[key ?? ""] = val ?? User.create();
|
|
171
|
+
}
|
|
172
|
+
internalBinaryWrite(message: CallEnvelope, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
173
|
+
/* map<string, stream.video.coordinator.user_v1.User> users = 1; */
|
|
174
|
+
for (let k of Object.keys(message.users)) {
|
|
175
|
+
writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
|
|
176
|
+
writer.tag(2, WireType.LengthDelimited).fork();
|
|
177
|
+
User.internalBinaryWrite(message.users[k], writer, options);
|
|
178
|
+
writer.join().join();
|
|
179
|
+
}
|
|
180
|
+
/* stream.video.coordinator.call_v1.Call call = 2; */
|
|
181
|
+
if (message.call)
|
|
182
|
+
Call.internalBinaryWrite(message.call, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
183
|
+
/* stream.video.coordinator.call_v1.CallDetails details = 3; */
|
|
184
|
+
if (message.details)
|
|
185
|
+
CallDetails.internalBinaryWrite(message.details, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
186
|
+
let u = options.writeUnknownFields;
|
|
187
|
+
if (u !== false)
|
|
188
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
189
|
+
return writer;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* @generated MessageType for protobuf message stream.video.coordinator.client_v1_rpc.CallEnvelope
|
|
194
|
+
*/
|
|
195
|
+
export const CallEnvelope = new CallEnvelope$Type();
|
|
196
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
197
|
+
class CallsEnvelope$Type extends MessageType<CallsEnvelope> {
|
|
198
|
+
constructor() {
|
|
199
|
+
super("stream.video.coordinator.client_v1_rpc.CallsEnvelope", [
|
|
200
|
+
{ no: 1, name: "users", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => User } },
|
|
201
|
+
{ no: 2, name: "call_cids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
202
|
+
{ no: 3, name: "calls", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Call } },
|
|
203
|
+
{ no: 4, name: "details", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => CallDetails } }
|
|
204
|
+
]);
|
|
205
|
+
}
|
|
206
|
+
create(value?: PartialMessage<CallsEnvelope>): CallsEnvelope {
|
|
207
|
+
const message = { users: {}, callCids: [], calls: {}, details: {} };
|
|
208
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
209
|
+
if (value !== undefined)
|
|
210
|
+
reflectionMergePartial<CallsEnvelope>(this, message, value);
|
|
211
|
+
return message;
|
|
212
|
+
}
|
|
213
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CallsEnvelope): CallsEnvelope {
|
|
214
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
215
|
+
while (reader.pos < end) {
|
|
216
|
+
let [fieldNo, wireType] = reader.tag();
|
|
217
|
+
switch (fieldNo) {
|
|
218
|
+
case /* map<string, stream.video.coordinator.user_v1.User> users */ 1:
|
|
219
|
+
this.binaryReadMap1(message.users, reader, options);
|
|
220
|
+
break;
|
|
221
|
+
case /* repeated string call_cids */ 2:
|
|
222
|
+
message.callCids.push(reader.string());
|
|
223
|
+
break;
|
|
224
|
+
case /* map<string, stream.video.coordinator.call_v1.Call> calls */ 3:
|
|
225
|
+
this.binaryReadMap3(message.calls, reader, options);
|
|
226
|
+
break;
|
|
227
|
+
case /* map<string, stream.video.coordinator.call_v1.CallDetails> details */ 4:
|
|
228
|
+
this.binaryReadMap4(message.details, reader, options);
|
|
229
|
+
break;
|
|
230
|
+
default:
|
|
231
|
+
let u = options.readUnknownField;
|
|
232
|
+
if (u === "throw")
|
|
233
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
234
|
+
let d = reader.skip(wireType);
|
|
235
|
+
if (u !== false)
|
|
236
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return message;
|
|
240
|
+
}
|
|
241
|
+
private binaryReadMap1(map: CallsEnvelope["users"], reader: IBinaryReader, options: BinaryReadOptions): void {
|
|
242
|
+
let len = reader.uint32(), end = reader.pos + len, key: keyof CallsEnvelope["users"] | undefined, val: CallsEnvelope["users"][any] | undefined;
|
|
243
|
+
while (reader.pos < end) {
|
|
244
|
+
let [fieldNo, wireType] = reader.tag();
|
|
245
|
+
switch (fieldNo) {
|
|
246
|
+
case 1:
|
|
247
|
+
key = reader.string();
|
|
248
|
+
break;
|
|
249
|
+
case 2:
|
|
250
|
+
val = User.internalBinaryRead(reader, reader.uint32(), options);
|
|
251
|
+
break;
|
|
252
|
+
default: throw new globalThis.Error("unknown map entry field for field stream.video.coordinator.client_v1_rpc.CallsEnvelope.users");
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
map[key ?? ""] = val ?? User.create();
|
|
256
|
+
}
|
|
257
|
+
private binaryReadMap3(map: CallsEnvelope["calls"], reader: IBinaryReader, options: BinaryReadOptions): void {
|
|
258
|
+
let len = reader.uint32(), end = reader.pos + len, key: keyof CallsEnvelope["calls"] | undefined, val: CallsEnvelope["calls"][any] | undefined;
|
|
259
|
+
while (reader.pos < end) {
|
|
260
|
+
let [fieldNo, wireType] = reader.tag();
|
|
261
|
+
switch (fieldNo) {
|
|
262
|
+
case 1:
|
|
263
|
+
key = reader.string();
|
|
264
|
+
break;
|
|
265
|
+
case 2:
|
|
266
|
+
val = Call.internalBinaryRead(reader, reader.uint32(), options);
|
|
267
|
+
break;
|
|
268
|
+
default: throw new globalThis.Error("unknown map entry field for field stream.video.coordinator.client_v1_rpc.CallsEnvelope.calls");
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
map[key ?? ""] = val ?? Call.create();
|
|
272
|
+
}
|
|
273
|
+
private binaryReadMap4(map: CallsEnvelope["details"], reader: IBinaryReader, options: BinaryReadOptions): void {
|
|
274
|
+
let len = reader.uint32(), end = reader.pos + len, key: keyof CallsEnvelope["details"] | undefined, val: CallsEnvelope["details"][any] | undefined;
|
|
275
|
+
while (reader.pos < end) {
|
|
276
|
+
let [fieldNo, wireType] = reader.tag();
|
|
277
|
+
switch (fieldNo) {
|
|
278
|
+
case 1:
|
|
279
|
+
key = reader.string();
|
|
280
|
+
break;
|
|
281
|
+
case 2:
|
|
282
|
+
val = CallDetails.internalBinaryRead(reader, reader.uint32(), options);
|
|
283
|
+
break;
|
|
284
|
+
default: throw new globalThis.Error("unknown map entry field for field stream.video.coordinator.client_v1_rpc.CallsEnvelope.details");
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
map[key ?? ""] = val ?? CallDetails.create();
|
|
288
|
+
}
|
|
289
|
+
internalBinaryWrite(message: CallsEnvelope, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
290
|
+
/* map<string, stream.video.coordinator.user_v1.User> users = 1; */
|
|
291
|
+
for (let k of Object.keys(message.users)) {
|
|
292
|
+
writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
|
|
293
|
+
writer.tag(2, WireType.LengthDelimited).fork();
|
|
294
|
+
User.internalBinaryWrite(message.users[k], writer, options);
|
|
295
|
+
writer.join().join();
|
|
296
|
+
}
|
|
297
|
+
/* repeated string call_cids = 2; */
|
|
298
|
+
for (let i = 0; i < message.callCids.length; i++)
|
|
299
|
+
writer.tag(2, WireType.LengthDelimited).string(message.callCids[i]);
|
|
300
|
+
/* map<string, stream.video.coordinator.call_v1.Call> calls = 3; */
|
|
301
|
+
for (let k of Object.keys(message.calls)) {
|
|
302
|
+
writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
|
|
303
|
+
writer.tag(2, WireType.LengthDelimited).fork();
|
|
304
|
+
Call.internalBinaryWrite(message.calls[k], writer, options);
|
|
305
|
+
writer.join().join();
|
|
306
|
+
}
|
|
307
|
+
/* map<string, stream.video.coordinator.call_v1.CallDetails> details = 4; */
|
|
308
|
+
for (let k of Object.keys(message.details)) {
|
|
309
|
+
writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
|
|
310
|
+
writer.tag(2, WireType.LengthDelimited).fork();
|
|
311
|
+
CallDetails.internalBinaryWrite(message.details[k], writer, options);
|
|
312
|
+
writer.join().join();
|
|
313
|
+
}
|
|
314
|
+
let u = options.writeUnknownFields;
|
|
315
|
+
if (u !== false)
|
|
316
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
317
|
+
return writer;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* @generated MessageType for protobuf message stream.video.coordinator.client_v1_rpc.CallsEnvelope
|
|
322
|
+
*/
|
|
323
|
+
export const CallsEnvelope = new CallsEnvelope$Type();
|
|
324
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
325
|
+
class MembersEnvelope$Type extends MessageType<MembersEnvelope> {
|
|
326
|
+
constructor() {
|
|
327
|
+
super("stream.video.coordinator.client_v1_rpc.MembersEnvelope", [
|
|
328
|
+
{ no: 1, name: "users", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => User } },
|
|
329
|
+
{ no: 2, name: "member_user_ids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
330
|
+
{ no: 3, name: "members", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Member } }
|
|
331
|
+
]);
|
|
332
|
+
}
|
|
333
|
+
create(value?: PartialMessage<MembersEnvelope>): MembersEnvelope {
|
|
334
|
+
const message = { users: {}, memberUserIds: [], members: {} };
|
|
335
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
336
|
+
if (value !== undefined)
|
|
337
|
+
reflectionMergePartial<MembersEnvelope>(this, message, value);
|
|
338
|
+
return message;
|
|
339
|
+
}
|
|
340
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MembersEnvelope): MembersEnvelope {
|
|
341
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
342
|
+
while (reader.pos < end) {
|
|
343
|
+
let [fieldNo, wireType] = reader.tag();
|
|
344
|
+
switch (fieldNo) {
|
|
345
|
+
case /* map<string, stream.video.coordinator.user_v1.User> users */ 1:
|
|
346
|
+
this.binaryReadMap1(message.users, reader, options);
|
|
347
|
+
break;
|
|
348
|
+
case /* repeated string member_user_ids */ 2:
|
|
349
|
+
message.memberUserIds.push(reader.string());
|
|
350
|
+
break;
|
|
351
|
+
case /* map<string, stream.video.coordinator.member_v1.Member> members */ 3:
|
|
352
|
+
this.binaryReadMap3(message.members, reader, options);
|
|
353
|
+
break;
|
|
354
|
+
default:
|
|
355
|
+
let u = options.readUnknownField;
|
|
356
|
+
if (u === "throw")
|
|
357
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
358
|
+
let d = reader.skip(wireType);
|
|
359
|
+
if (u !== false)
|
|
360
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return message;
|
|
364
|
+
}
|
|
365
|
+
private binaryReadMap1(map: MembersEnvelope["users"], reader: IBinaryReader, options: BinaryReadOptions): void {
|
|
366
|
+
let len = reader.uint32(), end = reader.pos + len, key: keyof MembersEnvelope["users"] | undefined, val: MembersEnvelope["users"][any] | undefined;
|
|
367
|
+
while (reader.pos < end) {
|
|
368
|
+
let [fieldNo, wireType] = reader.tag();
|
|
369
|
+
switch (fieldNo) {
|
|
370
|
+
case 1:
|
|
371
|
+
key = reader.string();
|
|
372
|
+
break;
|
|
373
|
+
case 2:
|
|
374
|
+
val = User.internalBinaryRead(reader, reader.uint32(), options);
|
|
375
|
+
break;
|
|
376
|
+
default: throw new globalThis.Error("unknown map entry field for field stream.video.coordinator.client_v1_rpc.MembersEnvelope.users");
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
map[key ?? ""] = val ?? User.create();
|
|
380
|
+
}
|
|
381
|
+
private binaryReadMap3(map: MembersEnvelope["members"], reader: IBinaryReader, options: BinaryReadOptions): void {
|
|
382
|
+
let len = reader.uint32(), end = reader.pos + len, key: keyof MembersEnvelope["members"] | undefined, val: MembersEnvelope["members"][any] | undefined;
|
|
383
|
+
while (reader.pos < end) {
|
|
384
|
+
let [fieldNo, wireType] = reader.tag();
|
|
385
|
+
switch (fieldNo) {
|
|
386
|
+
case 1:
|
|
387
|
+
key = reader.string();
|
|
388
|
+
break;
|
|
389
|
+
case 2:
|
|
390
|
+
val = Member.internalBinaryRead(reader, reader.uint32(), options);
|
|
391
|
+
break;
|
|
392
|
+
default: throw new globalThis.Error("unknown map entry field for field stream.video.coordinator.client_v1_rpc.MembersEnvelope.members");
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
map[key ?? ""] = val ?? Member.create();
|
|
396
|
+
}
|
|
397
|
+
internalBinaryWrite(message: MembersEnvelope, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
398
|
+
/* map<string, stream.video.coordinator.user_v1.User> users = 1; */
|
|
399
|
+
for (let k of Object.keys(message.users)) {
|
|
400
|
+
writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
|
|
401
|
+
writer.tag(2, WireType.LengthDelimited).fork();
|
|
402
|
+
User.internalBinaryWrite(message.users[k], writer, options);
|
|
403
|
+
writer.join().join();
|
|
404
|
+
}
|
|
405
|
+
/* repeated string member_user_ids = 2; */
|
|
406
|
+
for (let i = 0; i < message.memberUserIds.length; i++)
|
|
407
|
+
writer.tag(2, WireType.LengthDelimited).string(message.memberUserIds[i]);
|
|
408
|
+
/* map<string, stream.video.coordinator.member_v1.Member> members = 3; */
|
|
409
|
+
for (let k of Object.keys(message.members)) {
|
|
410
|
+
writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
|
|
411
|
+
writer.tag(2, WireType.LengthDelimited).fork();
|
|
412
|
+
Member.internalBinaryWrite(message.members[k], writer, options);
|
|
413
|
+
writer.join().join();
|
|
414
|
+
}
|
|
415
|
+
let u = options.writeUnknownFields;
|
|
416
|
+
if (u !== false)
|
|
417
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
418
|
+
return writer;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* @generated MessageType for protobuf message stream.video.coordinator.client_v1_rpc.MembersEnvelope
|
|
423
|
+
*/
|
|
424
|
+
export const MembersEnvelope = new MembersEnvelope$Type();
|