diff --git a/.changeset/cold-parents-visit.md b/.changeset/cold-parents-visit.md new file mode 100644 index 00000000..3698ca11 --- /dev/null +++ b/.changeset/cold-parents-visit.md @@ -0,0 +1,5 @@ +--- +'@livekit/rtc-node': minor +--- + +Update rust-sdk dependency to latest diff --git a/.changeset/dry-lizards-tan.md b/.changeset/dry-lizards-tan.md new file mode 100644 index 00000000..e3ea794a --- /dev/null +++ b/.changeset/dry-lizards-tan.md @@ -0,0 +1,5 @@ +--- +'@livekit/rtc-node': patch +--- + +Add publishDtmf method on local participant diff --git a/.changeset/kind-cups-obey.md b/.changeset/kind-cups-obey.md new file mode 100644 index 00000000..d50f05fc --- /dev/null +++ b/.changeset/kind-cups-obey.md @@ -0,0 +1,5 @@ +--- +'@livekit/rtc-node': patch +--- + +Add support for setting and listening to participant attribute changes diff --git a/.changeset/neat-falcons-type.md b/.changeset/neat-falcons-type.md new file mode 100644 index 00000000..98504d3e --- /dev/null +++ b/.changeset/neat-falcons-type.md @@ -0,0 +1,5 @@ +--- +'@livekit/rtc-node': patch +--- + +Add enableQueue argument to AudioSource constructor diff --git a/.gitignore b/.gitignore index d0aa3f3e..8a279130 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,9 @@ web_modules/ # Yarn Integrity file .yarn-integrity +# macOS +.DS_Store + # dotenv environment variable files .env .env.development.local diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index fa49b7e8..9d6554b4 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit fa49b7e8d06eb3ffdcd496bc2372f54264affbe7 +Subproject commit 9d6554b4d1d8c3426fab3fba7c12c8f5229e5afa diff --git a/packages/livekit-rtc/src/audio_source.ts b/packages/livekit-rtc/src/audio_source.ts index d4ab28d2..0af142cb 100644 --- a/packages/livekit-rtc/src/audio_source.ts +++ b/packages/livekit-rtc/src/audio_source.ts @@ -25,7 +25,7 @@ export class AudioSource { sampleRate: number; numChannels: number; - constructor(sampleRate: number, numChannels: number) { + constructor(sampleRate: number, numChannels: number, enableQueue?: boolean) { this.sampleRate = sampleRate; this.numChannels = numChannels; @@ -33,6 +33,7 @@ export class AudioSource { type: AudioSourceType.AUDIO_SOURCE_NATIVE, sampleRate: sampleRate, numChannels: numChannels, + enableQueue: enableQueue, }); const res = FfiClient.instance.request({ diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 17d21957..2ff19b6f 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -6,23 +6,28 @@ import type { OwnedParticipant, ParticipantInfo } from './proto/participant_pb.j import type { PublishDataCallback, PublishDataResponse, + PublishSipDtmfCallback, + PublishSipDtmfResponse, PublishTrackCallback, PublishTrackResponse, + SetLocalAttributesCallback, + SetLocalAttributesResponse, + SetLocalMetadataCallback, + SetLocalMetadataResponse, + SetLocalNameCallback, + SetLocalNameResponse, TrackPublishOptions, UnpublishTrackCallback, UnpublishTrackResponse, - UpdateLocalMetadataCallback, - UpdateLocalMetadataResponse, - UpdateLocalNameCallback, - UpdateLocalNameResponse, } from './proto/room_pb.js'; import { - DataPacketKind, PublishDataRequest, + PublishSipDtmfRequest, PublishTrackRequest, + SetLocalAttributesRequest, + SetLocalMetadataRequest, + SetLocalNameRequest, UnpublishTrackRequest, - UpdateLocalMetadataRequest, - UpdateLocalNameRequest, } from './proto/room_pb.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; @@ -57,6 +62,10 @@ export abstract class Participant { get metadata(): string { return this.info.metadata; } + + get attributes(): Record { + return this.info.attributes; + } } export type DataPublishOptions = { @@ -68,9 +77,9 @@ export type DataPublishOptions = { */ reliable?: boolean; /** - * the sids of participants who will receive the message, will be sent to every one if empty + * the identities of participants who will receive the message, will be sent to every one if empty */ - destination?: string[] | RemoteParticipant[]; + destination_identities?: string[]; /** the topic under which the message gets published */ topic?: string; }; @@ -83,18 +92,11 @@ export class LocalParticipant extends Participant { localParticipantHandle: this.ffi_handle.handle, dataPtr: FfiClient.instance.retrievePtr(data), dataLen: BigInt(data.byteLength), - kind: options.reliable ? DataPacketKind.KIND_RELIABLE : DataPacketKind.KIND_LOSSY, + reliable: options.reliable, topic: options.topic, + destinationIdentities: options.destination_identities, }); - if (options.destination) { - const sids = options.destination.map((sid: string | RemoteParticipant) => { - if (typeof sid == 'string') return sid; - return sid.sid; - }); - req.destinationSids = sids; - } - const res = FfiClient.instance.request({ message: { case: 'publishData', value: req }, }); @@ -108,33 +110,67 @@ export class LocalParticipant extends Participant { } } + async publishDtmf(code: number, digit: string) { + const req = new PublishSipDtmfRequest({ + code, + digit, + }); + + const res = FfiClient.instance.request({ + message: { case: 'publishSipDtmf', value: req }, + }); + + const cb = await FfiClient.instance.waitFor((ev) => { + return ev.message.case == 'publishSipDtmf' && ev.message.value.asyncId == res.asyncId; + }); + + if (cb.error) { + throw new Error(cb.error); + } + } + async updateMetadata(metadata: string) { - const req = new UpdateLocalMetadataRequest({ + const req = new SetLocalMetadataRequest({ localParticipantHandle: this.ffi_handle.handle, metadata: metadata, }); - const res = FfiClient.instance.request({ - message: { case: 'updateLocalMetadata', value: req }, + const res = FfiClient.instance.request({ + message: { case: 'setLocalMetadata', value: req }, }); - await FfiClient.instance.waitFor((ev) => { - return ev.message.case == 'updateLocalMetadata' && ev.message.value.asyncId == res.asyncId; + await FfiClient.instance.waitFor((ev) => { + return ev.message.case == 'setLocalMetadata' && ev.message.value.asyncId == res.asyncId; }); } async updateName(name: string) { - const req = new UpdateLocalNameRequest({ + const req = new SetLocalNameRequest({ localParticipantHandle: this.ffi_handle.handle, name: name, }); - const res = FfiClient.instance.request({ - message: { case: 'updateLocalName', value: req }, + const res = FfiClient.instance.request({ + message: { case: 'setLocalName', value: req }, + }); + + await FfiClient.instance.waitFor((ev) => { + return ev.message.case == 'setLocalName' && ev.message.value.asyncId == res.asyncId; + }); + } + + async setAttributes(attributes: Record) { + const req = new SetLocalAttributesRequest({ + localParticipantHandle: this.ffi_handle.handle, + attributes: attributes, + }); + + const res = FfiClient.instance.request({ + message: { case: 'setLocalAttributes', value: req }, }); - await FfiClient.instance.waitFor((ev) => { - return ev.message.case == 'updateLocalName' && ev.message.value.asyncId == res.asyncId; + await FfiClient.instance.waitFor((ev) => { + return ev.message.case == 'setLocalAttributes' && ev.message.value.asyncId == res.asyncId; }); } diff --git a/packages/livekit-rtc/src/proto/audio_frame_pb.ts b/packages/livekit-rtc/src/proto/audio_frame_pb.ts index fe29f353..025381f4 100644 --- a/packages/livekit-rtc/src/proto/audio_frame_pb.ts +++ b/packages/livekit-rtc/src/proto/audio_frame_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.7.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" // @generated from file audio_frame.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -164,6 +164,11 @@ export class NewAudioSourceRequest extends Message { */ numChannels = 0; + /** + * @generated from field: optional bool enable_queue = 5; + */ + enableQueue?: boolean; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -176,6 +181,7 @@ export class NewAudioSourceRequest extends Message { { no: 2, name: "options", kind: "message", T: AudioSourceOptions, opt: true }, { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 4, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 5, name: "enable_queue", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioSourceRequest { diff --git a/packages/livekit-rtc/src/proto/e2ee_pb.ts b/packages/livekit-rtc/src/proto/e2ee_pb.ts index 0ad97ad8..73601aa1 100644 --- a/packages/livekit-rtc/src/proto/e2ee_pb.ts +++ b/packages/livekit-rtc/src/proto/e2ee_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.7.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" // @generated from file e2ee.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index 5f5a15e9..ba716693 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.7.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" // @generated from file ffi.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; -import { ConnectCallback, ConnectRequest, ConnectResponse, DisconnectCallback, DisconnectRequest, DisconnectResponse, GetSessionStatsCallback, GetSessionStatsRequest, GetSessionStatsResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, RoomEvent, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse, UpdateLocalMetadataCallback, UpdateLocalMetadataRequest, UpdateLocalMetadataResponse, UpdateLocalNameCallback, UpdateLocalNameRequest, UpdateLocalNameResponse } from "./room_pb.js"; +import { ConnectCallback, ConnectRequest, ConnectResponse, DisconnectCallback, DisconnectRequest, DisconnectResponse, GetSessionStatsCallback, GetSessionStatsRequest, GetSessionStatsResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishSipDtmfCallback, PublishSipDtmfRequest, PublishSipDtmfResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, PublishTranscriptionCallback, PublishTranscriptionRequest, PublishTranscriptionResponse, RoomEvent, SetLocalAttributesCallback, SetLocalAttributesRequest, SetLocalAttributesResponse, SetLocalMetadataCallback, SetLocalMetadataRequest, SetLocalMetadataResponse, SetLocalNameCallback, SetLocalNameRequest, SetLocalNameResponse, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse } from "./room_pb.js"; import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, TrackEvent } from "./track_pb.js"; import { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent } from "./video_frame_pb.js"; import { AudioStreamEvent, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb.js"; @@ -119,39 +119,57 @@ export class FfiRequest extends Message { case: "setSubscribed"; } | { /** - * @generated from field: livekit.proto.UpdateLocalMetadataRequest update_local_metadata = 9; + * @generated from field: livekit.proto.SetLocalMetadataRequest set_local_metadata = 9; */ - value: UpdateLocalMetadataRequest; - case: "updateLocalMetadata"; + value: SetLocalMetadataRequest; + case: "setLocalMetadata"; } | { /** - * @generated from field: livekit.proto.UpdateLocalNameRequest update_local_name = 10; + * @generated from field: livekit.proto.SetLocalNameRequest set_local_name = 10; */ - value: UpdateLocalNameRequest; - case: "updateLocalName"; + value: SetLocalNameRequest; + case: "setLocalName"; } | { /** - * @generated from field: livekit.proto.GetSessionStatsRequest get_session_stats = 11; + * @generated from field: livekit.proto.SetLocalAttributesRequest set_local_attributes = 11; + */ + value: SetLocalAttributesRequest; + case: "setLocalAttributes"; + } | { + /** + * @generated from field: livekit.proto.GetSessionStatsRequest get_session_stats = 12; */ value: GetSessionStatsRequest; case: "getSessionStats"; + } | { + /** + * @generated from field: livekit.proto.PublishTranscriptionRequest publish_transcription = 13; + */ + value: PublishTranscriptionRequest; + case: "publishTranscription"; + } | { + /** + * @generated from field: livekit.proto.PublishSipDtmfRequest publish_sip_dtmf = 14; + */ + value: PublishSipDtmfRequest; + case: "publishSipDtmf"; } | { /** * Track * - * @generated from field: livekit.proto.CreateVideoTrackRequest create_video_track = 12; + * @generated from field: livekit.proto.CreateVideoTrackRequest create_video_track = 15; */ value: CreateVideoTrackRequest; case: "createVideoTrack"; } | { /** - * @generated from field: livekit.proto.CreateAudioTrackRequest create_audio_track = 13; + * @generated from field: livekit.proto.CreateAudioTrackRequest create_audio_track = 16; */ value: CreateAudioTrackRequest; case: "createAudioTrack"; } | { /** - * @generated from field: livekit.proto.GetStatsRequest get_stats = 14; + * @generated from field: livekit.proto.GetStatsRequest get_stats = 17; */ value: GetStatsRequest; case: "getStats"; @@ -159,25 +177,25 @@ export class FfiRequest extends Message { /** * Video * - * @generated from field: livekit.proto.NewVideoStreamRequest new_video_stream = 16; + * @generated from field: livekit.proto.NewVideoStreamRequest new_video_stream = 18; */ value: NewVideoStreamRequest; case: "newVideoStream"; } | { /** - * @generated from field: livekit.proto.NewVideoSourceRequest new_video_source = 17; + * @generated from field: livekit.proto.NewVideoSourceRequest new_video_source = 19; */ value: NewVideoSourceRequest; case: "newVideoSource"; } | { /** - * @generated from field: livekit.proto.CaptureVideoFrameRequest capture_video_frame = 18; + * @generated from field: livekit.proto.CaptureVideoFrameRequest capture_video_frame = 20; */ value: CaptureVideoFrameRequest; case: "captureVideoFrame"; } | { /** - * @generated from field: livekit.proto.VideoConvertRequest video_convert = 19; + * @generated from field: livekit.proto.VideoConvertRequest video_convert = 21; */ value: VideoConvertRequest; case: "videoConvert"; @@ -185,37 +203,37 @@ export class FfiRequest extends Message { /** * Audio * - * @generated from field: livekit.proto.NewAudioStreamRequest new_audio_stream = 22; + * @generated from field: livekit.proto.NewAudioStreamRequest new_audio_stream = 23; */ value: NewAudioStreamRequest; case: "newAudioStream"; } | { /** - * @generated from field: livekit.proto.NewAudioSourceRequest new_audio_source = 23; + * @generated from field: livekit.proto.NewAudioSourceRequest new_audio_source = 24; */ value: NewAudioSourceRequest; case: "newAudioSource"; } | { /** - * @generated from field: livekit.proto.CaptureAudioFrameRequest capture_audio_frame = 24; + * @generated from field: livekit.proto.CaptureAudioFrameRequest capture_audio_frame = 25; */ value: CaptureAudioFrameRequest; case: "captureAudioFrame"; } | { /** - * @generated from field: livekit.proto.NewAudioResamplerRequest new_audio_resampler = 25; + * @generated from field: livekit.proto.NewAudioResamplerRequest new_audio_resampler = 26; */ value: NewAudioResamplerRequest; case: "newAudioResampler"; } | { /** - * @generated from field: livekit.proto.RemixAndResampleRequest remix_and_resample = 26; + * @generated from field: livekit.proto.RemixAndResampleRequest remix_and_resample = 27; */ value: RemixAndResampleRequest; case: "remixAndResample"; } | { /** - * @generated from field: livekit.proto.E2eeRequest e2ee = 27; + * @generated from field: livekit.proto.E2eeRequest e2ee = 28; */ value: E2eeRequest; case: "e2ee"; @@ -236,22 +254,25 @@ export class FfiRequest extends Message { { no: 6, name: "unpublish_track", kind: "message", T: UnpublishTrackRequest, oneof: "message" }, { no: 7, name: "publish_data", kind: "message", T: PublishDataRequest, oneof: "message" }, { no: 8, name: "set_subscribed", kind: "message", T: SetSubscribedRequest, oneof: "message" }, - { no: 9, name: "update_local_metadata", kind: "message", T: UpdateLocalMetadataRequest, oneof: "message" }, - { no: 10, name: "update_local_name", kind: "message", T: UpdateLocalNameRequest, oneof: "message" }, - { no: 11, name: "get_session_stats", kind: "message", T: GetSessionStatsRequest, oneof: "message" }, - { no: 12, name: "create_video_track", kind: "message", T: CreateVideoTrackRequest, oneof: "message" }, - { no: 13, name: "create_audio_track", kind: "message", T: CreateAudioTrackRequest, oneof: "message" }, - { no: 14, name: "get_stats", kind: "message", T: GetStatsRequest, oneof: "message" }, - { no: 16, name: "new_video_stream", kind: "message", T: NewVideoStreamRequest, oneof: "message" }, - { no: 17, name: "new_video_source", kind: "message", T: NewVideoSourceRequest, oneof: "message" }, - { no: 18, name: "capture_video_frame", kind: "message", T: CaptureVideoFrameRequest, oneof: "message" }, - { no: 19, name: "video_convert", kind: "message", T: VideoConvertRequest, oneof: "message" }, - { no: 22, name: "new_audio_stream", kind: "message", T: NewAudioStreamRequest, oneof: "message" }, - { no: 23, name: "new_audio_source", kind: "message", T: NewAudioSourceRequest, oneof: "message" }, - { no: 24, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameRequest, oneof: "message" }, - { no: 25, name: "new_audio_resampler", kind: "message", T: NewAudioResamplerRequest, oneof: "message" }, - { no: 26, name: "remix_and_resample", kind: "message", T: RemixAndResampleRequest, oneof: "message" }, - { no: 27, name: "e2ee", kind: "message", T: E2eeRequest, oneof: "message" }, + { no: 9, name: "set_local_metadata", kind: "message", T: SetLocalMetadataRequest, oneof: "message" }, + { no: 10, name: "set_local_name", kind: "message", T: SetLocalNameRequest, oneof: "message" }, + { no: 11, name: "set_local_attributes", kind: "message", T: SetLocalAttributesRequest, oneof: "message" }, + { no: 12, name: "get_session_stats", kind: "message", T: GetSessionStatsRequest, oneof: "message" }, + { no: 13, name: "publish_transcription", kind: "message", T: PublishTranscriptionRequest, oneof: "message" }, + { no: 14, name: "publish_sip_dtmf", kind: "message", T: PublishSipDtmfRequest, oneof: "message" }, + { no: 15, name: "create_video_track", kind: "message", T: CreateVideoTrackRequest, oneof: "message" }, + { no: 16, name: "create_audio_track", kind: "message", T: CreateAudioTrackRequest, oneof: "message" }, + { no: 17, name: "get_stats", kind: "message", T: GetStatsRequest, oneof: "message" }, + { no: 18, name: "new_video_stream", kind: "message", T: NewVideoStreamRequest, oneof: "message" }, + { no: 19, name: "new_video_source", kind: "message", T: NewVideoSourceRequest, oneof: "message" }, + { no: 20, name: "capture_video_frame", kind: "message", T: CaptureVideoFrameRequest, oneof: "message" }, + { no: 21, name: "video_convert", kind: "message", T: VideoConvertRequest, oneof: "message" }, + { no: 23, name: "new_audio_stream", kind: "message", T: NewAudioStreamRequest, oneof: "message" }, + { no: 24, name: "new_audio_source", kind: "message", T: NewAudioSourceRequest, oneof: "message" }, + { no: 25, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameRequest, oneof: "message" }, + { no: 26, name: "new_audio_resampler", kind: "message", T: NewAudioResamplerRequest, oneof: "message" }, + { no: 27, name: "remix_and_resample", kind: "message", T: RemixAndResampleRequest, oneof: "message" }, + { no: 28, name: "e2ee", kind: "message", T: E2eeRequest, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiRequest { @@ -326,39 +347,57 @@ export class FfiResponse extends Message { case: "setSubscribed"; } | { /** - * @generated from field: livekit.proto.UpdateLocalMetadataResponse update_local_metadata = 9; + * @generated from field: livekit.proto.SetLocalMetadataResponse set_local_metadata = 9; */ - value: UpdateLocalMetadataResponse; - case: "updateLocalMetadata"; + value: SetLocalMetadataResponse; + case: "setLocalMetadata"; } | { /** - * @generated from field: livekit.proto.UpdateLocalNameResponse update_local_name = 10; + * @generated from field: livekit.proto.SetLocalNameResponse set_local_name = 10; */ - value: UpdateLocalNameResponse; - case: "updateLocalName"; + value: SetLocalNameResponse; + case: "setLocalName"; } | { /** - * @generated from field: livekit.proto.GetSessionStatsResponse get_session_stats = 11; + * @generated from field: livekit.proto.SetLocalAttributesResponse set_local_attributes = 11; + */ + value: SetLocalAttributesResponse; + case: "setLocalAttributes"; + } | { + /** + * @generated from field: livekit.proto.GetSessionStatsResponse get_session_stats = 12; */ value: GetSessionStatsResponse; case: "getSessionStats"; + } | { + /** + * @generated from field: livekit.proto.PublishTranscriptionResponse publish_transcription = 13; + */ + value: PublishTranscriptionResponse; + case: "publishTranscription"; + } | { + /** + * @generated from field: livekit.proto.PublishSipDtmfResponse publish_sip_dtmf = 14; + */ + value: PublishSipDtmfResponse; + case: "publishSipDtmf"; } | { /** * Track * - * @generated from field: livekit.proto.CreateVideoTrackResponse create_video_track = 12; + * @generated from field: livekit.proto.CreateVideoTrackResponse create_video_track = 15; */ value: CreateVideoTrackResponse; case: "createVideoTrack"; } | { /** - * @generated from field: livekit.proto.CreateAudioTrackResponse create_audio_track = 13; + * @generated from field: livekit.proto.CreateAudioTrackResponse create_audio_track = 16; */ value: CreateAudioTrackResponse; case: "createAudioTrack"; } | { /** - * @generated from field: livekit.proto.GetStatsResponse get_stats = 14; + * @generated from field: livekit.proto.GetStatsResponse get_stats = 17; */ value: GetStatsResponse; case: "getStats"; @@ -366,25 +405,25 @@ export class FfiResponse extends Message { /** * Video * - * @generated from field: livekit.proto.NewVideoStreamResponse new_video_stream = 16; + * @generated from field: livekit.proto.NewVideoStreamResponse new_video_stream = 18; */ value: NewVideoStreamResponse; case: "newVideoStream"; } | { /** - * @generated from field: livekit.proto.NewVideoSourceResponse new_video_source = 17; + * @generated from field: livekit.proto.NewVideoSourceResponse new_video_source = 19; */ value: NewVideoSourceResponse; case: "newVideoSource"; } | { /** - * @generated from field: livekit.proto.CaptureVideoFrameResponse capture_video_frame = 18; + * @generated from field: livekit.proto.CaptureVideoFrameResponse capture_video_frame = 20; */ value: CaptureVideoFrameResponse; case: "captureVideoFrame"; } | { /** - * @generated from field: livekit.proto.VideoConvertResponse video_convert = 19; + * @generated from field: livekit.proto.VideoConvertResponse video_convert = 21; */ value: VideoConvertResponse; case: "videoConvert"; @@ -443,16 +482,19 @@ export class FfiResponse extends Message { { no: 6, name: "unpublish_track", kind: "message", T: UnpublishTrackResponse, oneof: "message" }, { no: 7, name: "publish_data", kind: "message", T: PublishDataResponse, oneof: "message" }, { no: 8, name: "set_subscribed", kind: "message", T: SetSubscribedResponse, oneof: "message" }, - { no: 9, name: "update_local_metadata", kind: "message", T: UpdateLocalMetadataResponse, oneof: "message" }, - { no: 10, name: "update_local_name", kind: "message", T: UpdateLocalNameResponse, oneof: "message" }, - { no: 11, name: "get_session_stats", kind: "message", T: GetSessionStatsResponse, oneof: "message" }, - { no: 12, name: "create_video_track", kind: "message", T: CreateVideoTrackResponse, oneof: "message" }, - { no: 13, name: "create_audio_track", kind: "message", T: CreateAudioTrackResponse, oneof: "message" }, - { no: 14, name: "get_stats", kind: "message", T: GetStatsResponse, oneof: "message" }, - { no: 16, name: "new_video_stream", kind: "message", T: NewVideoStreamResponse, oneof: "message" }, - { no: 17, name: "new_video_source", kind: "message", T: NewVideoSourceResponse, oneof: "message" }, - { no: 18, name: "capture_video_frame", kind: "message", T: CaptureVideoFrameResponse, oneof: "message" }, - { no: 19, name: "video_convert", kind: "message", T: VideoConvertResponse, oneof: "message" }, + { no: 9, name: "set_local_metadata", kind: "message", T: SetLocalMetadataResponse, oneof: "message" }, + { no: 10, name: "set_local_name", kind: "message", T: SetLocalNameResponse, oneof: "message" }, + { no: 11, name: "set_local_attributes", kind: "message", T: SetLocalAttributesResponse, oneof: "message" }, + { no: 12, name: "get_session_stats", kind: "message", T: GetSessionStatsResponse, oneof: "message" }, + { no: 13, name: "publish_transcription", kind: "message", T: PublishTranscriptionResponse, oneof: "message" }, + { no: 14, name: "publish_sip_dtmf", kind: "message", T: PublishSipDtmfResponse, oneof: "message" }, + { no: 15, name: "create_video_track", kind: "message", T: CreateVideoTrackResponse, oneof: "message" }, + { no: 16, name: "create_audio_track", kind: "message", T: CreateAudioTrackResponse, oneof: "message" }, + { no: 17, name: "get_stats", kind: "message", T: GetStatsResponse, oneof: "message" }, + { no: 18, name: "new_video_stream", kind: "message", T: NewVideoStreamResponse, oneof: "message" }, + { no: 19, name: "new_video_source", kind: "message", T: NewVideoSourceResponse, oneof: "message" }, + { no: 20, name: "capture_video_frame", kind: "message", T: CaptureVideoFrameResponse, oneof: "message" }, + { no: 21, name: "video_convert", kind: "message", T: VideoConvertResponse, oneof: "message" }, { no: 22, name: "new_audio_stream", kind: "message", T: NewAudioStreamResponse, oneof: "message" }, { no: 23, name: "new_audio_source", kind: "message", T: NewAudioSourceResponse, oneof: "message" }, { no: 24, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameResponse, oneof: "message" }, @@ -521,76 +563,94 @@ export class FfiEvent extends Message { case: "connect"; } | { /** - * @generated from field: livekit.proto.DisconnectCallback disconnect = 6; + * @generated from field: livekit.proto.DisconnectCallback disconnect = 7; */ value: DisconnectCallback; case: "disconnect"; } | { /** - * @generated from field: livekit.proto.DisposeCallback dispose = 7; + * @generated from field: livekit.proto.DisposeCallback dispose = 8; */ value: DisposeCallback; case: "dispose"; } | { /** - * @generated from field: livekit.proto.PublishTrackCallback publish_track = 8; + * @generated from field: livekit.proto.PublishTrackCallback publish_track = 9; */ value: PublishTrackCallback; case: "publishTrack"; } | { /** - * @generated from field: livekit.proto.UnpublishTrackCallback unpublish_track = 9; + * @generated from field: livekit.proto.UnpublishTrackCallback unpublish_track = 10; */ value: UnpublishTrackCallback; case: "unpublishTrack"; } | { /** - * @generated from field: livekit.proto.PublishDataCallback publish_data = 10; + * @generated from field: livekit.proto.PublishDataCallback publish_data = 11; */ value: PublishDataCallback; case: "publishData"; } | { /** - * @generated from field: livekit.proto.CaptureAudioFrameCallback capture_audio_frame = 11; + * @generated from field: livekit.proto.PublishTranscriptionCallback publish_transcription = 12; + */ + value: PublishTranscriptionCallback; + case: "publishTranscription"; + } | { + /** + * @generated from field: livekit.proto.CaptureAudioFrameCallback capture_audio_frame = 13; */ value: CaptureAudioFrameCallback; case: "captureAudioFrame"; } | { /** - * @generated from field: livekit.proto.UpdateLocalMetadataCallback update_local_metadata = 12; + * @generated from field: livekit.proto.SetLocalMetadataCallback set_local_metadata = 14; */ - value: UpdateLocalMetadataCallback; - case: "updateLocalMetadata"; + value: SetLocalMetadataCallback; + case: "setLocalMetadata"; } | { /** - * @generated from field: livekit.proto.UpdateLocalNameCallback update_local_name = 13; + * @generated from field: livekit.proto.SetLocalNameCallback set_local_name = 15; */ - value: UpdateLocalNameCallback; - case: "updateLocalName"; + value: SetLocalNameCallback; + case: "setLocalName"; } | { /** - * @generated from field: livekit.proto.GetStatsCallback get_stats = 14; + * @generated from field: livekit.proto.SetLocalAttributesCallback set_local_attributes = 16; + */ + value: SetLocalAttributesCallback; + case: "setLocalAttributes"; + } | { + /** + * @generated from field: livekit.proto.GetStatsCallback get_stats = 17; */ value: GetStatsCallback; case: "getStats"; } | { /** - * @generated from field: livekit.proto.LogBatch logs = 15; + * @generated from field: livekit.proto.LogBatch logs = 18; */ value: LogBatch; case: "logs"; } | { /** - * @generated from field: livekit.proto.GetSessionStatsCallback get_session_stats = 16; + * @generated from field: livekit.proto.GetSessionStatsCallback get_session_stats = 19; */ value: GetSessionStatsCallback; case: "getSessionStats"; } | { /** - * @generated from field: livekit.proto.Panic panic = 17; + * @generated from field: livekit.proto.Panic panic = 20; */ value: Panic; case: "panic"; + } | { + /** + * @generated from field: livekit.proto.PublishSipDtmfCallback publish_sip_dtmf = 21; + */ + value: PublishSipDtmfCallback; + case: "publishSipDtmf"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -606,18 +666,21 @@ export class FfiEvent extends Message { { no: 3, name: "video_stream_event", kind: "message", T: VideoStreamEvent, oneof: "message" }, { no: 4, name: "audio_stream_event", kind: "message", T: AudioStreamEvent, oneof: "message" }, { no: 5, name: "connect", kind: "message", T: ConnectCallback, oneof: "message" }, - { no: 6, name: "disconnect", kind: "message", T: DisconnectCallback, oneof: "message" }, - { no: 7, name: "dispose", kind: "message", T: DisposeCallback, oneof: "message" }, - { no: 8, name: "publish_track", kind: "message", T: PublishTrackCallback, oneof: "message" }, - { no: 9, name: "unpublish_track", kind: "message", T: UnpublishTrackCallback, oneof: "message" }, - { no: 10, name: "publish_data", kind: "message", T: PublishDataCallback, oneof: "message" }, - { no: 11, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameCallback, oneof: "message" }, - { no: 12, name: "update_local_metadata", kind: "message", T: UpdateLocalMetadataCallback, oneof: "message" }, - { no: 13, name: "update_local_name", kind: "message", T: UpdateLocalNameCallback, oneof: "message" }, - { no: 14, name: "get_stats", kind: "message", T: GetStatsCallback, oneof: "message" }, - { no: 15, name: "logs", kind: "message", T: LogBatch, oneof: "message" }, - { no: 16, name: "get_session_stats", kind: "message", T: GetSessionStatsCallback, oneof: "message" }, - { no: 17, name: "panic", kind: "message", T: Panic, oneof: "message" }, + { no: 7, name: "disconnect", kind: "message", T: DisconnectCallback, oneof: "message" }, + { no: 8, name: "dispose", kind: "message", T: DisposeCallback, oneof: "message" }, + { no: 9, name: "publish_track", kind: "message", T: PublishTrackCallback, oneof: "message" }, + { no: 10, name: "unpublish_track", kind: "message", T: UnpublishTrackCallback, oneof: "message" }, + { no: 11, name: "publish_data", kind: "message", T: PublishDataCallback, oneof: "message" }, + { no: 12, name: "publish_transcription", kind: "message", T: PublishTranscriptionCallback, oneof: "message" }, + { no: 13, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameCallback, oneof: "message" }, + { no: 14, name: "set_local_metadata", kind: "message", T: SetLocalMetadataCallback, oneof: "message" }, + { no: 15, name: "set_local_name", kind: "message", T: SetLocalNameCallback, oneof: "message" }, + { no: 16, name: "set_local_attributes", kind: "message", T: SetLocalAttributesCallback, oneof: "message" }, + { no: 17, name: "get_stats", kind: "message", T: GetStatsCallback, oneof: "message" }, + { no: 18, name: "logs", kind: "message", T: LogBatch, oneof: "message" }, + { no: 19, name: "get_session_stats", kind: "message", T: GetSessionStatsCallback, oneof: "message" }, + { no: 20, name: "panic", kind: "message", T: Panic, oneof: "message" }, + { no: 21, name: "publish_sip_dtmf", kind: "message", T: PublishSipDtmfCallback, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiEvent { diff --git a/packages/livekit-rtc/src/proto/handle_pb.ts b/packages/livekit-rtc/src/proto/handle_pb.ts index c4b5e7ff..cbb0bcef 100644 --- a/packages/livekit-rtc/src/proto/handle_pb.ts +++ b/packages/livekit-rtc/src/proto/handle_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.7.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" // @generated from file handle.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/livekit-rtc/src/proto/participant_pb.ts b/packages/livekit-rtc/src/proto/participant_pb.ts index e5d12f55..f20cb4e1 100644 --- a/packages/livekit-rtc/src/proto/participant_pb.ts +++ b/packages/livekit-rtc/src/proto/participant_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.7.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" // @generated from file participant.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -45,6 +45,11 @@ export class ParticipantInfo extends Message { */ metadata = ""; + /** + * @generated from field: map attributes = 5; + */ + attributes: { [key: string]: string } = {}; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -57,6 +62,7 @@ export class ParticipantInfo extends Message { { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantInfo { diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index 6b05f5be..5bb96d24 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.7.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" // @generated from file room.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -748,14 +748,13 @@ export class PublishDataRequest extends Message { dataLen = protoInt64.zero; /** - * @generated from field: livekit.proto.DataPacketKind kind = 4; + * @generated from field: bool reliable = 4; */ - kind = DataPacketKind.KIND_LOSSY; + reliable = false; /** - * destination - * - * @generated from field: repeated string destination_sids = 5; + * @generated from field: repeated string destination_sids = 5 [deprecated = true]; + * @deprecated */ destinationSids: string[] = []; @@ -764,6 +763,11 @@ export class PublishDataRequest extends Message { */ topic?: string; + /** + * @generated from field: repeated string destination_identities = 7; + */ + destinationIdentities: string[] = []; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -775,9 +779,10 @@ export class PublishDataRequest extends Message { { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 3, name: "data_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 4, name: "kind", kind: "enum", T: proto3.getEnumType(DataPacketKind) }, + { no: 4, name: "reliable", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 5, name: "destination_sids", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 6, name: "topic", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 7, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishDataRequest { @@ -877,12 +882,286 @@ export class PublishDataCallback extends Message { } } +/** + * Publish transcription messages to room + * + * @generated from message livekit.proto.PublishTranscriptionRequest + */ +export class PublishTranscriptionRequest extends Message { + /** + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: string participant_identity = 2; + */ + participantIdentity = ""; + + /** + * @generated from field: string track_id = 3; + */ + trackId = ""; + + /** + * @generated from field: repeated livekit.proto.TranscriptionSegment segments = 4; + */ + segments: TranscriptionSegment[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishTranscriptionRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "track_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "segments", kind: "message", T: TranscriptionSegment, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishTranscriptionRequest { + return new PublishTranscriptionRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishTranscriptionRequest { + return new PublishTranscriptionRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishTranscriptionRequest { + return new PublishTranscriptionRequest().fromJsonString(jsonString, options); + } + + static equals(a: PublishTranscriptionRequest | PlainMessage | undefined, b: PublishTranscriptionRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishTranscriptionRequest, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishTranscriptionResponse + */ +export class PublishTranscriptionResponse extends Message { + /** + * @generated from field: uint64 async_id = 1; + */ + asyncId = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishTranscriptionResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishTranscriptionResponse { + return new PublishTranscriptionResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishTranscriptionResponse { + return new PublishTranscriptionResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishTranscriptionResponse { + return new PublishTranscriptionResponse().fromJsonString(jsonString, options); + } + + static equals(a: PublishTranscriptionResponse | PlainMessage | undefined, b: PublishTranscriptionResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishTranscriptionResponse, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishTranscriptionCallback + */ +export class PublishTranscriptionCallback extends Message { + /** + * @generated from field: uint64 async_id = 1; + */ + asyncId = protoInt64.zero; + + /** + * @generated from field: optional string error = 2; + */ + error?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishTranscriptionCallback"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishTranscriptionCallback { + return new PublishTranscriptionCallback().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishTranscriptionCallback { + return new PublishTranscriptionCallback().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishTranscriptionCallback { + return new PublishTranscriptionCallback().fromJsonString(jsonString, options); + } + + static equals(a: PublishTranscriptionCallback | PlainMessage | undefined, b: PublishTranscriptionCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishTranscriptionCallback, a, b); + } +} + +/** + * Publish Sip DTMF messages to other participants + * + * @generated from message livekit.proto.PublishSipDtmfRequest + */ +export class PublishSipDtmfRequest extends Message { + /** + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: uint32 code = 2; + */ + code = 0; + + /** + * @generated from field: string digit = 3; + */ + digit = ""; + + /** + * @generated from field: repeated string destination_identities = 4; + */ + destinationIdentities: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishSipDtmfRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: "digit", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishSipDtmfRequest { + return new PublishSipDtmfRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishSipDtmfRequest { + return new PublishSipDtmfRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishSipDtmfRequest { + return new PublishSipDtmfRequest().fromJsonString(jsonString, options); + } + + static equals(a: PublishSipDtmfRequest | PlainMessage | undefined, b: PublishSipDtmfRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishSipDtmfRequest, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishSipDtmfResponse + */ +export class PublishSipDtmfResponse extends Message { + /** + * @generated from field: uint64 async_id = 1; + */ + asyncId = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishSipDtmfResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishSipDtmfResponse { + return new PublishSipDtmfResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishSipDtmfResponse { + return new PublishSipDtmfResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishSipDtmfResponse { + return new PublishSipDtmfResponse().fromJsonString(jsonString, options); + } + + static equals(a: PublishSipDtmfResponse | PlainMessage | undefined, b: PublishSipDtmfResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishSipDtmfResponse, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishSipDtmfCallback + */ +export class PublishSipDtmfCallback extends Message { + /** + * @generated from field: uint64 async_id = 1; + */ + asyncId = protoInt64.zero; + + /** + * @generated from field: optional string error = 2; + */ + error?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishSipDtmfCallback"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishSipDtmfCallback { + return new PublishSipDtmfCallback().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishSipDtmfCallback { + return new PublishSipDtmfCallback().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishSipDtmfCallback { + return new PublishSipDtmfCallback().fromJsonString(jsonString, options); + } + + static equals(a: PublishSipDtmfCallback | PlainMessage | undefined, b: PublishSipDtmfCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishSipDtmfCallback, a, b); + } +} + /** * Change the local participant's metadata * - * @generated from message livekit.proto.UpdateLocalMetadataRequest + * @generated from message livekit.proto.SetLocalMetadataRequest */ -export class UpdateLocalMetadataRequest extends Message { +export class SetLocalMetadataRequest extends Message { /** * @generated from field: uint64 local_participant_handle = 1; */ @@ -893,115 +1172,246 @@ export class UpdateLocalMetadataRequest extends Message) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UpdateLocalMetadataRequest"; + static readonly typeName = "livekit.proto.SetLocalMetadataRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateLocalMetadataRequest { - return new UpdateLocalMetadataRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalMetadataRequest { + return new SetLocalMetadataRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalMetadataRequest { + return new SetLocalMetadataRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetLocalMetadataRequest { + return new SetLocalMetadataRequest().fromJsonString(jsonString, options); + } + + static equals(a: SetLocalMetadataRequest | PlainMessage | undefined, b: SetLocalMetadataRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SetLocalMetadataRequest, a, b); + } +} + +/** + * @generated from message livekit.proto.SetLocalMetadataResponse + */ +export class SetLocalMetadataResponse extends Message { + /** + * @generated from field: uint64 async_id = 1; + */ + asyncId = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.SetLocalMetadataResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalMetadataResponse { + return new SetLocalMetadataResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalMetadataResponse { + return new SetLocalMetadataResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetLocalMetadataResponse { + return new SetLocalMetadataResponse().fromJsonString(jsonString, options); + } + + static equals(a: SetLocalMetadataResponse | PlainMessage | undefined, b: SetLocalMetadataResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SetLocalMetadataResponse, a, b); + } +} + +/** + * @generated from message livekit.proto.SetLocalMetadataCallback + */ +export class SetLocalMetadataCallback extends Message { + /** + * @generated from field: uint64 async_id = 1; + */ + asyncId = protoInt64.zero; + + /** + * @generated from field: optional string error = 2; + */ + error?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.SetLocalMetadataCallback"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalMetadataCallback { + return new SetLocalMetadataCallback().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalMetadataCallback { + return new SetLocalMetadataCallback().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetLocalMetadataCallback { + return new SetLocalMetadataCallback().fromJsonString(jsonString, options); + } + + static equals(a: SetLocalMetadataCallback | PlainMessage | undefined, b: SetLocalMetadataCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(SetLocalMetadataCallback, a, b); + } +} + +/** + * Change the local participant's attributes + * + * @generated from message livekit.proto.SetLocalAttributesRequest + */ +export class SetLocalAttributesRequest extends Message { + /** + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: map attributes = 2; + */ + attributes: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.SetLocalAttributesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalAttributesRequest { + return new SetLocalAttributesRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateLocalMetadataRequest { - return new UpdateLocalMetadataRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalAttributesRequest { + return new SetLocalAttributesRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): UpdateLocalMetadataRequest { - return new UpdateLocalMetadataRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): SetLocalAttributesRequest { + return new SetLocalAttributesRequest().fromJsonString(jsonString, options); } - static equals(a: UpdateLocalMetadataRequest | PlainMessage | undefined, b: UpdateLocalMetadataRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(UpdateLocalMetadataRequest, a, b); + static equals(a: SetLocalAttributesRequest | PlainMessage | undefined, b: SetLocalAttributesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SetLocalAttributesRequest, a, b); } } /** - * @generated from message livekit.proto.UpdateLocalMetadataResponse + * @generated from message livekit.proto.SetLocalAttributesResponse */ -export class UpdateLocalMetadataResponse extends Message { +export class SetLocalAttributesResponse extends Message { /** * @generated from field: uint64 async_id = 1; */ asyncId = protoInt64.zero; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UpdateLocalMetadataResponse"; + static readonly typeName = "livekit.proto.SetLocalAttributesResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateLocalMetadataResponse { - return new UpdateLocalMetadataResponse().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalAttributesResponse { + return new SetLocalAttributesResponse().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateLocalMetadataResponse { - return new UpdateLocalMetadataResponse().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalAttributesResponse { + return new SetLocalAttributesResponse().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): UpdateLocalMetadataResponse { - return new UpdateLocalMetadataResponse().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): SetLocalAttributesResponse { + return new SetLocalAttributesResponse().fromJsonString(jsonString, options); } - static equals(a: UpdateLocalMetadataResponse | PlainMessage | undefined, b: UpdateLocalMetadataResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(UpdateLocalMetadataResponse, a, b); + static equals(a: SetLocalAttributesResponse | PlainMessage | undefined, b: SetLocalAttributesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SetLocalAttributesResponse, a, b); } } /** - * @generated from message livekit.proto.UpdateLocalMetadataCallback + * @generated from message livekit.proto.SetLocalAttributesCallback */ -export class UpdateLocalMetadataCallback extends Message { +export class SetLocalAttributesCallback extends Message { /** * @generated from field: uint64 async_id = 1; */ asyncId = protoInt64.zero; - constructor(data?: PartialMessage) { + /** + * @generated from field: optional string error = 2; + */ + error?: string; + + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UpdateLocalMetadataCallback"; + static readonly typeName = "livekit.proto.SetLocalAttributesCallback"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateLocalMetadataCallback { - return new UpdateLocalMetadataCallback().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalAttributesCallback { + return new SetLocalAttributesCallback().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateLocalMetadataCallback { - return new UpdateLocalMetadataCallback().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalAttributesCallback { + return new SetLocalAttributesCallback().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): UpdateLocalMetadataCallback { - return new UpdateLocalMetadataCallback().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): SetLocalAttributesCallback { + return new SetLocalAttributesCallback().fromJsonString(jsonString, options); } - static equals(a: UpdateLocalMetadataCallback | PlainMessage | undefined, b: UpdateLocalMetadataCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(UpdateLocalMetadataCallback, a, b); + static equals(a: SetLocalAttributesCallback | PlainMessage | undefined, b: SetLocalAttributesCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(SetLocalAttributesCallback, a, b); } } /** * Change the local participant's name * - * @generated from message livekit.proto.UpdateLocalNameRequest + * @generated from message livekit.proto.SetLocalNameRequest */ -export class UpdateLocalNameRequest extends Message { +export class SetLocalNameRequest extends Message { /** * @generated from field: uint64 local_participant_handle = 1; */ @@ -1012,106 +1422,112 @@ export class UpdateLocalNameRequest extends Message { */ name = ""; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UpdateLocalNameRequest"; + static readonly typeName = "livekit.proto.SetLocalNameRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateLocalNameRequest { - return new UpdateLocalNameRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalNameRequest { + return new SetLocalNameRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateLocalNameRequest { - return new UpdateLocalNameRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalNameRequest { + return new SetLocalNameRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): UpdateLocalNameRequest { - return new UpdateLocalNameRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): SetLocalNameRequest { + return new SetLocalNameRequest().fromJsonString(jsonString, options); } - static equals(a: UpdateLocalNameRequest | PlainMessage | undefined, b: UpdateLocalNameRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(UpdateLocalNameRequest, a, b); + static equals(a: SetLocalNameRequest | PlainMessage | undefined, b: SetLocalNameRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SetLocalNameRequest, a, b); } } /** - * @generated from message livekit.proto.UpdateLocalNameResponse + * @generated from message livekit.proto.SetLocalNameResponse */ -export class UpdateLocalNameResponse extends Message { +export class SetLocalNameResponse extends Message { /** * @generated from field: uint64 async_id = 1; */ asyncId = protoInt64.zero; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UpdateLocalNameResponse"; + static readonly typeName = "livekit.proto.SetLocalNameResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateLocalNameResponse { - return new UpdateLocalNameResponse().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalNameResponse { + return new SetLocalNameResponse().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateLocalNameResponse { - return new UpdateLocalNameResponse().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalNameResponse { + return new SetLocalNameResponse().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): UpdateLocalNameResponse { - return new UpdateLocalNameResponse().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): SetLocalNameResponse { + return new SetLocalNameResponse().fromJsonString(jsonString, options); } - static equals(a: UpdateLocalNameResponse | PlainMessage | undefined, b: UpdateLocalNameResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(UpdateLocalNameResponse, a, b); + static equals(a: SetLocalNameResponse | PlainMessage | undefined, b: SetLocalNameResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SetLocalNameResponse, a, b); } } /** - * @generated from message livekit.proto.UpdateLocalNameCallback + * @generated from message livekit.proto.SetLocalNameCallback */ -export class UpdateLocalNameCallback extends Message { +export class SetLocalNameCallback extends Message { /** * @generated from field: uint64 async_id = 1; */ asyncId = protoInt64.zero; - constructor(data?: PartialMessage) { + /** + * @generated from field: optional string error = 2; + */ + error?: string; + + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UpdateLocalNameCallback"; + static readonly typeName = "livekit.proto.SetLocalNameCallback"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateLocalNameCallback { - return new UpdateLocalNameCallback().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalNameCallback { + return new SetLocalNameCallback().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateLocalNameCallback { - return new UpdateLocalNameCallback().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalNameCallback { + return new SetLocalNameCallback().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): UpdateLocalNameCallback { - return new UpdateLocalNameCallback().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): SetLocalNameCallback { + return new SetLocalNameCallback().fromJsonString(jsonString, options); } - static equals(a: UpdateLocalNameCallback | PlainMessage | undefined, b: UpdateLocalNameCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(UpdateLocalNameCallback, a, b); + static equals(a: SetLocalNameCallback | PlainMessage | undefined, b: SetLocalNameCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(SetLocalNameCallback, a, b); } } @@ -1644,6 +2060,73 @@ export class RoomOptions extends Message { } } +/** + * @generated from message livekit.proto.TranscriptionSegment + */ +export class TranscriptionSegment extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string text = 2; + */ + text = ""; + + /** + * @generated from field: uint64 start_time = 3; + */ + startTime = protoInt64.zero; + + /** + * @generated from field: uint64 end_time = 4; + */ + endTime = protoInt64.zero; + + /** + * @generated from field: bool final = 5; + */ + final = false; + + /** + * @generated from field: string language = 6; + */ + language = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.TranscriptionSegment"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "start_time", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 4, name: "end_time", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 5, name: "final", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "language", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TranscriptionSegment { + return new TranscriptionSegment().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TranscriptionSegment { + return new TranscriptionSegment().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TranscriptionSegment { + return new TranscriptionSegment().fromJsonString(jsonString, options); + } + + static equals(a: TranscriptionSegment | PlainMessage | undefined, b: TranscriptionSegment | PlainMessage | undefined): boolean { + return proto3.util.equals(TranscriptionSegment, a, b); + } +} + /** * @generated from message livekit.proto.BufferInfo */ @@ -1822,57 +2305,63 @@ export class RoomEvent extends Message { case: "roomMetadataChanged"; } | { /** - * @generated from field: livekit.proto.ParticipantMetadataChanged participant_metadata_changed = 15; + * @generated from field: livekit.proto.RoomSidChanged room_sid_changed = 15; + */ + value: RoomSidChanged; + case: "roomSidChanged"; + } | { + /** + * @generated from field: livekit.proto.ParticipantMetadataChanged participant_metadata_changed = 16; */ value: ParticipantMetadataChanged; case: "participantMetadataChanged"; } | { /** - * @generated from field: livekit.proto.ParticipantNameChanged participant_name_changed = 16; + * @generated from field: livekit.proto.ParticipantNameChanged participant_name_changed = 17; */ value: ParticipantNameChanged; case: "participantNameChanged"; } | { /** - * @generated from field: livekit.proto.ConnectionQualityChanged connection_quality_changed = 17; + * @generated from field: livekit.proto.ParticipantAttributesChanged participant_attributes_changed = 18; */ - value: ConnectionQualityChanged; - case: "connectionQualityChanged"; + value: ParticipantAttributesChanged; + case: "participantAttributesChanged"; } | { /** - * @generated from field: livekit.proto.DataReceived data_received = 18; + * @generated from field: livekit.proto.ConnectionQualityChanged connection_quality_changed = 19; */ - value: DataReceived; - case: "dataReceived"; + value: ConnectionQualityChanged; + case: "connectionQualityChanged"; } | { /** - * @generated from field: livekit.proto.ConnectionStateChanged connection_state_changed = 19; + * @generated from field: livekit.proto.ConnectionStateChanged connection_state_changed = 20; */ value: ConnectionStateChanged; case: "connectionStateChanged"; } | { /** - * Connected connected = 20; + * Connected connected = 21; * - * @generated from field: livekit.proto.Disconnected disconnected = 21; + * @generated from field: livekit.proto.Disconnected disconnected = 22; */ value: Disconnected; case: "disconnected"; } | { /** - * @generated from field: livekit.proto.Reconnecting reconnecting = 22; + * @generated from field: livekit.proto.Reconnecting reconnecting = 23; */ value: Reconnecting; case: "reconnecting"; } | { /** - * @generated from field: livekit.proto.Reconnected reconnected = 23; + * @generated from field: livekit.proto.Reconnected reconnected = 24; */ value: Reconnected; case: "reconnected"; } | { /** - * @generated from field: livekit.proto.E2eeStateChanged e2ee_state_changed = 24; + * @generated from field: livekit.proto.E2eeStateChanged e2ee_state_changed = 25; */ value: E2eeStateChanged; case: "e2eeStateChanged"; @@ -1880,10 +2369,16 @@ export class RoomEvent extends Message { /** * The stream of room events has ended * - * @generated from field: livekit.proto.RoomEOS eos = 25; + * @generated from field: livekit.proto.RoomEOS eos = 26; */ value: RoomEOS; case: "eos"; + } | { + /** + * @generated from field: livekit.proto.DataPacketReceived data_packet_received = 27; + */ + value: DataPacketReceived; + case: "dataPacketReceived"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -1908,16 +2403,18 @@ export class RoomEvent extends Message { { no: 12, name: "track_unmuted", kind: "message", T: TrackUnmuted, oneof: "message" }, { no: 13, name: "active_speakers_changed", kind: "message", T: ActiveSpeakersChanged, oneof: "message" }, { no: 14, name: "room_metadata_changed", kind: "message", T: RoomMetadataChanged, oneof: "message" }, - { no: 15, name: "participant_metadata_changed", kind: "message", T: ParticipantMetadataChanged, oneof: "message" }, - { no: 16, name: "participant_name_changed", kind: "message", T: ParticipantNameChanged, oneof: "message" }, - { no: 17, name: "connection_quality_changed", kind: "message", T: ConnectionQualityChanged, oneof: "message" }, - { no: 18, name: "data_received", kind: "message", T: DataReceived, oneof: "message" }, - { no: 19, name: "connection_state_changed", kind: "message", T: ConnectionStateChanged, oneof: "message" }, - { no: 21, name: "disconnected", kind: "message", T: Disconnected, oneof: "message" }, - { no: 22, name: "reconnecting", kind: "message", T: Reconnecting, oneof: "message" }, - { no: 23, name: "reconnected", kind: "message", T: Reconnected, oneof: "message" }, - { no: 24, name: "e2ee_state_changed", kind: "message", T: E2eeStateChanged, oneof: "message" }, - { no: 25, name: "eos", kind: "message", T: RoomEOS, oneof: "message" }, + { no: 15, name: "room_sid_changed", kind: "message", T: RoomSidChanged, oneof: "message" }, + { no: 16, name: "participant_metadata_changed", kind: "message", T: ParticipantMetadataChanged, oneof: "message" }, + { no: 17, name: "participant_name_changed", kind: "message", T: ParticipantNameChanged, oneof: "message" }, + { no: 18, name: "participant_attributes_changed", kind: "message", T: ParticipantAttributesChanged, oneof: "message" }, + { no: 19, name: "connection_quality_changed", kind: "message", T: ConnectionQualityChanged, oneof: "message" }, + { no: 20, name: "connection_state_changed", kind: "message", T: ConnectionStateChanged, oneof: "message" }, + { no: 22, name: "disconnected", kind: "message", T: Disconnected, oneof: "message" }, + { no: 23, name: "reconnecting", kind: "message", T: Reconnecting, oneof: "message" }, + { no: 24, name: "reconnected", kind: "message", T: Reconnected, oneof: "message" }, + { no: 25, name: "e2ee_state_changed", kind: "message", T: E2eeStateChanged, oneof: "message" }, + { no: 26, name: "eos", kind: "message", T: RoomEOS, oneof: "message" }, + { no: 27, name: "data_packet_received", kind: "message", T: DataPacketReceived, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomEvent { @@ -1942,9 +2439,9 @@ export class RoomEvent extends Message { */ export class RoomInfo extends Message { /** - * @generated from field: string sid = 1; + * @generated from field: optional string sid = 1; */ - sid = ""; + sid?: string; /** * @generated from field: string name = 2; @@ -1964,7 +2461,7 @@ export class RoomInfo extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RoomInfo"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -2071,9 +2568,9 @@ export class ParticipantConnected extends Message { */ export class ParticipantDisconnected extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; constructor(data?: PartialMessage) { super(); @@ -2083,7 +2580,7 @@ export class ParticipantDisconnected extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ParticipantDisconnected"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantDisconnected { @@ -2185,9 +2682,9 @@ export class LocalTrackUnpublished extends Message { */ export class TrackPublished extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: livekit.proto.OwnedTrackPublication publication = 2; @@ -2202,7 +2699,7 @@ export class TrackPublished extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackPublished"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "publication", kind: "message", T: OwnedTrackPublication }, ]); @@ -2228,9 +2725,9 @@ export class TrackPublished extends Message { */ export class TrackUnpublished extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: string publication_sid = 2; @@ -2245,7 +2742,7 @@ export class TrackUnpublished extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackUnpublished"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -2274,9 +2771,9 @@ export class TrackUnpublished extends Message { */ export class TrackSubscribed extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: livekit.proto.OwnedTrack track = 2; @@ -2291,7 +2788,7 @@ export class TrackSubscribed extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackSubscribed"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "track", kind: "message", T: OwnedTrack }, ]); @@ -2319,9 +2816,9 @@ export class TrackUnsubscribed extends Message { /** * The FFI language can dispose/remove the VideoSink here * - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: string track_sid = 2; @@ -2336,7 +2833,7 @@ export class TrackUnsubscribed extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackUnsubscribed"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -2362,9 +2859,9 @@ export class TrackUnsubscribed extends Message { */ export class TrackSubscriptionFailed extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: string track_sid = 2; @@ -2384,7 +2881,7 @@ export class TrackSubscriptionFailed extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackSubscriptionFailed"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -2411,9 +2908,9 @@ export class TrackSubscriptionFailed extends Message { */ export class TrackMuted extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: string track_sid = 2; @@ -2428,7 +2925,7 @@ export class TrackMuted extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackMuted"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -2454,9 +2951,9 @@ export class TrackMuted extends Message { */ export class TrackUnmuted extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: string track_sid = 2; @@ -2471,7 +2968,7 @@ export class TrackUnmuted extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackUnmuted"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -2499,9 +2996,9 @@ export class E2eeStateChanged extends Message { /** * Using sid instead of identity for ffi communication * - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: livekit.proto.EncryptionState state = 2; @@ -2516,7 +3013,7 @@ export class E2eeStateChanged extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.E2eeStateChanged"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(EncryptionState) }, ]); @@ -2542,9 +3039,9 @@ export class E2eeStateChanged extends Message { */ export class ActiveSpeakersChanged extends Message { /** - * @generated from field: repeated string participant_sids = 1; + * @generated from field: repeated string participant_identities = 1; */ - participantSids: string[] = []; + participantIdentities: string[] = []; constructor(data?: PartialMessage) { super(); @@ -2554,7 +3051,7 @@ export class ActiveSpeakersChanged extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ActiveSpeakersChanged"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sids", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 1, name: "participant_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ActiveSpeakersChanged { @@ -2611,14 +3108,51 @@ export class RoomMetadataChanged extends Message { } } +/** + * @generated from message livekit.proto.RoomSidChanged + */ +export class RoomSidChanged extends Message { + /** + * @generated from field: string sid = 1; + */ + sid = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.RoomSidChanged"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RoomSidChanged { + return new RoomSidChanged().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RoomSidChanged { + return new RoomSidChanged().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RoomSidChanged { + return new RoomSidChanged().fromJsonString(jsonString, options); + } + + static equals(a: RoomSidChanged | PlainMessage | undefined, b: RoomSidChanged | PlainMessage | undefined): boolean { + return proto3.util.equals(RoomSidChanged, a, b); + } +} + /** * @generated from message livekit.proto.ParticipantMetadataChanged */ export class ParticipantMetadataChanged extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: string metadata = 2; @@ -2633,7 +3167,7 @@ export class ParticipantMetadataChanged extends Message [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -2654,14 +3188,63 @@ export class ParticipantMetadataChanged extends Message { + /** + * @generated from field: string participant_identity = 1; + */ + participantIdentity = ""; + + /** + * @generated from field: map old_attributes = 2; + */ + oldAttributes: { [key: string]: string } = {}; + + /** + * @generated from field: map attributes = 3; + */ + attributes: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.ParticipantAttributesChanged"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "old_attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 3, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantAttributesChanged { + return new ParticipantAttributesChanged().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ParticipantAttributesChanged { + return new ParticipantAttributesChanged().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ParticipantAttributesChanged { + return new ParticipantAttributesChanged().fromJsonString(jsonString, options); + } + + static equals(a: ParticipantAttributesChanged | PlainMessage | undefined, b: ParticipantAttributesChanged | PlainMessage | undefined): boolean { + return proto3.util.equals(ParticipantAttributesChanged, a, b); + } +} + /** * @generated from message livekit.proto.ParticipantNameChanged */ export class ParticipantNameChanged extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: string name = 2; @@ -2676,7 +3259,7 @@ export class ParticipantNameChanged extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ParticipantNameChanged"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -2702,9 +3285,9 @@ export class ParticipantNameChanged extends Message { */ export class ConnectionQualityChanged extends Message { /** - * @generated from field: string participant_sid = 1; + * @generated from field: string participant_identity = 1; */ - participantSid = ""; + participantIdentity = ""; /** * @generated from field: livekit.proto.ConnectionQuality quality = 2; @@ -2719,7 +3302,7 @@ export class ConnectionQualityChanged extends Message static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ConnectionQualityChanged"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "quality", kind: "enum", T: proto3.getEnumType(ConnectionQuality) }, ]); @@ -2741,59 +3324,152 @@ export class ConnectionQualityChanged extends Message } /** - * @generated from message livekit.proto.DataReceived + * @generated from message livekit.proto.UserPacket */ -export class DataReceived extends Message { +export class UserPacket extends Message { /** * @generated from field: livekit.proto.OwnedBuffer data = 1; */ data?: OwnedBuffer; /** - * Can be empty if the data is sent a server SDK - * - * @generated from field: optional string participant_sid = 2; + * @generated from field: optional string topic = 2; + */ + topic?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.UserPacket"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "data", kind: "message", T: OwnedBuffer }, + { no: 2, name: "topic", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UserPacket { + return new UserPacket().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UserPacket { + return new UserPacket().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UserPacket { + return new UserPacket().fromJsonString(jsonString, options); + } + + static equals(a: UserPacket | PlainMessage | undefined, b: UserPacket | PlainMessage | undefined): boolean { + return proto3.util.equals(UserPacket, a, b); + } +} + +/** + * @generated from message livekit.proto.SipDTMF + */ +export class SipDTMF extends Message { + /** + * @generated from field: uint32 code = 1; */ - participantSid?: string; + code = 0; + + /** + * @generated from field: optional string digit = 2; + */ + digit?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.SipDTMF"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "digit", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SipDTMF { + return new SipDTMF().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SipDTMF { + return new SipDTMF().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SipDTMF { + return new SipDTMF().fromJsonString(jsonString, options); + } + + static equals(a: SipDTMF | PlainMessage | undefined, b: SipDTMF | PlainMessage | undefined): boolean { + return proto3.util.equals(SipDTMF, a, b); + } +} + +/** + * @generated from message livekit.proto.DataPacketReceived + */ +export class DataPacketReceived extends Message { /** - * @generated from field: livekit.proto.DataPacketKind kind = 3; + * @generated from field: livekit.proto.DataPacketKind kind = 1; */ kind = DataPacketKind.KIND_LOSSY; /** - * @generated from field: optional string topic = 4; + * Can be empty if the data is sent a server SDK + * + * @generated from field: string participant_identity = 2; */ - topic?: string; + participantIdentity = ""; + + /** + * @generated from oneof livekit.proto.DataPacketReceived.value + */ + value: { + /** + * @generated from field: livekit.proto.UserPacket user = 4; + */ + value: UserPacket; + case: "user"; + } | { + /** + * @generated from field: livekit.proto.SipDTMF sip_dtmf = 5; + */ + value: SipDTMF; + case: "sipDtmf"; + } | { case: undefined; value?: undefined } = { case: undefined }; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.DataReceived"; + static readonly typeName = "livekit.proto.DataPacketReceived"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data", kind: "message", T: OwnedBuffer }, - { no: 2, name: "participant_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 3, name: "kind", kind: "enum", T: proto3.getEnumType(DataPacketKind) }, - { no: 4, name: "topic", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 1, name: "kind", kind: "enum", T: proto3.getEnumType(DataPacketKind) }, + { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "user", kind: "message", T: UserPacket, oneof: "value" }, + { no: 5, name: "sip_dtmf", kind: "message", T: SipDTMF, oneof: "value" }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): DataReceived { - return new DataReceived().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): DataPacketReceived { + return new DataPacketReceived().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): DataReceived { - return new DataReceived().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): DataPacketReceived { + return new DataPacketReceived().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): DataReceived { - return new DataReceived().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): DataPacketReceived { + return new DataPacketReceived().fromJsonString(jsonString, options); } - static equals(a: DataReceived | PlainMessage | undefined, b: DataReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(DataReceived, a, b); + static equals(a: DataPacketReceived | PlainMessage | undefined, b: DataPacketReceived | PlainMessage | undefined): boolean { + return proto3.util.equals(DataPacketReceived, a, b); } } diff --git a/packages/livekit-rtc/src/proto/stats_pb.ts b/packages/livekit-rtc/src/proto/stats_pb.ts index 9c1c6187..ee7a001f 100644 --- a/packages/livekit-rtc/src/proto/stats_pb.ts +++ b/packages/livekit-rtc/src/proto/stats_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.7.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" // @generated from file stats.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/livekit-rtc/src/proto/track_pb.ts b/packages/livekit-rtc/src/proto/track_pb.ts index 2d86164a..b41cba3d 100644 --- a/packages/livekit-rtc/src/proto/track_pb.ts +++ b/packages/livekit-rtc/src/proto/track_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.7.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" // @generated from file track.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/livekit-rtc/src/proto/video_frame_pb.ts b/packages/livekit-rtc/src/proto/video_frame_pb.ts index 3397a894..383c8976 100644 --- a/packages/livekit-rtc/src/proto/video_frame_pb.ts +++ b/packages/livekit-rtc/src/proto/video_frame_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.7.2 with parameter "target=ts" +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" // @generated from file video_frame.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 80591dfd..20bdc6e9 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -31,6 +31,7 @@ import type { RemoteTrack } from './track.js'; import { RemoteAudioTrack, RemoteVideoTrack } from './track.js'; import type { LocalTrackPublication, TrackPublication } from './track_publication.js'; import { RemoteTrackPublication } from './track_publication.js'; +import { diffAttributes } from './utils.js'; export interface RtcConfiguration { iceTransportType: IceTransportType; @@ -175,7 +176,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter this.remoteParticipants.set(participant.identity, participant); this.emit(RoomEvent.ParticipantConnected, participant); } else if (ev.case == 'participantDisconnected') { - const participant = this.getRemoteParticipantBySid(ev.value.participantSid); + const participant = this.remoteParticipants.get(ev.value.participantIdentity); this.remoteParticipants.delete(participant.identity); this.emit(RoomEvent.ParticipantDisconnected, participant); } else if (ev.case == 'localTrackPublished') { @@ -186,18 +187,18 @@ export class Room extends (EventEmitter as new () => TypedEmitter this.localParticipant.trackPublications.delete(ev.value.publicationSid); this.emit(RoomEvent.LocalTrackUnpublished, publication, this.localParticipant); } else if (ev.case == 'trackPublished') { - const participant = this.getRemoteParticipantBySid(ev.value.participantSid); + const participant = this.remoteParticipants.get(ev.value.participantIdentity); const publication = new RemoteTrackPublication(ev.value.publication); participant.trackPublications.set(publication.sid, publication); this.emit(RoomEvent.TrackPublished, publication, participant); } else if (ev.case == 'trackUnpublished') { - const participant = this.getRemoteParticipantBySid(ev.value.participantSid); + const participant = this.remoteParticipants.get(ev.value.participantIdentity); const publication = participant.trackPublications.get(ev.value.publicationSid); participant.trackPublications.delete(ev.value.publicationSid); this.emit(RoomEvent.TrackUnpublished, publication, participant); } else if (ev.case == 'trackSubscribed') { const ownedTrack = ev.value.track; - const participant = this.getRemoteParticipantBySid(ev.value.participantSid); + const participant = this.remoteParticipants.get(ev.value.participantIdentity); const publication = participant.trackPublications.get(ownedTrack.info.sid); publication.subscribed = true; if (ownedTrack.info.kind == TrackKind.KIND_VIDEO) { @@ -208,16 +209,16 @@ export class Room extends (EventEmitter as new () => TypedEmitter this.emit(RoomEvent.TrackSubscribed, publication.track, publication, participant); } else if (ev.case == 'trackUnsubscribed') { - const participant = this.getRemoteParticipantBySid(ev.value.participantSid); + const participant = this.remoteParticipants.get(ev.value.participantIdentity); const publication = participant.trackPublications.get(ev.value.trackSid); publication.track = undefined; publication.subscribed = false; this.emit(RoomEvent.TrackUnsubscribed, publication.track, publication, participant); } else if (ev.case == 'trackSubscriptionFailed') { - const participant = this.getRemoteParticipantBySid(ev.value.participantSid); + const participant = this.remoteParticipants.get(ev.value.participantIdentity); this.emit(RoomEvent.TrackSubscriptionFailed, ev.value.trackSid, participant, ev.value.error); } else if (ev.case == 'trackMuted') { - const participant = this.retrieveParticipant(ev.value.participantSid); + const participant = this.remoteParticipants.get(ev.value.participantIdentity); const publication = participant.trackPublications.get(ev.value.trackSid); publication.info.muted = true; if (publication.track) { @@ -225,7 +226,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter } this.emit(RoomEvent.TrackMuted, publication, participant); } else if (ev.case == 'trackUnmuted') { - const participant = this.retrieveParticipant(ev.value.participantSid); + const participant = this.retrieveParticipantByIdentity(ev.value.participantIdentity); const publication = participant.trackPublications.get(ev.value.trackSid); publication.info.muted = false; if (publication.track) { @@ -233,31 +234,56 @@ export class Room extends (EventEmitter as new () => TypedEmitter } this.emit(RoomEvent.TrackUnmuted, publication, participant); } else if (ev.case == 'activeSpeakersChanged') { - const activeSpeakers = ev.value.participantSids.map((sid) => - this.getRemoteParticipantBySid(sid), + const activeSpeakers = ev.value.participantIdentities.map((identity) => + this.retrieveParticipantByIdentity(identity), ); this.emit(RoomEvent.ActiveSpeakersChanged, activeSpeakers); } else if (ev.case == 'roomMetadataChanged') { this.info.metadata = ev.value.metadata; this.emit(RoomEvent.RoomMetadataChanged, this.info.metadata); } else if (ev.case == 'participantMetadataChanged') { - const participant = this.retrieveParticipant(ev.value.participantSid); + const participant = this.retrieveParticipantByIdentity(ev.value.participantIdentity); participant.info.metadata = ev.value.metadata; this.emit(RoomEvent.ParticipantMetadataChanged, participant.metadata, participant); } else if (ev.case == 'participantNameChanged') { - const participant = this.retrieveParticipant(ev.value.participantSid); + const participant = this.retrieveParticipantByIdentity(ev.value.participantIdentity); participant.info.name = ev.value.name; this.emit(RoomEvent.ParticipantNameChanged, participant.name, participant); + } else if (ev.case == 'participantAttributesChanged') { + const participant = this.retrieveParticipantByIdentity(ev.value.participantIdentity); + const changedAttributes = diffAttributes(participant.info.attributes, ev.value.attributes); + participant.info.attributes = ev.value.attributes; + this.emit(RoomEvent.ParticipantAttributesChanged, changedAttributes, participant); } else if (ev.case == 'connectionQualityChanged') { - const participant = this.retrieveParticipant(ev.value.participantSid); + const participant = this.retrieveParticipantByIdentity(ev.value.participantIdentity); this.emit(RoomEvent.ConnectionQualityChanged, ev.value.quality, participant); - } else if (ev.case == 'dataReceived') { + } else if (ev.case == 'dataPacketReceived') { // Can be undefined if the data is sent from a Server SDK - const participant = this.getRemoteParticipantBySid(ev.value.participantSid); - const info = ev.value.data; - const buffer = FfiClient.instance.copyBuffer(info.data.dataPtr, Number(info.data.dataLen)); - new FfiHandle(info.handle.id).dispose(); - this.emit(RoomEvent.DataReceived, buffer, participant, ev.value.kind, ev.value.topic); + const participant = this.remoteParticipants.get(ev.value.participantIdentity); + const dataPacket = ev.value.value; + switch (dataPacket.case) { + case 'user': + const buffer = FfiClient.instance.copyBuffer( + dataPacket.value.data.data.dataPtr, + Number(dataPacket.value.data.data.dataLen), + ); + new FfiHandle(dataPacket.value.data.handle.id).dispose(); + this.emit( + RoomEvent.DataReceived, + buffer, + participant, + ev.value.kind, + dataPacket.value.topic, + ); + break; + case 'sipDtmf': + const { code, digit } = dataPacket.value; + this.emit(RoomEvent.DtmfReceived, code, digit, participant); + break; + + default: + break; + } } else if (ev.case == 'e2eeStateChanged') { if (ev.value.state == EncryptionState.INTERNAL_ERROR) { // throw generic error until Rust SDK is updated to supply the error alongside INTERNAL_ERROR @@ -277,15 +303,11 @@ export class Room extends (EventEmitter as new () => TypedEmitter } }; - getRemoteParticipantBySid(sid: string) { - return Array.from(this.remoteParticipants.values()).find((p) => p.sid === sid); - } - - private retrieveParticipant(sid: string): Participant { - if (this.localParticipant.sid === sid) { + private retrieveParticipantByIdentity(identity: string): Participant { + if (this.localParticipant.identity === identity) { return this.localParticipant; } else { - return this.getRemoteParticipantBySid(sid); + return this.remoteParticipants.get(identity); } } @@ -337,6 +359,10 @@ export type RoomCallbacks = { roomMetadataChanged: (metadata: string) => void; participantMetadataChanged: (metadata: string | undefined, participant: Participant) => void; participantNameChanged: (name: string, participant: Participant) => void; + participantAttributesChanged: ( + changedAttributes: Record, + participant: Participant, + ) => void; connectionQualityChanged: (quality: ConnectionQuality, participant: Participant) => void; dataReceived: ( payload: Uint8Array, @@ -344,6 +370,7 @@ export type RoomCallbacks = { kind?: DataPacketKind, topic?: string, ) => void; + dtmfReceived: (code: number, digit: string, participant: RemoteParticipant) => void; encryptionError: (error: Error) => void; connectionStateChanged: (state: ConnectionState) => void; connected: () => void; @@ -368,8 +395,10 @@ export enum RoomEvent { RoomMetadataChanged = 'roomMetadataChanged', ParticipantMetadataChanged = 'participantMetadataChanged', ParticipantNameChanged = 'participantNameChanged', + ParticipantAttributesChanged = 'participantAttributesChanged', ConnectionQualityChanged = 'connectionQualityChanged', DataReceived = 'dataReceived', + DtmfReceived = 'dtmfReceived', EncryptionError = 'encryptionError', ConnectionStateChanged = 'connectionStateChanged', Connected = 'connected', diff --git a/packages/livekit-rtc/src/utils.ts b/packages/livekit-rtc/src/utils.ts new file mode 100644 index 00000000..7f2b25d7 --- /dev/null +++ b/packages/livekit-rtc/src/utils.ts @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: 2024 LiveKit, Inc. +// +// SPDX-License-Identifier: Apache-2.0 + +export function diffAttributes( + oldValues: Record | undefined, + newValues: Record | undefined, +) { + if (oldValues === undefined) { + oldValues = {}; + } + if (newValues === undefined) { + newValues = {}; + } + const allKeys = [...Object.keys(newValues), ...Object.keys(oldValues)]; + const diff: Record = {}; + + for (const key of allKeys) { + if (oldValues[key] !== newValues[key]) { + diff[key] = newValues[key] ?? ''; + } + } + + return diff; +}