@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/push_v1/push.proto" (package "stream.video.coordinator.push_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 { Timestamp } from "../../../google/protobuf/timestamp";
16
+ /**
17
+ * Keep in sync with stream.config.push.PushProvider
18
+ *
19
+ * @generated from protobuf message stream.video.coordinator.push_v1.PushProvider
20
+ */
21
+ export interface PushProvider {
22
+ /**
23
+ * @generated from protobuf field: string id = 1;
24
+ */
25
+ id: string;
26
+ /**
27
+ * @generated from protobuf field: bool disabled = 2;
28
+ */
29
+ disabled: boolean;
30
+ /**
31
+ * @generated from protobuf field: string disabled_reason = 3;
32
+ */
33
+ disabledReason: string;
34
+ /**
35
+ * @generated from protobuf field: google.protobuf.Timestamp created_at = 4;
36
+ */
37
+ createdAt?: Timestamp;
38
+ /**
39
+ * @generated from protobuf field: google.protobuf.Timestamp updated_at = 5;
40
+ */
41
+ updatedAt?: Timestamp;
42
+ /**
43
+ * @generated from protobuf oneof: credentials
44
+ */
45
+ credentials: {
46
+ oneofKind: "apn";
47
+ /**
48
+ * @generated from protobuf field: stream.video.coordinator.push_v1.ApnCredentials apn = 6;
49
+ */
50
+ apn: ApnCredentials;
51
+ } | {
52
+ oneofKind: "firebase";
53
+ /**
54
+ * @generated from protobuf field: stream.video.coordinator.push_v1.FirebaseCredentials firebase = 7;
55
+ */
56
+ firebase: FirebaseCredentials;
57
+ } | {
58
+ oneofKind: "huawei";
59
+ /**
60
+ * @generated from protobuf field: stream.video.coordinator.push_v1.HuaweiCredentials huawei = 8;
61
+ */
62
+ huawei: HuaweiCredentials;
63
+ } | {
64
+ oneofKind: "xiaomi";
65
+ /**
66
+ * @generated from protobuf field: stream.video.coordinator.push_v1.XiaomiCredentials xiaomi = 9;
67
+ */
68
+ xiaomi: XiaomiCredentials;
69
+ } | {
70
+ oneofKind: undefined;
71
+ };
72
+ }
73
+ /**
74
+ * @generated from protobuf message stream.video.coordinator.push_v1.ApnCredentials
75
+ */
76
+ export interface ApnCredentials {
77
+ /**
78
+ * @generated from protobuf field: bytes certificate_p12 = 1;
79
+ */
80
+ certificateP12: Uint8Array;
81
+ /**
82
+ * @generated from protobuf field: string topic = 2;
83
+ */
84
+ topic: string;
85
+ /**
86
+ * @generated from protobuf field: string team_id = 3;
87
+ */
88
+ teamId: string;
89
+ }
90
+ /**
91
+ * @generated from protobuf message stream.video.coordinator.push_v1.FirebaseCredentials
92
+ */
93
+ export interface FirebaseCredentials {
94
+ /**
95
+ * @generated from protobuf field: string credentials = 1;
96
+ */
97
+ credentials: string;
98
+ }
99
+ /**
100
+ * @generated from protobuf message stream.video.coordinator.push_v1.HuaweiCredentials
101
+ */
102
+ export interface HuaweiCredentials {
103
+ /**
104
+ * @generated from protobuf field: string id = 1;
105
+ */
106
+ id: string;
107
+ /**
108
+ * @generated from protobuf field: string secret = 2;
109
+ */
110
+ secret: string;
111
+ }
112
+ /**
113
+ * @generated from protobuf message stream.video.coordinator.push_v1.XiaomiCredentials
114
+ */
115
+ export interface XiaomiCredentials {
116
+ /**
117
+ * @generated from protobuf field: string package_name = 1;
118
+ */
119
+ packageName: string;
120
+ /**
121
+ * @generated from protobuf field: string secret = 2;
122
+ */
123
+ secret: string;
124
+ }
125
+ /**
126
+ * @generated from protobuf message stream.video.coordinator.push_v1.Device
127
+ */
128
+ export interface Device {
129
+ /**
130
+ * @generated from protobuf field: string user_id = 1;
131
+ */
132
+ userId: string;
133
+ /**
134
+ * @generated from protobuf field: string id = 2;
135
+ */
136
+ id: string;
137
+ /**
138
+ * @generated from protobuf field: bool disabled = 3;
139
+ */
140
+ disabled: boolean;
141
+ /**
142
+ * @generated from protobuf field: string disabled_reason = 4;
143
+ */
144
+ disabledReason: string;
145
+ /**
146
+ * @generated from protobuf field: string push_provider_name = 5;
147
+ */
148
+ pushProviderName: string;
149
+ /**
150
+ * @generated from protobuf field: google.protobuf.Timestamp created_at = 6;
151
+ */
152
+ createdAt?: Timestamp;
153
+ /**
154
+ * @generated from protobuf field: google.protobuf.Timestamp updated_at = 7;
155
+ */
156
+ updatedAt?: Timestamp;
157
+ }
158
+ /**
159
+ * An object that is used in requests to create or update a device
160
+ *
161
+ * @generated from protobuf message stream.video.coordinator.push_v1.DeviceInput
162
+ */
163
+ export interface DeviceInput {
164
+ /**
165
+ * Unique device ID, specific to a provider
166
+ *
167
+ * @generated from protobuf field: string id = 1;
168
+ */
169
+ id: string;
170
+ /**
171
+ * Push provider ID, as configured in application push notification settings
172
+ * Refers to a set of credentials and templates of one of the supported push providers
173
+ *
174
+ * @generated from protobuf field: string push_provider_id = 2;
175
+ */
176
+ pushProviderId: string;
177
+ }
178
+ // @generated message type with reflection information, may provide speed optimized methods
179
+ class PushProvider$Type extends MessageType<PushProvider> {
180
+ constructor() {
181
+ super("stream.video.coordinator.push_v1.PushProvider", [
182
+ { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
183
+ { no: 2, name: "disabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
184
+ { no: 3, name: "disabled_reason", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
185
+ { no: 4, name: "created_at", kind: "message", T: () => Timestamp },
186
+ { no: 5, name: "updated_at", kind: "message", T: () => Timestamp },
187
+ { no: 6, name: "apn", kind: "message", oneof: "credentials", T: () => ApnCredentials },
188
+ { no: 7, name: "firebase", kind: "message", oneof: "credentials", T: () => FirebaseCredentials },
189
+ { no: 8, name: "huawei", kind: "message", oneof: "credentials", T: () => HuaweiCredentials },
190
+ { no: 9, name: "xiaomi", kind: "message", oneof: "credentials", T: () => XiaomiCredentials }
191
+ ]);
192
+ }
193
+ create(value?: PartialMessage<PushProvider>): PushProvider {
194
+ const message = { id: "", disabled: false, disabledReason: "", credentials: { oneofKind: undefined } };
195
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
196
+ if (value !== undefined)
197
+ reflectionMergePartial<PushProvider>(this, message, value);
198
+ return message;
199
+ }
200
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PushProvider): PushProvider {
201
+ let message = target ?? this.create(), end = reader.pos + length;
202
+ while (reader.pos < end) {
203
+ let [fieldNo, wireType] = reader.tag();
204
+ switch (fieldNo) {
205
+ case /* string id */ 1:
206
+ message.id = reader.string();
207
+ break;
208
+ case /* bool disabled */ 2:
209
+ message.disabled = reader.bool();
210
+ break;
211
+ case /* string disabled_reason */ 3:
212
+ message.disabledReason = reader.string();
213
+ break;
214
+ case /* google.protobuf.Timestamp created_at */ 4:
215
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
216
+ break;
217
+ case /* google.protobuf.Timestamp updated_at */ 5:
218
+ message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
219
+ break;
220
+ case /* stream.video.coordinator.push_v1.ApnCredentials apn */ 6:
221
+ message.credentials = {
222
+ oneofKind: "apn",
223
+ apn: ApnCredentials.internalBinaryRead(reader, reader.uint32(), options, (message.credentials as any).apn)
224
+ };
225
+ break;
226
+ case /* stream.video.coordinator.push_v1.FirebaseCredentials firebase */ 7:
227
+ message.credentials = {
228
+ oneofKind: "firebase",
229
+ firebase: FirebaseCredentials.internalBinaryRead(reader, reader.uint32(), options, (message.credentials as any).firebase)
230
+ };
231
+ break;
232
+ case /* stream.video.coordinator.push_v1.HuaweiCredentials huawei */ 8:
233
+ message.credentials = {
234
+ oneofKind: "huawei",
235
+ huawei: HuaweiCredentials.internalBinaryRead(reader, reader.uint32(), options, (message.credentials as any).huawei)
236
+ };
237
+ break;
238
+ case /* stream.video.coordinator.push_v1.XiaomiCredentials xiaomi */ 9:
239
+ message.credentials = {
240
+ oneofKind: "xiaomi",
241
+ xiaomi: XiaomiCredentials.internalBinaryRead(reader, reader.uint32(), options, (message.credentials as any).xiaomi)
242
+ };
243
+ break;
244
+ default:
245
+ let u = options.readUnknownField;
246
+ if (u === "throw")
247
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
248
+ let d = reader.skip(wireType);
249
+ if (u !== false)
250
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
251
+ }
252
+ }
253
+ return message;
254
+ }
255
+ internalBinaryWrite(message: PushProvider, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
256
+ /* string id = 1; */
257
+ if (message.id !== "")
258
+ writer.tag(1, WireType.LengthDelimited).string(message.id);
259
+ /* bool disabled = 2; */
260
+ if (message.disabled !== false)
261
+ writer.tag(2, WireType.Varint).bool(message.disabled);
262
+ /* string disabled_reason = 3; */
263
+ if (message.disabledReason !== "")
264
+ writer.tag(3, WireType.LengthDelimited).string(message.disabledReason);
265
+ /* google.protobuf.Timestamp created_at = 4; */
266
+ if (message.createdAt)
267
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
268
+ /* google.protobuf.Timestamp updated_at = 5; */
269
+ if (message.updatedAt)
270
+ Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
271
+ /* stream.video.coordinator.push_v1.ApnCredentials apn = 6; */
272
+ if (message.credentials.oneofKind === "apn")
273
+ ApnCredentials.internalBinaryWrite(message.credentials.apn, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
274
+ /* stream.video.coordinator.push_v1.FirebaseCredentials firebase = 7; */
275
+ if (message.credentials.oneofKind === "firebase")
276
+ FirebaseCredentials.internalBinaryWrite(message.credentials.firebase, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
277
+ /* stream.video.coordinator.push_v1.HuaweiCredentials huawei = 8; */
278
+ if (message.credentials.oneofKind === "huawei")
279
+ HuaweiCredentials.internalBinaryWrite(message.credentials.huawei, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
280
+ /* stream.video.coordinator.push_v1.XiaomiCredentials xiaomi = 9; */
281
+ if (message.credentials.oneofKind === "xiaomi")
282
+ XiaomiCredentials.internalBinaryWrite(message.credentials.xiaomi, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
283
+ let u = options.writeUnknownFields;
284
+ if (u !== false)
285
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
286
+ return writer;
287
+ }
288
+ }
289
+ /**
290
+ * @generated MessageType for protobuf message stream.video.coordinator.push_v1.PushProvider
291
+ */
292
+ export const PushProvider = new PushProvider$Type();
293
+ // @generated message type with reflection information, may provide speed optimized methods
294
+ class ApnCredentials$Type extends MessageType<ApnCredentials> {
295
+ constructor() {
296
+ super("stream.video.coordinator.push_v1.ApnCredentials", [
297
+ { no: 1, name: "certificate_p12", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
298
+ { no: 2, name: "topic", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
299
+ { no: 3, name: "team_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
300
+ ]);
301
+ }
302
+ create(value?: PartialMessage<ApnCredentials>): ApnCredentials {
303
+ const message = { certificateP12: new Uint8Array(0), topic: "", teamId: "" };
304
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
305
+ if (value !== undefined)
306
+ reflectionMergePartial<ApnCredentials>(this, message, value);
307
+ return message;
308
+ }
309
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ApnCredentials): ApnCredentials {
310
+ let message = target ?? this.create(), end = reader.pos + length;
311
+ while (reader.pos < end) {
312
+ let [fieldNo, wireType] = reader.tag();
313
+ switch (fieldNo) {
314
+ case /* bytes certificate_p12 */ 1:
315
+ message.certificateP12 = reader.bytes();
316
+ break;
317
+ case /* string topic */ 2:
318
+ message.topic = reader.string();
319
+ break;
320
+ case /* string team_id */ 3:
321
+ message.teamId = reader.string();
322
+ break;
323
+ default:
324
+ let u = options.readUnknownField;
325
+ if (u === "throw")
326
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
327
+ let d = reader.skip(wireType);
328
+ if (u !== false)
329
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
330
+ }
331
+ }
332
+ return message;
333
+ }
334
+ internalBinaryWrite(message: ApnCredentials, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
335
+ /* bytes certificate_p12 = 1; */
336
+ if (message.certificateP12.length)
337
+ writer.tag(1, WireType.LengthDelimited).bytes(message.certificateP12);
338
+ /* string topic = 2; */
339
+ if (message.topic !== "")
340
+ writer.tag(2, WireType.LengthDelimited).string(message.topic);
341
+ /* string team_id = 3; */
342
+ if (message.teamId !== "")
343
+ writer.tag(3, WireType.LengthDelimited).string(message.teamId);
344
+ let u = options.writeUnknownFields;
345
+ if (u !== false)
346
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
347
+ return writer;
348
+ }
349
+ }
350
+ /**
351
+ * @generated MessageType for protobuf message stream.video.coordinator.push_v1.ApnCredentials
352
+ */
353
+ export const ApnCredentials = new ApnCredentials$Type();
354
+ // @generated message type with reflection information, may provide speed optimized methods
355
+ class FirebaseCredentials$Type extends MessageType<FirebaseCredentials> {
356
+ constructor() {
357
+ super("stream.video.coordinator.push_v1.FirebaseCredentials", [
358
+ { no: 1, name: "credentials", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
359
+ ]);
360
+ }
361
+ create(value?: PartialMessage<FirebaseCredentials>): FirebaseCredentials {
362
+ const message = { credentials: "" };
363
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
364
+ if (value !== undefined)
365
+ reflectionMergePartial<FirebaseCredentials>(this, message, value);
366
+ return message;
367
+ }
368
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FirebaseCredentials): FirebaseCredentials {
369
+ let message = target ?? this.create(), end = reader.pos + length;
370
+ while (reader.pos < end) {
371
+ let [fieldNo, wireType] = reader.tag();
372
+ switch (fieldNo) {
373
+ case /* string credentials */ 1:
374
+ message.credentials = reader.string();
375
+ break;
376
+ default:
377
+ let u = options.readUnknownField;
378
+ if (u === "throw")
379
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
380
+ let d = reader.skip(wireType);
381
+ if (u !== false)
382
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
383
+ }
384
+ }
385
+ return message;
386
+ }
387
+ internalBinaryWrite(message: FirebaseCredentials, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
388
+ /* string credentials = 1; */
389
+ if (message.credentials !== "")
390
+ writer.tag(1, WireType.LengthDelimited).string(message.credentials);
391
+ let u = options.writeUnknownFields;
392
+ if (u !== false)
393
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
394
+ return writer;
395
+ }
396
+ }
397
+ /**
398
+ * @generated MessageType for protobuf message stream.video.coordinator.push_v1.FirebaseCredentials
399
+ */
400
+ export const FirebaseCredentials = new FirebaseCredentials$Type();
401
+ // @generated message type with reflection information, may provide speed optimized methods
402
+ class HuaweiCredentials$Type extends MessageType<HuaweiCredentials> {
403
+ constructor() {
404
+ super("stream.video.coordinator.push_v1.HuaweiCredentials", [
405
+ { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
406
+ { no: 2, name: "secret", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
407
+ ]);
408
+ }
409
+ create(value?: PartialMessage<HuaweiCredentials>): HuaweiCredentials {
410
+ const message = { id: "", secret: "" };
411
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
412
+ if (value !== undefined)
413
+ reflectionMergePartial<HuaweiCredentials>(this, message, value);
414
+ return message;
415
+ }
416
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HuaweiCredentials): HuaweiCredentials {
417
+ let message = target ?? this.create(), end = reader.pos + length;
418
+ while (reader.pos < end) {
419
+ let [fieldNo, wireType] = reader.tag();
420
+ switch (fieldNo) {
421
+ case /* string id */ 1:
422
+ message.id = reader.string();
423
+ break;
424
+ case /* string secret */ 2:
425
+ message.secret = reader.string();
426
+ break;
427
+ default:
428
+ let u = options.readUnknownField;
429
+ if (u === "throw")
430
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
431
+ let d = reader.skip(wireType);
432
+ if (u !== false)
433
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
434
+ }
435
+ }
436
+ return message;
437
+ }
438
+ internalBinaryWrite(message: HuaweiCredentials, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
439
+ /* string id = 1; */
440
+ if (message.id !== "")
441
+ writer.tag(1, WireType.LengthDelimited).string(message.id);
442
+ /* string secret = 2; */
443
+ if (message.secret !== "")
444
+ writer.tag(2, WireType.LengthDelimited).string(message.secret);
445
+ let u = options.writeUnknownFields;
446
+ if (u !== false)
447
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
448
+ return writer;
449
+ }
450
+ }
451
+ /**
452
+ * @generated MessageType for protobuf message stream.video.coordinator.push_v1.HuaweiCredentials
453
+ */
454
+ export const HuaweiCredentials = new HuaweiCredentials$Type();
455
+ // @generated message type with reflection information, may provide speed optimized methods
456
+ class XiaomiCredentials$Type extends MessageType<XiaomiCredentials> {
457
+ constructor() {
458
+ super("stream.video.coordinator.push_v1.XiaomiCredentials", [
459
+ { no: 1, name: "package_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
460
+ { no: 2, name: "secret", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
461
+ ]);
462
+ }
463
+ create(value?: PartialMessage<XiaomiCredentials>): XiaomiCredentials {
464
+ const message = { packageName: "", secret: "" };
465
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
466
+ if (value !== undefined)
467
+ reflectionMergePartial<XiaomiCredentials>(this, message, value);
468
+ return message;
469
+ }
470
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: XiaomiCredentials): XiaomiCredentials {
471
+ let message = target ?? this.create(), end = reader.pos + length;
472
+ while (reader.pos < end) {
473
+ let [fieldNo, wireType] = reader.tag();
474
+ switch (fieldNo) {
475
+ case /* string package_name */ 1:
476
+ message.packageName = reader.string();
477
+ break;
478
+ case /* string secret */ 2:
479
+ message.secret = reader.string();
480
+ break;
481
+ default:
482
+ let u = options.readUnknownField;
483
+ if (u === "throw")
484
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
485
+ let d = reader.skip(wireType);
486
+ if (u !== false)
487
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
488
+ }
489
+ }
490
+ return message;
491
+ }
492
+ internalBinaryWrite(message: XiaomiCredentials, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
493
+ /* string package_name = 1; */
494
+ if (message.packageName !== "")
495
+ writer.tag(1, WireType.LengthDelimited).string(message.packageName);
496
+ /* string secret = 2; */
497
+ if (message.secret !== "")
498
+ writer.tag(2, WireType.LengthDelimited).string(message.secret);
499
+ let u = options.writeUnknownFields;
500
+ if (u !== false)
501
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
502
+ return writer;
503
+ }
504
+ }
505
+ /**
506
+ * @generated MessageType for protobuf message stream.video.coordinator.push_v1.XiaomiCredentials
507
+ */
508
+ export const XiaomiCredentials = new XiaomiCredentials$Type();
509
+ // @generated message type with reflection information, may provide speed optimized methods
510
+ class Device$Type extends MessageType<Device> {
511
+ constructor() {
512
+ super("stream.video.coordinator.push_v1.Device", [
513
+ { no: 1, name: "user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
514
+ { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
515
+ { no: 3, name: "disabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
516
+ { no: 4, name: "disabled_reason", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
517
+ { no: 5, name: "push_provider_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
518
+ { no: 6, name: "created_at", kind: "message", T: () => Timestamp },
519
+ { no: 7, name: "updated_at", kind: "message", T: () => Timestamp }
520
+ ]);
521
+ }
522
+ create(value?: PartialMessage<Device>): Device {
523
+ const message = { userId: "", id: "", disabled: false, disabledReason: "", pushProviderName: "" };
524
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
525
+ if (value !== undefined)
526
+ reflectionMergePartial<Device>(this, message, value);
527
+ return message;
528
+ }
529
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Device): Device {
530
+ let message = target ?? this.create(), end = reader.pos + length;
531
+ while (reader.pos < end) {
532
+ let [fieldNo, wireType] = reader.tag();
533
+ switch (fieldNo) {
534
+ case /* string user_id */ 1:
535
+ message.userId = reader.string();
536
+ break;
537
+ case /* string id */ 2:
538
+ message.id = reader.string();
539
+ break;
540
+ case /* bool disabled */ 3:
541
+ message.disabled = reader.bool();
542
+ break;
543
+ case /* string disabled_reason */ 4:
544
+ message.disabledReason = reader.string();
545
+ break;
546
+ case /* string push_provider_name */ 5:
547
+ message.pushProviderName = reader.string();
548
+ break;
549
+ case /* google.protobuf.Timestamp created_at */ 6:
550
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
551
+ break;
552
+ case /* google.protobuf.Timestamp updated_at */ 7:
553
+ message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
554
+ break;
555
+ default:
556
+ let u = options.readUnknownField;
557
+ if (u === "throw")
558
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
559
+ let d = reader.skip(wireType);
560
+ if (u !== false)
561
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
562
+ }
563
+ }
564
+ return message;
565
+ }
566
+ internalBinaryWrite(message: Device, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
567
+ /* string user_id = 1; */
568
+ if (message.userId !== "")
569
+ writer.tag(1, WireType.LengthDelimited).string(message.userId);
570
+ /* string id = 2; */
571
+ if (message.id !== "")
572
+ writer.tag(2, WireType.LengthDelimited).string(message.id);
573
+ /* bool disabled = 3; */
574
+ if (message.disabled !== false)
575
+ writer.tag(3, WireType.Varint).bool(message.disabled);
576
+ /* string disabled_reason = 4; */
577
+ if (message.disabledReason !== "")
578
+ writer.tag(4, WireType.LengthDelimited).string(message.disabledReason);
579
+ /* string push_provider_name = 5; */
580
+ if (message.pushProviderName !== "")
581
+ writer.tag(5, WireType.LengthDelimited).string(message.pushProviderName);
582
+ /* google.protobuf.Timestamp created_at = 6; */
583
+ if (message.createdAt)
584
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
585
+ /* google.protobuf.Timestamp updated_at = 7; */
586
+ if (message.updatedAt)
587
+ Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
588
+ let u = options.writeUnknownFields;
589
+ if (u !== false)
590
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
591
+ return writer;
592
+ }
593
+ }
594
+ /**
595
+ * @generated MessageType for protobuf message stream.video.coordinator.push_v1.Device
596
+ */
597
+ export const Device = new Device$Type();
598
+ // @generated message type with reflection information, may provide speed optimized methods
599
+ class DeviceInput$Type extends MessageType<DeviceInput> {
600
+ constructor() {
601
+ super("stream.video.coordinator.push_v1.DeviceInput", [
602
+ { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
603
+ { no: 2, name: "push_provider_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
604
+ ]);
605
+ }
606
+ create(value?: PartialMessage<DeviceInput>): DeviceInput {
607
+ const message = { id: "", pushProviderId: "" };
608
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
609
+ if (value !== undefined)
610
+ reflectionMergePartial<DeviceInput>(this, message, value);
611
+ return message;
612
+ }
613
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeviceInput): DeviceInput {
614
+ let message = target ?? this.create(), end = reader.pos + length;
615
+ while (reader.pos < end) {
616
+ let [fieldNo, wireType] = reader.tag();
617
+ switch (fieldNo) {
618
+ case /* string id */ 1:
619
+ message.id = reader.string();
620
+ break;
621
+ case /* string push_provider_id */ 2:
622
+ message.pushProviderId = reader.string();
623
+ break;
624
+ default:
625
+ let u = options.readUnknownField;
626
+ if (u === "throw")
627
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
628
+ let d = reader.skip(wireType);
629
+ if (u !== false)
630
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
631
+ }
632
+ }
633
+ return message;
634
+ }
635
+ internalBinaryWrite(message: DeviceInput, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
636
+ /* string id = 1; */
637
+ if (message.id !== "")
638
+ writer.tag(1, WireType.LengthDelimited).string(message.id);
639
+ /* string push_provider_id = 2; */
640
+ if (message.pushProviderId !== "")
641
+ writer.tag(2, WireType.LengthDelimited).string(message.pushProviderId);
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.push_v1.DeviceInput
650
+ */
651
+ export const DeviceInput = new DeviceInput$Type();