@stream-io/video-client 0.0.28 → 0.0.29

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 (67) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/index.browser.es.js +2514 -1757
  3. package/dist/index.browser.es.js.map +1 -1
  4. package/dist/index.cjs.js +2534 -1755
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.es.js +2514 -1757
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/src/Call.d.ts +2 -3
  9. package/dist/src/StreamSfuClient.d.ts +23 -10
  10. package/dist/src/StreamVideoClient.d.ts +1 -4
  11. package/dist/src/client-details.d.ts +2 -1
  12. package/dist/src/coordinator/connection/types.d.ts +2 -2
  13. package/dist/src/coordinator/connection/utils.d.ts +1 -0
  14. package/dist/src/events/internal.d.ts +4 -0
  15. package/dist/src/gen/coordinator/index.d.ts +6 -0
  16. package/dist/src/gen/google/protobuf/struct.d.ts +8 -15
  17. package/dist/src/gen/google/protobuf/timestamp.d.ts +2 -9
  18. package/dist/src/gen/video/sfu/event/events.d.ts +121 -1
  19. package/dist/src/gen/video/sfu/models/models.d.ts +38 -1
  20. package/dist/src/gen/video/sfu/signal_rpc/signal.client.d.ts +3 -14
  21. package/dist/src/gen/video/sfu/signal_rpc/signal.d.ts +4 -12
  22. package/dist/src/logger.d.ts +4 -2
  23. package/dist/src/rtc/Dispatcher.d.ts +1 -2
  24. package/dist/src/rtc/{publisher.d.ts → Publisher.d.ts} +49 -15
  25. package/dist/src/rtc/Subscriber.d.ts +58 -0
  26. package/dist/src/rtc/__tests__/Subscriber.test.d.ts +1 -0
  27. package/dist/src/rtc/flows/join.d.ts +8 -1
  28. package/dist/src/rtc/index.d.ts +2 -2
  29. package/dist/src/rtc/signal.d.ts +1 -0
  30. package/dist/src/stats/state-store-stats-reporter.d.ts +3 -4
  31. package/dist/src/store/CallState.d.ts +10 -0
  32. package/package.json +3 -1
  33. package/src/Call.ts +215 -209
  34. package/src/StreamSfuClient.ts +48 -21
  35. package/src/StreamVideoClient.ts +7 -24
  36. package/src/client-details.ts +33 -1
  37. package/src/coordinator/connection/client.ts +6 -8
  38. package/src/coordinator/connection/types.ts +2 -3
  39. package/src/coordinator/connection/utils.ts +1 -0
  40. package/src/events/call.ts +0 -1
  41. package/src/events/callEventHandlers.ts +2 -0
  42. package/src/events/internal.ts +20 -0
  43. package/src/events/sessions.ts +0 -1
  44. package/src/gen/coordinator/index.ts +6 -0
  45. package/src/gen/google/protobuf/struct.ts +541 -333
  46. package/src/gen/google/protobuf/timestamp.ts +214 -148
  47. package/src/gen/video/sfu/event/events.ts +353 -3
  48. package/src/gen/video/sfu/models/models.ts +37 -0
  49. package/src/gen/video/sfu/signal_rpc/signal.client.ts +160 -94
  50. package/src/gen/video/sfu/signal_rpc/signal.ts +1214 -731
  51. package/src/logger.ts +43 -30
  52. package/src/rtc/Dispatcher.ts +5 -9
  53. package/src/rtc/{publisher.ts → Publisher.ts} +245 -111
  54. package/src/rtc/Subscriber.ts +304 -0
  55. package/src/rtc/__tests__/{publisher.test.ts → Publisher.test.ts} +77 -9
  56. package/src/rtc/__tests__/Subscriber.test.ts +121 -0
  57. package/src/rtc/__tests__/mocks/webrtc.mocks.ts +20 -0
  58. package/src/rtc/flows/join.ts +43 -2
  59. package/src/rtc/index.ts +2 -2
  60. package/src/rtc/signal.ts +6 -5
  61. package/src/rtc/videoLayers.ts +1 -4
  62. package/src/stats/state-store-stats-reporter.ts +3 -5
  63. package/src/store/CallState.ts +20 -0
  64. package/src/types.ts +0 -1
  65. package/dist/src/rtc/subscriber.d.ts +0 -9
  66. package/src/rtc/subscriber.ts +0 -107
  67. /package/dist/src/rtc/__tests__/{publisher.test.d.ts → Publisher.test.d.ts} +0 -0
@@ -2,107 +2,173 @@
2
2
  // @generated by protobuf-ts 2.8.1 with parameter long_type_string,client_generic,server_none,eslint_disable
3
3
  // @generated from protobuf file "video/sfu/signal_rpc/signal.proto" (package "stream.video.sfu.signal", syntax proto3)
4
4
  // tslint:disable
5
- import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
6
- import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
7
- import { SignalServer } from "./signal";
8
- import type { UpdateMuteStatesResponse } from "./signal";
9
- import type { UpdateMuteStatesRequest } from "./signal";
10
- import type { UpdateSubscriptionsResponse } from "./signal";
11
- import type { UpdateSubscriptionsRequest } from "./signal";
12
- import type { ICETrickleResponse } from "./signal";
13
- import type { ICETrickle } from "../models/models";
14
- import type { SendAnswerResponse } from "./signal";
15
- import type { SendAnswerRequest } from "./signal";
16
- import { stackIntercept } from "@protobuf-ts/runtime-rpc";
17
- import type { SetPublisherResponse } from "./signal";
18
- import type { SetPublisherRequest } from "./signal";
19
- import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
20
- import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
5
+ import type {
6
+ RpcOptions,
7
+ RpcTransport,
8
+ ServiceInfo,
9
+ UnaryCall,
10
+ } from '@protobuf-ts/runtime-rpc';
11
+ import { stackIntercept } from '@protobuf-ts/runtime-rpc';
12
+ import type {
13
+ ICETrickleResponse,
14
+ SendAnswerRequest,
15
+ SendAnswerResponse,
16
+ SetPublisherRequest,
17
+ SetPublisherResponse,
18
+ UpdateMuteStatesRequest,
19
+ UpdateMuteStatesResponse,
20
+ UpdateSubscriptionsRequest,
21
+ UpdateSubscriptionsResponse,
22
+ } from './signal';
23
+ import { SignalServer } from './signal';
24
+ import type { ICETrickle } from '../models/models';
25
+
21
26
  /**
22
27
  * @generated from protobuf service stream.video.sfu.signal.SignalServer
23
28
  */
24
29
  export interface ISignalServerClient {
25
- /**
26
- * SetPublisher sends the WebRTC offer for the peer connection used to publish A/V
27
- *
28
- * @generated from protobuf rpc: SetPublisher(stream.video.sfu.signal.SetPublisherRequest) returns (stream.video.sfu.signal.SetPublisherResponse);
29
- */
30
- setPublisher(input: SetPublisherRequest, options?: RpcOptions): UnaryCall<SetPublisherRequest, SetPublisherResponse>;
31
- /**
32
- * answer is sent by the client to the SFU after receiving a subscriber_offer.
33
- *
34
- * @generated from protobuf rpc: SendAnswer(stream.video.sfu.signal.SendAnswerRequest) returns (stream.video.sfu.signal.SendAnswerResponse);
35
- */
36
- sendAnswer(input: SendAnswerRequest, options?: RpcOptions): UnaryCall<SendAnswerRequest, SendAnswerResponse>;
37
- /**
38
- * SendICECandidate sends an ICE candidate to the client
39
- *
40
- * @generated from protobuf rpc: IceTrickle(stream.video.sfu.models.ICETrickle) returns (stream.video.sfu.signal.ICETrickleResponse);
41
- */
42
- iceTrickle(input: ICETrickle, options?: RpcOptions): UnaryCall<ICETrickle, ICETrickleResponse>;
43
- /**
44
- * UpdateSubscribers is used to notify the SFU about the list of video subscriptions
45
- * TODO: sync subscriptions based on this + update tracks using the dimension info sent by the user
46
- *
47
- * @generated from protobuf rpc: UpdateSubscriptions(stream.video.sfu.signal.UpdateSubscriptionsRequest) returns (stream.video.sfu.signal.UpdateSubscriptionsResponse);
48
- */
49
- updateSubscriptions(input: UpdateSubscriptionsRequest, options?: RpcOptions): UnaryCall<UpdateSubscriptionsRequest, UpdateSubscriptionsResponse>;
50
- /**
51
- * @generated from protobuf rpc: UpdateMuteStates(stream.video.sfu.signal.UpdateMuteStatesRequest) returns (stream.video.sfu.signal.UpdateMuteStatesResponse);
52
- */
53
- updateMuteStates(input: UpdateMuteStatesRequest, options?: RpcOptions): UnaryCall<UpdateMuteStatesRequest, UpdateMuteStatesResponse>;
30
+ /**
31
+ * SetPublisher sends the WebRTC offer for the peer connection used to publish A/V
32
+ *
33
+ * @generated from protobuf rpc: SetPublisher(stream.video.sfu.signal.SetPublisherRequest) returns (stream.video.sfu.signal.SetPublisherResponse);
34
+ */
35
+ setPublisher(
36
+ input: SetPublisherRequest,
37
+ options?: RpcOptions,
38
+ ): UnaryCall<SetPublisherRequest, SetPublisherResponse>;
39
+ /**
40
+ * answer is sent by the client to the SFU after receiving a subscriber_offer.
41
+ *
42
+ * @generated from protobuf rpc: SendAnswer(stream.video.sfu.signal.SendAnswerRequest) returns (stream.video.sfu.signal.SendAnswerResponse);
43
+ */
44
+ sendAnswer(
45
+ input: SendAnswerRequest,
46
+ options?: RpcOptions,
47
+ ): UnaryCall<SendAnswerRequest, SendAnswerResponse>;
48
+ /**
49
+ * SendICECandidate sends an ICE candidate to the client
50
+ *
51
+ * @generated from protobuf rpc: IceTrickle(stream.video.sfu.models.ICETrickle) returns (stream.video.sfu.signal.ICETrickleResponse);
52
+ */
53
+ iceTrickle(
54
+ input: ICETrickle,
55
+ options?: RpcOptions,
56
+ ): UnaryCall<ICETrickle, ICETrickleResponse>;
57
+ /**
58
+ * UpdateSubscribers is used to notify the SFU about the list of video subscriptions
59
+ * TODO: sync subscriptions based on this + update tracks using the dimension info sent by the user
60
+ *
61
+ * @generated from protobuf rpc: UpdateSubscriptions(stream.video.sfu.signal.UpdateSubscriptionsRequest) returns (stream.video.sfu.signal.UpdateSubscriptionsResponse);
62
+ */
63
+ updateSubscriptions(
64
+ input: UpdateSubscriptionsRequest,
65
+ options?: RpcOptions,
66
+ ): UnaryCall<UpdateSubscriptionsRequest, UpdateSubscriptionsResponse>;
67
+ /**
68
+ * @generated from protobuf rpc: UpdateMuteStates(stream.video.sfu.signal.UpdateMuteStatesRequest) returns (stream.video.sfu.signal.UpdateMuteStatesResponse);
69
+ */
70
+ updateMuteStates(
71
+ input: UpdateMuteStatesRequest,
72
+ options?: RpcOptions,
73
+ ): UnaryCall<UpdateMuteStatesRequest, UpdateMuteStatesResponse>;
54
74
  }
55
75
  /**
56
76
  * @generated from protobuf service stream.video.sfu.signal.SignalServer
57
77
  */
58
78
  export class SignalServerClient implements ISignalServerClient, ServiceInfo {
59
- typeName = SignalServer.typeName;
60
- methods = SignalServer.methods;
61
- options = SignalServer.options;
62
- constructor(private readonly _transport: RpcTransport) {
63
- }
64
- /**
65
- * SetPublisher sends the WebRTC offer for the peer connection used to publish A/V
66
- *
67
- * @generated from protobuf rpc: SetPublisher(stream.video.sfu.signal.SetPublisherRequest) returns (stream.video.sfu.signal.SetPublisherResponse);
68
- */
69
- setPublisher(input: SetPublisherRequest, options?: RpcOptions): UnaryCall<SetPublisherRequest, SetPublisherResponse> {
70
- const method = this.methods[0], opt = this._transport.mergeOptions(options);
71
- return stackIntercept<SetPublisherRequest, SetPublisherResponse>("unary", this._transport, method, opt, input);
72
- }
73
- /**
74
- * answer is sent by the client to the SFU after receiving a subscriber_offer.
75
- *
76
- * @generated from protobuf rpc: SendAnswer(stream.video.sfu.signal.SendAnswerRequest) returns (stream.video.sfu.signal.SendAnswerResponse);
77
- */
78
- sendAnswer(input: SendAnswerRequest, options?: RpcOptions): UnaryCall<SendAnswerRequest, SendAnswerResponse> {
79
- const method = this.methods[1], opt = this._transport.mergeOptions(options);
80
- return stackIntercept<SendAnswerRequest, SendAnswerResponse>("unary", this._transport, method, opt, input);
81
- }
82
- /**
83
- * SendICECandidate sends an ICE candidate to the client
84
- *
85
- * @generated from protobuf rpc: IceTrickle(stream.video.sfu.models.ICETrickle) returns (stream.video.sfu.signal.ICETrickleResponse);
86
- */
87
- iceTrickle(input: ICETrickle, options?: RpcOptions): UnaryCall<ICETrickle, ICETrickleResponse> {
88
- const method = this.methods[2], opt = this._transport.mergeOptions(options);
89
- return stackIntercept<ICETrickle, ICETrickleResponse>("unary", this._transport, method, opt, input);
90
- }
91
- /**
92
- * UpdateSubscribers is used to notify the SFU about the list of video subscriptions
93
- * TODO: sync subscriptions based on this + update tracks using the dimension info sent by the user
94
- *
95
- * @generated from protobuf rpc: UpdateSubscriptions(stream.video.sfu.signal.UpdateSubscriptionsRequest) returns (stream.video.sfu.signal.UpdateSubscriptionsResponse);
96
- */
97
- updateSubscriptions(input: UpdateSubscriptionsRequest, options?: RpcOptions): UnaryCall<UpdateSubscriptionsRequest, UpdateSubscriptionsResponse> {
98
- const method = this.methods[3], opt = this._transport.mergeOptions(options);
99
- return stackIntercept<UpdateSubscriptionsRequest, UpdateSubscriptionsResponse>("unary", this._transport, method, opt, input);
100
- }
101
- /**
102
- * @generated from protobuf rpc: UpdateMuteStates(stream.video.sfu.signal.UpdateMuteStatesRequest) returns (stream.video.sfu.signal.UpdateMuteStatesResponse);
103
- */
104
- updateMuteStates(input: UpdateMuteStatesRequest, options?: RpcOptions): UnaryCall<UpdateMuteStatesRequest, UpdateMuteStatesResponse> {
105
- const method = this.methods[4], opt = this._transport.mergeOptions(options);
106
- return stackIntercept<UpdateMuteStatesRequest, UpdateMuteStatesResponse>("unary", this._transport, method, opt, input);
107
- }
79
+ typeName = SignalServer.typeName;
80
+ methods = SignalServer.methods;
81
+ options = SignalServer.options;
82
+ constructor(private readonly _transport: RpcTransport) {}
83
+ /**
84
+ * SetPublisher sends the WebRTC offer for the peer connection used to publish A/V
85
+ *
86
+ * @generated from protobuf rpc: SetPublisher(stream.video.sfu.signal.SetPublisherRequest) returns (stream.video.sfu.signal.SetPublisherResponse);
87
+ */
88
+ setPublisher(
89
+ input: SetPublisherRequest,
90
+ options?: RpcOptions,
91
+ ): UnaryCall<SetPublisherRequest, SetPublisherResponse> {
92
+ const method = this.methods[0],
93
+ opt = this._transport.mergeOptions(options);
94
+ return stackIntercept<SetPublisherRequest, SetPublisherResponse>(
95
+ 'unary',
96
+ this._transport,
97
+ method,
98
+ opt,
99
+ input,
100
+ );
101
+ }
102
+ /**
103
+ * answer is sent by the client to the SFU after receiving a subscriber_offer.
104
+ *
105
+ * @generated from protobuf rpc: SendAnswer(stream.video.sfu.signal.SendAnswerRequest) returns (stream.video.sfu.signal.SendAnswerResponse);
106
+ */
107
+ sendAnswer(
108
+ input: SendAnswerRequest,
109
+ options?: RpcOptions,
110
+ ): UnaryCall<SendAnswerRequest, SendAnswerResponse> {
111
+ const method = this.methods[1],
112
+ opt = this._transport.mergeOptions(options);
113
+ return stackIntercept<SendAnswerRequest, SendAnswerResponse>(
114
+ 'unary',
115
+ this._transport,
116
+ method,
117
+ opt,
118
+ input,
119
+ );
120
+ }
121
+ /**
122
+ * SendICECandidate sends an ICE candidate to the client
123
+ *
124
+ * @generated from protobuf rpc: IceTrickle(stream.video.sfu.models.ICETrickle) returns (stream.video.sfu.signal.ICETrickleResponse);
125
+ */
126
+ iceTrickle(
127
+ input: ICETrickle,
128
+ options?: RpcOptions,
129
+ ): UnaryCall<ICETrickle, ICETrickleResponse> {
130
+ const method = this.methods[2],
131
+ opt = this._transport.mergeOptions(options);
132
+ return stackIntercept<ICETrickle, ICETrickleResponse>(
133
+ 'unary',
134
+ this._transport,
135
+ method,
136
+ opt,
137
+ input,
138
+ );
139
+ }
140
+ /**
141
+ * UpdateSubscribers is used to notify the SFU about the list of video subscriptions
142
+ * TODO: sync subscriptions based on this + update tracks using the dimension info sent by the user
143
+ *
144
+ * @generated from protobuf rpc: UpdateSubscriptions(stream.video.sfu.signal.UpdateSubscriptionsRequest) returns (stream.video.sfu.signal.UpdateSubscriptionsResponse);
145
+ */
146
+ updateSubscriptions(
147
+ input: UpdateSubscriptionsRequest,
148
+ options?: RpcOptions,
149
+ ): UnaryCall<UpdateSubscriptionsRequest, UpdateSubscriptionsResponse> {
150
+ const method = this.methods[3],
151
+ opt = this._transport.mergeOptions(options);
152
+ return stackIntercept<
153
+ UpdateSubscriptionsRequest,
154
+ UpdateSubscriptionsResponse
155
+ >('unary', this._transport, method, opt, input);
156
+ }
157
+ /**
158
+ * @generated from protobuf rpc: UpdateMuteStates(stream.video.sfu.signal.UpdateMuteStatesRequest) returns (stream.video.sfu.signal.UpdateMuteStatesResponse);
159
+ */
160
+ updateMuteStates(
161
+ input: UpdateMuteStatesRequest,
162
+ options?: RpcOptions,
163
+ ): UnaryCall<UpdateMuteStatesRequest, UpdateMuteStatesResponse> {
164
+ const method = this.methods[4],
165
+ opt = this._transport.mergeOptions(options);
166
+ return stackIntercept<UpdateMuteStatesRequest, UpdateMuteStatesResponse>(
167
+ 'unary',
168
+ this._transport,
169
+ method,
170
+ opt,
171
+ input,
172
+ );
173
+ }
108
174
  }