@livekit/rtc-node 0.10.4 → 0.11.1

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 (136) hide show
  1. package/README.md +54 -2
  2. package/build.rs +1 -1
  3. package/dist/audio_frame.d.ts +1 -1
  4. package/dist/audio_frame.d.ts.map +1 -1
  5. package/dist/audio_frame.js +4 -4
  6. package/dist/audio_frame.js.map +1 -1
  7. package/dist/audio_resampler.d.ts.map +1 -1
  8. package/dist/audio_resampler.js +8 -7
  9. package/dist/audio_resampler.js.map +1 -1
  10. package/dist/audio_source.d.ts.map +1 -1
  11. package/dist/audio_source.js +8 -4
  12. package/dist/audio_source.js.map +1 -1
  13. package/dist/audio_stream.d.ts +1 -1
  14. package/dist/audio_stream.d.ts.map +1 -1
  15. package/dist/audio_stream.js +4 -3
  16. package/dist/audio_stream.js.map +1 -1
  17. package/dist/e2ee.d.ts.map +1 -1
  18. package/dist/e2ee.js +25 -25
  19. package/dist/e2ee.js.map +1 -1
  20. package/dist/ffi_client.d.ts +3 -3
  21. package/dist/ffi_client.d.ts.map +1 -1
  22. package/dist/ffi_client.js +9 -7
  23. package/dist/ffi_client.js.map +1 -1
  24. package/dist/index.d.ts +29 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +34 -4
  27. package/dist/index.js.map +1 -1
  28. package/dist/napi/native.d.ts +1 -0
  29. package/dist/participant.d.ts +48 -2
  30. package/dist/participant.d.ts.map +1 -1
  31. package/dist/participant.js +143 -24
  32. package/dist/participant.js.map +1 -1
  33. package/dist/proto/audio_frame_pb.d.ts +451 -526
  34. package/dist/proto/audio_frame_pb.d.ts.map +1 -1
  35. package/dist/proto/audio_frame_pb.js +200 -1179
  36. package/dist/proto/audio_frame_pb.js.map +1 -1
  37. package/dist/proto/e2ee_pb.d.ts +264 -333
  38. package/dist/proto/e2ee_pb.d.ts.map +1 -1
  39. package/dist/proto/e2ee_pb.js +136 -810
  40. package/dist/proto/e2ee_pb.js.map +1 -1
  41. package/dist/proto/ffi_pb.d.ts +175 -129
  42. package/dist/proto/ffi_pb.d.ts.map +1 -1
  43. package/dist/proto/ffi_pb.js +58 -395
  44. package/dist/proto/ffi_pb.js.map +1 -1
  45. package/dist/proto/handle_pb.d.ts +14 -13
  46. package/dist/proto/handle_pb.d.ts.map +1 -1
  47. package/dist/proto/handle_pb.js +8 -39
  48. package/dist/proto/handle_pb.js.map +1 -1
  49. package/dist/proto/participant_pb.d.ts +54 -52
  50. package/dist/proto/participant_pb.d.ts.map +1 -1
  51. package/dist/proto/participant_pb.js +18 -90
  52. package/dist/proto/participant_pb.js.map +1 -1
  53. package/dist/proto/room_pb.d.ts +1042 -1187
  54. package/dist/proto/room_pb.d.ts.map +1 -1
  55. package/dist/proto/room_pb.js +470 -2938
  56. package/dist/proto/room_pb.js.map +1 -1
  57. package/dist/proto/rpc_pb.d.ts +235 -0
  58. package/dist/proto/rpc_pb.d.ts.map +1 -0
  59. package/dist/proto/rpc_pb.js +74 -0
  60. package/dist/proto/rpc_pb.js.map +1 -0
  61. package/dist/proto/stats_pb.d.ts +738 -800
  62. package/dist/proto/stats_pb.d.ts.map +1 -1
  63. package/dist/proto/stats_pb.js +218 -1960
  64. package/dist/proto/stats_pb.js.map +1 -1
  65. package/dist/proto/track_pb.d.ts +225 -258
  66. package/dist/proto/track_pb.d.ts.map +1 -1
  67. package/dist/proto/track_pb.js +98 -591
  68. package/dist/proto/track_pb.js.map +1 -1
  69. package/dist/proto/video_frame_pb.d.ts +357 -390
  70. package/dist/proto/video_frame_pb.d.ts.map +1 -1
  71. package/dist/proto/video_frame_pb.js +137 -790
  72. package/dist/proto/video_frame_pb.js.map +1 -1
  73. package/dist/room.d.ts +21 -7
  74. package/dist/room.d.ts.map +1 -1
  75. package/dist/room.js +134 -54
  76. package/dist/room.js.map +1 -1
  77. package/dist/rpc.d.ts +78 -0
  78. package/dist/rpc.d.ts.map +1 -0
  79. package/dist/rpc.js +69 -0
  80. package/dist/rpc.js.map +1 -0
  81. package/dist/track.d.ts.map +1 -1
  82. package/dist/track.js +7 -3
  83. package/dist/track.js.map +1 -1
  84. package/dist/track_publication.d.ts.map +1 -1
  85. package/dist/track_publication.js +3 -2
  86. package/dist/track_publication.js.map +1 -1
  87. package/dist/version.d.ts +2 -0
  88. package/dist/version.d.ts.map +1 -0
  89. package/dist/version.js +2 -0
  90. package/dist/version.js.map +1 -0
  91. package/dist/video_frame.d.ts +2 -2
  92. package/dist/video_frame.d.ts.map +1 -1
  93. package/dist/video_frame.js +47 -25
  94. package/dist/video_frame.js.map +1 -1
  95. package/dist/video_source.d.ts.map +1 -1
  96. package/dist/video_source.js +4 -3
  97. package/dist/video_source.js.map +1 -1
  98. package/dist/video_stream.d.ts +1 -1
  99. package/dist/video_stream.d.ts.map +1 -1
  100. package/dist/video_stream.js +7 -3
  101. package/dist/video_stream.js.map +1 -1
  102. package/package.json +13 -10
  103. package/src/audio_frame.ts +6 -6
  104. package/src/audio_resampler.ts +10 -9
  105. package/src/audio_source.ts +9 -8
  106. package/src/audio_stream.ts +7 -6
  107. package/src/e2ee.ts +34 -34
  108. package/src/ffi_client.ts +23 -10
  109. package/src/index.ts +61 -2
  110. package/src/napi/native.d.ts +1 -0
  111. package/src/nodejs.rs +6 -3
  112. package/src/participant.ts +207 -47
  113. package/src/proto/audio_frame_pb.ts +562 -1279
  114. package/src/proto/e2ee_pb.ts +365 -886
  115. package/src/proto/ffi_pb.ts +206 -405
  116. package/src/proto/handle_pb.ts +21 -35
  117. package/src/proto/participant_pb.ts +71 -112
  118. package/src/proto/room_pb.ts +1284 -2995
  119. package/src/proto/rpc_pb.ts +310 -0
  120. package/src/proto/stats_pb.ts +1028 -1947
  121. package/src/proto/track_pb.ts +287 -621
  122. package/src/proto/video_frame_pb.ts +445 -905
  123. package/src/room.ts +181 -75
  124. package/src/rpc.ts +121 -0
  125. package/src/track.ts +8 -7
  126. package/src/track_publication.ts +5 -4
  127. package/src/version.ts +1 -0
  128. package/src/video_frame.ts +54 -27
  129. package/src/video_source.ts +7 -6
  130. package/src/video_stream.ts +7 -6
  131. package/dist/utils.d.ts +0 -7
  132. package/dist/utils.d.ts.map +0 -1
  133. package/dist/utils.js +0 -48
  134. package/dist/utils.js.map +0 -1
  135. package/src/utils.test.ts +0 -47
  136. package/src/utils.ts +0 -44
@@ -0,0 +1,310 @@
1
+ // Copyright 2023 LiveKit, Inc.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ // @generated by protoc-gen-es v2.2.0 with parameter "target=ts,import_extension=js"
16
+ // @generated from file rpc.proto (package livekit.proto, syntax proto2)
17
+ /* eslint-disable */
18
+
19
+ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
20
+ import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
21
+ import type { Message } from "@bufbuild/protobuf";
22
+
23
+ /**
24
+ * Describes the file rpc.proto.
25
+ */
26
+ export const file_rpc: GenFile = /*@__PURE__*/
27
+ fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIk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type RpcError = Message<"livekit.proto.RpcError"> & {
33
+ /**
34
+ * @generated from field: required uint32 code = 1;
35
+ */
36
+ code: number;
37
+
38
+ /**
39
+ * @generated from field: required string message = 2;
40
+ */
41
+ message: string;
42
+
43
+ /**
44
+ * @generated from field: optional string data = 3;
45
+ */
46
+ data: string;
47
+ };
48
+
49
+ /**
50
+ * Describes the message livekit.proto.RpcError.
51
+ * Use `create(RpcErrorSchema)` to create a new message.
52
+ */
53
+ export const RpcErrorSchema: GenMessage<RpcError> = /*@__PURE__*/
54
+ messageDesc(file_rpc, 0);
55
+
56
+ /**
57
+ * FFI Requests
58
+ *
59
+ * @generated from message livekit.proto.PerformRpcRequest
60
+ */
61
+ export type PerformRpcRequest = Message<"livekit.proto.PerformRpcRequest"> & {
62
+ /**
63
+ * @generated from field: required uint64 local_participant_handle = 1;
64
+ */
65
+ localParticipantHandle: bigint;
66
+
67
+ /**
68
+ * @generated from field: required string destination_identity = 2;
69
+ */
70
+ destinationIdentity: string;
71
+
72
+ /**
73
+ * @generated from field: required string method = 3;
74
+ */
75
+ method: string;
76
+
77
+ /**
78
+ * @generated from field: required string payload = 4;
79
+ */
80
+ payload: string;
81
+
82
+ /**
83
+ * @generated from field: optional uint32 response_timeout_ms = 5;
84
+ */
85
+ responseTimeoutMs: number;
86
+ };
87
+
88
+ /**
89
+ * Describes the message livekit.proto.PerformRpcRequest.
90
+ * Use `create(PerformRpcRequestSchema)` to create a new message.
91
+ */
92
+ export const PerformRpcRequestSchema: GenMessage<PerformRpcRequest> = /*@__PURE__*/
93
+ messageDesc(file_rpc, 1);
94
+
95
+ /**
96
+ * @generated from message livekit.proto.RegisterRpcMethodRequest
97
+ */
98
+ export type RegisterRpcMethodRequest = Message<"livekit.proto.RegisterRpcMethodRequest"> & {
99
+ /**
100
+ * @generated from field: required uint64 local_participant_handle = 1;
101
+ */
102
+ localParticipantHandle: bigint;
103
+
104
+ /**
105
+ * @generated from field: required string method = 2;
106
+ */
107
+ method: string;
108
+ };
109
+
110
+ /**
111
+ * Describes the message livekit.proto.RegisterRpcMethodRequest.
112
+ * Use `create(RegisterRpcMethodRequestSchema)` to create a new message.
113
+ */
114
+ export const RegisterRpcMethodRequestSchema: GenMessage<RegisterRpcMethodRequest> = /*@__PURE__*/
115
+ messageDesc(file_rpc, 2);
116
+
117
+ /**
118
+ * @generated from message livekit.proto.UnregisterRpcMethodRequest
119
+ */
120
+ export type UnregisterRpcMethodRequest = Message<"livekit.proto.UnregisterRpcMethodRequest"> & {
121
+ /**
122
+ * @generated from field: required uint64 local_participant_handle = 1;
123
+ */
124
+ localParticipantHandle: bigint;
125
+
126
+ /**
127
+ * @generated from field: required string method = 2;
128
+ */
129
+ method: string;
130
+ };
131
+
132
+ /**
133
+ * Describes the message livekit.proto.UnregisterRpcMethodRequest.
134
+ * Use `create(UnregisterRpcMethodRequestSchema)` to create a new message.
135
+ */
136
+ export const UnregisterRpcMethodRequestSchema: GenMessage<UnregisterRpcMethodRequest> = /*@__PURE__*/
137
+ messageDesc(file_rpc, 3);
138
+
139
+ /**
140
+ * @generated from message livekit.proto.RpcMethodInvocationResponseRequest
141
+ */
142
+ export type RpcMethodInvocationResponseRequest = Message<"livekit.proto.RpcMethodInvocationResponseRequest"> & {
143
+ /**
144
+ * @generated from field: required uint64 local_participant_handle = 1;
145
+ */
146
+ localParticipantHandle: bigint;
147
+
148
+ /**
149
+ * @generated from field: required uint64 invocation_id = 2;
150
+ */
151
+ invocationId: bigint;
152
+
153
+ /**
154
+ * @generated from field: optional string payload = 3;
155
+ */
156
+ payload: string;
157
+
158
+ /**
159
+ * @generated from field: optional livekit.proto.RpcError error = 4;
160
+ */
161
+ error?: RpcError;
162
+ };
163
+
164
+ /**
165
+ * Describes the message livekit.proto.RpcMethodInvocationResponseRequest.
166
+ * Use `create(RpcMethodInvocationResponseRequestSchema)` to create a new message.
167
+ */
168
+ export const RpcMethodInvocationResponseRequestSchema: GenMessage<RpcMethodInvocationResponseRequest> = /*@__PURE__*/
169
+ messageDesc(file_rpc, 4);
170
+
171
+ /**
172
+ * FFI Responses
173
+ *
174
+ * @generated from message livekit.proto.PerformRpcResponse
175
+ */
176
+ export type PerformRpcResponse = Message<"livekit.proto.PerformRpcResponse"> & {
177
+ /**
178
+ * @generated from field: required uint64 async_id = 1;
179
+ */
180
+ asyncId: bigint;
181
+ };
182
+
183
+ /**
184
+ * Describes the message livekit.proto.PerformRpcResponse.
185
+ * Use `create(PerformRpcResponseSchema)` to create a new message.
186
+ */
187
+ export const PerformRpcResponseSchema: GenMessage<PerformRpcResponse> = /*@__PURE__*/
188
+ messageDesc(file_rpc, 5);
189
+
190
+ /**
191
+ * @generated from message livekit.proto.RegisterRpcMethodResponse
192
+ */
193
+ export type RegisterRpcMethodResponse = Message<"livekit.proto.RegisterRpcMethodResponse"> & {
194
+ };
195
+
196
+ /**
197
+ * Describes the message livekit.proto.RegisterRpcMethodResponse.
198
+ * Use `create(RegisterRpcMethodResponseSchema)` to create a new message.
199
+ */
200
+ export const RegisterRpcMethodResponseSchema: GenMessage<RegisterRpcMethodResponse> = /*@__PURE__*/
201
+ messageDesc(file_rpc, 6);
202
+
203
+ /**
204
+ * @generated from message livekit.proto.UnregisterRpcMethodResponse
205
+ */
206
+ export type UnregisterRpcMethodResponse = Message<"livekit.proto.UnregisterRpcMethodResponse"> & {
207
+ };
208
+
209
+ /**
210
+ * Describes the message livekit.proto.UnregisterRpcMethodResponse.
211
+ * Use `create(UnregisterRpcMethodResponseSchema)` to create a new message.
212
+ */
213
+ export const UnregisterRpcMethodResponseSchema: GenMessage<UnregisterRpcMethodResponse> = /*@__PURE__*/
214
+ messageDesc(file_rpc, 7);
215
+
216
+ /**
217
+ * @generated from message livekit.proto.RpcMethodInvocationResponseResponse
218
+ */
219
+ export type RpcMethodInvocationResponseResponse = Message<"livekit.proto.RpcMethodInvocationResponseResponse"> & {
220
+ /**
221
+ * @generated from field: optional string error = 1;
222
+ */
223
+ error: string;
224
+ };
225
+
226
+ /**
227
+ * Describes the message livekit.proto.RpcMethodInvocationResponseResponse.
228
+ * Use `create(RpcMethodInvocationResponseResponseSchema)` to create a new message.
229
+ */
230
+ export const RpcMethodInvocationResponseResponseSchema: GenMessage<RpcMethodInvocationResponseResponse> = /*@__PURE__*/
231
+ messageDesc(file_rpc, 8);
232
+
233
+ /**
234
+ * FFI Callbacks
235
+ *
236
+ * @generated from message livekit.proto.PerformRpcCallback
237
+ */
238
+ export type PerformRpcCallback = Message<"livekit.proto.PerformRpcCallback"> & {
239
+ /**
240
+ * @generated from field: required uint64 async_id = 1;
241
+ */
242
+ asyncId: bigint;
243
+
244
+ /**
245
+ * @generated from field: optional string payload = 2;
246
+ */
247
+ payload: string;
248
+
249
+ /**
250
+ * @generated from field: optional livekit.proto.RpcError error = 3;
251
+ */
252
+ error?: RpcError;
253
+ };
254
+
255
+ /**
256
+ * Describes the message livekit.proto.PerformRpcCallback.
257
+ * Use `create(PerformRpcCallbackSchema)` to create a new message.
258
+ */
259
+ export const PerformRpcCallbackSchema: GenMessage<PerformRpcCallback> = /*@__PURE__*/
260
+ messageDesc(file_rpc, 9);
261
+
262
+ /**
263
+ * FFI Events
264
+ *
265
+ * @generated from message livekit.proto.RpcMethodInvocationEvent
266
+ */
267
+ export type RpcMethodInvocationEvent = Message<"livekit.proto.RpcMethodInvocationEvent"> & {
268
+ /**
269
+ * @generated from field: required uint64 local_participant_handle = 1;
270
+ */
271
+ localParticipantHandle: bigint;
272
+
273
+ /**
274
+ * @generated from field: required uint64 invocation_id = 2;
275
+ */
276
+ invocationId: bigint;
277
+
278
+ /**
279
+ * @generated from field: required string method = 3;
280
+ */
281
+ method: string;
282
+
283
+ /**
284
+ * @generated from field: required string request_id = 4;
285
+ */
286
+ requestId: string;
287
+
288
+ /**
289
+ * @generated from field: required string caller_identity = 5;
290
+ */
291
+ callerIdentity: string;
292
+
293
+ /**
294
+ * @generated from field: required string payload = 6;
295
+ */
296
+ payload: string;
297
+
298
+ /**
299
+ * @generated from field: required uint32 response_timeout_ms = 7;
300
+ */
301
+ responseTimeoutMs: number;
302
+ };
303
+
304
+ /**
305
+ * Describes the message livekit.proto.RpcMethodInvocationEvent.
306
+ * Use `create(RpcMethodInvocationEventSchema)` to create a new message.
307
+ */
308
+ export const RpcMethodInvocationEventSchema: GenMessage<RpcMethodInvocationEvent> = /*@__PURE__*/
309
+ messageDesc(file_rpc, 10);
310
+