@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
@@ -12,13 +12,19 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
- // @generated by protoc-gen-es v1.10.0 with parameter "target=ts"
16
- // @generated from file handle.proto (package livekit.proto, syntax proto3)
15
+ // @generated by protoc-gen-es v2.2.0 with parameter "target=ts,import_extension=js"
16
+ // @generated from file handle.proto (package livekit.proto, syntax proto2)
17
17
  /* eslint-disable */
18
- // @ts-nocheck
19
18
 
20
- import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
21
- import { Message, proto3, protoInt64 } from "@bufbuild/protobuf";
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 handle.proto.
25
+ */
26
+ export const file_handle: GenFile = /*@__PURE__*/
27
+ fileDesc("CgxoYW5kbGUucHJvdG8SDWxpdmVraXQucHJvdG8iHAoORmZpT3duZWRIYW5kbGUSCgoCaWQYASACKARCEKoCDUxpdmVLaXQuUHJvdG8");
22
28
 
23
29
  /**
24
30
  * # Safety
@@ -33,37 +39,17 @@ import { Message, proto3, protoInt64 } from "@bufbuild/protobuf";
33
39
  *
34
40
  * @generated from message livekit.proto.FfiOwnedHandle
35
41
  */
36
- export class FfiOwnedHandle extends Message<FfiOwnedHandle> {
42
+ export type FfiOwnedHandle = Message<"livekit.proto.FfiOwnedHandle"> & {
37
43
  /**
38
- * @generated from field: uint64 id = 1;
44
+ * @generated from field: required uint64 id = 1;
39
45
  */
40
- id = protoInt64.zero;
41
-
42
- constructor(data?: PartialMessage<FfiOwnedHandle>) {
43
- super();
44
- proto3.util.initPartial(data, this);
45
- }
46
-
47
- static readonly runtime: typeof proto3 = proto3;
48
- static readonly typeName = "livekit.proto.FfiOwnedHandle";
49
- static readonly fields: FieldList = proto3.util.newFieldList(() => [
50
- { no: 1, name: "id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
51
- ]);
46
+ id: bigint;
47
+ };
52
48
 
53
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FfiOwnedHandle {
54
- return new FfiOwnedHandle().fromBinary(bytes, options);
55
- }
56
-
57
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): FfiOwnedHandle {
58
- return new FfiOwnedHandle().fromJson(jsonValue, options);
59
- }
60
-
61
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): FfiOwnedHandle {
62
- return new FfiOwnedHandle().fromJsonString(jsonString, options);
63
- }
64
-
65
- static equals(a: FfiOwnedHandle | PlainMessage<FfiOwnedHandle> | undefined, b: FfiOwnedHandle | PlainMessage<FfiOwnedHandle> | undefined): boolean {
66
- return proto3.util.equals(FfiOwnedHandle, a, b);
67
- }
68
- }
49
+ /**
50
+ * Describes the message livekit.proto.FfiOwnedHandle.
51
+ * Use `create(FfiOwnedHandleSchema)` to create a new message.
52
+ */
53
+ export const FfiOwnedHandleSchema: GenMessage<FfiOwnedHandle> = /*@__PURE__*/
54
+ messageDesc(file_handle, 0);
69
55
 
@@ -12,160 +12,119 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
- // @generated by protoc-gen-es v1.10.0 with parameter "target=ts"
16
- // @generated from file participant.proto (package livekit.proto, syntax proto3)
15
+ // @generated by protoc-gen-es v2.2.0 with parameter "target=ts,import_extension=js"
16
+ // @generated from file participant.proto (package livekit.proto, syntax proto2)
17
17
  /* eslint-disable */
18
- // @ts-nocheck
19
18
 
20
- import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
21
- import { Message, proto3 } from "@bufbuild/protobuf";
22
- import { FfiOwnedHandle } from "./handle_pb.js";
19
+ import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
20
+ import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
21
+ import type { FfiOwnedHandle } from "./handle_pb.js";
22
+ import { file_handle } from "./handle_pb.js";
23
+ import type { Message } from "@bufbuild/protobuf";
23
24
 
24
25
  /**
25
- * @generated from enum livekit.proto.ParticipantKind
26
+ * Describes the file participant.proto.
26
27
  */
27
- export enum ParticipantKind {
28
+ export const file_participant: GenFile = /*@__PURE__*/
29
+ fileDesc("ChFwYXJ0aWNpcGFudC5wcm90bxINbGl2ZWtpdC5wcm90byL1AQoPUGFydGljaXBhbnRJbmZvEgsKA3NpZBgBIAIoCRIMCgRuYW1lGAIgAigJEhAKCGlkZW50aXR5GAMgAigJEhAKCG1ldGFkYXRhGAQgAigJEkIKCmF0dHJpYnV0ZXMYBSADKAsyLi5saXZla2l0LnByb3RvLlBhcnRpY2lwYW50SW5mby5BdHRyaWJ1dGVzRW50cnkSLAoEa2luZBgGIAIoDjIeLmxpdmVraXQucHJvdG8uUGFydGljaXBhbnRLaW5kGjEKD0F0dHJpYnV0ZXNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIm8KEE93bmVkUGFydGljaXBhbnQSLQoGaGFuZGxlGAEgAigLMh0ubGl2ZWtpdC5wcm90by5GZmlPd25lZEhhbmRsZRIsCgRpbmZvGAIgAigLMh4ubGl2ZWtpdC5wcm90by5QYXJ0aWNpcGFudEluZm8qoQEKD1BhcnRpY2lwYW50S2luZBIdChlQQVJUSUNJUEFOVF9LSU5EX1NUQU5EQVJEEAASHAoYUEFSVElDSVBBTlRfS0lORF9JTkdSRVNTEAESGwoXUEFSVElDSVBBTlRfS0lORF9FR1JFU1MQAhIYChRQQVJUSUNJUEFOVF9LSU5EX1NJUBADEhoKFlBBUlRJQ0lQQU5UX0tJTkRfQUdFTlQQBEIQqgINTGl2ZUtpdC5Qcm90bw", [file_handle]);
30
+
31
+ /**
32
+ * @generated from message livekit.proto.ParticipantInfo
33
+ */
34
+ export type ParticipantInfo = Message<"livekit.proto.ParticipantInfo"> & {
28
35
  /**
29
- * @generated from enum value: PARTICIPANT_KIND_STANDARD = 0;
36
+ * @generated from field: required string sid = 1;
30
37
  */
31
- STANDARD = 0,
38
+ sid: string;
32
39
 
33
40
  /**
34
- * @generated from enum value: PARTICIPANT_KIND_INGRESS = 1;
41
+ * @generated from field: required string name = 2;
35
42
  */
36
- INGRESS = 1,
43
+ name: string;
37
44
 
38
45
  /**
39
- * @generated from enum value: PARTICIPANT_KIND_EGRESS = 2;
46
+ * @generated from field: required string identity = 3;
40
47
  */
41
- EGRESS = 2,
48
+ identity: string;
42
49
 
43
50
  /**
44
- * @generated from enum value: PARTICIPANT_KIND_SIP = 3;
51
+ * @generated from field: required string metadata = 4;
45
52
  */
46
- SIP = 3,
53
+ metadata: string;
47
54
 
48
55
  /**
49
- * @generated from enum value: PARTICIPANT_KIND_AGENT = 4;
56
+ * @generated from field: map<string, string> attributes = 5;
50
57
  */
51
- AGENT = 4,
52
- }
53
- // Retrieve enum metadata with: proto3.getEnumType(ParticipantKind)
54
- proto3.util.setEnumType(ParticipantKind, "livekit.proto.ParticipantKind", [
55
- { no: 0, name: "PARTICIPANT_KIND_STANDARD" },
56
- { no: 1, name: "PARTICIPANT_KIND_INGRESS" },
57
- { no: 2, name: "PARTICIPANT_KIND_EGRESS" },
58
- { no: 3, name: "PARTICIPANT_KIND_SIP" },
59
- { no: 4, name: "PARTICIPANT_KIND_AGENT" },
60
- ]);
58
+ attributes: { [key: string]: string };
61
59
 
62
- /**
63
- * @generated from message livekit.proto.ParticipantInfo
64
- */
65
- export class ParticipantInfo extends Message<ParticipantInfo> {
66
60
  /**
67
- * @generated from field: string sid = 1;
61
+ * @generated from field: required livekit.proto.ParticipantKind kind = 6;
68
62
  */
69
- sid = "";
63
+ kind: ParticipantKind;
64
+ };
65
+
66
+ /**
67
+ * Describes the message livekit.proto.ParticipantInfo.
68
+ * Use `create(ParticipantInfoSchema)` to create a new message.
69
+ */
70
+ export const ParticipantInfoSchema: GenMessage<ParticipantInfo> = /*@__PURE__*/
71
+ messageDesc(file_participant, 0);
70
72
 
73
+ /**
74
+ * @generated from message livekit.proto.OwnedParticipant
75
+ */
76
+ export type OwnedParticipant = Message<"livekit.proto.OwnedParticipant"> & {
71
77
  /**
72
- * @generated from field: string name = 2;
78
+ * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1;
73
79
  */
74
- name = "";
80
+ handle?: FfiOwnedHandle;
75
81
 
76
82
  /**
77
- * @generated from field: string identity = 3;
83
+ * @generated from field: required livekit.proto.ParticipantInfo info = 2;
78
84
  */
79
- identity = "";
85
+ info?: ParticipantInfo;
86
+ };
80
87
 
88
+ /**
89
+ * Describes the message livekit.proto.OwnedParticipant.
90
+ * Use `create(OwnedParticipantSchema)` to create a new message.
91
+ */
92
+ export const OwnedParticipantSchema: GenMessage<OwnedParticipant> = /*@__PURE__*/
93
+ messageDesc(file_participant, 1);
94
+
95
+ /**
96
+ * @generated from enum livekit.proto.ParticipantKind
97
+ */
98
+ export enum ParticipantKind {
81
99
  /**
82
- * @generated from field: string metadata = 4;
100
+ * @generated from enum value: PARTICIPANT_KIND_STANDARD = 0;
83
101
  */
84
- metadata = "";
102
+ STANDARD = 0,
85
103
 
86
104
  /**
87
- * @generated from field: map<string, string> attributes = 5;
105
+ * @generated from enum value: PARTICIPANT_KIND_INGRESS = 1;
88
106
  */
89
- attributes: { [key: string]: string } = {};
107
+ INGRESS = 1,
90
108
 
91
109
  /**
92
- * @generated from field: livekit.proto.ParticipantKind kind = 6;
110
+ * @generated from enum value: PARTICIPANT_KIND_EGRESS = 2;
93
111
  */
94
- kind = ParticipantKind.STANDARD;
95
-
96
- constructor(data?: PartialMessage<ParticipantInfo>) {
97
- super();
98
- proto3.util.initPartial(data, this);
99
- }
100
-
101
- static readonly runtime: typeof proto3 = proto3;
102
- static readonly typeName = "livekit.proto.ParticipantInfo";
103
- static readonly fields: FieldList = proto3.util.newFieldList(() => [
104
- { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ },
105
- { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
106
- { no: 3, name: "identity", kind: "scalar", T: 9 /* ScalarType.STRING */ },
107
- { no: 4, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ },
108
- { no: 5, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
109
- { no: 6, name: "kind", kind: "enum", T: proto3.getEnumType(ParticipantKind) },
110
- ]);
111
-
112
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ParticipantInfo {
113
- return new ParticipantInfo().fromBinary(bytes, options);
114
- }
115
-
116
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ParticipantInfo {
117
- return new ParticipantInfo().fromJson(jsonValue, options);
118
- }
119
-
120
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ParticipantInfo {
121
- return new ParticipantInfo().fromJsonString(jsonString, options);
122
- }
123
-
124
- static equals(a: ParticipantInfo | PlainMessage<ParticipantInfo> | undefined, b: ParticipantInfo | PlainMessage<ParticipantInfo> | undefined): boolean {
125
- return proto3.util.equals(ParticipantInfo, a, b);
126
- }
127
- }
112
+ EGRESS = 2,
128
113
 
129
- /**
130
- * @generated from message livekit.proto.OwnedParticipant
131
- */
132
- export class OwnedParticipant extends Message<OwnedParticipant> {
133
114
  /**
134
- * @generated from field: livekit.proto.FfiOwnedHandle handle = 1;
115
+ * @generated from enum value: PARTICIPANT_KIND_SIP = 3;
135
116
  */
136
- handle?: FfiOwnedHandle;
117
+ SIP = 3,
137
118
 
138
119
  /**
139
- * @generated from field: livekit.proto.ParticipantInfo info = 2;
120
+ * @generated from enum value: PARTICIPANT_KIND_AGENT = 4;
140
121
  */
141
- info?: ParticipantInfo;
142
-
143
- constructor(data?: PartialMessage<OwnedParticipant>) {
144
- super();
145
- proto3.util.initPartial(data, this);
146
- }
147
-
148
- static readonly runtime: typeof proto3 = proto3;
149
- static readonly typeName = "livekit.proto.OwnedParticipant";
150
- static readonly fields: FieldList = proto3.util.newFieldList(() => [
151
- { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle },
152
- { no: 2, name: "info", kind: "message", T: ParticipantInfo },
153
- ]);
154
-
155
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): OwnedParticipant {
156
- return new OwnedParticipant().fromBinary(bytes, options);
157
- }
158
-
159
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): OwnedParticipant {
160
- return new OwnedParticipant().fromJson(jsonValue, options);
161
- }
162
-
163
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): OwnedParticipant {
164
- return new OwnedParticipant().fromJsonString(jsonString, options);
165
- }
166
-
167
- static equals(a: OwnedParticipant | PlainMessage<OwnedParticipant> | undefined, b: OwnedParticipant | PlainMessage<OwnedParticipant> | undefined): boolean {
168
- return proto3.util.equals(OwnedParticipant, a, b);
169
- }
122
+ AGENT = 4,
170
123
  }
171
124
 
125
+ /**
126
+ * Describes the enum livekit.proto.ParticipantKind.
127
+ */
128
+ export const ParticipantKindSchema: GenEnum<ParticipantKind> = /*@__PURE__*/
129
+ enumDesc(file_participant, 0);
130
+