@livekit/rtc-node 0.13.5 → 0.13.6

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/dist/data_streams/index.d.cts +2 -2
  2. package/dist/data_streams/index.d.ts +2 -2
  3. package/dist/data_streams/stream_reader.d.cts +1 -1
  4. package/dist/data_streams/stream_reader.d.ts +1 -1
  5. package/dist/data_streams/stream_writer.d.cts +1 -1
  6. package/dist/data_streams/stream_writer.d.ts +1 -1
  7. package/dist/data_streams/types.d.cts +1 -1
  8. package/dist/data_streams/types.d.ts +1 -1
  9. package/dist/index.cjs +15 -13
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +17 -17
  12. package/dist/index.d.ts +17 -17
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +29 -28
  15. package/dist/index.js.map +1 -1
  16. package/dist/participant.d.cts +2 -2
  17. package/dist/participant.d.ts +2 -2
  18. package/dist/proto/ffi_pb.cjs +2 -0
  19. package/dist/proto/ffi_pb.cjs.map +1 -1
  20. package/dist/proto/ffi_pb.d.cts +13 -1
  21. package/dist/proto/ffi_pb.d.ts +13 -1
  22. package/dist/proto/ffi_pb.d.ts.map +1 -1
  23. package/dist/proto/ffi_pb.js +3 -1
  24. package/dist/proto/ffi_pb.js.map +1 -1
  25. package/dist/proto/room_pb.cjs +2 -1
  26. package/dist/proto/room_pb.cjs.map +1 -1
  27. package/dist/proto/room_pb.d.cts +4 -0
  28. package/dist/proto/room_pb.d.ts +4 -0
  29. package/dist/proto/room_pb.d.ts.map +1 -1
  30. package/dist/proto/room_pb.js +2 -1
  31. package/dist/proto/room_pb.js.map +1 -1
  32. package/dist/proto/track_pb.cjs +90 -0
  33. package/dist/proto/track_pb.cjs.map +1 -1
  34. package/dist/proto/track_pb.d.cts +70 -1
  35. package/dist/proto/track_pb.d.ts +70 -1
  36. package/dist/proto/track_pb.d.ts.map +1 -1
  37. package/dist/proto/track_pb.js +87 -0
  38. package/dist/proto/track_pb.js.map +1 -1
  39. package/dist/proto/video_frame_pb.cjs +1 -1
  40. package/dist/proto/video_frame_pb.cjs.map +1 -1
  41. package/dist/proto/video_frame_pb.d.cts +1 -1
  42. package/dist/proto/video_frame_pb.d.ts +1 -1
  43. package/dist/proto/video_frame_pb.js +1 -1
  44. package/dist/proto/video_frame_pb.js.map +1 -1
  45. package/dist/room.cjs +7 -7
  46. package/dist/room.cjs.map +1 -1
  47. package/dist/room.d.cts +1 -1
  48. package/dist/room.d.ts +1 -1
  49. package/dist/room.d.ts.map +1 -1
  50. package/dist/room.js +2 -4
  51. package/dist/room.js.map +1 -1
  52. package/dist/version.cjs +1 -1
  53. package/dist/version.cjs.map +1 -1
  54. package/dist/version.d.cts +1 -1
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.js +1 -1
  57. package/dist/version.js.map +1 -1
  58. package/package.json +6 -6
  59. package/src/index.ts +33 -33
  60. package/src/proto/ffi_pb.ts +15 -1
  61. package/src/proto/room_pb.ts +6 -0
  62. package/src/proto/track_pb.ts +135 -0
  63. package/src/proto/video_frame_pb.ts +2 -2
  64. package/src/room.ts +7 -8
  65. package/src/version.ts +1 -1
  66. package/dist/{types-BDnbvXeD.d.ts → stream_reader-DWUV4eJB.d.ts} +40 -40
  67. package/dist/{types-B28ZM-Ci.d.cts → stream_reader-a8_oiaOi.d.cts} +40 -40
package/src/room.ts CHANGED
@@ -21,24 +21,22 @@ import { LocalParticipant, RemoteParticipant } from './participant.js';
21
21
  import { EncryptionState } from './proto/e2ee_pb.js';
22
22
  import type { FfiEvent } from './proto/ffi_pb.js';
23
23
  import type { DisconnectReason, OwnedParticipant } from './proto/participant_pb.js';
24
+ import type { DataStream_Trailer } from './proto/room_pb.js';
24
25
  import {
25
26
  type ConnectCallback,
27
+ ConnectRequest,
26
28
  type ConnectResponse,
27
29
  type ConnectionQuality,
30
+ ConnectionState,
31
+ ContinualGatheringPolicy,
28
32
  type DataPacketKind,
29
33
  type DataStream_Chunk,
30
34
  type DataStream_Header,
31
- DataStream_Trailer,
32
35
  type DisconnectResponse,
33
36
  RoomOptions as FfiRoomOptions,
34
37
  type IceServer,
35
- type RoomInfo,
36
- } from './proto/room_pb.js';
37
- import {
38
- ConnectRequest,
39
- ConnectionState,
40
- ContinualGatheringPolicy,
41
38
  IceTransportType,
39
+ type RoomInfo,
42
40
  } from './proto/room_pb.js';
43
41
  import { TrackKind } from './proto/track_pb.js';
44
42
  import type { LocalTrack, RemoteTrack } from './track.js';
@@ -249,7 +247,8 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
249
247
  this.emit(RoomEvent.ParticipantConnected, participant);
250
248
  } else if (ev.case == 'participantDisconnected') {
251
249
  const participant = this.remoteParticipants.get(ev.value.participantIdentity!);
252
- this.remoteParticipants.delete(participant!.identity!);
250
+ this.remoteParticipants.delete(participant!.identity);
251
+ participant!.info.disconnectReason = ev.value.disconnectReason;
253
252
  this.emit(RoomEvent.ParticipantDisconnected, participant!);
254
253
  } else if (ev.case == 'localTrackPublished') {
255
254
  const publication = this.localParticipant!.trackPublications.get(ev.value.trackSid!);
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.13.5";
1
+ export const SDK_VERSION = "0.13.6";
@@ -1,5 +1,44 @@
1
- import { DataStream_Chunk, DataStream_Header } from './proto/room_pb.js';
2
1
  import { ReadableStream } from 'node:stream/web';
2
+ import { DataStream_Chunk, DataStream_Header } from './proto/room_pb.js';
3
+
4
+ interface StreamController<T extends DataStream_Chunk> {
5
+ header: DataStream_Header;
6
+ controller: ReadableStreamDefaultController<T>;
7
+ startTime: number;
8
+ endTime?: number;
9
+ }
10
+ interface BaseStreamInfo {
11
+ streamId: string;
12
+ mimeType: string;
13
+ topic: string;
14
+ timestamp: number;
15
+ /** total size in bytes for finite streams and undefined for streams of unknown size */
16
+ totalSize?: number;
17
+ attributes?: Record<string, string>;
18
+ }
19
+ type ByteStreamInfo = BaseStreamInfo & {
20
+ name: string;
21
+ };
22
+ type TextStreamInfo = BaseStreamInfo;
23
+ interface DataStreamOptions {
24
+ topic?: string;
25
+ destinationIdentities?: Array<string>;
26
+ attributes?: Record<string, string>;
27
+ mimeType?: string;
28
+ }
29
+ interface TextStreamOptions extends DataStreamOptions {
30
+ attachments?: [];
31
+ }
32
+ interface ByteStreamOptions extends DataStreamOptions {
33
+ name?: string;
34
+ onProgress?: (progress: number) => void;
35
+ }
36
+ type ByteStreamHandler = (reader: ByteStreamReader, participantInfo: {
37
+ identity: string;
38
+ }) => void;
39
+ type TextStreamHandler = (reader: TextStreamReader, participantInfo: {
40
+ identity: string;
41
+ }) => void;
3
42
 
4
43
  declare abstract class BaseStreamReader<T extends BaseStreamInfo> {
5
44
  protected reader: ReadableStream<DataStream_Chunk>;
@@ -46,43 +85,4 @@ declare class TextStreamReader extends BaseStreamReader<TextStreamInfo> {
46
85
  readAll(): Promise<string>;
47
86
  }
48
87
 
49
- interface StreamController<T extends DataStream_Chunk> {
50
- header: DataStream_Header;
51
- controller: ReadableStreamDefaultController<T>;
52
- startTime: number;
53
- endTime?: number;
54
- }
55
- interface BaseStreamInfo {
56
- streamId: string;
57
- mimeType: string;
58
- topic: string;
59
- timestamp: number;
60
- /** total size in bytes for finite streams and undefined for streams of unknown size */
61
- totalSize?: number;
62
- attributes?: Record<string, string>;
63
- }
64
- type ByteStreamInfo = BaseStreamInfo & {
65
- name: string;
66
- };
67
- type TextStreamInfo = BaseStreamInfo;
68
- interface DataStreamOptions {
69
- topic?: string;
70
- destinationIdentities?: Array<string>;
71
- attributes?: Record<string, string>;
72
- mimeType?: string;
73
- }
74
- interface TextStreamOptions extends DataStreamOptions {
75
- attachments?: [];
76
- }
77
- interface ByteStreamOptions extends DataStreamOptions {
78
- name?: string;
79
- onProgress?: (progress: number) => void;
80
- }
81
- type ByteStreamHandler = (reader: ByteStreamReader, participantInfo: {
82
- identity: string;
83
- }) => void;
84
- type TextStreamHandler = (reader: TextStreamReader, participantInfo: {
85
- identity: string;
86
- }) => void;
87
-
88
88
  export { ByteStreamReader as B, type DataStreamOptions as D, type StreamController as S, TextStreamReader as T, type BaseStreamInfo as a, type ByteStreamInfo as b, type TextStreamInfo as c, type TextStreamOptions as d, type ByteStreamOptions as e, type ByteStreamHandler as f, type TextStreamHandler as g };
@@ -1,5 +1,44 @@
1
- import { DataStream_Chunk, DataStream_Header } from './proto/room_pb.cjs';
2
1
  import { ReadableStream } from 'node:stream/web';
2
+ import { DataStream_Chunk, DataStream_Header } from './proto/room_pb.cjs';
3
+
4
+ interface StreamController<T extends DataStream_Chunk> {
5
+ header: DataStream_Header;
6
+ controller: ReadableStreamDefaultController<T>;
7
+ startTime: number;
8
+ endTime?: number;
9
+ }
10
+ interface BaseStreamInfo {
11
+ streamId: string;
12
+ mimeType: string;
13
+ topic: string;
14
+ timestamp: number;
15
+ /** total size in bytes for finite streams and undefined for streams of unknown size */
16
+ totalSize?: number;
17
+ attributes?: Record<string, string>;
18
+ }
19
+ type ByteStreamInfo = BaseStreamInfo & {
20
+ name: string;
21
+ };
22
+ type TextStreamInfo = BaseStreamInfo;
23
+ interface DataStreamOptions {
24
+ topic?: string;
25
+ destinationIdentities?: Array<string>;
26
+ attributes?: Record<string, string>;
27
+ mimeType?: string;
28
+ }
29
+ interface TextStreamOptions extends DataStreamOptions {
30
+ attachments?: [];
31
+ }
32
+ interface ByteStreamOptions extends DataStreamOptions {
33
+ name?: string;
34
+ onProgress?: (progress: number) => void;
35
+ }
36
+ type ByteStreamHandler = (reader: ByteStreamReader, participantInfo: {
37
+ identity: string;
38
+ }) => void;
39
+ type TextStreamHandler = (reader: TextStreamReader, participantInfo: {
40
+ identity: string;
41
+ }) => void;
3
42
 
4
43
  declare abstract class BaseStreamReader<T extends BaseStreamInfo> {
5
44
  protected reader: ReadableStream<DataStream_Chunk>;
@@ -46,43 +85,4 @@ declare class TextStreamReader extends BaseStreamReader<TextStreamInfo> {
46
85
  readAll(): Promise<string>;
47
86
  }
48
87
 
49
- interface StreamController<T extends DataStream_Chunk> {
50
- header: DataStream_Header;
51
- controller: ReadableStreamDefaultController<T>;
52
- startTime: number;
53
- endTime?: number;
54
- }
55
- interface BaseStreamInfo {
56
- streamId: string;
57
- mimeType: string;
58
- topic: string;
59
- timestamp: number;
60
- /** total size in bytes for finite streams and undefined for streams of unknown size */
61
- totalSize?: number;
62
- attributes?: Record<string, string>;
63
- }
64
- type ByteStreamInfo = BaseStreamInfo & {
65
- name: string;
66
- };
67
- type TextStreamInfo = BaseStreamInfo;
68
- interface DataStreamOptions {
69
- topic?: string;
70
- destinationIdentities?: Array<string>;
71
- attributes?: Record<string, string>;
72
- mimeType?: string;
73
- }
74
- interface TextStreamOptions extends DataStreamOptions {
75
- attachments?: [];
76
- }
77
- interface ByteStreamOptions extends DataStreamOptions {
78
- name?: string;
79
- onProgress?: (progress: number) => void;
80
- }
81
- type ByteStreamHandler = (reader: ByteStreamReader, participantInfo: {
82
- identity: string;
83
- }) => void;
84
- type TextStreamHandler = (reader: TextStreamReader, participantInfo: {
85
- identity: string;
86
- }) => void;
87
-
88
88
  export { ByteStreamReader as B, type DataStreamOptions as D, type StreamController as S, TextStreamReader as T, type BaseStreamInfo as a, type ByteStreamInfo as b, type TextStreamInfo as c, type TextStreamOptions as d, type ByteStreamOptions as e, type ByteStreamHandler as f, type TextStreamHandler as g };