From d7e3a4da68509e8029c897f99025fd9f299fd64b Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 12:34:25 -0700 Subject: [PATCH 001/126] draft --- packages/livekit-rtc/src/participant.ts | 74 +++++++++++++++++++++++++ packages/livekit-rtc/src/room.ts | 62 ++++++++++++++++++--- 2 files changed, 129 insertions(+), 7 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 73bbee54..f54c8bbb 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -37,6 +37,7 @@ import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; import type { Transcription } from './transcription.js'; +import { RpcRequest, type RpcAck, type RpcResponse } from './rpc.js'; export abstract class Participant { /** @internal */ @@ -262,6 +263,79 @@ export class LocalParticipant extends Participant { pub.track = undefined; this.trackPublications.delete(trackSid); } + + private pendingAcks = new Map void>(); + private pendingResponses = new Map void>(); + + performRpcRequest( + recipientIdentity: string, + name: string, + data: string, + ackTimeout: number = 5000, + responseTimeout: number = 10000, + ): { ackPromise: Promise; responsePromise: Promise } { + const id = crypto.randomUUID(); + + const request = new RpcRequest(); + request.id = id; + request.name = name; + request.data = data; + + const jsonString = JSON.stringify(request); + this.publishData(new TextEncoder().encode(jsonString), { + reliable: true, + destination_identities: [recipientIdentity], + topic: 'lk-rpc-request', + }); + console.log('RPC REQUEST SENT', jsonString); + + const ackPromise = new Promise((resolve, reject) => { + const ackTimeoutId = setTimeout(() => { + this.pendingAcks.delete(id); + reject(new Error('ACK timeout')); + }, ackTimeout); + + this.pendingAcks.set(id, (ack) => { + console.log('ACK HANDLER CALLED'); + clearTimeout(ackTimeoutId); + resolve(ack); + }); + }); + + const responsePromise = new Promise((resolve, reject) => { + const responseTimeoutId = setTimeout(() => { + this.pendingResponses.delete(id); + reject(new Error('Response timeout')); + }, responseTimeout); + + this.pendingResponses.set(id, (response) => { + console.log('RESPONSE HANDLER CALLED'); + clearTimeout(responseTimeoutId); + resolve(response); + }); + }); + + return { ackPromise, responsePromise }; + } + + handleIncomingRpcAck(rpcAck: RpcAck) { + console.log('RPC ACK RECEIVED', rpcAck); + const handler = this.pendingAcks.get(rpcAck.requestId); + if (handler) { + handler(rpcAck); + this.pendingAcks.delete(rpcAck.requestId); + } + } + + handleIncomingRpcResponse(rpcResponse: RpcResponse) { + console.log('RPC RESPONSE RECEIVED', rpcResponse); + const handler = this.pendingResponses.get(rpcResponse.requestId); + if (handler) { + handler(rpcResponse); + this.pendingResponses.delete(rpcResponse.requestId); + } + } + } export class RemoteParticipant extends Participant { diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 2c50981e..6f9c9a49 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -32,6 +32,7 @@ import type { LocalTrack, 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 { RpcRequest, RpcAck, RpcResponse } from './rpc.js'; export interface RtcConfiguration { iceTransportType: IceTransportType; @@ -273,13 +274,24 @@ export class Room extends (EventEmitter as new () => TypedEmitter 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, - ); + if (dataPacket.value.topic === 'lk-rpc-request') { + const request = JSON.parse(new TextDecoder().decode(buffer)) as RpcRequest; + this.handleIncomingRpcRequest(request, participant); + } else if (dataPacket.value.topic === 'lk-rpc-ack') { + const ack = JSON.parse(new TextDecoder().decode(buffer)) as RpcAck; + this.localParticipant.handleIncomingRpcAck(ack); + } else if (dataPacket.value.topic === 'lk-rpc-response') { + const response = JSON.parse(new TextDecoder().decode(buffer)) as RpcResponse; + this.localParticipant.handleIncomingRpcResponse(response); + } else { + this.emit( + RoomEvent.DataReceived, + buffer, + participant, + ev.value.kind, + dataPacket.value.topic, + ); + } break; case 'sipDtmf': const { code, digit } = dataPacket.value; @@ -308,6 +320,40 @@ export class Room extends (EventEmitter as new () => TypedEmitter } }; + private handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { + console.log('RPC REQUEST RECEIVED', request); + const ack = new RpcAck(); + ack.requestId = request.id; + const jsonString = JSON.stringify(ack); + this.localParticipant.publishData(new TextEncoder().encode(jsonString), { + reliable: true, + destination_identities: [sender.identity], + topic: 'lk-rpc-ack', + }); + console.log('RPC ACK SENT', ack); + + this.emit(RoomEvent.RpcRequestReceived, request, sender, (response: string, errorCode?: number, errorData?: string) => { + const rpcResponse = new RpcResponse(); + rpcResponse.requestId = request.id; + rpcResponse.data = response; + + if (errorCode) { + rpcResponse.errorCode = errorCode; + } + if (errorData) { + rpcResponse.errorData = errorData; + } + + const jsonString = JSON.stringify(rpcResponse); + this.localParticipant.publishData(new TextEncoder().encode(jsonString), { + reliable: true, + destination_identities: [sender.identity], + topic: 'lk-rpc-response', + }); + console.log('RPC RESPONSE SENT', rpcResponse); + }); + } + private retrieveParticipantByIdentity(identity: string): Participant { if (this.localParticipant.identity === identity) { return this.localParticipant; @@ -383,6 +429,7 @@ export type RoomCallbacks = { disconnected: (reason: DisconnectReason) => void; reconnecting: () => void; reconnected: () => void; + rpcRequestReceived: (request: RpcRequest, sender: RemoteParticipant, callback: (response: string, errorCode?: number, errorData?: string) => void) => void; }; export enum RoomEvent { @@ -412,4 +459,5 @@ export enum RoomEvent { Disconnected = 'disconnected', Reconnecting = 'reconnecting', Reconnected = 'reconnected', + RpcRequestReceived = 'rpcRequestReceived', } From bc4d82cf4a19a19593039a4aec5173c56a0dd1f3 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 12:43:35 -0700 Subject: [PATCH 002/126] wip --- packages/livekit-rtc/src/participant.ts | 2 -- packages/livekit-rtc/src/room.ts | 48 +++++++++++++++---------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index f54c8bbb..a6f51db7 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -296,7 +296,6 @@ export class LocalParticipant extends Participant { }, ackTimeout); this.pendingAcks.set(id, (ack) => { - console.log('ACK HANDLER CALLED'); clearTimeout(ackTimeoutId); resolve(ack); }); @@ -309,7 +308,6 @@ export class LocalParticipant extends Participant { }, responseTimeout); this.pendingResponses.set(id, (response) => { - console.log('RESPONSE HANDLER CALLED'); clearTimeout(responseTimeoutId); resolve(response); }); diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 6f9c9a49..e8906cb8 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -322,27 +322,25 @@ export class Room extends (EventEmitter as new () => TypedEmitter private handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { console.log('RPC REQUEST RECEIVED', request); - const ack = new RpcAck(); - ack.requestId = request.id; - const jsonString = JSON.stringify(ack); - this.localParticipant.publishData(new TextEncoder().encode(jsonString), { - reliable: true, - destination_identities: [sender.identity], - topic: 'lk-rpc-ack', - }); - console.log('RPC ACK SENT', ack); + + const sendAck = () => { + const ack = new RpcAck(); + ack.requestId = request.id; + const jsonString = JSON.stringify(ack); + this.localParticipant.publishData(new TextEncoder().encode(jsonString), { + reliable: true, + destination_identities: [sender.identity], + topic: 'lk-rpc-ack', + }); + console.log('RPC ACK SENT', ack); + }; - this.emit(RoomEvent.RpcRequestReceived, request, sender, (response: string, errorCode?: number, errorData?: string) => { + const sendResponse = (response: string, errorCode?: number, errorData?: string) => { const rpcResponse = new RpcResponse(); rpcResponse.requestId = request.id; rpcResponse.data = response; - - if (errorCode) { - rpcResponse.errorCode = errorCode; - } - if (errorData) { - rpcResponse.errorData = errorData; - } + rpcResponse.errorCode = errorCode || 0; + rpcResponse.errorData = errorData; const jsonString = JSON.stringify(rpcResponse); this.localParticipant.publishData(new TextEncoder().encode(jsonString), { @@ -351,7 +349,14 @@ export class Room extends (EventEmitter as new () => TypedEmitter topic: 'lk-rpc-response', }); console.log('RPC RESPONSE SENT', rpcResponse); - }); + }; + + this.emit(RoomEvent.RpcRequestReceived, + request, + sender, + sendAck, + sendResponse, + ); } private retrieveParticipantByIdentity(identity: string): Participant { @@ -429,7 +434,12 @@ export type RoomCallbacks = { disconnected: (reason: DisconnectReason) => void; reconnecting: () => void; reconnected: () => void; - rpcRequestReceived: (request: RpcRequest, sender: RemoteParticipant, callback: (response: string, errorCode?: number, errorData?: string) => void) => void; + rpcRequestReceived: ( + request: RpcRequest, + sender: RemoteParticipant, + sendAck: () => void, + sendResponse: (response: string, errorCode?: number, errorData?: string) => void, + ) => void; }; export enum RoomEvent { From 9e052e9b98ebe1a8719813ce14ed0fb5749095a6 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 12:43:43 -0700 Subject: [PATCH 003/126] wip --- packages/livekit-rtc/src/rpc.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/livekit-rtc/src/rpc.ts diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts new file mode 100644 index 00000000..825564a5 --- /dev/null +++ b/packages/livekit-rtc/src/rpc.ts @@ -0,0 +1,16 @@ +export class RpcRequest { + id: string; + name: string; + data: string; +} + +export class RpcAck { + requestId: string; +} + +export class RpcResponse { + requestId: string; + data: string; + errorCode: number; // Use 0 for success; non-zero for errors. + errorData?: string; // Optional error message. +} \ No newline at end of file From d64a4b51c56ca4412d358a69e2fd5557d19fa60a Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 12:50:55 -0700 Subject: [PATCH 004/126] wip --- packages/livekit-rtc/src/participant.ts | 57 +++++++++++++------------ packages/livekit-rtc/src/rpc.ts | 6 ++- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index a6f51db7..f6c29e81 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -33,11 +33,11 @@ import { SetLocalNameRequest, UnpublishTrackRequest, } from './proto/room_pb.js'; +import { type RpcAck, RpcRequest, type RpcResponse, RPC_ERROR_ACK_TIMEOUT, RPC_ERROR_RESPONSE_TIMEOUT } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; import type { Transcription } from './transcription.js'; -import { RpcRequest, type RpcAck, type RpcResponse } from './rpc.js'; export abstract class Participant { /** @internal */ @@ -273,47 +273,51 @@ export class LocalParticipant extends Participant { data: string, ackTimeout: number = 5000, responseTimeout: number = 10000, - ): { ackPromise: Promise; responsePromise: Promise } { - const id = crypto.randomUUID(); - - const request = new RpcRequest(); - request.id = id; - request.name = name; - request.data = data; - - const jsonString = JSON.stringify(request); - this.publishData(new TextEncoder().encode(jsonString), { - reliable: true, - destination_identities: [recipientIdentity], - topic: 'lk-rpc-request', - }); - console.log('RPC REQUEST SENT', jsonString); + ): Promise { + return new Promise((resolve, reject) => { + const id = crypto.randomUUID(); + + const request = new RpcRequest(); + request.id = id; + request.name = name; + request.data = data; + + const jsonString = JSON.stringify(request); + this.publishData(new TextEncoder().encode(jsonString), { + reliable: true, + destination_identities: [recipientIdentity], + topic: 'lk-rpc-request', + }); + console.log('RPC REQUEST SENT', jsonString); - const ackPromise = new Promise((resolve, reject) => { const ackTimeoutId = setTimeout(() => { this.pendingAcks.delete(id); - reject(new Error('ACK timeout')); + reject({ code: RPC_ERROR_ACK_TIMEOUT }); + this.pendingResponses.delete(id); + clearTimeout(responseTimeoutId); }, ackTimeout); - this.pendingAcks.set(id, (ack) => { + this.pendingAcks.set(id, () => { clearTimeout(ackTimeoutId); - resolve(ack); }); - }); - const responsePromise = new Promise((resolve, reject) => { const responseTimeoutId = setTimeout(() => { this.pendingResponses.delete(id); - reject(new Error('Response timeout')); + reject({ code: RPC_ERROR_RESPONSE_TIMEOUT }); }, responseTimeout); this.pendingResponses.set(id, (response) => { clearTimeout(responseTimeoutId); - resolve(response); + if (response.errorCode !== 0 || response.errorData) { + reject({ + code: response.errorCode, + data: response.errorData + }); + } else { + resolve(response.data); + } }); }); - - return { ackPromise, responsePromise }; } handleIncomingRpcAck(rpcAck: RpcAck) { @@ -333,7 +337,6 @@ export class LocalParticipant extends Participant { this.pendingResponses.delete(rpcResponse.requestId); } } - } export class RemoteParticipant extends Participant { diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 825564a5..6d7290f2 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -13,4 +13,8 @@ export class RpcResponse { data: string; errorCode: number; // Use 0 for success; non-zero for errors. errorData?: string; // Optional error message. -} \ No newline at end of file +} + +export const RPC_ERROR_ACK_TIMEOUT = 1001; +export const RPC_ERROR_RESPONSE_TIMEOUT = 1002; + From a55c07e8efefe65755187c344fbe8b2aa50a778d Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 15:06:45 -0700 Subject: [PATCH 005/126] harness --- examples/rpc/.env.example | 6 ++ examples/rpc/README.md | 0 examples/rpc/index.ts | 74 +++++++++++++++++++++++++ examples/rpc/package.json | 23 ++++++++ packages/livekit-rtc/src/index.ts | 1 + packages/livekit-rtc/src/participant.ts | 5 ++ pnpm-lock.yaml | 19 +++++++ 7 files changed, 128 insertions(+) create mode 100644 examples/rpc/.env.example create mode 100644 examples/rpc/README.md create mode 100644 examples/rpc/index.ts create mode 100644 examples/rpc/package.json diff --git a/examples/rpc/.env.example b/examples/rpc/.env.example new file mode 100644 index 00000000..0e56d427 --- /dev/null +++ b/examples/rpc/.env.example @@ -0,0 +1,6 @@ +# 1. Copy this file and rename it to .env +# 2. Update the enviroment variables below. + +LIVEKIT_API_KEY=mykey +LIVEKIT_API_SECRET=mysecret +LIVEKIT_URL=wss://myproject.livekit.cloud diff --git a/examples/rpc/README.md b/examples/rpc/README.md new file mode 100644 index 00000000..e69de29b diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts new file mode 100644 index 00000000..37aa085b --- /dev/null +++ b/examples/rpc/index.ts @@ -0,0 +1,74 @@ +import { Room, RoomEvent } from '@livekit/rtc-node'; +import { AccessToken } from 'livekit-server-sdk'; +import { randomBytes } from 'crypto'; +import { config } from 'dotenv'; + +// Load environment variables from .env.local file +config({ path: '.env.local', override: false }); + +// Generate a random room name +const roomName = `room-${randomBytes(4).toString('hex')}`; + +// Create access token from API credentials +const createToken = (identity: string) => { + const token = new AccessToken(process.env.LIVEKIT_API_KEY, process.env.LIVEKIT_API_SECRET, { + identity, + }); + token.addGrant({ + room: roomName, + roomJoin: true, + canPublish: true, + canSubscribe: true, + }); + return token.toJwt(); +}; + +// Function to connect a participant to the room +const connectParticipant = async (participantId: string) => { + const room = new Room(); + const token = await createToken(`participant-${participantId}`); + + room.on(RoomEvent.Connected, () => { + console.log(`Participant ${participantId} connected to room: ${room.name}`); + }); + + room.on(RoomEvent.ParticipantConnected, (participant) => { + console.log(`Participant ${participantId}: Another participant connected: ${participant.identity}`); + }); + + room.on(RoomEvent.Disconnected, () => { + console.log(`Participant ${participantId} disconnected from room`); + }); + + await room.connect(process.env.LIVEKIT_URL, token, { + autoSubscribe: true, + dynacast: true, + }); + + return room; +}; + +// Main function to set up and connect participants +async function main() { + try { + console.log(`Connecting participants to room: ${roomName}`); + + const room1 = await connectParticipant('1'); + const room2 = await connectParticipant('2'); + + // Keep the rooms connected for a while + console.log('Participants connected. Waiting for 60 seconds...'); + await new Promise((resolve) => setTimeout(resolve, 60000)); + + // Disconnect + console.log('Disconnecting participants...'); + await room1.disconnect(); + await room2.disconnect(); + + console.log('Participants disconnected. Example completed.'); + } catch (error) { + console.error('Error:', error); + } +} + +main(); diff --git a/examples/rpc/package.json b/examples/rpc/package.json new file mode 100644 index 00000000..025f777c --- /dev/null +++ b/examples/rpc/package.json @@ -0,0 +1,23 @@ +{ + "name": "example-rpc", + "author": "LiveKit", + "private": "true", + "description": "Example of using RPC in LiveKit", + "type": "module", + "main": "index.ts", + "scripts": { + "lint": "eslint -f unix \"**/*.ts\"", + "start": "tsx index.ts" + }, + "keywords": [], + "license": "Apache-2.0", + "dependencies": { + "@livekit/rtc-node": "workspace:*", + "dotenv": "^16.4.5", + "livekit-server-sdk": "workspace:*" + }, + "devDependencies": { + "@types/node": "^20.10.4", + "tsx": "^4.7.1" + } +} diff --git a/packages/livekit-rtc/src/index.ts b/packages/livekit-rtc/src/index.ts index 04675f22..5e75eb65 100644 --- a/packages/livekit-rtc/src/index.ts +++ b/packages/livekit-rtc/src/index.ts @@ -37,6 +37,7 @@ export { TrackPublishOptions, ConnectionState, } from './proto/room_pb.js'; +export { RpcRequest, RpcAck, RpcResponse } from './rpc.js'; export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js'; export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js'; export { VideoBufferType, VideoRotation } from './proto/video_frame_pb.js'; diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index f6c29e81..21ca356d 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -307,6 +307,11 @@ export class LocalParticipant extends Participant { }, responseTimeout); this.pendingResponses.set(id, (response) => { + if (this.pendingAcks.has(id)) { + console.error('RPC response received before ack', id); + this.pendingAcks.delete(id); + clearTimeout(ackTimeoutId); + } clearTimeout(responseTimeoutId); if (response.errorCode !== 0 || response.errorData) { reject({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 04faab37..1f48cca3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -110,6 +110,25 @@ importers: specifier: ^4.7.1 version: 4.17.0 + examples/rpc: + dependencies: + '@livekit/rtc-node': + specifier: workspace:* + version: link:../../packages/livekit-rtc + dotenv: + specifier: ^16.4.5 + version: 16.4.5 + livekit-server-sdk: + specifier: workspace:* + version: link:../../packages/livekit-server-sdk + devDependencies: + '@types/node': + specifier: ^20.10.4 + version: 20.16.3 + tsx: + specifier: ^4.7.1 + version: 4.17.0 + examples/webhooks-http: dependencies: livekit-server-sdk: From 6a3633425d5cbf80b76dd3b136b3a7fabb443a48 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 15:28:22 -0700 Subject: [PATCH 006/126] working --- examples/rpc/index.ts | 70 +++++++++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 16 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 37aa085b..b308d46d 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -6,12 +6,21 @@ import { config } from 'dotenv'; // Load environment variables from .env.local file config({ path: '.env.local', override: false }); +// Check for required environment variables and assign them to constants +const LIVEKIT_API_KEY = process.env.LIVEKIT_API_KEY; +const LIVEKIT_API_SECRET = process.env.LIVEKIT_API_SECRET; +const LIVEKIT_URL = process.env.LIVEKIT_URL; + +if (!LIVEKIT_API_KEY || !LIVEKIT_API_SECRET || !LIVEKIT_URL) { + throw new Error('Missing required environment variables. Please check your .env.local file.'); +} + // Generate a random room name const roomName = `room-${randomBytes(4).toString('hex')}`; // Create access token from API credentials const createToken = (identity: string) => { - const token = new AccessToken(process.env.LIVEKIT_API_KEY, process.env.LIVEKIT_API_SECRET, { + const token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET, { identity, }); token.addGrant({ @@ -23,42 +32,68 @@ const createToken = (identity: string) => { return token.toJwt(); }; -// Function to connect a participant to the room -const connectParticipant = async (participantId: string) => { +// Define a type for the customization function +type ParticipantBodyFunc = (room: Room) => void; + +// Function to connect a participant to the room with customization +const connectParticipant = async (participantId: string, body: ParticipantBodyFunc) => { const room = new Room(); const token = await createToken(`participant-${participantId}`); - - room.on(RoomEvent.Connected, () => { - console.log(`Participant ${participantId} connected to room: ${room.name}`); - }); - - room.on(RoomEvent.ParticipantConnected, (participant) => { - console.log(`Participant ${participantId}: Another participant connected: ${participant.identity}`); - }); - + room.on(RoomEvent.Disconnected, () => { console.log(`Participant ${participantId} disconnected from room`); }); - await room.connect(process.env.LIVEKIT_URL, token, { + await room.connect(LIVEKIT_URL, token, { autoSubscribe: true, dynacast: true, }); + // Wait for the other participant to join the room + await new Promise((resolve) => { + if (room.remoteParticipants.size > 0) { + resolve(); + } else { + const onParticipantConnected = () => { + room.off(RoomEvent.ParticipantConnected, onParticipantConnected); + resolve(); + }; + room.on(RoomEvent.ParticipantConnected, onParticipantConnected); + } + }); + + body(room); + return room; }; +// Customization for participant 1 +const customizeParticipant1: ParticipantBodyFunc = (room) => { + console.log('Hello from participant 1'); + + + // Add specific behavior for participant 1 here +}; + +// Customization for participant 2 +const customizeParticipant2: ParticipantBodyFunc = (room) => { + console.log('Hello from participant 2'); + // Add specific behavior for participant 2 here +}; + // Main function to set up and connect participants async function main() { try { console.log(`Connecting participants to room: ${roomName}`); - const room1 = await connectParticipant('1'); - const room2 = await connectParticipant('2'); + const [room1, room2] = await Promise.all([ + connectParticipant('1', customizeParticipant1), + connectParticipant('2', customizeParticipant2) + ]); // Keep the rooms connected for a while console.log('Participants connected. Waiting for 60 seconds...'); - await new Promise((resolve) => setTimeout(resolve, 60000)); + await new Promise((resolve) => setTimeout(resolve, 10000)); // Disconnect console.log('Disconnecting participants...'); @@ -68,6 +103,9 @@ async function main() { console.log('Participants disconnected. Example completed.'); } catch (error) { console.error('Error:', error); + } finally { + // Ensure we clean up resources and exit the process + process.exit(0); } } From d7eae1ade042146a503c4523cc5b039327757cec Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 15:34:16 -0700 Subject: [PATCH 007/126] working --- examples/rpc/index.ts | 44 ++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index b308d46d..fac4955c 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,7 +1,7 @@ import { Room, RoomEvent } from '@livekit/rtc-node'; -import { AccessToken } from 'livekit-server-sdk'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; +import { AccessToken } from 'livekit-server-sdk'; // Load environment variables from .env.local file config({ path: '.env.local', override: false }); @@ -36,12 +36,12 @@ const createToken = (identity: string) => { type ParticipantBodyFunc = (room: Room) => void; // Function to connect a participant to the room with customization -const connectParticipant = async (participantId: string, body: ParticipantBodyFunc) => { +const connectParticipant = async (identity: string, body: ParticipantBodyFunc) => { const room = new Room(); - const token = await createToken(`participant-${participantId}`); - + const token = await createToken(identity); + room.on(RoomEvent.Disconnected, () => { - console.log(`Participant ${participantId} disconnected from room`); + console.log(`Participant ${identity} disconnected from room`); }); await room.connect(LIVEKIT_URL, token, { @@ -67,18 +67,28 @@ const connectParticipant = async (participantId: string, body: ParticipantBodyFu return room; }; -// Customization for participant 1 -const customizeParticipant1: ParticipantBodyFunc = (room) => { - console.log('Hello from participant 1'); - - - // Add specific behavior for participant 1 here +const participant1: ParticipantBodyFunc = async (room) => { + try { + const response = await room.localParticipant?.performRpcRequest( + 'participant-2', + 'greeting', + JSON.stringify({ message: 'Hello from participant 1!' }), + ); + console.log('RPC response received:', response); + } catch (error) { + console.error('RPC call failed:', error); + } }; -// Customization for participant 2 -const customizeParticipant2: ParticipantBodyFunc = (room) => { - console.log('Hello from participant 2'); - // Add specific behavior for participant 2 here +const participant2: ParticipantBodyFunc = (room) => { + // Listen for incoming RPC requests + room.on(RoomEvent.RpcRequestReceived, (request, sender, sendAck, sendResponse) => { + console.log('Received RPC request from', sender.identity, ':', request); + sendAck(); // Acknowledge receipt of the request + // Process the request and send a response + const responseData = JSON.stringify({ message: 'Hello from participant 2!' }); + sendResponse(responseData); + }); }; // Main function to set up and connect participants @@ -87,8 +97,8 @@ async function main() { console.log(`Connecting participants to room: ${roomName}`); const [room1, room2] = await Promise.all([ - connectParticipant('1', customizeParticipant1), - connectParticipant('2', customizeParticipant2) + connectParticipant('participant-1', participant1), + connectParticipant('participant-2', participant2), ]); // Keep the rooms connected for a while From 0083605a3caf97045369114f6be43aff8ec8e140 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 15:44:53 -0700 Subject: [PATCH 008/126] better --- examples/rpc/index.ts | 163 ++++++++++++------------ packages/livekit-rtc/src/participant.ts | 5 +- packages/livekit-rtc/src/room.ts | 4 - 3 files changed, 84 insertions(+), 88 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index fac4955c..d5285d87 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,25 +1,82 @@ -import { Room, RoomEvent } from '@livekit/rtc-node'; +import { Room, RoomEvent, RemoteParticipant, RpcRequest } from '@livekit/rtc-node'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; import { AccessToken } from 'livekit-server-sdk'; -// Load environment variables from .env.local file config({ path: '.env.local', override: false }); - -// Check for required environment variables and assign them to constants const LIVEKIT_API_KEY = process.env.LIVEKIT_API_KEY; const LIVEKIT_API_SECRET = process.env.LIVEKIT_API_SECRET; const LIVEKIT_URL = process.env.LIVEKIT_URL; - if (!LIVEKIT_API_KEY || !LIVEKIT_API_SECRET || !LIVEKIT_URL) { throw new Error('Missing required environment variables. Please check your .env.local file.'); } -// Generate a random room name -const roomName = `room-${randomBytes(4).toString('hex')}`; +async function main() { + const roomName = `rpc-test-${randomBytes(4).toString('hex')}`; + + try { + console.log(`Connecting participants to room: ${roomName}`); + + const [room1, room2] = await Promise.all([ + connectParticipant('participant-1', roomName), + connectParticipant('participant-2', roomName), + ]); + + await Promise.all([ + participant1Body(room1), + participant2Body(room2) + ]); + + console.log('Participants done, disconnecting...'); + await room1.disconnect(); + await room2.disconnect(); + + console.log('Participants disconnected. Example completed.'); + } catch (error) { + console.error('Error:', error); + } finally { + process.exit(0); + } + } + +const participant1Body = async (room: Room): Promise => { + return new Promise((resolve, reject) => { + console.log('sending rpc request to participant 2'); + room.localParticipant?.performRpcRequest( + 'participant-2', + 'greeting', + JSON.stringify({ message: 'Hello from participant 1!' }), + ) + .then((response) => { + console.log('RPC response received:', response); + resolve(); + }) + .catch((error) => { + console.error('RPC call failed:', error); + reject(error); + }); + }); +}; + +const participant2Body = (room: Room): Promise => { + return new Promise((resolve) => { + const handleRpcRequest = (request: RpcRequest, sender: RemoteParticipant, sendAck: () => void, sendResponse: (response: string) => void) => { + console.log('Acking RPC request from', sender.identity, ':'); + sendAck(); + console.log('working…'); + setTimeout(() => { + const responseData = JSON.stringify({ message: 'Hello from participant 2!' }); + console.log('sending response to participant 1'); + sendResponse(responseData); + }, 5000); + resolve(); // Resolve the promise after handling the RPC request + }; + + room.on(RoomEvent.RpcRequestReceived, handleRpcRequest); + }); +}; -// Create access token from API credentials -const createToken = (identity: string) => { +const createToken = (identity: string, roomName: string) => { const token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET, { identity, }); @@ -32,13 +89,9 @@ const createToken = (identity: string) => { return token.toJwt(); }; -// Define a type for the customization function -type ParticipantBodyFunc = (room: Room) => void; - -// Function to connect a participant to the room with customization -const connectParticipant = async (identity: string, body: ParticipantBodyFunc) => { +const connectParticipant = async (identity: string, roomName: string): Promise => { const room = new Room(); - const token = await createToken(identity); + const token = await createToken(identity, roomName); room.on(RoomEvent.Disconnected, () => { console.log(`Participant ${identity} disconnected from room`); @@ -49,74 +102,24 @@ const connectParticipant = async (identity: string, body: ParticipantBodyFunc) = dynacast: true, }); - // Wait for the other participant to join the room - await new Promise((resolve) => { - if (room.remoteParticipants.size > 0) { - resolve(); - } else { - const onParticipantConnected = () => { - room.off(RoomEvent.ParticipantConnected, onParticipantConnected); + await Promise.race([ + new Promise((resolve) => { + if (room.remoteParticipants.size > 0) { resolve(); - }; - room.on(RoomEvent.ParticipantConnected, onParticipantConnected); - } - }); - - body(room); + } else { + const onParticipantConnected = () => { + room.off(RoomEvent.ParticipantConnected, onParticipantConnected); + resolve(); + }; + room.on(RoomEvent.ParticipantConnected, onParticipantConnected); + } + }), + new Promise((_, reject) => { + setTimeout(() => reject(new Error('Timed out waiting for participants')), 5000); + }) + ]); return room; }; -const participant1: ParticipantBodyFunc = async (room) => { - try { - const response = await room.localParticipant?.performRpcRequest( - 'participant-2', - 'greeting', - JSON.stringify({ message: 'Hello from participant 1!' }), - ); - console.log('RPC response received:', response); - } catch (error) { - console.error('RPC call failed:', error); - } -}; - -const participant2: ParticipantBodyFunc = (room) => { - // Listen for incoming RPC requests - room.on(RoomEvent.RpcRequestReceived, (request, sender, sendAck, sendResponse) => { - console.log('Received RPC request from', sender.identity, ':', request); - sendAck(); // Acknowledge receipt of the request - // Process the request and send a response - const responseData = JSON.stringify({ message: 'Hello from participant 2!' }); - sendResponse(responseData); - }); -}; - -// Main function to set up and connect participants -async function main() { - try { - console.log(`Connecting participants to room: ${roomName}`); - - const [room1, room2] = await Promise.all([ - connectParticipant('participant-1', participant1), - connectParticipant('participant-2', participant2), - ]); - - // Keep the rooms connected for a while - console.log('Participants connected. Waiting for 60 seconds...'); - await new Promise((resolve) => setTimeout(resolve, 10000)); - - // Disconnect - console.log('Disconnecting participants...'); - await room1.disconnect(); - await room2.disconnect(); - - console.log('Participants disconnected. Example completed.'); - } catch (error) { - console.error('Error:', error); - } finally { - // Ensure we clean up resources and exit the process - process.exit(0); - } -} - main(); diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 21ca356d..7a393f0a 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -288,8 +288,7 @@ export class LocalParticipant extends Participant { destination_identities: [recipientIdentity], topic: 'lk-rpc-request', }); - console.log('RPC REQUEST SENT', jsonString); - + const ackTimeoutId = setTimeout(() => { this.pendingAcks.delete(id); reject({ code: RPC_ERROR_ACK_TIMEOUT }); @@ -326,7 +325,6 @@ export class LocalParticipant extends Participant { } handleIncomingRpcAck(rpcAck: RpcAck) { - console.log('RPC ACK RECEIVED', rpcAck); const handler = this.pendingAcks.get(rpcAck.requestId); if (handler) { handler(rpcAck); @@ -335,7 +333,6 @@ export class LocalParticipant extends Participant { } handleIncomingRpcResponse(rpcResponse: RpcResponse) { - console.log('RPC RESPONSE RECEIVED', rpcResponse); const handler = this.pendingResponses.get(rpcResponse.requestId); if (handler) { handler(rpcResponse); diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index e8906cb8..e02c92f5 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -321,8 +321,6 @@ export class Room extends (EventEmitter as new () => TypedEmitter }; private handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { - console.log('RPC REQUEST RECEIVED', request); - const sendAck = () => { const ack = new RpcAck(); ack.requestId = request.id; @@ -332,7 +330,6 @@ export class Room extends (EventEmitter as new () => TypedEmitter destination_identities: [sender.identity], topic: 'lk-rpc-ack', }); - console.log('RPC ACK SENT', ack); }; const sendResponse = (response: string, errorCode?: number, errorData?: string) => { @@ -348,7 +345,6 @@ export class Room extends (EventEmitter as new () => TypedEmitter destination_identities: [sender.identity], topic: 'lk-rpc-response', }); - console.log('RPC RESPONSE SENT', rpcResponse); }; this.emit(RoomEvent.RpcRequestReceived, From 6aa8a61f8e3f4b31e9c0b2530ae5241149be77f2 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 15:47:11 -0700 Subject: [PATCH 009/126] better --- examples/rpc/index.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index d5285d87..f8de7500 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -41,18 +41,18 @@ async function main() { const participant1Body = async (room: Room): Promise => { return new Promise((resolve, reject) => { - console.log('sending rpc request to participant 2'); + console.log('[Participant 1] Sending RPC request to participant 2'); room.localParticipant?.performRpcRequest( 'participant-2', 'greeting', - JSON.stringify({ message: 'Hello from participant 1!' }), + 'Hello from participant 1!' ) .then((response) => { - console.log('RPC response received:', response); + console.log('[Participant 1] RPC response received:', response); resolve(); }) .catch((error) => { - console.error('RPC call failed:', error); + console.error('[Participant 1] RPC call failed:', error); reject(error); }); }); @@ -61,15 +61,15 @@ const participant1Body = async (room: Room): Promise => { const participant2Body = (room: Room): Promise => { return new Promise((resolve) => { const handleRpcRequest = (request: RpcRequest, sender: RemoteParticipant, sendAck: () => void, sendResponse: (response: string) => void) => { - console.log('Acking RPC request from', sender.identity, ':'); + console.log('[Participant 2] Received RPC request from', sender.identity, ':', request.data); sendAck(); - console.log('working…'); + console.log('[Participant 2] Processing request...'); setTimeout(() => { - const responseData = JSON.stringify({ message: 'Hello from participant 2!' }); - console.log('sending response to participant 1'); - sendResponse(responseData); - }, 5000); - resolve(); // Resolve the promise after handling the RPC request + const response = 'Hello from participant 2!'; + console.log('[Participant 2] Sending response to participant 1'); + sendResponse(response); + resolve(); + }, 2000); }; room.on(RoomEvent.RpcRequestReceived, handleRpcRequest); @@ -94,7 +94,7 @@ const connectParticipant = async (identity: string, roomName: string): Promise { - console.log(`Participant ${identity} disconnected from room`); + console.log(`[${identity}] Disconnected from room`); }); await room.connect(LIVEKIT_URL, token, { From dd659ce0905cb205a3c56ff18d9c965493aab309 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 15:49:06 -0700 Subject: [PATCH 010/126] better --- examples/rpc/index.ts | 73 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index f8de7500..eb46de23 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -26,6 +26,13 @@ async function main() { participant1Body(room1), participant2Body(room2) ]); + + // Add the second example + console.log('\nStarting second example with JSON data...'); + await Promise.all([ + participant1JsonBody(room1), + participant2JsonBody(room2) + ]); console.log('Participants done, disconnecting...'); await room1.disconnect(); @@ -76,6 +83,72 @@ const participant2Body = (room: Room): Promise => { }); }; +const participant1JsonBody = async (room: Room): Promise => { + return new Promise((resolve, reject) => { + console.log('[Participant 1] Sending JSON RPC request to participant 2'); + const jsonData = { + message: 'Hello from participant 1!', + number: 42, + nested: { + value: 'Transform me!' + } + }; + room.localParticipant?.performRpcRequest( + 'participant-2', + 'json-greeting', + JSON.stringify(jsonData) + ) + .then((response) => { + console.log('[Participant 1] JSON RPC response received:', response); + const parsedResponse = JSON.parse(response); + console.log('[Participant 1] Parsed response:', parsedResponse); + resolve(); + }) + .catch((error) => { + console.error('[Participant 1] JSON RPC call failed:', error); + reject(error); + }); + }); +}; + +const participant2JsonBody = (room: Room): Promise => { + return new Promise((resolve) => { + const handleJsonRpcRequest = (request: RpcRequest, sender: RemoteParticipant, sendAck: () => void, sendResponse: (response: string) => void) => { + console.log('[Participant 2] Received JSON RPC request from', sender.identity); + sendAck(); + console.log('[Participant 2] Processing JSON request...'); + + try { + const jsonData = JSON.parse(request.data); + console.log('[Participant 2] Parsed request data:', jsonData); + + // Transform the nested.value + const transformedValue = jsonData.nested.value.toUpperCase(); + + const response = { + originalMessage: jsonData.message, + transformedValue: transformedValue, + numberSquared: jsonData.number * jsonData.number + }; + + console.log('[Participant 2] Sending JSON response to participant 1'); + sendResponse(JSON.stringify(response)); + resolve(); + } catch (error) { + console.error('[Participant 2] Error processing JSON request:', error); + sendResponse(JSON.stringify({ error: 'Failed to process JSON request' })); + resolve(); + } + }; + + room.on(RoomEvent.RpcRequestReceived, (request, sender, sendAck, sendResponse) => { + if (request.method === 'json-greeting') { + handleJsonRpcRequest(request, sender, sendAck, sendResponse); + } + }); + }); +}; + const createToken = (identity: string, roomName: string) => { const token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET, { identity, From bb870a2aef0d42735a9eb5f81317920121c40383 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 16:23:04 -0700 Subject: [PATCH 011/126] fixes --- examples/rpc/index.ts | 132 +++++++++++++----------- packages/livekit-rtc/src/participant.ts | 13 +-- packages/livekit-rtc/src/room.ts | 15 ++- packages/livekit-rtc/src/rpc.ts | 10 +- 4 files changed, 98 insertions(+), 72 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index eb46de23..cad2dbe9 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -22,19 +22,21 @@ async function main() { connectParticipant('participant-2', roomName), ]); + console.log('\n\nRunning greeting example...'); await Promise.all([ - participant1Body(room1), - participant2Body(room2) + participant1Greeting(room1), + participant2Greeting(room2) ]); - // Add the second example - console.log('\nStarting second example with JSON data...'); + console.log('\n\nRunning math example...'); await Promise.all([ - participant1JsonBody(room1), - participant2JsonBody(room2) + squareRoot(room1).then(() => { + return new Promise(resolve => setTimeout(() => resolve(), 2000)) + }).then(() => quantumHypergeometricSeries(room1)), + mathGenius(room2) ]); - console.log('Participants done, disconnecting...'); + console.log('\n\nParticipants done, disconnecting...'); await room1.disconnect(); await room2.disconnect(); @@ -46,7 +48,7 @@ async function main() { } } -const participant1Body = async (room: Room): Promise => { +const participant1Greeting = async (room: Room): Promise => { return new Promise((resolve, reject) => { console.log('[Participant 1] Sending RPC request to participant 2'); room.localParticipant?.performRpcRequest( @@ -55,7 +57,7 @@ const participant1Body = async (room: Room): Promise => { 'Hello from participant 1!' ) .then((response) => { - console.log('[Participant 1] RPC response received:', response); + console.log(`[Participant 1] I heard back: "${response}"`); resolve(); }) .catch((error) => { @@ -65,86 +67,98 @@ const participant1Body = async (room: Room): Promise => { }); }; -const participant2Body = (room: Room): Promise => { +const participant2Greeting = (room: Room): Promise => { return new Promise((resolve) => { const handleRpcRequest = (request: RpcRequest, sender: RemoteParticipant, sendAck: () => void, sendResponse: (response: string) => void) => { - console.log('[Participant 2] Received RPC request from', sender.identity, ':', request.data); + console.log(`[Participant 2] Oh participant 1 says "${request.payload}"`); sendAck(); - console.log('[Participant 2] Processing request...'); setTimeout(() => { - const response = 'Hello from participant 2!'; - console.log('[Participant 2] Sending response to participant 1'); - sendResponse(response); + sendResponse('Hi nice to meet you, I\'m participant 2!'); resolve(); }, 2000); + room.off(RoomEvent.RpcRequestReceived, handleRpcRequest); }; room.on(RoomEvent.RpcRequestReceived, handleRpcRequest); }); }; -const participant1JsonBody = async (room: Room): Promise => { +const squareRoot = async (room: Room): Promise => { return new Promise((resolve, reject) => { - console.log('[Participant 1] Sending JSON RPC request to participant 2'); - const jsonData = { - message: 'Hello from participant 1!', - number: 42, - nested: { - value: 'Transform me!' - } - }; + console.log('[Math Novice] What\'s the square root of 16?'); room.localParticipant?.performRpcRequest( 'participant-2', - 'json-greeting', - JSON.stringify(jsonData) + 'square-root', + JSON.stringify({ number: 16 }) ) .then((response) => { - console.log('[Participant 1] JSON RPC response received:', response); const parsedResponse = JSON.parse(response); - console.log('[Participant 1] Parsed response:', parsedResponse); + console.log(`[Math Novice] Nice, the answer was ${parsedResponse.result}`); resolve(); }) .catch((error) => { - console.error('[Participant 1] JSON RPC call failed:', error); + console.error('[Math Novice] RPC call failed:', error); reject(error); }); }); }; -const participant2JsonBody = (room: Room): Promise => { +const quantumHypergeometricSeries = async (room: Room): Promise => { + return new Promise((resolve, reject) => { + console.log('[Math Novice] What\'s the quantum hypergeometric series of 42?'); + room.localParticipant?.performRpcRequest( + 'participant-2', + 'quantum-hypergeometric-series', + JSON.stringify({ number: 42 }) + ) + .then((response) => { + const parsedResponse = JSON.parse(response); + console.log(`[Math Novice] Nice, the answer was ${parsedResponse.result}`); + resolve(); + }) + .catch((error) => { + if (error.code == 1) { + console.log(`[Math Novice] Aww I guess that was too hard. The genius said "${error.data}"`); + resolve(); + } else { + console.error('[Math Novice] Unexpected error:', error); + reject(error); + } + }); + }); +}; + +const mathGenius = (room: Room): Promise => { return new Promise((resolve) => { - const handleJsonRpcRequest = (request: RpcRequest, sender: RemoteParticipant, sendAck: () => void, sendResponse: (response: string) => void) => { - console.log('[Participant 2] Received JSON RPC request from', sender.identity); - sendAck(); - console.log('[Participant 2] Processing JSON request...'); - - try { - const jsonData = JSON.parse(request.data); - console.log('[Participant 2] Parsed request data:', jsonData); - - // Transform the nested.value - const transformedValue = jsonData.nested.value.toUpperCase(); - - const response = { - originalMessage: jsonData.message, - transformedValue: transformedValue, - numberSquared: jsonData.number * jsonData.number - }; - - console.log('[Participant 2] Sending JSON response to participant 1'); - sendResponse(JSON.stringify(response)); - resolve(); - } catch (error) { - console.error('[Participant 2] Error processing JSON request:', error); - sendResponse(JSON.stringify({ error: 'Failed to process JSON request' })); - resolve(); - } + const handleJsonRpcRequest = (request: RpcRequest, sender: RemoteParticipant, sendAck: () => void, sendResponse: (payload: string | null, errorCode?: number, errorData?: string) => void) => { + if (request.method === 'square-root') { + const jsonData = JSON.parse(request.payload); + const number = jsonData.number; + console.log(`[Math Genius] I guess participant 1 wants the square root of ${number}. I can do that but it will take a few seconds...`); + sendAck(); + + console.log(`[Math Genius] *doing math*…`); + setTimeout(() => { + try { + const result = Math.sqrt(number); + console.log(`[Math Genius] Aha! It's ${result}`); + sendResponse(JSON.stringify({ result })); + resolve(); + } catch (error) { + console.error('[Math Genius] Error processing JSON request:', error); + sendResponse(null, 1, 'error'); + resolve(); + } + }, 2000); + } else { + console.log(`[Math Genius] Oops, I don't know how to handle ${request.method}, I'd better decline.`); + sendAck(); + sendResponse(null, 1, 'That math is too hard for me'); + } }; room.on(RoomEvent.RpcRequestReceived, (request, sender, sendAck, sendResponse) => { - if (request.method === 'json-greeting') { - handleJsonRpcRequest(request, sender, sendAck, sendResponse); - } + handleJsonRpcRequest(request, sender, sendAck, sendResponse); }); }); }; diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 7a393f0a..86433438 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -269,8 +269,8 @@ export class LocalParticipant extends Participant { performRpcRequest( recipientIdentity: string, - name: string, - data: string, + method: string, + payload: string, ackTimeout: number = 5000, responseTimeout: number = 10000, ): Promise { @@ -279,8 +279,8 @@ export class LocalParticipant extends Participant { const request = new RpcRequest(); request.id = id; - request.name = name; - request.data = data; + request.method = method; + request.payload = payload; const jsonString = JSON.stringify(request); this.publishData(new TextEncoder().encode(jsonString), { @@ -318,12 +318,12 @@ export class LocalParticipant extends Participant { data: response.errorData }); } else { - resolve(response.data); + resolve(response.payload); } }); }); } - + /** @internal */ handleIncomingRpcAck(rpcAck: RpcAck) { const handler = this.pendingAcks.get(rpcAck.requestId); if (handler) { @@ -332,6 +332,7 @@ export class LocalParticipant extends Participant { } } + /** @internal */ handleIncomingRpcResponse(rpcResponse: RpcResponse) { const handler = this.pendingResponses.get(rpcResponse.requestId); if (handler) { diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index e02c92f5..8e6496ca 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -335,7 +335,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter const sendResponse = (response: string, errorCode?: number, errorData?: string) => { const rpcResponse = new RpcResponse(); rpcResponse.requestId = request.id; - rpcResponse.data = response; + rpcResponse.payload = response; rpcResponse.errorCode = errorCode || 0; rpcResponse.errorData = errorData; @@ -430,11 +430,22 @@ export type RoomCallbacks = { disconnected: (reason: DisconnectReason) => void; reconnecting: () => void; reconnected: () => void; + /** + * Incoming RPC request handler. + * @param request - The RPC request object containing the request details. + * @param sender - The RemoteParticipant who sent the RPC request. + * @param sendAck - You must call this function to acknowledge receipt of the request. + * @param sendResponse - You must call this function to send a response to the request. + * It takes three parameters: + * - response: The response payload as a string. + * - errorCode: An optional error code (use 0 for success). + * - errorData: Optional error details as a string. + */ rpcRequestReceived: ( request: RpcRequest, sender: RemoteParticipant, sendAck: () => void, - sendResponse: (response: string, errorCode?: number, errorData?: string) => void, + sendResponse: (payload: string | null, errorCode?: number, errorData?: string) => void, ) => void; }; diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 6d7290f2..3813563b 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -1,7 +1,7 @@ export class RpcRequest { id: string; - name: string; - data: string; + method: string; + payload: string; } export class RpcAck { @@ -10,9 +10,9 @@ export class RpcAck { export class RpcResponse { requestId: string; - data: string; - errorCode: number; // Use 0 for success; non-zero for errors. - errorData?: string; // Optional error message. + payload?: string; // Response payload for successful requests + errorCode?: number; // Non-zero for errors, omitted for success + errorData?: string; // Optional error details, omitted for success } export const RPC_ERROR_ACK_TIMEOUT = 1001; From e648522d6479c957081ce350dd0e698f5a76e350 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 16:25:44 -0700 Subject: [PATCH 012/126] Do it --- examples/rpc/README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/examples/rpc/README.md b/examples/rpc/README.md index e69de29b..23bfdcd0 100644 --- a/examples/rpc/README.md +++ b/examples/rpc/README.md @@ -0,0 +1,39 @@ +# RPC Example + +This example demonstrates how to use RPC between two participants with LiveKit. + +The example includes two scenarios: +1. A simple greeting exchange. +2. A contrived function-calling service with JSON data payloads and multiple method types. + +## Prerequisites + +Before running this example, make sure you have: + +1. Node.js installed on your machine. +2. A LiveKit server running (either locally or remotely). +3. LiveKit API key and secret. + +## Setup + +1. Install dependencies: + ``` + npm install + ``` + +2. Create a `.env.local` file in the example directory with your LiveKit credentials: + ``` + LIVEKIT_API_KEY=your_api_key + LIVEKIT_API_SECRET=your_api_secret + LIVEKIT_URL=your_livekit_url + ``` + +## Running the Example + +To run the example, use the following command: + +``` +npm run start +``` + +The example will log to your terminal. From 69719dd1ba94b86c2cb99748a27ce6e534fbdcf5 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 16:31:40 -0700 Subject: [PATCH 013/126] comments --- packages/livekit-rtc/src/participant.ts | 12 ++++++++++++ packages/livekit-rtc/src/room.ts | 2 ++ packages/livekit-rtc/src/rpc.ts | 2 ++ 3 files changed, 16 insertions(+) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 86433438..3f6b5448 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -267,6 +267,16 @@ export class LocalParticipant extends Participant { private pendingAcks = new Map void>(); private pendingResponses = new Map void>(); + /** + * Performs an RPC request to a remote participant. + * @param recipientIdentity The identity of the recipient participant. + * @param method The RPC method to call. + * @param payload The payload to send with the RPC request. + * @param ackTimeout The timeout for receiving an acknowledgment (in milliseconds). + * @param responseTimeout The timeout for receiving a response (in milliseconds). + * @returns A promise that resolves with the response payload or rejects with an error. + * @throws {code: number, data: string} upon failure + */ performRpcRequest( recipientIdentity: string, method: string, @@ -283,6 +293,8 @@ export class LocalParticipant extends Participant { request.payload = payload; const jsonString = JSON.stringify(request); + // TODO: This implementation is only a prototype + // The final version will use a native DataPacket this.publishData(new TextEncoder().encode(jsonString), { reliable: true, destination_identities: [recipientIdentity], diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 8e6496ca..d17977b7 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -274,6 +274,8 @@ export class Room extends (EventEmitter as new () => TypedEmitter Number(dataPacket.value.data.data.dataLen), ); new FfiHandle(dataPacket.value.data.handle.id).dispose(); + // TODO: This implementation is only a prototype + // The final version will use native DataPacket types instead of special topics if (dataPacket.value.topic === 'lk-rpc-request') { const request = JSON.parse(new TextDecoder().decode(buffer)) as RpcRequest; this.handleIncomingRpcRequest(request, participant); diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 3813563b..e7853b6e 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -1,3 +1,5 @@ +// TODO: This implementation is only a prototype +// The final version will use a protocol types where possible export class RpcRequest { id: string; method: string; From ead34bb40e05501f4165da53993dd8270f3a6b2f Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 16:37:24 -0700 Subject: [PATCH 014/126] Create itchy-cheetahs-taste.md --- .changeset/itchy-cheetahs-taste.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/itchy-cheetahs-taste.md diff --git a/.changeset/itchy-cheetahs-taste.md b/.changeset/itchy-cheetahs-taste.md new file mode 100644 index 00000000..9569c09e --- /dev/null +++ b/.changeset/itchy-cheetahs-taste.md @@ -0,0 +1,6 @@ +--- +"example-rpc": minor +"@livekit/rtc-node": minor +--- + +Native RPC support From b7a36aabac8c6d3e3c58b0fe07303f2b2e34505f Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 20:19:34 -0700 Subject: [PATCH 015/126] switch to registers --- examples/rpc/index.ts | 71 ++++++++++--------------- packages/livekit-rtc/src/participant.ts | 22 ++++++++ packages/livekit-rtc/src/room.ts | 46 ++++++---------- 3 files changed, 66 insertions(+), 73 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index cad2dbe9..a87075d6 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -51,7 +51,7 @@ async function main() { const participant1Greeting = async (room: Room): Promise => { return new Promise((resolve, reject) => { console.log('[Participant 1] Sending RPC request to participant 2'); - room.localParticipant?.performRpcRequest( + room.localParticipant.performRpcRequest( 'participant-2', 'greeting', 'Hello from participant 1!' @@ -69,24 +69,19 @@ const participant1Greeting = async (room: Room): Promise => { const participant2Greeting = (room: Room): Promise => { return new Promise((resolve) => { - const handleRpcRequest = (request: RpcRequest, sender: RemoteParticipant, sendAck: () => void, sendResponse: (response: string) => void) => { + room.localParticipant.registerRpcMethod('greeting', async (request: RpcRequest, sender: RemoteParticipant) => { console.log(`[Participant 2] Oh participant 1 says "${request.payload}"`); - sendAck(); - setTimeout(() => { - sendResponse('Hi nice to meet you, I\'m participant 2!'); - resolve(); - }, 2000); - room.off(RoomEvent.RpcRequestReceived, handleRpcRequest); - }; - - room.on(RoomEvent.RpcRequestReceived, handleRpcRequest); + await new Promise(resolve => setTimeout(resolve, 2000)); + resolve(); + return 'Hi nice to meet you, I\'m participant 2!'; + }); }); }; const squareRoot = async (room: Room): Promise => { return new Promise((resolve, reject) => { console.log('[Math Novice] What\'s the square root of 16?'); - room.localParticipant?.performRpcRequest( + room.localParticipant.performRpcRequest( 'participant-2', 'square-root', JSON.stringify({ number: 16 }) @@ -106,7 +101,7 @@ const squareRoot = async (room: Room): Promise => { const quantumHypergeometricSeries = async (room: Room): Promise => { return new Promise((resolve, reject) => { console.log('[Math Novice] What\'s the quantum hypergeometric series of 42?'); - room.localParticipant?.performRpcRequest( + room.localParticipant.performRpcRequest( 'participant-2', 'quantum-hypergeometric-series', JSON.stringify({ number: 42 }) @@ -130,35 +125,23 @@ const quantumHypergeometricSeries = async (room: Room): Promise => { const mathGenius = (room: Room): Promise => { return new Promise((resolve) => { - const handleJsonRpcRequest = (request: RpcRequest, sender: RemoteParticipant, sendAck: () => void, sendResponse: (payload: string | null, errorCode?: number, errorData?: string) => void) => { - if (request.method === 'square-root') { - const jsonData = JSON.parse(request.payload); - const number = jsonData.number; - console.log(`[Math Genius] I guess participant 1 wants the square root of ${number}. I can do that but it will take a few seconds...`); - sendAck(); - - console.log(`[Math Genius] *doing math*…`); - setTimeout(() => { - try { - const result = Math.sqrt(number); - console.log(`[Math Genius] Aha! It's ${result}`); - sendResponse(JSON.stringify({ result })); - resolve(); - } catch (error) { - console.error('[Math Genius] Error processing JSON request:', error); - sendResponse(null, 1, 'error'); - resolve(); - } - }, 2000); - } else { - console.log(`[Math Genius] Oops, I don't know how to handle ${request.method}, I'd better decline.`); - sendAck(); - sendResponse(null, 1, 'That math is too hard for me'); - } - }; + room.localParticipant.registerRpcMethod('square-root', async (request: RpcRequest, sender: RemoteParticipant) => { + const jsonData = JSON.parse(request.payload); + const number = jsonData.number; + console.log(`[Math Genius] I guess participant 1 wants the square root of ${number}. I can do that but it will take a few seconds...`); + + console.log(`[Math Genius] *doing math*…`); + await new Promise(resolve => setTimeout(resolve, 2000)); + + const result = Math.sqrt(number); + console.log(`[Math Genius] Aha! It's ${result}`); + resolve(); + return JSON.stringify({ result }); + }); - room.on(RoomEvent.RpcRequestReceived, (request, sender, sendAck, sendResponse) => { - handleJsonRpcRequest(request, sender, sendAck, sendResponse); + room.localParticipant.registerRpcMethod('quantum-hypergeometric-series', async (request: RpcRequest, sender: RemoteParticipant) => { + console.log(`[Math Genius] Oops, I don't know how to handle quantum-hypergeometric-series, I'd better decline.`); + throw new Error('That math is too hard for me'); }); }); }; @@ -180,7 +163,7 @@ const connectParticipant = async (identity: string, roomName: string): Promise { + room.on('disconnected', () => { console.log(`[${identity}] Disconnected from room`); }); @@ -195,10 +178,10 @@ const connectParticipant = async (identity: string, roomName: string): Promise { - room.off(RoomEvent.ParticipantConnected, onParticipantConnected); + room.off('participantConnected', onParticipantConnected); resolve(); }; - room.on(RoomEvent.ParticipantConnected, onParticipantConnected); + room.on('participantConnected', onParticipantConnected); } }), new Promise((_, reject) => { diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 3f6b5448..47369bd2 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -91,6 +91,8 @@ export type DataPublishOptions = { }; export class LocalParticipant extends Participant { + private rpcCallbacks: Map Promise> = new Map(); + trackPublications: Map = new Map(); async publishData(data: Uint8Array, options: DataPublishOptions) { @@ -335,6 +337,7 @@ export class LocalParticipant extends Participant { }); }); } + /** @internal */ handleIncomingRpcAck(rpcAck: RpcAck) { const handler = this.pendingAcks.get(rpcAck.requestId); @@ -352,6 +355,25 @@ export class LocalParticipant extends Participant { this.pendingResponses.delete(rpcResponse.requestId); } } + + registerRpcMethod( + method: string, + callback: (request: RpcRequest, sender: RemoteParticipant) => Promise + ) { + this.rpcCallbacks.set(method, callback); + } + + unregisterRpcMethod(method: string) { + this.rpcCallbacks.delete(method); + } + + async handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant): Promise { + const callback = this.rpcCallbacks.get(request.method); + if (!callback) { + throw new Error(`No callback registered for method: ${request.method}`); + } + return await callback(request, sender); + } } export class RemoteParticipant extends Participant { diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index d17977b7..c1de840c 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -322,7 +322,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter } }; - private handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { + private async handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { const sendAck = () => { const ack = new RpcAck(); ack.requestId = request.id; @@ -334,12 +334,13 @@ export class Room extends (EventEmitter as new () => TypedEmitter }); }; - const sendResponse = (response: string, errorCode?: number, errorData?: string) => { + try { + sendAck(); + const response = await this.localParticipant.handleIncomingRpcRequest(request, sender); const rpcResponse = new RpcResponse(); rpcResponse.requestId = request.id; rpcResponse.payload = response; - rpcResponse.errorCode = errorCode || 0; - rpcResponse.errorData = errorData; + rpcResponse.errorCode = 0; const jsonString = JSON.stringify(rpcResponse); this.localParticipant.publishData(new TextEncoder().encode(jsonString), { @@ -347,14 +348,19 @@ export class Room extends (EventEmitter as new () => TypedEmitter destination_identities: [sender.identity], topic: 'lk-rpc-response', }); - }; + } catch (error) { + const rpcResponse = new RpcResponse(); + rpcResponse.requestId = request.id; + rpcResponse.errorCode = 1; + rpcResponse.errorData = error.message; - this.emit(RoomEvent.RpcRequestReceived, - request, - sender, - sendAck, - sendResponse, - ); + const jsonString = JSON.stringify(rpcResponse); + this.localParticipant.publishData(new TextEncoder().encode(jsonString), { + reliable: true, + destination_identities: [sender.identity], + topic: 'lk-rpc-response', + }); + } } private retrieveParticipantByIdentity(identity: string): Participant { @@ -432,23 +438,6 @@ export type RoomCallbacks = { disconnected: (reason: DisconnectReason) => void; reconnecting: () => void; reconnected: () => void; - /** - * Incoming RPC request handler. - * @param request - The RPC request object containing the request details. - * @param sender - The RemoteParticipant who sent the RPC request. - * @param sendAck - You must call this function to acknowledge receipt of the request. - * @param sendResponse - You must call this function to send a response to the request. - * It takes three parameters: - * - response: The response payload as a string. - * - errorCode: An optional error code (use 0 for success). - * - errorData: Optional error details as a string. - */ - rpcRequestReceived: ( - request: RpcRequest, - sender: RemoteParticipant, - sendAck: () => void, - sendResponse: (payload: string | null, errorCode?: number, errorData?: string) => void, - ) => void; }; export enum RoomEvent { @@ -478,5 +467,4 @@ export enum RoomEvent { Disconnected = 'disconnected', Reconnecting = 'reconnecting', Reconnected = 'reconnected', - RpcRequestReceived = 'rpcRequestReceived', } From c5d1e52e59ff69c304561a55de3087e469e48422 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 20:24:00 -0700 Subject: [PATCH 016/126] cleanup --- packages/livekit-rtc/src/participant.ts | 35 +++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 47369bd2..bd683eed 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -338,6 +338,29 @@ export class LocalParticipant extends Participant { }); } + /** + * Etablishes the participant as a receiver for RPC calls of the specified method. + * Will overwrite any existing callback for the specified method. + * + * @param method - The name of the indicated RPC method + * @param callback - Will be called when an RPC request for this method is received, with the request and the sender. Respond with a string. + */ + registerRpcMethod( + method: string, + callback: (request: RpcRequest, sender: RemoteParticipant) => Promise + ) { + this.rpcCallbacks.set(method, callback); + } + + /** + * Unregisters a previously registered RPC method. + * + * @param method - The name of the RPC method to unregister + */ + unregisterRpcMethod(method: string) { + this.rpcCallbacks.delete(method); + } + /** @internal */ handleIncomingRpcAck(rpcAck: RpcAck) { const handler = this.pendingAcks.get(rpcAck.requestId); @@ -356,17 +379,7 @@ export class LocalParticipant extends Participant { } } - registerRpcMethod( - method: string, - callback: (request: RpcRequest, sender: RemoteParticipant) => Promise - ) { - this.rpcCallbacks.set(method, callback); - } - - unregisterRpcMethod(method: string) { - this.rpcCallbacks.delete(method); - } - + /** @internal */ async handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant): Promise { const callback = this.rpcCallbacks.get(request.method); if (!callback) { From c6d80a85921650ed515dd05ffe028fc89132e32a Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 20:32:35 -0700 Subject: [PATCH 017/126] autoack --- examples/rpc/index.ts | 8 ++--- packages/livekit-rtc/src/participant.ts | 47 ++++++++++++++++++++++--- packages/livekit-rtc/src/room.ts | 45 ++--------------------- packages/livekit-rtc/src/rpc.ts | 1 + 4 files changed, 50 insertions(+), 51 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index a87075d6..7553386e 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -51,7 +51,7 @@ async function main() { const participant1Greeting = async (room: Room): Promise => { return new Promise((resolve, reject) => { console.log('[Participant 1] Sending RPC request to participant 2'); - room.localParticipant.performRpcRequest( + room.localParticipant?.performRpcRequest( 'participant-2', 'greeting', 'Hello from participant 1!' @@ -69,8 +69,8 @@ const participant1Greeting = async (room: Room): Promise => { const participant2Greeting = (room: Room): Promise => { return new Promise((resolve) => { - room.localParticipant.registerRpcMethod('greeting', async (request: RpcRequest, sender: RemoteParticipant) => { - console.log(`[Participant 2] Oh participant 1 says "${request.payload}"`); + room.localParticipant?.registerRpcMethod('greeting', async (request: RpcRequest, sender: RemoteParticipant) => { + console.log(`[Participant 2] Oh ${sender.identity} says "${request.payload}"`); await new Promise(resolve => setTimeout(resolve, 2000)); resolve(); return 'Hi nice to meet you, I\'m participant 2!'; @@ -81,7 +81,7 @@ const participant2Greeting = (room: Room): Promise => { const squareRoot = async (room: Room): Promise => { return new Promise((resolve, reject) => { console.log('[Math Novice] What\'s the square root of 16?'); - room.localParticipant.performRpcRequest( + room.localParticipant?.performRpcRequest( 'participant-2', 'square-root', JSON.stringify({ number: 16 }) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index bd683eed..19fd5e3e 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -33,7 +33,7 @@ import { SetLocalNameRequest, UnpublishTrackRequest, } from './proto/room_pb.js'; -import { type RpcAck, RpcRequest, type RpcResponse, RPC_ERROR_ACK_TIMEOUT, RPC_ERROR_RESPONSE_TIMEOUT } from './rpc.js'; +import { RpcAck, RpcRequest, RpcResponse, RPC_ERROR_ACK_TIMEOUT, RPC_ERROR_RESPONSE_TIMEOUT, RPC_ERROR_METHOD_UNSUPPORTED } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; @@ -380,12 +380,51 @@ export class LocalParticipant extends Participant { } /** @internal */ - async handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant): Promise { + async handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { + // ACK the request + const ack = new RpcAck(); + ack.requestId = request.id; + const jsonString = JSON.stringify(ack); + this.publishData(new TextEncoder().encode(jsonString), { + reliable: true, + destination_identities: [sender.identity], + topic: 'lk-rpc-ack', + }); + + const sendResponse = (response: RpcResponse) => { + const jsonString = JSON.stringify(response); + this.publishData(new TextEncoder().encode(jsonString), { + reliable: true, + destination_identities: [sender.identity], + topic: 'lk-rpc-response', + }); + }; + const callback = this.rpcCallbacks.get(request.method); + if (!callback) { - throw new Error(`No callback registered for method: ${request.method}`); + // Auto fail for unsupported methods + const rpcResponse = new RpcResponse(); + rpcResponse.requestId = request.id; + rpcResponse.errorCode = RPC_ERROR_METHOD_UNSUPPORTED; + sendResponse(rpcResponse); + return; + } + + try { + const response = await callback(request, sender); + const rpcResponse = new RpcResponse(); + rpcResponse.requestId = request.id; + rpcResponse.payload = response; + rpcResponse.errorCode = 0; + sendResponse(rpcResponse); + } catch (error) { + const rpcResponse = new RpcResponse(); + rpcResponse.requestId = request.id; + rpcResponse.errorCode = 1; + rpcResponse.errorData = error.message; + sendResponse(rpcResponse); } - return await callback(request, sender); } } diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index c1de840c..c05f1981 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -32,7 +32,7 @@ import type { LocalTrack, 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 { RpcRequest, RpcAck, RpcResponse } from './rpc.js'; +import { RpcRequest, RpcAck, RpcResponse, RPC_ERROR_METHOD_UNSUPPORTED } from './rpc.js'; export interface RtcConfiguration { iceTransportType: IceTransportType; @@ -278,7 +278,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter // The final version will use native DataPacket types instead of special topics if (dataPacket.value.topic === 'lk-rpc-request') { const request = JSON.parse(new TextDecoder().decode(buffer)) as RpcRequest; - this.handleIncomingRpcRequest(request, participant); + this.localParticipant.handleIncomingRpcRequest(request, participant); } else if (dataPacket.value.topic === 'lk-rpc-ack') { const ack = JSON.parse(new TextDecoder().decode(buffer)) as RpcAck; this.localParticipant.handleIncomingRpcAck(ack); @@ -322,47 +322,6 @@ export class Room extends (EventEmitter as new () => TypedEmitter } }; - private async handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { - const sendAck = () => { - const ack = new RpcAck(); - ack.requestId = request.id; - const jsonString = JSON.stringify(ack); - this.localParticipant.publishData(new TextEncoder().encode(jsonString), { - reliable: true, - destination_identities: [sender.identity], - topic: 'lk-rpc-ack', - }); - }; - - try { - sendAck(); - const response = await this.localParticipant.handleIncomingRpcRequest(request, sender); - const rpcResponse = new RpcResponse(); - rpcResponse.requestId = request.id; - rpcResponse.payload = response; - rpcResponse.errorCode = 0; - - const jsonString = JSON.stringify(rpcResponse); - this.localParticipant.publishData(new TextEncoder().encode(jsonString), { - reliable: true, - destination_identities: [sender.identity], - topic: 'lk-rpc-response', - }); - } catch (error) { - const rpcResponse = new RpcResponse(); - rpcResponse.requestId = request.id; - rpcResponse.errorCode = 1; - rpcResponse.errorData = error.message; - - const jsonString = JSON.stringify(rpcResponse); - this.localParticipant.publishData(new TextEncoder().encode(jsonString), { - reliable: true, - destination_identities: [sender.identity], - topic: 'lk-rpc-response', - }); - } - } - private retrieveParticipantByIdentity(identity: string): Participant { if (this.localParticipant.identity === identity) { return this.localParticipant; diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index e7853b6e..a406cd0e 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -19,4 +19,5 @@ export class RpcResponse { export const RPC_ERROR_ACK_TIMEOUT = 1001; export const RPC_ERROR_RESPONSE_TIMEOUT = 1002; +export const RPC_ERROR_METHOD_UNSUPPORTED = 1003; From 4c7052266071548f10789adbab0700845b977fa4 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 20:46:17 -0700 Subject: [PATCH 018/126] Clean up --- examples/rpc/index.ts | 172 ++++++++++++------------ packages/livekit-rtc/src/participant.ts | 20 +-- packages/livekit-rtc/src/room.ts | 2 +- packages/livekit-rtc/src/rpc.ts | 11 +- 4 files changed, 101 insertions(+), 104 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 7553386e..ee8acdc6 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,4 +1,5 @@ -import { Room, RoomEvent, RemoteParticipant, RpcRequest } from '@livekit/rtc-node'; +import { RemoteParticipant, Room, RoomEvent, RpcRequest } from '@livekit/rtc-node'; +import { RPC_ERROR_UNSUPPORTED_METHOD } from '@livekit/rtc-node/dist/rpc'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; import { AccessToken } from 'livekit-server-sdk'; @@ -12,50 +13,50 @@ if (!LIVEKIT_API_KEY || !LIVEKIT_API_SECRET || !LIVEKIT_URL) { } async function main() { - const roomName = `rpc-test-${randomBytes(4).toString('hex')}`; - - try { - console.log(`Connecting participants to room: ${roomName}`); - - const [room1, room2] = await Promise.all([ - connectParticipant('participant-1', roomName), - connectParticipant('participant-2', roomName), - ]); - - console.log('\n\nRunning greeting example...'); - await Promise.all([ - participant1Greeting(room1), - participant2Greeting(room2) - ]); - - console.log('\n\nRunning math example...'); - await Promise.all([ - squareRoot(room1).then(() => { - return new Promise(resolve => setTimeout(() => resolve(), 2000)) - }).then(() => quantumHypergeometricSeries(room1)), - mathGenius(room2) - ]); - - console.log('\n\nParticipants done, disconnecting...'); - await room1.disconnect(); - await room2.disconnect(); - - console.log('Participants disconnected. Example completed.'); - } catch (error) { - console.error('Error:', error); - } finally { - process.exit(0); - } + const roomName = `rpc-test-${randomBytes(4).toString('hex')}`; + + console.log(`Connecting participants to room: ${roomName}`); + + const [room1, room2] = await Promise.all([ + connectParticipant('participant-1', roomName), + connectParticipant('participant-2', roomName), + ]); + + try { + console.log('\n\nRunning greeting example...'); + await Promise.all([participant1Greeting(room1), participant2Greeting(room2)]); + } catch (error) { + console.error('Error:', error); + } + + try { + console.log('\n\nRunning math example...'); + await Promise.all([ + squareRoot(room1) + .then(() => { + return new Promise((resolve) => setTimeout(() => resolve(), 2000)); + }) + .then(() => quantumHypergeometricSeries(room1)), + mathGenius(room2), + ]); + } catch (error) { + console.error('Error:', error); } + console.log('\n\nParticipants done, disconnecting...'); + await room1.disconnect(); + await room2.disconnect(); + + console.log('Participants disconnected. Example completed.'); + + process.exit(0); +} + const participant1Greeting = async (room: Room): Promise => { return new Promise((resolve, reject) => { console.log('[Participant 1] Sending RPC request to participant 2'); - room.localParticipant?.performRpcRequest( - 'participant-2', - 'greeting', - 'Hello from participant 1!' - ) + room.localParticipant + ?.performRpcRequest('participant-2', 'greeting', 'Hello from participant 1!') .then((response) => { console.log(`[Participant 1] I heard back: "${response}"`); resolve(); @@ -69,23 +70,23 @@ const participant1Greeting = async (room: Room): Promise => { const participant2Greeting = (room: Room): Promise => { return new Promise((resolve) => { - room.localParticipant?.registerRpcMethod('greeting', async (request: RpcRequest, sender: RemoteParticipant) => { - console.log(`[Participant 2] Oh ${sender.identity} says "${request.payload}"`); - await new Promise(resolve => setTimeout(resolve, 2000)); - resolve(); - return 'Hi nice to meet you, I\'m participant 2!'; - }); + room.localParticipant?.registerRpcMethod( + 'greeting', + async (request: RpcRequest, sender: RemoteParticipant) => { + console.log(`[Participant 2] Oh ${sender.identity} says "${request.payload}"`); + await new Promise((resolve) => setTimeout(resolve, 2000)); + resolve(); + return "Hi nice to meet you, I'm participant 2!"; + }, + ); }); }; const squareRoot = async (room: Room): Promise => { return new Promise((resolve, reject) => { - console.log('[Math Novice] What\'s the square root of 16?'); - room.localParticipant?.performRpcRequest( - 'participant-2', - 'square-root', - JSON.stringify({ number: 16 }) - ) + console.log("[Math Novice] What's the square root of 16?"); + room.localParticipant + ?.performRpcRequest('participant-2', 'square-root', JSON.stringify({ number: 16 })) .then((response) => { const parsedResponse = JSON.parse(response); console.log(`[Math Novice] Nice, the answer was ${parsedResponse.result}`); @@ -99,50 +100,53 @@ const squareRoot = async (room: Room): Promise => { }; const quantumHypergeometricSeries = async (room: Room): Promise => { - return new Promise((resolve, reject) => { - console.log('[Math Novice] What\'s the quantum hypergeometric series of 42?'); - room.localParticipant.performRpcRequest( + return new Promise((resolve, reject) => { + console.log("[Math Novice] What's the quantum hypergeometric series of 42?"); + room.localParticipant + ?.performRpcRequest( 'participant-2', 'quantum-hypergeometric-series', - JSON.stringify({ number: 42 }) + JSON.stringify({ number: 42 }), ) - .then((response) => { - const parsedResponse = JSON.parse(response); - console.log(`[Math Novice] Nice, the answer was ${parsedResponse.result}`); + .then((response) => { + const parsedResponse = JSON.parse(response); + console.log(`[Math Novice] Nice, the answer was ${parsedResponse.result}`); + resolve(); + }) + .catch((error) => { + if (error.message === RPC_ERROR_UNSUPPORTED_METHOD) { + console.log( + `[Math Novice] Aww I guess that was too hard for the genius. Oh well.`, + ); resolve(); - }) - .catch((error) => { - if (error.code == 1) { - console.log(`[Math Novice] Aww I guess that was too hard. The genius said "${error.data}"`); - resolve(); } else { console.error('[Math Novice] Unexpected error:', error); reject(error); } }); - }); + }); }; const mathGenius = (room: Room): Promise => { return new Promise((resolve) => { - room.localParticipant.registerRpcMethod('square-root', async (request: RpcRequest, sender: RemoteParticipant) => { - const jsonData = JSON.parse(request.payload); - const number = jsonData.number; - console.log(`[Math Genius] I guess participant 1 wants the square root of ${number}. I can do that but it will take a few seconds...`); - - console.log(`[Math Genius] *doing math*…`); - await new Promise(resolve => setTimeout(resolve, 2000)); - - const result = Math.sqrt(number); - console.log(`[Math Genius] Aha! It's ${result}`); - resolve(); - return JSON.stringify({ result }); - }); - - room.localParticipant.registerRpcMethod('quantum-hypergeometric-series', async (request: RpcRequest, sender: RemoteParticipant) => { - console.log(`[Math Genius] Oops, I don't know how to handle quantum-hypergeometric-series, I'd better decline.`); - throw new Error('That math is too hard for me'); - }); + room.localParticipant?.registerRpcMethod( + 'square-root', + async (request: RpcRequest, sender: RemoteParticipant) => { + const jsonData = JSON.parse(request.payload); + const number = jsonData.number; + console.log( + `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I can do that but it will take a few seconds...`, + ); + + console.log(`[Math Genius] *doing math*…`); + await new Promise((resolve) => setTimeout(resolve, 2000)); + + const result = Math.sqrt(number); + console.log(`[Math Genius] Aha! It's ${result}`); + resolve(); + return JSON.stringify({ result }); + }, + ); }); }; @@ -186,7 +190,7 @@ const connectParticipant = async (identity: string, roomName: string): Promise((_, reject) => { setTimeout(() => reject(new Error('Timed out waiting for participants')), 5000); - }) + }), ]); return room; diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 19fd5e3e..00b48e6c 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -33,7 +33,7 @@ import { SetLocalNameRequest, UnpublishTrackRequest, } from './proto/room_pb.js'; -import { RpcAck, RpcRequest, RpcResponse, RPC_ERROR_ACK_TIMEOUT, RPC_ERROR_RESPONSE_TIMEOUT, RPC_ERROR_METHOD_UNSUPPORTED } from './rpc.js'; +import { RpcAck, RpcRequest, RpcResponse, RPC_ERROR_ACK_TIMEOUT, RPC_ERROR_RESPONSE_TIMEOUT, RPC_ERROR_UNSUPPORTED_METHOD } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; @@ -305,7 +305,7 @@ export class LocalParticipant extends Participant { const ackTimeoutId = setTimeout(() => { this.pendingAcks.delete(id); - reject({ code: RPC_ERROR_ACK_TIMEOUT }); + reject(new Error(RPC_ERROR_ACK_TIMEOUT)); this.pendingResponses.delete(id); clearTimeout(responseTimeoutId); }, ackTimeout); @@ -316,7 +316,7 @@ export class LocalParticipant extends Participant { const responseTimeoutId = setTimeout(() => { this.pendingResponses.delete(id); - reject({ code: RPC_ERROR_RESPONSE_TIMEOUT }); + reject(new Error(RPC_ERROR_RESPONSE_TIMEOUT)); }, responseTimeout); this.pendingResponses.set(id, (response) => { @@ -326,11 +326,8 @@ export class LocalParticipant extends Participant { clearTimeout(ackTimeoutId); } clearTimeout(responseTimeoutId); - if (response.errorCode !== 0 || response.errorData) { - reject({ - code: response.errorCode, - data: response.errorData - }); + if (response.error) { + reject(new Error(response.error)); } else { resolve(response.payload); } @@ -403,10 +400,9 @@ export class LocalParticipant extends Participant { const callback = this.rpcCallbacks.get(request.method); if (!callback) { - // Auto fail for unsupported methods const rpcResponse = new RpcResponse(); rpcResponse.requestId = request.id; - rpcResponse.errorCode = RPC_ERROR_METHOD_UNSUPPORTED; + rpcResponse.error = RPC_ERROR_UNSUPPORTED_METHOD; sendResponse(rpcResponse); return; } @@ -416,13 +412,11 @@ export class LocalParticipant extends Participant { const rpcResponse = new RpcResponse(); rpcResponse.requestId = request.id; rpcResponse.payload = response; - rpcResponse.errorCode = 0; sendResponse(rpcResponse); } catch (error) { const rpcResponse = new RpcResponse(); rpcResponse.requestId = request.id; - rpcResponse.errorCode = 1; - rpcResponse.errorData = error.message; + rpcResponse.error = error.message; sendResponse(rpcResponse); } } diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index c05f1981..eef864bf 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -32,7 +32,7 @@ import type { LocalTrack, 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 { RpcRequest, RpcAck, RpcResponse, RPC_ERROR_METHOD_UNSUPPORTED } from './rpc.js'; +import type { RpcRequest, RpcAck, RpcResponse } from './rpc.js'; export interface RtcConfiguration { iceTransportType: IceTransportType; diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index a406cd0e..69b3fa80 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -12,12 +12,11 @@ export class RpcAck { export class RpcResponse { requestId: string; - payload?: string; // Response payload for successful requests - errorCode?: number; // Non-zero for errors, omitted for success - errorData?: string; // Optional error details, omitted for success + payload?: string; + error?: string; } -export const RPC_ERROR_ACK_TIMEOUT = 1001; -export const RPC_ERROR_RESPONSE_TIMEOUT = 1002; -export const RPC_ERROR_METHOD_UNSUPPORTED = 1003; +export const RPC_ERROR_ACK_TIMEOUT = 'lk-rpc.ack-timeout'; +export const RPC_ERROR_RESPONSE_TIMEOUT = 'lk-rpc.response-timeout'; +export const RPC_ERROR_UNSUPPORTED_METHOD = 'lk-rpc.unsupported-method'; From f216ac143f6c153f9e30a2efc5d8d378be40981f Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 21:14:34 -0700 Subject: [PATCH 019/126] updates --- packages/livekit-rtc/src/napi/native.d.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/livekit-rtc/src/napi/native.d.ts b/packages/livekit-rtc/src/napi/native.d.ts index 0355e240..f3ba192f 100644 --- a/packages/livekit-rtc/src/napi/native.d.ts +++ b/packages/livekit-rtc/src/napi/native.d.ts @@ -3,11 +3,14 @@ /* auto-generated by NAPI-RS */ -export function livekitInitialize(callback: (data: Uint8Array) => void, captureLogs: boolean): void; -export function livekitFfiRequest(data: Uint8Array): Uint8Array; -export function livekitRetrievePtr(handle: Uint8Array): bigint; -export function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array; -export function livekitDispose(): Promise; +export declare function livekitInitialize( + callback: (data: Uint8Array) => void, + captureLogs: boolean, +): void; +export declare function livekitFfiRequest(data: Uint8Array): Uint8Array; +export declare function livekitRetrievePtr(handle: Uint8Array): bigint; +export declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array; +export declare function livekitDispose(): Promise; export declare class FfiHandle { constructor(handle: bigint); dispose(): void; From 710800eed0f5897b38ab8bf0db6515c0554178a5 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 21:23:33 -0700 Subject: [PATCH 020/126] fixes --- examples/rpc/index.ts | 6 +- packages/livekit-rtc/src/participant.ts | 74 +++++++++++++++---------- packages/livekit-rtc/src/rpc.ts | 38 ++++++++++++- 3 files changed, 86 insertions(+), 32 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index ee8acdc6..0d1e277a 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -110,13 +110,13 @@ const quantumHypergeometricSeries = async (room: Room): Promise => { ) .then((response) => { const parsedResponse = JSON.parse(response); - console.log(`[Math Novice] Nice, the answer was ${parsedResponse.result}`); + console.log(`[Math Novice] genius says ${parsedResponse.result}!`); resolve(); }) .catch((error) => { if (error.message === RPC_ERROR_UNSUPPORTED_METHOD) { console.log( - `[Math Novice] Aww I guess that was too hard for the genius. Oh well.`, + `[Math Novice] Aww looks like the genius doesn't know that one.`, ); resolve(); } else { @@ -135,7 +135,7 @@ const mathGenius = (room: Room): Promise => { const jsonData = JSON.parse(request.payload); const number = jsonData.number; console.log( - `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I can do that but it will take a few seconds...`, + `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I've only got ${request.responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, ); console.log(`[Math Genius] *doing math*…`); diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 16916a75..e9e5c5f6 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -33,7 +33,14 @@ import { SetLocalNameRequest, UnpublishTrackRequest, } from './proto/room_pb.js'; -import { RpcAck, RpcRequest, RpcResponse, RPC_ERROR_ACK_TIMEOUT, RPC_ERROR_RESPONSE_TIMEOUT, RPC_ERROR_UNSUPPORTED_METHOD } from './rpc.js'; +import { + RPC_ERROR_ACK_TIMEOUT, + RPC_ERROR_RESPONSE_TIMEOUT, + RPC_ERROR_UNSUPPORTED_METHOD, + RpcAck, + RpcRequest, + RpcResponse, +} from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; @@ -95,7 +102,10 @@ export type DataPublishOptions = { }; export class LocalParticipant extends Participant { - private rpcCallbacks: Map Promise> = new Map(); + private rpcCallbacks: Map< + string, + (request: RpcRequest, sender: RemoteParticipant) => Promise + > = new Map(); trackPublications: Map = new Map(); @@ -278,8 +288,8 @@ export class LocalParticipant extends Participant { * @param recipientIdentity The identity of the recipient participant. * @param method The RPC method to call. * @param payload The payload to send with the RPC request. - * @param ackTimeout The timeout for receiving an acknowledgment (in milliseconds). - * @param responseTimeout The timeout for receiving a response (in milliseconds). + * @param ackTimeoutMs The timeout for receiving an acknowledgment (in milliseconds). + * @param responseTimeoutMs The timeout for receiving a response (in milliseconds). * @returns A promise that resolves with the response payload or rejects with an error. * @throws {code: number, data: string} upon failure */ @@ -287,16 +297,20 @@ export class LocalParticipant extends Participant { recipientIdentity: string, method: string, payload: string, - ackTimeout: number = 5000, - responseTimeout: number = 10000, + ackTimeoutMs: number = 5000, + responseTimeoutMs: number = 10000, ): Promise { + const maxRoundTripLatencyMs = 2000; + return new Promise((resolve, reject) => { const id = crypto.randomUUID(); - const request = new RpcRequest(); - request.id = id; - request.method = method; - request.payload = payload; + const request = new RpcRequest({ + id, + method, + payload, + responseTimeoutMs: responseTimeoutMs - maxRoundTripLatencyMs + }); const jsonString = JSON.stringify(request); // TODO: This implementation is only a prototype @@ -306,13 +320,13 @@ export class LocalParticipant extends Participant { destination_identities: [recipientIdentity], topic: 'lk-rpc-request', }); - + const ackTimeoutId = setTimeout(() => { this.pendingAcks.delete(id); reject(new Error(RPC_ERROR_ACK_TIMEOUT)); this.pendingResponses.delete(id); clearTimeout(responseTimeoutId); - }, ackTimeout); + }, ackTimeoutMs); this.pendingAcks.set(id, () => { clearTimeout(ackTimeoutId); @@ -321,7 +335,7 @@ export class LocalParticipant extends Participant { const responseTimeoutId = setTimeout(() => { this.pendingResponses.delete(id); reject(new Error(RPC_ERROR_RESPONSE_TIMEOUT)); - }, responseTimeout); + }, responseTimeoutMs); this.pendingResponses.set(id, (response) => { if (this.pendingAcks.has(id)) { @@ -342,20 +356,20 @@ export class LocalParticipant extends Participant { /** * Etablishes the participant as a receiver for RPC calls of the specified method. * Will overwrite any existing callback for the specified method. - * - * @param method - The name of the indicated RPC method + * + * @param method - The name of the indicated RPC method * @param callback - Will be called when an RPC request for this method is received, with the request and the sender. Respond with a string. */ registerRpcMethod( method: string, - callback: (request: RpcRequest, sender: RemoteParticipant) => Promise + callback: (request: RpcRequest, sender: RemoteParticipant) => Promise, ) { this.rpcCallbacks.set(method, callback); } /** * Unregisters a previously registered RPC method. - * + * * @param method - The name of the RPC method to unregister */ unregisterRpcMethod(method: string) { @@ -383,8 +397,9 @@ export class LocalParticipant extends Participant { /** @internal */ async handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { // ACK the request - const ack = new RpcAck(); - ack.requestId = request.id; + const ack = new RpcAck({ + requestId: request.id, + }); const jsonString = JSON.stringify(ack); this.publishData(new TextEncoder().encode(jsonString), { reliable: true, @@ -404,23 +419,26 @@ export class LocalParticipant extends Participant { const callback = this.rpcCallbacks.get(request.method); if (!callback) { - const rpcResponse = new RpcResponse(); - rpcResponse.requestId = request.id; - rpcResponse.error = RPC_ERROR_UNSUPPORTED_METHOD; + const rpcResponse = new RpcResponse({ + requestId: request.id, + error: RPC_ERROR_UNSUPPORTED_METHOD, + }); sendResponse(rpcResponse); return; } try { const response = await callback(request, sender); - const rpcResponse = new RpcResponse(); - rpcResponse.requestId = request.id; - rpcResponse.payload = response; + const rpcResponse = new RpcResponse({ + requestId: request.id, + payload: response, + }); sendResponse(rpcResponse); } catch (error) { - const rpcResponse = new RpcResponse(); - rpcResponse.requestId = request.id; - rpcResponse.error = error.message; + const rpcResponse = new RpcResponse({ + requestId: request.id, + error: error.message, + }); sendResponse(rpcResponse); } } diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 69b3fa80..2dc789a2 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -4,16 +4,52 @@ export class RpcRequest { id: string; method: string; payload: string; + responseTimeoutMs: number; + + constructor({ + method, + payload, + responseTimeoutMs, + id = crypto.randomUUID(), + }: { + method: string; + payload: string; + responseTimeoutMs: number; + id?: string; + }) { + this.id = id; + this.method = method; + this.payload = payload; + this.responseTimeoutMs = responseTimeoutMs; + } } export class RpcAck { requestId: string; + + constructor({ requestId }: { requestId: string }) { + this.requestId = requestId; + } } export class RpcResponse { requestId: string; - payload?: string; + payload?: string; error?: string; + + constructor({ + requestId, + payload, + error, + }: { + requestId: string; + payload?: string; + error?: string; + }) { + this.requestId = requestId; + this.payload = payload; + this.error = error; + } } export const RPC_ERROR_ACK_TIMEOUT = 'lk-rpc.ack-timeout'; From d963dc5207dfe32f798842c530e0728f13a54d66 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 21:43:00 -0700 Subject: [PATCH 021/126] Clean up exampeles --- examples/rpc/index.ts | 124 ++++++++++++++++++++---------------------- 1 file changed, 59 insertions(+), 65 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 0d1e277a..2294af0c 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -17,14 +17,18 @@ async function main() { console.log(`Connecting participants to room: ${roomName}`); - const [room1, room2] = await Promise.all([ - connectParticipant('participant-1', roomName), - connectParticipant('participant-2', roomName), + const [requestersRoom, greetersRoom, mathGeniusRoom] = await Promise.all([ + connectParticipant('requester', roomName), + connectParticipant('greeter', roomName), + connectParticipant('math-genius', roomName), ]); + // Register all methods for the receiving participant + await registerReceiverMethods(greetersRoom, mathGeniusRoom); + try { console.log('\n\nRunning greeting example...'); - await Promise.all([participant1Greeting(room1), participant2Greeting(room2)]); + await Promise.all([performGreeting(requestersRoom)]); } catch (error) { console.error('Error:', error); } @@ -32,124 +36,114 @@ async function main() { try { console.log('\n\nRunning math example...'); await Promise.all([ - squareRoot(room1) - .then(() => { - return new Promise((resolve) => setTimeout(() => resolve(), 2000)); - }) - .then(() => quantumHypergeometricSeries(room1)), - mathGenius(room2), + performSquareRoot(requestersRoom) + .then(() => new Promise((resolve) => setTimeout(resolve, 2000))) + .then(() => performQuantumHypergeometricSeries(requestersRoom)), ]); } catch (error) { console.error('Error:', error); } console.log('\n\nParticipants done, disconnecting...'); - await room1.disconnect(); - await room2.disconnect(); + await requestersRoom.disconnect(); + await greetersRoom.disconnect(); + await mathGeniusRoom.disconnect(); console.log('Participants disconnected. Example completed.'); process.exit(0); } -const participant1Greeting = async (room: Room): Promise => { +const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room): Promise => { + greetersRoom.localParticipant?.registerRpcMethod( + 'arrival', + async (request: RpcRequest, sender: RemoteParticipant) => { + console.log(`[Greeter] Oh ${sender.identity} arrived and said "${request.payload}"`); + await new Promise((resolve) => setTimeout(resolve, 2000)); + return "Welcome and have a wonderful day!"; + }, + ); + + mathGeniusRoom.localParticipant?.registerRpcMethod( + 'square-root', + async (request: RpcRequest, sender: RemoteParticipant) => { + const jsonData = JSON.parse(request.payload); + const number = jsonData.number; + console.log( + `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I've only got ${request.responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, + ); + + console.log(`[Math Genius] *doing math*…`); + await new Promise((resolve) => setTimeout(resolve, 2000)); + + const result = Math.sqrt(number); + console.log(`[Math Genius] Aha! It's ${result}`); + return JSON.stringify({ result }); + }, + ); +}; + +const performGreeting = async (room: Room): Promise => { return new Promise((resolve, reject) => { - console.log('[Participant 1] Sending RPC request to participant 2'); + console.log('[Requester] Letting the greeter know that I\'ve arrived'); room.localParticipant - ?.performRpcRequest('participant-2', 'greeting', 'Hello from participant 1!') + ?.performRpcRequest('greeter', 'arrival', 'Hello') .then((response) => { - console.log(`[Participant 1] I heard back: "${response}"`); + console.log(`[Requester] That's nice, the greeter said: "${response}"`); resolve(); }) .catch((error) => { - console.error('[Participant 1] RPC call failed:', error); + console.error('[Requester] RPC call failed:', error); reject(error); }); }); }; -const participant2Greeting = (room: Room): Promise => { - return new Promise((resolve) => { - room.localParticipant?.registerRpcMethod( - 'greeting', - async (request: RpcRequest, sender: RemoteParticipant) => { - console.log(`[Participant 2] Oh ${sender.identity} says "${request.payload}"`); - await new Promise((resolve) => setTimeout(resolve, 2000)); - resolve(); - return "Hi nice to meet you, I'm participant 2!"; - }, - ); - }); -}; - -const squareRoot = async (room: Room): Promise => { +const performSquareRoot = async (room: Room): Promise => { return new Promise((resolve, reject) => { - console.log("[Math Novice] What's the square root of 16?"); + console.log("[Requester] What's the square root of 16?"); room.localParticipant - ?.performRpcRequest('participant-2', 'square-root', JSON.stringify({ number: 16 })) + ?.performRpcRequest('math-genius', 'square-root', JSON.stringify({ number: 16 })) .then((response) => { const parsedResponse = JSON.parse(response); - console.log(`[Math Novice] Nice, the answer was ${parsedResponse.result}`); + console.log(`[Requester] Nice, the answer was ${parsedResponse.result}`); resolve(); }) .catch((error) => { - console.error('[Math Novice] RPC call failed:', error); + console.error('[Requester] RPC call failed:', error); reject(error); }); }); }; -const quantumHypergeometricSeries = async (room: Room): Promise => { +const performQuantumHypergeometricSeries = async (room: Room): Promise => { return new Promise((resolve, reject) => { - console.log("[Math Novice] What's the quantum hypergeometric series of 42?"); + console.log("[Requester] What's the quantum hypergeometric series of 42?"); room.localParticipant ?.performRpcRequest( - 'participant-2', + 'math-genius', 'quantum-hypergeometric-series', JSON.stringify({ number: 42 }), ) .then((response) => { const parsedResponse = JSON.parse(response); - console.log(`[Math Novice] genius says ${parsedResponse.result}!`); + console.log(`[Requester] genius says ${parsedResponse.result}!`); resolve(); }) .catch((error) => { if (error.message === RPC_ERROR_UNSUPPORTED_METHOD) { console.log( - `[Math Novice] Aww looks like the genius doesn't know that one.`, + `[Requester] Aww looks like the genius doesn't know that one.`, ); resolve(); } else { - console.error('[Math Novice] Unexpected error:', error); + console.error('[Requester] Unexpected error:', error); reject(error); } }); }); }; -const mathGenius = (room: Room): Promise => { - return new Promise((resolve) => { - room.localParticipant?.registerRpcMethod( - 'square-root', - async (request: RpcRequest, sender: RemoteParticipant) => { - const jsonData = JSON.parse(request.payload); - const number = jsonData.number; - console.log( - `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I've only got ${request.responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, - ); - - console.log(`[Math Genius] *doing math*…`); - await new Promise((resolve) => setTimeout(resolve, 2000)); - - const result = Math.sqrt(number); - console.log(`[Math Genius] Aha! It's ${result}`); - resolve(); - return JSON.stringify({ result }); - }, - ); - }); -}; - const createToken = (identity: string, roomName: string) => { const token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET, { identity, From a4e441fb29adda714169e0f863e29d7155e723ca Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 21:46:52 -0700 Subject: [PATCH 022/126] simplify --- examples/rpc/index.ts | 87 +++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 53 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 2294af0c..e1f26421 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -84,64 +84,45 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) }; const performGreeting = async (room: Room): Promise => { - return new Promise((resolve, reject) => { - console.log('[Requester] Letting the greeter know that I\'ve arrived'); - room.localParticipant - ?.performRpcRequest('greeter', 'arrival', 'Hello') - .then((response) => { - console.log(`[Requester] That's nice, the greeter said: "${response}"`); - resolve(); - }) - .catch((error) => { - console.error('[Requester] RPC call failed:', error); - reject(error); - }); - }); + console.log('[Requester] Letting the greeter know that I\'ve arrived'); + try { + const response = await room.localParticipant!.performRpcRequest('greeter', 'arrival', 'Hello'); + console.log(`[Requester] That's nice, the greeter said: "${response}"`); + } catch (error) { + console.error('[Requester] RPC call failed:', error); + throw error; + } }; const performSquareRoot = async (room: Room): Promise => { - return new Promise((resolve, reject) => { - console.log("[Requester] What's the square root of 16?"); - room.localParticipant - ?.performRpcRequest('math-genius', 'square-root', JSON.stringify({ number: 16 })) - .then((response) => { - const parsedResponse = JSON.parse(response); - console.log(`[Requester] Nice, the answer was ${parsedResponse.result}`); - resolve(); - }) - .catch((error) => { - console.error('[Requester] RPC call failed:', error); - reject(error); - }); - }); + console.log("[Requester] What's the square root of 16?"); + try { + const response = await room.localParticipant!.performRpcRequest('math-genius', 'square-root', JSON.stringify({ number: 16 })); + const parsedResponse = JSON.parse(response); + console.log(`[Requester] Nice, the answer was ${parsedResponse.result}`); + } catch (error) { + console.error('[Requester] RPC call failed:', error); + throw error; + } }; - const performQuantumHypergeometricSeries = async (room: Room): Promise => { - return new Promise((resolve, reject) => { - console.log("[Requester] What's the quantum hypergeometric series of 42?"); - room.localParticipant - ?.performRpcRequest( - 'math-genius', - 'quantum-hypergeometric-series', - JSON.stringify({ number: 42 }), - ) - .then((response) => { - const parsedResponse = JSON.parse(response); - console.log(`[Requester] genius says ${parsedResponse.result}!`); - resolve(); - }) - .catch((error) => { - if (error.message === RPC_ERROR_UNSUPPORTED_METHOD) { - console.log( - `[Requester] Aww looks like the genius doesn't know that one.`, - ); - resolve(); - } else { - console.error('[Requester] Unexpected error:', error); - reject(error); - } - }); - }); + console.log("[Requester] What's the quantum hypergeometric series of 42?"); + try { + const response = await room.localParticipant!.performRpcRequest( + 'math-genius', + 'quantum-hypergeometric-series', + JSON.stringify({ number: 42 }) + ); + const parsedResponse = JSON.parse(response); + console.log(`[Requester] genius says ${parsedResponse.result}!`); + } catch (error) { + if (error instanceof Error && error.message === RPC_ERROR_UNSUPPORTED_METHOD) { + console.log(`[Requester] Aww looks like the genius doesn't know that one.`); + } else { + console.error('[Requester] Unexpected error:', error); + throw error; + } + } }; const createToken = (identity: string, roomName: string) => { From 208993a4c28a3b374895e6516cd1fa57988e3995 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 21:52:52 -0700 Subject: [PATCH 023/126] logs --- examples/rpc/index.ts | 1 + packages/livekit-rtc/src/participant.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index e1f26421..fda46eef 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -105,6 +105,7 @@ const performSquareRoot = async (room: Room): Promise => { throw error; } }; + const performQuantumHypergeometricSeries = async (room: Room): Promise => { console.log("[Requester] What's the quantum hypergeometric series of 42?"); try { diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index e9e5c5f6..9415daff 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -382,6 +382,8 @@ export class LocalParticipant extends Participant { if (handler) { handler(rpcAck); this.pendingAcks.delete(rpcAck.requestId); + } else { + console.error('Ack received for unexpected RPC request', rpcAck.requestId); } } @@ -391,6 +393,8 @@ export class LocalParticipant extends Participant { if (handler) { handler(rpcResponse); this.pendingResponses.delete(rpcResponse.requestId); + } else { + console.error('Response received for unexpected RPC request', rpcResponse.requestId); } } From 5fae10fe1c266ed873f518e19aba0a0171ea39c3 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 21:55:17 -0700 Subject: [PATCH 024/126] simple --- examples/rpc/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index fda46eef..12a9c473 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -147,10 +147,7 @@ const connectParticipant = async (identity: string, roomName: string): Promise((resolve) => { From 7dba8ba53a021c4e5aa07cda2640497de21a5a16 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 20 Sep 2024 22:02:35 -0700 Subject: [PATCH 025/126] readme --- packages/livekit-rtc/README.md | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/packages/livekit-rtc/README.md b/packages/livekit-rtc/README.md index ae1e2b0c..db0b2bf7 100644 --- a/packages/livekit-rtc/README.md +++ b/packages/livekit-rtc/README.md @@ -76,10 +76,56 @@ await room.localParticipant.publishTrack(track, options); await source.captureFrame(new AudioFrame(buffer, 16000, 1, buffer.byteLength / 2)); ``` +### RPC + +LiveKit now supports RPC, allowing participants to call methods on other participants in the room. This feature is especially useful in combination with [Agents](https://docs.livekit.io/agents). + +#### Registering an RPC method + +To make a method available for remote calls, you need to register it (on the participant who will receive the call): + +```typescript +room.localParticipant?.registerRpcMethod( + 'greet', + async (request: RpcRequest, sender: RemoteParticipant) => { + console.log(`Received greeting from ${sender.identity}: ${request.payload}`); + return `Hello, ${sender.identity}!`; + } +); +``` + +#### Performing an RPC request + +To call a method on a remote participant: + +```typescript +try { + const response = await room.localParticipant!.performRpcRequest( + 'recipient-identity', + 'greet', + 'Hello from RPC!' + ); + console.log('RPC response:', response); +} catch (error) { + console.error('RPC call failed:', error); +} +``` + +#### Error Handling + +LiveKit is a dynamic realtime environment and calls can fail for various reasons: + +The recipient doesn't support the requested method (RPC_ERROR_UNSUPPORTED_METHOD) +The call times out waiting for an acknowledgment (RPC_ERROR_ACK_TIMEOUT) +The call times out waiting for a response (RPC_ERROR_RESPONSE_TIMEOUT) + +In addition, you may throw errors in your method handler to return an error back to the caller. + ## Examples - [`publish-wav`](https://github.com/livekit/node-sdks/tree/main/examples/publish-wav): connect to a room and publish a wave file + ## Getting help / Contributing Please join us on [Slack](https://livekit.io/join-slack) to get help from our devs/community. We welcome your contributions and details can be discussed there. From 319ea58267c64b5e2a4f27cad6dc9382ce23fcdc Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Sat, 21 Sep 2024 11:23:59 -0700 Subject: [PATCH 026/126] Update README.md --- packages/livekit-rtc/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/README.md b/packages/livekit-rtc/README.md index db0b2bf7..1832c7ee 100644 --- a/packages/livekit-rtc/README.md +++ b/packages/livekit-rtc/README.md @@ -78,7 +78,7 @@ await source.captureFrame(new AudioFrame(buffer, 16000, 1, buffer.byteLength / 2 ### RPC -LiveKit now supports RPC, allowing participants to call methods on other participants in the room. This feature is especially useful in combination with [Agents](https://docs.livekit.io/agents). +Use RPC to allow one participant to call custom-defined methods on other participants in the room. This feature is especially useful in combination with [Agents](https://docs.livekit.io/agents). #### Registering an RPC method From 0c5cbe83048e74537de79c7b6abd0937b6ddd0af Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Sat, 21 Sep 2024 20:04:46 -0700 Subject: [PATCH 027/126] Cleanup --- packages/livekit-rtc/README.md | 30 ++++++++++++++++--------- packages/livekit-rtc/src/participant.ts | 23 ++++++++++--------- packages/livekit-rtc/src/rpc.ts | 4 ++-- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/packages/livekit-rtc/README.md b/packages/livekit-rtc/README.md index 1832c7ee..c9ee878a 100644 --- a/packages/livekit-rtc/README.md +++ b/packages/livekit-rtc/README.md @@ -78,11 +78,11 @@ await source.captureFrame(new AudioFrame(buffer, 16000, 1, buffer.byteLength / 2 ### RPC -Use RPC to allow one participant to call custom-defined methods on other participants in the room. This feature is especially useful in combination with [Agents](https://docs.livekit.io/agents). +RPC you to perform your own predefined method calls from one participant to another. This feature is especially powerful when used with [Agents](https://docs.livekit.io/agents), for instance to forward LLM function calls to your client application. #### Registering an RPC method -To make a method available for remote calls, you need to register it (on the participant who will receive the call): +The participant who will receive a call must first register for the specific method: ```typescript room.localParticipant?.registerRpcMethod( @@ -94,9 +94,11 @@ room.localParticipant?.registerRpcMethod( ); ``` +The request will also have a `responseTimeoutMs` field, which informs you how long you have to return a response. If you are unable to respond in time, you can either send an error or let the request time out on the sender's side. + #### Performing an RPC request -To call a method on a remote participant: +The caller may then initiate a request like so: ```typescript try { @@ -111,21 +113,27 @@ try { } ``` -#### Error Handling +You may find it useful to adjust the `responseTimeoutMs` parameter, which allows you to set the amount of time you will wait for a response. We recommend keeping this value as low as possible while still satisfying the constraints of your application. + +#### Errors + +LiveKit is a dynamic realtime environment and calls can fail for various reasons. -LiveKit is a dynamic realtime environment and calls can fail for various reasons: +Built-in errors: -The recipient doesn't support the requested method (RPC_ERROR_UNSUPPORTED_METHOD) -The call times out waiting for an acknowledgment (RPC_ERROR_ACK_TIMEOUT) -The call times out waiting for a response (RPC_ERROR_RESPONSE_TIMEOUT) +- RPC_ERROR_UNSUPPORTED_METHOD (`lk-rpc.unsupported-method`): The recipient hasn't registered a handler for the requested method +- RPC_ERROR_CONNECT_TIMEOUT (`lk-rpc.connection-timeout`): The request timed out before establishing a connection (see `connectionTimeoutMs`) +- RPC_ERROR_RESPONSE_TIMEOUT (`lk-rpc.response-timeout`): The request timed out while waiting for a response (see `responseTimeoutMs`) +- RPC_ERROR_RECIPIENT_DISCONNECTED (`lk-rpc.recipient-disconnected`): The recipient left the room prior to returning a response. -In addition, you may throw errors in your method handler to return an error back to the caller. +In addition, you may throw your own error in the request handler and it's `message` will be returned to the caller on a new error object (e.g. `throw new Error('my-error-details')` will be received by the requester with `error.message` populated). ## Examples -- [`publish-wav`](https://github.com/livekit/node-sdks/tree/main/examples/publish-wav): connect to a room and publish a wave file +- [`publish-wav`](https://github.com/livekit/node-sdks/tree/main/examples/publish-wav): connect to a room and publish a .wave file +- [ `rpc`](https://github.com/livekit/node-sdks/tree/main/examples/rpc): simple back-and-forth RPC interaction ## Getting help / Contributing -Please join us on [Slack](https://livekit.io/join-slack) to get help from our devs/community. We welcome your contributions and details can be discussed there. +Please join us on [Slack](https://livekit.io/join-slack) to get help from our devs & community. We welcome your contributions and details can be discussed there. diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 9415daff..819b070c 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -34,7 +34,7 @@ import { UnpublishTrackRequest, } from './proto/room_pb.js'; import { - RPC_ERROR_ACK_TIMEOUT, + RPC_ERROR_CONNECTION_TIMEOUT, RPC_ERROR_RESPONSE_TIMEOUT, RPC_ERROR_UNSUPPORTED_METHOD, RpcAck, @@ -284,20 +284,20 @@ export class LocalParticipant extends Participant { private pendingResponses = new Map void>(); /** - * Performs an RPC request to a remote participant. - * @param recipientIdentity The identity of the recipient participant. - * @param method The RPC method to call. - * @param payload The payload to send with the RPC request. - * @param ackTimeoutMs The timeout for receiving an acknowledgment (in milliseconds). - * @param responseTimeoutMs The timeout for receiving a response (in milliseconds). + * Initiate an RPC request to a remote participant. + * @param recipientIdentity - The `identity` of the destination participant + * @param method - The method name to call + * @param payload - The method payload + * @param connectionTimeoutMs - Timeout for establishing initial connection + * @param responseTimeoutMs - Timeout for receiving a response after initial connection * @returns A promise that resolves with the response payload or rejects with an error. - * @throws {code: number, data: string} upon failure + * @throws Error on failure. Details in `message`. */ performRpcRequest( recipientIdentity: string, method: string, payload: string, - ackTimeoutMs: number = 5000, + connectionTimeoutMs: number = 5000, responseTimeoutMs: number = 10000, ): Promise { const maxRoundTripLatencyMs = 2000; @@ -323,10 +323,10 @@ export class LocalParticipant extends Participant { const ackTimeoutId = setTimeout(() => { this.pendingAcks.delete(id); - reject(new Error(RPC_ERROR_ACK_TIMEOUT)); + reject(new Error(RPC_ERROR_CONNECTION_TIMEOUT)); this.pendingResponses.delete(id); clearTimeout(responseTimeoutId); - }, ackTimeoutMs); + }, connectionTimeoutMs); this.pendingAcks.set(id, () => { clearTimeout(ackTimeoutId); @@ -337,6 +337,7 @@ export class LocalParticipant extends Participant { reject(new Error(RPC_ERROR_RESPONSE_TIMEOUT)); }, responseTimeoutMs); + // TODO: Send an error if the participant disconnects without responding this.pendingResponses.set(id, (response) => { if (this.pendingAcks.has(id)) { console.error('RPC response received before ack', id); diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 2dc789a2..ed4f176a 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -52,7 +52,7 @@ export class RpcResponse { } } -export const RPC_ERROR_ACK_TIMEOUT = 'lk-rpc.ack-timeout'; +export const RPC_ERROR_CONNECTION_TIMEOUT = 'lk-rpc.connection-timeout'; export const RPC_ERROR_RESPONSE_TIMEOUT = 'lk-rpc.response-timeout'; export const RPC_ERROR_UNSUPPORTED_METHOD = 'lk-rpc.unsupported-method'; - +export const RPC_ERROR_RECIPIENT_DISCONNECTED = 'lk-rpc.recipient-disconnected'; From 912638c331238274705baf10bc4d82784f8e34b2 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Sun, 22 Sep 2024 20:10:11 -0700 Subject: [PATCH 028/126] reuse --- packages/livekit-rtc/src/rpc.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index ed4f176a..2ce867f6 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 LiveKit, Inc. +// +// SPDX-License-Identifier: Apache-2.0 + // TODO: This implementation is only a prototype // The final version will use a protocol types where possible export class RpcRequest { From 30ad557ce8bdf6d1978822b8072dfcef0545d4a1 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Sun, 22 Sep 2024 21:53:42 -0700 Subject: [PATCH 029/126] lint --- examples/rpc/index.ts | 3 ++- packages/livekit-rtc/src/participant.ts | 2 +- packages/livekit-rtc/src/room.ts | 4 ++-- packages/livekit-server-sdk/src/IngressClient.ts | 10 ++++++---- packages/livekit-server-sdk/src/ServiceBase.ts | 2 +- packages/livekit-server-sdk/src/SipClient.ts | 3 ++- packages/livekit-server-sdk/src/grants.test.ts | 3 ++- 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 12a9c473..47bb7aa2 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,4 +1,5 @@ -import { RemoteParticipant, Room, RoomEvent, RpcRequest } from '@livekit/rtc-node'; +import type { RemoteParticipant, RpcRequest } from '@livekit/rtc-node'; +import { Room } from '@livekit/rtc-node'; import { RPC_ERROR_UNSUPPORTED_METHOD } from '@livekit/rtc-node/dist/rpc'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 819b070c..47ffd96f 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -309,7 +309,7 @@ export class LocalParticipant extends Participant { id, method, payload, - responseTimeoutMs: responseTimeoutMs - maxRoundTripLatencyMs + responseTimeoutMs: responseTimeoutMs - maxRoundTripLatencyMs, }); const jsonString = JSON.stringify(request); diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 15c2addf..9df64c91 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -28,11 +28,11 @@ import { IceTransportType, } from './proto/room_pb.js'; import { TrackKind } from './proto/track_pb.js'; +import type { RpcAck, RpcRequest, RpcResponse } from './rpc.js'; import type { LocalTrack, 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 type { RpcRequest, RpcAck, RpcResponse } from './rpc.js'; export interface RtcConfiguration { iceTransportType: IceTransportType; @@ -286,7 +286,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter const response = JSON.parse(new TextDecoder().decode(buffer)) as RpcResponse; this.localParticipant.handleIncomingRpcResponse(response); } else { - this.emit( + this.emit( RoomEvent.DataReceived, buffer, participant, diff --git a/packages/livekit-server-sdk/src/IngressClient.ts b/packages/livekit-server-sdk/src/IngressClient.ts index a0c79769..357ed6d5 100644 --- a/packages/livekit-server-sdk/src/IngressClient.ts +++ b/packages/livekit-server-sdk/src/IngressClient.ts @@ -1,19 +1,21 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 +import type { + IngressAudioOptions, + IngressInput, + IngressVideoOptions} from '@livekit/protocol'; import { CreateIngressRequest, DeleteIngressRequest, - IngressAudioOptions, IngressInfo, - IngressInput, - IngressVideoOptions, ListIngressRequest, ListIngressResponse, UpdateIngressRequest, } from '@livekit/protocol'; import ServiceBase from './ServiceBase.js'; -import { Rpc, TwirpRpc, livekitPackage } from './TwirpRPC.js'; +import type { Rpc} from './TwirpRPC.js'; +import { TwirpRpc, livekitPackage } from './TwirpRPC.js'; const svc = 'Ingress'; diff --git a/packages/livekit-server-sdk/src/ServiceBase.ts b/packages/livekit-server-sdk/src/ServiceBase.ts index 083f4534..e9ddc809 100644 --- a/packages/livekit-server-sdk/src/ServiceBase.ts +++ b/packages/livekit-server-sdk/src/ServiceBase.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 import { AccessToken } from './AccessToken.js'; -import { SIPGrant, VideoGrant } from './grants.js'; +import type { SIPGrant, VideoGrant } from './grants.js'; /** * Utilities to handle authentication diff --git a/packages/livekit-server-sdk/src/SipClient.ts b/packages/livekit-server-sdk/src/SipClient.ts index d50fe393..1e3bdaa8 100644 --- a/packages/livekit-server-sdk/src/SipClient.ts +++ b/packages/livekit-server-sdk/src/SipClient.ts @@ -28,7 +28,8 @@ import { SIPTrunkInfo, } from '@livekit/protocol'; import ServiceBase from './ServiceBase.js'; -import { Rpc, TwirpRpc, livekitPackage } from './TwirpRPC.js'; +import type { Rpc} from './TwirpRPC.js'; +import { TwirpRpc, livekitPackage } from './TwirpRPC.js'; const svc = 'SIP'; diff --git a/packages/livekit-server-sdk/src/grants.test.ts b/packages/livekit-server-sdk/src/grants.test.ts index 2a66b680..3c134bee 100644 --- a/packages/livekit-server-sdk/src/grants.test.ts +++ b/packages/livekit-server-sdk/src/grants.test.ts @@ -3,7 +3,8 @@ // SPDX-License-Identifier: Apache-2.0 import { TrackSource } from '@livekit/protocol'; import { describe, expect, it } from 'vitest'; -import { ClaimGrants, VideoGrant, claimsToJwtPayload } from './grants'; +import type { ClaimGrants, VideoGrant} from './grants'; +import { claimsToJwtPayload } from './grants'; describe('ClaimGrants are parsed correctly', () => { it('parses TrackSource correctly to strings', () => { From 71dde9f6a3975a13a1b7b44d1370c7cd813b2c28 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Sun, 22 Sep 2024 22:12:42 -0700 Subject: [PATCH 030/126] format --- packages/livekit-server-sdk/src/IngressClient.ts | 7 ++----- packages/livekit-server-sdk/src/SipClient.ts | 2 +- packages/livekit-server-sdk/src/grants.test.ts | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/livekit-server-sdk/src/IngressClient.ts b/packages/livekit-server-sdk/src/IngressClient.ts index 357ed6d5..cc3f8a23 100644 --- a/packages/livekit-server-sdk/src/IngressClient.ts +++ b/packages/livekit-server-sdk/src/IngressClient.ts @@ -1,10 +1,7 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 -import type { - IngressAudioOptions, - IngressInput, - IngressVideoOptions} from '@livekit/protocol'; +import type { IngressAudioOptions, IngressInput, IngressVideoOptions } from '@livekit/protocol'; import { CreateIngressRequest, DeleteIngressRequest, @@ -14,7 +11,7 @@ import { UpdateIngressRequest, } from '@livekit/protocol'; import ServiceBase from './ServiceBase.js'; -import type { Rpc} from './TwirpRPC.js'; +import type { Rpc } from './TwirpRPC.js'; import { TwirpRpc, livekitPackage } from './TwirpRPC.js'; const svc = 'Ingress'; diff --git a/packages/livekit-server-sdk/src/SipClient.ts b/packages/livekit-server-sdk/src/SipClient.ts index 1e3bdaa8..60f2e680 100644 --- a/packages/livekit-server-sdk/src/SipClient.ts +++ b/packages/livekit-server-sdk/src/SipClient.ts @@ -28,7 +28,7 @@ import { SIPTrunkInfo, } from '@livekit/protocol'; import ServiceBase from './ServiceBase.js'; -import type { Rpc} from './TwirpRPC.js'; +import type { Rpc } from './TwirpRPC.js'; import { TwirpRpc, livekitPackage } from './TwirpRPC.js'; const svc = 'SIP'; diff --git a/packages/livekit-server-sdk/src/grants.test.ts b/packages/livekit-server-sdk/src/grants.test.ts index 3c134bee..2e494b47 100644 --- a/packages/livekit-server-sdk/src/grants.test.ts +++ b/packages/livekit-server-sdk/src/grants.test.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 import { TrackSource } from '@livekit/protocol'; import { describe, expect, it } from 'vitest'; -import type { ClaimGrants, VideoGrant} from './grants'; +import type { ClaimGrants, VideoGrant } from './grants'; import { claimsToJwtPayload } from './grants'; describe('ClaimGrants are parsed correctly', () => { From 00a06caef921b2b138465d11130d3c7645ab0f92 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 10:22:51 -0700 Subject: [PATCH 031/126] better error handling --- examples/rpc/index.ts | 7 +-- packages/livekit-rtc/src/index.ts | 2 +- packages/livekit-rtc/src/participant.ts | 59 ++++++++++++++----------- packages/livekit-rtc/src/rpc.ts | 23 ++++++++-- 4 files changed, 57 insertions(+), 34 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 47bb7aa2..58e0bc20 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,6 +1,5 @@ -import type { RemoteParticipant, RpcRequest } from '@livekit/rtc-node'; +import { RemoteParticipant, RpcRequest, RpcError } from '@livekit/rtc-node'; import { Room } from '@livekit/rtc-node'; -import { RPC_ERROR_UNSUPPORTED_METHOD } from '@livekit/rtc-node/dist/rpc'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; import { AccessToken } from 'livekit-server-sdk'; @@ -74,6 +73,8 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I've only got ${request.responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, ); + // throw new Error("some error"); + console.log(`[Math Genius] *doing math*…`); await new Promise((resolve) => setTimeout(resolve, 2000)); @@ -118,7 +119,7 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => const parsedResponse = JSON.parse(response); console.log(`[Requester] genius says ${parsedResponse.result}!`); } catch (error) { - if (error instanceof Error && error.message === RPC_ERROR_UNSUPPORTED_METHOD) { + if (error instanceof RpcError && error.message === RpcError.ErrorType.UNSUPPORTED_METHOD) { console.log(`[Requester] Aww looks like the genius doesn't know that one.`); } else { console.error('[Requester] Unexpected error:', error); diff --git a/packages/livekit-rtc/src/index.ts b/packages/livekit-rtc/src/index.ts index 953c379f..c1ada082 100644 --- a/packages/livekit-rtc/src/index.ts +++ b/packages/livekit-rtc/src/index.ts @@ -37,7 +37,7 @@ export { TrackPublishOptions, ConnectionState, } from './proto/room_pb.js'; -export { RpcRequest, RpcAck, RpcResponse } from './rpc.js'; +export { RpcRequest, RpcAck, RpcResponse, RpcError } from './rpc.js'; export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js'; export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js'; export { VideoBufferType, VideoRotation } from './proto/video_frame_pb.js'; diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 47ffd96f..5d0e9c23 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -34,9 +34,7 @@ import { UnpublishTrackRequest, } from './proto/room_pb.js'; import { - RPC_ERROR_CONNECTION_TIMEOUT, - RPC_ERROR_RESPONSE_TIMEOUT, - RPC_ERROR_UNSUPPORTED_METHOD, + RpcError, RpcAck, RpcRequest, RpcResponse, @@ -102,9 +100,9 @@ export type DataPublishOptions = { }; export class LocalParticipant extends Participant { - private rpcCallbacks: Map< + private rpcHandlers: Map< string, - (request: RpcRequest, sender: RemoteParticipant) => Promise + (request: RpcRequest, sender: RemoteParticipant) => Promise > = new Map(); trackPublications: Map = new Map(); @@ -323,7 +321,7 @@ export class LocalParticipant extends Participant { const ackTimeoutId = setTimeout(() => { this.pendingAcks.delete(id); - reject(new Error(RPC_ERROR_CONNECTION_TIMEOUT)); + reject(new RpcError(RpcError.ErrorType.CONNECTION_TIMEOUT)); this.pendingResponses.delete(id); clearTimeout(responseTimeoutId); }, connectionTimeoutMs); @@ -334,7 +332,7 @@ export class LocalParticipant extends Participant { const responseTimeoutId = setTimeout(() => { this.pendingResponses.delete(id); - reject(new Error(RPC_ERROR_RESPONSE_TIMEOUT)); + reject(new RpcError(RpcError.ErrorType.RESPONSE_TIMEOUT)); }, responseTimeoutMs); // TODO: Send an error if the participant disconnects without responding @@ -346,7 +344,7 @@ export class LocalParticipant extends Participant { } clearTimeout(responseTimeoutId); if (response.error) { - reject(new Error(response.error)); + reject(new RpcError(response.error)); } else { resolve(response.payload); } @@ -363,9 +361,9 @@ export class LocalParticipant extends Participant { */ registerRpcMethod( method: string, - callback: (request: RpcRequest, sender: RemoteParticipant) => Promise, + handler: (request: RpcRequest, sender: RemoteParticipant) => Promise, ) { - this.rpcCallbacks.set(method, callback); + this.rpcHandlers.set(method, handler); } /** @@ -374,7 +372,7 @@ export class LocalParticipant extends Participant { * @param method - The name of the RPC method to unregister */ unregisterRpcMethod(method: string) { - this.rpcCallbacks.delete(method); + this.rpcHandlers.delete(method); } /** @internal */ @@ -421,31 +419,40 @@ export class LocalParticipant extends Participant { }); }; - const callback = this.rpcCallbacks.get(request.method); + const handler = this.rpcHandlers.get(request.method); - if (!callback) { + if (!handler) { const rpcResponse = new RpcResponse({ requestId: request.id, - error: RPC_ERROR_UNSUPPORTED_METHOD, + error: RpcError.ErrorType.UNSUPPORTED_METHOD, }); sendResponse(rpcResponse); return; } - + + const rpcResponse = new RpcResponse({ + requestId: request.id + }); try { - const response = await callback(request, sender); - const rpcResponse = new RpcResponse({ - requestId: request.id, - payload: response, - }); - sendResponse(rpcResponse); + const response = await handler(request, sender); + if (typeof response === 'string') { + rpcResponse.payload = response + } else if (response instanceof RpcError) { + rpcResponse.error = response.message + } else { + console.warn(`unexpected handler response for ${request.method}: ${response}`) + rpcResponse.error = RpcError.ErrorType.MALFORMED_RESPONSE; + } } catch (error) { - const rpcResponse = new RpcResponse({ - requestId: request.id, - error: error.message, - }); - sendResponse(rpcResponse); + if (error instanceof RpcError) { + rpcResponse.error = error.message; + } else { + console.warn(`Uncaught error returned by RPC handler for ${request.method}. Returning ${RpcError.ErrorType.UNCAUGHT_ERROR}`, error); + rpcResponse.error = RpcError.ErrorType.UNCAUGHT_ERROR; + } } + + sendResponse(rpcResponse); } } diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 2ce867f6..536e56d3 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -56,7 +56,22 @@ export class RpcResponse { } } -export const RPC_ERROR_CONNECTION_TIMEOUT = 'lk-rpc.connection-timeout'; -export const RPC_ERROR_RESPONSE_TIMEOUT = 'lk-rpc.response-timeout'; -export const RPC_ERROR_UNSUPPORTED_METHOD = 'lk-rpc.unsupported-method'; -export const RPC_ERROR_RECIPIENT_DISCONNECTED = 'lk-rpc.recipient-disconnected'; +export class RpcError extends Error { + static ErrorType = { + CONNECTION_TIMEOUT: 'lk-rpc.connection-timeout', + RESPONSE_TIMEOUT: 'lk-rpc.response-timeout', + UNSUPPORTED_METHOD: 'lk-rpc.unsupported-method', + RECIPIENT_DISCONNECTED: 'lk-rpc.recipient-disconnected', + UNCAUGHT_ERROR: 'lk-rpc.uncaught-error', + MALFORMED_RESPONSE: 'lk-rpc.malformed-response', + }; + + constructor(message: string | keyof typeof RpcError.ErrorType) { + if (message in RpcError.ErrorType) { + super(RpcError.ErrorType[message as keyof typeof RpcError.ErrorType]); + } else { + super(message); + } + this.name = 'LKRPCError'; + } +} From e4320f32f68fb1666c755f426c27a504999c4f35 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 10:23:13 -0700 Subject: [PATCH 032/126] fmt --- packages/livekit-rtc/src/participant.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 5d0e9c23..734c5394 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -33,12 +33,7 @@ import { SetLocalNameRequest, UnpublishTrackRequest, } from './proto/room_pb.js'; -import { - RpcError, - RpcAck, - RpcRequest, - RpcResponse, -} from './rpc.js'; +import { RpcAck, RpcError, RpcRequest, RpcResponse } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; @@ -429,25 +424,28 @@ export class LocalParticipant extends Participant { sendResponse(rpcResponse); return; } - + const rpcResponse = new RpcResponse({ - requestId: request.id + requestId: request.id, }); try { const response = await handler(request, sender); if (typeof response === 'string') { - rpcResponse.payload = response + rpcResponse.payload = response; } else if (response instanceof RpcError) { - rpcResponse.error = response.message + rpcResponse.error = response.message; } else { - console.warn(`unexpected handler response for ${request.method}: ${response}`) + console.warn(`unexpected handler response for ${request.method}: ${response}`); rpcResponse.error = RpcError.ErrorType.MALFORMED_RESPONSE; } } catch (error) { if (error instanceof RpcError) { rpcResponse.error = error.message; } else { - console.warn(`Uncaught error returned by RPC handler for ${request.method}. Returning ${RpcError.ErrorType.UNCAUGHT_ERROR}`, error); + console.warn( + `Uncaught error returned by RPC handler for ${request.method}. Returning ${RpcError.ErrorType.UNCAUGHT_ERROR}`, + error, + ); rpcResponse.error = RpcError.ErrorType.UNCAUGHT_ERROR; } } From 5fe1317fe6a49314d373bb5f1067b72ca2391f3b Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 10:47:11 -0700 Subject: [PATCH 033/126] max length --- packages/livekit-rtc/src/participant.ts | 14 ++++++- packages/livekit-rtc/src/rpc.ts | 53 +++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 734c5394..a9421eca 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -33,7 +33,7 @@ import { SetLocalNameRequest, UnpublishTrackRequest, } from './proto/room_pb.js'; -import { RpcAck, RpcError, RpcRequest, RpcResponse } from './rpc.js'; +import { byteLength, MAX_PAYLOAD_BYTES, RpcAck, RpcError, RpcRequest, RpcResponse } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; @@ -296,6 +296,11 @@ export class LocalParticipant extends Participant { const maxRoundTripLatencyMs = 2000; return new Promise((resolve, reject) => { + if (byteLength(payload) > MAX_PAYLOAD_BYTES) { + reject(new RpcError(RpcError.ErrorType.PAYLOAD_TOO_LARGE)); + return; + } + const id = crypto.randomUUID(); const request = new RpcRequest({ @@ -431,7 +436,12 @@ export class LocalParticipant extends Participant { try { const response = await handler(request, sender); if (typeof response === 'string') { - rpcResponse.payload = response; + if (byteLength(response) > MAX_PAYLOAD_BYTES) { + rpcResponse.error = RpcError.ErrorType.PAYLOAD_TOO_LARGE; + console.warn(`RPC Response payload too large for ${request.method}`); + } else { + rpcResponse.payload = response; + } } else if (response instanceof RpcError) { rpcResponse.error = response.message; } else { diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 536e56d3..b6ba50a2 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -56,7 +56,18 @@ export class RpcResponse { } } +/** + * Specialized error handling for RPC methods. + * + * Instances of this type, when thrown in a method handler, will have their `message` + * serialized and sent across the wire. The sender will receive an equivalent error on the other side. + * + * Build-in types are included but developers may use any string, with a max length of 256 bytes. + */ + export class RpcError extends Error { + static MAX_BYTES = 256; + static ErrorType = { CONNECTION_TIMEOUT: 'lk-rpc.connection-timeout', RESPONSE_TIMEOUT: 'lk-rpc.response-timeout', @@ -64,14 +75,56 @@ export class RpcError extends Error { RECIPIENT_DISCONNECTED: 'lk-rpc.recipient-disconnected', UNCAUGHT_ERROR: 'lk-rpc.uncaught-error', MALFORMED_RESPONSE: 'lk-rpc.malformed-response', + PAYLOAD_TOO_LARGE: 'lk-rpc.payload-too-large', }; constructor(message: string | keyof typeof RpcError.ErrorType) { if (message in RpcError.ErrorType) { super(RpcError.ErrorType[message as keyof typeof RpcError.ErrorType]); } else { + if (byteLength(message) > RpcError.MAX_BYTES) { + console.warn("Error message longer than 256 bytes will be truncated"); + message = truncateBytes(message, RpcError.MAX_BYTES); + } super(message); } this.name = 'LKRPCError'; } } + +/** + * @internal + */ +export const MAX_PAYLOAD_BYTES = 15360; // 15 KB + +/** + * @internal + */ +export function byteLength(str: string): number { + const encoder = new TextEncoder(); + return encoder.encode(str).length; +} + +/** + * @internal + */ +export function truncateBytes(str: string, maxBytes: number): string { + if (byteLength(str) <= maxBytes) { + return str; + } + + let low = 0; + let high = str.length; + const encoder = new TextEncoder(); + + while (low < high) { + const mid = Math.floor((low + high + 1) / 2); + if (encoder.encode(str.slice(0, mid)).length <= maxBytes) { + low = mid; + } else { + high = mid - 1; + } + } + + return str.slice(0, low); +} From 924108aa6c7e2c481ab7dff2b3129642b1a71345 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 11:26:59 -0700 Subject: [PATCH 034/126] add participant disconnected --- packages/livekit-rtc/src/participant.ts | 38 ++++++++++++++++++------- packages/livekit-rtc/src/room.ts | 5 ++++ 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index a9421eca..4b4f8628 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -102,6 +102,9 @@ export class LocalParticipant extends Participant { trackPublications: Map = new Map(); + private pendingAcks = new Map void, participantIdentity: string }>(); + private pendingResponses = new Map void, participantIdentity: string }>(); + async publishData(data: Uint8Array, options: DataPublishOptions) { const req = new PublishDataRequest({ localParticipantHandle: this.ffi_handle.handle, @@ -273,9 +276,6 @@ export class LocalParticipant extends Participant { this.trackPublications.delete(trackSid); } - private pendingAcks = new Map void>(); - private pendingResponses = new Map void>(); - /** * Initiate an RPC request to a remote participant. * @param recipientIdentity - The `identity` of the destination participant @@ -326,17 +326,16 @@ export class LocalParticipant extends Participant { clearTimeout(responseTimeoutId); }, connectionTimeoutMs); - this.pendingAcks.set(id, () => { + this.pendingAcks.set(id, { resolve: () => { clearTimeout(ackTimeoutId); - }); + }, participantIdentity: recipientIdentity }); const responseTimeoutId = setTimeout(() => { this.pendingResponses.delete(id); reject(new RpcError(RpcError.ErrorType.RESPONSE_TIMEOUT)); }, responseTimeoutMs); - // TODO: Send an error if the participant disconnects without responding - this.pendingResponses.set(id, (response) => { + this.pendingResponses.set(id, { resolve: (response) => { if (this.pendingAcks.has(id)) { console.error('RPC response received before ack', id); this.pendingAcks.delete(id); @@ -348,7 +347,7 @@ export class LocalParticipant extends Participant { } else { resolve(response.payload); } - }); + }, participantIdentity: recipientIdentity }); }); } @@ -379,7 +378,7 @@ export class LocalParticipant extends Participant { handleIncomingRpcAck(rpcAck: RpcAck) { const handler = this.pendingAcks.get(rpcAck.requestId); if (handler) { - handler(rpcAck); + handler.resolve(rpcAck); this.pendingAcks.delete(rpcAck.requestId); } else { console.error('Ack received for unexpected RPC request', rpcAck.requestId); @@ -390,7 +389,7 @@ export class LocalParticipant extends Participant { handleIncomingRpcResponse(rpcResponse: RpcResponse) { const handler = this.pendingResponses.get(rpcResponse.requestId); if (handler) { - handler(rpcResponse); + handler.resolve(rpcResponse); this.pendingResponses.delete(rpcResponse.requestId); } else { console.error('Response received for unexpected RPC request', rpcResponse.requestId); @@ -462,6 +461,25 @@ export class LocalParticipant extends Participant { sendResponse(rpcResponse); } + + /** @internal */ + handleParticipantDisconnected(participantIdentity: string) { + for (const [id, { participantIdentity: pendingIdentity }] of this.pendingAcks) { + if (pendingIdentity === participantIdentity) { + this.pendingAcks.delete(id); + } + } + + for (const [id, { participantIdentity: pendingIdentity, resolve }] of this.pendingResponses) { + if (pendingIdentity === participantIdentity) { + resolve(new RpcResponse({ + requestId: id, + error: RpcError.ErrorType.RECIPIENT_DISCONNECTED, + })); + this.pendingResponses.delete(id); + } + } + } } export class RemoteParticipant extends Participant { diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 9df64c91..a7250582 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -180,6 +180,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter const participant = this.remoteParticipants.get(ev.value.participantIdentity); this.remoteParticipants.delete(participant.identity); this.emit(RoomEvent.ParticipantDisconnected, participant); + this.localParticipant.handleParticipantDisconnected(participant.identity); } else if (ev.case == 'localTrackPublished') { const publication = this.localParticipant.trackPublications.get(ev.value.trackSid); this.emit(RoomEvent.LocalTrackPublished, publication, this.localParticipant); @@ -339,6 +340,10 @@ export class Room extends (EventEmitter as new () => TypedEmitter this.remoteParticipants.set(ownedInfo.info.identity, participant); return participant; } + + private handleParticipantDisconnected(participant: RemoteParticipant) { + this.localParticipant.handleParticipantDisconnected(participant.identity); + } } export class ConnectError extends Error { From d4ac5709313cf1a755c2a05a594a8603fbab7e22 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 11:43:36 -0700 Subject: [PATCH 035/126] docs --- packages/livekit-rtc/README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/livekit-rtc/README.md b/packages/livekit-rtc/README.md index c9ee878a..dfb4e5b5 100644 --- a/packages/livekit-rtc/README.md +++ b/packages/livekit-rtc/README.md @@ -119,14 +119,7 @@ You may find it useful to adjust the `responseTimeoutMs` parameter, which allows LiveKit is a dynamic realtime environment and calls can fail for various reasons. -Built-in errors: - -- RPC_ERROR_UNSUPPORTED_METHOD (`lk-rpc.unsupported-method`): The recipient hasn't registered a handler for the requested method -- RPC_ERROR_CONNECT_TIMEOUT (`lk-rpc.connection-timeout`): The request timed out before establishing a connection (see `connectionTimeoutMs`) -- RPC_ERROR_RESPONSE_TIMEOUT (`lk-rpc.response-timeout`): The request timed out while waiting for a response (see `responseTimeoutMs`) -- RPC_ERROR_RECIPIENT_DISCONNECTED (`lk-rpc.recipient-disconnected`): The recipient left the room prior to returning a response. - -In addition, you may throw your own error in the request handler and it's `message` will be returned to the caller on a new error object (e.g. `throw new Error('my-error-details')` will be received by the requester with `error.message` populated). +You may throw errors of the type `RpcError` with a string `message` in an RPC method handler and they will be received on the caller's side with the message intact. Other errors will not be transmitted and will instead arrive to the caller as `UNCAUGHT_ERROR`. Other built-in errors are detailed in `RpcError.ErrorType`. ## Examples From 0697269c44d5a76f6468998fcda528a5a0c966b7 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 17:00:25 -0700 Subject: [PATCH 036/126] Error updates --- examples/rpc/index.ts | 6 +- packages/livekit-rtc/src/index.ts | 2 +- packages/livekit-rtc/src/participant.ts | 26 ++++---- packages/livekit-rtc/src/room.ts | 9 ++- packages/livekit-rtc/src/rpc.ts | 88 +++++++++++++++++-------- 5 files changed, 84 insertions(+), 47 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 58e0bc20..a9266188 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,5 +1,5 @@ -import { RemoteParticipant, RpcRequest, RpcError } from '@livekit/rtc-node'; -import { Room } from '@livekit/rtc-node'; +import { Room, RpcError, RpcErrorName } from '@livekit/rtc-node'; +import type { RemoteParticipant, RpcRequest } from '@livekit/rtc-node'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; import { AccessToken } from 'livekit-server-sdk'; @@ -119,7 +119,7 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => const parsedResponse = JSON.parse(response); console.log(`[Requester] genius says ${parsedResponse.result}!`); } catch (error) { - if (error instanceof RpcError && error.message === RpcError.ErrorType.UNSUPPORTED_METHOD) { + if (error instanceof RpcError && error.name === RpcErrorName.UNSUPPORTED_METHOD) { console.log(`[Requester] Aww looks like the genius doesn't know that one.`); } else { console.error('[Requester] Unexpected error:', error); diff --git a/packages/livekit-rtc/src/index.ts b/packages/livekit-rtc/src/index.ts index c1ada082..fcc1de05 100644 --- a/packages/livekit-rtc/src/index.ts +++ b/packages/livekit-rtc/src/index.ts @@ -37,7 +37,7 @@ export { TrackPublishOptions, ConnectionState, } from './proto/room_pb.js'; -export { RpcRequest, RpcAck, RpcResponse, RpcError } from './rpc.js'; +export { RpcRequest, RpcAck, RpcResponse, RpcError, RpcErrorName } from './rpc.js'; export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js'; export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js'; export { VideoBufferType, VideoRotation } from './proto/video_frame_pb.js'; diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 4b4f8628..c7408e97 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -33,7 +33,7 @@ import { SetLocalNameRequest, UnpublishTrackRequest, } from './proto/room_pb.js'; -import { byteLength, MAX_PAYLOAD_BYTES, RpcAck, RpcError, RpcRequest, RpcResponse } from './rpc.js'; +import { byteLength, MAX_PAYLOAD_BYTES, RpcAck, RpcError, RpcErrorName, RpcRequest, RpcResponse } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; @@ -297,7 +297,7 @@ export class LocalParticipant extends Participant { return new Promise((resolve, reject) => { if (byteLength(payload) > MAX_PAYLOAD_BYTES) { - reject(new RpcError(RpcError.ErrorType.PAYLOAD_TOO_LARGE)); + reject(RpcError.builtIn(RpcErrorName.PAYLOAD_TOO_LARGE)); return; } @@ -321,7 +321,7 @@ export class LocalParticipant extends Participant { const ackTimeoutId = setTimeout(() => { this.pendingAcks.delete(id); - reject(new RpcError(RpcError.ErrorType.CONNECTION_TIMEOUT)); + reject(RpcError.builtIn(RpcErrorName.CONNECTION_TIMEOUT)); this.pendingResponses.delete(id); clearTimeout(responseTimeoutId); }, connectionTimeoutMs); @@ -332,7 +332,7 @@ export class LocalParticipant extends Participant { const responseTimeoutId = setTimeout(() => { this.pendingResponses.delete(id); - reject(new RpcError(RpcError.ErrorType.RESPONSE_TIMEOUT)); + reject(RpcError.builtIn(RpcErrorName.RESPONSE_TIMEOUT)); }, responseTimeoutMs); this.pendingResponses.set(id, { resolve: (response) => { @@ -343,7 +343,7 @@ export class LocalParticipant extends Participant { } clearTimeout(responseTimeoutId); if (response.error) { - reject(new RpcError(response.error)); + reject(response.error); } else { resolve(response.payload); } @@ -423,7 +423,7 @@ export class LocalParticipant extends Participant { if (!handler) { const rpcResponse = new RpcResponse({ requestId: request.id, - error: RpcError.ErrorType.UNSUPPORTED_METHOD, + error: RpcError.builtIn(RpcErrorName.UNSUPPORTED_METHOD), }); sendResponse(rpcResponse); return; @@ -436,26 +436,26 @@ export class LocalParticipant extends Participant { const response = await handler(request, sender); if (typeof response === 'string') { if (byteLength(response) > MAX_PAYLOAD_BYTES) { - rpcResponse.error = RpcError.ErrorType.PAYLOAD_TOO_LARGE; + rpcResponse.error = RpcError.builtIn(RpcErrorName.PAYLOAD_TOO_LARGE); console.warn(`RPC Response payload too large for ${request.method}`); } else { rpcResponse.payload = response; } } else if (response instanceof RpcError) { - rpcResponse.error = response.message; + rpcResponse.error = response; } else { console.warn(`unexpected handler response for ${request.method}: ${response}`); - rpcResponse.error = RpcError.ErrorType.MALFORMED_RESPONSE; + rpcResponse.error = RpcError.builtIn(RpcErrorName.MALFORMED_RESPONSE); } } catch (error) { if (error instanceof RpcError) { - rpcResponse.error = error.message; + rpcResponse.error = error; } else { console.warn( - `Uncaught error returned by RPC handler for ${request.method}. Returning ${RpcError.ErrorType.UNCAUGHT_ERROR}`, + `Uncaught error returned by RPC handler for ${request.method}. Returning ${RpcErrorName.UNCAUGHT_ERROR}`, error, ); - rpcResponse.error = RpcError.ErrorType.UNCAUGHT_ERROR; + rpcResponse.error = RpcError.builtIn(RpcErrorName.UNCAUGHT_ERROR); } } @@ -474,7 +474,7 @@ export class LocalParticipant extends Participant { if (pendingIdentity === participantIdentity) { resolve(new RpcResponse({ requestId: id, - error: RpcError.ErrorType.RECIPIENT_DISCONNECTED, + error: RpcError.builtIn(RpcErrorName.RECIPIENT_DISCONNECTED), })); this.pendingResponses.delete(id); } diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index a7250582..779e38ed 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -28,7 +28,7 @@ import { IceTransportType, } from './proto/room_pb.js'; import { TrackKind } from './proto/track_pb.js'; -import type { RpcAck, RpcRequest, RpcResponse } from './rpc.js'; +import { RpcAck, RpcRequest, RpcResponse, RpcError } from './rpc.js'; import type { LocalTrack, RemoteTrack } from './track.js'; import { RemoteAudioTrack, RemoteVideoTrack } from './track.js'; import type { LocalTrackPublication, TrackPublication } from './track_publication.js'; @@ -285,6 +285,13 @@ export class Room extends (EventEmitter as new () => TypedEmitter this.localParticipant.handleIncomingRpcAck(ack); } else if (dataPacket.value.topic === 'lk-rpc-response') { const response = JSON.parse(new TextDecoder().decode(buffer)) as RpcResponse; + if (response.error) { + response.error = new RpcError( + response.error.name, + response.error.message, + response.error.data, + ); + } this.localParticipant.handleIncomingRpcResponse(response); } else { this.emit( diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index b6ba50a2..b1bcab5a 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -39,7 +39,7 @@ export class RpcAck { export class RpcResponse { requestId: string; payload?: string; - error?: string; + error?: RpcError; constructor({ requestId, @@ -48,7 +48,7 @@ export class RpcResponse { }: { requestId: string; payload?: string; - error?: string; + error?: RpcError; }) { this.requestId = requestId; this.payload = payload; @@ -58,40 +58,70 @@ export class RpcResponse { /** * Specialized error handling for RPC methods. - * + * * Instances of this type, when thrown in a method handler, will have their `message` * serialized and sent across the wire. The sender will receive an equivalent error on the other side. - * + * * Build-in types are included but developers may use any string, with a max length of 256 bytes. */ export class RpcError extends Error { - static MAX_BYTES = 256; - - static ErrorType = { - CONNECTION_TIMEOUT: 'lk-rpc.connection-timeout', - RESPONSE_TIMEOUT: 'lk-rpc.response-timeout', - UNSUPPORTED_METHOD: 'lk-rpc.unsupported-method', - RECIPIENT_DISCONNECTED: 'lk-rpc.recipient-disconnected', - UNCAUGHT_ERROR: 'lk-rpc.uncaught-error', - MALFORMED_RESPONSE: 'lk-rpc.malformed-response', - PAYLOAD_TOO_LARGE: 'lk-rpc.payload-too-large', - }; - - constructor(message: string | keyof typeof RpcError.ErrorType) { - if (message in RpcError.ErrorType) { - super(RpcError.ErrorType[message as keyof typeof RpcError.ErrorType]); - } else { - if (byteLength(message) > RpcError.MAX_BYTES) { - console.warn("Error message longer than 256 bytes will be truncated"); - message = truncateBytes(message, RpcError.MAX_BYTES); - } - super(message); + static MAX_NAME_BYTES = 64; + static MAX_MESSAGE_BYTES = 256; + static MAX_DATA_BYTES = 15360; // 15 KB + + name: RpcErrorName; + data?: string; + + constructor(name: RpcErrorName, message: string, data?: string) { + super(message); + this.name = name; + this.message = truncateBytes(message, RpcError.MAX_MESSAGE_BYTES); + this.data = data ? truncateBytes(data, RpcError.MAX_DATA_BYTES) : undefined; + } + + toJSON() { + return { + name: this.name, + message: this.message, + data: this.data, + }; + } + + static builtIn(type: RpcErrorName, data?: string): RpcError { + return new RpcError(type, RpcError.getMessage(type), data); + } + + private static getMessage(name: RpcErrorName): string { + switch (name) { + case RpcErrorName.CONNECTION_TIMEOUT: + return 'Connection timed out'; + case RpcErrorName.RESPONSE_TIMEOUT: + return 'Response timed out'; + case RpcErrorName.UNSUPPORTED_METHOD: + return 'Method is not supported'; + case RpcErrorName.RECIPIENT_DISCONNECTED: + return 'Recipient has disconnected'; + case RpcErrorName.UNCAUGHT_ERROR: + return 'An uncaught error occurred'; + case RpcErrorName.MALFORMED_RESPONSE: + return 'Response is malformed'; + case RpcErrorName.PAYLOAD_TOO_LARGE: + return 'Payload exceeds size limit'; } - this.name = 'LKRPCError'; } } +export enum RpcErrorName { + CONNECTION_TIMEOUT = 'lk.CONNECTION_TIMEOUT', + RESPONSE_TIMEOUT = 'lk.RESPONSE_TIMEOUT', + UNSUPPORTED_METHOD = 'lk.UNSUPPORTED_METHOD', + RECIPIENT_DISCONNECTED = 'lk.RECIPIENT_DISCONNECTED', + UNCAUGHT_ERROR = 'lk.UNCAUGHT_ERROR', + MALFORMED_RESPONSE = 'lk.MALFORMED_RESPONSE', + PAYLOAD_TOO_LARGE = 'lk.PAYLOAD_TOO_LARGE', +} + /** * @internal */ @@ -112,11 +142,11 @@ export function truncateBytes(str: string, maxBytes: number): string { if (byteLength(str) <= maxBytes) { return str; } - + let low = 0; let high = str.length; const encoder = new TextEncoder(); - + while (low < high) { const mid = Math.floor((low + high + 1) / 2); if (encoder.encode(str.slice(0, mid)).length <= maxBytes) { @@ -125,6 +155,6 @@ export function truncateBytes(str: string, maxBytes: number): string { high = mid - 1; } } - + return str.slice(0, low); } From 550668405d85e4a8172b713140d2bf2f6c4e76c8 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 17:02:22 -0700 Subject: [PATCH 037/126] int --- packages/livekit-rtc/src/rpc.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index b1bcab5a..051fcc80 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -88,6 +88,7 @@ export class RpcError extends Error { }; } + /** @internal */ static builtIn(type: RpcErrorName, data?: string): RpcError { return new RpcError(type, RpcError.getMessage(type), data); } From fe6eba693c3eb0f755504923a6d165dfbda32fd9 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 19:50:07 -0700 Subject: [PATCH 038/126] remove stub --- examples/rpc/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index a9266188..efd33c2e 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -73,8 +73,6 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I've only got ${request.responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, ); - // throw new Error("some error"); - console.log(`[Math Genius] *doing math*…`); await new Promise((resolve) => setTimeout(resolve, 2000)); From 9051646109e31398f8179c2dcd40ccbd156c24a4 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 20:28:47 -0700 Subject: [PATCH 039/126] tests --- packages/livekit-rtc/src/participant.test.ts | 104 +++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 packages/livekit-rtc/src/participant.test.ts diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts new file mode 100644 index 00000000..05a60fb7 --- /dev/null +++ b/packages/livekit-rtc/src/participant.test.ts @@ -0,0 +1,104 @@ +import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { LocalParticipant, RemoteParticipant } from './participant'; +import { type OwnedParticipant, ParticipantKind } from './proto/participant_pb'; +import { RpcRequest } from './rpc'; + +describe('LocalParticipant', () => { + let localParticipant: LocalParticipant; + + beforeEach(() => { + // Mock the OwnedParticipant object + const mockOwnedParticipant = { + info: { + sid: 'test-sid', + identity: 'test-identity', + name: 'Test Participant', + metadata: '', + attributes: {}, + kind: ParticipantKind.STANDARD, + }, + handle: { id: BigInt('0x1234567890abcdef') }, + } as unknown as OwnedParticipant; + + localParticipant = new LocalParticipant(mockOwnedParticipant); + }); + + describe('registerRpcMethod', () => { + it('should register an RPC method handler', async () => { + const methodName = 'testMethod'; + const handler = vi.fn().mockResolvedValue('test response'); + + localParticipant.registerRpcMethod(methodName, handler); + + // Create a mock RpcRequest and RemoteParticipant + const mockRequest = new RpcRequest({ + id: 'test-request-id', + method: methodName, + payload: 'test payload', + responseTimeoutMs: 5000, // Add a default timeout + }); + const mockSender = new RemoteParticipant({ + info: { + sid: 'remote-sid', + identity: 'remote-identity', + name: 'Remote Participant', + metadata: '', + attributes: {}, + kind: ParticipantKind.STANDARD, + }, + handle: { id: BigInt('0x9876543210fedcba') }, + } as unknown as OwnedParticipant); + + // Mock the publishData method to avoid actual data publishing + localParticipant.publishData = vi.fn(); + + // Call the internal method that would be triggered by an incoming RPC request + await localParticipant['handleIncomingRpcRequest'](mockRequest, mockSender); + + // Verify that the handler was called with the correct arguments + expect(handler).toHaveBeenCalledWith(mockRequest, mockSender); + + // Verify that publishData was called to send the response + expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // Once for ACK, once for response + }); + + it('should handle errors thrown by the RPC method handler', async () => { + const methodName = 'errorMethod'; + const errorMessage = 'Test error'; + const handler = vi.fn().mockRejectedValue(new Error(errorMessage)); + + localParticipant.registerRpcMethod(methodName, handler); + + const mockRequest = new RpcRequest({ + id: 'test-error-request-id', + method: methodName, + payload: 'test payload', + responseTimeoutMs: 5000, // Add a default timeout + }); + const mockSender = new RemoteParticipant({ + info: { + sid: 'remote-sid', + identity: 'remote-identity', + name: 'Remote Participant', + metadata: '', + attributes: {}, + kind: ParticipantKind.STANDARD, + }, + handle: { id: BigInt('0xabcdef0123456789') }, + } as unknown as OwnedParticipant); + + localParticipant.publishData = vi.fn(); + + // Spy on console.warn to check for error logging + const consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); + + await localParticipant['handleIncomingRpcRequest'](mockRequest, mockSender); + + expect(handler).toHaveBeenCalledWith(mockRequest, mockSender); + expect(consoleWarnSpy).toHaveBeenCalled(); + expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // ACK and error response + + consoleWarnSpy.mockRestore(); + }); + }); +}); From 5bc0387766ffa18c1ef63b49159632ca5fd70f5e Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 20:29:40 -0700 Subject: [PATCH 040/126] tests --- packages/livekit-rtc/src/participant.test.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts index 05a60fb7..ee34dc8d 100644 --- a/packages/livekit-rtc/src/participant.test.ts +++ b/packages/livekit-rtc/src/participant.test.ts @@ -73,7 +73,7 @@ describe('LocalParticipant', () => { id: 'test-error-request-id', method: methodName, payload: 'test payload', - responseTimeoutMs: 5000, // Add a default timeout + responseTimeoutMs: 5000, }); const mockSender = new RemoteParticipant({ info: { @@ -89,16 +89,15 @@ describe('LocalParticipant', () => { localParticipant.publishData = vi.fn(); - // Spy on console.warn to check for error logging - const consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); - await localParticipant['handleIncomingRpcRequest'](mockRequest, mockSender); expect(handler).toHaveBeenCalledWith(mockRequest, mockSender); - expect(consoleWarnSpy).toHaveBeenCalled(); expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // ACK and error response - consoleWarnSpy.mockRestore(); + // Verify that the error response contains the correct error name + const errorResponse = localParticipant.publishData.mock.calls[1][0]; + const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); + expect(parsedResponse.error.name).toBe('lk.UNCAUGHT_ERROR'); }); }); }); From 805c590f16b0a9e51ba504c59696600998d4ae18 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 20:47:00 -0700 Subject: [PATCH 041/126] ther --- packages/livekit-rtc/src/participant.test.ts | 45 +++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts index ee34dc8d..fcbf746a 100644 --- a/packages/livekit-rtc/src/participant.test.ts +++ b/packages/livekit-rtc/src/participant.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { LocalParticipant, RemoteParticipant } from './participant'; import { type OwnedParticipant, ParticipantKind } from './proto/participant_pb'; -import { RpcRequest } from './rpc'; +import { RpcRequest, RpcError } from './rpc'; describe('LocalParticipant', () => { let localParticipant: LocalParticipant; @@ -62,7 +62,7 @@ describe('LocalParticipant', () => { expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // Once for ACK, once for response }); - it('should handle errors thrown by the RPC method handler', async () => { + it('should catch and transform unhandled errors in the RPC method handler', async () => { const methodName = 'errorMethod'; const errorMessage = 'Test error'; const handler = vi.fn().mockRejectedValue(new Error(errorMessage)); @@ -98,6 +98,47 @@ describe('LocalParticipant', () => { const errorResponse = localParticipant.publishData.mock.calls[1][0]; const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); expect(parsedResponse.error.name).toBe('lk.UNCAUGHT_ERROR'); + + }); + + it('should pass through RpcError thrown by the RPC method handler', async () => { + const methodName = 'rpcErrorMethod'; + const errorName = 'some-error'; + const errorMessage = 'some-error-message'; + const handler = vi.fn().mockRejectedValue(new RpcError(errorName, errorMessage)); + + localParticipant.registerRpcMethod(methodName, handler); + + const mockRequest = new RpcRequest({ + id: 'test-rpc-error-request-id', + method: methodName, + payload: 'test payload', + responseTimeoutMs: 5000, + }); + const mockSender = new RemoteParticipant({ + info: { + sid: 'remote-sid', + identity: 'remote-identity', + name: 'Remote Participant', + metadata: '', + attributes: {}, + kind: ParticipantKind.STANDARD, + }, + handle: { id: BigInt('0xabcdef0123456789') }, + } as unknown as OwnedParticipant); + + localParticipant.publishData = vi.fn(); + + await localParticipant['handleIncomingRpcRequest'](mockRequest, mockSender); + + expect(handler).toHaveBeenCalledWith(mockRequest, mockSender); + expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // ACK and error response + + // Verify that the error response contains the correct RpcError + const errorResponse = localParticipant.publishData.mock.calls[1][0]; + const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); + expect(parsedResponse.error.name).toBe(errorName); + expect(parsedResponse.error.message).toBe(errorMessage); }); }); }); From 5048cf3c7bb568304fc87304948032210d94c43d Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 20:52:59 -0700 Subject: [PATCH 042/126] other tests --- packages/livekit-rtc/src/participant.test.ts | 169 ++++++++++++++++--- packages/livekit-rtc/src/rpc.ts | 4 +- 2 files changed, 151 insertions(+), 22 deletions(-) diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts index fcbf746a..c7d67884 100644 --- a/packages/livekit-rtc/src/participant.test.ts +++ b/packages/livekit-rtc/src/participant.test.ts @@ -1,29 +1,29 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { LocalParticipant, RemoteParticipant } from './participant'; import { type OwnedParticipant, ParticipantKind } from './proto/participant_pb'; -import { RpcRequest, RpcError } from './rpc'; +import { RpcRequest, RpcError, RpcResponse } from './rpc'; describe('LocalParticipant', () => { - let localParticipant: LocalParticipant; - - beforeEach(() => { - // Mock the OwnedParticipant object - const mockOwnedParticipant = { - info: { - sid: 'test-sid', - identity: 'test-identity', - name: 'Test Participant', - metadata: '', - attributes: {}, - kind: ParticipantKind.STANDARD, - }, - handle: { id: BigInt('0x1234567890abcdef') }, - } as unknown as OwnedParticipant; - - localParticipant = new LocalParticipant(mockOwnedParticipant); - }); - describe('registerRpcMethod', () => { + let localParticipant: LocalParticipant; + + beforeEach(() => { + // Mock the OwnedParticipant object + const mockOwnedParticipant = { + info: { + sid: 'test-sid', + identity: 'test-identity', + name: 'Test Participant', + metadata: '', + attributes: {}, + kind: ParticipantKind.STANDARD, + }, + handle: { id: BigInt('0x1234567890abcdef') }, + } as unknown as OwnedParticipant; + + localParticipant = new LocalParticipant(mockOwnedParticipant); + }); + it('should register an RPC method handler', async () => { const methodName = 'testMethod'; const handler = vi.fn().mockResolvedValue('test response'); @@ -141,4 +141,133 @@ describe('LocalParticipant', () => { expect(parsedResponse.error.message).toBe(errorMessage); }); }); + + describe('performRpcRequest', () => { + let localParticipant: LocalParticipant; + let mockRemoteParticipant: RemoteParticipant; + + beforeEach(() => { + localParticipant = new LocalParticipant({ + info: { + sid: 'local-sid', + identity: 'local-identity', + name: 'Local Participant', + metadata: '', + attributes: {}, + kind: ParticipantKind.STANDARD, + }, + handle: { id: BigInt('0x1234567890abcdef') }, + } as unknown as OwnedParticipant); + + mockRemoteParticipant = new RemoteParticipant({ + info: { + sid: 'remote-sid', + identity: 'remote-identity', + name: 'Remote Participant', + metadata: '', + attributes: {}, + kind: ParticipantKind.STANDARD, + }, + handle: { id: BigInt('0xabcdef0123456789') }, + } as unknown as OwnedParticipant); + + localParticipant.publishData = vi.fn(); + }); + + it('should send RPC request and receive successful response', async () => { + const method = 'testMethod'; + const payload = 'testPayload'; + const responsePayload = 'responsePayload'; + + // Mock the publishData method to simulate sending the request + localParticipant.publishData.mockImplementationOnce((data) => { + const request = JSON.parse(new TextDecoder().decode(data)); + // Simulate receiving a response + setTimeout(() => { + const response = new RpcResponse({ + requestId: request.id, + payload: responsePayload, + }); + localParticipant['handleIncomingRpcResponse'](response); + }, 10); + }); + + const result = await localParticipant.performRpcRequest(mockRemoteParticipant.identity, method, payload); + + expect(localParticipant.publishData).toHaveBeenCalledTimes(1); + expect(result).toBe(responsePayload); + }); + + it('should handle RPC request timeout', async () => { + const method = 'timeoutMethod'; + const payload = 'timeoutPayload'; + + // Set a short timeout for the test + const timeoutMs = 50; + + const resultPromise = localParticipant.performRpcRequest( + mockRemoteParticipant.identity, + method, + payload, + timeoutMs + ); + + // Mock the publishData method to simulate a delay longer than the timeout + localParticipant.publishData.mockImplementationOnce(() => { + return new Promise((resolve) => { + setTimeout(resolve, timeoutMs + 10); + }); + }); + + // Start the timer + const startTime = Date.now(); + + // Wait for the promise to reject + await expect(resultPromise).rejects.toThrow('Connection timed out'); + + // Check that the time elapsed is close to the timeout value + const elapsedTime = Date.now() - startTime; + expect(elapsedTime).toBeGreaterThanOrEqual(timeoutMs); + expect(elapsedTime).toBeLessThan(timeoutMs + 50); // Allow some margin for test execution + + // Verify that publishData was called + expect(localParticipant.publishData).toHaveBeenCalledTimes(1); + + await expect(resultPromise).rejects.toThrow('Connection timed out'); + }); + + it('should handle RPC error response', async () => { + const method = 'errorMethod'; + const payload = 'errorPayload'; + const errorName = 'TEST_ERROR'; + const errorMessage = 'Test error message'; + + localParticipant.publishData.mockImplementationOnce((data) => { + const request = JSON.parse(new TextDecoder().decode(data)); + // Simulate receiving an error response + setTimeout(() => { + const response = new RpcResponse({ + requestId: request.id, + error: new RpcError(errorName, errorMessage), + }); + localParticipant['handleIncomingRpcResponse'](response); + }, 10); + }); + + await expect(localParticipant.performRpcRequest(mockRemoteParticipant.identity, method, payload)) + .rejects.toThrow(errorMessage); + }); + + it('should handle participant disconnection during RPC request', async () => { + const method = 'disconnectMethod'; + const payload = 'disconnectPayload'; + + const resultPromise = localParticipant.performRpcRequest(mockRemoteParticipant.identity, method, payload); + + // Simulate participant disconnection + localParticipant['handleParticipantDisconnected'](mockRemoteParticipant.identity); + + await expect(resultPromise).rejects.toThrow('Recipient has disconnected'); + }); + }); }); diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 051fcc80..1b626b6d 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -70,10 +70,10 @@ export class RpcError extends Error { static MAX_MESSAGE_BYTES = 256; static MAX_DATA_BYTES = 15360; // 15 KB - name: RpcErrorName; + name: string; data?: string; - constructor(name: RpcErrorName, message: string, data?: string) { + constructor(name: string, message: string, data?: string) { super(message); this.name = name; this.message = truncateBytes(message, RpcError.MAX_MESSAGE_BYTES); From ed3f991e26a97f4c1fe8869800df3e4c833367ca Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 20:55:03 -0700 Subject: [PATCH 043/126] update workflows --- .github/workflows/rtc-node.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rtc-node.yml b/.github/workflows/rtc-node.yml index c0757e0f..a07617c7 100644 --- a/.github/workflows/rtc-node.yml +++ b/.github/workflows/rtc-node.yml @@ -50,13 +50,16 @@ jobs: - name: Prettier run: pnpm format:check - - name: Test Node env livekit-server-sdk + - name: Test livekit-rtc + run: pnpm --filter="livekit-rtc" test + + - name: Test livekit-server-sdk (Node) run: pnpm --filter="livekit-server-sdk" test - - name: Test browser env livekit-server-sdk + - name: Test livekit-server-sdk (Browser) run: pnpm --filter="livekit-server-sdk" test:browser - - name: Test edge runtime env livekit-server-sdk + - name: Test env livekit-server-sdk (Edge Runtime) run: pnpm --filter="livekit-server-sdk" test:edge - uses: dorny/paths-filter@v3 From 4297d95abf81541bfcc250e752129981972b332c Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 21:10:33 -0700 Subject: [PATCH 044/126] reuse --- packages/livekit-rtc/src/participant.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts index c7d67884..425cc776 100644 --- a/packages/livekit-rtc/src/participant.test.ts +++ b/packages/livekit-rtc/src/participant.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 LiveKit, Inc. +// +// SPDX-License-Identifier: Apache-2.0 import { describe, it, expect, vi, beforeEach } from 'vitest'; import { LocalParticipant, RemoteParticipant } from './participant'; import { type OwnedParticipant, ParticipantKind } from './proto/participant_pb'; From b3bd24b80b1d5429074319f6eff6b6786a20c5c7 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 21:54:26 -0700 Subject: [PATCH 045/126] Improvement --- examples/rpc/index.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index efd33c2e..6dfdefb3 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -117,12 +117,15 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => const parsedResponse = JSON.parse(response); console.log(`[Requester] genius says ${parsedResponse.result}!`); } catch (error) { - if (error instanceof RpcError && error.name === RpcErrorName.UNSUPPORTED_METHOD) { - console.log(`[Requester] Aww looks like the genius doesn't know that one.`); - } else { - console.error('[Requester] Unexpected error:', error); - throw error; + if (error instanceof RpcError) { + if (error.name === RpcErrorName.UNSUPPORTED_METHOD) { + console.log(`[Requester] Aww looks like the genius doesn't know that one.`); + return; + } } + + console.error('[Requester] Unexpected error:', error); + throw error; } }; From d27b9aecdf1255ae69a8d515a5f34e688e315fbf Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 23:10:32 -0700 Subject: [PATCH 046/126] fmt --- examples/rpc/index.ts | 4 +- packages/livekit-rtc/src/index.ts | 2 +- packages/livekit-rtc/src/participant.test.ts | 53 ++++++++------ packages/livekit-rtc/src/participant.ts | 76 ++++++++++++-------- packages/livekit-rtc/src/room.ts | 3 +- packages/livekit-rtc/src/rpc.ts | 40 +++++------ packages/livekit-rtc/tsconfig.json | 3 +- packages/livekit-rtc/vite.config.js | 11 +++ 8 files changed, 116 insertions(+), 76 deletions(-) create mode 100644 packages/livekit-rtc/vite.config.js diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 6dfdefb3..51f1be68 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,4 +1,4 @@ -import { Room, RpcError, RpcErrorName } from '@livekit/rtc-node'; +import { Room, RpcError } from '@livekit/rtc-node'; import type { RemoteParticipant, RpcRequest } from '@livekit/rtc-node'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; @@ -118,7 +118,7 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => console.log(`[Requester] genius says ${parsedResponse.result}!`); } catch (error) { if (error instanceof RpcError) { - if (error.name === RpcErrorName.UNSUPPORTED_METHOD) { + if (error.name === 'UNSUPPORTED_METHOD') { console.log(`[Requester] Aww looks like the genius doesn't know that one.`); return; } diff --git a/packages/livekit-rtc/src/index.ts b/packages/livekit-rtc/src/index.ts index fcc1de05..c1ada082 100644 --- a/packages/livekit-rtc/src/index.ts +++ b/packages/livekit-rtc/src/index.ts @@ -37,7 +37,7 @@ export { TrackPublishOptions, ConnectionState, } from './proto/room_pb.js'; -export { RpcRequest, RpcAck, RpcResponse, RpcError, RpcErrorName } from './rpc.js'; +export { RpcRequest, RpcAck, RpcResponse, RpcError } from './rpc.js'; export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js'; export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js'; export { VideoBufferType, VideoRotation } from './proto/video_frame_pb.js'; diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts index 425cc776..2bdc480b 100644 --- a/packages/livekit-rtc/src/participant.test.ts +++ b/packages/livekit-rtc/src/participant.test.ts @@ -1,10 +1,10 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 -import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { LocalParticipant, RemoteParticipant } from './participant'; import { type OwnedParticipant, ParticipantKind } from './proto/participant_pb'; -import { RpcRequest, RpcError, RpcResponse } from './rpc'; +import { RpcError, RpcRequest, RpcResponse } from './rpc'; describe('LocalParticipant', () => { describe('registerRpcMethod', () => { @@ -23,7 +23,7 @@ describe('LocalParticipant', () => { }, handle: { id: BigInt('0x1234567890abcdef') }, } as unknown as OwnedParticipant; - + localParticipant = new LocalParticipant(mockOwnedParticipant); }); @@ -90,7 +90,8 @@ describe('LocalParticipant', () => { handle: { id: BigInt('0xabcdef0123456789') }, } as unknown as OwnedParticipant); - localParticipant.publishData = vi.fn(); + const mockPublishData = vi.fn(); + localParticipant.publishData = mockPublishData; await localParticipant['handleIncomingRpcRequest'](mockRequest, mockSender); @@ -98,10 +99,9 @@ describe('LocalParticipant', () => { expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // ACK and error response // Verify that the error response contains the correct error name - const errorResponse = localParticipant.publishData.mock.calls[1][0]; + const errorResponse = mockPublishData.mock.calls[1][0]; const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); - expect(parsedResponse.error.name).toBe('lk.UNCAUGHT_ERROR'); - + expect(parsedResponse.error.name).toBe('lk.uncaught-error'); }); it('should pass through RpcError thrown by the RPC method handler', async () => { @@ -130,7 +130,8 @@ describe('LocalParticipant', () => { handle: { id: BigInt('0xabcdef0123456789') }, } as unknown as OwnedParticipant); - localParticipant.publishData = vi.fn(); + const mockPublishData = vi.fn(); + localParticipant.publishData = mockPublishData; await localParticipant['handleIncomingRpcRequest'](mockRequest, mockSender); @@ -138,7 +139,7 @@ describe('LocalParticipant', () => { expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // ACK and error response // Verify that the error response contains the correct RpcError - const errorResponse = localParticipant.publishData.mock.calls[1][0]; + const errorResponse = mockPublishData.mock.calls[1][0]; const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); expect(parsedResponse.error.name).toBe(errorName); expect(parsedResponse.error.message).toBe(errorMessage); @@ -148,6 +149,7 @@ describe('LocalParticipant', () => { describe('performRpcRequest', () => { let localParticipant: LocalParticipant; let mockRemoteParticipant: RemoteParticipant; + let mockPublishData: ReturnType; beforeEach(() => { localParticipant = new LocalParticipant({ @@ -174,7 +176,9 @@ describe('LocalParticipant', () => { handle: { id: BigInt('0xabcdef0123456789') }, } as unknown as OwnedParticipant); - localParticipant.publishData = vi.fn(); + // Create a mock function for publishData + mockPublishData = vi.fn(); + localParticipant.publishData = mockPublishData; }); it('should send RPC request and receive successful response', async () => { @@ -182,8 +186,8 @@ describe('LocalParticipant', () => { const payload = 'testPayload'; const responsePayload = 'responsePayload'; - // Mock the publishData method to simulate sending the request - localParticipant.publishData.mockImplementationOnce((data) => { + // Use the mockPublishData variable for the mock implementation + mockPublishData.mockImplementationOnce((data) => { const request = JSON.parse(new TextDecoder().decode(data)); // Simulate receiving a response setTimeout(() => { @@ -195,9 +199,13 @@ describe('LocalParticipant', () => { }, 10); }); - const result = await localParticipant.performRpcRequest(mockRemoteParticipant.identity, method, payload); + const result = await localParticipant.performRpcRequest( + mockRemoteParticipant.identity, + method, + payload, + ); - expect(localParticipant.publishData).toHaveBeenCalledTimes(1); + expect(mockPublishData).toHaveBeenCalledTimes(1); expect(result).toBe(responsePayload); }); @@ -212,11 +220,11 @@ describe('LocalParticipant', () => { mockRemoteParticipant.identity, method, payload, - timeoutMs + timeoutMs, ); // Mock the publishData method to simulate a delay longer than the timeout - localParticipant.publishData.mockImplementationOnce(() => { + mockPublishData.mockImplementationOnce(() => { return new Promise((resolve) => { setTimeout(resolve, timeoutMs + 10); }); @@ -245,7 +253,7 @@ describe('LocalParticipant', () => { const errorName = 'TEST_ERROR'; const errorMessage = 'Test error message'; - localParticipant.publishData.mockImplementationOnce((data) => { + mockPublishData.mockImplementationOnce((data) => { const request = JSON.parse(new TextDecoder().decode(data)); // Simulate receiving an error response setTimeout(() => { @@ -257,15 +265,20 @@ describe('LocalParticipant', () => { }, 10); }); - await expect(localParticipant.performRpcRequest(mockRemoteParticipant.identity, method, payload)) - .rejects.toThrow(errorMessage); + await expect( + localParticipant.performRpcRequest(mockRemoteParticipant.identity, method, payload), + ).rejects.toThrow(errorMessage); }); it('should handle participant disconnection during RPC request', async () => { const method = 'disconnectMethod'; const payload = 'disconnectPayload'; - const resultPromise = localParticipant.performRpcRequest(mockRemoteParticipant.identity, method, payload); + const resultPromise = localParticipant.performRpcRequest( + mockRemoteParticipant.identity, + method, + payload, + ); // Simulate participant disconnection localParticipant['handleParticipantDisconnected'](mockRemoteParticipant.identity); diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index c7408e97..2cd8b04a 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -33,7 +33,7 @@ import { SetLocalNameRequest, UnpublishTrackRequest, } from './proto/room_pb.js'; -import { byteLength, MAX_PAYLOAD_BYTES, RpcAck, RpcError, RpcErrorName, RpcRequest, RpcResponse } from './rpc.js'; +import { MAX_PAYLOAD_BYTES, RpcAck, RpcError, RpcRequest, RpcResponse, byteLength } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; @@ -102,8 +102,14 @@ export class LocalParticipant extends Participant { trackPublications: Map = new Map(); - private pendingAcks = new Map void, participantIdentity: string }>(); - private pendingResponses = new Map void, participantIdentity: string }>(); + private pendingAcks = new Map< + string, + { resolve: (ack: RpcAck) => void; participantIdentity: string } + >(); + private pendingResponses = new Map< + string, + { resolve: (response: RpcResponse) => void; participantIdentity: string } + >(); async publishData(data: Uint8Array, options: DataPublishOptions) { const req = new PublishDataRequest({ @@ -297,7 +303,7 @@ export class LocalParticipant extends Participant { return new Promise((resolve, reject) => { if (byteLength(payload) > MAX_PAYLOAD_BYTES) { - reject(RpcError.builtIn(RpcErrorName.PAYLOAD_TOO_LARGE)); + reject(RpcError.builtIn('PAYLOAD_TOO_LARGE')); return; } @@ -321,33 +327,39 @@ export class LocalParticipant extends Participant { const ackTimeoutId = setTimeout(() => { this.pendingAcks.delete(id); - reject(RpcError.builtIn(RpcErrorName.CONNECTION_TIMEOUT)); + reject(RpcError.builtIn('CONNECTION_TIMEOUT')); this.pendingResponses.delete(id); clearTimeout(responseTimeoutId); }, connectionTimeoutMs); - this.pendingAcks.set(id, { resolve: () => { - clearTimeout(ackTimeoutId); - }, participantIdentity: recipientIdentity }); + this.pendingAcks.set(id, { + resolve: () => { + clearTimeout(ackTimeoutId); + }, + participantIdentity: recipientIdentity, + }); const responseTimeoutId = setTimeout(() => { this.pendingResponses.delete(id); - reject(RpcError.builtIn(RpcErrorName.RESPONSE_TIMEOUT)); + reject(RpcError.builtIn('RESPONSE_TIMEOUT')); }, responseTimeoutMs); - this.pendingResponses.set(id, { resolve: (response) => { - if (this.pendingAcks.has(id)) { - console.error('RPC response received before ack', id); - this.pendingAcks.delete(id); - clearTimeout(ackTimeoutId); - } - clearTimeout(responseTimeoutId); - if (response.error) { - reject(response.error); - } else { - resolve(response.payload); - } - }, participantIdentity: recipientIdentity }); + this.pendingResponses.set(id, { + resolve: (response) => { + if (this.pendingAcks.has(id)) { + console.error('RPC response received before ack', id); + this.pendingAcks.delete(id); + clearTimeout(ackTimeoutId); + } + clearTimeout(responseTimeoutId); + if (response.error) { + reject(response.error); + } else { + resolve(response.payload); + } + }, + participantIdentity: recipientIdentity, + }); }); } @@ -423,7 +435,7 @@ export class LocalParticipant extends Participant { if (!handler) { const rpcResponse = new RpcResponse({ requestId: request.id, - error: RpcError.builtIn(RpcErrorName.UNSUPPORTED_METHOD), + error: RpcError.builtIn('UNSUPPORTED_METHOD'), }); sendResponse(rpcResponse); return; @@ -436,7 +448,7 @@ export class LocalParticipant extends Participant { const response = await handler(request, sender); if (typeof response === 'string') { if (byteLength(response) > MAX_PAYLOAD_BYTES) { - rpcResponse.error = RpcError.builtIn(RpcErrorName.PAYLOAD_TOO_LARGE); + rpcResponse.error = RpcError.builtIn('PAYLOAD_TOO_LARGE'); console.warn(`RPC Response payload too large for ${request.method}`); } else { rpcResponse.payload = response; @@ -445,17 +457,17 @@ export class LocalParticipant extends Participant { rpcResponse.error = response; } else { console.warn(`unexpected handler response for ${request.method}: ${response}`); - rpcResponse.error = RpcError.builtIn(RpcErrorName.MALFORMED_RESPONSE); + rpcResponse.error = RpcError.builtIn('MALFORMED_RESPONSE'); } } catch (error) { if (error instanceof RpcError) { rpcResponse.error = error; } else { console.warn( - `Uncaught error returned by RPC handler for ${request.method}. Returning ${RpcErrorName.UNCAUGHT_ERROR}`, + `Uncaught error returned by RPC handler for ${request.method}. Returning UNCAUGHT_ERROR instead.`, error, ); - rpcResponse.error = RpcError.builtIn(RpcErrorName.UNCAUGHT_ERROR); + rpcResponse.error = RpcError.builtIn('UNCAUGHT_ERROR'); } } @@ -472,10 +484,12 @@ export class LocalParticipant extends Participant { for (const [id, { participantIdentity: pendingIdentity, resolve }] of this.pendingResponses) { if (pendingIdentity === participantIdentity) { - resolve(new RpcResponse({ - requestId: id, - error: RpcError.builtIn(RpcErrorName.RECIPIENT_DISCONNECTED), - })); + resolve( + new RpcResponse({ + requestId: id, + error: RpcError.builtIn('RECIPIENT_DISCONNECTED'), + }), + ); this.pendingResponses.delete(id); } } diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 779e38ed..5ee2d2fd 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -28,7 +28,8 @@ import { IceTransportType, } from './proto/room_pb.js'; import { TrackKind } from './proto/track_pb.js'; -import { RpcAck, RpcRequest, RpcResponse, RpcError } from './rpc.js'; +import type { RpcAck, RpcRequest, RpcResponse } from './rpc.js'; +import { RpcError } from './rpc.js'; import type { LocalTrack, RemoteTrack } from './track.js'; import { RemoteAudioTrack, RemoteVideoTrack } from './track.js'; import type { LocalTrackPublication, TrackPublication } from './track_publication.js'; diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 1b626b6d..ac79a6fd 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -88,41 +88,41 @@ export class RpcError extends Error { }; } + static Name = { + CONNECTION_TIMEOUT: 'lk.connection-timeout', + RESPONSE_TIMEOUT: 'lk.response-timeout', + UNSUPPORTED_METHOD: 'lk.unsupported-method', + RECIPIENT_DISCONNECTED: 'lk.recipient-disconnected', + UNCAUGHT_ERROR: 'lk.uncaught-error', + MALFORMED_RESPONSE: 'lk.malformed-response', + PAYLOAD_TOO_LARGE: 'lk.payload-too-large', + } as const; + /** @internal */ - static builtIn(type: RpcErrorName, data?: string): RpcError { - return new RpcError(type, RpcError.getMessage(type), data); + static builtIn(name: keyof typeof RpcError.Name, data?: string): RpcError { + return new RpcError(RpcError.Name[name], RpcError.getMessage(name), data); } - private static getMessage(name: RpcErrorName): string { + private static getMessage(name: keyof typeof RpcError.Name): string { switch (name) { - case RpcErrorName.CONNECTION_TIMEOUT: + case 'CONNECTION_TIMEOUT': return 'Connection timed out'; - case RpcErrorName.RESPONSE_TIMEOUT: + case 'RESPONSE_TIMEOUT': return 'Response timed out'; - case RpcErrorName.UNSUPPORTED_METHOD: + case 'UNSUPPORTED_METHOD': return 'Method is not supported'; - case RpcErrorName.RECIPIENT_DISCONNECTED: + case 'RECIPIENT_DISCONNECTED': return 'Recipient has disconnected'; - case RpcErrorName.UNCAUGHT_ERROR: + case 'UNCAUGHT_ERROR': return 'An uncaught error occurred'; - case RpcErrorName.MALFORMED_RESPONSE: + case 'MALFORMED_RESPONSE': return 'Response is malformed'; - case RpcErrorName.PAYLOAD_TOO_LARGE: + case 'PAYLOAD_TOO_LARGE': return 'Payload exceeds size limit'; } } } -export enum RpcErrorName { - CONNECTION_TIMEOUT = 'lk.CONNECTION_TIMEOUT', - RESPONSE_TIMEOUT = 'lk.RESPONSE_TIMEOUT', - UNSUPPORTED_METHOD = 'lk.UNSUPPORTED_METHOD', - RECIPIENT_DISCONNECTED = 'lk.RECIPIENT_DISCONNECTED', - UNCAUGHT_ERROR = 'lk.UNCAUGHT_ERROR', - MALFORMED_RESPONSE = 'lk.MALFORMED_RESPONSE', - PAYLOAD_TOO_LARGE = 'lk.PAYLOAD_TOO_LARGE', -} - /** * @internal */ diff --git a/packages/livekit-rtc/tsconfig.json b/packages/livekit-rtc/tsconfig.json index c5c808cf..ce0d7ec7 100644 --- a/packages/livekit-rtc/tsconfig.json +++ b/packages/livekit-rtc/tsconfig.json @@ -11,5 +11,6 @@ "sourceMap": true, "outDir": "dist" }, - "include": ["src/**/*.ts"] + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.test.ts", "vite.config.ts"], } diff --git a/packages/livekit-rtc/vite.config.js b/packages/livekit-rtc/vite.config.js new file mode 100644 index 00000000..cf74485c --- /dev/null +++ b/packages/livekit-rtc/vite.config.js @@ -0,0 +1,11 @@ +// SPDX-FileCopyrightText: 2024 LiveKit, Inc. +// +// SPDX-License-Identifier: Apache-2.0 + +import { defineConfig } from 'vite'; + +export default defineConfig({ + test: { + environment: 'node', + }, +}); From e800bf52452b12a1bfe425e2a954e6687e461e8d Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 23 Sep 2024 23:53:25 -0700 Subject: [PATCH 047/126] Fix error in example --- examples/rpc/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 51f1be68..a484d0bb 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -118,7 +118,7 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => console.log(`[Requester] genius says ${parsedResponse.result}!`); } catch (error) { if (error instanceof RpcError) { - if (error.name === 'UNSUPPORTED_METHOD') { + if (error.name === 'lk.unsupported-method') { console.log(`[Requester] Aww looks like the genius doesn't know that one.`); return; } From b186125447c7912a0dc5193a0ab0c05e7a73ac69 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 24 Sep 2024 00:57:41 -0700 Subject: [PATCH 048/126] Cleanup --- packages/livekit-rtc/src/participant.test.ts | 18 +++---- packages/livekit-rtc/src/room.ts | 2 +- packages/livekit-rtc/src/rpc.ts | 57 +++++++++----------- 3 files changed, 33 insertions(+), 44 deletions(-) diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts index 2bdc480b..4e685ca1 100644 --- a/packages/livekit-rtc/src/participant.test.ts +++ b/packages/livekit-rtc/src/participant.test.ts @@ -101,14 +101,14 @@ describe('LocalParticipant', () => { // Verify that the error response contains the correct error name const errorResponse = mockPublishData.mock.calls[1][0]; const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); - expect(parsedResponse.error.name).toBe('lk.uncaught-error'); + expect(parsedResponse.error.code).toBe(RpcError.ErrorCodes.UNCAUGHT_ERROR); }); it('should pass through RpcError thrown by the RPC method handler', async () => { const methodName = 'rpcErrorMethod'; - const errorName = 'some-error'; + const errorCode = 101; const errorMessage = 'some-error-message'; - const handler = vi.fn().mockRejectedValue(new RpcError(errorName, errorMessage)); + const handler = vi.fn().mockRejectedValue(new RpcError(errorCode, errorMessage)); localParticipant.registerRpcMethod(methodName, handler); @@ -141,7 +141,7 @@ describe('LocalParticipant', () => { // Verify that the error response contains the correct RpcError const errorResponse = mockPublishData.mock.calls[1][0]; const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); - expect(parsedResponse.error.name).toBe(errorName); + expect(parsedResponse.error.code).toBe(errorCode); expect(parsedResponse.error.message).toBe(errorMessage); }); }); @@ -234,7 +234,7 @@ describe('LocalParticipant', () => { const startTime = Date.now(); // Wait for the promise to reject - await expect(resultPromise).rejects.toThrow('Connection timed out'); + await expect(resultPromise).rejects.toThrow('Connection timeout'); // Check that the time elapsed is close to the timeout value const elapsedTime = Date.now() - startTime; @@ -243,14 +243,12 @@ describe('LocalParticipant', () => { // Verify that publishData was called expect(localParticipant.publishData).toHaveBeenCalledTimes(1); - - await expect(resultPromise).rejects.toThrow('Connection timed out'); }); it('should handle RPC error response', async () => { const method = 'errorMethod'; const payload = 'errorPayload'; - const errorName = 'TEST_ERROR'; + const errorCode = 101; const errorMessage = 'Test error message'; mockPublishData.mockImplementationOnce((data) => { @@ -259,7 +257,7 @@ describe('LocalParticipant', () => { setTimeout(() => { const response = new RpcResponse({ requestId: request.id, - error: new RpcError(errorName, errorMessage), + error: new RpcError(errorCode, errorMessage), }); localParticipant['handleIncomingRpcResponse'](response); }, 10); @@ -283,7 +281,7 @@ describe('LocalParticipant', () => { // Simulate participant disconnection localParticipant['handleParticipantDisconnected'](mockRemoteParticipant.identity); - await expect(resultPromise).rejects.toThrow('Recipient has disconnected'); + await expect(resultPromise).rejects.toThrow('Recipient disconnected'); }); }); }); diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 5ee2d2fd..313703cd 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -288,7 +288,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter const response = JSON.parse(new TextDecoder().decode(buffer)) as RpcResponse; if (response.error) { response.error = new RpcError( - response.error.name, + response.error.code, response.error.message, response.error.data, ); diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index ac79a6fd..eceb8996 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -70,56 +70,47 @@ export class RpcError extends Error { static MAX_MESSAGE_BYTES = 256; static MAX_DATA_BYTES = 15360; // 15 KB - name: string; + code: number; data?: string; - constructor(name: string, message: string, data?: string) { + constructor(code: number, message: string, data?: string) { super(message); - this.name = name; + this.code = code; this.message = truncateBytes(message, RpcError.MAX_MESSAGE_BYTES); this.data = data ? truncateBytes(data, RpcError.MAX_DATA_BYTES) : undefined; } toJSON() { return { - name: this.name, + code: this.code, message: this.message, data: this.data, }; } - static Name = { - CONNECTION_TIMEOUT: 'lk.connection-timeout', - RESPONSE_TIMEOUT: 'lk.response-timeout', - UNSUPPORTED_METHOD: 'lk.unsupported-method', - RECIPIENT_DISCONNECTED: 'lk.recipient-disconnected', - UNCAUGHT_ERROR: 'lk.uncaught-error', - MALFORMED_RESPONSE: 'lk.malformed-response', - PAYLOAD_TOO_LARGE: 'lk.payload-too-large', + static ErrorCodes = { + UNCAUGHT_ERROR: 1001, + UNSUPPORTED_METHOD: 1002, + CONNECTION_TIMEOUT: 1003, + RESPONSE_TIMEOUT: 1004, + RECIPIENT_DISCONNECTED: 1005, + PAYLOAD_TOO_LARGE: 1006, + MALFORMED_RESPONSE: 1007, } as const; - /** @internal */ - static builtIn(name: keyof typeof RpcError.Name, data?: string): RpcError { - return new RpcError(RpcError.Name[name], RpcError.getMessage(name), data); - } + static ErrorMessages = { + UNCAUGHT_ERROR: 'Uncaught application error', + UNSUPPORTED_METHOD: 'Method not supported at destination', + CONNECTION_TIMEOUT: 'Connection timeout', + RESPONSE_TIMEOUT: 'Response timeout', + RECIPIENT_DISCONNECTED: 'Recipient disconnected', + PAYLOAD_TOO_LARGE: 'Payload too large', + MALFORMED_RESPONSE: 'Malformed response' + } as const; - private static getMessage(name: keyof typeof RpcError.Name): string { - switch (name) { - case 'CONNECTION_TIMEOUT': - return 'Connection timed out'; - case 'RESPONSE_TIMEOUT': - return 'Response timed out'; - case 'UNSUPPORTED_METHOD': - return 'Method is not supported'; - case 'RECIPIENT_DISCONNECTED': - return 'Recipient has disconnected'; - case 'UNCAUGHT_ERROR': - return 'An uncaught error occurred'; - case 'MALFORMED_RESPONSE': - return 'Response is malformed'; - case 'PAYLOAD_TOO_LARGE': - return 'Payload exceeds size limit'; - } + /** @internal */ + static builtIn(key: keyof typeof RpcError.ErrorCodes & keyof typeof RpcError.ErrorMessages, data?: string): RpcError { + return new RpcError(RpcError.ErrorCodes[key], RpcError.ErrorMessages[key], data); } } From bff53e564ae1a331744754add7fcf44ba725eb9d Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 24 Sep 2024 00:58:47 -0700 Subject: [PATCH 049/126] fix --- examples/rpc/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index a484d0bb..d56e27ae 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -118,7 +118,7 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => console.log(`[Requester] genius says ${parsedResponse.result}!`); } catch (error) { if (error instanceof RpcError) { - if (error.name === 'lk.unsupported-method') { + if (error.code === RpcError.ErrorCodes.UNSUPPORTED_METHOD) { console.log(`[Requester] Aww looks like the genius doesn't know that one.`); return; } From 7e8e23b9fc3669e2193b8eed3169f5c8f55afd05 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 24 Sep 2024 01:00:23 -0700 Subject: [PATCH 050/126] Format --- packages/livekit-rtc/src/rpc.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index eceb8996..34982ff2 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -105,11 +105,14 @@ export class RpcError extends Error { RESPONSE_TIMEOUT: 'Response timeout', RECIPIENT_DISCONNECTED: 'Recipient disconnected', PAYLOAD_TOO_LARGE: 'Payload too large', - MALFORMED_RESPONSE: 'Malformed response' + MALFORMED_RESPONSE: 'Malformed response', } as const; /** @internal */ - static builtIn(key: keyof typeof RpcError.ErrorCodes & keyof typeof RpcError.ErrorMessages, data?: string): RpcError { + static builtIn( + key: keyof typeof RpcError.ErrorCodes & keyof typeof RpcError.ErrorMessages, + data?: string, + ): RpcError { return new RpcError(RpcError.ErrorCodes[key], RpcError.ErrorMessages[key], data); } } From abb1c6a344e5fc8198ce3314f4c01e5230ed9ecf Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 24 Sep 2024 01:02:52 -0700 Subject: [PATCH 051/126] Comments --- packages/livekit-rtc/src/rpc.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 34982ff2..a5e77be4 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -73,6 +73,13 @@ export class RpcError extends Error { code: number; data?: string; + /** + * Creates an error object with the given code and message, plus an optional data payload. + * + * If thrown in an RPC method handler, the error will be sent back to the caller. + * + * Error codes 1001-1999 are reserved for built-in errors (see RpcError.ErrorCodes for their meanings). + */ constructor(code: number, message: string, data?: string) { super(message); this.code = code; @@ -108,7 +115,11 @@ export class RpcError extends Error { MALFORMED_RESPONSE: 'Malformed response', } as const; - /** @internal */ + /** + * Creates an error object from the code, with an auto-populated message. + * + * @internal + */ static builtIn( key: keyof typeof RpcError.ErrorCodes & keyof typeof RpcError.ErrorMessages, data?: string, From a872a41e0a407f99ae39939610a3a00324319bb9 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 24 Sep 2024 01:03:19 -0700 Subject: [PATCH 052/126] rm --- packages/livekit-rtc/src/rpc.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index a5e77be4..20d09da1 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -66,7 +66,6 @@ export class RpcResponse { */ export class RpcError extends Error { - static MAX_NAME_BYTES = 64; static MAX_MESSAGE_BYTES = 256; static MAX_DATA_BYTES = 15360; // 15 KB From 597e8897ec49e702273ac9d57e3ac39934e2c590 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 24 Sep 2024 01:06:01 -0700 Subject: [PATCH 053/126] fix --- packages/livekit-rtc/src/participant.test.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts index 4e685ca1..dc689284 100644 --- a/packages/livekit-rtc/src/participant.test.ts +++ b/packages/livekit-rtc/src/participant.test.ts @@ -11,7 +11,6 @@ describe('LocalParticipant', () => { let localParticipant: LocalParticipant; beforeEach(() => { - // Mock the OwnedParticipant object const mockOwnedParticipant = { info: { sid: 'test-sid', @@ -33,12 +32,11 @@ describe('LocalParticipant', () => { localParticipant.registerRpcMethod(methodName, handler); - // Create a mock RpcRequest and RemoteParticipant const mockRequest = new RpcRequest({ id: 'test-request-id', method: methodName, payload: 'test payload', - responseTimeoutMs: 5000, // Add a default timeout + responseTimeoutMs: 5000, }); const mockSender = new RemoteParticipant({ info: { @@ -52,7 +50,6 @@ describe('LocalParticipant', () => { handle: { id: BigInt('0x9876543210fedcba') }, } as unknown as OwnedParticipant); - // Mock the publishData method to avoid actual data publishing localParticipant.publishData = vi.fn(); // Call the internal method that would be triggered by an incoming RPC request @@ -176,7 +173,6 @@ describe('LocalParticipant', () => { handle: { id: BigInt('0xabcdef0123456789') }, } as unknown as OwnedParticipant); - // Create a mock function for publishData mockPublishData = vi.fn(); localParticipant.publishData = mockPublishData; }); @@ -186,7 +182,6 @@ describe('LocalParticipant', () => { const payload = 'testPayload'; const responsePayload = 'responsePayload'; - // Use the mockPublishData variable for the mock implementation mockPublishData.mockImplementationOnce((data) => { const request = JSON.parse(new TextDecoder().decode(data)); // Simulate receiving a response @@ -230,7 +225,6 @@ describe('LocalParticipant', () => { }); }); - // Start the timer const startTime = Date.now(); // Wait for the promise to reject @@ -241,7 +235,6 @@ describe('LocalParticipant', () => { expect(elapsedTime).toBeGreaterThanOrEqual(timeoutMs); expect(elapsedTime).toBeLessThan(timeoutMs + 50); // Allow some margin for test execution - // Verify that publishData was called expect(localParticipant.publishData).toHaveBeenCalledTimes(1); }); From 0d9da4b70e76710afb0c2304941c13afddcd0ca8 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 24 Sep 2024 01:13:03 -0700 Subject: [PATCH 054/126] More errors --- packages/livekit-rtc/src/rpc.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 20d09da1..c9b136b7 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -100,8 +100,10 @@ export class RpcError extends Error { CONNECTION_TIMEOUT: 1003, RESPONSE_TIMEOUT: 1004, RECIPIENT_DISCONNECTED: 1005, - PAYLOAD_TOO_LARGE: 1006, - MALFORMED_RESPONSE: 1007, + RECIPIENT_NOT_FOUND: 1006, + REQUEST_PAYLOAD_TOO_LARGE: 1007, + RESPONSE_PAYLOAD_TOO_LARGE: 1008, + MALFORMED_RESPONSE: 1099, // TODO: Shouldn't be needed with protobuf type } as const; static ErrorMessages = { @@ -110,7 +112,9 @@ export class RpcError extends Error { CONNECTION_TIMEOUT: 'Connection timeout', RESPONSE_TIMEOUT: 'Response timeout', RECIPIENT_DISCONNECTED: 'Recipient disconnected', - PAYLOAD_TOO_LARGE: 'Payload too large', + RECIPIENT_NOT_FOUND: 'Recipient not found', + REQUEST_PAYLOAD_TOO_LARGE: 'Request payload too large', + RESPONSE_PAYLOAD_TOO_LARGE: 'Response payload too large', MALFORMED_RESPONSE: 'Malformed response', } as const; From 1a2fe787c46b1e0ca61fffc49dea90d138f8c027 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 24 Sep 2024 01:20:21 -0700 Subject: [PATCH 055/126] things --- examples/rpc/index.ts | 2 +- packages/livekit-rtc/src/participant.test.ts | 2 +- packages/livekit-rtc/src/participant.ts | 4 ++-- packages/livekit-rtc/src/rpc.ts | 15 +++++++++------ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index d56e27ae..58dfa0c1 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -118,7 +118,7 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => console.log(`[Requester] genius says ${parsedResponse.result}!`); } catch (error) { if (error instanceof RpcError) { - if (error.code === RpcError.ErrorCodes.UNSUPPORTED_METHOD) { + if (error.code === RpcError.ErrorCode.UNSUPPORTED_METHOD) { console.log(`[Requester] Aww looks like the genius doesn't know that one.`); return; } diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts index dc689284..023c9d35 100644 --- a/packages/livekit-rtc/src/participant.test.ts +++ b/packages/livekit-rtc/src/participant.test.ts @@ -98,7 +98,7 @@ describe('LocalParticipant', () => { // Verify that the error response contains the correct error name const errorResponse = mockPublishData.mock.calls[1][0]; const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); - expect(parsedResponse.error.code).toBe(RpcError.ErrorCodes.UNCAUGHT_ERROR); + expect(parsedResponse.error.code).toBe(RpcError.ErrorCode.UNCAUGHT_ERROR); }); it('should pass through RpcError thrown by the RPC method handler', async () => { diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 2cd8b04a..5789cbbb 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -303,7 +303,7 @@ export class LocalParticipant extends Participant { return new Promise((resolve, reject) => { if (byteLength(payload) > MAX_PAYLOAD_BYTES) { - reject(RpcError.builtIn('PAYLOAD_TOO_LARGE')); + reject(RpcError.builtIn('REQUEST_PAYLOAD_TOO_LARGE')); return; } @@ -448,7 +448,7 @@ export class LocalParticipant extends Participant { const response = await handler(request, sender); if (typeof response === 'string') { if (byteLength(response) > MAX_PAYLOAD_BYTES) { - rpcResponse.error = RpcError.builtIn('PAYLOAD_TOO_LARGE'); + rpcResponse.error = RpcError.builtIn('RESPONSE_PAYLOAD_TOO_LARGE'); console.warn(`RPC Response payload too large for ${request.method}`); } else { rpcResponse.payload = response; diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index c9b136b7..fddaab49 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -77,7 +77,7 @@ export class RpcError extends Error { * * If thrown in an RPC method handler, the error will be sent back to the caller. * - * Error codes 1001-1999 are reserved for built-in errors (see RpcError.ErrorCodes for their meanings). + * Error codes 1001-1999 are reserved for built-in errors (see RpcError.ErrorCode for their meanings). */ constructor(code: number, message: string, data?: string) { super(message); @@ -94,7 +94,7 @@ export class RpcError extends Error { }; } - static ErrorCodes = { + static ErrorCode = { UNCAUGHT_ERROR: 1001, UNSUPPORTED_METHOD: 1002, CONNECTION_TIMEOUT: 1003, @@ -106,7 +106,10 @@ export class RpcError extends Error { MALFORMED_RESPONSE: 1099, // TODO: Shouldn't be needed with protobuf type } as const; - static ErrorMessages = { + /** + * @internal + */ + static ErrorMessage = { UNCAUGHT_ERROR: 'Uncaught application error', UNSUPPORTED_METHOD: 'Method not supported at destination', CONNECTION_TIMEOUT: 'Connection timeout', @@ -120,14 +123,14 @@ export class RpcError extends Error { /** * Creates an error object from the code, with an auto-populated message. - * + * * @internal */ static builtIn( - key: keyof typeof RpcError.ErrorCodes & keyof typeof RpcError.ErrorMessages, + key: keyof typeof RpcError.ErrorCode & keyof typeof RpcError.ErrorMessage, data?: string, ): RpcError { - return new RpcError(RpcError.ErrorCodes[key], RpcError.ErrorMessages[key], data); + return new RpcError(RpcError.ErrorCode[key], RpcError.ErrorMessage[key], data); } } From 23fd42fdfb82a0b08096d027e0d45afe90b2b38a Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 24 Sep 2024 09:43:53 -0700 Subject: [PATCH 056/126] simplify --- packages/livekit-rtc/src/rpc.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index fddaab49..bc714d73 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -109,7 +109,7 @@ export class RpcError extends Error { /** * @internal */ - static ErrorMessage = { + static ErrorMessage: Record = { UNCAUGHT_ERROR: 'Uncaught application error', UNSUPPORTED_METHOD: 'Method not supported at destination', CONNECTION_TIMEOUT: 'Connection timeout', @@ -126,10 +126,7 @@ export class RpcError extends Error { * * @internal */ - static builtIn( - key: keyof typeof RpcError.ErrorCode & keyof typeof RpcError.ErrorMessage, - data?: string, - ): RpcError { + static builtIn(key: keyof typeof RpcError.ErrorCode, data?: string): RpcError { return new RpcError(RpcError.ErrorCode[key], RpcError.ErrorMessage[key], data); } } From 085e1309b9b117f406f5b5db2e4e6992820b5d87 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 4 Oct 2024 14:33:14 -0700 Subject: [PATCH 057/126] proto --- packages/livekit-rtc/src/proto/ffi_pb.ts | 64 ++++++++ packages/livekit-rtc/src/proto/room_pb.ts | 175 ++++++++++++++++++++++ 2 files changed, 239 insertions(+) diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index c65cb535..36519cb0 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -20,6 +20,7 @@ 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, 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 { PublishRpcAckCallback, PublishRpcAckRequest, PublishRpcAckResponse, PublishRpcRequestCallback, PublishRpcRequestRequest, PublishRpcRequestResponse, PublishRpcResponseCallback, PublishRpcResponseRequest, PublishRpcResponseResponse } from "./rpc_pb.js"; import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, EnableRemoteTrackRequest, EnableRemoteTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, LocalTrackMuteRequest, LocalTrackMuteResponse, TrackEvent } from "./track_pb.js"; import { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb.js"; import { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb.js"; @@ -153,6 +154,24 @@ export class FfiRequest extends Message { */ value: PublishSipDtmfRequest; case: "publishSipDtmf"; + } | { + /** + * @generated from field: livekit.proto.PublishRpcRequestRequest publish_rpc_request = 36; + */ + value: PublishRpcRequestRequest; + case: "publishRpcRequest"; + } | { + /** + * @generated from field: livekit.proto.PublishRpcResponseRequest publish_rpc_response = 37; + */ + value: PublishRpcResponseRequest; + case: "publishRpcResponse"; + } | { + /** + * @generated from field: livekit.proto.PublishRpcAckRequest publish_rpc_ack = 38; + */ + value: PublishRpcAckRequest; + case: "publishRpcAck"; } | { /** * Track @@ -308,6 +327,9 @@ export class FfiRequest extends 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: 36, name: "publish_rpc_request", kind: "message", T: PublishRpcRequestRequest, oneof: "message" }, + { no: 37, name: "publish_rpc_response", kind: "message", T: PublishRpcResponseRequest, oneof: "message" }, + { no: 38, name: "publish_rpc_ack", kind: "message", T: PublishRpcAckRequest, 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: "local_track_mute", kind: "message", T: LocalTrackMuteRequest, oneof: "message" }, @@ -437,6 +459,24 @@ export class FfiResponse extends Message { */ value: PublishSipDtmfResponse; case: "publishSipDtmf"; + } | { + /** + * @generated from field: livekit.proto.PublishRpcRequestResponse publish_rpc_request = 36; + */ + value: PublishRpcRequestResponse; + case: "publishRpcRequest"; + } | { + /** + * @generated from field: livekit.proto.PublishRpcResponseResponse publish_rpc_response = 37; + */ + value: PublishRpcResponseResponse; + case: "publishRpcResponse"; + } | { + /** + * @generated from field: livekit.proto.PublishRpcAckResponse publish_rpc_ack = 38; + */ + value: PublishRpcAckResponse; + case: "publishRpcAck"; } | { /** * Track @@ -592,6 +632,9 @@ export class FfiResponse extends 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: 36, name: "publish_rpc_request", kind: "message", T: PublishRpcRequestResponse, oneof: "message" }, + { no: 37, name: "publish_rpc_response", kind: "message", T: PublishRpcResponseResponse, oneof: "message" }, + { no: 38, name: "publish_rpc_ack", kind: "message", T: PublishRpcAckResponse, 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: "local_track_mute", kind: "message", T: LocalTrackMuteResponse, oneof: "message" }, @@ -763,6 +806,24 @@ export class FfiEvent extends Message { */ value: PublishSipDtmfCallback; case: "publishSipDtmf"; + } | { + /** + * @generated from field: livekit.proto.PublishRpcRequestCallback publish_rpc_request = 22; + */ + value: PublishRpcRequestCallback; + case: "publishRpcRequest"; + } | { + /** + * @generated from field: livekit.proto.PublishRpcResponseCallback publish_rpc_response = 23; + */ + value: PublishRpcResponseCallback; + case: "publishRpcResponse"; + } | { + /** + * @generated from field: livekit.proto.PublishRpcAckCallback publish_rpc_ack = 24; + */ + value: PublishRpcAckCallback; + case: "publishRpcAck"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -793,6 +854,9 @@ export class FfiEvent extends 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" }, + { no: 22, name: "publish_rpc_request", kind: "message", T: PublishRpcRequestCallback, oneof: "message" }, + { no: 23, name: "publish_rpc_response", kind: "message", T: PublishRpcResponseCallback, oneof: "message" }, + { no: 24, name: "publish_rpc_ack", kind: "message", T: PublishRpcAckCallback, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiEvent { diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index fefc54b7..491f0693 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -25,6 +25,7 @@ import { RtcStats } from "./stats_pb.js"; import { VideoCodec } from "./video_frame_pb.js"; import { E2eeOptions, EncryptionState } from "./e2ee_pb.js"; import { FfiOwnedHandle } from "./handle_pb.js"; +import { RpcError } from "./rpc_pb.js"; /** * @generated from enum livekit.proto.IceTransportType @@ -2491,6 +2492,24 @@ export class RoomEvent extends Message { */ value: TranscriptionReceived; case: "transcriptionReceived"; + } | { + /** + * @generated from field: livekit.proto.RpcRequestReceived rpc_request_received = 29; + */ + value: RpcRequestReceived; + case: "rpcRequestReceived"; + } | { + /** + * @generated from field: livekit.proto.RpcResponseReceived rpc_response_received = 30; + */ + value: RpcResponseReceived; + case: "rpcResponseReceived"; + } | { + /** + * @generated from field: livekit.proto.RpcAckReceived rpc_ack_received = 31; + */ + value: RpcAckReceived; + case: "rpcAckReceived"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -2529,6 +2548,9 @@ export class RoomEvent extends Message { { no: 26, name: "eos", kind: "message", T: RoomEOS, oneof: "message" }, { no: 27, name: "data_packet_received", kind: "message", T: DataPacketReceived, oneof: "message" }, { no: 28, name: "transcription_received", kind: "message", T: TranscriptionReceived, oneof: "message" }, + { no: 29, name: "rpc_request_received", kind: "message", T: RpcRequestReceived, oneof: "message" }, + { no: 30, name: "rpc_response_received", kind: "message", T: RpcResponseReceived, oneof: "message" }, + { no: 31, name: "rpc_ack_received", kind: "message", T: RpcAckReceived, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomEvent { @@ -3673,6 +3695,159 @@ export class TranscriptionReceived extends Message { } } +/** + * @generated from message livekit.proto.RpcRequestReceived + */ +export class RpcRequestReceived extends Message { + /** + * @generated from field: uint64 participant_identity = 1; + */ + participantIdentity = protoInt64.zero; + + /** + * @generated from field: string request_id = 2; + */ + requestId = ""; + + /** + * @generated from field: string method = 3; + */ + method = ""; + + /** + * @generated from field: string payload = 4; + */ + payload = ""; + + /** + * @generated from field: uint32 response_timeout_ms = 5; + */ + responseTimeoutMs = 0; + + /** + * @generated from field: uint32 version = 6; + */ + version = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.RpcRequestReceived"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 6, name: "version", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RpcRequestReceived { + return new RpcRequestReceived().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RpcRequestReceived { + return new RpcRequestReceived().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RpcRequestReceived { + return new RpcRequestReceived().fromJsonString(jsonString, options); + } + + static equals(a: RpcRequestReceived | PlainMessage | undefined, b: RpcRequestReceived | PlainMessage | undefined): boolean { + return proto3.util.equals(RpcRequestReceived, a, b); + } +} + +/** + * @generated from message livekit.proto.RpcResponseReceived + */ +export class RpcResponseReceived extends Message { + /** + * @generated from field: string request_id = 1; + */ + requestId = ""; + + /** + * @generated from field: string payload = 2; + */ + payload = ""; + + /** + * @generated from field: optional livekit.proto.RpcError error = 3; + */ + error?: RpcError; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.RpcResponseReceived"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "error", kind: "message", T: RpcError, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RpcResponseReceived { + return new RpcResponseReceived().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RpcResponseReceived { + return new RpcResponseReceived().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RpcResponseReceived { + return new RpcResponseReceived().fromJsonString(jsonString, options); + } + + static equals(a: RpcResponseReceived | PlainMessage | undefined, b: RpcResponseReceived | PlainMessage | undefined): boolean { + return proto3.util.equals(RpcResponseReceived, a, b); + } +} + +/** + * @generated from message livekit.proto.RpcAckReceived + */ +export class RpcAckReceived extends Message { + /** + * @generated from field: string request_id = 1; + */ + requestId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.RpcAckReceived"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RpcAckReceived { + return new RpcAckReceived().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RpcAckReceived { + return new RpcAckReceived().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RpcAckReceived { + return new RpcAckReceived().fromJsonString(jsonString, options); + } + + static equals(a: RpcAckReceived | PlainMessage | undefined, b: RpcAckReceived | PlainMessage | undefined): boolean { + return proto3.util.equals(RpcAckReceived, a, b); + } +} + /** * @generated from message livekit.proto.ConnectionStateChanged */ From ba4e8f324817311ba6863532f36f1ab77393f27b Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 4 Oct 2024 14:55:56 -0700 Subject: [PATCH 058/126] almost --- packages/livekit-rtc/generate_proto.sh | 3 +- packages/livekit-rtc/src/participant.ts | 153 +++++-- packages/livekit-rtc/src/proto/rpc_pb.ts | 509 +++++++++++++++++++++++ 3 files changed, 620 insertions(+), 45 deletions(-) create mode 100644 packages/livekit-rtc/src/proto/rpc_pb.ts diff --git a/packages/livekit-rtc/generate_proto.sh b/packages/livekit-rtc/generate_proto.sh index f30dea72..14b56df4 100755 --- a/packages/livekit-rtc/generate_proto.sh +++ b/packages/livekit-rtc/generate_proto.sh @@ -24,4 +24,5 @@ protoc \ $FFI_PROTOCOL/track.proto \ $FFI_PROTOCOL/video_frame.proto \ $FFI_PROTOCOL/e2ee.proto \ - $FFI_PROTOCOL/stats.proto + $FFI_PROTOCOL/stats.proto \ + $FFI_PROTOCOL/rpc.proto diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 5789cbbb..2413e089 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -33,6 +33,19 @@ import { SetLocalNameRequest, UnpublishTrackRequest, } from './proto/room_pb.js'; +import type { + PublishRpcAckCallback, + PublishRpcAckResponse, + PublishRpcRequestCallback, + PublishRpcRequestResponse, + PublishRpcResponseCallback, + PublishRpcResponseResponse, +} from './proto/rpc_pb.js'; +import { + PublishRpcAckRequest, + PublishRpcRequestRequest, + PublishRpcResponseRequest, +} from './proto/rpc_pb.js'; import { MAX_PAYLOAD_BYTES, RpcAck, RpcError, RpcRequest, RpcResponse, byteLength } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; @@ -154,6 +167,80 @@ export class LocalParticipant extends Participant { } } + async publishRpcRequest( + destinationIdentity: string, + requestId: string, + method: string, + payload: string, + responseTimeoutMs: number, + ) { + const req = new PublishRpcRequestRequest({ + localParticipantHandle: this.ffi_handle.handle, + destinationIdentity, + requestId, + method, + payload, + responseTimeoutMs, + }); + + const res = FfiClient.instance.request({ + message: { case: 'publishRpcRequest', value: req }, + }); + + const cb = await FfiClient.instance.waitFor((ev) => { + return ev.message.case == 'publishRpcRequest' && ev.message.value.asyncId == res.asyncId; + }); + + if (cb.error) { + throw new Error(cb.error); + } + } + async publishRpcResponse( + destinationIdentity: string, + requestId: string, + payload: string | null, + error: RpcError | null, + ) { + const req = new PublishRpcResponseRequest({ + localParticipantHandle: this.ffi_handle.handle, + destinationIdentity, + requestId, + value: error ? { case: 'error', value: error } : { case: 'payload', value: payload }, + }); + + const res = FfiClient.instance.request({ + message: { case: 'publishRpcResponse', value: req }, + }); + + const cb = await FfiClient.instance.waitFor((ev) => { + return ev.message.case == 'publishRpcResponse' && ev.message.value.asyncId == res.asyncId; + }); + + if (cb.error) { + throw new Error(cb.error); + } + } + + async publishRpcAck(destinationIdentity: string, requestId: string) { + const req = new PublishRpcAckRequest({ + localParticipantHandle: this.ffi_handle.handle, + destinationIdentity, + requestId, + }); + + const res = FfiClient.instance.request({ + message: { case: 'publishRpcAck', value: req }, + }); + + const cb = await FfiClient.instance.waitFor((ev) => { + return ev.message.case == 'publishRpcAck' && ev.message.value.asyncId == res.asyncId; + }); + + if (cb.error) { + throw new Error(cb.error); + } + } + async publishTranscription(transcription: Transcription) { const req = new PublishTranscriptionRequest({ localParticipantHandle: this.ffi_handle.handle, @@ -308,22 +395,13 @@ export class LocalParticipant extends Participant { } const id = crypto.randomUUID(); - - const request = new RpcRequest({ + this.publishRpcRequest( + recipientIdentity, id, method, payload, - responseTimeoutMs: responseTimeoutMs - maxRoundTripLatencyMs, - }); - - const jsonString = JSON.stringify(request); - // TODO: This implementation is only a prototype - // The final version will use a native DataPacket - this.publishData(new TextEncoder().encode(jsonString), { - reliable: true, - destination_identities: [recipientIdentity], - topic: 'lk-rpc-request', - }); + responseTimeoutMs - maxRoundTripLatencyMs, + ); const ackTimeoutId = setTimeout(() => { this.pendingAcks.delete(id); @@ -410,68 +488,55 @@ export class LocalParticipant extends Participant { /** @internal */ async handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { - // ACK the request - const ack = new RpcAck({ - requestId: request.id, - }); - const jsonString = JSON.stringify(ack); - this.publishData(new TextEncoder().encode(jsonString), { - reliable: true, - destination_identities: [sender.identity], - topic: 'lk-rpc-ack', - }); + this.publishRpcAck(sender.identity, request.id); const sendResponse = (response: RpcResponse) => { - const jsonString = JSON.stringify(response); - this.publishData(new TextEncoder().encode(jsonString), { - reliable: true, - destination_identities: [sender.identity], - topic: 'lk-rpc-response', - }); + this.publishRpcResponse(sender.identity, request.id, response.payload, response.error); }; const handler = this.rpcHandlers.get(request.method); if (!handler) { - const rpcResponse = new RpcResponse({ - requestId: request.id, - error: RpcError.builtIn('UNSUPPORTED_METHOD'), - }); - sendResponse(rpcResponse); + this.publishRpcResponse( + sender.identity, + request.id, + undefined, + RpcError.builtIn('UNSUPPORTED_METHOD'), + ); return; } - const rpcResponse = new RpcResponse({ - requestId: request.id, - }); + let error: RpcError | null = null; + let payload: string | null = null; + try { const response = await handler(request, sender); if (typeof response === 'string') { if (byteLength(response) > MAX_PAYLOAD_BYTES) { - rpcResponse.error = RpcError.builtIn('RESPONSE_PAYLOAD_TOO_LARGE'); + error = RpcError.builtIn('RESPONSE_PAYLOAD_TOO_LARGE'); console.warn(`RPC Response payload too large for ${request.method}`); } else { - rpcResponse.payload = response; + payload = response; } } else if (response instanceof RpcError) { - rpcResponse.error = response; + error = response; } else { console.warn(`unexpected handler response for ${request.method}: ${response}`); - rpcResponse.error = RpcError.builtIn('MALFORMED_RESPONSE'); + error = RpcError.builtIn('MALFORMED_RESPONSE'); } } catch (error) { if (error instanceof RpcError) { - rpcResponse.error = error; + error = error; } else { console.warn( `Uncaught error returned by RPC handler for ${request.method}. Returning UNCAUGHT_ERROR instead.`, error, ); - rpcResponse.error = RpcError.builtIn('UNCAUGHT_ERROR'); + error = RpcError.builtIn('UNCAUGHT_ERROR'); } } - sendResponse(rpcResponse); + this.publishRpcResponse(sender.identity, request.id, payload, error); } /** @internal */ diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts new file mode 100644 index 00000000..6f68f22c --- /dev/null +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -0,0 +1,509 @@ +// Copyright 2023 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file rpc.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"; + +/** + * Data types + * + * @generated from message livekit.proto.RpcError + */ +export class RpcError extends Message { + /** + * @generated from field: uint32 code = 1; + */ + code = 0; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + /** + * @generated from field: string data = 3; + */ + data = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.RpcError"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "data", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RpcError { + return new RpcError().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RpcError { + return new RpcError().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RpcError { + return new RpcError().fromJsonString(jsonString, options); + } + + static equals(a: RpcError | PlainMessage | undefined, b: RpcError | PlainMessage | undefined): boolean { + return proto3.util.equals(RpcError, a, b); + } +} + +/** + * FFI Requests + * + * @generated from message livekit.proto.PublishRpcRequestRequest + */ +export class PublishRpcRequestRequest extends Message { + /** + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: string destination_identity = 2; + */ + destinationIdentity = ""; + + /** + * @generated from field: string request_id = 3; + */ + requestId = ""; + + /** + * @generated from field: string method = 4; + */ + method = ""; + + /** + * @generated from field: string payload = 5; + */ + payload = ""; + + /** + * @generated from field: uint32 response_timeout_ms = 6; + */ + responseTimeoutMs = 0; + + /** + * @generated from field: uint32 version = 7; + */ + version = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishRpcRequestRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "destination_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 7, name: "version", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcRequestRequest { + return new PublishRpcRequestRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcRequestRequest { + return new PublishRpcRequestRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishRpcRequestRequest { + return new PublishRpcRequestRequest().fromJsonString(jsonString, options); + } + + static equals(a: PublishRpcRequestRequest | PlainMessage | undefined, b: PublishRpcRequestRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishRpcRequestRequest, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishRpcResponseRequest + */ +export class PublishRpcResponseRequest extends Message { + /** + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: string destination_identity = 2; + */ + destinationIdentity = ""; + + /** + * @generated from field: string request_id = 3; + */ + requestId = ""; + + /** + * @generated from oneof livekit.proto.PublishRpcResponseRequest.value + */ + value: { + /** + * @generated from field: string payload = 4; + */ + value: string; + case: "payload"; + } | { + /** + * @generated from field: livekit.proto.RpcError error = 5; + */ + value: RpcError; + case: "error"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishRpcResponseRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "destination_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "value" }, + { no: 5, name: "error", kind: "message", T: RpcError, oneof: "value" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcResponseRequest { + return new PublishRpcResponseRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcResponseRequest { + return new PublishRpcResponseRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishRpcResponseRequest { + return new PublishRpcResponseRequest().fromJsonString(jsonString, options); + } + + static equals(a: PublishRpcResponseRequest | PlainMessage | undefined, b: PublishRpcResponseRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishRpcResponseRequest, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishRpcAckRequest + */ +export class PublishRpcAckRequest extends Message { + /** + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: string destination_identity = 2; + */ + destinationIdentity = ""; + + /** + * @generated from field: string request_id = 3; + */ + requestId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishRpcAckRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "destination_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcAckRequest { + return new PublishRpcAckRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcAckRequest { + return new PublishRpcAckRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishRpcAckRequest { + return new PublishRpcAckRequest().fromJsonString(jsonString, options); + } + + static equals(a: PublishRpcAckRequest | PlainMessage | undefined, b: PublishRpcAckRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishRpcAckRequest, a, b); + } +} + +/** + * FFI Responses + * + * @generated from message livekit.proto.PublishRpcRequestResponse + */ +export class PublishRpcRequestResponse 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.PublishRpcRequestResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcRequestResponse { + return new PublishRpcRequestResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcRequestResponse { + return new PublishRpcRequestResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishRpcRequestResponse { + return new PublishRpcRequestResponse().fromJsonString(jsonString, options); + } + + static equals(a: PublishRpcRequestResponse | PlainMessage | undefined, b: PublishRpcRequestResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishRpcRequestResponse, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishRpcResponseResponse + */ +export class PublishRpcResponseResponse 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.PublishRpcResponseResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcResponseResponse { + return new PublishRpcResponseResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcResponseResponse { + return new PublishRpcResponseResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishRpcResponseResponse { + return new PublishRpcResponseResponse().fromJsonString(jsonString, options); + } + + static equals(a: PublishRpcResponseResponse | PlainMessage | undefined, b: PublishRpcResponseResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishRpcResponseResponse, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishRpcAckResponse + */ +export class PublishRpcAckResponse 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.PublishRpcAckResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcAckResponse { + return new PublishRpcAckResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcAckResponse { + return new PublishRpcAckResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishRpcAckResponse { + return new PublishRpcAckResponse().fromJsonString(jsonString, options); + } + + static equals(a: PublishRpcAckResponse | PlainMessage | undefined, b: PublishRpcAckResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishRpcAckResponse, a, b); + } +} + +/** + * FFI Callbacks + * + * @generated from message livekit.proto.PublishRpcRequestCallback + */ +export class PublishRpcRequestCallback extends Message { + /** + * @generated from field: uint64 async_id = 1; + */ + asyncId = protoInt64.zero; + + /** + * @generated from field: optional string error = 3; + */ + error?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.PublishRpcRequestCallback"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcRequestCallback { + return new PublishRpcRequestCallback().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcRequestCallback { + return new PublishRpcRequestCallback().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishRpcRequestCallback { + return new PublishRpcRequestCallback().fromJsonString(jsonString, options); + } + + static equals(a: PublishRpcRequestCallback | PlainMessage | undefined, b: PublishRpcRequestCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishRpcRequestCallback, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishRpcResponseCallback + */ +export class PublishRpcResponseCallback 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.PublishRpcResponseCallback"; + 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): PublishRpcResponseCallback { + return new PublishRpcResponseCallback().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcResponseCallback { + return new PublishRpcResponseCallback().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishRpcResponseCallback { + return new PublishRpcResponseCallback().fromJsonString(jsonString, options); + } + + static equals(a: PublishRpcResponseCallback | PlainMessage | undefined, b: PublishRpcResponseCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishRpcResponseCallback, a, b); + } +} + +/** + * @generated from message livekit.proto.PublishRpcAckCallback + */ +export class PublishRpcAckCallback 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.PublishRpcAckCallback"; + 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): PublishRpcAckCallback { + return new PublishRpcAckCallback().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcAckCallback { + return new PublishRpcAckCallback().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublishRpcAckCallback { + return new PublishRpcAckCallback().fromJsonString(jsonString, options); + } + + static equals(a: PublishRpcAckCallback | PlainMessage | undefined, b: PublishRpcAckCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(PublishRpcAckCallback, a, b); + } +} + From a99a6ebf11130e6a07361e7d3824ca1c6625bf25 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 4 Oct 2024 16:22:45 -0700 Subject: [PATCH 059/126] tests --- examples/rpc/README.md | 4 +- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.test.ts | 113 ++++++++----------- packages/livekit-rtc/src/participant.ts | 90 +++++++-------- packages/livekit-rtc/src/proto/room_pb.ts | 6 +- packages/livekit-rtc/src/room.ts | 45 +++----- packages/livekit-rtc/src/rpc.ts | 64 ++--------- 7 files changed, 116 insertions(+), 208 deletions(-) diff --git a/examples/rpc/README.md b/examples/rpc/README.md index 23bfdcd0..3545580c 100644 --- a/examples/rpc/README.md +++ b/examples/rpc/README.md @@ -18,7 +18,7 @@ Before running this example, make sure you have: 1. Install dependencies: ``` - npm install + pnpm install ``` 2. Create a `.env.local` file in the example directory with your LiveKit credentials: @@ -33,7 +33,7 @@ Before running this example, make sure you have: To run the example, use the following command: ``` -npm run start +pnpm run start ``` The example will log to your terminal. diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index e0da69a5..4d9a8995 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit e0da69a504b859254ed8af5f11984a378d105a72 +Subproject commit 4d9a89950f1190614f336f3a2cdb86de78d41c9a diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts index 023c9d35..48b97493 100644 --- a/packages/livekit-rtc/src/participant.test.ts +++ b/packages/livekit-rtc/src/participant.test.ts @@ -4,7 +4,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { LocalParticipant, RemoteParticipant } from './participant'; import { type OwnedParticipant, ParticipantKind } from './proto/participant_pb'; -import { RpcError, RpcRequest, RpcResponse } from './rpc'; +import { RpcError } from './rpc'; describe('LocalParticipant', () => { describe('registerRpcMethod', () => { @@ -32,12 +32,6 @@ describe('LocalParticipant', () => { localParticipant.registerRpcMethod(methodName, handler); - const mockRequest = new RpcRequest({ - id: 'test-request-id', - method: methodName, - payload: 'test payload', - responseTimeoutMs: 5000, - }); const mockSender = new RemoteParticipant({ info: { sid: 'remote-sid', @@ -50,16 +44,18 @@ describe('LocalParticipant', () => { handle: { id: BigInt('0x9876543210fedcba') }, } as unknown as OwnedParticipant); - localParticipant.publishData = vi.fn(); + localParticipant.publishRpcAck = vi.fn(); + localParticipant.publishRpcResponse = vi.fn(); // Call the internal method that would be triggered by an incoming RPC request - await localParticipant['handleIncomingRpcRequest'](mockRequest, mockSender); + await localParticipant['handleIncomingRpcRequest'](mockSender, 'test-request-id', methodName, 'test payload', 5000); // Verify that the handler was called with the correct arguments - expect(handler).toHaveBeenCalledWith(mockRequest, mockSender); + expect(handler).toHaveBeenCalledWith(mockSender, 'test-request-id', 'test payload', 5000); - // Verify that publishData was called to send the response - expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // Once for ACK, once for response + // Verify that publishRpcAck and publishRpcResponse were called + expect(localParticipant.publishRpcAck).toHaveBeenCalledTimes(1); + expect(localParticipant.publishRpcResponse).toHaveBeenCalledTimes(1); }); it('should catch and transform unhandled errors in the RPC method handler', async () => { @@ -69,12 +65,6 @@ describe('LocalParticipant', () => { localParticipant.registerRpcMethod(methodName, handler); - const mockRequest = new RpcRequest({ - id: 'test-error-request-id', - method: methodName, - payload: 'test payload', - responseTimeoutMs: 5000, - }); const mockSender = new RemoteParticipant({ info: { sid: 'remote-sid', @@ -87,18 +77,21 @@ describe('LocalParticipant', () => { handle: { id: BigInt('0xabcdef0123456789') }, } as unknown as OwnedParticipant); - const mockPublishData = vi.fn(); - localParticipant.publishData = mockPublishData; + const mockPublishAck = vi.fn(); + const mockPublishResponse = vi.fn(); + localParticipant.publishRpcAck = mockPublishAck; + localParticipant.publishRpcResponse = mockPublishResponse; - await localParticipant['handleIncomingRpcRequest'](mockRequest, mockSender); + await localParticipant['handleIncomingRpcRequest'](mockSender, 'test-error-request-id', methodName, 'test payload', 5000); - expect(handler).toHaveBeenCalledWith(mockRequest, mockSender); - expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // ACK and error response + expect(handler).toHaveBeenCalledWith(mockSender, 'test-error-request-id', 'test payload', 5000); + expect(mockPublishAck).toHaveBeenCalledTimes(1); + expect(mockPublishResponse).toHaveBeenCalledTimes(1); - // Verify that the error response contains the correct error name - const errorResponse = mockPublishData.mock.calls[1][0]; - const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); - expect(parsedResponse.error.code).toBe(RpcError.ErrorCode.UNCAUGHT_ERROR); + // Verify that the error response contains the correct error + const errorResponse = mockPublishResponse.mock.calls[0][3]; + expect(errorResponse).toBeInstanceOf(RpcError); + expect(errorResponse.code).toBe(RpcError.ErrorCode.UNCAUGHT_ERROR); }); it('should pass through RpcError thrown by the RPC method handler', async () => { @@ -109,12 +102,6 @@ describe('LocalParticipant', () => { localParticipant.registerRpcMethod(methodName, handler); - const mockRequest = new RpcRequest({ - id: 'test-rpc-error-request-id', - method: methodName, - payload: 'test payload', - responseTimeoutMs: 5000, - }); const mockSender = new RemoteParticipant({ info: { sid: 'remote-sid', @@ -127,27 +114,29 @@ describe('LocalParticipant', () => { handle: { id: BigInt('0xabcdef0123456789') }, } as unknown as OwnedParticipant); - const mockPublishData = vi.fn(); - localParticipant.publishData = mockPublishData; + const mockPublishAck = vi.fn(); + const mockPublishResponse = vi.fn(); + localParticipant.publishRpcAck = mockPublishAck; + localParticipant.publishRpcResponse = mockPublishResponse; - await localParticipant['handleIncomingRpcRequest'](mockRequest, mockSender); + await localParticipant['handleIncomingRpcRequest'](mockSender, 'test-rpc-error-request-id', methodName, 'test payload', 5000); - expect(handler).toHaveBeenCalledWith(mockRequest, mockSender); - expect(localParticipant.publishData).toHaveBeenCalledTimes(2); // ACK and error response + expect(handler).toHaveBeenCalledWith(mockSender, 'test-rpc-error-request-id', 'test payload', 5000); + expect(localParticipant.publishRpcAck).toHaveBeenCalledTimes(1); + expect(localParticipant.publishRpcResponse).toHaveBeenCalledTimes(1); // Verify that the error response contains the correct RpcError - const errorResponse = mockPublishData.mock.calls[1][0]; - const parsedResponse = JSON.parse(new TextDecoder().decode(errorResponse)); - expect(parsedResponse.error.code).toBe(errorCode); - expect(parsedResponse.error.message).toBe(errorMessage); + const errorResponse = mockPublishResponse.mock.calls[0][3]; + expect(errorResponse).toBeInstanceOf(RpcError); + expect(errorResponse.code).toBe(errorCode); + expect(errorResponse.message).toBe(errorMessage); }); }); describe('performRpcRequest', () => { let localParticipant: LocalParticipant; let mockRemoteParticipant: RemoteParticipant; - let mockPublishData: ReturnType; - + let mockPublishRequest: ReturnType; beforeEach(() => { localParticipant = new LocalParticipant({ info: { @@ -173,8 +162,8 @@ describe('LocalParticipant', () => { handle: { id: BigInt('0xabcdef0123456789') }, } as unknown as OwnedParticipant); - mockPublishData = vi.fn(); - localParticipant.publishData = mockPublishData; + mockPublishRequest = vi.fn(); + localParticipant.publishRpcRequest = mockPublishRequest; }); it('should send RPC request and receive successful response', async () => { @@ -182,15 +171,12 @@ describe('LocalParticipant', () => { const payload = 'testPayload'; const responsePayload = 'responsePayload'; - mockPublishData.mockImplementationOnce((data) => { - const request = JSON.parse(new TextDecoder().decode(data)); - // Simulate receiving a response + mockPublishRequest.mockImplementationOnce((_, requestId) => { setTimeout(() => { - const response = new RpcResponse({ - requestId: request.id, - payload: responsePayload, - }); - localParticipant['handleIncomingRpcResponse'](response); + localParticipant['handleIncomingRpcAck'](requestId); + setTimeout(() => { + localParticipant['handleIncomingRpcResponse'](requestId, responsePayload, null); + }, 10); }, 10); }); @@ -200,7 +186,7 @@ describe('LocalParticipant', () => { payload, ); - expect(mockPublishData).toHaveBeenCalledTimes(1); + expect(mockPublishRequest).toHaveBeenCalledTimes(1); expect(result).toBe(responsePayload); }); @@ -218,8 +204,8 @@ describe('LocalParticipant', () => { timeoutMs, ); - // Mock the publishData method to simulate a delay longer than the timeout - mockPublishData.mockImplementationOnce(() => { + // Mock the publishRpcRequest method to simulate a delay longer than the timeout + mockPublishRequest.mockImplementationOnce(() => { return new Promise((resolve) => { setTimeout(resolve, timeoutMs + 10); }); @@ -235,7 +221,7 @@ describe('LocalParticipant', () => { expect(elapsedTime).toBeGreaterThanOrEqual(timeoutMs); expect(elapsedTime).toBeLessThan(timeoutMs + 50); // Allow some margin for test execution - expect(localParticipant.publishData).toHaveBeenCalledTimes(1); + expect(localParticipant.publishRpcRequest).toHaveBeenCalledTimes(1); }); it('should handle RPC error response', async () => { @@ -244,15 +230,10 @@ describe('LocalParticipant', () => { const errorCode = 101; const errorMessage = 'Test error message'; - mockPublishData.mockImplementationOnce((data) => { - const request = JSON.parse(new TextDecoder().decode(data)); - // Simulate receiving an error response + mockPublishRequest.mockImplementationOnce((_, requestId) => { setTimeout(() => { - const response = new RpcResponse({ - requestId: request.id, - error: new RpcError(errorCode, errorMessage), - }); - localParticipant['handleIncomingRpcResponse'](response); + localParticipant['handleIncomingRpcAck'](requestId); + localParticipant['handleIncomingRpcResponse'](requestId, null, new RpcError(errorCode, errorMessage)); }, 10); }); diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 2413e089..cd847278 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -46,7 +46,7 @@ import { PublishRpcRequestRequest, PublishRpcResponseRequest, } from './proto/rpc_pb.js'; -import { MAX_PAYLOAD_BYTES, RpcAck, RpcError, RpcRequest, RpcResponse, byteLength } from './rpc.js'; +import { MAX_PAYLOAD_BYTES, RpcError, byteLength } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; @@ -110,18 +110,18 @@ export type DataPublishOptions = { export class LocalParticipant extends Participant { private rpcHandlers: Map< string, - (request: RpcRequest, sender: RemoteParticipant) => Promise + (sender: RemoteParticipant, requestId: string, payload: string, responseTimeoutMs: number) => Promise > = new Map(); trackPublications: Map = new Map(); private pendingAcks = new Map< string, - { resolve: (ack: RpcAck) => void; participantIdentity: string } + { resolve: () => void; participantIdentity: string } >(); private pendingResponses = new Map< string, - { resolve: (response: RpcResponse) => void; participantIdentity: string } + { resolve: (payload: string | null, error: RpcError | null) => void; participantIdentity: string } >(); async publishData(data: Uint8Array, options: DataPublishOptions) { @@ -205,7 +205,7 @@ export class LocalParticipant extends Participant { localParticipantHandle: this.ffi_handle.handle, destinationIdentity, requestId, - value: error ? { case: 'error', value: error } : { case: 'payload', value: payload }, + value: error ? { case: 'error', value: error.toProto() } : { case: 'payload', value: payload }, }); const res = FfiClient.instance.request({ @@ -385,7 +385,7 @@ export class LocalParticipant extends Participant { payload: string, connectionTimeoutMs: number = 5000, responseTimeoutMs: number = 10000, - ): Promise { + ): Promise { const maxRoundTripLatencyMs = 2000; return new Promise((resolve, reject) => { @@ -423,17 +423,17 @@ export class LocalParticipant extends Participant { }, responseTimeoutMs); this.pendingResponses.set(id, { - resolve: (response) => { + resolve: (payload, error) => { if (this.pendingAcks.has(id)) { console.error('RPC response received before ack', id); this.pendingAcks.delete(id); clearTimeout(ackTimeoutId); } clearTimeout(responseTimeoutId); - if (response.error) { - reject(response.error); + if (error) { + reject(error); } else { - resolve(response.payload); + resolve(payload ?? ''); } }, participantIdentity: recipientIdentity, @@ -450,7 +450,7 @@ export class LocalParticipant extends Participant { */ registerRpcMethod( method: string, - handler: (request: RpcRequest, sender: RemoteParticipant) => Promise, + handler: (sender: RemoteParticipant, requestId: string, payload: string, responseTimeoutMs: number) => Promise, ) { this.rpcHandlers.set(method, handler); } @@ -465,78 +465,73 @@ export class LocalParticipant extends Participant { } /** @internal */ - handleIncomingRpcAck(rpcAck: RpcAck) { - const handler = this.pendingAcks.get(rpcAck.requestId); + handleIncomingRpcAck(requestId: string) { + const handler = this.pendingAcks.get(requestId); if (handler) { - handler.resolve(rpcAck); - this.pendingAcks.delete(rpcAck.requestId); + handler.resolve(); + this.pendingAcks.delete(requestId); } else { - console.error('Ack received for unexpected RPC request', rpcAck.requestId); + console.error('Ack received for unexpected RPC request', requestId); } } /** @internal */ - handleIncomingRpcResponse(rpcResponse: RpcResponse) { - const handler = this.pendingResponses.get(rpcResponse.requestId); + handleIncomingRpcResponse(requestId: string, payload: string | null, error: RpcError | null) { + const handler = this.pendingResponses.get(requestId); if (handler) { - handler.resolve(rpcResponse); - this.pendingResponses.delete(rpcResponse.requestId); + handler.resolve(payload, error); + this.pendingResponses.delete(requestId); } else { - console.error('Response received for unexpected RPC request', rpcResponse.requestId); + console.error('Response received for unexpected RPC request', requestId); } } /** @internal */ - async handleIncomingRpcRequest(request: RpcRequest, sender: RemoteParticipant) { - this.publishRpcAck(sender.identity, request.id); + async handleIncomingRpcRequest(sender: RemoteParticipant, requestId: string, method: string, payload: string, responseTimeoutMs: number) { + this.publishRpcAck(sender.identity, requestId); - const sendResponse = (response: RpcResponse) => { - this.publishRpcResponse(sender.identity, request.id, response.payload, response.error); - }; - - const handler = this.rpcHandlers.get(request.method); + const handler = this.rpcHandlers.get(method); if (!handler) { this.publishRpcResponse( sender.identity, - request.id, - undefined, + requestId, + null, RpcError.builtIn('UNSUPPORTED_METHOD'), ); return; } - let error: RpcError | null = null; - let payload: string | null = null; + let responseError: RpcError | null = null; + let responsePayload: string | null = null; try { - const response = await handler(request, sender); + const response = await handler(sender, requestId, payload, responseTimeoutMs); if (typeof response === 'string') { if (byteLength(response) > MAX_PAYLOAD_BYTES) { - error = RpcError.builtIn('RESPONSE_PAYLOAD_TOO_LARGE'); - console.warn(`RPC Response payload too large for ${request.method}`); + responseError = RpcError.builtIn('RESPONSE_PAYLOAD_TOO_LARGE'); + console.warn(`RPC Response payload too large for ${method}`); } else { - payload = response; + responsePayload = response; } } else if (response instanceof RpcError) { - error = response; + responseError = response; } else { - console.warn(`unexpected handler response for ${request.method}: ${response}`); - error = RpcError.builtIn('MALFORMED_RESPONSE'); + console.warn(`unexpected handler response for ${method}: ${response}`); + responseError = RpcError.builtIn('MALFORMED_RESPONSE'); } } catch (error) { if (error instanceof RpcError) { - error = error; + responseError = error; } else { console.warn( - `Uncaught error returned by RPC handler for ${request.method}. Returning UNCAUGHT_ERROR instead.`, + `Uncaught error returned by RPC handler for ${method}. Returning UNCAUGHT_ERROR instead.`, error, ); - error = RpcError.builtIn('UNCAUGHT_ERROR'); + responseError = RpcError.builtIn('UNCAUGHT_ERROR'); } } - - this.publishRpcResponse(sender.identity, request.id, payload, error); + this.publishRpcResponse(sender.identity, requestId, responsePayload, responseError); } /** @internal */ @@ -549,12 +544,7 @@ export class LocalParticipant extends Participant { for (const [id, { participantIdentity: pendingIdentity, resolve }] of this.pendingResponses) { if (pendingIdentity === participantIdentity) { - resolve( - new RpcResponse({ - requestId: id, - error: RpcError.builtIn('RECIPIENT_DISCONNECTED'), - }), - ); + resolve(null, RpcError.builtIn('RECIPIENT_DISCONNECTED')); this.pendingResponses.delete(id); } } diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index 491f0693..10417bca 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -3700,9 +3700,9 @@ export class TranscriptionReceived extends Message { */ export class RpcRequestReceived extends Message { /** - * @generated from field: uint64 participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity = protoInt64.zero; + participantIdentity = ""; /** * @generated from field: string request_id = 2; @@ -3737,7 +3737,7 @@ export class RpcRequestReceived extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RpcRequestReceived"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 313703cd..0c0f7c4e 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -28,12 +28,11 @@ import { IceTransportType, } from './proto/room_pb.js'; import { TrackKind } from './proto/track_pb.js'; -import type { RpcAck, RpcRequest, RpcResponse } from './rpc.js'; -import { RpcError } from './rpc.js'; import type { LocalTrack, 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 { RpcError } from './rpc.js' export interface RtcConfiguration { iceTransportType: IceTransportType; @@ -276,42 +275,28 @@ export class Room extends (EventEmitter as new () => TypedEmitter Number(dataPacket.value.data.data.dataLen), ); new FfiHandle(dataPacket.value.data.handle.id).dispose(); - // TODO: This implementation is only a prototype - // The final version will use native DataPacket types instead of special topics - if (dataPacket.value.topic === 'lk-rpc-request') { - const request = JSON.parse(new TextDecoder().decode(buffer)) as RpcRequest; - this.localParticipant.handleIncomingRpcRequest(request, participant); - } else if (dataPacket.value.topic === 'lk-rpc-ack') { - const ack = JSON.parse(new TextDecoder().decode(buffer)) as RpcAck; - this.localParticipant.handleIncomingRpcAck(ack); - } else if (dataPacket.value.topic === 'lk-rpc-response') { - const response = JSON.parse(new TextDecoder().decode(buffer)) as RpcResponse; - if (response.error) { - response.error = new RpcError( - response.error.code, - response.error.message, - response.error.data, - ); - } - this.localParticipant.handleIncomingRpcResponse(response); - } else { - this.emit( - RoomEvent.DataReceived, - buffer, - participant, - ev.value.kind, - dataPacket.value.topic, - ); - } + 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 == 'rpcRequestReceived') { + const participant = this.remoteParticipants.get(ev.value.participantIdentity); + this.localParticipant.handleIncomingRpcRequest(participant, ev.value.requestId, ev.value.method, ev.value.payload, ev.value.responseTimeoutMs); + } else if (ev.case == 'rpcResponseReceived') { + this.localParticipant.handleIncomingRpcResponse(ev.value.requestId, ev.value.payload, RpcError.fromProto(ev.value.error)); + } else if (ev.case == 'rpcAckReceived') { + this.localParticipant.handleIncomingRpcAck(ev.value.requestId); } 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 diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index bc714d73..a8df7262 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -2,59 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -// TODO: This implementation is only a prototype -// The final version will use a protocol types where possible -export class RpcRequest { - id: string; - method: string; - payload: string; - responseTimeoutMs: number; - - constructor({ - method, - payload, - responseTimeoutMs, - id = crypto.randomUUID(), - }: { - method: string; - payload: string; - responseTimeoutMs: number; - id?: string; - }) { - this.id = id; - this.method = method; - this.payload = payload; - this.responseTimeoutMs = responseTimeoutMs; - } -} - -export class RpcAck { - requestId: string; - - constructor({ requestId }: { requestId: string }) { - this.requestId = requestId; - } -} - -export class RpcResponse { - requestId: string; - payload?: string; - error?: RpcError; - - constructor({ - requestId, - payload, - error, - }: { - requestId: string; - payload?: string; - error?: RpcError; - }) { - this.requestId = requestId; - this.payload = payload; - this.error = error; - } -} +import { RpcError as RpcError_Proto } from './proto/rpc_pb.js'; /** * Specialized error handling for RPC methods. @@ -86,12 +34,16 @@ export class RpcError extends Error { this.data = data ? truncateBytes(data, RpcError.MAX_DATA_BYTES) : undefined; } - toJSON() { - return { + static fromProto(proto: RpcError_Proto) { + return new RpcError(proto.code, proto.message, proto.data); + } + + toProto() { + return new RpcError_Proto({ code: this.code, message: this.message, data: this.data, - }; + }); } static ErrorCode = { From 564ba8511a1e52f3a75025f2d6a4e98102b97764 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 4 Oct 2024 16:39:35 -0700 Subject: [PATCH 060/126] rust --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 4d9a8995..78482488 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 4d9a89950f1190614f336f3a2cdb86de78d41c9a +Subproject commit 78482488a28a548468fe6a87de07bf7a0b4728ea From 506708a06307949ff87691e36d7934c04d7c1031 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 4 Oct 2024 16:52:25 -0700 Subject: [PATCH 061/126] proto --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/proto/room_pb.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 78482488..afe96cf3 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 78482488a28a548468fe6a87de07bf7a0b4728ea +Subproject commit afe96cf309fbfcff7d886b38f64b993b4e41c19c diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index 10417bca..c4e66bb6 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -3700,9 +3700,9 @@ export class TranscriptionReceived extends Message { */ export class RpcRequestReceived extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: optional string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** * @generated from field: string request_id = 2; @@ -3737,7 +3737,7 @@ export class RpcRequestReceived extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RpcRequestReceived"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 2, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, @@ -3772,9 +3772,9 @@ export class RpcResponseReceived extends Message { requestId = ""; /** - * @generated from field: string payload = 2; + * @generated from field: optional string payload = 2; */ - payload = ""; + payload?: string; /** * @generated from field: optional livekit.proto.RpcError error = 3; @@ -3790,7 +3790,7 @@ export class RpcResponseReceived extends Message { static readonly typeName = "livekit.proto.RpcResponseReceived"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 3, name: "error", kind: "message", T: RpcError, opt: true }, ]); From 0dd7e2db7162e3bbdd7532e834c9a58e9b70fdce Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 4 Oct 2024 16:53:18 -0700 Subject: [PATCH 062/126] fixes --- packages/livekit-rtc/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/src/index.ts b/packages/livekit-rtc/src/index.ts index 756144bf..5ea86b31 100644 --- a/packages/livekit-rtc/src/index.ts +++ b/packages/livekit-rtc/src/index.ts @@ -38,7 +38,7 @@ export { TrackPublishOptions, ConnectionState, } from './proto/room_pb.js'; -export { RpcRequest, RpcAck, RpcResponse, RpcError } from './rpc.js'; +export { RpcError } from './rpc.js'; export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js'; export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js'; export { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js'; From 96613395a5106448d2aac330ea44fda378977d86 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 4 Oct 2024 16:57:56 -0700 Subject: [PATCH 063/126] Fixing example code --- examples/rpc/index.ts | 12 ++++++------ packages/livekit-rtc/src/participant.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 58dfa0c1..34e896d7 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,5 +1,5 @@ import { Room, RpcError } from '@livekit/rtc-node'; -import type { RemoteParticipant, RpcRequest } from '@livekit/rtc-node'; +import type { RemoteParticipant } from '@livekit/rtc-node'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; import { AccessToken } from 'livekit-server-sdk'; @@ -57,8 +57,8 @@ async function main() { const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room): Promise => { greetersRoom.localParticipant?.registerRpcMethod( 'arrival', - async (request: RpcRequest, sender: RemoteParticipant) => { - console.log(`[Greeter] Oh ${sender.identity} arrived and said "${request.payload}"`); + async (sender: RemoteParticipant, requestId: string, payload: string, responseTimeoutMs: number) => { + console.log(`[Greeter] Oh ${sender.identity} arrived and said "${payload}"`); await new Promise((resolve) => setTimeout(resolve, 2000)); return "Welcome and have a wonderful day!"; }, @@ -66,11 +66,11 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) mathGeniusRoom.localParticipant?.registerRpcMethod( 'square-root', - async (request: RpcRequest, sender: RemoteParticipant) => { - const jsonData = JSON.parse(request.payload); + async (sender: RemoteParticipant, requestId: string, payload: string, responseTimeoutMs: number) => { + const jsonData = JSON.parse(payload); const number = jsonData.number; console.log( - `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I've only got ${request.responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, + `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I've only got ${responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, ); console.log(`[Math Genius] *doing math*…`); diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index cd847278..216ea798 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -385,7 +385,7 @@ export class LocalParticipant extends Participant { payload: string, connectionTimeoutMs: number = 5000, responseTimeoutMs: number = 10000, - ): Promise { + ): Promise { const maxRoundTripLatencyMs = 2000; return new Promise((resolve, reject) => { From 1a33b02a1bcc5ce272d7ab8de9d274ee9530d7dd Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 4 Oct 2024 17:02:15 -0700 Subject: [PATCH 064/126] It works --- packages/livekit-rtc/src/room.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 0c0f7c4e..a812d98d 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -294,7 +294,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter const participant = this.remoteParticipants.get(ev.value.participantIdentity); this.localParticipant.handleIncomingRpcRequest(participant, ev.value.requestId, ev.value.method, ev.value.payload, ev.value.responseTimeoutMs); } else if (ev.case == 'rpcResponseReceived') { - this.localParticipant.handleIncomingRpcResponse(ev.value.requestId, ev.value.payload, RpcError.fromProto(ev.value.error)); + this.localParticipant.handleIncomingRpcResponse(ev.value.requestId, ev.value.payload, ev.value.error ? RpcError.fromProto(ev.value.error) : null); } else if (ev.case == 'rpcAckReceived') { this.localParticipant.handleIncomingRpcAck(ev.value.requestId); } else if (ev.case == 'e2eeStateChanged') { From 2d4b7e6f9069808e4de8f5475065cf18b1618eae Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 14:50:52 -0700 Subject: [PATCH 065/126] amost --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 251 +++-------- packages/livekit-rtc/src/proto/ffi_pb.ts | 135 +++--- packages/livekit-rtc/src/proto/room_pb.ts | 179 +------- packages/livekit-rtc/src/proto/rpc_pb.ts | 481 ++++++++++++++-------- packages/livekit-rtc/src/room.ts | 26 +- 6 files changed, 472 insertions(+), 602 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index afe96cf3..b1e4ef48 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit afe96cf309fbfcff7d886b38f64b993b4e41c19c +Subproject commit b1e4ef48a59e1a478a713df562a380e5a8019348 diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 216ea798..054832ef 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -34,17 +34,17 @@ import { UnpublishTrackRequest, } from './proto/room_pb.js'; import type { - PublishRpcAckCallback, - PublishRpcAckResponse, - PublishRpcRequestCallback, - PublishRpcRequestResponse, - PublishRpcResponseCallback, - PublishRpcResponseResponse, + PerformRpcRequestResponse, + PerformRpcRequestCallback, + RegisterRpcMethodResponse, + RegisterRpcMethodCallback, + UnregisterRpcMethodResponse, + UnregisterRpcMethodCallback, } from './proto/rpc_pb.js'; import { - PublishRpcAckRequest, - PublishRpcRequestRequest, - PublishRpcResponseRequest, + PerformRpcRequestRequest, + RegisterRpcMethodRequest, + UnregisterRpcMethodRequest, } from './proto/rpc_pb.js'; import { MAX_PAYLOAD_BYTES, RpcError, byteLength } from './rpc.js'; import type { LocalTrack } from './track.js'; @@ -167,80 +167,6 @@ export class LocalParticipant extends Participant { } } - async publishRpcRequest( - destinationIdentity: string, - requestId: string, - method: string, - payload: string, - responseTimeoutMs: number, - ) { - const req = new PublishRpcRequestRequest({ - localParticipantHandle: this.ffi_handle.handle, - destinationIdentity, - requestId, - method, - payload, - responseTimeoutMs, - }); - - const res = FfiClient.instance.request({ - message: { case: 'publishRpcRequest', value: req }, - }); - - const cb = await FfiClient.instance.waitFor((ev) => { - return ev.message.case == 'publishRpcRequest' && ev.message.value.asyncId == res.asyncId; - }); - - if (cb.error) { - throw new Error(cb.error); - } - } - async publishRpcResponse( - destinationIdentity: string, - requestId: string, - payload: string | null, - error: RpcError | null, - ) { - const req = new PublishRpcResponseRequest({ - localParticipantHandle: this.ffi_handle.handle, - destinationIdentity, - requestId, - value: error ? { case: 'error', value: error.toProto() } : { case: 'payload', value: payload }, - }); - - const res = FfiClient.instance.request({ - message: { case: 'publishRpcResponse', value: req }, - }); - - const cb = await FfiClient.instance.waitFor((ev) => { - return ev.message.case == 'publishRpcResponse' && ev.message.value.asyncId == res.asyncId; - }); - - if (cb.error) { - throw new Error(cb.error); - } - } - - async publishRpcAck(destinationIdentity: string, requestId: string) { - const req = new PublishRpcAckRequest({ - localParticipantHandle: this.ffi_handle.handle, - destinationIdentity, - requestId, - }); - - const res = FfiClient.instance.request({ - message: { case: 'publishRpcAck', value: req }, - }); - - const cb = await FfiClient.instance.waitFor((ev) => { - return ev.message.case == 'publishRpcAck' && ev.message.value.asyncId == res.asyncId; - }); - - if (cb.error) { - throw new Error(cb.error); - } - } - async publishTranscription(transcription: Transcription) { const req = new PublishTranscriptionRequest({ localParticipantHandle: this.ffi_handle.handle, @@ -371,74 +297,40 @@ export class LocalParticipant extends Participant { /** * Initiate an RPC request to a remote participant. - * @param recipientIdentity - The `identity` of the destination participant + * @param destinationIdentity - The `identity` of the destination participant * @param method - The method name to call * @param payload - The method payload - * @param connectionTimeoutMs - Timeout for establishing initial connection * @param responseTimeoutMs - Timeout for receiving a response after initial connection * @returns A promise that resolves with the response payload or rejects with an error. * @throws Error on failure. Details in `message`. */ - performRpcRequest( - recipientIdentity: string, + async performRpcRequest( + destinationIdentity: string, method: string, payload: string, - connectionTimeoutMs: number = 5000, responseTimeoutMs: number = 10000, ): Promise { - const maxRoundTripLatencyMs = 2000; + const req = new PerformRpcRequestRequest({ + localParticipantHandle: this.ffi_handle.handle, + destinationIdentity, + method, + payload, + responseTimeoutMs, + }); - return new Promise((resolve, reject) => { - if (byteLength(payload) > MAX_PAYLOAD_BYTES) { - reject(RpcError.builtIn('REQUEST_PAYLOAD_TOO_LARGE')); - return; - } + const res = FfiClient.instance.request({ + message: { case: 'performRpcRequest', value: req }, + }); - const id = crypto.randomUUID(); - this.publishRpcRequest( - recipientIdentity, - id, - method, - payload, - responseTimeoutMs - maxRoundTripLatencyMs, - ); - - const ackTimeoutId = setTimeout(() => { - this.pendingAcks.delete(id); - reject(RpcError.builtIn('CONNECTION_TIMEOUT')); - this.pendingResponses.delete(id); - clearTimeout(responseTimeoutId); - }, connectionTimeoutMs); - - this.pendingAcks.set(id, { - resolve: () => { - clearTimeout(ackTimeoutId); - }, - participantIdentity: recipientIdentity, - }); - - const responseTimeoutId = setTimeout(() => { - this.pendingResponses.delete(id); - reject(RpcError.builtIn('RESPONSE_TIMEOUT')); - }, responseTimeoutMs); - - this.pendingResponses.set(id, { - resolve: (payload, error) => { - if (this.pendingAcks.has(id)) { - console.error('RPC response received before ack', id); - this.pendingAcks.delete(id); - clearTimeout(ackTimeoutId); - } - clearTimeout(responseTimeoutId); - if (error) { - reject(error); - } else { - resolve(payload ?? ''); - } - }, - participantIdentity: recipientIdentity, - }); + const cb = await FfiClient.instance.waitFor((ev) => { + return ev.message.case === 'performRpcRequest' && ev.message.value.asyncId === res.asyncId; }); + + if (cb.error) { + throw RpcError.fromProto(cb.error); + } + + return cb.payload; } /** @@ -448,11 +340,24 @@ export class LocalParticipant extends Participant { * @param method - The name of the indicated RPC method * @param callback - Will be called when an RPC request for this method is received, with the request and the sender. Respond with a string. */ - registerRpcMethod( + async registerRpcMethod( method: string, handler: (sender: RemoteParticipant, requestId: string, payload: string, responseTimeoutMs: number) => Promise, - ) { + ): Promise { this.rpcHandlers.set(method, handler); + + const req = new RegisterRpcMethodRequest({ + localParticipantHandle: this.ffi_handle.handle, + method, + }); + + const res = FfiClient.instance.request({ + message: { case: 'registerRpcMethod', value: req }, + }); + + await FfiClient.instance.waitFor((ev) => { + return ev.message.case === 'registerRpcMethod' && ev.message.value.asyncId === res.asyncId; + }); } /** @@ -460,53 +365,36 @@ export class LocalParticipant extends Participant { * * @param method - The name of the RPC method to unregister */ - unregisterRpcMethod(method: string) { + async unregisterRpcMethod(method: string): Promise { this.rpcHandlers.delete(method); - } - /** @internal */ - handleIncomingRpcAck(requestId: string) { - const handler = this.pendingAcks.get(requestId); - if (handler) { - handler.resolve(); - this.pendingAcks.delete(requestId); - } else { - console.error('Ack received for unexpected RPC request', requestId); - } - } + const req = new UnregisterRpcMethodRequest({ + localParticipantHandle: this.ffi_handle.handle, + method, + }); - /** @internal */ - handleIncomingRpcResponse(requestId: string, payload: string | null, error: RpcError | null) { - const handler = this.pendingResponses.get(requestId); - if (handler) { - handler.resolve(payload, error); - this.pendingResponses.delete(requestId); - } else { - console.error('Response received for unexpected RPC request', requestId); - } + const res = FfiClient.instance.request({ + message: { case: 'unregisterRpcMethod', value: req }, + }); + + await FfiClient.instance.waitFor((ev) => { + return ev.message.case === 'unregisterRpcMethod' && ev.message.value.asyncId === res.asyncId; + }); } /** @internal */ - async handleIncomingRpcRequest(sender: RemoteParticipant, requestId: string, method: string, payload: string, responseTimeoutMs: number) { - this.publishRpcAck(sender.identity, requestId); - + async handleIncomingRpcMethodInvocation(invocationId: bigint, method: string, requestId: string, sender: RemoteParticipant, payload: string, timeoutMs: number): Promise { const handler = this.rpcHandlers.get(method); if (!handler) { - this.publishRpcResponse( - sender.identity, - requestId, - null, - RpcError.builtIn('UNSUPPORTED_METHOD'), - ); - return; + throw RpcError.builtIn('UNSUPPORTED_METHOD'); } let responseError: RpcError | null = null; let responsePayload: string | null = null; - + try { - const response = await handler(sender, requestId, payload, responseTimeoutMs); + const response = await handler(sender, requestId, payload, timeoutMs); if (typeof response === 'string') { if (byteLength(response) > MAX_PAYLOAD_BYTES) { responseError = RpcError.builtIn('RESPONSE_PAYLOAD_TOO_LARGE'); @@ -531,23 +419,12 @@ export class LocalParticipant extends Participant { responseError = RpcError.builtIn('UNCAUGHT_ERROR'); } } - this.publishRpcResponse(sender.identity, requestId, responsePayload, responseError); - } - /** @internal */ - handleParticipantDisconnected(participantIdentity: string) { - for (const [id, { participantIdentity: pendingIdentity }] of this.pendingAcks) { - if (pendingIdentity === participantIdentity) { - this.pendingAcks.delete(id); - } + if (responseError) { + throw responseError; } - for (const [id, { participantIdentity: pendingIdentity, resolve }] of this.pendingResponses) { - if (pendingIdentity === participantIdentity) { - resolve(null, RpcError.builtIn('RECIPIENT_DISCONNECTED')); - this.pendingResponses.delete(id); - } - } + return responsePayload; } } diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index 36519cb0..71de7c29 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -20,11 +20,11 @@ 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, 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 { PublishRpcAckCallback, PublishRpcAckRequest, PublishRpcAckResponse, PublishRpcRequestCallback, PublishRpcRequestRequest, PublishRpcRequestResponse, PublishRpcResponseCallback, PublishRpcResponseRequest, PublishRpcResponseResponse } from "./rpc_pb.js"; import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, EnableRemoteTrackRequest, EnableRemoteTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, LocalTrackMuteRequest, LocalTrackMuteResponse, TrackEvent } from "./track_pb.js"; import { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb.js"; import { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb.js"; import { E2eeRequest, E2eeResponse } from "./e2ee_pb.js"; +import { PerformRpcRequestCallback, PerformRpcRequestRequest, PerformRpcRequestResponse, RegisterRpcMethodCallback, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb.js"; /** * @generated from enum livekit.proto.LogLevel @@ -154,24 +154,6 @@ export class FfiRequest extends Message { */ value: PublishSipDtmfRequest; case: "publishSipDtmf"; - } | { - /** - * @generated from field: livekit.proto.PublishRpcRequestRequest publish_rpc_request = 36; - */ - value: PublishRpcRequestRequest; - case: "publishRpcRequest"; - } | { - /** - * @generated from field: livekit.proto.PublishRpcResponseRequest publish_rpc_response = 37; - */ - value: PublishRpcResponseRequest; - case: "publishRpcResponse"; - } | { - /** - * @generated from field: livekit.proto.PublishRpcAckRequest publish_rpc_ack = 38; - */ - value: PublishRpcAckRequest; - case: "publishRpcAck"; } | { /** * Track @@ -304,6 +286,32 @@ export class FfiRequest extends Message { */ value: FlushSoxResamplerRequest; case: "flushSoxResampler"; + } | { + /** + * RPC + * + * @generated from field: livekit.proto.PerformRpcRequestRequest perform_rpc_request = 36; + */ + value: PerformRpcRequestRequest; + case: "performRpcRequest"; + } | { + /** + * @generated from field: livekit.proto.RegisterRpcMethodRequest register_rpc_method = 37; + */ + value: RegisterRpcMethodRequest; + case: "registerRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.UnregisterRpcMethodRequest unregister_rpc_method = 38; + */ + value: UnregisterRpcMethodRequest; + case: "unregisterRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.RpcMethodInvocationResponseRequest rpc_method_invocation_response = 39; + */ + value: RpcMethodInvocationResponseRequest; + case: "rpcMethodInvocationResponse"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -327,9 +335,6 @@ export class FfiRequest extends 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: 36, name: "publish_rpc_request", kind: "message", T: PublishRpcRequestRequest, oneof: "message" }, - { no: 37, name: "publish_rpc_response", kind: "message", T: PublishRpcResponseRequest, oneof: "message" }, - { no: 38, name: "publish_rpc_ack", kind: "message", T: PublishRpcAckRequest, 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: "local_track_mute", kind: "message", T: LocalTrackMuteRequest, oneof: "message" }, @@ -351,6 +356,10 @@ export class FfiRequest extends Message { { no: 33, name: "new_sox_resampler", kind: "message", T: NewSoxResamplerRequest, oneof: "message" }, { no: 34, name: "push_sox_resampler", kind: "message", T: PushSoxResamplerRequest, oneof: "message" }, { no: 35, name: "flush_sox_resampler", kind: "message", T: FlushSoxResamplerRequest, oneof: "message" }, + { no: 36, name: "perform_rpc_request", kind: "message", T: PerformRpcRequestRequest, oneof: "message" }, + { no: 37, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodRequest, oneof: "message" }, + { no: 38, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodRequest, oneof: "message" }, + { no: 39, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseRequest, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiRequest { @@ -459,24 +468,6 @@ export class FfiResponse extends Message { */ value: PublishSipDtmfResponse; case: "publishSipDtmf"; - } | { - /** - * @generated from field: livekit.proto.PublishRpcRequestResponse publish_rpc_request = 36; - */ - value: PublishRpcRequestResponse; - case: "publishRpcRequest"; - } | { - /** - * @generated from field: livekit.proto.PublishRpcResponseResponse publish_rpc_response = 37; - */ - value: PublishRpcResponseResponse; - case: "publishRpcResponse"; - } | { - /** - * @generated from field: livekit.proto.PublishRpcAckResponse publish_rpc_ack = 38; - */ - value: PublishRpcAckResponse; - case: "publishRpcAck"; } | { /** * Track @@ -609,6 +600,32 @@ export class FfiResponse extends Message { */ value: FlushSoxResamplerResponse; case: "flushSoxResampler"; + } | { + /** + * RPC + * + * @generated from field: livekit.proto.PerformRpcRequestResponse perform_rpc_request = 36; + */ + value: PerformRpcRequestResponse; + case: "performRpcRequest"; + } | { + /** + * @generated from field: livekit.proto.RegisterRpcMethodResponse register_rpc_method = 37; + */ + value: RegisterRpcMethodResponse; + case: "registerRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.UnregisterRpcMethodResponse unregister_rpc_method = 38; + */ + value: UnregisterRpcMethodResponse; + case: "unregisterRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.RpcMethodInvocationResponseResponse rpc_method_invocation_response = 39; + */ + value: RpcMethodInvocationResponseResponse; + case: "rpcMethodInvocationResponse"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -632,9 +649,6 @@ export class FfiResponse extends 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: 36, name: "publish_rpc_request", kind: "message", T: PublishRpcRequestResponse, oneof: "message" }, - { no: 37, name: "publish_rpc_response", kind: "message", T: PublishRpcResponseResponse, oneof: "message" }, - { no: 38, name: "publish_rpc_ack", kind: "message", T: PublishRpcAckResponse, 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: "local_track_mute", kind: "message", T: LocalTrackMuteResponse, oneof: "message" }, @@ -656,6 +670,10 @@ export class FfiResponse extends Message { { no: 33, name: "new_sox_resampler", kind: "message", T: NewSoxResamplerResponse, oneof: "message" }, { no: 34, name: "push_sox_resampler", kind: "message", T: PushSoxResamplerResponse, oneof: "message" }, { no: 35, name: "flush_sox_resampler", kind: "message", T: FlushSoxResamplerResponse, oneof: "message" }, + { no: 36, name: "perform_rpc_request", kind: "message", T: PerformRpcRequestResponse, oneof: "message" }, + { no: 37, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodResponse, oneof: "message" }, + { no: 38, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodResponse, oneof: "message" }, + { no: 39, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseResponse, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiResponse { @@ -808,22 +826,28 @@ export class FfiEvent extends Message { case: "publishSipDtmf"; } | { /** - * @generated from field: livekit.proto.PublishRpcRequestCallback publish_rpc_request = 22; + * @generated from field: livekit.proto.PerformRpcRequestCallback perform_rpc_request = 22; + */ + value: PerformRpcRequestCallback; + case: "performRpcRequest"; + } | { + /** + * @generated from field: livekit.proto.RegisterRpcMethodCallback register_rpc_method = 23; */ - value: PublishRpcRequestCallback; - case: "publishRpcRequest"; + value: RegisterRpcMethodCallback; + case: "registerRpcMethod"; } | { /** - * @generated from field: livekit.proto.PublishRpcResponseCallback publish_rpc_response = 23; + * @generated from field: livekit.proto.UnregisterRpcMethodCallback unregister_rpc_method = 24; */ - value: PublishRpcResponseCallback; - case: "publishRpcResponse"; + value: UnregisterRpcMethodCallback; + case: "unregisterRpcMethod"; } | { /** - * @generated from field: livekit.proto.PublishRpcAckCallback publish_rpc_ack = 24; + * @generated from field: livekit.proto.RpcMethodInvocationEvent rpc_method_invocation = 25; */ - value: PublishRpcAckCallback; - case: "publishRpcAck"; + value: RpcMethodInvocationEvent; + case: "rpcMethodInvocation"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -854,9 +878,10 @@ export class FfiEvent extends 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" }, - { no: 22, name: "publish_rpc_request", kind: "message", T: PublishRpcRequestCallback, oneof: "message" }, - { no: 23, name: "publish_rpc_response", kind: "message", T: PublishRpcResponseCallback, oneof: "message" }, - { no: 24, name: "publish_rpc_ack", kind: "message", T: PublishRpcAckCallback, oneof: "message" }, + { no: 22, name: "perform_rpc_request", kind: "message", T: PerformRpcRequestCallback, oneof: "message" }, + { no: 23, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodCallback, oneof: "message" }, + { no: 24, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodCallback, oneof: "message" }, + { no: 25, name: "rpc_method_invocation", kind: "message", T: RpcMethodInvocationEvent, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiEvent { diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index c4e66bb6..62b05a26 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -25,7 +25,6 @@ import { RtcStats } from "./stats_pb.js"; import { VideoCodec } from "./video_frame_pb.js"; import { E2eeOptions, EncryptionState } from "./e2ee_pb.js"; import { FfiOwnedHandle } from "./handle_pb.js"; -import { RpcError } from "./rpc_pb.js"; /** * @generated from enum livekit.proto.IceTransportType @@ -2488,28 +2487,14 @@ export class RoomEvent extends Message { case: "dataPacketReceived"; } | { /** + * RpcRequestReceived rpc_request_received = 29; + * RpcResponseReceived rpc_response_received = 30; + * RpcAckReceived rpc_ack_received = 31; + * * @generated from field: livekit.proto.TranscriptionReceived transcription_received = 28; */ value: TranscriptionReceived; case: "transcriptionReceived"; - } | { - /** - * @generated from field: livekit.proto.RpcRequestReceived rpc_request_received = 29; - */ - value: RpcRequestReceived; - case: "rpcRequestReceived"; - } | { - /** - * @generated from field: livekit.proto.RpcResponseReceived rpc_response_received = 30; - */ - value: RpcResponseReceived; - case: "rpcResponseReceived"; - } | { - /** - * @generated from field: livekit.proto.RpcAckReceived rpc_ack_received = 31; - */ - value: RpcAckReceived; - case: "rpcAckReceived"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -2548,9 +2533,6 @@ export class RoomEvent extends Message { { no: 26, name: "eos", kind: "message", T: RoomEOS, oneof: "message" }, { no: 27, name: "data_packet_received", kind: "message", T: DataPacketReceived, oneof: "message" }, { no: 28, name: "transcription_received", kind: "message", T: TranscriptionReceived, oneof: "message" }, - { no: 29, name: "rpc_request_received", kind: "message", T: RpcRequestReceived, oneof: "message" }, - { no: 30, name: "rpc_response_received", kind: "message", T: RpcResponseReceived, oneof: "message" }, - { no: 31, name: "rpc_ack_received", kind: "message", T: RpcAckReceived, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomEvent { @@ -3695,159 +3677,6 @@ export class TranscriptionReceived extends Message { } } -/** - * @generated from message livekit.proto.RpcRequestReceived - */ -export class RpcRequestReceived extends Message { - /** - * @generated from field: optional string participant_identity = 1; - */ - participantIdentity?: string; - - /** - * @generated from field: string request_id = 2; - */ - requestId = ""; - - /** - * @generated from field: string method = 3; - */ - method = ""; - - /** - * @generated from field: string payload = 4; - */ - payload = ""; - - /** - * @generated from field: uint32 response_timeout_ms = 5; - */ - responseTimeoutMs = 0; - - /** - * @generated from field: uint32 version = 6; - */ - version = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RpcRequestReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 2, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 6, name: "version", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RpcRequestReceived { - return new RpcRequestReceived().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RpcRequestReceived { - return new RpcRequestReceived().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RpcRequestReceived { - return new RpcRequestReceived().fromJsonString(jsonString, options); - } - - static equals(a: RpcRequestReceived | PlainMessage | undefined, b: RpcRequestReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(RpcRequestReceived, a, b); - } -} - -/** - * @generated from message livekit.proto.RpcResponseReceived - */ -export class RpcResponseReceived extends Message { - /** - * @generated from field: string request_id = 1; - */ - requestId = ""; - - /** - * @generated from field: optional string payload = 2; - */ - payload?: string; - - /** - * @generated from field: optional livekit.proto.RpcError error = 3; - */ - error?: RpcError; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RpcResponseReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 3, name: "error", kind: "message", T: RpcError, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RpcResponseReceived { - return new RpcResponseReceived().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RpcResponseReceived { - return new RpcResponseReceived().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RpcResponseReceived { - return new RpcResponseReceived().fromJsonString(jsonString, options); - } - - static equals(a: RpcResponseReceived | PlainMessage | undefined, b: RpcResponseReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(RpcResponseReceived, a, b); - } -} - -/** - * @generated from message livekit.proto.RpcAckReceived - */ -export class RpcAckReceived extends Message { - /** - * @generated from field: string request_id = 1; - */ - requestId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RpcAckReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RpcAckReceived { - return new RpcAckReceived().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RpcAckReceived { - return new RpcAckReceived().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RpcAckReceived { - return new RpcAckReceived().fromJsonString(jsonString, options); - } - - static equals(a: RpcAckReceived | PlainMessage | undefined, b: RpcAckReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(RpcAckReceived, a, b); - } -} - /** * @generated from message livekit.proto.ConnectionStateChanged */ diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index 6f68f22c..df31e758 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -21,8 +21,6 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialM import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; /** - * Data types - * * @generated from message livekit.proto.RpcError */ export class RpcError extends Message { @@ -74,9 +72,9 @@ export class RpcError extends Message { /** * FFI Requests * - * @generated from message livekit.proto.PublishRpcRequestRequest + * @generated from message livekit.proto.PerformRpcRequestRequest */ -export class PublishRpcRequestRequest extends Message { +export class PerformRpcRequestRequest extends Message { /** * @generated from field: uint64 local_participant_handle = 1; */ @@ -88,422 +86,565 @@ export class PublishRpcRequestRequest extends Message destinationIdentity = ""; /** - * @generated from field: string request_id = 3; - */ - requestId = ""; - - /** - * @generated from field: string method = 4; + * @generated from field: string method = 3; */ method = ""; /** - * @generated from field: string payload = 5; + * @generated from field: string payload = 4; */ payload = ""; /** - * @generated from field: uint32 response_timeout_ms = 6; + * @generated from field: uint32 response_timeout_ms = 5; */ responseTimeoutMs = 0; - /** - * @generated from field: uint32 version = 7; - */ - version = 0; - - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PublishRpcRequestRequest"; + static readonly typeName = "livekit.proto.PerformRpcRequestRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "destination_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 7, name: "version", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcRequestRequest { - return new PublishRpcRequestRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcRequestRequest { + return new PerformRpcRequestRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcRequestRequest { - return new PublishRpcRequestRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcRequestRequest { + return new PerformRpcRequestRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PublishRpcRequestRequest { - return new PublishRpcRequestRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): PerformRpcRequestRequest { + return new PerformRpcRequestRequest().fromJsonString(jsonString, options); } - static equals(a: PublishRpcRequestRequest | PlainMessage | undefined, b: PublishRpcRequestRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishRpcRequestRequest, a, b); + static equals(a: PerformRpcRequestRequest | PlainMessage | undefined, b: PerformRpcRequestRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PerformRpcRequestRequest, a, b); } } /** - * @generated from message livekit.proto.PublishRpcResponseRequest + * @generated from message livekit.proto.RegisterRpcMethodRequest */ -export class PublishRpcResponseRequest extends Message { +export class RegisterRpcMethodRequest extends Message { /** * @generated from field: uint64 local_participant_handle = 1; */ localParticipantHandle = protoInt64.zero; /** - * @generated from field: string destination_identity = 2; + * @generated from field: string method = 2; */ - destinationIdentity = ""; + method = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.RegisterRpcMethodRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegisterRpcMethodRequest { + return new RegisterRpcMethodRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegisterRpcMethodRequest { + return new RegisterRpcMethodRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RegisterRpcMethodRequest { + return new RegisterRpcMethodRequest().fromJsonString(jsonString, options); + } + + static equals(a: RegisterRpcMethodRequest | PlainMessage | undefined, b: RegisterRpcMethodRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RegisterRpcMethodRequest, a, b); + } +} + +/** + * @generated from message livekit.proto.UnregisterRpcMethodRequest + */ +export class UnregisterRpcMethodRequest extends Message { /** - * @generated from field: string request_id = 3; + * @generated from field: uint64 local_participant_handle = 1; */ - requestId = ""; + localParticipantHandle = protoInt64.zero; /** - * @generated from oneof livekit.proto.PublishRpcResponseRequest.value + * @generated from field: string method = 2; */ - value: { - /** - * @generated from field: string payload = 4; - */ - value: string; - case: "payload"; - } | { - /** - * @generated from field: livekit.proto.RpcError error = 5; - */ - value: RpcError; - case: "error"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { + method = ""; + + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PublishRpcResponseRequest"; + static readonly typeName = "livekit.proto.UnregisterRpcMethodRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "destination_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "value" }, - { no: 5, name: "error", kind: "message", T: RpcError, oneof: "value" }, + { no: 2, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcResponseRequest { - return new PublishRpcResponseRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): UnregisterRpcMethodRequest { + return new UnregisterRpcMethodRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcResponseRequest { - return new PublishRpcResponseRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): UnregisterRpcMethodRequest { + return new UnregisterRpcMethodRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PublishRpcResponseRequest { - return new PublishRpcResponseRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): UnregisterRpcMethodRequest { + return new UnregisterRpcMethodRequest().fromJsonString(jsonString, options); } - static equals(a: PublishRpcResponseRequest | PlainMessage | undefined, b: PublishRpcResponseRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishRpcResponseRequest, a, b); + static equals(a: UnregisterRpcMethodRequest | PlainMessage | undefined, b: UnregisterRpcMethodRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UnregisterRpcMethodRequest, a, b); } } /** - * @generated from message livekit.proto.PublishRpcAckRequest + * @generated from message livekit.proto.RpcMethodInvocationResponseRequest */ -export class PublishRpcAckRequest extends Message { +export class RpcMethodInvocationResponseRequest extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: uint64 invocation_id = 1; */ - localParticipantHandle = protoInt64.zero; + invocationId = protoInt64.zero; /** - * @generated from field: string destination_identity = 2; + * @generated from field: optional string payload = 2; */ - destinationIdentity = ""; + payload?: string; /** - * @generated from field: string request_id = 3; + * @generated from field: optional livekit.proto.RpcError error = 3; */ - requestId = ""; + error?: RpcError; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PublishRpcAckRequest"; + static readonly typeName = "livekit.proto.RpcMethodInvocationResponseRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "destination_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "invocation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 3, name: "error", kind: "message", T: RpcError, opt: true }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcAckRequest { - return new PublishRpcAckRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationResponseRequest { + return new RpcMethodInvocationResponseRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcAckRequest { - return new PublishRpcAckRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): RpcMethodInvocationResponseRequest { + return new RpcMethodInvocationResponseRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PublishRpcAckRequest { - return new PublishRpcAckRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): RpcMethodInvocationResponseRequest { + return new RpcMethodInvocationResponseRequest().fromJsonString(jsonString, options); } - static equals(a: PublishRpcAckRequest | PlainMessage | undefined, b: PublishRpcAckRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishRpcAckRequest, a, b); + static equals(a: RpcMethodInvocationResponseRequest | PlainMessage | undefined, b: RpcMethodInvocationResponseRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RpcMethodInvocationResponseRequest, a, b); } } /** * FFI Responses * - * @generated from message livekit.proto.PublishRpcRequestResponse + * @generated from message livekit.proto.PerformRpcRequestResponse + */ +export class PerformRpcRequestResponse 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.PerformRpcRequestResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcRequestResponse { + return new PerformRpcRequestResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcRequestResponse { + return new PerformRpcRequestResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PerformRpcRequestResponse { + return new PerformRpcRequestResponse().fromJsonString(jsonString, options); + } + + static equals(a: PerformRpcRequestResponse | PlainMessage | undefined, b: PerformRpcRequestResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PerformRpcRequestResponse, a, b); + } +} + +/** + * @generated from message livekit.proto.RegisterRpcMethodResponse */ -export class PublishRpcRequestResponse extends Message { +export class RegisterRpcMethodResponse 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.PublishRpcRequestResponse"; + static readonly typeName = "livekit.proto.RegisterRpcMethodResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcRequestResponse { - return new PublishRpcRequestResponse().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): RegisterRpcMethodResponse { + return new RegisterRpcMethodResponse().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcRequestResponse { - return new PublishRpcRequestResponse().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): RegisterRpcMethodResponse { + return new RegisterRpcMethodResponse().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PublishRpcRequestResponse { - return new PublishRpcRequestResponse().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): RegisterRpcMethodResponse { + return new RegisterRpcMethodResponse().fromJsonString(jsonString, options); } - static equals(a: PublishRpcRequestResponse | PlainMessage | undefined, b: PublishRpcRequestResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishRpcRequestResponse, a, b); + static equals(a: RegisterRpcMethodResponse | PlainMessage | undefined, b: RegisterRpcMethodResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RegisterRpcMethodResponse, a, b); } } /** - * @generated from message livekit.proto.PublishRpcResponseResponse + * @generated from message livekit.proto.UnregisterRpcMethodResponse */ -export class PublishRpcResponseResponse extends Message { +export class UnregisterRpcMethodResponse 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.PublishRpcResponseResponse"; + static readonly typeName = "livekit.proto.UnregisterRpcMethodResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcResponseResponse { - return new PublishRpcResponseResponse().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): UnregisterRpcMethodResponse { + return new UnregisterRpcMethodResponse().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcResponseResponse { - return new PublishRpcResponseResponse().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): UnregisterRpcMethodResponse { + return new UnregisterRpcMethodResponse().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PublishRpcResponseResponse { - return new PublishRpcResponseResponse().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): UnregisterRpcMethodResponse { + return new UnregisterRpcMethodResponse().fromJsonString(jsonString, options); } - static equals(a: PublishRpcResponseResponse | PlainMessage | undefined, b: PublishRpcResponseResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishRpcResponseResponse, a, b); + static equals(a: UnregisterRpcMethodResponse | PlainMessage | undefined, b: UnregisterRpcMethodResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UnregisterRpcMethodResponse, a, b); } } /** - * @generated from message livekit.proto.PublishRpcAckResponse + * @generated from message livekit.proto.RpcMethodInvocationResponseResponse */ -export class PublishRpcAckResponse extends Message { +export class RpcMethodInvocationResponseResponse 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.PublishRpcAckResponse"; + static readonly typeName = "livekit.proto.RpcMethodInvocationResponseResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcAckResponse { - return new PublishRpcAckResponse().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationResponseResponse { + return new RpcMethodInvocationResponseResponse().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcAckResponse { - return new PublishRpcAckResponse().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): RpcMethodInvocationResponseResponse { + return new RpcMethodInvocationResponseResponse().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PublishRpcAckResponse { - return new PublishRpcAckResponse().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): RpcMethodInvocationResponseResponse { + return new RpcMethodInvocationResponseResponse().fromJsonString(jsonString, options); } - static equals(a: PublishRpcAckResponse | PlainMessage | undefined, b: PublishRpcAckResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishRpcAckResponse, a, b); + static equals(a: RpcMethodInvocationResponseResponse | PlainMessage | undefined, b: RpcMethodInvocationResponseResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RpcMethodInvocationResponseResponse, a, b); } } /** * FFI Callbacks * - * @generated from message livekit.proto.PublishRpcRequestCallback + * @generated from message livekit.proto.PerformRpcRequestCallback */ -export class PublishRpcRequestCallback extends Message { +export class PerformRpcRequestCallback extends Message { /** * @generated from field: uint64 async_id = 1; */ asyncId = protoInt64.zero; /** - * @generated from field: optional string error = 3; + * @generated from field: optional string payload = 2; + */ + payload?: string; + + /** + * @generated from field: optional livekit.proto.RpcError error = 3; */ - error?: string; + error?: RpcError; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PublishRpcRequestCallback"; + static readonly typeName = "livekit.proto.PerformRpcRequestCallback"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 3, name: "error", kind: "message", T: RpcError, opt: true }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcRequestCallback { - return new PublishRpcRequestCallback().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcRequestCallback { + return new PerformRpcRequestCallback().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcRequestCallback { - return new PublishRpcRequestCallback().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcRequestCallback { + return new PerformRpcRequestCallback().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PublishRpcRequestCallback { - return new PublishRpcRequestCallback().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): PerformRpcRequestCallback { + return new PerformRpcRequestCallback().fromJsonString(jsonString, options); } - static equals(a: PublishRpcRequestCallback | PlainMessage | undefined, b: PublishRpcRequestCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishRpcRequestCallback, a, b); + static equals(a: PerformRpcRequestCallback | PlainMessage | undefined, b: PerformRpcRequestCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(PerformRpcRequestCallback, a, b); } } /** - * @generated from message livekit.proto.PublishRpcResponseCallback + * @generated from message livekit.proto.RegisterRpcMethodCallback */ -export class PublishRpcResponseCallback extends Message { +export class RegisterRpcMethodCallback 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.RegisterRpcMethodCallback"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegisterRpcMethodCallback { + return new RegisterRpcMethodCallback().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegisterRpcMethodCallback { + return new RegisterRpcMethodCallback().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RegisterRpcMethodCallback { + return new RegisterRpcMethodCallback().fromJsonString(jsonString, options); + } + + static equals(a: RegisterRpcMethodCallback | PlainMessage | undefined, b: RegisterRpcMethodCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(RegisterRpcMethodCallback, a, b); + } +} + +/** + * @generated from message livekit.proto.UnregisterRpcMethodCallback + */ +export class UnregisterRpcMethodCallback extends Message { /** - * @generated from field: optional string error = 2; + * @generated from field: uint64 async_id = 1; */ - error?: string; + 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.PublishRpcResponseCallback"; + static readonly typeName = "livekit.proto.UnregisterRpcMethodCallback"; 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): PublishRpcResponseCallback { - return new PublishRpcResponseCallback().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): UnregisterRpcMethodCallback { + return new UnregisterRpcMethodCallback().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcResponseCallback { - return new PublishRpcResponseCallback().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): UnregisterRpcMethodCallback { + return new UnregisterRpcMethodCallback().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PublishRpcResponseCallback { - return new PublishRpcResponseCallback().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): UnregisterRpcMethodCallback { + return new UnregisterRpcMethodCallback().fromJsonString(jsonString, options); } - static equals(a: PublishRpcResponseCallback | PlainMessage | undefined, b: PublishRpcResponseCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishRpcResponseCallback, a, b); + static equals(a: UnregisterRpcMethodCallback | PlainMessage | undefined, b: UnregisterRpcMethodCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(UnregisterRpcMethodCallback, a, b); } } /** - * @generated from message livekit.proto.PublishRpcAckCallback + * @generated from message livekit.proto.RpcMethodInvocationResponseCallback */ -export class PublishRpcAckCallback extends Message { +export class RpcMethodInvocationResponseCallback 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.RpcMethodInvocationResponseCallback"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationResponseCallback { + return new RpcMethodInvocationResponseCallback().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RpcMethodInvocationResponseCallback { + return new RpcMethodInvocationResponseCallback().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RpcMethodInvocationResponseCallback { + return new RpcMethodInvocationResponseCallback().fromJsonString(jsonString, options); + } + + static equals(a: RpcMethodInvocationResponseCallback | PlainMessage | undefined, b: RpcMethodInvocationResponseCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(RpcMethodInvocationResponseCallback, a, b); + } +} + +/** + * FFI Events + * + * @generated from message livekit.proto.RpcMethodInvocationEvent + */ +export class RpcMethodInvocationEvent extends Message { + /** + * @generated from field: uint64 invocation_id = 1; + */ + invocationId = protoInt64.zero; + + /** + * @generated from field: string method = 2; + */ + method = ""; + + /** + * @generated from field: string request_id = 3; + */ + requestId = ""; + + /** + * @generated from field: string participant_identity = 4; + */ + participantIdentity = ""; + /** - * @generated from field: optional string error = 2; + * @generated from field: string payload = 5; */ - error?: string; + payload = ""; - constructor(data?: PartialMessage) { + /** + * @generated from field: uint32 timeout_ms = 6; + */ + timeoutMs = 0; + + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PublishRpcAckCallback"; + static readonly typeName = "livekit.proto.RpcMethodInvocationEvent"; 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 }, + { no: 1, name: "invocation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PublishRpcAckCallback { - return new PublishRpcAckCallback().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationEvent { + return new RpcMethodInvocationEvent().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PublishRpcAckCallback { - return new PublishRpcAckCallback().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): RpcMethodInvocationEvent { + return new RpcMethodInvocationEvent().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PublishRpcAckCallback { - return new PublishRpcAckCallback().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): RpcMethodInvocationEvent { + return new RpcMethodInvocationEvent().fromJsonString(jsonString, options); } - static equals(a: PublishRpcAckCallback | PlainMessage | undefined, b: PublishRpcAckCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishRpcAckCallback, a, b); + static equals(a: RpcMethodInvocationEvent | PlainMessage | undefined, b: RpcMethodInvocationEvent | PlainMessage | undefined): boolean { + return proto3.util.equals(RpcMethodInvocationEvent, a, b); } } diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index a812d98d..81f57221 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -32,7 +32,6 @@ import type { LocalTrack, 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 { RpcError } from './rpc.js' export interface RtcConfiguration { iceTransportType: IceTransportType; @@ -164,7 +163,18 @@ export class Room extends (EventEmitter as new () => TypedEmitter } private onFfiEvent = (ffiEvent: FfiEvent) => { - if ( + if (ffiEvent.message.case == 'rpcMethodInvocation') { + const sender = this.remoteParticipants.get(ffiEvent.message.value.participantIdentity); + this.localParticipant.handleIncomingRpcMethodInvocation( + ffiEvent.message.value.invocationId, + ffiEvent.message.value.method, + ffiEvent.message.value.requestId, + sender, + ffiEvent.message.value.payload, + ffiEvent.message.value.timeoutMs, + ); + return; + } else if ( ffiEvent.message.case != 'roomEvent' || ffiEvent.message.value.roomHandle != this.ffiHandle.handle ) { @@ -180,7 +190,6 @@ export class Room extends (EventEmitter as new () => TypedEmitter const participant = this.remoteParticipants.get(ev.value.participantIdentity); this.remoteParticipants.delete(participant.identity); this.emit(RoomEvent.ParticipantDisconnected, participant); - this.localParticipant.handleParticipantDisconnected(participant.identity); } else if (ev.case == 'localTrackPublished') { const publication = this.localParticipant.trackPublications.get(ev.value.trackSid); this.emit(RoomEvent.LocalTrackPublished, publication, this.localParticipant); @@ -290,13 +299,6 @@ export class Room extends (EventEmitter as new () => TypedEmitter default: break; } - } else if (ev.case == 'rpcRequestReceived') { - const participant = this.remoteParticipants.get(ev.value.participantIdentity); - this.localParticipant.handleIncomingRpcRequest(participant, ev.value.requestId, ev.value.method, ev.value.payload, ev.value.responseTimeoutMs); - } else if (ev.case == 'rpcResponseReceived') { - this.localParticipant.handleIncomingRpcResponse(ev.value.requestId, ev.value.payload, ev.value.error ? RpcError.fromProto(ev.value.error) : null); - } else if (ev.case == 'rpcAckReceived') { - this.localParticipant.handleIncomingRpcAck(ev.value.requestId); } 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 @@ -333,10 +335,6 @@ export class Room extends (EventEmitter as new () => TypedEmitter this.remoteParticipants.set(ownedInfo.info.identity, participant); return participant; } - - private handleParticipantDisconnected(participant: RemoteParticipant) { - this.localParticipant.handleParticipantDisconnected(participant.identity); - } } export class ConnectError extends Error { From 092ff983347bfe7081877c23a10d95ad2759ca1e Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 15:04:30 -0700 Subject: [PATCH 066/126] wip --- examples/rpc/index.ts | 8 ++++---- packages/livekit-rtc/src/participant.ts | 10 ++++++---- packages/livekit-rtc/src/room.ts | 3 +-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 34e896d7..7cd7ddbe 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -55,18 +55,18 @@ async function main() { } const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room): Promise => { - greetersRoom.localParticipant?.registerRpcMethod( + await greetersRoom.localParticipant?.registerRpcMethod( 'arrival', - async (sender: RemoteParticipant, requestId: string, payload: string, responseTimeoutMs: number) => { + async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { console.log(`[Greeter] Oh ${sender.identity} arrived and said "${payload}"`); await new Promise((resolve) => setTimeout(resolve, 2000)); return "Welcome and have a wonderful day!"; }, ); - mathGeniusRoom.localParticipant?.registerRpcMethod( + await mathGeniusRoom.localParticipant?.registerRpcMethod( 'square-root', - async (sender: RemoteParticipant, requestId: string, payload: string, responseTimeoutMs: number) => { + async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { const jsonData = JSON.parse(payload); const number = jsonData.number; console.log( diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 054832ef..e5c0ef16 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -110,7 +110,7 @@ export type DataPublishOptions = { export class LocalParticipant extends Participant { private rpcHandlers: Map< string, - (sender: RemoteParticipant, requestId: string, payload: string, responseTimeoutMs: number) => Promise + (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => Promise > = new Map(); trackPublications: Map = new Map(); @@ -342,7 +342,7 @@ export class LocalParticipant extends Participant { */ async registerRpcMethod( method: string, - handler: (sender: RemoteParticipant, requestId: string, payload: string, responseTimeoutMs: number) => Promise, + handler: (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => Promise, ): Promise { this.rpcHandlers.set(method, handler); @@ -383,10 +383,12 @@ export class LocalParticipant extends Participant { } /** @internal */ - async handleIncomingRpcMethodInvocation(invocationId: bigint, method: string, requestId: string, sender: RemoteParticipant, payload: string, timeoutMs: number): Promise { + async handleRpcMethodInvocation(method: string, requestId: string, sender: RemoteParticipant, payload: string, timeoutMs: number): Promise { + console.warn(`Handling RPC method invocation for ${method}`); const handler = this.rpcHandlers.get(method); if (!handler) { + console.warn(`No handler for RPC method ${method}`); throw RpcError.builtIn('UNSUPPORTED_METHOD'); } @@ -394,7 +396,7 @@ export class LocalParticipant extends Participant { let responsePayload: string | null = null; try { - const response = await handler(sender, requestId, payload, timeoutMs); + const response = await handler(requestId, sender, payload, timeoutMs); if (typeof response === 'string') { if (byteLength(response) > MAX_PAYLOAD_BYTES) { responseError = RpcError.builtIn('RESPONSE_PAYLOAD_TOO_LARGE'); diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 81f57221..80f30293 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -165,8 +165,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter private onFfiEvent = (ffiEvent: FfiEvent) => { if (ffiEvent.message.case == 'rpcMethodInvocation') { const sender = this.remoteParticipants.get(ffiEvent.message.value.participantIdentity); - this.localParticipant.handleIncomingRpcMethodInvocation( - ffiEvent.message.value.invocationId, + this.localParticipant.handleRpcMethodInvocation( ffiEvent.message.value.method, ffiEvent.message.value.requestId, sender, From 5248bd28f1250a092c777168989984c91ce22e17 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 15:19:13 -0700 Subject: [PATCH 067/126] update --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/proto/room_pb.ts | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index b1e4ef48..6d41c9b5 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit b1e4ef48a59e1a478a713df562a380e5a8019348 +Subproject commit 6d41c9b57cf2d9621d0d2ea16f975db8f6bee16c diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index 62b05a26..fefc54b7 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -2487,10 +2487,6 @@ export class RoomEvent extends Message { case: "dataPacketReceived"; } | { /** - * RpcRequestReceived rpc_request_received = 29; - * RpcResponseReceived rpc_response_received = 30; - * RpcAckReceived rpc_ack_received = 31; - * * @generated from field: livekit.proto.TranscriptionReceived transcription_received = 28; */ value: TranscriptionReceived; From 0b4affe58570a69a29a3b4ef907546c7d5a1d571 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 15:33:39 -0700 Subject: [PATCH 068/126] rst --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 6d41c9b5..d0e60049 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 6d41c9b57cf2d9621d0d2ea16f975db8f6bee16c +Subproject commit d0e60049c4d3051069e6952c65d2f3100d617205 From 3009afe8f9b03e9d480f33971de7f3a9103160fc Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 15:44:16 -0700 Subject: [PATCH 069/126] logging --- examples/rpc/index.ts | 6 ++++++ packages/livekit-rtc/src/participant.ts | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 7cd7ddbe..49b6a008 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -58,15 +58,19 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await greetersRoom.localParticipant?.registerRpcMethod( 'arrival', async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + console.warn('running arrival'); console.log(`[Greeter] Oh ${sender.identity} arrived and said "${payload}"`); await new Promise((resolve) => setTimeout(resolve, 2000)); return "Welcome and have a wonderful day!"; }, ); + console.warn('registered arrival'); + await mathGeniusRoom.localParticipant?.registerRpcMethod( 'square-root', async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + console.warn('running square-root'); const jsonData = JSON.parse(payload); const number = jsonData.number; console.log( @@ -81,6 +85,8 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) return JSON.stringify({ result }); }, ); + + console.warn('registered square-root'); }; const performGreeting = async (room: Room): Promise => { diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index e5c0ef16..67d5a5d3 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -310,6 +310,7 @@ export class LocalParticipant extends Participant { payload: string, responseTimeoutMs: number = 10000, ): Promise { + console.warn(`Performing RPC request to ${destinationIdentity} for method ${method} from ${this.identity}`); const req = new PerformRpcRequestRequest({ localParticipantHandle: this.ffi_handle.handle, destinationIdentity, @@ -384,11 +385,11 @@ export class LocalParticipant extends Participant { /** @internal */ async handleRpcMethodInvocation(method: string, requestId: string, sender: RemoteParticipant, payload: string, timeoutMs: number): Promise { - console.warn(`Handling RPC method invocation for ${method}`); + console.warn(`Handling RPC method invocation for ${method} from ${sender.identity} requestId: ${requestId} self: ${this.identity}`); const handler = this.rpcHandlers.get(method); if (!handler) { - console.warn(`No handler for RPC method ${method}`); + console.warn(`No handler for RPC method ${method} from ${sender.identity} requestId: ${requestId} self: ${this.identity}`); throw RpcError.builtIn('UNSUPPORTED_METHOD'); } From bcb80a1bb17af8df4f59bc4fd4130dc2b89fa62f Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 17:16:21 -0700 Subject: [PATCH 070/126] fixes --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/proto/rpc_pb.ts | 36 ++++++++++++++---------- packages/livekit-rtc/src/room.ts | 18 ++++++------ 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index d0e60049..e9e6c2df 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit d0e60049c4d3051069e6952c65d2f3100d617205 +Subproject commit e9e6c2df81e08dd0d27fb07b25e57c0cb53a6119 diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index df31e758..2eaad14f 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -96,9 +96,9 @@ export class PerformRpcRequestRequest extends Message payload = ""; /** - * @generated from field: uint32 response_timeout_ms = 5; + * @generated from field: optional uint32 response_timeout_ms = 5; */ - responseTimeoutMs = 0; + responseTimeoutMs?: number; constructor(data?: PartialMessage) { super(); @@ -112,7 +112,7 @@ export class PerformRpcRequestRequest extends Message { no: 2, name: "destination_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 5, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcRequestRequest { @@ -586,32 +586,37 @@ export class RpcMethodInvocationResponseCallback extends Message { /** - * @generated from field: uint64 invocation_id = 1; + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: uint64 invocation_id = 2; */ invocationId = protoInt64.zero; /** - * @generated from field: string method = 2; + * @generated from field: string method = 3; */ method = ""; /** - * @generated from field: string request_id = 3; + * @generated from field: string request_id = 4; */ requestId = ""; /** - * @generated from field: string participant_identity = 4; + * @generated from field: string participant_identity = 5; */ participantIdentity = ""; /** - * @generated from field: string payload = 5; + * @generated from field: string payload = 6; */ payload = ""; /** - * @generated from field: uint32 timeout_ms = 6; + * @generated from field: uint32 timeout_ms = 7; */ timeoutMs = 0; @@ -623,12 +628,13 @@ export class RpcMethodInvocationEvent extends Message static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RpcMethodInvocationEvent"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "invocation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "invocation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationEvent { diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 80f30293..9af14107 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -164,14 +164,16 @@ export class Room extends (EventEmitter as new () => TypedEmitter private onFfiEvent = (ffiEvent: FfiEvent) => { if (ffiEvent.message.case == 'rpcMethodInvocation') { - const sender = this.remoteParticipants.get(ffiEvent.message.value.participantIdentity); - this.localParticipant.handleRpcMethodInvocation( - ffiEvent.message.value.method, - ffiEvent.message.value.requestId, - sender, - ffiEvent.message.value.payload, - ffiEvent.message.value.timeoutMs, - ); + if (ffiEvent.message.value.localParticipantHandle == this.localParticipant.ffi_handle.handle) { + const sender = this.remoteParticipants.get(ffiEvent.message.value.participantIdentity); + this.localParticipant.handleRpcMethodInvocation( + ffiEvent.message.value.method, + ffiEvent.message.value.requestId, + sender, + ffiEvent.message.value.payload, + ffiEvent.message.value.timeoutMs, + ); + } return; } else if ( ffiEvent.message.case != 'roomEvent' || From 928808abdae1481572fe5ecce4b65503d07fbd15 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 17:29:19 -0700 Subject: [PATCH 071/126] fixes --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index e9e6c2df..8d8e55a9 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit e9e6c2df81e08dd0d27fb07b25e57c0cb53a6119 +Subproject commit 8d8e55a95b2e625700e16c1ac76e35fc9497ba94 From 6c85ff439e23e5725939cb29443757aa458e4e6f Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 17:46:30 -0700 Subject: [PATCH 072/126] it works --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 68 +++++++++++++++++++----- packages/livekit-rtc/src/proto/ffi_pb.ts | 9 +++- packages/livekit-rtc/src/proto/rpc_pb.ts | 18 ++++--- packages/livekit-rtc/src/room.ts | 1 + 5 files changed, 76 insertions(+), 22 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 8d8e55a9..e8131e0e 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 8d8e55a95b2e625700e16c1ac76e35fc9497ba94 +Subproject commit e8131e0e1e2893a24f7f8da756ff38924a8feb39 diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 67d5a5d3..03f2eb8c 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -34,17 +34,20 @@ import { UnpublishTrackRequest, } from './proto/room_pb.js'; import type { - PerformRpcRequestResponse, PerformRpcRequestCallback, - RegisterRpcMethodResponse, + PerformRpcRequestResponse, RegisterRpcMethodCallback, - UnregisterRpcMethodResponse, + RegisterRpcMethodResponse, UnregisterRpcMethodCallback, + UnregisterRpcMethodResponse, + RpcMethodInvocationResponseResponse, + RpcMethodInvocationResponseCallback, } from './proto/rpc_pb.js'; import { PerformRpcRequestRequest, RegisterRpcMethodRequest, UnregisterRpcMethodRequest, + RpcMethodInvocationResponseRequest, } from './proto/rpc_pb.js'; import { MAX_PAYLOAD_BYTES, RpcError, byteLength } from './rpc.js'; import type { LocalTrack } from './track.js'; @@ -110,18 +113,23 @@ export type DataPublishOptions = { export class LocalParticipant extends Participant { private rpcHandlers: Map< string, - (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => Promise + ( + requestId: string, + sender: RemoteParticipant, + payload: string, + responseTimeoutMs: number, + ) => Promise > = new Map(); trackPublications: Map = new Map(); - private pendingAcks = new Map< - string, - { resolve: () => void; participantIdentity: string } - >(); + private pendingAcks = new Map void; participantIdentity: string }>(); private pendingResponses = new Map< string, - { resolve: (payload: string | null, error: RpcError | null) => void; participantIdentity: string } + { + resolve: (payload: string | null, error: RpcError | null) => void; + participantIdentity: string; + } >(); async publishData(data: Uint8Array, options: DataPublishOptions) { @@ -310,7 +318,9 @@ export class LocalParticipant extends Participant { payload: string, responseTimeoutMs: number = 10000, ): Promise { - console.warn(`Performing RPC request to ${destinationIdentity} for method ${method} from ${this.identity}`); + console.warn( + `Performing RPC request to ${destinationIdentity} for method ${method} from ${this.identity}`, + ); const req = new PerformRpcRequestRequest({ localParticipantHandle: this.ffi_handle.handle, destinationIdentity, @@ -343,7 +353,12 @@ export class LocalParticipant extends Participant { */ async registerRpcMethod( method: string, - handler: (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => Promise, + handler: ( + requestId: string, + sender: RemoteParticipant, + payload: string, + responseTimeoutMs: number, + ) => Promise, ): Promise { this.rpcHandlers.set(method, handler); @@ -384,12 +399,23 @@ export class LocalParticipant extends Participant { } /** @internal */ - async handleRpcMethodInvocation(method: string, requestId: string, sender: RemoteParticipant, payload: string, timeoutMs: number): Promise { - console.warn(`Handling RPC method invocation for ${method} from ${sender.identity} requestId: ${requestId} self: ${this.identity}`); + async handleRpcMethodInvocation( + invocationId: bigint, + method: string, + requestId: string, + sender: RemoteParticipant, + payload: string, + timeoutMs: number, + ) { + console.warn( + `Handling RPC method invocation for ${method} from ${sender.identity} requestId: ${requestId} self: ${this.identity}`, + ); const handler = this.rpcHandlers.get(method); if (!handler) { - console.warn(`No handler for RPC method ${method} from ${sender.identity} requestId: ${requestId} self: ${this.identity}`); + console.warn( + `No handler for RPC method ${method} from ${sender.identity} requestId: ${requestId} self: ${this.identity}`, + ); throw RpcError.builtIn('UNSUPPORTED_METHOD'); } @@ -423,6 +449,20 @@ export class LocalParticipant extends Participant { } } + const req = new RpcMethodInvocationResponseRequest({ + invocationId, + error: responseError ? responseError.toProto() : undefined, + payload: responsePayload ?? undefined, + }); + + const res = FfiClient.instance.request({ + message: { case: 'rpcMethodInvocationResponse', value: req }, + }); + + const cb = await FfiClient.instance.waitFor((ev) => { + return ev.message.case === 'rpcMethodInvocationResponse' && ev.message.value.asyncId === res.asyncId; + }); + if (responseError) { throw responseError; } diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index 71de7c29..6b6ad0b3 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -24,7 +24,7 @@ import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequ import { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb.js"; import { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb.js"; import { E2eeRequest, E2eeResponse } from "./e2ee_pb.js"; -import { PerformRpcRequestCallback, PerformRpcRequestRequest, PerformRpcRequestResponse, RegisterRpcMethodCallback, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb.js"; +import { PerformRpcRequestCallback, PerformRpcRequestRequest, PerformRpcRequestResponse, RegisterRpcMethodCallback, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb.js"; /** * @generated from enum livekit.proto.LogLevel @@ -848,6 +848,12 @@ export class FfiEvent extends Message { */ value: RpcMethodInvocationEvent; case: "rpcMethodInvocation"; + } | { + /** + * @generated from field: livekit.proto.RpcMethodInvocationResponseCallback rpc_method_invocation_response = 26; + */ + value: RpcMethodInvocationResponseCallback; + case: "rpcMethodInvocationResponse"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -882,6 +888,7 @@ export class FfiEvent extends Message { { no: 23, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodCallback, oneof: "message" }, { no: 24, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodCallback, oneof: "message" }, { no: 25, name: "rpc_method_invocation", kind: "message", T: RpcMethodInvocationEvent, oneof: "message" }, + { no: 26, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseCallback, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiEvent { diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index 2eaad14f..444cc504 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -223,17 +223,22 @@ export class UnregisterRpcMethodRequest extends Message { /** - * @generated from field: uint64 invocation_id = 1; + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: uint64 invocation_id = 2; */ invocationId = protoInt64.zero; /** - * @generated from field: optional string payload = 2; + * @generated from field: optional string payload = 3; */ payload?: string; /** - * @generated from field: optional livekit.proto.RpcError error = 3; + * @generated from field: optional livekit.proto.RpcError error = 4; */ error?: RpcError; @@ -245,9 +250,10 @@ export class RpcMethodInvocationResponseRequest extends Message [ - { no: 1, name: "invocation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 3, name: "error", kind: "message", T: RpcError, opt: true }, + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "invocation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 3, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "error", kind: "message", T: RpcError, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationResponseRequest { diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 9af14107..281df083 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -167,6 +167,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter if (ffiEvent.message.value.localParticipantHandle == this.localParticipant.ffi_handle.handle) { const sender = this.remoteParticipants.get(ffiEvent.message.value.participantIdentity); this.localParticipant.handleRpcMethodInvocation( + ffiEvent.message.value.invocationId, ffiEvent.message.value.method, ffiEvent.message.value.requestId, sender, From c4271b90528319110990aabe1756e2bc7fc1fc2d Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 21:14:00 -0700 Subject: [PATCH 073/126] updates --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index e8131e0e..b19ab562 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit e8131e0e1e2893a24f7f8da756ff38924a8feb39 +Subproject commit b19ab562fb5dc9961f124ef4af3b5430182395a2 diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 03f2eb8c..7af50098 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -318,9 +318,6 @@ export class LocalParticipant extends Participant { payload: string, responseTimeoutMs: number = 10000, ): Promise { - console.warn( - `Performing RPC request to ${destinationIdentity} for method ${method} from ${this.identity}`, - ); const req = new PerformRpcRequestRequest({ localParticipantHandle: this.ffi_handle.handle, destinationIdentity, @@ -407,15 +404,9 @@ export class LocalParticipant extends Participant { payload: string, timeoutMs: number, ) { - console.warn( - `Handling RPC method invocation for ${method} from ${sender.identity} requestId: ${requestId} self: ${this.identity}`, - ); const handler = this.rpcHandlers.get(method); if (!handler) { - console.warn( - `No handler for RPC method ${method} from ${sender.identity} requestId: ${requestId} self: ${this.identity}`, - ); throw RpcError.builtIn('UNSUPPORTED_METHOD'); } @@ -427,14 +418,12 @@ export class LocalParticipant extends Participant { if (typeof response === 'string') { if (byteLength(response) > MAX_PAYLOAD_BYTES) { responseError = RpcError.builtIn('RESPONSE_PAYLOAD_TOO_LARGE'); - console.warn(`RPC Response payload too large for ${method}`); } else { responsePayload = response; } } else if (response instanceof RpcError) { responseError = response; } else { - console.warn(`unexpected handler response for ${method}: ${response}`); responseError = RpcError.builtIn('MALFORMED_RESPONSE'); } } catch (error) { From 246af971b9f2befd4e3c514267f336829757b5b2 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 21:51:19 -0700 Subject: [PATCH 074/126] cleanup --- examples/rpc/index.ts | 6 -- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 30 ++-------- packages/livekit-rtc/src/proto/rpc_pb.ts | 6 ++ packages/livekit-rtc/src/rpc.ts | 72 ++++++------------------ 5 files changed, 29 insertions(+), 87 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 49b6a008..7cd7ddbe 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -58,19 +58,15 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await greetersRoom.localParticipant?.registerRpcMethod( 'arrival', async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { - console.warn('running arrival'); console.log(`[Greeter] Oh ${sender.identity} arrived and said "${payload}"`); await new Promise((resolve) => setTimeout(resolve, 2000)); return "Welcome and have a wonderful day!"; }, ); - console.warn('registered arrival'); - await mathGeniusRoom.localParticipant?.registerRpcMethod( 'square-root', async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { - console.warn('running square-root'); const jsonData = JSON.parse(payload); const number = jsonData.number; console.log( @@ -85,8 +81,6 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) return JSON.stringify({ result }); }, ); - - console.warn('registered square-root'); }; const performGreeting = async (room: Room): Promise => { diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index b19ab562..00f76874 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit b19ab562fb5dc9961f124ef4af3b5430182395a2 +Subproject commit 00f768749f870912c3b5104757dc2d5a91554285 diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 7af50098..e4cb570b 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -49,7 +49,7 @@ import { UnregisterRpcMethodRequest, RpcMethodInvocationResponseRequest, } from './proto/rpc_pb.js'; -import { MAX_PAYLOAD_BYTES, RpcError, byteLength } from './rpc.js'; +import { RpcError } from './rpc.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; @@ -118,20 +118,11 @@ export class LocalParticipant extends Participant { sender: RemoteParticipant, payload: string, responseTimeoutMs: number, - ) => Promise + ) => Promise > = new Map(); trackPublications: Map = new Map(); - private pendingAcks = new Map void; participantIdentity: string }>(); - private pendingResponses = new Map< - string, - { - resolve: (payload: string | null, error: RpcError | null) => void; - participantIdentity: string; - } - >(); - async publishData(data: Uint8Array, options: DataPublishOptions) { const req = new PublishDataRequest({ localParticipantHandle: this.ffi_handle.handle, @@ -355,7 +346,7 @@ export class LocalParticipant extends Participant { sender: RemoteParticipant, payload: string, responseTimeoutMs: number, - ) => Promise, + ) => Promise, ): Promise { this.rpcHandlers.set(method, handler); @@ -414,18 +405,7 @@ export class LocalParticipant extends Participant { let responsePayload: string | null = null; try { - const response = await handler(requestId, sender, payload, timeoutMs); - if (typeof response === 'string') { - if (byteLength(response) > MAX_PAYLOAD_BYTES) { - responseError = RpcError.builtIn('RESPONSE_PAYLOAD_TOO_LARGE'); - } else { - responsePayload = response; - } - } else if (response instanceof RpcError) { - responseError = response; - } else { - responseError = RpcError.builtIn('MALFORMED_RESPONSE'); - } + responsePayload = await handler(requestId, sender, payload, timeoutMs); } catch (error) { if (error instanceof RpcError) { responseError = error; @@ -434,7 +414,7 @@ export class LocalParticipant extends Participant { `Uncaught error returned by RPC handler for ${method}. Returning UNCAUGHT_ERROR instead.`, error, ); - responseError = RpcError.builtIn('UNCAUGHT_ERROR'); + responseError = RpcError.builtIn('APPLICATION_ERROR'); } } diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index 444cc504..9e47c4bf 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -557,6 +557,11 @@ export class RpcMethodInvocationResponseCallback extends Message) { super(); proto3.util.initPartial(data, this); @@ -566,6 +571,7 @@ export class RpcMethodInvocationResponseCallback extends Message [ { 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): RpcMethodInvocationResponseCallback { diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index a8df7262..cae6382f 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -14,9 +14,6 @@ import { RpcError as RpcError_Proto } from './proto/rpc_pb.js'; */ export class RpcError extends Error { - static MAX_MESSAGE_BYTES = 256; - static MAX_DATA_BYTES = 15360; // 15 KB - code: number; data?: string; @@ -30,8 +27,8 @@ export class RpcError extends Error { constructor(code: number, message: string, data?: string) { super(message); this.code = code; - this.message = truncateBytes(message, RpcError.MAX_MESSAGE_BYTES); - this.data = data ? truncateBytes(data, RpcError.MAX_DATA_BYTES) : undefined; + this.message = message; + this.data = data; } static fromProto(proto: RpcError_Proto) { @@ -47,30 +44,32 @@ export class RpcError extends Error { } static ErrorCode = { - UNCAUGHT_ERROR: 1001, - UNSUPPORTED_METHOD: 1002, - CONNECTION_TIMEOUT: 1003, - RESPONSE_TIMEOUT: 1004, - RECIPIENT_DISCONNECTED: 1005, - RECIPIENT_NOT_FOUND: 1006, - REQUEST_PAYLOAD_TOO_LARGE: 1007, - RESPONSE_PAYLOAD_TOO_LARGE: 1008, - MALFORMED_RESPONSE: 1099, // TODO: Shouldn't be needed with protobuf type + APPLICATION_ERROR: 1500, + CONNECTION_TIMEOUT: 1501, + RESPONSE_TIMEOUT: 1502, + RECIPIENT_DISCONNECTED: 1503, + RESPONSE_PAYLOAD_TOO_LARGE: 1504, + SEND_FAILED: 1505, + + UNSUPPORTED_METHOD: 1400, + RECIPIENT_NOT_FOUND: 1401, + REQUEST_PAYLOAD_TOO_LARGE: 1402, } as const; /** * @internal */ static ErrorMessage: Record = { - UNCAUGHT_ERROR: 'Uncaught application error', - UNSUPPORTED_METHOD: 'Method not supported at destination', + APPLICATION_ERROR: 'Application error in method handler', CONNECTION_TIMEOUT: 'Connection timeout', RESPONSE_TIMEOUT: 'Response timeout', RECIPIENT_DISCONNECTED: 'Recipient disconnected', + RESPONSE_PAYLOAD_TOO_LARGE: 'Response payload too large', + SEND_FAILED: 'Failed to send', + + UNSUPPORTED_METHOD: 'Method not supported at destination', RECIPIENT_NOT_FOUND: 'Recipient not found', REQUEST_PAYLOAD_TOO_LARGE: 'Request payload too large', - RESPONSE_PAYLOAD_TOO_LARGE: 'Response payload too large', - MALFORMED_RESPONSE: 'Malformed response', } as const; /** @@ -82,40 +81,3 @@ export class RpcError extends Error { return new RpcError(RpcError.ErrorCode[key], RpcError.ErrorMessage[key], data); } } - -/** - * @internal - */ -export const MAX_PAYLOAD_BYTES = 15360; // 15 KB - -/** - * @internal - */ -export function byteLength(str: string): number { - const encoder = new TextEncoder(); - return encoder.encode(str).length; -} - -/** - * @internal - */ -export function truncateBytes(str: string, maxBytes: number): string { - if (byteLength(str) <= maxBytes) { - return str; - } - - let low = 0; - let high = str.length; - const encoder = new TextEncoder(); - - while (low < high) { - const mid = Math.floor((low + high + 1) / 2); - if (encoder.encode(str.slice(0, mid)).length <= maxBytes) { - low = mid; - } else { - high = mid - 1; - } - } - - return str.slice(0, low); -} From 5a81ab909b5cc6ed56f4d732cd57d5a1fd37e186 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 21:55:17 -0700 Subject: [PATCH 075/126] fixes --- packages/livekit-rtc/src/participant.ts | 42 ++++++++++++------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index e4cb570b..78e3f423 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -395,26 +395,27 @@ export class LocalParticipant extends Participant { payload: string, timeoutMs: number, ) { - const handler = this.rpcHandlers.get(method); - - if (!handler) { - throw RpcError.builtIn('UNSUPPORTED_METHOD'); - } - let responseError: RpcError | null = null; let responsePayload: string | null = null; - try { - responsePayload = await handler(requestId, sender, payload, timeoutMs); - } catch (error) { - if (error instanceof RpcError) { - responseError = error; - } else { - console.warn( - `Uncaught error returned by RPC handler for ${method}. Returning UNCAUGHT_ERROR instead.`, - error, - ); - responseError = RpcError.builtIn('APPLICATION_ERROR'); + + const handler = this.rpcHandlers.get(method); + + if (!handler) { + responseError = RpcError.builtIn('UNSUPPORTED_METHOD'); + } else { + try { + responsePayload = await handler(requestId, sender, payload, timeoutMs); + } catch (error) { + if (error instanceof RpcError) { + responseError = error; + } else { + console.warn( + `Uncaught error returned by RPC handler for ${method}. Returning UNCAUGHT_ERROR instead.`, + error, + ); + responseError = RpcError.builtIn('APPLICATION_ERROR'); + } } } @@ -431,12 +432,9 @@ export class LocalParticipant extends Participant { const cb = await FfiClient.instance.waitFor((ev) => { return ev.message.case === 'rpcMethodInvocationResponse' && ev.message.value.asyncId === res.asyncId; }); - - if (responseError) { - throw responseError; + if (cb.error) { + console.warn(`error sending rpc method invocation response: ${cb.error}`); } - - return responsePayload; } } From c023906d51d58d2a9b317feda179d358b5af0727 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 22:15:20 -0700 Subject: [PATCH 076/126] rust --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 00f76874..269bdad7 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 00f768749f870912c3b5104757dc2d5a91554285 +Subproject commit 269bdad70a1027c55b33f4f6225bd19e509dd72b From cea2fcf6849dd0b5e66c45fa98f4bb7a57f6feb5 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 22:18:43 -0700 Subject: [PATCH 077/126] readme --- packages/livekit-rtc/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/livekit-rtc/README.md b/packages/livekit-rtc/README.md index dfb4e5b5..b089b763 100644 --- a/packages/livekit-rtc/README.md +++ b/packages/livekit-rtc/README.md @@ -87,14 +87,14 @@ The participant who will receive a call must first register for the specific met ```typescript room.localParticipant?.registerRpcMethod( 'greet', - async (request: RpcRequest, sender: RemoteParticipant) => { - console.log(`Received greeting from ${sender.identity}: ${request.payload}`); + async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + console.log(`Received greeting from ${sender.identity}: ${payload}`); return `Hello, ${sender.identity}!`; } ); ``` -The request will also have a `responseTimeoutMs` field, which informs you how long you have to return a response. If you are unable to respond in time, you can either send an error or let the request time out on the sender's side. +The request includes a `responseTimeoutMs` field, which informs you how long you have to return a response. If you are unable to respond in time, you can either send an error or let the request time out on the sender's side. #### Performing an RPC request @@ -119,7 +119,7 @@ You may find it useful to adjust the `responseTimeoutMs` parameter, which allows LiveKit is a dynamic realtime environment and calls can fail for various reasons. -You may throw errors of the type `RpcError` with a string `message` in an RPC method handler and they will be received on the caller's side with the message intact. Other errors will not be transmitted and will instead arrive to the caller as `UNCAUGHT_ERROR`. Other built-in errors are detailed in `RpcError.ErrorType`. +You may throw errors of the type `RpcError` with a string `message` in an RPC method handler and they will be received on the caller's side with the message intact. Other errors will not be transmitted and will instead arrive to the caller as `1500` ("Application Error"). Other built-in errors are detailed in `RpcError`. ## Examples From 7532f011c6b35c025d87954fcf82d0071565a681 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 22:25:40 -0700 Subject: [PATCH 078/126] remove tests --- packages/livekit-rtc/src/participant.test.ts | 261 ------------------- 1 file changed, 261 deletions(-) delete mode 100644 packages/livekit-rtc/src/participant.test.ts diff --git a/packages/livekit-rtc/src/participant.test.ts b/packages/livekit-rtc/src/participant.test.ts deleted file mode 100644 index 48b97493..00000000 --- a/packages/livekit-rtc/src/participant.test.ts +++ /dev/null @@ -1,261 +0,0 @@ -// SPDX-FileCopyrightText: 2024 LiveKit, Inc. -// -// SPDX-License-Identifier: Apache-2.0 -import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { LocalParticipant, RemoteParticipant } from './participant'; -import { type OwnedParticipant, ParticipantKind } from './proto/participant_pb'; -import { RpcError } from './rpc'; - -describe('LocalParticipant', () => { - describe('registerRpcMethod', () => { - let localParticipant: LocalParticipant; - - beforeEach(() => { - const mockOwnedParticipant = { - info: { - sid: 'test-sid', - identity: 'test-identity', - name: 'Test Participant', - metadata: '', - attributes: {}, - kind: ParticipantKind.STANDARD, - }, - handle: { id: BigInt('0x1234567890abcdef') }, - } as unknown as OwnedParticipant; - - localParticipant = new LocalParticipant(mockOwnedParticipant); - }); - - it('should register an RPC method handler', async () => { - const methodName = 'testMethod'; - const handler = vi.fn().mockResolvedValue('test response'); - - localParticipant.registerRpcMethod(methodName, handler); - - const mockSender = new RemoteParticipant({ - info: { - sid: 'remote-sid', - identity: 'remote-identity', - name: 'Remote Participant', - metadata: '', - attributes: {}, - kind: ParticipantKind.STANDARD, - }, - handle: { id: BigInt('0x9876543210fedcba') }, - } as unknown as OwnedParticipant); - - localParticipant.publishRpcAck = vi.fn(); - localParticipant.publishRpcResponse = vi.fn(); - - // Call the internal method that would be triggered by an incoming RPC request - await localParticipant['handleIncomingRpcRequest'](mockSender, 'test-request-id', methodName, 'test payload', 5000); - - // Verify that the handler was called with the correct arguments - expect(handler).toHaveBeenCalledWith(mockSender, 'test-request-id', 'test payload', 5000); - - // Verify that publishRpcAck and publishRpcResponse were called - expect(localParticipant.publishRpcAck).toHaveBeenCalledTimes(1); - expect(localParticipant.publishRpcResponse).toHaveBeenCalledTimes(1); - }); - - it('should catch and transform unhandled errors in the RPC method handler', async () => { - const methodName = 'errorMethod'; - const errorMessage = 'Test error'; - const handler = vi.fn().mockRejectedValue(new Error(errorMessage)); - - localParticipant.registerRpcMethod(methodName, handler); - - const mockSender = new RemoteParticipant({ - info: { - sid: 'remote-sid', - identity: 'remote-identity', - name: 'Remote Participant', - metadata: '', - attributes: {}, - kind: ParticipantKind.STANDARD, - }, - handle: { id: BigInt('0xabcdef0123456789') }, - } as unknown as OwnedParticipant); - - const mockPublishAck = vi.fn(); - const mockPublishResponse = vi.fn(); - localParticipant.publishRpcAck = mockPublishAck; - localParticipant.publishRpcResponse = mockPublishResponse; - - await localParticipant['handleIncomingRpcRequest'](mockSender, 'test-error-request-id', methodName, 'test payload', 5000); - - expect(handler).toHaveBeenCalledWith(mockSender, 'test-error-request-id', 'test payload', 5000); - expect(mockPublishAck).toHaveBeenCalledTimes(1); - expect(mockPublishResponse).toHaveBeenCalledTimes(1); - - // Verify that the error response contains the correct error - const errorResponse = mockPublishResponse.mock.calls[0][3]; - expect(errorResponse).toBeInstanceOf(RpcError); - expect(errorResponse.code).toBe(RpcError.ErrorCode.UNCAUGHT_ERROR); - }); - - it('should pass through RpcError thrown by the RPC method handler', async () => { - const methodName = 'rpcErrorMethod'; - const errorCode = 101; - const errorMessage = 'some-error-message'; - const handler = vi.fn().mockRejectedValue(new RpcError(errorCode, errorMessage)); - - localParticipant.registerRpcMethod(methodName, handler); - - const mockSender = new RemoteParticipant({ - info: { - sid: 'remote-sid', - identity: 'remote-identity', - name: 'Remote Participant', - metadata: '', - attributes: {}, - kind: ParticipantKind.STANDARD, - }, - handle: { id: BigInt('0xabcdef0123456789') }, - } as unknown as OwnedParticipant); - - const mockPublishAck = vi.fn(); - const mockPublishResponse = vi.fn(); - localParticipant.publishRpcAck = mockPublishAck; - localParticipant.publishRpcResponse = mockPublishResponse; - - await localParticipant['handleIncomingRpcRequest'](mockSender, 'test-rpc-error-request-id', methodName, 'test payload', 5000); - - expect(handler).toHaveBeenCalledWith(mockSender, 'test-rpc-error-request-id', 'test payload', 5000); - expect(localParticipant.publishRpcAck).toHaveBeenCalledTimes(1); - expect(localParticipant.publishRpcResponse).toHaveBeenCalledTimes(1); - - // Verify that the error response contains the correct RpcError - const errorResponse = mockPublishResponse.mock.calls[0][3]; - expect(errorResponse).toBeInstanceOf(RpcError); - expect(errorResponse.code).toBe(errorCode); - expect(errorResponse.message).toBe(errorMessage); - }); - }); - - describe('performRpcRequest', () => { - let localParticipant: LocalParticipant; - let mockRemoteParticipant: RemoteParticipant; - let mockPublishRequest: ReturnType; - beforeEach(() => { - localParticipant = new LocalParticipant({ - info: { - sid: 'local-sid', - identity: 'local-identity', - name: 'Local Participant', - metadata: '', - attributes: {}, - kind: ParticipantKind.STANDARD, - }, - handle: { id: BigInt('0x1234567890abcdef') }, - } as unknown as OwnedParticipant); - - mockRemoteParticipant = new RemoteParticipant({ - info: { - sid: 'remote-sid', - identity: 'remote-identity', - name: 'Remote Participant', - metadata: '', - attributes: {}, - kind: ParticipantKind.STANDARD, - }, - handle: { id: BigInt('0xabcdef0123456789') }, - } as unknown as OwnedParticipant); - - mockPublishRequest = vi.fn(); - localParticipant.publishRpcRequest = mockPublishRequest; - }); - - it('should send RPC request and receive successful response', async () => { - const method = 'testMethod'; - const payload = 'testPayload'; - const responsePayload = 'responsePayload'; - - mockPublishRequest.mockImplementationOnce((_, requestId) => { - setTimeout(() => { - localParticipant['handleIncomingRpcAck'](requestId); - setTimeout(() => { - localParticipant['handleIncomingRpcResponse'](requestId, responsePayload, null); - }, 10); - }, 10); - }); - - const result = await localParticipant.performRpcRequest( - mockRemoteParticipant.identity, - method, - payload, - ); - - expect(mockPublishRequest).toHaveBeenCalledTimes(1); - expect(result).toBe(responsePayload); - }); - - it('should handle RPC request timeout', async () => { - const method = 'timeoutMethod'; - const payload = 'timeoutPayload'; - - // Set a short timeout for the test - const timeoutMs = 50; - - const resultPromise = localParticipant.performRpcRequest( - mockRemoteParticipant.identity, - method, - payload, - timeoutMs, - ); - - // Mock the publishRpcRequest method to simulate a delay longer than the timeout - mockPublishRequest.mockImplementationOnce(() => { - return new Promise((resolve) => { - setTimeout(resolve, timeoutMs + 10); - }); - }); - - const startTime = Date.now(); - - // Wait for the promise to reject - await expect(resultPromise).rejects.toThrow('Connection timeout'); - - // Check that the time elapsed is close to the timeout value - const elapsedTime = Date.now() - startTime; - expect(elapsedTime).toBeGreaterThanOrEqual(timeoutMs); - expect(elapsedTime).toBeLessThan(timeoutMs + 50); // Allow some margin for test execution - - expect(localParticipant.publishRpcRequest).toHaveBeenCalledTimes(1); - }); - - it('should handle RPC error response', async () => { - const method = 'errorMethod'; - const payload = 'errorPayload'; - const errorCode = 101; - const errorMessage = 'Test error message'; - - mockPublishRequest.mockImplementationOnce((_, requestId) => { - setTimeout(() => { - localParticipant['handleIncomingRpcAck'](requestId); - localParticipant['handleIncomingRpcResponse'](requestId, null, new RpcError(errorCode, errorMessage)); - }, 10); - }); - - await expect( - localParticipant.performRpcRequest(mockRemoteParticipant.identity, method, payload), - ).rejects.toThrow(errorMessage); - }); - - it('should handle participant disconnection during RPC request', async () => { - const method = 'disconnectMethod'; - const payload = 'disconnectPayload'; - - const resultPromise = localParticipant.performRpcRequest( - mockRemoteParticipant.identity, - method, - payload, - ); - - // Simulate participant disconnection - localParticipant['handleParticipantDisconnected'](mockRemoteParticipant.identity); - - await expect(resultPromise).rejects.toThrow('Recipient disconnected'); - }); - }); -}); From f8bd86966a6011cd8414ae2c8d92282ddad69cf7 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 22:28:15 -0700 Subject: [PATCH 079/126] fmt --- packages/livekit-rtc/src/participant.ts | 14 ++++++++------ packages/livekit-rtc/src/room.ts | 4 +++- packages/livekit-rtc/src/rpc.ts | 1 - 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 78e3f423..dfc8bdf2 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -38,16 +38,16 @@ import type { PerformRpcRequestResponse, RegisterRpcMethodCallback, RegisterRpcMethodResponse, + RpcMethodInvocationResponseCallback, + RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodResponse, - RpcMethodInvocationResponseResponse, - RpcMethodInvocationResponseCallback, } from './proto/rpc_pb.js'; import { PerformRpcRequestRequest, RegisterRpcMethodRequest, - UnregisterRpcMethodRequest, RpcMethodInvocationResponseRequest, + UnregisterRpcMethodRequest, } from './proto/rpc_pb.js'; import { RpcError } from './rpc.js'; import type { LocalTrack } from './track.js'; @@ -398,9 +398,8 @@ export class LocalParticipant extends Participant { let responseError: RpcError | null = null; let responsePayload: string | null = null; - const handler = this.rpcHandlers.get(method); - + if (!handler) { responseError = RpcError.builtIn('UNSUPPORTED_METHOD'); } else { @@ -430,7 +429,10 @@ export class LocalParticipant extends Participant { }); const cb = await FfiClient.instance.waitFor((ev) => { - return ev.message.case === 'rpcMethodInvocationResponse' && ev.message.value.asyncId === res.asyncId; + return ( + ev.message.case === 'rpcMethodInvocationResponse' && + ev.message.value.asyncId === res.asyncId + ); }); if (cb.error) { console.warn(`error sending rpc method invocation response: ${cb.error}`); diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 281df083..58c5405c 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -164,7 +164,9 @@ export class Room extends (EventEmitter as new () => TypedEmitter private onFfiEvent = (ffiEvent: FfiEvent) => { if (ffiEvent.message.case == 'rpcMethodInvocation') { - if (ffiEvent.message.value.localParticipantHandle == this.localParticipant.ffi_handle.handle) { + if ( + ffiEvent.message.value.localParticipantHandle == this.localParticipant.ffi_handle.handle + ) { const sender = this.remoteParticipants.get(ffiEvent.message.value.participantIdentity); this.localParticipant.handleRpcMethodInvocation( ffiEvent.message.value.invocationId, diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index cae6382f..dd78bcb6 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -1,7 +1,6 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 - import { RpcError as RpcError_Proto } from './proto/rpc_pb.js'; /** From ea7dec34a1cc2747268546960abc086d2830ea08 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 22:29:08 -0700 Subject: [PATCH 080/126] lint --- examples/rpc/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 7cd7ddbe..dd86ad29 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -57,6 +57,7 @@ async function main() { const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room): Promise => { await greetersRoom.localParticipant?.registerRpcMethod( 'arrival', + // eslint-disable-next-line @typescript-eslint/no-unused-vars async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { console.log(`[Greeter] Oh ${sender.identity} arrived and said "${payload}"`); await new Promise((resolve) => setTimeout(resolve, 2000)); From b0c4879779ff1b5667ac889fd329d801a36a5451 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 22:30:15 -0700 Subject: [PATCH 081/126] opt --- packages/livekit-rtc/src/participant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index dfc8bdf2..e34bfa82 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -307,7 +307,7 @@ export class LocalParticipant extends Participant { destinationIdentity: string, method: string, payload: string, - responseTimeoutMs: number = 10000, + responseTimeoutMs?: number, ): Promise { const req = new PerformRpcRequestRequest({ localParticipantHandle: this.ffi_handle.handle, From bebe5397f629dd4d60edd7f9d78738b0df111831 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 7 Oct 2024 22:47:55 -0700 Subject: [PATCH 082/126] number --- packages/livekit-rtc/src/rpc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index dd78bcb6..9d6c9dfb 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -13,7 +13,7 @@ import { RpcError as RpcError_Proto } from './proto/rpc_pb.js'; */ export class RpcError extends Error { - code: number; + code: typeof RpcError.ErrorCode | number; data?: string; /** @@ -36,7 +36,7 @@ export class RpcError extends Error { toProto() { return new RpcError_Proto({ - code: this.code, + code: this.code as number, message: this.message, data: this.data, }); From d9d8a96edd6a546e4798203285fd1e45b6f1e17e Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 10:16:31 -0700 Subject: [PATCH 083/126] sender->caller --- examples/rpc/index.ts | 40 +++++++++++------------ packages/livekit-rtc/README.md | 21 +++++++----- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 41 +++++++++++++++++++----- packages/livekit-rtc/src/proto/rpc_pb.ts | 6 ++-- packages/livekit-rtc/src/room.ts | 4 +-- packages/livekit-rtc/src/rpc.ts | 2 +- 7 files changed, 73 insertions(+), 43 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index dd86ad29..e0f446f9 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -17,8 +17,8 @@ async function main() { console.log(`Connecting participants to room: ${roomName}`); - const [requestersRoom, greetersRoom, mathGeniusRoom] = await Promise.all([ - connectParticipant('requester', roomName), + const [callersRoom, greetersRoom, mathGeniusRoom] = await Promise.all([ + connectParticipant('caller', roomName), connectParticipant('greeter', roomName), connectParticipant('math-genius', roomName), ]); @@ -28,7 +28,7 @@ async function main() { try { console.log('\n\nRunning greeting example...'); - await Promise.all([performGreeting(requestersRoom)]); + await Promise.all([performGreeting(callersRoom)]); } catch (error) { console.error('Error:', error); } @@ -36,16 +36,16 @@ async function main() { try { console.log('\n\nRunning math example...'); await Promise.all([ - performSquareRoot(requestersRoom) + performSquareRoot(callersRoom) .then(() => new Promise((resolve) => setTimeout(resolve, 2000))) - .then(() => performQuantumHypergeometricSeries(requestersRoom)), + .then(() => performQuantumHypergeometricSeries(callersRoom)), ]); } catch (error) { console.error('Error:', error); } console.log('\n\nParticipants done, disconnecting...'); - await requestersRoom.disconnect(); + await callersRoom.disconnect(); await greetersRoom.disconnect(); await mathGeniusRoom.disconnect(); @@ -58,8 +58,8 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await greetersRoom.localParticipant?.registerRpcMethod( 'arrival', // eslint-disable-next-line @typescript-eslint/no-unused-vars - async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { - console.log(`[Greeter] Oh ${sender.identity} arrived and said "${payload}"`); + async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + console.log(`[Greeter] Oh ${caller.identity} arrived and said "${payload}"`); await new Promise((resolve) => setTimeout(resolve, 2000)); return "Welcome and have a wonderful day!"; }, @@ -67,11 +67,11 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await mathGeniusRoom.localParticipant?.registerRpcMethod( 'square-root', - async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { const jsonData = JSON.parse(payload); const number = jsonData.number; console.log( - `[Math Genius] I guess ${sender.identity} wants the square root of ${number}. I've only got ${responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, + `[Math Genius] I guess ${caller.identity} wants the square root of ${number}. I've only got ${responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, ); console.log(`[Math Genius] *doing math*…`); @@ -85,30 +85,30 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) }; const performGreeting = async (room: Room): Promise => { - console.log('[Requester] Letting the greeter know that I\'ve arrived'); + console.log('[Caller] Letting the greeter know that I\'ve arrived'); try { const response = await room.localParticipant!.performRpcRequest('greeter', 'arrival', 'Hello'); - console.log(`[Requester] That's nice, the greeter said: "${response}"`); + console.log(`[Caller] That's nice, the greeter said: "${response}"`); } catch (error) { - console.error('[Requester] RPC call failed:', error); + console.error('[Caller] RPC call failed:', error); throw error; } }; const performSquareRoot = async (room: Room): Promise => { - console.log("[Requester] What's the square root of 16?"); + console.log("[Caller] What's the square root of 16?"); try { const response = await room.localParticipant!.performRpcRequest('math-genius', 'square-root', JSON.stringify({ number: 16 })); const parsedResponse = JSON.parse(response); - console.log(`[Requester] Nice, the answer was ${parsedResponse.result}`); + console.log(`[Caller] Nice, the answer was ${parsedResponse.result}`); } catch (error) { - console.error('[Requester] RPC call failed:', error); + console.error('[Caller] RPC call failed:', error); throw error; } }; const performQuantumHypergeometricSeries = async (room: Room): Promise => { - console.log("[Requester] What's the quantum hypergeometric series of 42?"); + console.log("[Caller] What's the quantum hypergeometric series of 42?"); try { const response = await room.localParticipant!.performRpcRequest( 'math-genius', @@ -116,16 +116,16 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => JSON.stringify({ number: 42 }) ); const parsedResponse = JSON.parse(response); - console.log(`[Requester] genius says ${parsedResponse.result}!`); + console.log(`[Caller] genius says ${parsedResponse.result}!`); } catch (error) { if (error instanceof RpcError) { if (error.code === RpcError.ErrorCode.UNSUPPORTED_METHOD) { - console.log(`[Requester] Aww looks like the genius doesn't know that one.`); + console.log(`[Caller] Aww looks like the genius doesn't know that one.`); return; } } - console.error('[Requester] Unexpected error:', error); + console.error('[Caller] Unexpected error:', error); throw error; } }; diff --git a/packages/livekit-rtc/README.md b/packages/livekit-rtc/README.md index b089b763..2c584340 100644 --- a/packages/livekit-rtc/README.md +++ b/packages/livekit-rtc/README.md @@ -78,23 +78,28 @@ await source.captureFrame(new AudioFrame(buffer, 16000, 1, buffer.byteLength / 2 ### RPC -RPC you to perform your own predefined method calls from one participant to another. This feature is especially powerful when used with [Agents](https://docs.livekit.io/agents), for instance to forward LLM function calls to your client application. +Perform your own predefined method calls from one participant to another. + +This feature is especially powerful when used with [Agents](https://docs.livekit.io/agents), for instance to forward LLM function calls to your client application. #### Registering an RPC method -The participant who will receive a call must first register for the specific method: +The participant who implements the method and will receive its calls must first register support: ```typescript room.localParticipant?.registerRpcMethod( + // method name - can be any string that makes sense for your application 'greet', - async (requestId: string, sender: RemoteParticipant, payload: string, responseTimeoutMs: number) => { - console.log(`Received greeting from ${sender.identity}: ${payload}`); - return `Hello, ${sender.identity}!`; + + // method handler - will be called when the method is invoked by a RemoteParticipant + async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + console.log(`Received greeting from ${caller.identity}: ${payload}`); + return `Hello, ${caller.identity}!`; } ); ``` -The request includes a `responseTimeoutMs` field, which informs you how long you have to return a response. If you are unable to respond in time, you can either send an error or let the request time out on the sender's side. +In addition to the payload, your handler will also receive `responseTimeoutMs`, which informs you the maximum time available to return a response. If you are unable to respond in time, the request will result in an error on the caller's side. #### Performing an RPC request @@ -113,7 +118,7 @@ try { } ``` -You may find it useful to adjust the `responseTimeoutMs` parameter, which allows you to set the amount of time you will wait for a response. We recommend keeping this value as low as possible while still satisfying the constraints of your application. +You may find it useful to adjust the `responseTimeoutMs` parameter, which indicates the amount of time you will wait for a response. We recommend keeping this value as low as possible while still satisfying the constraints of your application. #### Errors @@ -124,7 +129,7 @@ You may throw errors of the type `RpcError` with a string `message` in an RPC me ## Examples - [`publish-wav`](https://github.com/livekit/node-sdks/tree/main/examples/publish-wav): connect to a room and publish a .wave file -- [ `rpc`](https://github.com/livekit/node-sdks/tree/main/examples/rpc): simple back-and-forth RPC interaction +- [`rpc`](https://github.com/livekit/node-sdks/tree/main/examples/rpc): simple back-and-forth RPC interaction ## Getting help / Contributing diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 269bdad7..bafce08a 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 269bdad70a1027c55b33f4f6225bd19e509dd72b +Subproject commit bafce08a77f2a97929b2babd84ea92437bdd6a52 diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index e34bfa82..3351365b 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -115,7 +115,7 @@ export class LocalParticipant extends Participant { string, ( requestId: string, - sender: RemoteParticipant, + caller: RemoteParticipant, payload: string, responseTimeoutMs: number, ) => Promise @@ -333,17 +333,42 @@ export class LocalParticipant extends Participant { } /** - * Etablishes the participant as a receiver for RPC calls of the specified method. - * Will overwrite any existing callback for the specified method. + * Establishes the participant as a receiver for calls of the specified RPC method. + * Will overwrite any existing callback for the same method. * * @param method - The name of the indicated RPC method - * @param callback - Will be called when an RPC request for this method is received, with the request and the sender. Respond with a string. + * @param handler - Will be invoked when an RPC request for this method is received + * @returns A promise that resolves when the method is successfully registered + * + * @example + * ```typescript + * room.localParticipant?.registerRpcMethod( + * 'greet', + * async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + * console.log(`Received greeting from ${caller.identity}: ${payload}`); + * return `Hello, ${caller.identity}!`; + * } + * ); + * ``` + * + * The handler receives the following parameters: + * - `requestId`: A unique identifier for this RPC request + * - `caller`: The RemoteParticipant who initiated the RPC call + * - `payload`: The data sent by the caller (as a string) + * - `responseTimeoutMs`: The maximum time available to return a response + * + * The handler should return a Promise that resolves to a string. + * If unable to respond within `responseTimeoutMs`, the request will result in an error on the caller's side. + * + * You may throw errors of type `RpcError` with a string `message` in the handler, + * and they will be received on the caller's side with the message intact. + * Other errors thrown in your handler will not be transmitted as-is, and will instead arrive to the caller as `1500` ("Application Error"). */ async registerRpcMethod( method: string, handler: ( requestId: string, - sender: RemoteParticipant, + caller: RemoteParticipant, payload: string, responseTimeoutMs: number, ) => Promise, @@ -391,7 +416,7 @@ export class LocalParticipant extends Participant { invocationId: bigint, method: string, requestId: string, - sender: RemoteParticipant, + caller: RemoteParticipant, payload: string, timeoutMs: number, ) { @@ -404,7 +429,7 @@ export class LocalParticipant extends Participant { responseError = RpcError.builtIn('UNSUPPORTED_METHOD'); } else { try { - responsePayload = await handler(requestId, sender, payload, timeoutMs); + responsePayload = await handler(requestId, caller, payload, timeoutMs); } catch (error) { if (error instanceof RpcError) { responseError = error; @@ -446,4 +471,4 @@ export class RemoteParticipant extends Participant { constructor(owned_info: OwnedParticipant) { super(owned_info); } -} +} \ No newline at end of file diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index 9e47c4bf..0fe52ad5 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -618,9 +618,9 @@ export class RpcMethodInvocationEvent extends Message requestId = ""; /** - * @generated from field: string participant_identity = 5; + * @generated from field: string caller_identity = 5; */ - participantIdentity = ""; + callerIdentity = ""; /** * @generated from field: string payload = 6; @@ -644,7 +644,7 @@ export class RpcMethodInvocationEvent extends Message { no: 2, name: "invocation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "caller_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 6, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 7, name: "timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 58c5405c..98c57fde 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -167,12 +167,12 @@ export class Room extends (EventEmitter as new () => TypedEmitter if ( ffiEvent.message.value.localParticipantHandle == this.localParticipant.ffi_handle.handle ) { - const sender = this.remoteParticipants.get(ffiEvent.message.value.participantIdentity); + const caller = this.remoteParticipants.get(ffiEvent.message.value.callerIdentity); this.localParticipant.handleRpcMethodInvocation( ffiEvent.message.value.invocationId, ffiEvent.message.value.method, ffiEvent.message.value.requestId, - sender, + caller, ffiEvent.message.value.payload, ffiEvent.message.value.timeoutMs, ); diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 9d6c9dfb..37ab05d2 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -7,7 +7,7 @@ import { RpcError as RpcError_Proto } from './proto/rpc_pb.js'; * Specialized error handling for RPC methods. * * Instances of this type, when thrown in a method handler, will have their `message` - * serialized and sent across the wire. The sender will receive an equivalent error on the other side. + * serialized and sent across the wire. The caller will receive an equivalent error on the other side. * * Build-in types are included but developers may use any string, with a max length of 256 bytes. */ From 9d98f017638e0a66af45716e19666c51b5c4e87d Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 10:25:51 -0700 Subject: [PATCH 084/126] performRpcRequest->performRpc --- examples/rpc/index.ts | 6 +- packages/livekit-rtc/README.md | 6 +- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 20 +++---- packages/livekit-rtc/src/proto/ffi_pb.ts | 26 ++++----- packages/livekit-rtc/src/proto/rpc_pb.ts | 72 ++++++++++++------------ 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index e0f446f9..8943d4bb 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -87,7 +87,7 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) const performGreeting = async (room: Room): Promise => { console.log('[Caller] Letting the greeter know that I\'ve arrived'); try { - const response = await room.localParticipant!.performRpcRequest('greeter', 'arrival', 'Hello'); + const response = await room.localParticipant!.performRpc('greeter', 'arrival', 'Hello'); console.log(`[Caller] That's nice, the greeter said: "${response}"`); } catch (error) { console.error('[Caller] RPC call failed:', error); @@ -98,7 +98,7 @@ const performGreeting = async (room: Room): Promise => { const performSquareRoot = async (room: Room): Promise => { console.log("[Caller] What's the square root of 16?"); try { - const response = await room.localParticipant!.performRpcRequest('math-genius', 'square-root', JSON.stringify({ number: 16 })); + const response = await room.localParticipant!.performRpc('math-genius', 'square-root', JSON.stringify({ number: 16 })); const parsedResponse = JSON.parse(response); console.log(`[Caller] Nice, the answer was ${parsedResponse.result}`); } catch (error) { @@ -110,7 +110,7 @@ const performSquareRoot = async (room: Room): Promise => { const performQuantumHypergeometricSeries = async (room: Room): Promise => { console.log("[Caller] What's the quantum hypergeometric series of 42?"); try { - const response = await room.localParticipant!.performRpcRequest( + const response = await room.localParticipant!.performRpc( 'math-genius', 'quantum-hypergeometric-series', JSON.stringify({ number: 42 }) diff --git a/packages/livekit-rtc/README.md b/packages/livekit-rtc/README.md index 2c584340..df713706 100644 --- a/packages/livekit-rtc/README.md +++ b/packages/livekit-rtc/README.md @@ -99,15 +99,15 @@ room.localParticipant?.registerRpcMethod( ); ``` -In addition to the payload, your handler will also receive `responseTimeoutMs`, which informs you the maximum time available to return a response. If you are unable to respond in time, the request will result in an error on the caller's side. +In addition to the payload, your handler will also receive `responseTimeoutMs`, which informs you the maximum time available to return a response. If you are unable to respond in time, the call will result in an error on the caller's side. #### Performing an RPC request -The caller may then initiate a request like so: +The caller may then initiate an RPC call like so: ```typescript try { - const response = await room.localParticipant!.performRpcRequest( + const response = await room.localParticipant!.performRpc( 'recipient-identity', 'greet', 'Hello from RPC!' diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index bafce08a..565834e0 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit bafce08a77f2a97929b2babd84ea92437bdd6a52 +Subproject commit 565834e04ac52ded9b81fd5a4ceed07de37ba47b diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 3351365b..928a1a0e 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -34,8 +34,8 @@ import { UnpublishTrackRequest, } from './proto/room_pb.js'; import type { - PerformRpcRequestCallback, - PerformRpcRequestResponse, + PerformRpcCallback, + PerformRpcResponse, RegisterRpcMethodCallback, RegisterRpcMethodResponse, RpcMethodInvocationResponseCallback, @@ -44,7 +44,7 @@ import type { UnregisterRpcMethodResponse, } from './proto/rpc_pb.js'; import { - PerformRpcRequestRequest, + PerformRpcRequest, RegisterRpcMethodRequest, RpcMethodInvocationResponseRequest, UnregisterRpcMethodRequest, @@ -295,7 +295,7 @@ export class LocalParticipant extends Participant { } /** - * Initiate an RPC request to a remote participant. + * Initiate an RPC call to a remote participant. * @param destinationIdentity - The `identity` of the destination participant * @param method - The method name to call * @param payload - The method payload @@ -303,13 +303,13 @@ export class LocalParticipant extends Participant { * @returns A promise that resolves with the response payload or rejects with an error. * @throws Error on failure. Details in `message`. */ - async performRpcRequest( + async performRpc( destinationIdentity: string, method: string, payload: string, responseTimeoutMs?: number, ): Promise { - const req = new PerformRpcRequestRequest({ + const req = new PerformRpcRequest({ localParticipantHandle: this.ffi_handle.handle, destinationIdentity, method, @@ -317,12 +317,12 @@ export class LocalParticipant extends Participant { responseTimeoutMs, }); - const res = FfiClient.instance.request({ - message: { case: 'performRpcRequest', value: req }, + const res = FfiClient.instance.request({ + message: { case: 'performRpc', value: req }, }); - const cb = await FfiClient.instance.waitFor((ev) => { - return ev.message.case === 'performRpcRequest' && ev.message.value.asyncId === res.asyncId; + const cb = await FfiClient.instance.waitFor((ev) => { + return ev.message.case === 'performRpc' && ev.message.value.asyncId === res.asyncId; }); if (cb.error) { diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index 6b6ad0b3..e84d276c 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -24,7 +24,7 @@ import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequ import { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb.js"; import { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb.js"; import { E2eeRequest, E2eeResponse } from "./e2ee_pb.js"; -import { PerformRpcRequestCallback, PerformRpcRequestRequest, PerformRpcRequestResponse, RegisterRpcMethodCallback, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb.js"; +import { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodCallback, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb.js"; /** * @generated from enum livekit.proto.LogLevel @@ -290,10 +290,10 @@ export class FfiRequest extends Message { /** * RPC * - * @generated from field: livekit.proto.PerformRpcRequestRequest perform_rpc_request = 36; + * @generated from field: livekit.proto.PerformRpcRequest perform_rpc = 36; */ - value: PerformRpcRequestRequest; - case: "performRpcRequest"; + value: PerformRpcRequest; + case: "performRpc"; } | { /** * @generated from field: livekit.proto.RegisterRpcMethodRequest register_rpc_method = 37; @@ -356,7 +356,7 @@ export class FfiRequest extends Message { { no: 33, name: "new_sox_resampler", kind: "message", T: NewSoxResamplerRequest, oneof: "message" }, { no: 34, name: "push_sox_resampler", kind: "message", T: PushSoxResamplerRequest, oneof: "message" }, { no: 35, name: "flush_sox_resampler", kind: "message", T: FlushSoxResamplerRequest, oneof: "message" }, - { no: 36, name: "perform_rpc_request", kind: "message", T: PerformRpcRequestRequest, oneof: "message" }, + { no: 36, name: "perform_rpc", kind: "message", T: PerformRpcRequest, oneof: "message" }, { no: 37, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodRequest, oneof: "message" }, { no: 38, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodRequest, oneof: "message" }, { no: 39, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseRequest, oneof: "message" }, @@ -604,10 +604,10 @@ export class FfiResponse extends Message { /** * RPC * - * @generated from field: livekit.proto.PerformRpcRequestResponse perform_rpc_request = 36; + * @generated from field: livekit.proto.PerformRpcResponse perform_rpc = 36; */ - value: PerformRpcRequestResponse; - case: "performRpcRequest"; + value: PerformRpcResponse; + case: "performRpc"; } | { /** * @generated from field: livekit.proto.RegisterRpcMethodResponse register_rpc_method = 37; @@ -670,7 +670,7 @@ export class FfiResponse extends Message { { no: 33, name: "new_sox_resampler", kind: "message", T: NewSoxResamplerResponse, oneof: "message" }, { no: 34, name: "push_sox_resampler", kind: "message", T: PushSoxResamplerResponse, oneof: "message" }, { no: 35, name: "flush_sox_resampler", kind: "message", T: FlushSoxResamplerResponse, oneof: "message" }, - { no: 36, name: "perform_rpc_request", kind: "message", T: PerformRpcRequestResponse, oneof: "message" }, + { no: 36, name: "perform_rpc", kind: "message", T: PerformRpcResponse, oneof: "message" }, { no: 37, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodResponse, oneof: "message" }, { no: 38, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodResponse, oneof: "message" }, { no: 39, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseResponse, oneof: "message" }, @@ -826,10 +826,10 @@ export class FfiEvent extends Message { case: "publishSipDtmf"; } | { /** - * @generated from field: livekit.proto.PerformRpcRequestCallback perform_rpc_request = 22; + * @generated from field: livekit.proto.PerformRpcCallback perform_rpc = 22; */ - value: PerformRpcRequestCallback; - case: "performRpcRequest"; + value: PerformRpcCallback; + case: "performRpc"; } | { /** * @generated from field: livekit.proto.RegisterRpcMethodCallback register_rpc_method = 23; @@ -884,7 +884,7 @@ export class FfiEvent extends 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" }, - { no: 22, name: "perform_rpc_request", kind: "message", T: PerformRpcRequestCallback, oneof: "message" }, + { no: 22, name: "perform_rpc", kind: "message", T: PerformRpcCallback, oneof: "message" }, { no: 23, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodCallback, oneof: "message" }, { no: 24, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodCallback, oneof: "message" }, { no: 25, name: "rpc_method_invocation", kind: "message", T: RpcMethodInvocationEvent, oneof: "message" }, diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index 0fe52ad5..fd3ad07a 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -72,9 +72,9 @@ export class RpcError extends Message { /** * FFI Requests * - * @generated from message livekit.proto.PerformRpcRequestRequest + * @generated from message livekit.proto.PerformRpcRequest */ -export class PerformRpcRequestRequest extends Message { +export class PerformRpcRequest extends Message { /** * @generated from field: uint64 local_participant_handle = 1; */ @@ -100,13 +100,13 @@ export class PerformRpcRequestRequest extends Message */ responseTimeoutMs?: number; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PerformRpcRequestRequest"; + static readonly typeName = "livekit.proto.PerformRpcRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "destination_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, @@ -115,20 +115,20 @@ export class PerformRpcRequestRequest extends Message { no: 5, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcRequestRequest { - return new PerformRpcRequestRequest().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcRequest { + return new PerformRpcRequest().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcRequestRequest { - return new PerformRpcRequestRequest().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcRequest { + return new PerformRpcRequest().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PerformRpcRequestRequest { - return new PerformRpcRequestRequest().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): PerformRpcRequest { + return new PerformRpcRequest().fromJsonString(jsonString, options); } - static equals(a: PerformRpcRequestRequest | PlainMessage | undefined, b: PerformRpcRequestRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PerformRpcRequestRequest, a, b); + static equals(a: PerformRpcRequest | PlainMessage | undefined, b: PerformRpcRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PerformRpcRequest, a, b); } } @@ -276,39 +276,39 @@ export class RpcMethodInvocationResponseRequest extends Message { +export class PerformRpcResponse 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.PerformRpcRequestResponse"; + static readonly typeName = "livekit.proto.PerformRpcResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcRequestResponse { - return new PerformRpcRequestResponse().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcResponse { + return new PerformRpcResponse().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcRequestResponse { - return new PerformRpcRequestResponse().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcResponse { + return new PerformRpcResponse().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PerformRpcRequestResponse { - return new PerformRpcRequestResponse().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): PerformRpcResponse { + return new PerformRpcResponse().fromJsonString(jsonString, options); } - static equals(a: PerformRpcRequestResponse | PlainMessage | undefined, b: PerformRpcRequestResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PerformRpcRequestResponse, a, b); + static equals(a: PerformRpcResponse | PlainMessage | undefined, b: PerformRpcResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PerformRpcResponse, a, b); } } @@ -426,9 +426,9 @@ export class RpcMethodInvocationResponseResponse extends Message { +export class PerformRpcCallback extends Message { /** * @generated from field: uint64 async_id = 1; */ @@ -444,33 +444,33 @@ export class PerformRpcRequestCallback extends Message) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PerformRpcRequestCallback"; + static readonly typeName = "livekit.proto.PerformRpcCallback"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 3, name: "error", kind: "message", T: RpcError, opt: true }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcRequestCallback { - return new PerformRpcRequestCallback().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcCallback { + return new PerformRpcCallback().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcRequestCallback { - return new PerformRpcRequestCallback().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcCallback { + return new PerformRpcCallback().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PerformRpcRequestCallback { - return new PerformRpcRequestCallback().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): PerformRpcCallback { + return new PerformRpcCallback().fromJsonString(jsonString, options); } - static equals(a: PerformRpcRequestCallback | PlainMessage | undefined, b: PerformRpcRequestCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PerformRpcRequestCallback, a, b); + static equals(a: PerformRpcCallback | PlainMessage | undefined, b: PerformRpcCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(PerformRpcCallback, a, b); } } From b5102e11fe7d9d25935561dab7b08fcc6423c736 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 10:56:15 -0700 Subject: [PATCH 085/126] fmt --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 565834e0..c4db8882 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 565834e04ac52ded9b81fd5a4ceed07de37ba47b +Subproject commit c4db8882620c4f2c05cca0b97b17117d680ec254 diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 928a1a0e..7f372134 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -339,7 +339,7 @@ export class LocalParticipant extends Participant { * @param method - The name of the indicated RPC method * @param handler - Will be invoked when an RPC request for this method is received * @returns A promise that resolves when the method is successfully registered - * + * * @example * ```typescript * room.localParticipant?.registerRpcMethod( @@ -350,18 +350,18 @@ export class LocalParticipant extends Participant { * } * ); * ``` - * + * * The handler receives the following parameters: * - `requestId`: A unique identifier for this RPC request * - `caller`: The RemoteParticipant who initiated the RPC call * - `payload`: The data sent by the caller (as a string) * - `responseTimeoutMs`: The maximum time available to return a response - * + * * The handler should return a Promise that resolves to a string. * If unable to respond within `responseTimeoutMs`, the request will result in an error on the caller's side. - * - * You may throw errors of type `RpcError` with a string `message` in the handler, - * and they will be received on the caller's side with the message intact. + * + * You may throw errors of type `RpcError` with a string `message` in the handler, + * and they will be received on the caller's side with the message intact. * Other errors thrown in your handler will not be transmitted as-is, and will instead arrive to the caller as `1500` ("Application Error"). */ async registerRpcMethod( @@ -471,4 +471,4 @@ export class RemoteParticipant extends Participant { constructor(owned_info: OwnedParticipant) { super(owned_info); } -} \ No newline at end of file +} From 453c6dad355e379648d7814cf4bd5e76ffc2a582 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 11:47:13 -0700 Subject: [PATCH 086/126] Updated lint --- pnpm-lock.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 29b4ed45..4fc7c218 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4457,8 +4457,8 @@ snapshots: '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0) eslint-plugin-react: 7.35.1(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) @@ -4493,33 +4493,33 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0): + eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.3.6 enhanced-resolve: 5.17.1 eslint: 8.57.0 - eslint-module-utils: 2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.8.0 is-bun-module: 1.1.0 is-glob: 4.0.3 optionalDependencies: - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@8.4.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0) transitivePeerDependencies: - supports-color @@ -4540,7 +4540,7 @@ snapshots: eslint: 8.57.0 eslint-compat-utils: 0.5.1(eslint@8.57.0) - eslint-plugin-import@2.30.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-plugin-import@2.30.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -4551,7 +4551,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0))(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 From b506416da86a122406bec5539d41180e0f8490bd Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 13:53:46 -0700 Subject: [PATCH 087/126] timeoutMs --- packages/livekit-rtc/src/participant.ts | 4 ++-- packages/livekit-rtc/src/room.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 7f372134..f280bffd 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -418,7 +418,7 @@ export class LocalParticipant extends Participant { requestId: string, caller: RemoteParticipant, payload: string, - timeoutMs: number, + responseTimeoutMs: number, ) { let responseError: RpcError | null = null; let responsePayload: string | null = null; @@ -429,7 +429,7 @@ export class LocalParticipant extends Participant { responseError = RpcError.builtIn('UNSUPPORTED_METHOD'); } else { try { - responsePayload = await handler(requestId, caller, payload, timeoutMs); + responsePayload = await handler(requestId, caller, payload, responseTimeoutMs); } catch (error) { if (error instanceof RpcError) { responseError = error; diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 98c57fde..63baddbf 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -174,7 +174,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter ffiEvent.message.value.requestId, caller, ffiEvent.message.value.payload, - ffiEvent.message.value.timeoutMs, + ffiEvent.message.value.responseTimeoutMs, ); } return; From f10ac1a48d8f47d7590e195848841b55304c7b2a Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 14:00:01 -0700 Subject: [PATCH 088/126] r --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index c4db8882..f7536415 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit c4db8882620c4f2c05cca0b97b17117d680ec254 +Subproject commit f753641514c5e52ddba932e03cdbdde912af0c75 From 9ddfeb58321cfba0f606031462f9a0d150403302 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 14:23:17 -0700 Subject: [PATCH 089/126] Changes --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/proto/rpc_pb.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index f7536415..3f11cb0f 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit f753641514c5e52ddba932e03cdbdde912af0c75 +Subproject commit 3f11cb0f875ed98816bc42c4f53f3fcfd2fffe9e diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index fd3ad07a..894350b1 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -628,9 +628,9 @@ export class RpcMethodInvocationEvent extends Message payload = ""; /** - * @generated from field: uint32 timeout_ms = 7; + * @generated from field: uint32 response_timeout_ms = 7; */ - timeoutMs = 0; + responseTimeoutMs = 0; constructor(data?: PartialMessage) { super(); @@ -646,7 +646,7 @@ export class RpcMethodInvocationEvent extends Message { no: 4, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 5, name: "caller_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 6, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 7, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationEvent { From 71f935c7b016b1597a8eaf0d006fba681ac8ddb7 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 14:48:27 -0700 Subject: [PATCH 090/126] fix --- pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d8b439ce..cff1fdb0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -124,7 +124,7 @@ importers: devDependencies: '@types/node': specifier: ^20.10.4 - version: 20.16.3 + version: 20.16.11 tsx: specifier: ^4.7.1 version: 4.17.0 From 3ab2ddfd88c4cad100b514485a7030544f8bf6f7 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 16:10:20 -0700 Subject: [PATCH 091/126] dv --- examples/rpc/index.ts | 50 ++++++++++++++++++++++++ packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 2 +- packages/livekit-rtc/src/proto/rpc_pb.ts | 6 +-- 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 8943d4bb..7364e480 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -33,6 +33,13 @@ async function main() { console.error('Error:', error); } + try { + console.log('\n\nRunning error handling example...'); + await Promise.all([performDivision(callersRoom)]); + } catch (error) { + console.error('Error:', error); + } + try { console.log('\n\nRunning math example...'); await Promise.all([ @@ -82,6 +89,26 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) return JSON.stringify({ result }); }, ); + + await mathGeniusRoom.localParticipant?.registerRpcMethod( + 'divide', + async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + const jsonData = JSON.parse(payload); + const { numerator, denominator } = jsonData; + console.log( + `[Math Genius] ${caller.identity} wants to divide ${numerator} by ${denominator}. This could be interesting...`, + ); + + if (denominator === 0) { + console.log(`[Math Genius] Uh oh, divide by zero! This won't end well...`); + throw new Error('Cannot divide by zero'); + } + + const result = numerator / denominator; + console.log(`[Math Genius] The result is ${result}`); + return JSON.stringify({ result }); + }, + ); }; const performGreeting = async (room: Room): Promise => { @@ -130,6 +157,29 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => } }; +const performDivision = async (room: Room): Promise => { + console.log("[Caller] Let's try dividing 10 by 0"); + try { + const response = await room.localParticipant!.performRpc( + 'math-genius', + 'divide', + JSON.stringify({ numerator: 10, denominator: 0 }) + ); + const parsedResponse = JSON.parse(response); + console.log(`[Caller] The result is ${parsedResponse.result}`); + } catch (error) { + if (error instanceof RpcError) { + if (error.code === RpcError.ErrorCode.APPLICATION_ERROR) { + console.log(`[Caller] Oops! I guess that didn't work. Let's try something else.`); + } else { + console.error('[Caller] Unexpected RPC error:', error); + } + } else { + console.error('[Caller] Unexpected error:', error); + } + } +}; + const createToken = (identity: string, roomName: string) => { const token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET, { identity, diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 3f11cb0f..089b748d 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 3f11cb0f875ed98816bc42c4f53f3fcfd2fffe9e +Subproject commit 089b748d3efb3fac2e291f03a234e73676b0dfa2 diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index f280bffd..0af386b7 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -435,7 +435,7 @@ export class LocalParticipant extends Participant { responseError = error; } else { console.warn( - `Uncaught error returned by RPC handler for ${method}. Returning UNCAUGHT_ERROR instead.`, + `Uncaught error returned by RPC handler for ${method}. Returning APPLICATION_ERROR instead.`, error, ); responseError = RpcError.builtIn('APPLICATION_ERROR'); diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index 894350b1..c849b160 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -35,9 +35,9 @@ export class RpcError extends Message { message = ""; /** - * @generated from field: string data = 3; + * @generated from field: optional string data = 3; */ - data = ""; + data?: string; constructor(data?: PartialMessage) { super(); @@ -49,7 +49,7 @@ export class RpcError extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "data", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "data", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RpcError { From d2e329d110285a2b4416510c9b1b51b74be3dc31 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 8 Oct 2024 16:11:10 -0700 Subject: [PATCH 092/126] lint --- examples/rpc/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 7364e480..c8263fd7 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -92,6 +92,7 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await mathGeniusRoom.localParticipant?.registerRpcMethod( 'divide', + // eslint-disable-next-line @typescript-eslint/no-unused-vars async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { const jsonData = JSON.parse(payload); const { numerator, denominator } = jsonData; From d8d69beaafab1995e75a6cd2a66c1dcb9d782184 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 9 Oct 2024 17:15:43 -0700 Subject: [PATCH 093/126] typo --- packages/livekit-rtc/src/rpc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 37ab05d2..561a9fb9 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -9,7 +9,7 @@ import { RpcError as RpcError_Proto } from './proto/rpc_pb.js'; * Instances of this type, when thrown in a method handler, will have their `message` * serialized and sent across the wire. The caller will receive an equivalent error on the other side. * - * Build-in types are included but developers may use any string, with a max length of 256 bytes. + * Built-in types are included but developers may use any string, with a max length of 256 bytes. */ export class RpcError extends Error { From 3193e314ba5c14a9a8527d61994e3e9d3556eea2 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 11 Oct 2024 15:34:23 -0700 Subject: [PATCH 094/126] rust --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/proto/ffi_pb.ts | 82 ++++-- packages/livekit-rtc/src/proto/room_pb.ts | 319 ++++++++++++++++++++++ 3 files changed, 375 insertions(+), 28 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 089b748d..6c103fb4 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 089b748d3efb3fac2e291f03a234e73676b0dfa2 +Subproject commit 6c103fb4f78f4da205f4935cb8750cf70a475bd9 diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index e84d276c..ff19c623 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -19,7 +19,7 @@ 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, 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 { ConnectCallback, ConnectRequest, ConnectResponse, DisconnectCallback, DisconnectRequest, DisconnectResponse, EditChatMessageRequest, GetSessionStatsCallback, GetSessionStatsRequest, GetSessionStatsResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishSipDtmfCallback, PublishSipDtmfRequest, PublishSipDtmfResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, PublishTranscriptionCallback, PublishTranscriptionRequest, PublishTranscriptionResponse, RoomEvent, SendChatMessageCallback, SendChatMessageRequest, SendChatMessageResponse, SetLocalAttributesCallback, SetLocalAttributesRequest, SetLocalAttributesResponse, SetLocalMetadataCallback, SetLocalMetadataRequest, SetLocalMetadataResponse, SetLocalNameCallback, SetLocalNameRequest, SetLocalNameResponse, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse } from "./room_pb.js"; import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, EnableRemoteTrackRequest, EnableRemoteTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, LocalTrackMuteRequest, LocalTrackMuteResponse, TrackEvent } from "./track_pb.js"; import { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb.js"; import { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb.js"; @@ -286,29 +286,41 @@ export class FfiRequest extends Message { */ value: FlushSoxResamplerRequest; case: "flushSoxResampler"; + } | { + /** + * @generated from field: livekit.proto.SendChatMessageRequest send_chat_message = 36; + */ + value: SendChatMessageRequest; + case: "sendChatMessage"; + } | { + /** + * @generated from field: livekit.proto.EditChatMessageRequest edit_chat_message = 37; + */ + value: EditChatMessageRequest; + case: "editChatMessage"; } | { /** * RPC * - * @generated from field: livekit.proto.PerformRpcRequest perform_rpc = 36; + * @generated from field: livekit.proto.PerformRpcRequest perform_rpc = 38; */ value: PerformRpcRequest; case: "performRpc"; } | { /** - * @generated from field: livekit.proto.RegisterRpcMethodRequest register_rpc_method = 37; + * @generated from field: livekit.proto.RegisterRpcMethodRequest register_rpc_method = 39; */ value: RegisterRpcMethodRequest; case: "registerRpcMethod"; } | { /** - * @generated from field: livekit.proto.UnregisterRpcMethodRequest unregister_rpc_method = 38; + * @generated from field: livekit.proto.UnregisterRpcMethodRequest unregister_rpc_method = 40; */ value: UnregisterRpcMethodRequest; case: "unregisterRpcMethod"; } | { /** - * @generated from field: livekit.proto.RpcMethodInvocationResponseRequest rpc_method_invocation_response = 39; + * @generated from field: livekit.proto.RpcMethodInvocationResponseRequest rpc_method_invocation_response = 41; */ value: RpcMethodInvocationResponseRequest; case: "rpcMethodInvocationResponse"; @@ -356,10 +368,12 @@ export class FfiRequest extends Message { { no: 33, name: "new_sox_resampler", kind: "message", T: NewSoxResamplerRequest, oneof: "message" }, { no: 34, name: "push_sox_resampler", kind: "message", T: PushSoxResamplerRequest, oneof: "message" }, { no: 35, name: "flush_sox_resampler", kind: "message", T: FlushSoxResamplerRequest, oneof: "message" }, - { no: 36, name: "perform_rpc", kind: "message", T: PerformRpcRequest, oneof: "message" }, - { no: 37, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodRequest, oneof: "message" }, - { no: 38, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodRequest, oneof: "message" }, - { no: 39, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseRequest, oneof: "message" }, + { no: 36, name: "send_chat_message", kind: "message", T: SendChatMessageRequest, oneof: "message" }, + { no: 37, name: "edit_chat_message", kind: "message", T: EditChatMessageRequest, oneof: "message" }, + { no: 38, name: "perform_rpc", kind: "message", T: PerformRpcRequest, oneof: "message" }, + { no: 39, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodRequest, oneof: "message" }, + { no: 40, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodRequest, oneof: "message" }, + { no: 41, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseRequest, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiRequest { @@ -600,29 +614,35 @@ export class FfiResponse extends Message { */ value: FlushSoxResamplerResponse; case: "flushSoxResampler"; + } | { + /** + * @generated from field: livekit.proto.SendChatMessageResponse send_chat_message = 36; + */ + value: SendChatMessageResponse; + case: "sendChatMessage"; } | { /** * RPC * - * @generated from field: livekit.proto.PerformRpcResponse perform_rpc = 36; + * @generated from field: livekit.proto.PerformRpcResponse perform_rpc = 37; */ value: PerformRpcResponse; case: "performRpc"; } | { /** - * @generated from field: livekit.proto.RegisterRpcMethodResponse register_rpc_method = 37; + * @generated from field: livekit.proto.RegisterRpcMethodResponse register_rpc_method = 38; */ value: RegisterRpcMethodResponse; case: "registerRpcMethod"; } | { /** - * @generated from field: livekit.proto.UnregisterRpcMethodResponse unregister_rpc_method = 38; + * @generated from field: livekit.proto.UnregisterRpcMethodResponse unregister_rpc_method = 39; */ value: UnregisterRpcMethodResponse; case: "unregisterRpcMethod"; } | { /** - * @generated from field: livekit.proto.RpcMethodInvocationResponseResponse rpc_method_invocation_response = 39; + * @generated from field: livekit.proto.RpcMethodInvocationResponseResponse rpc_method_invocation_response = 40; */ value: RpcMethodInvocationResponseResponse; case: "rpcMethodInvocationResponse"; @@ -670,10 +690,11 @@ export class FfiResponse extends Message { { no: 33, name: "new_sox_resampler", kind: "message", T: NewSoxResamplerResponse, oneof: "message" }, { no: 34, name: "push_sox_resampler", kind: "message", T: PushSoxResamplerResponse, oneof: "message" }, { no: 35, name: "flush_sox_resampler", kind: "message", T: FlushSoxResamplerResponse, oneof: "message" }, - { no: 36, name: "perform_rpc", kind: "message", T: PerformRpcResponse, oneof: "message" }, - { no: 37, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodResponse, oneof: "message" }, - { no: 38, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodResponse, oneof: "message" }, - { no: 39, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseResponse, oneof: "message" }, + { no: 36, name: "send_chat_message", kind: "message", T: SendChatMessageResponse, oneof: "message" }, + { no: 37, name: "perform_rpc", kind: "message", T: PerformRpcResponse, oneof: "message" }, + { no: 38, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodResponse, oneof: "message" }, + { no: 39, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodResponse, oneof: "message" }, + { no: 40, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseResponse, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiResponse { @@ -826,31 +847,37 @@ export class FfiEvent extends Message { case: "publishSipDtmf"; } | { /** - * @generated from field: livekit.proto.PerformRpcCallback perform_rpc = 22; + * @generated from field: livekit.proto.SendChatMessageCallback send_chat_message = 22; + */ + value: SendChatMessageCallback; + case: "sendChatMessage"; + } | { + /** + * @generated from field: livekit.proto.PerformRpcCallback perform_rpc = 23; */ value: PerformRpcCallback; case: "performRpc"; } | { /** - * @generated from field: livekit.proto.RegisterRpcMethodCallback register_rpc_method = 23; + * @generated from field: livekit.proto.RegisterRpcMethodCallback register_rpc_method = 24; */ value: RegisterRpcMethodCallback; case: "registerRpcMethod"; } | { /** - * @generated from field: livekit.proto.UnregisterRpcMethodCallback unregister_rpc_method = 24; + * @generated from field: livekit.proto.UnregisterRpcMethodCallback unregister_rpc_method = 25; */ value: UnregisterRpcMethodCallback; case: "unregisterRpcMethod"; } | { /** - * @generated from field: livekit.proto.RpcMethodInvocationEvent rpc_method_invocation = 25; + * @generated from field: livekit.proto.RpcMethodInvocationEvent rpc_method_invocation = 26; */ value: RpcMethodInvocationEvent; case: "rpcMethodInvocation"; } | { /** - * @generated from field: livekit.proto.RpcMethodInvocationResponseCallback rpc_method_invocation_response = 26; + * @generated from field: livekit.proto.RpcMethodInvocationResponseCallback rpc_method_invocation_response = 27; */ value: RpcMethodInvocationResponseCallback; case: "rpcMethodInvocationResponse"; @@ -884,11 +911,12 @@ export class FfiEvent extends 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" }, - { no: 22, name: "perform_rpc", kind: "message", T: PerformRpcCallback, oneof: "message" }, - { no: 23, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodCallback, oneof: "message" }, - { no: 24, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodCallback, oneof: "message" }, - { no: 25, name: "rpc_method_invocation", kind: "message", T: RpcMethodInvocationEvent, oneof: "message" }, - { no: 26, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseCallback, oneof: "message" }, + { no: 22, name: "send_chat_message", kind: "message", T: SendChatMessageCallback, oneof: "message" }, + { no: 23, name: "perform_rpc", kind: "message", T: PerformRpcCallback, oneof: "message" }, + { no: 24, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodCallback, oneof: "message" }, + { no: 25, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodCallback, oneof: "message" }, + { no: 26, name: "rpc_method_invocation", kind: "message", T: RpcMethodInvocationEvent, oneof: "message" }, + { no: 27, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseCallback, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiEvent { diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index fefc54b7..219f431c 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -1375,6 +1375,208 @@ export class SetLocalMetadataCallback extends Message } } +/** + * @generated from message livekit.proto.SendChatMessageRequest + */ +export class SendChatMessageRequest extends Message { + /** + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + /** + * @generated from field: repeated string destination_identities = 3; + */ + destinationIdentities: string[] = []; + + /** + * @generated from field: optional string sender_identity = 4; + */ + senderIdentity?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.SendChatMessageRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 4, name: "sender_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageRequest { + return new SendChatMessageRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SendChatMessageRequest { + return new SendChatMessageRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SendChatMessageRequest { + return new SendChatMessageRequest().fromJsonString(jsonString, options); + } + + static equals(a: SendChatMessageRequest | PlainMessage | undefined, b: SendChatMessageRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SendChatMessageRequest, a, b); + } +} + +/** + * @generated from message livekit.proto.EditChatMessageRequest + */ +export class EditChatMessageRequest extends Message { + /** + * @generated from field: uint64 local_participant_handle = 1; + */ + localParticipantHandle = protoInt64.zero; + + /** + * @generated from field: string edit_text = 2; + */ + editText = ""; + + /** + * @generated from field: livekit.proto.ChatMessage original_message = 3; + */ + originalMessage?: ChatMessage; + + /** + * @generated from field: repeated string destination_identities = 4; + */ + destinationIdentities: string[] = []; + + /** + * @generated from field: optional string sender_identity = 5; + */ + senderIdentity?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.EditChatMessageRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "edit_text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "original_message", kind: "message", T: ChatMessage }, + { no: 4, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 5, name: "sender_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EditChatMessageRequest { + return new EditChatMessageRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EditChatMessageRequest { + return new EditChatMessageRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EditChatMessageRequest { + return new EditChatMessageRequest().fromJsonString(jsonString, options); + } + + static equals(a: EditChatMessageRequest | PlainMessage | undefined, b: EditChatMessageRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(EditChatMessageRequest, a, b); + } +} + +/** + * @generated from message livekit.proto.SendChatMessageResponse + */ +export class SendChatMessageResponse 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.SendChatMessageResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageResponse { + return new SendChatMessageResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SendChatMessageResponse { + return new SendChatMessageResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SendChatMessageResponse { + return new SendChatMessageResponse().fromJsonString(jsonString, options); + } + + static equals(a: SendChatMessageResponse | PlainMessage | undefined, b: SendChatMessageResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SendChatMessageResponse, a, b); + } +} + +/** + * @generated from message livekit.proto.SendChatMessageCallback + */ +export class SendChatMessageCallback extends Message { + /** + * @generated from field: uint64 async_id = 1; + */ + asyncId = protoInt64.zero; + + /** + * @generated from field: optional string error = 2; + */ + error?: string; + + /** + * @generated from field: optional livekit.proto.ChatMessage chat_message = 3; + */ + chatMessage?: ChatMessage; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.SendChatMessageCallback"; + 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 }, + { no: 3, name: "chat_message", kind: "message", T: ChatMessage, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageCallback { + return new SendChatMessageCallback().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SendChatMessageCallback { + return new SendChatMessageCallback().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SendChatMessageCallback { + return new SendChatMessageCallback().fromJsonString(jsonString, options); + } + + static equals(a: SendChatMessageCallback | PlainMessage | undefined, b: SendChatMessageCallback | PlainMessage | undefined): boolean { + return proto3.util.equals(SendChatMessageCallback, a, b); + } +} + /** * Change the local participant's attributes * @@ -2491,6 +2693,12 @@ export class RoomEvent extends Message { */ value: TranscriptionReceived; case: "transcriptionReceived"; + } | { + /** + * @generated from field: livekit.proto.ChatMessageReceived chat_message = 29; + */ + value: ChatMessageReceived; + case: "chatMessage"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -2529,6 +2737,7 @@ export class RoomEvent extends Message { { no: 26, name: "eos", kind: "message", T: RoomEOS, oneof: "message" }, { no: 27, name: "data_packet_received", kind: "message", T: DataPacketReceived, oneof: "message" }, { no: 28, name: "transcription_received", kind: "message", T: TranscriptionReceived, oneof: "message" }, + { no: 29, name: "chat_message", kind: "message", T: ChatMessageReceived, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomEvent { @@ -3517,6 +3726,116 @@ export class UserPacket extends Message { } } +/** + * @generated from message livekit.proto.ChatMessage + */ +export class ChatMessage extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: int64 timestamp = 2; + */ + timestamp = protoInt64.zero; + + /** + * @generated from field: string message = 3; + */ + message = ""; + + /** + * @generated from field: optional int64 edit_timestamp = 4; + */ + editTimestamp?: bigint; + + /** + * @generated from field: optional bool deleted = 5; + */ + deleted?: boolean; + + /** + * @generated from field: optional bool generated = 6; + */ + generated?: boolean; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.ChatMessage"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "edit_timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, + { no: 5, name: "deleted", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 6, name: "generated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChatMessage { + return new ChatMessage().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChatMessage { + return new ChatMessage().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChatMessage { + return new ChatMessage().fromJsonString(jsonString, options); + } + + static equals(a: ChatMessage | PlainMessage | undefined, b: ChatMessage | PlainMessage | undefined): boolean { + return proto3.util.equals(ChatMessage, a, b); + } +} + +/** + * @generated from message livekit.proto.ChatMessageReceived + */ +export class ChatMessageReceived extends Message { + /** + * @generated from field: livekit.proto.ChatMessage message = 1; + */ + message?: ChatMessage; + + /** + * @generated from field: string participant_identity = 2; + */ + participantIdentity = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "livekit.proto.ChatMessageReceived"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "message", kind: "message", T: ChatMessage }, + { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChatMessageReceived { + return new ChatMessageReceived().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChatMessageReceived { + return new ChatMessageReceived().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChatMessageReceived { + return new ChatMessageReceived().fromJsonString(jsonString, options); + } + + static equals(a: ChatMessageReceived | PlainMessage | undefined, b: ChatMessageReceived | PlainMessage | undefined): boolean { + return proto3.util.equals(ChatMessageReceived, a, b); + } +} + /** * @generated from message livekit.proto.SipDTMF */ From aa9c8cf1135158898a13a9cb874a57cfa457468b Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 11 Oct 2024 16:01:18 -0700 Subject: [PATCH 095/126] fix --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 6c103fb4..f321ecd8 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 6c103fb4f78f4da205f4935cb8750cf70a475bd9 +Subproject commit f321ecd818e9a7ee8689b32cc3b59565b0862dde diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 0af386b7..9ef058bc 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -444,6 +444,7 @@ export class LocalParticipant extends Participant { } const req = new RpcMethodInvocationResponseRequest({ + localParticipantHandle: this.ffi_handle.handle, invocationId, error: responseError ? responseError.toProto() : undefined, payload: responsePayload ?? undefined, From 8f065a2144e5ddf20ed09a73d0bbf04b587f0173 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 15 Oct 2024 13:22:53 -0700 Subject: [PATCH 096/126] use identity --- examples/rpc/index.ts | 198 ++++++------------------ packages/livekit-rtc/README.md | 2 +- packages/livekit-rtc/src/participant.ts | 4 +- packages/livekit-rtc/src/room.ts | 3 +- 4 files changed, 48 insertions(+), 159 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index c8263fd7..06b48b0b 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,5 +1,4 @@ -import { Room, RpcError } from '@livekit/rtc-node'; -import type { RemoteParticipant } from '@livekit/rtc-node'; +import { Room } from '@livekit/rtc-node'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; import { AccessToken } from 'livekit-server-sdk'; @@ -13,174 +12,65 @@ if (!LIVEKIT_API_KEY || !LIVEKIT_API_SECRET || !LIVEKIT_URL) { } async function main() { - const roomName = `rpc-test-${randomBytes(4).toString('hex')}`; + const roomName = `data-test-${randomBytes(4).toString('hex')}`; console.log(`Connecting participants to room: ${roomName}`); - const [callersRoom, greetersRoom, mathGeniusRoom] = await Promise.all([ - connectParticipant('caller', roomName), - connectParticipant('greeter', roomName), - connectParticipant('math-genius', roomName), + const [senderRoom, receiverRoom] = await Promise.all([ + connectParticipant('sender', roomName), + connectParticipant('receiver', roomName), ]); - // Register all methods for the receiving participant - await registerReceiverMethods(greetersRoom, mathGeniusRoom); + // Generate 256KB of random data in 32KB chunks + const totalSize = 256 * 1024; + const chunkSize = 32 * 1024; + const numChunks = totalSize / chunkSize; + const data = new Uint8Array(totalSize); - try { - console.log('\n\nRunning greeting example...'); - await Promise.all([performGreeting(callersRoom)]); - } catch (error) { - console.error('Error:', error); + for (let i = 0; i < numChunks; i++) { + const chunk = new Uint8Array(chunkSize); + crypto.getRandomValues(chunk); + data.set(chunk, i * chunkSize); } - try { - console.log('\n\nRunning error handling example...'); - await Promise.all([performDivision(callersRoom)]); - } catch (error) { - console.error('Error:', error); - } + // Set up receiver to log received data + let totalReceivedBytes = 0; + const dataReceivedPromise = new Promise((resolve) => { + receiverRoom.on('dataReceived', (payload: Uint8Array, topic?: string) => { + totalReceivedBytes += payload.byteLength; + console.log(`[Receiver] Received data:`); + console.log(` Size: ${payload.byteLength} bytes`); + console.log(` Total received: ${totalReceivedBytes} bytes`); + console.log(` First 10 bytes: ${Array.from(payload.slice(0, 10)).map(b => b.toString(16).padStart(2, '0')).join(' ')}`); + console.log(` Last 10 bytes: ${Array.from(payload.slice(-10)).map(b => b.toString(16).padStart(2, '0')).join(' ')}`); + if (topic) { + console.log(` Topic: ${topic}`); + } + if (totalReceivedBytes >= totalSize) { + resolve(); + } + }); + }); - try { - console.log('\n\nRunning math example...'); - await Promise.all([ - performSquareRoot(callersRoom) - .then(() => new Promise((resolve) => setTimeout(resolve, 2000))) - .then(() => performQuantumHypergeometricSeries(callersRoom)), - ]); - } catch (error) { - console.error('Error:', error); - } + // Send data + console.log('[Sender] Sending 256KB of data...'); + await senderRoom.localParticipant.publishData(data, { reliable: true }); + console.log('[Sender] Data sent'); + + // Wait for all data to be received + console.log('Waiting for all data to be received...'); + await dataReceivedPromise; + console.log('All data received.'); - console.log('\n\nParticipants done, disconnecting...'); - await callersRoom.disconnect(); - await greetersRoom.disconnect(); - await mathGeniusRoom.disconnect(); + console.log('\nDisconnecting participants...'); + await senderRoom.disconnect(); + await receiverRoom.disconnect(); console.log('Participants disconnected. Example completed.'); process.exit(0); } -const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room): Promise => { - await greetersRoom.localParticipant?.registerRpcMethod( - 'arrival', - // eslint-disable-next-line @typescript-eslint/no-unused-vars - async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { - console.log(`[Greeter] Oh ${caller.identity} arrived and said "${payload}"`); - await new Promise((resolve) => setTimeout(resolve, 2000)); - return "Welcome and have a wonderful day!"; - }, - ); - - await mathGeniusRoom.localParticipant?.registerRpcMethod( - 'square-root', - async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { - const jsonData = JSON.parse(payload); - const number = jsonData.number; - console.log( - `[Math Genius] I guess ${caller.identity} wants the square root of ${number}. I've only got ${responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, - ); - - console.log(`[Math Genius] *doing math*…`); - await new Promise((resolve) => setTimeout(resolve, 2000)); - - const result = Math.sqrt(number); - console.log(`[Math Genius] Aha! It's ${result}`); - return JSON.stringify({ result }); - }, - ); - - await mathGeniusRoom.localParticipant?.registerRpcMethod( - 'divide', - // eslint-disable-next-line @typescript-eslint/no-unused-vars - async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { - const jsonData = JSON.parse(payload); - const { numerator, denominator } = jsonData; - console.log( - `[Math Genius] ${caller.identity} wants to divide ${numerator} by ${denominator}. This could be interesting...`, - ); - - if (denominator === 0) { - console.log(`[Math Genius] Uh oh, divide by zero! This won't end well...`); - throw new Error('Cannot divide by zero'); - } - - const result = numerator / denominator; - console.log(`[Math Genius] The result is ${result}`); - return JSON.stringify({ result }); - }, - ); -}; - -const performGreeting = async (room: Room): Promise => { - console.log('[Caller] Letting the greeter know that I\'ve arrived'); - try { - const response = await room.localParticipant!.performRpc('greeter', 'arrival', 'Hello'); - console.log(`[Caller] That's nice, the greeter said: "${response}"`); - } catch (error) { - console.error('[Caller] RPC call failed:', error); - throw error; - } -}; - -const performSquareRoot = async (room: Room): Promise => { - console.log("[Caller] What's the square root of 16?"); - try { - const response = await room.localParticipant!.performRpc('math-genius', 'square-root', JSON.stringify({ number: 16 })); - const parsedResponse = JSON.parse(response); - console.log(`[Caller] Nice, the answer was ${parsedResponse.result}`); - } catch (error) { - console.error('[Caller] RPC call failed:', error); - throw error; - } -}; - -const performQuantumHypergeometricSeries = async (room: Room): Promise => { - console.log("[Caller] What's the quantum hypergeometric series of 42?"); - try { - const response = await room.localParticipant!.performRpc( - 'math-genius', - 'quantum-hypergeometric-series', - JSON.stringify({ number: 42 }) - ); - const parsedResponse = JSON.parse(response); - console.log(`[Caller] genius says ${parsedResponse.result}!`); - } catch (error) { - if (error instanceof RpcError) { - if (error.code === RpcError.ErrorCode.UNSUPPORTED_METHOD) { - console.log(`[Caller] Aww looks like the genius doesn't know that one.`); - return; - } - } - - console.error('[Caller] Unexpected error:', error); - throw error; - } -}; - -const performDivision = async (room: Room): Promise => { - console.log("[Caller] Let's try dividing 10 by 0"); - try { - const response = await room.localParticipant!.performRpc( - 'math-genius', - 'divide', - JSON.stringify({ numerator: 10, denominator: 0 }) - ); - const parsedResponse = JSON.parse(response); - console.log(`[Caller] The result is ${parsedResponse.result}`); - } catch (error) { - if (error instanceof RpcError) { - if (error.code === RpcError.ErrorCode.APPLICATION_ERROR) { - console.log(`[Caller] Oops! I guess that didn't work. Let's try something else.`); - } else { - console.error('[Caller] Unexpected RPC error:', error); - } - } else { - console.error('[Caller] Unexpected error:', error); - } - } -}; - const createToken = (identity: string, roomName: string) => { const token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET, { identity, diff --git a/packages/livekit-rtc/README.md b/packages/livekit-rtc/README.md index df713706..f7bd043f 100644 --- a/packages/livekit-rtc/README.md +++ b/packages/livekit-rtc/README.md @@ -92,7 +92,7 @@ room.localParticipant?.registerRpcMethod( 'greet', // method handler - will be called when the method is invoked by a RemoteParticipant - async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + async (requestId: string, callerIdentity: string, payload: string, responseTimeoutMs: number) => { console.log(`Received greeting from ${caller.identity}: ${payload}`); return `Hello, ${caller.identity}!`; } diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 9ef058bc..44656b41 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -416,7 +416,7 @@ export class LocalParticipant extends Participant { invocationId: bigint, method: string, requestId: string, - caller: RemoteParticipant, + callerIdentity: string, payload: string, responseTimeoutMs: number, ) { @@ -429,7 +429,7 @@ export class LocalParticipant extends Participant { responseError = RpcError.builtIn('UNSUPPORTED_METHOD'); } else { try { - responsePayload = await handler(requestId, caller, payload, responseTimeoutMs); + responsePayload = await handler(requestId, callerIdentity, payload, responseTimeoutMs); } catch (error) { if (error instanceof RpcError) { responseError = error; diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 63baddbf..c5efdfb6 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -167,12 +167,11 @@ export class Room extends (EventEmitter as new () => TypedEmitter if ( ffiEvent.message.value.localParticipantHandle == this.localParticipant.ffi_handle.handle ) { - const caller = this.remoteParticipants.get(ffiEvent.message.value.callerIdentity); this.localParticipant.handleRpcMethodInvocation( ffiEvent.message.value.invocationId, ffiEvent.message.value.method, ffiEvent.message.value.requestId, - caller, + ffiEvent.message.value.callerIdentity, ffiEvent.message.value.payload, ffiEvent.message.value.responseTimeoutMs, ); From 85bda319776d5fa0d2de2a44297e98b915034897 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 18 Oct 2024 16:36:01 -0700 Subject: [PATCH 097/126] r --- packages/livekit-rtc/rust-sdks | 2 +- .../livekit-rtc/src/proto/audio_frame_pb.ts | 667 +++---- packages/livekit-rtc/src/proto/e2ee_pb.ts | 380 ++-- packages/livekit-rtc/src/proto/ffi_pb.ts | 122 +- packages/livekit-rtc/src/proto/handle_pb.ts | 18 +- .../livekit-rtc/src/proto/participant_pb.ts | 62 +- packages/livekit-rtc/src/proto/room_pb.ts | 1737 +++++++++-------- packages/livekit-rtc/src/proto/stats_pb.ts | 1624 +++++++-------- packages/livekit-rtc/src/proto/track_pb.ts | 348 ++-- .../livekit-rtc/src/proto/video_frame_pb.ts | 467 ++--- 10 files changed, 2793 insertions(+), 2634 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 73106cfb..17967c42 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 73106cfb0211508f9564002c0eac1a5683d49d75 +Subproject commit 17967c42898ac45eca97d7c92127d7d860f7b616 diff --git a/packages/livekit-rtc/src/proto/audio_frame_pb.ts b/packages/livekit-rtc/src/proto/audio_frame_pb.ts index c6e0dba5..8daa5ab9 100644 --- a/packages/livekit-rtc/src/proto/audio_frame_pb.ts +++ b/packages/livekit-rtc/src/proto/audio_frame_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file audio_frame.proto (package livekit.proto, syntax proto3) +// @generated from file audio_frame.proto (package livekit.proto, syntax proto2) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { Message, proto2 } from "@bufbuild/protobuf"; import { TrackSource } from "./track_pb.js"; import { FfiOwnedHandle } from "./handle_pb.js"; @@ -38,8 +38,8 @@ export enum SoxResamplerDataType { */ SOXR_DATATYPE_INT16S = 1, } -// Retrieve enum metadata with: proto3.getEnumType(SoxResamplerDataType) -proto3.util.setEnumType(SoxResamplerDataType, "livekit.proto.SoxResamplerDataType", [ +// Retrieve enum metadata with: proto2.getEnumType(SoxResamplerDataType) +proto2.util.setEnumType(SoxResamplerDataType, "livekit.proto.SoxResamplerDataType", [ { no: 0, name: "SOXR_DATATYPE_INT16I" }, { no: 1, name: "SOXR_DATATYPE_INT16S" }, ]); @@ -73,8 +73,8 @@ export enum SoxQualityRecipe { */ SOXR_QUALITY_VERYHIGH = 4, } -// Retrieve enum metadata with: proto3.getEnumType(SoxQualityRecipe) -proto3.util.setEnumType(SoxQualityRecipe, "livekit.proto.SoxQualityRecipe", [ +// Retrieve enum metadata with: proto2.getEnumType(SoxQualityRecipe) +proto2.util.setEnumType(SoxQualityRecipe, "livekit.proto.SoxQualityRecipe", [ { no: 0, name: "SOXR_QUALITY_QUICK" }, { no: 1, name: "SOXR_QUALITY_LOW" }, { no: 2, name: "SOXR_QUALITY_MEDIUM" }, @@ -128,8 +128,8 @@ export enum SoxFlagBits { */ SOXR_VR = 5, } -// Retrieve enum metadata with: proto3.getEnumType(SoxFlagBits) -proto3.util.setEnumType(SoxFlagBits, "livekit.proto.SoxFlagBits", [ +// Retrieve enum metadata with: proto2.getEnumType(SoxFlagBits) +proto2.util.setEnumType(SoxFlagBits, "livekit.proto.SoxFlagBits", [ { no: 0, name: "SOXR_ROLLOFF_SMALL" }, { no: 1, name: "SOXR_ROLLOFF_MEDIUM" }, { no: 2, name: "SOXR_ROLLOFF_NONE" }, @@ -152,8 +152,8 @@ export enum AudioStreamType { */ AUDIO_STREAM_HTML = 1, } -// Retrieve enum metadata with: proto3.getEnumType(AudioStreamType) -proto3.util.setEnumType(AudioStreamType, "livekit.proto.AudioStreamType", [ +// Retrieve enum metadata with: proto2.getEnumType(AudioStreamType) +proto2.util.setEnumType(AudioStreamType, "livekit.proto.AudioStreamType", [ { no: 0, name: "AUDIO_STREAM_NATIVE" }, { no: 1, name: "AUDIO_STREAM_HTML" }, ]); @@ -167,8 +167,8 @@ export enum AudioSourceType { */ AUDIO_SOURCE_NATIVE = 0, } -// Retrieve enum metadata with: proto3.getEnumType(AudioSourceType) -proto3.util.setEnumType(AudioSourceType, "livekit.proto.AudioSourceType", [ +// Retrieve enum metadata with: proto2.getEnumType(AudioSourceType) +proto2.util.setEnumType(AudioSourceType, "livekit.proto.AudioSourceType", [ { no: 0, name: "AUDIO_SOURCE_NATIVE" }, ]); @@ -180,37 +180,37 @@ proto3.util.setEnumType(AudioSourceType, "livekit.proto.AudioSourceType", [ */ export class NewAudioStreamRequest extends Message { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle?: bigint; /** - * @generated from field: livekit.proto.AudioStreamType type = 2; + * @generated from field: required livekit.proto.AudioStreamType type = 2; */ - type = AudioStreamType.AUDIO_STREAM_NATIVE; + type?: AudioStreamType; /** - * @generated from field: uint32 sample_rate = 3; + * @generated from field: required uint32 sample_rate = 3; */ - sampleRate = 0; + sampleRate?: number; /** - * @generated from field: uint32 num_channels = 4; + * @generated from field: required uint32 num_channels = 4; */ - numChannels = 0; + numChannels?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewAudioStreamRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AudioStreamType) }, - { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(AudioStreamType), req: true }, + { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 4, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioStreamRequest { @@ -226,7 +226,7 @@ export class NewAudioStreamRequest extends Message { } static equals(a: NewAudioStreamRequest | PlainMessage | undefined, b: NewAudioStreamRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioStreamRequest, a, b); + return proto2.util.equals(NewAudioStreamRequest, a, b); } } @@ -235,19 +235,19 @@ export class NewAudioStreamRequest extends Message { */ export class NewAudioStreamResponse extends Message { /** - * @generated from field: livekit.proto.OwnedAudioStream stream = 1; + * @generated from field: required livekit.proto.OwnedAudioStream stream = 1; */ stream?: OwnedAudioStream; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewAudioStreamResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedAudioStream }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "stream", kind: "message", T: OwnedAudioStream, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioStreamResponse { @@ -263,7 +263,7 @@ export class NewAudioStreamResponse extends Message { } static equals(a: NewAudioStreamResponse | PlainMessage | undefined, b: NewAudioStreamResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioStreamResponse, a, b); + return proto2.util.equals(NewAudioStreamResponse, a, b); } } @@ -272,14 +272,14 @@ export class NewAudioStreamResponse extends Message { */ export class AudioStreamFromParticipantRequest extends Message { /** - * @generated from field: uint64 participant_handle = 1; + * @generated from field: required uint64 participant_handle = 1; */ - participantHandle = protoInt64.zero; + participantHandle?: bigint; /** - * @generated from field: livekit.proto.AudioStreamType type = 2; + * @generated from field: required livekit.proto.AudioStreamType type = 2; */ - type = AudioStreamType.AUDIO_STREAM_NATIVE; + type?: AudioStreamType; /** * @generated from field: optional livekit.proto.TrackSource track_source = 3; @@ -287,28 +287,28 @@ export class AudioStreamFromParticipantRequest extends Message) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioStreamFromParticipantRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AudioStreamType) }, - { no: 3, name: "track_source", kind: "enum", T: proto3.getEnumType(TrackSource), opt: true }, - { no: 5, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 6, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(AudioStreamType), req: true }, + { no: 3, name: "track_source", kind: "enum", T: proto2.getEnumType(TrackSource), opt: true }, + { no: 5, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 6, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamFromParticipantRequest { @@ -324,7 +324,7 @@ export class AudioStreamFromParticipantRequest extends Message | undefined, b: AudioStreamFromParticipantRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamFromParticipantRequest, a, b); + return proto2.util.equals(AudioStreamFromParticipantRequest, a, b); } } @@ -333,19 +333,19 @@ export class AudioStreamFromParticipantRequest extends Message { /** - * @generated from field: livekit.proto.OwnedAudioStream stream = 1; + * @generated from field: required livekit.proto.OwnedAudioStream stream = 1; */ stream?: OwnedAudioStream; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioStreamFromParticipantResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedAudioStream }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "stream", kind: "message", T: OwnedAudioStream, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamFromParticipantResponse { @@ -361,7 +361,7 @@ export class AudioStreamFromParticipantResponse extends Message | undefined, b: AudioStreamFromParticipantResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamFromParticipantResponse, a, b); + return proto2.util.equals(AudioStreamFromParticipantResponse, a, b); } } @@ -372,9 +372,9 @@ export class AudioStreamFromParticipantResponse extends Message { /** - * @generated from field: livekit.proto.AudioSourceType type = 1; + * @generated from field: required livekit.proto.AudioSourceType type = 1; */ - type = AudioSourceType.AUDIO_SOURCE_NATIVE; + type?: AudioSourceType; /** * @generated from field: optional livekit.proto.AudioSourceOptions options = 2; @@ -382,33 +382,33 @@ export class NewAudioSourceRequest extends Message { options?: AudioSourceOptions; /** - * @generated from field: uint32 sample_rate = 3; + * @generated from field: required uint32 sample_rate = 3; */ - sampleRate = 0; + sampleRate?: number; /** - * @generated from field: uint32 num_channels = 4; + * @generated from field: required uint32 num_channels = 4; */ - numChannels = 0; + numChannels?: number; /** - * @generated from field: uint32 queue_size_ms = 5; + * @generated from field: required uint32 queue_size_ms = 5; */ - queueSizeMs = 0; + queueSizeMs?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewAudioSourceRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(AudioSourceType) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(AudioSourceType), req: true }, { 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: "queue_size_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 4, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 5, name: "queue_size_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioSourceRequest { @@ -424,7 +424,7 @@ export class NewAudioSourceRequest extends Message { } static equals(a: NewAudioSourceRequest | PlainMessage | undefined, b: NewAudioSourceRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioSourceRequest, a, b); + return proto2.util.equals(NewAudioSourceRequest, a, b); } } @@ -433,19 +433,19 @@ export class NewAudioSourceRequest extends Message { */ export class NewAudioSourceResponse extends Message { /** - * @generated from field: livekit.proto.OwnedAudioSource source = 1; + * @generated from field: required livekit.proto.OwnedAudioSource source = 1; */ source?: OwnedAudioSource; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewAudioSourceResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source", kind: "message", T: OwnedAudioSource }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "source", kind: "message", T: OwnedAudioSource, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioSourceResponse { @@ -461,7 +461,7 @@ export class NewAudioSourceResponse extends Message { } static equals(a: NewAudioSourceResponse | PlainMessage | undefined, b: NewAudioSourceResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioSourceResponse, a, b); + return proto2.util.equals(NewAudioSourceResponse, a, b); } } @@ -473,25 +473,25 @@ export class NewAudioSourceResponse extends Message { */ export class CaptureAudioFrameRequest extends Message { /** - * @generated from field: uint64 source_handle = 1; + * @generated from field: required uint64 source_handle = 1; */ - sourceHandle = protoInt64.zero; + sourceHandle?: bigint; /** - * @generated from field: livekit.proto.AudioFrameBufferInfo buffer = 2; + * @generated from field: required livekit.proto.AudioFrameBufferInfo buffer = 2; */ buffer?: AudioFrameBufferInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CaptureAudioFrameRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CaptureAudioFrameRequest { @@ -507,7 +507,7 @@ export class CaptureAudioFrameRequest extends Message } static equals(a: CaptureAudioFrameRequest | PlainMessage | undefined, b: CaptureAudioFrameRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureAudioFrameRequest, a, b); + return proto2.util.equals(CaptureAudioFrameRequest, a, b); } } @@ -516,19 +516,19 @@ export class CaptureAudioFrameRequest extends Message */ export class CaptureAudioFrameResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CaptureAudioFrameResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CaptureAudioFrameResponse { @@ -544,7 +544,7 @@ export class CaptureAudioFrameResponse extends Message | undefined, b: CaptureAudioFrameResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureAudioFrameResponse, a, b); + return proto2.util.equals(CaptureAudioFrameResponse, a, b); } } @@ -553,9 +553,9 @@ export class CaptureAudioFrameResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** * @generated from field: optional string error = 2; @@ -564,13 +564,13 @@ export class CaptureAudioFrameCallback extends Message) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CaptureAudioFrameCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -587,7 +587,7 @@ export class CaptureAudioFrameCallback extends Message | undefined, b: CaptureAudioFrameCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureAudioFrameCallback, a, b); + return proto2.util.equals(CaptureAudioFrameCallback, a, b); } } @@ -596,19 +596,19 @@ export class CaptureAudioFrameCallback extends Message { /** - * @generated from field: uint64 source_handle = 1; + * @generated from field: required uint64 source_handle = 1; */ - sourceHandle = protoInt64.zero; + sourceHandle?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ClearAudioBufferRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ClearAudioBufferRequest { @@ -624,7 +624,7 @@ export class ClearAudioBufferRequest extends Message { } static equals(a: ClearAudioBufferRequest | PlainMessage | undefined, b: ClearAudioBufferRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ClearAudioBufferRequest, a, b); + return proto2.util.equals(ClearAudioBufferRequest, a, b); } } @@ -634,12 +634,12 @@ export class ClearAudioBufferRequest extends Message { export class ClearAudioBufferResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ClearAudioBufferResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): ClearAudioBufferResponse { @@ -655,7 +655,7 @@ export class ClearAudioBufferResponse extends Message } static equals(a: ClearAudioBufferResponse | PlainMessage | undefined, b: ClearAudioBufferResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ClearAudioBufferResponse, a, b); + return proto2.util.equals(ClearAudioBufferResponse, a, b); } } @@ -667,12 +667,12 @@ export class ClearAudioBufferResponse extends Message export class NewAudioResamplerRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewAudioResamplerRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioResamplerRequest { @@ -688,7 +688,7 @@ export class NewAudioResamplerRequest extends Message } static equals(a: NewAudioResamplerRequest | PlainMessage | undefined, b: NewAudioResamplerRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioResamplerRequest, a, b); + return proto2.util.equals(NewAudioResamplerRequest, a, b); } } @@ -697,19 +697,19 @@ export class NewAudioResamplerRequest extends Message */ export class NewAudioResamplerResponse extends Message { /** - * @generated from field: livekit.proto.OwnedAudioResampler resampler = 1; + * @generated from field: required livekit.proto.OwnedAudioResampler resampler = 1; */ resampler?: OwnedAudioResampler; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewAudioResamplerResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler", kind: "message", T: OwnedAudioResampler }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "resampler", kind: "message", T: OwnedAudioResampler, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioResamplerResponse { @@ -725,7 +725,7 @@ export class NewAudioResamplerResponse extends Message | undefined, b: NewAudioResamplerResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioResamplerResponse, a, b); + return proto2.util.equals(NewAudioResamplerResponse, a, b); } } @@ -736,37 +736,37 @@ export class NewAudioResamplerResponse extends Message { /** - * @generated from field: uint64 resampler_handle = 1; + * @generated from field: required uint64 resampler_handle = 1; */ - resamplerHandle = protoInt64.zero; + resamplerHandle?: bigint; /** - * @generated from field: livekit.proto.AudioFrameBufferInfo buffer = 2; + * @generated from field: required livekit.proto.AudioFrameBufferInfo buffer = 2; */ buffer?: AudioFrameBufferInfo; /** - * @generated from field: uint32 num_channels = 3; + * @generated from field: required uint32 num_channels = 3; */ - numChannels = 0; + numChannels?: number; /** - * @generated from field: uint32 sample_rate = 4; + * @generated from field: required uint32 sample_rate = 4; */ - sampleRate = 0; + sampleRate?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RemixAndResampleRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo }, - { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo, req: true }, + { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 4, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RemixAndResampleRequest { @@ -782,7 +782,7 @@ export class RemixAndResampleRequest extends Message { } static equals(a: RemixAndResampleRequest | PlainMessage | undefined, b: RemixAndResampleRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RemixAndResampleRequest, a, b); + return proto2.util.equals(RemixAndResampleRequest, a, b); } } @@ -791,19 +791,19 @@ export class RemixAndResampleRequest extends Message { */ export class RemixAndResampleResponse extends Message { /** - * @generated from field: livekit.proto.OwnedAudioFrameBuffer buffer = 1; + * @generated from field: required livekit.proto.OwnedAudioFrameBuffer buffer = 1; */ buffer?: OwnedAudioFrameBuffer; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RemixAndResampleResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "buffer", kind: "message", T: OwnedAudioFrameBuffer }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "buffer", kind: "message", T: OwnedAudioFrameBuffer, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RemixAndResampleResponse { @@ -819,7 +819,7 @@ export class RemixAndResampleResponse extends Message } static equals(a: RemixAndResampleResponse | PlainMessage | undefined, b: RemixAndResampleResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RemixAndResampleResponse, a, b); + return proto2.util.equals(RemixAndResampleResponse, a, b); } } @@ -828,55 +828,55 @@ export class RemixAndResampleResponse extends Message */ export class NewSoxResamplerRequest extends Message { /** - * @generated from field: double input_rate = 1; + * @generated from field: required double input_rate = 1; */ - inputRate = 0; + inputRate?: number; /** - * @generated from field: double output_rate = 2; + * @generated from field: required double output_rate = 2; */ - outputRate = 0; + outputRate?: number; /** - * @generated from field: uint32 num_channels = 3; + * @generated from field: required uint32 num_channels = 3; */ - numChannels = 0; + numChannels?: number; /** - * @generated from field: livekit.proto.SoxResamplerDataType input_data_type = 4; + * @generated from field: required livekit.proto.SoxResamplerDataType input_data_type = 4; */ - inputDataType = SoxResamplerDataType.SOXR_DATATYPE_INT16I; + inputDataType?: SoxResamplerDataType; /** - * @generated from field: livekit.proto.SoxResamplerDataType output_data_type = 5; + * @generated from field: required livekit.proto.SoxResamplerDataType output_data_type = 5; */ - outputDataType = SoxResamplerDataType.SOXR_DATATYPE_INT16I; + outputDataType?: SoxResamplerDataType; /** - * @generated from field: livekit.proto.SoxQualityRecipe quality_recipe = 6; + * @generated from field: required livekit.proto.SoxQualityRecipe quality_recipe = 6; */ - qualityRecipe = SoxQualityRecipe.SOXR_QUALITY_QUICK; + qualityRecipe?: SoxQualityRecipe; /** - * @generated from field: uint32 flags = 7; + * @generated from field: required uint32 flags = 7; */ - flags = 0; + flags?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewSoxResamplerRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "input_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 2, name: "output_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "input_data_type", kind: "enum", T: proto3.getEnumType(SoxResamplerDataType) }, - { no: 5, name: "output_data_type", kind: "enum", T: proto3.getEnumType(SoxResamplerDataType) }, - { no: 6, name: "quality_recipe", kind: "enum", T: proto3.getEnumType(SoxQualityRecipe) }, - { no: 7, name: "flags", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "input_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 2, name: "output_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 4, name: "input_data_type", kind: "enum", T: proto2.getEnumType(SoxResamplerDataType), req: true }, + { no: 5, name: "output_data_type", kind: "enum", T: proto2.getEnumType(SoxResamplerDataType), req: true }, + { no: 6, name: "quality_recipe", kind: "enum", T: proto2.getEnumType(SoxQualityRecipe), req: true }, + { no: 7, name: "flags", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewSoxResamplerRequest { @@ -892,7 +892,7 @@ export class NewSoxResamplerRequest extends Message { } static equals(a: NewSoxResamplerRequest | PlainMessage | undefined, b: NewSoxResamplerRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewSoxResamplerRequest, a, b); + return proto2.util.equals(NewSoxResamplerRequest, a, b); } } @@ -901,25 +901,32 @@ export class NewSoxResamplerRequest extends Message { */ export class NewSoxResamplerResponse extends Message { /** - * @generated from field: livekit.proto.OwnedSoxResampler resampler = 1; + * @generated from oneof livekit.proto.NewSoxResamplerResponse.message */ - resampler?: OwnedSoxResampler; - - /** - * @generated from field: optional string error = 2; - */ - error?: string; + message: { + /** + * @generated from field: livekit.proto.OwnedSoxResampler resampler = 1; + */ + value: OwnedSoxResampler; + case: "resampler"; + } | { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewSoxResamplerResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler", kind: "message", T: OwnedSoxResampler }, - { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "resampler", kind: "message", T: OwnedSoxResampler, oneof: "message" }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewSoxResamplerResponse { @@ -935,7 +942,7 @@ export class NewSoxResamplerResponse extends Message { } static equals(a: NewSoxResamplerResponse | PlainMessage | undefined, b: NewSoxResamplerResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewSoxResamplerResponse, a, b); + return proto2.util.equals(NewSoxResamplerResponse, a, b); } } @@ -944,35 +951,35 @@ export class NewSoxResamplerResponse extends Message { */ export class PushSoxResamplerRequest extends Message { /** - * @generated from field: uint64 resampler_handle = 1; + * @generated from field: required uint64 resampler_handle = 1; */ - resamplerHandle = protoInt64.zero; + resamplerHandle?: bigint; /** * *const i16 * - * @generated from field: uint64 data_ptr = 2; + * @generated from field: required uint64 data_ptr = 2; */ - dataPtr = protoInt64.zero; + dataPtr?: bigint; /** * in bytes * - * @generated from field: uint32 size = 3; + * @generated from field: required uint32 size = 3; */ - size = 0; + size?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PushSoxResamplerRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PushSoxResamplerRequest { @@ -988,7 +995,7 @@ export class PushSoxResamplerRequest extends Message { } static equals(a: PushSoxResamplerRequest | PlainMessage | undefined, b: PushSoxResamplerRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PushSoxResamplerRequest, a, b); + return proto2.util.equals(PushSoxResamplerRequest, a, b); } } @@ -999,16 +1006,16 @@ export class PushSoxResamplerResponse extends Message /** * *const i16 (could be null) * - * @generated from field: uint64 output_ptr = 1; + * @generated from field: required uint64 output_ptr = 1; */ - outputPtr = protoInt64.zero; + outputPtr?: bigint; /** * in bytes * - * @generated from field: uint32 size = 2; + * @generated from field: required uint32 size = 2; */ - size = 0; + size?: number; /** * @generated from field: optional string error = 3; @@ -1017,14 +1024,14 @@ export class PushSoxResamplerResponse extends Message constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PushSoxResamplerResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1041,7 +1048,7 @@ export class PushSoxResamplerResponse extends Message } static equals(a: PushSoxResamplerResponse | PlainMessage | undefined, b: PushSoxResamplerResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PushSoxResamplerResponse, a, b); + return proto2.util.equals(PushSoxResamplerResponse, a, b); } } @@ -1050,19 +1057,19 @@ export class PushSoxResamplerResponse extends Message */ export class FlushSoxResamplerRequest extends Message { /** - * @generated from field: uint64 resampler_handle = 1; + * @generated from field: required uint64 resampler_handle = 1; */ - resamplerHandle = protoInt64.zero; + resamplerHandle?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FlushSoxResamplerRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FlushSoxResamplerRequest { @@ -1078,7 +1085,7 @@ export class FlushSoxResamplerRequest extends Message } static equals(a: FlushSoxResamplerRequest | PlainMessage | undefined, b: FlushSoxResamplerRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(FlushSoxResamplerRequest, a, b); + return proto2.util.equals(FlushSoxResamplerRequest, a, b); } } @@ -1089,16 +1096,16 @@ export class FlushSoxResamplerResponse extends Message) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FlushSoxResamplerResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1131,7 +1138,7 @@ export class FlushSoxResamplerResponse extends Message | undefined, b: FlushSoxResamplerResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(FlushSoxResamplerResponse, a, b); + return proto2.util.equals(FlushSoxResamplerResponse, a, b); } } @@ -1142,37 +1149,37 @@ export class AudioFrameBufferInfo extends Message { /** * *const i16 * - * @generated from field: uint64 data_ptr = 1; + * @generated from field: required uint64 data_ptr = 1; */ - dataPtr = protoInt64.zero; + dataPtr?: bigint; /** - * @generated from field: uint32 num_channels = 2; + * @generated from field: required uint32 num_channels = 2; */ - numChannels = 0; + numChannels?: number; /** - * @generated from field: uint32 sample_rate = 3; + * @generated from field: required uint32 sample_rate = 3; */ - sampleRate = 0; + sampleRate?: number; /** - * @generated from field: uint32 samples_per_channel = 4; + * @generated from field: required uint32 samples_per_channel = 4; */ - samplesPerChannel = 0; + samplesPerChannel?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioFrameBufferInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "samples_per_channel", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 4, name: "samples_per_channel", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioFrameBufferInfo { @@ -1188,7 +1195,7 @@ export class AudioFrameBufferInfo extends Message { } static equals(a: AudioFrameBufferInfo | PlainMessage | undefined, b: AudioFrameBufferInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioFrameBufferInfo, a, b); + return proto2.util.equals(AudioFrameBufferInfo, a, b); } } @@ -1197,25 +1204,25 @@ export class AudioFrameBufferInfo extends Message { */ export class OwnedAudioFrameBuffer extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.AudioFrameBufferInfo info = 2; + * @generated from field: required livekit.proto.AudioFrameBufferInfo info = 2; */ info?: AudioFrameBufferInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedAudioFrameBuffer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: AudioFrameBufferInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: AudioFrameBufferInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioFrameBuffer { @@ -1231,7 +1238,7 @@ export class OwnedAudioFrameBuffer extends Message { } static equals(a: OwnedAudioFrameBuffer | PlainMessage | undefined, b: OwnedAudioFrameBuffer | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedAudioFrameBuffer, a, b); + return proto2.util.equals(OwnedAudioFrameBuffer, a, b); } } @@ -1240,19 +1247,19 @@ export class OwnedAudioFrameBuffer extends Message { */ export class AudioStreamInfo extends Message { /** - * @generated from field: livekit.proto.AudioStreamType type = 1; + * @generated from field: required livekit.proto.AudioStreamType type = 1; */ - type = AudioStreamType.AUDIO_STREAM_NATIVE; + type?: AudioStreamType; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioStreamInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(AudioStreamType) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(AudioStreamType), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamInfo { @@ -1268,7 +1275,7 @@ export class AudioStreamInfo extends Message { } static equals(a: AudioStreamInfo | PlainMessage | undefined, b: AudioStreamInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamInfo, a, b); + return proto2.util.equals(AudioStreamInfo, a, b); } } @@ -1277,25 +1284,25 @@ export class AudioStreamInfo extends Message { */ export class OwnedAudioStream extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.AudioStreamInfo info = 2; + * @generated from field: required livekit.proto.AudioStreamInfo info = 2; */ info?: AudioStreamInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedAudioStream"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: AudioStreamInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: AudioStreamInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioStream { @@ -1311,7 +1318,7 @@ export class OwnedAudioStream extends Message { } static equals(a: OwnedAudioStream | PlainMessage | undefined, b: OwnedAudioStream | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedAudioStream, a, b); + return proto2.util.equals(OwnedAudioStream, a, b); } } @@ -1320,9 +1327,9 @@ export class OwnedAudioStream extends Message { */ export class AudioStreamEvent extends Message { /** - * @generated from field: uint64 stream_handle = 1; + * @generated from field: required uint64 stream_handle = 1; */ - streamHandle = protoInt64.zero; + streamHandle?: bigint; /** * @generated from oneof livekit.proto.AudioStreamEvent.message @@ -1343,13 +1350,13 @@ export class AudioStreamEvent extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioStreamEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "frame_received", kind: "message", T: AudioFrameReceived, oneof: "message" }, { no: 3, name: "eos", kind: "message", T: AudioStreamEOS, oneof: "message" }, ]); @@ -1367,7 +1374,7 @@ export class AudioStreamEvent extends Message { } static equals(a: AudioStreamEvent | PlainMessage | undefined, b: AudioStreamEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamEvent, a, b); + return proto2.util.equals(AudioStreamEvent, a, b); } } @@ -1376,19 +1383,19 @@ export class AudioStreamEvent extends Message { */ export class AudioFrameReceived extends Message { /** - * @generated from field: livekit.proto.OwnedAudioFrameBuffer frame = 1; + * @generated from field: required livekit.proto.OwnedAudioFrameBuffer frame = 1; */ frame?: OwnedAudioFrameBuffer; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioFrameReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "frame", kind: "message", T: OwnedAudioFrameBuffer }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "frame", kind: "message", T: OwnedAudioFrameBuffer, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioFrameReceived { @@ -1404,7 +1411,7 @@ export class AudioFrameReceived extends Message { } static equals(a: AudioFrameReceived | PlainMessage | undefined, b: AudioFrameReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioFrameReceived, a, b); + return proto2.util.equals(AudioFrameReceived, a, b); } } @@ -1414,12 +1421,12 @@ export class AudioFrameReceived extends Message { export class AudioStreamEOS extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioStreamEOS"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamEOS { @@ -1435,7 +1442,7 @@ export class AudioStreamEOS extends Message { } static equals(a: AudioStreamEOS | PlainMessage | undefined, b: AudioStreamEOS | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamEOS, a, b); + return proto2.util.equals(AudioStreamEOS, a, b); } } @@ -1444,31 +1451,31 @@ export class AudioStreamEOS extends Message { */ export class AudioSourceOptions extends Message { /** - * @generated from field: bool echo_cancellation = 1; + * @generated from field: required bool echo_cancellation = 1; */ - echoCancellation = false; + echoCancellation?: boolean; /** - * @generated from field: bool noise_suppression = 2; + * @generated from field: required bool noise_suppression = 2; */ - noiseSuppression = false; + noiseSuppression?: boolean; /** - * @generated from field: bool auto_gain_control = 3; + * @generated from field: required bool auto_gain_control = 3; */ - autoGainControl = false; + autoGainControl?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioSourceOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "echo_cancellation", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "noise_suppression", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 3, name: "auto_gain_control", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "echo_cancellation", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 2, name: "noise_suppression", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 3, name: "auto_gain_control", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioSourceOptions { @@ -1484,7 +1491,7 @@ export class AudioSourceOptions extends Message { } static equals(a: AudioSourceOptions | PlainMessage | undefined, b: AudioSourceOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioSourceOptions, a, b); + return proto2.util.equals(AudioSourceOptions, a, b); } } @@ -1493,19 +1500,19 @@ export class AudioSourceOptions extends Message { */ export class AudioSourceInfo extends Message { /** - * @generated from field: livekit.proto.AudioSourceType type = 2; + * @generated from field: required livekit.proto.AudioSourceType type = 2; */ - type = AudioSourceType.AUDIO_SOURCE_NATIVE; + type?: AudioSourceType; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioSourceInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AudioSourceType) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(AudioSourceType), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioSourceInfo { @@ -1521,7 +1528,7 @@ export class AudioSourceInfo extends Message { } static equals(a: AudioSourceInfo | PlainMessage | undefined, b: AudioSourceInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioSourceInfo, a, b); + return proto2.util.equals(AudioSourceInfo, a, b); } } @@ -1530,25 +1537,25 @@ export class AudioSourceInfo extends Message { */ export class OwnedAudioSource extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.AudioSourceInfo info = 2; + * @generated from field: required livekit.proto.AudioSourceInfo info = 2; */ info?: AudioSourceInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedAudioSource"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: AudioSourceInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: AudioSourceInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioSource { @@ -1564,7 +1571,7 @@ export class OwnedAudioSource extends Message { } static equals(a: OwnedAudioSource | PlainMessage | undefined, b: OwnedAudioSource | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedAudioSource, a, b); + return proto2.util.equals(OwnedAudioSource, a, b); } } @@ -1574,12 +1581,12 @@ export class OwnedAudioSource extends Message { export class AudioResamplerInfo extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioResamplerInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioResamplerInfo { @@ -1595,7 +1602,7 @@ export class AudioResamplerInfo extends Message { } static equals(a: AudioResamplerInfo | PlainMessage | undefined, b: AudioResamplerInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioResamplerInfo, a, b); + return proto2.util.equals(AudioResamplerInfo, a, b); } } @@ -1604,25 +1611,25 @@ export class AudioResamplerInfo extends Message { */ export class OwnedAudioResampler extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.AudioResamplerInfo info = 2; + * @generated from field: required livekit.proto.AudioResamplerInfo info = 2; */ info?: AudioResamplerInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedAudioResampler"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: AudioResamplerInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: AudioResamplerInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioResampler { @@ -1638,7 +1645,7 @@ export class OwnedAudioResampler extends Message { } static equals(a: OwnedAudioResampler | PlainMessage | undefined, b: OwnedAudioResampler | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedAudioResampler, a, b); + return proto2.util.equals(OwnedAudioResampler, a, b); } } @@ -1648,12 +1655,12 @@ export class OwnedAudioResampler extends Message { export class SoxResamplerInfo extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SoxResamplerInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): SoxResamplerInfo { @@ -1669,7 +1676,7 @@ export class SoxResamplerInfo extends Message { } static equals(a: SoxResamplerInfo | PlainMessage | undefined, b: SoxResamplerInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(SoxResamplerInfo, a, b); + return proto2.util.equals(SoxResamplerInfo, a, b); } } @@ -1678,25 +1685,25 @@ export class SoxResamplerInfo extends Message { */ export class OwnedSoxResampler extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.SoxResamplerInfo info = 2; + * @generated from field: required livekit.proto.SoxResamplerInfo info = 2; */ info?: SoxResamplerInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedSoxResampler"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: SoxResamplerInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: SoxResamplerInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedSoxResampler { @@ -1712,7 +1719,7 @@ export class OwnedSoxResampler extends Message { } static equals(a: OwnedSoxResampler | PlainMessage | undefined, b: OwnedSoxResampler | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedSoxResampler, a, b); + return proto2.util.equals(OwnedSoxResampler, a, b); } } diff --git a/packages/livekit-rtc/src/proto/e2ee_pb.ts b/packages/livekit-rtc/src/proto/e2ee_pb.ts index 73601aa1..a82a0787 100644 --- a/packages/livekit-rtc/src/proto/e2ee_pb.ts +++ b/packages/livekit-rtc/src/proto/e2ee_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file e2ee.proto (package livekit.proto, syntax proto3) +// @generated from file e2ee.proto (package livekit.proto, syntax proto2) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { Message, proto2 } from "@bufbuild/protobuf"; /** * @generated from enum livekit.proto.EncryptionType @@ -39,8 +39,8 @@ export enum EncryptionType { */ CUSTOM = 2, } -// Retrieve enum metadata with: proto3.getEnumType(EncryptionType) -proto3.util.setEnumType(EncryptionType, "livekit.proto.EncryptionType", [ +// Retrieve enum metadata with: proto2.getEnumType(EncryptionType) +proto2.util.setEnumType(EncryptionType, "livekit.proto.EncryptionType", [ { no: 0, name: "NONE" }, { no: 1, name: "GCM" }, { no: 2, name: "CUSTOM" }, @@ -85,8 +85,8 @@ export enum EncryptionState { */ INTERNAL_ERROR = 6, } -// Retrieve enum metadata with: proto3.getEnumType(EncryptionState) -proto3.util.setEnumType(EncryptionState, "livekit.proto.EncryptionState", [ +// Retrieve enum metadata with: proto2.getEnumType(EncryptionState) +proto2.util.setEnumType(EncryptionState, "livekit.proto.EncryptionState", [ { no: 0, name: "NEW" }, { no: 1, name: "OK" }, { no: 2, name: "ENCRYPTION_FAILED" }, @@ -101,37 +101,37 @@ proto3.util.setEnumType(EncryptionState, "livekit.proto.EncryptionState", [ */ export class FrameCryptor extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid?: string; /** - * @generated from field: int32 key_index = 3; + * @generated from field: required int32 key_index = 3; */ - keyIndex = 0; + keyIndex?: number; /** - * @generated from field: bool enabled = 4; + * @generated from field: required bool enabled = 4; */ - enabled = false; + enabled?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FrameCryptor"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 4, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + { no: 4, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptor { @@ -147,7 +147,7 @@ export class FrameCryptor extends Message { } static equals(a: FrameCryptor | PlainMessage | undefined, b: FrameCryptor | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptor, a, b); + return proto2.util.equals(FrameCryptor, a, b); } } @@ -163,34 +163,34 @@ export class KeyProviderOptions extends Message { sharedKey?: Uint8Array; /** - * @generated from field: int32 ratchet_window_size = 2; + * @generated from field: required int32 ratchet_window_size = 2; */ - ratchetWindowSize = 0; + ratchetWindowSize?: number; /** - * @generated from field: bytes ratchet_salt = 3; + * @generated from field: required bytes ratchet_salt = 3; */ - ratchetSalt = new Uint8Array(0); + ratchetSalt?: Uint8Array; /** - * -1 = no tolerence + * -1 = no tolerance * - * @generated from field: int32 failure_tolerance = 4; + * @generated from field: required int32 failure_tolerance = 4; */ - failureTolerance = 0; + failureTolerance?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.KeyProviderOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "shared_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - { no: 2, name: "ratchet_window_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 3, name: "ratchet_salt", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 4, name: "failure_tolerance", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "ratchet_window_size", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + { no: 3, name: "ratchet_salt", kind: "scalar", T: 12 /* ScalarType.BYTES */, req: true }, + { no: 4, name: "failure_tolerance", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): KeyProviderOptions { @@ -206,7 +206,7 @@ export class KeyProviderOptions extends Message { } static equals(a: KeyProviderOptions | PlainMessage | undefined, b: KeyProviderOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(KeyProviderOptions, a, b); + return proto2.util.equals(KeyProviderOptions, a, b); } } @@ -215,25 +215,25 @@ export class KeyProviderOptions extends Message { */ export class E2eeOptions extends Message { /** - * @generated from field: livekit.proto.EncryptionType encryption_type = 1; + * @generated from field: required livekit.proto.EncryptionType encryption_type = 1; */ - encryptionType = EncryptionType.NONE; + encryptionType?: EncryptionType; /** - * @generated from field: livekit.proto.KeyProviderOptions key_provider_options = 2; + * @generated from field: required livekit.proto.KeyProviderOptions key_provider_options = 2; */ keyProviderOptions?: KeyProviderOptions; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.E2eeOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "encryption_type", kind: "enum", T: proto3.getEnumType(EncryptionType) }, - { no: 2, name: "key_provider_options", kind: "message", T: KeyProviderOptions }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "encryption_type", kind: "enum", T: proto2.getEnumType(EncryptionType), req: true }, + { no: 2, name: "key_provider_options", kind: "message", T: KeyProviderOptions, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeOptions { @@ -249,7 +249,7 @@ export class E2eeOptions extends Message { } static equals(a: E2eeOptions | PlainMessage | undefined, b: E2eeOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeOptions, a, b); + return proto2.util.equals(E2eeOptions, a, b); } } @@ -258,19 +258,19 @@ export class E2eeOptions extends Message { */ export class E2eeManagerSetEnabledRequest extends Message { /** - * @generated from field: bool enabled = 1; + * @generated from field: required bool enabled = 1; */ - enabled = false; + enabled?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.E2eeManagerSetEnabledRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerSetEnabledRequest { @@ -286,7 +286,7 @@ export class E2eeManagerSetEnabledRequest extends Message | undefined, b: E2eeManagerSetEnabledRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeManagerSetEnabledRequest, a, b); + return proto2.util.equals(E2eeManagerSetEnabledRequest, a, b); } } @@ -296,12 +296,12 @@ export class E2eeManagerSetEnabledRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.E2eeManagerSetEnabledResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerSetEnabledResponse { @@ -317,7 +317,7 @@ export class E2eeManagerSetEnabledResponse extends Message | undefined, b: E2eeManagerSetEnabledResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeManagerSetEnabledResponse, a, b); + return proto2.util.equals(E2eeManagerSetEnabledResponse, a, b); } } @@ -327,12 +327,12 @@ export class E2eeManagerSetEnabledResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.E2eeManagerGetFrameCryptorsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerGetFrameCryptorsRequest { @@ -348,7 +348,7 @@ export class E2eeManagerGetFrameCryptorsRequest extends Message | undefined, b: E2eeManagerGetFrameCryptorsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeManagerGetFrameCryptorsRequest, a, b); + return proto2.util.equals(E2eeManagerGetFrameCryptorsRequest, a, b); } } @@ -363,12 +363,12 @@ export class E2eeManagerGetFrameCryptorsResponse extends Message) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.E2eeManagerGetFrameCryptorsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "frame_cryptors", kind: "message", T: FrameCryptor, repeated: true }, ]); @@ -385,7 +385,7 @@ export class E2eeManagerGetFrameCryptorsResponse extends Message | undefined, b: E2eeManagerGetFrameCryptorsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeManagerGetFrameCryptorsResponse, a, b); + return proto2.util.equals(E2eeManagerGetFrameCryptorsResponse, a, b); } } @@ -394,31 +394,31 @@ export class E2eeManagerGetFrameCryptorsResponse extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid?: string; /** - * @generated from field: bool enabled = 3; + * @generated from field: required bool enabled = 3; */ - enabled = false; + enabled?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FrameCryptorSetEnabledRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetEnabledRequest { @@ -434,7 +434,7 @@ export class FrameCryptorSetEnabledRequest extends Message | undefined, b: FrameCryptorSetEnabledRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptorSetEnabledRequest, a, b); + return proto2.util.equals(FrameCryptorSetEnabledRequest, a, b); } } @@ -444,12 +444,12 @@ export class FrameCryptorSetEnabledRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FrameCryptorSetEnabledResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetEnabledResponse { @@ -465,7 +465,7 @@ export class FrameCryptorSetEnabledResponse extends Message | undefined, b: FrameCryptorSetEnabledResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptorSetEnabledResponse, a, b); + return proto2.util.equals(FrameCryptorSetEnabledResponse, a, b); } } @@ -474,31 +474,31 @@ export class FrameCryptorSetEnabledResponse extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid?: string; /** - * @generated from field: int32 key_index = 3; + * @generated from field: required int32 key_index = 3; */ - keyIndex = 0; + keyIndex?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FrameCryptorSetKeyIndexRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetKeyIndexRequest { @@ -514,7 +514,7 @@ export class FrameCryptorSetKeyIndexRequest extends Message | undefined, b: FrameCryptorSetKeyIndexRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptorSetKeyIndexRequest, a, b); + return proto2.util.equals(FrameCryptorSetKeyIndexRequest, a, b); } } @@ -524,12 +524,12 @@ export class FrameCryptorSetKeyIndexRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FrameCryptorSetKeyIndexResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetKeyIndexResponse { @@ -545,7 +545,7 @@ export class FrameCryptorSetKeyIndexResponse extends Message | undefined, b: FrameCryptorSetKeyIndexResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptorSetKeyIndexResponse, a, b); + return proto2.util.equals(FrameCryptorSetKeyIndexResponse, a, b); } } @@ -554,25 +554,25 @@ export class FrameCryptorSetKeyIndexResponse extends Message { /** - * @generated from field: bytes shared_key = 1; + * @generated from field: required bytes shared_key = 1; */ - sharedKey = new Uint8Array(0); + sharedKey?: Uint8Array; /** - * @generated from field: int32 key_index = 2; + * @generated from field: required int32 key_index = 2; */ - keyIndex = 0; + keyIndex?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SetSharedKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "shared_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "shared_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, req: true }, + { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetSharedKeyRequest { @@ -588,7 +588,7 @@ export class SetSharedKeyRequest extends Message { } static equals(a: SetSharedKeyRequest | PlainMessage | undefined, b: SetSharedKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetSharedKeyRequest, a, b); + return proto2.util.equals(SetSharedKeyRequest, a, b); } } @@ -598,12 +598,12 @@ export class SetSharedKeyRequest extends Message { export class SetSharedKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SetSharedKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetSharedKeyResponse { @@ -619,7 +619,7 @@ export class SetSharedKeyResponse extends Message { } static equals(a: SetSharedKeyResponse | PlainMessage | undefined, b: SetSharedKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetSharedKeyResponse, a, b); + return proto2.util.equals(SetSharedKeyResponse, a, b); } } @@ -628,19 +628,19 @@ export class SetSharedKeyResponse extends Message { */ export class RatchetSharedKeyRequest extends Message { /** - * @generated from field: int32 key_index = 1; + * @generated from field: required int32 key_index = 1; */ - keyIndex = 0; + keyIndex?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RatchetSharedKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RatchetSharedKeyRequest { @@ -656,7 +656,7 @@ export class RatchetSharedKeyRequest extends Message { } static equals(a: RatchetSharedKeyRequest | PlainMessage | undefined, b: RatchetSharedKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RatchetSharedKeyRequest, a, b); + return proto2.util.equals(RatchetSharedKeyRequest, a, b); } } @@ -671,12 +671,12 @@ export class RatchetSharedKeyResponse extends Message constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RatchetSharedKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "new_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, ]); @@ -693,7 +693,7 @@ export class RatchetSharedKeyResponse extends Message } static equals(a: RatchetSharedKeyResponse | PlainMessage | undefined, b: RatchetSharedKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RatchetSharedKeyResponse, a, b); + return proto2.util.equals(RatchetSharedKeyResponse, a, b); } } @@ -702,19 +702,19 @@ export class RatchetSharedKeyResponse extends Message */ export class GetSharedKeyRequest extends Message { /** - * @generated from field: int32 key_index = 1; + * @generated from field: required int32 key_index = 1; */ - keyIndex = 0; + keyIndex?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetSharedKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSharedKeyRequest { @@ -730,7 +730,7 @@ export class GetSharedKeyRequest extends Message { } static equals(a: GetSharedKeyRequest | PlainMessage | undefined, b: GetSharedKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSharedKeyRequest, a, b); + return proto2.util.equals(GetSharedKeyRequest, a, b); } } @@ -745,12 +745,12 @@ export class GetSharedKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetSharedKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, ]); @@ -767,7 +767,7 @@ export class GetSharedKeyResponse extends Message { } static equals(a: GetSharedKeyResponse | PlainMessage | undefined, b: GetSharedKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSharedKeyResponse, a, b); + return proto2.util.equals(GetSharedKeyResponse, a, b); } } @@ -776,31 +776,31 @@ export class GetSharedKeyResponse extends Message { */ export class SetKeyRequest extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: bytes key = 2; + * @generated from field: required bytes key = 2; */ - key = new Uint8Array(0); + key?: Uint8Array; /** - * @generated from field: int32 key_index = 3; + * @generated from field: required int32 key_index = 3; */ - keyIndex = 0; + keyIndex?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SetKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 3, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */, req: true }, + { no: 3, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetKeyRequest { @@ -816,7 +816,7 @@ export class SetKeyRequest extends Message { } static equals(a: SetKeyRequest | PlainMessage | undefined, b: SetKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetKeyRequest, a, b); + return proto2.util.equals(SetKeyRequest, a, b); } } @@ -826,12 +826,12 @@ export class SetKeyRequest extends Message { export class SetKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SetKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetKeyResponse { @@ -847,7 +847,7 @@ export class SetKeyResponse extends Message { } static equals(a: SetKeyResponse | PlainMessage | undefined, b: SetKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetKeyResponse, a, b); + return proto2.util.equals(SetKeyResponse, a, b); } } @@ -856,25 +856,25 @@ export class SetKeyResponse extends Message { */ export class RatchetKeyRequest extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: int32 key_index = 2; + * @generated from field: required int32 key_index = 2; */ - keyIndex = 0; + keyIndex?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RatchetKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RatchetKeyRequest { @@ -890,7 +890,7 @@ export class RatchetKeyRequest extends Message { } static equals(a: RatchetKeyRequest | PlainMessage | undefined, b: RatchetKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RatchetKeyRequest, a, b); + return proto2.util.equals(RatchetKeyRequest, a, b); } } @@ -905,12 +905,12 @@ export class RatchetKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RatchetKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "new_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, ]); @@ -927,7 +927,7 @@ export class RatchetKeyResponse extends Message { } static equals(a: RatchetKeyResponse | PlainMessage | undefined, b: RatchetKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RatchetKeyResponse, a, b); + return proto2.util.equals(RatchetKeyResponse, a, b); } } @@ -936,25 +936,25 @@ export class RatchetKeyResponse extends Message { */ export class GetKeyRequest extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: int32 key_index = 2; + * @generated from field: required int32 key_index = 2; */ - keyIndex = 0; + keyIndex?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetKeyRequest { @@ -970,7 +970,7 @@ export class GetKeyRequest extends Message { } static equals(a: GetKeyRequest | PlainMessage | undefined, b: GetKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetKeyRequest, a, b); + return proto2.util.equals(GetKeyRequest, a, b); } } @@ -985,12 +985,12 @@ export class GetKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, ]); @@ -1007,7 +1007,7 @@ export class GetKeyResponse extends Message { } static equals(a: GetKeyResponse | PlainMessage | undefined, b: GetKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetKeyResponse, a, b); + return proto2.util.equals(GetKeyResponse, a, b); } } @@ -1016,9 +1016,9 @@ export class GetKeyResponse extends Message { */ export class E2eeRequest extends Message { /** - * @generated from field: uint64 room_handle = 1; + * @generated from field: required uint64 room_handle = 1; */ - roomHandle = protoInt64.zero; + roomHandle?: bigint; /** * @generated from oneof livekit.proto.E2eeRequest.message @@ -1087,13 +1087,13 @@ export class E2eeRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.E2eeRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "manager_set_enabled", kind: "message", T: E2eeManagerSetEnabledRequest, oneof: "message" }, { no: 3, name: "manager_get_frame_cryptors", kind: "message", T: E2eeManagerGetFrameCryptorsRequest, oneof: "message" }, { no: 4, name: "cryptor_set_enabled", kind: "message", T: FrameCryptorSetEnabledRequest, oneof: "message" }, @@ -1119,7 +1119,7 @@ export class E2eeRequest extends Message { } static equals(a: E2eeRequest | PlainMessage | undefined, b: E2eeRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeRequest, a, b); + return proto2.util.equals(E2eeRequest, a, b); } } @@ -1194,12 +1194,12 @@ export class E2eeResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.E2eeResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "manager_set_enabled", kind: "message", T: E2eeManagerSetEnabledResponse, oneof: "message" }, { no: 2, name: "manager_get_frame_cryptors", kind: "message", T: E2eeManagerGetFrameCryptorsResponse, oneof: "message" }, { no: 3, name: "cryptor_set_enabled", kind: "message", T: FrameCryptorSetEnabledResponse, oneof: "message" }, @@ -1225,7 +1225,7 @@ export class E2eeResponse extends Message { } static equals(a: E2eeResponse | PlainMessage | undefined, b: E2eeResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeResponse, a, b); + return proto2.util.equals(E2eeResponse, a, b); } } diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index ff19c623..510eea1c 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file ffi.proto (package livekit.proto, syntax proto3) +// @generated from file ffi.proto (package livekit.proto, syntax proto2) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { Message, proto2 } from "@bufbuild/protobuf"; import { ConnectCallback, ConnectRequest, ConnectResponse, DisconnectCallback, DisconnectRequest, DisconnectResponse, EditChatMessageRequest, GetSessionStatsCallback, GetSessionStatsRequest, GetSessionStatsResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishSipDtmfCallback, PublishSipDtmfRequest, PublishSipDtmfResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, PublishTranscriptionCallback, PublishTranscriptionRequest, PublishTranscriptionResponse, RoomEvent, SendChatMessageCallback, SendChatMessageRequest, SendChatMessageResponse, SetLocalAttributesCallback, SetLocalAttributesRequest, SetLocalAttributesResponse, SetLocalMetadataCallback, SetLocalMetadataRequest, SetLocalMetadataResponse, SetLocalNameCallback, SetLocalNameRequest, SetLocalNameResponse, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse } from "./room_pb.js"; import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, EnableRemoteTrackRequest, EnableRemoteTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, LocalTrackMuteRequest, LocalTrackMuteResponse, TrackEvent } from "./track_pb.js"; import { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb.js"; @@ -55,8 +55,8 @@ export enum LogLevel { */ LOG_TRACE = 4, } -// Retrieve enum metadata with: proto3.getEnumType(LogLevel) -proto3.util.setEnumType(LogLevel, "livekit.proto.LogLevel", [ +// Retrieve enum metadata with: proto2.getEnumType(LogLevel) +proto2.util.setEnumType(LogLevel, "livekit.proto.LogLevel", [ { no: 0, name: "LOG_ERROR" }, { no: 1, name: "LOG_WARN" }, { no: 2, name: "LOG_INFO" }, @@ -328,12 +328,12 @@ export class FfiRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FfiRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 2, name: "dispose", kind: "message", T: DisposeRequest, oneof: "message" }, { no: 3, name: "connect", kind: "message", T: ConnectRequest, oneof: "message" }, { no: 4, name: "disconnect", kind: "message", T: DisconnectRequest, oneof: "message" }, @@ -389,7 +389,7 @@ export class FfiRequest extends Message { } static equals(a: FfiRequest | PlainMessage | undefined, b: FfiRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(FfiRequest, a, b); + return proto2.util.equals(FfiRequest, a, b); } } @@ -650,12 +650,12 @@ export class FfiResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FfiResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 2, name: "dispose", kind: "message", T: DisposeResponse, oneof: "message" }, { no: 3, name: "connect", kind: "message", T: ConnectResponse, oneof: "message" }, { no: 4, name: "disconnect", kind: "message", T: DisconnectResponse, oneof: "message" }, @@ -710,7 +710,7 @@ export class FfiResponse extends Message { } static equals(a: FfiResponse | PlainMessage | undefined, b: FfiResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(FfiResponse, a, b); + return proto2.util.equals(FfiResponse, a, b); } } @@ -847,10 +847,10 @@ export class FfiEvent extends Message { case: "publishSipDtmf"; } | { /** - * @generated from field: livekit.proto.SendChatMessageCallback send_chat_message = 22; + * @generated from field: livekit.proto.SendChatMessageCallback chat_message = 22; */ value: SendChatMessageCallback; - case: "sendChatMessage"; + case: "chatMessage"; } | { /** * @generated from field: livekit.proto.PerformRpcCallback perform_rpc = 23; @@ -885,12 +885,12 @@ export class FfiEvent extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FfiEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "room_event", kind: "message", T: RoomEvent, oneof: "message" }, { no: 2, name: "track_event", kind: "message", T: TrackEvent, oneof: "message" }, { no: 3, name: "video_stream_event", kind: "message", T: VideoStreamEvent, oneof: "message" }, @@ -911,7 +911,7 @@ export class FfiEvent extends 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" }, - { no: 22, name: "send_chat_message", kind: "message", T: SendChatMessageCallback, oneof: "message" }, + { no: 22, name: "chat_message", kind: "message", T: SendChatMessageCallback, oneof: "message" }, { no: 23, name: "perform_rpc", kind: "message", T: PerformRpcCallback, oneof: "message" }, { no: 24, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodCallback, oneof: "message" }, { no: 25, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodCallback, oneof: "message" }, @@ -932,7 +932,7 @@ export class FfiEvent extends Message { } static equals(a: FfiEvent | PlainMessage | undefined, b: FfiEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(FfiEvent, a, b); + return proto2.util.equals(FfiEvent, a, b); } } @@ -945,19 +945,19 @@ export class FfiEvent extends Message { */ export class DisposeRequest extends Message { /** - * @generated from field: bool async = 1; + * @generated from field: required bool async = 1; */ - async = false; + async?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.DisposeRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisposeRequest { @@ -973,7 +973,7 @@ export class DisposeRequest extends Message { } static equals(a: DisposeRequest | PlainMessage | undefined, b: DisposeRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(DisposeRequest, a, b); + return proto2.util.equals(DisposeRequest, a, b); } } @@ -990,12 +990,12 @@ export class DisposeResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.DisposeResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, ]); @@ -1012,7 +1012,7 @@ export class DisposeResponse extends Message { } static equals(a: DisposeResponse | PlainMessage | undefined, b: DisposeResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(DisposeResponse, a, b); + return proto2.util.equals(DisposeResponse, a, b); } } @@ -1021,19 +1021,19 @@ export class DisposeResponse extends Message { */ export class DisposeCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.DisposeCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisposeCallback { @@ -1049,7 +1049,7 @@ export class DisposeCallback extends Message { } static equals(a: DisposeCallback | PlainMessage | undefined, b: DisposeCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(DisposeCallback, a, b); + return proto2.util.equals(DisposeCallback, a, b); } } @@ -1058,16 +1058,16 @@ export class DisposeCallback extends Message { */ export class LogRecord extends Message { /** - * @generated from field: livekit.proto.LogLevel level = 1; + * @generated from field: required livekit.proto.LogLevel level = 1; */ - level = LogLevel.LOG_ERROR; + level?: LogLevel; /** * e.g "livekit", "libwebrtc", "tokio-tungstenite", etc... * - * @generated from field: string target = 2; + * @generated from field: required string target = 2; */ - target = ""; + target?: string; /** * @generated from field: optional string module_path = 3; @@ -1085,24 +1085,24 @@ export class LogRecord extends Message { line?: number; /** - * @generated from field: string message = 6; + * @generated from field: required string message = 6; */ - message = ""; + message?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.LogRecord"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "level", kind: "enum", T: proto3.getEnumType(LogLevel) }, - { no: 2, name: "target", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "level", kind: "enum", T: proto2.getEnumType(LogLevel), req: true }, + { no: 2, name: "target", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, { no: 3, name: "module_path", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 4, name: "file", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 5, name: "line", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, - { no: 6, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LogRecord { @@ -1118,7 +1118,7 @@ export class LogRecord extends Message { } static equals(a: LogRecord | PlainMessage | undefined, b: LogRecord | PlainMessage | undefined): boolean { - return proto3.util.equals(LogRecord, a, b); + return proto2.util.equals(LogRecord, a, b); } } @@ -1133,12 +1133,12 @@ export class LogBatch extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.LogBatch"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "records", kind: "message", T: LogRecord, repeated: true }, ]); @@ -1155,7 +1155,7 @@ export class LogBatch extends Message { } static equals(a: LogBatch | PlainMessage | undefined, b: LogBatch | PlainMessage | undefined): boolean { - return proto3.util.equals(LogBatch, a, b); + return proto2.util.equals(LogBatch, a, b); } } @@ -1164,19 +1164,19 @@ export class LogBatch extends Message { */ export class Panic extends Message { /** - * @generated from field: string message = 1; + * @generated from field: required string message = 1; */ - message = ""; + message?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.Panic"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Panic { @@ -1192,7 +1192,7 @@ export class Panic extends Message { } static equals(a: Panic | PlainMessage | undefined, b: Panic | PlainMessage | undefined): boolean { - return proto3.util.equals(Panic, a, b); + return proto2.util.equals(Panic, a, b); } } diff --git a/packages/livekit-rtc/src/proto/handle_pb.ts b/packages/livekit-rtc/src/proto/handle_pb.ts index cbb0bcef..cb39d0ea 100644 --- a/packages/livekit-rtc/src/proto/handle_pb.ts +++ b/packages/livekit-rtc/src/proto/handle_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file handle.proto (package livekit.proto, syntax proto3) +// @generated from file handle.proto (package livekit.proto, syntax proto2) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { Message, proto2 } from "@bufbuild/protobuf"; /** * # Safety @@ -35,19 +35,19 @@ import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; */ export class FfiOwnedHandle extends Message { /** - * @generated from field: uint64 id = 1; + * @generated from field: required uint64 id = 1; */ - id = protoInt64.zero; + id?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.FfiOwnedHandle"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiOwnedHandle { @@ -63,7 +63,7 @@ export class FfiOwnedHandle extends Message { } static equals(a: FfiOwnedHandle | PlainMessage | undefined, b: FfiOwnedHandle | PlainMessage | undefined): boolean { - return proto3.util.equals(FfiOwnedHandle, a, b); + return proto2.util.equals(FfiOwnedHandle, a, b); } } diff --git a/packages/livekit-rtc/src/proto/participant_pb.ts b/packages/livekit-rtc/src/proto/participant_pb.ts index c0d03f9a..f7105042 100644 --- a/packages/livekit-rtc/src/proto/participant_pb.ts +++ b/packages/livekit-rtc/src/proto/participant_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file participant.proto (package livekit.proto, syntax proto3) +// @generated from file participant.proto (package livekit.proto, syntax proto2) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; +import { Message, proto2 } from "@bufbuild/protobuf"; import { FfiOwnedHandle } from "./handle_pb.js"; /** @@ -50,8 +50,8 @@ export enum ParticipantKind { */ AGENT = 4, } -// Retrieve enum metadata with: proto3.getEnumType(ParticipantKind) -proto3.util.setEnumType(ParticipantKind, "livekit.proto.ParticipantKind", [ +// Retrieve enum metadata with: proto2.getEnumType(ParticipantKind) +proto2.util.setEnumType(ParticipantKind, "livekit.proto.ParticipantKind", [ { no: 0, name: "PARTICIPANT_KIND_STANDARD" }, { no: 1, name: "PARTICIPANT_KIND_INGRESS" }, { no: 2, name: "PARTICIPANT_KIND_EGRESS" }, @@ -64,24 +64,24 @@ proto3.util.setEnumType(ParticipantKind, "livekit.proto.ParticipantKind", [ */ export class ParticipantInfo extends Message { /** - * @generated from field: string sid = 1; + * @generated from field: required string sid = 1; */ - sid = ""; + sid?: string; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; + name?: string; /** - * @generated from field: string identity = 3; + * @generated from field: required string identity = 3; */ - identity = ""; + identity?: string; /** - * @generated from field: string metadata = 4; + * @generated from field: required string metadata = 4; */ - metadata = ""; + metadata?: string; /** * @generated from field: map attributes = 5; @@ -89,24 +89,24 @@ export class ParticipantInfo extends Message { attributes: { [key: string]: string } = {}; /** - * @generated from field: livekit.proto.ParticipantKind kind = 6; + * @generated from field: required livekit.proto.ParticipantKind kind = 6; */ - kind = ParticipantKind.STANDARD; + kind?: ParticipantKind; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ParticipantInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { 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 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 4, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, { no: 5, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 6, name: "kind", kind: "enum", T: proto3.getEnumType(ParticipantKind) }, + { no: 6, name: "kind", kind: "enum", T: proto2.getEnumType(ParticipantKind), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantInfo { @@ -122,7 +122,7 @@ export class ParticipantInfo extends Message { } static equals(a: ParticipantInfo | PlainMessage | undefined, b: ParticipantInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantInfo, a, b); + return proto2.util.equals(ParticipantInfo, a, b); } } @@ -131,25 +131,25 @@ export class ParticipantInfo extends Message { */ export class OwnedParticipant extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.ParticipantInfo info = 2; + * @generated from field: required livekit.proto.ParticipantInfo info = 2; */ info?: ParticipantInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedParticipant"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: ParticipantInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: ParticipantInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedParticipant { @@ -165,7 +165,7 @@ export class OwnedParticipant extends Message { } static equals(a: OwnedParticipant | PlainMessage | undefined, b: OwnedParticipant | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedParticipant, a, b); + return proto2.util.equals(OwnedParticipant, a, b); } } diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index 219f431c..8e4e99e2 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file room.proto (package livekit.proto, syntax proto3) +// @generated from file room.proto (package livekit.proto, syntax proto2) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { Message, proto2 } from "@bufbuild/protobuf"; import { OwnedParticipant } from "./participant_pb.js"; import { OwnedTrack, OwnedTrackPublication, TrackSource } from "./track_pb.js"; import { RtcStats } from "./stats_pb.js"; @@ -45,8 +45,8 @@ export enum IceTransportType { */ TRANSPORT_ALL = 2, } -// Retrieve enum metadata with: proto3.getEnumType(IceTransportType) -proto3.util.setEnumType(IceTransportType, "livekit.proto.IceTransportType", [ +// Retrieve enum metadata with: proto2.getEnumType(IceTransportType) +proto2.util.setEnumType(IceTransportType, "livekit.proto.IceTransportType", [ { no: 0, name: "TRANSPORT_RELAY" }, { no: 1, name: "TRANSPORT_NOHOST" }, { no: 2, name: "TRANSPORT_ALL" }, @@ -66,8 +66,8 @@ export enum ContinualGatheringPolicy { */ GATHER_CONTINUALLY = 1, } -// Retrieve enum metadata with: proto3.getEnumType(ContinualGatheringPolicy) -proto3.util.setEnumType(ContinualGatheringPolicy, "livekit.proto.ContinualGatheringPolicy", [ +// Retrieve enum metadata with: proto2.getEnumType(ContinualGatheringPolicy) +proto2.util.setEnumType(ContinualGatheringPolicy, "livekit.proto.ContinualGatheringPolicy", [ { no: 0, name: "GATHER_ONCE" }, { no: 1, name: "GATHER_CONTINUALLY" }, ]); @@ -96,8 +96,8 @@ export enum ConnectionQuality { */ QUALITY_LOST = 3, } -// Retrieve enum metadata with: proto3.getEnumType(ConnectionQuality) -proto3.util.setEnumType(ConnectionQuality, "livekit.proto.ConnectionQuality", [ +// Retrieve enum metadata with: proto2.getEnumType(ConnectionQuality) +proto2.util.setEnumType(ConnectionQuality, "livekit.proto.ConnectionQuality", [ { no: 0, name: "QUALITY_POOR" }, { no: 1, name: "QUALITY_GOOD" }, { no: 2, name: "QUALITY_EXCELLENT" }, @@ -123,8 +123,8 @@ export enum ConnectionState { */ CONN_RECONNECTING = 2, } -// Retrieve enum metadata with: proto3.getEnumType(ConnectionState) -proto3.util.setEnumType(ConnectionState, "livekit.proto.ConnectionState", [ +// Retrieve enum metadata with: proto2.getEnumType(ConnectionState) +proto2.util.setEnumType(ConnectionState, "livekit.proto.ConnectionState", [ { no: 0, name: "CONN_DISCONNECTED" }, { no: 1, name: "CONN_CONNECTED" }, { no: 2, name: "CONN_RECONNECTING" }, @@ -144,8 +144,8 @@ export enum DataPacketKind { */ KIND_RELIABLE = 1, } -// Retrieve enum metadata with: proto3.getEnumType(DataPacketKind) -proto3.util.setEnumType(DataPacketKind, "livekit.proto.DataPacketKind", [ +// Retrieve enum metadata with: proto2.getEnumType(DataPacketKind) +proto2.util.setEnumType(DataPacketKind, "livekit.proto.DataPacketKind", [ { no: 0, name: "KIND_LOSSY" }, { no: 1, name: "KIND_RELIABLE" }, ]); @@ -229,8 +229,8 @@ export enum DisconnectReason { */ ROOM_CLOSED = 10, } -// Retrieve enum metadata with: proto3.getEnumType(DisconnectReason) -proto3.util.setEnumType(DisconnectReason, "livekit.proto.DisconnectReason", [ +// Retrieve enum metadata with: proto2.getEnumType(DisconnectReason) +proto2.util.setEnumType(DisconnectReason, "livekit.proto.DisconnectReason", [ { no: 0, name: "UNKNOWN_REASON" }, { no: 1, name: "CLIENT_INITIATED" }, { no: 2, name: "DUPLICATE_IDENTITY" }, @@ -251,31 +251,31 @@ proto3.util.setEnumType(DisconnectReason, "livekit.proto.DisconnectReason", [ */ export class ConnectRequest extends Message { /** - * @generated from field: string url = 1; + * @generated from field: required string url = 1; */ - url = ""; + url?: string; /** - * @generated from field: string token = 2; + * @generated from field: required string token = 2; */ - token = ""; + token?: string; /** - * @generated from field: livekit.proto.RoomOptions options = 3; + * @generated from field: required livekit.proto.RoomOptions options = 3; */ options?: RoomOptions; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ConnectRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "options", kind: "message", T: RoomOptions }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "options", kind: "message", T: RoomOptions, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectRequest { @@ -291,7 +291,7 @@ export class ConnectRequest extends Message { } static equals(a: ConnectRequest | PlainMessage | undefined, b: ConnectRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectRequest, a, b); + return proto2.util.equals(ConnectRequest, a, b); } } @@ -300,19 +300,19 @@ export class ConnectRequest extends Message { */ export class ConnectResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ConnectResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectResponse { @@ -328,7 +328,7 @@ export class ConnectResponse extends Message { } static equals(a: ConnectResponse | PlainMessage | undefined, b: ConnectResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectResponse, a, b); + return proto2.util.equals(ConnectResponse, a, b); } } @@ -337,43 +337,38 @@ export class ConnectResponse extends Message { */ export class ConnectCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** - * @generated from field: optional string error = 2; - */ - error?: string; - - /** - * @generated from field: livekit.proto.OwnedRoom room = 3; + * @generated from oneof livekit.proto.ConnectCallback.message */ - room?: OwnedRoom; - - /** - * @generated from field: livekit.proto.OwnedParticipant local_participant = 4; - */ - localParticipant?: OwnedParticipant; - - /** - * @generated from field: repeated livekit.proto.ConnectCallback.ParticipantWithTracks participants = 5; - */ - participants: ConnectCallback_ParticipantWithTracks[] = []; + message: { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.ConnectCallback.Result result = 3; + */ + value: ConnectCallback_Result; + case: "result"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ConnectCallback"; - 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 }, - { no: 3, name: "room", kind: "message", T: OwnedRoom }, - { no: 4, name: "local_participant", kind: "message", T: OwnedParticipant }, - { no: 5, name: "participants", kind: "message", T: ConnectCallback_ParticipantWithTracks, repeated: true }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, + { no: 3, name: "result", kind: "message", T: ConnectCallback_Result, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectCallback { @@ -389,7 +384,7 @@ export class ConnectCallback extends Message { } static equals(a: ConnectCallback | PlainMessage | undefined, b: ConnectCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectCallback, a, b); + return proto2.util.equals(ConnectCallback, a, b); } } @@ -398,7 +393,7 @@ export class ConnectCallback extends Message { */ export class ConnectCallback_ParticipantWithTracks extends Message { /** - * @generated from field: livekit.proto.OwnedParticipant participant = 1; + * @generated from field: required livekit.proto.OwnedParticipant participant = 1; */ participant?: OwnedParticipant; @@ -412,13 +407,13 @@ export class ConnectCallback_ParticipantWithTracks extends Message) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ConnectCallback.ParticipantWithTracks"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant", kind: "message", T: OwnedParticipant }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant", kind: "message", T: OwnedParticipant, req: true }, { no: 2, name: "publications", kind: "message", T: OwnedTrackPublication, repeated: true }, ]); @@ -435,7 +430,56 @@ export class ConnectCallback_ParticipantWithTracks extends Message | undefined, b: ConnectCallback_ParticipantWithTracks | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectCallback_ParticipantWithTracks, a, b); + return proto2.util.equals(ConnectCallback_ParticipantWithTracks, a, b); + } +} + +/** + * @generated from message livekit.proto.ConnectCallback.Result + */ +export class ConnectCallback_Result extends Message { + /** + * @generated from field: required livekit.proto.OwnedRoom room = 1; + */ + room?: OwnedRoom; + + /** + * @generated from field: required livekit.proto.OwnedParticipant local_participant = 2; + */ + localParticipant?: OwnedParticipant; + + /** + * @generated from field: repeated livekit.proto.ConnectCallback.ParticipantWithTracks participants = 3; + */ + participants: ConnectCallback_ParticipantWithTracks[] = []; + + constructor(data?: PartialMessage) { + super(); + proto2.util.initPartial(data, this); + } + + static readonly runtime: typeof proto2 = proto2; + static readonly typeName = "livekit.proto.ConnectCallback.Result"; + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "room", kind: "message", T: OwnedRoom, req: true }, + { no: 2, name: "local_participant", kind: "message", T: OwnedParticipant, req: true }, + { no: 3, name: "participants", kind: "message", T: ConnectCallback_ParticipantWithTracks, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConnectCallback_Result { + return new ConnectCallback_Result().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConnectCallback_Result { + return new ConnectCallback_Result().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConnectCallback_Result { + return new ConnectCallback_Result().fromJsonString(jsonString, options); + } + + static equals(a: ConnectCallback_Result | PlainMessage | undefined, b: ConnectCallback_Result | PlainMessage | undefined): boolean { + return proto2.util.equals(ConnectCallback_Result, a, b); } } @@ -446,19 +490,19 @@ export class ConnectCallback_ParticipantWithTracks extends Message { /** - * @generated from field: uint64 room_handle = 1; + * @generated from field: required uint64 room_handle = 1; */ - roomHandle = protoInt64.zero; + roomHandle?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.DisconnectRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisconnectRequest { @@ -474,7 +518,7 @@ export class DisconnectRequest extends Message { } static equals(a: DisconnectRequest | PlainMessage | undefined, b: DisconnectRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(DisconnectRequest, a, b); + return proto2.util.equals(DisconnectRequest, a, b); } } @@ -483,19 +527,19 @@ export class DisconnectRequest extends Message { */ export class DisconnectResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.DisconnectResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisconnectResponse { @@ -511,7 +555,7 @@ export class DisconnectResponse extends Message { } static equals(a: DisconnectResponse | PlainMessage | undefined, b: DisconnectResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(DisconnectResponse, a, b); + return proto2.util.equals(DisconnectResponse, a, b); } } @@ -520,19 +564,19 @@ export class DisconnectResponse extends Message { */ export class DisconnectCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.DisconnectCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisconnectCallback { @@ -548,7 +592,7 @@ export class DisconnectCallback extends Message { } static equals(a: DisconnectCallback | PlainMessage | undefined, b: DisconnectCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(DisconnectCallback, a, b); + return proto2.util.equals(DisconnectCallback, a, b); } } @@ -559,31 +603,31 @@ export class DisconnectCallback extends Message { */ export class PublishTrackRequest extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: uint64 track_handle = 2; + * @generated from field: required uint64 track_handle = 2; */ - trackHandle = protoInt64.zero; + trackHandle?: bigint; /** - * @generated from field: livekit.proto.TrackPublishOptions options = 3; + * @generated from field: required livekit.proto.TrackPublishOptions options = 3; */ options?: TrackPublishOptions; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PublishTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 3, name: "options", kind: "message", T: TrackPublishOptions }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 3, name: "options", kind: "message", T: TrackPublishOptions, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishTrackRequest { @@ -599,7 +643,7 @@ export class PublishTrackRequest extends Message { } static equals(a: PublishTrackRequest | PlainMessage | undefined, b: PublishTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTrackRequest, a, b); + return proto2.util.equals(PublishTrackRequest, a, b); } } @@ -608,19 +652,19 @@ export class PublishTrackRequest extends Message { */ export class PublishTrackResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PublishTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishTrackResponse { @@ -636,7 +680,7 @@ export class PublishTrackResponse extends Message { } static equals(a: PublishTrackResponse | PlainMessage | undefined, b: PublishTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTrackResponse, a, b); + return proto2.util.equals(PublishTrackResponse, a, b); } } @@ -645,31 +689,38 @@ export class PublishTrackResponse extends Message { */ export class PublishTrackCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** - * @generated from field: optional string error = 2; + * @generated from oneof livekit.proto.PublishTrackCallback.message */ - error?: string; - - /** - * @generated from field: livekit.proto.OwnedTrackPublication publication = 3; - */ - publication?: OwnedTrackPublication; + message: { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.OwnedTrackPublication publication = 3; + */ + value: OwnedTrackPublication; + case: "publication"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PublishTrackCallback"; - 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 }, - { no: 3, name: "publication", kind: "message", T: OwnedTrackPublication }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, + { no: 3, name: "publication", kind: "message", T: OwnedTrackPublication, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishTrackCallback { @@ -685,7 +736,7 @@ export class PublishTrackCallback extends Message { } static equals(a: PublishTrackCallback | PlainMessage | undefined, b: PublishTrackCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTrackCallback, a, b); + return proto2.util.equals(PublishTrackCallback, a, b); } } @@ -696,31 +747,31 @@ export class PublishTrackCallback extends Message { */ export class UnpublishTrackRequest extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid?: string; /** - * @generated from field: bool stop_on_unpublish = 3; + * @generated from field: required bool stop_on_unpublish = 3; */ - stopOnUnpublish = false; + stopOnUnpublish?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.UnpublishTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "stop_on_unpublish", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "stop_on_unpublish", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): UnpublishTrackRequest { @@ -736,7 +787,7 @@ export class UnpublishTrackRequest extends Message { } static equals(a: UnpublishTrackRequest | PlainMessage | undefined, b: UnpublishTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(UnpublishTrackRequest, a, b); + return proto2.util.equals(UnpublishTrackRequest, a, b); } } @@ -745,19 +796,19 @@ export class UnpublishTrackRequest extends Message { */ export class UnpublishTrackResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.UnpublishTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): UnpublishTrackResponse { @@ -773,7 +824,7 @@ export class UnpublishTrackResponse extends Message { } static equals(a: UnpublishTrackResponse | PlainMessage | undefined, b: UnpublishTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(UnpublishTrackResponse, a, b); + return proto2.util.equals(UnpublishTrackResponse, a, b); } } @@ -782,9 +833,9 @@ export class UnpublishTrackResponse extends Message { */ export class UnpublishTrackCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** * @generated from field: optional string error = 2; @@ -793,13 +844,13 @@ export class UnpublishTrackCallback extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.UnpublishTrackCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -816,7 +867,7 @@ export class UnpublishTrackCallback extends Message { } static equals(a: UnpublishTrackCallback | PlainMessage | undefined, b: UnpublishTrackCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(UnpublishTrackCallback, a, b); + return proto2.util.equals(UnpublishTrackCallback, a, b); } } @@ -827,24 +878,24 @@ export class UnpublishTrackCallback extends Message { */ export class PublishDataRequest extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: uint64 data_ptr = 2; + * @generated from field: required uint64 data_ptr = 2; */ - dataPtr = protoInt64.zero; + dataPtr?: bigint; /** - * @generated from field: uint64 data_len = 3; + * @generated from field: required uint64 data_len = 3; */ - dataLen = protoInt64.zero; + dataLen?: bigint; /** - * @generated from field: bool reliable = 4; + * @generated from field: required bool reliable = 4; */ - reliable = false; + reliable?: boolean; /** * @generated from field: repeated string destination_sids = 5 [deprecated = true]; @@ -864,16 +915,16 @@ export class PublishDataRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PublishDataRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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: "reliable", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 3, name: "data_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 4, name: "reliable", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, { 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 }, @@ -892,7 +943,7 @@ export class PublishDataRequest extends Message { } static equals(a: PublishDataRequest | PlainMessage | undefined, b: PublishDataRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishDataRequest, a, b); + return proto2.util.equals(PublishDataRequest, a, b); } } @@ -901,19 +952,19 @@ export class PublishDataRequest extends Message { */ export class PublishDataResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PublishDataResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishDataResponse { @@ -929,7 +980,7 @@ export class PublishDataResponse extends Message { } static equals(a: PublishDataResponse | PlainMessage | undefined, b: PublishDataResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishDataResponse, a, b); + return proto2.util.equals(PublishDataResponse, a, b); } } @@ -938,9 +989,9 @@ export class PublishDataResponse extends Message { */ export class PublishDataCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** * @generated from field: optional string error = 2; @@ -949,13 +1000,13 @@ export class PublishDataCallback extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PublishDataCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -972,7 +1023,7 @@ export class PublishDataCallback extends Message { } static equals(a: PublishDataCallback | PlainMessage | undefined, b: PublishDataCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishDataCallback, a, b); + return proto2.util.equals(PublishDataCallback, a, b); } } @@ -983,19 +1034,19 @@ export class PublishDataCallback extends Message { */ export class PublishTranscriptionRequest extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: string participant_identity = 2; + * @generated from field: required string participant_identity = 2; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string track_id = 3; + * @generated from field: required string track_id = 3; */ - trackId = ""; + trackId?: string; /** * @generated from field: repeated livekit.proto.TranscriptionSegment segments = 4; @@ -1004,15 +1055,15 @@ export class PublishTranscriptionRequest extends Message) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "track_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, { no: 4, name: "segments", kind: "message", T: TranscriptionSegment, repeated: true }, ]); @@ -1029,7 +1080,7 @@ export class PublishTranscriptionRequest extends Message | undefined, b: PublishTranscriptionRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTranscriptionRequest, a, b); + return proto2.util.equals(PublishTranscriptionRequest, a, b); } } @@ -1038,19 +1089,19 @@ export class PublishTranscriptionRequest extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishTranscriptionResponse { @@ -1066,7 +1117,7 @@ export class PublishTranscriptionResponse extends Message | undefined, b: PublishTranscriptionResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTranscriptionResponse, a, b); + return proto2.util.equals(PublishTranscriptionResponse, a, b); } } @@ -1075,9 +1126,9 @@ export class PublishTranscriptionResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** * @generated from field: optional string error = 2; @@ -1086,13 +1137,13 @@ export class PublishTranscriptionCallback extends Message) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PublishTranscriptionCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1109,7 +1160,7 @@ export class PublishTranscriptionCallback extends Message | undefined, b: PublishTranscriptionCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTranscriptionCallback, a, b); + return proto2.util.equals(PublishTranscriptionCallback, a, b); } } @@ -1120,19 +1171,19 @@ export class PublishTranscriptionCallback extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: uint32 code = 2; + * @generated from field: required uint32 code = 2; */ - code = 0; + code?: number; /** - * @generated from field: string digit = 3; + * @generated from field: required string digit = 3; */ - digit = ""; + digit?: string; /** * @generated from field: repeated string destination_identities = 4; @@ -1141,15 +1192,15 @@ export class PublishSipDtmfRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 3, name: "digit", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, { no: 4, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, ]); @@ -1166,7 +1217,7 @@ export class PublishSipDtmfRequest extends Message { } static equals(a: PublishSipDtmfRequest | PlainMessage | undefined, b: PublishSipDtmfRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishSipDtmfRequest, a, b); + return proto2.util.equals(PublishSipDtmfRequest, a, b); } } @@ -1175,19 +1226,19 @@ export class PublishSipDtmfRequest extends Message { */ export class PublishSipDtmfResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishSipDtmfResponse { @@ -1203,7 +1254,7 @@ export class PublishSipDtmfResponse extends Message { } static equals(a: PublishSipDtmfResponse | PlainMessage | undefined, b: PublishSipDtmfResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishSipDtmfResponse, a, b); + return proto2.util.equals(PublishSipDtmfResponse, a, b); } } @@ -1212,9 +1263,9 @@ export class PublishSipDtmfResponse extends Message { */ export class PublishSipDtmfCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** * @generated from field: optional string error = 2; @@ -1223,13 +1274,13 @@ export class PublishSipDtmfCallback extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PublishSipDtmfCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1246,7 +1297,7 @@ export class PublishSipDtmfCallback extends Message { } static equals(a: PublishSipDtmfCallback | PlainMessage | undefined, b: PublishSipDtmfCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishSipDtmfCallback, a, b); + return proto2.util.equals(PublishSipDtmfCallback, a, b); } } @@ -1257,25 +1308,25 @@ export class PublishSipDtmfCallback extends Message { */ export class SetLocalMetadataRequest extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: string metadata = 2; + * @generated from field: required string metadata = 2; */ - metadata = ""; + metadata?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalMetadataRequest { @@ -1291,7 +1342,7 @@ export class SetLocalMetadataRequest extends Message { } static equals(a: SetLocalMetadataRequest | PlainMessage | undefined, b: SetLocalMetadataRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalMetadataRequest, a, b); + return proto2.util.equals(SetLocalMetadataRequest, a, b); } } @@ -1300,19 +1351,19 @@ export class SetLocalMetadataRequest extends Message { */ export class SetLocalMetadataResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalMetadataResponse { @@ -1328,7 +1379,7 @@ export class SetLocalMetadataResponse extends Message } static equals(a: SetLocalMetadataResponse | PlainMessage | undefined, b: SetLocalMetadataResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalMetadataResponse, a, b); + return proto2.util.equals(SetLocalMetadataResponse, a, b); } } @@ -1337,9 +1388,9 @@ export class SetLocalMetadataResponse extends Message */ export class SetLocalMetadataCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** * @generated from field: optional string error = 2; @@ -1348,13 +1399,13 @@ export class SetLocalMetadataCallback extends Message constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SetLocalMetadataCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1371,7 +1422,7 @@ export class SetLocalMetadataCallback extends Message } static equals(a: SetLocalMetadataCallback | PlainMessage | undefined, b: SetLocalMetadataCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalMetadataCallback, a, b); + return proto2.util.equals(SetLocalMetadataCallback, a, b); } } @@ -1380,14 +1431,14 @@ export class SetLocalMetadataCallback extends Message */ export class SendChatMessageRequest extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: string message = 2; + * @generated from field: required string message = 2; */ - message = ""; + message?: string; /** * @generated from field: repeated string destination_identities = 3; @@ -1401,14 +1452,14 @@ export class SendChatMessageRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SendChatMessageRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, { no: 3, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 4, name: "sender_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1426,7 +1477,7 @@ export class SendChatMessageRequest extends Message { } static equals(a: SendChatMessageRequest | PlainMessage | undefined, b: SendChatMessageRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SendChatMessageRequest, a, b); + return proto2.util.equals(SendChatMessageRequest, a, b); } } @@ -1435,17 +1486,17 @@ export class SendChatMessageRequest extends Message { */ export class EditChatMessageRequest extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: string edit_text = 2; + * @generated from field: required string edit_text = 2; */ - editText = ""; + editText?: string; /** - * @generated from field: livekit.proto.ChatMessage original_message = 3; + * @generated from field: required livekit.proto.ChatMessage original_message = 3; */ originalMessage?: ChatMessage; @@ -1461,15 +1512,15 @@ export class EditChatMessageRequest extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.EditChatMessageRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "edit_text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "original_message", kind: "message", T: ChatMessage }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "edit_text", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "original_message", kind: "message", T: ChatMessage, req: true }, { no: 4, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 5, name: "sender_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1487,7 +1538,7 @@ export class EditChatMessageRequest extends Message { } static equals(a: EditChatMessageRequest | PlainMessage | undefined, b: EditChatMessageRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(EditChatMessageRequest, a, b); + return proto2.util.equals(EditChatMessageRequest, a, b); } } @@ -1496,19 +1547,19 @@ export class EditChatMessageRequest extends Message { */ export class SendChatMessageResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SendChatMessageResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageResponse { @@ -1524,7 +1575,7 @@ export class SendChatMessageResponse extends Message { } static equals(a: SendChatMessageResponse | PlainMessage | undefined, b: SendChatMessageResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SendChatMessageResponse, a, b); + return proto2.util.equals(SendChatMessageResponse, a, b); } } @@ -1533,31 +1584,38 @@ export class SendChatMessageResponse extends Message { */ export class SendChatMessageCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** - * @generated from field: optional string error = 2; + * @generated from oneof livekit.proto.SendChatMessageCallback.message */ - error?: string; - - /** - * @generated from field: optional livekit.proto.ChatMessage chat_message = 3; - */ - chatMessage?: ChatMessage; + message: { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.ChatMessage chat_message = 3; + */ + value: ChatMessage; + case: "chatMessage"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SendChatMessageCallback"; - 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 }, - { no: 3, name: "chat_message", kind: "message", T: ChatMessage, opt: true }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, + { no: 3, name: "chat_message", kind: "message", T: ChatMessage, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageCallback { @@ -1573,7 +1631,7 @@ export class SendChatMessageCallback extends Message { } static equals(a: SendChatMessageCallback | PlainMessage | undefined, b: SendChatMessageCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(SendChatMessageCallback, a, b); + return proto2.util.equals(SendChatMessageCallback, a, b); } } @@ -1584,25 +1642,25 @@ export class SendChatMessageCallback extends Message { */ export class SetLocalAttributesRequest extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: map attributes = 2; + * @generated from field: repeated livekit.proto.AttributesEntry attributes = 2; */ - attributes: { [key: string]: string } = {}; + attributes: AttributesEntry[] = []; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "attributes", kind: "message", T: AttributesEntry, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalAttributesRequest { @@ -1618,7 +1676,50 @@ export class SetLocalAttributesRequest extends Message | undefined, b: SetLocalAttributesRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalAttributesRequest, a, b); + return proto2.util.equals(SetLocalAttributesRequest, a, b); + } +} + +/** + * @generated from message livekit.proto.AttributesEntry + */ +export class AttributesEntry extends Message { + /** + * @generated from field: required string key = 1; + */ + key?: string; + + /** + * @generated from field: required string value = 2; + */ + value?: string; + + constructor(data?: PartialMessage) { + super(); + proto2.util.initPartial(data, this); + } + + static readonly runtime: typeof proto2 = proto2; + static readonly typeName = "livekit.proto.AttributesEntry"; + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributesEntry { + return new AttributesEntry().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributesEntry { + return new AttributesEntry().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributesEntry { + return new AttributesEntry().fromJsonString(jsonString, options); + } + + static equals(a: AttributesEntry | PlainMessage | undefined, b: AttributesEntry | PlainMessage | undefined): boolean { + return proto2.util.equals(AttributesEntry, a, b); } } @@ -1627,19 +1728,19 @@ export class SetLocalAttributesRequest extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalAttributesResponse { @@ -1655,7 +1756,7 @@ export class SetLocalAttributesResponse extends Message | undefined, b: SetLocalAttributesResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalAttributesResponse, a, b); + return proto2.util.equals(SetLocalAttributesResponse, a, b); } } @@ -1664,9 +1765,9 @@ export class SetLocalAttributesResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** * @generated from field: optional string error = 2; @@ -1675,13 +1776,13 @@ export class SetLocalAttributesCallback extends Message) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SetLocalAttributesCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1698,7 +1799,7 @@ export class SetLocalAttributesCallback extends Message | undefined, b: SetLocalAttributesCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalAttributesCallback, a, b); + return proto2.util.equals(SetLocalAttributesCallback, a, b); } } @@ -1709,25 +1810,25 @@ export class SetLocalAttributesCallback extends Message { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle?: bigint; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; + name?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalNameRequest { @@ -1743,7 +1844,7 @@ export class SetLocalNameRequest extends Message { } static equals(a: SetLocalNameRequest | PlainMessage | undefined, b: SetLocalNameRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalNameRequest, a, b); + return proto2.util.equals(SetLocalNameRequest, a, b); } } @@ -1752,19 +1853,19 @@ export class SetLocalNameRequest extends Message { */ export class SetLocalNameResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalNameResponse { @@ -1780,7 +1881,7 @@ export class SetLocalNameResponse extends Message { } static equals(a: SetLocalNameResponse | PlainMessage | undefined, b: SetLocalNameResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalNameResponse, a, b); + return proto2.util.equals(SetLocalNameResponse, a, b); } } @@ -1789,9 +1890,9 @@ export class SetLocalNameResponse extends Message { */ export class SetLocalNameCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** * @generated from field: optional string error = 2; @@ -1800,13 +1901,13 @@ export class SetLocalNameCallback extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SetLocalNameCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1823,7 +1924,7 @@ export class SetLocalNameCallback extends Message { } static equals(a: SetLocalNameCallback | PlainMessage | undefined, b: SetLocalNameCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalNameCallback, a, b); + return proto2.util.equals(SetLocalNameCallback, a, b); } } @@ -1834,25 +1935,25 @@ export class SetLocalNameCallback extends Message { */ export class SetSubscribedRequest extends Message { /** - * @generated from field: bool subscribe = 1; + * @generated from field: required bool subscribe = 1; */ - subscribe = false; + subscribe?: boolean; /** - * @generated from field: uint64 publication_handle = 2; + * @generated from field: required uint64 publication_handle = 2; */ - publicationHandle = protoInt64.zero; + publicationHandle?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SetSubscribedRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "publication_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 2, name: "publication_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetSubscribedRequest { @@ -1868,7 +1969,7 @@ export class SetSubscribedRequest extends Message { } static equals(a: SetSubscribedRequest | PlainMessage | undefined, b: SetSubscribedRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetSubscribedRequest, a, b); + return proto2.util.equals(SetSubscribedRequest, a, b); } } @@ -1878,12 +1979,12 @@ export class SetSubscribedRequest extends Message { export class SetSubscribedResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SetSubscribedResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetSubscribedResponse { @@ -1899,7 +2000,7 @@ export class SetSubscribedResponse extends Message { } static equals(a: SetSubscribedResponse | PlainMessage | undefined, b: SetSubscribedResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetSubscribedResponse, a, b); + return proto2.util.equals(SetSubscribedResponse, a, b); } } @@ -1908,19 +2009,19 @@ export class SetSubscribedResponse extends Message { */ export class GetSessionStatsRequest extends Message { /** - * @generated from field: uint64 room_handle = 1; + * @generated from field: required uint64 room_handle = 1; */ - roomHandle = protoInt64.zero; + roomHandle?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetSessionStatsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsRequest { @@ -1936,7 +2037,7 @@ export class GetSessionStatsRequest extends Message { } static equals(a: GetSessionStatsRequest | PlainMessage | undefined, b: GetSessionStatsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSessionStatsRequest, a, b); + return proto2.util.equals(GetSessionStatsRequest, a, b); } } @@ -1945,19 +2046,19 @@ export class GetSessionStatsRequest extends Message { */ export class GetSessionStatsResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetSessionStatsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsResponse { @@ -1973,7 +2074,7 @@ export class GetSessionStatsResponse extends Message { } static equals(a: GetSessionStatsResponse | PlainMessage | undefined, b: GetSessionStatsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSessionStatsResponse, a, b); + return proto2.util.equals(GetSessionStatsResponse, a, b); } } @@ -1982,37 +2083,38 @@ export class GetSessionStatsResponse extends Message { */ export class GetSessionStatsCallback extends Message { /** - * @generated from field: uint64 async_id = 1; - */ - asyncId = protoInt64.zero; - - /** - * @generated from field: optional string error = 2; + * @generated from field: required uint64 async_id = 1; */ - error?: string; + asyncId?: bigint; /** - * @generated from field: repeated livekit.proto.RtcStats publisher_stats = 3; + * @generated from oneof livekit.proto.GetSessionStatsCallback.message */ - publisherStats: RtcStats[] = []; - - /** - * @generated from field: repeated livekit.proto.RtcStats subscriber_stats = 4; - */ - subscriberStats: RtcStats[] = []; + message: { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.GetSessionStatsCallback.Result result = 3; + */ + value: GetSessionStatsCallback_Result; + case: "result"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetSessionStatsCallback"; - 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 }, - { no: 3, name: "publisher_stats", kind: "message", T: RtcStats, repeated: true }, - { no: 4, name: "subscriber_stats", kind: "message", T: RtcStats, repeated: true }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, + { no: 3, name: "result", kind: "message", T: GetSessionStatsCallback_Result, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsCallback { @@ -2028,7 +2130,50 @@ export class GetSessionStatsCallback extends Message { } static equals(a: GetSessionStatsCallback | PlainMessage | undefined, b: GetSessionStatsCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSessionStatsCallback, a, b); + return proto2.util.equals(GetSessionStatsCallback, a, b); + } +} + +/** + * @generated from message livekit.proto.GetSessionStatsCallback.Result + */ +export class GetSessionStatsCallback_Result extends Message { + /** + * @generated from field: repeated livekit.proto.RtcStats publisher_stats = 1; + */ + publisherStats: RtcStats[] = []; + + /** + * @generated from field: repeated livekit.proto.RtcStats subscriber_stats = 2; + */ + subscriberStats: RtcStats[] = []; + + constructor(data?: PartialMessage) { + super(); + proto2.util.initPartial(data, this); + } + + static readonly runtime: typeof proto2 = proto2; + static readonly typeName = "livekit.proto.GetSessionStatsCallback.Result"; + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "publisher_stats", kind: "message", T: RtcStats, repeated: true }, + { no: 2, name: "subscriber_stats", kind: "message", T: RtcStats, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsCallback_Result { + return new GetSessionStatsCallback_Result().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetSessionStatsCallback_Result { + return new GetSessionStatsCallback_Result().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetSessionStatsCallback_Result { + return new GetSessionStatsCallback_Result().fromJsonString(jsonString, options); + } + + static equals(a: GetSessionStatsCallback_Result | PlainMessage | undefined, b: GetSessionStatsCallback_Result | PlainMessage | undefined): boolean { + return proto2.util.equals(GetSessionStatsCallback_Result, a, b); } } @@ -2037,25 +2182,25 @@ export class GetSessionStatsCallback extends Message { */ export class VideoEncoding extends Message { /** - * @generated from field: uint64 max_bitrate = 1; + * @generated from field: required uint64 max_bitrate = 1; */ - maxBitrate = protoInt64.zero; + maxBitrate?: bigint; /** - * @generated from field: double max_framerate = 2; + * @generated from field: required double max_framerate = 2; */ - maxFramerate = 0; + maxFramerate?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoEncoding"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "max_framerate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "max_framerate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoEncoding { @@ -2071,7 +2216,7 @@ export class VideoEncoding extends Message { } static equals(a: VideoEncoding | PlainMessage | undefined, b: VideoEncoding | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoEncoding, a, b); + return proto2.util.equals(VideoEncoding, a, b); } } @@ -2080,19 +2225,19 @@ export class VideoEncoding extends Message { */ export class AudioEncoding extends Message { /** - * @generated from field: uint64 max_bitrate = 1; + * @generated from field: required uint64 max_bitrate = 1; */ - maxBitrate = protoInt64.zero; + maxBitrate?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioEncoding"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioEncoding { @@ -2108,7 +2253,7 @@ export class AudioEncoding extends Message { } static equals(a: AudioEncoding | PlainMessage | undefined, b: AudioEncoding | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioEncoding, a, b); + return proto2.util.equals(AudioEncoding, a, b); } } @@ -2119,61 +2264,61 @@ export class TrackPublishOptions extends Message { /** * encodings are optional * - * @generated from field: livekit.proto.VideoEncoding video_encoding = 1; + * @generated from field: optional livekit.proto.VideoEncoding video_encoding = 1; */ videoEncoding?: VideoEncoding; /** - * @generated from field: livekit.proto.AudioEncoding audio_encoding = 2; + * @generated from field: optional livekit.proto.AudioEncoding audio_encoding = 2; */ audioEncoding?: AudioEncoding; /** - * @generated from field: livekit.proto.VideoCodec video_codec = 3; + * @generated from field: required livekit.proto.VideoCodec video_codec = 3; */ - videoCodec = VideoCodec.VP8; + videoCodec?: VideoCodec; /** - * @generated from field: bool dtx = 4; + * @generated from field: required bool dtx = 4; */ - dtx = false; + dtx?: boolean; /** - * @generated from field: bool red = 5; + * @generated from field: required bool red = 5; */ - red = false; + red?: boolean; /** - * @generated from field: bool simulcast = 6; + * @generated from field: required bool simulcast = 6; */ - simulcast = false; + simulcast?: boolean; /** - * @generated from field: livekit.proto.TrackSource source = 7; + * @generated from field: required livekit.proto.TrackSource source = 7; */ - source = TrackSource.SOURCE_UNKNOWN; + source?: TrackSource; /** - * @generated from field: string stream = 8; + * @generated from field: required string stream = 8; */ - stream = ""; + stream?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackPublishOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "video_encoding", kind: "message", T: VideoEncoding }, - { no: 2, name: "audio_encoding", kind: "message", T: AudioEncoding }, - { no: 3, name: "video_codec", kind: "enum", T: proto3.getEnumType(VideoCodec) }, - { no: 4, name: "dtx", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 5, name: "red", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "simulcast", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 7, name: "source", kind: "enum", T: proto3.getEnumType(TrackSource) }, - { no: 8, name: "stream", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "video_encoding", kind: "message", T: VideoEncoding, opt: true }, + { no: 2, name: "audio_encoding", kind: "message", T: AudioEncoding, opt: true }, + { no: 3, name: "video_codec", kind: "enum", T: proto2.getEnumType(VideoCodec), req: true }, + { no: 4, name: "dtx", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 5, name: "red", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 6, name: "simulcast", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 7, name: "source", kind: "enum", T: proto2.getEnumType(TrackSource), req: true }, + { no: 8, name: "stream", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackPublishOptions { @@ -2189,7 +2334,7 @@ export class TrackPublishOptions extends Message { } static equals(a: TrackPublishOptions | PlainMessage | undefined, b: TrackPublishOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackPublishOptions, a, b); + return proto2.util.equals(TrackPublishOptions, a, b); } } @@ -2203,26 +2348,26 @@ export class IceServer extends Message { urls: string[] = []; /** - * @generated from field: string username = 2; + * @generated from field: optional string username = 2; */ - username = ""; + username?: string; /** - * @generated from field: string password = 3; + * @generated from field: optional string password = 3; */ - password = ""; + password?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.IceServer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "urls", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 3, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): IceServer { @@ -2238,7 +2383,7 @@ export class IceServer extends Message { } static equals(a: IceServer | PlainMessage | undefined, b: IceServer | PlainMessage | undefined): boolean { - return proto3.util.equals(IceServer, a, b); + return proto2.util.equals(IceServer, a, b); } } @@ -2265,14 +2410,14 @@ export class RtcConfig extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcConfig"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "ice_transport_type", kind: "enum", T: proto3.getEnumType(IceTransportType), opt: true }, - { no: 2, name: "continual_gathering_policy", kind: "enum", T: proto3.getEnumType(ContinualGatheringPolicy), opt: true }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "ice_transport_type", kind: "enum", T: proto2.getEnumType(IceTransportType), opt: true }, + { no: 2, name: "continual_gathering_policy", kind: "enum", T: proto2.getEnumType(ContinualGatheringPolicy), opt: true }, { no: 3, name: "ice_servers", kind: "message", T: IceServer, repeated: true }, ]); @@ -2289,7 +2434,7 @@ export class RtcConfig extends Message { } static equals(a: RtcConfig | PlainMessage | undefined, b: RtcConfig | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcConfig, a, b); + return proto2.util.equals(RtcConfig, a, b); } } @@ -2298,19 +2443,19 @@ export class RtcConfig extends Message { */ export class RoomOptions extends Message { /** - * @generated from field: bool auto_subscribe = 1; + * @generated from field: required bool auto_subscribe = 1; */ - autoSubscribe = false; + autoSubscribe?: boolean; /** - * @generated from field: bool adaptive_stream = 2; + * @generated from field: required bool adaptive_stream = 2; */ - adaptiveStream = false; + adaptiveStream?: boolean; /** - * @generated from field: bool dynacast = 3; + * @generated from field: required bool dynacast = 3; */ - dynacast = false; + dynacast?: boolean; /** * @generated from field: optional livekit.proto.E2eeOptions e2ee = 4; @@ -2325,24 +2470,24 @@ export class RoomOptions extends Message { rtcConfig?: RtcConfig; /** - * @generated from field: uint32 join_retries = 6; + * @generated from field: required uint32 join_retries = 6; */ - joinRetries = 0; + joinRetries?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RoomOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "auto_subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "adaptive_stream", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 3, name: "dynacast", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "auto_subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 2, name: "adaptive_stream", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 3, name: "dynacast", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, { no: 4, name: "e2ee", kind: "message", T: E2eeOptions, opt: true }, { no: 5, name: "rtc_config", kind: "message", T: RtcConfig, opt: true }, - { no: 6, name: "join_retries", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 6, name: "join_retries", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomOptions { @@ -2358,7 +2503,7 @@ export class RoomOptions extends Message { } static equals(a: RoomOptions | PlainMessage | undefined, b: RoomOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomOptions, a, b); + return proto2.util.equals(RoomOptions, a, b); } } @@ -2367,49 +2512,49 @@ export class RoomOptions extends Message { */ export class TranscriptionSegment extends Message { /** - * @generated from field: string id = 1; + * @generated from field: required string id = 1; */ - id = ""; + id?: string; /** - * @generated from field: string text = 2; + * @generated from field: required string text = 2; */ - text = ""; + text?: string; /** - * @generated from field: uint64 start_time = 3; + * @generated from field: required uint64 start_time = 3; */ - startTime = protoInt64.zero; + startTime?: bigint; /** - * @generated from field: uint64 end_time = 4; + * @generated from field: required uint64 end_time = 4; */ - endTime = protoInt64.zero; + endTime?: bigint; /** - * @generated from field: bool final = 5; + * @generated from field: required bool final = 5; */ - final = false; + final?: boolean; /** - * @generated from field: string language = 6; + * @generated from field: required string language = 6; */ - language = ""; + language?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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 readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "start_time", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 4, name: "end_time", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 5, name: "final", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 6, name: "language", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TranscriptionSegment { @@ -2425,7 +2570,7 @@ export class TranscriptionSegment extends Message { } static equals(a: TranscriptionSegment | PlainMessage | undefined, b: TranscriptionSegment | PlainMessage | undefined): boolean { - return proto3.util.equals(TranscriptionSegment, a, b); + return proto2.util.equals(TranscriptionSegment, a, b); } } @@ -2434,25 +2579,25 @@ export class TranscriptionSegment extends Message { */ export class BufferInfo extends Message { /** - * @generated from field: uint64 data_ptr = 1; + * @generated from field: required uint64 data_ptr = 1; */ - dataPtr = protoInt64.zero; + dataPtr?: bigint; /** - * @generated from field: uint64 data_len = 2; + * @generated from field: required uint64 data_len = 2; */ - dataLen = protoInt64.zero; + dataLen?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.BufferInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "data_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "data_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): BufferInfo { @@ -2468,7 +2613,7 @@ export class BufferInfo extends Message { } static equals(a: BufferInfo | PlainMessage | undefined, b: BufferInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(BufferInfo, a, b); + return proto2.util.equals(BufferInfo, a, b); } } @@ -2477,25 +2622,25 @@ export class BufferInfo extends Message { */ export class OwnedBuffer extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.BufferInfo data = 2; + * @generated from field: required livekit.proto.BufferInfo data = 2; */ data?: BufferInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedBuffer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "data", kind: "message", T: BufferInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "data", kind: "message", T: BufferInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedBuffer { @@ -2511,7 +2656,7 @@ export class OwnedBuffer extends Message { } static equals(a: OwnedBuffer | PlainMessage | undefined, b: OwnedBuffer | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedBuffer, a, b); + return proto2.util.equals(OwnedBuffer, a, b); } } @@ -2520,9 +2665,9 @@ export class OwnedBuffer extends Message { */ export class RoomEvent extends Message { /** - * @generated from field: uint64 room_handle = 1; + * @generated from field: required uint64 room_handle = 1; */ - roomHandle = protoInt64.zero; + roomHandle?: bigint; /** * @generated from oneof livekit.proto.RoomEvent.message @@ -2703,13 +2848,13 @@ export class RoomEvent extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RoomEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "participant_connected", kind: "message", T: ParticipantConnected, oneof: "message" }, { no: 3, name: "participant_disconnected", kind: "message", T: ParticipantDisconnected, oneof: "message" }, { no: 4, name: "local_track_published", kind: "message", T: LocalTrackPublished, oneof: "message" }, @@ -2753,7 +2898,7 @@ export class RoomEvent extends Message { } static equals(a: RoomEvent | PlainMessage | undefined, b: RoomEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomEvent, a, b); + return proto2.util.equals(RoomEvent, a, b); } } @@ -2767,26 +2912,26 @@ export class RoomInfo extends Message { sid?: string; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; + name?: string; /** - * @generated from field: string metadata = 3; + * @generated from field: required string metadata = 3; */ - metadata = ""; + metadata?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RoomInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { 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 */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomInfo { @@ -2802,7 +2947,7 @@ export class RoomInfo extends Message { } static equals(a: RoomInfo | PlainMessage | undefined, b: RoomInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomInfo, a, b); + return proto2.util.equals(RoomInfo, a, b); } } @@ -2811,25 +2956,25 @@ export class RoomInfo extends Message { */ export class OwnedRoom extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.RoomInfo info = 2; + * @generated from field: required livekit.proto.RoomInfo info = 2; */ info?: RoomInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedRoom"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: RoomInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: RoomInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedRoom { @@ -2845,7 +2990,7 @@ export class OwnedRoom extends Message { } static equals(a: OwnedRoom | PlainMessage | undefined, b: OwnedRoom | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedRoom, a, b); + return proto2.util.equals(OwnedRoom, a, b); } } @@ -2854,19 +2999,19 @@ export class OwnedRoom extends Message { */ export class ParticipantConnected extends Message { /** - * @generated from field: livekit.proto.OwnedParticipant info = 1; + * @generated from field: required livekit.proto.OwnedParticipant info = 1; */ info?: OwnedParticipant; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ParticipantConnected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "info", kind: "message", T: OwnedParticipant }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "info", kind: "message", T: OwnedParticipant, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantConnected { @@ -2882,7 +3027,7 @@ export class ParticipantConnected extends Message { } static equals(a: ParticipantConnected | PlainMessage | undefined, b: ParticipantConnected | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantConnected, a, b); + return proto2.util.equals(ParticipantConnected, a, b); } } @@ -2891,19 +3036,19 @@ export class ParticipantConnected extends Message { */ export class ParticipantDisconnected extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ParticipantDisconnected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantDisconnected { @@ -2919,7 +3064,7 @@ export class ParticipantDisconnected extends Message { } static equals(a: ParticipantDisconnected | PlainMessage | undefined, b: ParticipantDisconnected | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantDisconnected, a, b); + return proto2.util.equals(ParticipantDisconnected, a, b); } } @@ -2931,19 +3076,19 @@ export class LocalTrackPublished extends Message { * The TrackPublicationInfo comes from the PublishTrack response * and the FfiClient musts wait for it before firing this event * - * @generated from field: string track_sid = 1; + * @generated from field: required string track_sid = 1; */ - trackSid = ""; + trackSid?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.LocalTrackPublished"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackPublished { @@ -2959,7 +3104,7 @@ export class LocalTrackPublished extends Message { } static equals(a: LocalTrackPublished | PlainMessage | undefined, b: LocalTrackPublished | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackPublished, a, b); + return proto2.util.equals(LocalTrackPublished, a, b); } } @@ -2968,19 +3113,19 @@ export class LocalTrackPublished extends Message { */ export class LocalTrackUnpublished extends Message { /** - * @generated from field: string publication_sid = 1; + * @generated from field: required string publication_sid = 1; */ - publicationSid = ""; + publicationSid?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.LocalTrackUnpublished"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackUnpublished { @@ -2996,7 +3141,7 @@ export class LocalTrackUnpublished extends Message { } static equals(a: LocalTrackUnpublished | PlainMessage | undefined, b: LocalTrackUnpublished | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackUnpublished, a, b); + return proto2.util.equals(LocalTrackUnpublished, a, b); } } @@ -3005,19 +3150,19 @@ export class LocalTrackUnpublished extends Message { */ export class LocalTrackSubscribed extends Message { /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.LocalTrackSubscribed"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackSubscribed { @@ -3033,7 +3178,7 @@ export class LocalTrackSubscribed extends Message { } static equals(a: LocalTrackSubscribed | PlainMessage | undefined, b: LocalTrackSubscribed | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackSubscribed, a, b); + return proto2.util.equals(LocalTrackSubscribed, a, b); } } @@ -3042,25 +3187,25 @@ export class LocalTrackSubscribed extends Message { */ export class TrackPublished extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: livekit.proto.OwnedTrackPublication publication = 2; + * @generated from field: required livekit.proto.OwnedTrackPublication publication = 2; */ publication?: OwnedTrackPublication; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackPublished"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "publication", kind: "message", T: OwnedTrackPublication }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "publication", kind: "message", T: OwnedTrackPublication, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackPublished { @@ -3076,7 +3221,7 @@ export class TrackPublished extends Message { } static equals(a: TrackPublished | PlainMessage | undefined, b: TrackPublished | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackPublished, a, b); + return proto2.util.equals(TrackPublished, a, b); } } @@ -3085,25 +3230,25 @@ export class TrackPublished extends Message { */ export class TrackUnpublished extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string publication_sid = 2; + * @generated from field: required string publication_sid = 2; */ - publicationSid = ""; + publicationSid?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackUnpublished"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackUnpublished { @@ -3119,7 +3264,7 @@ export class TrackUnpublished extends Message { } static equals(a: TrackUnpublished | PlainMessage | undefined, b: TrackUnpublished | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackUnpublished, a, b); + return proto2.util.equals(TrackUnpublished, a, b); } } @@ -3131,25 +3276,25 @@ export class TrackUnpublished extends Message { */ export class TrackSubscribed extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: livekit.proto.OwnedTrack track = 2; + * @generated from field: required livekit.proto.OwnedTrack track = 2; */ track?: OwnedTrack; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackSubscribed"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "track", kind: "message", T: OwnedTrack }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "track", kind: "message", T: OwnedTrack, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackSubscribed { @@ -3165,7 +3310,7 @@ export class TrackSubscribed extends Message { } static equals(a: TrackSubscribed | PlainMessage | undefined, b: TrackSubscribed | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackSubscribed, a, b); + return proto2.util.equals(TrackSubscribed, a, b); } } @@ -3176,25 +3321,25 @@ export class TrackUnsubscribed extends Message { /** * The FFI language can dispose/remove the VideoSink here * - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackUnsubscribed"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackUnsubscribed { @@ -3210,7 +3355,7 @@ export class TrackUnsubscribed extends Message { } static equals(a: TrackUnsubscribed | PlainMessage | undefined, b: TrackUnsubscribed | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackUnsubscribed, a, b); + return proto2.util.equals(TrackUnsubscribed, a, b); } } @@ -3219,31 +3364,31 @@ export class TrackUnsubscribed extends Message { */ export class TrackSubscriptionFailed extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid?: string; /** - * @generated from field: string error = 3; + * @generated from field: required string error = 3; */ - error = ""; + error?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackSubscriptionFailed"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackSubscriptionFailed { @@ -3259,7 +3404,7 @@ export class TrackSubscriptionFailed extends Message { } static equals(a: TrackSubscriptionFailed | PlainMessage | undefined, b: TrackSubscriptionFailed | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackSubscriptionFailed, a, b); + return proto2.util.equals(TrackSubscriptionFailed, a, b); } } @@ -3268,25 +3413,25 @@ export class TrackSubscriptionFailed extends Message { */ export class TrackMuted extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackMuted"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackMuted { @@ -3302,7 +3447,7 @@ export class TrackMuted extends Message { } static equals(a: TrackMuted | PlainMessage | undefined, b: TrackMuted | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackMuted, a, b); + return proto2.util.equals(TrackMuted, a, b); } } @@ -3311,25 +3456,25 @@ export class TrackMuted extends Message { */ export class TrackUnmuted extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackUnmuted"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackUnmuted { @@ -3345,7 +3490,7 @@ export class TrackUnmuted extends Message { } static equals(a: TrackUnmuted | PlainMessage | undefined, b: TrackUnmuted | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackUnmuted, a, b); + return proto2.util.equals(TrackUnmuted, a, b); } } @@ -3356,25 +3501,25 @@ export class E2eeStateChanged extends Message { /** * Using sid instead of identity for ffi communication * - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: livekit.proto.EncryptionState state = 2; + * @generated from field: required livekit.proto.EncryptionState state = 2; */ - state = EncryptionState.NEW; + state?: EncryptionState; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.E2eeStateChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(EncryptionState) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "state", kind: "enum", T: proto2.getEnumType(EncryptionState), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeStateChanged { @@ -3390,7 +3535,7 @@ export class E2eeStateChanged extends Message { } static equals(a: E2eeStateChanged | PlainMessage | undefined, b: E2eeStateChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeStateChanged, a, b); + return proto2.util.equals(E2eeStateChanged, a, b); } } @@ -3405,12 +3550,12 @@ export class ActiveSpeakersChanged extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ActiveSpeakersChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "participant_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, ]); @@ -3427,7 +3572,7 @@ export class ActiveSpeakersChanged extends Message { } static equals(a: ActiveSpeakersChanged | PlainMessage | undefined, b: ActiveSpeakersChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ActiveSpeakersChanged, a, b); + return proto2.util.equals(ActiveSpeakersChanged, a, b); } } @@ -3436,19 +3581,19 @@ export class ActiveSpeakersChanged extends Message { */ export class RoomMetadataChanged extends Message { /** - * @generated from field: string metadata = 1; + * @generated from field: required string metadata = 1; */ - metadata = ""; + metadata?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RoomMetadataChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomMetadataChanged { @@ -3464,7 +3609,7 @@ export class RoomMetadataChanged extends Message { } static equals(a: RoomMetadataChanged | PlainMessage | undefined, b: RoomMetadataChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomMetadataChanged, a, b); + return proto2.util.equals(RoomMetadataChanged, a, b); } } @@ -3473,19 +3618,19 @@ export class RoomMetadataChanged extends Message { */ export class RoomSidChanged extends Message { /** - * @generated from field: string sid = 1; + * @generated from field: required string sid = 1; */ - sid = ""; + sid?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RoomSidChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomSidChanged { @@ -3501,7 +3646,7 @@ export class RoomSidChanged extends Message { } static equals(a: RoomSidChanged | PlainMessage | undefined, b: RoomSidChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomSidChanged, a, b); + return proto2.util.equals(RoomSidChanged, a, b); } } @@ -3510,25 +3655,25 @@ export class RoomSidChanged extends Message { */ export class ParticipantMetadataChanged extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string metadata = 2; + * @generated from field: required string metadata = 2; */ - metadata = ""; + metadata?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ParticipantMetadataChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantMetadataChanged { @@ -3544,7 +3689,7 @@ export class ParticipantMetadataChanged extends Message | undefined, b: ParticipantMetadataChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantMetadataChanged, a, b); + return proto2.util.equals(ParticipantMetadataChanged, a, b); } } @@ -3553,31 +3698,31 @@ export class ParticipantMetadataChanged extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: map attributes = 2; + * @generated from field: repeated livekit.proto.AttributesEntry attributes = 2; */ - attributes: { [key: string]: string } = {}; + attributes: AttributesEntry[] = []; /** - * @generated from field: map changed_attributes = 3; + * @generated from field: repeated livekit.proto.AttributesEntry changed_attributes = 3; */ - changedAttributes: { [key: string]: string } = {}; + changedAttributes: AttributesEntry[] = []; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; 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: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 3, name: "changed_attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "attributes", kind: "message", T: AttributesEntry, repeated: true }, + { no: 3, name: "changed_attributes", kind: "message", T: AttributesEntry, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantAttributesChanged { @@ -3593,7 +3738,7 @@ export class ParticipantAttributesChanged extends Message | undefined, b: ParticipantAttributesChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantAttributesChanged, a, b); + return proto2.util.equals(ParticipantAttributesChanged, a, b); } } @@ -3602,25 +3747,25 @@ export class ParticipantAttributesChanged extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; + name?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ParticipantNameChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantNameChanged { @@ -3636,7 +3781,7 @@ export class ParticipantNameChanged extends Message { } static equals(a: ParticipantNameChanged | PlainMessage | undefined, b: ParticipantNameChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantNameChanged, a, b); + return proto2.util.equals(ParticipantNameChanged, a, b); } } @@ -3645,25 +3790,25 @@ export class ParticipantNameChanged extends Message { */ export class ConnectionQualityChanged extends Message { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity?: string; /** - * @generated from field: livekit.proto.ConnectionQuality quality = 2; + * @generated from field: required livekit.proto.ConnectionQuality quality = 2; */ - quality = ConnectionQuality.QUALITY_POOR; + quality?: ConnectionQuality; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ConnectionQualityChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "quality", kind: "enum", T: proto3.getEnumType(ConnectionQuality) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "quality", kind: "enum", T: proto2.getEnumType(ConnectionQuality), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectionQualityChanged { @@ -3679,7 +3824,7 @@ export class ConnectionQualityChanged extends Message } static equals(a: ConnectionQualityChanged | PlainMessage | undefined, b: ConnectionQualityChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectionQualityChanged, a, b); + return proto2.util.equals(ConnectionQualityChanged, a, b); } } @@ -3688,7 +3833,7 @@ export class ConnectionQualityChanged extends Message */ export class UserPacket extends Message { /** - * @generated from field: livekit.proto.OwnedBuffer data = 1; + * @generated from field: required livekit.proto.OwnedBuffer data = 1; */ data?: OwnedBuffer; @@ -3699,13 +3844,13 @@ export class UserPacket extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.UserPacket"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data", kind: "message", T: OwnedBuffer }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "data", kind: "message", T: OwnedBuffer, req: true }, { no: 2, name: "topic", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -3722,7 +3867,7 @@ export class UserPacket extends Message { } static equals(a: UserPacket | PlainMessage | undefined, b: UserPacket | PlainMessage | undefined): boolean { - return proto3.util.equals(UserPacket, a, b); + return proto2.util.equals(UserPacket, a, b); } } @@ -3731,19 +3876,19 @@ export class UserPacket extends Message { */ export class ChatMessage extends Message { /** - * @generated from field: string id = 1; + * @generated from field: required string id = 1; */ - id = ""; + id?: string; /** - * @generated from field: int64 timestamp = 2; + * @generated from field: required int64 timestamp = 2; */ - timestamp = protoInt64.zero; + timestamp?: bigint; /** - * @generated from field: string message = 3; + * @generated from field: required string message = 3; */ - message = ""; + message?: string; /** * @generated from field: optional int64 edit_timestamp = 4; @@ -3762,15 +3907,15 @@ export class ChatMessage extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ChatMessage"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 3, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, + { no: 3, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, { no: 4, name: "edit_timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, { no: 5, name: "deleted", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, { no: 6, name: "generated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, @@ -3789,7 +3934,7 @@ export class ChatMessage extends Message { } static equals(a: ChatMessage | PlainMessage | undefined, b: ChatMessage | PlainMessage | undefined): boolean { - return proto3.util.equals(ChatMessage, a, b); + return proto2.util.equals(ChatMessage, a, b); } } @@ -3798,25 +3943,25 @@ export class ChatMessage extends Message { */ export class ChatMessageReceived extends Message { /** - * @generated from field: livekit.proto.ChatMessage message = 1; + * @generated from field: required livekit.proto.ChatMessage message = 1; */ message?: ChatMessage; /** - * @generated from field: string participant_identity = 2; + * @generated from field: required string participant_identity = 2; */ - participantIdentity = ""; + participantIdentity?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ChatMessageReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "message", kind: "message", T: ChatMessage }, - { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "message", kind: "message", T: ChatMessage, req: true }, + { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ChatMessageReceived { @@ -3832,7 +3977,7 @@ export class ChatMessageReceived extends Message { } static equals(a: ChatMessageReceived | PlainMessage | undefined, b: ChatMessageReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(ChatMessageReceived, a, b); + return proto2.util.equals(ChatMessageReceived, a, b); } } @@ -3841,9 +3986,9 @@ export class ChatMessageReceived extends Message { */ export class SipDTMF extends Message { /** - * @generated from field: uint32 code = 1; + * @generated from field: required uint32 code = 1; */ - code = 0; + code?: number; /** * @generated from field: optional string digit = 2; @@ -3852,13 +3997,13 @@ export class SipDTMF extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SipDTMF"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, { no: 2, name: "digit", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -3875,7 +4020,7 @@ export class SipDTMF extends Message { } static equals(a: SipDTMF | PlainMessage | undefined, b: SipDTMF | PlainMessage | undefined): boolean { - return proto3.util.equals(SipDTMF, a, b); + return proto2.util.equals(SipDTMF, a, b); } } @@ -3884,16 +4029,16 @@ export class SipDTMF extends Message { */ export class DataPacketReceived extends Message { /** - * @generated from field: livekit.proto.DataPacketKind kind = 1; + * @generated from field: required livekit.proto.DataPacketKind kind = 1; */ - kind = DataPacketKind.KIND_LOSSY; + kind?: DataPacketKind; /** * Can be empty if the data is sent a server SDK * - * @generated from field: string participant_identity = 2; + * @generated from field: required string participant_identity = 2; */ - participantIdentity = ""; + participantIdentity?: string; /** * @generated from oneof livekit.proto.DataPacketReceived.value @@ -3914,14 +4059,14 @@ export class DataPacketReceived extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.DataPacketReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "kind", kind: "enum", T: proto3.getEnumType(DataPacketKind) }, - { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "kind", kind: "enum", T: proto2.getEnumType(DataPacketKind), req: true }, + { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, { no: 4, name: "user", kind: "message", T: UserPacket, oneof: "value" }, { no: 5, name: "sip_dtmf", kind: "message", T: SipDTMF, oneof: "value" }, ]); @@ -3939,7 +4084,7 @@ export class DataPacketReceived extends Message { } static equals(a: DataPacketReceived | PlainMessage | undefined, b: DataPacketReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(DataPacketReceived, a, b); + return proto2.util.equals(DataPacketReceived, a, b); } } @@ -3964,12 +4109,12 @@ export class TranscriptionReceived extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TranscriptionReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 3, name: "segments", kind: "message", T: TranscriptionSegment, repeated: true }, @@ -3988,7 +4133,7 @@ export class TranscriptionReceived extends Message { } static equals(a: TranscriptionReceived | PlainMessage | undefined, b: TranscriptionReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(TranscriptionReceived, a, b); + return proto2.util.equals(TranscriptionReceived, a, b); } } @@ -3997,19 +4142,19 @@ export class TranscriptionReceived extends Message { */ export class ConnectionStateChanged extends Message { /** - * @generated from field: livekit.proto.ConnectionState state = 1; + * @generated from field: required livekit.proto.ConnectionState state = 1; */ - state = ConnectionState.CONN_DISCONNECTED; + state?: ConnectionState; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ConnectionStateChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "state", kind: "enum", T: proto3.getEnumType(ConnectionState) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "state", kind: "enum", T: proto2.getEnumType(ConnectionState), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectionStateChanged { @@ -4025,7 +4170,7 @@ export class ConnectionStateChanged extends Message { } static equals(a: ConnectionStateChanged | PlainMessage | undefined, b: ConnectionStateChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectionStateChanged, a, b); + return proto2.util.equals(ConnectionStateChanged, a, b); } } @@ -4035,12 +4180,12 @@ export class ConnectionStateChanged extends Message { export class Connected extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.Connected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): Connected { @@ -4056,7 +4201,7 @@ export class Connected extends Message { } static equals(a: Connected | PlainMessage | undefined, b: Connected | PlainMessage | undefined): boolean { - return proto3.util.equals(Connected, a, b); + return proto2.util.equals(Connected, a, b); } } @@ -4065,19 +4210,19 @@ export class Connected extends Message { */ export class Disconnected extends Message { /** - * @generated from field: livekit.proto.DisconnectReason reason = 1; + * @generated from field: required livekit.proto.DisconnectReason reason = 1; */ - reason = DisconnectReason.UNKNOWN_REASON; + reason?: DisconnectReason; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.Disconnected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "reason", kind: "enum", T: proto3.getEnumType(DisconnectReason) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "reason", kind: "enum", T: proto2.getEnumType(DisconnectReason), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Disconnected { @@ -4093,7 +4238,7 @@ export class Disconnected extends Message { } static equals(a: Disconnected | PlainMessage | undefined, b: Disconnected | PlainMessage | undefined): boolean { - return proto3.util.equals(Disconnected, a, b); + return proto2.util.equals(Disconnected, a, b); } } @@ -4103,12 +4248,12 @@ export class Disconnected extends Message { export class Reconnecting extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.Reconnecting"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): Reconnecting { @@ -4124,7 +4269,7 @@ export class Reconnecting extends Message { } static equals(a: Reconnecting | PlainMessage | undefined, b: Reconnecting | PlainMessage | undefined): boolean { - return proto3.util.equals(Reconnecting, a, b); + return proto2.util.equals(Reconnecting, a, b); } } @@ -4134,12 +4279,12 @@ export class Reconnecting extends Message { export class Reconnected extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.Reconnected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): Reconnected { @@ -4155,7 +4300,7 @@ export class Reconnected extends Message { } static equals(a: Reconnected | PlainMessage | undefined, b: Reconnected | PlainMessage | undefined): boolean { - return proto3.util.equals(Reconnected, a, b); + return proto2.util.equals(Reconnected, a, b); } } @@ -4165,12 +4310,12 @@ export class Reconnected extends Message { export class RoomEOS extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RoomEOS"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomEOS { @@ -4186,7 +4331,7 @@ export class RoomEOS extends Message { } static equals(a: RoomEOS | PlainMessage | undefined, b: RoomEOS | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomEOS, a, b); + return proto2.util.equals(RoomEOS, a, b); } } diff --git a/packages/livekit-rtc/src/proto/stats_pb.ts b/packages/livekit-rtc/src/proto/stats_pb.ts index ee7a001f..d0faf3db 100644 --- a/packages/livekit-rtc/src/proto/stats_pb.ts +++ b/packages/livekit-rtc/src/proto/stats_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file stats.proto (package livekit.proto, syntax proto3) +// @generated from file stats.proto (package livekit.proto, syntax proto2) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { Message, proto2 } from "@bufbuild/protobuf"; /** * @generated from enum livekit.proto.DataChannelState @@ -44,8 +44,8 @@ export enum DataChannelState { */ DC_CLOSED = 3, } -// Retrieve enum metadata with: proto3.getEnumType(DataChannelState) -proto3.util.setEnumType(DataChannelState, "livekit.proto.DataChannelState", [ +// Retrieve enum metadata with: proto2.getEnumType(DataChannelState) +proto2.util.setEnumType(DataChannelState, "livekit.proto.DataChannelState", [ { no: 0, name: "DC_CONNECTING" }, { no: 1, name: "DC_OPEN" }, { no: 2, name: "DC_CLOSING" }, @@ -76,8 +76,8 @@ export enum QualityLimitationReason { */ LIMITATION_OTHER = 3, } -// Retrieve enum metadata with: proto3.getEnumType(QualityLimitationReason) -proto3.util.setEnumType(QualityLimitationReason, "livekit.proto.QualityLimitationReason", [ +// Retrieve enum metadata with: proto2.getEnumType(QualityLimitationReason) +proto2.util.setEnumType(QualityLimitationReason, "livekit.proto.QualityLimitationReason", [ { no: 0, name: "LIMITATION_NONE" }, { no: 1, name: "LIMITATION_CPU" }, { no: 2, name: "LIMITATION_BANDWIDTH" }, @@ -103,8 +103,8 @@ export enum IceRole { */ ICE_CONTROLLED = 2, } -// Retrieve enum metadata with: proto3.getEnumType(IceRole) -proto3.util.setEnumType(IceRole, "livekit.proto.IceRole", [ +// Retrieve enum metadata with: proto2.getEnumType(IceRole) +proto2.util.setEnumType(IceRole, "livekit.proto.IceRole", [ { no: 0, name: "ICE_UNKNOWN" }, { no: 1, name: "ICE_CONTROLLING" }, { no: 2, name: "ICE_CONTROLLED" }, @@ -139,8 +139,8 @@ export enum DtlsTransportState { */ DTLS_TRANSPORT_FAILED = 4, } -// Retrieve enum metadata with: proto3.getEnumType(DtlsTransportState) -proto3.util.setEnumType(DtlsTransportState, "livekit.proto.DtlsTransportState", [ +// Retrieve enum metadata with: proto2.getEnumType(DtlsTransportState) +proto2.util.setEnumType(DtlsTransportState, "livekit.proto.DtlsTransportState", [ { no: 0, name: "DTLS_TRANSPORT_NEW" }, { no: 1, name: "DTLS_TRANSPORT_CONNECTING" }, { no: 2, name: "DTLS_TRANSPORT_CONNECTED" }, @@ -187,8 +187,8 @@ export enum IceTransportState { */ ICE_TRANSPORT_CLOSED = 6, } -// Retrieve enum metadata with: proto3.getEnumType(IceTransportState) -proto3.util.setEnumType(IceTransportState, "livekit.proto.IceTransportState", [ +// Retrieve enum metadata with: proto2.getEnumType(IceTransportState) +proto2.util.setEnumType(IceTransportState, "livekit.proto.IceTransportState", [ { no: 0, name: "ICE_TRANSPORT_NEW" }, { no: 1, name: "ICE_TRANSPORT_CHECKING" }, { no: 2, name: "ICE_TRANSPORT_CONNECTED" }, @@ -217,8 +217,8 @@ export enum DtlsRole { */ DTLS_UNKNOWN = 2, } -// Retrieve enum metadata with: proto3.getEnumType(DtlsRole) -proto3.util.setEnumType(DtlsRole, "livekit.proto.DtlsRole", [ +// Retrieve enum metadata with: proto2.getEnumType(DtlsRole) +proto2.util.setEnumType(DtlsRole, "livekit.proto.DtlsRole", [ { no: 0, name: "DTLS_CLIENT" }, { no: 1, name: "DTLS_SERVER" }, { no: 2, name: "DTLS_UNKNOWN" }, @@ -253,8 +253,8 @@ export enum IceCandidatePairState { */ PAIR_SUCCEEDED = 4, } -// Retrieve enum metadata with: proto3.getEnumType(IceCandidatePairState) -proto3.util.setEnumType(IceCandidatePairState, "livekit.proto.IceCandidatePairState", [ +// Retrieve enum metadata with: proto2.getEnumType(IceCandidatePairState) +proto2.util.setEnumType(IceCandidatePairState, "livekit.proto.IceCandidatePairState", [ { no: 0, name: "PAIR_FROZEN" }, { no: 1, name: "PAIR_WAITING" }, { no: 2, name: "PAIR_IN_PROGRESS" }, @@ -286,8 +286,8 @@ export enum IceCandidateType { */ RELAY = 3, } -// Retrieve enum metadata with: proto3.getEnumType(IceCandidateType) -proto3.util.setEnumType(IceCandidateType, "livekit.proto.IceCandidateType", [ +// Retrieve enum metadata with: proto2.getEnumType(IceCandidateType) +proto2.util.setEnumType(IceCandidateType, "livekit.proto.IceCandidateType", [ { no: 0, name: "HOST" }, { no: 1, name: "SRFLX" }, { no: 2, name: "PRFLX" }, @@ -313,8 +313,8 @@ export enum IceServerTransportProtocol { */ TRANSPORT_TLS = 2, } -// Retrieve enum metadata with: proto3.getEnumType(IceServerTransportProtocol) -proto3.util.setEnumType(IceServerTransportProtocol, "livekit.proto.IceServerTransportProtocol", [ +// Retrieve enum metadata with: proto2.getEnumType(IceServerTransportProtocol) +proto2.util.setEnumType(IceServerTransportProtocol, "livekit.proto.IceServerTransportProtocol", [ { no: 0, name: "TRANSPORT_UDP" }, { no: 1, name: "TRANSPORT_TCP" }, { no: 2, name: "TRANSPORT_TLS" }, @@ -339,8 +339,8 @@ export enum IceTcpCandidateType { */ CANDIDATE_SO = 2, } -// Retrieve enum metadata with: proto3.getEnumType(IceTcpCandidateType) -proto3.util.setEnumType(IceTcpCandidateType, "livekit.proto.IceTcpCandidateType", [ +// Retrieve enum metadata with: proto2.getEnumType(IceTcpCandidateType) +proto2.util.setEnumType(IceTcpCandidateType, "livekit.proto.IceTcpCandidateType", [ { no: 0, name: "CANDIDATE_ACTIVE" }, { no: 1, name: "CANDIDATE_PASSIVE" }, { no: 2, name: "CANDIDATE_SO" }, @@ -447,12 +447,12 @@ export class RtcStats extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ { no: 3, name: "codec", kind: "message", T: RtcStats_Codec, oneof: "stats" }, { no: 4, name: "inbound_rtp", kind: "message", T: RtcStats_InboundRtp, oneof: "stats" }, { no: 5, name: "outbound_rtp", kind: "message", T: RtcStats_OutboundRtp, oneof: "stats" }, @@ -483,7 +483,7 @@ export class RtcStats extends Message { } static equals(a: RtcStats | PlainMessage | undefined, b: RtcStats | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats, a, b); + return proto2.util.equals(RtcStats, a, b); } } @@ -492,25 +492,25 @@ export class RtcStats extends Message { */ export class RtcStats_Codec extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.CodecStats codec = 2; + * @generated from field: required livekit.proto.CodecStats codec = 2; */ codec?: CodecStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.Codec"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "codec", kind: "message", T: CodecStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "codec", kind: "message", T: CodecStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Codec { @@ -526,7 +526,7 @@ export class RtcStats_Codec extends Message { } static equals(a: RtcStats_Codec | PlainMessage | undefined, b: RtcStats_Codec | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_Codec, a, b); + return proto2.util.equals(RtcStats_Codec, a, b); } } @@ -535,37 +535,37 @@ export class RtcStats_Codec extends Message { */ export class RtcStats_InboundRtp extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.RtpStreamStats stream = 2; + * @generated from field: required livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: livekit.proto.ReceivedRtpStreamStats received = 3; + * @generated from field: required livekit.proto.ReceivedRtpStreamStats received = 3; */ received?: ReceivedRtpStreamStats; /** - * @generated from field: livekit.proto.InboundRtpStreamStats inbound = 4; + * @generated from field: required livekit.proto.InboundRtpStreamStats inbound = 4; */ inbound?: InboundRtpStreamStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.InboundRtp"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, - { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats }, - { no: 4, name: "inbound", kind: "message", T: InboundRtpStreamStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "stream", kind: "message", T: RtpStreamStats, req: true }, + { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats, req: true }, + { no: 4, name: "inbound", kind: "message", T: InboundRtpStreamStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_InboundRtp { @@ -581,7 +581,7 @@ export class RtcStats_InboundRtp extends Message { } static equals(a: RtcStats_InboundRtp | PlainMessage | undefined, b: RtcStats_InboundRtp | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_InboundRtp, a, b); + return proto2.util.equals(RtcStats_InboundRtp, a, b); } } @@ -590,37 +590,37 @@ export class RtcStats_InboundRtp extends Message { */ export class RtcStats_OutboundRtp extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.RtpStreamStats stream = 2; + * @generated from field: required livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: livekit.proto.SentRtpStreamStats sent = 3; + * @generated from field: required livekit.proto.SentRtpStreamStats sent = 3; */ sent?: SentRtpStreamStats; /** - * @generated from field: livekit.proto.OutboundRtpStreamStats outbound = 4; + * @generated from field: required livekit.proto.OutboundRtpStreamStats outbound = 4; */ outbound?: OutboundRtpStreamStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.OutboundRtp"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, - { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats }, - { no: 4, name: "outbound", kind: "message", T: OutboundRtpStreamStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "stream", kind: "message", T: RtpStreamStats, req: true }, + { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats, req: true }, + { no: 4, name: "outbound", kind: "message", T: OutboundRtpStreamStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_OutboundRtp { @@ -636,7 +636,7 @@ export class RtcStats_OutboundRtp extends Message { } static equals(a: RtcStats_OutboundRtp | PlainMessage | undefined, b: RtcStats_OutboundRtp | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_OutboundRtp, a, b); + return proto2.util.equals(RtcStats_OutboundRtp, a, b); } } @@ -645,37 +645,37 @@ export class RtcStats_OutboundRtp extends Message { */ export class RtcStats_RemoteInboundRtp extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.RtpStreamStats stream = 2; + * @generated from field: required livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: livekit.proto.ReceivedRtpStreamStats received = 3; + * @generated from field: required livekit.proto.ReceivedRtpStreamStats received = 3; */ received?: ReceivedRtpStreamStats; /** - * @generated from field: livekit.proto.RemoteInboundRtpStreamStats remote_inbound = 4; + * @generated from field: required livekit.proto.RemoteInboundRtpStreamStats remote_inbound = 4; */ remoteInbound?: RemoteInboundRtpStreamStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.RemoteInboundRtp"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, - { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats }, - { no: 4, name: "remote_inbound", kind: "message", T: RemoteInboundRtpStreamStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "stream", kind: "message", T: RtpStreamStats, req: true }, + { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats, req: true }, + { no: 4, name: "remote_inbound", kind: "message", T: RemoteInboundRtpStreamStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_RemoteInboundRtp { @@ -691,7 +691,7 @@ export class RtcStats_RemoteInboundRtp extends Message | undefined, b: RtcStats_RemoteInboundRtp | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_RemoteInboundRtp, a, b); + return proto2.util.equals(RtcStats_RemoteInboundRtp, a, b); } } @@ -700,37 +700,37 @@ export class RtcStats_RemoteInboundRtp extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.RtpStreamStats stream = 2; + * @generated from field: required livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: livekit.proto.SentRtpStreamStats sent = 3; + * @generated from field: required livekit.proto.SentRtpStreamStats sent = 3; */ sent?: SentRtpStreamStats; /** - * @generated from field: livekit.proto.RemoteOutboundRtpStreamStats remote_outbound = 4; + * @generated from field: required livekit.proto.RemoteOutboundRtpStreamStats remote_outbound = 4; */ remoteOutbound?: RemoteOutboundRtpStreamStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.RemoteOutboundRtp"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, - { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats }, - { no: 4, name: "remote_outbound", kind: "message", T: RemoteOutboundRtpStreamStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "stream", kind: "message", T: RtpStreamStats, req: true }, + { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats, req: true }, + { no: 4, name: "remote_outbound", kind: "message", T: RemoteOutboundRtpStreamStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_RemoteOutboundRtp { @@ -746,7 +746,7 @@ export class RtcStats_RemoteOutboundRtp extends Message | undefined, b: RtcStats_RemoteOutboundRtp | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_RemoteOutboundRtp, a, b); + return proto2.util.equals(RtcStats_RemoteOutboundRtp, a, b); } } @@ -755,37 +755,37 @@ export class RtcStats_RemoteOutboundRtp extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.MediaSourceStats source = 2; + * @generated from field: required livekit.proto.MediaSourceStats source = 2; */ source?: MediaSourceStats; /** - * @generated from field: livekit.proto.AudioSourceStats audio = 3; + * @generated from field: required livekit.proto.AudioSourceStats audio = 3; */ audio?: AudioSourceStats; /** - * @generated from field: livekit.proto.VideoSourceStats video = 4; + * @generated from field: required livekit.proto.VideoSourceStats video = 4; */ video?: VideoSourceStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.MediaSource"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "source", kind: "message", T: MediaSourceStats }, - { no: 3, name: "audio", kind: "message", T: AudioSourceStats }, - { no: 4, name: "video", kind: "message", T: VideoSourceStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "source", kind: "message", T: MediaSourceStats, req: true }, + { no: 3, name: "audio", kind: "message", T: AudioSourceStats, req: true }, + { no: 4, name: "video", kind: "message", T: VideoSourceStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_MediaSource { @@ -801,7 +801,7 @@ export class RtcStats_MediaSource extends Message { } static equals(a: RtcStats_MediaSource | PlainMessage | undefined, b: RtcStats_MediaSource | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_MediaSource, a, b); + return proto2.util.equals(RtcStats_MediaSource, a, b); } } @@ -810,25 +810,25 @@ export class RtcStats_MediaSource extends Message { */ export class RtcStats_MediaPlayout extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.AudioPlayoutStats audio_playout = 2; + * @generated from field: required livekit.proto.AudioPlayoutStats audio_playout = 2; */ audioPlayout?: AudioPlayoutStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.MediaPlayout"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "audio_playout", kind: "message", T: AudioPlayoutStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "audio_playout", kind: "message", T: AudioPlayoutStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_MediaPlayout { @@ -844,7 +844,7 @@ export class RtcStats_MediaPlayout extends Message { } static equals(a: RtcStats_MediaPlayout | PlainMessage | undefined, b: RtcStats_MediaPlayout | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_MediaPlayout, a, b); + return proto2.util.equals(RtcStats_MediaPlayout, a, b); } } @@ -853,25 +853,25 @@ export class RtcStats_MediaPlayout extends Message { */ export class RtcStats_PeerConnection extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.PeerConnectionStats pc = 2; + * @generated from field: required livekit.proto.PeerConnectionStats pc = 2; */ pc?: PeerConnectionStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.PeerConnection"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "pc", kind: "message", T: PeerConnectionStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "pc", kind: "message", T: PeerConnectionStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_PeerConnection { @@ -887,7 +887,7 @@ export class RtcStats_PeerConnection extends Message { } static equals(a: RtcStats_PeerConnection | PlainMessage | undefined, b: RtcStats_PeerConnection | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_PeerConnection, a, b); + return proto2.util.equals(RtcStats_PeerConnection, a, b); } } @@ -896,25 +896,25 @@ export class RtcStats_PeerConnection extends Message { */ export class RtcStats_DataChannel extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.DataChannelStats dc = 2; + * @generated from field: required livekit.proto.DataChannelStats dc = 2; */ dc?: DataChannelStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.DataChannel"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "dc", kind: "message", T: DataChannelStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "dc", kind: "message", T: DataChannelStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_DataChannel { @@ -930,7 +930,7 @@ export class RtcStats_DataChannel extends Message { } static equals(a: RtcStats_DataChannel | PlainMessage | undefined, b: RtcStats_DataChannel | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_DataChannel, a, b); + return proto2.util.equals(RtcStats_DataChannel, a, b); } } @@ -939,25 +939,25 @@ export class RtcStats_DataChannel extends Message { */ export class RtcStats_Transport extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.TransportStats transport = 2; + * @generated from field: required livekit.proto.TransportStats transport = 2; */ transport?: TransportStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.Transport"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "transport", kind: "message", T: TransportStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "transport", kind: "message", T: TransportStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Transport { @@ -973,7 +973,7 @@ export class RtcStats_Transport extends Message { } static equals(a: RtcStats_Transport | PlainMessage | undefined, b: RtcStats_Transport | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_Transport, a, b); + return proto2.util.equals(RtcStats_Transport, a, b); } } @@ -982,25 +982,25 @@ export class RtcStats_Transport extends Message { */ export class RtcStats_CandidatePair extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.CandidatePairStats candidate_pair = 2; + * @generated from field: required livekit.proto.CandidatePairStats candidate_pair = 2; */ candidatePair?: CandidatePairStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.CandidatePair"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "candidate_pair", kind: "message", T: CandidatePairStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "candidate_pair", kind: "message", T: CandidatePairStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_CandidatePair { @@ -1016,7 +1016,7 @@ export class RtcStats_CandidatePair extends Message { } static equals(a: RtcStats_CandidatePair | PlainMessage | undefined, b: RtcStats_CandidatePair | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_CandidatePair, a, b); + return proto2.util.equals(RtcStats_CandidatePair, a, b); } } @@ -1025,25 +1025,25 @@ export class RtcStats_CandidatePair extends Message { */ export class RtcStats_LocalCandidate extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.IceCandidateStats candidate = 2; + * @generated from field: required livekit.proto.IceCandidateStats candidate = 2; */ candidate?: IceCandidateStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.LocalCandidate"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "candidate", kind: "message", T: IceCandidateStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "candidate", kind: "message", T: IceCandidateStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_LocalCandidate { @@ -1059,7 +1059,7 @@ export class RtcStats_LocalCandidate extends Message { } static equals(a: RtcStats_LocalCandidate | PlainMessage | undefined, b: RtcStats_LocalCandidate | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_LocalCandidate, a, b); + return proto2.util.equals(RtcStats_LocalCandidate, a, b); } } @@ -1068,25 +1068,25 @@ export class RtcStats_LocalCandidate extends Message { */ export class RtcStats_RemoteCandidate extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.IceCandidateStats candidate = 2; + * @generated from field: required livekit.proto.IceCandidateStats candidate = 2; */ candidate?: IceCandidateStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.RemoteCandidate"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "candidate", kind: "message", T: IceCandidateStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "candidate", kind: "message", T: IceCandidateStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_RemoteCandidate { @@ -1102,7 +1102,7 @@ export class RtcStats_RemoteCandidate extends Message } static equals(a: RtcStats_RemoteCandidate | PlainMessage | undefined, b: RtcStats_RemoteCandidate | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_RemoteCandidate, a, b); + return proto2.util.equals(RtcStats_RemoteCandidate, a, b); } } @@ -1111,25 +1111,25 @@ export class RtcStats_RemoteCandidate extends Message */ export class RtcStats_Certificate extends Message { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.CertificateStats certificate = 2; + * @generated from field: required livekit.proto.CertificateStats certificate = 2; */ certificate?: CertificateStats; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.Certificate"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "certificate", kind: "message", T: CertificateStats }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, + { no: 2, name: "certificate", kind: "message", T: CertificateStats, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Certificate { @@ -1145,7 +1145,7 @@ export class RtcStats_Certificate extends Message { } static equals(a: RtcStats_Certificate | PlainMessage | undefined, b: RtcStats_Certificate | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_Certificate, a, b); + return proto2.util.equals(RtcStats_Certificate, a, b); } } @@ -1157,12 +1157,12 @@ export class RtcStats_Certificate extends Message { export class RtcStats_Track extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStats.Track"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Track { @@ -1178,7 +1178,7 @@ export class RtcStats_Track extends Message { } static equals(a: RtcStats_Track | PlainMessage | undefined, b: RtcStats_Track | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_Track, a, b); + return proto2.util.equals(RtcStats_Track, a, b); } } @@ -1187,25 +1187,25 @@ export class RtcStats_Track extends Message { */ export class RtcStatsData extends Message { /** - * @generated from field: string id = 1; + * @generated from field: required string id = 1; */ - id = ""; + id?: string; /** - * @generated from field: int64 timestamp = 2; + * @generated from field: required int64 timestamp = 2; */ - timestamp = protoInt64.zero; + timestamp?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtcStatsData"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStatsData { @@ -1221,7 +1221,7 @@ export class RtcStatsData extends Message { } static equals(a: RtcStatsData | PlainMessage | undefined, b: RtcStatsData | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStatsData, a, b); + return proto2.util.equals(RtcStatsData, a, b); } } @@ -1230,49 +1230,49 @@ export class RtcStatsData extends Message { */ export class CodecStats extends Message { /** - * @generated from field: uint32 payload_type = 1; + * @generated from field: required uint32 payload_type = 1; */ - payloadType = 0; + payloadType?: number; /** - * @generated from field: string transport_id = 2; + * @generated from field: required string transport_id = 2; */ - transportId = ""; + transportId?: string; /** - * @generated from field: string mime_type = 3; + * @generated from field: required string mime_type = 3; */ - mimeType = ""; + mimeType?: string; /** - * @generated from field: uint32 clock_rate = 4; + * @generated from field: required uint32 clock_rate = 4; */ - clockRate = 0; + clockRate?: number; /** - * @generated from field: uint32 channels = 5; + * @generated from field: required uint32 channels = 5; */ - channels = 0; + channels?: number; /** - * @generated from field: string sdp_fmtp_line = 6; + * @generated from field: required string sdp_fmtp_line = 6; */ - sdpFmtpLine = ""; + sdpFmtpLine?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CodecStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "payload_type", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "clock_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 5, name: "channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 6, name: "sdp_fmtp_line", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "payload_type", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 2, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 4, name: "clock_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 5, name: "channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 6, name: "sdp_fmtp_line", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CodecStats { @@ -1288,7 +1288,7 @@ export class CodecStats extends Message { } static equals(a: CodecStats | PlainMessage | undefined, b: CodecStats | PlainMessage | undefined): boolean { - return proto3.util.equals(CodecStats, a, b); + return proto2.util.equals(CodecStats, a, b); } } @@ -1297,37 +1297,37 @@ export class CodecStats extends Message { */ export class RtpStreamStats extends Message { /** - * @generated from field: uint32 ssrc = 1; + * @generated from field: required uint32 ssrc = 1; */ - ssrc = 0; + ssrc?: number; /** - * @generated from field: string kind = 2; + * @generated from field: required string kind = 2; */ - kind = ""; + kind?: string; /** - * @generated from field: string transport_id = 3; + * @generated from field: required string transport_id = 3; */ - transportId = ""; + transportId?: string; /** - * @generated from field: string codec_id = 4; + * @generated from field: required string codec_id = 4; */ - codecId = ""; + codecId?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "codec_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 4, name: "codec_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtpStreamStats { @@ -1343,7 +1343,7 @@ export class RtpStreamStats extends Message { } static equals(a: RtpStreamStats | PlainMessage | undefined, b: RtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(RtpStreamStats, a, b); + return proto2.util.equals(RtpStreamStats, a, b); } } @@ -1352,31 +1352,31 @@ export class RtpStreamStats extends Message { */ export class ReceivedRtpStreamStats extends Message { /** - * @generated from field: uint64 packets_received = 1; + * @generated from field: required uint64 packets_received = 1; */ - packetsReceived = protoInt64.zero; + packetsReceived?: bigint; /** - * @generated from field: int64 packets_lost = 2; + * @generated from field: required int64 packets_lost = 2; */ - packetsLost = protoInt64.zero; + packetsLost?: bigint; /** - * @generated from field: double jitter = 3; + * @generated from field: required double jitter = 3; */ - jitter = 0; + jitter?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.ReceivedRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "packets_lost", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 3, name: "jitter", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "packets_lost", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, + { no: 3, name: "jitter", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ReceivedRtpStreamStats { @@ -1392,7 +1392,7 @@ export class ReceivedRtpStreamStats extends Message { } static equals(a: ReceivedRtpStreamStats | PlainMessage | undefined, b: ReceivedRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(ReceivedRtpStreamStats, a, b); + return proto2.util.equals(ReceivedRtpStreamStats, a, b); } } @@ -1401,331 +1401,331 @@ export class ReceivedRtpStreamStats extends Message { */ export class InboundRtpStreamStats extends Message { /** - * @generated from field: string track_identifier = 1; + * @generated from field: required string track_identifier = 1; */ - trackIdentifier = ""; + trackIdentifier?: string; /** - * @generated from field: string mid = 2; + * @generated from field: required string mid = 2; */ - mid = ""; + mid?: string; /** - * @generated from field: string remote_id = 3; + * @generated from field: required string remote_id = 3; */ - remoteId = ""; + remoteId?: string; /** - * @generated from field: uint32 frames_decoded = 4; + * @generated from field: required uint32 frames_decoded = 4; */ - framesDecoded = 0; + framesDecoded?: number; /** - * @generated from field: uint32 key_frames_decoded = 5; + * @generated from field: required uint32 key_frames_decoded = 5; */ - keyFramesDecoded = 0; + keyFramesDecoded?: number; /** - * @generated from field: uint32 frames_rendered = 6; + * @generated from field: required uint32 frames_rendered = 6; */ - framesRendered = 0; + framesRendered?: number; /** - * @generated from field: uint32 frames_dropped = 7; + * @generated from field: required uint32 frames_dropped = 7; */ - framesDropped = 0; + framesDropped?: number; /** - * @generated from field: uint32 frame_width = 8; + * @generated from field: required uint32 frame_width = 8; */ - frameWidth = 0; + frameWidth?: number; /** - * @generated from field: uint32 frame_height = 9; + * @generated from field: required uint32 frame_height = 9; */ - frameHeight = 0; + frameHeight?: number; /** - * @generated from field: double frames_per_second = 10; + * @generated from field: required double frames_per_second = 10; */ - framesPerSecond = 0; + framesPerSecond?: number; /** - * @generated from field: uint64 qp_sum = 11; + * @generated from field: required uint64 qp_sum = 11; */ - qpSum = protoInt64.zero; + qpSum?: bigint; /** - * @generated from field: double total_decode_time = 12; + * @generated from field: required double total_decode_time = 12; */ - totalDecodeTime = 0; + totalDecodeTime?: number; /** - * @generated from field: double total_inter_frame_delay = 13; + * @generated from field: required double total_inter_frame_delay = 13; */ - totalInterFrameDelay = 0; + totalInterFrameDelay?: number; /** - * @generated from field: double total_squared_inter_frame_delay = 14; + * @generated from field: required double total_squared_inter_frame_delay = 14; */ - totalSquaredInterFrameDelay = 0; + totalSquaredInterFrameDelay?: number; /** - * @generated from field: uint32 pause_count = 15; + * @generated from field: required uint32 pause_count = 15; */ - pauseCount = 0; + pauseCount?: number; /** - * @generated from field: double total_pause_duration = 16; + * @generated from field: required double total_pause_duration = 16; */ - totalPauseDuration = 0; + totalPauseDuration?: number; /** - * @generated from field: uint32 freeze_count = 17; + * @generated from field: required uint32 freeze_count = 17; */ - freezeCount = 0; + freezeCount?: number; /** - * @generated from field: double total_freeze_duration = 18; + * @generated from field: required double total_freeze_duration = 18; */ - totalFreezeDuration = 0; + totalFreezeDuration?: number; /** - * @generated from field: double last_packet_received_timestamp = 19; + * @generated from field: required double last_packet_received_timestamp = 19; */ - lastPacketReceivedTimestamp = 0; + lastPacketReceivedTimestamp?: number; /** - * @generated from field: uint64 header_bytes_received = 20; + * @generated from field: required uint64 header_bytes_received = 20; */ - headerBytesReceived = protoInt64.zero; + headerBytesReceived?: bigint; /** - * @generated from field: uint64 packets_discarded = 21; + * @generated from field: required uint64 packets_discarded = 21; */ - packetsDiscarded = protoInt64.zero; + packetsDiscarded?: bigint; /** - * @generated from field: uint64 fec_bytes_received = 22; + * @generated from field: required uint64 fec_bytes_received = 22; */ - fecBytesReceived = protoInt64.zero; + fecBytesReceived?: bigint; /** - * @generated from field: uint64 fec_packets_received = 23; + * @generated from field: required uint64 fec_packets_received = 23; */ - fecPacketsReceived = protoInt64.zero; + fecPacketsReceived?: bigint; /** - * @generated from field: uint64 fec_packets_discarded = 24; + * @generated from field: required uint64 fec_packets_discarded = 24; */ - fecPacketsDiscarded = protoInt64.zero; + fecPacketsDiscarded?: bigint; /** - * @generated from field: uint64 bytes_received = 25; + * @generated from field: required uint64 bytes_received = 25; */ - bytesReceived = protoInt64.zero; + bytesReceived?: bigint; /** - * @generated from field: uint32 nack_count = 26; + * @generated from field: required uint32 nack_count = 26; */ - nackCount = 0; + nackCount?: number; /** - * @generated from field: uint32 fir_count = 27; + * @generated from field: required uint32 fir_count = 27; */ - firCount = 0; + firCount?: number; /** - * @generated from field: uint32 pli_count = 28; + * @generated from field: required uint32 pli_count = 28; */ - pliCount = 0; + pliCount?: number; /** - * @generated from field: double total_processing_delay = 29; + * @generated from field: required double total_processing_delay = 29; */ - totalProcessingDelay = 0; + totalProcessingDelay?: number; /** - * @generated from field: double estimated_playout_timestamp = 30; + * @generated from field: required double estimated_playout_timestamp = 30; */ - estimatedPlayoutTimestamp = 0; + estimatedPlayoutTimestamp?: number; /** - * @generated from field: double jitter_buffer_delay = 31; + * @generated from field: required double jitter_buffer_delay = 31; */ - jitterBufferDelay = 0; + jitterBufferDelay?: number; /** - * @generated from field: double jitter_buffer_target_delay = 32; + * @generated from field: required double jitter_buffer_target_delay = 32; */ - jitterBufferTargetDelay = 0; + jitterBufferTargetDelay?: number; /** - * @generated from field: uint64 jitter_buffer_emitted_count = 33; + * @generated from field: required uint64 jitter_buffer_emitted_count = 33; */ - jitterBufferEmittedCount = protoInt64.zero; + jitterBufferEmittedCount?: bigint; /** - * @generated from field: double jitter_buffer_minimum_delay = 34; + * @generated from field: required double jitter_buffer_minimum_delay = 34; */ - jitterBufferMinimumDelay = 0; + jitterBufferMinimumDelay?: number; /** - * @generated from field: uint64 total_samples_received = 35; + * @generated from field: required uint64 total_samples_received = 35; */ - totalSamplesReceived = protoInt64.zero; + totalSamplesReceived?: bigint; /** - * @generated from field: uint64 concealed_samples = 36; + * @generated from field: required uint64 concealed_samples = 36; */ - concealedSamples = protoInt64.zero; + concealedSamples?: bigint; /** - * @generated from field: uint64 silent_concealed_samples = 37; + * @generated from field: required uint64 silent_concealed_samples = 37; */ - silentConcealedSamples = protoInt64.zero; + silentConcealedSamples?: bigint; /** - * @generated from field: uint64 concealment_events = 38; + * @generated from field: required uint64 concealment_events = 38; */ - concealmentEvents = protoInt64.zero; + concealmentEvents?: bigint; /** - * @generated from field: uint64 inserted_samples_for_deceleration = 39; + * @generated from field: required uint64 inserted_samples_for_deceleration = 39; */ - insertedSamplesForDeceleration = protoInt64.zero; + insertedSamplesForDeceleration?: bigint; /** - * @generated from field: uint64 removed_samples_for_acceleration = 40; + * @generated from field: required uint64 removed_samples_for_acceleration = 40; */ - removedSamplesForAcceleration = protoInt64.zero; + removedSamplesForAcceleration?: bigint; /** - * @generated from field: double audio_level = 41; + * @generated from field: required double audio_level = 41; */ - audioLevel = 0; + audioLevel?: number; /** - * @generated from field: double total_audio_energy = 42; + * @generated from field: required double total_audio_energy = 42; */ - totalAudioEnergy = 0; + totalAudioEnergy?: number; /** - * @generated from field: double total_samples_duration = 43; + * @generated from field: required double total_samples_duration = 43; */ - totalSamplesDuration = 0; + totalSamplesDuration?: number; /** - * @generated from field: uint64 frames_received = 44; + * @generated from field: required uint64 frames_received = 44; */ - framesReceived = protoInt64.zero; + framesReceived?: bigint; /** - * @generated from field: string decoder_implementation = 45; + * @generated from field: required string decoder_implementation = 45; */ - decoderImplementation = ""; + decoderImplementation?: string; /** - * @generated from field: string playout_id = 46; + * @generated from field: required string playout_id = 46; */ - playoutId = ""; + playoutId?: string; /** - * @generated from field: bool power_efficient_decoder = 47; + * @generated from field: required bool power_efficient_decoder = 47; */ - powerEfficientDecoder = false; + powerEfficientDecoder?: boolean; /** - * @generated from field: uint64 frames_assembled_from_multiple_packets = 48; + * @generated from field: required uint64 frames_assembled_from_multiple_packets = 48; */ - framesAssembledFromMultiplePackets = protoInt64.zero; + framesAssembledFromMultiplePackets?: bigint; /** - * @generated from field: double total_assembly_time = 49; + * @generated from field: required double total_assembly_time = 49; */ - totalAssemblyTime = 0; + totalAssemblyTime?: number; /** - * @generated from field: uint64 retransmitted_packets_received = 50; + * @generated from field: required uint64 retransmitted_packets_received = 50; */ - retransmittedPacketsReceived = protoInt64.zero; + retransmittedPacketsReceived?: bigint; /** - * @generated from field: uint64 retransmitted_bytes_received = 51; + * @generated from field: required uint64 retransmitted_bytes_received = 51; */ - retransmittedBytesReceived = protoInt64.zero; + retransmittedBytesReceived?: bigint; /** - * @generated from field: uint32 rtx_ssrc = 52; + * @generated from field: required uint32 rtx_ssrc = 52; */ - rtxSsrc = 0; + rtxSsrc?: number; /** - * @generated from field: uint32 fec_ssrc = 53; + * @generated from field: required uint32 fec_ssrc = 53; */ - fecSsrc = 0; + fecSsrc?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.InboundRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 5, name: "key_frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 6, name: "frames_rendered", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 7, name: "frames_dropped", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 8, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 9, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 10, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 11, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 12, name: "total_decode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 13, name: "total_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 14, name: "total_squared_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 15, name: "pause_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 16, name: "total_pause_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 17, name: "freeze_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 18, name: "total_freeze_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 19, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 20, name: "header_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 21, name: "packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 22, name: "fec_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 23, name: "fec_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 24, name: "fec_packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 25, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 26, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 27, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 28, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 29, name: "total_processing_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 30, name: "estimated_playout_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 31, name: "jitter_buffer_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 32, name: "jitter_buffer_target_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 33, name: "jitter_buffer_emitted_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 34, name: "jitter_buffer_minimum_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 35, name: "total_samples_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 36, name: "concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 37, name: "silent_concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 38, name: "concealment_events", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 39, name: "inserted_samples_for_deceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 40, name: "removed_samples_for_acceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 41, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 42, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 43, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 44, name: "frames_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 45, name: "decoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 46, name: "playout_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 47, name: "power_efficient_decoder", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 48, name: "frames_assembled_from_multiple_packets", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 49, name: "total_assembly_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 50, name: "retransmitted_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 51, name: "retransmitted_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 52, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 53, name: "fec_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 4, name: "frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 5, name: "key_frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 6, name: "frames_rendered", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 7, name: "frames_dropped", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 8, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 9, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 10, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 11, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 12, name: "total_decode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 13, name: "total_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 14, name: "total_squared_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 15, name: "pause_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 16, name: "total_pause_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 17, name: "freeze_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 18, name: "total_freeze_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 19, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 20, name: "header_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 21, name: "packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 22, name: "fec_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 23, name: "fec_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 24, name: "fec_packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 25, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 26, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 27, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 28, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 29, name: "total_processing_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 30, name: "estimated_playout_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 31, name: "jitter_buffer_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 32, name: "jitter_buffer_target_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 33, name: "jitter_buffer_emitted_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 34, name: "jitter_buffer_minimum_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 35, name: "total_samples_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 36, name: "concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 37, name: "silent_concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 38, name: "concealment_events", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 39, name: "inserted_samples_for_deceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 40, name: "removed_samples_for_acceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 41, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 42, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 43, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 44, name: "frames_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 45, name: "decoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 46, name: "playout_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 47, name: "power_efficient_decoder", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 48, name: "frames_assembled_from_multiple_packets", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 49, name: "total_assembly_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 50, name: "retransmitted_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 51, name: "retransmitted_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 52, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 53, name: "fec_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): InboundRtpStreamStats { @@ -1741,7 +1741,7 @@ export class InboundRtpStreamStats extends Message { } static equals(a: InboundRtpStreamStats | PlainMessage | undefined, b: InboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(InboundRtpStreamStats, a, b); + return proto2.util.equals(InboundRtpStreamStats, a, b); } } @@ -1750,25 +1750,25 @@ export class InboundRtpStreamStats extends Message { */ export class SentRtpStreamStats extends Message { /** - * @generated from field: uint64 packets_sent = 1; + * @generated from field: required uint64 packets_sent = 1; */ - packetsSent = protoInt64.zero; + packetsSent?: bigint; /** - * @generated from field: uint64 bytes_sent = 2; + * @generated from field: required uint64 bytes_sent = 2; */ - bytesSent = protoInt64.zero; + bytesSent?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.SentRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SentRtpStreamStats { @@ -1784,7 +1784,7 @@ export class SentRtpStreamStats extends Message { } static equals(a: SentRtpStreamStats | PlainMessage | undefined, b: SentRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(SentRtpStreamStats, a, b); + return proto2.util.equals(SentRtpStreamStats, a, b); } } @@ -1793,109 +1793,109 @@ export class SentRtpStreamStats extends Message { */ export class OutboundRtpStreamStats extends Message { /** - * @generated from field: string mid = 1; + * @generated from field: required string mid = 1; */ - mid = ""; + mid?: string; /** - * @generated from field: string media_source_id = 2; + * @generated from field: required string media_source_id = 2; */ - mediaSourceId = ""; + mediaSourceId?: string; /** - * @generated from field: string remote_id = 3; + * @generated from field: required string remote_id = 3; */ - remoteId = ""; + remoteId?: string; /** - * @generated from field: string rid = 4; + * @generated from field: required string rid = 4; */ - rid = ""; + rid?: string; /** - * @generated from field: uint64 header_bytes_sent = 5; + * @generated from field: required uint64 header_bytes_sent = 5; */ - headerBytesSent = protoInt64.zero; + headerBytesSent?: bigint; /** - * @generated from field: uint64 retransmitted_packets_sent = 6; + * @generated from field: required uint64 retransmitted_packets_sent = 6; */ - retransmittedPacketsSent = protoInt64.zero; + retransmittedPacketsSent?: bigint; /** - * @generated from field: uint64 retransmitted_bytes_sent = 7; + * @generated from field: required uint64 retransmitted_bytes_sent = 7; */ - retransmittedBytesSent = protoInt64.zero; + retransmittedBytesSent?: bigint; /** - * @generated from field: uint32 rtx_ssrc = 8; + * @generated from field: required uint32 rtx_ssrc = 8; */ - rtxSsrc = 0; + rtxSsrc?: number; /** - * @generated from field: double target_bitrate = 9; + * @generated from field: required double target_bitrate = 9; */ - targetBitrate = 0; + targetBitrate?: number; /** - * @generated from field: uint64 total_encoded_bytes_target = 10; + * @generated from field: required uint64 total_encoded_bytes_target = 10; */ - totalEncodedBytesTarget = protoInt64.zero; + totalEncodedBytesTarget?: bigint; /** - * @generated from field: uint32 frame_width = 11; + * @generated from field: required uint32 frame_width = 11; */ - frameWidth = 0; + frameWidth?: number; /** - * @generated from field: uint32 frame_height = 12; + * @generated from field: required uint32 frame_height = 12; */ - frameHeight = 0; + frameHeight?: number; /** - * @generated from field: double frames_per_second = 13; + * @generated from field: required double frames_per_second = 13; */ - framesPerSecond = 0; + framesPerSecond?: number; /** - * @generated from field: uint32 frames_sent = 14; + * @generated from field: required uint32 frames_sent = 14; */ - framesSent = 0; + framesSent?: number; /** - * @generated from field: uint32 huge_frames_sent = 15; + * @generated from field: required uint32 huge_frames_sent = 15; */ - hugeFramesSent = 0; + hugeFramesSent?: number; /** - * @generated from field: uint32 frames_encoded = 16; + * @generated from field: required uint32 frames_encoded = 16; */ - framesEncoded = 0; + framesEncoded?: number; /** - * @generated from field: uint32 key_frames_encoded = 17; + * @generated from field: required uint32 key_frames_encoded = 17; */ - keyFramesEncoded = 0; + keyFramesEncoded?: number; /** - * @generated from field: uint64 qp_sum = 18; + * @generated from field: required uint64 qp_sum = 18; */ - qpSum = protoInt64.zero; + qpSum?: bigint; /** - * @generated from field: double total_encode_time = 19; + * @generated from field: required double total_encode_time = 19; */ - totalEncodeTime = 0; + totalEncodeTime?: number; /** - * @generated from field: double total_packet_send_delay = 20; + * @generated from field: required double total_packet_send_delay = 20; */ - totalPacketSendDelay = 0; + totalPacketSendDelay?: number; /** - * @generated from field: livekit.proto.QualityLimitationReason quality_limitation_reason = 21; + * @generated from field: required livekit.proto.QualityLimitationReason quality_limitation_reason = 21; */ - qualityLimitationReason = QualityLimitationReason.LIMITATION_NONE; + qualityLimitationReason?: QualityLimitationReason; /** * @generated from field: map quality_limitation_durations = 22; @@ -1903,83 +1903,83 @@ export class OutboundRtpStreamStats extends Message { qualityLimitationDurations: { [key: string]: number } = {}; /** - * @generated from field: uint32 quality_limitation_resolution_changes = 23; + * @generated from field: required uint32 quality_limitation_resolution_changes = 23; */ - qualityLimitationResolutionChanges = 0; + qualityLimitationResolutionChanges?: number; /** - * @generated from field: uint32 nack_count = 24; + * @generated from field: required uint32 nack_count = 24; */ - nackCount = 0; + nackCount?: number; /** - * @generated from field: uint32 fir_count = 25; + * @generated from field: required uint32 fir_count = 25; */ - firCount = 0; + firCount?: number; /** - * @generated from field: uint32 pli_count = 26; + * @generated from field: required uint32 pli_count = 26; */ - pliCount = 0; + pliCount?: number; /** - * @generated from field: string encoder_implementation = 27; + * @generated from field: required string encoder_implementation = 27; */ - encoderImplementation = ""; + encoderImplementation?: string; /** - * @generated from field: bool power_efficient_encoder = 28; + * @generated from field: required bool power_efficient_encoder = 28; */ - powerEfficientEncoder = false; + powerEfficientEncoder?: boolean; /** - * @generated from field: bool active = 29; + * @generated from field: required bool active = 29; */ - active = false; + active?: boolean; /** - * @generated from field: string scalibility_mode = 30; + * @generated from field: required string scalability_mode = 30; */ - scalibilityMode = ""; + scalabilityMode?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OutboundRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "media_source_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "rid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "header_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 6, name: "retransmitted_packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 7, name: "retransmitted_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 8, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 9, name: "target_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 10, name: "total_encoded_bytes_target", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 11, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 12, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 13, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 14, name: "frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 15, name: "huge_frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 16, name: "frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 17, name: "key_frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 18, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 19, name: "total_encode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 20, name: "total_packet_send_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 21, name: "quality_limitation_reason", kind: "enum", T: proto3.getEnumType(QualityLimitationReason) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "media_source_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 4, name: "rid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 5, name: "header_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 6, name: "retransmitted_packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 7, name: "retransmitted_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 8, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 9, name: "target_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 10, name: "total_encoded_bytes_target", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 11, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 12, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 13, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 14, name: "frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 15, name: "huge_frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 16, name: "frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 17, name: "key_frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 18, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 19, name: "total_encode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 20, name: "total_packet_send_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 21, name: "quality_limitation_reason", kind: "enum", T: proto2.getEnumType(QualityLimitationReason), req: true }, { no: 22, name: "quality_limitation_durations", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 1 /* ScalarType.DOUBLE */} }, - { no: 23, name: "quality_limitation_resolution_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 24, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 25, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 26, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 27, name: "encoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 28, name: "power_efficient_encoder", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 29, name: "active", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 30, name: "scalibility_mode", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 23, name: "quality_limitation_resolution_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 24, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 25, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 26, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 27, name: "encoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 28, name: "power_efficient_encoder", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 29, name: "active", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 30, name: "scalability_mode", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OutboundRtpStreamStats { @@ -1995,7 +1995,7 @@ export class OutboundRtpStreamStats extends Message { } static equals(a: OutboundRtpStreamStats | PlainMessage | undefined, b: OutboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(OutboundRtpStreamStats, a, b); + return proto2.util.equals(OutboundRtpStreamStats, a, b); } } @@ -2004,43 +2004,43 @@ export class OutboundRtpStreamStats extends Message { */ export class RemoteInboundRtpStreamStats extends Message { /** - * @generated from field: string local_id = 1; + * @generated from field: required string local_id = 1; */ - localId = ""; + localId?: string; /** - * @generated from field: double round_trip_time = 2; + * @generated from field: required double round_trip_time = 2; */ - roundTripTime = 0; + roundTripTime?: number; /** - * @generated from field: double total_round_trip_time = 3; + * @generated from field: required double total_round_trip_time = 3; */ - totalRoundTripTime = 0; + totalRoundTripTime?: number; /** - * @generated from field: double fraction_lost = 4; + * @generated from field: required double fraction_lost = 4; */ - fractionLost = 0; + fractionLost?: number; /** - * @generated from field: uint64 round_trip_time_measurements = 5; + * @generated from field: required uint64 round_trip_time_measurements = 5; */ - roundTripTimeMeasurements = protoInt64.zero; + roundTripTimeMeasurements?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RemoteInboundRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 4, name: "fraction_lost", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 5, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 3, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 4, name: "fraction_lost", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 5, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RemoteInboundRtpStreamStats { @@ -2056,7 +2056,7 @@ export class RemoteInboundRtpStreamStats extends Message | undefined, b: RemoteInboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(RemoteInboundRtpStreamStats, a, b); + return proto2.util.equals(RemoteInboundRtpStreamStats, a, b); } } @@ -2065,49 +2065,49 @@ export class RemoteInboundRtpStreamStats extends Message { /** - * @generated from field: string local_id = 1; + * @generated from field: required string local_id = 1; */ - localId = ""; + localId?: string; /** - * @generated from field: double remote_timestamp = 2; + * @generated from field: required double remote_timestamp = 2; */ - remoteTimestamp = 0; + remoteTimestamp?: number; /** - * @generated from field: uint64 reports_sent = 3; + * @generated from field: required uint64 reports_sent = 3; */ - reportsSent = protoInt64.zero; + reportsSent?: bigint; /** - * @generated from field: double round_trip_time = 4; + * @generated from field: required double round_trip_time = 4; */ - roundTripTime = 0; + roundTripTime?: number; /** - * @generated from field: double total_round_trip_time = 5; + * @generated from field: required double total_round_trip_time = 5; */ - totalRoundTripTime = 0; + totalRoundTripTime?: number; /** - * @generated from field: uint64 round_trip_time_measurements = 6; + * @generated from field: required uint64 round_trip_time_measurements = 6; */ - roundTripTimeMeasurements = protoInt64.zero; + roundTripTimeMeasurements?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.RemoteOutboundRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "remote_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "reports_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 4, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 5, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 6, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "remote_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 3, name: "reports_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 4, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 5, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 6, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RemoteOutboundRtpStreamStats { @@ -2123,7 +2123,7 @@ export class RemoteOutboundRtpStreamStats extends Message | undefined, b: RemoteOutboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(RemoteOutboundRtpStreamStats, a, b); + return proto2.util.equals(RemoteOutboundRtpStreamStats, a, b); } } @@ -2132,25 +2132,25 @@ export class RemoteOutboundRtpStreamStats extends Message { /** - * @generated from field: string track_identifier = 1; + * @generated from field: required string track_identifier = 1; */ - trackIdentifier = ""; + trackIdentifier?: string; /** - * @generated from field: string kind = 2; + * @generated from field: required string kind = 2; */ - kind = ""; + kind?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.MediaSourceStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): MediaSourceStats { @@ -2166,7 +2166,7 @@ export class MediaSourceStats extends Message { } static equals(a: MediaSourceStats | PlainMessage | undefined, b: MediaSourceStats | PlainMessage | undefined): boolean { - return proto3.util.equals(MediaSourceStats, a, b); + return proto2.util.equals(MediaSourceStats, a, b); } } @@ -2175,67 +2175,67 @@ export class MediaSourceStats extends Message { */ export class AudioSourceStats extends Message { /** - * @generated from field: double audio_level = 1; + * @generated from field: required double audio_level = 1; */ - audioLevel = 0; + audioLevel?: number; /** - * @generated from field: double total_audio_energy = 2; + * @generated from field: required double total_audio_energy = 2; */ - totalAudioEnergy = 0; + totalAudioEnergy?: number; /** - * @generated from field: double total_samples_duration = 3; + * @generated from field: required double total_samples_duration = 3; */ - totalSamplesDuration = 0; + totalSamplesDuration?: number; /** - * @generated from field: double echo_return_loss = 4; + * @generated from field: required double echo_return_loss = 4; */ - echoReturnLoss = 0; + echoReturnLoss?: number; /** - * @generated from field: double echo_return_loss_enhancement = 5; + * @generated from field: required double echo_return_loss_enhancement = 5; */ - echoReturnLossEnhancement = 0; + echoReturnLossEnhancement?: number; /** - * @generated from field: double dropped_samples_duration = 6; + * @generated from field: required double dropped_samples_duration = 6; */ - droppedSamplesDuration = 0; + droppedSamplesDuration?: number; /** - * @generated from field: uint32 dropped_samples_events = 7; + * @generated from field: required uint32 dropped_samples_events = 7; */ - droppedSamplesEvents = 0; + droppedSamplesEvents?: number; /** - * @generated from field: double total_capture_delay = 8; + * @generated from field: required double total_capture_delay = 8; */ - totalCaptureDelay = 0; + totalCaptureDelay?: number; /** - * @generated from field: uint64 total_samples_captured = 9; + * @generated from field: required uint64 total_samples_captured = 9; */ - totalSamplesCaptured = protoInt64.zero; + totalSamplesCaptured?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioSourceStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 2, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 4, name: "echo_return_loss", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 5, name: "echo_return_loss_enhancement", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 6, name: "dropped_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 7, name: "dropped_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 8, name: "total_capture_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 9, name: "total_samples_captured", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 2, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 3, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 4, name: "echo_return_loss", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 5, name: "echo_return_loss_enhancement", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 6, name: "dropped_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 7, name: "dropped_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 8, name: "total_capture_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 9, name: "total_samples_captured", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioSourceStats { @@ -2251,7 +2251,7 @@ export class AudioSourceStats extends Message { } static equals(a: AudioSourceStats | PlainMessage | undefined, b: AudioSourceStats | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioSourceStats, a, b); + return proto2.util.equals(AudioSourceStats, a, b); } } @@ -2260,37 +2260,37 @@ export class AudioSourceStats extends Message { */ export class VideoSourceStats extends Message { /** - * @generated from field: uint32 width = 1; + * @generated from field: required uint32 width = 1; */ - width = 0; + width?: number; /** - * @generated from field: uint32 height = 2; + * @generated from field: required uint32 height = 2; */ - height = 0; + height?: number; /** - * @generated from field: uint32 frames = 3; + * @generated from field: required uint32 frames = 3; */ - frames = 0; + frames?: number; /** - * @generated from field: double frames_per_second = 4; + * @generated from field: required double frames_per_second = 4; */ - framesPerSecond = 0; + framesPerSecond?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoSourceStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "frames", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 3, name: "frames", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 4, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoSourceStats { @@ -2306,7 +2306,7 @@ export class VideoSourceStats extends Message { } static equals(a: VideoSourceStats | PlainMessage | undefined, b: VideoSourceStats | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoSourceStats, a, b); + return proto2.util.equals(VideoSourceStats, a, b); } } @@ -2315,49 +2315,49 @@ export class VideoSourceStats extends Message { */ export class AudioPlayoutStats extends Message { /** - * @generated from field: string kind = 1; + * @generated from field: required string kind = 1; */ - kind = ""; + kind?: string; /** - * @generated from field: double synthesized_samples_duration = 2; + * @generated from field: required double synthesized_samples_duration = 2; */ - synthesizedSamplesDuration = 0; + synthesizedSamplesDuration?: number; /** - * @generated from field: uint32 synthesized_samples_events = 3; + * @generated from field: required uint32 synthesized_samples_events = 3; */ - synthesizedSamplesEvents = 0; + synthesizedSamplesEvents?: number; /** - * @generated from field: double total_samples_duration = 4; + * @generated from field: required double total_samples_duration = 4; */ - totalSamplesDuration = 0; + totalSamplesDuration?: number; /** - * @generated from field: double total_playout_delay = 5; + * @generated from field: required double total_playout_delay = 5; */ - totalPlayoutDelay = 0; + totalPlayoutDelay?: number; /** - * @generated from field: uint64 total_samples_count = 6; + * @generated from field: required uint64 total_samples_count = 6; */ - totalSamplesCount = protoInt64.zero; + totalSamplesCount?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.AudioPlayoutStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "synthesized_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "synthesized_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 5, name: "total_playout_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 6, name: "total_samples_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "synthesized_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 3, name: "synthesized_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 4, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 5, name: "total_playout_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 6, name: "total_samples_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioPlayoutStats { @@ -2373,7 +2373,7 @@ export class AudioPlayoutStats extends Message { } static equals(a: AudioPlayoutStats | PlainMessage | undefined, b: AudioPlayoutStats | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioPlayoutStats, a, b); + return proto2.util.equals(AudioPlayoutStats, a, b); } } @@ -2382,25 +2382,25 @@ export class AudioPlayoutStats extends Message { */ export class PeerConnectionStats extends Message { /** - * @generated from field: uint32 data_channels_opened = 1; + * @generated from field: required uint32 data_channels_opened = 1; */ - dataChannelsOpened = 0; + dataChannelsOpened?: number; /** - * @generated from field: uint32 data_channels_closed = 2; + * @generated from field: required uint32 data_channels_closed = 2; */ - dataChannelsClosed = 0; + dataChannelsClosed?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.PeerConnectionStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data_channels_opened", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "data_channels_closed", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "data_channels_opened", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 2, name: "data_channels_closed", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PeerConnectionStats { @@ -2416,7 +2416,7 @@ export class PeerConnectionStats extends Message { } static equals(a: PeerConnectionStats | PlainMessage | undefined, b: PeerConnectionStats | PlainMessage | undefined): boolean { - return proto3.util.equals(PeerConnectionStats, a, b); + return proto2.util.equals(PeerConnectionStats, a, b); } } @@ -2425,19 +2425,19 @@ export class PeerConnectionStats extends Message { */ export class DataChannelStats extends Message { /** - * @generated from field: string label = 1; + * @generated from field: required string label = 1; */ - label = ""; + label?: string; /** - * @generated from field: string protocol = 2; + * @generated from field: required string protocol = 2; */ - protocol = ""; + protocol?: string; /** - * @generated from field: int32 data_channel_identifier = 3; + * @generated from field: required int32 data_channel_identifier = 3; */ - dataChannelIdentifier = 0; + dataChannelIdentifier?: number; /** * @generated from field: optional livekit.proto.DataChannelState state = 4; @@ -2445,41 +2445,41 @@ export class DataChannelStats extends Message { state?: DataChannelState; /** - * @generated from field: uint32 messages_sent = 5; + * @generated from field: required uint32 messages_sent = 5; */ - messagesSent = 0; + messagesSent?: number; /** - * @generated from field: uint64 bytes_sent = 6; + * @generated from field: required uint64 bytes_sent = 6; */ - bytesSent = protoInt64.zero; + bytesSent?: bigint; /** - * @generated from field: uint32 messages_received = 7; + * @generated from field: required uint32 messages_received = 7; */ - messagesReceived = 0; + messagesReceived?: number; /** - * @generated from field: uint64 bytes_received = 8; + * @generated from field: required uint64 bytes_received = 8; */ - bytesReceived = protoInt64.zero; + bytesReceived?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.DataChannelStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "label", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "data_channel_identifier", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 4, name: "state", kind: "enum", T: proto3.getEnumType(DataChannelState), opt: true }, - { no: 5, name: "messages_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 6, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 7, name: "messages_received", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 8, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "label", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "data_channel_identifier", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + { no: 4, name: "state", kind: "enum", T: proto2.getEnumType(DataChannelState), opt: true }, + { no: 5, name: "messages_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 6, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 7, name: "messages_received", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 8, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DataChannelStats { @@ -2495,7 +2495,7 @@ export class DataChannelStats extends Message { } static equals(a: DataChannelStats | PlainMessage | undefined, b: DataChannelStats | PlainMessage | undefined): boolean { - return proto3.util.equals(DataChannelStats, a, b); + return proto2.util.equals(DataChannelStats, a, b); } } @@ -2504,34 +2504,34 @@ export class DataChannelStats extends Message { */ export class TransportStats extends Message { /** - * @generated from field: uint64 packets_sent = 1; + * @generated from field: required uint64 packets_sent = 1; */ - packetsSent = protoInt64.zero; + packetsSent?: bigint; /** - * @generated from field: uint64 packets_received = 2; + * @generated from field: required uint64 packets_received = 2; */ - packetsReceived = protoInt64.zero; + packetsReceived?: bigint; /** - * @generated from field: uint64 bytes_sent = 3; + * @generated from field: required uint64 bytes_sent = 3; */ - bytesSent = protoInt64.zero; + bytesSent?: bigint; /** - * @generated from field: uint64 bytes_received = 4; + * @generated from field: required uint64 bytes_received = 4; */ - bytesReceived = protoInt64.zero; + bytesReceived?: bigint; /** - * @generated from field: livekit.proto.IceRole ice_role = 5; + * @generated from field: required livekit.proto.IceRole ice_role = 5; */ - iceRole = IceRole.ICE_UNKNOWN; + iceRole?: IceRole; /** - * @generated from field: string ice_local_username_fragment = 6; + * @generated from field: required string ice_local_username_fragment = 6; */ - iceLocalUsernameFragment = ""; + iceLocalUsernameFragment?: string; /** * @generated from field: optional livekit.proto.DtlsTransportState dtls_state = 7; @@ -2544,69 +2544,69 @@ export class TransportStats extends Message { iceState?: IceTransportState; /** - * @generated from field: string selected_candidate_pair_id = 9; + * @generated from field: required string selected_candidate_pair_id = 9; */ - selectedCandidatePairId = ""; + selectedCandidatePairId?: string; /** - * @generated from field: string local_certificate_id = 10; + * @generated from field: required string local_certificate_id = 10; */ - localCertificateId = ""; + localCertificateId?: string; /** - * @generated from field: string remote_certificate_id = 11; + * @generated from field: required string remote_certificate_id = 11; */ - remoteCertificateId = ""; + remoteCertificateId?: string; /** - * @generated from field: string tls_version = 12; + * @generated from field: required string tls_version = 12; */ - tlsVersion = ""; + tlsVersion?: string; /** - * @generated from field: string dtls_cipher = 13; + * @generated from field: required string dtls_cipher = 13; */ - dtlsCipher = ""; + dtlsCipher?: string; /** - * @generated from field: livekit.proto.DtlsRole dtls_role = 14; + * @generated from field: required livekit.proto.DtlsRole dtls_role = 14; */ - dtlsRole = DtlsRole.DTLS_CLIENT; + dtlsRole?: DtlsRole; /** - * @generated from field: string srtp_cipher = 15; + * @generated from field: required string srtp_cipher = 15; */ - srtpCipher = ""; + srtpCipher?: string; /** - * @generated from field: uint32 selected_candidate_pair_changes = 16; + * @generated from field: required uint32 selected_candidate_pair_changes = 16; */ - selectedCandidatePairChanges = 0; + selectedCandidatePairChanges?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TransportStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 3, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 4, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 5, name: "ice_role", kind: "enum", T: proto3.getEnumType(IceRole) }, - { no: 6, name: "ice_local_username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "dtls_state", kind: "enum", T: proto3.getEnumType(DtlsTransportState), opt: true }, - { no: 8, name: "ice_state", kind: "enum", T: proto3.getEnumType(IceTransportState), opt: true }, - { no: 9, name: "selected_candidate_pair_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 10, name: "local_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 11, name: "remote_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 12, name: "tls_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 13, name: "dtls_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 14, name: "dtls_role", kind: "enum", T: proto3.getEnumType(DtlsRole) }, - { no: 15, name: "srtp_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 16, name: "selected_candidate_pair_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 3, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 4, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 5, name: "ice_role", kind: "enum", T: proto2.getEnumType(IceRole), req: true }, + { no: 6, name: "ice_local_username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 7, name: "dtls_state", kind: "enum", T: proto2.getEnumType(DtlsTransportState), opt: true }, + { no: 8, name: "ice_state", kind: "enum", T: proto2.getEnumType(IceTransportState), opt: true }, + { no: 9, name: "selected_candidate_pair_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 10, name: "local_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 11, name: "remote_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 12, name: "tls_version", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 13, name: "dtls_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 14, name: "dtls_role", kind: "enum", T: proto2.getEnumType(DtlsRole), req: true }, + { no: 15, name: "srtp_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 16, name: "selected_candidate_pair_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TransportStats { @@ -2622,7 +2622,7 @@ export class TransportStats extends Message { } static equals(a: TransportStats | PlainMessage | undefined, b: TransportStats | PlainMessage | undefined): boolean { - return proto3.util.equals(TransportStats, a, b); + return proto2.util.equals(TransportStats, a, b); } } @@ -2631,19 +2631,19 @@ export class TransportStats extends Message { */ export class CandidatePairStats extends Message { /** - * @generated from field: string transport_id = 1; + * @generated from field: required string transport_id = 1; */ - transportId = ""; + transportId?: string; /** - * @generated from field: string local_candidate_id = 2; + * @generated from field: required string local_candidate_id = 2; */ - localCandidateId = ""; + localCandidateId?: string; /** - * @generated from field: string remote_candidate_id = 3; + * @generated from field: required string remote_candidate_id = 3; */ - remoteCandidateId = ""; + remoteCandidateId?: string; /** * @generated from field: optional livekit.proto.IceCandidatePairState state = 4; @@ -2651,125 +2651,125 @@ export class CandidatePairStats extends Message { state?: IceCandidatePairState; /** - * @generated from field: bool nominated = 5; + * @generated from field: required bool nominated = 5; */ - nominated = false; + nominated?: boolean; /** - * @generated from field: uint64 packets_sent = 6; + * @generated from field: required uint64 packets_sent = 6; */ - packetsSent = protoInt64.zero; + packetsSent?: bigint; /** - * @generated from field: uint64 packets_received = 7; + * @generated from field: required uint64 packets_received = 7; */ - packetsReceived = protoInt64.zero; + packetsReceived?: bigint; /** - * @generated from field: uint64 bytes_sent = 8; + * @generated from field: required uint64 bytes_sent = 8; */ - bytesSent = protoInt64.zero; + bytesSent?: bigint; /** - * @generated from field: uint64 bytes_received = 9; + * @generated from field: required uint64 bytes_received = 9; */ - bytesReceived = protoInt64.zero; + bytesReceived?: bigint; /** - * @generated from field: double last_packet_sent_timestamp = 10; + * @generated from field: required double last_packet_sent_timestamp = 10; */ - lastPacketSentTimestamp = 0; + lastPacketSentTimestamp?: number; /** - * @generated from field: double last_packet_received_timestamp = 11; + * @generated from field: required double last_packet_received_timestamp = 11; */ - lastPacketReceivedTimestamp = 0; + lastPacketReceivedTimestamp?: number; /** - * @generated from field: double total_round_trip_time = 12; + * @generated from field: required double total_round_trip_time = 12; */ - totalRoundTripTime = 0; + totalRoundTripTime?: number; /** - * @generated from field: double current_round_trip_time = 13; + * @generated from field: required double current_round_trip_time = 13; */ - currentRoundTripTime = 0; + currentRoundTripTime?: number; /** - * @generated from field: double available_outgoing_bitrate = 14; + * @generated from field: required double available_outgoing_bitrate = 14; */ - availableOutgoingBitrate = 0; + availableOutgoingBitrate?: number; /** - * @generated from field: double available_incoming_bitrate = 15; + * @generated from field: required double available_incoming_bitrate = 15; */ - availableIncomingBitrate = 0; + availableIncomingBitrate?: number; /** - * @generated from field: uint64 requests_received = 16; + * @generated from field: required uint64 requests_received = 16; */ - requestsReceived = protoInt64.zero; + requestsReceived?: bigint; /** - * @generated from field: uint64 requests_sent = 17; + * @generated from field: required uint64 requests_sent = 17; */ - requestsSent = protoInt64.zero; + requestsSent?: bigint; /** - * @generated from field: uint64 responses_received = 18; + * @generated from field: required uint64 responses_received = 18; */ - responsesReceived = protoInt64.zero; + responsesReceived?: bigint; /** - * @generated from field: uint64 responses_sent = 19; + * @generated from field: required uint64 responses_sent = 19; */ - responsesSent = protoInt64.zero; + responsesSent?: bigint; /** - * @generated from field: uint64 consent_requests_sent = 20; + * @generated from field: required uint64 consent_requests_sent = 20; */ - consentRequestsSent = protoInt64.zero; + consentRequestsSent?: bigint; /** - * @generated from field: uint32 packets_discarded_on_send = 21; + * @generated from field: required uint32 packets_discarded_on_send = 21; */ - packetsDiscardedOnSend = 0; + packetsDiscardedOnSend?: number; /** - * @generated from field: uint64 bytes_discarded_on_send = 22; + * @generated from field: required uint64 bytes_discarded_on_send = 22; */ - bytesDiscardedOnSend = protoInt64.zero; + bytesDiscardedOnSend?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CandidatePairStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "local_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "remote_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "state", kind: "enum", T: proto3.getEnumType(IceCandidatePairState), opt: true }, - { no: 5, name: "nominated", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 7, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 8, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 9, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 10, name: "last_packet_sent_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 11, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 12, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 13, name: "current_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 14, name: "available_outgoing_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 15, name: "available_incoming_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 16, name: "requests_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 17, name: "requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 18, name: "responses_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 19, name: "responses_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 20, name: "consent_requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 21, name: "packets_discarded_on_send", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 22, name: "bytes_discarded_on_send", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "local_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "remote_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 4, name: "state", kind: "enum", T: proto2.getEnumType(IceCandidatePairState), opt: true }, + { no: 5, name: "nominated", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 6, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 7, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 8, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 9, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 10, name: "last_packet_sent_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 11, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 12, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 13, name: "current_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 14, name: "available_outgoing_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 15, name: "available_incoming_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + { no: 16, name: "requests_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 17, name: "requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 18, name: "responses_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 19, name: "responses_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 20, name: "consent_requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 21, name: "packets_discarded_on_send", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 22, name: "bytes_discarded_on_send", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CandidatePairStats { @@ -2785,7 +2785,7 @@ export class CandidatePairStats extends Message { } static equals(a: CandidatePairStats | PlainMessage | undefined, b: CandidatePairStats | PlainMessage | undefined): boolean { - return proto3.util.equals(CandidatePairStats, a, b); + return proto2.util.equals(CandidatePairStats, a, b); } } @@ -2794,24 +2794,24 @@ export class CandidatePairStats extends Message { */ export class IceCandidateStats extends Message { /** - * @generated from field: string transport_id = 1; + * @generated from field: required string transport_id = 1; */ - transportId = ""; + transportId?: string; /** - * @generated from field: string address = 2; + * @generated from field: required string address = 2; */ - address = ""; + address?: string; /** - * @generated from field: int32 port = 3; + * @generated from field: required int32 port = 3; */ - port = 0; + port?: number; /** - * @generated from field: string protocol = 4; + * @generated from field: required string protocol = 4; */ - protocol = ""; + protocol?: string; /** * @generated from field: optional livekit.proto.IceCandidateType candidate_type = 5; @@ -2819,14 +2819,14 @@ export class IceCandidateStats extends Message { candidateType?: IceCandidateType; /** - * @generated from field: int32 priority = 6; + * @generated from field: required int32 priority = 6; */ - priority = 0; + priority?: number; /** - * @generated from field: string url = 7; + * @generated from field: required string url = 7; */ - url = ""; + url?: string; /** * @generated from field: optional livekit.proto.IceServerTransportProtocol relay_protocol = 8; @@ -2834,24 +2834,24 @@ export class IceCandidateStats extends Message { relayProtocol?: IceServerTransportProtocol; /** - * @generated from field: string foundation = 9; + * @generated from field: required string foundation = 9; */ - foundation = ""; + foundation?: string; /** - * @generated from field: string related_address = 10; + * @generated from field: required string related_address = 10; */ - relatedAddress = ""; + relatedAddress?: string; /** - * @generated from field: int32 related_port = 11; + * @generated from field: required int32 related_port = 11; */ - relatedPort = 0; + relatedPort?: number; /** - * @generated from field: string username_fragment = 12; + * @generated from field: required string username_fragment = 12; */ - usernameFragment = ""; + usernameFragment?: string; /** * @generated from field: optional livekit.proto.IceTcpCandidateType tcp_type = 13; @@ -2860,25 +2860,25 @@ export class IceCandidateStats extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.IceCandidateStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "port", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 4, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "candidate_type", kind: "enum", T: proto3.getEnumType(IceCandidateType), opt: true }, - { no: 6, name: "priority", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 7, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 8, name: "relay_protocol", kind: "enum", T: proto3.getEnumType(IceServerTransportProtocol), opt: true }, - { no: 9, name: "foundation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 10, name: "related_address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 11, name: "related_port", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 12, name: "username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 13, name: "tcp_type", kind: "enum", T: proto3.getEnumType(IceTcpCandidateType), opt: true }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "port", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + { no: 4, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 5, name: "candidate_type", kind: "enum", T: proto2.getEnumType(IceCandidateType), opt: true }, + { no: 6, name: "priority", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + { no: 7, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 8, name: "relay_protocol", kind: "enum", T: proto2.getEnumType(IceServerTransportProtocol), opt: true }, + { no: 9, name: "foundation", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 10, name: "related_address", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 11, name: "related_port", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + { no: 12, name: "username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 13, name: "tcp_type", kind: "enum", T: proto2.getEnumType(IceTcpCandidateType), opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): IceCandidateStats { @@ -2894,7 +2894,7 @@ export class IceCandidateStats extends Message { } static equals(a: IceCandidateStats | PlainMessage | undefined, b: IceCandidateStats | PlainMessage | undefined): boolean { - return proto3.util.equals(IceCandidateStats, a, b); + return proto2.util.equals(IceCandidateStats, a, b); } } @@ -2903,37 +2903,37 @@ export class IceCandidateStats extends Message { */ export class CertificateStats extends Message { /** - * @generated from field: string fingerprint = 1; + * @generated from field: required string fingerprint = 1; */ - fingerprint = ""; + fingerprint?: string; /** - * @generated from field: string fingerprint_algorithm = 2; + * @generated from field: required string fingerprint_algorithm = 2; */ - fingerprintAlgorithm = ""; + fingerprintAlgorithm?: string; /** - * @generated from field: string base64_certificate = 3; + * @generated from field: required string base64_certificate = 3; */ - base64Certificate = ""; + base64Certificate?: string; /** - * @generated from field: string issuer_certificate_id = 4; + * @generated from field: required string issuer_certificate_id = 4; */ - issuerCertificateId = ""; + issuerCertificateId?: string; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CertificateStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "fingerprint", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "fingerprint_algorithm", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "base64_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "issuer_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "fingerprint", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "fingerprint_algorithm", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "base64_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 4, name: "issuer_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CertificateStats { @@ -2949,7 +2949,7 @@ export class CertificateStats extends Message { } static equals(a: CertificateStats | PlainMessage | undefined, b: CertificateStats | PlainMessage | undefined): boolean { - return proto3.util.equals(CertificateStats, a, b); + return proto2.util.equals(CertificateStats, a, b); } } diff --git a/packages/livekit-rtc/src/proto/track_pb.ts b/packages/livekit-rtc/src/proto/track_pb.ts index c7a87d65..a331190b 100644 --- a/packages/livekit-rtc/src/proto/track_pb.ts +++ b/packages/livekit-rtc/src/proto/track_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file track.proto (package livekit.proto, syntax proto3) +// @generated from file track.proto (package livekit.proto, syntax proto2) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { Message, proto2 } from "@bufbuild/protobuf"; import { RtcStats } from "./stats_pb.js"; import { EncryptionType } from "./e2ee_pb.js"; import { FfiOwnedHandle } from "./handle_pb.js"; @@ -42,8 +42,8 @@ export enum TrackKind { */ KIND_VIDEO = 2, } -// Retrieve enum metadata with: proto3.getEnumType(TrackKind) -proto3.util.setEnumType(TrackKind, "livekit.proto.TrackKind", [ +// Retrieve enum metadata with: proto2.getEnumType(TrackKind) +proto2.util.setEnumType(TrackKind, "livekit.proto.TrackKind", [ { no: 0, name: "KIND_UNKNOWN" }, { no: 1, name: "KIND_AUDIO" }, { no: 2, name: "KIND_VIDEO" }, @@ -78,8 +78,8 @@ export enum TrackSource { */ SOURCE_SCREENSHARE_AUDIO = 4, } -// Retrieve enum metadata with: proto3.getEnumType(TrackSource) -proto3.util.setEnumType(TrackSource, "livekit.proto.TrackSource", [ +// Retrieve enum metadata with: proto2.getEnumType(TrackSource) +proto2.util.setEnumType(TrackSource, "livekit.proto.TrackSource", [ { no: 0, name: "SOURCE_UNKNOWN" }, { no: 1, name: "SOURCE_CAMERA" }, { no: 2, name: "SOURCE_MICROPHONE" }, @@ -106,8 +106,8 @@ export enum StreamState { */ STATE_PAUSED = 2, } -// Retrieve enum metadata with: proto3.getEnumType(StreamState) -proto3.util.setEnumType(StreamState, "livekit.proto.StreamState", [ +// Retrieve enum metadata with: proto2.getEnumType(StreamState) +proto2.util.setEnumType(StreamState, "livekit.proto.StreamState", [ { no: 0, name: "STATE_UNKNOWN" }, { no: 1, name: "STATE_ACTIVE" }, { no: 2, name: "STATE_PAUSED" }, @@ -120,25 +120,25 @@ proto3.util.setEnumType(StreamState, "livekit.proto.StreamState", [ */ export class CreateVideoTrackRequest extends Message { /** - * @generated from field: string name = 1; + * @generated from field: required string name = 1; */ - name = ""; + name?: string; /** - * @generated from field: uint64 source_handle = 2; + * @generated from field: required uint64 source_handle = 2; */ - sourceHandle = protoInt64.zero; + sourceHandle?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CreateVideoTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateVideoTrackRequest { @@ -154,7 +154,7 @@ export class CreateVideoTrackRequest extends Message { } static equals(a: CreateVideoTrackRequest | PlainMessage | undefined, b: CreateVideoTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateVideoTrackRequest, a, b); + return proto2.util.equals(CreateVideoTrackRequest, a, b); } } @@ -163,19 +163,19 @@ export class CreateVideoTrackRequest extends Message { */ export class CreateVideoTrackResponse extends Message { /** - * @generated from field: livekit.proto.OwnedTrack track = 1; + * @generated from field: required livekit.proto.OwnedTrack track = 1; */ track?: OwnedTrack; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CreateVideoTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track", kind: "message", T: OwnedTrack }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track", kind: "message", T: OwnedTrack, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateVideoTrackResponse { @@ -191,7 +191,7 @@ export class CreateVideoTrackResponse extends Message } static equals(a: CreateVideoTrackResponse | PlainMessage | undefined, b: CreateVideoTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateVideoTrackResponse, a, b); + return proto2.util.equals(CreateVideoTrackResponse, a, b); } } @@ -202,25 +202,25 @@ export class CreateVideoTrackResponse extends Message */ export class CreateAudioTrackRequest extends Message { /** - * @generated from field: string name = 1; + * @generated from field: required string name = 1; */ - name = ""; + name?: string; /** - * @generated from field: uint64 source_handle = 2; + * @generated from field: required uint64 source_handle = 2; */ - sourceHandle = protoInt64.zero; + sourceHandle?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CreateAudioTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateAudioTrackRequest { @@ -236,7 +236,7 @@ export class CreateAudioTrackRequest extends Message { } static equals(a: CreateAudioTrackRequest | PlainMessage | undefined, b: CreateAudioTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateAudioTrackRequest, a, b); + return proto2.util.equals(CreateAudioTrackRequest, a, b); } } @@ -245,19 +245,19 @@ export class CreateAudioTrackRequest extends Message { */ export class CreateAudioTrackResponse extends Message { /** - * @generated from field: livekit.proto.OwnedTrack track = 1; + * @generated from field: required livekit.proto.OwnedTrack track = 1; */ track?: OwnedTrack; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CreateAudioTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track", kind: "message", T: OwnedTrack }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track", kind: "message", T: OwnedTrack, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateAudioTrackResponse { @@ -273,7 +273,7 @@ export class CreateAudioTrackResponse extends Message } static equals(a: CreateAudioTrackResponse | PlainMessage | undefined, b: CreateAudioTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateAudioTrackResponse, a, b); + return proto2.util.equals(CreateAudioTrackResponse, a, b); } } @@ -282,19 +282,19 @@ export class CreateAudioTrackResponse extends Message */ export class GetStatsRequest extends Message { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetStatsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetStatsRequest { @@ -310,7 +310,7 @@ export class GetStatsRequest extends Message { } static equals(a: GetStatsRequest | PlainMessage | undefined, b: GetStatsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetStatsRequest, a, b); + return proto2.util.equals(GetStatsRequest, a, b); } } @@ -319,19 +319,19 @@ export class GetStatsRequest extends Message { */ export class GetStatsResponse extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetStatsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetStatsResponse { @@ -347,7 +347,7 @@ export class GetStatsResponse extends Message { } static equals(a: GetStatsResponse | PlainMessage | undefined, b: GetStatsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetStatsResponse, a, b); + return proto2.util.equals(GetStatsResponse, a, b); } } @@ -356,9 +356,9 @@ export class GetStatsResponse extends Message { */ export class GetStatsCallback extends Message { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId?: bigint; /** * @generated from field: optional string error = 2; @@ -372,13 +372,13 @@ export class GetStatsCallback extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.GetStatsCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 3, name: "stats", kind: "message", T: RtcStats, repeated: true }, ]); @@ -396,7 +396,7 @@ export class GetStatsCallback extends Message { } static equals(a: GetStatsCallback | PlainMessage | undefined, b: GetStatsCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(GetStatsCallback, a, b); + return proto2.util.equals(GetStatsCallback, a, b); } } @@ -406,12 +406,12 @@ export class GetStatsCallback extends Message { export class TrackEvent extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackEvent { @@ -427,7 +427,7 @@ export class TrackEvent extends Message { } static equals(a: TrackEvent | PlainMessage | undefined, b: TrackEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackEvent, a, b); + return proto2.util.equals(TrackEvent, a, b); } } @@ -436,79 +436,79 @@ export class TrackEvent extends Message { */ export class TrackPublicationInfo extends Message { /** - * @generated from field: string sid = 1; + * @generated from field: required string sid = 1; */ - sid = ""; + sid?: string; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; + name?: string; /** - * @generated from field: livekit.proto.TrackKind kind = 3; + * @generated from field: required livekit.proto.TrackKind kind = 3; */ - kind = TrackKind.KIND_UNKNOWN; + kind?: TrackKind; /** - * @generated from field: livekit.proto.TrackSource source = 4; + * @generated from field: required livekit.proto.TrackSource source = 4; */ - source = TrackSource.SOURCE_UNKNOWN; + source?: TrackSource; /** - * @generated from field: bool simulcasted = 5; + * @generated from field: required bool simulcasted = 5; */ - simulcasted = false; + simulcasted?: boolean; /** - * @generated from field: uint32 width = 6; + * @generated from field: required uint32 width = 6; */ - width = 0; + width?: number; /** - * @generated from field: uint32 height = 7; + * @generated from field: required uint32 height = 7; */ - height = 0; + height?: number; /** - * @generated from field: string mime_type = 8; + * @generated from field: required string mime_type = 8; */ - mimeType = ""; + mimeType?: string; /** - * @generated from field: bool muted = 9; + * @generated from field: required bool muted = 9; */ - muted = false; + muted?: boolean; /** - * @generated from field: bool remote = 10; + * @generated from field: required bool remote = 10; */ - remote = false; + remote?: boolean; /** - * @generated from field: livekit.proto.EncryptionType encryption_type = 11; + * @generated from field: required livekit.proto.EncryptionType encryption_type = 11; */ - encryptionType = EncryptionType.NONE; + encryptionType?: EncryptionType; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackPublicationInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "kind", kind: "enum", T: proto3.getEnumType(TrackKind) }, - { no: 4, name: "source", kind: "enum", T: proto3.getEnumType(TrackSource) }, - { no: 5, name: "simulcasted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 7, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 8, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 9, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 10, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 11, name: "encryption_type", kind: "enum", T: proto3.getEnumType(EncryptionType) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "kind", kind: "enum", T: proto2.getEnumType(TrackKind), req: true }, + { no: 4, name: "source", kind: "enum", T: proto2.getEnumType(TrackSource), req: true }, + { no: 5, name: "simulcasted", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 6, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 7, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 8, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 9, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 10, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 11, name: "encryption_type", kind: "enum", T: proto2.getEnumType(EncryptionType), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackPublicationInfo { @@ -524,7 +524,7 @@ export class TrackPublicationInfo extends Message { } static equals(a: TrackPublicationInfo | PlainMessage | undefined, b: TrackPublicationInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackPublicationInfo, a, b); + return proto2.util.equals(TrackPublicationInfo, a, b); } } @@ -533,25 +533,25 @@ export class TrackPublicationInfo extends Message { */ export class OwnedTrackPublication extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.TrackPublicationInfo info = 2; + * @generated from field: required livekit.proto.TrackPublicationInfo info = 2; */ info?: TrackPublicationInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedTrackPublication"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: TrackPublicationInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: TrackPublicationInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedTrackPublication { @@ -567,7 +567,7 @@ export class OwnedTrackPublication extends Message { } static equals(a: OwnedTrackPublication | PlainMessage | undefined, b: OwnedTrackPublication | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedTrackPublication, a, b); + return proto2.util.equals(OwnedTrackPublication, a, b); } } @@ -576,49 +576,49 @@ export class OwnedTrackPublication extends Message { */ export class TrackInfo extends Message { /** - * @generated from field: string sid = 1; + * @generated from field: required string sid = 1; */ - sid = ""; + sid?: string; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; + name?: string; /** - * @generated from field: livekit.proto.TrackKind kind = 3; + * @generated from field: required livekit.proto.TrackKind kind = 3; */ - kind = TrackKind.KIND_UNKNOWN; + kind?: TrackKind; /** - * @generated from field: livekit.proto.StreamState stream_state = 4; + * @generated from field: required livekit.proto.StreamState stream_state = 4; */ - streamState = StreamState.STATE_UNKNOWN; + streamState?: StreamState; /** - * @generated from field: bool muted = 5; + * @generated from field: required bool muted = 5; */ - muted = false; + muted?: boolean; /** - * @generated from field: bool remote = 6; + * @generated from field: required bool remote = 6; */ - remote = false; + remote?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.TrackInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "kind", kind: "enum", T: proto3.getEnumType(TrackKind) }, - { no: 4, name: "stream_state", kind: "enum", T: proto3.getEnumType(StreamState) }, - { no: 5, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 3, name: "kind", kind: "enum", T: proto2.getEnumType(TrackKind), req: true }, + { no: 4, name: "stream_state", kind: "enum", T: proto2.getEnumType(StreamState), req: true }, + { no: 5, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 6, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackInfo { @@ -634,7 +634,7 @@ export class TrackInfo extends Message { } static equals(a: TrackInfo | PlainMessage | undefined, b: TrackInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackInfo, a, b); + return proto2.util.equals(TrackInfo, a, b); } } @@ -643,25 +643,25 @@ export class TrackInfo extends Message { */ export class OwnedTrack extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.TrackInfo info = 2; + * @generated from field: required livekit.proto.TrackInfo info = 2; */ info?: TrackInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedTrack"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: TrackInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: TrackInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedTrack { @@ -677,7 +677,7 @@ export class OwnedTrack extends Message { } static equals(a: OwnedTrack | PlainMessage | undefined, b: OwnedTrack | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedTrack, a, b); + return proto2.util.equals(OwnedTrack, a, b); } } @@ -688,25 +688,25 @@ export class OwnedTrack extends Message { */ export class LocalTrackMuteRequest extends Message { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle?: bigint; /** - * @generated from field: bool mute = 2; + * @generated from field: required bool mute = 2; */ - mute = false; + mute?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.LocalTrackMuteRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "mute", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "mute", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackMuteRequest { @@ -722,7 +722,7 @@ export class LocalTrackMuteRequest extends Message { } static equals(a: LocalTrackMuteRequest | PlainMessage | undefined, b: LocalTrackMuteRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackMuteRequest, a, b); + return proto2.util.equals(LocalTrackMuteRequest, a, b); } } @@ -731,19 +731,19 @@ export class LocalTrackMuteRequest extends Message { */ export class LocalTrackMuteResponse extends Message { /** - * @generated from field: bool muted = 1; + * @generated from field: required bool muted = 1; */ - muted = false; + muted?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.LocalTrackMuteResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackMuteResponse { @@ -759,7 +759,7 @@ export class LocalTrackMuteResponse extends Message { } static equals(a: LocalTrackMuteResponse | PlainMessage | undefined, b: LocalTrackMuteResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackMuteResponse, a, b); + return proto2.util.equals(LocalTrackMuteResponse, a, b); } } @@ -770,25 +770,25 @@ export class LocalTrackMuteResponse extends Message { */ export class EnableRemoteTrackRequest extends Message { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle?: bigint; /** - * @generated from field: bool enabled = 2; + * @generated from field: required bool enabled = 2; */ - enabled = false; + enabled?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.EnableRemoteTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): EnableRemoteTrackRequest { @@ -804,7 +804,7 @@ export class EnableRemoteTrackRequest extends Message } static equals(a: EnableRemoteTrackRequest | PlainMessage | undefined, b: EnableRemoteTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(EnableRemoteTrackRequest, a, b); + return proto2.util.equals(EnableRemoteTrackRequest, a, b); } } @@ -813,19 +813,19 @@ export class EnableRemoteTrackRequest extends Message */ export class EnableRemoteTrackResponse extends Message { /** - * @generated from field: bool enabled = 1; + * @generated from field: required bool enabled = 1; */ - enabled = false; + enabled?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.EnableRemoteTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): EnableRemoteTrackResponse { @@ -841,7 +841,7 @@ export class EnableRemoteTrackResponse extends Message | undefined, b: EnableRemoteTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(EnableRemoteTrackResponse, a, b); + return proto2.util.equals(EnableRemoteTrackResponse, a, b); } } diff --git a/packages/livekit-rtc/src/proto/video_frame_pb.ts b/packages/livekit-rtc/src/proto/video_frame_pb.ts index 4727a87b..62ec038a 100644 --- a/packages/livekit-rtc/src/proto/video_frame_pb.ts +++ b/packages/livekit-rtc/src/proto/video_frame_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file video_frame.proto (package livekit.proto, syntax proto3) +// @generated from file video_frame.proto (package livekit.proto, syntax proto2) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { Message, proto2 } from "@bufbuild/protobuf"; import { TrackSource } from "./track_pb.js"; import { FfiOwnedHandle } from "./handle_pb.js"; @@ -46,8 +46,8 @@ export enum VideoCodec { */ VP9 = 3, } -// Retrieve enum metadata with: proto3.getEnumType(VideoCodec) -proto3.util.setEnumType(VideoCodec, "livekit.proto.VideoCodec", [ +// Retrieve enum metadata with: proto2.getEnumType(VideoCodec) +proto2.util.setEnumType(VideoCodec, "livekit.proto.VideoCodec", [ { no: 0, name: "VP8" }, { no: 1, name: "H264" }, { no: 2, name: "AV1" }, @@ -78,8 +78,8 @@ export enum VideoRotation { */ VIDEO_ROTATION_270 = 3, } -// Retrieve enum metadata with: proto3.getEnumType(VideoRotation) -proto3.util.setEnumType(VideoRotation, "livekit.proto.VideoRotation", [ +// Retrieve enum metadata with: proto2.getEnumType(VideoRotation) +proto2.util.setEnumType(VideoRotation, "livekit.proto.VideoRotation", [ { no: 0, name: "VIDEO_ROTATION_0" }, { no: 1, name: "VIDEO_ROTATION_90" }, { no: 2, name: "VIDEO_ROTATION_180" }, @@ -145,8 +145,8 @@ export enum VideoBufferType { */ NV12 = 10, } -// Retrieve enum metadata with: proto3.getEnumType(VideoBufferType) -proto3.util.setEnumType(VideoBufferType, "livekit.proto.VideoBufferType", [ +// Retrieve enum metadata with: proto2.getEnumType(VideoBufferType) +proto2.util.setEnumType(VideoBufferType, "livekit.proto.VideoBufferType", [ { no: 0, name: "RGBA" }, { no: 1, name: "ABGR" }, { no: 2, name: "ARGB" }, @@ -179,8 +179,8 @@ export enum VideoStreamType { */ VIDEO_STREAM_HTML = 2, } -// Retrieve enum metadata with: proto3.getEnumType(VideoStreamType) -proto3.util.setEnumType(VideoStreamType, "livekit.proto.VideoStreamType", [ +// Retrieve enum metadata with: proto2.getEnumType(VideoStreamType) +proto2.util.setEnumType(VideoStreamType, "livekit.proto.VideoStreamType", [ { no: 0, name: "VIDEO_STREAM_NATIVE" }, { no: 1, name: "VIDEO_STREAM_WEBGL" }, { no: 2, name: "VIDEO_STREAM_HTML" }, @@ -195,8 +195,8 @@ export enum VideoSourceType { */ VIDEO_SOURCE_NATIVE = 0, } -// Retrieve enum metadata with: proto3.getEnumType(VideoSourceType) -proto3.util.setEnumType(VideoSourceType, "livekit.proto.VideoSourceType", [ +// Retrieve enum metadata with: proto2.getEnumType(VideoSourceType) +proto2.util.setEnumType(VideoSourceType, "livekit.proto.VideoSourceType", [ { no: 0, name: "VIDEO_SOURCE_NATIVE" }, ]); @@ -208,14 +208,14 @@ proto3.util.setEnumType(VideoSourceType, "livekit.proto.VideoSourceType", [ */ export class NewVideoStreamRequest extends Message { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle?: bigint; /** - * @generated from field: livekit.proto.VideoStreamType type = 2; + * @generated from field: required livekit.proto.VideoStreamType type = 2; */ - type = VideoStreamType.VIDEO_STREAM_NATIVE; + type?: VideoStreamType; /** * Get the frame on a specific format @@ -227,22 +227,22 @@ export class NewVideoStreamRequest extends Message { /** * if true, stride will be set to width/chroma_width * - * @generated from field: bool normalize_stride = 4; + * @generated from field: required bool normalize_stride = 4; */ - normalizeStride = false; + normalizeStride?: boolean; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewVideoStreamRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(VideoStreamType) }, - { no: 3, name: "format", kind: "enum", T: proto3.getEnumType(VideoBufferType), opt: true }, - { no: 4, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(VideoStreamType), req: true }, + { no: 3, name: "format", kind: "enum", T: proto2.getEnumType(VideoBufferType), opt: true }, + { no: 4, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoStreamRequest { @@ -258,7 +258,7 @@ export class NewVideoStreamRequest extends Message { } static equals(a: NewVideoStreamRequest | PlainMessage | undefined, b: NewVideoStreamRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewVideoStreamRequest, a, b); + return proto2.util.equals(NewVideoStreamRequest, a, b); } } @@ -267,19 +267,19 @@ export class NewVideoStreamRequest extends Message { */ export class NewVideoStreamResponse extends Message { /** - * @generated from field: livekit.proto.OwnedVideoStream stream = 1; + * @generated from field: required livekit.proto.OwnedVideoStream stream = 1; */ stream?: OwnedVideoStream; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewVideoStreamResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedVideoStream }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "stream", kind: "message", T: OwnedVideoStream, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoStreamResponse { @@ -295,7 +295,7 @@ export class NewVideoStreamResponse extends Message { } static equals(a: NewVideoStreamResponse | PlainMessage | undefined, b: NewVideoStreamResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewVideoStreamResponse, a, b); + return proto2.util.equals(NewVideoStreamResponse, a, b); } } @@ -306,19 +306,19 @@ export class NewVideoStreamResponse extends Message { */ export class VideoStreamFromParticipantRequest extends Message { /** - * @generated from field: uint64 participant_handle = 1; + * @generated from field: required uint64 participant_handle = 1; */ - participantHandle = protoInt64.zero; + participantHandle?: bigint; /** - * @generated from field: livekit.proto.VideoStreamType type = 2; + * @generated from field: required livekit.proto.VideoStreamType type = 2; */ - type = VideoStreamType.VIDEO_STREAM_NATIVE; + type?: VideoStreamType; /** - * @generated from field: livekit.proto.TrackSource track_source = 3; + * @generated from field: required livekit.proto.TrackSource track_source = 3; */ - trackSource = TrackSource.SOURCE_UNKNOWN; + trackSource?: TrackSource; /** * @generated from field: optional livekit.proto.VideoBufferType format = 4; @@ -326,23 +326,23 @@ export class VideoStreamFromParticipantRequest extends Message) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoStreamFromParticipantRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(VideoStreamType) }, - { no: 3, name: "track_source", kind: "enum", T: proto3.getEnumType(TrackSource) }, - { no: 4, name: "format", kind: "enum", T: proto3.getEnumType(VideoBufferType), opt: true }, - { no: 5, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(VideoStreamType), req: true }, + { no: 3, name: "track_source", kind: "enum", T: proto2.getEnumType(TrackSource), req: true }, + { no: 4, name: "format", kind: "enum", T: proto2.getEnumType(VideoBufferType), opt: true }, + { no: 5, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamFromParticipantRequest { @@ -358,7 +358,7 @@ export class VideoStreamFromParticipantRequest extends Message | undefined, b: VideoStreamFromParticipantRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamFromParticipantRequest, a, b); + return proto2.util.equals(VideoStreamFromParticipantRequest, a, b); } } @@ -367,19 +367,19 @@ export class VideoStreamFromParticipantRequest extends Message { /** - * @generated from field: livekit.proto.OwnedVideoStream stream = 1; + * @generated from field: required livekit.proto.OwnedVideoStream stream = 1; */ stream?: OwnedVideoStream; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoStreamFromParticipantResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedVideoStream }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "stream", kind: "message", T: OwnedVideoStream, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamFromParticipantResponse { @@ -395,7 +395,7 @@ export class VideoStreamFromParticipantResponse extends Message | undefined, b: VideoStreamFromParticipantResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamFromParticipantResponse, a, b); + return proto2.util.equals(VideoStreamFromParticipantResponse, a, b); } } @@ -407,28 +407,28 @@ export class VideoStreamFromParticipantResponse extends Message { /** - * @generated from field: livekit.proto.VideoSourceType type = 1; + * @generated from field: required livekit.proto.VideoSourceType type = 1; */ - type = VideoSourceType.VIDEO_SOURCE_NATIVE; + type?: VideoSourceType; /** * Used to determine which encodings to use + simulcast layers * Most of the time it corresponds to the source resolution * - * @generated from field: livekit.proto.VideoSourceResolution resolution = 2; + * @generated from field: required livekit.proto.VideoSourceResolution resolution = 2; */ resolution?: VideoSourceResolution; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewVideoSourceRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoSourceType) }, - { no: 2, name: "resolution", kind: "message", T: VideoSourceResolution }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(VideoSourceType), req: true }, + { no: 2, name: "resolution", kind: "message", T: VideoSourceResolution, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoSourceRequest { @@ -444,7 +444,7 @@ export class NewVideoSourceRequest extends Message { } static equals(a: NewVideoSourceRequest | PlainMessage | undefined, b: NewVideoSourceRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewVideoSourceRequest, a, b); + return proto2.util.equals(NewVideoSourceRequest, a, b); } } @@ -453,19 +453,19 @@ export class NewVideoSourceRequest extends Message { */ export class NewVideoSourceResponse extends Message { /** - * @generated from field: livekit.proto.OwnedVideoSource source = 1; + * @generated from field: required livekit.proto.OwnedVideoSource source = 1; */ source?: OwnedVideoSource; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.NewVideoSourceResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source", kind: "message", T: OwnedVideoSource }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "source", kind: "message", T: OwnedVideoSource, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoSourceResponse { @@ -481,7 +481,7 @@ export class NewVideoSourceResponse extends Message { } static equals(a: NewVideoSourceResponse | PlainMessage | undefined, b: NewVideoSourceResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewVideoSourceResponse, a, b); + return proto2.util.equals(NewVideoSourceResponse, a, b); } } @@ -492,39 +492,39 @@ export class NewVideoSourceResponse extends Message { */ export class CaptureVideoFrameRequest extends Message { /** - * @generated from field: uint64 source_handle = 1; + * @generated from field: required uint64 source_handle = 1; */ - sourceHandle = protoInt64.zero; + sourceHandle?: bigint; /** - * @generated from field: livekit.proto.VideoBufferInfo buffer = 2; + * @generated from field: required livekit.proto.VideoBufferInfo buffer = 2; */ buffer?: VideoBufferInfo; /** * In microseconds * - * @generated from field: int64 timestamp_us = 3; + * @generated from field: required int64 timestamp_us = 3; */ - timestampUs = protoInt64.zero; + timestampUs?: bigint; /** - * @generated from field: livekit.proto.VideoRotation rotation = 4; + * @generated from field: required livekit.proto.VideoRotation rotation = 4; */ - rotation = VideoRotation.VIDEO_ROTATION_0; + rotation?: VideoRotation; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CaptureVideoFrameRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo }, - { no: 3, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 4, name: "rotation", kind: "enum", T: proto3.getEnumType(VideoRotation) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo, req: true }, + { no: 3, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, + { no: 4, name: "rotation", kind: "enum", T: proto2.getEnumType(VideoRotation), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CaptureVideoFrameRequest { @@ -540,7 +540,7 @@ export class CaptureVideoFrameRequest extends Message } static equals(a: CaptureVideoFrameRequest | PlainMessage | undefined, b: CaptureVideoFrameRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureVideoFrameRequest, a, b); + return proto2.util.equals(CaptureVideoFrameRequest, a, b); } } @@ -550,12 +550,12 @@ export class CaptureVideoFrameRequest extends Message export class CaptureVideoFrameResponse extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.CaptureVideoFrameResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): CaptureVideoFrameResponse { @@ -571,7 +571,7 @@ export class CaptureVideoFrameResponse extends Message | undefined, b: CaptureVideoFrameResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureVideoFrameResponse, a, b); + return proto2.util.equals(CaptureVideoFrameResponse, a, b); } } @@ -580,31 +580,31 @@ export class CaptureVideoFrameResponse extends Message { /** - * @generated from field: bool flip_y = 1; + * @generated from field: required bool flip_y = 1; */ - flipY = false; + flipY?: boolean; /** - * @generated from field: livekit.proto.VideoBufferInfo buffer = 2; + * @generated from field: required livekit.proto.VideoBufferInfo buffer = 2; */ buffer?: VideoBufferInfo; /** - * @generated from field: livekit.proto.VideoBufferType dst_type = 3; + * @generated from field: required livekit.proto.VideoBufferType dst_type = 3; */ - dstType = VideoBufferType.RGBA; + dstType?: VideoBufferType; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoConvertRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "flip_y", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo }, - { no: 3, name: "dst_type", kind: "enum", T: proto3.getEnumType(VideoBufferType) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "flip_y", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo, req: true }, + { no: 3, name: "dst_type", kind: "enum", T: proto2.getEnumType(VideoBufferType), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoConvertRequest { @@ -620,7 +620,7 @@ export class VideoConvertRequest extends Message { } static equals(a: VideoConvertRequest | PlainMessage | undefined, b: VideoConvertRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoConvertRequest, a, b); + return proto2.util.equals(VideoConvertRequest, a, b); } } @@ -629,25 +629,32 @@ export class VideoConvertRequest extends Message { */ export class VideoConvertResponse extends Message { /** - * @generated from field: optional string error = 1; + * @generated from oneof livekit.proto.VideoConvertResponse.message */ - error?: string; - - /** - * @generated from field: livekit.proto.OwnedVideoBuffer buffer = 2; - */ - buffer?: OwnedVideoBuffer; + message: { + /** + * @generated from field: string error = 1; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.OwnedVideoBuffer buffer = 2; + */ + value: OwnedVideoBuffer; + case: "buffer"; + } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoConvertResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 2, name: "buffer", kind: "message", T: OwnedVideoBuffer }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, + { no: 2, name: "buffer", kind: "message", T: OwnedVideoBuffer, oneof: "message" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoConvertResponse { @@ -663,7 +670,7 @@ export class VideoConvertResponse extends Message { } static equals(a: VideoConvertResponse | PlainMessage | undefined, b: VideoConvertResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoConvertResponse, a, b); + return proto2.util.equals(VideoConvertResponse, a, b); } } @@ -672,31 +679,31 @@ export class VideoConvertResponse extends Message { */ export class VideoResolution extends Message { /** - * @generated from field: uint32 width = 1; + * @generated from field: required uint32 width = 1; */ - width = 0; + width?: number; /** - * @generated from field: uint32 height = 2; + * @generated from field: required uint32 height = 2; */ - height = 0; + height?: number; /** - * @generated from field: double frame_rate = 3; + * @generated from field: required double frame_rate = 3; */ - frameRate = 0; + frameRate?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoResolution"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "frame_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 3, name: "frame_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoResolution { @@ -712,7 +719,7 @@ export class VideoResolution extends Message { } static equals(a: VideoResolution | PlainMessage | undefined, b: VideoResolution | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoResolution, a, b); + return proto2.util.equals(VideoResolution, a, b); } } @@ -721,31 +728,31 @@ export class VideoResolution extends Message { */ export class VideoBufferInfo extends Message { /** - * @generated from field: livekit.proto.VideoBufferType type = 1; + * @generated from field: required livekit.proto.VideoBufferType type = 1; */ - type = VideoBufferType.RGBA; + type?: VideoBufferType; /** - * @generated from field: uint32 width = 2; + * @generated from field: required uint32 width = 2; */ - width = 0; + width?: number; /** - * @generated from field: uint32 height = 3; + * @generated from field: required uint32 height = 3; */ - height = 0; + height?: number; /** - * @generated from field: uint64 data_ptr = 4; + * @generated from field: required uint64 data_ptr = 4; */ - dataPtr = protoInt64.zero; + dataPtr?: bigint; /** * only for packed formats * - * @generated from field: uint32 stride = 6; + * @generated from field: required uint32 stride = 6; */ - stride = 0; + stride?: number; /** * @generated from field: repeated livekit.proto.VideoBufferInfo.ComponentInfo components = 7; @@ -754,17 +761,17 @@ export class VideoBufferInfo extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoBufferInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoBufferType) }, - { no: 2, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 6, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(VideoBufferType), req: true }, + { no: 2, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 3, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 4, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 6, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, { no: 7, name: "components", kind: "message", T: VideoBufferInfo_ComponentInfo, repeated: true }, ]); @@ -781,7 +788,7 @@ export class VideoBufferInfo extends Message { } static equals(a: VideoBufferInfo | PlainMessage | undefined, b: VideoBufferInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoBufferInfo, a, b); + return proto2.util.equals(VideoBufferInfo, a, b); } } @@ -790,31 +797,31 @@ export class VideoBufferInfo extends Message { */ export class VideoBufferInfo_ComponentInfo extends Message { /** - * @generated from field: uint64 data_ptr = 1; + * @generated from field: required uint64 data_ptr = 1; */ - dataPtr = protoInt64.zero; + dataPtr?: bigint; /** - * @generated from field: uint32 stride = 2; + * @generated from field: required uint32 stride = 2; */ - stride = 0; + stride?: number; /** - * @generated from field: uint32 size = 3; + * @generated from field: required uint32 size = 3; */ - size = 0; + size?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoBufferInfo.ComponentInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoBufferInfo_ComponentInfo { @@ -830,7 +837,7 @@ export class VideoBufferInfo_ComponentInfo extends Message | undefined, b: VideoBufferInfo_ComponentInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoBufferInfo_ComponentInfo, a, b); + return proto2.util.equals(VideoBufferInfo_ComponentInfo, a, b); } } @@ -839,25 +846,25 @@ export class VideoBufferInfo_ComponentInfo extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.VideoBufferInfo info = 2; + * @generated from field: required livekit.proto.VideoBufferInfo info = 2; */ info?: VideoBufferInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedVideoBuffer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: VideoBufferInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: VideoBufferInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedVideoBuffer { @@ -873,7 +880,7 @@ export class OwnedVideoBuffer extends Message { } static equals(a: OwnedVideoBuffer | PlainMessage | undefined, b: OwnedVideoBuffer | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedVideoBuffer, a, b); + return proto2.util.equals(OwnedVideoBuffer, a, b); } } @@ -882,19 +889,19 @@ export class OwnedVideoBuffer extends Message { */ export class VideoStreamInfo extends Message { /** - * @generated from field: livekit.proto.VideoStreamType type = 1; + * @generated from field: required livekit.proto.VideoStreamType type = 1; */ - type = VideoStreamType.VIDEO_STREAM_NATIVE; + type?: VideoStreamType; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoStreamInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoStreamType) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(VideoStreamType), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamInfo { @@ -910,7 +917,7 @@ export class VideoStreamInfo extends Message { } static equals(a: VideoStreamInfo | PlainMessage | undefined, b: VideoStreamInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamInfo, a, b); + return proto2.util.equals(VideoStreamInfo, a, b); } } @@ -919,25 +926,25 @@ export class VideoStreamInfo extends Message { */ export class OwnedVideoStream extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.VideoStreamInfo info = 2; + * @generated from field: required livekit.proto.VideoStreamInfo info = 2; */ info?: VideoStreamInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedVideoStream"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: VideoStreamInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: VideoStreamInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedVideoStream { @@ -953,7 +960,7 @@ export class OwnedVideoStream extends Message { } static equals(a: OwnedVideoStream | PlainMessage | undefined, b: OwnedVideoStream | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedVideoStream, a, b); + return proto2.util.equals(OwnedVideoStream, a, b); } } @@ -962,9 +969,9 @@ export class OwnedVideoStream extends Message { */ export class VideoStreamEvent extends Message { /** - * @generated from field: uint64 stream_handle = 1; + * @generated from field: required uint64 stream_handle = 1; */ - streamHandle = protoInt64.zero; + streamHandle?: bigint; /** * @generated from oneof livekit.proto.VideoStreamEvent.message @@ -985,13 +992,13 @@ export class VideoStreamEvent extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoStreamEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "frame_received", kind: "message", T: VideoFrameReceived, oneof: "message" }, { no: 3, name: "eos", kind: "message", T: VideoStreamEOS, oneof: "message" }, ]); @@ -1009,7 +1016,7 @@ export class VideoStreamEvent extends Message { } static equals(a: VideoStreamEvent | PlainMessage | undefined, b: VideoStreamEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamEvent, a, b); + return proto2.util.equals(VideoStreamEvent, a, b); } } @@ -1018,33 +1025,33 @@ export class VideoStreamEvent extends Message { */ export class VideoFrameReceived extends Message { /** - * @generated from field: livekit.proto.OwnedVideoBuffer buffer = 1; + * @generated from field: required livekit.proto.OwnedVideoBuffer buffer = 1; */ buffer?: OwnedVideoBuffer; /** * In microseconds * - * @generated from field: int64 timestamp_us = 2; + * @generated from field: required int64 timestamp_us = 2; */ - timestampUs = protoInt64.zero; + timestampUs?: bigint; /** - * @generated from field: livekit.proto.VideoRotation rotation = 3; + * @generated from field: required livekit.proto.VideoRotation rotation = 3; */ - rotation = VideoRotation.VIDEO_ROTATION_0; + rotation?: VideoRotation; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoFrameReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "buffer", kind: "message", T: OwnedVideoBuffer }, - { no: 2, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 3, name: "rotation", kind: "enum", T: proto3.getEnumType(VideoRotation) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "buffer", kind: "message", T: OwnedVideoBuffer, req: true }, + { no: 2, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, + { no: 3, name: "rotation", kind: "enum", T: proto2.getEnumType(VideoRotation), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoFrameReceived { @@ -1060,7 +1067,7 @@ export class VideoFrameReceived extends Message { } static equals(a: VideoFrameReceived | PlainMessage | undefined, b: VideoFrameReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoFrameReceived, a, b); + return proto2.util.equals(VideoFrameReceived, a, b); } } @@ -1070,12 +1077,12 @@ export class VideoFrameReceived extends Message { export class VideoStreamEOS extends Message { constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoStreamEOS"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ + static readonly fields: FieldList = proto2.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamEOS { @@ -1091,7 +1098,7 @@ export class VideoStreamEOS extends Message { } static equals(a: VideoStreamEOS | PlainMessage | undefined, b: VideoStreamEOS | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamEOS, a, b); + return proto2.util.equals(VideoStreamEOS, a, b); } } @@ -1100,25 +1107,25 @@ export class VideoStreamEOS extends Message { */ export class VideoSourceResolution extends Message { /** - * @generated from field: uint32 width = 1; + * @generated from field: required uint32 width = 1; */ - width = 0; + width?: number; /** - * @generated from field: uint32 height = 2; + * @generated from field: required uint32 height = 2; */ - height = 0; + height?: number; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoSourceResolution"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoSourceResolution { @@ -1134,7 +1141,7 @@ export class VideoSourceResolution extends Message { } static equals(a: VideoSourceResolution | PlainMessage | undefined, b: VideoSourceResolution | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoSourceResolution, a, b); + return proto2.util.equals(VideoSourceResolution, a, b); } } @@ -1143,19 +1150,19 @@ export class VideoSourceResolution extends Message { */ export class VideoSourceInfo extends Message { /** - * @generated from field: livekit.proto.VideoSourceType type = 1; + * @generated from field: required livekit.proto.VideoSourceType type = 1; */ - type = VideoSourceType.VIDEO_SOURCE_NATIVE; + type?: VideoSourceType; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.VideoSourceInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoSourceType) }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(VideoSourceType), req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoSourceInfo { @@ -1171,7 +1178,7 @@ export class VideoSourceInfo extends Message { } static equals(a: VideoSourceInfo | PlainMessage | undefined, b: VideoSourceInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoSourceInfo, a, b); + return proto2.util.equals(VideoSourceInfo, a, b); } } @@ -1180,25 +1187,25 @@ export class VideoSourceInfo extends Message { */ export class OwnedVideoSource extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.VideoSourceInfo info = 2; + * @generated from field: required livekit.proto.VideoSourceInfo info = 2; */ info?: VideoSourceInfo; constructor(data?: PartialMessage) { super(); - proto3.util.initPartial(data, this); + proto2.util.initPartial(data, this); } - static readonly runtime: typeof proto3 = proto3; + static readonly runtime: typeof proto2 = proto2; static readonly typeName = "livekit.proto.OwnedVideoSource"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: VideoSourceInfo }, + static readonly fields: FieldList = proto2.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, + { no: 2, name: "info", kind: "message", T: VideoSourceInfo, req: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedVideoSource { @@ -1214,7 +1221,7 @@ export class OwnedVideoSource extends Message { } static equals(a: OwnedVideoSource | PlainMessage | undefined, b: OwnedVideoSource | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedVideoSource, a, b); + return proto2.util.equals(OwnedVideoSource, a, b); } } From a21904f0ae63a88391e2ee3c343c6b32db02725d Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 18 Oct 2024 16:46:27 -0700 Subject: [PATCH 098/126] p --- packages/livekit-rtc/rust-sdks | 2 +- .../livekit-rtc/src/proto/audio_frame_pb.ts | 667 ++++--- packages/livekit-rtc/src/proto/e2ee_pb.ts | 380 ++-- packages/livekit-rtc/src/proto/ffi_pb.ts | 116 +- packages/livekit-rtc/src/proto/handle_pb.ts | 18 +- .../livekit-rtc/src/proto/participant_pb.ts | 62 +- packages/livekit-rtc/src/proto/room_pb.ts | 1737 ++++++++--------- packages/livekit-rtc/src/proto/stats_pb.ts | 1624 +++++++-------- packages/livekit-rtc/src/proto/track_pb.ts | 348 ++-- .../livekit-rtc/src/proto/video_frame_pb.ts | 467 +++-- 10 files changed, 2631 insertions(+), 2790 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 17967c42..ce7c79bc 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 17967c42898ac45eca97d7c92127d7d860f7b616 +Subproject commit ce7c79bcfbda9af6e0657f46b770234641bc53fb diff --git a/packages/livekit-rtc/src/proto/audio_frame_pb.ts b/packages/livekit-rtc/src/proto/audio_frame_pb.ts index 8daa5ab9..c6e0dba5 100644 --- a/packages/livekit-rtc/src/proto/audio_frame_pb.ts +++ b/packages/livekit-rtc/src/proto/audio_frame_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file audio_frame.proto (package livekit.proto, syntax proto2) +// @generated from file audio_frame.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { TrackSource } from "./track_pb.js"; import { FfiOwnedHandle } from "./handle_pb.js"; @@ -38,8 +38,8 @@ export enum SoxResamplerDataType { */ SOXR_DATATYPE_INT16S = 1, } -// Retrieve enum metadata with: proto2.getEnumType(SoxResamplerDataType) -proto2.util.setEnumType(SoxResamplerDataType, "livekit.proto.SoxResamplerDataType", [ +// Retrieve enum metadata with: proto3.getEnumType(SoxResamplerDataType) +proto3.util.setEnumType(SoxResamplerDataType, "livekit.proto.SoxResamplerDataType", [ { no: 0, name: "SOXR_DATATYPE_INT16I" }, { no: 1, name: "SOXR_DATATYPE_INT16S" }, ]); @@ -73,8 +73,8 @@ export enum SoxQualityRecipe { */ SOXR_QUALITY_VERYHIGH = 4, } -// Retrieve enum metadata with: proto2.getEnumType(SoxQualityRecipe) -proto2.util.setEnumType(SoxQualityRecipe, "livekit.proto.SoxQualityRecipe", [ +// Retrieve enum metadata with: proto3.getEnumType(SoxQualityRecipe) +proto3.util.setEnumType(SoxQualityRecipe, "livekit.proto.SoxQualityRecipe", [ { no: 0, name: "SOXR_QUALITY_QUICK" }, { no: 1, name: "SOXR_QUALITY_LOW" }, { no: 2, name: "SOXR_QUALITY_MEDIUM" }, @@ -128,8 +128,8 @@ export enum SoxFlagBits { */ SOXR_VR = 5, } -// Retrieve enum metadata with: proto2.getEnumType(SoxFlagBits) -proto2.util.setEnumType(SoxFlagBits, "livekit.proto.SoxFlagBits", [ +// Retrieve enum metadata with: proto3.getEnumType(SoxFlagBits) +proto3.util.setEnumType(SoxFlagBits, "livekit.proto.SoxFlagBits", [ { no: 0, name: "SOXR_ROLLOFF_SMALL" }, { no: 1, name: "SOXR_ROLLOFF_MEDIUM" }, { no: 2, name: "SOXR_ROLLOFF_NONE" }, @@ -152,8 +152,8 @@ export enum AudioStreamType { */ AUDIO_STREAM_HTML = 1, } -// Retrieve enum metadata with: proto2.getEnumType(AudioStreamType) -proto2.util.setEnumType(AudioStreamType, "livekit.proto.AudioStreamType", [ +// Retrieve enum metadata with: proto3.getEnumType(AudioStreamType) +proto3.util.setEnumType(AudioStreamType, "livekit.proto.AudioStreamType", [ { no: 0, name: "AUDIO_STREAM_NATIVE" }, { no: 1, name: "AUDIO_STREAM_HTML" }, ]); @@ -167,8 +167,8 @@ export enum AudioSourceType { */ AUDIO_SOURCE_NATIVE = 0, } -// Retrieve enum metadata with: proto2.getEnumType(AudioSourceType) -proto2.util.setEnumType(AudioSourceType, "livekit.proto.AudioSourceType", [ +// Retrieve enum metadata with: proto3.getEnumType(AudioSourceType) +proto3.util.setEnumType(AudioSourceType, "livekit.proto.AudioSourceType", [ { no: 0, name: "AUDIO_SOURCE_NATIVE" }, ]); @@ -180,37 +180,37 @@ proto2.util.setEnumType(AudioSourceType, "livekit.proto.AudioSourceType", [ */ export class NewAudioStreamRequest extends Message { /** - * @generated from field: required uint64 track_handle = 1; + * @generated from field: uint64 track_handle = 1; */ - trackHandle?: bigint; + trackHandle = protoInt64.zero; /** - * @generated from field: required livekit.proto.AudioStreamType type = 2; + * @generated from field: livekit.proto.AudioStreamType type = 2; */ - type?: AudioStreamType; + type = AudioStreamType.AUDIO_STREAM_NATIVE; /** - * @generated from field: required uint32 sample_rate = 3; + * @generated from field: uint32 sample_rate = 3; */ - sampleRate?: number; + sampleRate = 0; /** - * @generated from field: required uint32 num_channels = 4; + * @generated from field: uint32 num_channels = 4; */ - numChannels?: number; + numChannels = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewAudioStreamRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(AudioStreamType), req: true }, - { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 4, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AudioStreamType) }, + { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 4, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioStreamRequest { @@ -226,7 +226,7 @@ export class NewAudioStreamRequest extends Message { } static equals(a: NewAudioStreamRequest | PlainMessage | undefined, b: NewAudioStreamRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(NewAudioStreamRequest, a, b); + return proto3.util.equals(NewAudioStreamRequest, a, b); } } @@ -235,19 +235,19 @@ export class NewAudioStreamRequest extends Message { */ export class NewAudioStreamResponse extends Message { /** - * @generated from field: required livekit.proto.OwnedAudioStream stream = 1; + * @generated from field: livekit.proto.OwnedAudioStream stream = 1; */ stream?: OwnedAudioStream; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewAudioStreamResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedAudioStream, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "stream", kind: "message", T: OwnedAudioStream }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioStreamResponse { @@ -263,7 +263,7 @@ export class NewAudioStreamResponse extends Message { } static equals(a: NewAudioStreamResponse | PlainMessage | undefined, b: NewAudioStreamResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(NewAudioStreamResponse, a, b); + return proto3.util.equals(NewAudioStreamResponse, a, b); } } @@ -272,14 +272,14 @@ export class NewAudioStreamResponse extends Message { */ export class AudioStreamFromParticipantRequest extends Message { /** - * @generated from field: required uint64 participant_handle = 1; + * @generated from field: uint64 participant_handle = 1; */ - participantHandle?: bigint; + participantHandle = protoInt64.zero; /** - * @generated from field: required livekit.proto.AudioStreamType type = 2; + * @generated from field: livekit.proto.AudioStreamType type = 2; */ - type?: AudioStreamType; + type = AudioStreamType.AUDIO_STREAM_NATIVE; /** * @generated from field: optional livekit.proto.TrackSource track_source = 3; @@ -287,28 +287,28 @@ export class AudioStreamFromParticipantRequest extends Message) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioStreamFromParticipantRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(AudioStreamType), req: true }, - { no: 3, name: "track_source", kind: "enum", T: proto2.getEnumType(TrackSource), opt: true }, - { no: 5, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 6, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AudioStreamType) }, + { no: 3, name: "track_source", kind: "enum", T: proto3.getEnumType(TrackSource), opt: true }, + { no: 5, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 6, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamFromParticipantRequest { @@ -324,7 +324,7 @@ export class AudioStreamFromParticipantRequest extends Message | undefined, b: AudioStreamFromParticipantRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioStreamFromParticipantRequest, a, b); + return proto3.util.equals(AudioStreamFromParticipantRequest, a, b); } } @@ -333,19 +333,19 @@ export class AudioStreamFromParticipantRequest extends Message { /** - * @generated from field: required livekit.proto.OwnedAudioStream stream = 1; + * @generated from field: livekit.proto.OwnedAudioStream stream = 1; */ stream?: OwnedAudioStream; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioStreamFromParticipantResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedAudioStream, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "stream", kind: "message", T: OwnedAudioStream }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamFromParticipantResponse { @@ -361,7 +361,7 @@ export class AudioStreamFromParticipantResponse extends Message | undefined, b: AudioStreamFromParticipantResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioStreamFromParticipantResponse, a, b); + return proto3.util.equals(AudioStreamFromParticipantResponse, a, b); } } @@ -372,9 +372,9 @@ export class AudioStreamFromParticipantResponse extends Message { /** - * @generated from field: required livekit.proto.AudioSourceType type = 1; + * @generated from field: livekit.proto.AudioSourceType type = 1; */ - type?: AudioSourceType; + type = AudioSourceType.AUDIO_SOURCE_NATIVE; /** * @generated from field: optional livekit.proto.AudioSourceOptions options = 2; @@ -382,33 +382,33 @@ export class NewAudioSourceRequest extends Message { options?: AudioSourceOptions; /** - * @generated from field: required uint32 sample_rate = 3; + * @generated from field: uint32 sample_rate = 3; */ - sampleRate?: number; + sampleRate = 0; /** - * @generated from field: required uint32 num_channels = 4; + * @generated from field: uint32 num_channels = 4; */ - numChannels?: number; + numChannels = 0; /** - * @generated from field: required uint32 queue_size_ms = 5; + * @generated from field: uint32 queue_size_ms = 5; */ - queueSizeMs?: number; + queueSizeMs = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewAudioSourceRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(AudioSourceType), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(AudioSourceType) }, { no: 2, name: "options", kind: "message", T: AudioSourceOptions, opt: true }, - { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 4, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 5, name: "queue_size_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: 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: "queue_size_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioSourceRequest { @@ -424,7 +424,7 @@ export class NewAudioSourceRequest extends Message { } static equals(a: NewAudioSourceRequest | PlainMessage | undefined, b: NewAudioSourceRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(NewAudioSourceRequest, a, b); + return proto3.util.equals(NewAudioSourceRequest, a, b); } } @@ -433,19 +433,19 @@ export class NewAudioSourceRequest extends Message { */ export class NewAudioSourceResponse extends Message { /** - * @generated from field: required livekit.proto.OwnedAudioSource source = 1; + * @generated from field: livekit.proto.OwnedAudioSource source = 1; */ source?: OwnedAudioSource; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewAudioSourceResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "source", kind: "message", T: OwnedAudioSource, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "source", kind: "message", T: OwnedAudioSource }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioSourceResponse { @@ -461,7 +461,7 @@ export class NewAudioSourceResponse extends Message { } static equals(a: NewAudioSourceResponse | PlainMessage | undefined, b: NewAudioSourceResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(NewAudioSourceResponse, a, b); + return proto3.util.equals(NewAudioSourceResponse, a, b); } } @@ -473,25 +473,25 @@ export class NewAudioSourceResponse extends Message { */ export class CaptureAudioFrameRequest extends Message { /** - * @generated from field: required uint64 source_handle = 1; + * @generated from field: uint64 source_handle = 1; */ - sourceHandle?: bigint; + sourceHandle = protoInt64.zero; /** - * @generated from field: required livekit.proto.AudioFrameBufferInfo buffer = 2; + * @generated from field: livekit.proto.AudioFrameBufferInfo buffer = 2; */ buffer?: AudioFrameBufferInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CaptureAudioFrameRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CaptureAudioFrameRequest { @@ -507,7 +507,7 @@ export class CaptureAudioFrameRequest extends Message } static equals(a: CaptureAudioFrameRequest | PlainMessage | undefined, b: CaptureAudioFrameRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(CaptureAudioFrameRequest, a, b); + return proto3.util.equals(CaptureAudioFrameRequest, a, b); } } @@ -516,19 +516,19 @@ export class CaptureAudioFrameRequest extends Message */ export class CaptureAudioFrameResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CaptureAudioFrameResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CaptureAudioFrameResponse { @@ -544,7 +544,7 @@ export class CaptureAudioFrameResponse extends Message | undefined, b: CaptureAudioFrameResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(CaptureAudioFrameResponse, a, b); + return proto3.util.equals(CaptureAudioFrameResponse, a, b); } } @@ -553,9 +553,9 @@ export class CaptureAudioFrameResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** * @generated from field: optional string error = 2; @@ -564,13 +564,13 @@ export class CaptureAudioFrameCallback extends Message) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CaptureAudioFrameCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 }, ]); @@ -587,7 +587,7 @@ export class CaptureAudioFrameCallback extends Message | undefined, b: CaptureAudioFrameCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(CaptureAudioFrameCallback, a, b); + return proto3.util.equals(CaptureAudioFrameCallback, a, b); } } @@ -596,19 +596,19 @@ export class CaptureAudioFrameCallback extends Message { /** - * @generated from field: required uint64 source_handle = 1; + * @generated from field: uint64 source_handle = 1; */ - sourceHandle?: bigint; + sourceHandle = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ClearAudioBufferRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ClearAudioBufferRequest { @@ -624,7 +624,7 @@ export class ClearAudioBufferRequest extends Message { } static equals(a: ClearAudioBufferRequest | PlainMessage | undefined, b: ClearAudioBufferRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(ClearAudioBufferRequest, a, b); + return proto3.util.equals(ClearAudioBufferRequest, a, b); } } @@ -634,12 +634,12 @@ export class ClearAudioBufferRequest extends Message { export class ClearAudioBufferResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ClearAudioBufferResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): ClearAudioBufferResponse { @@ -655,7 +655,7 @@ export class ClearAudioBufferResponse extends Message } static equals(a: ClearAudioBufferResponse | PlainMessage | undefined, b: ClearAudioBufferResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(ClearAudioBufferResponse, a, b); + return proto3.util.equals(ClearAudioBufferResponse, a, b); } } @@ -667,12 +667,12 @@ export class ClearAudioBufferResponse extends Message export class NewAudioResamplerRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewAudioResamplerRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioResamplerRequest { @@ -688,7 +688,7 @@ export class NewAudioResamplerRequest extends Message } static equals(a: NewAudioResamplerRequest | PlainMessage | undefined, b: NewAudioResamplerRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(NewAudioResamplerRequest, a, b); + return proto3.util.equals(NewAudioResamplerRequest, a, b); } } @@ -697,19 +697,19 @@ export class NewAudioResamplerRequest extends Message */ export class NewAudioResamplerResponse extends Message { /** - * @generated from field: required livekit.proto.OwnedAudioResampler resampler = 1; + * @generated from field: livekit.proto.OwnedAudioResampler resampler = 1; */ resampler?: OwnedAudioResampler; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewAudioResamplerResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "resampler", kind: "message", T: OwnedAudioResampler, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resampler", kind: "message", T: OwnedAudioResampler }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioResamplerResponse { @@ -725,7 +725,7 @@ export class NewAudioResamplerResponse extends Message | undefined, b: NewAudioResamplerResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(NewAudioResamplerResponse, a, b); + return proto3.util.equals(NewAudioResamplerResponse, a, b); } } @@ -736,37 +736,37 @@ export class NewAudioResamplerResponse extends Message { /** - * @generated from field: required uint64 resampler_handle = 1; + * @generated from field: uint64 resampler_handle = 1; */ - resamplerHandle?: bigint; + resamplerHandle = protoInt64.zero; /** - * @generated from field: required livekit.proto.AudioFrameBufferInfo buffer = 2; + * @generated from field: livekit.proto.AudioFrameBufferInfo buffer = 2; */ buffer?: AudioFrameBufferInfo; /** - * @generated from field: required uint32 num_channels = 3; + * @generated from field: uint32 num_channels = 3; */ - numChannels?: number; + numChannels = 0; /** - * @generated from field: required uint32 sample_rate = 4; + * @generated from field: uint32 sample_rate = 4; */ - sampleRate?: number; + sampleRate = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RemixAndResampleRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo, req: true }, - { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 4, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo }, + { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 4, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RemixAndResampleRequest { @@ -782,7 +782,7 @@ export class RemixAndResampleRequest extends Message { } static equals(a: RemixAndResampleRequest | PlainMessage | undefined, b: RemixAndResampleRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(RemixAndResampleRequest, a, b); + return proto3.util.equals(RemixAndResampleRequest, a, b); } } @@ -791,19 +791,19 @@ export class RemixAndResampleRequest extends Message { */ export class RemixAndResampleResponse extends Message { /** - * @generated from field: required livekit.proto.OwnedAudioFrameBuffer buffer = 1; + * @generated from field: livekit.proto.OwnedAudioFrameBuffer buffer = 1; */ buffer?: OwnedAudioFrameBuffer; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RemixAndResampleResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "buffer", kind: "message", T: OwnedAudioFrameBuffer, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "buffer", kind: "message", T: OwnedAudioFrameBuffer }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RemixAndResampleResponse { @@ -819,7 +819,7 @@ export class RemixAndResampleResponse extends Message } static equals(a: RemixAndResampleResponse | PlainMessage | undefined, b: RemixAndResampleResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(RemixAndResampleResponse, a, b); + return proto3.util.equals(RemixAndResampleResponse, a, b); } } @@ -828,55 +828,55 @@ export class RemixAndResampleResponse extends Message */ export class NewSoxResamplerRequest extends Message { /** - * @generated from field: required double input_rate = 1; + * @generated from field: double input_rate = 1; */ - inputRate?: number; + inputRate = 0; /** - * @generated from field: required double output_rate = 2; + * @generated from field: double output_rate = 2; */ - outputRate?: number; + outputRate = 0; /** - * @generated from field: required uint32 num_channels = 3; + * @generated from field: uint32 num_channels = 3; */ - numChannels?: number; + numChannels = 0; /** - * @generated from field: required livekit.proto.SoxResamplerDataType input_data_type = 4; + * @generated from field: livekit.proto.SoxResamplerDataType input_data_type = 4; */ - inputDataType?: SoxResamplerDataType; + inputDataType = SoxResamplerDataType.SOXR_DATATYPE_INT16I; /** - * @generated from field: required livekit.proto.SoxResamplerDataType output_data_type = 5; + * @generated from field: livekit.proto.SoxResamplerDataType output_data_type = 5; */ - outputDataType?: SoxResamplerDataType; + outputDataType = SoxResamplerDataType.SOXR_DATATYPE_INT16I; /** - * @generated from field: required livekit.proto.SoxQualityRecipe quality_recipe = 6; + * @generated from field: livekit.proto.SoxQualityRecipe quality_recipe = 6; */ - qualityRecipe?: SoxQualityRecipe; + qualityRecipe = SoxQualityRecipe.SOXR_QUALITY_QUICK; /** - * @generated from field: required uint32 flags = 7; + * @generated from field: uint32 flags = 7; */ - flags?: number; + flags = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewSoxResamplerRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "input_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 2, name: "output_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 4, name: "input_data_type", kind: "enum", T: proto2.getEnumType(SoxResamplerDataType), req: true }, - { no: 5, name: "output_data_type", kind: "enum", T: proto2.getEnumType(SoxResamplerDataType), req: true }, - { no: 6, name: "quality_recipe", kind: "enum", T: proto2.getEnumType(SoxQualityRecipe), req: true }, - { no: 7, name: "flags", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "input_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 2, name: "output_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 4, name: "input_data_type", kind: "enum", T: proto3.getEnumType(SoxResamplerDataType) }, + { no: 5, name: "output_data_type", kind: "enum", T: proto3.getEnumType(SoxResamplerDataType) }, + { no: 6, name: "quality_recipe", kind: "enum", T: proto3.getEnumType(SoxQualityRecipe) }, + { no: 7, name: "flags", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewSoxResamplerRequest { @@ -892,7 +892,7 @@ export class NewSoxResamplerRequest extends Message { } static equals(a: NewSoxResamplerRequest | PlainMessage | undefined, b: NewSoxResamplerRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(NewSoxResamplerRequest, a, b); + return proto3.util.equals(NewSoxResamplerRequest, a, b); } } @@ -901,32 +901,25 @@ export class NewSoxResamplerRequest extends Message { */ export class NewSoxResamplerResponse extends Message { /** - * @generated from oneof livekit.proto.NewSoxResamplerResponse.message + * @generated from field: livekit.proto.OwnedSoxResampler resampler = 1; */ - message: { - /** - * @generated from field: livekit.proto.OwnedSoxResampler resampler = 1; - */ - value: OwnedSoxResampler; - case: "resampler"; - } | { - /** - * @generated from field: string error = 2; - */ - value: string; - case: "error"; - } | { case: undefined; value?: undefined } = { case: undefined }; + resampler?: OwnedSoxResampler; + + /** + * @generated from field: optional string error = 2; + */ + error?: string; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewSoxResamplerResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "resampler", kind: "message", T: OwnedSoxResampler, oneof: "message" }, - { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resampler", kind: "message", T: OwnedSoxResampler }, + { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewSoxResamplerResponse { @@ -942,7 +935,7 @@ export class NewSoxResamplerResponse extends Message { } static equals(a: NewSoxResamplerResponse | PlainMessage | undefined, b: NewSoxResamplerResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(NewSoxResamplerResponse, a, b); + return proto3.util.equals(NewSoxResamplerResponse, a, b); } } @@ -951,35 +944,35 @@ export class NewSoxResamplerResponse extends Message { */ export class PushSoxResamplerRequest extends Message { /** - * @generated from field: required uint64 resampler_handle = 1; + * @generated from field: uint64 resampler_handle = 1; */ - resamplerHandle?: bigint; + resamplerHandle = protoInt64.zero; /** * *const i16 * - * @generated from field: required uint64 data_ptr = 2; + * @generated from field: uint64 data_ptr = 2; */ - dataPtr?: bigint; + dataPtr = protoInt64.zero; /** * in bytes * - * @generated from field: required uint32 size = 3; + * @generated from field: uint32 size = 3; */ - size?: number; + size = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PushSoxResamplerRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PushSoxResamplerRequest { @@ -995,7 +988,7 @@ export class PushSoxResamplerRequest extends Message { } static equals(a: PushSoxResamplerRequest | PlainMessage | undefined, b: PushSoxResamplerRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(PushSoxResamplerRequest, a, b); + return proto3.util.equals(PushSoxResamplerRequest, a, b); } } @@ -1006,16 +999,16 @@ export class PushSoxResamplerResponse extends Message /** * *const i16 (could be null) * - * @generated from field: required uint64 output_ptr = 1; + * @generated from field: uint64 output_ptr = 1; */ - outputPtr?: bigint; + outputPtr = protoInt64.zero; /** * in bytes * - * @generated from field: required uint32 size = 2; + * @generated from field: uint32 size = 2; */ - size?: number; + size = 0; /** * @generated from field: optional string error = 3; @@ -1024,14 +1017,14 @@ export class PushSoxResamplerResponse extends Message constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PushSoxResamplerResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1048,7 +1041,7 @@ export class PushSoxResamplerResponse extends Message } static equals(a: PushSoxResamplerResponse | PlainMessage | undefined, b: PushSoxResamplerResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(PushSoxResamplerResponse, a, b); + return proto3.util.equals(PushSoxResamplerResponse, a, b); } } @@ -1057,19 +1050,19 @@ export class PushSoxResamplerResponse extends Message */ export class FlushSoxResamplerRequest extends Message { /** - * @generated from field: required uint64 resampler_handle = 1; + * @generated from field: uint64 resampler_handle = 1; */ - resamplerHandle?: bigint; + resamplerHandle = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FlushSoxResamplerRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FlushSoxResamplerRequest { @@ -1085,7 +1078,7 @@ export class FlushSoxResamplerRequest extends Message } static equals(a: FlushSoxResamplerRequest | PlainMessage | undefined, b: FlushSoxResamplerRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(FlushSoxResamplerRequest, a, b); + return proto3.util.equals(FlushSoxResamplerRequest, a, b); } } @@ -1096,16 +1089,16 @@ export class FlushSoxResamplerResponse extends Message) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FlushSoxResamplerResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1138,7 +1131,7 @@ export class FlushSoxResamplerResponse extends Message | undefined, b: FlushSoxResamplerResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(FlushSoxResamplerResponse, a, b); + return proto3.util.equals(FlushSoxResamplerResponse, a, b); } } @@ -1149,37 +1142,37 @@ export class AudioFrameBufferInfo extends Message { /** * *const i16 * - * @generated from field: required uint64 data_ptr = 1; + * @generated from field: uint64 data_ptr = 1; */ - dataPtr?: bigint; + dataPtr = protoInt64.zero; /** - * @generated from field: required uint32 num_channels = 2; + * @generated from field: uint32 num_channels = 2; */ - numChannels?: number; + numChannels = 0; /** - * @generated from field: required uint32 sample_rate = 3; + * @generated from field: uint32 sample_rate = 3; */ - sampleRate?: number; + sampleRate = 0; /** - * @generated from field: required uint32 samples_per_channel = 4; + * @generated from field: uint32 samples_per_channel = 4; */ - samplesPerChannel?: number; + samplesPerChannel = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioFrameBufferInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 4, name: "samples_per_channel", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 4, name: "samples_per_channel", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioFrameBufferInfo { @@ -1195,7 +1188,7 @@ export class AudioFrameBufferInfo extends Message { } static equals(a: AudioFrameBufferInfo | PlainMessage | undefined, b: AudioFrameBufferInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioFrameBufferInfo, a, b); + return proto3.util.equals(AudioFrameBufferInfo, a, b); } } @@ -1204,25 +1197,25 @@ export class AudioFrameBufferInfo extends Message { */ export class OwnedAudioFrameBuffer extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.AudioFrameBufferInfo info = 2; + * @generated from field: livekit.proto.AudioFrameBufferInfo info = 2; */ info?: AudioFrameBufferInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedAudioFrameBuffer"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: AudioFrameBufferInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: AudioFrameBufferInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioFrameBuffer { @@ -1238,7 +1231,7 @@ export class OwnedAudioFrameBuffer extends Message { } static equals(a: OwnedAudioFrameBuffer | PlainMessage | undefined, b: OwnedAudioFrameBuffer | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedAudioFrameBuffer, a, b); + return proto3.util.equals(OwnedAudioFrameBuffer, a, b); } } @@ -1247,19 +1240,19 @@ export class OwnedAudioFrameBuffer extends Message { */ export class AudioStreamInfo extends Message { /** - * @generated from field: required livekit.proto.AudioStreamType type = 1; + * @generated from field: livekit.proto.AudioStreamType type = 1; */ - type?: AudioStreamType; + type = AudioStreamType.AUDIO_STREAM_NATIVE; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioStreamInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(AudioStreamType), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(AudioStreamType) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamInfo { @@ -1275,7 +1268,7 @@ export class AudioStreamInfo extends Message { } static equals(a: AudioStreamInfo | PlainMessage | undefined, b: AudioStreamInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioStreamInfo, a, b); + return proto3.util.equals(AudioStreamInfo, a, b); } } @@ -1284,25 +1277,25 @@ export class AudioStreamInfo extends Message { */ export class OwnedAudioStream extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.AudioStreamInfo info = 2; + * @generated from field: livekit.proto.AudioStreamInfo info = 2; */ info?: AudioStreamInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedAudioStream"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: AudioStreamInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: AudioStreamInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioStream { @@ -1318,7 +1311,7 @@ export class OwnedAudioStream extends Message { } static equals(a: OwnedAudioStream | PlainMessage | undefined, b: OwnedAudioStream | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedAudioStream, a, b); + return proto3.util.equals(OwnedAudioStream, a, b); } } @@ -1327,9 +1320,9 @@ export class OwnedAudioStream extends Message { */ export class AudioStreamEvent extends Message { /** - * @generated from field: required uint64 stream_handle = 1; + * @generated from field: uint64 stream_handle = 1; */ - streamHandle?: bigint; + streamHandle = protoInt64.zero; /** * @generated from oneof livekit.proto.AudioStreamEvent.message @@ -1350,13 +1343,13 @@ export class AudioStreamEvent extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioStreamEvent"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "frame_received", kind: "message", T: AudioFrameReceived, oneof: "message" }, { no: 3, name: "eos", kind: "message", T: AudioStreamEOS, oneof: "message" }, ]); @@ -1374,7 +1367,7 @@ export class AudioStreamEvent extends Message { } static equals(a: AudioStreamEvent | PlainMessage | undefined, b: AudioStreamEvent | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioStreamEvent, a, b); + return proto3.util.equals(AudioStreamEvent, a, b); } } @@ -1383,19 +1376,19 @@ export class AudioStreamEvent extends Message { */ export class AudioFrameReceived extends Message { /** - * @generated from field: required livekit.proto.OwnedAudioFrameBuffer frame = 1; + * @generated from field: livekit.proto.OwnedAudioFrameBuffer frame = 1; */ frame?: OwnedAudioFrameBuffer; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioFrameReceived"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "frame", kind: "message", T: OwnedAudioFrameBuffer, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "frame", kind: "message", T: OwnedAudioFrameBuffer }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioFrameReceived { @@ -1411,7 +1404,7 @@ export class AudioFrameReceived extends Message { } static equals(a: AudioFrameReceived | PlainMessage | undefined, b: AudioFrameReceived | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioFrameReceived, a, b); + return proto3.util.equals(AudioFrameReceived, a, b); } } @@ -1421,12 +1414,12 @@ export class AudioFrameReceived extends Message { export class AudioStreamEOS extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioStreamEOS"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamEOS { @@ -1442,7 +1435,7 @@ export class AudioStreamEOS extends Message { } static equals(a: AudioStreamEOS | PlainMessage | undefined, b: AudioStreamEOS | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioStreamEOS, a, b); + return proto3.util.equals(AudioStreamEOS, a, b); } } @@ -1451,31 +1444,31 @@ export class AudioStreamEOS extends Message { */ export class AudioSourceOptions extends Message { /** - * @generated from field: required bool echo_cancellation = 1; + * @generated from field: bool echo_cancellation = 1; */ - echoCancellation?: boolean; + echoCancellation = false; /** - * @generated from field: required bool noise_suppression = 2; + * @generated from field: bool noise_suppression = 2; */ - noiseSuppression?: boolean; + noiseSuppression = false; /** - * @generated from field: required bool auto_gain_control = 3; + * @generated from field: bool auto_gain_control = 3; */ - autoGainControl?: boolean; + autoGainControl = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioSourceOptions"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "echo_cancellation", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 2, name: "noise_suppression", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 3, name: "auto_gain_control", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "echo_cancellation", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "noise_suppression", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "auto_gain_control", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioSourceOptions { @@ -1491,7 +1484,7 @@ export class AudioSourceOptions extends Message { } static equals(a: AudioSourceOptions | PlainMessage | undefined, b: AudioSourceOptions | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioSourceOptions, a, b); + return proto3.util.equals(AudioSourceOptions, a, b); } } @@ -1500,19 +1493,19 @@ export class AudioSourceOptions extends Message { */ export class AudioSourceInfo extends Message { /** - * @generated from field: required livekit.proto.AudioSourceType type = 2; + * @generated from field: livekit.proto.AudioSourceType type = 2; */ - type?: AudioSourceType; + type = AudioSourceType.AUDIO_SOURCE_NATIVE; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioSourceInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(AudioSourceType), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AudioSourceType) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioSourceInfo { @@ -1528,7 +1521,7 @@ export class AudioSourceInfo extends Message { } static equals(a: AudioSourceInfo | PlainMessage | undefined, b: AudioSourceInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioSourceInfo, a, b); + return proto3.util.equals(AudioSourceInfo, a, b); } } @@ -1537,25 +1530,25 @@ export class AudioSourceInfo extends Message { */ export class OwnedAudioSource extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.AudioSourceInfo info = 2; + * @generated from field: livekit.proto.AudioSourceInfo info = 2; */ info?: AudioSourceInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedAudioSource"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: AudioSourceInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: AudioSourceInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioSource { @@ -1571,7 +1564,7 @@ export class OwnedAudioSource extends Message { } static equals(a: OwnedAudioSource | PlainMessage | undefined, b: OwnedAudioSource | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedAudioSource, a, b); + return proto3.util.equals(OwnedAudioSource, a, b); } } @@ -1581,12 +1574,12 @@ export class OwnedAudioSource extends Message { export class AudioResamplerInfo extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioResamplerInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioResamplerInfo { @@ -1602,7 +1595,7 @@ export class AudioResamplerInfo extends Message { } static equals(a: AudioResamplerInfo | PlainMessage | undefined, b: AudioResamplerInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioResamplerInfo, a, b); + return proto3.util.equals(AudioResamplerInfo, a, b); } } @@ -1611,25 +1604,25 @@ export class AudioResamplerInfo extends Message { */ export class OwnedAudioResampler extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.AudioResamplerInfo info = 2; + * @generated from field: livekit.proto.AudioResamplerInfo info = 2; */ info?: AudioResamplerInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedAudioResampler"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: AudioResamplerInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: AudioResamplerInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioResampler { @@ -1645,7 +1638,7 @@ export class OwnedAudioResampler extends Message { } static equals(a: OwnedAudioResampler | PlainMessage | undefined, b: OwnedAudioResampler | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedAudioResampler, a, b); + return proto3.util.equals(OwnedAudioResampler, a, b); } } @@ -1655,12 +1648,12 @@ export class OwnedAudioResampler extends Message { export class SoxResamplerInfo extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SoxResamplerInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): SoxResamplerInfo { @@ -1676,7 +1669,7 @@ export class SoxResamplerInfo extends Message { } static equals(a: SoxResamplerInfo | PlainMessage | undefined, b: SoxResamplerInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(SoxResamplerInfo, a, b); + return proto3.util.equals(SoxResamplerInfo, a, b); } } @@ -1685,25 +1678,25 @@ export class SoxResamplerInfo extends Message { */ export class OwnedSoxResampler extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.SoxResamplerInfo info = 2; + * @generated from field: livekit.proto.SoxResamplerInfo info = 2; */ info?: SoxResamplerInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedSoxResampler"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: SoxResamplerInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: SoxResamplerInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedSoxResampler { @@ -1719,7 +1712,7 @@ export class OwnedSoxResampler extends Message { } static equals(a: OwnedSoxResampler | PlainMessage | undefined, b: OwnedSoxResampler | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedSoxResampler, a, b); + return proto3.util.equals(OwnedSoxResampler, a, b); } } diff --git a/packages/livekit-rtc/src/proto/e2ee_pb.ts b/packages/livekit-rtc/src/proto/e2ee_pb.ts index a82a0787..73601aa1 100644 --- a/packages/livekit-rtc/src/proto/e2ee_pb.ts +++ b/packages/livekit-rtc/src/proto/e2ee_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file e2ee.proto (package livekit.proto, syntax proto2) +// @generated from file e2ee.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; /** * @generated from enum livekit.proto.EncryptionType @@ -39,8 +39,8 @@ export enum EncryptionType { */ CUSTOM = 2, } -// Retrieve enum metadata with: proto2.getEnumType(EncryptionType) -proto2.util.setEnumType(EncryptionType, "livekit.proto.EncryptionType", [ +// Retrieve enum metadata with: proto3.getEnumType(EncryptionType) +proto3.util.setEnumType(EncryptionType, "livekit.proto.EncryptionType", [ { no: 0, name: "NONE" }, { no: 1, name: "GCM" }, { no: 2, name: "CUSTOM" }, @@ -85,8 +85,8 @@ export enum EncryptionState { */ INTERNAL_ERROR = 6, } -// Retrieve enum metadata with: proto2.getEnumType(EncryptionState) -proto2.util.setEnumType(EncryptionState, "livekit.proto.EncryptionState", [ +// Retrieve enum metadata with: proto3.getEnumType(EncryptionState) +proto3.util.setEnumType(EncryptionState, "livekit.proto.EncryptionState", [ { no: 0, name: "NEW" }, { no: 1, name: "OK" }, { no: 2, name: "ENCRYPTION_FAILED" }, @@ -101,37 +101,37 @@ proto2.util.setEnumType(EncryptionState, "livekit.proto.EncryptionState", [ */ export class FrameCryptor extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string track_sid = 2; + * @generated from field: string track_sid = 2; */ - trackSid?: string; + trackSid = ""; /** - * @generated from field: required int32 key_index = 3; + * @generated from field: int32 key_index = 3; */ - keyIndex?: number; + keyIndex = 0; /** - * @generated from field: required bool enabled = 4; + * @generated from field: bool enabled = 4; */ - enabled?: boolean; + enabled = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FrameCryptor"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 4, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { 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: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptor { @@ -147,7 +147,7 @@ export class FrameCryptor extends Message { } static equals(a: FrameCryptor | PlainMessage | undefined, b: FrameCryptor | PlainMessage | undefined): boolean { - return proto2.util.equals(FrameCryptor, a, b); + return proto3.util.equals(FrameCryptor, a, b); } } @@ -163,34 +163,34 @@ export class KeyProviderOptions extends Message { sharedKey?: Uint8Array; /** - * @generated from field: required int32 ratchet_window_size = 2; + * @generated from field: int32 ratchet_window_size = 2; */ - ratchetWindowSize?: number; + ratchetWindowSize = 0; /** - * @generated from field: required bytes ratchet_salt = 3; + * @generated from field: bytes ratchet_salt = 3; */ - ratchetSalt?: Uint8Array; + ratchetSalt = new Uint8Array(0); /** - * -1 = no tolerance + * -1 = no tolerence * - * @generated from field: required int32 failure_tolerance = 4; + * @generated from field: int32 failure_tolerance = 4; */ - failureTolerance?: number; + failureTolerance = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.KeyProviderOptions"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "shared_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - { no: 2, name: "ratchet_window_size", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 3, name: "ratchet_salt", kind: "scalar", T: 12 /* ScalarType.BYTES */, req: true }, - { no: 4, name: "failure_tolerance", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + { no: 2, name: "ratchet_window_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "ratchet_salt", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 4, name: "failure_tolerance", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): KeyProviderOptions { @@ -206,7 +206,7 @@ export class KeyProviderOptions extends Message { } static equals(a: KeyProviderOptions | PlainMessage | undefined, b: KeyProviderOptions | PlainMessage | undefined): boolean { - return proto2.util.equals(KeyProviderOptions, a, b); + return proto3.util.equals(KeyProviderOptions, a, b); } } @@ -215,25 +215,25 @@ export class KeyProviderOptions extends Message { */ export class E2eeOptions extends Message { /** - * @generated from field: required livekit.proto.EncryptionType encryption_type = 1; + * @generated from field: livekit.proto.EncryptionType encryption_type = 1; */ - encryptionType?: EncryptionType; + encryptionType = EncryptionType.NONE; /** - * @generated from field: required livekit.proto.KeyProviderOptions key_provider_options = 2; + * @generated from field: livekit.proto.KeyProviderOptions key_provider_options = 2; */ keyProviderOptions?: KeyProviderOptions; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.E2eeOptions"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "encryption_type", kind: "enum", T: proto2.getEnumType(EncryptionType), req: true }, - { no: 2, name: "key_provider_options", kind: "message", T: KeyProviderOptions, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "encryption_type", kind: "enum", T: proto3.getEnumType(EncryptionType) }, + { no: 2, name: "key_provider_options", kind: "message", T: KeyProviderOptions }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeOptions { @@ -249,7 +249,7 @@ export class E2eeOptions extends Message { } static equals(a: E2eeOptions | PlainMessage | undefined, b: E2eeOptions | PlainMessage | undefined): boolean { - return proto2.util.equals(E2eeOptions, a, b); + return proto3.util.equals(E2eeOptions, a, b); } } @@ -258,19 +258,19 @@ export class E2eeOptions extends Message { */ export class E2eeManagerSetEnabledRequest extends Message { /** - * @generated from field: required bool enabled = 1; + * @generated from field: bool enabled = 1; */ - enabled?: boolean; + enabled = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.E2eeManagerSetEnabledRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerSetEnabledRequest { @@ -286,7 +286,7 @@ export class E2eeManagerSetEnabledRequest extends Message | undefined, b: E2eeManagerSetEnabledRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(E2eeManagerSetEnabledRequest, a, b); + return proto3.util.equals(E2eeManagerSetEnabledRequest, a, b); } } @@ -296,12 +296,12 @@ export class E2eeManagerSetEnabledRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.E2eeManagerSetEnabledResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerSetEnabledResponse { @@ -317,7 +317,7 @@ export class E2eeManagerSetEnabledResponse extends Message | undefined, b: E2eeManagerSetEnabledResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(E2eeManagerSetEnabledResponse, a, b); + return proto3.util.equals(E2eeManagerSetEnabledResponse, a, b); } } @@ -327,12 +327,12 @@ export class E2eeManagerSetEnabledResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.E2eeManagerGetFrameCryptorsRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerGetFrameCryptorsRequest { @@ -348,7 +348,7 @@ export class E2eeManagerGetFrameCryptorsRequest extends Message | undefined, b: E2eeManagerGetFrameCryptorsRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(E2eeManagerGetFrameCryptorsRequest, a, b); + return proto3.util.equals(E2eeManagerGetFrameCryptorsRequest, a, b); } } @@ -363,12 +363,12 @@ export class E2eeManagerGetFrameCryptorsResponse extends Message) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.E2eeManagerGetFrameCryptorsResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "frame_cryptors", kind: "message", T: FrameCryptor, repeated: true }, ]); @@ -385,7 +385,7 @@ export class E2eeManagerGetFrameCryptorsResponse extends Message | undefined, b: E2eeManagerGetFrameCryptorsResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(E2eeManagerGetFrameCryptorsResponse, a, b); + return proto3.util.equals(E2eeManagerGetFrameCryptorsResponse, a, b); } } @@ -394,31 +394,31 @@ export class E2eeManagerGetFrameCryptorsResponse extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string track_sid = 2; + * @generated from field: string track_sid = 2; */ - trackSid?: string; + trackSid = ""; /** - * @generated from field: required bool enabled = 3; + * @generated from field: bool enabled = 3; */ - enabled?: boolean; + enabled = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FrameCryptorSetEnabledRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { 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: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetEnabledRequest { @@ -434,7 +434,7 @@ export class FrameCryptorSetEnabledRequest extends Message | undefined, b: FrameCryptorSetEnabledRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(FrameCryptorSetEnabledRequest, a, b); + return proto3.util.equals(FrameCryptorSetEnabledRequest, a, b); } } @@ -444,12 +444,12 @@ export class FrameCryptorSetEnabledRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FrameCryptorSetEnabledResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetEnabledResponse { @@ -465,7 +465,7 @@ export class FrameCryptorSetEnabledResponse extends Message | undefined, b: FrameCryptorSetEnabledResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(FrameCryptorSetEnabledResponse, a, b); + return proto3.util.equals(FrameCryptorSetEnabledResponse, a, b); } } @@ -474,31 +474,31 @@ export class FrameCryptorSetEnabledResponse extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string track_sid = 2; + * @generated from field: string track_sid = 2; */ - trackSid?: string; + trackSid = ""; /** - * @generated from field: required int32 key_index = 3; + * @generated from field: int32 key_index = 3; */ - keyIndex?: number; + keyIndex = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FrameCryptorSetKeyIndexRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { 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: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetKeyIndexRequest { @@ -514,7 +514,7 @@ export class FrameCryptorSetKeyIndexRequest extends Message | undefined, b: FrameCryptorSetKeyIndexRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(FrameCryptorSetKeyIndexRequest, a, b); + return proto3.util.equals(FrameCryptorSetKeyIndexRequest, a, b); } } @@ -524,12 +524,12 @@ export class FrameCryptorSetKeyIndexRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FrameCryptorSetKeyIndexResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetKeyIndexResponse { @@ -545,7 +545,7 @@ export class FrameCryptorSetKeyIndexResponse extends Message | undefined, b: FrameCryptorSetKeyIndexResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(FrameCryptorSetKeyIndexResponse, a, b); + return proto3.util.equals(FrameCryptorSetKeyIndexResponse, a, b); } } @@ -554,25 +554,25 @@ export class FrameCryptorSetKeyIndexResponse extends Message { /** - * @generated from field: required bytes shared_key = 1; + * @generated from field: bytes shared_key = 1; */ - sharedKey?: Uint8Array; + sharedKey = new Uint8Array(0); /** - * @generated from field: required int32 key_index = 2; + * @generated from field: int32 key_index = 2; */ - keyIndex?: number; + keyIndex = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetSharedKeyRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "shared_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, req: true }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "shared_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetSharedKeyRequest { @@ -588,7 +588,7 @@ export class SetSharedKeyRequest extends Message { } static equals(a: SetSharedKeyRequest | PlainMessage | undefined, b: SetSharedKeyRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(SetSharedKeyRequest, a, b); + return proto3.util.equals(SetSharedKeyRequest, a, b); } } @@ -598,12 +598,12 @@ export class SetSharedKeyRequest extends Message { export class SetSharedKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetSharedKeyResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetSharedKeyResponse { @@ -619,7 +619,7 @@ export class SetSharedKeyResponse extends Message { } static equals(a: SetSharedKeyResponse | PlainMessage | undefined, b: SetSharedKeyResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(SetSharedKeyResponse, a, b); + return proto3.util.equals(SetSharedKeyResponse, a, b); } } @@ -628,19 +628,19 @@ export class SetSharedKeyResponse extends Message { */ export class RatchetSharedKeyRequest extends Message { /** - * @generated from field: required int32 key_index = 1; + * @generated from field: int32 key_index = 1; */ - keyIndex?: number; + keyIndex = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RatchetSharedKeyRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RatchetSharedKeyRequest { @@ -656,7 +656,7 @@ export class RatchetSharedKeyRequest extends Message { } static equals(a: RatchetSharedKeyRequest | PlainMessage | undefined, b: RatchetSharedKeyRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(RatchetSharedKeyRequest, a, b); + return proto3.util.equals(RatchetSharedKeyRequest, a, b); } } @@ -671,12 +671,12 @@ export class RatchetSharedKeyResponse extends Message constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RatchetSharedKeyResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "new_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, ]); @@ -693,7 +693,7 @@ export class RatchetSharedKeyResponse extends Message } static equals(a: RatchetSharedKeyResponse | PlainMessage | undefined, b: RatchetSharedKeyResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(RatchetSharedKeyResponse, a, b); + return proto3.util.equals(RatchetSharedKeyResponse, a, b); } } @@ -702,19 +702,19 @@ export class RatchetSharedKeyResponse extends Message */ export class GetSharedKeyRequest extends Message { /** - * @generated from field: required int32 key_index = 1; + * @generated from field: int32 key_index = 1; */ - keyIndex?: number; + keyIndex = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetSharedKeyRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSharedKeyRequest { @@ -730,7 +730,7 @@ export class GetSharedKeyRequest extends Message { } static equals(a: GetSharedKeyRequest | PlainMessage | undefined, b: GetSharedKeyRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(GetSharedKeyRequest, a, b); + return proto3.util.equals(GetSharedKeyRequest, a, b); } } @@ -745,12 +745,12 @@ export class GetSharedKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetSharedKeyResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, ]); @@ -767,7 +767,7 @@ export class GetSharedKeyResponse extends Message { } static equals(a: GetSharedKeyResponse | PlainMessage | undefined, b: GetSharedKeyResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(GetSharedKeyResponse, a, b); + return proto3.util.equals(GetSharedKeyResponse, a, b); } } @@ -776,31 +776,31 @@ export class GetSharedKeyResponse extends Message { */ export class SetKeyRequest extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required bytes key = 2; + * @generated from field: bytes key = 2; */ - key?: Uint8Array; + key = new Uint8Array(0); /** - * @generated from field: required int32 key_index = 3; + * @generated from field: int32 key_index = 3; */ - keyIndex?: number; + keyIndex = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetKeyRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */, req: true }, - { no: 3, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 3, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetKeyRequest { @@ -816,7 +816,7 @@ export class SetKeyRequest extends Message { } static equals(a: SetKeyRequest | PlainMessage | undefined, b: SetKeyRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(SetKeyRequest, a, b); + return proto3.util.equals(SetKeyRequest, a, b); } } @@ -826,12 +826,12 @@ export class SetKeyRequest extends Message { export class SetKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetKeyResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetKeyResponse { @@ -847,7 +847,7 @@ export class SetKeyResponse extends Message { } static equals(a: SetKeyResponse | PlainMessage | undefined, b: SetKeyResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(SetKeyResponse, a, b); + return proto3.util.equals(SetKeyResponse, a, b); } } @@ -856,25 +856,25 @@ export class SetKeyResponse extends Message { */ export class RatchetKeyRequest extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required int32 key_index = 2; + * @generated from field: int32 key_index = 2; */ - keyIndex?: number; + keyIndex = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RatchetKeyRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RatchetKeyRequest { @@ -890,7 +890,7 @@ export class RatchetKeyRequest extends Message { } static equals(a: RatchetKeyRequest | PlainMessage | undefined, b: RatchetKeyRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(RatchetKeyRequest, a, b); + return proto3.util.equals(RatchetKeyRequest, a, b); } } @@ -905,12 +905,12 @@ export class RatchetKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RatchetKeyResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "new_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, ]); @@ -927,7 +927,7 @@ export class RatchetKeyResponse extends Message { } static equals(a: RatchetKeyResponse | PlainMessage | undefined, b: RatchetKeyResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(RatchetKeyResponse, a, b); + return proto3.util.equals(RatchetKeyResponse, a, b); } } @@ -936,25 +936,25 @@ export class RatchetKeyResponse extends Message { */ export class GetKeyRequest extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required int32 key_index = 2; + * @generated from field: int32 key_index = 2; */ - keyIndex?: number; + keyIndex = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetKeyRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetKeyRequest { @@ -970,7 +970,7 @@ export class GetKeyRequest extends Message { } static equals(a: GetKeyRequest | PlainMessage | undefined, b: GetKeyRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(GetKeyRequest, a, b); + return proto3.util.equals(GetKeyRequest, a, b); } } @@ -985,12 +985,12 @@ export class GetKeyResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetKeyResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, ]); @@ -1007,7 +1007,7 @@ export class GetKeyResponse extends Message { } static equals(a: GetKeyResponse | PlainMessage | undefined, b: GetKeyResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(GetKeyResponse, a, b); + return proto3.util.equals(GetKeyResponse, a, b); } } @@ -1016,9 +1016,9 @@ export class GetKeyResponse extends Message { */ export class E2eeRequest extends Message { /** - * @generated from field: required uint64 room_handle = 1; + * @generated from field: uint64 room_handle = 1; */ - roomHandle?: bigint; + roomHandle = protoInt64.zero; /** * @generated from oneof livekit.proto.E2eeRequest.message @@ -1087,13 +1087,13 @@ export class E2eeRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.E2eeRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "manager_set_enabled", kind: "message", T: E2eeManagerSetEnabledRequest, oneof: "message" }, { no: 3, name: "manager_get_frame_cryptors", kind: "message", T: E2eeManagerGetFrameCryptorsRequest, oneof: "message" }, { no: 4, name: "cryptor_set_enabled", kind: "message", T: FrameCryptorSetEnabledRequest, oneof: "message" }, @@ -1119,7 +1119,7 @@ export class E2eeRequest extends Message { } static equals(a: E2eeRequest | PlainMessage | undefined, b: E2eeRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(E2eeRequest, a, b); + return proto3.util.equals(E2eeRequest, a, b); } } @@ -1194,12 +1194,12 @@ export class E2eeResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.E2eeResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "manager_set_enabled", kind: "message", T: E2eeManagerSetEnabledResponse, oneof: "message" }, { no: 2, name: "manager_get_frame_cryptors", kind: "message", T: E2eeManagerGetFrameCryptorsResponse, oneof: "message" }, { no: 3, name: "cryptor_set_enabled", kind: "message", T: FrameCryptorSetEnabledResponse, oneof: "message" }, @@ -1225,7 +1225,7 @@ export class E2eeResponse extends Message { } static equals(a: E2eeResponse | PlainMessage | undefined, b: E2eeResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(E2eeResponse, a, b); + return proto3.util.equals(E2eeResponse, a, b); } } diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index 510eea1c..1270492b 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file ffi.proto (package livekit.proto, syntax proto2) +// @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, proto2 } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { ConnectCallback, ConnectRequest, ConnectResponse, DisconnectCallback, DisconnectRequest, DisconnectResponse, EditChatMessageRequest, GetSessionStatsCallback, GetSessionStatsRequest, GetSessionStatsResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishSipDtmfCallback, PublishSipDtmfRequest, PublishSipDtmfResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, PublishTranscriptionCallback, PublishTranscriptionRequest, PublishTranscriptionResponse, RoomEvent, SendChatMessageCallback, SendChatMessageRequest, SendChatMessageResponse, SetLocalAttributesCallback, SetLocalAttributesRequest, SetLocalAttributesResponse, SetLocalMetadataCallback, SetLocalMetadataRequest, SetLocalMetadataResponse, SetLocalNameCallback, SetLocalNameRequest, SetLocalNameResponse, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse } from "./room_pb.js"; import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, EnableRemoteTrackRequest, EnableRemoteTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, LocalTrackMuteRequest, LocalTrackMuteResponse, TrackEvent } from "./track_pb.js"; import { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb.js"; @@ -55,8 +55,8 @@ export enum LogLevel { */ LOG_TRACE = 4, } -// Retrieve enum metadata with: proto2.getEnumType(LogLevel) -proto2.util.setEnumType(LogLevel, "livekit.proto.LogLevel", [ +// Retrieve enum metadata with: proto3.getEnumType(LogLevel) +proto3.util.setEnumType(LogLevel, "livekit.proto.LogLevel", [ { no: 0, name: "LOG_ERROR" }, { no: 1, name: "LOG_WARN" }, { no: 2, name: "LOG_INFO" }, @@ -328,12 +328,12 @@ export class FfiRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FfiRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 2, name: "dispose", kind: "message", T: DisposeRequest, oneof: "message" }, { no: 3, name: "connect", kind: "message", T: ConnectRequest, oneof: "message" }, { no: 4, name: "disconnect", kind: "message", T: DisconnectRequest, oneof: "message" }, @@ -389,7 +389,7 @@ export class FfiRequest extends Message { } static equals(a: FfiRequest | PlainMessage | undefined, b: FfiRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(FfiRequest, a, b); + return proto3.util.equals(FfiRequest, a, b); } } @@ -650,12 +650,12 @@ export class FfiResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FfiResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 2, name: "dispose", kind: "message", T: DisposeResponse, oneof: "message" }, { no: 3, name: "connect", kind: "message", T: ConnectResponse, oneof: "message" }, { no: 4, name: "disconnect", kind: "message", T: DisconnectResponse, oneof: "message" }, @@ -710,7 +710,7 @@ export class FfiResponse extends Message { } static equals(a: FfiResponse | PlainMessage | undefined, b: FfiResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(FfiResponse, a, b); + return proto3.util.equals(FfiResponse, a, b); } } @@ -885,12 +885,12 @@ export class FfiEvent extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FfiEvent"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "room_event", kind: "message", T: RoomEvent, oneof: "message" }, { no: 2, name: "track_event", kind: "message", T: TrackEvent, oneof: "message" }, { no: 3, name: "video_stream_event", kind: "message", T: VideoStreamEvent, oneof: "message" }, @@ -932,7 +932,7 @@ export class FfiEvent extends Message { } static equals(a: FfiEvent | PlainMessage | undefined, b: FfiEvent | PlainMessage | undefined): boolean { - return proto2.util.equals(FfiEvent, a, b); + return proto3.util.equals(FfiEvent, a, b); } } @@ -945,19 +945,19 @@ export class FfiEvent extends Message { */ export class DisposeRequest extends Message { /** - * @generated from field: required bool async = 1; + * @generated from field: bool async = 1; */ - async?: boolean; + async = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.DisposeRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisposeRequest { @@ -973,7 +973,7 @@ export class DisposeRequest extends Message { } static equals(a: DisposeRequest | PlainMessage | undefined, b: DisposeRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(DisposeRequest, a, b); + return proto3.util.equals(DisposeRequest, a, b); } } @@ -990,12 +990,12 @@ export class DisposeResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.DisposeResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, ]); @@ -1012,7 +1012,7 @@ export class DisposeResponse extends Message { } static equals(a: DisposeResponse | PlainMessage | undefined, b: DisposeResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(DisposeResponse, a, b); + return proto3.util.equals(DisposeResponse, a, b); } } @@ -1021,19 +1021,19 @@ export class DisposeResponse extends Message { */ export class DisposeCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.DisposeCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisposeCallback { @@ -1049,7 +1049,7 @@ export class DisposeCallback extends Message { } static equals(a: DisposeCallback | PlainMessage | undefined, b: DisposeCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(DisposeCallback, a, b); + return proto3.util.equals(DisposeCallback, a, b); } } @@ -1058,16 +1058,16 @@ export class DisposeCallback extends Message { */ export class LogRecord extends Message { /** - * @generated from field: required livekit.proto.LogLevel level = 1; + * @generated from field: livekit.proto.LogLevel level = 1; */ - level?: LogLevel; + level = LogLevel.LOG_ERROR; /** * e.g "livekit", "libwebrtc", "tokio-tungstenite", etc... * - * @generated from field: required string target = 2; + * @generated from field: string target = 2; */ - target?: string; + target = ""; /** * @generated from field: optional string module_path = 3; @@ -1085,24 +1085,24 @@ export class LogRecord extends Message { line?: number; /** - * @generated from field: required string message = 6; + * @generated from field: string message = 6; */ - message?: string; + message = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.LogRecord"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "level", kind: "enum", T: proto2.getEnumType(LogLevel), req: true }, - { no: 2, name: "target", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "level", kind: "enum", T: proto3.getEnumType(LogLevel) }, + { no: 2, name: "target", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "module_path", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 4, name: "file", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 5, name: "line", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, - { no: 6, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 6, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LogRecord { @@ -1118,7 +1118,7 @@ export class LogRecord extends Message { } static equals(a: LogRecord | PlainMessage | undefined, b: LogRecord | PlainMessage | undefined): boolean { - return proto2.util.equals(LogRecord, a, b); + return proto3.util.equals(LogRecord, a, b); } } @@ -1133,12 +1133,12 @@ export class LogBatch extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.LogBatch"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "records", kind: "message", T: LogRecord, repeated: true }, ]); @@ -1155,7 +1155,7 @@ export class LogBatch extends Message { } static equals(a: LogBatch | PlainMessage | undefined, b: LogBatch | PlainMessage | undefined): boolean { - return proto2.util.equals(LogBatch, a, b); + return proto3.util.equals(LogBatch, a, b); } } @@ -1164,19 +1164,19 @@ export class LogBatch extends Message { */ export class Panic extends Message { /** - * @generated from field: required string message = 1; + * @generated from field: string message = 1; */ - message?: string; + message = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.Panic"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Panic { @@ -1192,7 +1192,7 @@ export class Panic extends Message { } static equals(a: Panic | PlainMessage | undefined, b: Panic | PlainMessage | undefined): boolean { - return proto2.util.equals(Panic, a, b); + return proto3.util.equals(Panic, a, b); } } diff --git a/packages/livekit-rtc/src/proto/handle_pb.ts b/packages/livekit-rtc/src/proto/handle_pb.ts index cb39d0ea..cbb0bcef 100644 --- a/packages/livekit-rtc/src/proto/handle_pb.ts +++ b/packages/livekit-rtc/src/proto/handle_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file handle.proto (package livekit.proto, syntax proto2) +// @generated from file handle.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; /** * # Safety @@ -35,19 +35,19 @@ import { Message, proto2 } from "@bufbuild/protobuf"; */ export class FfiOwnedHandle extends Message { /** - * @generated from field: required uint64 id = 1; + * @generated from field: uint64 id = 1; */ - id?: bigint; + id = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.FfiOwnedHandle"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): FfiOwnedHandle { @@ -63,7 +63,7 @@ export class FfiOwnedHandle extends Message { } static equals(a: FfiOwnedHandle | PlainMessage | undefined, b: FfiOwnedHandle | PlainMessage | undefined): boolean { - return proto2.util.equals(FfiOwnedHandle, a, b); + return proto3.util.equals(FfiOwnedHandle, a, b); } } diff --git a/packages/livekit-rtc/src/proto/participant_pb.ts b/packages/livekit-rtc/src/proto/participant_pb.ts index f7105042..c0d03f9a 100644 --- a/packages/livekit-rtc/src/proto/participant_pb.ts +++ b/packages/livekit-rtc/src/proto/participant_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file participant.proto (package livekit.proto, syntax proto2) +// @generated from file participant.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; import { FfiOwnedHandle } from "./handle_pb.js"; /** @@ -50,8 +50,8 @@ export enum ParticipantKind { */ AGENT = 4, } -// Retrieve enum metadata with: proto2.getEnumType(ParticipantKind) -proto2.util.setEnumType(ParticipantKind, "livekit.proto.ParticipantKind", [ +// Retrieve enum metadata with: proto3.getEnumType(ParticipantKind) +proto3.util.setEnumType(ParticipantKind, "livekit.proto.ParticipantKind", [ { no: 0, name: "PARTICIPANT_KIND_STANDARD" }, { no: 1, name: "PARTICIPANT_KIND_INGRESS" }, { no: 2, name: "PARTICIPANT_KIND_EGRESS" }, @@ -64,24 +64,24 @@ proto2.util.setEnumType(ParticipantKind, "livekit.proto.ParticipantKind", [ */ export class ParticipantInfo extends Message { /** - * @generated from field: required string sid = 1; + * @generated from field: string sid = 1; */ - sid?: string; + sid = ""; /** - * @generated from field: required string name = 2; + * @generated from field: string name = 2; */ - name?: string; + name = ""; /** - * @generated from field: required string identity = 3; + * @generated from field: string identity = 3; */ - identity?: string; + identity = ""; /** - * @generated from field: required string metadata = 4; + * @generated from field: string metadata = 4; */ - metadata?: string; + metadata = ""; /** * @generated from field: map attributes = 5; @@ -89,24 +89,24 @@ export class ParticipantInfo extends Message { attributes: { [key: string]: string } = {}; /** - * @generated from field: required livekit.proto.ParticipantKind kind = 6; + * @generated from field: livekit.proto.ParticipantKind kind = 6; */ - kind?: ParticipantKind; + kind = ParticipantKind.STANDARD; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ParticipantInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 4, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { 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 */} }, - { no: 6, name: "kind", kind: "enum", T: proto2.getEnumType(ParticipantKind), req: true }, + { no: 6, name: "kind", kind: "enum", T: proto3.getEnumType(ParticipantKind) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantInfo { @@ -122,7 +122,7 @@ export class ParticipantInfo extends Message { } static equals(a: ParticipantInfo | PlainMessage | undefined, b: ParticipantInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(ParticipantInfo, a, b); + return proto3.util.equals(ParticipantInfo, a, b); } } @@ -131,25 +131,25 @@ export class ParticipantInfo extends Message { */ export class OwnedParticipant extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.ParticipantInfo info = 2; + * @generated from field: livekit.proto.ParticipantInfo info = 2; */ info?: ParticipantInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedParticipant"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: ParticipantInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: ParticipantInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedParticipant { @@ -165,7 +165,7 @@ export class OwnedParticipant extends Message { } static equals(a: OwnedParticipant | PlainMessage | undefined, b: OwnedParticipant | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedParticipant, a, b); + return proto3.util.equals(OwnedParticipant, a, b); } } diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index 8e4e99e2..219f431c 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file room.proto (package livekit.proto, syntax proto2) +// @generated from file room.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { OwnedParticipant } from "./participant_pb.js"; import { OwnedTrack, OwnedTrackPublication, TrackSource } from "./track_pb.js"; import { RtcStats } from "./stats_pb.js"; @@ -45,8 +45,8 @@ export enum IceTransportType { */ TRANSPORT_ALL = 2, } -// Retrieve enum metadata with: proto2.getEnumType(IceTransportType) -proto2.util.setEnumType(IceTransportType, "livekit.proto.IceTransportType", [ +// Retrieve enum metadata with: proto3.getEnumType(IceTransportType) +proto3.util.setEnumType(IceTransportType, "livekit.proto.IceTransportType", [ { no: 0, name: "TRANSPORT_RELAY" }, { no: 1, name: "TRANSPORT_NOHOST" }, { no: 2, name: "TRANSPORT_ALL" }, @@ -66,8 +66,8 @@ export enum ContinualGatheringPolicy { */ GATHER_CONTINUALLY = 1, } -// Retrieve enum metadata with: proto2.getEnumType(ContinualGatheringPolicy) -proto2.util.setEnumType(ContinualGatheringPolicy, "livekit.proto.ContinualGatheringPolicy", [ +// Retrieve enum metadata with: proto3.getEnumType(ContinualGatheringPolicy) +proto3.util.setEnumType(ContinualGatheringPolicy, "livekit.proto.ContinualGatheringPolicy", [ { no: 0, name: "GATHER_ONCE" }, { no: 1, name: "GATHER_CONTINUALLY" }, ]); @@ -96,8 +96,8 @@ export enum ConnectionQuality { */ QUALITY_LOST = 3, } -// Retrieve enum metadata with: proto2.getEnumType(ConnectionQuality) -proto2.util.setEnumType(ConnectionQuality, "livekit.proto.ConnectionQuality", [ +// Retrieve enum metadata with: proto3.getEnumType(ConnectionQuality) +proto3.util.setEnumType(ConnectionQuality, "livekit.proto.ConnectionQuality", [ { no: 0, name: "QUALITY_POOR" }, { no: 1, name: "QUALITY_GOOD" }, { no: 2, name: "QUALITY_EXCELLENT" }, @@ -123,8 +123,8 @@ export enum ConnectionState { */ CONN_RECONNECTING = 2, } -// Retrieve enum metadata with: proto2.getEnumType(ConnectionState) -proto2.util.setEnumType(ConnectionState, "livekit.proto.ConnectionState", [ +// Retrieve enum metadata with: proto3.getEnumType(ConnectionState) +proto3.util.setEnumType(ConnectionState, "livekit.proto.ConnectionState", [ { no: 0, name: "CONN_DISCONNECTED" }, { no: 1, name: "CONN_CONNECTED" }, { no: 2, name: "CONN_RECONNECTING" }, @@ -144,8 +144,8 @@ export enum DataPacketKind { */ KIND_RELIABLE = 1, } -// Retrieve enum metadata with: proto2.getEnumType(DataPacketKind) -proto2.util.setEnumType(DataPacketKind, "livekit.proto.DataPacketKind", [ +// Retrieve enum metadata with: proto3.getEnumType(DataPacketKind) +proto3.util.setEnumType(DataPacketKind, "livekit.proto.DataPacketKind", [ { no: 0, name: "KIND_LOSSY" }, { no: 1, name: "KIND_RELIABLE" }, ]); @@ -229,8 +229,8 @@ export enum DisconnectReason { */ ROOM_CLOSED = 10, } -// Retrieve enum metadata with: proto2.getEnumType(DisconnectReason) -proto2.util.setEnumType(DisconnectReason, "livekit.proto.DisconnectReason", [ +// Retrieve enum metadata with: proto3.getEnumType(DisconnectReason) +proto3.util.setEnumType(DisconnectReason, "livekit.proto.DisconnectReason", [ { no: 0, name: "UNKNOWN_REASON" }, { no: 1, name: "CLIENT_INITIATED" }, { no: 2, name: "DUPLICATE_IDENTITY" }, @@ -251,31 +251,31 @@ proto2.util.setEnumType(DisconnectReason, "livekit.proto.DisconnectReason", [ */ export class ConnectRequest extends Message { /** - * @generated from field: required string url = 1; + * @generated from field: string url = 1; */ - url?: string; + url = ""; /** - * @generated from field: required string token = 2; + * @generated from field: string token = 2; */ - token?: string; + token = ""; /** - * @generated from field: required livekit.proto.RoomOptions options = 3; + * @generated from field: livekit.proto.RoomOptions options = 3; */ options?: RoomOptions; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ConnectRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "options", kind: "message", T: RoomOptions, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "options", kind: "message", T: RoomOptions }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectRequest { @@ -291,7 +291,7 @@ export class ConnectRequest extends Message { } static equals(a: ConnectRequest | PlainMessage | undefined, b: ConnectRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(ConnectRequest, a, b); + return proto3.util.equals(ConnectRequest, a, b); } } @@ -300,19 +300,19 @@ export class ConnectRequest extends Message { */ export class ConnectResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ConnectResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectResponse { @@ -328,7 +328,7 @@ export class ConnectResponse extends Message { } static equals(a: ConnectResponse | PlainMessage | undefined, b: ConnectResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(ConnectResponse, a, b); + return proto3.util.equals(ConnectResponse, a, b); } } @@ -337,38 +337,43 @@ export class ConnectResponse extends Message { */ export class ConnectCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** - * @generated from oneof livekit.proto.ConnectCallback.message + * @generated from field: optional string error = 2; */ - message: { - /** - * @generated from field: string error = 2; - */ - value: string; - case: "error"; - } | { - /** - * @generated from field: livekit.proto.ConnectCallback.Result result = 3; - */ - value: ConnectCallback_Result; - case: "result"; - } | { case: undefined; value?: undefined } = { case: undefined }; + error?: string; + + /** + * @generated from field: livekit.proto.OwnedRoom room = 3; + */ + room?: OwnedRoom; + + /** + * @generated from field: livekit.proto.OwnedParticipant local_participant = 4; + */ + localParticipant?: OwnedParticipant; + + /** + * @generated from field: repeated livekit.proto.ConnectCallback.ParticipantWithTracks participants = 5; + */ + participants: ConnectCallback_ParticipantWithTracks[] = []; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ConnectCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, - { no: 3, name: "result", kind: "message", T: ConnectCallback_Result, oneof: "message" }, + 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 }, + { no: 3, name: "room", kind: "message", T: OwnedRoom }, + { no: 4, name: "local_participant", kind: "message", T: OwnedParticipant }, + { no: 5, name: "participants", kind: "message", T: ConnectCallback_ParticipantWithTracks, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectCallback { @@ -384,7 +389,7 @@ export class ConnectCallback extends Message { } static equals(a: ConnectCallback | PlainMessage | undefined, b: ConnectCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(ConnectCallback, a, b); + return proto3.util.equals(ConnectCallback, a, b); } } @@ -393,7 +398,7 @@ export class ConnectCallback extends Message { */ export class ConnectCallback_ParticipantWithTracks extends Message { /** - * @generated from field: required livekit.proto.OwnedParticipant participant = 1; + * @generated from field: livekit.proto.OwnedParticipant participant = 1; */ participant?: OwnedParticipant; @@ -407,13 +412,13 @@ export class ConnectCallback_ParticipantWithTracks extends Message) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ConnectCallback.ParticipantWithTracks"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant", kind: "message", T: OwnedParticipant, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant", kind: "message", T: OwnedParticipant }, { no: 2, name: "publications", kind: "message", T: OwnedTrackPublication, repeated: true }, ]); @@ -430,56 +435,7 @@ export class ConnectCallback_ParticipantWithTracks extends Message | undefined, b: ConnectCallback_ParticipantWithTracks | PlainMessage | undefined): boolean { - return proto2.util.equals(ConnectCallback_ParticipantWithTracks, a, b); - } -} - -/** - * @generated from message livekit.proto.ConnectCallback.Result - */ -export class ConnectCallback_Result extends Message { - /** - * @generated from field: required livekit.proto.OwnedRoom room = 1; - */ - room?: OwnedRoom; - - /** - * @generated from field: required livekit.proto.OwnedParticipant local_participant = 2; - */ - localParticipant?: OwnedParticipant; - - /** - * @generated from field: repeated livekit.proto.ConnectCallback.ParticipantWithTracks participants = 3; - */ - participants: ConnectCallback_ParticipantWithTracks[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "livekit.proto.ConnectCallback.Result"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "room", kind: "message", T: OwnedRoom, req: true }, - { no: 2, name: "local_participant", kind: "message", T: OwnedParticipant, req: true }, - { no: 3, name: "participants", kind: "message", T: ConnectCallback_ParticipantWithTracks, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ConnectCallback_Result { - return new ConnectCallback_Result().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ConnectCallback_Result { - return new ConnectCallback_Result().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ConnectCallback_Result { - return new ConnectCallback_Result().fromJsonString(jsonString, options); - } - - static equals(a: ConnectCallback_Result | PlainMessage | undefined, b: ConnectCallback_Result | PlainMessage | undefined): boolean { - return proto2.util.equals(ConnectCallback_Result, a, b); + return proto3.util.equals(ConnectCallback_ParticipantWithTracks, a, b); } } @@ -490,19 +446,19 @@ export class ConnectCallback_Result extends Message { */ export class DisconnectRequest extends Message { /** - * @generated from field: required uint64 room_handle = 1; + * @generated from field: uint64 room_handle = 1; */ - roomHandle?: bigint; + roomHandle = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.DisconnectRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisconnectRequest { @@ -518,7 +474,7 @@ export class DisconnectRequest extends Message { } static equals(a: DisconnectRequest | PlainMessage | undefined, b: DisconnectRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(DisconnectRequest, a, b); + return proto3.util.equals(DisconnectRequest, a, b); } } @@ -527,19 +483,19 @@ export class DisconnectRequest extends Message { */ export class DisconnectResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.DisconnectResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisconnectResponse { @@ -555,7 +511,7 @@ export class DisconnectResponse extends Message { } static equals(a: DisconnectResponse | PlainMessage | undefined, b: DisconnectResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(DisconnectResponse, a, b); + return proto3.util.equals(DisconnectResponse, a, b); } } @@ -564,19 +520,19 @@ export class DisconnectResponse extends Message { */ export class DisconnectCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.DisconnectCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DisconnectCallback { @@ -592,7 +548,7 @@ export class DisconnectCallback extends Message { } static equals(a: DisconnectCallback | PlainMessage | undefined, b: DisconnectCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(DisconnectCallback, a, b); + return proto3.util.equals(DisconnectCallback, a, b); } } @@ -603,31 +559,31 @@ export class DisconnectCallback extends Message { */ export class PublishTrackRequest extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: required uint64 track_handle = 2; + * @generated from field: uint64 track_handle = 2; */ - trackHandle?: bigint; + trackHandle = protoInt64.zero; /** - * @generated from field: required livekit.proto.TrackPublishOptions options = 3; + * @generated from field: livekit.proto.TrackPublishOptions options = 3; */ options?: TrackPublishOptions; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishTrackRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 3, name: "options", kind: "message", T: TrackPublishOptions, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 3, name: "options", kind: "message", T: TrackPublishOptions }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishTrackRequest { @@ -643,7 +599,7 @@ export class PublishTrackRequest extends Message { } static equals(a: PublishTrackRequest | PlainMessage | undefined, b: PublishTrackRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishTrackRequest, a, b); + return proto3.util.equals(PublishTrackRequest, a, b); } } @@ -652,19 +608,19 @@ export class PublishTrackRequest extends Message { */ export class PublishTrackResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishTrackResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishTrackResponse { @@ -680,7 +636,7 @@ export class PublishTrackResponse extends Message { } static equals(a: PublishTrackResponse | PlainMessage | undefined, b: PublishTrackResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishTrackResponse, a, b); + return proto3.util.equals(PublishTrackResponse, a, b); } } @@ -689,38 +645,31 @@ export class PublishTrackResponse extends Message { */ export class PublishTrackCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** - * @generated from oneof livekit.proto.PublishTrackCallback.message + * @generated from field: optional string error = 2; */ - message: { - /** - * @generated from field: string error = 2; - */ - value: string; - case: "error"; - } | { - /** - * @generated from field: livekit.proto.OwnedTrackPublication publication = 3; - */ - value: OwnedTrackPublication; - case: "publication"; - } | { case: undefined; value?: undefined } = { case: undefined }; + error?: string; + + /** + * @generated from field: livekit.proto.OwnedTrackPublication publication = 3; + */ + publication?: OwnedTrackPublication; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishTrackCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, - { no: 3, name: "publication", kind: "message", T: OwnedTrackPublication, oneof: "message" }, + 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 }, + { no: 3, name: "publication", kind: "message", T: OwnedTrackPublication }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishTrackCallback { @@ -736,7 +685,7 @@ export class PublishTrackCallback extends Message { } static equals(a: PublishTrackCallback | PlainMessage | undefined, b: PublishTrackCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishTrackCallback, a, b); + return proto3.util.equals(PublishTrackCallback, a, b); } } @@ -747,31 +696,31 @@ export class PublishTrackCallback extends Message { */ export class UnpublishTrackRequest extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: required string track_sid = 2; + * @generated from field: string track_sid = 2; */ - trackSid?: string; + trackSid = ""; /** - * @generated from field: required bool stop_on_unpublish = 3; + * @generated from field: bool stop_on_unpublish = 3; */ - stopOnUnpublish?: boolean; + stopOnUnpublish = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.UnpublishTrackRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "stop_on_unpublish", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "stop_on_unpublish", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): UnpublishTrackRequest { @@ -787,7 +736,7 @@ export class UnpublishTrackRequest extends Message { } static equals(a: UnpublishTrackRequest | PlainMessage | undefined, b: UnpublishTrackRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(UnpublishTrackRequest, a, b); + return proto3.util.equals(UnpublishTrackRequest, a, b); } } @@ -796,19 +745,19 @@ export class UnpublishTrackRequest extends Message { */ export class UnpublishTrackResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.UnpublishTrackResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): UnpublishTrackResponse { @@ -824,7 +773,7 @@ export class UnpublishTrackResponse extends Message { } static equals(a: UnpublishTrackResponse | PlainMessage | undefined, b: UnpublishTrackResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(UnpublishTrackResponse, a, b); + return proto3.util.equals(UnpublishTrackResponse, a, b); } } @@ -833,9 +782,9 @@ export class UnpublishTrackResponse extends Message { */ export class UnpublishTrackCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** * @generated from field: optional string error = 2; @@ -844,13 +793,13 @@ export class UnpublishTrackCallback extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.UnpublishTrackCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 }, ]); @@ -867,7 +816,7 @@ export class UnpublishTrackCallback extends Message { } static equals(a: UnpublishTrackCallback | PlainMessage | undefined, b: UnpublishTrackCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(UnpublishTrackCallback, a, b); + return proto3.util.equals(UnpublishTrackCallback, a, b); } } @@ -878,24 +827,24 @@ export class UnpublishTrackCallback extends Message { */ export class PublishDataRequest extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: required uint64 data_ptr = 2; + * @generated from field: uint64 data_ptr = 2; */ - dataPtr?: bigint; + dataPtr = protoInt64.zero; /** - * @generated from field: required uint64 data_len = 3; + * @generated from field: uint64 data_len = 3; */ - dataLen?: bigint; + dataLen = protoInt64.zero; /** - * @generated from field: required bool reliable = 4; + * @generated from field: bool reliable = 4; */ - reliable?: boolean; + reliable = false; /** * @generated from field: repeated string destination_sids = 5 [deprecated = true]; @@ -915,16 +864,16 @@ export class PublishDataRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishDataRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 3, name: "data_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 4, name: "reliable", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { 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: "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 }, @@ -943,7 +892,7 @@ export class PublishDataRequest extends Message { } static equals(a: PublishDataRequest | PlainMessage | undefined, b: PublishDataRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishDataRequest, a, b); + return proto3.util.equals(PublishDataRequest, a, b); } } @@ -952,19 +901,19 @@ export class PublishDataRequest extends Message { */ export class PublishDataResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishDataResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PublishDataResponse { @@ -980,7 +929,7 @@ export class PublishDataResponse extends Message { } static equals(a: PublishDataResponse | PlainMessage | undefined, b: PublishDataResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishDataResponse, a, b); + return proto3.util.equals(PublishDataResponse, a, b); } } @@ -989,9 +938,9 @@ export class PublishDataResponse extends Message { */ export class PublishDataCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** * @generated from field: optional string error = 2; @@ -1000,13 +949,13 @@ export class PublishDataCallback extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishDataCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 }, ]); @@ -1023,7 +972,7 @@ export class PublishDataCallback extends Message { } static equals(a: PublishDataCallback | PlainMessage | undefined, b: PublishDataCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishDataCallback, a, b); + return proto3.util.equals(PublishDataCallback, a, b); } } @@ -1034,19 +983,19 @@ export class PublishDataCallback extends Message { */ export class PublishTranscriptionRequest extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: required string participant_identity = 2; + * @generated from field: string participant_identity = 2; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string track_id = 3; + * @generated from field: string track_id = 3; */ - trackId?: string; + trackId = ""; /** * @generated from field: repeated livekit.proto.TranscriptionSegment segments = 4; @@ -1055,15 +1004,15 @@ export class PublishTranscriptionRequest extends Message) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishTranscriptionRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "track_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + 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 }, ]); @@ -1080,7 +1029,7 @@ export class PublishTranscriptionRequest extends Message | undefined, b: PublishTranscriptionRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishTranscriptionRequest, a, b); + return proto3.util.equals(PublishTranscriptionRequest, a, b); } } @@ -1089,19 +1038,19 @@ export class PublishTranscriptionRequest extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishTranscriptionResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 { @@ -1117,7 +1066,7 @@ export class PublishTranscriptionResponse extends Message | undefined, b: PublishTranscriptionResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishTranscriptionResponse, a, b); + return proto3.util.equals(PublishTranscriptionResponse, a, b); } } @@ -1126,9 +1075,9 @@ export class PublishTranscriptionResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** * @generated from field: optional string error = 2; @@ -1137,13 +1086,13 @@ export class PublishTranscriptionCallback extends Message) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishTranscriptionCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 }, ]); @@ -1160,7 +1109,7 @@ export class PublishTranscriptionCallback extends Message | undefined, b: PublishTranscriptionCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishTranscriptionCallback, a, b); + return proto3.util.equals(PublishTranscriptionCallback, a, b); } } @@ -1171,19 +1120,19 @@ export class PublishTranscriptionCallback extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: required uint32 code = 2; + * @generated from field: uint32 code = 2; */ - code?: number; + code = 0; /** - * @generated from field: required string digit = 3; + * @generated from field: string digit = 3; */ - digit?: string; + digit = ""; /** * @generated from field: repeated string destination_identities = 4; @@ -1192,15 +1141,15 @@ export class PublishSipDtmfRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishSipDtmfRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 3, name: "digit", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + 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 }, ]); @@ -1217,7 +1166,7 @@ export class PublishSipDtmfRequest extends Message { } static equals(a: PublishSipDtmfRequest | PlainMessage | undefined, b: PublishSipDtmfRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishSipDtmfRequest, a, b); + return proto3.util.equals(PublishSipDtmfRequest, a, b); } } @@ -1226,19 +1175,19 @@ export class PublishSipDtmfRequest extends Message { */ export class PublishSipDtmfResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishSipDtmfResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 { @@ -1254,7 +1203,7 @@ export class PublishSipDtmfResponse extends Message { } static equals(a: PublishSipDtmfResponse | PlainMessage | undefined, b: PublishSipDtmfResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishSipDtmfResponse, a, b); + return proto3.util.equals(PublishSipDtmfResponse, a, b); } } @@ -1263,9 +1212,9 @@ export class PublishSipDtmfResponse extends Message { */ export class PublishSipDtmfCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** * @generated from field: optional string error = 2; @@ -1274,13 +1223,13 @@ export class PublishSipDtmfCallback extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PublishSipDtmfCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 }, ]); @@ -1297,7 +1246,7 @@ export class PublishSipDtmfCallback extends Message { } static equals(a: PublishSipDtmfCallback | PlainMessage | undefined, b: PublishSipDtmfCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(PublishSipDtmfCallback, a, b); + return proto3.util.equals(PublishSipDtmfCallback, a, b); } } @@ -1308,25 +1257,25 @@ export class PublishSipDtmfCallback extends Message { */ export class SetLocalMetadataRequest extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: required string metadata = 2; + * @generated from field: string metadata = 2; */ - metadata?: string; + metadata = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetLocalMetadataRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + 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): SetLocalMetadataRequest { @@ -1342,7 +1291,7 @@ export class SetLocalMetadataRequest extends Message { } static equals(a: SetLocalMetadataRequest | PlainMessage | undefined, b: SetLocalMetadataRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(SetLocalMetadataRequest, a, b); + return proto3.util.equals(SetLocalMetadataRequest, a, b); } } @@ -1351,19 +1300,19 @@ export class SetLocalMetadataRequest extends Message { */ export class SetLocalMetadataResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetLocalMetadataResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 { @@ -1379,7 +1328,7 @@ export class SetLocalMetadataResponse extends Message } static equals(a: SetLocalMetadataResponse | PlainMessage | undefined, b: SetLocalMetadataResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(SetLocalMetadataResponse, a, b); + return proto3.util.equals(SetLocalMetadataResponse, a, b); } } @@ -1388,9 +1337,9 @@ export class SetLocalMetadataResponse extends Message */ export class SetLocalMetadataCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** * @generated from field: optional string error = 2; @@ -1399,13 +1348,13 @@ export class SetLocalMetadataCallback extends Message constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetLocalMetadataCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 }, ]); @@ -1422,7 +1371,7 @@ export class SetLocalMetadataCallback extends Message } static equals(a: SetLocalMetadataCallback | PlainMessage | undefined, b: SetLocalMetadataCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(SetLocalMetadataCallback, a, b); + return proto3.util.equals(SetLocalMetadataCallback, a, b); } } @@ -1431,14 +1380,14 @@ export class SetLocalMetadataCallback extends Message */ export class SendChatMessageRequest extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: required string message = 2; + * @generated from field: string message = 2; */ - message?: string; + message = ""; /** * @generated from field: repeated string destination_identities = 3; @@ -1452,14 +1401,14 @@ export class SendChatMessageRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SendChatMessageRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 4, name: "sender_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1477,7 +1426,7 @@ export class SendChatMessageRequest extends Message { } static equals(a: SendChatMessageRequest | PlainMessage | undefined, b: SendChatMessageRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(SendChatMessageRequest, a, b); + return proto3.util.equals(SendChatMessageRequest, a, b); } } @@ -1486,17 +1435,17 @@ export class SendChatMessageRequest extends Message { */ export class EditChatMessageRequest extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: required string edit_text = 2; + * @generated from field: string edit_text = 2; */ - editText?: string; + editText = ""; /** - * @generated from field: required livekit.proto.ChatMessage original_message = 3; + * @generated from field: livekit.proto.ChatMessage original_message = 3; */ originalMessage?: ChatMessage; @@ -1512,15 +1461,15 @@ export class EditChatMessageRequest extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.EditChatMessageRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "edit_text", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "original_message", kind: "message", T: ChatMessage, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "edit_text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "original_message", kind: "message", T: ChatMessage }, { no: 4, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 5, name: "sender_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, ]); @@ -1538,7 +1487,7 @@ export class EditChatMessageRequest extends Message { } static equals(a: EditChatMessageRequest | PlainMessage | undefined, b: EditChatMessageRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(EditChatMessageRequest, a, b); + return proto3.util.equals(EditChatMessageRequest, a, b); } } @@ -1547,19 +1496,19 @@ export class EditChatMessageRequest extends Message { */ export class SendChatMessageResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SendChatMessageResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageResponse { @@ -1575,7 +1524,7 @@ export class SendChatMessageResponse extends Message { } static equals(a: SendChatMessageResponse | PlainMessage | undefined, b: SendChatMessageResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(SendChatMessageResponse, a, b); + return proto3.util.equals(SendChatMessageResponse, a, b); } } @@ -1584,38 +1533,31 @@ export class SendChatMessageResponse extends Message { */ export class SendChatMessageCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** - * @generated from oneof livekit.proto.SendChatMessageCallback.message + * @generated from field: optional string error = 2; */ - message: { - /** - * @generated from field: string error = 2; - */ - value: string; - case: "error"; - } | { - /** - * @generated from field: livekit.proto.ChatMessage chat_message = 3; - */ - value: ChatMessage; - case: "chatMessage"; - } | { case: undefined; value?: undefined } = { case: undefined }; + error?: string; + + /** + * @generated from field: optional livekit.proto.ChatMessage chat_message = 3; + */ + chatMessage?: ChatMessage; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SendChatMessageCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, - { no: 3, name: "chat_message", kind: "message", T: ChatMessage, oneof: "message" }, + 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 }, + { no: 3, name: "chat_message", kind: "message", T: ChatMessage, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageCallback { @@ -1631,7 +1573,7 @@ export class SendChatMessageCallback extends Message { } static equals(a: SendChatMessageCallback | PlainMessage | undefined, b: SendChatMessageCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(SendChatMessageCallback, a, b); + return proto3.util.equals(SendChatMessageCallback, a, b); } } @@ -1642,25 +1584,25 @@ export class SendChatMessageCallback extends Message { */ export class SetLocalAttributesRequest extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: repeated livekit.proto.AttributesEntry attributes = 2; + * @generated from field: map attributes = 2; */ - attributes: AttributesEntry[] = []; + attributes: { [key: string]: string } = {}; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetLocalAttributesRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "attributes", kind: "message", T: AttributesEntry, repeated: true }, + 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 { @@ -1676,50 +1618,7 @@ export class SetLocalAttributesRequest extends Message | undefined, b: SetLocalAttributesRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(SetLocalAttributesRequest, a, b); - } -} - -/** - * @generated from message livekit.proto.AttributesEntry - */ -export class AttributesEntry extends Message { - /** - * @generated from field: required string key = 1; - */ - key?: string; - - /** - * @generated from field: required string value = 2; - */ - value?: string; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "livekit.proto.AttributesEntry"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AttributesEntry { - return new AttributesEntry().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AttributesEntry { - return new AttributesEntry().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AttributesEntry { - return new AttributesEntry().fromJsonString(jsonString, options); - } - - static equals(a: AttributesEntry | PlainMessage | undefined, b: AttributesEntry | PlainMessage | undefined): boolean { - return proto2.util.equals(AttributesEntry, a, b); + return proto3.util.equals(SetLocalAttributesRequest, a, b); } } @@ -1728,19 +1627,19 @@ export class AttributesEntry extends Message { */ export class SetLocalAttributesResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetLocalAttributesResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalAttributesResponse { @@ -1756,7 +1655,7 @@ export class SetLocalAttributesResponse extends Message | undefined, b: SetLocalAttributesResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(SetLocalAttributesResponse, a, b); + return proto3.util.equals(SetLocalAttributesResponse, a, b); } } @@ -1765,9 +1664,9 @@ export class SetLocalAttributesResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** * @generated from field: optional string error = 2; @@ -1776,13 +1675,13 @@ export class SetLocalAttributesCallback extends Message) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetLocalAttributesCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 }, ]); @@ -1799,7 +1698,7 @@ export class SetLocalAttributesCallback extends Message | undefined, b: SetLocalAttributesCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(SetLocalAttributesCallback, a, b); + return proto3.util.equals(SetLocalAttributesCallback, a, b); } } @@ -1810,25 +1709,25 @@ export class SetLocalAttributesCallback extends Message { /** - * @generated from field: required uint64 local_participant_handle = 1; + * @generated from field: uint64 local_participant_handle = 1; */ - localParticipantHandle?: bigint; + localParticipantHandle = protoInt64.zero; /** - * @generated from field: required string name = 2; + * @generated from field: string name = 2; */ - name?: string; + name = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetLocalNameRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + 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): SetLocalNameRequest { @@ -1844,7 +1743,7 @@ export class SetLocalNameRequest extends Message { } static equals(a: SetLocalNameRequest | PlainMessage | undefined, b: SetLocalNameRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(SetLocalNameRequest, a, b); + return proto3.util.equals(SetLocalNameRequest, a, b); } } @@ -1853,19 +1752,19 @@ export class SetLocalNameRequest extends Message { */ export class SetLocalNameResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetLocalNameResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalNameResponse { @@ -1881,7 +1780,7 @@ export class SetLocalNameResponse extends Message { } static equals(a: SetLocalNameResponse | PlainMessage | undefined, b: SetLocalNameResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(SetLocalNameResponse, a, b); + return proto3.util.equals(SetLocalNameResponse, a, b); } } @@ -1890,9 +1789,9 @@ export class SetLocalNameResponse extends Message { */ export class SetLocalNameCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** * @generated from field: optional string error = 2; @@ -1901,13 +1800,13 @@ export class SetLocalNameCallback extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetLocalNameCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 }, ]); @@ -1924,7 +1823,7 @@ export class SetLocalNameCallback extends Message { } static equals(a: SetLocalNameCallback | PlainMessage | undefined, b: SetLocalNameCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(SetLocalNameCallback, a, b); + return proto3.util.equals(SetLocalNameCallback, a, b); } } @@ -1935,25 +1834,25 @@ export class SetLocalNameCallback extends Message { */ export class SetSubscribedRequest extends Message { /** - * @generated from field: required bool subscribe = 1; + * @generated from field: bool subscribe = 1; */ - subscribe?: boolean; + subscribe = false; /** - * @generated from field: required uint64 publication_handle = 2; + * @generated from field: uint64 publication_handle = 2; */ - publicationHandle?: bigint; + publicationHandle = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetSubscribedRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 2, name: "publication_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "publication_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetSubscribedRequest { @@ -1969,7 +1868,7 @@ export class SetSubscribedRequest extends Message { } static equals(a: SetSubscribedRequest | PlainMessage | undefined, b: SetSubscribedRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(SetSubscribedRequest, a, b); + return proto3.util.equals(SetSubscribedRequest, a, b); } } @@ -1979,12 +1878,12 @@ export class SetSubscribedRequest extends Message { export class SetSubscribedResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SetSubscribedResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetSubscribedResponse { @@ -2000,7 +1899,7 @@ export class SetSubscribedResponse extends Message { } static equals(a: SetSubscribedResponse | PlainMessage | undefined, b: SetSubscribedResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(SetSubscribedResponse, a, b); + return proto3.util.equals(SetSubscribedResponse, a, b); } } @@ -2009,19 +1908,19 @@ export class SetSubscribedResponse extends Message { */ export class GetSessionStatsRequest extends Message { /** - * @generated from field: required uint64 room_handle = 1; + * @generated from field: uint64 room_handle = 1; */ - roomHandle?: bigint; + roomHandle = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetSessionStatsRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsRequest { @@ -2037,7 +1936,7 @@ export class GetSessionStatsRequest extends Message { } static equals(a: GetSessionStatsRequest | PlainMessage | undefined, b: GetSessionStatsRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(GetSessionStatsRequest, a, b); + return proto3.util.equals(GetSessionStatsRequest, a, b); } } @@ -2046,19 +1945,19 @@ export class GetSessionStatsRequest extends Message { */ export class GetSessionStatsResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetSessionStatsResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsResponse { @@ -2074,7 +1973,7 @@ export class GetSessionStatsResponse extends Message { } static equals(a: GetSessionStatsResponse | PlainMessage | undefined, b: GetSessionStatsResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(GetSessionStatsResponse, a, b); + return proto3.util.equals(GetSessionStatsResponse, a, b); } } @@ -2083,38 +1982,37 @@ export class GetSessionStatsResponse extends Message { */ export class GetSessionStatsCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** - * @generated from oneof livekit.proto.GetSessionStatsCallback.message + * @generated from field: optional string error = 2; */ - message: { - /** - * @generated from field: string error = 2; - */ - value: string; - case: "error"; - } | { - /** - * @generated from field: livekit.proto.GetSessionStatsCallback.Result result = 3; - */ - value: GetSessionStatsCallback_Result; - case: "result"; - } | { case: undefined; value?: undefined } = { case: undefined }; + error?: string; + + /** + * @generated from field: repeated livekit.proto.RtcStats publisher_stats = 3; + */ + publisherStats: RtcStats[] = []; + + /** + * @generated from field: repeated livekit.proto.RtcStats subscriber_stats = 4; + */ + subscriberStats: RtcStats[] = []; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetSessionStatsCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, - { no: 3, name: "result", kind: "message", T: GetSessionStatsCallback_Result, oneof: "message" }, + 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 }, + { no: 3, name: "publisher_stats", kind: "message", T: RtcStats, repeated: true }, + { no: 4, name: "subscriber_stats", kind: "message", T: RtcStats, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsCallback { @@ -2130,50 +2028,7 @@ export class GetSessionStatsCallback extends Message { } static equals(a: GetSessionStatsCallback | PlainMessage | undefined, b: GetSessionStatsCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(GetSessionStatsCallback, a, b); - } -} - -/** - * @generated from message livekit.proto.GetSessionStatsCallback.Result - */ -export class GetSessionStatsCallback_Result extends Message { - /** - * @generated from field: repeated livekit.proto.RtcStats publisher_stats = 1; - */ - publisherStats: RtcStats[] = []; - - /** - * @generated from field: repeated livekit.proto.RtcStats subscriber_stats = 2; - */ - subscriberStats: RtcStats[] = []; - - constructor(data?: PartialMessage) { - super(); - proto2.util.initPartial(data, this); - } - - static readonly runtime: typeof proto2 = proto2; - static readonly typeName = "livekit.proto.GetSessionStatsCallback.Result"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "publisher_stats", kind: "message", T: RtcStats, repeated: true }, - { no: 2, name: "subscriber_stats", kind: "message", T: RtcStats, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsCallback_Result { - return new GetSessionStatsCallback_Result().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSessionStatsCallback_Result { - return new GetSessionStatsCallback_Result().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetSessionStatsCallback_Result { - return new GetSessionStatsCallback_Result().fromJsonString(jsonString, options); - } - - static equals(a: GetSessionStatsCallback_Result | PlainMessage | undefined, b: GetSessionStatsCallback_Result | PlainMessage | undefined): boolean { - return proto2.util.equals(GetSessionStatsCallback_Result, a, b); + return proto3.util.equals(GetSessionStatsCallback, a, b); } } @@ -2182,25 +2037,25 @@ export class GetSessionStatsCallback_Result extends Message { /** - * @generated from field: required uint64 max_bitrate = 1; + * @generated from field: uint64 max_bitrate = 1; */ - maxBitrate?: bigint; + maxBitrate = protoInt64.zero; /** - * @generated from field: required double max_framerate = 2; + * @generated from field: double max_framerate = 2; */ - maxFramerate?: number; + maxFramerate = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoEncoding"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "max_framerate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "max_framerate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoEncoding { @@ -2216,7 +2071,7 @@ export class VideoEncoding extends Message { } static equals(a: VideoEncoding | PlainMessage | undefined, b: VideoEncoding | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoEncoding, a, b); + return proto3.util.equals(VideoEncoding, a, b); } } @@ -2225,19 +2080,19 @@ export class VideoEncoding extends Message { */ export class AudioEncoding extends Message { /** - * @generated from field: required uint64 max_bitrate = 1; + * @generated from field: uint64 max_bitrate = 1; */ - maxBitrate?: bigint; + maxBitrate = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioEncoding"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioEncoding { @@ -2253,7 +2108,7 @@ export class AudioEncoding extends Message { } static equals(a: AudioEncoding | PlainMessage | undefined, b: AudioEncoding | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioEncoding, a, b); + return proto3.util.equals(AudioEncoding, a, b); } } @@ -2264,61 +2119,61 @@ export class TrackPublishOptions extends Message { /** * encodings are optional * - * @generated from field: optional livekit.proto.VideoEncoding video_encoding = 1; + * @generated from field: livekit.proto.VideoEncoding video_encoding = 1; */ videoEncoding?: VideoEncoding; /** - * @generated from field: optional livekit.proto.AudioEncoding audio_encoding = 2; + * @generated from field: livekit.proto.AudioEncoding audio_encoding = 2; */ audioEncoding?: AudioEncoding; /** - * @generated from field: required livekit.proto.VideoCodec video_codec = 3; + * @generated from field: livekit.proto.VideoCodec video_codec = 3; */ - videoCodec?: VideoCodec; + videoCodec = VideoCodec.VP8; /** - * @generated from field: required bool dtx = 4; + * @generated from field: bool dtx = 4; */ - dtx?: boolean; + dtx = false; /** - * @generated from field: required bool red = 5; + * @generated from field: bool red = 5; */ - red?: boolean; + red = false; /** - * @generated from field: required bool simulcast = 6; + * @generated from field: bool simulcast = 6; */ - simulcast?: boolean; + simulcast = false; /** - * @generated from field: required livekit.proto.TrackSource source = 7; + * @generated from field: livekit.proto.TrackSource source = 7; */ - source?: TrackSource; + source = TrackSource.SOURCE_UNKNOWN; /** - * @generated from field: required string stream = 8; + * @generated from field: string stream = 8; */ - stream?: string; + stream = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackPublishOptions"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "video_encoding", kind: "message", T: VideoEncoding, opt: true }, - { no: 2, name: "audio_encoding", kind: "message", T: AudioEncoding, opt: true }, - { no: 3, name: "video_codec", kind: "enum", T: proto2.getEnumType(VideoCodec), req: true }, - { no: 4, name: "dtx", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 5, name: "red", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 6, name: "simulcast", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 7, name: "source", kind: "enum", T: proto2.getEnumType(TrackSource), req: true }, - { no: 8, name: "stream", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "video_encoding", kind: "message", T: VideoEncoding }, + { no: 2, name: "audio_encoding", kind: "message", T: AudioEncoding }, + { no: 3, name: "video_codec", kind: "enum", T: proto3.getEnumType(VideoCodec) }, + { no: 4, name: "dtx", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 5, name: "red", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "simulcast", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 7, name: "source", kind: "enum", T: proto3.getEnumType(TrackSource) }, + { no: 8, name: "stream", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackPublishOptions { @@ -2334,7 +2189,7 @@ export class TrackPublishOptions extends Message { } static equals(a: TrackPublishOptions | PlainMessage | undefined, b: TrackPublishOptions | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackPublishOptions, a, b); + return proto3.util.equals(TrackPublishOptions, a, b); } } @@ -2348,26 +2203,26 @@ export class IceServer extends Message { urls: string[] = []; /** - * @generated from field: optional string username = 2; + * @generated from field: string username = 2; */ - username?: string; + username = ""; /** - * @generated from field: optional string password = 3; + * @generated from field: string password = 3; */ - password?: string; + password = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.IceServer"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "urls", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 3, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): IceServer { @@ -2383,7 +2238,7 @@ export class IceServer extends Message { } static equals(a: IceServer | PlainMessage | undefined, b: IceServer | PlainMessage | undefined): boolean { - return proto2.util.equals(IceServer, a, b); + return proto3.util.equals(IceServer, a, b); } } @@ -2410,14 +2265,14 @@ export class RtcConfig extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcConfig"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "ice_transport_type", kind: "enum", T: proto2.getEnumType(IceTransportType), opt: true }, - { no: 2, name: "continual_gathering_policy", kind: "enum", T: proto2.getEnumType(ContinualGatheringPolicy), opt: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "ice_transport_type", kind: "enum", T: proto3.getEnumType(IceTransportType), opt: true }, + { no: 2, name: "continual_gathering_policy", kind: "enum", T: proto3.getEnumType(ContinualGatheringPolicy), opt: true }, { no: 3, name: "ice_servers", kind: "message", T: IceServer, repeated: true }, ]); @@ -2434,7 +2289,7 @@ export class RtcConfig extends Message { } static equals(a: RtcConfig | PlainMessage | undefined, b: RtcConfig | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcConfig, a, b); + return proto3.util.equals(RtcConfig, a, b); } } @@ -2443,19 +2298,19 @@ export class RtcConfig extends Message { */ export class RoomOptions extends Message { /** - * @generated from field: required bool auto_subscribe = 1; + * @generated from field: bool auto_subscribe = 1; */ - autoSubscribe?: boolean; + autoSubscribe = false; /** - * @generated from field: required bool adaptive_stream = 2; + * @generated from field: bool adaptive_stream = 2; */ - adaptiveStream?: boolean; + adaptiveStream = false; /** - * @generated from field: required bool dynacast = 3; + * @generated from field: bool dynacast = 3; */ - dynacast?: boolean; + dynacast = false; /** * @generated from field: optional livekit.proto.E2eeOptions e2ee = 4; @@ -2470,24 +2325,24 @@ export class RoomOptions extends Message { rtcConfig?: RtcConfig; /** - * @generated from field: required uint32 join_retries = 6; + * @generated from field: uint32 join_retries = 6; */ - joinRetries?: number; + joinRetries = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RoomOptions"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "auto_subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 2, name: "adaptive_stream", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 3, name: "dynacast", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "auto_subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "adaptive_stream", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "dynacast", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 4, name: "e2ee", kind: "message", T: E2eeOptions, opt: true }, { no: 5, name: "rtc_config", kind: "message", T: RtcConfig, opt: true }, - { no: 6, name: "join_retries", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + { no: 6, name: "join_retries", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomOptions { @@ -2503,7 +2358,7 @@ export class RoomOptions extends Message { } static equals(a: RoomOptions | PlainMessage | undefined, b: RoomOptions | PlainMessage | undefined): boolean { - return proto2.util.equals(RoomOptions, a, b); + return proto3.util.equals(RoomOptions, a, b); } } @@ -2512,49 +2367,49 @@ export class RoomOptions extends Message { */ export class TranscriptionSegment extends Message { /** - * @generated from field: required string id = 1; + * @generated from field: string id = 1; */ - id?: string; + id = ""; /** - * @generated from field: required string text = 2; + * @generated from field: string text = 2; */ - text?: string; + text = ""; /** - * @generated from field: required uint64 start_time = 3; + * @generated from field: uint64 start_time = 3; */ - startTime?: bigint; + startTime = protoInt64.zero; /** - * @generated from field: required uint64 end_time = 4; + * @generated from field: uint64 end_time = 4; */ - endTime?: bigint; + endTime = protoInt64.zero; /** - * @generated from field: required bool final = 5; + * @generated from field: bool final = 5; */ - final?: boolean; + final = false; /** - * @generated from field: required string language = 6; + * @generated from field: string language = 6; */ - language?: string; + language = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TranscriptionSegment"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "start_time", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 4, name: "end_time", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 5, name: "final", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 6, name: "language", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + 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 { @@ -2570,7 +2425,7 @@ export class TranscriptionSegment extends Message { } static equals(a: TranscriptionSegment | PlainMessage | undefined, b: TranscriptionSegment | PlainMessage | undefined): boolean { - return proto2.util.equals(TranscriptionSegment, a, b); + return proto3.util.equals(TranscriptionSegment, a, b); } } @@ -2579,25 +2434,25 @@ export class TranscriptionSegment extends Message { */ export class BufferInfo extends Message { /** - * @generated from field: required uint64 data_ptr = 1; + * @generated from field: uint64 data_ptr = 1; */ - dataPtr?: bigint; + dataPtr = protoInt64.zero; /** - * @generated from field: required uint64 data_len = 2; + * @generated from field: uint64 data_len = 2; */ - dataLen?: bigint; + dataLen = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.BufferInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "data_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "data_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): BufferInfo { @@ -2613,7 +2468,7 @@ export class BufferInfo extends Message { } static equals(a: BufferInfo | PlainMessage | undefined, b: BufferInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(BufferInfo, a, b); + return proto3.util.equals(BufferInfo, a, b); } } @@ -2622,25 +2477,25 @@ export class BufferInfo extends Message { */ export class OwnedBuffer extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.BufferInfo data = 2; + * @generated from field: livekit.proto.BufferInfo data = 2; */ data?: BufferInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedBuffer"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "data", kind: "message", T: BufferInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "data", kind: "message", T: BufferInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedBuffer { @@ -2656,7 +2511,7 @@ export class OwnedBuffer extends Message { } static equals(a: OwnedBuffer | PlainMessage | undefined, b: OwnedBuffer | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedBuffer, a, b); + return proto3.util.equals(OwnedBuffer, a, b); } } @@ -2665,9 +2520,9 @@ export class OwnedBuffer extends Message { */ export class RoomEvent extends Message { /** - * @generated from field: required uint64 room_handle = 1; + * @generated from field: uint64 room_handle = 1; */ - roomHandle?: bigint; + roomHandle = protoInt64.zero; /** * @generated from oneof livekit.proto.RoomEvent.message @@ -2848,13 +2703,13 @@ export class RoomEvent extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RoomEvent"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "participant_connected", kind: "message", T: ParticipantConnected, oneof: "message" }, { no: 3, name: "participant_disconnected", kind: "message", T: ParticipantDisconnected, oneof: "message" }, { no: 4, name: "local_track_published", kind: "message", T: LocalTrackPublished, oneof: "message" }, @@ -2898,7 +2753,7 @@ export class RoomEvent extends Message { } static equals(a: RoomEvent | PlainMessage | undefined, b: RoomEvent | PlainMessage | undefined): boolean { - return proto2.util.equals(RoomEvent, a, b); + return proto3.util.equals(RoomEvent, a, b); } } @@ -2912,26 +2767,26 @@ export class RoomInfo extends Message { sid?: string; /** - * @generated from field: required string name = 2; + * @generated from field: string name = 2; */ - name?: string; + name = ""; /** - * @generated from field: required string metadata = 3; + * @generated from field: string metadata = 3; */ - metadata?: string; + metadata = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RoomInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomInfo { @@ -2947,7 +2802,7 @@ export class RoomInfo extends Message { } static equals(a: RoomInfo | PlainMessage | undefined, b: RoomInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(RoomInfo, a, b); + return proto3.util.equals(RoomInfo, a, b); } } @@ -2956,25 +2811,25 @@ export class RoomInfo extends Message { */ export class OwnedRoom extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.RoomInfo info = 2; + * @generated from field: livekit.proto.RoomInfo info = 2; */ info?: RoomInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedRoom"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: RoomInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: RoomInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedRoom { @@ -2990,7 +2845,7 @@ export class OwnedRoom extends Message { } static equals(a: OwnedRoom | PlainMessage | undefined, b: OwnedRoom | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedRoom, a, b); + return proto3.util.equals(OwnedRoom, a, b); } } @@ -2999,19 +2854,19 @@ export class OwnedRoom extends Message { */ export class ParticipantConnected extends Message { /** - * @generated from field: required livekit.proto.OwnedParticipant info = 1; + * @generated from field: livekit.proto.OwnedParticipant info = 1; */ info?: OwnedParticipant; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ParticipantConnected"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "info", kind: "message", T: OwnedParticipant, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "info", kind: "message", T: OwnedParticipant }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantConnected { @@ -3027,7 +2882,7 @@ export class ParticipantConnected extends Message { } static equals(a: ParticipantConnected | PlainMessage | undefined, b: ParticipantConnected | PlainMessage | undefined): boolean { - return proto2.util.equals(ParticipantConnected, a, b); + return proto3.util.equals(ParticipantConnected, a, b); } } @@ -3036,19 +2891,19 @@ export class ParticipantConnected extends Message { */ export class ParticipantDisconnected extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ParticipantDisconnected"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantDisconnected { @@ -3064,7 +2919,7 @@ export class ParticipantDisconnected extends Message { } static equals(a: ParticipantDisconnected | PlainMessage | undefined, b: ParticipantDisconnected | PlainMessage | undefined): boolean { - return proto2.util.equals(ParticipantDisconnected, a, b); + return proto3.util.equals(ParticipantDisconnected, a, b); } } @@ -3076,19 +2931,19 @@ export class LocalTrackPublished extends Message { * The TrackPublicationInfo comes from the PublishTrack response * and the FfiClient musts wait for it before firing this event * - * @generated from field: required string track_sid = 1; + * @generated from field: string track_sid = 1; */ - trackSid?: string; + trackSid = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.LocalTrackPublished"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackPublished { @@ -3104,7 +2959,7 @@ export class LocalTrackPublished extends Message { } static equals(a: LocalTrackPublished | PlainMessage | undefined, b: LocalTrackPublished | PlainMessage | undefined): boolean { - return proto2.util.equals(LocalTrackPublished, a, b); + return proto3.util.equals(LocalTrackPublished, a, b); } } @@ -3113,19 +2968,19 @@ export class LocalTrackPublished extends Message { */ export class LocalTrackUnpublished extends Message { /** - * @generated from field: required string publication_sid = 1; + * @generated from field: string publication_sid = 1; */ - publicationSid?: string; + publicationSid = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.LocalTrackUnpublished"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackUnpublished { @@ -3141,7 +2996,7 @@ export class LocalTrackUnpublished extends Message { } static equals(a: LocalTrackUnpublished | PlainMessage | undefined, b: LocalTrackUnpublished | PlainMessage | undefined): boolean { - return proto2.util.equals(LocalTrackUnpublished, a, b); + return proto3.util.equals(LocalTrackUnpublished, a, b); } } @@ -3150,19 +3005,19 @@ export class LocalTrackUnpublished extends Message { */ export class LocalTrackSubscribed extends Message { /** - * @generated from field: required string track_sid = 2; + * @generated from field: string track_sid = 2; */ - trackSid?: string; + trackSid = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.LocalTrackSubscribed"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackSubscribed { @@ -3178,7 +3033,7 @@ export class LocalTrackSubscribed extends Message { } static equals(a: LocalTrackSubscribed | PlainMessage | undefined, b: LocalTrackSubscribed | PlainMessage | undefined): boolean { - return proto2.util.equals(LocalTrackSubscribed, a, b); + return proto3.util.equals(LocalTrackSubscribed, a, b); } } @@ -3187,25 +3042,25 @@ export class LocalTrackSubscribed extends Message { */ export class TrackPublished extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required livekit.proto.OwnedTrackPublication publication = 2; + * @generated from field: livekit.proto.OwnedTrackPublication publication = 2; */ publication?: OwnedTrackPublication; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackPublished"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "publication", kind: "message", T: OwnedTrackPublication, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "publication", kind: "message", T: OwnedTrackPublication }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackPublished { @@ -3221,7 +3076,7 @@ export class TrackPublished extends Message { } static equals(a: TrackPublished | PlainMessage | undefined, b: TrackPublished | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackPublished, a, b); + return proto3.util.equals(TrackPublished, a, b); } } @@ -3230,25 +3085,25 @@ export class TrackPublished extends Message { */ export class TrackUnpublished extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string publication_sid = 2; + * @generated from field: string publication_sid = 2; */ - publicationSid?: string; + publicationSid = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackUnpublished"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackUnpublished { @@ -3264,7 +3119,7 @@ export class TrackUnpublished extends Message { } static equals(a: TrackUnpublished | PlainMessage | undefined, b: TrackUnpublished | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackUnpublished, a, b); + return proto3.util.equals(TrackUnpublished, a, b); } } @@ -3276,25 +3131,25 @@ export class TrackUnpublished extends Message { */ export class TrackSubscribed extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required livekit.proto.OwnedTrack track = 2; + * @generated from field: livekit.proto.OwnedTrack track = 2; */ track?: OwnedTrack; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackSubscribed"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "track", kind: "message", T: OwnedTrack, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "track", kind: "message", T: OwnedTrack }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackSubscribed { @@ -3310,7 +3165,7 @@ export class TrackSubscribed extends Message { } static equals(a: TrackSubscribed | PlainMessage | undefined, b: TrackSubscribed | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackSubscribed, a, b); + return proto3.util.equals(TrackSubscribed, a, b); } } @@ -3321,25 +3176,25 @@ export class TrackUnsubscribed extends Message { /** * The FFI language can dispose/remove the VideoSink here * - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string track_sid = 2; + * @generated from field: string track_sid = 2; */ - trackSid?: string; + trackSid = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackUnsubscribed"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackUnsubscribed { @@ -3355,7 +3210,7 @@ export class TrackUnsubscribed extends Message { } static equals(a: TrackUnsubscribed | PlainMessage | undefined, b: TrackUnsubscribed | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackUnsubscribed, a, b); + return proto3.util.equals(TrackUnsubscribed, a, b); } } @@ -3364,31 +3219,31 @@ export class TrackUnsubscribed extends Message { */ export class TrackSubscriptionFailed extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string track_sid = 2; + * @generated from field: string track_sid = 2; */ - trackSid?: string; + trackSid = ""; /** - * @generated from field: required string error = 3; + * @generated from field: string error = 3; */ - error?: string; + error = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackSubscriptionFailed"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { 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 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackSubscriptionFailed { @@ -3404,7 +3259,7 @@ export class TrackSubscriptionFailed extends Message { } static equals(a: TrackSubscriptionFailed | PlainMessage | undefined, b: TrackSubscriptionFailed | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackSubscriptionFailed, a, b); + return proto3.util.equals(TrackSubscriptionFailed, a, b); } } @@ -3413,25 +3268,25 @@ export class TrackSubscriptionFailed extends Message { */ export class TrackMuted extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string track_sid = 2; + * @generated from field: string track_sid = 2; */ - trackSid?: string; + trackSid = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackMuted"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackMuted { @@ -3447,7 +3302,7 @@ export class TrackMuted extends Message { } static equals(a: TrackMuted | PlainMessage | undefined, b: TrackMuted | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackMuted, a, b); + return proto3.util.equals(TrackMuted, a, b); } } @@ -3456,25 +3311,25 @@ export class TrackMuted extends Message { */ export class TrackUnmuted extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string track_sid = 2; + * @generated from field: string track_sid = 2; */ - trackSid?: string; + trackSid = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackUnmuted"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackUnmuted { @@ -3490,7 +3345,7 @@ export class TrackUnmuted extends Message { } static equals(a: TrackUnmuted | PlainMessage | undefined, b: TrackUnmuted | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackUnmuted, a, b); + return proto3.util.equals(TrackUnmuted, a, b); } } @@ -3501,25 +3356,25 @@ export class E2eeStateChanged extends Message { /** * Using sid instead of identity for ffi communication * - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required livekit.proto.EncryptionState state = 2; + * @generated from field: livekit.proto.EncryptionState state = 2; */ - state?: EncryptionState; + state = EncryptionState.NEW; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.E2eeStateChanged"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "state", kind: "enum", T: proto2.getEnumType(EncryptionState), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(EncryptionState) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): E2eeStateChanged { @@ -3535,7 +3390,7 @@ export class E2eeStateChanged extends Message { } static equals(a: E2eeStateChanged | PlainMessage | undefined, b: E2eeStateChanged | PlainMessage | undefined): boolean { - return proto2.util.equals(E2eeStateChanged, a, b); + return proto3.util.equals(E2eeStateChanged, a, b); } } @@ -3550,12 +3405,12 @@ export class ActiveSpeakersChanged extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ActiveSpeakersChanged"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "participant_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, ]); @@ -3572,7 +3427,7 @@ export class ActiveSpeakersChanged extends Message { } static equals(a: ActiveSpeakersChanged | PlainMessage | undefined, b: ActiveSpeakersChanged | PlainMessage | undefined): boolean { - return proto2.util.equals(ActiveSpeakersChanged, a, b); + return proto3.util.equals(ActiveSpeakersChanged, a, b); } } @@ -3581,19 +3436,19 @@ export class ActiveSpeakersChanged extends Message { */ export class RoomMetadataChanged extends Message { /** - * @generated from field: required string metadata = 1; + * @generated from field: string metadata = 1; */ - metadata?: string; + metadata = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RoomMetadataChanged"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomMetadataChanged { @@ -3609,7 +3464,7 @@ export class RoomMetadataChanged extends Message { } static equals(a: RoomMetadataChanged | PlainMessage | undefined, b: RoomMetadataChanged | PlainMessage | undefined): boolean { - return proto2.util.equals(RoomMetadataChanged, a, b); + return proto3.util.equals(RoomMetadataChanged, a, b); } } @@ -3618,19 +3473,19 @@ export class RoomMetadataChanged extends Message { */ export class RoomSidChanged extends Message { /** - * @generated from field: required string sid = 1; + * @generated from field: string sid = 1; */ - sid?: string; + sid = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RoomSidChanged"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomSidChanged { @@ -3646,7 +3501,7 @@ export class RoomSidChanged extends Message { } static equals(a: RoomSidChanged | PlainMessage | undefined, b: RoomSidChanged | PlainMessage | undefined): boolean { - return proto2.util.equals(RoomSidChanged, a, b); + return proto3.util.equals(RoomSidChanged, a, b); } } @@ -3655,25 +3510,25 @@ export class RoomSidChanged extends Message { */ export class ParticipantMetadataChanged extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string metadata = 2; + * @generated from field: string metadata = 2; */ - metadata?: string; + metadata = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ParticipantMetadataChanged"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantMetadataChanged { @@ -3689,7 +3544,7 @@ export class ParticipantMetadataChanged extends Message | undefined, b: ParticipantMetadataChanged | PlainMessage | undefined): boolean { - return proto2.util.equals(ParticipantMetadataChanged, a, b); + return proto3.util.equals(ParticipantMetadataChanged, a, b); } } @@ -3698,31 +3553,31 @@ export class ParticipantMetadataChanged extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: repeated livekit.proto.AttributesEntry attributes = 2; + * @generated from field: map attributes = 2; */ - attributes: AttributesEntry[] = []; + attributes: { [key: string]: string } = {}; /** - * @generated from field: repeated livekit.proto.AttributesEntry changed_attributes = 3; + * @generated from field: map changed_attributes = 3; */ - changedAttributes: AttributesEntry[] = []; + changedAttributes: { [key: string]: string } = {}; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ParticipantAttributesChanged"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "attributes", kind: "message", T: AttributesEntry, repeated: true }, - { no: 3, name: "changed_attributes", kind: "message", T: AttributesEntry, repeated: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 3, name: "changed_attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantAttributesChanged { @@ -3738,7 +3593,7 @@ export class ParticipantAttributesChanged extends Message | undefined, b: ParticipantAttributesChanged | PlainMessage | undefined): boolean { - return proto2.util.equals(ParticipantAttributesChanged, a, b); + return proto3.util.equals(ParticipantAttributesChanged, a, b); } } @@ -3747,25 +3602,25 @@ export class ParticipantAttributesChanged extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required string name = 2; + * @generated from field: string name = 2; */ - name?: string; + name = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ParticipantNameChanged"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantNameChanged { @@ -3781,7 +3636,7 @@ export class ParticipantNameChanged extends Message { } static equals(a: ParticipantNameChanged | PlainMessage | undefined, b: ParticipantNameChanged | PlainMessage | undefined): boolean { - return proto2.util.equals(ParticipantNameChanged, a, b); + return proto3.util.equals(ParticipantNameChanged, a, b); } } @@ -3790,25 +3645,25 @@ export class ParticipantNameChanged extends Message { */ export class ConnectionQualityChanged extends Message { /** - * @generated from field: required string participant_identity = 1; + * @generated from field: string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity = ""; /** - * @generated from field: required livekit.proto.ConnectionQuality quality = 2; + * @generated from field: livekit.proto.ConnectionQuality quality = 2; */ - quality?: ConnectionQuality; + quality = ConnectionQuality.QUALITY_POOR; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ConnectionQualityChanged"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "quality", kind: "enum", T: proto2.getEnumType(ConnectionQuality), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "quality", kind: "enum", T: proto3.getEnumType(ConnectionQuality) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectionQualityChanged { @@ -3824,7 +3679,7 @@ export class ConnectionQualityChanged extends Message } static equals(a: ConnectionQualityChanged | PlainMessage | undefined, b: ConnectionQualityChanged | PlainMessage | undefined): boolean { - return proto2.util.equals(ConnectionQualityChanged, a, b); + return proto3.util.equals(ConnectionQualityChanged, a, b); } } @@ -3833,7 +3688,7 @@ export class ConnectionQualityChanged extends Message */ export class UserPacket extends Message { /** - * @generated from field: required livekit.proto.OwnedBuffer data = 1; + * @generated from field: livekit.proto.OwnedBuffer data = 1; */ data?: OwnedBuffer; @@ -3844,13 +3699,13 @@ export class UserPacket extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.UserPacket"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "data", kind: "message", T: OwnedBuffer, req: true }, + 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 }, ]); @@ -3867,7 +3722,7 @@ export class UserPacket extends Message { } static equals(a: UserPacket | PlainMessage | undefined, b: UserPacket | PlainMessage | undefined): boolean { - return proto2.util.equals(UserPacket, a, b); + return proto3.util.equals(UserPacket, a, b); } } @@ -3876,19 +3731,19 @@ export class UserPacket extends Message { */ export class ChatMessage extends Message { /** - * @generated from field: required string id = 1; + * @generated from field: string id = 1; */ - id?: string; + id = ""; /** - * @generated from field: required int64 timestamp = 2; + * @generated from field: int64 timestamp = 2; */ - timestamp?: bigint; + timestamp = protoInt64.zero; /** - * @generated from field: required string message = 3; + * @generated from field: string message = 3; */ - message?: string; + message = ""; /** * @generated from field: optional int64 edit_timestamp = 4; @@ -3907,15 +3762,15 @@ export class ChatMessage extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ChatMessage"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, - { no: 3, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "edit_timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, { no: 5, name: "deleted", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, { no: 6, name: "generated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, @@ -3934,7 +3789,7 @@ export class ChatMessage extends Message { } static equals(a: ChatMessage | PlainMessage | undefined, b: ChatMessage | PlainMessage | undefined): boolean { - return proto2.util.equals(ChatMessage, a, b); + return proto3.util.equals(ChatMessage, a, b); } } @@ -3943,25 +3798,25 @@ export class ChatMessage extends Message { */ export class ChatMessageReceived extends Message { /** - * @generated from field: required livekit.proto.ChatMessage message = 1; + * @generated from field: livekit.proto.ChatMessage message = 1; */ message?: ChatMessage; /** - * @generated from field: required string participant_identity = 2; + * @generated from field: string participant_identity = 2; */ - participantIdentity?: string; + participantIdentity = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ChatMessageReceived"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "message", kind: "message", T: ChatMessage, req: true }, - { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "message", kind: "message", T: ChatMessage }, + { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ChatMessageReceived { @@ -3977,7 +3832,7 @@ export class ChatMessageReceived extends Message { } static equals(a: ChatMessageReceived | PlainMessage | undefined, b: ChatMessageReceived | PlainMessage | undefined): boolean { - return proto2.util.equals(ChatMessageReceived, a, b); + return proto3.util.equals(ChatMessageReceived, a, b); } } @@ -3986,9 +3841,9 @@ export class ChatMessageReceived extends Message { */ export class SipDTMF extends Message { /** - * @generated from field: required uint32 code = 1; + * @generated from field: uint32 code = 1; */ - code?: number; + code = 0; /** * @generated from field: optional string digit = 2; @@ -3997,13 +3852,13 @@ export class SipDTMF extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SipDTMF"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + 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 }, ]); @@ -4020,7 +3875,7 @@ export class SipDTMF extends Message { } static equals(a: SipDTMF | PlainMessage | undefined, b: SipDTMF | PlainMessage | undefined): boolean { - return proto2.util.equals(SipDTMF, a, b); + return proto3.util.equals(SipDTMF, a, b); } } @@ -4029,16 +3884,16 @@ export class SipDTMF extends Message { */ export class DataPacketReceived extends Message { /** - * @generated from field: required livekit.proto.DataPacketKind kind = 1; + * @generated from field: livekit.proto.DataPacketKind kind = 1; */ - kind?: DataPacketKind; + kind = DataPacketKind.KIND_LOSSY; /** * Can be empty if the data is sent a server SDK * - * @generated from field: required string participant_identity = 2; + * @generated from field: string participant_identity = 2; */ - participantIdentity?: string; + participantIdentity = ""; /** * @generated from oneof livekit.proto.DataPacketReceived.value @@ -4059,14 +3914,14 @@ export class DataPacketReceived extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.DataPacketReceived"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "kind", kind: "enum", T: proto2.getEnumType(DataPacketKind), req: true }, - { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { 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" }, ]); @@ -4084,7 +3939,7 @@ export class DataPacketReceived extends Message { } static equals(a: DataPacketReceived | PlainMessage | undefined, b: DataPacketReceived | PlainMessage | undefined): boolean { - return proto2.util.equals(DataPacketReceived, a, b); + return proto3.util.equals(DataPacketReceived, a, b); } } @@ -4109,12 +3964,12 @@ export class TranscriptionReceived extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TranscriptionReceived"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 3, name: "segments", kind: "message", T: TranscriptionSegment, repeated: true }, @@ -4133,7 +3988,7 @@ export class TranscriptionReceived extends Message { } static equals(a: TranscriptionReceived | PlainMessage | undefined, b: TranscriptionReceived | PlainMessage | undefined): boolean { - return proto2.util.equals(TranscriptionReceived, a, b); + return proto3.util.equals(TranscriptionReceived, a, b); } } @@ -4142,19 +3997,19 @@ export class TranscriptionReceived extends Message { */ export class ConnectionStateChanged extends Message { /** - * @generated from field: required livekit.proto.ConnectionState state = 1; + * @generated from field: livekit.proto.ConnectionState state = 1; */ - state?: ConnectionState; + state = ConnectionState.CONN_DISCONNECTED; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ConnectionStateChanged"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "state", kind: "enum", T: proto2.getEnumType(ConnectionState), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "state", kind: "enum", T: proto3.getEnumType(ConnectionState) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ConnectionStateChanged { @@ -4170,7 +4025,7 @@ export class ConnectionStateChanged extends Message { } static equals(a: ConnectionStateChanged | PlainMessage | undefined, b: ConnectionStateChanged | PlainMessage | undefined): boolean { - return proto2.util.equals(ConnectionStateChanged, a, b); + return proto3.util.equals(ConnectionStateChanged, a, b); } } @@ -4180,12 +4035,12 @@ export class ConnectionStateChanged extends Message { export class Connected extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.Connected"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): Connected { @@ -4201,7 +4056,7 @@ export class Connected extends Message { } static equals(a: Connected | PlainMessage | undefined, b: Connected | PlainMessage | undefined): boolean { - return proto2.util.equals(Connected, a, b); + return proto3.util.equals(Connected, a, b); } } @@ -4210,19 +4065,19 @@ export class Connected extends Message { */ export class Disconnected extends Message { /** - * @generated from field: required livekit.proto.DisconnectReason reason = 1; + * @generated from field: livekit.proto.DisconnectReason reason = 1; */ - reason?: DisconnectReason; + reason = DisconnectReason.UNKNOWN_REASON; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.Disconnected"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "reason", kind: "enum", T: proto2.getEnumType(DisconnectReason), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "reason", kind: "enum", T: proto3.getEnumType(DisconnectReason) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Disconnected { @@ -4238,7 +4093,7 @@ export class Disconnected extends Message { } static equals(a: Disconnected | PlainMessage | undefined, b: Disconnected | PlainMessage | undefined): boolean { - return proto2.util.equals(Disconnected, a, b); + return proto3.util.equals(Disconnected, a, b); } } @@ -4248,12 +4103,12 @@ export class Disconnected extends Message { export class Reconnecting extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.Reconnecting"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): Reconnecting { @@ -4269,7 +4124,7 @@ export class Reconnecting extends Message { } static equals(a: Reconnecting | PlainMessage | undefined, b: Reconnecting | PlainMessage | undefined): boolean { - return proto2.util.equals(Reconnecting, a, b); + return proto3.util.equals(Reconnecting, a, b); } } @@ -4279,12 +4134,12 @@ export class Reconnecting extends Message { export class Reconnected extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.Reconnected"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): Reconnected { @@ -4300,7 +4155,7 @@ export class Reconnected extends Message { } static equals(a: Reconnected | PlainMessage | undefined, b: Reconnected | PlainMessage | undefined): boolean { - return proto2.util.equals(Reconnected, a, b); + return proto3.util.equals(Reconnected, a, b); } } @@ -4310,12 +4165,12 @@ export class Reconnected extends Message { export class RoomEOS extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RoomEOS"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): RoomEOS { @@ -4331,7 +4186,7 @@ export class RoomEOS extends Message { } static equals(a: RoomEOS | PlainMessage | undefined, b: RoomEOS | PlainMessage | undefined): boolean { - return proto2.util.equals(RoomEOS, a, b); + return proto3.util.equals(RoomEOS, a, b); } } diff --git a/packages/livekit-rtc/src/proto/stats_pb.ts b/packages/livekit-rtc/src/proto/stats_pb.ts index d0faf3db..ee7a001f 100644 --- a/packages/livekit-rtc/src/proto/stats_pb.ts +++ b/packages/livekit-rtc/src/proto/stats_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file stats.proto (package livekit.proto, syntax proto2) +// @generated from file stats.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; /** * @generated from enum livekit.proto.DataChannelState @@ -44,8 +44,8 @@ export enum DataChannelState { */ DC_CLOSED = 3, } -// Retrieve enum metadata with: proto2.getEnumType(DataChannelState) -proto2.util.setEnumType(DataChannelState, "livekit.proto.DataChannelState", [ +// Retrieve enum metadata with: proto3.getEnumType(DataChannelState) +proto3.util.setEnumType(DataChannelState, "livekit.proto.DataChannelState", [ { no: 0, name: "DC_CONNECTING" }, { no: 1, name: "DC_OPEN" }, { no: 2, name: "DC_CLOSING" }, @@ -76,8 +76,8 @@ export enum QualityLimitationReason { */ LIMITATION_OTHER = 3, } -// Retrieve enum metadata with: proto2.getEnumType(QualityLimitationReason) -proto2.util.setEnumType(QualityLimitationReason, "livekit.proto.QualityLimitationReason", [ +// Retrieve enum metadata with: proto3.getEnumType(QualityLimitationReason) +proto3.util.setEnumType(QualityLimitationReason, "livekit.proto.QualityLimitationReason", [ { no: 0, name: "LIMITATION_NONE" }, { no: 1, name: "LIMITATION_CPU" }, { no: 2, name: "LIMITATION_BANDWIDTH" }, @@ -103,8 +103,8 @@ export enum IceRole { */ ICE_CONTROLLED = 2, } -// Retrieve enum metadata with: proto2.getEnumType(IceRole) -proto2.util.setEnumType(IceRole, "livekit.proto.IceRole", [ +// Retrieve enum metadata with: proto3.getEnumType(IceRole) +proto3.util.setEnumType(IceRole, "livekit.proto.IceRole", [ { no: 0, name: "ICE_UNKNOWN" }, { no: 1, name: "ICE_CONTROLLING" }, { no: 2, name: "ICE_CONTROLLED" }, @@ -139,8 +139,8 @@ export enum DtlsTransportState { */ DTLS_TRANSPORT_FAILED = 4, } -// Retrieve enum metadata with: proto2.getEnumType(DtlsTransportState) -proto2.util.setEnumType(DtlsTransportState, "livekit.proto.DtlsTransportState", [ +// Retrieve enum metadata with: proto3.getEnumType(DtlsTransportState) +proto3.util.setEnumType(DtlsTransportState, "livekit.proto.DtlsTransportState", [ { no: 0, name: "DTLS_TRANSPORT_NEW" }, { no: 1, name: "DTLS_TRANSPORT_CONNECTING" }, { no: 2, name: "DTLS_TRANSPORT_CONNECTED" }, @@ -187,8 +187,8 @@ export enum IceTransportState { */ ICE_TRANSPORT_CLOSED = 6, } -// Retrieve enum metadata with: proto2.getEnumType(IceTransportState) -proto2.util.setEnumType(IceTransportState, "livekit.proto.IceTransportState", [ +// Retrieve enum metadata with: proto3.getEnumType(IceTransportState) +proto3.util.setEnumType(IceTransportState, "livekit.proto.IceTransportState", [ { no: 0, name: "ICE_TRANSPORT_NEW" }, { no: 1, name: "ICE_TRANSPORT_CHECKING" }, { no: 2, name: "ICE_TRANSPORT_CONNECTED" }, @@ -217,8 +217,8 @@ export enum DtlsRole { */ DTLS_UNKNOWN = 2, } -// Retrieve enum metadata with: proto2.getEnumType(DtlsRole) -proto2.util.setEnumType(DtlsRole, "livekit.proto.DtlsRole", [ +// Retrieve enum metadata with: proto3.getEnumType(DtlsRole) +proto3.util.setEnumType(DtlsRole, "livekit.proto.DtlsRole", [ { no: 0, name: "DTLS_CLIENT" }, { no: 1, name: "DTLS_SERVER" }, { no: 2, name: "DTLS_UNKNOWN" }, @@ -253,8 +253,8 @@ export enum IceCandidatePairState { */ PAIR_SUCCEEDED = 4, } -// Retrieve enum metadata with: proto2.getEnumType(IceCandidatePairState) -proto2.util.setEnumType(IceCandidatePairState, "livekit.proto.IceCandidatePairState", [ +// Retrieve enum metadata with: proto3.getEnumType(IceCandidatePairState) +proto3.util.setEnumType(IceCandidatePairState, "livekit.proto.IceCandidatePairState", [ { no: 0, name: "PAIR_FROZEN" }, { no: 1, name: "PAIR_WAITING" }, { no: 2, name: "PAIR_IN_PROGRESS" }, @@ -286,8 +286,8 @@ export enum IceCandidateType { */ RELAY = 3, } -// Retrieve enum metadata with: proto2.getEnumType(IceCandidateType) -proto2.util.setEnumType(IceCandidateType, "livekit.proto.IceCandidateType", [ +// Retrieve enum metadata with: proto3.getEnumType(IceCandidateType) +proto3.util.setEnumType(IceCandidateType, "livekit.proto.IceCandidateType", [ { no: 0, name: "HOST" }, { no: 1, name: "SRFLX" }, { no: 2, name: "PRFLX" }, @@ -313,8 +313,8 @@ export enum IceServerTransportProtocol { */ TRANSPORT_TLS = 2, } -// Retrieve enum metadata with: proto2.getEnumType(IceServerTransportProtocol) -proto2.util.setEnumType(IceServerTransportProtocol, "livekit.proto.IceServerTransportProtocol", [ +// Retrieve enum metadata with: proto3.getEnumType(IceServerTransportProtocol) +proto3.util.setEnumType(IceServerTransportProtocol, "livekit.proto.IceServerTransportProtocol", [ { no: 0, name: "TRANSPORT_UDP" }, { no: 1, name: "TRANSPORT_TCP" }, { no: 2, name: "TRANSPORT_TLS" }, @@ -339,8 +339,8 @@ export enum IceTcpCandidateType { */ CANDIDATE_SO = 2, } -// Retrieve enum metadata with: proto2.getEnumType(IceTcpCandidateType) -proto2.util.setEnumType(IceTcpCandidateType, "livekit.proto.IceTcpCandidateType", [ +// Retrieve enum metadata with: proto3.getEnumType(IceTcpCandidateType) +proto3.util.setEnumType(IceTcpCandidateType, "livekit.proto.IceTcpCandidateType", [ { no: 0, name: "CANDIDATE_ACTIVE" }, { no: 1, name: "CANDIDATE_PASSIVE" }, { no: 2, name: "CANDIDATE_SO" }, @@ -447,12 +447,12 @@ export class RtcStats extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 3, name: "codec", kind: "message", T: RtcStats_Codec, oneof: "stats" }, { no: 4, name: "inbound_rtp", kind: "message", T: RtcStats_InboundRtp, oneof: "stats" }, { no: 5, name: "outbound_rtp", kind: "message", T: RtcStats_OutboundRtp, oneof: "stats" }, @@ -483,7 +483,7 @@ export class RtcStats extends Message { } static equals(a: RtcStats | PlainMessage | undefined, b: RtcStats | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats, a, b); + return proto3.util.equals(RtcStats, a, b); } } @@ -492,25 +492,25 @@ export class RtcStats extends Message { */ export class RtcStats_Codec extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.CodecStats codec = 2; + * @generated from field: livekit.proto.CodecStats codec = 2; */ codec?: CodecStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.Codec"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "codec", kind: "message", T: CodecStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "codec", kind: "message", T: CodecStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Codec { @@ -526,7 +526,7 @@ export class RtcStats_Codec extends Message { } static equals(a: RtcStats_Codec | PlainMessage | undefined, b: RtcStats_Codec | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_Codec, a, b); + return proto3.util.equals(RtcStats_Codec, a, b); } } @@ -535,37 +535,37 @@ export class RtcStats_Codec extends Message { */ export class RtcStats_InboundRtp extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.RtpStreamStats stream = 2; + * @generated from field: livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: required livekit.proto.ReceivedRtpStreamStats received = 3; + * @generated from field: livekit.proto.ReceivedRtpStreamStats received = 3; */ received?: ReceivedRtpStreamStats; /** - * @generated from field: required livekit.proto.InboundRtpStreamStats inbound = 4; + * @generated from field: livekit.proto.InboundRtpStreamStats inbound = 4; */ inbound?: InboundRtpStreamStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.InboundRtp"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats, req: true }, - { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats, req: true }, - { no: 4, name: "inbound", kind: "message", T: InboundRtpStreamStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, + { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats }, + { no: 4, name: "inbound", kind: "message", T: InboundRtpStreamStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_InboundRtp { @@ -581,7 +581,7 @@ export class RtcStats_InboundRtp extends Message { } static equals(a: RtcStats_InboundRtp | PlainMessage | undefined, b: RtcStats_InboundRtp | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_InboundRtp, a, b); + return proto3.util.equals(RtcStats_InboundRtp, a, b); } } @@ -590,37 +590,37 @@ export class RtcStats_InboundRtp extends Message { */ export class RtcStats_OutboundRtp extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.RtpStreamStats stream = 2; + * @generated from field: livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: required livekit.proto.SentRtpStreamStats sent = 3; + * @generated from field: livekit.proto.SentRtpStreamStats sent = 3; */ sent?: SentRtpStreamStats; /** - * @generated from field: required livekit.proto.OutboundRtpStreamStats outbound = 4; + * @generated from field: livekit.proto.OutboundRtpStreamStats outbound = 4; */ outbound?: OutboundRtpStreamStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.OutboundRtp"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats, req: true }, - { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats, req: true }, - { no: 4, name: "outbound", kind: "message", T: OutboundRtpStreamStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, + { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats }, + { no: 4, name: "outbound", kind: "message", T: OutboundRtpStreamStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_OutboundRtp { @@ -636,7 +636,7 @@ export class RtcStats_OutboundRtp extends Message { } static equals(a: RtcStats_OutboundRtp | PlainMessage | undefined, b: RtcStats_OutboundRtp | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_OutboundRtp, a, b); + return proto3.util.equals(RtcStats_OutboundRtp, a, b); } } @@ -645,37 +645,37 @@ export class RtcStats_OutboundRtp extends Message { */ export class RtcStats_RemoteInboundRtp extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.RtpStreamStats stream = 2; + * @generated from field: livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: required livekit.proto.ReceivedRtpStreamStats received = 3; + * @generated from field: livekit.proto.ReceivedRtpStreamStats received = 3; */ received?: ReceivedRtpStreamStats; /** - * @generated from field: required livekit.proto.RemoteInboundRtpStreamStats remote_inbound = 4; + * @generated from field: livekit.proto.RemoteInboundRtpStreamStats remote_inbound = 4; */ remoteInbound?: RemoteInboundRtpStreamStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.RemoteInboundRtp"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats, req: true }, - { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats, req: true }, - { no: 4, name: "remote_inbound", kind: "message", T: RemoteInboundRtpStreamStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, + { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats }, + { no: 4, name: "remote_inbound", kind: "message", T: RemoteInboundRtpStreamStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_RemoteInboundRtp { @@ -691,7 +691,7 @@ export class RtcStats_RemoteInboundRtp extends Message | undefined, b: RtcStats_RemoteInboundRtp | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_RemoteInboundRtp, a, b); + return proto3.util.equals(RtcStats_RemoteInboundRtp, a, b); } } @@ -700,37 +700,37 @@ export class RtcStats_RemoteInboundRtp extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.RtpStreamStats stream = 2; + * @generated from field: livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: required livekit.proto.SentRtpStreamStats sent = 3; + * @generated from field: livekit.proto.SentRtpStreamStats sent = 3; */ sent?: SentRtpStreamStats; /** - * @generated from field: required livekit.proto.RemoteOutboundRtpStreamStats remote_outbound = 4; + * @generated from field: livekit.proto.RemoteOutboundRtpStreamStats remote_outbound = 4; */ remoteOutbound?: RemoteOutboundRtpStreamStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.RemoteOutboundRtp"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats, req: true }, - { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats, req: true }, - { no: 4, name: "remote_outbound", kind: "message", T: RemoteOutboundRtpStreamStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, + { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats }, + { no: 4, name: "remote_outbound", kind: "message", T: RemoteOutboundRtpStreamStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_RemoteOutboundRtp { @@ -746,7 +746,7 @@ export class RtcStats_RemoteOutboundRtp extends Message | undefined, b: RtcStats_RemoteOutboundRtp | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_RemoteOutboundRtp, a, b); + return proto3.util.equals(RtcStats_RemoteOutboundRtp, a, b); } } @@ -755,37 +755,37 @@ export class RtcStats_RemoteOutboundRtp extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.MediaSourceStats source = 2; + * @generated from field: livekit.proto.MediaSourceStats source = 2; */ source?: MediaSourceStats; /** - * @generated from field: required livekit.proto.AudioSourceStats audio = 3; + * @generated from field: livekit.proto.AudioSourceStats audio = 3; */ audio?: AudioSourceStats; /** - * @generated from field: required livekit.proto.VideoSourceStats video = 4; + * @generated from field: livekit.proto.VideoSourceStats video = 4; */ video?: VideoSourceStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.MediaSource"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "source", kind: "message", T: MediaSourceStats, req: true }, - { no: 3, name: "audio", kind: "message", T: AudioSourceStats, req: true }, - { no: 4, name: "video", kind: "message", T: VideoSourceStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "source", kind: "message", T: MediaSourceStats }, + { no: 3, name: "audio", kind: "message", T: AudioSourceStats }, + { no: 4, name: "video", kind: "message", T: VideoSourceStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_MediaSource { @@ -801,7 +801,7 @@ export class RtcStats_MediaSource extends Message { } static equals(a: RtcStats_MediaSource | PlainMessage | undefined, b: RtcStats_MediaSource | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_MediaSource, a, b); + return proto3.util.equals(RtcStats_MediaSource, a, b); } } @@ -810,25 +810,25 @@ export class RtcStats_MediaSource extends Message { */ export class RtcStats_MediaPlayout extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.AudioPlayoutStats audio_playout = 2; + * @generated from field: livekit.proto.AudioPlayoutStats audio_playout = 2; */ audioPlayout?: AudioPlayoutStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.MediaPlayout"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "audio_playout", kind: "message", T: AudioPlayoutStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "audio_playout", kind: "message", T: AudioPlayoutStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_MediaPlayout { @@ -844,7 +844,7 @@ export class RtcStats_MediaPlayout extends Message { } static equals(a: RtcStats_MediaPlayout | PlainMessage | undefined, b: RtcStats_MediaPlayout | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_MediaPlayout, a, b); + return proto3.util.equals(RtcStats_MediaPlayout, a, b); } } @@ -853,25 +853,25 @@ export class RtcStats_MediaPlayout extends Message { */ export class RtcStats_PeerConnection extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.PeerConnectionStats pc = 2; + * @generated from field: livekit.proto.PeerConnectionStats pc = 2; */ pc?: PeerConnectionStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.PeerConnection"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "pc", kind: "message", T: PeerConnectionStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "pc", kind: "message", T: PeerConnectionStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_PeerConnection { @@ -887,7 +887,7 @@ export class RtcStats_PeerConnection extends Message { } static equals(a: RtcStats_PeerConnection | PlainMessage | undefined, b: RtcStats_PeerConnection | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_PeerConnection, a, b); + return proto3.util.equals(RtcStats_PeerConnection, a, b); } } @@ -896,25 +896,25 @@ export class RtcStats_PeerConnection extends Message { */ export class RtcStats_DataChannel extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.DataChannelStats dc = 2; + * @generated from field: livekit.proto.DataChannelStats dc = 2; */ dc?: DataChannelStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.DataChannel"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "dc", kind: "message", T: DataChannelStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "dc", kind: "message", T: DataChannelStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_DataChannel { @@ -930,7 +930,7 @@ export class RtcStats_DataChannel extends Message { } static equals(a: RtcStats_DataChannel | PlainMessage | undefined, b: RtcStats_DataChannel | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_DataChannel, a, b); + return proto3.util.equals(RtcStats_DataChannel, a, b); } } @@ -939,25 +939,25 @@ export class RtcStats_DataChannel extends Message { */ export class RtcStats_Transport extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.TransportStats transport = 2; + * @generated from field: livekit.proto.TransportStats transport = 2; */ transport?: TransportStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.Transport"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "transport", kind: "message", T: TransportStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "transport", kind: "message", T: TransportStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Transport { @@ -973,7 +973,7 @@ export class RtcStats_Transport extends Message { } static equals(a: RtcStats_Transport | PlainMessage | undefined, b: RtcStats_Transport | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_Transport, a, b); + return proto3.util.equals(RtcStats_Transport, a, b); } } @@ -982,25 +982,25 @@ export class RtcStats_Transport extends Message { */ export class RtcStats_CandidatePair extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.CandidatePairStats candidate_pair = 2; + * @generated from field: livekit.proto.CandidatePairStats candidate_pair = 2; */ candidatePair?: CandidatePairStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.CandidatePair"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "candidate_pair", kind: "message", T: CandidatePairStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "candidate_pair", kind: "message", T: CandidatePairStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_CandidatePair { @@ -1016,7 +1016,7 @@ export class RtcStats_CandidatePair extends Message { } static equals(a: RtcStats_CandidatePair | PlainMessage | undefined, b: RtcStats_CandidatePair | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_CandidatePair, a, b); + return proto3.util.equals(RtcStats_CandidatePair, a, b); } } @@ -1025,25 +1025,25 @@ export class RtcStats_CandidatePair extends Message { */ export class RtcStats_LocalCandidate extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.IceCandidateStats candidate = 2; + * @generated from field: livekit.proto.IceCandidateStats candidate = 2; */ candidate?: IceCandidateStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.LocalCandidate"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "candidate", kind: "message", T: IceCandidateStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "candidate", kind: "message", T: IceCandidateStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_LocalCandidate { @@ -1059,7 +1059,7 @@ export class RtcStats_LocalCandidate extends Message { } static equals(a: RtcStats_LocalCandidate | PlainMessage | undefined, b: RtcStats_LocalCandidate | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_LocalCandidate, a, b); + return proto3.util.equals(RtcStats_LocalCandidate, a, b); } } @@ -1068,25 +1068,25 @@ export class RtcStats_LocalCandidate extends Message { */ export class RtcStats_RemoteCandidate extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.IceCandidateStats candidate = 2; + * @generated from field: livekit.proto.IceCandidateStats candidate = 2; */ candidate?: IceCandidateStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.RemoteCandidate"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "candidate", kind: "message", T: IceCandidateStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "candidate", kind: "message", T: IceCandidateStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_RemoteCandidate { @@ -1102,7 +1102,7 @@ export class RtcStats_RemoteCandidate extends Message } static equals(a: RtcStats_RemoteCandidate | PlainMessage | undefined, b: RtcStats_RemoteCandidate | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_RemoteCandidate, a, b); + return proto3.util.equals(RtcStats_RemoteCandidate, a, b); } } @@ -1111,25 +1111,25 @@ export class RtcStats_RemoteCandidate extends Message */ export class RtcStats_Certificate extends Message { /** - * @generated from field: required livekit.proto.RtcStatsData rtc = 1; + * @generated from field: livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: required livekit.proto.CertificateStats certificate = 2; + * @generated from field: livekit.proto.CertificateStats certificate = 2; */ certificate?: CertificateStats; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.Certificate"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData, req: true }, - { no: 2, name: "certificate", kind: "message", T: CertificateStats, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, + { no: 2, name: "certificate", kind: "message", T: CertificateStats }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Certificate { @@ -1145,7 +1145,7 @@ export class RtcStats_Certificate extends Message { } static equals(a: RtcStats_Certificate | PlainMessage | undefined, b: RtcStats_Certificate | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_Certificate, a, b); + return proto3.util.equals(RtcStats_Certificate, a, b); } } @@ -1157,12 +1157,12 @@ export class RtcStats_Certificate extends Message { export class RtcStats_Track extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStats.Track"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Track { @@ -1178,7 +1178,7 @@ export class RtcStats_Track extends Message { } static equals(a: RtcStats_Track | PlainMessage | undefined, b: RtcStats_Track | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStats_Track, a, b); + return proto3.util.equals(RtcStats_Track, a, b); } } @@ -1187,25 +1187,25 @@ export class RtcStats_Track extends Message { */ export class RtcStatsData extends Message { /** - * @generated from field: required string id = 1; + * @generated from field: string id = 1; */ - id?: string; + id = ""; /** - * @generated from field: required int64 timestamp = 2; + * @generated from field: int64 timestamp = 2; */ - timestamp?: bigint; + timestamp = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtcStatsData"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtcStatsData { @@ -1221,7 +1221,7 @@ export class RtcStatsData extends Message { } static equals(a: RtcStatsData | PlainMessage | undefined, b: RtcStatsData | PlainMessage | undefined): boolean { - return proto2.util.equals(RtcStatsData, a, b); + return proto3.util.equals(RtcStatsData, a, b); } } @@ -1230,49 +1230,49 @@ export class RtcStatsData extends Message { */ export class CodecStats extends Message { /** - * @generated from field: required uint32 payload_type = 1; + * @generated from field: uint32 payload_type = 1; */ - payloadType?: number; + payloadType = 0; /** - * @generated from field: required string transport_id = 2; + * @generated from field: string transport_id = 2; */ - transportId?: string; + transportId = ""; /** - * @generated from field: required string mime_type = 3; + * @generated from field: string mime_type = 3; */ - mimeType?: string; + mimeType = ""; /** - * @generated from field: required uint32 clock_rate = 4; + * @generated from field: uint32 clock_rate = 4; */ - clockRate?: number; + clockRate = 0; /** - * @generated from field: required uint32 channels = 5; + * @generated from field: uint32 channels = 5; */ - channels?: number; + channels = 0; /** - * @generated from field: required string sdp_fmtp_line = 6; + * @generated from field: string sdp_fmtp_line = 6; */ - sdpFmtpLine?: string; + sdpFmtpLine = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CodecStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "payload_type", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 2, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 4, name: "clock_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 5, name: "channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 6, name: "sdp_fmtp_line", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "payload_type", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "clock_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 5, name: "channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 6, name: "sdp_fmtp_line", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CodecStats { @@ -1288,7 +1288,7 @@ export class CodecStats extends Message { } static equals(a: CodecStats | PlainMessage | undefined, b: CodecStats | PlainMessage | undefined): boolean { - return proto2.util.equals(CodecStats, a, b); + return proto3.util.equals(CodecStats, a, b); } } @@ -1297,37 +1297,37 @@ export class CodecStats extends Message { */ export class RtpStreamStats extends Message { /** - * @generated from field: required uint32 ssrc = 1; + * @generated from field: uint32 ssrc = 1; */ - ssrc?: number; + ssrc = 0; /** - * @generated from field: required string kind = 2; + * @generated from field: string kind = 2; */ - kind?: string; + kind = ""; /** - * @generated from field: required string transport_id = 3; + * @generated from field: string transport_id = 3; */ - transportId?: string; + transportId = ""; /** - * @generated from field: required string codec_id = 4; + * @generated from field: string codec_id = 4; */ - codecId?: string; + codecId = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RtpStreamStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 4, name: "codec_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "codec_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RtpStreamStats { @@ -1343,7 +1343,7 @@ export class RtpStreamStats extends Message { } static equals(a: RtpStreamStats | PlainMessage | undefined, b: RtpStreamStats | PlainMessage | undefined): boolean { - return proto2.util.equals(RtpStreamStats, a, b); + return proto3.util.equals(RtpStreamStats, a, b); } } @@ -1352,31 +1352,31 @@ export class RtpStreamStats extends Message { */ export class ReceivedRtpStreamStats extends Message { /** - * @generated from field: required uint64 packets_received = 1; + * @generated from field: uint64 packets_received = 1; */ - packetsReceived?: bigint; + packetsReceived = protoInt64.zero; /** - * @generated from field: required int64 packets_lost = 2; + * @generated from field: int64 packets_lost = 2; */ - packetsLost?: bigint; + packetsLost = protoInt64.zero; /** - * @generated from field: required double jitter = 3; + * @generated from field: double jitter = 3; */ - jitter?: number; + jitter = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.ReceivedRtpStreamStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "packets_lost", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, - { no: 3, name: "jitter", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "packets_lost", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "jitter", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ReceivedRtpStreamStats { @@ -1392,7 +1392,7 @@ export class ReceivedRtpStreamStats extends Message { } static equals(a: ReceivedRtpStreamStats | PlainMessage | undefined, b: ReceivedRtpStreamStats | PlainMessage | undefined): boolean { - return proto2.util.equals(ReceivedRtpStreamStats, a, b); + return proto3.util.equals(ReceivedRtpStreamStats, a, b); } } @@ -1401,331 +1401,331 @@ export class ReceivedRtpStreamStats extends Message { */ export class InboundRtpStreamStats extends Message { /** - * @generated from field: required string track_identifier = 1; + * @generated from field: string track_identifier = 1; */ - trackIdentifier?: string; + trackIdentifier = ""; /** - * @generated from field: required string mid = 2; + * @generated from field: string mid = 2; */ - mid?: string; + mid = ""; /** - * @generated from field: required string remote_id = 3; + * @generated from field: string remote_id = 3; */ - remoteId?: string; + remoteId = ""; /** - * @generated from field: required uint32 frames_decoded = 4; + * @generated from field: uint32 frames_decoded = 4; */ - framesDecoded?: number; + framesDecoded = 0; /** - * @generated from field: required uint32 key_frames_decoded = 5; + * @generated from field: uint32 key_frames_decoded = 5; */ - keyFramesDecoded?: number; + keyFramesDecoded = 0; /** - * @generated from field: required uint32 frames_rendered = 6; + * @generated from field: uint32 frames_rendered = 6; */ - framesRendered?: number; + framesRendered = 0; /** - * @generated from field: required uint32 frames_dropped = 7; + * @generated from field: uint32 frames_dropped = 7; */ - framesDropped?: number; + framesDropped = 0; /** - * @generated from field: required uint32 frame_width = 8; + * @generated from field: uint32 frame_width = 8; */ - frameWidth?: number; + frameWidth = 0; /** - * @generated from field: required uint32 frame_height = 9; + * @generated from field: uint32 frame_height = 9; */ - frameHeight?: number; + frameHeight = 0; /** - * @generated from field: required double frames_per_second = 10; + * @generated from field: double frames_per_second = 10; */ - framesPerSecond?: number; + framesPerSecond = 0; /** - * @generated from field: required uint64 qp_sum = 11; + * @generated from field: uint64 qp_sum = 11; */ - qpSum?: bigint; + qpSum = protoInt64.zero; /** - * @generated from field: required double total_decode_time = 12; + * @generated from field: double total_decode_time = 12; */ - totalDecodeTime?: number; + totalDecodeTime = 0; /** - * @generated from field: required double total_inter_frame_delay = 13; + * @generated from field: double total_inter_frame_delay = 13; */ - totalInterFrameDelay?: number; + totalInterFrameDelay = 0; /** - * @generated from field: required double total_squared_inter_frame_delay = 14; + * @generated from field: double total_squared_inter_frame_delay = 14; */ - totalSquaredInterFrameDelay?: number; + totalSquaredInterFrameDelay = 0; /** - * @generated from field: required uint32 pause_count = 15; + * @generated from field: uint32 pause_count = 15; */ - pauseCount?: number; + pauseCount = 0; /** - * @generated from field: required double total_pause_duration = 16; + * @generated from field: double total_pause_duration = 16; */ - totalPauseDuration?: number; + totalPauseDuration = 0; /** - * @generated from field: required uint32 freeze_count = 17; + * @generated from field: uint32 freeze_count = 17; */ - freezeCount?: number; + freezeCount = 0; /** - * @generated from field: required double total_freeze_duration = 18; + * @generated from field: double total_freeze_duration = 18; */ - totalFreezeDuration?: number; + totalFreezeDuration = 0; /** - * @generated from field: required double last_packet_received_timestamp = 19; + * @generated from field: double last_packet_received_timestamp = 19; */ - lastPacketReceivedTimestamp?: number; + lastPacketReceivedTimestamp = 0; /** - * @generated from field: required uint64 header_bytes_received = 20; + * @generated from field: uint64 header_bytes_received = 20; */ - headerBytesReceived?: bigint; + headerBytesReceived = protoInt64.zero; /** - * @generated from field: required uint64 packets_discarded = 21; + * @generated from field: uint64 packets_discarded = 21; */ - packetsDiscarded?: bigint; + packetsDiscarded = protoInt64.zero; /** - * @generated from field: required uint64 fec_bytes_received = 22; + * @generated from field: uint64 fec_bytes_received = 22; */ - fecBytesReceived?: bigint; + fecBytesReceived = protoInt64.zero; /** - * @generated from field: required uint64 fec_packets_received = 23; + * @generated from field: uint64 fec_packets_received = 23; */ - fecPacketsReceived?: bigint; + fecPacketsReceived = protoInt64.zero; /** - * @generated from field: required uint64 fec_packets_discarded = 24; + * @generated from field: uint64 fec_packets_discarded = 24; */ - fecPacketsDiscarded?: bigint; + fecPacketsDiscarded = protoInt64.zero; /** - * @generated from field: required uint64 bytes_received = 25; + * @generated from field: uint64 bytes_received = 25; */ - bytesReceived?: bigint; + bytesReceived = protoInt64.zero; /** - * @generated from field: required uint32 nack_count = 26; + * @generated from field: uint32 nack_count = 26; */ - nackCount?: number; + nackCount = 0; /** - * @generated from field: required uint32 fir_count = 27; + * @generated from field: uint32 fir_count = 27; */ - firCount?: number; + firCount = 0; /** - * @generated from field: required uint32 pli_count = 28; + * @generated from field: uint32 pli_count = 28; */ - pliCount?: number; + pliCount = 0; /** - * @generated from field: required double total_processing_delay = 29; + * @generated from field: double total_processing_delay = 29; */ - totalProcessingDelay?: number; + totalProcessingDelay = 0; /** - * @generated from field: required double estimated_playout_timestamp = 30; + * @generated from field: double estimated_playout_timestamp = 30; */ - estimatedPlayoutTimestamp?: number; + estimatedPlayoutTimestamp = 0; /** - * @generated from field: required double jitter_buffer_delay = 31; + * @generated from field: double jitter_buffer_delay = 31; */ - jitterBufferDelay?: number; + jitterBufferDelay = 0; /** - * @generated from field: required double jitter_buffer_target_delay = 32; + * @generated from field: double jitter_buffer_target_delay = 32; */ - jitterBufferTargetDelay?: number; + jitterBufferTargetDelay = 0; /** - * @generated from field: required uint64 jitter_buffer_emitted_count = 33; + * @generated from field: uint64 jitter_buffer_emitted_count = 33; */ - jitterBufferEmittedCount?: bigint; + jitterBufferEmittedCount = protoInt64.zero; /** - * @generated from field: required double jitter_buffer_minimum_delay = 34; + * @generated from field: double jitter_buffer_minimum_delay = 34; */ - jitterBufferMinimumDelay?: number; + jitterBufferMinimumDelay = 0; /** - * @generated from field: required uint64 total_samples_received = 35; + * @generated from field: uint64 total_samples_received = 35; */ - totalSamplesReceived?: bigint; + totalSamplesReceived = protoInt64.zero; /** - * @generated from field: required uint64 concealed_samples = 36; + * @generated from field: uint64 concealed_samples = 36; */ - concealedSamples?: bigint; + concealedSamples = protoInt64.zero; /** - * @generated from field: required uint64 silent_concealed_samples = 37; + * @generated from field: uint64 silent_concealed_samples = 37; */ - silentConcealedSamples?: bigint; + silentConcealedSamples = protoInt64.zero; /** - * @generated from field: required uint64 concealment_events = 38; + * @generated from field: uint64 concealment_events = 38; */ - concealmentEvents?: bigint; + concealmentEvents = protoInt64.zero; /** - * @generated from field: required uint64 inserted_samples_for_deceleration = 39; + * @generated from field: uint64 inserted_samples_for_deceleration = 39; */ - insertedSamplesForDeceleration?: bigint; + insertedSamplesForDeceleration = protoInt64.zero; /** - * @generated from field: required uint64 removed_samples_for_acceleration = 40; + * @generated from field: uint64 removed_samples_for_acceleration = 40; */ - removedSamplesForAcceleration?: bigint; + removedSamplesForAcceleration = protoInt64.zero; /** - * @generated from field: required double audio_level = 41; + * @generated from field: double audio_level = 41; */ - audioLevel?: number; + audioLevel = 0; /** - * @generated from field: required double total_audio_energy = 42; + * @generated from field: double total_audio_energy = 42; */ - totalAudioEnergy?: number; + totalAudioEnergy = 0; /** - * @generated from field: required double total_samples_duration = 43; + * @generated from field: double total_samples_duration = 43; */ - totalSamplesDuration?: number; + totalSamplesDuration = 0; /** - * @generated from field: required uint64 frames_received = 44; + * @generated from field: uint64 frames_received = 44; */ - framesReceived?: bigint; + framesReceived = protoInt64.zero; /** - * @generated from field: required string decoder_implementation = 45; + * @generated from field: string decoder_implementation = 45; */ - decoderImplementation?: string; + decoderImplementation = ""; /** - * @generated from field: required string playout_id = 46; + * @generated from field: string playout_id = 46; */ - playoutId?: string; + playoutId = ""; /** - * @generated from field: required bool power_efficient_decoder = 47; + * @generated from field: bool power_efficient_decoder = 47; */ - powerEfficientDecoder?: boolean; + powerEfficientDecoder = false; /** - * @generated from field: required uint64 frames_assembled_from_multiple_packets = 48; + * @generated from field: uint64 frames_assembled_from_multiple_packets = 48; */ - framesAssembledFromMultiplePackets?: bigint; + framesAssembledFromMultiplePackets = protoInt64.zero; /** - * @generated from field: required double total_assembly_time = 49; + * @generated from field: double total_assembly_time = 49; */ - totalAssemblyTime?: number; + totalAssemblyTime = 0; /** - * @generated from field: required uint64 retransmitted_packets_received = 50; + * @generated from field: uint64 retransmitted_packets_received = 50; */ - retransmittedPacketsReceived?: bigint; + retransmittedPacketsReceived = protoInt64.zero; /** - * @generated from field: required uint64 retransmitted_bytes_received = 51; + * @generated from field: uint64 retransmitted_bytes_received = 51; */ - retransmittedBytesReceived?: bigint; + retransmittedBytesReceived = protoInt64.zero; /** - * @generated from field: required uint32 rtx_ssrc = 52; + * @generated from field: uint32 rtx_ssrc = 52; */ - rtxSsrc?: number; + rtxSsrc = 0; /** - * @generated from field: required uint32 fec_ssrc = 53; + * @generated from field: uint32 fec_ssrc = 53; */ - fecSsrc?: number; + fecSsrc = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.InboundRtpStreamStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 4, name: "frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 5, name: "key_frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 6, name: "frames_rendered", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 7, name: "frames_dropped", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 8, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 9, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 10, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 11, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 12, name: "total_decode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 13, name: "total_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 14, name: "total_squared_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 15, name: "pause_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 16, name: "total_pause_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 17, name: "freeze_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 18, name: "total_freeze_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 19, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 20, name: "header_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 21, name: "packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 22, name: "fec_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 23, name: "fec_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 24, name: "fec_packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 25, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 26, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 27, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 28, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 29, name: "total_processing_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 30, name: "estimated_playout_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 31, name: "jitter_buffer_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 32, name: "jitter_buffer_target_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 33, name: "jitter_buffer_emitted_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 34, name: "jitter_buffer_minimum_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 35, name: "total_samples_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 36, name: "concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 37, name: "silent_concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 38, name: "concealment_events", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 39, name: "inserted_samples_for_deceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 40, name: "removed_samples_for_acceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 41, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 42, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 43, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 44, name: "frames_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 45, name: "decoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 46, name: "playout_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 47, name: "power_efficient_decoder", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 48, name: "frames_assembled_from_multiple_packets", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 49, name: "total_assembly_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 50, name: "retransmitted_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 51, name: "retransmitted_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 52, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 53, name: "fec_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 5, name: "key_frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 6, name: "frames_rendered", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 7, name: "frames_dropped", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 8, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 9, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 10, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 11, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 12, name: "total_decode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 13, name: "total_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 14, name: "total_squared_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 15, name: "pause_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 16, name: "total_pause_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 17, name: "freeze_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 18, name: "total_freeze_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 19, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 20, name: "header_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 21, name: "packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 22, name: "fec_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 23, name: "fec_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 24, name: "fec_packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 25, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 26, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 27, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 28, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 29, name: "total_processing_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 30, name: "estimated_playout_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 31, name: "jitter_buffer_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 32, name: "jitter_buffer_target_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 33, name: "jitter_buffer_emitted_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 34, name: "jitter_buffer_minimum_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 35, name: "total_samples_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 36, name: "concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 37, name: "silent_concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 38, name: "concealment_events", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 39, name: "inserted_samples_for_deceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 40, name: "removed_samples_for_acceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 41, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 42, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 43, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 44, name: "frames_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 45, name: "decoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 46, name: "playout_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 47, name: "power_efficient_decoder", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 48, name: "frames_assembled_from_multiple_packets", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 49, name: "total_assembly_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 50, name: "retransmitted_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 51, name: "retransmitted_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 52, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 53, name: "fec_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): InboundRtpStreamStats { @@ -1741,7 +1741,7 @@ export class InboundRtpStreamStats extends Message { } static equals(a: InboundRtpStreamStats | PlainMessage | undefined, b: InboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto2.util.equals(InboundRtpStreamStats, a, b); + return proto3.util.equals(InboundRtpStreamStats, a, b); } } @@ -1750,25 +1750,25 @@ export class InboundRtpStreamStats extends Message { */ export class SentRtpStreamStats extends Message { /** - * @generated from field: required uint64 packets_sent = 1; + * @generated from field: uint64 packets_sent = 1; */ - packetsSent?: bigint; + packetsSent = protoInt64.zero; /** - * @generated from field: required uint64 bytes_sent = 2; + * @generated from field: uint64 bytes_sent = 2; */ - bytesSent?: bigint; + bytesSent = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.SentRtpStreamStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SentRtpStreamStats { @@ -1784,7 +1784,7 @@ export class SentRtpStreamStats extends Message { } static equals(a: SentRtpStreamStats | PlainMessage | undefined, b: SentRtpStreamStats | PlainMessage | undefined): boolean { - return proto2.util.equals(SentRtpStreamStats, a, b); + return proto3.util.equals(SentRtpStreamStats, a, b); } } @@ -1793,109 +1793,109 @@ export class SentRtpStreamStats extends Message { */ export class OutboundRtpStreamStats extends Message { /** - * @generated from field: required string mid = 1; + * @generated from field: string mid = 1; */ - mid?: string; + mid = ""; /** - * @generated from field: required string media_source_id = 2; + * @generated from field: string media_source_id = 2; */ - mediaSourceId?: string; + mediaSourceId = ""; /** - * @generated from field: required string remote_id = 3; + * @generated from field: string remote_id = 3; */ - remoteId?: string; + remoteId = ""; /** - * @generated from field: required string rid = 4; + * @generated from field: string rid = 4; */ - rid?: string; + rid = ""; /** - * @generated from field: required uint64 header_bytes_sent = 5; + * @generated from field: uint64 header_bytes_sent = 5; */ - headerBytesSent?: bigint; + headerBytesSent = protoInt64.zero; /** - * @generated from field: required uint64 retransmitted_packets_sent = 6; + * @generated from field: uint64 retransmitted_packets_sent = 6; */ - retransmittedPacketsSent?: bigint; + retransmittedPacketsSent = protoInt64.zero; /** - * @generated from field: required uint64 retransmitted_bytes_sent = 7; + * @generated from field: uint64 retransmitted_bytes_sent = 7; */ - retransmittedBytesSent?: bigint; + retransmittedBytesSent = protoInt64.zero; /** - * @generated from field: required uint32 rtx_ssrc = 8; + * @generated from field: uint32 rtx_ssrc = 8; */ - rtxSsrc?: number; + rtxSsrc = 0; /** - * @generated from field: required double target_bitrate = 9; + * @generated from field: double target_bitrate = 9; */ - targetBitrate?: number; + targetBitrate = 0; /** - * @generated from field: required uint64 total_encoded_bytes_target = 10; + * @generated from field: uint64 total_encoded_bytes_target = 10; */ - totalEncodedBytesTarget?: bigint; + totalEncodedBytesTarget = protoInt64.zero; /** - * @generated from field: required uint32 frame_width = 11; + * @generated from field: uint32 frame_width = 11; */ - frameWidth?: number; + frameWidth = 0; /** - * @generated from field: required uint32 frame_height = 12; + * @generated from field: uint32 frame_height = 12; */ - frameHeight?: number; + frameHeight = 0; /** - * @generated from field: required double frames_per_second = 13; + * @generated from field: double frames_per_second = 13; */ - framesPerSecond?: number; + framesPerSecond = 0; /** - * @generated from field: required uint32 frames_sent = 14; + * @generated from field: uint32 frames_sent = 14; */ - framesSent?: number; + framesSent = 0; /** - * @generated from field: required uint32 huge_frames_sent = 15; + * @generated from field: uint32 huge_frames_sent = 15; */ - hugeFramesSent?: number; + hugeFramesSent = 0; /** - * @generated from field: required uint32 frames_encoded = 16; + * @generated from field: uint32 frames_encoded = 16; */ - framesEncoded?: number; + framesEncoded = 0; /** - * @generated from field: required uint32 key_frames_encoded = 17; + * @generated from field: uint32 key_frames_encoded = 17; */ - keyFramesEncoded?: number; + keyFramesEncoded = 0; /** - * @generated from field: required uint64 qp_sum = 18; + * @generated from field: uint64 qp_sum = 18; */ - qpSum?: bigint; + qpSum = protoInt64.zero; /** - * @generated from field: required double total_encode_time = 19; + * @generated from field: double total_encode_time = 19; */ - totalEncodeTime?: number; + totalEncodeTime = 0; /** - * @generated from field: required double total_packet_send_delay = 20; + * @generated from field: double total_packet_send_delay = 20; */ - totalPacketSendDelay?: number; + totalPacketSendDelay = 0; /** - * @generated from field: required livekit.proto.QualityLimitationReason quality_limitation_reason = 21; + * @generated from field: livekit.proto.QualityLimitationReason quality_limitation_reason = 21; */ - qualityLimitationReason?: QualityLimitationReason; + qualityLimitationReason = QualityLimitationReason.LIMITATION_NONE; /** * @generated from field: map quality_limitation_durations = 22; @@ -1903,83 +1903,83 @@ export class OutboundRtpStreamStats extends Message { qualityLimitationDurations: { [key: string]: number } = {}; /** - * @generated from field: required uint32 quality_limitation_resolution_changes = 23; + * @generated from field: uint32 quality_limitation_resolution_changes = 23; */ - qualityLimitationResolutionChanges?: number; + qualityLimitationResolutionChanges = 0; /** - * @generated from field: required uint32 nack_count = 24; + * @generated from field: uint32 nack_count = 24; */ - nackCount?: number; + nackCount = 0; /** - * @generated from field: required uint32 fir_count = 25; + * @generated from field: uint32 fir_count = 25; */ - firCount?: number; + firCount = 0; /** - * @generated from field: required uint32 pli_count = 26; + * @generated from field: uint32 pli_count = 26; */ - pliCount?: number; + pliCount = 0; /** - * @generated from field: required string encoder_implementation = 27; + * @generated from field: string encoder_implementation = 27; */ - encoderImplementation?: string; + encoderImplementation = ""; /** - * @generated from field: required bool power_efficient_encoder = 28; + * @generated from field: bool power_efficient_encoder = 28; */ - powerEfficientEncoder?: boolean; + powerEfficientEncoder = false; /** - * @generated from field: required bool active = 29; + * @generated from field: bool active = 29; */ - active?: boolean; + active = false; /** - * @generated from field: required string scalability_mode = 30; + * @generated from field: string scalibility_mode = 30; */ - scalabilityMode?: string; + scalibilityMode = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OutboundRtpStreamStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "media_source_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 4, name: "rid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 5, name: "header_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 6, name: "retransmitted_packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 7, name: "retransmitted_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 8, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 9, name: "target_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 10, name: "total_encoded_bytes_target", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 11, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 12, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 13, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 14, name: "frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 15, name: "huge_frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 16, name: "frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 17, name: "key_frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 18, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 19, name: "total_encode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 20, name: "total_packet_send_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 21, name: "quality_limitation_reason", kind: "enum", T: proto2.getEnumType(QualityLimitationReason), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "media_source_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "rid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "header_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 6, name: "retransmitted_packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 7, name: "retransmitted_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 8, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 9, name: "target_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 10, name: "total_encoded_bytes_target", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 11, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 12, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 13, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 14, name: "frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 15, name: "huge_frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 16, name: "frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 17, name: "key_frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 18, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 19, name: "total_encode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 20, name: "total_packet_send_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 21, name: "quality_limitation_reason", kind: "enum", T: proto3.getEnumType(QualityLimitationReason) }, { no: 22, name: "quality_limitation_durations", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 1 /* ScalarType.DOUBLE */} }, - { no: 23, name: "quality_limitation_resolution_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 24, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 25, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 26, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 27, name: "encoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 28, name: "power_efficient_encoder", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 29, name: "active", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 30, name: "scalability_mode", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 23, name: "quality_limitation_resolution_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 24, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 25, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 26, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 27, name: "encoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 28, name: "power_efficient_encoder", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 29, name: "active", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 30, name: "scalibility_mode", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OutboundRtpStreamStats { @@ -1995,7 +1995,7 @@ export class OutboundRtpStreamStats extends Message { } static equals(a: OutboundRtpStreamStats | PlainMessage | undefined, b: OutboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto2.util.equals(OutboundRtpStreamStats, a, b); + return proto3.util.equals(OutboundRtpStreamStats, a, b); } } @@ -2004,43 +2004,43 @@ export class OutboundRtpStreamStats extends Message { */ export class RemoteInboundRtpStreamStats extends Message { /** - * @generated from field: required string local_id = 1; + * @generated from field: string local_id = 1; */ - localId?: string; + localId = ""; /** - * @generated from field: required double round_trip_time = 2; + * @generated from field: double round_trip_time = 2; */ - roundTripTime?: number; + roundTripTime = 0; /** - * @generated from field: required double total_round_trip_time = 3; + * @generated from field: double total_round_trip_time = 3; */ - totalRoundTripTime?: number; + totalRoundTripTime = 0; /** - * @generated from field: required double fraction_lost = 4; + * @generated from field: double fraction_lost = 4; */ - fractionLost?: number; + fractionLost = 0; /** - * @generated from field: required uint64 round_trip_time_measurements = 5; + * @generated from field: uint64 round_trip_time_measurements = 5; */ - roundTripTimeMeasurements?: bigint; + roundTripTimeMeasurements = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RemoteInboundRtpStreamStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 3, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 4, name: "fraction_lost", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 5, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 3, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 4, name: "fraction_lost", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 5, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RemoteInboundRtpStreamStats { @@ -2056,7 +2056,7 @@ export class RemoteInboundRtpStreamStats extends Message | undefined, b: RemoteInboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto2.util.equals(RemoteInboundRtpStreamStats, a, b); + return proto3.util.equals(RemoteInboundRtpStreamStats, a, b); } } @@ -2065,49 +2065,49 @@ export class RemoteInboundRtpStreamStats extends Message { /** - * @generated from field: required string local_id = 1; + * @generated from field: string local_id = 1; */ - localId?: string; + localId = ""; /** - * @generated from field: required double remote_timestamp = 2; + * @generated from field: double remote_timestamp = 2; */ - remoteTimestamp?: number; + remoteTimestamp = 0; /** - * @generated from field: required uint64 reports_sent = 3; + * @generated from field: uint64 reports_sent = 3; */ - reportsSent?: bigint; + reportsSent = protoInt64.zero; /** - * @generated from field: required double round_trip_time = 4; + * @generated from field: double round_trip_time = 4; */ - roundTripTime?: number; + roundTripTime = 0; /** - * @generated from field: required double total_round_trip_time = 5; + * @generated from field: double total_round_trip_time = 5; */ - totalRoundTripTime?: number; + totalRoundTripTime = 0; /** - * @generated from field: required uint64 round_trip_time_measurements = 6; + * @generated from field: uint64 round_trip_time_measurements = 6; */ - roundTripTimeMeasurements?: bigint; + roundTripTimeMeasurements = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.RemoteOutboundRtpStreamStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "remote_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 3, name: "reports_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 4, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 5, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 6, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "remote_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 3, name: "reports_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 4, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 5, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 6, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RemoteOutboundRtpStreamStats { @@ -2123,7 +2123,7 @@ export class RemoteOutboundRtpStreamStats extends Message | undefined, b: RemoteOutboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto2.util.equals(RemoteOutboundRtpStreamStats, a, b); + return proto3.util.equals(RemoteOutboundRtpStreamStats, a, b); } } @@ -2132,25 +2132,25 @@ export class RemoteOutboundRtpStreamStats extends Message { /** - * @generated from field: required string track_identifier = 1; + * @generated from field: string track_identifier = 1; */ - trackIdentifier?: string; + trackIdentifier = ""; /** - * @generated from field: required string kind = 2; + * @generated from field: string kind = 2; */ - kind?: string; + kind = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.MediaSourceStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): MediaSourceStats { @@ -2166,7 +2166,7 @@ export class MediaSourceStats extends Message { } static equals(a: MediaSourceStats | PlainMessage | undefined, b: MediaSourceStats | PlainMessage | undefined): boolean { - return proto2.util.equals(MediaSourceStats, a, b); + return proto3.util.equals(MediaSourceStats, a, b); } } @@ -2175,67 +2175,67 @@ export class MediaSourceStats extends Message { */ export class AudioSourceStats extends Message { /** - * @generated from field: required double audio_level = 1; + * @generated from field: double audio_level = 1; */ - audioLevel?: number; + audioLevel = 0; /** - * @generated from field: required double total_audio_energy = 2; + * @generated from field: double total_audio_energy = 2; */ - totalAudioEnergy?: number; + totalAudioEnergy = 0; /** - * @generated from field: required double total_samples_duration = 3; + * @generated from field: double total_samples_duration = 3; */ - totalSamplesDuration?: number; + totalSamplesDuration = 0; /** - * @generated from field: required double echo_return_loss = 4; + * @generated from field: double echo_return_loss = 4; */ - echoReturnLoss?: number; + echoReturnLoss = 0; /** - * @generated from field: required double echo_return_loss_enhancement = 5; + * @generated from field: double echo_return_loss_enhancement = 5; */ - echoReturnLossEnhancement?: number; + echoReturnLossEnhancement = 0; /** - * @generated from field: required double dropped_samples_duration = 6; + * @generated from field: double dropped_samples_duration = 6; */ - droppedSamplesDuration?: number; + droppedSamplesDuration = 0; /** - * @generated from field: required uint32 dropped_samples_events = 7; + * @generated from field: uint32 dropped_samples_events = 7; */ - droppedSamplesEvents?: number; + droppedSamplesEvents = 0; /** - * @generated from field: required double total_capture_delay = 8; + * @generated from field: double total_capture_delay = 8; */ - totalCaptureDelay?: number; + totalCaptureDelay = 0; /** - * @generated from field: required uint64 total_samples_captured = 9; + * @generated from field: uint64 total_samples_captured = 9; */ - totalSamplesCaptured?: bigint; + totalSamplesCaptured = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioSourceStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 2, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 3, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 4, name: "echo_return_loss", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 5, name: "echo_return_loss_enhancement", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 6, name: "dropped_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 7, name: "dropped_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 8, name: "total_capture_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 9, name: "total_samples_captured", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 2, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 3, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 4, name: "echo_return_loss", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 5, name: "echo_return_loss_enhancement", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 6, name: "dropped_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 7, name: "dropped_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 8, name: "total_capture_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 9, name: "total_samples_captured", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioSourceStats { @@ -2251,7 +2251,7 @@ export class AudioSourceStats extends Message { } static equals(a: AudioSourceStats | PlainMessage | undefined, b: AudioSourceStats | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioSourceStats, a, b); + return proto3.util.equals(AudioSourceStats, a, b); } } @@ -2260,37 +2260,37 @@ export class AudioSourceStats extends Message { */ export class VideoSourceStats extends Message { /** - * @generated from field: required uint32 width = 1; + * @generated from field: uint32 width = 1; */ - width?: number; + width = 0; /** - * @generated from field: required uint32 height = 2; + * @generated from field: uint32 height = 2; */ - height?: number; + height = 0; /** - * @generated from field: required uint32 frames = 3; + * @generated from field: uint32 frames = 3; */ - frames?: number; + frames = 0; /** - * @generated from field: required double frames_per_second = 4; + * @generated from field: double frames_per_second = 4; */ - framesPerSecond?: number; + framesPerSecond = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoSourceStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 3, name: "frames", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 4, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: "frames", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 4, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoSourceStats { @@ -2306,7 +2306,7 @@ export class VideoSourceStats extends Message { } static equals(a: VideoSourceStats | PlainMessage | undefined, b: VideoSourceStats | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoSourceStats, a, b); + return proto3.util.equals(VideoSourceStats, a, b); } } @@ -2315,49 +2315,49 @@ export class VideoSourceStats extends Message { */ export class AudioPlayoutStats extends Message { /** - * @generated from field: required string kind = 1; + * @generated from field: string kind = 1; */ - kind?: string; + kind = ""; /** - * @generated from field: required double synthesized_samples_duration = 2; + * @generated from field: double synthesized_samples_duration = 2; */ - synthesizedSamplesDuration?: number; + synthesizedSamplesDuration = 0; /** - * @generated from field: required uint32 synthesized_samples_events = 3; + * @generated from field: uint32 synthesized_samples_events = 3; */ - synthesizedSamplesEvents?: number; + synthesizedSamplesEvents = 0; /** - * @generated from field: required double total_samples_duration = 4; + * @generated from field: double total_samples_duration = 4; */ - totalSamplesDuration?: number; + totalSamplesDuration = 0; /** - * @generated from field: required double total_playout_delay = 5; + * @generated from field: double total_playout_delay = 5; */ - totalPlayoutDelay?: number; + totalPlayoutDelay = 0; /** - * @generated from field: required uint64 total_samples_count = 6; + * @generated from field: uint64 total_samples_count = 6; */ - totalSamplesCount?: bigint; + totalSamplesCount = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.AudioPlayoutStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "synthesized_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 3, name: "synthesized_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 4, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 5, name: "total_playout_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 6, name: "total_samples_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "synthesized_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 3, name: "synthesized_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 4, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 5, name: "total_playout_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 6, name: "total_samples_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AudioPlayoutStats { @@ -2373,7 +2373,7 @@ export class AudioPlayoutStats extends Message { } static equals(a: AudioPlayoutStats | PlainMessage | undefined, b: AudioPlayoutStats | PlainMessage | undefined): boolean { - return proto2.util.equals(AudioPlayoutStats, a, b); + return proto3.util.equals(AudioPlayoutStats, a, b); } } @@ -2382,25 +2382,25 @@ export class AudioPlayoutStats extends Message { */ export class PeerConnectionStats extends Message { /** - * @generated from field: required uint32 data_channels_opened = 1; + * @generated from field: uint32 data_channels_opened = 1; */ - dataChannelsOpened?: number; + dataChannelsOpened = 0; /** - * @generated from field: required uint32 data_channels_closed = 2; + * @generated from field: uint32 data_channels_closed = 2; */ - dataChannelsClosed?: number; + dataChannelsClosed = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.PeerConnectionStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "data_channels_opened", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 2, name: "data_channels_closed", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "data_channels_opened", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "data_channels_closed", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PeerConnectionStats { @@ -2416,7 +2416,7 @@ export class PeerConnectionStats extends Message { } static equals(a: PeerConnectionStats | PlainMessage | undefined, b: PeerConnectionStats | PlainMessage | undefined): boolean { - return proto2.util.equals(PeerConnectionStats, a, b); + return proto3.util.equals(PeerConnectionStats, a, b); } } @@ -2425,19 +2425,19 @@ export class PeerConnectionStats extends Message { */ export class DataChannelStats extends Message { /** - * @generated from field: required string label = 1; + * @generated from field: string label = 1; */ - label?: string; + label = ""; /** - * @generated from field: required string protocol = 2; + * @generated from field: string protocol = 2; */ - protocol?: string; + protocol = ""; /** - * @generated from field: required int32 data_channel_identifier = 3; + * @generated from field: int32 data_channel_identifier = 3; */ - dataChannelIdentifier?: number; + dataChannelIdentifier = 0; /** * @generated from field: optional livekit.proto.DataChannelState state = 4; @@ -2445,41 +2445,41 @@ export class DataChannelStats extends Message { state?: DataChannelState; /** - * @generated from field: required uint32 messages_sent = 5; + * @generated from field: uint32 messages_sent = 5; */ - messagesSent?: number; + messagesSent = 0; /** - * @generated from field: required uint64 bytes_sent = 6; + * @generated from field: uint64 bytes_sent = 6; */ - bytesSent?: bigint; + bytesSent = protoInt64.zero; /** - * @generated from field: required uint32 messages_received = 7; + * @generated from field: uint32 messages_received = 7; */ - messagesReceived?: number; + messagesReceived = 0; /** - * @generated from field: required uint64 bytes_received = 8; + * @generated from field: uint64 bytes_received = 8; */ - bytesReceived?: bigint; + bytesReceived = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.DataChannelStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "label", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "data_channel_identifier", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 4, name: "state", kind: "enum", T: proto2.getEnumType(DataChannelState), opt: true }, - { no: 5, name: "messages_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 6, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 7, name: "messages_received", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 8, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "label", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "data_channel_identifier", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "state", kind: "enum", T: proto3.getEnumType(DataChannelState), opt: true }, + { no: 5, name: "messages_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 6, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 7, name: "messages_received", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 8, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DataChannelStats { @@ -2495,7 +2495,7 @@ export class DataChannelStats extends Message { } static equals(a: DataChannelStats | PlainMessage | undefined, b: DataChannelStats | PlainMessage | undefined): boolean { - return proto2.util.equals(DataChannelStats, a, b); + return proto3.util.equals(DataChannelStats, a, b); } } @@ -2504,34 +2504,34 @@ export class DataChannelStats extends Message { */ export class TransportStats extends Message { /** - * @generated from field: required uint64 packets_sent = 1; + * @generated from field: uint64 packets_sent = 1; */ - packetsSent?: bigint; + packetsSent = protoInt64.zero; /** - * @generated from field: required uint64 packets_received = 2; + * @generated from field: uint64 packets_received = 2; */ - packetsReceived?: bigint; + packetsReceived = protoInt64.zero; /** - * @generated from field: required uint64 bytes_sent = 3; + * @generated from field: uint64 bytes_sent = 3; */ - bytesSent?: bigint; + bytesSent = protoInt64.zero; /** - * @generated from field: required uint64 bytes_received = 4; + * @generated from field: uint64 bytes_received = 4; */ - bytesReceived?: bigint; + bytesReceived = protoInt64.zero; /** - * @generated from field: required livekit.proto.IceRole ice_role = 5; + * @generated from field: livekit.proto.IceRole ice_role = 5; */ - iceRole?: IceRole; + iceRole = IceRole.ICE_UNKNOWN; /** - * @generated from field: required string ice_local_username_fragment = 6; + * @generated from field: string ice_local_username_fragment = 6; */ - iceLocalUsernameFragment?: string; + iceLocalUsernameFragment = ""; /** * @generated from field: optional livekit.proto.DtlsTransportState dtls_state = 7; @@ -2544,69 +2544,69 @@ export class TransportStats extends Message { iceState?: IceTransportState; /** - * @generated from field: required string selected_candidate_pair_id = 9; + * @generated from field: string selected_candidate_pair_id = 9; */ - selectedCandidatePairId?: string; + selectedCandidatePairId = ""; /** - * @generated from field: required string local_certificate_id = 10; + * @generated from field: string local_certificate_id = 10; */ - localCertificateId?: string; + localCertificateId = ""; /** - * @generated from field: required string remote_certificate_id = 11; + * @generated from field: string remote_certificate_id = 11; */ - remoteCertificateId?: string; + remoteCertificateId = ""; /** - * @generated from field: required string tls_version = 12; + * @generated from field: string tls_version = 12; */ - tlsVersion?: string; + tlsVersion = ""; /** - * @generated from field: required string dtls_cipher = 13; + * @generated from field: string dtls_cipher = 13; */ - dtlsCipher?: string; + dtlsCipher = ""; /** - * @generated from field: required livekit.proto.DtlsRole dtls_role = 14; + * @generated from field: livekit.proto.DtlsRole dtls_role = 14; */ - dtlsRole?: DtlsRole; + dtlsRole = DtlsRole.DTLS_CLIENT; /** - * @generated from field: required string srtp_cipher = 15; + * @generated from field: string srtp_cipher = 15; */ - srtpCipher?: string; + srtpCipher = ""; /** - * @generated from field: required uint32 selected_candidate_pair_changes = 16; + * @generated from field: uint32 selected_candidate_pair_changes = 16; */ - selectedCandidatePairChanges?: number; + selectedCandidatePairChanges = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TransportStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 3, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 4, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 5, name: "ice_role", kind: "enum", T: proto2.getEnumType(IceRole), req: true }, - { no: 6, name: "ice_local_username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 7, name: "dtls_state", kind: "enum", T: proto2.getEnumType(DtlsTransportState), opt: true }, - { no: 8, name: "ice_state", kind: "enum", T: proto2.getEnumType(IceTransportState), opt: true }, - { no: 9, name: "selected_candidate_pair_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 10, name: "local_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 11, name: "remote_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 12, name: "tls_version", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 13, name: "dtls_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 14, name: "dtls_role", kind: "enum", T: proto2.getEnumType(DtlsRole), req: true }, - { no: 15, name: "srtp_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 16, name: "selected_candidate_pair_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 3, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 4, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 5, name: "ice_role", kind: "enum", T: proto3.getEnumType(IceRole) }, + { no: 6, name: "ice_local_username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "dtls_state", kind: "enum", T: proto3.getEnumType(DtlsTransportState), opt: true }, + { no: 8, name: "ice_state", kind: "enum", T: proto3.getEnumType(IceTransportState), opt: true }, + { no: 9, name: "selected_candidate_pair_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 10, name: "local_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "remote_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 12, name: "tls_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 13, name: "dtls_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 14, name: "dtls_role", kind: "enum", T: proto3.getEnumType(DtlsRole) }, + { no: 15, name: "srtp_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 16, name: "selected_candidate_pair_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TransportStats { @@ -2622,7 +2622,7 @@ export class TransportStats extends Message { } static equals(a: TransportStats | PlainMessage | undefined, b: TransportStats | PlainMessage | undefined): boolean { - return proto2.util.equals(TransportStats, a, b); + return proto3.util.equals(TransportStats, a, b); } } @@ -2631,19 +2631,19 @@ export class TransportStats extends Message { */ export class CandidatePairStats extends Message { /** - * @generated from field: required string transport_id = 1; + * @generated from field: string transport_id = 1; */ - transportId?: string; + transportId = ""; /** - * @generated from field: required string local_candidate_id = 2; + * @generated from field: string local_candidate_id = 2; */ - localCandidateId?: string; + localCandidateId = ""; /** - * @generated from field: required string remote_candidate_id = 3; + * @generated from field: string remote_candidate_id = 3; */ - remoteCandidateId?: string; + remoteCandidateId = ""; /** * @generated from field: optional livekit.proto.IceCandidatePairState state = 4; @@ -2651,125 +2651,125 @@ export class CandidatePairStats extends Message { state?: IceCandidatePairState; /** - * @generated from field: required bool nominated = 5; + * @generated from field: bool nominated = 5; */ - nominated?: boolean; + nominated = false; /** - * @generated from field: required uint64 packets_sent = 6; + * @generated from field: uint64 packets_sent = 6; */ - packetsSent?: bigint; + packetsSent = protoInt64.zero; /** - * @generated from field: required uint64 packets_received = 7; + * @generated from field: uint64 packets_received = 7; */ - packetsReceived?: bigint; + packetsReceived = protoInt64.zero; /** - * @generated from field: required uint64 bytes_sent = 8; + * @generated from field: uint64 bytes_sent = 8; */ - bytesSent?: bigint; + bytesSent = protoInt64.zero; /** - * @generated from field: required uint64 bytes_received = 9; + * @generated from field: uint64 bytes_received = 9; */ - bytesReceived?: bigint; + bytesReceived = protoInt64.zero; /** - * @generated from field: required double last_packet_sent_timestamp = 10; + * @generated from field: double last_packet_sent_timestamp = 10; */ - lastPacketSentTimestamp?: number; + lastPacketSentTimestamp = 0; /** - * @generated from field: required double last_packet_received_timestamp = 11; + * @generated from field: double last_packet_received_timestamp = 11; */ - lastPacketReceivedTimestamp?: number; + lastPacketReceivedTimestamp = 0; /** - * @generated from field: required double total_round_trip_time = 12; + * @generated from field: double total_round_trip_time = 12; */ - totalRoundTripTime?: number; + totalRoundTripTime = 0; /** - * @generated from field: required double current_round_trip_time = 13; + * @generated from field: double current_round_trip_time = 13; */ - currentRoundTripTime?: number; + currentRoundTripTime = 0; /** - * @generated from field: required double available_outgoing_bitrate = 14; + * @generated from field: double available_outgoing_bitrate = 14; */ - availableOutgoingBitrate?: number; + availableOutgoingBitrate = 0; /** - * @generated from field: required double available_incoming_bitrate = 15; + * @generated from field: double available_incoming_bitrate = 15; */ - availableIncomingBitrate?: number; + availableIncomingBitrate = 0; /** - * @generated from field: required uint64 requests_received = 16; + * @generated from field: uint64 requests_received = 16; */ - requestsReceived?: bigint; + requestsReceived = protoInt64.zero; /** - * @generated from field: required uint64 requests_sent = 17; + * @generated from field: uint64 requests_sent = 17; */ - requestsSent?: bigint; + requestsSent = protoInt64.zero; /** - * @generated from field: required uint64 responses_received = 18; + * @generated from field: uint64 responses_received = 18; */ - responsesReceived?: bigint; + responsesReceived = protoInt64.zero; /** - * @generated from field: required uint64 responses_sent = 19; + * @generated from field: uint64 responses_sent = 19; */ - responsesSent?: bigint; + responsesSent = protoInt64.zero; /** - * @generated from field: required uint64 consent_requests_sent = 20; + * @generated from field: uint64 consent_requests_sent = 20; */ - consentRequestsSent?: bigint; + consentRequestsSent = protoInt64.zero; /** - * @generated from field: required uint32 packets_discarded_on_send = 21; + * @generated from field: uint32 packets_discarded_on_send = 21; */ - packetsDiscardedOnSend?: number; + packetsDiscardedOnSend = 0; /** - * @generated from field: required uint64 bytes_discarded_on_send = 22; + * @generated from field: uint64 bytes_discarded_on_send = 22; */ - bytesDiscardedOnSend?: bigint; + bytesDiscardedOnSend = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CandidatePairStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "local_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "remote_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 4, name: "state", kind: "enum", T: proto2.getEnumType(IceCandidatePairState), opt: true }, - { no: 5, name: "nominated", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 6, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 7, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 8, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 9, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 10, name: "last_packet_sent_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 11, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 12, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 13, name: "current_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 14, name: "available_outgoing_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 15, name: "available_incoming_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, - { no: 16, name: "requests_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 17, name: "requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 18, name: "responses_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 19, name: "responses_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 20, name: "consent_requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 21, name: "packets_discarded_on_send", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 22, name: "bytes_discarded_on_send", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "local_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "remote_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "state", kind: "enum", T: proto3.getEnumType(IceCandidatePairState), opt: true }, + { no: 5, name: "nominated", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 7, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 8, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 9, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 10, name: "last_packet_sent_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 11, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 12, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 13, name: "current_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 14, name: "available_outgoing_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 15, name: "available_incoming_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 16, name: "requests_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 17, name: "requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 18, name: "responses_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 19, name: "responses_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 20, name: "consent_requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 21, name: "packets_discarded_on_send", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 22, name: "bytes_discarded_on_send", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CandidatePairStats { @@ -2785,7 +2785,7 @@ export class CandidatePairStats extends Message { } static equals(a: CandidatePairStats | PlainMessage | undefined, b: CandidatePairStats | PlainMessage | undefined): boolean { - return proto2.util.equals(CandidatePairStats, a, b); + return proto3.util.equals(CandidatePairStats, a, b); } } @@ -2794,24 +2794,24 @@ export class CandidatePairStats extends Message { */ export class IceCandidateStats extends Message { /** - * @generated from field: required string transport_id = 1; + * @generated from field: string transport_id = 1; */ - transportId?: string; + transportId = ""; /** - * @generated from field: required string address = 2; + * @generated from field: string address = 2; */ - address?: string; + address = ""; /** - * @generated from field: required int32 port = 3; + * @generated from field: int32 port = 3; */ - port?: number; + port = 0; /** - * @generated from field: required string protocol = 4; + * @generated from field: string protocol = 4; */ - protocol?: string; + protocol = ""; /** * @generated from field: optional livekit.proto.IceCandidateType candidate_type = 5; @@ -2819,14 +2819,14 @@ export class IceCandidateStats extends Message { candidateType?: IceCandidateType; /** - * @generated from field: required int32 priority = 6; + * @generated from field: int32 priority = 6; */ - priority?: number; + priority = 0; /** - * @generated from field: required string url = 7; + * @generated from field: string url = 7; */ - url?: string; + url = ""; /** * @generated from field: optional livekit.proto.IceServerTransportProtocol relay_protocol = 8; @@ -2834,24 +2834,24 @@ export class IceCandidateStats extends Message { relayProtocol?: IceServerTransportProtocol; /** - * @generated from field: required string foundation = 9; + * @generated from field: string foundation = 9; */ - foundation?: string; + foundation = ""; /** - * @generated from field: required string related_address = 10; + * @generated from field: string related_address = 10; */ - relatedAddress?: string; + relatedAddress = ""; /** - * @generated from field: required int32 related_port = 11; + * @generated from field: int32 related_port = 11; */ - relatedPort?: number; + relatedPort = 0; /** - * @generated from field: required string username_fragment = 12; + * @generated from field: string username_fragment = 12; */ - usernameFragment?: string; + usernameFragment = ""; /** * @generated from field: optional livekit.proto.IceTcpCandidateType tcp_type = 13; @@ -2860,25 +2860,25 @@ export class IceCandidateStats extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.IceCandidateStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "port", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 4, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 5, name: "candidate_type", kind: "enum", T: proto2.getEnumType(IceCandidateType), opt: true }, - { no: 6, name: "priority", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 7, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 8, name: "relay_protocol", kind: "enum", T: proto2.getEnumType(IceServerTransportProtocol), opt: true }, - { no: 9, name: "foundation", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 10, name: "related_address", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 11, name: "related_port", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true }, - { no: 12, name: "username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 13, name: "tcp_type", kind: "enum", T: proto2.getEnumType(IceTcpCandidateType), opt: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "port", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "candidate_type", kind: "enum", T: proto3.getEnumType(IceCandidateType), opt: true }, + { no: 6, name: "priority", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 7, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "relay_protocol", kind: "enum", T: proto3.getEnumType(IceServerTransportProtocol), opt: true }, + { no: 9, name: "foundation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 10, name: "related_address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "related_port", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 12, name: "username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 13, name: "tcp_type", kind: "enum", T: proto3.getEnumType(IceTcpCandidateType), opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): IceCandidateStats { @@ -2894,7 +2894,7 @@ export class IceCandidateStats extends Message { } static equals(a: IceCandidateStats | PlainMessage | undefined, b: IceCandidateStats | PlainMessage | undefined): boolean { - return proto2.util.equals(IceCandidateStats, a, b); + return proto3.util.equals(IceCandidateStats, a, b); } } @@ -2903,37 +2903,37 @@ export class IceCandidateStats extends Message { */ export class CertificateStats extends Message { /** - * @generated from field: required string fingerprint = 1; + * @generated from field: string fingerprint = 1; */ - fingerprint?: string; + fingerprint = ""; /** - * @generated from field: required string fingerprint_algorithm = 2; + * @generated from field: string fingerprint_algorithm = 2; */ - fingerprintAlgorithm?: string; + fingerprintAlgorithm = ""; /** - * @generated from field: required string base64_certificate = 3; + * @generated from field: string base64_certificate = 3; */ - base64Certificate?: string; + base64Certificate = ""; /** - * @generated from field: required string issuer_certificate_id = 4; + * @generated from field: string issuer_certificate_id = 4; */ - issuerCertificateId?: string; + issuerCertificateId = ""; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CertificateStats"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "fingerprint", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "fingerprint_algorithm", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "base64_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 4, name: "issuer_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "fingerprint", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "fingerprint_algorithm", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "base64_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "issuer_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CertificateStats { @@ -2949,7 +2949,7 @@ export class CertificateStats extends Message { } static equals(a: CertificateStats | PlainMessage | undefined, b: CertificateStats | PlainMessage | undefined): boolean { - return proto2.util.equals(CertificateStats, a, b); + return proto3.util.equals(CertificateStats, a, b); } } diff --git a/packages/livekit-rtc/src/proto/track_pb.ts b/packages/livekit-rtc/src/proto/track_pb.ts index a331190b..c7a87d65 100644 --- a/packages/livekit-rtc/src/proto/track_pb.ts +++ b/packages/livekit-rtc/src/proto/track_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file track.proto (package livekit.proto, syntax proto2) +// @generated from file track.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { RtcStats } from "./stats_pb.js"; import { EncryptionType } from "./e2ee_pb.js"; import { FfiOwnedHandle } from "./handle_pb.js"; @@ -42,8 +42,8 @@ export enum TrackKind { */ KIND_VIDEO = 2, } -// Retrieve enum metadata with: proto2.getEnumType(TrackKind) -proto2.util.setEnumType(TrackKind, "livekit.proto.TrackKind", [ +// Retrieve enum metadata with: proto3.getEnumType(TrackKind) +proto3.util.setEnumType(TrackKind, "livekit.proto.TrackKind", [ { no: 0, name: "KIND_UNKNOWN" }, { no: 1, name: "KIND_AUDIO" }, { no: 2, name: "KIND_VIDEO" }, @@ -78,8 +78,8 @@ export enum TrackSource { */ SOURCE_SCREENSHARE_AUDIO = 4, } -// Retrieve enum metadata with: proto2.getEnumType(TrackSource) -proto2.util.setEnumType(TrackSource, "livekit.proto.TrackSource", [ +// Retrieve enum metadata with: proto3.getEnumType(TrackSource) +proto3.util.setEnumType(TrackSource, "livekit.proto.TrackSource", [ { no: 0, name: "SOURCE_UNKNOWN" }, { no: 1, name: "SOURCE_CAMERA" }, { no: 2, name: "SOURCE_MICROPHONE" }, @@ -106,8 +106,8 @@ export enum StreamState { */ STATE_PAUSED = 2, } -// Retrieve enum metadata with: proto2.getEnumType(StreamState) -proto2.util.setEnumType(StreamState, "livekit.proto.StreamState", [ +// Retrieve enum metadata with: proto3.getEnumType(StreamState) +proto3.util.setEnumType(StreamState, "livekit.proto.StreamState", [ { no: 0, name: "STATE_UNKNOWN" }, { no: 1, name: "STATE_ACTIVE" }, { no: 2, name: "STATE_PAUSED" }, @@ -120,25 +120,25 @@ proto2.util.setEnumType(StreamState, "livekit.proto.StreamState", [ */ export class CreateVideoTrackRequest extends Message { /** - * @generated from field: required string name = 1; + * @generated from field: string name = 1; */ - name?: string; + name = ""; /** - * @generated from field: required uint64 source_handle = 2; + * @generated from field: uint64 source_handle = 2; */ - sourceHandle?: bigint; + sourceHandle = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CreateVideoTrackRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateVideoTrackRequest { @@ -154,7 +154,7 @@ export class CreateVideoTrackRequest extends Message { } static equals(a: CreateVideoTrackRequest | PlainMessage | undefined, b: CreateVideoTrackRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(CreateVideoTrackRequest, a, b); + return proto3.util.equals(CreateVideoTrackRequest, a, b); } } @@ -163,19 +163,19 @@ export class CreateVideoTrackRequest extends Message { */ export class CreateVideoTrackResponse extends Message { /** - * @generated from field: required livekit.proto.OwnedTrack track = 1; + * @generated from field: livekit.proto.OwnedTrack track = 1; */ track?: OwnedTrack; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CreateVideoTrackResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track", kind: "message", T: OwnedTrack, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track", kind: "message", T: OwnedTrack }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateVideoTrackResponse { @@ -191,7 +191,7 @@ export class CreateVideoTrackResponse extends Message } static equals(a: CreateVideoTrackResponse | PlainMessage | undefined, b: CreateVideoTrackResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(CreateVideoTrackResponse, a, b); + return proto3.util.equals(CreateVideoTrackResponse, a, b); } } @@ -202,25 +202,25 @@ export class CreateVideoTrackResponse extends Message */ export class CreateAudioTrackRequest extends Message { /** - * @generated from field: required string name = 1; + * @generated from field: string name = 1; */ - name?: string; + name = ""; /** - * @generated from field: required uint64 source_handle = 2; + * @generated from field: uint64 source_handle = 2; */ - sourceHandle?: bigint; + sourceHandle = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CreateAudioTrackRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateAudioTrackRequest { @@ -236,7 +236,7 @@ export class CreateAudioTrackRequest extends Message { } static equals(a: CreateAudioTrackRequest | PlainMessage | undefined, b: CreateAudioTrackRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(CreateAudioTrackRequest, a, b); + return proto3.util.equals(CreateAudioTrackRequest, a, b); } } @@ -245,19 +245,19 @@ export class CreateAudioTrackRequest extends Message { */ export class CreateAudioTrackResponse extends Message { /** - * @generated from field: required livekit.proto.OwnedTrack track = 1; + * @generated from field: livekit.proto.OwnedTrack track = 1; */ track?: OwnedTrack; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CreateAudioTrackResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track", kind: "message", T: OwnedTrack, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track", kind: "message", T: OwnedTrack }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateAudioTrackResponse { @@ -273,7 +273,7 @@ export class CreateAudioTrackResponse extends Message } static equals(a: CreateAudioTrackResponse | PlainMessage | undefined, b: CreateAudioTrackResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(CreateAudioTrackResponse, a, b); + return proto3.util.equals(CreateAudioTrackResponse, a, b); } } @@ -282,19 +282,19 @@ export class CreateAudioTrackResponse extends Message */ export class GetStatsRequest extends Message { /** - * @generated from field: required uint64 track_handle = 1; + * @generated from field: uint64 track_handle = 1; */ - trackHandle?: bigint; + trackHandle = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetStatsRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetStatsRequest { @@ -310,7 +310,7 @@ export class GetStatsRequest extends Message { } static equals(a: GetStatsRequest | PlainMessage | undefined, b: GetStatsRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(GetStatsRequest, a, b); + return proto3.util.equals(GetStatsRequest, a, b); } } @@ -319,19 +319,19 @@ export class GetStatsRequest extends Message { */ export class GetStatsResponse extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetStatsResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetStatsResponse { @@ -347,7 +347,7 @@ export class GetStatsResponse extends Message { } static equals(a: GetStatsResponse | PlainMessage | undefined, b: GetStatsResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(GetStatsResponse, a, b); + return proto3.util.equals(GetStatsResponse, a, b); } } @@ -356,9 +356,9 @@ export class GetStatsResponse extends Message { */ export class GetStatsCallback extends Message { /** - * @generated from field: required uint64 async_id = 1; + * @generated from field: uint64 async_id = 1; */ - asyncId?: bigint; + asyncId = protoInt64.zero; /** * @generated from field: optional string error = 2; @@ -372,13 +372,13 @@ export class GetStatsCallback extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.GetStatsCallback"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + 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 }, { no: 3, name: "stats", kind: "message", T: RtcStats, repeated: true }, ]); @@ -396,7 +396,7 @@ export class GetStatsCallback extends Message { } static equals(a: GetStatsCallback | PlainMessage | undefined, b: GetStatsCallback | PlainMessage | undefined): boolean { - return proto2.util.equals(GetStatsCallback, a, b); + return proto3.util.equals(GetStatsCallback, a, b); } } @@ -406,12 +406,12 @@ export class GetStatsCallback extends Message { export class TrackEvent extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackEvent"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackEvent { @@ -427,7 +427,7 @@ export class TrackEvent extends Message { } static equals(a: TrackEvent | PlainMessage | undefined, b: TrackEvent | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackEvent, a, b); + return proto3.util.equals(TrackEvent, a, b); } } @@ -436,79 +436,79 @@ export class TrackEvent extends Message { */ export class TrackPublicationInfo extends Message { /** - * @generated from field: required string sid = 1; + * @generated from field: string sid = 1; */ - sid?: string; + sid = ""; /** - * @generated from field: required string name = 2; + * @generated from field: string name = 2; */ - name?: string; + name = ""; /** - * @generated from field: required livekit.proto.TrackKind kind = 3; + * @generated from field: livekit.proto.TrackKind kind = 3; */ - kind?: TrackKind; + kind = TrackKind.KIND_UNKNOWN; /** - * @generated from field: required livekit.proto.TrackSource source = 4; + * @generated from field: livekit.proto.TrackSource source = 4; */ - source?: TrackSource; + source = TrackSource.SOURCE_UNKNOWN; /** - * @generated from field: required bool simulcasted = 5; + * @generated from field: bool simulcasted = 5; */ - simulcasted?: boolean; + simulcasted = false; /** - * @generated from field: required uint32 width = 6; + * @generated from field: uint32 width = 6; */ - width?: number; + width = 0; /** - * @generated from field: required uint32 height = 7; + * @generated from field: uint32 height = 7; */ - height?: number; + height = 0; /** - * @generated from field: required string mime_type = 8; + * @generated from field: string mime_type = 8; */ - mimeType?: string; + mimeType = ""; /** - * @generated from field: required bool muted = 9; + * @generated from field: bool muted = 9; */ - muted?: boolean; + muted = false; /** - * @generated from field: required bool remote = 10; + * @generated from field: bool remote = 10; */ - remote?: boolean; + remote = false; /** - * @generated from field: required livekit.proto.EncryptionType encryption_type = 11; + * @generated from field: livekit.proto.EncryptionType encryption_type = 11; */ - encryptionType?: EncryptionType; + encryptionType = EncryptionType.NONE; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackPublicationInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "kind", kind: "enum", T: proto2.getEnumType(TrackKind), req: true }, - { no: 4, name: "source", kind: "enum", T: proto2.getEnumType(TrackSource), req: true }, - { no: 5, name: "simulcasted", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 6, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 7, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 8, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 9, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 10, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 11, name: "encryption_type", kind: "enum", T: proto2.getEnumType(EncryptionType), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "kind", kind: "enum", T: proto3.getEnumType(TrackKind) }, + { no: 4, name: "source", kind: "enum", T: proto3.getEnumType(TrackSource) }, + { no: 5, name: "simulcasted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 7, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 8, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 9, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 10, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 11, name: "encryption_type", kind: "enum", T: proto3.getEnumType(EncryptionType) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackPublicationInfo { @@ -524,7 +524,7 @@ export class TrackPublicationInfo extends Message { } static equals(a: TrackPublicationInfo | PlainMessage | undefined, b: TrackPublicationInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackPublicationInfo, a, b); + return proto3.util.equals(TrackPublicationInfo, a, b); } } @@ -533,25 +533,25 @@ export class TrackPublicationInfo extends Message { */ export class OwnedTrackPublication extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.TrackPublicationInfo info = 2; + * @generated from field: livekit.proto.TrackPublicationInfo info = 2; */ info?: TrackPublicationInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedTrackPublication"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: TrackPublicationInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: TrackPublicationInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedTrackPublication { @@ -567,7 +567,7 @@ export class OwnedTrackPublication extends Message { } static equals(a: OwnedTrackPublication | PlainMessage | undefined, b: OwnedTrackPublication | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedTrackPublication, a, b); + return proto3.util.equals(OwnedTrackPublication, a, b); } } @@ -576,49 +576,49 @@ export class OwnedTrackPublication extends Message { */ export class TrackInfo extends Message { /** - * @generated from field: required string sid = 1; + * @generated from field: string sid = 1; */ - sid?: string; + sid = ""; /** - * @generated from field: required string name = 2; + * @generated from field: string name = 2; */ - name?: string; + name = ""; /** - * @generated from field: required livekit.proto.TrackKind kind = 3; + * @generated from field: livekit.proto.TrackKind kind = 3; */ - kind?: TrackKind; + kind = TrackKind.KIND_UNKNOWN; /** - * @generated from field: required livekit.proto.StreamState stream_state = 4; + * @generated from field: livekit.proto.StreamState stream_state = 4; */ - streamState?: StreamState; + streamState = StreamState.STATE_UNKNOWN; /** - * @generated from field: required bool muted = 5; + * @generated from field: bool muted = 5; */ - muted?: boolean; + muted = false; /** - * @generated from field: required bool remote = 6; + * @generated from field: bool remote = 6; */ - remote?: boolean; + remote = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.TrackInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, - { no: 3, name: "kind", kind: "enum", T: proto2.getEnumType(TrackKind), req: true }, - { no: 4, name: "stream_state", kind: "enum", T: proto2.getEnumType(StreamState), req: true }, - { no: 5, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 6, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "kind", kind: "enum", T: proto3.getEnumType(TrackKind) }, + { no: 4, name: "stream_state", kind: "enum", T: proto3.getEnumType(StreamState) }, + { no: 5, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TrackInfo { @@ -634,7 +634,7 @@ export class TrackInfo extends Message { } static equals(a: TrackInfo | PlainMessage | undefined, b: TrackInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(TrackInfo, a, b); + return proto3.util.equals(TrackInfo, a, b); } } @@ -643,25 +643,25 @@ export class TrackInfo extends Message { */ export class OwnedTrack extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.TrackInfo info = 2; + * @generated from field: livekit.proto.TrackInfo info = 2; */ info?: TrackInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedTrack"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: TrackInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: TrackInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedTrack { @@ -677,7 +677,7 @@ export class OwnedTrack extends Message { } static equals(a: OwnedTrack | PlainMessage | undefined, b: OwnedTrack | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedTrack, a, b); + return proto3.util.equals(OwnedTrack, a, b); } } @@ -688,25 +688,25 @@ export class OwnedTrack extends Message { */ export class LocalTrackMuteRequest extends Message { /** - * @generated from field: required uint64 track_handle = 1; + * @generated from field: uint64 track_handle = 1; */ - trackHandle?: bigint; + trackHandle = protoInt64.zero; /** - * @generated from field: required bool mute = 2; + * @generated from field: bool mute = 2; */ - mute?: boolean; + mute = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.LocalTrackMuteRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "mute", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "mute", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackMuteRequest { @@ -722,7 +722,7 @@ export class LocalTrackMuteRequest extends Message { } static equals(a: LocalTrackMuteRequest | PlainMessage | undefined, b: LocalTrackMuteRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(LocalTrackMuteRequest, a, b); + return proto3.util.equals(LocalTrackMuteRequest, a, b); } } @@ -731,19 +731,19 @@ export class LocalTrackMuteRequest extends Message { */ export class LocalTrackMuteResponse extends Message { /** - * @generated from field: required bool muted = 1; + * @generated from field: bool muted = 1; */ - muted?: boolean; + muted = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.LocalTrackMuteResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackMuteResponse { @@ -759,7 +759,7 @@ export class LocalTrackMuteResponse extends Message { } static equals(a: LocalTrackMuteResponse | PlainMessage | undefined, b: LocalTrackMuteResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(LocalTrackMuteResponse, a, b); + return proto3.util.equals(LocalTrackMuteResponse, a, b); } } @@ -770,25 +770,25 @@ export class LocalTrackMuteResponse extends Message { */ export class EnableRemoteTrackRequest extends Message { /** - * @generated from field: required uint64 track_handle = 1; + * @generated from field: uint64 track_handle = 1; */ - trackHandle?: bigint; + trackHandle = protoInt64.zero; /** - * @generated from field: required bool enabled = 2; + * @generated from field: bool enabled = 2; */ - enabled?: boolean; + enabled = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.EnableRemoteTrackRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): EnableRemoteTrackRequest { @@ -804,7 +804,7 @@ export class EnableRemoteTrackRequest extends Message } static equals(a: EnableRemoteTrackRequest | PlainMessage | undefined, b: EnableRemoteTrackRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(EnableRemoteTrackRequest, a, b); + return proto3.util.equals(EnableRemoteTrackRequest, a, b); } } @@ -813,19 +813,19 @@ export class EnableRemoteTrackRequest extends Message */ export class EnableRemoteTrackResponse extends Message { /** - * @generated from field: required bool enabled = 1; + * @generated from field: bool enabled = 1; */ - enabled?: boolean; + enabled = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.EnableRemoteTrackResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): EnableRemoteTrackResponse { @@ -841,7 +841,7 @@ export class EnableRemoteTrackResponse extends Message | undefined, b: EnableRemoteTrackResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(EnableRemoteTrackResponse, a, b); + return proto3.util.equals(EnableRemoteTrackResponse, a, b); } } diff --git a/packages/livekit-rtc/src/proto/video_frame_pb.ts b/packages/livekit-rtc/src/proto/video_frame_pb.ts index 62ec038a..4727a87b 100644 --- a/packages/livekit-rtc/src/proto/video_frame_pb.ts +++ b/packages/livekit-rtc/src/proto/video_frame_pb.ts @@ -13,12 +13,12 @@ // limitations under the License. // @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file video_frame.proto (package livekit.proto, syntax proto2) +// @generated from file video_frame.proto (package livekit.proto, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto2 } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { TrackSource } from "./track_pb.js"; import { FfiOwnedHandle } from "./handle_pb.js"; @@ -46,8 +46,8 @@ export enum VideoCodec { */ VP9 = 3, } -// Retrieve enum metadata with: proto2.getEnumType(VideoCodec) -proto2.util.setEnumType(VideoCodec, "livekit.proto.VideoCodec", [ +// Retrieve enum metadata with: proto3.getEnumType(VideoCodec) +proto3.util.setEnumType(VideoCodec, "livekit.proto.VideoCodec", [ { no: 0, name: "VP8" }, { no: 1, name: "H264" }, { no: 2, name: "AV1" }, @@ -78,8 +78,8 @@ export enum VideoRotation { */ VIDEO_ROTATION_270 = 3, } -// Retrieve enum metadata with: proto2.getEnumType(VideoRotation) -proto2.util.setEnumType(VideoRotation, "livekit.proto.VideoRotation", [ +// Retrieve enum metadata with: proto3.getEnumType(VideoRotation) +proto3.util.setEnumType(VideoRotation, "livekit.proto.VideoRotation", [ { no: 0, name: "VIDEO_ROTATION_0" }, { no: 1, name: "VIDEO_ROTATION_90" }, { no: 2, name: "VIDEO_ROTATION_180" }, @@ -145,8 +145,8 @@ export enum VideoBufferType { */ NV12 = 10, } -// Retrieve enum metadata with: proto2.getEnumType(VideoBufferType) -proto2.util.setEnumType(VideoBufferType, "livekit.proto.VideoBufferType", [ +// Retrieve enum metadata with: proto3.getEnumType(VideoBufferType) +proto3.util.setEnumType(VideoBufferType, "livekit.proto.VideoBufferType", [ { no: 0, name: "RGBA" }, { no: 1, name: "ABGR" }, { no: 2, name: "ARGB" }, @@ -179,8 +179,8 @@ export enum VideoStreamType { */ VIDEO_STREAM_HTML = 2, } -// Retrieve enum metadata with: proto2.getEnumType(VideoStreamType) -proto2.util.setEnumType(VideoStreamType, "livekit.proto.VideoStreamType", [ +// Retrieve enum metadata with: proto3.getEnumType(VideoStreamType) +proto3.util.setEnumType(VideoStreamType, "livekit.proto.VideoStreamType", [ { no: 0, name: "VIDEO_STREAM_NATIVE" }, { no: 1, name: "VIDEO_STREAM_WEBGL" }, { no: 2, name: "VIDEO_STREAM_HTML" }, @@ -195,8 +195,8 @@ export enum VideoSourceType { */ VIDEO_SOURCE_NATIVE = 0, } -// Retrieve enum metadata with: proto2.getEnumType(VideoSourceType) -proto2.util.setEnumType(VideoSourceType, "livekit.proto.VideoSourceType", [ +// Retrieve enum metadata with: proto3.getEnumType(VideoSourceType) +proto3.util.setEnumType(VideoSourceType, "livekit.proto.VideoSourceType", [ { no: 0, name: "VIDEO_SOURCE_NATIVE" }, ]); @@ -208,14 +208,14 @@ proto2.util.setEnumType(VideoSourceType, "livekit.proto.VideoSourceType", [ */ export class NewVideoStreamRequest extends Message { /** - * @generated from field: required uint64 track_handle = 1; + * @generated from field: uint64 track_handle = 1; */ - trackHandle?: bigint; + trackHandle = protoInt64.zero; /** - * @generated from field: required livekit.proto.VideoStreamType type = 2; + * @generated from field: livekit.proto.VideoStreamType type = 2; */ - type?: VideoStreamType; + type = VideoStreamType.VIDEO_STREAM_NATIVE; /** * Get the frame on a specific format @@ -227,22 +227,22 @@ export class NewVideoStreamRequest extends Message { /** * if true, stride will be set to width/chroma_width * - * @generated from field: required bool normalize_stride = 4; + * @generated from field: bool normalize_stride = 4; */ - normalizeStride?: boolean; + normalizeStride = false; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewVideoStreamRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(VideoStreamType), req: true }, - { no: 3, name: "format", kind: "enum", T: proto2.getEnumType(VideoBufferType), opt: true }, - { no: 4, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(VideoStreamType) }, + { no: 3, name: "format", kind: "enum", T: proto3.getEnumType(VideoBufferType), opt: true }, + { no: 4, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoStreamRequest { @@ -258,7 +258,7 @@ export class NewVideoStreamRequest extends Message { } static equals(a: NewVideoStreamRequest | PlainMessage | undefined, b: NewVideoStreamRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(NewVideoStreamRequest, a, b); + return proto3.util.equals(NewVideoStreamRequest, a, b); } } @@ -267,19 +267,19 @@ export class NewVideoStreamRequest extends Message { */ export class NewVideoStreamResponse extends Message { /** - * @generated from field: required livekit.proto.OwnedVideoStream stream = 1; + * @generated from field: livekit.proto.OwnedVideoStream stream = 1; */ stream?: OwnedVideoStream; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewVideoStreamResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedVideoStream, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "stream", kind: "message", T: OwnedVideoStream }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoStreamResponse { @@ -295,7 +295,7 @@ export class NewVideoStreamResponse extends Message { } static equals(a: NewVideoStreamResponse | PlainMessage | undefined, b: NewVideoStreamResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(NewVideoStreamResponse, a, b); + return proto3.util.equals(NewVideoStreamResponse, a, b); } } @@ -306,19 +306,19 @@ export class NewVideoStreamResponse extends Message { */ export class VideoStreamFromParticipantRequest extends Message { /** - * @generated from field: required uint64 participant_handle = 1; + * @generated from field: uint64 participant_handle = 1; */ - participantHandle?: bigint; + participantHandle = protoInt64.zero; /** - * @generated from field: required livekit.proto.VideoStreamType type = 2; + * @generated from field: livekit.proto.VideoStreamType type = 2; */ - type?: VideoStreamType; + type = VideoStreamType.VIDEO_STREAM_NATIVE; /** - * @generated from field: required livekit.proto.TrackSource track_source = 3; + * @generated from field: livekit.proto.TrackSource track_source = 3; */ - trackSource?: TrackSource; + trackSource = TrackSource.SOURCE_UNKNOWN; /** * @generated from field: optional livekit.proto.VideoBufferType format = 4; @@ -326,23 +326,23 @@ export class VideoStreamFromParticipantRequest extends Message) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoStreamFromParticipantRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "type", kind: "enum", T: proto2.getEnumType(VideoStreamType), req: true }, - { no: 3, name: "track_source", kind: "enum", T: proto2.getEnumType(TrackSource), req: true }, - { no: 4, name: "format", kind: "enum", T: proto2.getEnumType(VideoBufferType), opt: true }, - { no: 5, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(VideoStreamType) }, + { no: 3, name: "track_source", kind: "enum", T: proto3.getEnumType(TrackSource) }, + { no: 4, name: "format", kind: "enum", T: proto3.getEnumType(VideoBufferType), opt: true }, + { no: 5, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamFromParticipantRequest { @@ -358,7 +358,7 @@ export class VideoStreamFromParticipantRequest extends Message | undefined, b: VideoStreamFromParticipantRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoStreamFromParticipantRequest, a, b); + return proto3.util.equals(VideoStreamFromParticipantRequest, a, b); } } @@ -367,19 +367,19 @@ export class VideoStreamFromParticipantRequest extends Message { /** - * @generated from field: required livekit.proto.OwnedVideoStream stream = 1; + * @generated from field: livekit.proto.OwnedVideoStream stream = 1; */ stream?: OwnedVideoStream; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoStreamFromParticipantResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedVideoStream, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "stream", kind: "message", T: OwnedVideoStream }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamFromParticipantResponse { @@ -395,7 +395,7 @@ export class VideoStreamFromParticipantResponse extends Message | undefined, b: VideoStreamFromParticipantResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoStreamFromParticipantResponse, a, b); + return proto3.util.equals(VideoStreamFromParticipantResponse, a, b); } } @@ -407,28 +407,28 @@ export class VideoStreamFromParticipantResponse extends Message { /** - * @generated from field: required livekit.proto.VideoSourceType type = 1; + * @generated from field: livekit.proto.VideoSourceType type = 1; */ - type?: VideoSourceType; + type = VideoSourceType.VIDEO_SOURCE_NATIVE; /** * Used to determine which encodings to use + simulcast layers * Most of the time it corresponds to the source resolution * - * @generated from field: required livekit.proto.VideoSourceResolution resolution = 2; + * @generated from field: livekit.proto.VideoSourceResolution resolution = 2; */ resolution?: VideoSourceResolution; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewVideoSourceRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(VideoSourceType), req: true }, - { no: 2, name: "resolution", kind: "message", T: VideoSourceResolution, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoSourceType) }, + { no: 2, name: "resolution", kind: "message", T: VideoSourceResolution }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoSourceRequest { @@ -444,7 +444,7 @@ export class NewVideoSourceRequest extends Message { } static equals(a: NewVideoSourceRequest | PlainMessage | undefined, b: NewVideoSourceRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(NewVideoSourceRequest, a, b); + return proto3.util.equals(NewVideoSourceRequest, a, b); } } @@ -453,19 +453,19 @@ export class NewVideoSourceRequest extends Message { */ export class NewVideoSourceResponse extends Message { /** - * @generated from field: required livekit.proto.OwnedVideoSource source = 1; + * @generated from field: livekit.proto.OwnedVideoSource source = 1; */ source?: OwnedVideoSource; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.NewVideoSourceResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "source", kind: "message", T: OwnedVideoSource, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "source", kind: "message", T: OwnedVideoSource }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoSourceResponse { @@ -481,7 +481,7 @@ export class NewVideoSourceResponse extends Message { } static equals(a: NewVideoSourceResponse | PlainMessage | undefined, b: NewVideoSourceResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(NewVideoSourceResponse, a, b); + return proto3.util.equals(NewVideoSourceResponse, a, b); } } @@ -492,39 +492,39 @@ export class NewVideoSourceResponse extends Message { */ export class CaptureVideoFrameRequest extends Message { /** - * @generated from field: required uint64 source_handle = 1; + * @generated from field: uint64 source_handle = 1; */ - sourceHandle?: bigint; + sourceHandle = protoInt64.zero; /** - * @generated from field: required livekit.proto.VideoBufferInfo buffer = 2; + * @generated from field: livekit.proto.VideoBufferInfo buffer = 2; */ buffer?: VideoBufferInfo; /** * In microseconds * - * @generated from field: required int64 timestamp_us = 3; + * @generated from field: int64 timestamp_us = 3; */ - timestampUs?: bigint; + timestampUs = protoInt64.zero; /** - * @generated from field: required livekit.proto.VideoRotation rotation = 4; + * @generated from field: livekit.proto.VideoRotation rotation = 4; */ - rotation?: VideoRotation; + rotation = VideoRotation.VIDEO_ROTATION_0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CaptureVideoFrameRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo, req: true }, - { no: 3, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, - { no: 4, name: "rotation", kind: "enum", T: proto2.getEnumType(VideoRotation), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo }, + { no: 3, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "rotation", kind: "enum", T: proto3.getEnumType(VideoRotation) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CaptureVideoFrameRequest { @@ -540,7 +540,7 @@ export class CaptureVideoFrameRequest extends Message } static equals(a: CaptureVideoFrameRequest | PlainMessage | undefined, b: CaptureVideoFrameRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(CaptureVideoFrameRequest, a, b); + return proto3.util.equals(CaptureVideoFrameRequest, a, b); } } @@ -550,12 +550,12 @@ export class CaptureVideoFrameRequest extends Message export class CaptureVideoFrameResponse extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.CaptureVideoFrameResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): CaptureVideoFrameResponse { @@ -571,7 +571,7 @@ export class CaptureVideoFrameResponse extends Message | undefined, b: CaptureVideoFrameResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(CaptureVideoFrameResponse, a, b); + return proto3.util.equals(CaptureVideoFrameResponse, a, b); } } @@ -580,31 +580,31 @@ export class CaptureVideoFrameResponse extends Message { /** - * @generated from field: required bool flip_y = 1; + * @generated from field: bool flip_y = 1; */ - flipY?: boolean; + flipY = false; /** - * @generated from field: required livekit.proto.VideoBufferInfo buffer = 2; + * @generated from field: livekit.proto.VideoBufferInfo buffer = 2; */ buffer?: VideoBufferInfo; /** - * @generated from field: required livekit.proto.VideoBufferType dst_type = 3; + * @generated from field: livekit.proto.VideoBufferType dst_type = 3; */ - dstType?: VideoBufferType; + dstType = VideoBufferType.RGBA; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoConvertRequest"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "flip_y", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, - { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo, req: true }, - { no: 3, name: "dst_type", kind: "enum", T: proto2.getEnumType(VideoBufferType), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "flip_y", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo }, + { no: 3, name: "dst_type", kind: "enum", T: proto3.getEnumType(VideoBufferType) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoConvertRequest { @@ -620,7 +620,7 @@ export class VideoConvertRequest extends Message { } static equals(a: VideoConvertRequest | PlainMessage | undefined, b: VideoConvertRequest | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoConvertRequest, a, b); + return proto3.util.equals(VideoConvertRequest, a, b); } } @@ -629,32 +629,25 @@ export class VideoConvertRequest extends Message { */ export class VideoConvertResponse extends Message { /** - * @generated from oneof livekit.proto.VideoConvertResponse.message + * @generated from field: optional string error = 1; */ - message: { - /** - * @generated from field: string error = 1; - */ - value: string; - case: "error"; - } | { - /** - * @generated from field: livekit.proto.OwnedVideoBuffer buffer = 2; - */ - value: OwnedVideoBuffer; - case: "buffer"; - } | { case: undefined; value?: undefined } = { case: undefined }; + error?: string; + + /** + * @generated from field: livekit.proto.OwnedVideoBuffer buffer = 2; + */ + buffer?: OwnedVideoBuffer; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoConvertResponse"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "message" }, - { no: 2, name: "buffer", kind: "message", T: OwnedVideoBuffer, oneof: "message" }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "buffer", kind: "message", T: OwnedVideoBuffer }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoConvertResponse { @@ -670,7 +663,7 @@ export class VideoConvertResponse extends Message { } static equals(a: VideoConvertResponse | PlainMessage | undefined, b: VideoConvertResponse | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoConvertResponse, a, b); + return proto3.util.equals(VideoConvertResponse, a, b); } } @@ -679,31 +672,31 @@ export class VideoConvertResponse extends Message { */ export class VideoResolution extends Message { /** - * @generated from field: required uint32 width = 1; + * @generated from field: uint32 width = 1; */ - width?: number; + width = 0; /** - * @generated from field: required uint32 height = 2; + * @generated from field: uint32 height = 2; */ - height?: number; + height = 0; /** - * @generated from field: required double frame_rate = 3; + * @generated from field: double frame_rate = 3; */ - frameRate?: number; + frameRate = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoResolution"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 3, name: "frame_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: "frame_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoResolution { @@ -719,7 +712,7 @@ export class VideoResolution extends Message { } static equals(a: VideoResolution | PlainMessage | undefined, b: VideoResolution | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoResolution, a, b); + return proto3.util.equals(VideoResolution, a, b); } } @@ -728,31 +721,31 @@ export class VideoResolution extends Message { */ export class VideoBufferInfo extends Message { /** - * @generated from field: required livekit.proto.VideoBufferType type = 1; + * @generated from field: livekit.proto.VideoBufferType type = 1; */ - type?: VideoBufferType; + type = VideoBufferType.RGBA; /** - * @generated from field: required uint32 width = 2; + * @generated from field: uint32 width = 2; */ - width?: number; + width = 0; /** - * @generated from field: required uint32 height = 3; + * @generated from field: uint32 height = 3; */ - height?: number; + height = 0; /** - * @generated from field: required uint64 data_ptr = 4; + * @generated from field: uint64 data_ptr = 4; */ - dataPtr?: bigint; + dataPtr = protoInt64.zero; /** * only for packed formats * - * @generated from field: required uint32 stride = 6; + * @generated from field: uint32 stride = 6; */ - stride?: number; + stride = 0; /** * @generated from field: repeated livekit.proto.VideoBufferInfo.ComponentInfo components = 7; @@ -761,17 +754,17 @@ export class VideoBufferInfo extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoBufferInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(VideoBufferType), req: true }, - { no: 2, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 3, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 4, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 6, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoBufferType) }, + { no: 2, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 4, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 6, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 7, name: "components", kind: "message", T: VideoBufferInfo_ComponentInfo, repeated: true }, ]); @@ -788,7 +781,7 @@ export class VideoBufferInfo extends Message { } static equals(a: VideoBufferInfo | PlainMessage | undefined, b: VideoBufferInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoBufferInfo, a, b); + return proto3.util.equals(VideoBufferInfo, a, b); } } @@ -797,31 +790,31 @@ export class VideoBufferInfo extends Message { */ export class VideoBufferInfo_ComponentInfo extends Message { /** - * @generated from field: required uint64 data_ptr = 1; + * @generated from field: uint64 data_ptr = 1; */ - dataPtr?: bigint; + dataPtr = protoInt64.zero; /** - * @generated from field: required uint32 stride = 2; + * @generated from field: uint32 stride = 2; */ - stride?: number; + stride = 0; /** - * @generated from field: required uint32 size = 3; + * @generated from field: uint32 size = 3; */ - size?: number; + size = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoBufferInfo.ComponentInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, - { no: 2, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 2, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoBufferInfo_ComponentInfo { @@ -837,7 +830,7 @@ export class VideoBufferInfo_ComponentInfo extends Message | undefined, b: VideoBufferInfo_ComponentInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoBufferInfo_ComponentInfo, a, b); + return proto3.util.equals(VideoBufferInfo_ComponentInfo, a, b); } } @@ -846,25 +839,25 @@ export class VideoBufferInfo_ComponentInfo extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.VideoBufferInfo info = 2; + * @generated from field: livekit.proto.VideoBufferInfo info = 2; */ info?: VideoBufferInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedVideoBuffer"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: VideoBufferInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: VideoBufferInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedVideoBuffer { @@ -880,7 +873,7 @@ export class OwnedVideoBuffer extends Message { } static equals(a: OwnedVideoBuffer | PlainMessage | undefined, b: OwnedVideoBuffer | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedVideoBuffer, a, b); + return proto3.util.equals(OwnedVideoBuffer, a, b); } } @@ -889,19 +882,19 @@ export class OwnedVideoBuffer extends Message { */ export class VideoStreamInfo extends Message { /** - * @generated from field: required livekit.proto.VideoStreamType type = 1; + * @generated from field: livekit.proto.VideoStreamType type = 1; */ - type?: VideoStreamType; + type = VideoStreamType.VIDEO_STREAM_NATIVE; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoStreamInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(VideoStreamType), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoStreamType) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamInfo { @@ -917,7 +910,7 @@ export class VideoStreamInfo extends Message { } static equals(a: VideoStreamInfo | PlainMessage | undefined, b: VideoStreamInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoStreamInfo, a, b); + return proto3.util.equals(VideoStreamInfo, a, b); } } @@ -926,25 +919,25 @@ export class VideoStreamInfo extends Message { */ export class OwnedVideoStream extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.VideoStreamInfo info = 2; + * @generated from field: livekit.proto.VideoStreamInfo info = 2; */ info?: VideoStreamInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedVideoStream"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: VideoStreamInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: VideoStreamInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedVideoStream { @@ -960,7 +953,7 @@ export class OwnedVideoStream extends Message { } static equals(a: OwnedVideoStream | PlainMessage | undefined, b: OwnedVideoStream | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedVideoStream, a, b); + return proto3.util.equals(OwnedVideoStream, a, b); } } @@ -969,9 +962,9 @@ export class OwnedVideoStream extends Message { */ export class VideoStreamEvent extends Message { /** - * @generated from field: required uint64 stream_handle = 1; + * @generated from field: uint64 stream_handle = 1; */ - streamHandle?: bigint; + streamHandle = protoInt64.zero; /** * @generated from oneof livekit.proto.VideoStreamEvent.message @@ -992,13 +985,13 @@ export class VideoStreamEvent extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoStreamEvent"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "frame_received", kind: "message", T: VideoFrameReceived, oneof: "message" }, { no: 3, name: "eos", kind: "message", T: VideoStreamEOS, oneof: "message" }, ]); @@ -1016,7 +1009,7 @@ export class VideoStreamEvent extends Message { } static equals(a: VideoStreamEvent | PlainMessage | undefined, b: VideoStreamEvent | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoStreamEvent, a, b); + return proto3.util.equals(VideoStreamEvent, a, b); } } @@ -1025,33 +1018,33 @@ export class VideoStreamEvent extends Message { */ export class VideoFrameReceived extends Message { /** - * @generated from field: required livekit.proto.OwnedVideoBuffer buffer = 1; + * @generated from field: livekit.proto.OwnedVideoBuffer buffer = 1; */ buffer?: OwnedVideoBuffer; /** * In microseconds * - * @generated from field: required int64 timestamp_us = 2; + * @generated from field: int64 timestamp_us = 2; */ - timestampUs?: bigint; + timestampUs = protoInt64.zero; /** - * @generated from field: required livekit.proto.VideoRotation rotation = 3; + * @generated from field: livekit.proto.VideoRotation rotation = 3; */ - rotation?: VideoRotation; + rotation = VideoRotation.VIDEO_ROTATION_0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoFrameReceived"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "buffer", kind: "message", T: OwnedVideoBuffer, req: true }, - { no: 2, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true }, - { no: 3, name: "rotation", kind: "enum", T: proto2.getEnumType(VideoRotation), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "buffer", kind: "message", T: OwnedVideoBuffer }, + { no: 2, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "rotation", kind: "enum", T: proto3.getEnumType(VideoRotation) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoFrameReceived { @@ -1067,7 +1060,7 @@ export class VideoFrameReceived extends Message { } static equals(a: VideoFrameReceived | PlainMessage | undefined, b: VideoFrameReceived | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoFrameReceived, a, b); + return proto3.util.equals(VideoFrameReceived, a, b); } } @@ -1077,12 +1070,12 @@ export class VideoFrameReceived extends Message { export class VideoStreamEOS extends Message { constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoStreamEOS"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ + static readonly fields: FieldList = proto3.util.newFieldList(() => [ ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamEOS { @@ -1098,7 +1091,7 @@ export class VideoStreamEOS extends Message { } static equals(a: VideoStreamEOS | PlainMessage | undefined, b: VideoStreamEOS | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoStreamEOS, a, b); + return proto3.util.equals(VideoStreamEOS, a, b); } } @@ -1107,25 +1100,25 @@ export class VideoStreamEOS extends Message { */ export class VideoSourceResolution extends Message { /** - * @generated from field: required uint32 width = 1; + * @generated from field: uint32 width = 1; */ - width?: number; + width = 0; /** - * @generated from field: required uint32 height = 2; + * @generated from field: uint32 height = 2; */ - height?: number; + height = 0; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoSourceResolution"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, - { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoSourceResolution { @@ -1141,7 +1134,7 @@ export class VideoSourceResolution extends Message { } static equals(a: VideoSourceResolution | PlainMessage | undefined, b: VideoSourceResolution | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoSourceResolution, a, b); + return proto3.util.equals(VideoSourceResolution, a, b); } } @@ -1150,19 +1143,19 @@ export class VideoSourceResolution extends Message { */ export class VideoSourceInfo extends Message { /** - * @generated from field: required livekit.proto.VideoSourceType type = 1; + * @generated from field: livekit.proto.VideoSourceType type = 1; */ - type?: VideoSourceType; + type = VideoSourceType.VIDEO_SOURCE_NATIVE; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.VideoSourceInfo"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto2.getEnumType(VideoSourceType), req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoSourceType) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): VideoSourceInfo { @@ -1178,7 +1171,7 @@ export class VideoSourceInfo extends Message { } static equals(a: VideoSourceInfo | PlainMessage | undefined, b: VideoSourceInfo | PlainMessage | undefined): boolean { - return proto2.util.equals(VideoSourceInfo, a, b); + return proto3.util.equals(VideoSourceInfo, a, b); } } @@ -1187,25 +1180,25 @@ export class VideoSourceInfo extends Message { */ export class OwnedVideoSource extends Message { /** - * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: required livekit.proto.VideoSourceInfo info = 2; + * @generated from field: livekit.proto.VideoSourceInfo info = 2; */ info?: VideoSourceInfo; constructor(data?: PartialMessage) { super(); - proto2.util.initPartial(data, this); + proto3.util.initPartial(data, this); } - static readonly runtime: typeof proto2 = proto2; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = "livekit.proto.OwnedVideoSource"; - static readonly fields: FieldList = proto2.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle, req: true }, - { no: 2, name: "info", kind: "message", T: VideoSourceInfo, req: true }, + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, + { no: 2, name: "info", kind: "message", T: VideoSourceInfo }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): OwnedVideoSource { @@ -1221,7 +1214,7 @@ export class OwnedVideoSource extends Message { } static equals(a: OwnedVideoSource | PlainMessage | undefined, b: OwnedVideoSource | PlainMessage | undefined): boolean { - return proto2.util.equals(OwnedVideoSource, a, b); + return proto3.util.equals(OwnedVideoSource, a, b); } } From 386b7a26c7fce7e5f323aa7eae649f6332b5b9d7 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Fri, 18 Oct 2024 16:49:10 -0700 Subject: [PATCH 099/126] r --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index ce7c79bc..23c2a7cc 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit ce7c79bcfbda9af6e0657f46b770234641bc53fb +Subproject commit 23c2a7ccc41d81fb13220b10f66f670eb2e3555e From 8b4c1e8abe1a35a4b53385e8ebb59072d3e47a42 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 21 Oct 2024 15:42:56 -0700 Subject: [PATCH 100/126] p --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 23c2a7cc..49c10d7b 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 23c2a7ccc41d81fb13220b10f66f670eb2e3555e +Subproject commit 49c10d7b34c3ecf55b4478e6037ae0af4b13c751 From b9573c4122a9b6d3faf63072b553c8d953ee3ebf Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 21 Oct 2024 15:43:54 -0700 Subject: [PATCH 101/126] fmt --- packages/livekit-rtc/src/participant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index ff1183db..8993200d 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -38,6 +38,7 @@ import { SetLocalNameRequestSchema, UnpublishTrackRequestSchema, } from './proto/room_pb.js'; +import { TranscriptionSegmentSchema } from './proto/room_pb.js'; import type { PerformRpcCallback, PerformRpcResponse, @@ -55,7 +56,6 @@ import { UnregisterRpcMethodRequest, } from './proto/rpc_pb.js'; import { RpcError } from './rpc.js'; -import { TranscriptionSegmentSchema } from './proto/room_pb.js'; import type { LocalTrack } from './track.js'; import type { RemoteTrackPublication, TrackPublication } from './track_publication.js'; import { LocalTrackPublication } from './track_publication.js'; From fe07b8030fd400efff57f8a3fbf953cf8b1cd3a4 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 21 Oct 2024 15:51:32 -0700 Subject: [PATCH 102/126] fixes --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 49c10d7b..35e7985e 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 49c10d7b34c3ecf55b4478e6037ae0af4b13c751 +Subproject commit 35e7985e2ce3b75a6fd42ceb16d507e1aacccd23 From aea624c86d7d42eb36cb6fbe73196dab3b680e59 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Mon, 21 Oct 2024 15:52:46 -0700 Subject: [PATCH 103/126] p --- .../livekit-rtc/src/proto/audio_frame_pb.ts | 1841 +++---- packages/livekit-rtc/src/proto/e2ee_pb.ts | 1251 ++--- packages/livekit-rtc/src/proto/ffi_pb.ts | 641 +-- packages/livekit-rtc/src/proto/handle_pb.ts | 56 +- .../livekit-rtc/src/proto/participant_pb.ts | 183 +- packages/livekit-rtc/src/proto/room_pb.ts | 4279 +++++------------ packages/livekit-rtc/src/proto/stats_pb.ts | 2975 ++++-------- packages/livekit-rtc/src/proto/track_pb.ts | 908 ++-- .../livekit-rtc/src/proto/video_frame_pb.ts | 1350 ++---- 9 files changed, 4203 insertions(+), 9281 deletions(-) diff --git a/packages/livekit-rtc/src/proto/audio_frame_pb.ts b/packages/livekit-rtc/src/proto/audio_frame_pb.ts index c6e0dba5..47000174 100644 --- a/packages/livekit-rtc/src/proto/audio_frame_pb.ts +++ b/packages/livekit-rtc/src/proto/audio_frame_pb.ts @@ -12,165 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file audio_frame.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file audio_frame.proto (package livekit.proto, syntax proto2) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; -import { TrackSource } from "./track_pb.js"; -import { FfiOwnedHandle } from "./handle_pb.js"; +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { FfiOwnedHandle } from "./handle_pb"; +import { file_handle } from "./handle_pb"; +import type { TrackSource } from "./track_pb"; +import { file_track } from "./track_pb"; +import type { Message } from "@bufbuild/protobuf"; /** - * @generated from enum livekit.proto.SoxResamplerDataType + * Describes the file audio_frame.proto. */ -export enum SoxResamplerDataType { - /** - * TODO(theomonnom): support other datatypes (shouldn't really be needed) - * - * @generated from enum value: SOXR_DATATYPE_INT16I = 0; - */ - SOXR_DATATYPE_INT16I = 0, - - /** - * @generated from enum value: SOXR_DATATYPE_INT16S = 1; - */ - SOXR_DATATYPE_INT16S = 1, -} -// Retrieve enum metadata with: proto3.getEnumType(SoxResamplerDataType) -proto3.util.setEnumType(SoxResamplerDataType, "livekit.proto.SoxResamplerDataType", [ - { no: 0, name: "SOXR_DATATYPE_INT16I" }, - { no: 1, name: "SOXR_DATATYPE_INT16S" }, -]); - -/** - * @generated from enum livekit.proto.SoxQualityRecipe - */ -export enum SoxQualityRecipe { - /** - * @generated from enum value: SOXR_QUALITY_QUICK = 0; - */ - SOXR_QUALITY_QUICK = 0, - - /** - * @generated from enum value: SOXR_QUALITY_LOW = 1; - */ - SOXR_QUALITY_LOW = 1, - - /** - * @generated from enum value: SOXR_QUALITY_MEDIUM = 2; - */ - SOXR_QUALITY_MEDIUM = 2, - - /** - * @generated from enum value: SOXR_QUALITY_HIGH = 3; - */ - SOXR_QUALITY_HIGH = 3, - - /** - * @generated from enum value: SOXR_QUALITY_VERYHIGH = 4; - */ - SOXR_QUALITY_VERYHIGH = 4, -} -// Retrieve enum metadata with: proto3.getEnumType(SoxQualityRecipe) -proto3.util.setEnumType(SoxQualityRecipe, "livekit.proto.SoxQualityRecipe", [ - { no: 0, name: "SOXR_QUALITY_QUICK" }, - { no: 1, name: "SOXR_QUALITY_LOW" }, - { no: 2, name: "SOXR_QUALITY_MEDIUM" }, - { no: 3, name: "SOXR_QUALITY_HIGH" }, - { no: 4, name: "SOXR_QUALITY_VERYHIGH" }, -]); - -/** - * @generated from enum livekit.proto.SoxFlagBits - */ -export enum SoxFlagBits { - /** - * 1 << 0 - * - * @generated from enum value: SOXR_ROLLOFF_SMALL = 0; - */ - SOXR_ROLLOFF_SMALL = 0, - - /** - * 1 << 1 - * - * @generated from enum value: SOXR_ROLLOFF_MEDIUM = 1; - */ - SOXR_ROLLOFF_MEDIUM = 1, - - /** - * 1 << 2 - * - * @generated from enum value: SOXR_ROLLOFF_NONE = 2; - */ - SOXR_ROLLOFF_NONE = 2, - - /** - * 1 << 3 - * - * @generated from enum value: SOXR_HIGH_PREC_CLOCK = 3; - */ - SOXR_HIGH_PREC_CLOCK = 3, - - /** - * 1 << 4 - * - * @generated from enum value: SOXR_DOUBLE_PRECISION = 4; - */ - SOXR_DOUBLE_PRECISION = 4, - - /** - * 1 << 5 - * - * @generated from enum value: SOXR_VR = 5; - */ - SOXR_VR = 5, -} -// Retrieve enum metadata with: proto3.getEnumType(SoxFlagBits) -proto3.util.setEnumType(SoxFlagBits, "livekit.proto.SoxFlagBits", [ - { no: 0, name: "SOXR_ROLLOFF_SMALL" }, - { no: 1, name: "SOXR_ROLLOFF_MEDIUM" }, - { no: 2, name: "SOXR_ROLLOFF_NONE" }, - { no: 3, name: "SOXR_HIGH_PREC_CLOCK" }, - { no: 4, name: "SOXR_DOUBLE_PRECISION" }, - { no: 5, name: "SOXR_VR" }, -]); - -/** - * @generated from enum livekit.proto.AudioStreamType - */ -export enum AudioStreamType { - /** - * @generated from enum value: AUDIO_STREAM_NATIVE = 0; - */ - AUDIO_STREAM_NATIVE = 0, - - /** - * @generated from enum value: AUDIO_STREAM_HTML = 1; - */ - AUDIO_STREAM_HTML = 1, -} -// Retrieve enum metadata with: proto3.getEnumType(AudioStreamType) -proto3.util.setEnumType(AudioStreamType, "livekit.proto.AudioStreamType", [ - { no: 0, name: "AUDIO_STREAM_NATIVE" }, - { no: 1, name: "AUDIO_STREAM_HTML" }, -]); - -/** - * @generated from enum livekit.proto.AudioSourceType - */ -export enum AudioSourceType { - /** - * @generated from enum value: AUDIO_SOURCE_NATIVE = 0; - */ - AUDIO_SOURCE_NATIVE = 0, -} -// Retrieve enum metadata with: proto3.getEnumType(AudioSourceType) -proto3.util.setEnumType(AudioSourceType, "livekit.proto.AudioSourceType", [ - { no: 0, name: "AUDIO_SOURCE_NATIVE" }, -]); +export const file_audio_frame: GenFile = /*@__PURE__*/ + fileDesc("ChFhdWRpb19mcmFtZS5wcm90bxINbGl2ZWtpdC5wcm90byKGAQoVTmV3QXVkaW9TdHJlYW1SZXF1ZXN0EhQKDHRyYWNrX2hhbmRsZRgBIAIoBBIsCgR0eXBlGAIgAigOMh4ubGl2ZWtpdC5wcm90by5BdWRpb1N0cmVhbVR5cGUSEwoLc2FtcGxlX3JhdGUYAyACKA0SFAoMbnVtX2NoYW5uZWxzGAQgAigNIkkKFk5ld0F1ZGlvU3RyZWFtUmVzcG9uc2USLwoGc3RyZWFtGAEgAigLMh8ubGl2ZWtpdC5wcm90by5Pd25lZEF1ZGlvU3RyZWFtIsoBCiFBdWRpb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlcXVlc3QSGgoScGFydGljaXBhbnRfaGFuZGxlGAEgAigEEiwKBHR5cGUYAiACKA4yHi5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtVHlwZRIwCgx0cmFja19zb3VyY2UYAyABKA4yGi5saXZla2l0LnByb3RvLlRyYWNrU291cmNlEhMKC3NhbXBsZV9yYXRlGAUgAigNEhQKDG51bV9jaGFubmVscxgGIAIoDSJVCiJBdWRpb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlc3BvbnNlEi8KBnN0cmVhbRgBIAIoCzIfLmxpdmVraXQucHJvdG8uT3duZWRBdWRpb1N0cmVhbSK7AQoVTmV3QXVkaW9Tb3VyY2VSZXF1ZXN0EiwKBHR5cGUYASACKA4yHi5saXZla2l0LnByb3RvLkF1ZGlvU291cmNlVHlwZRIyCgdvcHRpb25zGAIgASgLMiEubGl2ZWtpdC5wcm90by5BdWRpb1NvdXJjZU9wdGlvbnMSEwoLc2FtcGxlX3JhdGUYAyACKA0SFAoMbnVtX2NoYW5uZWxzGAQgAigNEhUKDXF1ZXVlX3NpemVfbXMYBSACKA0iSQoWTmV3QXVkaW9Tb3VyY2VSZXNwb25zZRIvCgZzb3VyY2UYASACKAsyHy5saXZla2l0LnByb3RvLk93bmVkQXVkaW9Tb3VyY2UiZgoYQ2FwdHVyZUF1ZGlvRnJhbWVSZXF1ZXN0EhUKDXNvdXJjZV9oYW5kbGUYASACKAQSMwoGYnVmZmVyGAIgAigLMiMubGl2ZWtpdC5wcm90by5BdWRpb0ZyYW1lQnVmZmVySW5mbyItChlDYXB0dXJlQXVkaW9GcmFtZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIjwKGUNhcHR1cmVBdWRpb0ZyYW1lQ2FsbGJhY2sSEAoIYXN5bmNfaWQYASACKAQSDQoFZXJyb3IYAiABKAkiMAoXQ2xlYXJBdWRpb0J1ZmZlclJlcXVlc3QSFQoNc291cmNlX2hhbmRsZRgBIAIoBCIaChhDbGVhckF1ZGlvQnVmZmVyUmVzcG9uc2UiGgoYTmV3QXVkaW9SZXNhbXBsZXJSZXF1ZXN0IlIKGU5ld0F1ZGlvUmVzYW1wbGVyUmVzcG9uc2USNQoJcmVzYW1wbGVyGAEgAigLMiIubGl2ZWtpdC5wcm90by5Pd25lZEF1ZGlvUmVzYW1wbGVyIpMBChdSZW1peEFuZFJlc2FtcGxlUmVxdWVzdBIYChByZXNhbXBsZXJfaGFuZGxlGAEgAigEEjMKBmJ1ZmZlchgCIAIoCzIjLmxpdmVraXQucHJvdG8uQXVkaW9GcmFtZUJ1ZmZlckluZm8SFAoMbnVtX2NoYW5uZWxzGAMgAigNEhMKC3NhbXBsZV9yYXRlGAQgAigNIlAKGFJlbWl4QW5kUmVzYW1wbGVSZXNwb25zZRI0CgZidWZmZXIYASACKAsyJC5saXZla2l0LnByb3RvLk93bmVkQXVkaW9GcmFtZUJ1ZmZlciKcAgoWTmV3U294UmVzYW1wbGVyUmVxdWVzdBISCgppbnB1dF9yYXRlGAEgAigBEhMKC291dHB1dF9yYXRlGAIgAigBEhQKDG51bV9jaGFubmVscxgDIAIoDRI8Cg9pbnB1dF9kYXRhX3R5cGUYBCACKA4yIy5saXZla2l0LnByb3RvLlNveFJlc2FtcGxlckRhdGFUeXBlEj0KEG91dHB1dF9kYXRhX3R5cGUYBSACKA4yIy5saXZla2l0LnByb3RvLlNveFJlc2FtcGxlckRhdGFUeXBlEjcKDnF1YWxpdHlfcmVjaXBlGAYgAigOMh8ubGl2ZWtpdC5wcm90by5Tb3hRdWFsaXR5UmVjaXBlEg0KBWZsYWdzGAcgAigNImwKF05ld1NveFJlc2FtcGxlclJlc3BvbnNlEjUKCXJlc2FtcGxlchgBIAEoCzIgLmxpdmVraXQucHJvdG8uT3duZWRTb3hSZXNhbXBsZXJIABIPCgVlcnJvchgCIAEoCUgAQgkKB21lc3NhZ2UiUwoXUHVzaFNveFJlc2FtcGxlclJlcXVlc3QSGAoQcmVzYW1wbGVyX2hhbmRsZRgBIAIoBBIQCghkYXRhX3B0chgCIAIoBBIMCgRzaXplGAMgAigNIksKGFB1c2hTb3hSZXNhbXBsZXJSZXNwb25zZRISCgpvdXRwdXRfcHRyGAEgAigEEgwKBHNpemUYAiACKA0SDQoFZXJyb3IYAyABKAkiNAoYRmx1c2hTb3hSZXNhbXBsZXJSZXF1ZXN0EhgKEHJlc2FtcGxlcl9oYW5kbGUYASACKAQiTAoZRmx1c2hTb3hSZXNhbXBsZXJSZXNwb25zZRISCgpvdXRwdXRfcHRyGAEgAigEEgwKBHNpemUYAiACKA0SDQoFZXJyb3IYAyABKAkicAoUQXVkaW9GcmFtZUJ1ZmZlckluZm8SEAoIZGF0YV9wdHIYASACKAQSFAoMbnVtX2NoYW5uZWxzGAIgAigNEhMKC3NhbXBsZV9yYXRlGAMgAigNEhsKE3NhbXBsZXNfcGVyX2NoYW5uZWwYBCACKA0ieQoVT3duZWRBdWRpb0ZyYW1lQnVmZmVyEi0KBmhhbmRsZRgBIAIoCzIdLmxpdmVraXQucHJvdG8uRmZpT3duZWRIYW5kbGUSMQoEaW5mbxgCIAIoCzIjLmxpdmVraXQucHJvdG8uQXVkaW9GcmFtZUJ1ZmZlckluZm8iPwoPQXVkaW9TdHJlYW1JbmZvEiwKBHR5cGUYASACKA4yHi5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtVHlwZSJvChBPd25lZEF1ZGlvU3RyZWFtEi0KBmhhbmRsZRgBIAIoCzIdLmxpdmVraXQucHJvdG8uRmZpT3duZWRIYW5kbGUSLAoEaW5mbxgCIAIoCzIeLmxpdmVraXQucHJvdG8uQXVkaW9TdHJlYW1JbmZvIp8BChBBdWRpb1N0cmVhbUV2ZW50EhUKDXN0cmVhbV9oYW5kbGUYASACKAQSOwoOZnJhbWVfcmVjZWl2ZWQYAiABKAsyIS5saXZla2l0LnByb3RvLkF1ZGlvRnJhbWVSZWNlaXZlZEgAEiwKA2VvcxgDIAEoCzIdLmxpdmVraXQucHJvdG8uQXVkaW9TdHJlYW1FT1NIAEIJCgdtZXNzYWdlIkkKEkF1ZGlvRnJhbWVSZWNlaXZlZBIzCgVmcmFtZRgBIAIoCzIkLmxpdmVraXQucHJvdG8uT3duZWRBdWRpb0ZyYW1lQnVmZmVyIhAKDkF1ZGlvU3RyZWFtRU9TImUKEkF1ZGlvU291cmNlT3B0aW9ucxIZChFlY2hvX2NhbmNlbGxhdGlvbhgBIAIoCBIZChFub2lzZV9zdXBwcmVzc2lvbhgCIAIoCBIZChFhdXRvX2dhaW5fY29udHJvbBgDIAIoCCI/Cg9BdWRpb1NvdXJjZUluZm8SLAoEdHlwZRgCIAIoDjIeLmxpdmVraXQucHJvdG8uQXVkaW9Tb3VyY2VUeXBlIm8KEE93bmVkQXVkaW9Tb3VyY2USLQoGaGFuZGxlGAEgAigLMh0ubGl2ZWtpdC5wcm90by5GZmlPd25lZEhhbmRsZRIsCgRpbmZvGAIgAigLMh4ubGl2ZWtpdC5wcm90by5BdWRpb1NvdXJjZUluZm8iFAoSQXVkaW9SZXNhbXBsZXJJbmZvInUKE093bmVkQXVkaW9SZXNhbXBsZXISLQoGaGFuZGxlGAEgAigLMh0ubGl2ZWtpdC5wcm90by5GZmlPd25lZEhhbmRsZRIvCgRpbmZvGAIgAigLMiEubGl2ZWtpdC5wcm90by5BdWRpb1Jlc2FtcGxlckluZm8iEgoQU294UmVzYW1wbGVySW5mbyJxChFPd25lZFNveFJlc2FtcGxlchItCgZoYW5kbGUYASACKAsyHS5saXZla2l0LnByb3RvLkZmaU93bmVkSGFuZGxlEi0KBGluZm8YAiACKAsyHy5saXZla2l0LnByb3RvLlNveFJlc2FtcGxlckluZm8qSgoUU294UmVzYW1wbGVyRGF0YVR5cGUSGAoUU09YUl9EQVRBVFlQRV9JTlQxNkkQABIYChRTT1hSX0RBVEFUWVBFX0lOVDE2UxABKosBChBTb3hRdWFsaXR5UmVjaXBlEhYKElNPWFJfUVVBTElUWV9RVUlDSxAAEhQKEFNPWFJfUVVBTElUWV9MT1cQARIXChNTT1hSX1FVQUxJVFlfTUVESVVNEAISFQoRU09YUl9RVUFMSVRZX0hJR0gQAxIZChVTT1hSX1FVQUxJVFlfVkVSWUhJR0gQBCqXAQoLU294RmxhZ0JpdHMSFgoSU09YUl9ST0xMT0ZGX1NNQUxMEAASFwoTU09YUl9ST0xMT0ZGX01FRElVTRABEhUKEVNPWFJfUk9MTE9GRl9OT05FEAISGAoUU09YUl9ISUdIX1BSRUNfQ0xPQ0sQAxIZChVTT1hSX0RPVUJMRV9QUkVDSVNJT04QBBILCgdTT1hSX1ZSEAUqQQoPQXVkaW9TdHJlYW1UeXBlEhcKE0FVRElPX1NUUkVBTV9OQVRJVkUQABIVChFBVURJT19TVFJFQU1fSFRNTBABKioKD0F1ZGlvU291cmNlVHlwZRIXChNBVURJT19TT1VSQ0VfTkFUSVZFEABCEKoCDUxpdmVLaXQuUHJvdG8", [file_handle, file_track]); /** * Create a new AudioStream @@ -178,203 +36,116 @@ proto3.util.setEnumType(AudioSourceType, "livekit.proto.AudioSourceType", [ * * @generated from message livekit.proto.NewAudioStreamRequest */ -export class NewAudioStreamRequest extends Message { +export type NewAudioStreamRequest = Message<"livekit.proto.NewAudioStreamRequest"> & { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle: bigint; /** - * @generated from field: livekit.proto.AudioStreamType type = 2; + * @generated from field: required livekit.proto.AudioStreamType type = 2; */ - type = AudioStreamType.AUDIO_STREAM_NATIVE; + type: AudioStreamType; /** - * @generated from field: uint32 sample_rate = 3; + * @generated from field: required uint32 sample_rate = 3; */ - sampleRate = 0; + sampleRate: number; /** - * @generated from field: uint32 num_channels = 4; + * @generated from field: required uint32 num_channels = 4; */ - numChannels = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewAudioStreamRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AudioStreamType) }, - { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioStreamRequest { - return new NewAudioStreamRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewAudioStreamRequest { - return new NewAudioStreamRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewAudioStreamRequest { - return new NewAudioStreamRequest().fromJsonString(jsonString, options); - } + numChannels: number; +}; - static equals(a: NewAudioStreamRequest | PlainMessage | undefined, b: NewAudioStreamRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioStreamRequest, a, b); - } -} +/** + * Describes the message livekit.proto.NewAudioStreamRequest. + * Use `create(NewAudioStreamRequestSchema)` to create a new message. + */ +export const NewAudioStreamRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 0); /** * @generated from message livekit.proto.NewAudioStreamResponse */ -export class NewAudioStreamResponse extends Message { +export type NewAudioStreamResponse = Message<"livekit.proto.NewAudioStreamResponse"> & { /** - * @generated from field: livekit.proto.OwnedAudioStream stream = 1; + * @generated from field: required livekit.proto.OwnedAudioStream stream = 1; */ stream?: OwnedAudioStream; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewAudioStreamResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedAudioStream }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioStreamResponse { - return new NewAudioStreamResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewAudioStreamResponse { - return new NewAudioStreamResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewAudioStreamResponse { - return new NewAudioStreamResponse().fromJsonString(jsonString, options); - } - - static equals(a: NewAudioStreamResponse | PlainMessage | undefined, b: NewAudioStreamResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioStreamResponse, a, b); - } -} +/** + * Describes the message livekit.proto.NewAudioStreamResponse. + * Use `create(NewAudioStreamResponseSchema)` to create a new message. + */ +export const NewAudioStreamResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 1); /** * @generated from message livekit.proto.AudioStreamFromParticipantRequest */ -export class AudioStreamFromParticipantRequest extends Message { +export type AudioStreamFromParticipantRequest = Message<"livekit.proto.AudioStreamFromParticipantRequest"> & { /** - * @generated from field: uint64 participant_handle = 1; + * @generated from field: required uint64 participant_handle = 1; */ - participantHandle = protoInt64.zero; + participantHandle: bigint; /** - * @generated from field: livekit.proto.AudioStreamType type = 2; + * @generated from field: required livekit.proto.AudioStreamType type = 2; */ - type = AudioStreamType.AUDIO_STREAM_NATIVE; + type: AudioStreamType; /** * @generated from field: optional livekit.proto.TrackSource track_source = 3; */ - trackSource?: TrackSource; + trackSource: TrackSource; /** - * @generated from field: uint32 sample_rate = 5; + * @generated from field: required uint32 sample_rate = 5; */ - sampleRate = 0; + sampleRate: number; /** - * @generated from field: uint32 num_channels = 6; + * @generated from field: required uint32 num_channels = 6; */ - numChannels = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioStreamFromParticipantRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AudioStreamType) }, - { no: 3, name: "track_source", kind: "enum", T: proto3.getEnumType(TrackSource), opt: true }, - { no: 5, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 6, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamFromParticipantRequest { - return new AudioStreamFromParticipantRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioStreamFromParticipantRequest { - return new AudioStreamFromParticipantRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioStreamFromParticipantRequest { - return new AudioStreamFromParticipantRequest().fromJsonString(jsonString, options); - } + numChannels: number; +}; - static equals(a: AudioStreamFromParticipantRequest | PlainMessage | undefined, b: AudioStreamFromParticipantRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamFromParticipantRequest, a, b); - } -} +/** + * Describes the message livekit.proto.AudioStreamFromParticipantRequest. + * Use `create(AudioStreamFromParticipantRequestSchema)` to create a new message. + */ +export const AudioStreamFromParticipantRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 2); /** * @generated from message livekit.proto.AudioStreamFromParticipantResponse */ -export class AudioStreamFromParticipantResponse extends Message { +export type AudioStreamFromParticipantResponse = Message<"livekit.proto.AudioStreamFromParticipantResponse"> & { /** - * @generated from field: livekit.proto.OwnedAudioStream stream = 1; + * @generated from field: required livekit.proto.OwnedAudioStream stream = 1; */ stream?: OwnedAudioStream; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioStreamFromParticipantResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedAudioStream }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamFromParticipantResponse { - return new AudioStreamFromParticipantResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioStreamFromParticipantResponse { - return new AudioStreamFromParticipantResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioStreamFromParticipantResponse { - return new AudioStreamFromParticipantResponse().fromJsonString(jsonString, options); - } - - static equals(a: AudioStreamFromParticipantResponse | PlainMessage | undefined, b: AudioStreamFromParticipantResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamFromParticipantResponse, a, b); - } -} +/** + * Describes the message livekit.proto.AudioStreamFromParticipantResponse. + * Use `create(AudioStreamFromParticipantResponseSchema)` to create a new message. + */ +export const AudioStreamFromParticipantResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 3); /** * Create a new AudioSource * * @generated from message livekit.proto.NewAudioSourceRequest */ -export class NewAudioSourceRequest extends Message { +export type NewAudioSourceRequest = Message<"livekit.proto.NewAudioSourceRequest"> & { /** - * @generated from field: livekit.proto.AudioSourceType type = 1; + * @generated from field: required livekit.proto.AudioSourceType type = 1; */ - type = AudioSourceType.AUDIO_SOURCE_NATIVE; + type: AudioSourceType; /** * @generated from field: optional livekit.proto.AudioSourceOptions options = 2; @@ -382,88 +153,44 @@ export class NewAudioSourceRequest extends Message { options?: AudioSourceOptions; /** - * @generated from field: uint32 sample_rate = 3; + * @generated from field: required uint32 sample_rate = 3; */ - sampleRate = 0; + sampleRate: number; /** - * @generated from field: uint32 num_channels = 4; + * @generated from field: required uint32 num_channels = 4; */ - numChannels = 0; + numChannels: number; /** - * @generated from field: uint32 queue_size_ms = 5; + * @generated from field: required uint32 queue_size_ms = 5; */ - queueSizeMs = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewAudioSourceRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(AudioSourceType) }, - { 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: "queue_size_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioSourceRequest { - return new NewAudioSourceRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewAudioSourceRequest { - return new NewAudioSourceRequest().fromJson(jsonValue, options); - } + queueSizeMs: number; +}; - static fromJsonString(jsonString: string, options?: Partial): NewAudioSourceRequest { - return new NewAudioSourceRequest().fromJsonString(jsonString, options); - } - - static equals(a: NewAudioSourceRequest | PlainMessage | undefined, b: NewAudioSourceRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioSourceRequest, a, b); - } -} +/** + * Describes the message livekit.proto.NewAudioSourceRequest. + * Use `create(NewAudioSourceRequestSchema)` to create a new message. + */ +export const NewAudioSourceRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 4); /** * @generated from message livekit.proto.NewAudioSourceResponse */ -export class NewAudioSourceResponse extends Message { +export type NewAudioSourceResponse = Message<"livekit.proto.NewAudioSourceResponse"> & { /** - * @generated from field: livekit.proto.OwnedAudioSource source = 1; + * @generated from field: required livekit.proto.OwnedAudioSource source = 1; */ source?: OwnedAudioSource; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewAudioSourceResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source", kind: "message", T: OwnedAudioSource }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioSourceResponse { - return new NewAudioSourceResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewAudioSourceResponse { - return new NewAudioSourceResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewAudioSourceResponse { - return new NewAudioSourceResponse().fromJsonString(jsonString, options); - } - - static equals(a: NewAudioSourceResponse | PlainMessage | undefined, b: NewAudioSourceResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioSourceResponse, a, b); - } -} +/** + * Describes the message livekit.proto.NewAudioSourceResponse. + * Use `create(NewAudioSourceResponseSchema)` to create a new message. + */ +export const NewAudioSourceResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 5); /** * Push a frame to an AudioSource @@ -471,858 +198,466 @@ export class NewAudioSourceResponse extends Message { * * @generated from message livekit.proto.CaptureAudioFrameRequest */ -export class CaptureAudioFrameRequest extends Message { +export type CaptureAudioFrameRequest = Message<"livekit.proto.CaptureAudioFrameRequest"> & { /** - * @generated from field: uint64 source_handle = 1; + * @generated from field: required uint64 source_handle = 1; */ - sourceHandle = protoInt64.zero; + sourceHandle: bigint; /** - * @generated from field: livekit.proto.AudioFrameBufferInfo buffer = 2; + * @generated from field: required livekit.proto.AudioFrameBufferInfo buffer = 2; */ buffer?: AudioFrameBufferInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CaptureAudioFrameRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CaptureAudioFrameRequest { - return new CaptureAudioFrameRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CaptureAudioFrameRequest { - return new CaptureAudioFrameRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CaptureAudioFrameRequest { - return new CaptureAudioFrameRequest().fromJsonString(jsonString, options); - } - - static equals(a: CaptureAudioFrameRequest | PlainMessage | undefined, b: CaptureAudioFrameRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureAudioFrameRequest, a, b); - } -} +/** + * Describes the message livekit.proto.CaptureAudioFrameRequest. + * Use `create(CaptureAudioFrameRequestSchema)` to create a new message. + */ +export const CaptureAudioFrameRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 6); /** * @generated from message livekit.proto.CaptureAudioFrameResponse */ -export class CaptureAudioFrameResponse extends Message { +export type CaptureAudioFrameResponse = Message<"livekit.proto.CaptureAudioFrameResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CaptureAudioFrameResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CaptureAudioFrameResponse { - return new CaptureAudioFrameResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CaptureAudioFrameResponse { - return new CaptureAudioFrameResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CaptureAudioFrameResponse { - return new CaptureAudioFrameResponse().fromJsonString(jsonString, options); - } - - static equals(a: CaptureAudioFrameResponse | PlainMessage | undefined, b: CaptureAudioFrameResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureAudioFrameResponse, a, b); - } -} +/** + * Describes the message livekit.proto.CaptureAudioFrameResponse. + * Use `create(CaptureAudioFrameResponseSchema)` to create a new message. + */ +export const CaptureAudioFrameResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 7); /** * @generated from message livekit.proto.CaptureAudioFrameCallback */ -export class CaptureAudioFrameCallback extends Message { +export type CaptureAudioFrameCallback = Message<"livekit.proto.CaptureAudioFrameCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @generated from field: optional string error = 2; */ - error?: string; + error: string; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CaptureAudioFrameCallback"; - 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): CaptureAudioFrameCallback { - return new CaptureAudioFrameCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CaptureAudioFrameCallback { - return new CaptureAudioFrameCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CaptureAudioFrameCallback { - return new CaptureAudioFrameCallback().fromJsonString(jsonString, options); - } - - static equals(a: CaptureAudioFrameCallback | PlainMessage | undefined, b: CaptureAudioFrameCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureAudioFrameCallback, a, b); - } -} +/** + * Describes the message livekit.proto.CaptureAudioFrameCallback. + * Use `create(CaptureAudioFrameCallbackSchema)` to create a new message. + */ +export const CaptureAudioFrameCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 8); /** * @generated from message livekit.proto.ClearAudioBufferRequest */ -export class ClearAudioBufferRequest extends Message { +export type ClearAudioBufferRequest = Message<"livekit.proto.ClearAudioBufferRequest"> & { /** - * @generated from field: uint64 source_handle = 1; + * @generated from field: required uint64 source_handle = 1; */ - sourceHandle = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ClearAudioBufferRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ClearAudioBufferRequest { - return new ClearAudioBufferRequest().fromBinary(bytes, options); - } + sourceHandle: bigint; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): ClearAudioBufferRequest { - return new ClearAudioBufferRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ClearAudioBufferRequest { - return new ClearAudioBufferRequest().fromJsonString(jsonString, options); - } - - static equals(a: ClearAudioBufferRequest | PlainMessage | undefined, b: ClearAudioBufferRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ClearAudioBufferRequest, a, b); - } -} +/** + * Describes the message livekit.proto.ClearAudioBufferRequest. + * Use `create(ClearAudioBufferRequestSchema)` to create a new message. + */ +export const ClearAudioBufferRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 9); /** * @generated from message livekit.proto.ClearAudioBufferResponse */ -export class ClearAudioBufferResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ClearAudioBufferResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ClearAudioBufferResponse { - return new ClearAudioBufferResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ClearAudioBufferResponse { - return new ClearAudioBufferResponse().fromJson(jsonValue, options); - } +export type ClearAudioBufferResponse = Message<"livekit.proto.ClearAudioBufferResponse"> & { +}; - static fromJsonString(jsonString: string, options?: Partial): ClearAudioBufferResponse { - return new ClearAudioBufferResponse().fromJsonString(jsonString, options); - } - - static equals(a: ClearAudioBufferResponse | PlainMessage | undefined, b: ClearAudioBufferResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ClearAudioBufferResponse, a, b); - } -} +/** + * Describes the message livekit.proto.ClearAudioBufferResponse. + * Use `create(ClearAudioBufferResponseSchema)` to create a new message. + */ +export const ClearAudioBufferResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 10); /** * Create a new AudioResampler * * @generated from message livekit.proto.NewAudioResamplerRequest */ -export class NewAudioResamplerRequest extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewAudioResamplerRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioResamplerRequest { - return new NewAudioResamplerRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewAudioResamplerRequest { - return new NewAudioResamplerRequest().fromJson(jsonValue, options); - } +export type NewAudioResamplerRequest = Message<"livekit.proto.NewAudioResamplerRequest"> & { +}; - static fromJsonString(jsonString: string, options?: Partial): NewAudioResamplerRequest { - return new NewAudioResamplerRequest().fromJsonString(jsonString, options); - } - - static equals(a: NewAudioResamplerRequest | PlainMessage | undefined, b: NewAudioResamplerRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioResamplerRequest, a, b); - } -} +/** + * Describes the message livekit.proto.NewAudioResamplerRequest. + * Use `create(NewAudioResamplerRequestSchema)` to create a new message. + */ +export const NewAudioResamplerRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 11); /** * @generated from message livekit.proto.NewAudioResamplerResponse */ -export class NewAudioResamplerResponse extends Message { +export type NewAudioResamplerResponse = Message<"livekit.proto.NewAudioResamplerResponse"> & { /** - * @generated from field: livekit.proto.OwnedAudioResampler resampler = 1; + * @generated from field: required livekit.proto.OwnedAudioResampler resampler = 1; */ resampler?: OwnedAudioResampler; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewAudioResamplerResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler", kind: "message", T: OwnedAudioResampler }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewAudioResamplerResponse { - return new NewAudioResamplerResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewAudioResamplerResponse { - return new NewAudioResamplerResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewAudioResamplerResponse { - return new NewAudioResamplerResponse().fromJsonString(jsonString, options); - } - - static equals(a: NewAudioResamplerResponse | PlainMessage | undefined, b: NewAudioResamplerResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewAudioResamplerResponse, a, b); - } -} +/** + * Describes the message livekit.proto.NewAudioResamplerResponse. + * Use `create(NewAudioResamplerResponseSchema)` to create a new message. + */ +export const NewAudioResamplerResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 12); /** * Remix and resample an audio frame * * @generated from message livekit.proto.RemixAndResampleRequest */ -export class RemixAndResampleRequest extends Message { +export type RemixAndResampleRequest = Message<"livekit.proto.RemixAndResampleRequest"> & { /** - * @generated from field: uint64 resampler_handle = 1; + * @generated from field: required uint64 resampler_handle = 1; */ - resamplerHandle = protoInt64.zero; + resamplerHandle: bigint; /** - * @generated from field: livekit.proto.AudioFrameBufferInfo buffer = 2; + * @generated from field: required livekit.proto.AudioFrameBufferInfo buffer = 2; */ buffer?: AudioFrameBufferInfo; /** - * @generated from field: uint32 num_channels = 3; + * @generated from field: required uint32 num_channels = 3; */ - numChannels = 0; + numChannels: number; /** - * @generated from field: uint32 sample_rate = 4; + * @generated from field: required uint32 sample_rate = 4; */ - sampleRate = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RemixAndResampleRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "buffer", kind: "message", T: AudioFrameBufferInfo }, - { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RemixAndResampleRequest { - return new RemixAndResampleRequest().fromBinary(bytes, options); - } + sampleRate: number; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): RemixAndResampleRequest { - return new RemixAndResampleRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RemixAndResampleRequest { - return new RemixAndResampleRequest().fromJsonString(jsonString, options); - } - - static equals(a: RemixAndResampleRequest | PlainMessage | undefined, b: RemixAndResampleRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RemixAndResampleRequest, a, b); - } -} +/** + * Describes the message livekit.proto.RemixAndResampleRequest. + * Use `create(RemixAndResampleRequestSchema)` to create a new message. + */ +export const RemixAndResampleRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 13); /** * @generated from message livekit.proto.RemixAndResampleResponse */ -export class RemixAndResampleResponse extends Message { +export type RemixAndResampleResponse = Message<"livekit.proto.RemixAndResampleResponse"> & { /** - * @generated from field: livekit.proto.OwnedAudioFrameBuffer buffer = 1; + * @generated from field: required livekit.proto.OwnedAudioFrameBuffer buffer = 1; */ buffer?: OwnedAudioFrameBuffer; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RemixAndResampleResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "buffer", kind: "message", T: OwnedAudioFrameBuffer }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RemixAndResampleResponse { - return new RemixAndResampleResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RemixAndResampleResponse { - return new RemixAndResampleResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RemixAndResampleResponse { - return new RemixAndResampleResponse().fromJsonString(jsonString, options); - } - - static equals(a: RemixAndResampleResponse | PlainMessage | undefined, b: RemixAndResampleResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RemixAndResampleResponse, a, b); - } -} +/** + * Describes the message livekit.proto.RemixAndResampleResponse. + * Use `create(RemixAndResampleResponseSchema)` to create a new message. + */ +export const RemixAndResampleResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 14); /** * @generated from message livekit.proto.NewSoxResamplerRequest */ -export class NewSoxResamplerRequest extends Message { +export type NewSoxResamplerRequest = Message<"livekit.proto.NewSoxResamplerRequest"> & { /** - * @generated from field: double input_rate = 1; + * @generated from field: required double input_rate = 1; */ - inputRate = 0; + inputRate: number; /** - * @generated from field: double output_rate = 2; + * @generated from field: required double output_rate = 2; */ - outputRate = 0; + outputRate: number; /** - * @generated from field: uint32 num_channels = 3; + * @generated from field: required uint32 num_channels = 3; */ - numChannels = 0; + numChannels: number; /** - * @generated from field: livekit.proto.SoxResamplerDataType input_data_type = 4; + * @generated from field: required livekit.proto.SoxResamplerDataType input_data_type = 4; */ - inputDataType = SoxResamplerDataType.SOXR_DATATYPE_INT16I; + inputDataType: SoxResamplerDataType; /** - * @generated from field: livekit.proto.SoxResamplerDataType output_data_type = 5; + * @generated from field: required livekit.proto.SoxResamplerDataType output_data_type = 5; */ - outputDataType = SoxResamplerDataType.SOXR_DATATYPE_INT16I; + outputDataType: SoxResamplerDataType; /** - * @generated from field: livekit.proto.SoxQualityRecipe quality_recipe = 6; + * @generated from field: required livekit.proto.SoxQualityRecipe quality_recipe = 6; */ - qualityRecipe = SoxQualityRecipe.SOXR_QUALITY_QUICK; + qualityRecipe: SoxQualityRecipe; /** - * @generated from field: uint32 flags = 7; + * @generated from field: required uint32 flags = 7; */ - flags = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewSoxResamplerRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "input_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 2, name: "output_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "input_data_type", kind: "enum", T: proto3.getEnumType(SoxResamplerDataType) }, - { no: 5, name: "output_data_type", kind: "enum", T: proto3.getEnumType(SoxResamplerDataType) }, - { no: 6, name: "quality_recipe", kind: "enum", T: proto3.getEnumType(SoxQualityRecipe) }, - { no: 7, name: "flags", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); + flags: number; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): NewSoxResamplerRequest { - return new NewSoxResamplerRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewSoxResamplerRequest { - return new NewSoxResamplerRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewSoxResamplerRequest { - return new NewSoxResamplerRequest().fromJsonString(jsonString, options); - } - - static equals(a: NewSoxResamplerRequest | PlainMessage | undefined, b: NewSoxResamplerRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewSoxResamplerRequest, a, b); - } -} +/** + * Describes the message livekit.proto.NewSoxResamplerRequest. + * Use `create(NewSoxResamplerRequestSchema)` to create a new message. + */ +export const NewSoxResamplerRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 15); /** * @generated from message livekit.proto.NewSoxResamplerResponse */ -export class NewSoxResamplerResponse extends Message { +export type NewSoxResamplerResponse = Message<"livekit.proto.NewSoxResamplerResponse"> & { /** - * @generated from field: livekit.proto.OwnedSoxResampler resampler = 1; + * @generated from oneof livekit.proto.NewSoxResamplerResponse.message */ - resampler?: OwnedSoxResampler; - - /** - * @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.NewSoxResamplerResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler", kind: "message", T: OwnedSoxResampler }, - { no: 2, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewSoxResamplerResponse { - return new NewSoxResamplerResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewSoxResamplerResponse { - return new NewSoxResamplerResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewSoxResamplerResponse { - return new NewSoxResamplerResponse().fromJsonString(jsonString, options); - } + message: { + /** + * @generated from field: livekit.proto.OwnedSoxResampler resampler = 1; + */ + value: OwnedSoxResampler; + case: "resampler"; + } | { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { case: undefined; value?: undefined }; +}; - static equals(a: NewSoxResamplerResponse | PlainMessage | undefined, b: NewSoxResamplerResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewSoxResamplerResponse, a, b); - } -} +/** + * Describes the message livekit.proto.NewSoxResamplerResponse. + * Use `create(NewSoxResamplerResponseSchema)` to create a new message. + */ +export const NewSoxResamplerResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 16); /** * @generated from message livekit.proto.PushSoxResamplerRequest */ -export class PushSoxResamplerRequest extends Message { +export type PushSoxResamplerRequest = Message<"livekit.proto.PushSoxResamplerRequest"> & { /** - * @generated from field: uint64 resampler_handle = 1; + * @generated from field: required uint64 resampler_handle = 1; */ - resamplerHandle = protoInt64.zero; + resamplerHandle: bigint; /** * *const i16 * - * @generated from field: uint64 data_ptr = 2; + * @generated from field: required uint64 data_ptr = 2; */ - dataPtr = protoInt64.zero; + dataPtr: bigint; /** * in bytes * - * @generated from field: uint32 size = 3; - */ - size = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PushSoxResamplerRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PushSoxResamplerRequest { - return new PushSoxResamplerRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PushSoxResamplerRequest { - return new PushSoxResamplerRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PushSoxResamplerRequest { - return new PushSoxResamplerRequest().fromJsonString(jsonString, options); - } - - static equals(a: PushSoxResamplerRequest | PlainMessage | undefined, b: PushSoxResamplerRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PushSoxResamplerRequest, a, b); - } -} + * @generated from field: required uint32 size = 3; + */ + size: number; +}; + +/** + * Describes the message livekit.proto.PushSoxResamplerRequest. + * Use `create(PushSoxResamplerRequestSchema)` to create a new message. + */ +export const PushSoxResamplerRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 17); /** * @generated from message livekit.proto.PushSoxResamplerResponse */ -export class PushSoxResamplerResponse extends Message { +export type PushSoxResamplerResponse = Message<"livekit.proto.PushSoxResamplerResponse"> & { /** * *const i16 (could be null) * - * @generated from field: uint64 output_ptr = 1; + * @generated from field: required uint64 output_ptr = 1; */ - outputPtr = protoInt64.zero; + outputPtr: bigint; /** * in bytes * - * @generated from field: uint32 size = 2; + * @generated from field: required uint32 size = 2; */ - size = 0; + size: number; /** * @generated from field: optional string error = 3; */ - error?: string; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PushSoxResamplerResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - ]); + error: string; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): PushSoxResamplerResponse { - return new PushSoxResamplerResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PushSoxResamplerResponse { - return new PushSoxResamplerResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PushSoxResamplerResponse { - return new PushSoxResamplerResponse().fromJsonString(jsonString, options); - } - - static equals(a: PushSoxResamplerResponse | PlainMessage | undefined, b: PushSoxResamplerResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PushSoxResamplerResponse, a, b); - } -} +/** + * Describes the message livekit.proto.PushSoxResamplerResponse. + * Use `create(PushSoxResamplerResponseSchema)` to create a new message. + */ +export const PushSoxResamplerResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 18); /** * @generated from message livekit.proto.FlushSoxResamplerRequest */ -export class FlushSoxResamplerRequest extends Message { +export type FlushSoxResamplerRequest = Message<"livekit.proto.FlushSoxResamplerRequest"> & { /** - * @generated from field: uint64 resampler_handle = 1; + * @generated from field: required uint64 resampler_handle = 1; */ - resamplerHandle = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FlushSoxResamplerRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "resampler_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FlushSoxResamplerRequest { - return new FlushSoxResamplerRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FlushSoxResamplerRequest { - return new FlushSoxResamplerRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FlushSoxResamplerRequest { - return new FlushSoxResamplerRequest().fromJsonString(jsonString, options); - } + resamplerHandle: bigint; +}; - static equals(a: FlushSoxResamplerRequest | PlainMessage | undefined, b: FlushSoxResamplerRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(FlushSoxResamplerRequest, a, b); - } -} +/** + * Describes the message livekit.proto.FlushSoxResamplerRequest. + * Use `create(FlushSoxResamplerRequestSchema)` to create a new message. + */ +export const FlushSoxResamplerRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 19); /** * @generated from message livekit.proto.FlushSoxResamplerResponse */ -export class FlushSoxResamplerResponse extends Message { +export type FlushSoxResamplerResponse = Message<"livekit.proto.FlushSoxResamplerResponse"> & { /** * *const i16 (could be null) * - * @generated from field: uint64 output_ptr = 1; + * @generated from field: required uint64 output_ptr = 1; */ - outputPtr = protoInt64.zero; + outputPtr: bigint; /** * in bytes * - * @generated from field: uint32 size = 2; + * @generated from field: required uint32 size = 2; */ - size = 0; + size: number; /** * @generated from field: optional string error = 3; */ - error?: string; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FlushSoxResamplerResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "output_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FlushSoxResamplerResponse { - return new FlushSoxResamplerResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FlushSoxResamplerResponse { - return new FlushSoxResamplerResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FlushSoxResamplerResponse { - return new FlushSoxResamplerResponse().fromJsonString(jsonString, options); - } + error: string; +}; - static equals(a: FlushSoxResamplerResponse | PlainMessage | undefined, b: FlushSoxResamplerResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(FlushSoxResamplerResponse, a, b); - } -} +/** + * Describes the message livekit.proto.FlushSoxResamplerResponse. + * Use `create(FlushSoxResamplerResponseSchema)` to create a new message. + */ +export const FlushSoxResamplerResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 20); /** * @generated from message livekit.proto.AudioFrameBufferInfo */ -export class AudioFrameBufferInfo extends Message { +export type AudioFrameBufferInfo = Message<"livekit.proto.AudioFrameBufferInfo"> & { /** * *const i16 * - * @generated from field: uint64 data_ptr = 1; + * @generated from field: required uint64 data_ptr = 1; */ - dataPtr = protoInt64.zero; + dataPtr: bigint; /** - * @generated from field: uint32 num_channels = 2; + * @generated from field: required uint32 num_channels = 2; */ - numChannels = 0; + numChannels: number; /** - * @generated from field: uint32 sample_rate = 3; + * @generated from field: required uint32 sample_rate = 3; */ - sampleRate = 0; + sampleRate: number; /** - * @generated from field: uint32 samples_per_channel = 4; + * @generated from field: required uint32 samples_per_channel = 4; */ - samplesPerChannel = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioFrameBufferInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "num_channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "sample_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "samples_per_channel", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioFrameBufferInfo { - return new AudioFrameBufferInfo().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioFrameBufferInfo { - return new AudioFrameBufferInfo().fromJson(jsonValue, options); - } + samplesPerChannel: number; +}; - static fromJsonString(jsonString: string, options?: Partial): AudioFrameBufferInfo { - return new AudioFrameBufferInfo().fromJsonString(jsonString, options); - } - - static equals(a: AudioFrameBufferInfo | PlainMessage | undefined, b: AudioFrameBufferInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioFrameBufferInfo, a, b); - } -} +/** + * Describes the message livekit.proto.AudioFrameBufferInfo. + * Use `create(AudioFrameBufferInfoSchema)` to create a new message. + */ +export const AudioFrameBufferInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 21); /** * @generated from message livekit.proto.OwnedAudioFrameBuffer */ -export class OwnedAudioFrameBuffer extends Message { +export type OwnedAudioFrameBuffer = Message<"livekit.proto.OwnedAudioFrameBuffer"> & { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.AudioFrameBufferInfo info = 2; + * @generated from field: required livekit.proto.AudioFrameBufferInfo info = 2; */ info?: AudioFrameBufferInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedAudioFrameBuffer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: AudioFrameBufferInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioFrameBuffer { - return new OwnedAudioFrameBuffer().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedAudioFrameBuffer { - return new OwnedAudioFrameBuffer().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedAudioFrameBuffer { - return new OwnedAudioFrameBuffer().fromJsonString(jsonString, options); - } - - static equals(a: OwnedAudioFrameBuffer | PlainMessage | undefined, b: OwnedAudioFrameBuffer | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedAudioFrameBuffer, a, b); - } -} +/** + * Describes the message livekit.proto.OwnedAudioFrameBuffer. + * Use `create(OwnedAudioFrameBufferSchema)` to create a new message. + */ +export const OwnedAudioFrameBufferSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 22); /** * @generated from message livekit.proto.AudioStreamInfo */ -export class AudioStreamInfo extends Message { +export type AudioStreamInfo = Message<"livekit.proto.AudioStreamInfo"> & { /** - * @generated from field: livekit.proto.AudioStreamType type = 1; + * @generated from field: required livekit.proto.AudioStreamType type = 1; */ - type = AudioStreamType.AUDIO_STREAM_NATIVE; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + type: AudioStreamType; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioStreamInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(AudioStreamType) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamInfo { - return new AudioStreamInfo().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioStreamInfo { - return new AudioStreamInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioStreamInfo { - return new AudioStreamInfo().fromJsonString(jsonString, options); - } - - static equals(a: AudioStreamInfo | PlainMessage | undefined, b: AudioStreamInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamInfo, a, b); - } -} +/** + * Describes the message livekit.proto.AudioStreamInfo. + * Use `create(AudioStreamInfoSchema)` to create a new message. + */ +export const AudioStreamInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 23); /** * @generated from message livekit.proto.OwnedAudioStream */ -export class OwnedAudioStream extends Message { +export type OwnedAudioStream = Message<"livekit.proto.OwnedAudioStream"> & { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.AudioStreamInfo info = 2; + * @generated from field: required livekit.proto.AudioStreamInfo info = 2; */ info?: AudioStreamInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedAudioStream"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: AudioStreamInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioStream { - return new OwnedAudioStream().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedAudioStream { - return new OwnedAudioStream().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedAudioStream { - return new OwnedAudioStream().fromJsonString(jsonString, options); - } - - static equals(a: OwnedAudioStream | PlainMessage | undefined, b: OwnedAudioStream | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedAudioStream, a, b); - } -} +/** + * Describes the message livekit.proto.OwnedAudioStream. + * Use `create(OwnedAudioStreamSchema)` to create a new message. + */ +export const OwnedAudioStreamSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 24); /** * @generated from message livekit.proto.AudioStreamEvent */ -export class AudioStreamEvent extends Message { +export type AudioStreamEvent = Message<"livekit.proto.AudioStreamEvent"> & { /** - * @generated from field: uint64 stream_handle = 1; + * @generated from field: required uint64 stream_handle = 1; */ - streamHandle = protoInt64.zero; + streamHandle: bigint; /** * @generated from oneof livekit.proto.AudioStreamEvent.message @@ -1339,380 +674,328 @@ export class AudioStreamEvent extends Message { */ value: AudioStreamEOS; case: "eos"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioStreamEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "frame_received", kind: "message", T: AudioFrameReceived, oneof: "message" }, - { no: 3, name: "eos", kind: "message", T: AudioStreamEOS, oneof: "message" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamEvent { - return new AudioStreamEvent().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioStreamEvent { - return new AudioStreamEvent().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioStreamEvent { - return new AudioStreamEvent().fromJsonString(jsonString, options); - } - - static equals(a: AudioStreamEvent | PlainMessage | undefined, b: AudioStreamEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamEvent, a, b); - } -} + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message livekit.proto.AudioStreamEvent. + * Use `create(AudioStreamEventSchema)` to create a new message. + */ +export const AudioStreamEventSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 25); /** * @generated from message livekit.proto.AudioFrameReceived */ -export class AudioFrameReceived extends Message { +export type AudioFrameReceived = Message<"livekit.proto.AudioFrameReceived"> & { /** - * @generated from field: livekit.proto.OwnedAudioFrameBuffer frame = 1; + * @generated from field: required livekit.proto.OwnedAudioFrameBuffer frame = 1; */ frame?: OwnedAudioFrameBuffer; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioFrameReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "frame", kind: "message", T: OwnedAudioFrameBuffer }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioFrameReceived { - return new AudioFrameReceived().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioFrameReceived { - return new AudioFrameReceived().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioFrameReceived { - return new AudioFrameReceived().fromJsonString(jsonString, options); - } - - static equals(a: AudioFrameReceived | PlainMessage | undefined, b: AudioFrameReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioFrameReceived, a, b); - } -} +/** + * Describes the message livekit.proto.AudioFrameReceived. + * Use `create(AudioFrameReceivedSchema)` to create a new message. + */ +export const AudioFrameReceivedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 26); /** * @generated from message livekit.proto.AudioStreamEOS */ -export class AudioStreamEOS extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +export type AudioStreamEOS = Message<"livekit.proto.AudioStreamEOS"> & { +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioStreamEOS"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioStreamEOS { - return new AudioStreamEOS().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioStreamEOS { - return new AudioStreamEOS().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioStreamEOS { - return new AudioStreamEOS().fromJsonString(jsonString, options); - } - - static equals(a: AudioStreamEOS | PlainMessage | undefined, b: AudioStreamEOS | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioStreamEOS, a, b); - } -} +/** + * Describes the message livekit.proto.AudioStreamEOS. + * Use `create(AudioStreamEOSSchema)` to create a new message. + */ +export const AudioStreamEOSSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 27); /** * @generated from message livekit.proto.AudioSourceOptions */ -export class AudioSourceOptions extends Message { +export type AudioSourceOptions = Message<"livekit.proto.AudioSourceOptions"> & { /** - * @generated from field: bool echo_cancellation = 1; + * @generated from field: required bool echo_cancellation = 1; */ - echoCancellation = false; + echoCancellation: boolean; /** - * @generated from field: bool noise_suppression = 2; + * @generated from field: required bool noise_suppression = 2; */ - noiseSuppression = false; + noiseSuppression: boolean; /** - * @generated from field: bool auto_gain_control = 3; + * @generated from field: required bool auto_gain_control = 3; */ - autoGainControl = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + autoGainControl: boolean; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioSourceOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "echo_cancellation", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "noise_suppression", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 3, name: "auto_gain_control", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioSourceOptions { - return new AudioSourceOptions().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioSourceOptions { - return new AudioSourceOptions().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioSourceOptions { - return new AudioSourceOptions().fromJsonString(jsonString, options); - } - - static equals(a: AudioSourceOptions | PlainMessage | undefined, b: AudioSourceOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioSourceOptions, a, b); - } -} +/** + * Describes the message livekit.proto.AudioSourceOptions. + * Use `create(AudioSourceOptionsSchema)` to create a new message. + */ +export const AudioSourceOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 28); /** * @generated from message livekit.proto.AudioSourceInfo */ -export class AudioSourceInfo extends Message { +export type AudioSourceInfo = Message<"livekit.proto.AudioSourceInfo"> & { /** - * @generated from field: livekit.proto.AudioSourceType type = 2; + * @generated from field: required livekit.proto.AudioSourceType type = 2; */ - type = AudioSourceType.AUDIO_SOURCE_NATIVE; + type: AudioSourceType; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +/** + * Describes the message livekit.proto.AudioSourceInfo. + * Use `create(AudioSourceInfoSchema)` to create a new message. + */ +export const AudioSourceInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 29); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioSourceInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AudioSourceType) }, - ]); +/** + * @generated from message livekit.proto.OwnedAudioSource + */ +export type OwnedAudioSource = Message<"livekit.proto.OwnedAudioSource"> & { + /** + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + */ + handle?: FfiOwnedHandle; - static fromBinary(bytes: Uint8Array, options?: Partial): AudioSourceInfo { - return new AudioSourceInfo().fromBinary(bytes, options); - } + /** + * @generated from field: required livekit.proto.AudioSourceInfo info = 2; + */ + info?: AudioSourceInfo; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): AudioSourceInfo { - return new AudioSourceInfo().fromJson(jsonValue, options); - } +/** + * Describes the message livekit.proto.OwnedAudioSource. + * Use `create(OwnedAudioSourceSchema)` to create a new message. + */ +export const OwnedAudioSourceSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 30); - static fromJsonString(jsonString: string, options?: Partial): AudioSourceInfo { - return new AudioSourceInfo().fromJsonString(jsonString, options); - } +/** + * @generated from message livekit.proto.AudioResamplerInfo + */ +export type AudioResamplerInfo = Message<"livekit.proto.AudioResamplerInfo"> & { +}; - static equals(a: AudioSourceInfo | PlainMessage | undefined, b: AudioSourceInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioSourceInfo, a, b); - } -} +/** + * Describes the message livekit.proto.AudioResamplerInfo. + * Use `create(AudioResamplerInfoSchema)` to create a new message. + */ +export const AudioResamplerInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 31); /** - * @generated from message livekit.proto.OwnedAudioSource + * @generated from message livekit.proto.OwnedAudioResampler */ -export class OwnedAudioSource extends Message { +export type OwnedAudioResampler = Message<"livekit.proto.OwnedAudioResampler"> & { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.AudioSourceInfo info = 2; + * @generated from field: required livekit.proto.AudioResamplerInfo info = 2; */ - info?: AudioSourceInfo; + info?: AudioResamplerInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedAudioSource"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: AudioSourceInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioSource { - return new OwnedAudioSource().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedAudioSource { - return new OwnedAudioSource().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedAudioSource { - return new OwnedAudioSource().fromJsonString(jsonString, options); - } - - static equals(a: OwnedAudioSource | PlainMessage | undefined, b: OwnedAudioSource | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedAudioSource, a, b); - } -} +/** + * Describes the message livekit.proto.OwnedAudioResampler. + * Use `create(OwnedAudioResamplerSchema)` to create a new message. + */ +export const OwnedAudioResamplerSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 32); /** - * @generated from message livekit.proto.AudioResamplerInfo + * @generated from message livekit.proto.SoxResamplerInfo + */ +export type SoxResamplerInfo = Message<"livekit.proto.SoxResamplerInfo"> & { +}; + +/** + * Describes the message livekit.proto.SoxResamplerInfo. + * Use `create(SoxResamplerInfoSchema)` to create a new message. */ -export class AudioResamplerInfo extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +export const SoxResamplerInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 33); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioResamplerInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); +/** + * @generated from message livekit.proto.OwnedSoxResampler + */ +export type OwnedSoxResampler = Message<"livekit.proto.OwnedSoxResampler"> & { + /** + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; + */ + handle?: FfiOwnedHandle; - static fromBinary(bytes: Uint8Array, options?: Partial): AudioResamplerInfo { - return new AudioResamplerInfo().fromBinary(bytes, options); - } + /** + * @generated from field: required livekit.proto.SoxResamplerInfo info = 2; + */ + info?: SoxResamplerInfo; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): AudioResamplerInfo { - return new AudioResamplerInfo().fromJson(jsonValue, options); - } +/** + * Describes the message livekit.proto.OwnedSoxResampler. + * Use `create(OwnedSoxResamplerSchema)` to create a new message. + */ +export const OwnedSoxResamplerSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_audio_frame, 34); - static fromJsonString(jsonString: string, options?: Partial): AudioResamplerInfo { - return new AudioResamplerInfo().fromJsonString(jsonString, options); - } +/** + * @generated from enum livekit.proto.SoxResamplerDataType + */ +export enum SoxResamplerDataType { + /** + * TODO(theomonnom): support other datatypes (shouldn't really be needed) + * + * @generated from enum value: SOXR_DATATYPE_INT16I = 0; + */ + SOXR_DATATYPE_INT16I = 0, - static equals(a: AudioResamplerInfo | PlainMessage | undefined, b: AudioResamplerInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioResamplerInfo, a, b); - } + /** + * @generated from enum value: SOXR_DATATYPE_INT16S = 1; + */ + SOXR_DATATYPE_INT16S = 1, } /** - * @generated from message livekit.proto.OwnedAudioResampler + * Describes the enum livekit.proto.SoxResamplerDataType. + */ +export const SoxResamplerDataTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_audio_frame, 0); + +/** + * @generated from enum livekit.proto.SoxQualityRecipe */ -export class OwnedAudioResampler extends Message { +export enum SoxQualityRecipe { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from enum value: SOXR_QUALITY_QUICK = 0; */ - handle?: FfiOwnedHandle; + SOXR_QUALITY_QUICK = 0, /** - * @generated from field: livekit.proto.AudioResamplerInfo info = 2; + * @generated from enum value: SOXR_QUALITY_LOW = 1; */ - info?: AudioResamplerInfo; + SOXR_QUALITY_LOW = 1, + + /** + * @generated from enum value: SOXR_QUALITY_MEDIUM = 2; + */ + SOXR_QUALITY_MEDIUM = 2, + + /** + * @generated from enum value: SOXR_QUALITY_HIGH = 3; + */ + SOXR_QUALITY_HIGH = 3, - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedAudioResampler"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: AudioResamplerInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedAudioResampler { - return new OwnedAudioResampler().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedAudioResampler { - return new OwnedAudioResampler().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedAudioResampler { - return new OwnedAudioResampler().fromJsonString(jsonString, options); - } - - static equals(a: OwnedAudioResampler | PlainMessage | undefined, b: OwnedAudioResampler | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedAudioResampler, a, b); - } + /** + * @generated from enum value: SOXR_QUALITY_VERYHIGH = 4; + */ + SOXR_QUALITY_VERYHIGH = 4, } /** - * @generated from message livekit.proto.SoxResamplerInfo + * Describes the enum livekit.proto.SoxQualityRecipe. */ -export class SoxResamplerInfo extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +export const SoxQualityRecipeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_audio_frame, 1); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SoxResamplerInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); +/** + * @generated from enum livekit.proto.SoxFlagBits + */ +export enum SoxFlagBits { + /** + * 1 << 0 + * + * @generated from enum value: SOXR_ROLLOFF_SMALL = 0; + */ + SOXR_ROLLOFF_SMALL = 0, - static fromBinary(bytes: Uint8Array, options?: Partial): SoxResamplerInfo { - return new SoxResamplerInfo().fromBinary(bytes, options); - } + /** + * 1 << 1 + * + * @generated from enum value: SOXR_ROLLOFF_MEDIUM = 1; + */ + SOXR_ROLLOFF_MEDIUM = 1, + + /** + * 1 << 2 + * + * @generated from enum value: SOXR_ROLLOFF_NONE = 2; + */ + SOXR_ROLLOFF_NONE = 2, - static fromJson(jsonValue: JsonValue, options?: Partial): SoxResamplerInfo { - return new SoxResamplerInfo().fromJson(jsonValue, options); - } + /** + * 1 << 3 + * + * @generated from enum value: SOXR_HIGH_PREC_CLOCK = 3; + */ + SOXR_HIGH_PREC_CLOCK = 3, - static fromJsonString(jsonString: string, options?: Partial): SoxResamplerInfo { - return new SoxResamplerInfo().fromJsonString(jsonString, options); - } + /** + * 1 << 4 + * + * @generated from enum value: SOXR_DOUBLE_PRECISION = 4; + */ + SOXR_DOUBLE_PRECISION = 4, - static equals(a: SoxResamplerInfo | PlainMessage | undefined, b: SoxResamplerInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(SoxResamplerInfo, a, b); - } + /** + * 1 << 5 + * + * @generated from enum value: SOXR_VR = 5; + */ + SOXR_VR = 5, } /** - * @generated from message livekit.proto.OwnedSoxResampler + * Describes the enum livekit.proto.SoxFlagBits. + */ +export const SoxFlagBitsSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_audio_frame, 2); + +/** + * @generated from enum livekit.proto.AudioStreamType */ -export class OwnedSoxResampler extends Message { +export enum AudioStreamType { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from enum value: AUDIO_STREAM_NATIVE = 0; */ - handle?: FfiOwnedHandle; + AUDIO_STREAM_NATIVE = 0, /** - * @generated from field: livekit.proto.SoxResamplerInfo info = 2; + * @generated from enum value: AUDIO_STREAM_HTML = 1; */ - info?: SoxResamplerInfo; + AUDIO_STREAM_HTML = 1, +} + +/** + * Describes the enum livekit.proto.AudioStreamType. + */ +export const AudioStreamTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_audio_frame, 3); - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedSoxResampler"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: SoxResamplerInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedSoxResampler { - return new OwnedSoxResampler().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedSoxResampler { - return new OwnedSoxResampler().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedSoxResampler { - return new OwnedSoxResampler().fromJsonString(jsonString, options); - } - - static equals(a: OwnedSoxResampler | PlainMessage | undefined, b: OwnedSoxResampler | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedSoxResampler, a, b); - } +/** + * @generated from enum livekit.proto.AudioSourceType + */ +export enum AudioSourceType { + /** + * @generated from enum value: AUDIO_SOURCE_NATIVE = 0; + */ + AUDIO_SOURCE_NATIVE = 0, } +/** + * Describes the enum livekit.proto.AudioSourceType. + */ +export const AudioSourceTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_audio_frame, 4); + diff --git a/packages/livekit-rtc/src/proto/e2ee_pb.ts b/packages/livekit-rtc/src/proto/e2ee_pb.ts index 73601aa1..78e1a83c 100644 --- a/packages/livekit-rtc/src/proto/e2ee_pb.ts +++ b/packages/livekit-rtc/src/proto/e2ee_pb.ts @@ -12,1013 +12,479 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file e2ee.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file e2ee.proto (package livekit.proto, syntax proto2) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message } from "@bufbuild/protobuf"; /** - * @generated from enum livekit.proto.EncryptionType + * Describes the file e2ee.proto. */ -export enum EncryptionType { - /** - * @generated from enum value: NONE = 0; - */ - NONE = 0, - - /** - * @generated from enum value: GCM = 1; - */ - GCM = 1, - - /** - * @generated from enum value: CUSTOM = 2; - */ - CUSTOM = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(EncryptionType) -proto3.util.setEnumType(EncryptionType, "livekit.proto.EncryptionType", [ - { no: 0, name: "NONE" }, - { no: 1, name: "GCM" }, - { no: 2, name: "CUSTOM" }, -]); +export const file_e2ee: GenFile = /*@__PURE__*/ + fileDesc("CgplMmVlLnByb3RvEg1saXZla2l0LnByb3RvImMKDEZyYW1lQ3J5cHRvchIcChRwYXJ0aWNpcGFudF9pZGVudGl0eRgBIAIoCRIRCgl0cmFja19zaWQYAiACKAkSEQoJa2V5X2luZGV4GAMgAigFEg8KB2VuYWJsZWQYBCACKAgidgoSS2V5UHJvdmlkZXJPcHRpb25zEhIKCnNoYXJlZF9rZXkYASABKAwSGwoTcmF0Y2hldF93aW5kb3dfc2l6ZRgCIAIoBRIUCgxyYXRjaGV0X3NhbHQYAyACKAwSGQoRZmFpbHVyZV90b2xlcmFuY2UYBCACKAUihgEKC0UyZWVPcHRpb25zEjYKD2VuY3J5cHRpb25fdHlwZRgBIAIoDjIdLmxpdmVraXQucHJvdG8uRW5jcnlwdGlvblR5cGUSPwoUa2V5X3Byb3ZpZGVyX29wdGlvbnMYAiACKAsyIS5saXZla2l0LnByb3RvLktleVByb3ZpZGVyT3B0aW9ucyIvChxFMmVlTWFuYWdlclNldEVuYWJsZWRSZXF1ZXN0Eg8KB2VuYWJsZWQYASACKAgiHwodRTJlZU1hbmFnZXJTZXRFbmFibGVkUmVzcG9uc2UiJAoiRTJlZU1hbmFnZXJHZXRGcmFtZUNyeXB0b3JzUmVxdWVzdCJaCiNFMmVlTWFuYWdlckdldEZyYW1lQ3J5cHRvcnNSZXNwb25zZRIzCg5mcmFtZV9jcnlwdG9ycxgBIAMoCzIbLmxpdmVraXQucHJvdG8uRnJhbWVDcnlwdG9yImEKHUZyYW1lQ3J5cHRvclNldEVuYWJsZWRSZXF1ZXN0EhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAEgAigJEhEKCXRyYWNrX3NpZBgCIAIoCRIPCgdlbmFibGVkGAMgAigIIiAKHkZyYW1lQ3J5cHRvclNldEVuYWJsZWRSZXNwb25zZSJkCh5GcmFtZUNyeXB0b3JTZXRLZXlJbmRleFJlcXVlc3QSHAoUcGFydGljaXBhbnRfaWRlbnRpdHkYASACKAkSEQoJdHJhY2tfc2lkGAIgAigJEhEKCWtleV9pbmRleBgDIAIoBSIhCh9GcmFtZUNyeXB0b3JTZXRLZXlJbmRleFJlc3BvbnNlIjwKE1NldFNoYXJlZEtleVJlcXVlc3QSEgoKc2hhcmVkX2tleRgBIAIoDBIRCglrZXlfaW5kZXgYAiACKAUiFgoUU2V0U2hhcmVkS2V5UmVzcG9uc2UiLAoXUmF0Y2hldFNoYXJlZEtleVJlcXVlc3QSEQoJa2V5X2luZGV4GAEgAigFIisKGFJhdGNoZXRTaGFyZWRLZXlSZXNwb25zZRIPCgduZXdfa2V5GAEgASgMIigKE0dldFNoYXJlZEtleVJlcXVlc3QSEQoJa2V5X2luZGV4GAEgAigFIiMKFEdldFNoYXJlZEtleVJlc3BvbnNlEgsKA2tleRgBIAEoDCJNCg1TZXRLZXlSZXF1ZXN0EhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAEgAigJEgsKA2tleRgCIAIoDBIRCglrZXlfaW5kZXgYAyACKAUiEAoOU2V0S2V5UmVzcG9uc2UiRAoRUmF0Y2hldEtleVJlcXVlc3QSHAoUcGFydGljaXBhbnRfaWRlbnRpdHkYASACKAkSEQoJa2V5X2luZGV4GAIgAigFIiUKElJhdGNoZXRLZXlSZXNwb25zZRIPCgduZXdfa2V5GAEgASgMIkAKDUdldEtleVJlcXVlc3QSHAoUcGFydGljaXBhbnRfaWRlbnRpdHkYASACKAkSEQoJa2V5X2luZGV4GAIgAigFIh0KDkdldEtleVJlc3BvbnNlEgsKA2tleRgBIAEoDCLMBQoLRTJlZVJlcXVlc3QSEwoLcm9vbV9oYW5kbGUYASACKAQSSgoTbWFuYWdlcl9zZXRfZW5hYmxlZBgCIAEoCzIrLmxpdmVraXQucHJvdG8uRTJlZU1hbmFnZXJTZXRFbmFibGVkUmVxdWVzdEgAElcKGm1hbmFnZXJfZ2V0X2ZyYW1lX2NyeXB0b3JzGAMgASgLMjEubGl2ZWtpdC5wcm90by5FMmVlTWFuYWdlckdldEZyYW1lQ3J5cHRvcnNSZXF1ZXN0SAASSwoTY3J5cHRvcl9zZXRfZW5hYmxlZBgEIAEoCzIsLmxpdmVraXQucHJvdG8uRnJhbWVDcnlwdG9yU2V0RW5hYmxlZFJlcXVlc3RIABJOChVjcnlwdG9yX3NldF9rZXlfaW5kZXgYBSABKAsyLS5saXZla2l0LnByb3RvLkZyYW1lQ3J5cHRvclNldEtleUluZGV4UmVxdWVzdEgAEjwKDnNldF9zaGFyZWRfa2V5GAYgASgLMiIubGl2ZWtpdC5wcm90by5TZXRTaGFyZWRLZXlSZXF1ZXN0SAASRAoScmF0Y2hldF9zaGFyZWRfa2V5GAcgASgLMiYubGl2ZWtpdC5wcm90by5SYXRjaGV0U2hhcmVkS2V5UmVxdWVzdEgAEjwKDmdldF9zaGFyZWRfa2V5GAggASgLMiIubGl2ZWtpdC5wcm90by5HZXRTaGFyZWRLZXlSZXF1ZXN0SAASLwoHc2V0X2tleRgJIAEoCzIcLmxpdmVraXQucHJvdG8uU2V0S2V5UmVxdWVzdEgAEjcKC3JhdGNoZXRfa2V5GAogASgLMiAubGl2ZWtpdC5wcm90by5SYXRjaGV0S2V5UmVxdWVzdEgAEi8KB2dldF9rZXkYCyABKAsyHC5saXZla2l0LnByb3RvLkdldEtleVJlcXVlc3RIAEIJCgdtZXNzYWdlIsIFCgxFMmVlUmVzcG9uc2USSwoTbWFuYWdlcl9zZXRfZW5hYmxlZBgBIAEoCzIsLmxpdmVraXQucHJvdG8uRTJlZU1hbmFnZXJTZXRFbmFibGVkUmVzcG9uc2VIABJYChptYW5hZ2VyX2dldF9mcmFtZV9jcnlwdG9ycxgCIAEoCzIyLmxpdmVraXQucHJvdG8uRTJlZU1hbmFnZXJHZXRGcmFtZUNyeXB0b3JzUmVzcG9uc2VIABJMChNjcnlwdG9yX3NldF9lbmFibGVkGAMgASgLMi0ubGl2ZWtpdC5wcm90by5GcmFtZUNyeXB0b3JTZXRFbmFibGVkUmVzcG9uc2VIABJPChVjcnlwdG9yX3NldF9rZXlfaW5kZXgYBCABKAsyLi5saXZla2l0LnByb3RvLkZyYW1lQ3J5cHRvclNldEtleUluZGV4UmVzcG9uc2VIABI9Cg5zZXRfc2hhcmVkX2tleRgFIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0U2hhcmVkS2V5UmVzcG9uc2VIABJFChJyYXRjaGV0X3NoYXJlZF9rZXkYBiABKAsyJy5saXZla2l0LnByb3RvLlJhdGNoZXRTaGFyZWRLZXlSZXNwb25zZUgAEj0KDmdldF9zaGFyZWRfa2V5GAcgASgLMiMubGl2ZWtpdC5wcm90by5HZXRTaGFyZWRLZXlSZXNwb25zZUgAEjAKB3NldF9rZXkYCCABKAsyHS5saXZla2l0LnByb3RvLlNldEtleVJlc3BvbnNlSAASOAoLcmF0Y2hldF9rZXkYCSABKAsyIS5saXZla2l0LnByb3RvLlJhdGNoZXRLZXlSZXNwb25zZUgAEjAKB2dldF9rZXkYCiABKAsyHS5saXZla2l0LnByb3RvLkdldEtleVJlc3BvbnNlSABCCQoHbWVzc2FnZSovCg5FbmNyeXB0aW9uVHlwZRIICgROT05FEAASBwoDR0NNEAESCgoGQ1VTVE9NEAIqiAEKD0VuY3J5cHRpb25TdGF0ZRIHCgNORVcQABIGCgJPSxABEhUKEUVOQ1JZUFRJT05fRkFJTEVEEAISFQoRREVDUllQVElPTl9GQUlMRUQQAxIPCgtNSVNTSU5HX0tFWRAEEhEKDUtFWV9SQVRDSEVURUQQBRISCg5JTlRFUk5BTF9FUlJPUhAGQhCqAg1MaXZlS2l0LlByb3Rv"); /** - * @generated from enum livekit.proto.EncryptionState + * @generated from message livekit.proto.FrameCryptor */ -export enum EncryptionState { - /** - * @generated from enum value: NEW = 0; - */ - NEW = 0, - - /** - * @generated from enum value: OK = 1; - */ - OK = 1, - +export type FrameCryptor = Message<"livekit.proto.FrameCryptor"> & { /** - * @generated from enum value: ENCRYPTION_FAILED = 2; + * @generated from field: required string participant_identity = 1; */ - ENCRYPTION_FAILED = 2, + participantIdentity: string; /** - * @generated from enum value: DECRYPTION_FAILED = 3; + * @generated from field: required string track_sid = 2; */ - DECRYPTION_FAILED = 3, + trackSid: string; /** - * @generated from enum value: MISSING_KEY = 4; + * @generated from field: required int32 key_index = 3; */ - MISSING_KEY = 4, + keyIndex: number; /** - * @generated from enum value: KEY_RATCHETED = 5; + * @generated from field: required bool enabled = 4; */ - KEY_RATCHETED = 5, - - /** - * @generated from enum value: INTERNAL_ERROR = 6; - */ - INTERNAL_ERROR = 6, -} -// Retrieve enum metadata with: proto3.getEnumType(EncryptionState) -proto3.util.setEnumType(EncryptionState, "livekit.proto.EncryptionState", [ - { no: 0, name: "NEW" }, - { no: 1, name: "OK" }, - { no: 2, name: "ENCRYPTION_FAILED" }, - { no: 3, name: "DECRYPTION_FAILED" }, - { no: 4, name: "MISSING_KEY" }, - { no: 5, name: "KEY_RATCHETED" }, - { no: 6, name: "INTERNAL_ERROR" }, -]); + enabled: boolean; +}; /** - * @generated from message livekit.proto.FrameCryptor + * Describes the message livekit.proto.FrameCryptor. + * Use `create(FrameCryptorSchema)` to create a new message. */ -export class FrameCryptor extends Message { - /** - * @generated from field: string participant_identity = 1; - */ - participantIdentity = ""; - - /** - * @generated from field: string track_sid = 2; - */ - trackSid = ""; - - /** - * @generated from field: int32 key_index = 3; - */ - keyIndex = 0; - - /** - * @generated from field: bool enabled = 4; - */ - enabled = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FrameCryptor"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 4, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptor { - return new FrameCryptor().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FrameCryptor { - return new FrameCryptor().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FrameCryptor { - return new FrameCryptor().fromJsonString(jsonString, options); - } - - static equals(a: FrameCryptor | PlainMessage | undefined, b: FrameCryptor | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptor, a, b); - } -} +export const FrameCryptorSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 0); /** * @generated from message livekit.proto.KeyProviderOptions */ -export class KeyProviderOptions extends Message { +export type KeyProviderOptions = Message<"livekit.proto.KeyProviderOptions"> & { /** * Only specify if you want to use a shared_key * * @generated from field: optional bytes shared_key = 1; */ - sharedKey?: Uint8Array; + sharedKey: Uint8Array; /** - * @generated from field: int32 ratchet_window_size = 2; + * @generated from field: required int32 ratchet_window_size = 2; */ - ratchetWindowSize = 0; + ratchetWindowSize: number; /** - * @generated from field: bytes ratchet_salt = 3; + * @generated from field: required bytes ratchet_salt = 3; */ - ratchetSalt = new Uint8Array(0); + ratchetSalt: Uint8Array; /** - * -1 = no tolerence + * -1 = no tolerance * - * @generated from field: int32 failure_tolerance = 4; + * @generated from field: required int32 failure_tolerance = 4; */ - failureTolerance = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.KeyProviderOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "shared_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - { no: 2, name: "ratchet_window_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 3, name: "ratchet_salt", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 4, name: "failure_tolerance", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): KeyProviderOptions { - return new KeyProviderOptions().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): KeyProviderOptions { - return new KeyProviderOptions().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): KeyProviderOptions { - return new KeyProviderOptions().fromJsonString(jsonString, options); - } - - static equals(a: KeyProviderOptions | PlainMessage | undefined, b: KeyProviderOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(KeyProviderOptions, a, b); - } -} + failureTolerance: number; +}; + +/** + * Describes the message livekit.proto.KeyProviderOptions. + * Use `create(KeyProviderOptionsSchema)` to create a new message. + */ +export const KeyProviderOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 1); /** * @generated from message livekit.proto.E2eeOptions */ -export class E2eeOptions extends Message { +export type E2eeOptions = Message<"livekit.proto.E2eeOptions"> & { /** - * @generated from field: livekit.proto.EncryptionType encryption_type = 1; + * @generated from field: required livekit.proto.EncryptionType encryption_type = 1; */ - encryptionType = EncryptionType.NONE; + encryptionType: EncryptionType; /** - * @generated from field: livekit.proto.KeyProviderOptions key_provider_options = 2; + * @generated from field: required livekit.proto.KeyProviderOptions key_provider_options = 2; */ keyProviderOptions?: KeyProviderOptions; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.E2eeOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "encryption_type", kind: "enum", T: proto3.getEnumType(EncryptionType) }, - { no: 2, name: "key_provider_options", kind: "message", T: KeyProviderOptions }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): E2eeOptions { - return new E2eeOptions().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): E2eeOptions { - return new E2eeOptions().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): E2eeOptions { - return new E2eeOptions().fromJsonString(jsonString, options); - } - - static equals(a: E2eeOptions | PlainMessage | undefined, b: E2eeOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeOptions, a, b); - } -} +/** + * Describes the message livekit.proto.E2eeOptions. + * Use `create(E2eeOptionsSchema)` to create a new message. + */ +export const E2eeOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 2); /** * @generated from message livekit.proto.E2eeManagerSetEnabledRequest */ -export class E2eeManagerSetEnabledRequest extends Message { +export type E2eeManagerSetEnabledRequest = Message<"livekit.proto.E2eeManagerSetEnabledRequest"> & { /** - * @generated from field: bool enabled = 1; + * @generated from field: required bool enabled = 1; */ - enabled = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.E2eeManagerSetEnabledRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerSetEnabledRequest { - return new E2eeManagerSetEnabledRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): E2eeManagerSetEnabledRequest { - return new E2eeManagerSetEnabledRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): E2eeManagerSetEnabledRequest { - return new E2eeManagerSetEnabledRequest().fromJsonString(jsonString, options); - } - - static equals(a: E2eeManagerSetEnabledRequest | PlainMessage | undefined, b: E2eeManagerSetEnabledRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeManagerSetEnabledRequest, a, b); - } -} + enabled: boolean; +}; + +/** + * Describes the message livekit.proto.E2eeManagerSetEnabledRequest. + * Use `create(E2eeManagerSetEnabledRequestSchema)` to create a new message. + */ +export const E2eeManagerSetEnabledRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 3); /** * @generated from message livekit.proto.E2eeManagerSetEnabledResponse */ -export class E2eeManagerSetEnabledResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.E2eeManagerSetEnabledResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerSetEnabledResponse { - return new E2eeManagerSetEnabledResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): E2eeManagerSetEnabledResponse { - return new E2eeManagerSetEnabledResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): E2eeManagerSetEnabledResponse { - return new E2eeManagerSetEnabledResponse().fromJsonString(jsonString, options); - } - - static equals(a: E2eeManagerSetEnabledResponse | PlainMessage | undefined, b: E2eeManagerSetEnabledResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeManagerSetEnabledResponse, a, b); - } -} +export type E2eeManagerSetEnabledResponse = Message<"livekit.proto.E2eeManagerSetEnabledResponse"> & { +}; + +/** + * Describes the message livekit.proto.E2eeManagerSetEnabledResponse. + * Use `create(E2eeManagerSetEnabledResponseSchema)` to create a new message. + */ +export const E2eeManagerSetEnabledResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 4); /** * @generated from message livekit.proto.E2eeManagerGetFrameCryptorsRequest */ -export class E2eeManagerGetFrameCryptorsRequest extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.E2eeManagerGetFrameCryptorsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerGetFrameCryptorsRequest { - return new E2eeManagerGetFrameCryptorsRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): E2eeManagerGetFrameCryptorsRequest { - return new E2eeManagerGetFrameCryptorsRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): E2eeManagerGetFrameCryptorsRequest { - return new E2eeManagerGetFrameCryptorsRequest().fromJsonString(jsonString, options); - } - - static equals(a: E2eeManagerGetFrameCryptorsRequest | PlainMessage | undefined, b: E2eeManagerGetFrameCryptorsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeManagerGetFrameCryptorsRequest, a, b); - } -} +export type E2eeManagerGetFrameCryptorsRequest = Message<"livekit.proto.E2eeManagerGetFrameCryptorsRequest"> & { +}; + +/** + * Describes the message livekit.proto.E2eeManagerGetFrameCryptorsRequest. + * Use `create(E2eeManagerGetFrameCryptorsRequestSchema)` to create a new message. + */ +export const E2eeManagerGetFrameCryptorsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 5); /** * @generated from message livekit.proto.E2eeManagerGetFrameCryptorsResponse */ -export class E2eeManagerGetFrameCryptorsResponse extends Message { +export type E2eeManagerGetFrameCryptorsResponse = Message<"livekit.proto.E2eeManagerGetFrameCryptorsResponse"> & { /** * @generated from field: repeated livekit.proto.FrameCryptor frame_cryptors = 1; */ - frameCryptors: FrameCryptor[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.E2eeManagerGetFrameCryptorsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "frame_cryptors", kind: "message", T: FrameCryptor, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): E2eeManagerGetFrameCryptorsResponse { - return new E2eeManagerGetFrameCryptorsResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): E2eeManagerGetFrameCryptorsResponse { - return new E2eeManagerGetFrameCryptorsResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): E2eeManagerGetFrameCryptorsResponse { - return new E2eeManagerGetFrameCryptorsResponse().fromJsonString(jsonString, options); - } - - static equals(a: E2eeManagerGetFrameCryptorsResponse | PlainMessage | undefined, b: E2eeManagerGetFrameCryptorsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeManagerGetFrameCryptorsResponse, a, b); - } -} + frameCryptors: FrameCryptor[]; +}; + +/** + * Describes the message livekit.proto.E2eeManagerGetFrameCryptorsResponse. + * Use `create(E2eeManagerGetFrameCryptorsResponseSchema)` to create a new message. + */ +export const E2eeManagerGetFrameCryptorsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 6); /** * @generated from message livekit.proto.FrameCryptorSetEnabledRequest */ -export class FrameCryptorSetEnabledRequest extends Message { +export type FrameCryptorSetEnabledRequest = Message<"livekit.proto.FrameCryptorSetEnabledRequest"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid: string; /** - * @generated from field: bool enabled = 3; + * @generated from field: required bool enabled = 3; */ - enabled = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FrameCryptorSetEnabledRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetEnabledRequest { - return new FrameCryptorSetEnabledRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FrameCryptorSetEnabledRequest { - return new FrameCryptorSetEnabledRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FrameCryptorSetEnabledRequest { - return new FrameCryptorSetEnabledRequest().fromJsonString(jsonString, options); - } - - static equals(a: FrameCryptorSetEnabledRequest | PlainMessage | undefined, b: FrameCryptorSetEnabledRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptorSetEnabledRequest, a, b); - } -} + enabled: boolean; +}; + +/** + * Describes the message livekit.proto.FrameCryptorSetEnabledRequest. + * Use `create(FrameCryptorSetEnabledRequestSchema)` to create a new message. + */ +export const FrameCryptorSetEnabledRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 7); /** * @generated from message livekit.proto.FrameCryptorSetEnabledResponse */ -export class FrameCryptorSetEnabledResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FrameCryptorSetEnabledResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetEnabledResponse { - return new FrameCryptorSetEnabledResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FrameCryptorSetEnabledResponse { - return new FrameCryptorSetEnabledResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FrameCryptorSetEnabledResponse { - return new FrameCryptorSetEnabledResponse().fromJsonString(jsonString, options); - } - - static equals(a: FrameCryptorSetEnabledResponse | PlainMessage | undefined, b: FrameCryptorSetEnabledResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptorSetEnabledResponse, a, b); - } -} +export type FrameCryptorSetEnabledResponse = Message<"livekit.proto.FrameCryptorSetEnabledResponse"> & { +}; + +/** + * Describes the message livekit.proto.FrameCryptorSetEnabledResponse. + * Use `create(FrameCryptorSetEnabledResponseSchema)` to create a new message. + */ +export const FrameCryptorSetEnabledResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 8); /** * @generated from message livekit.proto.FrameCryptorSetKeyIndexRequest */ -export class FrameCryptorSetKeyIndexRequest extends Message { +export type FrameCryptorSetKeyIndexRequest = Message<"livekit.proto.FrameCryptorSetKeyIndexRequest"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid: string; /** - * @generated from field: int32 key_index = 3; + * @generated from field: required int32 key_index = 3; */ - keyIndex = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FrameCryptorSetKeyIndexRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetKeyIndexRequest { - return new FrameCryptorSetKeyIndexRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FrameCryptorSetKeyIndexRequest { - return new FrameCryptorSetKeyIndexRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FrameCryptorSetKeyIndexRequest { - return new FrameCryptorSetKeyIndexRequest().fromJsonString(jsonString, options); - } - - static equals(a: FrameCryptorSetKeyIndexRequest | PlainMessage | undefined, b: FrameCryptorSetKeyIndexRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptorSetKeyIndexRequest, a, b); - } -} + keyIndex: number; +}; + +/** + * Describes the message livekit.proto.FrameCryptorSetKeyIndexRequest. + * Use `create(FrameCryptorSetKeyIndexRequestSchema)` to create a new message. + */ +export const FrameCryptorSetKeyIndexRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 9); /** * @generated from message livekit.proto.FrameCryptorSetKeyIndexResponse */ -export class FrameCryptorSetKeyIndexResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FrameCryptorSetKeyIndexResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FrameCryptorSetKeyIndexResponse { - return new FrameCryptorSetKeyIndexResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FrameCryptorSetKeyIndexResponse { - return new FrameCryptorSetKeyIndexResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FrameCryptorSetKeyIndexResponse { - return new FrameCryptorSetKeyIndexResponse().fromJsonString(jsonString, options); - } - - static equals(a: FrameCryptorSetKeyIndexResponse | PlainMessage | undefined, b: FrameCryptorSetKeyIndexResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(FrameCryptorSetKeyIndexResponse, a, b); - } -} +export type FrameCryptorSetKeyIndexResponse = Message<"livekit.proto.FrameCryptorSetKeyIndexResponse"> & { +}; + +/** + * Describes the message livekit.proto.FrameCryptorSetKeyIndexResponse. + * Use `create(FrameCryptorSetKeyIndexResponseSchema)` to create a new message. + */ +export const FrameCryptorSetKeyIndexResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 10); /** * @generated from message livekit.proto.SetSharedKeyRequest */ -export class SetSharedKeyRequest extends Message { +export type SetSharedKeyRequest = Message<"livekit.proto.SetSharedKeyRequest"> & { /** - * @generated from field: bytes shared_key = 1; + * @generated from field: required bytes shared_key = 1; */ - sharedKey = new Uint8Array(0); + sharedKey: Uint8Array; /** - * @generated from field: int32 key_index = 2; + * @generated from field: required int32 key_index = 2; */ - keyIndex = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SetSharedKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "shared_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SetSharedKeyRequest { - return new SetSharedKeyRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetSharedKeyRequest { - return new SetSharedKeyRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetSharedKeyRequest { - return new SetSharedKeyRequest().fromJsonString(jsonString, options); - } - - static equals(a: SetSharedKeyRequest | PlainMessage | undefined, b: SetSharedKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetSharedKeyRequest, a, b); - } -} + keyIndex: number; +}; + +/** + * Describes the message livekit.proto.SetSharedKeyRequest. + * Use `create(SetSharedKeyRequestSchema)` to create a new message. + */ +export const SetSharedKeyRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 11); /** * @generated from message livekit.proto.SetSharedKeyResponse */ -export class SetSharedKeyResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SetSharedKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SetSharedKeyResponse { - return new SetSharedKeyResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetSharedKeyResponse { - return new SetSharedKeyResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetSharedKeyResponse { - return new SetSharedKeyResponse().fromJsonString(jsonString, options); - } - - static equals(a: SetSharedKeyResponse | PlainMessage | undefined, b: SetSharedKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetSharedKeyResponse, a, b); - } -} +export type SetSharedKeyResponse = Message<"livekit.proto.SetSharedKeyResponse"> & { +}; + +/** + * Describes the message livekit.proto.SetSharedKeyResponse. + * Use `create(SetSharedKeyResponseSchema)` to create a new message. + */ +export const SetSharedKeyResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 12); /** * @generated from message livekit.proto.RatchetSharedKeyRequest */ -export class RatchetSharedKeyRequest extends Message { +export type RatchetSharedKeyRequest = Message<"livekit.proto.RatchetSharedKeyRequest"> & { /** - * @generated from field: int32 key_index = 1; + * @generated from field: required int32 key_index = 1; */ - keyIndex = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RatchetSharedKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RatchetSharedKeyRequest { - return new RatchetSharedKeyRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RatchetSharedKeyRequest { - return new RatchetSharedKeyRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RatchetSharedKeyRequest { - return new RatchetSharedKeyRequest().fromJsonString(jsonString, options); - } - - static equals(a: RatchetSharedKeyRequest | PlainMessage | undefined, b: RatchetSharedKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RatchetSharedKeyRequest, a, b); - } -} + keyIndex: number; +}; + +/** + * Describes the message livekit.proto.RatchetSharedKeyRequest. + * Use `create(RatchetSharedKeyRequestSchema)` to create a new message. + */ +export const RatchetSharedKeyRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 13); /** * @generated from message livekit.proto.RatchetSharedKeyResponse */ -export class RatchetSharedKeyResponse extends Message { +export type RatchetSharedKeyResponse = Message<"livekit.proto.RatchetSharedKeyResponse"> & { /** * @generated from field: optional bytes new_key = 1; */ - newKey?: Uint8Array; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RatchetSharedKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "new_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RatchetSharedKeyResponse { - return new RatchetSharedKeyResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RatchetSharedKeyResponse { - return new RatchetSharedKeyResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RatchetSharedKeyResponse { - return new RatchetSharedKeyResponse().fromJsonString(jsonString, options); - } - - static equals(a: RatchetSharedKeyResponse | PlainMessage | undefined, b: RatchetSharedKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RatchetSharedKeyResponse, a, b); - } -} + newKey: Uint8Array; +}; + +/** + * Describes the message livekit.proto.RatchetSharedKeyResponse. + * Use `create(RatchetSharedKeyResponseSchema)` to create a new message. + */ +export const RatchetSharedKeyResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 14); /** * @generated from message livekit.proto.GetSharedKeyRequest */ -export class GetSharedKeyRequest extends Message { +export type GetSharedKeyRequest = Message<"livekit.proto.GetSharedKeyRequest"> & { /** - * @generated from field: int32 key_index = 1; + * @generated from field: required int32 key_index = 1; */ - keyIndex = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.GetSharedKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSharedKeyRequest { - return new GetSharedKeyRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSharedKeyRequest { - return new GetSharedKeyRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetSharedKeyRequest { - return new GetSharedKeyRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetSharedKeyRequest | PlainMessage | undefined, b: GetSharedKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSharedKeyRequest, a, b); - } -} + keyIndex: number; +}; + +/** + * Describes the message livekit.proto.GetSharedKeyRequest. + * Use `create(GetSharedKeyRequestSchema)` to create a new message. + */ +export const GetSharedKeyRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 15); /** * @generated from message livekit.proto.GetSharedKeyResponse */ -export class GetSharedKeyResponse extends Message { +export type GetSharedKeyResponse = Message<"livekit.proto.GetSharedKeyResponse"> & { /** * @generated from field: optional bytes key = 1; */ - key?: Uint8Array; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.GetSharedKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSharedKeyResponse { - return new GetSharedKeyResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSharedKeyResponse { - return new GetSharedKeyResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetSharedKeyResponse { - return new GetSharedKeyResponse().fromJsonString(jsonString, options); - } - - static equals(a: GetSharedKeyResponse | PlainMessage | undefined, b: GetSharedKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSharedKeyResponse, a, b); - } -} + key: Uint8Array; +}; + +/** + * Describes the message livekit.proto.GetSharedKeyResponse. + * Use `create(GetSharedKeyResponseSchema)` to create a new message. + */ +export const GetSharedKeyResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 16); /** * @generated from message livekit.proto.SetKeyRequest */ -export class SetKeyRequest extends Message { +export type SetKeyRequest = Message<"livekit.proto.SetKeyRequest"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: bytes key = 2; + * @generated from field: required bytes key = 2; */ - key = new Uint8Array(0); + key: Uint8Array; /** - * @generated from field: int32 key_index = 3; + * @generated from field: required int32 key_index = 3; */ - keyIndex = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SetKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 3, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SetKeyRequest { - return new SetKeyRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetKeyRequest { - return new SetKeyRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetKeyRequest { - return new SetKeyRequest().fromJsonString(jsonString, options); - } - - static equals(a: SetKeyRequest | PlainMessage | undefined, b: SetKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetKeyRequest, a, b); - } -} + keyIndex: number; +}; + +/** + * Describes the message livekit.proto.SetKeyRequest. + * Use `create(SetKeyRequestSchema)` to create a new message. + */ +export const SetKeyRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 17); /** * @generated from message livekit.proto.SetKeyResponse */ -export class SetKeyResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SetKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SetKeyResponse { - return new SetKeyResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetKeyResponse { - return new SetKeyResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetKeyResponse { - return new SetKeyResponse().fromJsonString(jsonString, options); - } - - static equals(a: SetKeyResponse | PlainMessage | undefined, b: SetKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetKeyResponse, a, b); - } -} +export type SetKeyResponse = Message<"livekit.proto.SetKeyResponse"> & { +}; + +/** + * Describes the message livekit.proto.SetKeyResponse. + * Use `create(SetKeyResponseSchema)` to create a new message. + */ +export const SetKeyResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 18); /** * @generated from message livekit.proto.RatchetKeyRequest */ -export class RatchetKeyRequest extends Message { +export type RatchetKeyRequest = Message<"livekit.proto.RatchetKeyRequest"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: int32 key_index = 2; + * @generated from field: required int32 key_index = 2; */ - keyIndex = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RatchetKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RatchetKeyRequest { - return new RatchetKeyRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RatchetKeyRequest { - return new RatchetKeyRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RatchetKeyRequest { - return new RatchetKeyRequest().fromJsonString(jsonString, options); - } - - static equals(a: RatchetKeyRequest | PlainMessage | undefined, b: RatchetKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RatchetKeyRequest, a, b); - } -} + keyIndex: number; +}; + +/** + * Describes the message livekit.proto.RatchetKeyRequest. + * Use `create(RatchetKeyRequestSchema)` to create a new message. + */ +export const RatchetKeyRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 19); /** * @generated from message livekit.proto.RatchetKeyResponse */ -export class RatchetKeyResponse extends Message { +export type RatchetKeyResponse = Message<"livekit.proto.RatchetKeyResponse"> & { /** * @generated from field: optional bytes new_key = 1; */ - newKey?: Uint8Array; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RatchetKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "new_key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RatchetKeyResponse { - return new RatchetKeyResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RatchetKeyResponse { - return new RatchetKeyResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RatchetKeyResponse { - return new RatchetKeyResponse().fromJsonString(jsonString, options); - } - - static equals(a: RatchetKeyResponse | PlainMessage | undefined, b: RatchetKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RatchetKeyResponse, a, b); - } -} + newKey: Uint8Array; +}; + +/** + * Describes the message livekit.proto.RatchetKeyResponse. + * Use `create(RatchetKeyResponseSchema)` to create a new message. + */ +export const RatchetKeyResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 20); /** * @generated from message livekit.proto.GetKeyRequest */ -export class GetKeyRequest extends Message { +export type GetKeyRequest = Message<"livekit.proto.GetKeyRequest"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: int32 key_index = 2; + * @generated from field: required int32 key_index = 2; */ - keyIndex = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.GetKeyRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetKeyRequest { - return new GetKeyRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetKeyRequest { - return new GetKeyRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetKeyRequest { - return new GetKeyRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetKeyRequest | PlainMessage | undefined, b: GetKeyRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetKeyRequest, a, b); - } -} + keyIndex: number; +}; + +/** + * Describes the message livekit.proto.GetKeyRequest. + * Use `create(GetKeyRequestSchema)` to create a new message. + */ +export const GetKeyRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 21); /** * @generated from message livekit.proto.GetKeyResponse */ -export class GetKeyResponse extends Message { +export type GetKeyResponse = Message<"livekit.proto.GetKeyResponse"> & { /** * @generated from field: optional bytes key = 1; */ - key?: Uint8Array; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.GetKeyResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetKeyResponse { - return new GetKeyResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetKeyResponse { - return new GetKeyResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetKeyResponse { - return new GetKeyResponse().fromJsonString(jsonString, options); - } - - static equals(a: GetKeyResponse | PlainMessage | undefined, b: GetKeyResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetKeyResponse, a, b); - } -} + key: Uint8Array; +}; + +/** + * Describes the message livekit.proto.GetKeyResponse. + * Use `create(GetKeyResponseSchema)` to create a new message. + */ +export const GetKeyResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 22); /** * @generated from message livekit.proto.E2eeRequest */ -export class E2eeRequest extends Message { +export type E2eeRequest = Message<"livekit.proto.E2eeRequest"> & { /** - * @generated from field: uint64 room_handle = 1; + * @generated from field: required uint64 room_handle = 1; */ - roomHandle = protoInt64.zero; + roomHandle: bigint; /** * @generated from oneof livekit.proto.E2eeRequest.message @@ -1083,50 +549,20 @@ export class E2eeRequest extends Message { */ value: GetKeyRequest; case: "getKey"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.E2eeRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "manager_set_enabled", kind: "message", T: E2eeManagerSetEnabledRequest, oneof: "message" }, - { no: 3, name: "manager_get_frame_cryptors", kind: "message", T: E2eeManagerGetFrameCryptorsRequest, oneof: "message" }, - { no: 4, name: "cryptor_set_enabled", kind: "message", T: FrameCryptorSetEnabledRequest, oneof: "message" }, - { no: 5, name: "cryptor_set_key_index", kind: "message", T: FrameCryptorSetKeyIndexRequest, oneof: "message" }, - { no: 6, name: "set_shared_key", kind: "message", T: SetSharedKeyRequest, oneof: "message" }, - { no: 7, name: "ratchet_shared_key", kind: "message", T: RatchetSharedKeyRequest, oneof: "message" }, - { no: 8, name: "get_shared_key", kind: "message", T: GetSharedKeyRequest, oneof: "message" }, - { no: 9, name: "set_key", kind: "message", T: SetKeyRequest, oneof: "message" }, - { no: 10, name: "ratchet_key", kind: "message", T: RatchetKeyRequest, oneof: "message" }, - { no: 11, name: "get_key", kind: "message", T: GetKeyRequest, oneof: "message" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): E2eeRequest { - return new E2eeRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): E2eeRequest { - return new E2eeRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): E2eeRequest { - return new E2eeRequest().fromJsonString(jsonString, options); - } - - static equals(a: E2eeRequest | PlainMessage | undefined, b: E2eeRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeRequest, a, b); - } -} + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message livekit.proto.E2eeRequest. + * Use `create(E2eeRequestSchema)` to create a new message. + */ +export const E2eeRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 23); /** * @generated from message livekit.proto.E2eeResponse */ -export class E2eeResponse extends Message { +export type E2eeResponse = Message<"livekit.proto.E2eeResponse"> & { /** * @generated from oneof livekit.proto.E2eeResponse.message */ @@ -1190,42 +626,85 @@ export class E2eeResponse extends Message { */ value: GetKeyResponse; case: "getKey"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.E2eeResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "manager_set_enabled", kind: "message", T: E2eeManagerSetEnabledResponse, oneof: "message" }, - { no: 2, name: "manager_get_frame_cryptors", kind: "message", T: E2eeManagerGetFrameCryptorsResponse, oneof: "message" }, - { no: 3, name: "cryptor_set_enabled", kind: "message", T: FrameCryptorSetEnabledResponse, oneof: "message" }, - { no: 4, name: "cryptor_set_key_index", kind: "message", T: FrameCryptorSetKeyIndexResponse, oneof: "message" }, - { no: 5, name: "set_shared_key", kind: "message", T: SetSharedKeyResponse, oneof: "message" }, - { no: 6, name: "ratchet_shared_key", kind: "message", T: RatchetSharedKeyResponse, oneof: "message" }, - { no: 7, name: "get_shared_key", kind: "message", T: GetSharedKeyResponse, oneof: "message" }, - { no: 8, name: "set_key", kind: "message", T: SetKeyResponse, oneof: "message" }, - { no: 9, name: "ratchet_key", kind: "message", T: RatchetKeyResponse, oneof: "message" }, - { no: 10, name: "get_key", kind: "message", T: GetKeyResponse, oneof: "message" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): E2eeResponse { - return new E2eeResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): E2eeResponse { - return new E2eeResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): E2eeResponse { - return new E2eeResponse().fromJsonString(jsonString, options); - } - - static equals(a: E2eeResponse | PlainMessage | undefined, b: E2eeResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeResponse, a, b); - } + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message livekit.proto.E2eeResponse. + * Use `create(E2eeResponseSchema)` to create a new message. + */ +export const E2eeResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_e2ee, 24); + +/** + * @generated from enum livekit.proto.EncryptionType + */ +export enum EncryptionType { + /** + * @generated from enum value: NONE = 0; + */ + NONE = 0, + + /** + * @generated from enum value: GCM = 1; + */ + GCM = 1, + + /** + * @generated from enum value: CUSTOM = 2; + */ + CUSTOM = 2, +} + +/** + * Describes the enum livekit.proto.EncryptionType. + */ +export const EncryptionTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_e2ee, 0); + +/** + * @generated from enum livekit.proto.EncryptionState + */ +export enum EncryptionState { + /** + * @generated from enum value: NEW = 0; + */ + NEW = 0, + + /** + * @generated from enum value: OK = 1; + */ + OK = 1, + + /** + * @generated from enum value: ENCRYPTION_FAILED = 2; + */ + ENCRYPTION_FAILED = 2, + + /** + * @generated from enum value: DECRYPTION_FAILED = 3; + */ + DECRYPTION_FAILED = 3, + + /** + * @generated from enum value: MISSING_KEY = 4; + */ + MISSING_KEY = 4, + + /** + * @generated from enum value: KEY_RATCHETED = 5; + */ + KEY_RATCHETED = 5, + + /** + * @generated from enum value: INTERNAL_ERROR = 6; + */ + INTERNAL_ERROR = 6, } +/** + * Describes the enum livekit.proto.EncryptionState. + */ +export const EncryptionStateSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_e2ee, 1); + diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index 1270492b..f1bfdd24 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -12,57 +12,29 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file ffi.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file ffi.proto (package livekit.proto, syntax proto2) /* 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, EditChatMessageRequest, GetSessionStatsCallback, GetSessionStatsRequest, GetSessionStatsResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishSipDtmfCallback, PublishSipDtmfRequest, PublishSipDtmfResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, PublishTranscriptionCallback, PublishTranscriptionRequest, PublishTranscriptionResponse, RoomEvent, SendChatMessageCallback, SendChatMessageRequest, SendChatMessageResponse, SetLocalAttributesCallback, SetLocalAttributesRequest, SetLocalAttributesResponse, SetLocalMetadataCallback, SetLocalMetadataRequest, SetLocalMetadataResponse, SetLocalNameCallback, SetLocalNameRequest, SetLocalNameResponse, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse } from "./room_pb.js"; -import { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, EnableRemoteTrackRequest, EnableRemoteTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, LocalTrackMuteRequest, LocalTrackMuteResponse, TrackEvent } from "./track_pb.js"; -import { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb.js"; -import { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb.js"; -import { E2eeRequest, E2eeResponse } from "./e2ee_pb.js"; -import { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodCallback, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb.js"; +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { E2eeRequest, E2eeResponse } from "./e2ee_pb"; +import { file_e2ee } from "./e2ee_pb"; +import type { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, EnableRemoteTrackRequest, EnableRemoteTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, LocalTrackMuteRequest, LocalTrackMuteResponse, TrackEvent } from "./track_pb"; +import { file_track } from "./track_pb"; +import type { ConnectCallback, ConnectRequest, ConnectResponse, DisconnectCallback, DisconnectRequest, DisconnectResponse, EditChatMessageRequest, GetSessionStatsCallback, GetSessionStatsRequest, GetSessionStatsResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishSipDtmfCallback, PublishSipDtmfRequest, PublishSipDtmfResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, PublishTranscriptionCallback, PublishTranscriptionRequest, PublishTranscriptionResponse, RoomEvent, SendChatMessageCallback, SendChatMessageRequest, SendChatMessageResponse, SetLocalAttributesCallback, SetLocalAttributesRequest, SetLocalAttributesResponse, SetLocalMetadataCallback, SetLocalMetadataRequest, SetLocalMetadataResponse, SetLocalNameCallback, SetLocalNameRequest, SetLocalNameResponse, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse } from "./room_pb"; +import { file_room } from "./room_pb"; +import type { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb"; +import { file_video_frame } from "./video_frame_pb"; +import type { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb"; +import { file_audio_frame } from "./audio_frame_pb"; +import type { Message } from "@bufbuild/protobuf"; /** - * @generated from enum livekit.proto.LogLevel + * Describes the file ffi.proto. */ -export enum LogLevel { - /** - * @generated from enum value: LOG_ERROR = 0; - */ - LOG_ERROR = 0, - - /** - * @generated from enum value: LOG_WARN = 1; - */ - LOG_WARN = 1, - - /** - * @generated from enum value: LOG_INFO = 2; - */ - LOG_INFO = 2, - - /** - * @generated from enum value: LOG_DEBUG = 3; - */ - LOG_DEBUG = 3, - - /** - * @generated from enum value: LOG_TRACE = 4; - */ - LOG_TRACE = 4, -} -// Retrieve enum metadata with: proto3.getEnumType(LogLevel) -proto3.util.setEnumType(LogLevel, "livekit.proto.LogLevel", [ - { no: 0, name: "LOG_ERROR" }, - { no: 1, name: "LOG_WARN" }, - { no: 2, name: "LOG_INFO" }, - { no: 3, name: "LOG_DEBUG" }, - { no: 4, name: "LOG_TRACE" }, -]); +export const file_ffi: GenFile = /*@__PURE__*/ + fileDesc("CglmZmkucHJvdG8SDWxpdmVraXQucHJvdG8i/BIKCkZmaVJlcXVlc3QSMAoHZGlzcG9zZRgCIAEoCzIdLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlcXVlc3RIABIwCgdjb25uZWN0GAMgASgLMh0ubGl2ZWtpdC5wcm90by5Db25uZWN0UmVxdWVzdEgAEjYKCmRpc2Nvbm5lY3QYBCABKAsyIC5saXZla2l0LnByb3RvLkRpc2Nvbm5lY3RSZXF1ZXN0SAASOwoNcHVibGlzaF90cmFjaxgFIAEoCzIiLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVxdWVzdEgAEj8KD3VucHVibGlzaF90cmFjaxgGIAEoCzIkLmxpdmVraXQucHJvdG8uVW5wdWJsaXNoVHJhY2tSZXF1ZXN0SAASOQoMcHVibGlzaF9kYXRhGAcgASgLMiEubGl2ZWtpdC5wcm90by5QdWJsaXNoRGF0YVJlcXVlc3RIABI9Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlcXVlc3RIABJEChJzZXRfbG9jYWxfbWV0YWRhdGEYCSABKAsyJi5saXZla2l0LnByb3RvLlNldExvY2FsTWV0YWRhdGFSZXF1ZXN0SAASPAoOc2V0X2xvY2FsX25hbWUYCiABKAsyIi5saXZla2l0LnByb3RvLlNldExvY2FsTmFtZVJlcXVlc3RIABJIChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIoLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVxdWVzdEgAEkIKEWdldF9zZXNzaW9uX3N0YXRzGAwgASgLMiUubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNSZXF1ZXN0SAASSwoVcHVibGlzaF90cmFuc2NyaXB0aW9uGA0gASgLMioubGl2ZWtpdC5wcm90by5QdWJsaXNoVHJhbnNjcmlwdGlvblJlcXVlc3RIABJAChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiQubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlcXVlc3RIABJEChJjcmVhdGVfdmlkZW9fdHJhY2sYDyABKAsyJi5saXZla2l0LnByb3RvLkNyZWF0ZVZpZGVvVHJhY2tSZXF1ZXN0SAASRAoSY3JlYXRlX2F1ZGlvX3RyYWNrGBAgASgLMiYubGl2ZWtpdC5wcm90by5DcmVhdGVBdWRpb1RyYWNrUmVxdWVzdEgAEkAKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJC5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVxdWVzdEgAEkYKE2VuYWJsZV9yZW1vdGVfdHJhY2sYEiABKAsyJy5saXZla2l0LnByb3RvLkVuYWJsZVJlbW90ZVRyYWNrUmVxdWVzdEgAEjMKCWdldF9zdGF0cxgTIAEoCzIeLmxpdmVraXQucHJvdG8uR2V0U3RhdHNSZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3NvdXJjZRgVIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9Tb3VyY2VSZXF1ZXN0SAASRgoTY2FwdHVyZV92aWRlb19mcmFtZRgWIAEoCzInLmxpdmVraXQucHJvdG8uQ2FwdHVyZVZpZGVvRnJhbWVSZXF1ZXN0SAASOwoNdmlkZW9fY29udmVydBgXIAEoCzIiLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVxdWVzdEgAElkKHXZpZGVvX3N0cmVhbV9mcm9tX3BhcnRpY2lwYW50GBggASgLMjAubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlcXVlc3RIABJAChBuZXdfYXVkaW9fc3RyZWFtGBkgASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1N0cmVhbVJlcXVlc3RIABJAChBuZXdfYXVkaW9fc291cmNlGBogASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlcXVlc3RIABJGChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGBsgASgLMicubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZVJlcXVlc3RIABJEChJjbGVhcl9hdWRpb19idWZmZXIYHCABKAsyJi5saXZla2l0LnByb3RvLkNsZWFyQXVkaW9CdWZmZXJSZXF1ZXN0SAASRgoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzInLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXF1ZXN0SAASRAoScmVtaXhfYW5kX3Jlc2FtcGxlGB4gASgLMiYubGl2ZWtpdC5wcm90by5SZW1peEFuZFJlc2FtcGxlUmVxdWVzdEgAEioKBGUyZWUYHyABKAsyGi5saXZla2l0LnByb3RvLkUyZWVSZXF1ZXN0SAASWQodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYICABKAsyMC5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVxdWVzdEgAEkIKEW5ld19zb3hfcmVzYW1wbGVyGCEgASgLMiUubGl2ZWtpdC5wcm90by5OZXdTb3hSZXNhbXBsZXJSZXF1ZXN0SAASRAoScHVzaF9zb3hfcmVzYW1wbGVyGCIgASgLMiYubGl2ZWtpdC5wcm90by5QdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkYKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyJy5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkIKEXNlbmRfY2hhdF9tZXNzYWdlGCQgASgLMiUubGl2ZWtpdC5wcm90by5TZW5kQ2hhdE1lc3NhZ2VSZXF1ZXN0SAASQgoRZWRpdF9jaGF0X21lc3NhZ2UYJSABKAsyJS5saXZla2l0LnByb3RvLkVkaXRDaGF0TWVzc2FnZVJlcXVlc3RIAEIJCgdtZXNzYWdlItwSCgtGZmlSZXNwb25zZRIxCgdkaXNwb3NlGAIgASgLMh4ubGl2ZWtpdC5wcm90by5EaXNwb3NlUmVzcG9uc2VIABIxCgdjb25uZWN0GAMgASgLMh4ubGl2ZWtpdC5wcm90by5Db25uZWN0UmVzcG9uc2VIABI3CgpkaXNjb25uZWN0GAQgASgLMiEubGl2ZWtpdC5wcm90by5EaXNjb25uZWN0UmVzcG9uc2VIABI8Cg1wdWJsaXNoX3RyYWNrGAUgASgLMiMubGl2ZWtpdC5wcm90by5QdWJsaXNoVHJhY2tSZXNwb25zZUgAEkAKD3VucHVibGlzaF90cmFjaxgGIAEoCzIlLmxpdmVraXQucHJvdG8uVW5wdWJsaXNoVHJhY2tSZXNwb25zZUgAEjoKDHB1Ymxpc2hfZGF0YRgHIAEoCzIiLmxpdmVraXQucHJvdG8uUHVibGlzaERhdGFSZXNwb25zZUgAEj4KDnNldF9zdWJzY3JpYmVkGAggASgLMiQubGl2ZWtpdC5wcm90by5TZXRTdWJzY3JpYmVkUmVzcG9uc2VIABJFChJzZXRfbG9jYWxfbWV0YWRhdGEYCSABKAsyJy5saXZla2l0LnByb3RvLlNldExvY2FsTWV0YWRhdGFSZXNwb25zZUgAEj0KDnNldF9sb2NhbF9uYW1lGAogASgLMiMubGl2ZWtpdC5wcm90by5TZXRMb2NhbE5hbWVSZXNwb25zZUgAEkkKFHNldF9sb2NhbF9hdHRyaWJ1dGVzGAsgASgLMikubGl2ZWtpdC5wcm90by5TZXRMb2NhbEF0dHJpYnV0ZXNSZXNwb25zZUgAEkMKEWdldF9zZXNzaW9uX3N0YXRzGAwgASgLMiYubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNSZXNwb25zZUgAEkwKFXB1Ymxpc2hfdHJhbnNjcmlwdGlvbhgNIAEoCzIrLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYW5zY3JpcHRpb25SZXNwb25zZUgAEkEKEHB1Ymxpc2hfc2lwX2R0bWYYDiABKAsyJS5saXZla2l0LnByb3RvLlB1Ymxpc2hTaXBEdG1mUmVzcG9uc2VIABJFChJjcmVhdGVfdmlkZW9fdHJhY2sYDyABKAsyJy5saXZla2l0LnByb3RvLkNyZWF0ZVZpZGVvVHJhY2tSZXNwb25zZUgAEkUKEmNyZWF0ZV9hdWRpb190cmFjaxgQIAEoCzInLmxpdmVraXQucHJvdG8uQ3JlYXRlQXVkaW9UcmFja1Jlc3BvbnNlSAASQQoQbG9jYWxfdHJhY2tfbXV0ZRgRIAEoCzIlLmxpdmVraXQucHJvdG8uTG9jYWxUcmFja011dGVSZXNwb25zZUgAEkcKE2VuYWJsZV9yZW1vdGVfdHJhY2sYEiABKAsyKC5saXZla2l0LnByb3RvLkVuYWJsZVJlbW90ZVRyYWNrUmVzcG9uc2VIABI0CglnZXRfc3RhdHMYEyABKAsyHy5saXZla2l0LnByb3RvLkdldFN0YXRzUmVzcG9uc2VIABJBChBuZXdfdmlkZW9fc3RyZWFtGBQgASgLMiUubGl2ZWtpdC5wcm90by5OZXdWaWRlb1N0cmVhbVJlc3BvbnNlSAASQQoQbmV3X3ZpZGVvX3NvdXJjZRgVIAEoCzIlLmxpdmVraXQucHJvdG8uTmV3VmlkZW9Tb3VyY2VSZXNwb25zZUgAEkcKE2NhcHR1cmVfdmlkZW9fZnJhbWUYFiABKAsyKC5saXZla2l0LnByb3RvLkNhcHR1cmVWaWRlb0ZyYW1lUmVzcG9uc2VIABI8Cg12aWRlb19jb252ZXJ0GBcgASgLMiMubGl2ZWtpdC5wcm90by5WaWRlb0NvbnZlcnRSZXNwb25zZUgAEloKHXZpZGVvX3N0cmVhbV9mcm9tX3BhcnRpY2lwYW50GBggASgLMjEubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlc3BvbnNlSAASQQoQbmV3X2F1ZGlvX3N0cmVhbRgZIAEoCzIlLmxpdmVraXQucHJvdG8uTmV3QXVkaW9TdHJlYW1SZXNwb25zZUgAEkEKEG5ld19hdWRpb19zb3VyY2UYGiABKAsyJS5saXZla2l0LnByb3RvLk5ld0F1ZGlvU291cmNlUmVzcG9uc2VIABJHChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGBsgASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZVJlc3BvbnNlSAASRQoSY2xlYXJfYXVkaW9fYnVmZmVyGBwgASgLMicubGl2ZWtpdC5wcm90by5DbGVhckF1ZGlvQnVmZmVyUmVzcG9uc2VIABJHChNuZXdfYXVkaW9fcmVzYW1wbGVyGB0gASgLMigubGl2ZWtpdC5wcm90by5OZXdBdWRpb1Jlc2FtcGxlclJlc3BvbnNlSAASRQoScmVtaXhfYW5kX3Jlc2FtcGxlGB4gASgLMicubGl2ZWtpdC5wcm90by5SZW1peEFuZFJlc2FtcGxlUmVzcG9uc2VIABJaCh1hdWRpb19zdHJlYW1fZnJvbV9wYXJ0aWNpcGFudBgfIAEoCzIxLmxpdmVraXQucHJvdG8uQXVkaW9TdHJlYW1Gcm9tUGFydGljaXBhbnRSZXNwb25zZUgAEisKBGUyZWUYICABKAsyGy5saXZla2l0LnByb3RvLkUyZWVSZXNwb25zZUgAEkMKEW5ld19zb3hfcmVzYW1wbGVyGCEgASgLMiYubGl2ZWtpdC5wcm90by5OZXdTb3hSZXNhbXBsZXJSZXNwb25zZUgAEkUKEnB1c2hfc294X3Jlc2FtcGxlchgiIAEoCzInLmxpdmVraXQucHJvdG8uUHVzaFNveFJlc2FtcGxlclJlc3BvbnNlSAASRwoTZmx1c2hfc294X3Jlc2FtcGxlchgjIAEoCzIoLmxpdmVraXQucHJvdG8uRmx1c2hTb3hSZXNhbXBsZXJSZXNwb25zZUgAEkMKEXNlbmRfY2hhdF9tZXNzYWdlGCQgASgLMiYubGl2ZWtpdC5wcm90by5TZW5kQ2hhdE1lc3NhZ2VSZXNwb25zZUgAQgkKB21lc3NhZ2UihgoKCEZmaUV2ZW50Ei4KCnJvb21fZXZlbnQYASABKAsyGC5saXZla2l0LnByb3RvLlJvb21FdmVudEgAEjAKC3RyYWNrX2V2ZW50GAIgASgLMhkubGl2ZWtpdC5wcm90by5UcmFja0V2ZW50SAASPQoSdmlkZW9fc3RyZWFtX2V2ZW50GAMgASgLMh8ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUV2ZW50SAASPQoSYXVkaW9fc3RyZWFtX2V2ZW50GAQgASgLMh8ubGl2ZWtpdC5wcm90by5BdWRpb1N0cmVhbUV2ZW50SAASMQoHY29ubmVjdBgFIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdENhbGxiYWNrSAASNwoKZGlzY29ubmVjdBgHIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdENhbGxiYWNrSAASMQoHZGlzcG9zZRgIIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZUNhbGxiYWNrSAASPAoNcHVibGlzaF90cmFjaxgJIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrQ2FsbGJhY2tIABJACg91bnB1Ymxpc2hfdHJhY2sYCiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrQ2FsbGJhY2tIABI6CgxwdWJsaXNoX2RhdGEYCyABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhQ2FsbGJhY2tIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDCABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uQ2FsbGJhY2tIABJHChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGA0gASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZUNhbGxiYWNrSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGA4gASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhQ2FsbGJhY2tIABI9Cg5zZXRfbG9jYWxfbmFtZRgPIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lQ2FsbGJhY2tIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgQIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzQ2FsbGJhY2tIABI0CglnZXRfc3RhdHMYESABKAsyHy5saXZla2l0LnByb3RvLkdldFN0YXRzQ2FsbGJhY2tIABInCgRsb2dzGBIgASgLMhcubGl2ZWtpdC5wcm90by5Mb2dCYXRjaEgAEkMKEWdldF9zZXNzaW9uX3N0YXRzGBMgASgLMiYubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNDYWxsYmFja0gAEiUKBXBhbmljGBQgASgLMhQubGl2ZWtpdC5wcm90by5QYW5pY0gAEkEKEHB1Ymxpc2hfc2lwX2R0bWYYFSABKAsyJS5saXZla2l0LnByb3RvLlB1Ymxpc2hTaXBEdG1mQ2FsbGJhY2tIABI+CgxjaGF0X21lc3NhZ2UYFiABKAsyJi5saXZla2l0LnByb3RvLlNlbmRDaGF0TWVzc2FnZUNhbGxiYWNrSABCCQoHbWVzc2FnZSIfCg5EaXNwb3NlUmVxdWVzdBINCgVhc3luYxgBIAIoCCIjCg9EaXNwb3NlUmVzcG9uc2USEAoIYXN5bmNfaWQYASABKAQiIwoPRGlzcG9zZUNhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEIoUBCglMb2dSZWNvcmQSJgoFbGV2ZWwYASACKA4yFy5saXZla2l0LnByb3RvLkxvZ0xldmVsEg4KBnRhcmdldBgCIAIoCRITCgttb2R1bGVfcGF0aBgDIAEoCRIMCgRmaWxlGAQgASgJEgwKBGxpbmUYBSABKA0SDwoHbWVzc2FnZRgGIAIoCSI1CghMb2dCYXRjaBIpCgdyZWNvcmRzGAEgAygLMhgubGl2ZWtpdC5wcm90by5Mb2dSZWNvcmQiGAoFUGFuaWMSDwoHbWVzc2FnZRgBIAIoCSpTCghMb2dMZXZlbBINCglMT0dfRVJST1IQABIMCghMT0dfV0FSThABEgwKCExPR19JTkZPEAISDQoJTE9HX0RFQlVHEAMSDQoJTE9HX1RSQUNFEARCEKoCDUxpdmVLaXQuUHJvdG8", [file_e2ee, file_track, file_room, file_video_frame, file_audio_frame]); /** * This is the input of livekit_ffi_request function @@ -70,7 +42,7 @@ proto3.util.setEnumType(LogLevel, "livekit.proto.LogLevel", [ * * @generated from message livekit.proto.FfiRequest */ -export class FfiRequest extends Message { +export type FfiRequest = Message<"livekit.proto.FfiRequest"> & { /** * @generated from oneof livekit.proto.FfiRequest.message */ @@ -298,107 +270,22 @@ export class FfiRequest extends Message { */ value: EditChatMessageRequest; case: "editChatMessage"; - } | { - /** - * RPC - * - * @generated from field: livekit.proto.PerformRpcRequest perform_rpc = 38; - */ - value: PerformRpcRequest; - case: "performRpc"; - } | { - /** - * @generated from field: livekit.proto.RegisterRpcMethodRequest register_rpc_method = 39; - */ - value: RegisterRpcMethodRequest; - case: "registerRpcMethod"; - } | { - /** - * @generated from field: livekit.proto.UnregisterRpcMethodRequest unregister_rpc_method = 40; - */ - value: UnregisterRpcMethodRequest; - case: "unregisterRpcMethod"; - } | { - /** - * @generated from field: livekit.proto.RpcMethodInvocationResponseRequest rpc_method_invocation_response = 41; - */ - value: RpcMethodInvocationResponseRequest; - case: "rpcMethodInvocationResponse"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + } | { case: undefined; value?: undefined }; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FfiRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 2, name: "dispose", kind: "message", T: DisposeRequest, oneof: "message" }, - { no: 3, name: "connect", kind: "message", T: ConnectRequest, oneof: "message" }, - { no: 4, name: "disconnect", kind: "message", T: DisconnectRequest, oneof: "message" }, - { no: 5, name: "publish_track", kind: "message", T: PublishTrackRequest, oneof: "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: "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: "local_track_mute", kind: "message", T: LocalTrackMuteRequest, oneof: "message" }, - { no: 18, name: "enable_remote_track", kind: "message", T: EnableRemoteTrackRequest, oneof: "message" }, - { no: 19, name: "get_stats", kind: "message", T: GetStatsRequest, oneof: "message" }, - { no: 20, name: "new_video_stream", kind: "message", T: NewVideoStreamRequest, oneof: "message" }, - { no: 21, name: "new_video_source", kind: "message", T: NewVideoSourceRequest, oneof: "message" }, - { no: 22, name: "capture_video_frame", kind: "message", T: CaptureVideoFrameRequest, oneof: "message" }, - { no: 23, name: "video_convert", kind: "message", T: VideoConvertRequest, oneof: "message" }, - { no: 24, name: "video_stream_from_participant", kind: "message", T: VideoStreamFromParticipantRequest, oneof: "message" }, - { no: 25, name: "new_audio_stream", kind: "message", T: NewAudioStreamRequest, oneof: "message" }, - { no: 26, name: "new_audio_source", kind: "message", T: NewAudioSourceRequest, oneof: "message" }, - { no: 27, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameRequest, oneof: "message" }, - { no: 28, name: "clear_audio_buffer", kind: "message", T: ClearAudioBufferRequest, oneof: "message" }, - { no: 29, name: "new_audio_resampler", kind: "message", T: NewAudioResamplerRequest, oneof: "message" }, - { no: 30, name: "remix_and_resample", kind: "message", T: RemixAndResampleRequest, oneof: "message" }, - { no: 31, name: "e2ee", kind: "message", T: E2eeRequest, oneof: "message" }, - { no: 32, name: "audio_stream_from_participant", kind: "message", T: AudioStreamFromParticipantRequest, oneof: "message" }, - { no: 33, name: "new_sox_resampler", kind: "message", T: NewSoxResamplerRequest, oneof: "message" }, - { no: 34, name: "push_sox_resampler", kind: "message", T: PushSoxResamplerRequest, oneof: "message" }, - { no: 35, name: "flush_sox_resampler", kind: "message", T: FlushSoxResamplerRequest, oneof: "message" }, - { no: 36, name: "send_chat_message", kind: "message", T: SendChatMessageRequest, oneof: "message" }, - { no: 37, name: "edit_chat_message", kind: "message", T: EditChatMessageRequest, oneof: "message" }, - { no: 38, name: "perform_rpc", kind: "message", T: PerformRpcRequest, oneof: "message" }, - { no: 39, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodRequest, oneof: "message" }, - { no: 40, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodRequest, oneof: "message" }, - { no: 41, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseRequest, oneof: "message" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FfiRequest { - return new FfiRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FfiRequest { - return new FfiRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FfiRequest { - return new FfiRequest().fromJsonString(jsonString, options); - } - - static equals(a: FfiRequest | PlainMessage | undefined, b: FfiRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(FfiRequest, a, b); - } -} +/** + * Describes the message livekit.proto.FfiRequest. + * Use `create(FfiRequestSchema)` to create a new message. + */ +export const FfiRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_ffi, 0); /** * This is the output of livekit_ffi_request function. * * @generated from message livekit.proto.FfiResponse */ -export class FfiResponse extends Message { +export type FfiResponse = Message<"livekit.proto.FfiResponse"> & { /** * @generated from oneof livekit.proto.FfiResponse.message */ @@ -620,99 +507,15 @@ export class FfiResponse extends Message { */ value: SendChatMessageResponse; case: "sendChatMessage"; - } | { - /** - * RPC - * - * @generated from field: livekit.proto.PerformRpcResponse perform_rpc = 37; - */ - value: PerformRpcResponse; - case: "performRpc"; - } | { - /** - * @generated from field: livekit.proto.RegisterRpcMethodResponse register_rpc_method = 38; - */ - value: RegisterRpcMethodResponse; - case: "registerRpcMethod"; - } | { - /** - * @generated from field: livekit.proto.UnregisterRpcMethodResponse unregister_rpc_method = 39; - */ - value: UnregisterRpcMethodResponse; - case: "unregisterRpcMethod"; - } | { - /** - * @generated from field: livekit.proto.RpcMethodInvocationResponseResponse rpc_method_invocation_response = 40; - */ - value: RpcMethodInvocationResponseResponse; - case: "rpcMethodInvocationResponse"; - } | { case: undefined; value?: undefined } = { case: undefined }; + } | { case: undefined; value?: undefined }; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FfiResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 2, name: "dispose", kind: "message", T: DisposeResponse, oneof: "message" }, - { no: 3, name: "connect", kind: "message", T: ConnectResponse, oneof: "message" }, - { no: 4, name: "disconnect", kind: "message", T: DisconnectResponse, oneof: "message" }, - { no: 5, name: "publish_track", kind: "message", T: PublishTrackResponse, oneof: "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: "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: "local_track_mute", kind: "message", T: LocalTrackMuteResponse, oneof: "message" }, - { no: 18, name: "enable_remote_track", kind: "message", T: EnableRemoteTrackResponse, oneof: "message" }, - { no: 19, name: "get_stats", kind: "message", T: GetStatsResponse, oneof: "message" }, - { no: 20, name: "new_video_stream", kind: "message", T: NewVideoStreamResponse, oneof: "message" }, - { no: 21, name: "new_video_source", kind: "message", T: NewVideoSourceResponse, oneof: "message" }, - { no: 22, name: "capture_video_frame", kind: "message", T: CaptureVideoFrameResponse, oneof: "message" }, - { no: 23, name: "video_convert", kind: "message", T: VideoConvertResponse, oneof: "message" }, - { no: 24, name: "video_stream_from_participant", kind: "message", T: VideoStreamFromParticipantResponse, oneof: "message" }, - { no: 25, name: "new_audio_stream", kind: "message", T: NewAudioStreamResponse, oneof: "message" }, - { no: 26, name: "new_audio_source", kind: "message", T: NewAudioSourceResponse, oneof: "message" }, - { no: 27, name: "capture_audio_frame", kind: "message", T: CaptureAudioFrameResponse, oneof: "message" }, - { no: 28, name: "clear_audio_buffer", kind: "message", T: ClearAudioBufferResponse, oneof: "message" }, - { no: 29, name: "new_audio_resampler", kind: "message", T: NewAudioResamplerResponse, oneof: "message" }, - { no: 30, name: "remix_and_resample", kind: "message", T: RemixAndResampleResponse, oneof: "message" }, - { no: 31, name: "audio_stream_from_participant", kind: "message", T: AudioStreamFromParticipantResponse, oneof: "message" }, - { no: 32, name: "e2ee", kind: "message", T: E2eeResponse, oneof: "message" }, - { no: 33, name: "new_sox_resampler", kind: "message", T: NewSoxResamplerResponse, oneof: "message" }, - { no: 34, name: "push_sox_resampler", kind: "message", T: PushSoxResamplerResponse, oneof: "message" }, - { no: 35, name: "flush_sox_resampler", kind: "message", T: FlushSoxResamplerResponse, oneof: "message" }, - { no: 36, name: "send_chat_message", kind: "message", T: SendChatMessageResponse, oneof: "message" }, - { no: 37, name: "perform_rpc", kind: "message", T: PerformRpcResponse, oneof: "message" }, - { no: 38, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodResponse, oneof: "message" }, - { no: 39, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodResponse, oneof: "message" }, - { no: 40, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseResponse, oneof: "message" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FfiResponse { - return new FfiResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FfiResponse { - return new FfiResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FfiResponse { - return new FfiResponse().fromJsonString(jsonString, options); - } - - static equals(a: FfiResponse | PlainMessage | undefined, b: FfiResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(FfiResponse, a, b); - } -} +/** + * Describes the message livekit.proto.FfiResponse. + * Use `create(FfiResponseSchema)` to create a new message. + */ +export const FfiResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_ffi, 1); /** * To minimize complexity, participant events are not included in the protocol. @@ -721,7 +524,7 @@ export class FfiResponse extends Message { * * @generated from message livekit.proto.FfiEvent */ -export class FfiEvent extends Message { +export type FfiEvent = Message<"livekit.proto.FfiEvent"> & { /** * @generated from oneof livekit.proto.FfiEvent.message */ @@ -851,90 +654,15 @@ export class FfiEvent extends Message { */ value: SendChatMessageCallback; case: "chatMessage"; - } | { - /** - * @generated from field: livekit.proto.PerformRpcCallback perform_rpc = 23; - */ - value: PerformRpcCallback; - case: "performRpc"; - } | { - /** - * @generated from field: livekit.proto.RegisterRpcMethodCallback register_rpc_method = 24; - */ - value: RegisterRpcMethodCallback; - case: "registerRpcMethod"; - } | { - /** - * @generated from field: livekit.proto.UnregisterRpcMethodCallback unregister_rpc_method = 25; - */ - value: UnregisterRpcMethodCallback; - case: "unregisterRpcMethod"; - } | { - /** - * @generated from field: livekit.proto.RpcMethodInvocationEvent rpc_method_invocation = 26; - */ - value: RpcMethodInvocationEvent; - case: "rpcMethodInvocation"; - } | { - /** - * @generated from field: livekit.proto.RpcMethodInvocationResponseCallback rpc_method_invocation_response = 27; - */ - value: RpcMethodInvocationResponseCallback; - case: "rpcMethodInvocationResponse"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FfiEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "room_event", kind: "message", T: RoomEvent, oneof: "message" }, - { no: 2, name: "track_event", kind: "message", T: TrackEvent, oneof: "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: 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" }, - { no: 22, name: "chat_message", kind: "message", T: SendChatMessageCallback, oneof: "message" }, - { no: 23, name: "perform_rpc", kind: "message", T: PerformRpcCallback, oneof: "message" }, - { no: 24, name: "register_rpc_method", kind: "message", T: RegisterRpcMethodCallback, oneof: "message" }, - { no: 25, name: "unregister_rpc_method", kind: "message", T: UnregisterRpcMethodCallback, oneof: "message" }, - { no: 26, name: "rpc_method_invocation", kind: "message", T: RpcMethodInvocationEvent, oneof: "message" }, - { no: 27, name: "rpc_method_invocation_response", kind: "message", T: RpcMethodInvocationResponseCallback, oneof: "message" }, - ]); + } | { case: undefined; value?: undefined }; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): FfiEvent { - return new FfiEvent().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FfiEvent { - return new FfiEvent().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FfiEvent { - return new FfiEvent().fromJsonString(jsonString, options); - } - - static equals(a: FfiEvent | PlainMessage | undefined, b: FfiEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(FfiEvent, a, b); - } -} +/** + * Describes the message livekit.proto.FfiEvent. + * Use `create(FfiEventSchema)` to create a new message. + */ +export const FfiEventSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_ffi, 2); /** * Stop all rooms synchronously (Do we need async here?). @@ -943,256 +671,167 @@ export class FfiEvent extends Message { * * @generated from message livekit.proto.DisposeRequest */ -export class DisposeRequest extends Message { +export type DisposeRequest = Message<"livekit.proto.DisposeRequest"> & { /** - * @generated from field: bool async = 1; + * @generated from field: required bool async = 1; */ - async = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.DisposeRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DisposeRequest { - return new DisposeRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DisposeRequest { - return new DisposeRequest().fromJson(jsonValue, options); - } + async: boolean; +}; - static fromJsonString(jsonString: string, options?: Partial): DisposeRequest { - return new DisposeRequest().fromJsonString(jsonString, options); - } - - static equals(a: DisposeRequest | PlainMessage | undefined, b: DisposeRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(DisposeRequest, a, b); - } -} +/** + * Describes the message livekit.proto.DisposeRequest. + * Use `create(DisposeRequestSchema)` to create a new message. + */ +export const DisposeRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_ffi, 3); /** * @generated from message livekit.proto.DisposeResponse */ -export class DisposeResponse extends Message { +export type DisposeResponse = Message<"livekit.proto.DisposeResponse"> & { /** * None if sync * * @generated from field: optional uint64 async_id = 1; */ - asyncId?: bigint; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + asyncId: bigint; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.DisposeResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DisposeResponse { - return new DisposeResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DisposeResponse { - return new DisposeResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DisposeResponse { - return new DisposeResponse().fromJsonString(jsonString, options); - } - - static equals(a: DisposeResponse | PlainMessage | undefined, b: DisposeResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(DisposeResponse, a, b); - } -} +/** + * Describes the message livekit.proto.DisposeResponse. + * Use `create(DisposeResponseSchema)` to create a new message. + */ +export const DisposeResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_ffi, 4); /** * @generated from message livekit.proto.DisposeCallback */ -export class DisposeCallback extends Message { +export type DisposeCallback = Message<"livekit.proto.DisposeCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.DisposeCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DisposeCallback { - return new DisposeCallback().fromBinary(bytes, options); - } + asyncId: bigint; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): DisposeCallback { - return new DisposeCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DisposeCallback { - return new DisposeCallback().fromJsonString(jsonString, options); - } - - static equals(a: DisposeCallback | PlainMessage | undefined, b: DisposeCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(DisposeCallback, a, b); - } -} +/** + * Describes the message livekit.proto.DisposeCallback. + * Use `create(DisposeCallbackSchema)` to create a new message. + */ +export const DisposeCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_ffi, 5); /** * @generated from message livekit.proto.LogRecord */ -export class LogRecord extends Message { +export type LogRecord = Message<"livekit.proto.LogRecord"> & { /** - * @generated from field: livekit.proto.LogLevel level = 1; + * @generated from field: required livekit.proto.LogLevel level = 1; */ - level = LogLevel.LOG_ERROR; + level: LogLevel; /** * e.g "livekit", "libwebrtc", "tokio-tungstenite", etc... * - * @generated from field: string target = 2; + * @generated from field: required string target = 2; */ - target = ""; + target: string; /** * @generated from field: optional string module_path = 3; */ - modulePath?: string; + modulePath: string; /** * @generated from field: optional string file = 4; */ - file?: string; + file: string; /** * @generated from field: optional uint32 line = 5; */ - line?: number; + line: number; /** - * @generated from field: string message = 6; + * @generated from field: required string message = 6; */ - message = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.LogRecord"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "level", kind: "enum", T: proto3.getEnumType(LogLevel) }, - { no: 2, name: "target", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "module_path", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 4, name: "file", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 5, name: "line", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, - { no: 6, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LogRecord { - return new LogRecord().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LogRecord { - return new LogRecord().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LogRecord { - return new LogRecord().fromJsonString(jsonString, options); - } + message: string; +}; - static equals(a: LogRecord | PlainMessage | undefined, b: LogRecord | PlainMessage | undefined): boolean { - return proto3.util.equals(LogRecord, a, b); - } -} +/** + * Describes the message livekit.proto.LogRecord. + * Use `create(LogRecordSchema)` to create a new message. + */ +export const LogRecordSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_ffi, 6); /** * @generated from message livekit.proto.LogBatch */ -export class LogBatch extends Message { +export type LogBatch = Message<"livekit.proto.LogBatch"> & { /** * @generated from field: repeated livekit.proto.LogRecord records = 1; */ - records: LogRecord[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.LogBatch"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "records", kind: "message", T: LogRecord, repeated: true }, - ]); + records: LogRecord[]; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): LogBatch { - return new LogBatch().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LogBatch { - return new LogBatch().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LogBatch { - return new LogBatch().fromJsonString(jsonString, options); - } - - static equals(a: LogBatch | PlainMessage | undefined, b: LogBatch | PlainMessage | undefined): boolean { - return proto3.util.equals(LogBatch, a, b); - } -} +/** + * Describes the message livekit.proto.LogBatch. + * Use `create(LogBatchSchema)` to create a new message. + */ +export const LogBatchSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_ffi, 7); /** * @generated from message livekit.proto.Panic */ -export class Panic extends Message { +export type Panic = Message<"livekit.proto.Panic"> & { /** - * @generated from field: string message = 1; + * @generated from field: required string message = 1; */ - message = ""; + message: string; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +/** + * Describes the message livekit.proto.Panic. + * Use `create(PanicSchema)` to create a new message. + */ +export const PanicSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_ffi, 8); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.Panic"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); +/** + * @generated from enum livekit.proto.LogLevel + */ +export enum LogLevel { + /** + * @generated from enum value: LOG_ERROR = 0; + */ + LOG_ERROR = 0, - static fromBinary(bytes: Uint8Array, options?: Partial): Panic { - return new Panic().fromBinary(bytes, options); - } + /** + * @generated from enum value: LOG_WARN = 1; + */ + LOG_WARN = 1, - static fromJson(jsonValue: JsonValue, options?: Partial): Panic { - return new Panic().fromJson(jsonValue, options); - } + /** + * @generated from enum value: LOG_INFO = 2; + */ + LOG_INFO = 2, - static fromJsonString(jsonString: string, options?: Partial): Panic { - return new Panic().fromJsonString(jsonString, options); - } + /** + * @generated from enum value: LOG_DEBUG = 3; + */ + LOG_DEBUG = 3, - static equals(a: Panic | PlainMessage | undefined, b: Panic | PlainMessage | undefined): boolean { - return proto3.util.equals(Panic, a, b); - } + /** + * @generated from enum value: LOG_TRACE = 4; + */ + LOG_TRACE = 4, } +/** + * Describes the enum livekit.proto.LogLevel. + */ +export const LogLevelSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_ffi, 0); + diff --git a/packages/livekit-rtc/src/proto/handle_pb.ts b/packages/livekit-rtc/src/proto/handle_pb.ts index cbb0bcef..ded2c866 100644 --- a/packages/livekit-rtc/src/proto/handle_pb.ts +++ b/packages/livekit-rtc/src/proto/handle_pb.ts @@ -12,13 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file handle.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file handle.proto (package livekit.proto, syntax proto2) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file handle.proto. + */ +export const file_handle: GenFile = /*@__PURE__*/ + fileDesc("CgxoYW5kbGUucHJvdG8SDWxpdmVraXQucHJvdG8iHAoORmZpT3duZWRIYW5kbGUSCgoCaWQYASACKARCEKoCDUxpdmVLaXQuUHJvdG8"); /** * # Safety @@ -33,37 +39,17 @@ import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; * * @generated from message livekit.proto.FfiOwnedHandle */ -export class FfiOwnedHandle extends Message { +export type FfiOwnedHandle = Message<"livekit.proto.FfiOwnedHandle"> & { /** - * @generated from field: uint64 id = 1; + * @generated from field: required uint64 id = 1; */ - id = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.FfiOwnedHandle"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); + id: bigint; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): FfiOwnedHandle { - return new FfiOwnedHandle().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FfiOwnedHandle { - return new FfiOwnedHandle().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FfiOwnedHandle { - return new FfiOwnedHandle().fromJsonString(jsonString, options); - } - - static equals(a: FfiOwnedHandle | PlainMessage | undefined, b: FfiOwnedHandle | PlainMessage | undefined): boolean { - return proto3.util.equals(FfiOwnedHandle, a, b); - } -} +/** + * Describes the message livekit.proto.FfiOwnedHandle. + * Use `create(FfiOwnedHandleSchema)` to create a new message. + */ +export const FfiOwnedHandleSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_handle, 0); diff --git a/packages/livekit-rtc/src/proto/participant_pb.ts b/packages/livekit-rtc/src/proto/participant_pb.ts index c0d03f9a..60497e9a 100644 --- a/packages/livekit-rtc/src/proto/participant_pb.ts +++ b/packages/livekit-rtc/src/proto/participant_pb.ts @@ -12,160 +12,119 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file participant.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file participant.proto (package livekit.proto, syntax proto2) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import { FfiOwnedHandle } from "./handle_pb.js"; +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { FfiOwnedHandle } from "./handle_pb"; +import { file_handle } from "./handle_pb"; +import type { Message } from "@bufbuild/protobuf"; /** - * @generated from enum livekit.proto.ParticipantKind + * Describes the file participant.proto. */ -export enum ParticipantKind { +export const file_participant: GenFile = /*@__PURE__*/ + fileDesc("ChFwYXJ0aWNpcGFudC5wcm90bxINbGl2ZWtpdC5wcm90byL1AQoPUGFydGljaXBhbnRJbmZvEgsKA3NpZBgBIAIoCRIMCgRuYW1lGAIgAigJEhAKCGlkZW50aXR5GAMgAigJEhAKCG1ldGFkYXRhGAQgAigJEkIKCmF0dHJpYnV0ZXMYBSADKAsyLi5saXZla2l0LnByb3RvLlBhcnRpY2lwYW50SW5mby5BdHRyaWJ1dGVzRW50cnkSLAoEa2luZBgGIAIoDjIeLmxpdmVraXQucHJvdG8uUGFydGljaXBhbnRLaW5kGjEKD0F0dHJpYnV0ZXNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIm8KEE93bmVkUGFydGljaXBhbnQSLQoGaGFuZGxlGAEgAigLMh0ubGl2ZWtpdC5wcm90by5GZmlPd25lZEhhbmRsZRIsCgRpbmZvGAIgAigLMh4ubGl2ZWtpdC5wcm90by5QYXJ0aWNpcGFudEluZm8qoQEKD1BhcnRpY2lwYW50S2luZBIdChlQQVJUSUNJUEFOVF9LSU5EX1NUQU5EQVJEEAASHAoYUEFSVElDSVBBTlRfS0lORF9JTkdSRVNTEAESGwoXUEFSVElDSVBBTlRfS0lORF9FR1JFU1MQAhIYChRQQVJUSUNJUEFOVF9LSU5EX1NJUBADEhoKFlBBUlRJQ0lQQU5UX0tJTkRfQUdFTlQQBEIQqgINTGl2ZUtpdC5Qcm90bw", [file_handle]); + +/** + * @generated from message livekit.proto.ParticipantInfo + */ +export type ParticipantInfo = Message<"livekit.proto.ParticipantInfo"> & { /** - * @generated from enum value: PARTICIPANT_KIND_STANDARD = 0; + * @generated from field: required string sid = 1; */ - STANDARD = 0, + sid: string; /** - * @generated from enum value: PARTICIPANT_KIND_INGRESS = 1; + * @generated from field: required string name = 2; */ - INGRESS = 1, + name: string; /** - * @generated from enum value: PARTICIPANT_KIND_EGRESS = 2; + * @generated from field: required string identity = 3; */ - EGRESS = 2, + identity: string; /** - * @generated from enum value: PARTICIPANT_KIND_SIP = 3; + * @generated from field: required string metadata = 4; */ - SIP = 3, + metadata: string; /** - * @generated from enum value: PARTICIPANT_KIND_AGENT = 4; + * @generated from field: map attributes = 5; */ - AGENT = 4, -} -// Retrieve enum metadata with: proto3.getEnumType(ParticipantKind) -proto3.util.setEnumType(ParticipantKind, "livekit.proto.ParticipantKind", [ - { no: 0, name: "PARTICIPANT_KIND_STANDARD" }, - { no: 1, name: "PARTICIPANT_KIND_INGRESS" }, - { no: 2, name: "PARTICIPANT_KIND_EGRESS" }, - { no: 3, name: "PARTICIPANT_KIND_SIP" }, - { no: 4, name: "PARTICIPANT_KIND_AGENT" }, -]); + attributes: { [key: string]: string }; -/** - * @generated from message livekit.proto.ParticipantInfo - */ -export class ParticipantInfo extends Message { /** - * @generated from field: string sid = 1; + * @generated from field: required livekit.proto.ParticipantKind kind = 6; */ - sid = ""; + kind: ParticipantKind; +}; + +/** + * Describes the message livekit.proto.ParticipantInfo. + * Use `create(ParticipantInfoSchema)` to create a new message. + */ +export const ParticipantInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_participant, 0); +/** + * @generated from message livekit.proto.OwnedParticipant + */ +export type OwnedParticipant = Message<"livekit.proto.OwnedParticipant"> & { /** - * @generated from field: string name = 2; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ - name = ""; + handle?: FfiOwnedHandle; /** - * @generated from field: string identity = 3; + * @generated from field: required livekit.proto.ParticipantInfo info = 2; */ - identity = ""; + info?: ParticipantInfo; +}; +/** + * Describes the message livekit.proto.OwnedParticipant. + * Use `create(OwnedParticipantSchema)` to create a new message. + */ +export const OwnedParticipantSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_participant, 1); + +/** + * @generated from enum livekit.proto.ParticipantKind + */ +export enum ParticipantKind { /** - * @generated from field: string metadata = 4; + * @generated from enum value: PARTICIPANT_KIND_STANDARD = 0; */ - metadata = ""; + STANDARD = 0, /** - * @generated from field: map attributes = 5; + * @generated from enum value: PARTICIPANT_KIND_INGRESS = 1; */ - attributes: { [key: string]: string } = {}; + INGRESS = 1, /** - * @generated from field: livekit.proto.ParticipantKind kind = 6; + * @generated from enum value: PARTICIPANT_KIND_EGRESS = 2; */ - kind = ParticipantKind.STANDARD; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ParticipantInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { 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 */} }, - { no: 6, name: "kind", kind: "enum", T: proto3.getEnumType(ParticipantKind) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantInfo { - return new ParticipantInfo().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ParticipantInfo { - return new ParticipantInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ParticipantInfo { - return new ParticipantInfo().fromJsonString(jsonString, options); - } - - static equals(a: ParticipantInfo | PlainMessage | undefined, b: ParticipantInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantInfo, a, b); - } -} + EGRESS = 2, -/** - * @generated from message livekit.proto.OwnedParticipant - */ -export class OwnedParticipant extends Message { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from enum value: PARTICIPANT_KIND_SIP = 3; */ - handle?: FfiOwnedHandle; + SIP = 3, /** - * @generated from field: livekit.proto.ParticipantInfo info = 2; + * @generated from enum value: PARTICIPANT_KIND_AGENT = 4; */ - info?: ParticipantInfo; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedParticipant"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: ParticipantInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedParticipant { - return new OwnedParticipant().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedParticipant { - return new OwnedParticipant().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedParticipant { - return new OwnedParticipant().fromJsonString(jsonString, options); - } - - static equals(a: OwnedParticipant | PlainMessage | undefined, b: OwnedParticipant | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedParticipant, a, b); - } + AGENT = 4, } +/** + * Describes the enum livekit.proto.ParticipantKind. + */ +export const ParticipantKindSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_participant, 0); + diff --git a/packages/livekit-rtc/src/proto/room_pb.ts b/packages/livekit-rtc/src/proto/room_pb.ts index 219f431c..a415ec5c 100644 --- a/packages/livekit-rtc/src/proto/room_pb.ts +++ b/packages/livekit-rtc/src/proto/room_pb.ts @@ -12,2305 +12,1225 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file room.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file room.proto (package livekit.proto, syntax proto2) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; -import { OwnedParticipant } from "./participant_pb.js"; -import { OwnedTrack, OwnedTrackPublication, TrackSource } from "./track_pb.js"; -import { RtcStats } from "./stats_pb.js"; -import { VideoCodec } from "./video_frame_pb.js"; -import { E2eeOptions, EncryptionState } from "./e2ee_pb.js"; -import { FfiOwnedHandle } from "./handle_pb.js"; +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { E2eeOptions, EncryptionState } from "./e2ee_pb"; +import { file_e2ee } from "./e2ee_pb"; +import type { FfiOwnedHandle } from "./handle_pb"; +import { file_handle } from "./handle_pb"; +import type { OwnedParticipant } from "./participant_pb"; +import { file_participant } from "./participant_pb"; +import type { OwnedTrack, OwnedTrackPublication, TrackSource } from "./track_pb"; +import { file_track } from "./track_pb"; +import type { VideoCodec } from "./video_frame_pb"; +import { file_video_frame } from "./video_frame_pb"; +import type { RtcStats } from "./stats_pb"; +import { file_stats } from "./stats_pb"; +import type { Message } from "@bufbuild/protobuf"; /** - * @generated from enum livekit.proto.IceTransportType + * Describes the file room.proto. */ -export enum IceTransportType { +export const file_room: GenFile = /*@__PURE__*/ + fileDesc("Cgpyb29tLnByb3RvEg1saXZla2l0LnByb3RvIlkKDkNvbm5lY3RSZXF1ZXN0EgsKA3VybBgBIAIoCRINCgV0b2tlbhgCIAIoCRIrCgdvcHRpb25zGAMgAigLMhoubGl2ZWtpdC5wcm90by5Sb29tT3B0aW9ucyIjCg9Db25uZWN0UmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQivwMKD0Nvbm5lY3RDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgVlcnJvchgCIAEoCUgAEjcKBnJlc3VsdBgDIAEoCzIlLmxpdmVraXQucHJvdG8uQ29ubmVjdENhbGxiYWNrLlJlc3VsdEgAGokBChVQYXJ0aWNpcGFudFdpdGhUcmFja3MSNAoLcGFydGljaXBhbnQYASACKAsyHy5saXZla2l0LnByb3RvLk93bmVkUGFydGljaXBhbnQSOgoMcHVibGljYXRpb25zGAIgAygLMiQubGl2ZWtpdC5wcm90by5Pd25lZFRyYWNrUHVibGljYXRpb24auAEKBlJlc3VsdBImCgRyb29tGAEgAigLMhgubGl2ZWtpdC5wcm90by5Pd25lZFJvb20SOgoRbG9jYWxfcGFydGljaXBhbnQYAiACKAsyHy5saXZla2l0LnByb3RvLk93bmVkUGFydGljaXBhbnQSSgoMcGFydGljaXBhbnRzGAMgAygLMjQubGl2ZWtpdC5wcm90by5Db25uZWN0Q2FsbGJhY2suUGFydGljaXBhbnRXaXRoVHJhY2tzQgkKB21lc3NhZ2UiKAoRRGlzY29ubmVjdFJlcXVlc3QSEwoLcm9vbV9oYW5kbGUYASACKAQiJgoSRGlzY29ubmVjdFJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIiYKEkRpc2Nvbm5lY3RDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBCKCAQoTUHVibGlzaFRyYWNrUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSFAoMdHJhY2tfaGFuZGxlGAIgAigEEjMKB29wdGlvbnMYAyACKAsyIi5saXZla2l0LnByb3RvLlRyYWNrUHVibGlzaE9wdGlvbnMiKAoUUHVibGlzaFRyYWNrUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQigQEKFFB1Ymxpc2hUcmFja0NhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEEg8KBWVycm9yGAIgASgJSAASOwoLcHVibGljYXRpb24YAyABKAsyJC5saXZla2l0LnByb3RvLk93bmVkVHJhY2tQdWJsaWNhdGlvbkgAQgkKB21lc3NhZ2UiZwoVVW5wdWJsaXNoVHJhY2tSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIRCgl0cmFja19zaWQYAiACKAkSGQoRc3RvcF9vbl91bnB1Ymxpc2gYAyACKAgiKgoWVW5wdWJsaXNoVHJhY2tSZXNwb25zZRIQCghhc3luY19pZBgBIAIoBCI5ChZVbnB1Ymxpc2hUcmFja0NhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEEg0KBWVycm9yGAIgASgJIrkBChJQdWJsaXNoRGF0YVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhAKCGRhdGFfcHRyGAIgAigEEhAKCGRhdGFfbGVuGAMgAigEEhAKCHJlbGlhYmxlGAQgAigIEhwKEGRlc3RpbmF0aW9uX3NpZHMYBSADKAlCAhgBEg0KBXRvcGljGAYgASgJEh4KFmRlc3RpbmF0aW9uX2lkZW50aXRpZXMYByADKAkiJwoTUHVibGlzaERhdGFSZXNwb25zZRIQCghhc3luY19pZBgBIAIoBCI2ChNQdWJsaXNoRGF0YUNhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEEg0KBWVycm9yGAIgASgJIqYBChtQdWJsaXNoVHJhbnNjcmlwdGlvblJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAIgAigJEhAKCHRyYWNrX2lkGAMgAigJEjUKCHNlZ21lbnRzGAQgAygLMiMubGl2ZWtpdC5wcm90by5UcmFuc2NyaXB0aW9uU2VnbWVudCIwChxQdWJsaXNoVHJhbnNjcmlwdGlvblJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIj8KHFB1Ymxpc2hUcmFuc2NyaXB0aW9uQ2FsbGJhY2sSEAoIYXN5bmNfaWQYASACKAQSDQoFZXJyb3IYAiABKAkidgoVUHVibGlzaFNpcER0bWZSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIMCgRjb2RlGAIgAigNEg0KBWRpZ2l0GAMgAigJEh4KFmRlc3RpbmF0aW9uX2lkZW50aXRpZXMYBCADKAkiKgoWUHVibGlzaFNpcER0bWZSZXNwb25zZRIQCghhc3luY19pZBgBIAIoBCI5ChZQdWJsaXNoU2lwRHRtZkNhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEEg0KBWVycm9yGAIgASgJIk0KF1NldExvY2FsTWV0YWRhdGFSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIQCghtZXRhZGF0YRgCIAIoCSIsChhTZXRMb2NhbE1ldGFkYXRhUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQiOwoYU2V0TG9jYWxNZXRhZGF0YUNhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEEg0KBWVycm9yGAIgASgJIoQBChZTZW5kQ2hhdE1lc3NhZ2VSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIPCgdtZXNzYWdlGAIgAigJEh4KFmRlc3RpbmF0aW9uX2lkZW50aXRpZXMYAyADKAkSFwoPc2VuZGVyX2lkZW50aXR5GAQgASgJIrwBChZFZGl0Q2hhdE1lc3NhZ2VSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIRCgllZGl0X3RleHQYAiACKAkSNAoQb3JpZ2luYWxfbWVzc2FnZRgDIAIoCzIaLmxpdmVraXQucHJvdG8uQ2hhdE1lc3NhZ2USHgoWZGVzdGluYXRpb25faWRlbnRpdGllcxgEIAMoCRIXCg9zZW5kZXJfaWRlbnRpdHkYBSABKAkiKwoXU2VuZENoYXRNZXNzYWdlUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQiewoXU2VuZENoYXRNZXNzYWdlQ2FsbGJhY2sSEAoIYXN5bmNfaWQYASACKAQSDwoFZXJyb3IYAiABKAlIABIyCgxjaGF0X21lc3NhZ2UYAyABKAsyGi5saXZla2l0LnByb3RvLkNoYXRNZXNzYWdlSABCCQoHbWVzc2FnZSJxChlTZXRMb2NhbEF0dHJpYnV0ZXNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIyCgphdHRyaWJ1dGVzGAIgAygLMh4ubGl2ZWtpdC5wcm90by5BdHRyaWJ1dGVzRW50cnkiLQoPQXR0cmlidXRlc0VudHJ5EgsKA2tleRgBIAIoCRINCgV2YWx1ZRgCIAIoCSIuChpTZXRMb2NhbEF0dHJpYnV0ZXNSZXNwb25zZRIQCghhc3luY19pZBgBIAIoBCI9ChpTZXRMb2NhbEF0dHJpYnV0ZXNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBINCgVlcnJvchgCIAEoCSJFChNTZXRMb2NhbE5hbWVSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIMCgRuYW1lGAIgAigJIigKFFNldExvY2FsTmFtZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIjcKFFNldExvY2FsTmFtZUNhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEEg0KBWVycm9yGAIgASgJIkUKFFNldFN1YnNjcmliZWRSZXF1ZXN0EhEKCXN1YnNjcmliZRgBIAIoCBIaChJwdWJsaWNhdGlvbl9oYW5kbGUYAiACKAQiFwoVU2V0U3Vic2NyaWJlZFJlc3BvbnNlIi0KFkdldFNlc3Npb25TdGF0c1JlcXVlc3QSEwoLcm9vbV9oYW5kbGUYASACKAQiKwoXR2V0U2Vzc2lvblN0YXRzUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQi9wEKF0dldFNlc3Npb25TdGF0c0NhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEEg8KBWVycm9yGAIgASgJSAASPwoGcmVzdWx0GAMgASgLMi0ubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNDYWxsYmFjay5SZXN1bHRIABptCgZSZXN1bHQSMAoPcHVibGlzaGVyX3N0YXRzGAEgAygLMhcubGl2ZWtpdC5wcm90by5SdGNTdGF0cxIxChBzdWJzY3JpYmVyX3N0YXRzGAIgAygLMhcubGl2ZWtpdC5wcm90by5SdGNTdGF0c0IJCgdtZXNzYWdlIjsKDVZpZGVvRW5jb2RpbmcSEwoLbWF4X2JpdHJhdGUYASACKAQSFQoNbWF4X2ZyYW1lcmF0ZRgCIAIoASIkCg1BdWRpb0VuY29kaW5nEhMKC21heF9iaXRyYXRlGAEgAigEIpoCChNUcmFja1B1Ymxpc2hPcHRpb25zEjQKDnZpZGVvX2VuY29kaW5nGAEgASgLMhwubGl2ZWtpdC5wcm90by5WaWRlb0VuY29kaW5nEjQKDmF1ZGlvX2VuY29kaW5nGAIgASgLMhwubGl2ZWtpdC5wcm90by5BdWRpb0VuY29kaW5nEi4KC3ZpZGVvX2NvZGVjGAMgAigOMhkubGl2ZWtpdC5wcm90by5WaWRlb0NvZGVjEgsKA2R0eBgEIAIoCBILCgNyZWQYBSACKAgSEQoJc2ltdWxjYXN0GAYgAigIEioKBnNvdXJjZRgHIAIoDjIaLmxpdmVraXQucHJvdG8uVHJhY2tTb3VyY2USDgoGc3RyZWFtGAggAigJIj0KCUljZVNlcnZlchIMCgR1cmxzGAEgAygJEhAKCHVzZXJuYW1lGAIgASgJEhAKCHBhc3N3b3JkGAMgASgJIsQBCglSdGNDb25maWcSOwoSaWNlX3RyYW5zcG9ydF90eXBlGAEgASgOMh8ubGl2ZWtpdC5wcm90by5JY2VUcmFuc3BvcnRUeXBlEksKGmNvbnRpbnVhbF9nYXRoZXJpbmdfcG9saWN5GAIgASgOMicubGl2ZWtpdC5wcm90by5Db250aW51YWxHYXRoZXJpbmdQb2xpY3kSLQoLaWNlX3NlcnZlcnMYAyADKAsyGC5saXZla2l0LnByb3RvLkljZVNlcnZlciK+AQoLUm9vbU9wdGlvbnMSFgoOYXV0b19zdWJzY3JpYmUYASACKAgSFwoPYWRhcHRpdmVfc3RyZWFtGAIgAigIEhAKCGR5bmFjYXN0GAMgAigIEigKBGUyZWUYBCABKAsyGi5saXZla2l0LnByb3RvLkUyZWVPcHRpb25zEiwKCnJ0Y19jb25maWcYBSABKAsyGC5saXZla2l0LnByb3RvLlJ0Y0NvbmZpZxIUCgxqb2luX3JldHJpZXMYBiACKA0idwoUVHJhbnNjcmlwdGlvblNlZ21lbnQSCgoCaWQYASACKAkSDAoEdGV4dBgCIAIoCRISCgpzdGFydF90aW1lGAMgAigEEhAKCGVuZF90aW1lGAQgAigEEg0KBWZpbmFsGAUgAigIEhAKCGxhbmd1YWdlGAYgAigJIjAKCkJ1ZmZlckluZm8SEAoIZGF0YV9wdHIYASACKAQSEAoIZGF0YV9sZW4YAiACKAQiZQoLT3duZWRCdWZmZXISLQoGaGFuZGxlGAEgAigLMh0ubGl2ZWtpdC5wcm90by5GZmlPd25lZEhhbmRsZRInCgRkYXRhGAIgAigLMhkubGl2ZWtpdC5wcm90by5CdWZmZXJJbmZvIt0OCglSb29tRXZlbnQSEwoLcm9vbV9oYW5kbGUYASACKAQSRAoVcGFydGljaXBhbnRfY29ubmVjdGVkGAIgASgLMiMubGl2ZWtpdC5wcm90by5QYXJ0aWNpcGFudENvbm5lY3RlZEgAEkoKGHBhcnRpY2lwYW50X2Rpc2Nvbm5lY3RlZBgDIAEoCzImLmxpdmVraXQucHJvdG8uUGFydGljaXBhbnREaXNjb25uZWN0ZWRIABJDChVsb2NhbF90cmFja19wdWJsaXNoZWQYBCABKAsyIi5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tQdWJsaXNoZWRIABJHChdsb2NhbF90cmFja191bnB1Ymxpc2hlZBgFIAEoCzIkLmxpdmVraXQucHJvdG8uTG9jYWxUcmFja1VucHVibGlzaGVkSAASRQoWbG9jYWxfdHJhY2tfc3Vic2NyaWJlZBgGIAEoCzIjLmxpdmVraXQucHJvdG8uTG9jYWxUcmFja1N1YnNjcmliZWRIABI4Cg90cmFja19wdWJsaXNoZWQYByABKAsyHS5saXZla2l0LnByb3RvLlRyYWNrUHVibGlzaGVkSAASPAoRdHJhY2tfdW5wdWJsaXNoZWQYCCABKAsyHy5saXZla2l0LnByb3RvLlRyYWNrVW5wdWJsaXNoZWRIABI6ChB0cmFja19zdWJzY3JpYmVkGAkgASgLMh4ubGl2ZWtpdC5wcm90by5UcmFja1N1YnNjcmliZWRIABI+ChJ0cmFja191bnN1YnNjcmliZWQYCiABKAsyIC5saXZla2l0LnByb3RvLlRyYWNrVW5zdWJzY3JpYmVkSAASSwoZdHJhY2tfc3Vic2NyaXB0aW9uX2ZhaWxlZBgLIAEoCzImLmxpdmVraXQucHJvdG8uVHJhY2tTdWJzY3JpcHRpb25GYWlsZWRIABIwCgt0cmFja19tdXRlZBgMIAEoCzIZLmxpdmVraXQucHJvdG8uVHJhY2tNdXRlZEgAEjQKDXRyYWNrX3VubXV0ZWQYDSABKAsyGy5saXZla2l0LnByb3RvLlRyYWNrVW5tdXRlZEgAEkcKF2FjdGl2ZV9zcGVha2Vyc19jaGFuZ2VkGA4gASgLMiQubGl2ZWtpdC5wcm90by5BY3RpdmVTcGVha2Vyc0NoYW5nZWRIABJDChVyb29tX21ldGFkYXRhX2NoYW5nZWQYDyABKAsyIi5saXZla2l0LnByb3RvLlJvb21NZXRhZGF0YUNoYW5nZWRIABI5ChByb29tX3NpZF9jaGFuZ2VkGBAgASgLMh0ubGl2ZWtpdC5wcm90by5Sb29tU2lkQ2hhbmdlZEgAElEKHHBhcnRpY2lwYW50X21ldGFkYXRhX2NoYW5nZWQYESABKAsyKS5saXZla2l0LnByb3RvLlBhcnRpY2lwYW50TWV0YWRhdGFDaGFuZ2VkSAASSQoYcGFydGljaXBhbnRfbmFtZV9jaGFuZ2VkGBIgASgLMiUubGl2ZWtpdC5wcm90by5QYXJ0aWNpcGFudE5hbWVDaGFuZ2VkSAASVQoecGFydGljaXBhbnRfYXR0cmlidXRlc19jaGFuZ2VkGBMgASgLMisubGl2ZWtpdC5wcm90by5QYXJ0aWNpcGFudEF0dHJpYnV0ZXNDaGFuZ2VkSAASTQoaY29ubmVjdGlvbl9xdWFsaXR5X2NoYW5nZWQYFCABKAsyJy5saXZla2l0LnByb3RvLkNvbm5lY3Rpb25RdWFsaXR5Q2hhbmdlZEgAEkkKGGNvbm5lY3Rpb25fc3RhdGVfY2hhbmdlZBgVIAEoCzIlLmxpdmVraXQucHJvdG8uQ29ubmVjdGlvblN0YXRlQ2hhbmdlZEgAEjMKDGRpc2Nvbm5lY3RlZBgWIAEoCzIbLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdGVkSAASMwoMcmVjb25uZWN0aW5nGBcgASgLMhsubGl2ZWtpdC5wcm90by5SZWNvbm5lY3RpbmdIABIxCgtyZWNvbm5lY3RlZBgYIAEoCzIaLmxpdmVraXQucHJvdG8uUmVjb25uZWN0ZWRIABI9ChJlMmVlX3N0YXRlX2NoYW5nZWQYGSABKAsyHy5saXZla2l0LnByb3RvLkUyZWVTdGF0ZUNoYW5nZWRIABIlCgNlb3MYGiABKAsyFi5saXZla2l0LnByb3RvLlJvb21FT1NIABJBChRkYXRhX3BhY2tldF9yZWNlaXZlZBgbIAEoCzIhLmxpdmVraXQucHJvdG8uRGF0YVBhY2tldFJlY2VpdmVkSAASRgoWdHJhbnNjcmlwdGlvbl9yZWNlaXZlZBgcIAEoCzIkLmxpdmVraXQucHJvdG8uVHJhbnNjcmlwdGlvblJlY2VpdmVkSAASOgoMY2hhdF9tZXNzYWdlGB0gASgLMiIubGl2ZWtpdC5wcm90by5DaGF0TWVzc2FnZVJlY2VpdmVkSABCCQoHbWVzc2FnZSI3CghSb29tSW5mbxILCgNzaWQYASABKAkSDAoEbmFtZRgCIAIoCRIQCghtZXRhZGF0YRgDIAIoCSJhCglPd25lZFJvb20SLQoGaGFuZGxlGAEgAigLMh0ubGl2ZWtpdC5wcm90by5GZmlPd25lZEhhbmRsZRIlCgRpbmZvGAIgAigLMhcubGl2ZWtpdC5wcm90by5Sb29tSW5mbyJFChRQYXJ0aWNpcGFudENvbm5lY3RlZBItCgRpbmZvGAEgAigLMh8ubGl2ZWtpdC5wcm90by5Pd25lZFBhcnRpY2lwYW50IjcKF1BhcnRpY2lwYW50RGlzY29ubmVjdGVkEhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAEgAigJIigKE0xvY2FsVHJhY2tQdWJsaXNoZWQSEQoJdHJhY2tfc2lkGAEgAigJIjAKFUxvY2FsVHJhY2tVbnB1Ymxpc2hlZBIXCg9wdWJsaWNhdGlvbl9zaWQYASACKAkiKQoUTG9jYWxUcmFja1N1YnNjcmliZWQSEQoJdHJhY2tfc2lkGAIgAigJImkKDlRyYWNrUHVibGlzaGVkEhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAEgAigJEjkKC3B1YmxpY2F0aW9uGAIgAigLMiQubGl2ZWtpdC5wcm90by5Pd25lZFRyYWNrUHVibGljYXRpb24iSQoQVHJhY2tVbnB1Ymxpc2hlZBIcChRwYXJ0aWNpcGFudF9pZGVudGl0eRgBIAIoCRIXCg9wdWJsaWNhdGlvbl9zaWQYAiACKAkiWQoPVHJhY2tTdWJzY3JpYmVkEhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAEgAigJEigKBXRyYWNrGAIgAigLMhkubGl2ZWtpdC5wcm90by5Pd25lZFRyYWNrIkQKEVRyYWNrVW5zdWJzY3JpYmVkEhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAEgAigJEhEKCXRyYWNrX3NpZBgCIAIoCSJZChdUcmFja1N1YnNjcmlwdGlvbkZhaWxlZBIcChRwYXJ0aWNpcGFudF9pZGVudGl0eRgBIAIoCRIRCgl0cmFja19zaWQYAiACKAkSDQoFZXJyb3IYAyACKAkiPQoKVHJhY2tNdXRlZBIcChRwYXJ0aWNpcGFudF9pZGVudGl0eRgBIAIoCRIRCgl0cmFja19zaWQYAiACKAkiPwoMVHJhY2tVbm11dGVkEhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAEgAigJEhEKCXRyYWNrX3NpZBgCIAIoCSJfChBFMmVlU3RhdGVDaGFuZ2VkEhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAEgAigJEi0KBXN0YXRlGAIgAigOMh4ubGl2ZWtpdC5wcm90by5FbmNyeXB0aW9uU3RhdGUiNwoVQWN0aXZlU3BlYWtlcnNDaGFuZ2VkEh4KFnBhcnRpY2lwYW50X2lkZW50aXRpZXMYASADKAkiJwoTUm9vbU1ldGFkYXRhQ2hhbmdlZBIQCghtZXRhZGF0YRgBIAIoCSIdCg5Sb29tU2lkQ2hhbmdlZBILCgNzaWQYASACKAkiTAoaUGFydGljaXBhbnRNZXRhZGF0YUNoYW5nZWQSHAoUcGFydGljaXBhbnRfaWRlbnRpdHkYASACKAkSEAoIbWV0YWRhdGEYAiACKAkirAEKHFBhcnRpY2lwYW50QXR0cmlidXRlc0NoYW5nZWQSHAoUcGFydGljaXBhbnRfaWRlbnRpdHkYASACKAkSMgoKYXR0cmlidXRlcxgCIAMoCzIeLmxpdmVraXQucHJvdG8uQXR0cmlidXRlc0VudHJ5EjoKEmNoYW5nZWRfYXR0cmlidXRlcxgDIAMoCzIeLmxpdmVraXQucHJvdG8uQXR0cmlidXRlc0VudHJ5IkQKFlBhcnRpY2lwYW50TmFtZUNoYW5nZWQSHAoUcGFydGljaXBhbnRfaWRlbnRpdHkYASACKAkSDAoEbmFtZRgCIAIoCSJrChhDb25uZWN0aW9uUXVhbGl0eUNoYW5nZWQSHAoUcGFydGljaXBhbnRfaWRlbnRpdHkYASACKAkSMQoHcXVhbGl0eRgCIAIoDjIgLmxpdmVraXQucHJvdG8uQ29ubmVjdGlvblF1YWxpdHkiRQoKVXNlclBhY2tldBIoCgRkYXRhGAEgAigLMhoubGl2ZWtpdC5wcm90by5Pd25lZEJ1ZmZlchINCgV0b3BpYxgCIAEoCSJ5CgtDaGF0TWVzc2FnZRIKCgJpZBgBIAIoCRIRCgl0aW1lc3RhbXAYAiACKAMSDwoHbWVzc2FnZRgDIAIoCRIWCg5lZGl0X3RpbWVzdGFtcBgEIAEoAxIPCgdkZWxldGVkGAUgASgIEhEKCWdlbmVyYXRlZBgGIAEoCCJgChNDaGF0TWVzc2FnZVJlY2VpdmVkEisKB21lc3NhZ2UYASACKAsyGi5saXZla2l0LnByb3RvLkNoYXRNZXNzYWdlEhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAIgAigJIiYKB1NpcERUTUYSDAoEY29kZRgBIAIoDRINCgVkaWdpdBgCIAEoCSK/AQoSRGF0YVBhY2tldFJlY2VpdmVkEisKBGtpbmQYASACKA4yHS5saXZla2l0LnByb3RvLkRhdGFQYWNrZXRLaW5kEhwKFHBhcnRpY2lwYW50X2lkZW50aXR5GAIgAigJEikKBHVzZXIYBCABKAsyGS5saXZla2l0LnByb3RvLlVzZXJQYWNrZXRIABIqCghzaXBfZHRtZhgFIAEoCzIWLmxpdmVraXQucHJvdG8uU2lwRFRNRkgAQgcKBXZhbHVlIn8KFVRyYW5zY3JpcHRpb25SZWNlaXZlZBIcChRwYXJ0aWNpcGFudF9pZGVudGl0eRgBIAEoCRIRCgl0cmFja19zaWQYAiABKAkSNQoIc2VnbWVudHMYAyADKAsyIy5saXZla2l0LnByb3RvLlRyYW5zY3JpcHRpb25TZWdtZW50IkcKFkNvbm5lY3Rpb25TdGF0ZUNoYW5nZWQSLQoFc3RhdGUYASACKA4yHi5saXZla2l0LnByb3RvLkNvbm5lY3Rpb25TdGF0ZSILCglDb25uZWN0ZWQiPwoMRGlzY29ubmVjdGVkEi8KBnJlYXNvbhgBIAIoDjIfLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdFJlYXNvbiIOCgxSZWNvbm5lY3RpbmciDQoLUmVjb25uZWN0ZWQiCQoHUm9vbUVPUypQChBJY2VUcmFuc3BvcnRUeXBlEhMKD1RSQU5TUE9SVF9SRUxBWRAAEhQKEFRSQU5TUE9SVF9OT0hPU1QQARIRCg1UUkFOU1BPUlRfQUxMEAIqQwoYQ29udGludWFsR2F0aGVyaW5nUG9saWN5Eg8KC0dBVEhFUl9PTkNFEAASFgoSR0FUSEVSX0NPTlRJTlVBTExZEAEqYAoRQ29ubmVjdGlvblF1YWxpdHkSEAoMUVVBTElUWV9QT09SEAASEAoMUVVBTElUWV9HT09EEAESFQoRUVVBTElUWV9FWENFTExFTlQQAhIQCgxRVUFMSVRZX0xPU1QQAypTCg9Db25uZWN0aW9uU3RhdGUSFQoRQ09OTl9ESVNDT05ORUNURUQQABISCg5DT05OX0NPTk5FQ1RFRBABEhUKEUNPTk5fUkVDT05ORUNUSU5HEAIqMwoORGF0YVBhY2tldEtpbmQSDgoKS0lORF9MT1NTWRAAEhEKDUtJTkRfUkVMSUFCTEUQASrsAQoQRGlzY29ubmVjdFJlYXNvbhISCg5VTktOT1dOX1JFQVNPThAAEhQKEENMSUVOVF9JTklUSUFURUQQARIWChJEVVBMSUNBVEVfSURFTlRJVFkQAhITCg9TRVJWRVJfU0hVVERPV04QAxIXChNQQVJUSUNJUEFOVF9SRU1PVkVEEAQSEAoMUk9PTV9ERUxFVEVEEAUSEgoOU1RBVEVfTUlTTUFUQ0gQBhIQCgxKT0lOX0ZBSUxVUkUQBxINCglNSUdSQVRJT04QCBIQCgxTSUdOQUxfQ0xPU0UQCRIPCgtST09NX0NMT1NFRBAKQhCqAg1MaXZlS2l0LlByb3Rv", [file_e2ee, file_handle, file_participant, file_track, file_video_frame, file_stats]); + +/** + * Connect to a new LiveKit room + * + * @generated from message livekit.proto.ConnectRequest + */ +export type ConnectRequest = Message<"livekit.proto.ConnectRequest"> & { /** - * @generated from enum value: TRANSPORT_RELAY = 0; + * @generated from field: required string url = 1; */ - TRANSPORT_RELAY = 0, + url: string; /** - * @generated from enum value: TRANSPORT_NOHOST = 1; + * @generated from field: required string token = 2; */ - TRANSPORT_NOHOST = 1, + token: string; /** - * @generated from enum value: TRANSPORT_ALL = 2; + * @generated from field: required livekit.proto.RoomOptions options = 3; */ - TRANSPORT_ALL = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(IceTransportType) -proto3.util.setEnumType(IceTransportType, "livekit.proto.IceTransportType", [ - { no: 0, name: "TRANSPORT_RELAY" }, - { no: 1, name: "TRANSPORT_NOHOST" }, - { no: 2, name: "TRANSPORT_ALL" }, -]); + options?: RoomOptions; +}; /** - * @generated from enum livekit.proto.ContinualGatheringPolicy + * Describes the message livekit.proto.ConnectRequest. + * Use `create(ConnectRequestSchema)` to create a new message. */ -export enum ContinualGatheringPolicy { - /** - * @generated from enum value: GATHER_ONCE = 0; - */ - GATHER_ONCE = 0, - - /** - * @generated from enum value: GATHER_CONTINUALLY = 1; - */ - GATHER_CONTINUALLY = 1, -} -// Retrieve enum metadata with: proto3.getEnumType(ContinualGatheringPolicy) -proto3.util.setEnumType(ContinualGatheringPolicy, "livekit.proto.ContinualGatheringPolicy", [ - { no: 0, name: "GATHER_ONCE" }, - { no: 1, name: "GATHER_CONTINUALLY" }, -]); +export const ConnectRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 0); /** - * @generated from enum livekit.proto.ConnectionQuality + * @generated from message livekit.proto.ConnectResponse */ -export enum ConnectionQuality { +export type ConnectResponse = Message<"livekit.proto.ConnectResponse"> & { /** - * @generated from enum value: QUALITY_POOR = 0; + * @generated from field: required uint64 async_id = 1; */ - QUALITY_POOR = 0, - - /** - * @generated from enum value: QUALITY_GOOD = 1; - */ - QUALITY_GOOD = 1, - - /** - * @generated from enum value: QUALITY_EXCELLENT = 2; - */ - QUALITY_EXCELLENT = 2, - - /** - * @generated from enum value: QUALITY_LOST = 3; - */ - QUALITY_LOST = 3, -} -// Retrieve enum metadata with: proto3.getEnumType(ConnectionQuality) -proto3.util.setEnumType(ConnectionQuality, "livekit.proto.ConnectionQuality", [ - { no: 0, name: "QUALITY_POOR" }, - { no: 1, name: "QUALITY_GOOD" }, - { no: 2, name: "QUALITY_EXCELLENT" }, - { no: 3, name: "QUALITY_LOST" }, -]); + asyncId: bigint; +}; /** - * @generated from enum livekit.proto.ConnectionState + * Describes the message livekit.proto.ConnectResponse. + * Use `create(ConnectResponseSchema)` to create a new message. */ -export enum ConnectionState { - /** - * @generated from enum value: CONN_DISCONNECTED = 0; - */ - CONN_DISCONNECTED = 0, - - /** - * @generated from enum value: CONN_CONNECTED = 1; - */ - CONN_CONNECTED = 1, - - /** - * @generated from enum value: CONN_RECONNECTING = 2; - */ - CONN_RECONNECTING = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(ConnectionState) -proto3.util.setEnumType(ConnectionState, "livekit.proto.ConnectionState", [ - { no: 0, name: "CONN_DISCONNECTED" }, - { no: 1, name: "CONN_CONNECTED" }, - { no: 2, name: "CONN_RECONNECTING" }, -]); +export const ConnectResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 1); /** - * @generated from enum livekit.proto.DataPacketKind + * @generated from message livekit.proto.ConnectCallback */ -export enum DataPacketKind { +export type ConnectCallback = Message<"livekit.proto.ConnectCallback"> & { /** - * @generated from enum value: KIND_LOSSY = 0; + * @generated from field: required uint64 async_id = 1; */ - KIND_LOSSY = 0, + asyncId: bigint; /** - * @generated from enum value: KIND_RELIABLE = 1; + * @generated from oneof livekit.proto.ConnectCallback.message */ - KIND_RELIABLE = 1, -} -// Retrieve enum metadata with: proto3.getEnumType(DataPacketKind) -proto3.util.setEnumType(DataPacketKind, "livekit.proto.DataPacketKind", [ - { no: 0, name: "KIND_LOSSY" }, - { no: 1, name: "KIND_RELIABLE" }, -]); + message: { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.ConnectCallback.Result result = 3; + */ + value: ConnectCallback_Result; + case: "result"; + } | { case: undefined; value?: undefined }; +}; /** - * @generated from enum livekit.proto.DisconnectReason + * Describes the message livekit.proto.ConnectCallback. + * Use `create(ConnectCallbackSchema)` to create a new message. */ -export enum DisconnectReason { - /** - * @generated from enum value: UNKNOWN_REASON = 0; - */ - UNKNOWN_REASON = 0, - - /** - * the client initiated the disconnect - * - * @generated from enum value: CLIENT_INITIATED = 1; - */ - CLIENT_INITIATED = 1, - - /** - * another participant with the same identity has joined the room - * - * @generated from enum value: DUPLICATE_IDENTITY = 2; - */ - DUPLICATE_IDENTITY = 2, - - /** - * the server instance is shutting down - * - * @generated from enum value: SERVER_SHUTDOWN = 3; - */ - SERVER_SHUTDOWN = 3, - - /** - * RoomService.RemoveParticipant was called - * - * @generated from enum value: PARTICIPANT_REMOVED = 4; - */ - PARTICIPANT_REMOVED = 4, - - /** - * RoomService.DeleteRoom was called - * - * @generated from enum value: ROOM_DELETED = 5; - */ - ROOM_DELETED = 5, - - /** - * the client is attempting to resume a session, but server is not aware of it - * - * @generated from enum value: STATE_MISMATCH = 6; - */ - STATE_MISMATCH = 6, - - /** - * client was unable to connect fully - * - * @generated from enum value: JOIN_FAILURE = 7; - */ - JOIN_FAILURE = 7, - - /** - * Cloud-only, the server requested Participant to migrate the connection elsewhere - * - * @generated from enum value: MIGRATION = 8; - */ - MIGRATION = 8, - - /** - * the signal websocket was closed unexpectedly - * - * @generated from enum value: SIGNAL_CLOSE = 9; - */ - SIGNAL_CLOSE = 9, - - /** - * the room was closed, due to all Standard and Ingress participants having left - * - * @generated from enum value: ROOM_CLOSED = 10; - */ - ROOM_CLOSED = 10, -} -// Retrieve enum metadata with: proto3.getEnumType(DisconnectReason) -proto3.util.setEnumType(DisconnectReason, "livekit.proto.DisconnectReason", [ - { no: 0, name: "UNKNOWN_REASON" }, - { no: 1, name: "CLIENT_INITIATED" }, - { no: 2, name: "DUPLICATE_IDENTITY" }, - { no: 3, name: "SERVER_SHUTDOWN" }, - { no: 4, name: "PARTICIPANT_REMOVED" }, - { no: 5, name: "ROOM_DELETED" }, - { no: 6, name: "STATE_MISMATCH" }, - { no: 7, name: "JOIN_FAILURE" }, - { no: 8, name: "MIGRATION" }, - { no: 9, name: "SIGNAL_CLOSE" }, - { no: 10, name: "ROOM_CLOSED" }, -]); +export const ConnectCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 2); /** - * Connect to a new LiveKit room - * - * @generated from message livekit.proto.ConnectRequest + * @generated from message livekit.proto.ConnectCallback.ParticipantWithTracks */ -export class ConnectRequest extends Message { +export type ConnectCallback_ParticipantWithTracks = Message<"livekit.proto.ConnectCallback.ParticipantWithTracks"> & { /** - * @generated from field: string url = 1; + * @generated from field: required livekit.proto.OwnedParticipant participant = 1; */ - url = ""; - - /** - * @generated from field: string token = 2; - */ - token = ""; + participant?: OwnedParticipant; /** - * @generated from field: livekit.proto.RoomOptions options = 3; + * TrackInfo are not needed here, if we're subscribed to a track, the FfiServer will send + * a TrackSubscribed event + * + * @generated from field: repeated livekit.proto.OwnedTrackPublication publications = 2; */ - options?: RoomOptions; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ConnectRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "options", kind: "message", T: RoomOptions }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ConnectRequest { - return new ConnectRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ConnectRequest { - return new ConnectRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ConnectRequest { - return new ConnectRequest().fromJsonString(jsonString, options); - } - - static equals(a: ConnectRequest | PlainMessage | undefined, b: ConnectRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectRequest, a, b); - } -} + publications: OwnedTrackPublication[]; +}; /** - * @generated from message livekit.proto.ConnectResponse + * Describes the message livekit.proto.ConnectCallback.ParticipantWithTracks. + * Use `create(ConnectCallback_ParticipantWithTracksSchema)` to create a new message. */ -export class ConnectResponse 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.ConnectResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ConnectResponse { - return new ConnectResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ConnectResponse { - return new ConnectResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ConnectResponse { - return new ConnectResponse().fromJsonString(jsonString, options); - } - - static equals(a: ConnectResponse | PlainMessage | undefined, b: ConnectResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectResponse, a, b); - } -} +export const ConnectCallback_ParticipantWithTracksSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 2, 0); /** - * @generated from message livekit.proto.ConnectCallback + * @generated from message livekit.proto.ConnectCallback.Result */ -export class ConnectCallback extends Message { +export type ConnectCallback_Result = Message<"livekit.proto.ConnectCallback.Result"> & { /** - * @generated from field: uint64 async_id = 1; - */ - asyncId = protoInt64.zero; - - /** - * @generated from field: optional string error = 2; - */ - error?: string; - - /** - * @generated from field: livekit.proto.OwnedRoom room = 3; + * @generated from field: required livekit.proto.OwnedRoom room = 1; */ room?: OwnedRoom; /** - * @generated from field: livekit.proto.OwnedParticipant local_participant = 4; + * @generated from field: required livekit.proto.OwnedParticipant local_participant = 2; */ localParticipant?: OwnedParticipant; /** - * @generated from field: repeated livekit.proto.ConnectCallback.ParticipantWithTracks participants = 5; + * @generated from field: repeated livekit.proto.ConnectCallback.ParticipantWithTracks participants = 3; */ - participants: ConnectCallback_ParticipantWithTracks[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ConnectCallback"; - 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 }, - { no: 3, name: "room", kind: "message", T: OwnedRoom }, - { no: 4, name: "local_participant", kind: "message", T: OwnedParticipant }, - { no: 5, name: "participants", kind: "message", T: ConnectCallback_ParticipantWithTracks, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ConnectCallback { - return new ConnectCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ConnectCallback { - return new ConnectCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ConnectCallback { - return new ConnectCallback().fromJsonString(jsonString, options); - } - - static equals(a: ConnectCallback | PlainMessage | undefined, b: ConnectCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectCallback, a, b); - } -} + participants: ConnectCallback_ParticipantWithTracks[]; +}; /** - * @generated from message livekit.proto.ConnectCallback.ParticipantWithTracks + * Describes the message livekit.proto.ConnectCallback.Result. + * Use `create(ConnectCallback_ResultSchema)` to create a new message. */ -export class ConnectCallback_ParticipantWithTracks extends Message { - /** - * @generated from field: livekit.proto.OwnedParticipant participant = 1; - */ - participant?: OwnedParticipant; - - /** - * TrackInfo are not needed here, if we're subscribed to a track, the FfiServer will send - * a TrackSubscribed event - * - * @generated from field: repeated livekit.proto.OwnedTrackPublication publications = 2; - */ - publications: OwnedTrackPublication[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ConnectCallback.ParticipantWithTracks"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant", kind: "message", T: OwnedParticipant }, - { no: 2, name: "publications", kind: "message", T: OwnedTrackPublication, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ConnectCallback_ParticipantWithTracks { - return new ConnectCallback_ParticipantWithTracks().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ConnectCallback_ParticipantWithTracks { - return new ConnectCallback_ParticipantWithTracks().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ConnectCallback_ParticipantWithTracks { - return new ConnectCallback_ParticipantWithTracks().fromJsonString(jsonString, options); - } - - static equals(a: ConnectCallback_ParticipantWithTracks | PlainMessage | undefined, b: ConnectCallback_ParticipantWithTracks | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectCallback_ParticipantWithTracks, a, b); - } -} +export const ConnectCallback_ResultSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 2, 1); /** * Disconnect from the a room * * @generated from message livekit.proto.DisconnectRequest */ -export class DisconnectRequest extends Message { +export type DisconnectRequest = Message<"livekit.proto.DisconnectRequest"> & { /** - * @generated from field: uint64 room_handle = 1; + * @generated from field: required uint64 room_handle = 1; */ - roomHandle = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + roomHandle: bigint; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.DisconnectRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DisconnectRequest { - return new DisconnectRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DisconnectRequest { - return new DisconnectRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DisconnectRequest { - return new DisconnectRequest().fromJsonString(jsonString, options); - } - - static equals(a: DisconnectRequest | PlainMessage | undefined, b: DisconnectRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(DisconnectRequest, a, b); - } -} +/** + * Describes the message livekit.proto.DisconnectRequest. + * Use `create(DisconnectRequestSchema)` to create a new message. + */ +export const DisconnectRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 3); /** * @generated from message livekit.proto.DisconnectResponse */ -export class DisconnectResponse extends Message { +export type DisconnectResponse = Message<"livekit.proto.DisconnectResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.DisconnectResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DisconnectResponse { - return new DisconnectResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DisconnectResponse { - return new DisconnectResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DisconnectResponse { - return new DisconnectResponse().fromJsonString(jsonString, options); - } - - static equals(a: DisconnectResponse | PlainMessage | undefined, b: DisconnectResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(DisconnectResponse, a, b); - } -} +/** + * Describes the message livekit.proto.DisconnectResponse. + * Use `create(DisconnectResponseSchema)` to create a new message. + */ +export const DisconnectResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 4); /** * @generated from message livekit.proto.DisconnectCallback */ -export class DisconnectCallback extends Message { +export type DisconnectCallback = Message<"livekit.proto.DisconnectCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.DisconnectCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DisconnectCallback { - return new DisconnectCallback().fromBinary(bytes, options); - } + asyncId: bigint; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): DisconnectCallback { - return new DisconnectCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DisconnectCallback { - return new DisconnectCallback().fromJsonString(jsonString, options); - } - - static equals(a: DisconnectCallback | PlainMessage | undefined, b: DisconnectCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(DisconnectCallback, a, b); - } -} +/** + * Describes the message livekit.proto.DisconnectCallback. + * Use `create(DisconnectCallbackSchema)` to create a new message. + */ +export const DisconnectCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 5); /** * Publish a track to the room * * @generated from message livekit.proto.PublishTrackRequest */ -export class PublishTrackRequest extends Message { +export type PublishTrackRequest = Message<"livekit.proto.PublishTrackRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: uint64 track_handle = 2; + * @generated from field: required uint64 track_handle = 2; */ - trackHandle = protoInt64.zero; + trackHandle: bigint; /** - * @generated from field: livekit.proto.TrackPublishOptions options = 3; + * @generated from field: required livekit.proto.TrackPublishOptions options = 3; */ options?: TrackPublishOptions; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PublishTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 3, name: "options", kind: "message", T: TrackPublishOptions }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PublishTrackRequest { - return new PublishTrackRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PublishTrackRequest { - return new PublishTrackRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PublishTrackRequest { - return new PublishTrackRequest().fromJsonString(jsonString, options); - } - - static equals(a: PublishTrackRequest | PlainMessage | undefined, b: PublishTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTrackRequest, a, b); - } -} +/** + * Describes the message livekit.proto.PublishTrackRequest. + * Use `create(PublishTrackRequestSchema)` to create a new message. + */ +export const PublishTrackRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 6); /** * @generated from message livekit.proto.PublishTrackResponse */ -export class PublishTrackResponse extends Message { +export type PublishTrackResponse = Message<"livekit.proto.PublishTrackResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.PublishTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PublishTrackResponse { - return new PublishTrackResponse().fromBinary(bytes, options); - } + asyncId: bigint; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): PublishTrackResponse { - return new PublishTrackResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PublishTrackResponse { - return new PublishTrackResponse().fromJsonString(jsonString, options); - } - - static equals(a: PublishTrackResponse | PlainMessage | undefined, b: PublishTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTrackResponse, a, b); - } -} +/** + * Describes the message livekit.proto.PublishTrackResponse. + * Use `create(PublishTrackResponseSchema)` to create a new message. + */ +export const PublishTrackResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 7); /** * @generated from message livekit.proto.PublishTrackCallback */ -export class PublishTrackCallback extends Message { - /** - * @generated from field: uint64 async_id = 1; - */ - asyncId = protoInt64.zero; - +export type PublishTrackCallback = Message<"livekit.proto.PublishTrackCallback"> & { /** - * @generated from field: optional string error = 2; + * @generated from field: required uint64 async_id = 1; */ - error?: string; + asyncId: bigint; /** - * @generated from field: livekit.proto.OwnedTrackPublication publication = 3; + * @generated from oneof livekit.proto.PublishTrackCallback.message */ - publication?: OwnedTrackPublication; + message: { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.OwnedTrackPublication publication = 3; + */ + value: OwnedTrackPublication; + case: "publication"; + } | { case: undefined; value?: undefined }; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PublishTrackCallback"; - 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 }, - { no: 3, name: "publication", kind: "message", T: OwnedTrackPublication }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PublishTrackCallback { - return new PublishTrackCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PublishTrackCallback { - return new PublishTrackCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PublishTrackCallback { - return new PublishTrackCallback().fromJsonString(jsonString, options); - } - - static equals(a: PublishTrackCallback | PlainMessage | undefined, b: PublishTrackCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTrackCallback, a, b); - } -} +/** + * Describes the message livekit.proto.PublishTrackCallback. + * Use `create(PublishTrackCallbackSchema)` to create a new message. + */ +export const PublishTrackCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 8); /** * Unpublish a track from the room * * @generated from message livekit.proto.UnpublishTrackRequest */ -export class UnpublishTrackRequest extends Message { +export type UnpublishTrackRequest = Message<"livekit.proto.UnpublishTrackRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid: string; /** - * @generated from field: bool stop_on_unpublish = 3; + * @generated from field: required bool stop_on_unpublish = 3; */ - stopOnUnpublish = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UnpublishTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "stop_on_unpublish", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): UnpublishTrackRequest { - return new UnpublishTrackRequest().fromBinary(bytes, options); - } + stopOnUnpublish: boolean; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): UnpublishTrackRequest { - return new UnpublishTrackRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): UnpublishTrackRequest { - return new UnpublishTrackRequest().fromJsonString(jsonString, options); - } - - static equals(a: UnpublishTrackRequest | PlainMessage | undefined, b: UnpublishTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(UnpublishTrackRequest, a, b); - } -} +/** + * Describes the message livekit.proto.UnpublishTrackRequest. + * Use `create(UnpublishTrackRequestSchema)` to create a new message. + */ +export const UnpublishTrackRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 9); /** * @generated from message livekit.proto.UnpublishTrackResponse */ -export class UnpublishTrackResponse extends Message { +export type UnpublishTrackResponse = Message<"livekit.proto.UnpublishTrackResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.UnpublishTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); + asyncId: bigint; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): UnpublishTrackResponse { - return new UnpublishTrackResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): UnpublishTrackResponse { - return new UnpublishTrackResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): UnpublishTrackResponse { - return new UnpublishTrackResponse().fromJsonString(jsonString, options); - } - - static equals(a: UnpublishTrackResponse | PlainMessage | undefined, b: UnpublishTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(UnpublishTrackResponse, a, b); - } -} +/** + * Describes the message livekit.proto.UnpublishTrackResponse. + * Use `create(UnpublishTrackResponseSchema)` to create a new message. + */ +export const UnpublishTrackResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 10); /** * @generated from message livekit.proto.UnpublishTrackCallback */ -export class UnpublishTrackCallback extends Message { +export type UnpublishTrackCallback = Message<"livekit.proto.UnpublishTrackCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @generated from field: optional string error = 2; */ - error?: string; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + error: string; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UnpublishTrackCallback"; - 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): UnpublishTrackCallback { - return new UnpublishTrackCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): UnpublishTrackCallback { - return new UnpublishTrackCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): UnpublishTrackCallback { - return new UnpublishTrackCallback().fromJsonString(jsonString, options); - } - - static equals(a: UnpublishTrackCallback | PlainMessage | undefined, b: UnpublishTrackCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(UnpublishTrackCallback, a, b); - } -} +/** + * Describes the message livekit.proto.UnpublishTrackCallback. + * Use `create(UnpublishTrackCallbackSchema)` to create a new message. + */ +export const UnpublishTrackCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 11); /** * Publish data to other participants * * @generated from message livekit.proto.PublishDataRequest */ -export class PublishDataRequest extends Message { +export type PublishDataRequest = Message<"livekit.proto.PublishDataRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: uint64 data_ptr = 2; + * @generated from field: required uint64 data_ptr = 2; */ - dataPtr = protoInt64.zero; + dataPtr: bigint; /** - * @generated from field: uint64 data_len = 3; + * @generated from field: required uint64 data_len = 3; */ - dataLen = protoInt64.zero; + dataLen: bigint; /** - * @generated from field: bool reliable = 4; + * @generated from field: required bool reliable = 4; */ - reliable = false; + reliable: boolean; /** * @generated from field: repeated string destination_sids = 5 [deprecated = true]; * @deprecated */ - destinationSids: string[] = []; + destinationSids: string[]; /** * @generated from field: optional string topic = 6; */ - topic?: string; + topic: string; /** * @generated from field: repeated string destination_identities = 7; */ - destinationIdentities: string[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PublishDataRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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: "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 { - return new PublishDataRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PublishDataRequest { - return new PublishDataRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PublishDataRequest { - return new PublishDataRequest().fromJsonString(jsonString, options); - } - - static equals(a: PublishDataRequest | PlainMessage | undefined, b: PublishDataRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishDataRequest, a, b); - } -} + destinationIdentities: string[]; +}; + +/** + * Describes the message livekit.proto.PublishDataRequest. + * Use `create(PublishDataRequestSchema)` to create a new message. + */ +export const PublishDataRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 12); /** * @generated from message livekit.proto.PublishDataResponse */ -export class PublishDataResponse extends Message { +export type PublishDataResponse = Message<"livekit.proto.PublishDataResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.PublishDataResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PublishDataResponse { - return new PublishDataResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PublishDataResponse { - return new PublishDataResponse().fromJson(jsonValue, options); - } + asyncId: bigint; +}; - static fromJsonString(jsonString: string, options?: Partial): PublishDataResponse { - return new PublishDataResponse().fromJsonString(jsonString, options); - } - - static equals(a: PublishDataResponse | PlainMessage | undefined, b: PublishDataResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishDataResponse, a, b); - } -} +/** + * Describes the message livekit.proto.PublishDataResponse. + * Use `create(PublishDataResponseSchema)` to create a new message. + */ +export const PublishDataResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 13); /** * @generated from message livekit.proto.PublishDataCallback */ -export class PublishDataCallback extends Message { +export type PublishDataCallback = Message<"livekit.proto.PublishDataCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @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.PublishDataCallback"; - 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): PublishDataCallback { - return new PublishDataCallback().fromBinary(bytes, options); - } + error: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): PublishDataCallback { - return new PublishDataCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PublishDataCallback { - return new PublishDataCallback().fromJsonString(jsonString, options); - } - - static equals(a: PublishDataCallback | PlainMessage | undefined, b: PublishDataCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishDataCallback, a, b); - } -} +/** + * Describes the message livekit.proto.PublishDataCallback. + * Use `create(PublishDataCallbackSchema)` to create a new message. + */ +export const PublishDataCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 14); /** * Publish transcription messages to room * * @generated from message livekit.proto.PublishTranscriptionRequest */ -export class PublishTranscriptionRequest extends Message { +export type PublishTranscriptionRequest = Message<"livekit.proto.PublishTranscriptionRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: string participant_identity = 2; + * @generated from field: required string participant_identity = 2; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string track_id = 3; + * @generated from field: required string track_id = 3; */ - trackId = ""; + trackId: string; /** * @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); - } -} + segments: TranscriptionSegment[]; +}; + +/** + * Describes the message livekit.proto.PublishTranscriptionRequest. + * Use `create(PublishTranscriptionRequestSchema)` to create a new message. + */ +export const PublishTranscriptionRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 15); /** * @generated from message livekit.proto.PublishTranscriptionResponse */ -export class PublishTranscriptionResponse extends Message { +export type PublishTranscriptionResponse = Message<"livekit.proto.PublishTranscriptionResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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); - } + asyncId: bigint; +}; - static equals(a: PublishTranscriptionResponse | PlainMessage | undefined, b: PublishTranscriptionResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishTranscriptionResponse, a, b); - } -} +/** + * Describes the message livekit.proto.PublishTranscriptionResponse. + * Use `create(PublishTranscriptionResponseSchema)` to create a new message. + */ +export const PublishTranscriptionResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 16); /** * @generated from message livekit.proto.PublishTranscriptionCallback */ -export class PublishTranscriptionCallback extends Message { +export type PublishTranscriptionCallback = Message<"livekit.proto.PublishTranscriptionCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @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); - } + error: string; +}; - 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); - } -} +/** + * Describes the message livekit.proto.PublishTranscriptionCallback. + * Use `create(PublishTranscriptionCallbackSchema)` to create a new message. + */ +export const PublishTranscriptionCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 17); /** * Publish Sip DTMF messages to other participants * * @generated from message livekit.proto.PublishSipDtmfRequest */ -export class PublishSipDtmfRequest extends Message { +export type PublishSipDtmfRequest = Message<"livekit.proto.PublishSipDtmfRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: uint32 code = 2; + * @generated from field: required uint32 code = 2; */ - code = 0; + code: number; /** - * @generated from field: string digit = 3; + * @generated from field: required string digit = 3; */ - digit = ""; + digit: string; /** * @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); - } -} + destinationIdentities: string[]; +}; + +/** + * Describes the message livekit.proto.PublishSipDtmfRequest. + * Use `create(PublishSipDtmfRequestSchema)` to create a new message. + */ +export const PublishSipDtmfRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 18); /** * @generated from message livekit.proto.PublishSipDtmfResponse */ -export class PublishSipDtmfResponse extends Message { +export type PublishSipDtmfResponse = Message<"livekit.proto.PublishSipDtmfResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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); - } + asyncId: bigint; +}; - 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); - } -} +/** + * Describes the message livekit.proto.PublishSipDtmfResponse. + * Use `create(PublishSipDtmfResponseSchema)` to create a new message. + */ +export const PublishSipDtmfResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 19); /** * @generated from message livekit.proto.PublishSipDtmfCallback */ -export class PublishSipDtmfCallback extends Message { +export type PublishSipDtmfCallback = Message<"livekit.proto.PublishSipDtmfCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @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); - } + error: string; +}; - static equals(a: PublishSipDtmfCallback | PlainMessage | undefined, b: PublishSipDtmfCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PublishSipDtmfCallback, a, b); - } -} +/** + * Describes the message livekit.proto.PublishSipDtmfCallback. + * Use `create(PublishSipDtmfCallbackSchema)` to create a new message. + */ +export const PublishSipDtmfCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 20); /** * Change the local participant's metadata * * @generated from message livekit.proto.SetLocalMetadataRequest */ -export class SetLocalMetadataRequest extends Message { +export type SetLocalMetadataRequest = Message<"livekit.proto.SetLocalMetadataRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: string metadata = 2; + * @generated from field: required string metadata = 2; */ - metadata = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - 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): 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); - } + metadata: string; +}; - static equals(a: SetLocalMetadataRequest | PlainMessage | undefined, b: SetLocalMetadataRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalMetadataRequest, a, b); - } -} +/** + * Describes the message livekit.proto.SetLocalMetadataRequest. + * Use `create(SetLocalMetadataRequestSchema)` to create a new message. + */ +export const SetLocalMetadataRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 21); /** * @generated from message livekit.proto.SetLocalMetadataResponse */ -export class SetLocalMetadataResponse extends Message { +export type SetLocalMetadataResponse = Message<"livekit.proto.SetLocalMetadataResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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); - } + asyncId: bigint; +}; - 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); - } -} +/** + * Describes the message livekit.proto.SetLocalMetadataResponse. + * Use `create(SetLocalMetadataResponseSchema)` to create a new message. + */ +export const SetLocalMetadataResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 22); /** * @generated from message livekit.proto.SetLocalMetadataCallback */ -export class SetLocalMetadataCallback extends Message { +export type SetLocalMetadataCallback = Message<"livekit.proto.SetLocalMetadataCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @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); - } + error: string; +}; - 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); - } -} +/** + * Describes the message livekit.proto.SetLocalMetadataCallback. + * Use `create(SetLocalMetadataCallbackSchema)` to create a new message. + */ +export const SetLocalMetadataCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 23); /** * @generated from message livekit.proto.SendChatMessageRequest */ -export class SendChatMessageRequest extends Message { +export type SendChatMessageRequest = Message<"livekit.proto.SendChatMessageRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: string message = 2; + * @generated from field: required string message = 2; */ - message = ""; + message: string; /** * @generated from field: repeated string destination_identities = 3; */ - destinationIdentities: string[] = []; + destinationIdentities: string[]; /** * @generated from field: optional string sender_identity = 4; */ - senderIdentity?: string; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SendChatMessageRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 4, name: "sender_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageRequest { - return new SendChatMessageRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SendChatMessageRequest { - return new SendChatMessageRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SendChatMessageRequest { - return new SendChatMessageRequest().fromJsonString(jsonString, options); - } - - static equals(a: SendChatMessageRequest | PlainMessage | undefined, b: SendChatMessageRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SendChatMessageRequest, a, b); - } -} + senderIdentity: string; +}; + +/** + * Describes the message livekit.proto.SendChatMessageRequest. + * Use `create(SendChatMessageRequestSchema)` to create a new message. + */ +export const SendChatMessageRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 24); /** * @generated from message livekit.proto.EditChatMessageRequest */ -export class EditChatMessageRequest extends Message { +export type EditChatMessageRequest = Message<"livekit.proto.EditChatMessageRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: string edit_text = 2; + * @generated from field: required string edit_text = 2; */ - editText = ""; + editText: string; /** - * @generated from field: livekit.proto.ChatMessage original_message = 3; + * @generated from field: required livekit.proto.ChatMessage original_message = 3; */ originalMessage?: ChatMessage; /** * @generated from field: repeated string destination_identities = 4; */ - destinationIdentities: string[] = []; + destinationIdentities: string[]; /** * @generated from field: optional string sender_identity = 5; */ - senderIdentity?: string; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.EditChatMessageRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "edit_text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "original_message", kind: "message", T: ChatMessage }, - { no: 4, name: "destination_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 5, name: "sender_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): EditChatMessageRequest { - return new EditChatMessageRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): EditChatMessageRequest { - return new EditChatMessageRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): EditChatMessageRequest { - return new EditChatMessageRequest().fromJsonString(jsonString, options); - } - - static equals(a: EditChatMessageRequest | PlainMessage | undefined, b: EditChatMessageRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(EditChatMessageRequest, a, b); - } -} + senderIdentity: string; +}; + +/** + * Describes the message livekit.proto.EditChatMessageRequest. + * Use `create(EditChatMessageRequestSchema)` to create a new message. + */ +export const EditChatMessageRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 25); /** * @generated from message livekit.proto.SendChatMessageResponse */ -export class SendChatMessageResponse extends Message { +export type SendChatMessageResponse = Message<"livekit.proto.SendChatMessageResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.SendChatMessageResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); + asyncId: bigint; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageResponse { - return new SendChatMessageResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SendChatMessageResponse { - return new SendChatMessageResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SendChatMessageResponse { - return new SendChatMessageResponse().fromJsonString(jsonString, options); - } - - static equals(a: SendChatMessageResponse | PlainMessage | undefined, b: SendChatMessageResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SendChatMessageResponse, a, b); - } -} +/** + * Describes the message livekit.proto.SendChatMessageResponse. + * Use `create(SendChatMessageResponseSchema)` to create a new message. + */ +export const SendChatMessageResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 26); /** * @generated from message livekit.proto.SendChatMessageCallback */ -export class SendChatMessageCallback extends Message { +export type SendChatMessageCallback = Message<"livekit.proto.SendChatMessageCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** - * @generated from field: optional string error = 2; + * @generated from oneof livekit.proto.SendChatMessageCallback.message */ - error?: string; - - /** - * @generated from field: optional livekit.proto.ChatMessage chat_message = 3; - */ - chatMessage?: ChatMessage; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SendChatMessageCallback"; - 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 }, - { no: 3, name: "chat_message", kind: "message", T: ChatMessage, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SendChatMessageCallback { - return new SendChatMessageCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SendChatMessageCallback { - return new SendChatMessageCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SendChatMessageCallback { - return new SendChatMessageCallback().fromJsonString(jsonString, options); - } + message: { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.ChatMessage chat_message = 3; + */ + value: ChatMessage; + case: "chatMessage"; + } | { case: undefined; value?: undefined }; +}; - static equals(a: SendChatMessageCallback | PlainMessage | undefined, b: SendChatMessageCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(SendChatMessageCallback, a, b); - } -} +/** + * Describes the message livekit.proto.SendChatMessageCallback. + * Use `create(SendChatMessageCallbackSchema)` to create a new message. + */ +export const SendChatMessageCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 27); /** * Change the local participant's attributes * * @generated from message livekit.proto.SetLocalAttributesRequest */ -export class SetLocalAttributesRequest extends Message { +export type SetLocalAttributesRequest = Message<"livekit.proto.SetLocalAttributesRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: map attributes = 2; + * @generated from field: repeated livekit.proto.AttributesEntry attributes = 2; */ - attributes: { [key: string]: string } = {}; + attributes: AttributesEntry[]; +}; - 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); - } +/** + * Describes the message livekit.proto.SetLocalAttributesRequest. + * Use `create(SetLocalAttributesRequestSchema)` to create a new message. + */ +export const SetLocalAttributesRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 28); - static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalAttributesRequest { - return new SetLocalAttributesRequest().fromJson(jsonValue, options); - } +/** + * @generated from message livekit.proto.AttributesEntry + */ +export type AttributesEntry = Message<"livekit.proto.AttributesEntry"> & { + /** + * @generated from field: required string key = 1; + */ + key: string; - static fromJsonString(jsonString: string, options?: Partial): SetLocalAttributesRequest { - return new SetLocalAttributesRequest().fromJsonString(jsonString, options); - } + /** + * @generated from field: required string value = 2; + */ + value: string; +}; - static equals(a: SetLocalAttributesRequest | PlainMessage | undefined, b: SetLocalAttributesRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalAttributesRequest, a, b); - } -} +/** + * Describes the message livekit.proto.AttributesEntry. + * Use `create(AttributesEntrySchema)` to create a new message. + */ +export const AttributesEntrySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 29); /** * @generated from message livekit.proto.SetLocalAttributesResponse */ -export class SetLocalAttributesResponse extends Message { +export type SetLocalAttributesResponse = Message<"livekit.proto.SetLocalAttributesResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.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): SetLocalAttributesResponse { - return new SetLocalAttributesResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalAttributesResponse { - return new SetLocalAttributesResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetLocalAttributesResponse { - return new SetLocalAttributesResponse().fromJsonString(jsonString, options); - } + asyncId: bigint; +}; - static equals(a: SetLocalAttributesResponse | PlainMessage | undefined, b: SetLocalAttributesResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalAttributesResponse, a, b); - } -} +/** + * Describes the message livekit.proto.SetLocalAttributesResponse. + * Use `create(SetLocalAttributesResponseSchema)` to create a new message. + */ +export const SetLocalAttributesResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 30); /** * @generated from message livekit.proto.SetLocalAttributesCallback */ -export class SetLocalAttributesCallback extends Message { +export type SetLocalAttributesCallback = Message<"livekit.proto.SetLocalAttributesCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @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.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): SetLocalAttributesCallback { - return new SetLocalAttributesCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalAttributesCallback { - return new SetLocalAttributesCallback().fromJson(jsonValue, options); - } + error: string; +}; - static fromJsonString(jsonString: string, options?: Partial): SetLocalAttributesCallback { - return new SetLocalAttributesCallback().fromJsonString(jsonString, options); - } - - static equals(a: SetLocalAttributesCallback | PlainMessage | undefined, b: SetLocalAttributesCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalAttributesCallback, a, b); - } -} +/** + * Describes the message livekit.proto.SetLocalAttributesCallback. + * Use `create(SetLocalAttributesCallbackSchema)` to create a new message. + */ +export const SetLocalAttributesCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 31); /** * Change the local participant's name * * @generated from message livekit.proto.SetLocalNameRequest */ -export class SetLocalNameRequest extends Message { +export type SetLocalNameRequest = Message<"livekit.proto.SetLocalNameRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - 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): SetLocalNameRequest { - return new SetLocalNameRequest().fromBinary(bytes, options); - } + name: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalNameRequest { - return new SetLocalNameRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetLocalNameRequest { - return new SetLocalNameRequest().fromJsonString(jsonString, options); - } - - static equals(a: SetLocalNameRequest | PlainMessage | undefined, b: SetLocalNameRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalNameRequest, a, b); - } -} +/** + * Describes the message livekit.proto.SetLocalNameRequest. + * Use `create(SetLocalNameRequestSchema)` to create a new message. + */ +export const SetLocalNameRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 32); /** * @generated from message livekit.proto.SetLocalNameResponse */ -export class SetLocalNameResponse extends Message { +export type SetLocalNameResponse = Message<"livekit.proto.SetLocalNameResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.SetLocalNameResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); + asyncId: bigint; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): SetLocalNameResponse { - return new SetLocalNameResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalNameResponse { - return new SetLocalNameResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetLocalNameResponse { - return new SetLocalNameResponse().fromJsonString(jsonString, options); - } - - static equals(a: SetLocalNameResponse | PlainMessage | undefined, b: SetLocalNameResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalNameResponse, a, b); - } -} +/** + * Describes the message livekit.proto.SetLocalNameResponse. + * Use `create(SetLocalNameResponseSchema)` to create a new message. + */ +export const SetLocalNameResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 33); /** * @generated from message livekit.proto.SetLocalNameCallback */ -export class SetLocalNameCallback extends Message { +export type SetLocalNameCallback = Message<"livekit.proto.SetLocalNameCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @generated from field: optional string error = 2; */ - error?: string; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + error: string; +}; - static readonly runtime: typeof proto3 = proto3; - 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): SetLocalNameCallback { - return new SetLocalNameCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetLocalNameCallback { - return new SetLocalNameCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetLocalNameCallback { - return new SetLocalNameCallback().fromJsonString(jsonString, options); - } - - static equals(a: SetLocalNameCallback | PlainMessage | undefined, b: SetLocalNameCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(SetLocalNameCallback, a, b); - } -} +/** + * Describes the message livekit.proto.SetLocalNameCallback. + * Use `create(SetLocalNameCallbackSchema)` to create a new message. + */ +export const SetLocalNameCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 34); /** * Change the "desire" to subs2ribe to a track * * @generated from message livekit.proto.SetSubscribedRequest */ -export class SetSubscribedRequest extends Message { +export type SetSubscribedRequest = Message<"livekit.proto.SetSubscribedRequest"> & { /** - * @generated from field: bool subscribe = 1; + * @generated from field: required bool subscribe = 1; */ - subscribe = false; + subscribe: boolean; /** - * @generated from field: uint64 publication_handle = 2; + * @generated from field: required uint64 publication_handle = 2; */ - publicationHandle = protoInt64.zero; + publicationHandle: bigint; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SetSubscribedRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "publication_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SetSubscribedRequest { - return new SetSubscribedRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetSubscribedRequest { - return new SetSubscribedRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetSubscribedRequest { - return new SetSubscribedRequest().fromJsonString(jsonString, options); - } - - static equals(a: SetSubscribedRequest | PlainMessage | undefined, b: SetSubscribedRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SetSubscribedRequest, a, b); - } -} +/** + * Describes the message livekit.proto.SetSubscribedRequest. + * Use `create(SetSubscribedRequestSchema)` to create a new message. + */ +export const SetSubscribedRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 35); /** * @generated from message livekit.proto.SetSubscribedResponse */ -export class SetSubscribedResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +export type SetSubscribedResponse = Message<"livekit.proto.SetSubscribedResponse"> & { +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SetSubscribedResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SetSubscribedResponse { - return new SetSubscribedResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SetSubscribedResponse { - return new SetSubscribedResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SetSubscribedResponse { - return new SetSubscribedResponse().fromJsonString(jsonString, options); - } - - static equals(a: SetSubscribedResponse | PlainMessage | undefined, b: SetSubscribedResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SetSubscribedResponse, a, b); - } -} +/** + * Describes the message livekit.proto.SetSubscribedResponse. + * Use `create(SetSubscribedResponseSchema)` to create a new message. + */ +export const SetSubscribedResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 36); /** * @generated from message livekit.proto.GetSessionStatsRequest */ -export class GetSessionStatsRequest extends Message { +export type GetSessionStatsRequest = Message<"livekit.proto.GetSessionStatsRequest"> & { /** - * @generated from field: uint64 room_handle = 1; + * @generated from field: required uint64 room_handle = 1; */ - roomHandle = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + roomHandle: bigint; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.GetSessionStatsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsRequest { - return new GetSessionStatsRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSessionStatsRequest { - return new GetSessionStatsRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetSessionStatsRequest { - return new GetSessionStatsRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetSessionStatsRequest | PlainMessage | undefined, b: GetSessionStatsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSessionStatsRequest, a, b); - } -} +/** + * Describes the message livekit.proto.GetSessionStatsRequest. + * Use `create(GetSessionStatsRequestSchema)` to create a new message. + */ +export const GetSessionStatsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 37); /** * @generated from message livekit.proto.GetSessionStatsResponse */ -export class GetSessionStatsResponse extends Message { +export type GetSessionStatsResponse = Message<"livekit.proto.GetSessionStatsResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + asyncId: bigint; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.GetSessionStatsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsResponse { - return new GetSessionStatsResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSessionStatsResponse { - return new GetSessionStatsResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetSessionStatsResponse { - return new GetSessionStatsResponse().fromJsonString(jsonString, options); - } - - static equals(a: GetSessionStatsResponse | PlainMessage | undefined, b: GetSessionStatsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSessionStatsResponse, a, b); - } -} +/** + * Describes the message livekit.proto.GetSessionStatsResponse. + * Use `create(GetSessionStatsResponseSchema)` to create a new message. + */ +export const GetSessionStatsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 38); /** * @generated from message livekit.proto.GetSessionStatsCallback */ -export class GetSessionStatsCallback extends Message { +export type GetSessionStatsCallback = Message<"livekit.proto.GetSessionStatsCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** - * @generated from field: optional string error = 2; + * @generated from oneof livekit.proto.GetSessionStatsCallback.message */ - error?: string; + message: { + /** + * @generated from field: string error = 2; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.GetSessionStatsCallback.Result result = 3; + */ + value: GetSessionStatsCallback_Result; + case: "result"; + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message livekit.proto.GetSessionStatsCallback. + * Use `create(GetSessionStatsCallbackSchema)` to create a new message. + */ +export const GetSessionStatsCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 39); +/** + * @generated from message livekit.proto.GetSessionStatsCallback.Result + */ +export type GetSessionStatsCallback_Result = Message<"livekit.proto.GetSessionStatsCallback.Result"> & { /** - * @generated from field: repeated livekit.proto.RtcStats publisher_stats = 3; + * @generated from field: repeated livekit.proto.RtcStats publisher_stats = 1; */ - publisherStats: RtcStats[] = []; + publisherStats: RtcStats[]; /** - * @generated from field: repeated livekit.proto.RtcStats subscriber_stats = 4; + * @generated from field: repeated livekit.proto.RtcStats subscriber_stats = 2; */ - subscriberStats: RtcStats[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.GetSessionStatsCallback"; - 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 }, - { no: 3, name: "publisher_stats", kind: "message", T: RtcStats, repeated: true }, - { no: 4, name: "subscriber_stats", kind: "message", T: RtcStats, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSessionStatsCallback { - return new GetSessionStatsCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSessionStatsCallback { - return new GetSessionStatsCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetSessionStatsCallback { - return new GetSessionStatsCallback().fromJsonString(jsonString, options); - } + subscriberStats: RtcStats[]; +}; - static equals(a: GetSessionStatsCallback | PlainMessage | undefined, b: GetSessionStatsCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(GetSessionStatsCallback, a, b); - } -} +/** + * Describes the message livekit.proto.GetSessionStatsCallback.Result. + * Use `create(GetSessionStatsCallback_ResultSchema)` to create a new message. + */ +export const GetSessionStatsCallback_ResultSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 39, 0); /** * @generated from message livekit.proto.VideoEncoding */ -export class VideoEncoding extends Message { +export type VideoEncoding = Message<"livekit.proto.VideoEncoding"> & { /** - * @generated from field: uint64 max_bitrate = 1; + * @generated from field: required uint64 max_bitrate = 1; */ - maxBitrate = protoInt64.zero; + maxBitrate: bigint; /** - * @generated from field: double max_framerate = 2; + * @generated from field: required double max_framerate = 2; */ - maxFramerate = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoEncoding"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "max_framerate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoEncoding { - return new VideoEncoding().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoEncoding { - return new VideoEncoding().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VideoEncoding { - return new VideoEncoding().fromJsonString(jsonString, options); - } + maxFramerate: number; +}; - static equals(a: VideoEncoding | PlainMessage | undefined, b: VideoEncoding | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoEncoding, a, b); - } -} +/** + * Describes the message livekit.proto.VideoEncoding. + * Use `create(VideoEncodingSchema)` to create a new message. + */ +export const VideoEncodingSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 40); /** * @generated from message livekit.proto.AudioEncoding */ -export class AudioEncoding extends Message { +export type AudioEncoding = Message<"livekit.proto.AudioEncoding"> & { /** - * @generated from field: uint64 max_bitrate = 1; + * @generated from field: required uint64 max_bitrate = 1; */ - maxBitrate = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioEncoding"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "max_bitrate", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioEncoding { - return new AudioEncoding().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioEncoding { - return new AudioEncoding().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioEncoding { - return new AudioEncoding().fromJsonString(jsonString, options); - } + maxBitrate: bigint; +}; - static equals(a: AudioEncoding | PlainMessage | undefined, b: AudioEncoding | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioEncoding, a, b); - } -} +/** + * Describes the message livekit.proto.AudioEncoding. + * Use `create(AudioEncodingSchema)` to create a new message. + */ +export const AudioEncodingSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 41); /** * @generated from message livekit.proto.TrackPublishOptions */ -export class TrackPublishOptions extends Message { +export type TrackPublishOptions = Message<"livekit.proto.TrackPublishOptions"> & { /** * encodings are optional * - * @generated from field: livekit.proto.VideoEncoding video_encoding = 1; + * @generated from field: optional livekit.proto.VideoEncoding video_encoding = 1; */ videoEncoding?: VideoEncoding; /** - * @generated from field: livekit.proto.AudioEncoding audio_encoding = 2; + * @generated from field: optional livekit.proto.AudioEncoding audio_encoding = 2; */ audioEncoding?: AudioEncoding; /** - * @generated from field: livekit.proto.VideoCodec video_codec = 3; + * @generated from field: required livekit.proto.VideoCodec video_codec = 3; */ - videoCodec = VideoCodec.VP8; + videoCodec: VideoCodec; /** - * @generated from field: bool dtx = 4; + * @generated from field: required bool dtx = 4; */ - dtx = false; + dtx: boolean; /** - * @generated from field: bool red = 5; + * @generated from field: required bool red = 5; */ - red = false; + red: boolean; /** - * @generated from field: bool simulcast = 6; + * @generated from field: required bool simulcast = 6; */ - simulcast = false; + simulcast: boolean; /** - * @generated from field: livekit.proto.TrackSource source = 7; + * @generated from field: required livekit.proto.TrackSource source = 7; */ - source = TrackSource.SOURCE_UNKNOWN; + source: TrackSource; /** - * @generated from field: string stream = 8; + * @generated from field: required string stream = 8; */ - stream = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackPublishOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "video_encoding", kind: "message", T: VideoEncoding }, - { no: 2, name: "audio_encoding", kind: "message", T: AudioEncoding }, - { no: 3, name: "video_codec", kind: "enum", T: proto3.getEnumType(VideoCodec) }, - { no: 4, name: "dtx", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 5, name: "red", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "simulcast", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 7, name: "source", kind: "enum", T: proto3.getEnumType(TrackSource) }, - { no: 8, name: "stream", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackPublishOptions { - return new TrackPublishOptions().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TrackPublishOptions { - return new TrackPublishOptions().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackPublishOptions { - return new TrackPublishOptions().fromJsonString(jsonString, options); - } + stream: string; +}; - static equals(a: TrackPublishOptions | PlainMessage | undefined, b: TrackPublishOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackPublishOptions, a, b); - } -} +/** + * Describes the message livekit.proto.TrackPublishOptions. + * Use `create(TrackPublishOptionsSchema)` to create a new message. + */ +export const TrackPublishOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 42); /** * @generated from message livekit.proto.IceServer */ -export class IceServer extends Message { +export type IceServer = Message<"livekit.proto.IceServer"> & { /** * @generated from field: repeated string urls = 1; */ - urls: string[] = []; + urls: string[]; /** - * @generated from field: string username = 2; + * @generated from field: optional string username = 2; */ - username = ""; + username: string; /** - * @generated from field: string password = 3; + * @generated from field: optional string password = 3; */ - password = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.IceServer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "urls", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): IceServer { - return new IceServer().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): IceServer { - return new IceServer().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): IceServer { - return new IceServer().fromJsonString(jsonString, options); - } + password: string; +}; - static equals(a: IceServer | PlainMessage | undefined, b: IceServer | PlainMessage | undefined): boolean { - return proto3.util.equals(IceServer, a, b); - } -} +/** + * Describes the message livekit.proto.IceServer. + * Use `create(IceServerSchema)` to create a new message. + */ +export const IceServerSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 43); /** * @generated from message livekit.proto.RtcConfig */ -export class RtcConfig extends Message { +export type RtcConfig = Message<"livekit.proto.RtcConfig"> & { /** * @generated from field: optional livekit.proto.IceTransportType ice_transport_type = 1; */ - iceTransportType?: IceTransportType; + iceTransportType: IceTransportType; /** * @generated from field: optional livekit.proto.ContinualGatheringPolicy continual_gathering_policy = 2; */ - continualGatheringPolicy?: ContinualGatheringPolicy; + continualGatheringPolicy: ContinualGatheringPolicy; /** * empty fallback to default * * @generated from field: repeated livekit.proto.IceServer ice_servers = 3; */ - iceServers: IceServer[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcConfig"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "ice_transport_type", kind: "enum", T: proto3.getEnumType(IceTransportType), opt: true }, - { no: 2, name: "continual_gathering_policy", kind: "enum", T: proto3.getEnumType(ContinualGatheringPolicy), opt: true }, - { no: 3, name: "ice_servers", kind: "message", T: IceServer, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcConfig { - return new RtcConfig().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcConfig { - return new RtcConfig().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcConfig { - return new RtcConfig().fromJsonString(jsonString, options); - } + iceServers: IceServer[]; +}; - static equals(a: RtcConfig | PlainMessage | undefined, b: RtcConfig | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcConfig, a, b); - } -} +/** + * Describes the message livekit.proto.RtcConfig. + * Use `create(RtcConfigSchema)` to create a new message. + */ +export const RtcConfigSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 44); /** * @generated from message livekit.proto.RoomOptions */ -export class RoomOptions extends Message { +export type RoomOptions = Message<"livekit.proto.RoomOptions"> & { /** - * @generated from field: bool auto_subscribe = 1; + * @generated from field: required bool auto_subscribe = 1; */ - autoSubscribe = false; + autoSubscribe: boolean; /** - * @generated from field: bool adaptive_stream = 2; + * @generated from field: required bool adaptive_stream = 2; */ - adaptiveStream = false; + adaptiveStream: boolean; /** - * @generated from field: bool dynacast = 3; + * @generated from field: required bool dynacast = 3; */ - dynacast = false; + dynacast: boolean; /** * @generated from field: optional livekit.proto.E2eeOptions e2ee = 4; @@ -2325,204 +1245,112 @@ export class RoomOptions extends Message { rtcConfig?: RtcConfig; /** - * @generated from field: uint32 join_retries = 6; + * @generated from field: required uint32 join_retries = 6; */ - joinRetries = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RoomOptions"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "auto_subscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "adaptive_stream", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 3, name: "dynacast", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 4, name: "e2ee", kind: "message", T: E2eeOptions, opt: true }, - { no: 5, name: "rtc_config", kind: "message", T: RtcConfig, opt: true }, - { no: 6, name: "join_retries", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RoomOptions { - return new RoomOptions().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RoomOptions { - return new RoomOptions().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RoomOptions { - return new RoomOptions().fromJsonString(jsonString, options); - } + joinRetries: number; +}; - static equals(a: RoomOptions | PlainMessage | undefined, b: RoomOptions | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomOptions, a, b); - } -} +/** + * Describes the message livekit.proto.RoomOptions. + * Use `create(RoomOptionsSchema)` to create a new message. + */ +export const RoomOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 45); /** * @generated from message livekit.proto.TranscriptionSegment */ -export class TranscriptionSegment extends Message { +export type TranscriptionSegment = Message<"livekit.proto.TranscriptionSegment"> & { /** - * @generated from field: string id = 1; + * @generated from field: required string id = 1; */ - id = ""; + id: string; /** - * @generated from field: string text = 2; + * @generated from field: required string text = 2; */ - text = ""; + text: string; /** - * @generated from field: uint64 start_time = 3; + * @generated from field: required uint64 start_time = 3; */ - startTime = protoInt64.zero; + startTime: bigint; /** - * @generated from field: uint64 end_time = 4; + * @generated from field: required uint64 end_time = 4; */ - endTime = protoInt64.zero; + endTime: bigint; /** - * @generated from field: bool final = 5; + * @generated from field: required bool final = 5; */ - final = false; + final: boolean; /** - * @generated from field: string language = 6; + * @generated from field: required 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); - } + language: string; +}; - static equals(a: TranscriptionSegment | PlainMessage | undefined, b: TranscriptionSegment | PlainMessage | undefined): boolean { - return proto3.util.equals(TranscriptionSegment, a, b); - } -} +/** + * Describes the message livekit.proto.TranscriptionSegment. + * Use `create(TranscriptionSegmentSchema)` to create a new message. + */ +export const TranscriptionSegmentSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 46); /** * @generated from message livekit.proto.BufferInfo */ -export class BufferInfo extends Message { +export type BufferInfo = Message<"livekit.proto.BufferInfo"> & { /** - * @generated from field: uint64 data_ptr = 1; + * @generated from field: required uint64 data_ptr = 1; */ - dataPtr = protoInt64.zero; + dataPtr: bigint; /** - * @generated from field: uint64 data_len = 2; + * @generated from field: required uint64 data_len = 2; */ - dataLen = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.BufferInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "data_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): BufferInfo { - return new BufferInfo().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): BufferInfo { - return new BufferInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): BufferInfo { - return new BufferInfo().fromJsonString(jsonString, options); - } + dataLen: bigint; +}; - static equals(a: BufferInfo | PlainMessage | undefined, b: BufferInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(BufferInfo, a, b); - } -} +/** + * Describes the message livekit.proto.BufferInfo. + * Use `create(BufferInfoSchema)` to create a new message. + */ +export const BufferInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 47); /** * @generated from message livekit.proto.OwnedBuffer */ -export class OwnedBuffer extends Message { +export type OwnedBuffer = Message<"livekit.proto.OwnedBuffer"> & { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.BufferInfo data = 2; + * @generated from field: required livekit.proto.BufferInfo data = 2; */ data?: BufferInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedBuffer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "data", kind: "message", T: BufferInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedBuffer { - return new OwnedBuffer().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedBuffer { - return new OwnedBuffer().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedBuffer { - return new OwnedBuffer().fromJsonString(jsonString, options); - } - - static equals(a: OwnedBuffer | PlainMessage | undefined, b: OwnedBuffer | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedBuffer, a, b); - } -} +/** + * Describes the message livekit.proto.OwnedBuffer. + * Use `create(OwnedBufferSchema)` to create a new message. + */ +export const OwnedBufferSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 48); /** * @generated from message livekit.proto.RoomEvent */ -export class RoomEvent extends Message { +export type RoomEvent = Message<"livekit.proto.RoomEvent"> & { /** - * @generated from field: uint64 room_handle = 1; + * @generated from field: required uint64 room_handle = 1; */ - roomHandle = protoInt64.zero; + roomHandle: bigint; /** * @generated from oneof livekit.proto.RoomEvent.message @@ -2699,429 +1527,196 @@ export class RoomEvent extends Message { */ value: ChatMessageReceived; case: "chatMessage"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RoomEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "room_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "participant_connected", kind: "message", T: ParticipantConnected, oneof: "message" }, - { no: 3, name: "participant_disconnected", kind: "message", T: ParticipantDisconnected, oneof: "message" }, - { no: 4, name: "local_track_published", kind: "message", T: LocalTrackPublished, oneof: "message" }, - { no: 5, name: "local_track_unpublished", kind: "message", T: LocalTrackUnpublished, oneof: "message" }, - { no: 6, name: "local_track_subscribed", kind: "message", T: LocalTrackSubscribed, oneof: "message" }, - { no: 7, name: "track_published", kind: "message", T: TrackPublished, oneof: "message" }, - { no: 8, name: "track_unpublished", kind: "message", T: TrackUnpublished, oneof: "message" }, - { no: 9, name: "track_subscribed", kind: "message", T: TrackSubscribed, oneof: "message" }, - { no: 10, name: "track_unsubscribed", kind: "message", T: TrackUnsubscribed, oneof: "message" }, - { no: 11, name: "track_subscription_failed", kind: "message", T: TrackSubscriptionFailed, oneof: "message" }, - { no: 12, name: "track_muted", kind: "message", T: TrackMuted, oneof: "message" }, - { no: 13, name: "track_unmuted", kind: "message", T: TrackUnmuted, oneof: "message" }, - { no: 14, name: "active_speakers_changed", kind: "message", T: ActiveSpeakersChanged, oneof: "message" }, - { no: 15, name: "room_metadata_changed", kind: "message", T: RoomMetadataChanged, oneof: "message" }, - { no: 16, name: "room_sid_changed", kind: "message", T: RoomSidChanged, oneof: "message" }, - { no: 17, name: "participant_metadata_changed", kind: "message", T: ParticipantMetadataChanged, oneof: "message" }, - { no: 18, name: "participant_name_changed", kind: "message", T: ParticipantNameChanged, oneof: "message" }, - { no: 19, name: "participant_attributes_changed", kind: "message", T: ParticipantAttributesChanged, oneof: "message" }, - { no: 20, name: "connection_quality_changed", kind: "message", T: ConnectionQualityChanged, oneof: "message" }, - { no: 21, 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" }, - { no: 28, name: "transcription_received", kind: "message", T: TranscriptionReceived, oneof: "message" }, - { no: 29, name: "chat_message", kind: "message", T: ChatMessageReceived, oneof: "message" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RoomEvent { - return new RoomEvent().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RoomEvent { - return new RoomEvent().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RoomEvent { - return new RoomEvent().fromJsonString(jsonString, options); - } - - static equals(a: RoomEvent | PlainMessage | undefined, b: RoomEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomEvent, a, b); - } -} + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message livekit.proto.RoomEvent. + * Use `create(RoomEventSchema)` to create a new message. + */ +export const RoomEventSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 49); /** * @generated from message livekit.proto.RoomInfo */ -export class RoomInfo extends Message { +export type RoomInfo = Message<"livekit.proto.RoomInfo"> & { /** * @generated from field: optional string sid = 1; */ - sid?: string; + sid: string; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; + name: string; /** - * @generated from field: string metadata = 3; + * @generated from field: required string metadata = 3; */ - metadata = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - 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 */, opt: true }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); + metadata: string; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): RoomInfo { - return new RoomInfo().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RoomInfo { - return new RoomInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RoomInfo { - return new RoomInfo().fromJsonString(jsonString, options); - } - - static equals(a: RoomInfo | PlainMessage | undefined, b: RoomInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomInfo, a, b); - } -} +/** + * Describes the message livekit.proto.RoomInfo. + * Use `create(RoomInfoSchema)` to create a new message. + */ +export const RoomInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 50); /** * @generated from message livekit.proto.OwnedRoom */ -export class OwnedRoom extends Message { +export type OwnedRoom = Message<"livekit.proto.OwnedRoom"> & { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.RoomInfo info = 2; + * @generated from field: required livekit.proto.RoomInfo info = 2; */ info?: RoomInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedRoom"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: RoomInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedRoom { - return new OwnedRoom().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedRoom { - return new OwnedRoom().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedRoom { - return new OwnedRoom().fromJsonString(jsonString, options); - } - - static equals(a: OwnedRoom | PlainMessage | undefined, b: OwnedRoom | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedRoom, a, b); - } -} +/** + * Describes the message livekit.proto.OwnedRoom. + * Use `create(OwnedRoomSchema)` to create a new message. + */ +export const OwnedRoomSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 51); /** * @generated from message livekit.proto.ParticipantConnected */ -export class ParticipantConnected extends Message { +export type ParticipantConnected = Message<"livekit.proto.ParticipantConnected"> & { /** - * @generated from field: livekit.proto.OwnedParticipant info = 1; + * @generated from field: required livekit.proto.OwnedParticipant info = 1; */ info?: OwnedParticipant; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ParticipantConnected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "info", kind: "message", T: OwnedParticipant }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantConnected { - return new ParticipantConnected().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ParticipantConnected { - return new ParticipantConnected().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ParticipantConnected { - return new ParticipantConnected().fromJsonString(jsonString, options); - } - - static equals(a: ParticipantConnected | PlainMessage | undefined, b: ParticipantConnected | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantConnected, a, b); - } -} +/** + * Describes the message livekit.proto.ParticipantConnected. + * Use `create(ParticipantConnectedSchema)` to create a new message. + */ +export const ParticipantConnectedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 52); /** * @generated from message livekit.proto.ParticipantDisconnected */ -export class ParticipantDisconnected extends Message { +export type ParticipantDisconnected = Message<"livekit.proto.ParticipantDisconnected"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ParticipantDisconnected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantDisconnected { - return new ParticipantDisconnected().fromBinary(bytes, options); - } + participantIdentity: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): ParticipantDisconnected { - return new ParticipantDisconnected().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ParticipantDisconnected { - return new ParticipantDisconnected().fromJsonString(jsonString, options); - } - - static equals(a: ParticipantDisconnected | PlainMessage | undefined, b: ParticipantDisconnected | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantDisconnected, a, b); - } -} +/** + * Describes the message livekit.proto.ParticipantDisconnected. + * Use `create(ParticipantDisconnectedSchema)` to create a new message. + */ +export const ParticipantDisconnectedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 53); /** * @generated from message livekit.proto.LocalTrackPublished */ -export class LocalTrackPublished extends Message { +export type LocalTrackPublished = Message<"livekit.proto.LocalTrackPublished"> & { /** * The TrackPublicationInfo comes from the PublishTrack response * and the FfiClient musts wait for it before firing this event * - * @generated from field: string track_sid = 1; + * @generated from field: required string track_sid = 1; */ - trackSid = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.LocalTrackPublished"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackPublished { - return new LocalTrackPublished().fromBinary(bytes, options); - } + trackSid: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): LocalTrackPublished { - return new LocalTrackPublished().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LocalTrackPublished { - return new LocalTrackPublished().fromJsonString(jsonString, options); - } - - static equals(a: LocalTrackPublished | PlainMessage | undefined, b: LocalTrackPublished | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackPublished, a, b); - } -} +/** + * Describes the message livekit.proto.LocalTrackPublished. + * Use `create(LocalTrackPublishedSchema)` to create a new message. + */ +export const LocalTrackPublishedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 54); /** * @generated from message livekit.proto.LocalTrackUnpublished */ -export class LocalTrackUnpublished extends Message { +export type LocalTrackUnpublished = Message<"livekit.proto.LocalTrackUnpublished"> & { /** - * @generated from field: string publication_sid = 1; + * @generated from field: required string publication_sid = 1; */ - publicationSid = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.LocalTrackUnpublished"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackUnpublished { - return new LocalTrackUnpublished().fromBinary(bytes, options); - } + publicationSid: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): LocalTrackUnpublished { - return new LocalTrackUnpublished().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LocalTrackUnpublished { - return new LocalTrackUnpublished().fromJsonString(jsonString, options); - } - - static equals(a: LocalTrackUnpublished | PlainMessage | undefined, b: LocalTrackUnpublished | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackUnpublished, a, b); - } -} +/** + * Describes the message livekit.proto.LocalTrackUnpublished. + * Use `create(LocalTrackUnpublishedSchema)` to create a new message. + */ +export const LocalTrackUnpublishedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 55); /** * @generated from message livekit.proto.LocalTrackSubscribed */ -export class LocalTrackSubscribed extends Message { +export type LocalTrackSubscribed = Message<"livekit.proto.LocalTrackSubscribed"> & { /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.LocalTrackSubscribed"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackSubscribed { - return new LocalTrackSubscribed().fromBinary(bytes, options); - } + trackSid: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): LocalTrackSubscribed { - return new LocalTrackSubscribed().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LocalTrackSubscribed { - return new LocalTrackSubscribed().fromJsonString(jsonString, options); - } - - static equals(a: LocalTrackSubscribed | PlainMessage | undefined, b: LocalTrackSubscribed | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackSubscribed, a, b); - } -} +/** + * Describes the message livekit.proto.LocalTrackSubscribed. + * Use `create(LocalTrackSubscribedSchema)` to create a new message. + */ +export const LocalTrackSubscribedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 56); /** * @generated from message livekit.proto.TrackPublished */ -export class TrackPublished extends Message { +export type TrackPublished = Message<"livekit.proto.TrackPublished"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: livekit.proto.OwnedTrackPublication publication = 2; + * @generated from field: required livekit.proto.OwnedTrackPublication publication = 2; */ publication?: OwnedTrackPublication; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackPublished"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "publication", kind: "message", T: OwnedTrackPublication }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackPublished { - return new TrackPublished().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TrackPublished { - return new TrackPublished().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackPublished { - return new TrackPublished().fromJsonString(jsonString, options); - } - - static equals(a: TrackPublished | PlainMessage | undefined, b: TrackPublished | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackPublished, a, b); - } -} +/** + * Describes the message livekit.proto.TrackPublished. + * Use `create(TrackPublishedSchema)` to create a new message. + */ +export const TrackPublishedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 57); /** * @generated from message livekit.proto.TrackUnpublished */ -export class TrackUnpublished extends Message { +export type TrackUnpublished = Message<"livekit.proto.TrackUnpublished"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string publication_sid = 2; + * @generated from field: required string publication_sid = 2; */ - publicationSid = ""; + publicationSid: string; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackUnpublished"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "publication_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackUnpublished { - return new TrackUnpublished().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TrackUnpublished { - return new TrackUnpublished().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackUnpublished { - return new TrackUnpublished().fromJsonString(jsonString, options); - } - - static equals(a: TrackUnpublished | PlainMessage | undefined, b: TrackUnpublished | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackUnpublished, a, b); - } -} +/** + * Describes the message livekit.proto.TrackUnpublished. + * Use `create(TrackUnpublishedSchema)` to create a new message. + */ +export const TrackUnpublishedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 58); /** * Publication isn't needed for subscription events on the FFI @@ -3129,771 +1724,411 @@ export class TrackUnpublished extends Message { * * @generated from message livekit.proto.TrackSubscribed */ -export class TrackSubscribed extends Message { +export type TrackSubscribed = Message<"livekit.proto.TrackSubscribed"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: livekit.proto.OwnedTrack track = 2; + * @generated from field: required livekit.proto.OwnedTrack track = 2; */ track?: OwnedTrack; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackSubscribed"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "track", kind: "message", T: OwnedTrack }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackSubscribed { - return new TrackSubscribed().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TrackSubscribed { - return new TrackSubscribed().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackSubscribed { - return new TrackSubscribed().fromJsonString(jsonString, options); - } - - static equals(a: TrackSubscribed | PlainMessage | undefined, b: TrackSubscribed | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackSubscribed, a, b); - } -} +/** + * Describes the message livekit.proto.TrackSubscribed. + * Use `create(TrackSubscribedSchema)` to create a new message. + */ +export const TrackSubscribedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 59); /** * @generated from message livekit.proto.TrackUnsubscribed */ -export class TrackUnsubscribed extends Message { +export type TrackUnsubscribed = Message<"livekit.proto.TrackUnsubscribed"> & { /** * The FFI language can dispose/remove the VideoSink here * - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackUnsubscribed"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackUnsubscribed { - return new TrackUnsubscribed().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TrackUnsubscribed { - return new TrackUnsubscribed().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackUnsubscribed { - return new TrackUnsubscribed().fromJsonString(jsonString, options); - } + trackSid: string; +}; - static equals(a: TrackUnsubscribed | PlainMessage | undefined, b: TrackUnsubscribed | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackUnsubscribed, a, b); - } -} +/** + * Describes the message livekit.proto.TrackUnsubscribed. + * Use `create(TrackUnsubscribedSchema)` to create a new message. + */ +export const TrackUnsubscribedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 60); /** * @generated from message livekit.proto.TrackSubscriptionFailed */ -export class TrackSubscriptionFailed extends Message { +export type TrackSubscriptionFailed = Message<"livekit.proto.TrackSubscriptionFailed"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; + trackSid: string; /** - * @generated from field: string error = 3; + * @generated from field: required string error = 3; */ - error = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackSubscriptionFailed"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackSubscriptionFailed { - return new TrackSubscriptionFailed().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TrackSubscriptionFailed { - return new TrackSubscriptionFailed().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackSubscriptionFailed { - return new TrackSubscriptionFailed().fromJsonString(jsonString, options); - } + error: string; +}; - static equals(a: TrackSubscriptionFailed | PlainMessage | undefined, b: TrackSubscriptionFailed | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackSubscriptionFailed, a, b); - } -} +/** + * Describes the message livekit.proto.TrackSubscriptionFailed. + * Use `create(TrackSubscriptionFailedSchema)` to create a new message. + */ +export const TrackSubscriptionFailedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 61); /** * @generated from message livekit.proto.TrackMuted */ -export class TrackMuted extends Message { +export type TrackMuted = Message<"livekit.proto.TrackMuted"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackMuted"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackMuted { - return new TrackMuted().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TrackMuted { - return new TrackMuted().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackMuted { - return new TrackMuted().fromJsonString(jsonString, options); - } + trackSid: string; +}; - static equals(a: TrackMuted | PlainMessage | undefined, b: TrackMuted | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackMuted, a, b); - } -} +/** + * Describes the message livekit.proto.TrackMuted. + * Use `create(TrackMutedSchema)` to create a new message. + */ +export const TrackMutedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 62); /** * @generated from message livekit.proto.TrackUnmuted */ -export class TrackUnmuted extends Message { +export type TrackUnmuted = Message<"livekit.proto.TrackUnmuted"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string track_sid = 2; + * @generated from field: required string track_sid = 2; */ - trackSid = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackUnmuted"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackUnmuted { - return new TrackUnmuted().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TrackUnmuted { - return new TrackUnmuted().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackUnmuted { - return new TrackUnmuted().fromJsonString(jsonString, options); - } + trackSid: string; +}; - static equals(a: TrackUnmuted | PlainMessage | undefined, b: TrackUnmuted | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackUnmuted, a, b); - } -} +/** + * Describes the message livekit.proto.TrackUnmuted. + * Use `create(TrackUnmutedSchema)` to create a new message. + */ +export const TrackUnmutedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 63); /** * @generated from message livekit.proto.E2eeStateChanged */ -export class E2eeStateChanged extends Message { +export type E2eeStateChanged = Message<"livekit.proto.E2eeStateChanged"> & { /** * Using sid instead of identity for ffi communication * - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: livekit.proto.EncryptionState state = 2; + * @generated from field: required livekit.proto.EncryptionState state = 2; */ - state = EncryptionState.NEW; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.E2eeStateChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(EncryptionState) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): E2eeStateChanged { - return new E2eeStateChanged().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): E2eeStateChanged { - return new E2eeStateChanged().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): E2eeStateChanged { - return new E2eeStateChanged().fromJsonString(jsonString, options); - } + state: EncryptionState; +}; - static equals(a: E2eeStateChanged | PlainMessage | undefined, b: E2eeStateChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(E2eeStateChanged, a, b); - } -} +/** + * Describes the message livekit.proto.E2eeStateChanged. + * Use `create(E2eeStateChangedSchema)` to create a new message. + */ +export const E2eeStateChangedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 64); /** * @generated from message livekit.proto.ActiveSpeakersChanged */ -export class ActiveSpeakersChanged extends Message { +export type ActiveSpeakersChanged = Message<"livekit.proto.ActiveSpeakersChanged"> & { /** * @generated from field: repeated string participant_identities = 1; */ - participantIdentities: string[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ActiveSpeakersChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identities", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ActiveSpeakersChanged { - return new ActiveSpeakersChanged().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ActiveSpeakersChanged { - return new ActiveSpeakersChanged().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ActiveSpeakersChanged { - return new ActiveSpeakersChanged().fromJsonString(jsonString, options); - } + participantIdentities: string[]; +}; - static equals(a: ActiveSpeakersChanged | PlainMessage | undefined, b: ActiveSpeakersChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ActiveSpeakersChanged, a, b); - } -} +/** + * Describes the message livekit.proto.ActiveSpeakersChanged. + * Use `create(ActiveSpeakersChangedSchema)` to create a new message. + */ +export const ActiveSpeakersChangedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 65); /** * @generated from message livekit.proto.RoomMetadataChanged */ -export class RoomMetadataChanged extends Message { +export type RoomMetadataChanged = Message<"livekit.proto.RoomMetadataChanged"> & { /** - * @generated from field: string metadata = 1; + * @generated from field: required string metadata = 1; */ - metadata = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RoomMetadataChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RoomMetadataChanged { - return new RoomMetadataChanged().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RoomMetadataChanged { - return new RoomMetadataChanged().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RoomMetadataChanged { - return new RoomMetadataChanged().fromJsonString(jsonString, options); - } + metadata: string; +}; - static equals(a: RoomMetadataChanged | PlainMessage | undefined, b: RoomMetadataChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomMetadataChanged, a, b); - } -} +/** + * Describes the message livekit.proto.RoomMetadataChanged. + * Use `create(RoomMetadataChangedSchema)` to create a new message. + */ +export const RoomMetadataChangedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 66); /** * @generated from message livekit.proto.RoomSidChanged */ -export class RoomSidChanged extends Message { +export type RoomSidChanged = Message<"livekit.proto.RoomSidChanged"> & { /** - * @generated from field: string sid = 1; + * @generated from field: required 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); - } + sid: string; +}; - static equals(a: RoomSidChanged | PlainMessage | undefined, b: RoomSidChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomSidChanged, a, b); - } -} +/** + * Describes the message livekit.proto.RoomSidChanged. + * Use `create(RoomSidChangedSchema)` to create a new message. + */ +export const RoomSidChangedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 67); /** * @generated from message livekit.proto.ParticipantMetadataChanged */ -export class ParticipantMetadataChanged extends Message { +export type ParticipantMetadataChanged = Message<"livekit.proto.ParticipantMetadataChanged"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string metadata = 2; + * @generated from field: required string metadata = 2; */ - metadata = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ParticipantMetadataChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "metadata", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantMetadataChanged { - return new ParticipantMetadataChanged().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ParticipantMetadataChanged { - return new ParticipantMetadataChanged().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ParticipantMetadataChanged { - return new ParticipantMetadataChanged().fromJsonString(jsonString, options); - } + metadata: string; +}; - static equals(a: ParticipantMetadataChanged | PlainMessage | undefined, b: ParticipantMetadataChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantMetadataChanged, a, b); - } -} +/** + * Describes the message livekit.proto.ParticipantMetadataChanged. + * Use `create(ParticipantMetadataChangedSchema)` to create a new message. + */ +export const ParticipantMetadataChangedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 68); /** * @generated from message livekit.proto.ParticipantAttributesChanged */ -export class ParticipantAttributesChanged extends Message { +export type ParticipantAttributesChanged = Message<"livekit.proto.ParticipantAttributesChanged"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: map attributes = 2; + * @generated from field: repeated livekit.proto.AttributesEntry attributes = 2; */ - attributes: { [key: string]: string } = {}; + attributes: AttributesEntry[]; /** - * @generated from field: map changed_attributes = 3; + * @generated from field: repeated livekit.proto.AttributesEntry changed_attributes = 3; */ - changedAttributes: { [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: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 3, name: "changed_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); - } + changedAttributes: AttributesEntry[]; +}; - static equals(a: ParticipantAttributesChanged | PlainMessage | undefined, b: ParticipantAttributesChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantAttributesChanged, a, b); - } -} +/** + * Describes the message livekit.proto.ParticipantAttributesChanged. + * Use `create(ParticipantAttributesChangedSchema)` to create a new message. + */ +export const ParticipantAttributesChangedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 69); /** * @generated from message livekit.proto.ParticipantNameChanged */ -export class ParticipantNameChanged extends Message { +export type ParticipantNameChanged = Message<"livekit.proto.ParticipantNameChanged"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ParticipantNameChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ParticipantNameChanged { - return new ParticipantNameChanged().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ParticipantNameChanged { - return new ParticipantNameChanged().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ParticipantNameChanged { - return new ParticipantNameChanged().fromJsonString(jsonString, options); - } + name: string; +}; - static equals(a: ParticipantNameChanged | PlainMessage | undefined, b: ParticipantNameChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ParticipantNameChanged, a, b); - } -} +/** + * Describes the message livekit.proto.ParticipantNameChanged. + * Use `create(ParticipantNameChangedSchema)` to create a new message. + */ +export const ParticipantNameChangedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 70); /** * @generated from message livekit.proto.ConnectionQualityChanged */ -export class ConnectionQualityChanged extends Message { +export type ConnectionQualityChanged = Message<"livekit.proto.ConnectionQualityChanged"> & { /** - * @generated from field: string participant_identity = 1; + * @generated from field: required string participant_identity = 1; */ - participantIdentity = ""; + participantIdentity: string; /** - * @generated from field: livekit.proto.ConnectionQuality quality = 2; + * @generated from field: required livekit.proto.ConnectionQuality quality = 2; */ - quality = ConnectionQuality.QUALITY_POOR; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ConnectionQualityChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "quality", kind: "enum", T: proto3.getEnumType(ConnectionQuality) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ConnectionQualityChanged { - return new ConnectionQualityChanged().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ConnectionQualityChanged { - return new ConnectionQualityChanged().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ConnectionQualityChanged { - return new ConnectionQualityChanged().fromJsonString(jsonString, options); - } + quality: ConnectionQuality; +}; - static equals(a: ConnectionQualityChanged | PlainMessage | undefined, b: ConnectionQualityChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectionQualityChanged, a, b); - } -} +/** + * Describes the message livekit.proto.ConnectionQualityChanged. + * Use `create(ConnectionQualityChangedSchema)` to create a new message. + */ +export const ConnectionQualityChangedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 71); /** * @generated from message livekit.proto.UserPacket */ -export class UserPacket extends Message { +export type UserPacket = Message<"livekit.proto.UserPacket"> & { /** - * @generated from field: livekit.proto.OwnedBuffer data = 1; + * @generated from field: required livekit.proto.OwnedBuffer data = 1; */ data?: OwnedBuffer; /** * @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); - } + topic: string; +}; - static equals(a: UserPacket | PlainMessage | undefined, b: UserPacket | PlainMessage | undefined): boolean { - return proto3.util.equals(UserPacket, a, b); - } -} +/** + * Describes the message livekit.proto.UserPacket. + * Use `create(UserPacketSchema)` to create a new message. + */ +export const UserPacketSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 72); /** * @generated from message livekit.proto.ChatMessage */ -export class ChatMessage extends Message { +export type ChatMessage = Message<"livekit.proto.ChatMessage"> & { /** - * @generated from field: string id = 1; + * @generated from field: required string id = 1; */ - id = ""; + id: string; /** - * @generated from field: int64 timestamp = 2; + * @generated from field: required int64 timestamp = 2; */ - timestamp = protoInt64.zero; + timestamp: bigint; /** - * @generated from field: string message = 3; + * @generated from field: required string message = 3; */ - message = ""; + message: string; /** * @generated from field: optional int64 edit_timestamp = 4; */ - editTimestamp?: bigint; + editTimestamp: bigint; /** * @generated from field: optional bool deleted = 5; */ - deleted?: boolean; + deleted: boolean; /** * @generated from field: optional bool generated = 6; */ - generated?: boolean; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ChatMessage"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 3, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "edit_timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, - { no: 5, name: "deleted", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - { no: 6, name: "generated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ChatMessage { - return new ChatMessage().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChatMessage { - return new ChatMessage().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ChatMessage { - return new ChatMessage().fromJsonString(jsonString, options); - } - - static equals(a: ChatMessage | PlainMessage | undefined, b: ChatMessage | PlainMessage | undefined): boolean { - return proto3.util.equals(ChatMessage, a, b); - } -} + generated: boolean; +}; + +/** + * Describes the message livekit.proto.ChatMessage. + * Use `create(ChatMessageSchema)` to create a new message. + */ +export const ChatMessageSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 73); /** * @generated from message livekit.proto.ChatMessageReceived */ -export class ChatMessageReceived extends Message { +export type ChatMessageReceived = Message<"livekit.proto.ChatMessageReceived"> & { /** - * @generated from field: livekit.proto.ChatMessage message = 1; + * @generated from field: required livekit.proto.ChatMessage message = 1; */ message?: ChatMessage; /** - * @generated from field: string participant_identity = 2; + * @generated from field: required string participant_identity = 2; */ - participantIdentity = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + participantIdentity: string; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ChatMessageReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "message", kind: "message", T: ChatMessage }, - { no: 2, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ChatMessageReceived { - return new ChatMessageReceived().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChatMessageReceived { - return new ChatMessageReceived().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ChatMessageReceived { - return new ChatMessageReceived().fromJsonString(jsonString, options); - } - - static equals(a: ChatMessageReceived | PlainMessage | undefined, b: ChatMessageReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(ChatMessageReceived, a, b); - } -} +/** + * Describes the message livekit.proto.ChatMessageReceived. + * Use `create(ChatMessageReceivedSchema)` to create a new message. + */ +export const ChatMessageReceivedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 74); /** * @generated from message livekit.proto.SipDTMF */ -export class SipDTMF extends Message { +export type SipDTMF = Message<"livekit.proto.SipDTMF"> & { /** - * @generated from field: uint32 code = 1; + * @generated from field: required uint32 code = 1; */ - code = 0; + code: number; /** * @generated from field: optional string digit = 2; */ - digit?: string; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + digit: string; +}; - 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); - } -} +/** + * Describes the message livekit.proto.SipDTMF. + * Use `create(SipDTMFSchema)` to create a new message. + */ +export const SipDTMFSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 75); /** * @generated from message livekit.proto.DataPacketReceived */ -export class DataPacketReceived extends Message { +export type DataPacketReceived = Message<"livekit.proto.DataPacketReceived"> & { /** - * @generated from field: livekit.proto.DataPacketKind kind = 1; + * @generated from field: required livekit.proto.DataPacketKind kind = 1; */ - kind = DataPacketKind.KIND_LOSSY; + kind: DataPacketKind; /** * Can be empty if the data is sent a server SDK * - * @generated from field: string participant_identity = 2; + * @generated from field: required string participant_identity = 2; */ - participantIdentity = ""; + participantIdentity: string; /** * @generated from oneof livekit.proto.DataPacketReceived.value @@ -3910,283 +2145,337 @@ export class DataPacketReceived extends Message { */ value: SipDTMF; case: "sipDtmf"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.DataPacketReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { 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): DataPacketReceived { - return new DataPacketReceived().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DataPacketReceived { - return new DataPacketReceived().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DataPacketReceived { - return new DataPacketReceived().fromJsonString(jsonString, options); - } - - static equals(a: DataPacketReceived | PlainMessage | undefined, b: DataPacketReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(DataPacketReceived, a, b); - } -} + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message livekit.proto.DataPacketReceived. + * Use `create(DataPacketReceivedSchema)` to create a new message. + */ +export const DataPacketReceivedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 76); /** * @generated from message livekit.proto.TranscriptionReceived */ -export class TranscriptionReceived extends Message { +export type TranscriptionReceived = Message<"livekit.proto.TranscriptionReceived"> & { /** * @generated from field: optional string participant_identity = 1; */ - participantIdentity?: string; + participantIdentity: string; /** * @generated from field: optional string track_sid = 2; */ - trackSid?: string; + trackSid: string; /** * @generated from field: repeated livekit.proto.TranscriptionSegment segments = 3; */ - segments: TranscriptionSegment[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + segments: TranscriptionSegment[]; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TranscriptionReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_identity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 2, name: "track_sid", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 3, name: "segments", kind: "message", T: TranscriptionSegment, repeated: true }, - ]); +/** + * Describes the message livekit.proto.TranscriptionReceived. + * Use `create(TranscriptionReceivedSchema)` to create a new message. + */ +export const TranscriptionReceivedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 77); - static fromBinary(bytes: Uint8Array, options?: Partial): TranscriptionReceived { - return new TranscriptionReceived().fromBinary(bytes, options); - } +/** + * @generated from message livekit.proto.ConnectionStateChanged + */ +export type ConnectionStateChanged = Message<"livekit.proto.ConnectionStateChanged"> & { + /** + * @generated from field: required livekit.proto.ConnectionState state = 1; + */ + state: ConnectionState; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): TranscriptionReceived { - return new TranscriptionReceived().fromJson(jsonValue, options); - } +/** + * Describes the message livekit.proto.ConnectionStateChanged. + * Use `create(ConnectionStateChangedSchema)` to create a new message. + */ +export const ConnectionStateChangedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 78); - static fromJsonString(jsonString: string, options?: Partial): TranscriptionReceived { - return new TranscriptionReceived().fromJsonString(jsonString, options); - } +/** + * @generated from message livekit.proto.Connected + */ +export type Connected = Message<"livekit.proto.Connected"> & { +}; - static equals(a: TranscriptionReceived | PlainMessage | undefined, b: TranscriptionReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(TranscriptionReceived, a, b); - } -} +/** + * Describes the message livekit.proto.Connected. + * Use `create(ConnectedSchema)` to create a new message. + */ +export const ConnectedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 79); /** - * @generated from message livekit.proto.ConnectionStateChanged + * @generated from message livekit.proto.Disconnected */ -export class ConnectionStateChanged extends Message { +export type Disconnected = Message<"livekit.proto.Disconnected"> & { /** - * @generated from field: livekit.proto.ConnectionState state = 1; + * @generated from field: required livekit.proto.DisconnectReason reason = 1; */ - state = ConnectionState.CONN_DISCONNECTED; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + reason: DisconnectReason; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ConnectionStateChanged"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "state", kind: "enum", T: proto3.getEnumType(ConnectionState) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ConnectionStateChanged { - return new ConnectionStateChanged().fromBinary(bytes, options); - } +/** + * Describes the message livekit.proto.Disconnected. + * Use `create(DisconnectedSchema)` to create a new message. + */ +export const DisconnectedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 80); - static fromJson(jsonValue: JsonValue, options?: Partial): ConnectionStateChanged { - return new ConnectionStateChanged().fromJson(jsonValue, options); - } +/** + * @generated from message livekit.proto.Reconnecting + */ +export type Reconnecting = Message<"livekit.proto.Reconnecting"> & { +}; - static fromJsonString(jsonString: string, options?: Partial): ConnectionStateChanged { - return new ConnectionStateChanged().fromJsonString(jsonString, options); - } +/** + * Describes the message livekit.proto.Reconnecting. + * Use `create(ReconnectingSchema)` to create a new message. + */ +export const ReconnectingSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 81); - static equals(a: ConnectionStateChanged | PlainMessage | undefined, b: ConnectionStateChanged | PlainMessage | undefined): boolean { - return proto3.util.equals(ConnectionStateChanged, a, b); - } -} +/** + * @generated from message livekit.proto.Reconnected + */ +export type Reconnected = Message<"livekit.proto.Reconnected"> & { +}; /** - * @generated from message livekit.proto.Connected + * Describes the message livekit.proto.Reconnected. + * Use `create(ReconnectedSchema)` to create a new message. */ -export class Connected extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +export const ReconnectedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 82); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.Connected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); +/** + * @generated from message livekit.proto.RoomEOS + */ +export type RoomEOS = Message<"livekit.proto.RoomEOS"> & { +}; - static fromBinary(bytes: Uint8Array, options?: Partial): Connected { - return new Connected().fromBinary(bytes, options); - } +/** + * Describes the message livekit.proto.RoomEOS. + * Use `create(RoomEOSSchema)` to create a new message. + */ +export const RoomEOSSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_room, 83); - static fromJson(jsonValue: JsonValue, options?: Partial): Connected { - return new Connected().fromJson(jsonValue, options); - } +/** + * @generated from enum livekit.proto.IceTransportType + */ +export enum IceTransportType { + /** + * @generated from enum value: TRANSPORT_RELAY = 0; + */ + TRANSPORT_RELAY = 0, - static fromJsonString(jsonString: string, options?: Partial): Connected { - return new Connected().fromJsonString(jsonString, options); - } + /** + * @generated from enum value: TRANSPORT_NOHOST = 1; + */ + TRANSPORT_NOHOST = 1, - static equals(a: Connected | PlainMessage | undefined, b: Connected | PlainMessage | undefined): boolean { - return proto3.util.equals(Connected, a, b); - } + /** + * @generated from enum value: TRANSPORT_ALL = 2; + */ + TRANSPORT_ALL = 2, } /** - * @generated from message livekit.proto.Disconnected + * Describes the enum livekit.proto.IceTransportType. + */ +export const IceTransportTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_room, 0); + +/** + * @generated from enum livekit.proto.ContinualGatheringPolicy */ -export class Disconnected extends Message { +export enum ContinualGatheringPolicy { /** - * @generated from field: livekit.proto.DisconnectReason reason = 1; + * @generated from enum value: GATHER_ONCE = 0; */ - reason = DisconnectReason.UNKNOWN_REASON; + GATHER_ONCE = 0, - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + /** + * @generated from enum value: GATHER_CONTINUALLY = 1; + */ + GATHER_CONTINUALLY = 1, +} - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.Disconnected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "reason", kind: "enum", T: proto3.getEnumType(DisconnectReason) }, - ]); +/** + * Describes the enum livekit.proto.ContinualGatheringPolicy. + */ +export const ContinualGatheringPolicySchema: GenEnum = /*@__PURE__*/ + enumDesc(file_room, 1); - static fromBinary(bytes: Uint8Array, options?: Partial): Disconnected { - return new Disconnected().fromBinary(bytes, options); - } +/** + * @generated from enum livekit.proto.ConnectionQuality + */ +export enum ConnectionQuality { + /** + * @generated from enum value: QUALITY_POOR = 0; + */ + QUALITY_POOR = 0, - static fromJson(jsonValue: JsonValue, options?: Partial): Disconnected { - return new Disconnected().fromJson(jsonValue, options); - } + /** + * @generated from enum value: QUALITY_GOOD = 1; + */ + QUALITY_GOOD = 1, - static fromJsonString(jsonString: string, options?: Partial): Disconnected { - return new Disconnected().fromJsonString(jsonString, options); - } + /** + * @generated from enum value: QUALITY_EXCELLENT = 2; + */ + QUALITY_EXCELLENT = 2, - static equals(a: Disconnected | PlainMessage | undefined, b: Disconnected | PlainMessage | undefined): boolean { - return proto3.util.equals(Disconnected, a, b); - } + /** + * @generated from enum value: QUALITY_LOST = 3; + */ + QUALITY_LOST = 3, } /** - * @generated from message livekit.proto.Reconnecting + * Describes the enum livekit.proto.ConnectionQuality. + */ +export const ConnectionQualitySchema: GenEnum = /*@__PURE__*/ + enumDesc(file_room, 2); + +/** + * @generated from enum livekit.proto.ConnectionState */ -export class Reconnecting extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +export enum ConnectionState { + /** + * @generated from enum value: CONN_DISCONNECTED = 0; + */ + CONN_DISCONNECTED = 0, - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.Reconnecting"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + /** + * @generated from enum value: CONN_CONNECTED = 1; + */ + CONN_CONNECTED = 1, - static fromBinary(bytes: Uint8Array, options?: Partial): Reconnecting { - return new Reconnecting().fromBinary(bytes, options); - } + /** + * @generated from enum value: CONN_RECONNECTING = 2; + */ + CONN_RECONNECTING = 2, +} - static fromJson(jsonValue: JsonValue, options?: Partial): Reconnecting { - return new Reconnecting().fromJson(jsonValue, options); - } +/** + * Describes the enum livekit.proto.ConnectionState. + */ +export const ConnectionStateSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_room, 3); - static fromJsonString(jsonString: string, options?: Partial): Reconnecting { - return new Reconnecting().fromJsonString(jsonString, options); - } +/** + * @generated from enum livekit.proto.DataPacketKind + */ +export enum DataPacketKind { + /** + * @generated from enum value: KIND_LOSSY = 0; + */ + KIND_LOSSY = 0, - static equals(a: Reconnecting | PlainMessage | undefined, b: Reconnecting | PlainMessage | undefined): boolean { - return proto3.util.equals(Reconnecting, a, b); - } + /** + * @generated from enum value: KIND_RELIABLE = 1; + */ + KIND_RELIABLE = 1, } /** - * @generated from message livekit.proto.Reconnected + * Describes the enum livekit.proto.DataPacketKind. */ -export class Reconnected extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +export const DataPacketKindSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_room, 4); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.Reconnected"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); +/** + * @generated from enum livekit.proto.DisconnectReason + */ +export enum DisconnectReason { + /** + * @generated from enum value: UNKNOWN_REASON = 0; + */ + UNKNOWN_REASON = 0, - static fromBinary(bytes: Uint8Array, options?: Partial): Reconnected { - return new Reconnected().fromBinary(bytes, options); - } + /** + * the client initiated the disconnect + * + * @generated from enum value: CLIENT_INITIATED = 1; + */ + CLIENT_INITIATED = 1, - static fromJson(jsonValue: JsonValue, options?: Partial): Reconnected { - return new Reconnected().fromJson(jsonValue, options); - } + /** + * another participant with the same identity has joined the room + * + * @generated from enum value: DUPLICATE_IDENTITY = 2; + */ + DUPLICATE_IDENTITY = 2, - static fromJsonString(jsonString: string, options?: Partial): Reconnected { - return new Reconnected().fromJsonString(jsonString, options); - } + /** + * the server instance is shutting down + * + * @generated from enum value: SERVER_SHUTDOWN = 3; + */ + SERVER_SHUTDOWN = 3, - static equals(a: Reconnected | PlainMessage | undefined, b: Reconnected | PlainMessage | undefined): boolean { - return proto3.util.equals(Reconnected, a, b); - } -} + /** + * RoomService.RemoveParticipant was called + * + * @generated from enum value: PARTICIPANT_REMOVED = 4; + */ + PARTICIPANT_REMOVED = 4, -/** - * @generated from message livekit.proto.RoomEOS - */ -export class RoomEOS extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + /** + * RoomService.DeleteRoom was called + * + * @generated from enum value: ROOM_DELETED = 5; + */ + ROOM_DELETED = 5, - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RoomEOS"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); + /** + * the client is attempting to resume a session, but server is not aware of it + * + * @generated from enum value: STATE_MISMATCH = 6; + */ + STATE_MISMATCH = 6, - static fromBinary(bytes: Uint8Array, options?: Partial): RoomEOS { - return new RoomEOS().fromBinary(bytes, options); - } + /** + * client was unable to connect fully + * + * @generated from enum value: JOIN_FAILURE = 7; + */ + JOIN_FAILURE = 7, - static fromJson(jsonValue: JsonValue, options?: Partial): RoomEOS { - return new RoomEOS().fromJson(jsonValue, options); - } + /** + * Cloud-only, the server requested Participant to migrate the connection elsewhere + * + * @generated from enum value: MIGRATION = 8; + */ + MIGRATION = 8, - static fromJsonString(jsonString: string, options?: Partial): RoomEOS { - return new RoomEOS().fromJsonString(jsonString, options); - } + /** + * the signal websocket was closed unexpectedly + * + * @generated from enum value: SIGNAL_CLOSE = 9; + */ + SIGNAL_CLOSE = 9, - static equals(a: RoomEOS | PlainMessage | undefined, b: RoomEOS | PlainMessage | undefined): boolean { - return proto3.util.equals(RoomEOS, a, b); - } + /** + * the room was closed, due to all Standard and Ingress participants having left + * + * @generated from enum value: ROOM_CLOSED = 10; + */ + ROOM_CLOSED = 10, } +/** + * Describes the enum livekit.proto.DisconnectReason. + */ +export const DisconnectReasonSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_room, 5); + diff --git a/packages/livekit-rtc/src/proto/stats_pb.ts b/packages/livekit-rtc/src/proto/stats_pb.ts index ee7a001f..f1a9e809 100644 --- a/packages/livekit-rtc/src/proto/stats_pb.ts +++ b/packages/livekit-rtc/src/proto/stats_pb.ts @@ -12,344 +12,24 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file stats.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file stats.proto (package livekit.proto, syntax proto2) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message } from "@bufbuild/protobuf"; /** - * @generated from enum livekit.proto.DataChannelState - */ -export enum DataChannelState { - /** - * @generated from enum value: DC_CONNECTING = 0; - */ - DC_CONNECTING = 0, - - /** - * @generated from enum value: DC_OPEN = 1; - */ - DC_OPEN = 1, - - /** - * @generated from enum value: DC_CLOSING = 2; - */ - DC_CLOSING = 2, - - /** - * @generated from enum value: DC_CLOSED = 3; - */ - DC_CLOSED = 3, -} -// Retrieve enum metadata with: proto3.getEnumType(DataChannelState) -proto3.util.setEnumType(DataChannelState, "livekit.proto.DataChannelState", [ - { no: 0, name: "DC_CONNECTING" }, - { no: 1, name: "DC_OPEN" }, - { no: 2, name: "DC_CLOSING" }, - { no: 3, name: "DC_CLOSED" }, -]); - -/** - * @generated from enum livekit.proto.QualityLimitationReason - */ -export enum QualityLimitationReason { - /** - * @generated from enum value: LIMITATION_NONE = 0; - */ - LIMITATION_NONE = 0, - - /** - * @generated from enum value: LIMITATION_CPU = 1; - */ - LIMITATION_CPU = 1, - - /** - * @generated from enum value: LIMITATION_BANDWIDTH = 2; - */ - LIMITATION_BANDWIDTH = 2, - - /** - * @generated from enum value: LIMITATION_OTHER = 3; - */ - LIMITATION_OTHER = 3, -} -// Retrieve enum metadata with: proto3.getEnumType(QualityLimitationReason) -proto3.util.setEnumType(QualityLimitationReason, "livekit.proto.QualityLimitationReason", [ - { no: 0, name: "LIMITATION_NONE" }, - { no: 1, name: "LIMITATION_CPU" }, - { no: 2, name: "LIMITATION_BANDWIDTH" }, - { no: 3, name: "LIMITATION_OTHER" }, -]); - -/** - * @generated from enum livekit.proto.IceRole + * Describes the file stats.proto. */ -export enum IceRole { - /** - * @generated from enum value: ICE_UNKNOWN = 0; - */ - ICE_UNKNOWN = 0, - - /** - * @generated from enum value: ICE_CONTROLLING = 1; - */ - ICE_CONTROLLING = 1, - - /** - * @generated from enum value: ICE_CONTROLLED = 2; - */ - ICE_CONTROLLED = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(IceRole) -proto3.util.setEnumType(IceRole, "livekit.proto.IceRole", [ - { no: 0, name: "ICE_UNKNOWN" }, - { no: 1, name: "ICE_CONTROLLING" }, - { no: 2, name: "ICE_CONTROLLED" }, -]); - -/** - * @generated from enum livekit.proto.DtlsTransportState - */ -export enum DtlsTransportState { - /** - * @generated from enum value: DTLS_TRANSPORT_NEW = 0; - */ - DTLS_TRANSPORT_NEW = 0, - - /** - * @generated from enum value: DTLS_TRANSPORT_CONNECTING = 1; - */ - DTLS_TRANSPORT_CONNECTING = 1, - - /** - * @generated from enum value: DTLS_TRANSPORT_CONNECTED = 2; - */ - DTLS_TRANSPORT_CONNECTED = 2, - - /** - * @generated from enum value: DTLS_TRANSPORT_CLOSED = 3; - */ - DTLS_TRANSPORT_CLOSED = 3, - - /** - * @generated from enum value: DTLS_TRANSPORT_FAILED = 4; - */ - DTLS_TRANSPORT_FAILED = 4, -} -// Retrieve enum metadata with: proto3.getEnumType(DtlsTransportState) -proto3.util.setEnumType(DtlsTransportState, "livekit.proto.DtlsTransportState", [ - { no: 0, name: "DTLS_TRANSPORT_NEW" }, - { no: 1, name: "DTLS_TRANSPORT_CONNECTING" }, - { no: 2, name: "DTLS_TRANSPORT_CONNECTED" }, - { no: 3, name: "DTLS_TRANSPORT_CLOSED" }, - { no: 4, name: "DTLS_TRANSPORT_FAILED" }, -]); - -/** - * @generated from enum livekit.proto.IceTransportState - */ -export enum IceTransportState { - /** - * @generated from enum value: ICE_TRANSPORT_NEW = 0; - */ - ICE_TRANSPORT_NEW = 0, - - /** - * @generated from enum value: ICE_TRANSPORT_CHECKING = 1; - */ - ICE_TRANSPORT_CHECKING = 1, - - /** - * @generated from enum value: ICE_TRANSPORT_CONNECTED = 2; - */ - ICE_TRANSPORT_CONNECTED = 2, - - /** - * @generated from enum value: ICE_TRANSPORT_COMPLETED = 3; - */ - ICE_TRANSPORT_COMPLETED = 3, - - /** - * @generated from enum value: ICE_TRANSPORT_DISCONNECTED = 4; - */ - ICE_TRANSPORT_DISCONNECTED = 4, - - /** - * @generated from enum value: ICE_TRANSPORT_FAILED = 5; - */ - ICE_TRANSPORT_FAILED = 5, - - /** - * @generated from enum value: ICE_TRANSPORT_CLOSED = 6; - */ - ICE_TRANSPORT_CLOSED = 6, -} -// Retrieve enum metadata with: proto3.getEnumType(IceTransportState) -proto3.util.setEnumType(IceTransportState, "livekit.proto.IceTransportState", [ - { no: 0, name: "ICE_TRANSPORT_NEW" }, - { no: 1, name: "ICE_TRANSPORT_CHECKING" }, - { no: 2, name: "ICE_TRANSPORT_CONNECTED" }, - { no: 3, name: "ICE_TRANSPORT_COMPLETED" }, - { no: 4, name: "ICE_TRANSPORT_DISCONNECTED" }, - { no: 5, name: "ICE_TRANSPORT_FAILED" }, - { no: 6, name: "ICE_TRANSPORT_CLOSED" }, -]); - -/** - * @generated from enum livekit.proto.DtlsRole - */ -export enum DtlsRole { - /** - * @generated from enum value: DTLS_CLIENT = 0; - */ - DTLS_CLIENT = 0, - - /** - * @generated from enum value: DTLS_SERVER = 1; - */ - DTLS_SERVER = 1, - - /** - * @generated from enum value: DTLS_UNKNOWN = 2; - */ - DTLS_UNKNOWN = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(DtlsRole) -proto3.util.setEnumType(DtlsRole, "livekit.proto.DtlsRole", [ - { no: 0, name: "DTLS_CLIENT" }, - { no: 1, name: "DTLS_SERVER" }, - { no: 2, name: "DTLS_UNKNOWN" }, -]); - -/** - * @generated from enum livekit.proto.IceCandidatePairState - */ -export enum IceCandidatePairState { - /** - * @generated from enum value: PAIR_FROZEN = 0; - */ - PAIR_FROZEN = 0, - - /** - * @generated from enum value: PAIR_WAITING = 1; - */ - PAIR_WAITING = 1, - - /** - * @generated from enum value: PAIR_IN_PROGRESS = 2; - */ - PAIR_IN_PROGRESS = 2, - - /** - * @generated from enum value: PAIR_FAILED = 3; - */ - PAIR_FAILED = 3, - - /** - * @generated from enum value: PAIR_SUCCEEDED = 4; - */ - PAIR_SUCCEEDED = 4, -} -// Retrieve enum metadata with: proto3.getEnumType(IceCandidatePairState) -proto3.util.setEnumType(IceCandidatePairState, "livekit.proto.IceCandidatePairState", [ - { no: 0, name: "PAIR_FROZEN" }, - { no: 1, name: "PAIR_WAITING" }, - { no: 2, name: "PAIR_IN_PROGRESS" }, - { no: 3, name: "PAIR_FAILED" }, - { no: 4, name: "PAIR_SUCCEEDED" }, -]); - -/** - * @generated from enum livekit.proto.IceCandidateType - */ -export enum IceCandidateType { - /** - * @generated from enum value: HOST = 0; - */ - HOST = 0, - - /** - * @generated from enum value: SRFLX = 1; - */ - SRFLX = 1, - - /** - * @generated from enum value: PRFLX = 2; - */ - PRFLX = 2, - - /** - * @generated from enum value: RELAY = 3; - */ - RELAY = 3, -} -// Retrieve enum metadata with: proto3.getEnumType(IceCandidateType) -proto3.util.setEnumType(IceCandidateType, "livekit.proto.IceCandidateType", [ - { no: 0, name: "HOST" }, - { no: 1, name: "SRFLX" }, - { no: 2, name: "PRFLX" }, - { no: 3, name: "RELAY" }, -]); - -/** - * @generated from enum livekit.proto.IceServerTransportProtocol - */ -export enum IceServerTransportProtocol { - /** - * @generated from enum value: TRANSPORT_UDP = 0; - */ - TRANSPORT_UDP = 0, - - /** - * @generated from enum value: TRANSPORT_TCP = 1; - */ - TRANSPORT_TCP = 1, - - /** - * @generated from enum value: TRANSPORT_TLS = 2; - */ - TRANSPORT_TLS = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(IceServerTransportProtocol) -proto3.util.setEnumType(IceServerTransportProtocol, "livekit.proto.IceServerTransportProtocol", [ - { no: 0, name: "TRANSPORT_UDP" }, - { no: 1, name: "TRANSPORT_TCP" }, - { no: 2, name: "TRANSPORT_TLS" }, -]); - -/** - * @generated from enum livekit.proto.IceTcpCandidateType - */ -export enum IceTcpCandidateType { - /** - * @generated from enum value: CANDIDATE_ACTIVE = 0; - */ - CANDIDATE_ACTIVE = 0, - - /** - * @generated from enum value: CANDIDATE_PASSIVE = 1; - */ - CANDIDATE_PASSIVE = 1, - - /** - * @generated from enum value: CANDIDATE_SO = 2; - */ - CANDIDATE_SO = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(IceTcpCandidateType) -proto3.util.setEnumType(IceTcpCandidateType, "livekit.proto.IceTcpCandidateType", [ - { no: 0, name: "CANDIDATE_ACTIVE" }, - { no: 1, name: "CANDIDATE_PASSIVE" }, - { no: 2, name: "CANDIDATE_SO" }, -]); +export const file_stats: GenFile = /*@__PURE__*/ + fileDesc("CgtzdGF0cy5wcm90bxINbGl2ZWtpdC5wcm90byLZFwoIUnRjU3RhdHMSLgoFY29kZWMYAyABKAsyHS5saXZla2l0LnByb3RvLlJ0Y1N0YXRzLkNvZGVjSAASOQoLaW5ib3VuZF9ydHAYBCABKAsyIi5saXZla2l0LnByb3RvLlJ0Y1N0YXRzLkluYm91bmRSdHBIABI7CgxvdXRib3VuZF9ydHAYBSABKAsyIy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzLk91dGJvdW5kUnRwSAASRgoScmVtb3RlX2luYm91bmRfcnRwGAYgASgLMigubGl2ZWtpdC5wcm90by5SdGNTdGF0cy5SZW1vdGVJbmJvdW5kUnRwSAASSAoTcmVtb3RlX291dGJvdW5kX3J0cBgHIAEoCzIpLmxpdmVraXQucHJvdG8uUnRjU3RhdHMuUmVtb3RlT3V0Ym91bmRSdHBIABI7CgxtZWRpYV9zb3VyY2UYCCABKAsyIy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzLk1lZGlhU291cmNlSAASPQoNbWVkaWFfcGxheW91dBgJIAEoCzIkLmxpdmVraXQucHJvdG8uUnRjU3RhdHMuTWVkaWFQbGF5b3V0SAASQQoPcGVlcl9jb25uZWN0aW9uGAogASgLMiYubGl2ZWtpdC5wcm90by5SdGNTdGF0cy5QZWVyQ29ubmVjdGlvbkgAEjsKDGRhdGFfY2hhbm5lbBgLIAEoCzIjLmxpdmVraXQucHJvdG8uUnRjU3RhdHMuRGF0YUNoYW5uZWxIABI2Cgl0cmFuc3BvcnQYDCABKAsyIS5saXZla2l0LnByb3RvLlJ0Y1N0YXRzLlRyYW5zcG9ydEgAEj8KDmNhbmRpZGF0ZV9wYWlyGA0gASgLMiUubGl2ZWtpdC5wcm90by5SdGNTdGF0cy5DYW5kaWRhdGVQYWlySAASQQoPbG9jYWxfY2FuZGlkYXRlGA4gASgLMiYubGl2ZWtpdC5wcm90by5SdGNTdGF0cy5Mb2NhbENhbmRpZGF0ZUgAEkMKEHJlbW90ZV9jYW5kaWRhdGUYDyABKAsyJy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzLlJlbW90ZUNhbmRpZGF0ZUgAEjoKC2NlcnRpZmljYXRlGBAgASgLMiMubGl2ZWtpdC5wcm90by5SdGNTdGF0cy5DZXJ0aWZpY2F0ZUgAEi4KBXRyYWNrGBEgASgLMh0ubGl2ZWtpdC5wcm90by5SdGNTdGF0cy5UcmFja0gAGlsKBUNvZGVjEigKA3J0YxgBIAIoCzIbLmxpdmVraXQucHJvdG8uUnRjU3RhdHNEYXRhEigKBWNvZGVjGAIgAigLMhkubGl2ZWtpdC5wcm90by5Db2RlY1N0YXRzGtUBCgpJbmJvdW5kUnRwEigKA3J0YxgBIAIoCzIbLmxpdmVraXQucHJvdG8uUnRjU3RhdHNEYXRhEi0KBnN0cmVhbRgCIAIoCzIdLmxpdmVraXQucHJvdG8uUnRwU3RyZWFtU3RhdHMSNwoIcmVjZWl2ZWQYAyACKAsyJS5saXZla2l0LnByb3RvLlJlY2VpdmVkUnRwU3RyZWFtU3RhdHMSNQoHaW5ib3VuZBgEIAIoCzIkLmxpdmVraXQucHJvdG8uSW5ib3VuZFJ0cFN0cmVhbVN0YXRzGtABCgtPdXRib3VuZFJ0cBIoCgNydGMYASACKAsyGy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzRGF0YRItCgZzdHJlYW0YAiACKAsyHS5saXZla2l0LnByb3RvLlJ0cFN0cmVhbVN0YXRzEi8KBHNlbnQYAyACKAsyIS5saXZla2l0LnByb3RvLlNlbnRSdHBTdHJlYW1TdGF0cxI3CghvdXRib3VuZBgEIAIoCzIlLmxpdmVraXQucHJvdG8uT3V0Ym91bmRSdHBTdHJlYW1TdGF0cxroAQoQUmVtb3RlSW5ib3VuZFJ0cBIoCgNydGMYASACKAsyGy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzRGF0YRItCgZzdHJlYW0YAiACKAsyHS5saXZla2l0LnByb3RvLlJ0cFN0cmVhbVN0YXRzEjcKCHJlY2VpdmVkGAMgAigLMiUubGl2ZWtpdC5wcm90by5SZWNlaXZlZFJ0cFN0cmVhbVN0YXRzEkIKDnJlbW90ZV9pbmJvdW5kGAQgAigLMioubGl2ZWtpdC5wcm90by5SZW1vdGVJbmJvdW5kUnRwU3RyZWFtU3RhdHMa4wEKEVJlbW90ZU91dGJvdW5kUnRwEigKA3J0YxgBIAIoCzIbLmxpdmVraXQucHJvdG8uUnRjU3RhdHNEYXRhEi0KBnN0cmVhbRgCIAIoCzIdLmxpdmVraXQucHJvdG8uUnRwU3RyZWFtU3RhdHMSLwoEc2VudBgDIAIoCzIhLmxpdmVraXQucHJvdG8uU2VudFJ0cFN0cmVhbVN0YXRzEkQKD3JlbW90ZV9vdXRib3VuZBgEIAIoCzIrLmxpdmVraXQucHJvdG8uUmVtb3RlT3V0Ym91bmRSdHBTdHJlYW1TdGF0cxrIAQoLTWVkaWFTb3VyY2USKAoDcnRjGAEgAigLMhsubGl2ZWtpdC5wcm90by5SdGNTdGF0c0RhdGESLwoGc291cmNlGAIgAigLMh8ubGl2ZWtpdC5wcm90by5NZWRpYVNvdXJjZVN0YXRzEi4KBWF1ZGlvGAMgAigLMh8ubGl2ZWtpdC5wcm90by5BdWRpb1NvdXJjZVN0YXRzEi4KBXZpZGVvGAQgAigLMh8ubGl2ZWtpdC5wcm90by5WaWRlb1NvdXJjZVN0YXRzGnEKDE1lZGlhUGxheW91dBIoCgNydGMYASACKAsyGy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzRGF0YRI3Cg1hdWRpb19wbGF5b3V0GAIgAigLMiAubGl2ZWtpdC5wcm90by5BdWRpb1BsYXlvdXRTdGF0cxpqCg5QZWVyQ29ubmVjdGlvbhIoCgNydGMYASACKAsyGy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzRGF0YRIuCgJwYxgCIAIoCzIiLmxpdmVraXQucHJvdG8uUGVlckNvbm5lY3Rpb25TdGF0cxpkCgtEYXRhQ2hhbm5lbBIoCgNydGMYASACKAsyGy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzRGF0YRIrCgJkYxgCIAIoCzIfLmxpdmVraXQucHJvdG8uRGF0YUNoYW5uZWxTdGF0cxpnCglUcmFuc3BvcnQSKAoDcnRjGAEgAigLMhsubGl2ZWtpdC5wcm90by5SdGNTdGF0c0RhdGESMAoJdHJhbnNwb3J0GAIgAigLMh0ubGl2ZWtpdC5wcm90by5UcmFuc3BvcnRTdGF0cxp0Cg1DYW5kaWRhdGVQYWlyEigKA3J0YxgBIAIoCzIbLmxpdmVraXQucHJvdG8uUnRjU3RhdHNEYXRhEjkKDmNhbmRpZGF0ZV9wYWlyGAIgAigLMiEubGl2ZWtpdC5wcm90by5DYW5kaWRhdGVQYWlyU3RhdHMabwoOTG9jYWxDYW5kaWRhdGUSKAoDcnRjGAEgAigLMhsubGl2ZWtpdC5wcm90by5SdGNTdGF0c0RhdGESMwoJY2FuZGlkYXRlGAIgAigLMiAubGl2ZWtpdC5wcm90by5JY2VDYW5kaWRhdGVTdGF0cxpwCg9SZW1vdGVDYW5kaWRhdGUSKAoDcnRjGAEgAigLMhsubGl2ZWtpdC5wcm90by5SdGNTdGF0c0RhdGESMwoJY2FuZGlkYXRlGAIgAigLMiAubGl2ZWtpdC5wcm90by5JY2VDYW5kaWRhdGVTdGF0cxptCgtDZXJ0aWZpY2F0ZRIoCgNydGMYASACKAsyGy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzRGF0YRI0CgtjZXJ0aWZpY2F0ZRgCIAIoCzIfLmxpdmVraXQucHJvdG8uQ2VydGlmaWNhdGVTdGF0cxoHCgVUcmFja0IHCgVzdGF0cyItCgxSdGNTdGF0c0RhdGESCgoCaWQYASACKAkSEQoJdGltZXN0YW1wGAIgAigDIogBCgpDb2RlY1N0YXRzEhQKDHBheWxvYWRfdHlwZRgBIAIoDRIUCgx0cmFuc3BvcnRfaWQYAiACKAkSEQoJbWltZV90eXBlGAMgAigJEhIKCmNsb2NrX3JhdGUYBCACKA0SEAoIY2hhbm5lbHMYBSACKA0SFQoNc2RwX2ZtdHBfbGluZRgGIAIoCSJUCg5SdHBTdHJlYW1TdGF0cxIMCgRzc3JjGAEgAigNEgwKBGtpbmQYAiACKAkSFAoMdHJhbnNwb3J0X2lkGAMgAigJEhAKCGNvZGVjX2lkGAQgAigJIlgKFlJlY2VpdmVkUnRwU3RyZWFtU3RhdHMSGAoQcGFja2V0c19yZWNlaXZlZBgBIAIoBBIUCgxwYWNrZXRzX2xvc3QYAiACKAMSDgoGaml0dGVyGAMgAigBIoIMChVJbmJvdW5kUnRwU3RyZWFtU3RhdHMSGAoQdHJhY2tfaWRlbnRpZmllchgBIAIoCRILCgNtaWQYAiACKAkSEQoJcmVtb3RlX2lkGAMgAigJEhYKDmZyYW1lc19kZWNvZGVkGAQgAigNEhoKEmtleV9mcmFtZXNfZGVjb2RlZBgFIAIoDRIXCg9mcmFtZXNfcmVuZGVyZWQYBiACKA0SFgoOZnJhbWVzX2Ryb3BwZWQYByACKA0SEwoLZnJhbWVfd2lkdGgYCCACKA0SFAoMZnJhbWVfaGVpZ2h0GAkgAigNEhkKEWZyYW1lc19wZXJfc2Vjb25kGAogAigBEg4KBnFwX3N1bRgLIAIoBBIZChF0b3RhbF9kZWNvZGVfdGltZRgMIAIoARIfChd0b3RhbF9pbnRlcl9mcmFtZV9kZWxheRgNIAIoARInCh90b3RhbF9zcXVhcmVkX2ludGVyX2ZyYW1lX2RlbGF5GA4gAigBEhMKC3BhdXNlX2NvdW50GA8gAigNEhwKFHRvdGFsX3BhdXNlX2R1cmF0aW9uGBAgAigBEhQKDGZyZWV6ZV9jb3VudBgRIAIoDRIdChV0b3RhbF9mcmVlemVfZHVyYXRpb24YEiACKAESJgoebGFzdF9wYWNrZXRfcmVjZWl2ZWRfdGltZXN0YW1wGBMgAigBEh0KFWhlYWRlcl9ieXRlc19yZWNlaXZlZBgUIAIoBBIZChFwYWNrZXRzX2Rpc2NhcmRlZBgVIAIoBBIaChJmZWNfYnl0ZXNfcmVjZWl2ZWQYFiACKAQSHAoUZmVjX3BhY2tldHNfcmVjZWl2ZWQYFyACKAQSHQoVZmVjX3BhY2tldHNfZGlzY2FyZGVkGBggAigEEhYKDmJ5dGVzX3JlY2VpdmVkGBkgAigEEhIKCm5hY2tfY291bnQYGiACKA0SEQoJZmlyX2NvdW50GBsgAigNEhEKCXBsaV9jb3VudBgcIAIoDRIeChZ0b3RhbF9wcm9jZXNzaW5nX2RlbGF5GB0gAigBEiMKG2VzdGltYXRlZF9wbGF5b3V0X3RpbWVzdGFtcBgeIAIoARIbChNqaXR0ZXJfYnVmZmVyX2RlbGF5GB8gAigBEiIKGmppdHRlcl9idWZmZXJfdGFyZ2V0X2RlbGF5GCAgAigBEiMKG2ppdHRlcl9idWZmZXJfZW1pdHRlZF9jb3VudBghIAIoBBIjChtqaXR0ZXJfYnVmZmVyX21pbmltdW1fZGVsYXkYIiACKAESHgoWdG90YWxfc2FtcGxlc19yZWNlaXZlZBgjIAIoBBIZChFjb25jZWFsZWRfc2FtcGxlcxgkIAIoBBIgChhzaWxlbnRfY29uY2VhbGVkX3NhbXBsZXMYJSACKAQSGgoSY29uY2VhbG1lbnRfZXZlbnRzGCYgAigEEikKIWluc2VydGVkX3NhbXBsZXNfZm9yX2RlY2VsZXJhdGlvbhgnIAIoBBIoCiByZW1vdmVkX3NhbXBsZXNfZm9yX2FjY2VsZXJhdGlvbhgoIAIoBBITCgthdWRpb19sZXZlbBgpIAIoARIaChJ0b3RhbF9hdWRpb19lbmVyZ3kYKiACKAESHgoWdG90YWxfc2FtcGxlc19kdXJhdGlvbhgrIAIoARIXCg9mcmFtZXNfcmVjZWl2ZWQYLCACKAQSHgoWZGVjb2Rlcl9pbXBsZW1lbnRhdGlvbhgtIAIoCRISCgpwbGF5b3V0X2lkGC4gAigJEh8KF3Bvd2VyX2VmZmljaWVudF9kZWNvZGVyGC8gAigIEi4KJmZyYW1lc19hc3NlbWJsZWRfZnJvbV9tdWx0aXBsZV9wYWNrZXRzGDAgAigEEhsKE3RvdGFsX2Fzc2VtYmx5X3RpbWUYMSACKAESJgoecmV0cmFuc21pdHRlZF9wYWNrZXRzX3JlY2VpdmVkGDIgAigEEiQKHHJldHJhbnNtaXR0ZWRfYnl0ZXNfcmVjZWl2ZWQYMyACKAQSEAoIcnR4X3NzcmMYNCACKA0SEAoIZmVjX3NzcmMYNSACKA0iPgoSU2VudFJ0cFN0cmVhbVN0YXRzEhQKDHBhY2tldHNfc2VudBgBIAIoBBISCgpieXRlc19zZW50GAIgAigEItEHChZPdXRib3VuZFJ0cFN0cmVhbVN0YXRzEgsKA21pZBgBIAIoCRIXCg9tZWRpYV9zb3VyY2VfaWQYAiACKAkSEQoJcmVtb3RlX2lkGAMgAigJEgsKA3JpZBgEIAIoCRIZChFoZWFkZXJfYnl0ZXNfc2VudBgFIAIoBBIiChpyZXRyYW5zbWl0dGVkX3BhY2tldHNfc2VudBgGIAIoBBIgChhyZXRyYW5zbWl0dGVkX2J5dGVzX3NlbnQYByACKAQSEAoIcnR4X3NzcmMYCCACKA0SFgoOdGFyZ2V0X2JpdHJhdGUYCSACKAESIgoadG90YWxfZW5jb2RlZF9ieXRlc190YXJnZXQYCiACKAQSEwoLZnJhbWVfd2lkdGgYCyACKA0SFAoMZnJhbWVfaGVpZ2h0GAwgAigNEhkKEWZyYW1lc19wZXJfc2Vjb25kGA0gAigBEhMKC2ZyYW1lc19zZW50GA4gAigNEhgKEGh1Z2VfZnJhbWVzX3NlbnQYDyACKA0SFgoOZnJhbWVzX2VuY29kZWQYECACKA0SGgoSa2V5X2ZyYW1lc19lbmNvZGVkGBEgAigNEg4KBnFwX3N1bRgSIAIoBBIZChF0b3RhbF9lbmNvZGVfdGltZRgTIAIoARIfChd0b3RhbF9wYWNrZXRfc2VuZF9kZWxheRgUIAIoARJJChlxdWFsaXR5X2xpbWl0YXRpb25fcmVhc29uGBUgAigOMiYubGl2ZWtpdC5wcm90by5RdWFsaXR5TGltaXRhdGlvblJlYXNvbhJrChxxdWFsaXR5X2xpbWl0YXRpb25fZHVyYXRpb25zGBYgAygLMkUubGl2ZWtpdC5wcm90by5PdXRib3VuZFJ0cFN0cmVhbVN0YXRzLlF1YWxpdHlMaW1pdGF0aW9uRHVyYXRpb25zRW50cnkSLQolcXVhbGl0eV9saW1pdGF0aW9uX3Jlc29sdXRpb25fY2hhbmdlcxgXIAIoDRISCgpuYWNrX2NvdW50GBggAigNEhEKCWZpcl9jb3VudBgZIAIoDRIRCglwbGlfY291bnQYGiACKA0SHgoWZW5jb2Rlcl9pbXBsZW1lbnRhdGlvbhgbIAIoCRIfChdwb3dlcl9lZmZpY2llbnRfZW5jb2RlchgcIAIoCBIOCgZhY3RpdmUYHSACKAgSGAoQc2NhbGFiaWxpdHlfbW9kZRgeIAIoCRpBCh9RdWFsaXR5TGltaXRhdGlvbkR1cmF0aW9uc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoAToCOAEipAEKG1JlbW90ZUluYm91bmRSdHBTdHJlYW1TdGF0cxIQCghsb2NhbF9pZBgBIAIoCRIXCg9yb3VuZF90cmlwX3RpbWUYAiACKAESHQoVdG90YWxfcm91bmRfdHJpcF90aW1lGAMgAigBEhUKDWZyYWN0aW9uX2xvc3QYBCACKAESJAoccm91bmRfdHJpcF90aW1lX21lYXN1cmVtZW50cxgFIAIoBCK+AQocUmVtb3RlT3V0Ym91bmRSdHBTdHJlYW1TdGF0cxIQCghsb2NhbF9pZBgBIAIoCRIYChByZW1vdGVfdGltZXN0YW1wGAIgAigBEhQKDHJlcG9ydHNfc2VudBgDIAIoBBIXCg9yb3VuZF90cmlwX3RpbWUYBCACKAESHQoVdG90YWxfcm91bmRfdHJpcF90aW1lGAUgAigBEiQKHHJvdW5kX3RyaXBfdGltZV9tZWFzdXJlbWVudHMYBiACKAQiOgoQTWVkaWFTb3VyY2VTdGF0cxIYChB0cmFja19pZGVudGlmaWVyGAEgAigJEgwKBGtpbmQYAiACKAkiogIKEEF1ZGlvU291cmNlU3RhdHMSEwoLYXVkaW9fbGV2ZWwYASACKAESGgoSdG90YWxfYXVkaW9fZW5lcmd5GAIgAigBEh4KFnRvdGFsX3NhbXBsZXNfZHVyYXRpb24YAyACKAESGAoQZWNob19yZXR1cm5fbG9zcxgEIAIoARIkChxlY2hvX3JldHVybl9sb3NzX2VuaGFuY2VtZW50GAUgAigBEiAKGGRyb3BwZWRfc2FtcGxlc19kdXJhdGlvbhgGIAIoARIeChZkcm9wcGVkX3NhbXBsZXNfZXZlbnRzGAcgAigNEhsKE3RvdGFsX2NhcHR1cmVfZGVsYXkYCCACKAESHgoWdG90YWxfc2FtcGxlc19jYXB0dXJlZBgJIAIoBCJcChBWaWRlb1NvdXJjZVN0YXRzEg0KBXdpZHRoGAEgAigNEg4KBmhlaWdodBgCIAIoDRIOCgZmcmFtZXMYAyACKA0SGQoRZnJhbWVzX3Blcl9zZWNvbmQYBCACKAEixQEKEUF1ZGlvUGxheW91dFN0YXRzEgwKBGtpbmQYASACKAkSJAocc3ludGhlc2l6ZWRfc2FtcGxlc19kdXJhdGlvbhgCIAIoARIiChpzeW50aGVzaXplZF9zYW1wbGVzX2V2ZW50cxgDIAIoDRIeChZ0b3RhbF9zYW1wbGVzX2R1cmF0aW9uGAQgAigBEhsKE3RvdGFsX3BsYXlvdXRfZGVsYXkYBSACKAESGwoTdG90YWxfc2FtcGxlc19jb3VudBgGIAIoBCJRChNQZWVyQ29ubmVjdGlvblN0YXRzEhwKFGRhdGFfY2hhbm5lbHNfb3BlbmVkGAEgAigNEhwKFGRhdGFfY2hhbm5lbHNfY2xvc2VkGAIgAigNIuIBChBEYXRhQ2hhbm5lbFN0YXRzEg0KBWxhYmVsGAEgAigJEhAKCHByb3RvY29sGAIgAigJEh8KF2RhdGFfY2hhbm5lbF9pZGVudGlmaWVyGAMgAigFEi4KBXN0YXRlGAQgASgOMh8ubGl2ZWtpdC5wcm90by5EYXRhQ2hhbm5lbFN0YXRlEhUKDW1lc3NhZ2VzX3NlbnQYBSACKA0SEgoKYnl0ZXNfc2VudBgGIAIoBBIZChFtZXNzYWdlc19yZWNlaXZlZBgHIAIoDRIWCg5ieXRlc19yZWNlaXZlZBgIIAIoBCKcBAoOVHJhbnNwb3J0U3RhdHMSFAoMcGFja2V0c19zZW50GAEgAigEEhgKEHBhY2tldHNfcmVjZWl2ZWQYAiACKAQSEgoKYnl0ZXNfc2VudBgDIAIoBBIWCg5ieXRlc19yZWNlaXZlZBgEIAIoBBIoCghpY2Vfcm9sZRgFIAIoDjIWLmxpdmVraXQucHJvdG8uSWNlUm9sZRIjChtpY2VfbG9jYWxfdXNlcm5hbWVfZnJhZ21lbnQYBiACKAkSNQoKZHRsc19zdGF0ZRgHIAEoDjIhLmxpdmVraXQucHJvdG8uRHRsc1RyYW5zcG9ydFN0YXRlEjMKCWljZV9zdGF0ZRgIIAEoDjIgLmxpdmVraXQucHJvdG8uSWNlVHJhbnNwb3J0U3RhdGUSIgoac2VsZWN0ZWRfY2FuZGlkYXRlX3BhaXJfaWQYCSACKAkSHAoUbG9jYWxfY2VydGlmaWNhdGVfaWQYCiACKAkSHQoVcmVtb3RlX2NlcnRpZmljYXRlX2lkGAsgAigJEhMKC3Rsc192ZXJzaW9uGAwgAigJEhMKC2R0bHNfY2lwaGVyGA0gAigJEioKCWR0bHNfcm9sZRgOIAIoDjIXLmxpdmVraXQucHJvdG8uRHRsc1JvbGUSEwoLc3J0cF9jaXBoZXIYDyACKAkSJwofc2VsZWN0ZWRfY2FuZGlkYXRlX3BhaXJfY2hhbmdlcxgQIAIoDSKkBQoSQ2FuZGlkYXRlUGFpclN0YXRzEhQKDHRyYW5zcG9ydF9pZBgBIAIoCRIaChJsb2NhbF9jYW5kaWRhdGVfaWQYAiACKAkSGwoTcmVtb3RlX2NhbmRpZGF0ZV9pZBgDIAIoCRIzCgVzdGF0ZRgEIAEoDjIkLmxpdmVraXQucHJvdG8uSWNlQ2FuZGlkYXRlUGFpclN0YXRlEhEKCW5vbWluYXRlZBgFIAIoCBIUCgxwYWNrZXRzX3NlbnQYBiACKAQSGAoQcGFja2V0c19yZWNlaXZlZBgHIAIoBBISCgpieXRlc19zZW50GAggAigEEhYKDmJ5dGVzX3JlY2VpdmVkGAkgAigEEiIKGmxhc3RfcGFja2V0X3NlbnRfdGltZXN0YW1wGAogAigBEiYKHmxhc3RfcGFja2V0X3JlY2VpdmVkX3RpbWVzdGFtcBgLIAIoARIdChV0b3RhbF9yb3VuZF90cmlwX3RpbWUYDCACKAESHwoXY3VycmVudF9yb3VuZF90cmlwX3RpbWUYDSACKAESIgoaYXZhaWxhYmxlX291dGdvaW5nX2JpdHJhdGUYDiACKAESIgoaYXZhaWxhYmxlX2luY29taW5nX2JpdHJhdGUYDyACKAESGQoRcmVxdWVzdHNfcmVjZWl2ZWQYECACKAQSFQoNcmVxdWVzdHNfc2VudBgRIAIoBBIaChJyZXNwb25zZXNfcmVjZWl2ZWQYEiACKAQSFgoOcmVzcG9uc2VzX3NlbnQYEyACKAQSHQoVY29uc2VudF9yZXF1ZXN0c19zZW50GBQgAigEEiEKGXBhY2tldHNfZGlzY2FyZGVkX29uX3NlbmQYFSACKA0SHwoXYnl0ZXNfZGlzY2FyZGVkX29uX3NlbmQYFiACKAQiiQMKEUljZUNhbmRpZGF0ZVN0YXRzEhQKDHRyYW5zcG9ydF9pZBgBIAIoCRIPCgdhZGRyZXNzGAIgAigJEgwKBHBvcnQYAyACKAUSEAoIcHJvdG9jb2wYBCACKAkSNwoOY2FuZGlkYXRlX3R5cGUYBSABKA4yHy5saXZla2l0LnByb3RvLkljZUNhbmRpZGF0ZVR5cGUSEAoIcHJpb3JpdHkYBiACKAUSCwoDdXJsGAcgAigJEkEKDnJlbGF5X3Byb3RvY29sGAggASgOMikubGl2ZWtpdC5wcm90by5JY2VTZXJ2ZXJUcmFuc3BvcnRQcm90b2NvbBISCgpmb3VuZGF0aW9uGAkgAigJEhcKD3JlbGF0ZWRfYWRkcmVzcxgKIAIoCRIUCgxyZWxhdGVkX3BvcnQYCyACKAUSGQoRdXNlcm5hbWVfZnJhZ21lbnQYDCACKAkSNAoIdGNwX3R5cGUYDSABKA4yIi5saXZla2l0LnByb3RvLkljZVRjcENhbmRpZGF0ZVR5cGUigQEKEENlcnRpZmljYXRlU3RhdHMSEwoLZmluZ2VycHJpbnQYASACKAkSHQoVZmluZ2VycHJpbnRfYWxnb3JpdGhtGAIgAigJEhoKEmJhc2U2NF9jZXJ0aWZpY2F0ZRgDIAIoCRIdChVpc3N1ZXJfY2VydGlmaWNhdGVfaWQYBCACKAkqUQoQRGF0YUNoYW5uZWxTdGF0ZRIRCg1EQ19DT05ORUNUSU5HEAASCwoHRENfT1BFThABEg4KCkRDX0NMT1NJTkcQAhINCglEQ19DTE9TRUQQAypyChdRdWFsaXR5TGltaXRhdGlvblJlYXNvbhITCg9MSU1JVEFUSU9OX05PTkUQABISCg5MSU1JVEFUSU9OX0NQVRABEhgKFExJTUlUQVRJT05fQkFORFdJRFRIEAISFAoQTElNSVRBVElPTl9PVEhFUhADKkMKB0ljZVJvbGUSDwoLSUNFX1VOS05PV04QABITCg9JQ0VfQ09OVFJPTExJTkcQARISCg5JQ0VfQ09OVFJPTExFRBACKp8BChJEdGxzVHJhbnNwb3J0U3RhdGUSFgoSRFRMU19UUkFOU1BPUlRfTkVXEAASHQoZRFRMU19UUkFOU1BPUlRfQ09OTkVDVElORxABEhwKGERUTFNfVFJBTlNQT1JUX0NPTk5FQ1RFRBACEhkKFURUTFNfVFJBTlNQT1JUX0NMT1NFRBADEhkKFURUTFNfVFJBTlNQT1JUX0ZBSUxFRBAEKtQBChFJY2VUcmFuc3BvcnRTdGF0ZRIVChFJQ0VfVFJBTlNQT1JUX05FVxAAEhoKFklDRV9UUkFOU1BPUlRfQ0hFQ0tJTkcQARIbChdJQ0VfVFJBTlNQT1JUX0NPTk5FQ1RFRBACEhsKF0lDRV9UUkFOU1BPUlRfQ09NUExFVEVEEAMSHgoaSUNFX1RSQU5TUE9SVF9ESVNDT05ORUNURUQQBBIYChRJQ0VfVFJBTlNQT1JUX0ZBSUxFRBAFEhgKFElDRV9UUkFOU1BPUlRfQ0xPU0VEEAYqPgoIRHRsc1JvbGUSDwoLRFRMU19DTElFTlQQABIPCgtEVExTX1NFUlZFUhABEhAKDERUTFNfVU5LTk9XThACKnUKFUljZUNhbmRpZGF0ZVBhaXJTdGF0ZRIPCgtQQUlSX0ZST1pFThAAEhAKDFBBSVJfV0FJVElORxABEhQKEFBBSVJfSU5fUFJPR1JFU1MQAhIPCgtQQUlSX0ZBSUxFRBADEhIKDlBBSVJfU1VDQ0VFREVEEAQqPQoQSWNlQ2FuZGlkYXRlVHlwZRIICgRIT1NUEAASCQoFU1JGTFgQARIJCgVQUkZMWBACEgkKBVJFTEFZEAMqVQoaSWNlU2VydmVyVHJhbnNwb3J0UHJvdG9jb2wSEQoNVFJBTlNQT1JUX1VEUBAAEhEKDVRSQU5TUE9SVF9UQ1AQARIRCg1UUkFOU1BPUlRfVExTEAIqVAoTSWNlVGNwQ2FuZGlkYXRlVHlwZRIUChBDQU5ESURBVEVfQUNUSVZFEAASFQoRQ0FORElEQVRFX1BBU1NJVkUQARIQCgxDQU5ESURBVEVfU08QAkIQqgINTGl2ZUtpdC5Qcm90bw"); /** * @generated from message livekit.proto.RtcStats */ -export class RtcStats extends Message { +export type RtcStats = Message<"livekit.proto.RtcStats"> & { /** * @generated from oneof livekit.proto.RtcStats.stats */ @@ -443,2513 +123,1914 @@ export class RtcStats extends Message { */ value: RtcStats_Track; case: "track"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 3, name: "codec", kind: "message", T: RtcStats_Codec, oneof: "stats" }, - { no: 4, name: "inbound_rtp", kind: "message", T: RtcStats_InboundRtp, oneof: "stats" }, - { no: 5, name: "outbound_rtp", kind: "message", T: RtcStats_OutboundRtp, oneof: "stats" }, - { no: 6, name: "remote_inbound_rtp", kind: "message", T: RtcStats_RemoteInboundRtp, oneof: "stats" }, - { no: 7, name: "remote_outbound_rtp", kind: "message", T: RtcStats_RemoteOutboundRtp, oneof: "stats" }, - { no: 8, name: "media_source", kind: "message", T: RtcStats_MediaSource, oneof: "stats" }, - { no: 9, name: "media_playout", kind: "message", T: RtcStats_MediaPlayout, oneof: "stats" }, - { no: 10, name: "peer_connection", kind: "message", T: RtcStats_PeerConnection, oneof: "stats" }, - { no: 11, name: "data_channel", kind: "message", T: RtcStats_DataChannel, oneof: "stats" }, - { no: 12, name: "transport", kind: "message", T: RtcStats_Transport, oneof: "stats" }, - { no: 13, name: "candidate_pair", kind: "message", T: RtcStats_CandidatePair, oneof: "stats" }, - { no: 14, name: "local_candidate", kind: "message", T: RtcStats_LocalCandidate, oneof: "stats" }, - { no: 15, name: "remote_candidate", kind: "message", T: RtcStats_RemoteCandidate, oneof: "stats" }, - { no: 16, name: "certificate", kind: "message", T: RtcStats_Certificate, oneof: "stats" }, - { no: 17, name: "track", kind: "message", T: RtcStats_Track, oneof: "stats" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats { - return new RtcStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats { - return new RtcStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats { - return new RtcStats().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats | PlainMessage | undefined, b: RtcStats | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats, a, b); - } -} + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message livekit.proto.RtcStats. + * Use `create(RtcStatsSchema)` to create a new message. + */ +export const RtcStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0); /** * @generated from message livekit.proto.RtcStats.Codec */ -export class RtcStats_Codec extends Message { +export type RtcStats_Codec = Message<"livekit.proto.RtcStats.Codec"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.CodecStats codec = 2; + * @generated from field: required livekit.proto.CodecStats codec = 2; */ codec?: CodecStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.Codec"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "codec", kind: "message", T: CodecStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Codec { - return new RtcStats_Codec().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_Codec { - return new RtcStats_Codec().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_Codec { - return new RtcStats_Codec().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_Codec | PlainMessage | undefined, b: RtcStats_Codec | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_Codec, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.Codec. + * Use `create(RtcStats_CodecSchema)` to create a new message. + */ +export const RtcStats_CodecSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 0); /** * @generated from message livekit.proto.RtcStats.InboundRtp */ -export class RtcStats_InboundRtp extends Message { +export type RtcStats_InboundRtp = Message<"livekit.proto.RtcStats.InboundRtp"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.RtpStreamStats stream = 2; + * @generated from field: required livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: livekit.proto.ReceivedRtpStreamStats received = 3; + * @generated from field: required livekit.proto.ReceivedRtpStreamStats received = 3; */ received?: ReceivedRtpStreamStats; /** - * @generated from field: livekit.proto.InboundRtpStreamStats inbound = 4; + * @generated from field: required livekit.proto.InboundRtpStreamStats inbound = 4; */ inbound?: InboundRtpStreamStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.InboundRtp"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, - { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats }, - { no: 4, name: "inbound", kind: "message", T: InboundRtpStreamStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_InboundRtp { - return new RtcStats_InboundRtp().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_InboundRtp { - return new RtcStats_InboundRtp().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_InboundRtp { - return new RtcStats_InboundRtp().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_InboundRtp | PlainMessage | undefined, b: RtcStats_InboundRtp | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_InboundRtp, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.InboundRtp. + * Use `create(RtcStats_InboundRtpSchema)` to create a new message. + */ +export const RtcStats_InboundRtpSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 1); /** * @generated from message livekit.proto.RtcStats.OutboundRtp */ -export class RtcStats_OutboundRtp extends Message { +export type RtcStats_OutboundRtp = Message<"livekit.proto.RtcStats.OutboundRtp"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.RtpStreamStats stream = 2; + * @generated from field: required livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: livekit.proto.SentRtpStreamStats sent = 3; + * @generated from field: required livekit.proto.SentRtpStreamStats sent = 3; */ sent?: SentRtpStreamStats; /** - * @generated from field: livekit.proto.OutboundRtpStreamStats outbound = 4; + * @generated from field: required livekit.proto.OutboundRtpStreamStats outbound = 4; */ outbound?: OutboundRtpStreamStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.OutboundRtp"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, - { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats }, - { no: 4, name: "outbound", kind: "message", T: OutboundRtpStreamStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_OutboundRtp { - return new RtcStats_OutboundRtp().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_OutboundRtp { - return new RtcStats_OutboundRtp().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_OutboundRtp { - return new RtcStats_OutboundRtp().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_OutboundRtp | PlainMessage | undefined, b: RtcStats_OutboundRtp | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_OutboundRtp, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.OutboundRtp. + * Use `create(RtcStats_OutboundRtpSchema)` to create a new message. + */ +export const RtcStats_OutboundRtpSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 2); /** * @generated from message livekit.proto.RtcStats.RemoteInboundRtp */ -export class RtcStats_RemoteInboundRtp extends Message { +export type RtcStats_RemoteInboundRtp = Message<"livekit.proto.RtcStats.RemoteInboundRtp"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.RtpStreamStats stream = 2; + * @generated from field: required livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: livekit.proto.ReceivedRtpStreamStats received = 3; + * @generated from field: required livekit.proto.ReceivedRtpStreamStats received = 3; */ received?: ReceivedRtpStreamStats; /** - * @generated from field: livekit.proto.RemoteInboundRtpStreamStats remote_inbound = 4; + * @generated from field: required livekit.proto.RemoteInboundRtpStreamStats remote_inbound = 4; */ remoteInbound?: RemoteInboundRtpStreamStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.RemoteInboundRtp"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, - { no: 3, name: "received", kind: "message", T: ReceivedRtpStreamStats }, - { no: 4, name: "remote_inbound", kind: "message", T: RemoteInboundRtpStreamStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_RemoteInboundRtp { - return new RtcStats_RemoteInboundRtp().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_RemoteInboundRtp { - return new RtcStats_RemoteInboundRtp().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_RemoteInboundRtp { - return new RtcStats_RemoteInboundRtp().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_RemoteInboundRtp | PlainMessage | undefined, b: RtcStats_RemoteInboundRtp | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_RemoteInboundRtp, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.RemoteInboundRtp. + * Use `create(RtcStats_RemoteInboundRtpSchema)` to create a new message. + */ +export const RtcStats_RemoteInboundRtpSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 3); /** * @generated from message livekit.proto.RtcStats.RemoteOutboundRtp */ -export class RtcStats_RemoteOutboundRtp extends Message { +export type RtcStats_RemoteOutboundRtp = Message<"livekit.proto.RtcStats.RemoteOutboundRtp"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.RtpStreamStats stream = 2; + * @generated from field: required livekit.proto.RtpStreamStats stream = 2; */ stream?: RtpStreamStats; /** - * @generated from field: livekit.proto.SentRtpStreamStats sent = 3; + * @generated from field: required livekit.proto.SentRtpStreamStats sent = 3; */ sent?: SentRtpStreamStats; /** - * @generated from field: livekit.proto.RemoteOutboundRtpStreamStats remote_outbound = 4; + * @generated from field: required livekit.proto.RemoteOutboundRtpStreamStats remote_outbound = 4; */ remoteOutbound?: RemoteOutboundRtpStreamStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.RemoteOutboundRtp"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "stream", kind: "message", T: RtpStreamStats }, - { no: 3, name: "sent", kind: "message", T: SentRtpStreamStats }, - { no: 4, name: "remote_outbound", kind: "message", T: RemoteOutboundRtpStreamStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_RemoteOutboundRtp { - return new RtcStats_RemoteOutboundRtp().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_RemoteOutboundRtp { - return new RtcStats_RemoteOutboundRtp().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_RemoteOutboundRtp { - return new RtcStats_RemoteOutboundRtp().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_RemoteOutboundRtp | PlainMessage | undefined, b: RtcStats_RemoteOutboundRtp | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_RemoteOutboundRtp, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.RemoteOutboundRtp. + * Use `create(RtcStats_RemoteOutboundRtpSchema)` to create a new message. + */ +export const RtcStats_RemoteOutboundRtpSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 4); /** * @generated from message livekit.proto.RtcStats.MediaSource */ -export class RtcStats_MediaSource extends Message { +export type RtcStats_MediaSource = Message<"livekit.proto.RtcStats.MediaSource"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.MediaSourceStats source = 2; + * @generated from field: required livekit.proto.MediaSourceStats source = 2; */ source?: MediaSourceStats; /** - * @generated from field: livekit.proto.AudioSourceStats audio = 3; + * @generated from field: required livekit.proto.AudioSourceStats audio = 3; */ audio?: AudioSourceStats; /** - * @generated from field: livekit.proto.VideoSourceStats video = 4; + * @generated from field: required livekit.proto.VideoSourceStats video = 4; */ video?: VideoSourceStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.MediaSource"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "source", kind: "message", T: MediaSourceStats }, - { no: 3, name: "audio", kind: "message", T: AudioSourceStats }, - { no: 4, name: "video", kind: "message", T: VideoSourceStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_MediaSource { - return new RtcStats_MediaSource().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_MediaSource { - return new RtcStats_MediaSource().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_MediaSource { - return new RtcStats_MediaSource().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_MediaSource | PlainMessage | undefined, b: RtcStats_MediaSource | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_MediaSource, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.MediaSource. + * Use `create(RtcStats_MediaSourceSchema)` to create a new message. + */ +export const RtcStats_MediaSourceSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 5); /** * @generated from message livekit.proto.RtcStats.MediaPlayout */ -export class RtcStats_MediaPlayout extends Message { +export type RtcStats_MediaPlayout = Message<"livekit.proto.RtcStats.MediaPlayout"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.AudioPlayoutStats audio_playout = 2; + * @generated from field: required livekit.proto.AudioPlayoutStats audio_playout = 2; */ audioPlayout?: AudioPlayoutStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.MediaPlayout"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "audio_playout", kind: "message", T: AudioPlayoutStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_MediaPlayout { - return new RtcStats_MediaPlayout().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_MediaPlayout { - return new RtcStats_MediaPlayout().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_MediaPlayout { - return new RtcStats_MediaPlayout().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_MediaPlayout | PlainMessage | undefined, b: RtcStats_MediaPlayout | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_MediaPlayout, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.MediaPlayout. + * Use `create(RtcStats_MediaPlayoutSchema)` to create a new message. + */ +export const RtcStats_MediaPlayoutSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 6); /** * @generated from message livekit.proto.RtcStats.PeerConnection */ -export class RtcStats_PeerConnection extends Message { +export type RtcStats_PeerConnection = Message<"livekit.proto.RtcStats.PeerConnection"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.PeerConnectionStats pc = 2; + * @generated from field: required livekit.proto.PeerConnectionStats pc = 2; */ pc?: PeerConnectionStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.PeerConnection"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "pc", kind: "message", T: PeerConnectionStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_PeerConnection { - return new RtcStats_PeerConnection().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_PeerConnection { - return new RtcStats_PeerConnection().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_PeerConnection { - return new RtcStats_PeerConnection().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_PeerConnection | PlainMessage | undefined, b: RtcStats_PeerConnection | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_PeerConnection, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.PeerConnection. + * Use `create(RtcStats_PeerConnectionSchema)` to create a new message. + */ +export const RtcStats_PeerConnectionSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 7); /** * @generated from message livekit.proto.RtcStats.DataChannel */ -export class RtcStats_DataChannel extends Message { +export type RtcStats_DataChannel = Message<"livekit.proto.RtcStats.DataChannel"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.DataChannelStats dc = 2; + * @generated from field: required livekit.proto.DataChannelStats dc = 2; */ dc?: DataChannelStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.DataChannel"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "dc", kind: "message", T: DataChannelStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_DataChannel { - return new RtcStats_DataChannel().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_DataChannel { - return new RtcStats_DataChannel().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_DataChannel { - return new RtcStats_DataChannel().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_DataChannel | PlainMessage | undefined, b: RtcStats_DataChannel | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_DataChannel, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.DataChannel. + * Use `create(RtcStats_DataChannelSchema)` to create a new message. + */ +export const RtcStats_DataChannelSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 8); /** * @generated from message livekit.proto.RtcStats.Transport */ -export class RtcStats_Transport extends Message { +export type RtcStats_Transport = Message<"livekit.proto.RtcStats.Transport"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.TransportStats transport = 2; + * @generated from field: required livekit.proto.TransportStats transport = 2; */ transport?: TransportStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.Transport"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "transport", kind: "message", T: TransportStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Transport { - return new RtcStats_Transport().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_Transport { - return new RtcStats_Transport().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_Transport { - return new RtcStats_Transport().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_Transport | PlainMessage | undefined, b: RtcStats_Transport | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_Transport, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.Transport. + * Use `create(RtcStats_TransportSchema)` to create a new message. + */ +export const RtcStats_TransportSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 9); /** * @generated from message livekit.proto.RtcStats.CandidatePair */ -export class RtcStats_CandidatePair extends Message { +export type RtcStats_CandidatePair = Message<"livekit.proto.RtcStats.CandidatePair"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.CandidatePairStats candidate_pair = 2; + * @generated from field: required livekit.proto.CandidatePairStats candidate_pair = 2; */ candidatePair?: CandidatePairStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.CandidatePair"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "candidate_pair", kind: "message", T: CandidatePairStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_CandidatePair { - return new RtcStats_CandidatePair().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_CandidatePair { - return new RtcStats_CandidatePair().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_CandidatePair { - return new RtcStats_CandidatePair().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_CandidatePair | PlainMessage | undefined, b: RtcStats_CandidatePair | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_CandidatePair, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.CandidatePair. + * Use `create(RtcStats_CandidatePairSchema)` to create a new message. + */ +export const RtcStats_CandidatePairSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 10); /** * @generated from message livekit.proto.RtcStats.LocalCandidate */ -export class RtcStats_LocalCandidate extends Message { +export type RtcStats_LocalCandidate = Message<"livekit.proto.RtcStats.LocalCandidate"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.IceCandidateStats candidate = 2; + * @generated from field: required livekit.proto.IceCandidateStats candidate = 2; */ candidate?: IceCandidateStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.LocalCandidate"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "candidate", kind: "message", T: IceCandidateStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_LocalCandidate { - return new RtcStats_LocalCandidate().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_LocalCandidate { - return new RtcStats_LocalCandidate().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_LocalCandidate { - return new RtcStats_LocalCandidate().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_LocalCandidate | PlainMessage | undefined, b: RtcStats_LocalCandidate | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_LocalCandidate, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.LocalCandidate. + * Use `create(RtcStats_LocalCandidateSchema)` to create a new message. + */ +export const RtcStats_LocalCandidateSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 11); /** * @generated from message livekit.proto.RtcStats.RemoteCandidate */ -export class RtcStats_RemoteCandidate extends Message { +export type RtcStats_RemoteCandidate = Message<"livekit.proto.RtcStats.RemoteCandidate"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.IceCandidateStats candidate = 2; + * @generated from field: required livekit.proto.IceCandidateStats candidate = 2; */ candidate?: IceCandidateStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.RemoteCandidate"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "candidate", kind: "message", T: IceCandidateStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_RemoteCandidate { - return new RtcStats_RemoteCandidate().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_RemoteCandidate { - return new RtcStats_RemoteCandidate().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_RemoteCandidate { - return new RtcStats_RemoteCandidate().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_RemoteCandidate | PlainMessage | undefined, b: RtcStats_RemoteCandidate | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_RemoteCandidate, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.RemoteCandidate. + * Use `create(RtcStats_RemoteCandidateSchema)` to create a new message. + */ +export const RtcStats_RemoteCandidateSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 12); /** * @generated from message livekit.proto.RtcStats.Certificate */ -export class RtcStats_Certificate extends Message { +export type RtcStats_Certificate = Message<"livekit.proto.RtcStats.Certificate"> & { /** - * @generated from field: livekit.proto.RtcStatsData rtc = 1; + * @generated from field: required livekit.proto.RtcStatsData rtc = 1; */ rtc?: RtcStatsData; /** - * @generated from field: livekit.proto.CertificateStats certificate = 2; + * @generated from field: required livekit.proto.CertificateStats certificate = 2; */ certificate?: CertificateStats; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.Certificate"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rtc", kind: "message", T: RtcStatsData }, - { no: 2, name: "certificate", kind: "message", T: CertificateStats }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Certificate { - return new RtcStats_Certificate().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_Certificate { - return new RtcStats_Certificate().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStats_Certificate { - return new RtcStats_Certificate().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_Certificate | PlainMessage | undefined, b: RtcStats_Certificate | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_Certificate, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.Certificate. + * Use `create(RtcStats_CertificateSchema)` to create a new message. + */ +export const RtcStats_CertificateSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 13); /** * Deprecated * * @generated from message livekit.proto.RtcStats.Track */ -export class RtcStats_Track extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStats.Track"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStats_Track { - return new RtcStats_Track().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStats_Track { - return new RtcStats_Track().fromJson(jsonValue, options); - } +export type RtcStats_Track = Message<"livekit.proto.RtcStats.Track"> & { +}; - static fromJsonString(jsonString: string, options?: Partial): RtcStats_Track { - return new RtcStats_Track().fromJsonString(jsonString, options); - } - - static equals(a: RtcStats_Track | PlainMessage | undefined, b: RtcStats_Track | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStats_Track, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStats.Track. + * Use `create(RtcStats_TrackSchema)` to create a new message. + */ +export const RtcStats_TrackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 0, 14); /** * @generated from message livekit.proto.RtcStatsData */ -export class RtcStatsData extends Message { +export type RtcStatsData = Message<"livekit.proto.RtcStatsData"> & { /** - * @generated from field: string id = 1; + * @generated from field: required string id = 1; */ - id = ""; + id: string; /** - * @generated from field: int64 timestamp = 2; + * @generated from field: required int64 timestamp = 2; */ - timestamp = protoInt64.zero; + timestamp: bigint; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtcStatsData"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtcStatsData { - return new RtcStatsData().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RtcStatsData { - return new RtcStatsData().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtcStatsData { - return new RtcStatsData().fromJsonString(jsonString, options); - } - - static equals(a: RtcStatsData | PlainMessage | undefined, b: RtcStatsData | PlainMessage | undefined): boolean { - return proto3.util.equals(RtcStatsData, a, b); - } -} +/** + * Describes the message livekit.proto.RtcStatsData. + * Use `create(RtcStatsDataSchema)` to create a new message. + */ +export const RtcStatsDataSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 1); /** * @generated from message livekit.proto.CodecStats */ -export class CodecStats extends Message { +export type CodecStats = Message<"livekit.proto.CodecStats"> & { /** - * @generated from field: uint32 payload_type = 1; + * @generated from field: required uint32 payload_type = 1; */ - payloadType = 0; + payloadType: number; /** - * @generated from field: string transport_id = 2; + * @generated from field: required string transport_id = 2; */ - transportId = ""; + transportId: string; /** - * @generated from field: string mime_type = 3; + * @generated from field: required string mime_type = 3; */ - mimeType = ""; + mimeType: string; /** - * @generated from field: uint32 clock_rate = 4; + * @generated from field: required uint32 clock_rate = 4; */ - clockRate = 0; + clockRate: number; /** - * @generated from field: uint32 channels = 5; + * @generated from field: required uint32 channels = 5; */ - channels = 0; + channels: number; /** - * @generated from field: string sdp_fmtp_line = 6; + * @generated from field: required string sdp_fmtp_line = 6; */ - sdpFmtpLine = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CodecStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "payload_type", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "clock_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 5, name: "channels", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 6, name: "sdp_fmtp_line", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CodecStats { - return new CodecStats().fromBinary(bytes, options); - } + sdpFmtpLine: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): CodecStats { - return new CodecStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CodecStats { - return new CodecStats().fromJsonString(jsonString, options); - } - - static equals(a: CodecStats | PlainMessage | undefined, b: CodecStats | PlainMessage | undefined): boolean { - return proto3.util.equals(CodecStats, a, b); - } -} +/** + * Describes the message livekit.proto.CodecStats. + * Use `create(CodecStatsSchema)` to create a new message. + */ +export const CodecStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 2); /** * @generated from message livekit.proto.RtpStreamStats */ -export class RtpStreamStats extends Message { +export type RtpStreamStats = Message<"livekit.proto.RtpStreamStats"> & { /** - * @generated from field: uint32 ssrc = 1; + * @generated from field: required uint32 ssrc = 1; */ - ssrc = 0; + ssrc: number; /** - * @generated from field: string kind = 2; + * @generated from field: required string kind = 2; */ - kind = ""; + kind: string; /** - * @generated from field: string transport_id = 3; + * @generated from field: required string transport_id = 3; */ - transportId = ""; + transportId: string; /** - * @generated from field: string codec_id = 4; + * @generated from field: required string codec_id = 4; */ - codecId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "codec_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RtpStreamStats { - return new RtpStreamStats().fromBinary(bytes, options); - } + codecId: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): RtpStreamStats { - return new RtpStreamStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RtpStreamStats { - return new RtpStreamStats().fromJsonString(jsonString, options); - } - - static equals(a: RtpStreamStats | PlainMessage | undefined, b: RtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(RtpStreamStats, a, b); - } -} +/** + * Describes the message livekit.proto.RtpStreamStats. + * Use `create(RtpStreamStatsSchema)` to create a new message. + */ +export const RtpStreamStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 3); /** * @generated from message livekit.proto.ReceivedRtpStreamStats */ -export class ReceivedRtpStreamStats extends Message { +export type ReceivedRtpStreamStats = Message<"livekit.proto.ReceivedRtpStreamStats"> & { /** - * @generated from field: uint64 packets_received = 1; + * @generated from field: required uint64 packets_received = 1; */ - packetsReceived = protoInt64.zero; + packetsReceived: bigint; /** - * @generated from field: int64 packets_lost = 2; + * @generated from field: required int64 packets_lost = 2; */ - packetsLost = protoInt64.zero; + packetsLost: bigint; /** - * @generated from field: double jitter = 3; + * @generated from field: required double jitter = 3; */ - jitter = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.ReceivedRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "packets_lost", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 3, name: "jitter", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - ]); + jitter: number; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): ReceivedRtpStreamStats { - return new ReceivedRtpStreamStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ReceivedRtpStreamStats { - return new ReceivedRtpStreamStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ReceivedRtpStreamStats { - return new ReceivedRtpStreamStats().fromJsonString(jsonString, options); - } - - static equals(a: ReceivedRtpStreamStats | PlainMessage | undefined, b: ReceivedRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(ReceivedRtpStreamStats, a, b); - } -} +/** + * Describes the message livekit.proto.ReceivedRtpStreamStats. + * Use `create(ReceivedRtpStreamStatsSchema)` to create a new message. + */ +export const ReceivedRtpStreamStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 4); /** * @generated from message livekit.proto.InboundRtpStreamStats */ -export class InboundRtpStreamStats extends Message { +export type InboundRtpStreamStats = Message<"livekit.proto.InboundRtpStreamStats"> & { /** - * @generated from field: string track_identifier = 1; + * @generated from field: required string track_identifier = 1; */ - trackIdentifier = ""; + trackIdentifier: string; /** - * @generated from field: string mid = 2; + * @generated from field: required string mid = 2; */ - mid = ""; + mid: string; /** - * @generated from field: string remote_id = 3; + * @generated from field: required string remote_id = 3; */ - remoteId = ""; + remoteId: string; /** - * @generated from field: uint32 frames_decoded = 4; + * @generated from field: required uint32 frames_decoded = 4; */ - framesDecoded = 0; + framesDecoded: number; /** - * @generated from field: uint32 key_frames_decoded = 5; + * @generated from field: required uint32 key_frames_decoded = 5; */ - keyFramesDecoded = 0; + keyFramesDecoded: number; /** - * @generated from field: uint32 frames_rendered = 6; + * @generated from field: required uint32 frames_rendered = 6; */ - framesRendered = 0; + framesRendered: number; /** - * @generated from field: uint32 frames_dropped = 7; + * @generated from field: required uint32 frames_dropped = 7; */ - framesDropped = 0; + framesDropped: number; /** - * @generated from field: uint32 frame_width = 8; + * @generated from field: required uint32 frame_width = 8; */ - frameWidth = 0; + frameWidth: number; /** - * @generated from field: uint32 frame_height = 9; + * @generated from field: required uint32 frame_height = 9; */ - frameHeight = 0; + frameHeight: number; /** - * @generated from field: double frames_per_second = 10; + * @generated from field: required double frames_per_second = 10; */ - framesPerSecond = 0; + framesPerSecond: number; /** - * @generated from field: uint64 qp_sum = 11; + * @generated from field: required uint64 qp_sum = 11; */ - qpSum = protoInt64.zero; + qpSum: bigint; /** - * @generated from field: double total_decode_time = 12; + * @generated from field: required double total_decode_time = 12; */ - totalDecodeTime = 0; + totalDecodeTime: number; /** - * @generated from field: double total_inter_frame_delay = 13; + * @generated from field: required double total_inter_frame_delay = 13; */ - totalInterFrameDelay = 0; + totalInterFrameDelay: number; /** - * @generated from field: double total_squared_inter_frame_delay = 14; + * @generated from field: required double total_squared_inter_frame_delay = 14; */ - totalSquaredInterFrameDelay = 0; + totalSquaredInterFrameDelay: number; /** - * @generated from field: uint32 pause_count = 15; + * @generated from field: required uint32 pause_count = 15; */ - pauseCount = 0; + pauseCount: number; /** - * @generated from field: double total_pause_duration = 16; + * @generated from field: required double total_pause_duration = 16; */ - totalPauseDuration = 0; + totalPauseDuration: number; /** - * @generated from field: uint32 freeze_count = 17; + * @generated from field: required uint32 freeze_count = 17; */ - freezeCount = 0; + freezeCount: number; /** - * @generated from field: double total_freeze_duration = 18; + * @generated from field: required double total_freeze_duration = 18; */ - totalFreezeDuration = 0; + totalFreezeDuration: number; /** - * @generated from field: double last_packet_received_timestamp = 19; + * @generated from field: required double last_packet_received_timestamp = 19; */ - lastPacketReceivedTimestamp = 0; + lastPacketReceivedTimestamp: number; /** - * @generated from field: uint64 header_bytes_received = 20; + * @generated from field: required uint64 header_bytes_received = 20; */ - headerBytesReceived = protoInt64.zero; + headerBytesReceived: bigint; /** - * @generated from field: uint64 packets_discarded = 21; + * @generated from field: required uint64 packets_discarded = 21; */ - packetsDiscarded = protoInt64.zero; + packetsDiscarded: bigint; /** - * @generated from field: uint64 fec_bytes_received = 22; + * @generated from field: required uint64 fec_bytes_received = 22; */ - fecBytesReceived = protoInt64.zero; + fecBytesReceived: bigint; /** - * @generated from field: uint64 fec_packets_received = 23; + * @generated from field: required uint64 fec_packets_received = 23; */ - fecPacketsReceived = protoInt64.zero; + fecPacketsReceived: bigint; /** - * @generated from field: uint64 fec_packets_discarded = 24; + * @generated from field: required uint64 fec_packets_discarded = 24; */ - fecPacketsDiscarded = protoInt64.zero; + fecPacketsDiscarded: bigint; /** - * @generated from field: uint64 bytes_received = 25; + * @generated from field: required uint64 bytes_received = 25; */ - bytesReceived = protoInt64.zero; + bytesReceived: bigint; /** - * @generated from field: uint32 nack_count = 26; + * @generated from field: required uint32 nack_count = 26; */ - nackCount = 0; + nackCount: number; /** - * @generated from field: uint32 fir_count = 27; + * @generated from field: required uint32 fir_count = 27; */ - firCount = 0; + firCount: number; /** - * @generated from field: uint32 pli_count = 28; + * @generated from field: required uint32 pli_count = 28; */ - pliCount = 0; + pliCount: number; /** - * @generated from field: double total_processing_delay = 29; + * @generated from field: required double total_processing_delay = 29; */ - totalProcessingDelay = 0; + totalProcessingDelay: number; /** - * @generated from field: double estimated_playout_timestamp = 30; + * @generated from field: required double estimated_playout_timestamp = 30; */ - estimatedPlayoutTimestamp = 0; + estimatedPlayoutTimestamp: number; /** - * @generated from field: double jitter_buffer_delay = 31; + * @generated from field: required double jitter_buffer_delay = 31; */ - jitterBufferDelay = 0; + jitterBufferDelay: number; /** - * @generated from field: double jitter_buffer_target_delay = 32; + * @generated from field: required double jitter_buffer_target_delay = 32; */ - jitterBufferTargetDelay = 0; + jitterBufferTargetDelay: number; /** - * @generated from field: uint64 jitter_buffer_emitted_count = 33; + * @generated from field: required uint64 jitter_buffer_emitted_count = 33; */ - jitterBufferEmittedCount = protoInt64.zero; + jitterBufferEmittedCount: bigint; /** - * @generated from field: double jitter_buffer_minimum_delay = 34; + * @generated from field: required double jitter_buffer_minimum_delay = 34; */ - jitterBufferMinimumDelay = 0; + jitterBufferMinimumDelay: number; /** - * @generated from field: uint64 total_samples_received = 35; + * @generated from field: required uint64 total_samples_received = 35; */ - totalSamplesReceived = protoInt64.zero; + totalSamplesReceived: bigint; /** - * @generated from field: uint64 concealed_samples = 36; + * @generated from field: required uint64 concealed_samples = 36; */ - concealedSamples = protoInt64.zero; + concealedSamples: bigint; /** - * @generated from field: uint64 silent_concealed_samples = 37; + * @generated from field: required uint64 silent_concealed_samples = 37; */ - silentConcealedSamples = protoInt64.zero; + silentConcealedSamples: bigint; /** - * @generated from field: uint64 concealment_events = 38; + * @generated from field: required uint64 concealment_events = 38; */ - concealmentEvents = protoInt64.zero; + concealmentEvents: bigint; /** - * @generated from field: uint64 inserted_samples_for_deceleration = 39; + * @generated from field: required uint64 inserted_samples_for_deceleration = 39; */ - insertedSamplesForDeceleration = protoInt64.zero; + insertedSamplesForDeceleration: bigint; /** - * @generated from field: uint64 removed_samples_for_acceleration = 40; + * @generated from field: required uint64 removed_samples_for_acceleration = 40; */ - removedSamplesForAcceleration = protoInt64.zero; + removedSamplesForAcceleration: bigint; /** - * @generated from field: double audio_level = 41; + * @generated from field: required double audio_level = 41; */ - audioLevel = 0; + audioLevel: number; /** - * @generated from field: double total_audio_energy = 42; + * @generated from field: required double total_audio_energy = 42; */ - totalAudioEnergy = 0; + totalAudioEnergy: number; /** - * @generated from field: double total_samples_duration = 43; + * @generated from field: required double total_samples_duration = 43; */ - totalSamplesDuration = 0; + totalSamplesDuration: number; /** - * @generated from field: uint64 frames_received = 44; + * @generated from field: required uint64 frames_received = 44; */ - framesReceived = protoInt64.zero; + framesReceived: bigint; /** - * @generated from field: string decoder_implementation = 45; + * @generated from field: required string decoder_implementation = 45; */ - decoderImplementation = ""; + decoderImplementation: string; /** - * @generated from field: string playout_id = 46; + * @generated from field: required string playout_id = 46; */ - playoutId = ""; + playoutId: string; /** - * @generated from field: bool power_efficient_decoder = 47; + * @generated from field: required bool power_efficient_decoder = 47; */ - powerEfficientDecoder = false; + powerEfficientDecoder: boolean; /** - * @generated from field: uint64 frames_assembled_from_multiple_packets = 48; + * @generated from field: required uint64 frames_assembled_from_multiple_packets = 48; */ - framesAssembledFromMultiplePackets = protoInt64.zero; + framesAssembledFromMultiplePackets: bigint; /** - * @generated from field: double total_assembly_time = 49; + * @generated from field: required double total_assembly_time = 49; */ - totalAssemblyTime = 0; + totalAssemblyTime: number; /** - * @generated from field: uint64 retransmitted_packets_received = 50; + * @generated from field: required uint64 retransmitted_packets_received = 50; */ - retransmittedPacketsReceived = protoInt64.zero; + retransmittedPacketsReceived: bigint; /** - * @generated from field: uint64 retransmitted_bytes_received = 51; + * @generated from field: required uint64 retransmitted_bytes_received = 51; */ - retransmittedBytesReceived = protoInt64.zero; + retransmittedBytesReceived: bigint; /** - * @generated from field: uint32 rtx_ssrc = 52; + * @generated from field: required uint32 rtx_ssrc = 52; */ - rtxSsrc = 0; + rtxSsrc: number; /** - * @generated from field: uint32 fec_ssrc = 53; + * @generated from field: required uint32 fec_ssrc = 53; */ - fecSsrc = 0; + fecSsrc: number; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.InboundRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 5, name: "key_frames_decoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 6, name: "frames_rendered", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 7, name: "frames_dropped", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 8, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 9, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 10, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 11, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 12, name: "total_decode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 13, name: "total_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 14, name: "total_squared_inter_frame_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 15, name: "pause_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 16, name: "total_pause_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 17, name: "freeze_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 18, name: "total_freeze_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 19, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 20, name: "header_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 21, name: "packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 22, name: "fec_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 23, name: "fec_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 24, name: "fec_packets_discarded", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 25, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 26, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 27, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 28, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 29, name: "total_processing_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 30, name: "estimated_playout_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 31, name: "jitter_buffer_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 32, name: "jitter_buffer_target_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 33, name: "jitter_buffer_emitted_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 34, name: "jitter_buffer_minimum_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 35, name: "total_samples_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 36, name: "concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 37, name: "silent_concealed_samples", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 38, name: "concealment_events", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 39, name: "inserted_samples_for_deceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 40, name: "removed_samples_for_acceleration", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 41, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 42, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 43, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 44, name: "frames_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 45, name: "decoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 46, name: "playout_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 47, name: "power_efficient_decoder", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 48, name: "frames_assembled_from_multiple_packets", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 49, name: "total_assembly_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 50, name: "retransmitted_packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 51, name: "retransmitted_bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 52, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 53, name: "fec_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): InboundRtpStreamStats { - return new InboundRtpStreamStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): InboundRtpStreamStats { - return new InboundRtpStreamStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): InboundRtpStreamStats { - return new InboundRtpStreamStats().fromJsonString(jsonString, options); - } - - static equals(a: InboundRtpStreamStats | PlainMessage | undefined, b: InboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(InboundRtpStreamStats, a, b); - } -} +/** + * Describes the message livekit.proto.InboundRtpStreamStats. + * Use `create(InboundRtpStreamStatsSchema)` to create a new message. + */ +export const InboundRtpStreamStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 5); /** * @generated from message livekit.proto.SentRtpStreamStats */ -export class SentRtpStreamStats extends Message { +export type SentRtpStreamStats = Message<"livekit.proto.SentRtpStreamStats"> & { /** - * @generated from field: uint64 packets_sent = 1; + * @generated from field: required uint64 packets_sent = 1; */ - packetsSent = protoInt64.zero; + packetsSent: bigint; /** - * @generated from field: uint64 bytes_sent = 2; + * @generated from field: required uint64 bytes_sent = 2; */ - bytesSent = protoInt64.zero; + bytesSent: bigint; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +/** + * Describes the message livekit.proto.SentRtpStreamStats. + * Use `create(SentRtpStreamStatsSchema)` to create a new message. + */ +export const SentRtpStreamStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 6); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.SentRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); +/** + * @generated from message livekit.proto.OutboundRtpStreamStats + */ +export type OutboundRtpStreamStats = Message<"livekit.proto.OutboundRtpStreamStats"> & { + /** + * @generated from field: required string mid = 1; + */ + mid: string; - static fromBinary(bytes: Uint8Array, options?: Partial): SentRtpStreamStats { - return new SentRtpStreamStats().fromBinary(bytes, options); - } + /** + * @generated from field: required string media_source_id = 2; + */ + mediaSourceId: string; - static fromJson(jsonValue: JsonValue, options?: Partial): SentRtpStreamStats { - return new SentRtpStreamStats().fromJson(jsonValue, options); - } + /** + * @generated from field: required string remote_id = 3; + */ + remoteId: string; - static fromJsonString(jsonString: string, options?: Partial): SentRtpStreamStats { - return new SentRtpStreamStats().fromJsonString(jsonString, options); - } + /** + * @generated from field: required string rid = 4; + */ + rid: string; - static equals(a: SentRtpStreamStats | PlainMessage | undefined, b: SentRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(SentRtpStreamStats, a, b); - } -} + /** + * @generated from field: required uint64 header_bytes_sent = 5; + */ + headerBytesSent: bigint; -/** - * @generated from message livekit.proto.OutboundRtpStreamStats - */ -export class OutboundRtpStreamStats extends Message { /** - * @generated from field: string mid = 1; + * @generated from field: required uint64 retransmitted_packets_sent = 6; */ - mid = ""; + retransmittedPacketsSent: bigint; /** - * @generated from field: string media_source_id = 2; + * @generated from field: required uint64 retransmitted_bytes_sent = 7; */ - mediaSourceId = ""; + retransmittedBytesSent: bigint; /** - * @generated from field: string remote_id = 3; + * @generated from field: required uint32 rtx_ssrc = 8; */ - remoteId = ""; + rtxSsrc: number; /** - * @generated from field: string rid = 4; + * @generated from field: required double target_bitrate = 9; */ - rid = ""; + targetBitrate: number; /** - * @generated from field: uint64 header_bytes_sent = 5; + * @generated from field: required uint64 total_encoded_bytes_target = 10; */ - headerBytesSent = protoInt64.zero; + totalEncodedBytesTarget: bigint; /** - * @generated from field: uint64 retransmitted_packets_sent = 6; + * @generated from field: required uint32 frame_width = 11; */ - retransmittedPacketsSent = protoInt64.zero; + frameWidth: number; /** - * @generated from field: uint64 retransmitted_bytes_sent = 7; + * @generated from field: required uint32 frame_height = 12; */ - retransmittedBytesSent = protoInt64.zero; + frameHeight: number; /** - * @generated from field: uint32 rtx_ssrc = 8; + * @generated from field: required double frames_per_second = 13; */ - rtxSsrc = 0; + framesPerSecond: number; /** - * @generated from field: double target_bitrate = 9; + * @generated from field: required uint32 frames_sent = 14; */ - targetBitrate = 0; + framesSent: number; /** - * @generated from field: uint64 total_encoded_bytes_target = 10; + * @generated from field: required uint32 huge_frames_sent = 15; */ - totalEncodedBytesTarget = protoInt64.zero; + hugeFramesSent: number; /** - * @generated from field: uint32 frame_width = 11; + * @generated from field: required uint32 frames_encoded = 16; */ - frameWidth = 0; + framesEncoded: number; /** - * @generated from field: uint32 frame_height = 12; + * @generated from field: required uint32 key_frames_encoded = 17; */ - frameHeight = 0; + keyFramesEncoded: number; /** - * @generated from field: double frames_per_second = 13; + * @generated from field: required uint64 qp_sum = 18; */ - framesPerSecond = 0; + qpSum: bigint; /** - * @generated from field: uint32 frames_sent = 14; + * @generated from field: required double total_encode_time = 19; */ - framesSent = 0; + totalEncodeTime: number; /** - * @generated from field: uint32 huge_frames_sent = 15; + * @generated from field: required double total_packet_send_delay = 20; */ - hugeFramesSent = 0; + totalPacketSendDelay: number; /** - * @generated from field: uint32 frames_encoded = 16; + * @generated from field: required livekit.proto.QualityLimitationReason quality_limitation_reason = 21; */ - framesEncoded = 0; + qualityLimitationReason: QualityLimitationReason; /** - * @generated from field: uint32 key_frames_encoded = 17; + * @generated from field: map quality_limitation_durations = 22; */ - keyFramesEncoded = 0; + qualityLimitationDurations: { [key: string]: number }; /** - * @generated from field: uint64 qp_sum = 18; + * @generated from field: required uint32 quality_limitation_resolution_changes = 23; */ - qpSum = protoInt64.zero; + qualityLimitationResolutionChanges: number; /** - * @generated from field: double total_encode_time = 19; + * @generated from field: required uint32 nack_count = 24; */ - totalEncodeTime = 0; + nackCount: number; /** - * @generated from field: double total_packet_send_delay = 20; + * @generated from field: required uint32 fir_count = 25; */ - totalPacketSendDelay = 0; + firCount: number; /** - * @generated from field: livekit.proto.QualityLimitationReason quality_limitation_reason = 21; + * @generated from field: required uint32 pli_count = 26; */ - qualityLimitationReason = QualityLimitationReason.LIMITATION_NONE; + pliCount: number; /** - * @generated from field: map quality_limitation_durations = 22; + * @generated from field: required string encoder_implementation = 27; */ - qualityLimitationDurations: { [key: string]: number } = {}; + encoderImplementation: string; /** - * @generated from field: uint32 quality_limitation_resolution_changes = 23; + * @generated from field: required bool power_efficient_encoder = 28; */ - qualityLimitationResolutionChanges = 0; + powerEfficientEncoder: boolean; /** - * @generated from field: uint32 nack_count = 24; + * @generated from field: required bool active = 29; */ - nackCount = 0; + active: boolean; /** - * @generated from field: uint32 fir_count = 25; + * @generated from field: required string scalability_mode = 30; */ - firCount = 0; + scalabilityMode: string; +}; +/** + * Describes the message livekit.proto.OutboundRtpStreamStats. + * Use `create(OutboundRtpStreamStatsSchema)` to create a new message. + */ +export const OutboundRtpStreamStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 7); + +/** + * @generated from message livekit.proto.RemoteInboundRtpStreamStats + */ +export type RemoteInboundRtpStreamStats = Message<"livekit.proto.RemoteInboundRtpStreamStats"> & { /** - * @generated from field: uint32 pli_count = 26; + * @generated from field: required string local_id = 1; */ - pliCount = 0; + localId: string; /** - * @generated from field: string encoder_implementation = 27; + * @generated from field: required double round_trip_time = 2; */ - encoderImplementation = ""; + roundTripTime: number; /** - * @generated from field: bool power_efficient_encoder = 28; + * @generated from field: required double total_round_trip_time = 3; */ - powerEfficientEncoder = false; + totalRoundTripTime: number; /** - * @generated from field: bool active = 29; + * @generated from field: required double fraction_lost = 4; */ - active = false; + fractionLost: number; /** - * @generated from field: string scalibility_mode = 30; + * @generated from field: required uint64 round_trip_time_measurements = 5; */ - scalibilityMode = ""; + roundTripTimeMeasurements: bigint; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +/** + * Describes the message livekit.proto.RemoteInboundRtpStreamStats. + * Use `create(RemoteInboundRtpStreamStatsSchema)` to create a new message. + */ +export const RemoteInboundRtpStreamStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 8); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OutboundRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "mid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "media_source_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "remote_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "rid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "header_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 6, name: "retransmitted_packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 7, name: "retransmitted_bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 8, name: "rtx_ssrc", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 9, name: "target_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 10, name: "total_encoded_bytes_target", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 11, name: "frame_width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 12, name: "frame_height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 13, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 14, name: "frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 15, name: "huge_frames_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 16, name: "frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 17, name: "key_frames_encoded", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 18, name: "qp_sum", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 19, name: "total_encode_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 20, name: "total_packet_send_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 21, name: "quality_limitation_reason", kind: "enum", T: proto3.getEnumType(QualityLimitationReason) }, - { no: 22, name: "quality_limitation_durations", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 1 /* ScalarType.DOUBLE */} }, - { no: 23, name: "quality_limitation_resolution_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 24, name: "nack_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 25, name: "fir_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 26, name: "pli_count", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 27, name: "encoder_implementation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 28, name: "power_efficient_encoder", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 29, name: "active", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 30, name: "scalibility_mode", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); +/** + * @generated from message livekit.proto.RemoteOutboundRtpStreamStats + */ +export type RemoteOutboundRtpStreamStats = Message<"livekit.proto.RemoteOutboundRtpStreamStats"> & { + /** + * @generated from field: required string local_id = 1; + */ + localId: string; - static fromBinary(bytes: Uint8Array, options?: Partial): OutboundRtpStreamStats { - return new OutboundRtpStreamStats().fromBinary(bytes, options); - } + /** + * @generated from field: required double remote_timestamp = 2; + */ + remoteTimestamp: number; - static fromJson(jsonValue: JsonValue, options?: Partial): OutboundRtpStreamStats { - return new OutboundRtpStreamStats().fromJson(jsonValue, options); - } + /** + * @generated from field: required uint64 reports_sent = 3; + */ + reportsSent: bigint; - static fromJsonString(jsonString: string, options?: Partial): OutboundRtpStreamStats { - return new OutboundRtpStreamStats().fromJsonString(jsonString, options); - } + /** + * @generated from field: required double round_trip_time = 4; + */ + roundTripTime: number; - static equals(a: OutboundRtpStreamStats | PlainMessage | undefined, b: OutboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(OutboundRtpStreamStats, a, b); - } -} + /** + * @generated from field: required double total_round_trip_time = 5; + */ + totalRoundTripTime: number; + + /** + * @generated from field: required uint64 round_trip_time_measurements = 6; + */ + roundTripTimeMeasurements: bigint; +}; /** - * @generated from message livekit.proto.RemoteInboundRtpStreamStats + * Describes the message livekit.proto.RemoteOutboundRtpStreamStats. + * Use `create(RemoteOutboundRtpStreamStatsSchema)` to create a new message. + */ +export const RemoteOutboundRtpStreamStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 9); + +/** + * @generated from message livekit.proto.MediaSourceStats */ -export class RemoteInboundRtpStreamStats extends Message { +export type MediaSourceStats = Message<"livekit.proto.MediaSourceStats"> & { /** - * @generated from field: string local_id = 1; + * @generated from field: required string track_identifier = 1; */ - localId = ""; + trackIdentifier: string; /** - * @generated from field: double round_trip_time = 2; + * @generated from field: required string kind = 2; */ - roundTripTime = 0; + kind: string; +}; +/** + * Describes the message livekit.proto.MediaSourceStats. + * Use `create(MediaSourceStatsSchema)` to create a new message. + */ +export const MediaSourceStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 10); + +/** + * @generated from message livekit.proto.AudioSourceStats + */ +export type AudioSourceStats = Message<"livekit.proto.AudioSourceStats"> & { /** - * @generated from field: double total_round_trip_time = 3; + * @generated from field: required double audio_level = 1; */ - totalRoundTripTime = 0; + audioLevel: number; /** - * @generated from field: double fraction_lost = 4; + * @generated from field: required double total_audio_energy = 2; */ - fractionLost = 0; + totalAudioEnergy: number; /** - * @generated from field: uint64 round_trip_time_measurements = 5; + * @generated from field: required double total_samples_duration = 3; */ - roundTripTimeMeasurements = protoInt64.zero; + totalSamplesDuration: number; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + /** + * @generated from field: required double echo_return_loss = 4; + */ + echoReturnLoss: number; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RemoteInboundRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 4, name: "fraction_lost", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 5, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); + /** + * @generated from field: required double echo_return_loss_enhancement = 5; + */ + echoReturnLossEnhancement: number; - static fromBinary(bytes: Uint8Array, options?: Partial): RemoteInboundRtpStreamStats { - return new RemoteInboundRtpStreamStats().fromBinary(bytes, options); - } + /** + * @generated from field: required double dropped_samples_duration = 6; + */ + droppedSamplesDuration: number; - static fromJson(jsonValue: JsonValue, options?: Partial): RemoteInboundRtpStreamStats { - return new RemoteInboundRtpStreamStats().fromJson(jsonValue, options); - } + /** + * @generated from field: required uint32 dropped_samples_events = 7; + */ + droppedSamplesEvents: number; + + /** + * @generated from field: required double total_capture_delay = 8; + */ + totalCaptureDelay: number; - static fromJsonString(jsonString: string, options?: Partial): RemoteInboundRtpStreamStats { - return new RemoteInboundRtpStreamStats().fromJsonString(jsonString, options); - } + /** + * @generated from field: required uint64 total_samples_captured = 9; + */ + totalSamplesCaptured: bigint; +}; - static equals(a: RemoteInboundRtpStreamStats | PlainMessage | undefined, b: RemoteInboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(RemoteInboundRtpStreamStats, a, b); - } -} +/** + * Describes the message livekit.proto.AudioSourceStats. + * Use `create(AudioSourceStatsSchema)` to create a new message. + */ +export const AudioSourceStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 11); /** - * @generated from message livekit.proto.RemoteOutboundRtpStreamStats + * @generated from message livekit.proto.VideoSourceStats */ -export class RemoteOutboundRtpStreamStats extends Message { +export type VideoSourceStats = Message<"livekit.proto.VideoSourceStats"> & { /** - * @generated from field: string local_id = 1; + * @generated from field: required uint32 width = 1; */ - localId = ""; + width: number; /** - * @generated from field: double remote_timestamp = 2; + * @generated from field: required uint32 height = 2; */ - remoteTimestamp = 0; + height: number; /** - * @generated from field: uint64 reports_sent = 3; + * @generated from field: required uint32 frames = 3; */ - reportsSent = protoInt64.zero; + frames: number; /** - * @generated from field: double round_trip_time = 4; + * @generated from field: required double frames_per_second = 4; */ - roundTripTime = 0; + framesPerSecond: number; +}; + +/** + * Describes the message livekit.proto.VideoSourceStats. + * Use `create(VideoSourceStatsSchema)` to create a new message. + */ +export const VideoSourceStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 12); +/** + * @generated from message livekit.proto.AudioPlayoutStats + */ +export type AudioPlayoutStats = Message<"livekit.proto.AudioPlayoutStats"> & { /** - * @generated from field: double total_round_trip_time = 5; + * @generated from field: required string kind = 1; */ - totalRoundTripTime = 0; + kind: string; /** - * @generated from field: uint64 round_trip_time_measurements = 6; + * @generated from field: required double synthesized_samples_duration = 2; */ - roundTripTimeMeasurements = protoInt64.zero; + synthesizedSamplesDuration: number; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + /** + * @generated from field: required uint32 synthesized_samples_events = 3; + */ + synthesizedSamplesEvents: number; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RemoteOutboundRtpStreamStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "remote_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "reports_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 4, name: "round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 5, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 6, name: "round_trip_time_measurements", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); + /** + * @generated from field: required double total_samples_duration = 4; + */ + totalSamplesDuration: number; - static fromBinary(bytes: Uint8Array, options?: Partial): RemoteOutboundRtpStreamStats { - return new RemoteOutboundRtpStreamStats().fromBinary(bytes, options); - } + /** + * @generated from field: required double total_playout_delay = 5; + */ + totalPlayoutDelay: number; + + /** + * @generated from field: required uint64 total_samples_count = 6; + */ + totalSamplesCount: bigint; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): RemoteOutboundRtpStreamStats { - return new RemoteOutboundRtpStreamStats().fromJson(jsonValue, options); - } +/** + * Describes the message livekit.proto.AudioPlayoutStats. + * Use `create(AudioPlayoutStatsSchema)` to create a new message. + */ +export const AudioPlayoutStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 13); - static fromJsonString(jsonString: string, options?: Partial): RemoteOutboundRtpStreamStats { - return new RemoteOutboundRtpStreamStats().fromJsonString(jsonString, options); - } +/** + * @generated from message livekit.proto.PeerConnectionStats + */ +export type PeerConnectionStats = Message<"livekit.proto.PeerConnectionStats"> & { + /** + * @generated from field: required uint32 data_channels_opened = 1; + */ + dataChannelsOpened: number; - static equals(a: RemoteOutboundRtpStreamStats | PlainMessage | undefined, b: RemoteOutboundRtpStreamStats | PlainMessage | undefined): boolean { - return proto3.util.equals(RemoteOutboundRtpStreamStats, a, b); - } -} + /** + * @generated from field: required uint32 data_channels_closed = 2; + */ + dataChannelsClosed: number; +}; /** - * @generated from message livekit.proto.MediaSourceStats + * Describes the message livekit.proto.PeerConnectionStats. + * Use `create(PeerConnectionStatsSchema)` to create a new message. */ -export class MediaSourceStats extends Message { +export const PeerConnectionStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 14); + +/** + * @generated from message livekit.proto.DataChannelStats + */ +export type DataChannelStats = Message<"livekit.proto.DataChannelStats"> & { /** - * @generated from field: string track_identifier = 1; + * @generated from field: required string label = 1; */ - trackIdentifier = ""; + label: string; /** - * @generated from field: string kind = 2; + * @generated from field: required string protocol = 2; */ - kind = ""; + protocol: string; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + /** + * @generated from field: required int32 data_channel_identifier = 3; + */ + dataChannelIdentifier: number; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.MediaSourceStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); + /** + * @generated from field: optional livekit.proto.DataChannelState state = 4; + */ + state: DataChannelState; - static fromBinary(bytes: Uint8Array, options?: Partial): MediaSourceStats { - return new MediaSourceStats().fromBinary(bytes, options); - } + /** + * @generated from field: required uint32 messages_sent = 5; + */ + messagesSent: number; - static fromJson(jsonValue: JsonValue, options?: Partial): MediaSourceStats { - return new MediaSourceStats().fromJson(jsonValue, options); - } + /** + * @generated from field: required uint64 bytes_sent = 6; + */ + bytesSent: bigint; - static fromJsonString(jsonString: string, options?: Partial): MediaSourceStats { - return new MediaSourceStats().fromJsonString(jsonString, options); - } + /** + * @generated from field: required uint32 messages_received = 7; + */ + messagesReceived: number; - static equals(a: MediaSourceStats | PlainMessage | undefined, b: MediaSourceStats | PlainMessage | undefined): boolean { - return proto3.util.equals(MediaSourceStats, a, b); - } -} + /** + * @generated from field: required uint64 bytes_received = 8; + */ + bytesReceived: bigint; +}; /** - * @generated from message livekit.proto.AudioSourceStats + * Describes the message livekit.proto.DataChannelStats. + * Use `create(DataChannelStatsSchema)` to create a new message. */ -export class AudioSourceStats extends Message { +export const DataChannelStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 15); + +/** + * @generated from message livekit.proto.TransportStats + */ +export type TransportStats = Message<"livekit.proto.TransportStats"> & { + /** + * @generated from field: required uint64 packets_sent = 1; + */ + packetsSent: bigint; + + /** + * @generated from field: required uint64 packets_received = 2; + */ + packetsReceived: bigint; + + /** + * @generated from field: required uint64 bytes_sent = 3; + */ + bytesSent: bigint; + /** - * @generated from field: double audio_level = 1; + * @generated from field: required uint64 bytes_received = 4; */ - audioLevel = 0; + bytesReceived: bigint; /** - * @generated from field: double total_audio_energy = 2; + * @generated from field: required livekit.proto.IceRole ice_role = 5; */ - totalAudioEnergy = 0; + iceRole: IceRole; /** - * @generated from field: double total_samples_duration = 3; + * @generated from field: required string ice_local_username_fragment = 6; */ - totalSamplesDuration = 0; + iceLocalUsernameFragment: string; /** - * @generated from field: double echo_return_loss = 4; + * @generated from field: optional livekit.proto.DtlsTransportState dtls_state = 7; */ - echoReturnLoss = 0; + dtlsState: DtlsTransportState; /** - * @generated from field: double echo_return_loss_enhancement = 5; + * @generated from field: optional livekit.proto.IceTransportState ice_state = 8; */ - echoReturnLossEnhancement = 0; + iceState: IceTransportState; /** - * @generated from field: double dropped_samples_duration = 6; + * @generated from field: required string selected_candidate_pair_id = 9; */ - droppedSamplesDuration = 0; + selectedCandidatePairId: string; /** - * @generated from field: uint32 dropped_samples_events = 7; + * @generated from field: required string local_certificate_id = 10; */ - droppedSamplesEvents = 0; + localCertificateId: string; /** - * @generated from field: double total_capture_delay = 8; + * @generated from field: required string remote_certificate_id = 11; */ - totalCaptureDelay = 0; + remoteCertificateId: string; /** - * @generated from field: uint64 total_samples_captured = 9; + * @generated from field: required string tls_version = 12; */ - totalSamplesCaptured = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioSourceStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "audio_level", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 2, name: "total_audio_energy", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 4, name: "echo_return_loss", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 5, name: "echo_return_loss_enhancement", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 6, name: "dropped_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 7, name: "dropped_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 8, name: "total_capture_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 9, name: "total_samples_captured", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioSourceStats { - return new AudioSourceStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioSourceStats { - return new AudioSourceStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioSourceStats { - return new AudioSourceStats().fromJsonString(jsonString, options); - } - - static equals(a: AudioSourceStats | PlainMessage | undefined, b: AudioSourceStats | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioSourceStats, a, b); - } -} + tlsVersion: string; -/** - * @generated from message livekit.proto.VideoSourceStats - */ -export class VideoSourceStats extends Message { /** - * @generated from field: uint32 width = 1; + * @generated from field: required string dtls_cipher = 13; */ - width = 0; + dtlsCipher: string; /** - * @generated from field: uint32 height = 2; + * @generated from field: required livekit.proto.DtlsRole dtls_role = 14; */ - height = 0; + dtlsRole: DtlsRole; /** - * @generated from field: uint32 frames = 3; + * @generated from field: required string srtp_cipher = 15; */ - frames = 0; + srtpCipher: string; /** - * @generated from field: double frames_per_second = 4; + * @generated from field: required uint32 selected_candidate_pair_changes = 16; */ - framesPerSecond = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoSourceStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "frames", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "frames_per_second", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoSourceStats { - return new VideoSourceStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoSourceStats { - return new VideoSourceStats().fromJson(jsonValue, options); - } + selectedCandidatePairChanges: number; +}; - static fromJsonString(jsonString: string, options?: Partial): VideoSourceStats { - return new VideoSourceStats().fromJsonString(jsonString, options); - } - - static equals(a: VideoSourceStats | PlainMessage | undefined, b: VideoSourceStats | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoSourceStats, a, b); - } -} +/** + * Describes the message livekit.proto.TransportStats. + * Use `create(TransportStatsSchema)` to create a new message. + */ +export const TransportStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 16); /** - * @generated from message livekit.proto.AudioPlayoutStats + * @generated from message livekit.proto.CandidatePairStats */ -export class AudioPlayoutStats extends Message { +export type CandidatePairStats = Message<"livekit.proto.CandidatePairStats"> & { /** - * @generated from field: string kind = 1; + * @generated from field: required string transport_id = 1; */ - kind = ""; + transportId: string; /** - * @generated from field: double synthesized_samples_duration = 2; + * @generated from field: required string local_candidate_id = 2; */ - synthesizedSamplesDuration = 0; + localCandidateId: string; /** - * @generated from field: uint32 synthesized_samples_events = 3; + * @generated from field: required string remote_candidate_id = 3; */ - synthesizedSamplesEvents = 0; + remoteCandidateId: string; /** - * @generated from field: double total_samples_duration = 4; + * @generated from field: optional livekit.proto.IceCandidatePairState state = 4; */ - totalSamplesDuration = 0; + state: IceCandidatePairState; /** - * @generated from field: double total_playout_delay = 5; + * @generated from field: required bool nominated = 5; */ - totalPlayoutDelay = 0; + nominated: boolean; /** - * @generated from field: uint64 total_samples_count = 6; + * @generated from field: required uint64 packets_sent = 6; */ - totalSamplesCount = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + packetsSent: bigint; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.AudioPlayoutStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "synthesized_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 3, name: "synthesized_samples_events", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "total_samples_duration", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 5, name: "total_playout_delay", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 6, name: "total_samples_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AudioPlayoutStats { - return new AudioPlayoutStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AudioPlayoutStats { - return new AudioPlayoutStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AudioPlayoutStats { - return new AudioPlayoutStats().fromJsonString(jsonString, options); - } - - static equals(a: AudioPlayoutStats | PlainMessage | undefined, b: AudioPlayoutStats | PlainMessage | undefined): boolean { - return proto3.util.equals(AudioPlayoutStats, a, b); - } -} - -/** - * @generated from message livekit.proto.PeerConnectionStats - */ -export class PeerConnectionStats extends Message { /** - * @generated from field: uint32 data_channels_opened = 1; + * @generated from field: required uint64 packets_received = 7; */ - dataChannelsOpened = 0; + packetsReceived: bigint; /** - * @generated from field: uint32 data_channels_closed = 2; + * @generated from field: required uint64 bytes_sent = 8; */ - dataChannelsClosed = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PeerConnectionStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data_channels_opened", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "data_channels_closed", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PeerConnectionStats { - return new PeerConnectionStats().fromBinary(bytes, options); - } + bytesSent: bigint; - static fromJson(jsonValue: JsonValue, options?: Partial): PeerConnectionStats { - return new PeerConnectionStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PeerConnectionStats { - return new PeerConnectionStats().fromJsonString(jsonString, options); - } - - static equals(a: PeerConnectionStats | PlainMessage | undefined, b: PeerConnectionStats | PlainMessage | undefined): boolean { - return proto3.util.equals(PeerConnectionStats, a, b); - } -} + /** + * @generated from field: required uint64 bytes_received = 9; + */ + bytesReceived: bigint; -/** - * @generated from message livekit.proto.DataChannelStats - */ -export class DataChannelStats extends Message { /** - * @generated from field: string label = 1; + * @generated from field: required double last_packet_sent_timestamp = 10; */ - label = ""; + lastPacketSentTimestamp: number; /** - * @generated from field: string protocol = 2; + * @generated from field: required double last_packet_received_timestamp = 11; */ - protocol = ""; + lastPacketReceivedTimestamp: number; /** - * @generated from field: int32 data_channel_identifier = 3; + * @generated from field: required double total_round_trip_time = 12; */ - dataChannelIdentifier = 0; + totalRoundTripTime: number; /** - * @generated from field: optional livekit.proto.DataChannelState state = 4; + * @generated from field: required double current_round_trip_time = 13; */ - state?: DataChannelState; + currentRoundTripTime: number; /** - * @generated from field: uint32 messages_sent = 5; + * @generated from field: required double available_outgoing_bitrate = 14; */ - messagesSent = 0; + availableOutgoingBitrate: number; /** - * @generated from field: uint64 bytes_sent = 6; + * @generated from field: required double available_incoming_bitrate = 15; */ - bytesSent = protoInt64.zero; + availableIncomingBitrate: number; /** - * @generated from field: uint32 messages_received = 7; + * @generated from field: required uint64 requests_received = 16; */ - messagesReceived = 0; + requestsReceived: bigint; /** - * @generated from field: uint64 bytes_received = 8; + * @generated from field: required uint64 requests_sent = 17; */ - bytesReceived = protoInt64.zero; + requestsSent: bigint; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + /** + * @generated from field: required uint64 responses_received = 18; + */ + responsesReceived: bigint; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.DataChannelStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "label", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "data_channel_identifier", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 4, name: "state", kind: "enum", T: proto3.getEnumType(DataChannelState), opt: true }, - { no: 5, name: "messages_sent", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 6, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 7, name: "messages_received", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 8, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); + /** + * @generated from field: required uint64 responses_sent = 19; + */ + responsesSent: bigint; - static fromBinary(bytes: Uint8Array, options?: Partial): DataChannelStats { - return new DataChannelStats().fromBinary(bytes, options); - } + /** + * @generated from field: required uint64 consent_requests_sent = 20; + */ + consentRequestsSent: bigint; - static fromJson(jsonValue: JsonValue, options?: Partial): DataChannelStats { - return new DataChannelStats().fromJson(jsonValue, options); - } + /** + * @generated from field: required uint32 packets_discarded_on_send = 21; + */ + packetsDiscardedOnSend: number; - static fromJsonString(jsonString: string, options?: Partial): DataChannelStats { - return new DataChannelStats().fromJsonString(jsonString, options); - } + /** + * @generated from field: required uint64 bytes_discarded_on_send = 22; + */ + bytesDiscardedOnSend: bigint; +}; - static equals(a: DataChannelStats | PlainMessage | undefined, b: DataChannelStats | PlainMessage | undefined): boolean { - return proto3.util.equals(DataChannelStats, a, b); - } -} +/** + * Describes the message livekit.proto.CandidatePairStats. + * Use `create(CandidatePairStatsSchema)` to create a new message. + */ +export const CandidatePairStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 17); /** - * @generated from message livekit.proto.TransportStats + * @generated from message livekit.proto.IceCandidateStats */ -export class TransportStats extends Message { +export type IceCandidateStats = Message<"livekit.proto.IceCandidateStats"> & { /** - * @generated from field: uint64 packets_sent = 1; + * @generated from field: required string transport_id = 1; */ - packetsSent = protoInt64.zero; + transportId: string; /** - * @generated from field: uint64 packets_received = 2; + * @generated from field: required string address = 2; */ - packetsReceived = protoInt64.zero; + address: string; /** - * @generated from field: uint64 bytes_sent = 3; + * @generated from field: required int32 port = 3; */ - bytesSent = protoInt64.zero; + port: number; /** - * @generated from field: uint64 bytes_received = 4; + * @generated from field: required string protocol = 4; */ - bytesReceived = protoInt64.zero; + protocol: string; /** - * @generated from field: livekit.proto.IceRole ice_role = 5; + * @generated from field: optional livekit.proto.IceCandidateType candidate_type = 5; */ - iceRole = IceRole.ICE_UNKNOWN; + candidateType: IceCandidateType; /** - * @generated from field: string ice_local_username_fragment = 6; + * @generated from field: required int32 priority = 6; */ - iceLocalUsernameFragment = ""; + priority: number; /** - * @generated from field: optional livekit.proto.DtlsTransportState dtls_state = 7; + * @generated from field: required string url = 7; */ - dtlsState?: DtlsTransportState; + url: string; /** - * @generated from field: optional livekit.proto.IceTransportState ice_state = 8; + * @generated from field: optional livekit.proto.IceServerTransportProtocol relay_protocol = 8; */ - iceState?: IceTransportState; + relayProtocol: IceServerTransportProtocol; /** - * @generated from field: string selected_candidate_pair_id = 9; + * @generated from field: required string foundation = 9; */ - selectedCandidatePairId = ""; + foundation: string; /** - * @generated from field: string local_certificate_id = 10; + * @generated from field: required string related_address = 10; */ - localCertificateId = ""; + relatedAddress: string; /** - * @generated from field: string remote_certificate_id = 11; + * @generated from field: required int32 related_port = 11; */ - remoteCertificateId = ""; + relatedPort: number; /** - * @generated from field: string tls_version = 12; + * @generated from field: required string username_fragment = 12; */ - tlsVersion = ""; + usernameFragment: string; /** - * @generated from field: string dtls_cipher = 13; + * @generated from field: optional livekit.proto.IceTcpCandidateType tcp_type = 13; */ - dtlsCipher = ""; + tcpType: IceTcpCandidateType; +}; + +/** + * Describes the message livekit.proto.IceCandidateStats. + * Use `create(IceCandidateStatsSchema)` to create a new message. + */ +export const IceCandidateStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 18); +/** + * @generated from message livekit.proto.CertificateStats + */ +export type CertificateStats = Message<"livekit.proto.CertificateStats"> & { /** - * @generated from field: livekit.proto.DtlsRole dtls_role = 14; + * @generated from field: required string fingerprint = 1; */ - dtlsRole = DtlsRole.DTLS_CLIENT; + fingerprint: string; /** - * @generated from field: string srtp_cipher = 15; + * @generated from field: required string fingerprint_algorithm = 2; */ - srtpCipher = ""; + fingerprintAlgorithm: string; /** - * @generated from field: uint32 selected_candidate_pair_changes = 16; + * @generated from field: required string base64_certificate = 3; */ - selectedCandidatePairChanges = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + base64Certificate: string; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TransportStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 3, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 4, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 5, name: "ice_role", kind: "enum", T: proto3.getEnumType(IceRole) }, - { no: 6, name: "ice_local_username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "dtls_state", kind: "enum", T: proto3.getEnumType(DtlsTransportState), opt: true }, - { no: 8, name: "ice_state", kind: "enum", T: proto3.getEnumType(IceTransportState), opt: true }, - { no: 9, name: "selected_candidate_pair_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 10, name: "local_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 11, name: "remote_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 12, name: "tls_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 13, name: "dtls_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 14, name: "dtls_role", kind: "enum", T: proto3.getEnumType(DtlsRole) }, - { no: 15, name: "srtp_cipher", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 16, name: "selected_candidate_pair_changes", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TransportStats { - return new TransportStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TransportStats { - return new TransportStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TransportStats { - return new TransportStats().fromJsonString(jsonString, options); - } + /** + * @generated from field: required string issuer_certificate_id = 4; + */ + issuerCertificateId: string; +}; - static equals(a: TransportStats | PlainMessage | undefined, b: TransportStats | PlainMessage | undefined): boolean { - return proto3.util.equals(TransportStats, a, b); - } -} +/** + * Describes the message livekit.proto.CertificateStats. + * Use `create(CertificateStatsSchema)` to create a new message. + */ +export const CertificateStatsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_stats, 19); /** - * @generated from message livekit.proto.CandidatePairStats + * @generated from enum livekit.proto.DataChannelState */ -export class CandidatePairStats extends Message { +export enum DataChannelState { /** - * @generated from field: string transport_id = 1; + * @generated from enum value: DC_CONNECTING = 0; */ - transportId = ""; + DC_CONNECTING = 0, /** - * @generated from field: string local_candidate_id = 2; + * @generated from enum value: DC_OPEN = 1; */ - localCandidateId = ""; + DC_OPEN = 1, /** - * @generated from field: string remote_candidate_id = 3; + * @generated from enum value: DC_CLOSING = 2; */ - remoteCandidateId = ""; + DC_CLOSING = 2, /** - * @generated from field: optional livekit.proto.IceCandidatePairState state = 4; + * @generated from enum value: DC_CLOSED = 3; */ - state?: IceCandidatePairState; + DC_CLOSED = 3, +} + +/** + * Describes the enum livekit.proto.DataChannelState. + */ +export const DataChannelStateSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 0); +/** + * @generated from enum livekit.proto.QualityLimitationReason + */ +export enum QualityLimitationReason { /** - * @generated from field: bool nominated = 5; + * @generated from enum value: LIMITATION_NONE = 0; */ - nominated = false; + LIMITATION_NONE = 0, /** - * @generated from field: uint64 packets_sent = 6; + * @generated from enum value: LIMITATION_CPU = 1; */ - packetsSent = protoInt64.zero; + LIMITATION_CPU = 1, /** - * @generated from field: uint64 packets_received = 7; + * @generated from enum value: LIMITATION_BANDWIDTH = 2; */ - packetsReceived = protoInt64.zero; + LIMITATION_BANDWIDTH = 2, /** - * @generated from field: uint64 bytes_sent = 8; + * @generated from enum value: LIMITATION_OTHER = 3; */ - bytesSent = protoInt64.zero; + LIMITATION_OTHER = 3, +} + +/** + * Describes the enum livekit.proto.QualityLimitationReason. + */ +export const QualityLimitationReasonSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 1); +/** + * @generated from enum livekit.proto.IceRole + */ +export enum IceRole { /** - * @generated from field: uint64 bytes_received = 9; + * @generated from enum value: ICE_UNKNOWN = 0; */ - bytesReceived = protoInt64.zero; + ICE_UNKNOWN = 0, /** - * @generated from field: double last_packet_sent_timestamp = 10; + * @generated from enum value: ICE_CONTROLLING = 1; */ - lastPacketSentTimestamp = 0; + ICE_CONTROLLING = 1, /** - * @generated from field: double last_packet_received_timestamp = 11; + * @generated from enum value: ICE_CONTROLLED = 2; */ - lastPacketReceivedTimestamp = 0; + ICE_CONTROLLED = 2, +} + +/** + * Describes the enum livekit.proto.IceRole. + */ +export const IceRoleSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 2); +/** + * @generated from enum livekit.proto.DtlsTransportState + */ +export enum DtlsTransportState { /** - * @generated from field: double total_round_trip_time = 12; + * @generated from enum value: DTLS_TRANSPORT_NEW = 0; */ - totalRoundTripTime = 0; + DTLS_TRANSPORT_NEW = 0, /** - * @generated from field: double current_round_trip_time = 13; + * @generated from enum value: DTLS_TRANSPORT_CONNECTING = 1; */ - currentRoundTripTime = 0; + DTLS_TRANSPORT_CONNECTING = 1, /** - * @generated from field: double available_outgoing_bitrate = 14; + * @generated from enum value: DTLS_TRANSPORT_CONNECTED = 2; */ - availableOutgoingBitrate = 0; + DTLS_TRANSPORT_CONNECTED = 2, /** - * @generated from field: double available_incoming_bitrate = 15; + * @generated from enum value: DTLS_TRANSPORT_CLOSED = 3; */ - availableIncomingBitrate = 0; + DTLS_TRANSPORT_CLOSED = 3, /** - * @generated from field: uint64 requests_received = 16; + * @generated from enum value: DTLS_TRANSPORT_FAILED = 4; */ - requestsReceived = protoInt64.zero; + DTLS_TRANSPORT_FAILED = 4, +} + +/** + * Describes the enum livekit.proto.DtlsTransportState. + */ +export const DtlsTransportStateSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 3); +/** + * @generated from enum livekit.proto.IceTransportState + */ +export enum IceTransportState { /** - * @generated from field: uint64 requests_sent = 17; + * @generated from enum value: ICE_TRANSPORT_NEW = 0; */ - requestsSent = protoInt64.zero; + ICE_TRANSPORT_NEW = 0, /** - * @generated from field: uint64 responses_received = 18; + * @generated from enum value: ICE_TRANSPORT_CHECKING = 1; */ - responsesReceived = protoInt64.zero; + ICE_TRANSPORT_CHECKING = 1, /** - * @generated from field: uint64 responses_sent = 19; + * @generated from enum value: ICE_TRANSPORT_CONNECTED = 2; */ - responsesSent = protoInt64.zero; + ICE_TRANSPORT_CONNECTED = 2, /** - * @generated from field: uint64 consent_requests_sent = 20; + * @generated from enum value: ICE_TRANSPORT_COMPLETED = 3; */ - consentRequestsSent = protoInt64.zero; + ICE_TRANSPORT_COMPLETED = 3, /** - * @generated from field: uint32 packets_discarded_on_send = 21; + * @generated from enum value: ICE_TRANSPORT_DISCONNECTED = 4; */ - packetsDiscardedOnSend = 0; + ICE_TRANSPORT_DISCONNECTED = 4, /** - * @generated from field: uint64 bytes_discarded_on_send = 22; + * @generated from enum value: ICE_TRANSPORT_FAILED = 5; */ - bytesDiscardedOnSend = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CandidatePairStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "local_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "remote_candidate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "state", kind: "enum", T: proto3.getEnumType(IceCandidatePairState), opt: true }, - { no: 5, name: "nominated", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "packets_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 7, name: "packets_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 8, name: "bytes_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 9, name: "bytes_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 10, name: "last_packet_sent_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 11, name: "last_packet_received_timestamp", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 12, name: "total_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 13, name: "current_round_trip_time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 14, name: "available_outgoing_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 15, name: "available_incoming_bitrate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 16, name: "requests_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 17, name: "requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 18, name: "responses_received", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 19, name: "responses_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 20, name: "consent_requests_sent", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 21, name: "packets_discarded_on_send", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 22, name: "bytes_discarded_on_send", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CandidatePairStats { - return new CandidatePairStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CandidatePairStats { - return new CandidatePairStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CandidatePairStats { - return new CandidatePairStats().fromJsonString(jsonString, options); - } + ICE_TRANSPORT_FAILED = 5, - static equals(a: CandidatePairStats | PlainMessage | undefined, b: CandidatePairStats | PlainMessage | undefined): boolean { - return proto3.util.equals(CandidatePairStats, a, b); - } + /** + * @generated from enum value: ICE_TRANSPORT_CLOSED = 6; + */ + ICE_TRANSPORT_CLOSED = 6, } /** - * @generated from message livekit.proto.IceCandidateStats + * Describes the enum livekit.proto.IceTransportState. */ -export class IceCandidateStats extends Message { - /** - * @generated from field: string transport_id = 1; - */ - transportId = ""; +export const IceTransportStateSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 4); +/** + * @generated from enum livekit.proto.DtlsRole + */ +export enum DtlsRole { /** - * @generated from field: string address = 2; + * @generated from enum value: DTLS_CLIENT = 0; */ - address = ""; + DTLS_CLIENT = 0, /** - * @generated from field: int32 port = 3; + * @generated from enum value: DTLS_SERVER = 1; */ - port = 0; + DTLS_SERVER = 1, /** - * @generated from field: string protocol = 4; + * @generated from enum value: DTLS_UNKNOWN = 2; */ - protocol = ""; + DTLS_UNKNOWN = 2, +} + +/** + * Describes the enum livekit.proto.DtlsRole. + */ +export const DtlsRoleSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 5); +/** + * @generated from enum livekit.proto.IceCandidatePairState + */ +export enum IceCandidatePairState { /** - * @generated from field: optional livekit.proto.IceCandidateType candidate_type = 5; + * @generated from enum value: PAIR_FROZEN = 0; */ - candidateType?: IceCandidateType; + PAIR_FROZEN = 0, /** - * @generated from field: int32 priority = 6; + * @generated from enum value: PAIR_WAITING = 1; */ - priority = 0; + PAIR_WAITING = 1, /** - * @generated from field: string url = 7; + * @generated from enum value: PAIR_IN_PROGRESS = 2; */ - url = ""; + PAIR_IN_PROGRESS = 2, /** - * @generated from field: optional livekit.proto.IceServerTransportProtocol relay_protocol = 8; + * @generated from enum value: PAIR_FAILED = 3; */ - relayProtocol?: IceServerTransportProtocol; + PAIR_FAILED = 3, /** - * @generated from field: string foundation = 9; + * @generated from enum value: PAIR_SUCCEEDED = 4; */ - foundation = ""; + PAIR_SUCCEEDED = 4, +} + +/** + * Describes the enum livekit.proto.IceCandidatePairState. + */ +export const IceCandidatePairStateSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 6); +/** + * @generated from enum livekit.proto.IceCandidateType + */ +export enum IceCandidateType { /** - * @generated from field: string related_address = 10; + * @generated from enum value: HOST = 0; */ - relatedAddress = ""; + HOST = 0, /** - * @generated from field: int32 related_port = 11; + * @generated from enum value: SRFLX = 1; */ - relatedPort = 0; + SRFLX = 1, /** - * @generated from field: string username_fragment = 12; + * @generated from enum value: PRFLX = 2; */ - usernameFragment = ""; + PRFLX = 2, /** - * @generated from field: optional livekit.proto.IceTcpCandidateType tcp_type = 13; + * @generated from enum value: RELAY = 3; */ - tcpType?: IceTcpCandidateType; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.IceCandidateStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "transport_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "port", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 4, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "candidate_type", kind: "enum", T: proto3.getEnumType(IceCandidateType), opt: true }, - { no: 6, name: "priority", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 7, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 8, name: "relay_protocol", kind: "enum", T: proto3.getEnumType(IceServerTransportProtocol), opt: true }, - { no: 9, name: "foundation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 10, name: "related_address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 11, name: "related_port", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 12, name: "username_fragment", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 13, name: "tcp_type", kind: "enum", T: proto3.getEnumType(IceTcpCandidateType), opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): IceCandidateStats { - return new IceCandidateStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): IceCandidateStats { - return new IceCandidateStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): IceCandidateStats { - return new IceCandidateStats().fromJsonString(jsonString, options); - } - - static equals(a: IceCandidateStats | PlainMessage | undefined, b: IceCandidateStats | PlainMessage | undefined): boolean { - return proto3.util.equals(IceCandidateStats, a, b); - } + RELAY = 3, } /** - * @generated from message livekit.proto.CertificateStats + * Describes the enum livekit.proto.IceCandidateType. */ -export class CertificateStats extends Message { - /** - * @generated from field: string fingerprint = 1; - */ - fingerprint = ""; +export const IceCandidateTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 7); +/** + * @generated from enum livekit.proto.IceServerTransportProtocol + */ +export enum IceServerTransportProtocol { /** - * @generated from field: string fingerprint_algorithm = 2; + * @generated from enum value: TRANSPORT_UDP = 0; */ - fingerprintAlgorithm = ""; + TRANSPORT_UDP = 0, /** - * @generated from field: string base64_certificate = 3; + * @generated from enum value: TRANSPORT_TCP = 1; */ - base64Certificate = ""; + TRANSPORT_TCP = 1, /** - * @generated from field: string issuer_certificate_id = 4; + * @generated from enum value: TRANSPORT_TLS = 2; */ - issuerCertificateId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CertificateStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "fingerprint", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "fingerprint_algorithm", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "base64_certificate", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "issuer_certificate_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); + TRANSPORT_TLS = 2, +} - static fromBinary(bytes: Uint8Array, options?: Partial): CertificateStats { - return new CertificateStats().fromBinary(bytes, options); - } +/** + * Describes the enum livekit.proto.IceServerTransportProtocol. + */ +export const IceServerTransportProtocolSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 8); - static fromJson(jsonValue: JsonValue, options?: Partial): CertificateStats { - return new CertificateStats().fromJson(jsonValue, options); - } +/** + * @generated from enum livekit.proto.IceTcpCandidateType + */ +export enum IceTcpCandidateType { + /** + * @generated from enum value: CANDIDATE_ACTIVE = 0; + */ + CANDIDATE_ACTIVE = 0, - static fromJsonString(jsonString: string, options?: Partial): CertificateStats { - return new CertificateStats().fromJsonString(jsonString, options); - } + /** + * @generated from enum value: CANDIDATE_PASSIVE = 1; + */ + CANDIDATE_PASSIVE = 1, - static equals(a: CertificateStats | PlainMessage | undefined, b: CertificateStats | PlainMessage | undefined): boolean { - return proto3.util.equals(CertificateStats, a, b); - } + /** + * @generated from enum value: CANDIDATE_SO = 2; + */ + CANDIDATE_SO = 2, } +/** + * Describes the enum livekit.proto.IceTcpCandidateType. + */ +export const IceTcpCandidateTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_stats, 9); + diff --git a/packages/livekit-rtc/src/proto/track_pb.ts b/packages/livekit-rtc/src/proto/track_pb.ts index c7a87d65..d5e159d7 100644 --- a/packages/livekit-rtc/src/proto/track_pb.ts +++ b/packages/livekit-rtc/src/proto/track_pb.ts @@ -12,836 +12,502 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file track.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file track.proto (package livekit.proto, syntax proto2) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; -import { RtcStats } from "./stats_pb.js"; -import { EncryptionType } from "./e2ee_pb.js"; -import { FfiOwnedHandle } from "./handle_pb.js"; +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { EncryptionType } from "./e2ee_pb"; +import { file_e2ee } from "./e2ee_pb"; +import type { FfiOwnedHandle } from "./handle_pb"; +import { file_handle } from "./handle_pb"; +import type { RtcStats } from "./stats_pb"; +import { file_stats } from "./stats_pb"; +import type { Message } from "@bufbuild/protobuf"; /** - * @generated from enum livekit.proto.TrackKind + * Describes the file track.proto. */ -export enum TrackKind { - /** - * @generated from enum value: KIND_UNKNOWN = 0; - */ - KIND_UNKNOWN = 0, - - /** - * @generated from enum value: KIND_AUDIO = 1; - */ - KIND_AUDIO = 1, - - /** - * @generated from enum value: KIND_VIDEO = 2; - */ - KIND_VIDEO = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(TrackKind) -proto3.util.setEnumType(TrackKind, "livekit.proto.TrackKind", [ - { no: 0, name: "KIND_UNKNOWN" }, - { no: 1, name: "KIND_AUDIO" }, - { no: 2, name: "KIND_VIDEO" }, -]); - -/** - * @generated from enum livekit.proto.TrackSource - */ -export enum TrackSource { - /** - * @generated from enum value: SOURCE_UNKNOWN = 0; - */ - SOURCE_UNKNOWN = 0, - - /** - * @generated from enum value: SOURCE_CAMERA = 1; - */ - SOURCE_CAMERA = 1, - - /** - * @generated from enum value: SOURCE_MICROPHONE = 2; - */ - SOURCE_MICROPHONE = 2, - - /** - * @generated from enum value: SOURCE_SCREENSHARE = 3; - */ - SOURCE_SCREENSHARE = 3, - - /** - * @generated from enum value: SOURCE_SCREENSHARE_AUDIO = 4; - */ - SOURCE_SCREENSHARE_AUDIO = 4, -} -// Retrieve enum metadata with: proto3.getEnumType(TrackSource) -proto3.util.setEnumType(TrackSource, "livekit.proto.TrackSource", [ - { no: 0, name: "SOURCE_UNKNOWN" }, - { no: 1, name: "SOURCE_CAMERA" }, - { no: 2, name: "SOURCE_MICROPHONE" }, - { no: 3, name: "SOURCE_SCREENSHARE" }, - { no: 4, name: "SOURCE_SCREENSHARE_AUDIO" }, -]); - -/** - * @generated from enum livekit.proto.StreamState - */ -export enum StreamState { - /** - * @generated from enum value: STATE_UNKNOWN = 0; - */ - STATE_UNKNOWN = 0, - - /** - * @generated from enum value: STATE_ACTIVE = 1; - */ - STATE_ACTIVE = 1, - - /** - * @generated from enum value: STATE_PAUSED = 2; - */ - STATE_PAUSED = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(StreamState) -proto3.util.setEnumType(StreamState, "livekit.proto.StreamState", [ - { no: 0, name: "STATE_UNKNOWN" }, - { no: 1, name: "STATE_ACTIVE" }, - { no: 2, name: "STATE_PAUSED" }, -]); +export const file_track: GenFile = /*@__PURE__*/ + fileDesc("Cgt0cmFjay5wcm90bxINbGl2ZWtpdC5wcm90byI+ChdDcmVhdGVWaWRlb1RyYWNrUmVxdWVzdBIMCgRuYW1lGAEgAigJEhUKDXNvdXJjZV9oYW5kbGUYAiACKAQiRAoYQ3JlYXRlVmlkZW9UcmFja1Jlc3BvbnNlEigKBXRyYWNrGAEgAigLMhkubGl2ZWtpdC5wcm90by5Pd25lZFRyYWNrIj4KF0NyZWF0ZUF1ZGlvVHJhY2tSZXF1ZXN0EgwKBG5hbWUYASACKAkSFQoNc291cmNlX2hhbmRsZRgCIAIoBCJEChhDcmVhdGVBdWRpb1RyYWNrUmVzcG9uc2USKAoFdHJhY2sYASACKAsyGS5saXZla2l0LnByb3RvLk93bmVkVHJhY2siJwoPR2V0U3RhdHNSZXF1ZXN0EhQKDHRyYWNrX2hhbmRsZRgBIAIoBCIkChBHZXRTdGF0c1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIlsKEEdldFN0YXRzQ2FsbGJhY2sSEAoIYXN5bmNfaWQYASACKAQSDQoFZXJyb3IYAiABKAkSJgoFc3RhdHMYAyADKAsyFy5saXZla2l0LnByb3RvLlJ0Y1N0YXRzIgwKClRyYWNrRXZlbnQiowIKFFRyYWNrUHVibGljYXRpb25JbmZvEgsKA3NpZBgBIAIoCRIMCgRuYW1lGAIgAigJEiYKBGtpbmQYAyACKA4yGC5saXZla2l0LnByb3RvLlRyYWNrS2luZBIqCgZzb3VyY2UYBCACKA4yGi5saXZla2l0LnByb3RvLlRyYWNrU291cmNlEhMKC3NpbXVsY2FzdGVkGAUgAigIEg0KBXdpZHRoGAYgAigNEg4KBmhlaWdodBgHIAIoDRIRCgltaW1lX3R5cGUYCCACKAkSDQoFbXV0ZWQYCSACKAgSDgoGcmVtb3RlGAogAigIEjYKD2VuY3J5cHRpb25fdHlwZRgLIAIoDjIdLmxpdmVraXQucHJvdG8uRW5jcnlwdGlvblR5cGUieQoVT3duZWRUcmFja1B1YmxpY2F0aW9uEi0KBmhhbmRsZRgBIAIoCzIdLmxpdmVraXQucHJvdG8uRmZpT3duZWRIYW5kbGUSMQoEaW5mbxgCIAIoCzIjLmxpdmVraXQucHJvdG8uVHJhY2tQdWJsaWNhdGlvbkluZm8inwEKCVRyYWNrSW5mbxILCgNzaWQYASACKAkSDAoEbmFtZRgCIAIoCRImCgRraW5kGAMgAigOMhgubGl2ZWtpdC5wcm90by5UcmFja0tpbmQSMAoMc3RyZWFtX3N0YXRlGAQgAigOMhoubGl2ZWtpdC5wcm90by5TdHJlYW1TdGF0ZRINCgVtdXRlZBgFIAIoCBIOCgZyZW1vdGUYBiACKAgiYwoKT3duZWRUcmFjaxItCgZoYW5kbGUYASACKAsyHS5saXZla2l0LnByb3RvLkZmaU93bmVkSGFuZGxlEiYKBGluZm8YAiACKAsyGC5saXZla2l0LnByb3RvLlRyYWNrSW5mbyI7ChVMb2NhbFRyYWNrTXV0ZVJlcXVlc3QSFAoMdHJhY2tfaGFuZGxlGAEgAigEEgwKBG11dGUYAiACKAgiJwoWTG9jYWxUcmFja011dGVSZXNwb25zZRINCgVtdXRlZBgBIAIoCCJBChhFbmFibGVSZW1vdGVUcmFja1JlcXVlc3QSFAoMdHJhY2tfaGFuZGxlGAEgAigEEg8KB2VuYWJsZWQYAiACKAgiLAoZRW5hYmxlUmVtb3RlVHJhY2tSZXNwb25zZRIPCgdlbmFibGVkGAEgAigIKj0KCVRyYWNrS2luZBIQCgxLSU5EX1VOS05PV04QABIOCgpLSU5EX0FVRElPEAESDgoKS0lORF9WSURFTxACKoEBCgtUcmFja1NvdXJjZRISCg5TT1VSQ0VfVU5LTk9XThAAEhEKDVNPVVJDRV9DQU1FUkEQARIVChFTT1VSQ0VfTUlDUk9QSE9ORRACEhYKElNPVVJDRV9TQ1JFRU5TSEFSRRADEhwKGFNPVVJDRV9TQ1JFRU5TSEFSRV9BVURJTxAEKkQKC1N0cmVhbVN0YXRlEhEKDVNUQVRFX1VOS05PV04QABIQCgxTVEFURV9BQ1RJVkUQARIQCgxTVEFURV9QQVVTRUQQAkIQqgINTGl2ZUtpdC5Qcm90bw", [file_e2ee, file_handle, file_stats]); /** * Create a new VideoTrack from a VideoSource * * @generated from message livekit.proto.CreateVideoTrackRequest */ -export class CreateVideoTrackRequest extends Message { +export type CreateVideoTrackRequest = Message<"livekit.proto.CreateVideoTrackRequest"> & { /** - * @generated from field: string name = 1; + * @generated from field: required string name = 1; */ - name = ""; + name: string; /** - * @generated from field: uint64 source_handle = 2; + * @generated from field: required uint64 source_handle = 2; */ - sourceHandle = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CreateVideoTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); + sourceHandle: bigint; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): CreateVideoTrackRequest { - return new CreateVideoTrackRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateVideoTrackRequest { - return new CreateVideoTrackRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateVideoTrackRequest { - return new CreateVideoTrackRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateVideoTrackRequest | PlainMessage | undefined, b: CreateVideoTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateVideoTrackRequest, a, b); - } -} +/** + * Describes the message livekit.proto.CreateVideoTrackRequest. + * Use `create(CreateVideoTrackRequestSchema)` to create a new message. + */ +export const CreateVideoTrackRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 0); /** * @generated from message livekit.proto.CreateVideoTrackResponse */ -export class CreateVideoTrackResponse extends Message { +export type CreateVideoTrackResponse = Message<"livekit.proto.CreateVideoTrackResponse"> & { /** - * @generated from field: livekit.proto.OwnedTrack track = 1; + * @generated from field: required livekit.proto.OwnedTrack track = 1; */ track?: OwnedTrack; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CreateVideoTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track", kind: "message", T: OwnedTrack }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateVideoTrackResponse { - return new CreateVideoTrackResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateVideoTrackResponse { - return new CreateVideoTrackResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateVideoTrackResponse { - return new CreateVideoTrackResponse().fromJsonString(jsonString, options); - } - - static equals(a: CreateVideoTrackResponse | PlainMessage | undefined, b: CreateVideoTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateVideoTrackResponse, a, b); - } -} +/** + * Describes the message livekit.proto.CreateVideoTrackResponse. + * Use `create(CreateVideoTrackResponseSchema)` to create a new message. + */ +export const CreateVideoTrackResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 1); /** * Create a new AudioTrack from a AudioSource * * @generated from message livekit.proto.CreateAudioTrackRequest */ -export class CreateAudioTrackRequest extends Message { +export type CreateAudioTrackRequest = Message<"livekit.proto.CreateAudioTrackRequest"> & { /** - * @generated from field: string name = 1; + * @generated from field: required string name = 1; */ - name = ""; + name: string; /** - * @generated from field: uint64 source_handle = 2; + * @generated from field: required uint64 source_handle = 2; */ - sourceHandle = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + sourceHandle: bigint; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CreateAudioTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateAudioTrackRequest { - return new CreateAudioTrackRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateAudioTrackRequest { - return new CreateAudioTrackRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateAudioTrackRequest { - return new CreateAudioTrackRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateAudioTrackRequest | PlainMessage | undefined, b: CreateAudioTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateAudioTrackRequest, a, b); - } -} +/** + * Describes the message livekit.proto.CreateAudioTrackRequest. + * Use `create(CreateAudioTrackRequestSchema)` to create a new message. + */ +export const CreateAudioTrackRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 2); /** * @generated from message livekit.proto.CreateAudioTrackResponse */ -export class CreateAudioTrackResponse extends Message { +export type CreateAudioTrackResponse = Message<"livekit.proto.CreateAudioTrackResponse"> & { /** - * @generated from field: livekit.proto.OwnedTrack track = 1; + * @generated from field: required livekit.proto.OwnedTrack track = 1; */ track?: OwnedTrack; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CreateAudioTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track", kind: "message", T: OwnedTrack }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateAudioTrackResponse { - return new CreateAudioTrackResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateAudioTrackResponse { - return new CreateAudioTrackResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateAudioTrackResponse { - return new CreateAudioTrackResponse().fromJsonString(jsonString, options); - } - - static equals(a: CreateAudioTrackResponse | PlainMessage | undefined, b: CreateAudioTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateAudioTrackResponse, a, b); - } -} +/** + * Describes the message livekit.proto.CreateAudioTrackResponse. + * Use `create(CreateAudioTrackResponseSchema)` to create a new message. + */ +export const CreateAudioTrackResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 3); /** * @generated from message livekit.proto.GetStatsRequest */ -export class GetStatsRequest extends Message { +export type GetStatsRequest = Message<"livekit.proto.GetStatsRequest"> & { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle: bigint; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.GetStatsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetStatsRequest { - return new GetStatsRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetStatsRequest { - return new GetStatsRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetStatsRequest { - return new GetStatsRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetStatsRequest | PlainMessage | undefined, b: GetStatsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetStatsRequest, a, b); - } -} +/** + * Describes the message livekit.proto.GetStatsRequest. + * Use `create(GetStatsRequestSchema)` to create a new message. + */ +export const GetStatsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 4); /** * @generated from message livekit.proto.GetStatsResponse */ -export class GetStatsResponse extends Message { +export type GetStatsResponse = Message<"livekit.proto.GetStatsResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.GetStatsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetStatsResponse { - return new GetStatsResponse().fromBinary(bytes, options); - } + asyncId: bigint; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): GetStatsResponse { - return new GetStatsResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetStatsResponse { - return new GetStatsResponse().fromJsonString(jsonString, options); - } - - static equals(a: GetStatsResponse | PlainMessage | undefined, b: GetStatsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetStatsResponse, a, b); - } -} +/** + * Describes the message livekit.proto.GetStatsResponse. + * Use `create(GetStatsResponseSchema)` to create a new message. + */ +export const GetStatsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 5); /** * @generated from message livekit.proto.GetStatsCallback */ -export class GetStatsCallback extends Message { +export type GetStatsCallback = Message<"livekit.proto.GetStatsCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @generated from field: optional string error = 2; */ - error?: string; + error: string; /** * @generated from field: repeated livekit.proto.RtcStats stats = 3; */ - stats: RtcStats[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.GetStatsCallback"; - 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 }, - { no: 3, name: "stats", kind: "message", T: RtcStats, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetStatsCallback { - return new GetStatsCallback().fromBinary(bytes, options); - } + stats: RtcStats[]; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): GetStatsCallback { - return new GetStatsCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetStatsCallback { - return new GetStatsCallback().fromJsonString(jsonString, options); - } - - static equals(a: GetStatsCallback | PlainMessage | undefined, b: GetStatsCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(GetStatsCallback, a, b); - } -} +/** + * Describes the message livekit.proto.GetStatsCallback. + * Use `create(GetStatsCallbackSchema)` to create a new message. + */ +export const GetStatsCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 6); /** * @generated from message livekit.proto.TrackEvent */ -export class TrackEvent extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackEvent { - return new TrackEvent().fromBinary(bytes, options); - } +export type TrackEvent = Message<"livekit.proto.TrackEvent"> & { +}; - static fromJson(jsonValue: JsonValue, options?: Partial): TrackEvent { - return new TrackEvent().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackEvent { - return new TrackEvent().fromJsonString(jsonString, options); - } - - static equals(a: TrackEvent | PlainMessage | undefined, b: TrackEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackEvent, a, b); - } -} +/** + * Describes the message livekit.proto.TrackEvent. + * Use `create(TrackEventSchema)` to create a new message. + */ +export const TrackEventSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 7); /** * @generated from message livekit.proto.TrackPublicationInfo */ -export class TrackPublicationInfo extends Message { +export type TrackPublicationInfo = Message<"livekit.proto.TrackPublicationInfo"> & { /** - * @generated from field: string sid = 1; + * @generated from field: required string sid = 1; */ - sid = ""; + sid: string; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; + name: string; /** - * @generated from field: livekit.proto.TrackKind kind = 3; + * @generated from field: required livekit.proto.TrackKind kind = 3; */ - kind = TrackKind.KIND_UNKNOWN; + kind: TrackKind; /** - * @generated from field: livekit.proto.TrackSource source = 4; + * @generated from field: required livekit.proto.TrackSource source = 4; */ - source = TrackSource.SOURCE_UNKNOWN; + source: TrackSource; /** - * @generated from field: bool simulcasted = 5; + * @generated from field: required bool simulcasted = 5; */ - simulcasted = false; + simulcasted: boolean; /** - * @generated from field: uint32 width = 6; + * @generated from field: required uint32 width = 6; */ - width = 0; + width: number; /** - * @generated from field: uint32 height = 7; + * @generated from field: required uint32 height = 7; */ - height = 0; + height: number; /** - * @generated from field: string mime_type = 8; + * @generated from field: required string mime_type = 8; */ - mimeType = ""; + mimeType: string; /** - * @generated from field: bool muted = 9; + * @generated from field: required bool muted = 9; */ - muted = false; + muted: boolean; /** - * @generated from field: bool remote = 10; + * @generated from field: required bool remote = 10; */ - remote = false; + remote: boolean; /** - * @generated from field: livekit.proto.EncryptionType encryption_type = 11; + * @generated from field: required livekit.proto.EncryptionType encryption_type = 11; */ - encryptionType = EncryptionType.NONE; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackPublicationInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "kind", kind: "enum", T: proto3.getEnumType(TrackKind) }, - { no: 4, name: "source", kind: "enum", T: proto3.getEnumType(TrackSource) }, - { no: 5, name: "simulcasted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 7, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 8, name: "mime_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 9, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 10, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 11, name: "encryption_type", kind: "enum", T: proto3.getEnumType(EncryptionType) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackPublicationInfo { - return new TrackPublicationInfo().fromBinary(bytes, options); - } + encryptionType: EncryptionType; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): TrackPublicationInfo { - return new TrackPublicationInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackPublicationInfo { - return new TrackPublicationInfo().fromJsonString(jsonString, options); - } - - static equals(a: TrackPublicationInfo | PlainMessage | undefined, b: TrackPublicationInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackPublicationInfo, a, b); - } -} +/** + * Describes the message livekit.proto.TrackPublicationInfo. + * Use `create(TrackPublicationInfoSchema)` to create a new message. + */ +export const TrackPublicationInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 8); /** * @generated from message livekit.proto.OwnedTrackPublication */ -export class OwnedTrackPublication extends Message { +export type OwnedTrackPublication = Message<"livekit.proto.OwnedTrackPublication"> & { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.TrackPublicationInfo info = 2; + * @generated from field: required livekit.proto.TrackPublicationInfo info = 2; */ info?: TrackPublicationInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedTrackPublication"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: TrackPublicationInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedTrackPublication { - return new OwnedTrackPublication().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedTrackPublication { - return new OwnedTrackPublication().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedTrackPublication { - return new OwnedTrackPublication().fromJsonString(jsonString, options); - } - - static equals(a: OwnedTrackPublication | PlainMessage | undefined, b: OwnedTrackPublication | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedTrackPublication, a, b); - } -} +/** + * Describes the message livekit.proto.OwnedTrackPublication. + * Use `create(OwnedTrackPublicationSchema)` to create a new message. + */ +export const OwnedTrackPublicationSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 9); /** * @generated from message livekit.proto.TrackInfo */ -export class TrackInfo extends Message { +export type TrackInfo = Message<"livekit.proto.TrackInfo"> & { /** - * @generated from field: string sid = 1; + * @generated from field: required string sid = 1; */ - sid = ""; + sid: string; /** - * @generated from field: string name = 2; + * @generated from field: required string name = 2; */ - name = ""; + name: string; /** - * @generated from field: livekit.proto.TrackKind kind = 3; + * @generated from field: required livekit.proto.TrackKind kind = 3; */ - kind = TrackKind.KIND_UNKNOWN; + kind: TrackKind; /** - * @generated from field: livekit.proto.StreamState stream_state = 4; + * @generated from field: required livekit.proto.StreamState stream_state = 4; */ - streamState = StreamState.STATE_UNKNOWN; + streamState: StreamState; /** - * @generated from field: bool muted = 5; + * @generated from field: required bool muted = 5; */ - muted = false; + muted: boolean; /** - * @generated from field: bool remote = 6; + * @generated from field: required bool remote = 6; */ - remote = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.TrackInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "sid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "kind", kind: "enum", T: proto3.getEnumType(TrackKind) }, - { no: 4, name: "stream_state", kind: "enum", T: proto3.getEnumType(StreamState) }, - { no: 5, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TrackInfo { - return new TrackInfo().fromBinary(bytes, options); - } + remote: boolean; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): TrackInfo { - return new TrackInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TrackInfo { - return new TrackInfo().fromJsonString(jsonString, options); - } - - static equals(a: TrackInfo | PlainMessage | undefined, b: TrackInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(TrackInfo, a, b); - } -} +/** + * Describes the message livekit.proto.TrackInfo. + * Use `create(TrackInfoSchema)` to create a new message. + */ +export const TrackInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 10); /** * @generated from message livekit.proto.OwnedTrack */ -export class OwnedTrack extends Message { +export type OwnedTrack = Message<"livekit.proto.OwnedTrack"> & { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.TrackInfo info = 2; + * @generated from field: required livekit.proto.TrackInfo info = 2; */ info?: TrackInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedTrack"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: TrackInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedTrack { - return new OwnedTrack().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedTrack { - return new OwnedTrack().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedTrack { - return new OwnedTrack().fromJsonString(jsonString, options); - } - - static equals(a: OwnedTrack | PlainMessage | undefined, b: OwnedTrack | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedTrack, a, b); - } -} +/** + * Describes the message livekit.proto.OwnedTrack. + * Use `create(OwnedTrackSchema)` to create a new message. + */ +export const OwnedTrackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 11); /** * Mute/UnMute a track * * @generated from message livekit.proto.LocalTrackMuteRequest */ -export class LocalTrackMuteRequest extends Message { +export type LocalTrackMuteRequest = Message<"livekit.proto.LocalTrackMuteRequest"> & { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle: bigint; /** - * @generated from field: bool mute = 2; + * @generated from field: required bool mute = 2; */ - mute = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.LocalTrackMuteRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "mute", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackMuteRequest { - return new LocalTrackMuteRequest().fromBinary(bytes, options); - } + mute: boolean; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): LocalTrackMuteRequest { - return new LocalTrackMuteRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LocalTrackMuteRequest { - return new LocalTrackMuteRequest().fromJsonString(jsonString, options); - } - - static equals(a: LocalTrackMuteRequest | PlainMessage | undefined, b: LocalTrackMuteRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackMuteRequest, a, b); - } -} +/** + * Describes the message livekit.proto.LocalTrackMuteRequest. + * Use `create(LocalTrackMuteRequestSchema)` to create a new message. + */ +export const LocalTrackMuteRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 12); /** * @generated from message livekit.proto.LocalTrackMuteResponse */ -export class LocalTrackMuteResponse extends Message { +export type LocalTrackMuteResponse = Message<"livekit.proto.LocalTrackMuteResponse"> & { /** - * @generated from field: bool muted = 1; + * @generated from field: required bool muted = 1; */ - muted = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.LocalTrackMuteResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LocalTrackMuteResponse { - return new LocalTrackMuteResponse().fromBinary(bytes, options); - } + muted: boolean; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): LocalTrackMuteResponse { - return new LocalTrackMuteResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LocalTrackMuteResponse { - return new LocalTrackMuteResponse().fromJsonString(jsonString, options); - } - - static equals(a: LocalTrackMuteResponse | PlainMessage | undefined, b: LocalTrackMuteResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(LocalTrackMuteResponse, a, b); - } -} +/** + * Describes the message livekit.proto.LocalTrackMuteResponse. + * Use `create(LocalTrackMuteResponseSchema)` to create a new message. + */ +export const LocalTrackMuteResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 13); /** * Enable/Disable a remote track * * @generated from message livekit.proto.EnableRemoteTrackRequest */ -export class EnableRemoteTrackRequest extends Message { +export type EnableRemoteTrackRequest = Message<"livekit.proto.EnableRemoteTrackRequest"> & { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle: bigint; /** - * @generated from field: bool enabled = 2; + * @generated from field: required bool enabled = 2; */ - enabled = false; + enabled: boolean; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +/** + * Describes the message livekit.proto.EnableRemoteTrackRequest. + * Use `create(EnableRemoteTrackRequestSchema)` to create a new message. + */ +export const EnableRemoteTrackRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 14); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.EnableRemoteTrackRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); +/** + * @generated from message livekit.proto.EnableRemoteTrackResponse + */ +export type EnableRemoteTrackResponse = Message<"livekit.proto.EnableRemoteTrackResponse"> & { + /** + * @generated from field: required bool enabled = 1; + */ + enabled: boolean; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): EnableRemoteTrackRequest { - return new EnableRemoteTrackRequest().fromBinary(bytes, options); - } +/** + * Describes the message livekit.proto.EnableRemoteTrackResponse. + * Use `create(EnableRemoteTrackResponseSchema)` to create a new message. + */ +export const EnableRemoteTrackResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_track, 15); - static fromJson(jsonValue: JsonValue, options?: Partial): EnableRemoteTrackRequest { - return new EnableRemoteTrackRequest().fromJson(jsonValue, options); - } +/** + * @generated from enum livekit.proto.TrackKind + */ +export enum TrackKind { + /** + * @generated from enum value: KIND_UNKNOWN = 0; + */ + KIND_UNKNOWN = 0, - static fromJsonString(jsonString: string, options?: Partial): EnableRemoteTrackRequest { - return new EnableRemoteTrackRequest().fromJsonString(jsonString, options); - } + /** + * @generated from enum value: KIND_AUDIO = 1; + */ + KIND_AUDIO = 1, - static equals(a: EnableRemoteTrackRequest | PlainMessage | undefined, b: EnableRemoteTrackRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(EnableRemoteTrackRequest, a, b); - } + /** + * @generated from enum value: KIND_VIDEO = 2; + */ + KIND_VIDEO = 2, } /** - * @generated from message livekit.proto.EnableRemoteTrackResponse + * Describes the enum livekit.proto.TrackKind. + */ +export const TrackKindSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_track, 0); + +/** + * @generated from enum livekit.proto.TrackSource */ -export class EnableRemoteTrackResponse extends Message { +export enum TrackSource { /** - * @generated from field: bool enabled = 1; + * @generated from enum value: SOURCE_UNKNOWN = 0; */ - enabled = false; + SOURCE_UNKNOWN = 0, + + /** + * @generated from enum value: SOURCE_CAMERA = 1; + */ + SOURCE_CAMERA = 1, + + /** + * @generated from enum value: SOURCE_MICROPHONE = 2; + */ + SOURCE_MICROPHONE = 2, - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + /** + * @generated from enum value: SOURCE_SCREENSHARE = 3; + */ + SOURCE_SCREENSHARE = 3, - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.EnableRemoteTrackResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); + /** + * @generated from enum value: SOURCE_SCREENSHARE_AUDIO = 4; + */ + SOURCE_SCREENSHARE_AUDIO = 4, +} - static fromBinary(bytes: Uint8Array, options?: Partial): EnableRemoteTrackResponse { - return new EnableRemoteTrackResponse().fromBinary(bytes, options); - } +/** + * Describes the enum livekit.proto.TrackSource. + */ +export const TrackSourceSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_track, 1); - static fromJson(jsonValue: JsonValue, options?: Partial): EnableRemoteTrackResponse { - return new EnableRemoteTrackResponse().fromJson(jsonValue, options); - } +/** + * @generated from enum livekit.proto.StreamState + */ +export enum StreamState { + /** + * @generated from enum value: STATE_UNKNOWN = 0; + */ + STATE_UNKNOWN = 0, - static fromJsonString(jsonString: string, options?: Partial): EnableRemoteTrackResponse { - return new EnableRemoteTrackResponse().fromJsonString(jsonString, options); - } + /** + * @generated from enum value: STATE_ACTIVE = 1; + */ + STATE_ACTIVE = 1, - static equals(a: EnableRemoteTrackResponse | PlainMessage | undefined, b: EnableRemoteTrackResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(EnableRemoteTrackResponse, a, b); - } + /** + * @generated from enum value: STATE_PAUSED = 2; + */ + STATE_PAUSED = 2, } +/** + * Describes the enum livekit.proto.StreamState. + */ +export const StreamStateSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_track, 2); + diff --git a/packages/livekit-rtc/src/proto/video_frame_pb.ts b/packages/livekit-rtc/src/proto/video_frame_pb.ts index 4727a87b..a6d9dd39 100644 --- a/packages/livekit-rtc/src/proto/video_frame_pb.ts +++ b/packages/livekit-rtc/src/proto/video_frame_pb.ts @@ -12,193 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file video_frame.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file video_frame.proto (package livekit.proto, syntax proto2) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; -import { TrackSource } from "./track_pb.js"; -import { FfiOwnedHandle } from "./handle_pb.js"; +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { FfiOwnedHandle } from "./handle_pb"; +import { file_handle } from "./handle_pb"; +import type { TrackSource } from "./track_pb"; +import { file_track } from "./track_pb"; +import type { Message } from "@bufbuild/protobuf"; /** - * @generated from enum livekit.proto.VideoCodec - */ -export enum VideoCodec { - /** - * @generated from enum value: VP8 = 0; - */ - VP8 = 0, - - /** - * @generated from enum value: H264 = 1; - */ - H264 = 1, - - /** - * @generated from enum value: AV1 = 2; - */ - AV1 = 2, - - /** - * @generated from enum value: VP9 = 3; - */ - VP9 = 3, -} -// Retrieve enum metadata with: proto3.getEnumType(VideoCodec) -proto3.util.setEnumType(VideoCodec, "livekit.proto.VideoCodec", [ - { no: 0, name: "VP8" }, - { no: 1, name: "H264" }, - { no: 2, name: "AV1" }, - { no: 3, name: "VP9" }, -]); - -/** - * @generated from enum livekit.proto.VideoRotation + * Describes the file video_frame.proto. */ -export enum VideoRotation { - /** - * @generated from enum value: VIDEO_ROTATION_0 = 0; - */ - VIDEO_ROTATION_0 = 0, - - /** - * @generated from enum value: VIDEO_ROTATION_90 = 1; - */ - VIDEO_ROTATION_90 = 1, - - /** - * @generated from enum value: VIDEO_ROTATION_180 = 2; - */ - VIDEO_ROTATION_180 = 2, - - /** - * @generated from enum value: VIDEO_ROTATION_270 = 3; - */ - VIDEO_ROTATION_270 = 3, -} -// Retrieve enum metadata with: proto3.getEnumType(VideoRotation) -proto3.util.setEnumType(VideoRotation, "livekit.proto.VideoRotation", [ - { no: 0, name: "VIDEO_ROTATION_0" }, - { no: 1, name: "VIDEO_ROTATION_90" }, - { no: 2, name: "VIDEO_ROTATION_180" }, - { no: 3, name: "VIDEO_ROTATION_270" }, -]); - -/** - * @generated from enum livekit.proto.VideoBufferType - */ -export enum VideoBufferType { - /** - * @generated from enum value: RGBA = 0; - */ - RGBA = 0, - - /** - * @generated from enum value: ABGR = 1; - */ - ABGR = 1, - - /** - * @generated from enum value: ARGB = 2; - */ - ARGB = 2, - - /** - * @generated from enum value: BGRA = 3; - */ - BGRA = 3, - - /** - * @generated from enum value: RGB24 = 4; - */ - RGB24 = 4, - - /** - * @generated from enum value: I420 = 5; - */ - I420 = 5, - - /** - * @generated from enum value: I420A = 6; - */ - I420A = 6, - - /** - * @generated from enum value: I422 = 7; - */ - I422 = 7, - - /** - * @generated from enum value: I444 = 8; - */ - I444 = 8, - - /** - * @generated from enum value: I010 = 9; - */ - I010 = 9, - - /** - * @generated from enum value: NV12 = 10; - */ - NV12 = 10, -} -// Retrieve enum metadata with: proto3.getEnumType(VideoBufferType) -proto3.util.setEnumType(VideoBufferType, "livekit.proto.VideoBufferType", [ - { no: 0, name: "RGBA" }, - { no: 1, name: "ABGR" }, - { no: 2, name: "ARGB" }, - { no: 3, name: "BGRA" }, - { no: 4, name: "RGB24" }, - { no: 5, name: "I420" }, - { no: 6, name: "I420A" }, - { no: 7, name: "I422" }, - { no: 8, name: "I444" }, - { no: 9, name: "I010" }, - { no: 10, name: "NV12" }, -]); - -/** - * @generated from enum livekit.proto.VideoStreamType - */ -export enum VideoStreamType { - /** - * @generated from enum value: VIDEO_STREAM_NATIVE = 0; - */ - VIDEO_STREAM_NATIVE = 0, - - /** - * @generated from enum value: VIDEO_STREAM_WEBGL = 1; - */ - VIDEO_STREAM_WEBGL = 1, - - /** - * @generated from enum value: VIDEO_STREAM_HTML = 2; - */ - VIDEO_STREAM_HTML = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(VideoStreamType) -proto3.util.setEnumType(VideoStreamType, "livekit.proto.VideoStreamType", [ - { no: 0, name: "VIDEO_STREAM_NATIVE" }, - { no: 1, name: "VIDEO_STREAM_WEBGL" }, - { no: 2, name: "VIDEO_STREAM_HTML" }, -]); - -/** - * @generated from enum livekit.proto.VideoSourceType - */ -export enum VideoSourceType { - /** - * @generated from enum value: VIDEO_SOURCE_NATIVE = 0; - */ - VIDEO_SOURCE_NATIVE = 0, -} -// Retrieve enum metadata with: proto3.getEnumType(VideoSourceType) -proto3.util.setEnumType(VideoSourceType, "livekit.proto.VideoSourceType", [ - { no: 0, name: "VIDEO_SOURCE_NATIVE" }, -]); +export const file_video_frame: GenFile = /*@__PURE__*/ + fileDesc("ChF2aWRlb19mcmFtZS5wcm90bxINbGl2ZWtpdC5wcm90byKlAQoVTmV3VmlkZW9TdHJlYW1SZXF1ZXN0EhQKDHRyYWNrX2hhbmRsZRgBIAIoBBIsCgR0eXBlGAIgAigOMh4ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbVR5cGUSLgoGZm9ybWF0GAMgASgOMh4ubGl2ZWtpdC5wcm90by5WaWRlb0J1ZmZlclR5cGUSGAoQbm9ybWFsaXplX3N0cmlkZRgEIAIoCCJJChZOZXdWaWRlb1N0cmVhbVJlc3BvbnNlEi8KBnN0cmVhbRgBIAIoCzIfLmxpdmVraXQucHJvdG8uT3duZWRWaWRlb1N0cmVhbSLpAQohVmlkZW9TdHJlYW1Gcm9tUGFydGljaXBhbnRSZXF1ZXN0EhoKEnBhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIsCgR0eXBlGAIgAigOMh4ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbVR5cGUSMAoMdHJhY2tfc291cmNlGAMgAigOMhoubGl2ZWtpdC5wcm90by5UcmFja1NvdXJjZRIuCgZmb3JtYXQYBCABKA4yHi5saXZla2l0LnByb3RvLlZpZGVvQnVmZmVyVHlwZRIYChBub3JtYWxpemVfc3RyaWRlGAUgAigIIlUKIlZpZGVvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVzcG9uc2USLwoGc3RyZWFtGAEgAigLMh8ubGl2ZWtpdC5wcm90by5Pd25lZFZpZGVvU3RyZWFtIn8KFU5ld1ZpZGVvU291cmNlUmVxdWVzdBIsCgR0eXBlGAEgAigOMh4ubGl2ZWtpdC5wcm90by5WaWRlb1NvdXJjZVR5cGUSOAoKcmVzb2x1dGlvbhgCIAIoCzIkLmxpdmVraXQucHJvdG8uVmlkZW9Tb3VyY2VSZXNvbHV0aW9uIkkKFk5ld1ZpZGVvU291cmNlUmVzcG9uc2USLwoGc291cmNlGAEgAigLMh8ubGl2ZWtpdC5wcm90by5Pd25lZFZpZGVvU291cmNlIqcBChhDYXB0dXJlVmlkZW9GcmFtZVJlcXVlc3QSFQoNc291cmNlX2hhbmRsZRgBIAIoBBIuCgZidWZmZXIYAiACKAsyHi5saXZla2l0LnByb3RvLlZpZGVvQnVmZmVySW5mbxIUCgx0aW1lc3RhbXBfdXMYAyACKAMSLgoIcm90YXRpb24YBCACKA4yHC5saXZla2l0LnByb3RvLlZpZGVvUm90YXRpb24iGwoZQ2FwdHVyZVZpZGVvRnJhbWVSZXNwb25zZSKHAQoTVmlkZW9Db252ZXJ0UmVxdWVzdBIOCgZmbGlwX3kYASACKAgSLgoGYnVmZmVyGAIgAigLMh4ubGl2ZWtpdC5wcm90by5WaWRlb0J1ZmZlckluZm8SMAoIZHN0X3R5cGUYAyACKA4yHi5saXZla2l0LnByb3RvLlZpZGVvQnVmZmVyVHlwZSJlChRWaWRlb0NvbnZlcnRSZXNwb25zZRIPCgVlcnJvchgBIAEoCUgAEjEKBmJ1ZmZlchgCIAEoCzIfLmxpdmVraXQucHJvdG8uT3duZWRWaWRlb0J1ZmZlckgAQgkKB21lc3NhZ2UiRAoPVmlkZW9SZXNvbHV0aW9uEg0KBXdpZHRoGAEgAigNEg4KBmhlaWdodBgCIAIoDRISCgpmcmFtZV9yYXRlGAMgAigBIoMCCg9WaWRlb0J1ZmZlckluZm8SLAoEdHlwZRgBIAIoDjIeLmxpdmVraXQucHJvdG8uVmlkZW9CdWZmZXJUeXBlEg0KBXdpZHRoGAIgAigNEg4KBmhlaWdodBgDIAIoDRIQCghkYXRhX3B0chgEIAIoBBIOCgZzdHJpZGUYBiACKA0SQAoKY29tcG9uZW50cxgHIAMoCzIsLmxpdmVraXQucHJvdG8uVmlkZW9CdWZmZXJJbmZvLkNvbXBvbmVudEluZm8aPwoNQ29tcG9uZW50SW5mbxIQCghkYXRhX3B0chgBIAIoBBIOCgZzdHJpZGUYAiACKA0SDAoEc2l6ZRgDIAIoDSJvChBPd25lZFZpZGVvQnVmZmVyEi0KBmhhbmRsZRgBIAIoCzIdLmxpdmVraXQucHJvdG8uRmZpT3duZWRIYW5kbGUSLAoEaW5mbxgCIAIoCzIeLmxpdmVraXQucHJvdG8uVmlkZW9CdWZmZXJJbmZvIj8KD1ZpZGVvU3RyZWFtSW5mbxIsCgR0eXBlGAEgAigOMh4ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbVR5cGUibwoQT3duZWRWaWRlb1N0cmVhbRItCgZoYW5kbGUYASACKAsyHS5saXZla2l0LnByb3RvLkZmaU93bmVkSGFuZGxlEiwKBGluZm8YAiACKAsyHi5saXZla2l0LnByb3RvLlZpZGVvU3RyZWFtSW5mbyKfAQoQVmlkZW9TdHJlYW1FdmVudBIVCg1zdHJlYW1faGFuZGxlGAEgAigEEjsKDmZyYW1lX3JlY2VpdmVkGAIgASgLMiEubGl2ZWtpdC5wcm90by5WaWRlb0ZyYW1lUmVjZWl2ZWRIABIsCgNlb3MYAyABKAsyHS5saXZla2l0LnByb3RvLlZpZGVvU3RyZWFtRU9TSABCCQoHbWVzc2FnZSKLAQoSVmlkZW9GcmFtZVJlY2VpdmVkEi8KBmJ1ZmZlchgBIAIoCzIfLmxpdmVraXQucHJvdG8uT3duZWRWaWRlb0J1ZmZlchIUCgx0aW1lc3RhbXBfdXMYAiACKAMSLgoIcm90YXRpb24YAyACKA4yHC5saXZla2l0LnByb3RvLlZpZGVvUm90YXRpb24iEAoOVmlkZW9TdHJlYW1FT1MiNgoVVmlkZW9Tb3VyY2VSZXNvbHV0aW9uEg0KBXdpZHRoGAEgAigNEg4KBmhlaWdodBgCIAIoDSI/Cg9WaWRlb1NvdXJjZUluZm8SLAoEdHlwZRgBIAIoDjIeLmxpdmVraXQucHJvdG8uVmlkZW9Tb3VyY2VUeXBlIm8KEE93bmVkVmlkZW9Tb3VyY2USLQoGaGFuZGxlGAEgAigLMh0ubGl2ZWtpdC5wcm90by5GZmlPd25lZEhhbmRsZRIsCgRpbmZvGAIgAigLMh4ubGl2ZWtpdC5wcm90by5WaWRlb1NvdXJjZUluZm8qMQoKVmlkZW9Db2RlYxIHCgNWUDgQABIICgRIMjY0EAESBwoDQVYxEAISBwoDVlA5EAMqbAoNVmlkZW9Sb3RhdGlvbhIUChBWSURFT19ST1RBVElPTl8wEAASFQoRVklERU9fUk9UQVRJT05fOTAQARIWChJWSURFT19ST1RBVElPTl8xODAQAhIWChJWSURFT19ST1RBVElPTl8yNzAQAyqBAQoPVmlkZW9CdWZmZXJUeXBlEggKBFJHQkEQABIICgRBQkdSEAESCAoEQVJHQhACEggKBEJHUkEQAxIJCgVSR0IyNBAEEggKBEk0MjAQBRIJCgVJNDIwQRAGEggKBEk0MjIQBxIICgRJNDQ0EAgSCAoESTAxMBAJEggKBE5WMTIQCipZCg9WaWRlb1N0cmVhbVR5cGUSFwoTVklERU9fU1RSRUFNX05BVElWRRAAEhYKElZJREVPX1NUUkVBTV9XRUJHTBABEhUKEVZJREVPX1NUUkVBTV9IVE1MEAIqKgoPVmlkZW9Tb3VyY2VUeXBlEhcKE1ZJREVPX1NPVVJDRV9OQVRJVkUQAEIQqgINTGl2ZUtpdC5Qcm90bw", [file_handle, file_track]); /** * Create a new VideoStream @@ -206,198 +36,111 @@ proto3.util.setEnumType(VideoSourceType, "livekit.proto.VideoSourceType", [ * * @generated from message livekit.proto.NewVideoStreamRequest */ -export class NewVideoStreamRequest extends Message { +export type NewVideoStreamRequest = Message<"livekit.proto.NewVideoStreamRequest"> & { /** - * @generated from field: uint64 track_handle = 1; + * @generated from field: required uint64 track_handle = 1; */ - trackHandle = protoInt64.zero; + trackHandle: bigint; /** - * @generated from field: livekit.proto.VideoStreamType type = 2; + * @generated from field: required livekit.proto.VideoStreamType type = 2; */ - type = VideoStreamType.VIDEO_STREAM_NATIVE; + type: VideoStreamType; /** * Get the frame on a specific format * * @generated from field: optional livekit.proto.VideoBufferType format = 3; */ - format?: VideoBufferType; + format: VideoBufferType; /** * if true, stride will be set to width/chroma_width * - * @generated from field: bool normalize_stride = 4; - */ - normalizeStride = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewVideoStreamRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "track_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(VideoStreamType) }, - { no: 3, name: "format", kind: "enum", T: proto3.getEnumType(VideoBufferType), opt: true }, - { no: 4, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoStreamRequest { - return new NewVideoStreamRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewVideoStreamRequest { - return new NewVideoStreamRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewVideoStreamRequest { - return new NewVideoStreamRequest().fromJsonString(jsonString, options); - } - - static equals(a: NewVideoStreamRequest | PlainMessage | undefined, b: NewVideoStreamRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewVideoStreamRequest, a, b); - } -} + * @generated from field: required bool normalize_stride = 4; + */ + normalizeStride: boolean; +}; + +/** + * Describes the message livekit.proto.NewVideoStreamRequest. + * Use `create(NewVideoStreamRequestSchema)` to create a new message. + */ +export const NewVideoStreamRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 0); /** * @generated from message livekit.proto.NewVideoStreamResponse */ -export class NewVideoStreamResponse extends Message { +export type NewVideoStreamResponse = Message<"livekit.proto.NewVideoStreamResponse"> & { /** - * @generated from field: livekit.proto.OwnedVideoStream stream = 1; + * @generated from field: required livekit.proto.OwnedVideoStream stream = 1; */ stream?: OwnedVideoStream; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewVideoStreamResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedVideoStream }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoStreamResponse { - return new NewVideoStreamResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewVideoStreamResponse { - return new NewVideoStreamResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewVideoStreamResponse { - return new NewVideoStreamResponse().fromJsonString(jsonString, options); - } - - static equals(a: NewVideoStreamResponse | PlainMessage | undefined, b: NewVideoStreamResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewVideoStreamResponse, a, b); - } -} +/** + * Describes the message livekit.proto.NewVideoStreamResponse. + * Use `create(NewVideoStreamResponseSchema)` to create a new message. + */ +export const NewVideoStreamResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 1); /** * Request a video stream from a participant * * @generated from message livekit.proto.VideoStreamFromParticipantRequest */ -export class VideoStreamFromParticipantRequest extends Message { +export type VideoStreamFromParticipantRequest = Message<"livekit.proto.VideoStreamFromParticipantRequest"> & { /** - * @generated from field: uint64 participant_handle = 1; + * @generated from field: required uint64 participant_handle = 1; */ - participantHandle = protoInt64.zero; + participantHandle: bigint; /** - * @generated from field: livekit.proto.VideoStreamType type = 2; + * @generated from field: required livekit.proto.VideoStreamType type = 2; */ - type = VideoStreamType.VIDEO_STREAM_NATIVE; + type: VideoStreamType; /** - * @generated from field: livekit.proto.TrackSource track_source = 3; + * @generated from field: required livekit.proto.TrackSource track_source = 3; */ - trackSource = TrackSource.SOURCE_UNKNOWN; + trackSource: TrackSource; /** * @generated from field: optional livekit.proto.VideoBufferType format = 4; */ - format?: VideoBufferType; + format: VideoBufferType; /** - * @generated from field: bool normalize_stride = 5; + * @generated from field: required bool normalize_stride = 5; */ - normalizeStride = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoStreamFromParticipantRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(VideoStreamType) }, - { no: 3, name: "track_source", kind: "enum", T: proto3.getEnumType(TrackSource) }, - { no: 4, name: "format", kind: "enum", T: proto3.getEnumType(VideoBufferType), opt: true }, - { no: 5, name: "normalize_stride", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamFromParticipantRequest { - return new VideoStreamFromParticipantRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoStreamFromParticipantRequest { - return new VideoStreamFromParticipantRequest().fromJson(jsonValue, options); - } + normalizeStride: boolean; +}; - static fromJsonString(jsonString: string, options?: Partial): VideoStreamFromParticipantRequest { - return new VideoStreamFromParticipantRequest().fromJsonString(jsonString, options); - } - - static equals(a: VideoStreamFromParticipantRequest | PlainMessage | undefined, b: VideoStreamFromParticipantRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamFromParticipantRequest, a, b); - } -} +/** + * Describes the message livekit.proto.VideoStreamFromParticipantRequest. + * Use `create(VideoStreamFromParticipantRequestSchema)` to create a new message. + */ +export const VideoStreamFromParticipantRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 2); /** * @generated from message livekit.proto.VideoStreamFromParticipantResponse */ -export class VideoStreamFromParticipantResponse extends Message { +export type VideoStreamFromParticipantResponse = Message<"livekit.proto.VideoStreamFromParticipantResponse"> & { /** - * @generated from field: livekit.proto.OwnedVideoStream stream = 1; + * @generated from field: required livekit.proto.OwnedVideoStream stream = 1; */ stream?: OwnedVideoStream; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoStreamFromParticipantResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream", kind: "message", T: OwnedVideoStream }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamFromParticipantResponse { - return new VideoStreamFromParticipantResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoStreamFromParticipantResponse { - return new VideoStreamFromParticipantResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VideoStreamFromParticipantResponse { - return new VideoStreamFromParticipantResponse().fromJsonString(jsonString, options); - } - - static equals(a: VideoStreamFromParticipantResponse | PlainMessage | undefined, b: VideoStreamFromParticipantResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamFromParticipantResponse, a, b); - } -} +/** + * Describes the message livekit.proto.VideoStreamFromParticipantResponse. + * Use `create(VideoStreamFromParticipantResponseSchema)` to create a new message. + */ +export const VideoStreamFromParticipantResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 3); /** * Create a new VideoSource @@ -405,566 +148,317 @@ export class VideoStreamFromParticipantResponse extends Message { +export type NewVideoSourceRequest = Message<"livekit.proto.NewVideoSourceRequest"> & { /** - * @generated from field: livekit.proto.VideoSourceType type = 1; + * @generated from field: required livekit.proto.VideoSourceType type = 1; */ - type = VideoSourceType.VIDEO_SOURCE_NATIVE; + type: VideoSourceType; /** * Used to determine which encodings to use + simulcast layers * Most of the time it corresponds to the source resolution * - * @generated from field: livekit.proto.VideoSourceResolution resolution = 2; + * @generated from field: required livekit.proto.VideoSourceResolution resolution = 2; */ resolution?: VideoSourceResolution; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewVideoSourceRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoSourceType) }, - { no: 2, name: "resolution", kind: "message", T: VideoSourceResolution }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoSourceRequest { - return new NewVideoSourceRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewVideoSourceRequest { - return new NewVideoSourceRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewVideoSourceRequest { - return new NewVideoSourceRequest().fromJsonString(jsonString, options); - } - - static equals(a: NewVideoSourceRequest | PlainMessage | undefined, b: NewVideoSourceRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(NewVideoSourceRequest, a, b); - } -} +/** + * Describes the message livekit.proto.NewVideoSourceRequest. + * Use `create(NewVideoSourceRequestSchema)` to create a new message. + */ +export const NewVideoSourceRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 4); /** * @generated from message livekit.proto.NewVideoSourceResponse */ -export class NewVideoSourceResponse extends Message { +export type NewVideoSourceResponse = Message<"livekit.proto.NewVideoSourceResponse"> & { /** - * @generated from field: livekit.proto.OwnedVideoSource source = 1; + * @generated from field: required livekit.proto.OwnedVideoSource source = 1; */ source?: OwnedVideoSource; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.NewVideoSourceResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source", kind: "message", T: OwnedVideoSource }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): NewVideoSourceResponse { - return new NewVideoSourceResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): NewVideoSourceResponse { - return new NewVideoSourceResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): NewVideoSourceResponse { - return new NewVideoSourceResponse().fromJsonString(jsonString, options); - } - - static equals(a: NewVideoSourceResponse | PlainMessage | undefined, b: NewVideoSourceResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(NewVideoSourceResponse, a, b); - } -} +/** + * Describes the message livekit.proto.NewVideoSourceResponse. + * Use `create(NewVideoSourceResponseSchema)` to create a new message. + */ +export const NewVideoSourceResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 5); /** * Push a frame to a VideoSource * * @generated from message livekit.proto.CaptureVideoFrameRequest */ -export class CaptureVideoFrameRequest extends Message { +export type CaptureVideoFrameRequest = Message<"livekit.proto.CaptureVideoFrameRequest"> & { /** - * @generated from field: uint64 source_handle = 1; + * @generated from field: required uint64 source_handle = 1; */ - sourceHandle = protoInt64.zero; + sourceHandle: bigint; /** - * @generated from field: livekit.proto.VideoBufferInfo buffer = 2; + * @generated from field: required livekit.proto.VideoBufferInfo buffer = 2; */ buffer?: VideoBufferInfo; /** * In microseconds * - * @generated from field: int64 timestamp_us = 3; + * @generated from field: required int64 timestamp_us = 3; */ - timestampUs = protoInt64.zero; + timestampUs: bigint; /** - * @generated from field: livekit.proto.VideoRotation rotation = 4; + * @generated from field: required livekit.proto.VideoRotation rotation = 4; */ - rotation = VideoRotation.VIDEO_ROTATION_0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CaptureVideoFrameRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "source_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo }, - { no: 3, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 4, name: "rotation", kind: "enum", T: proto3.getEnumType(VideoRotation) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CaptureVideoFrameRequest { - return new CaptureVideoFrameRequest().fromBinary(bytes, options); - } + rotation: VideoRotation; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): CaptureVideoFrameRequest { - return new CaptureVideoFrameRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CaptureVideoFrameRequest { - return new CaptureVideoFrameRequest().fromJsonString(jsonString, options); - } - - static equals(a: CaptureVideoFrameRequest | PlainMessage | undefined, b: CaptureVideoFrameRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureVideoFrameRequest, a, b); - } -} +/** + * Describes the message livekit.proto.CaptureVideoFrameRequest. + * Use `create(CaptureVideoFrameRequestSchema)` to create a new message. + */ +export const CaptureVideoFrameRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 6); /** * @generated from message livekit.proto.CaptureVideoFrameResponse */ -export class CaptureVideoFrameResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.CaptureVideoFrameResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CaptureVideoFrameResponse { - return new CaptureVideoFrameResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CaptureVideoFrameResponse { - return new CaptureVideoFrameResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CaptureVideoFrameResponse { - return new CaptureVideoFrameResponse().fromJsonString(jsonString, options); - } - - static equals(a: CaptureVideoFrameResponse | PlainMessage | undefined, b: CaptureVideoFrameResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CaptureVideoFrameResponse, a, b); - } -} +export type CaptureVideoFrameResponse = Message<"livekit.proto.CaptureVideoFrameResponse"> & { +}; + +/** + * Describes the message livekit.proto.CaptureVideoFrameResponse. + * Use `create(CaptureVideoFrameResponseSchema)` to create a new message. + */ +export const CaptureVideoFrameResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 7); /** * @generated from message livekit.proto.VideoConvertRequest */ -export class VideoConvertRequest extends Message { +export type VideoConvertRequest = Message<"livekit.proto.VideoConvertRequest"> & { /** - * @generated from field: bool flip_y = 1; + * @generated from field: required bool flip_y = 1; */ - flipY = false; + flipY: boolean; /** - * @generated from field: livekit.proto.VideoBufferInfo buffer = 2; + * @generated from field: required livekit.proto.VideoBufferInfo buffer = 2; */ buffer?: VideoBufferInfo; /** - * @generated from field: livekit.proto.VideoBufferType dst_type = 3; + * @generated from field: required livekit.proto.VideoBufferType dst_type = 3; */ - dstType = VideoBufferType.RGBA; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoConvertRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "flip_y", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "buffer", kind: "message", T: VideoBufferInfo }, - { no: 3, name: "dst_type", kind: "enum", T: proto3.getEnumType(VideoBufferType) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoConvertRequest { - return new VideoConvertRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoConvertRequest { - return new VideoConvertRequest().fromJson(jsonValue, options); - } + dstType: VideoBufferType; +}; - static fromJsonString(jsonString: string, options?: Partial): VideoConvertRequest { - return new VideoConvertRequest().fromJsonString(jsonString, options); - } - - static equals(a: VideoConvertRequest | PlainMessage | undefined, b: VideoConvertRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoConvertRequest, a, b); - } -} +/** + * Describes the message livekit.proto.VideoConvertRequest. + * Use `create(VideoConvertRequestSchema)` to create a new message. + */ +export const VideoConvertRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 8); /** * @generated from message livekit.proto.VideoConvertResponse */ -export class VideoConvertResponse extends Message { - /** - * @generated from field: optional string error = 1; - */ - error?: string; - +export type VideoConvertResponse = Message<"livekit.proto.VideoConvertResponse"> & { /** - * @generated from field: livekit.proto.OwnedVideoBuffer buffer = 2; + * @generated from oneof livekit.proto.VideoConvertResponse.message */ - buffer?: OwnedVideoBuffer; + message: { + /** + * @generated from field: string error = 1; + */ + value: string; + case: "error"; + } | { + /** + * @generated from field: livekit.proto.OwnedVideoBuffer buffer = 2; + */ + value: OwnedVideoBuffer; + case: "buffer"; + } | { case: undefined; value?: undefined }; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoConvertResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 2, name: "buffer", kind: "message", T: OwnedVideoBuffer }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoConvertResponse { - return new VideoConvertResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoConvertResponse { - return new VideoConvertResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VideoConvertResponse { - return new VideoConvertResponse().fromJsonString(jsonString, options); - } - - static equals(a: VideoConvertResponse | PlainMessage | undefined, b: VideoConvertResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoConvertResponse, a, b); - } -} +/** + * Describes the message livekit.proto.VideoConvertResponse. + * Use `create(VideoConvertResponseSchema)` to create a new message. + */ +export const VideoConvertResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 9); /** * @generated from message livekit.proto.VideoResolution */ -export class VideoResolution extends Message { +export type VideoResolution = Message<"livekit.proto.VideoResolution"> & { /** - * @generated from field: uint32 width = 1; + * @generated from field: required uint32 width = 1; */ - width = 0; + width: number; /** - * @generated from field: uint32 height = 2; + * @generated from field: required uint32 height = 2; */ - height = 0; + height: number; /** - * @generated from field: double frame_rate = 3; + * @generated from field: required double frame_rate = 3; */ - frameRate = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoResolution"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "frame_rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - ]); + frameRate: number; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): VideoResolution { - return new VideoResolution().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoResolution { - return new VideoResolution().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VideoResolution { - return new VideoResolution().fromJsonString(jsonString, options); - } - - static equals(a: VideoResolution | PlainMessage | undefined, b: VideoResolution | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoResolution, a, b); - } -} +/** + * Describes the message livekit.proto.VideoResolution. + * Use `create(VideoResolutionSchema)` to create a new message. + */ +export const VideoResolutionSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 10); /** * @generated from message livekit.proto.VideoBufferInfo */ -export class VideoBufferInfo extends Message { +export type VideoBufferInfo = Message<"livekit.proto.VideoBufferInfo"> & { /** - * @generated from field: livekit.proto.VideoBufferType type = 1; + * @generated from field: required livekit.proto.VideoBufferType type = 1; */ - type = VideoBufferType.RGBA; + type: VideoBufferType; /** - * @generated from field: uint32 width = 2; + * @generated from field: required uint32 width = 2; */ - width = 0; + width: number; /** - * @generated from field: uint32 height = 3; + * @generated from field: required uint32 height = 3; */ - height = 0; + height: number; /** - * @generated from field: uint64 data_ptr = 4; + * @generated from field: required uint64 data_ptr = 4; */ - dataPtr = protoInt64.zero; + dataPtr: bigint; /** * only for packed formats * - * @generated from field: uint32 stride = 6; + * @generated from field: required uint32 stride = 6; */ - stride = 0; + stride: number; /** * @generated from field: repeated livekit.proto.VideoBufferInfo.ComponentInfo components = 7; */ - components: VideoBufferInfo_ComponentInfo[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoBufferInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoBufferType) }, - { no: 2, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 4, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 6, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 7, name: "components", kind: "message", T: VideoBufferInfo_ComponentInfo, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoBufferInfo { - return new VideoBufferInfo().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoBufferInfo { - return new VideoBufferInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VideoBufferInfo { - return new VideoBufferInfo().fromJsonString(jsonString, options); - } - - static equals(a: VideoBufferInfo | PlainMessage | undefined, b: VideoBufferInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoBufferInfo, a, b); - } -} + components: VideoBufferInfo_ComponentInfo[]; +}; + +/** + * Describes the message livekit.proto.VideoBufferInfo. + * Use `create(VideoBufferInfoSchema)` to create a new message. + */ +export const VideoBufferInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 11); /** * @generated from message livekit.proto.VideoBufferInfo.ComponentInfo */ -export class VideoBufferInfo_ComponentInfo extends Message { +export type VideoBufferInfo_ComponentInfo = Message<"livekit.proto.VideoBufferInfo.ComponentInfo"> & { /** - * @generated from field: uint64 data_ptr = 1; + * @generated from field: required uint64 data_ptr = 1; */ - dataPtr = protoInt64.zero; + dataPtr: bigint; /** - * @generated from field: uint32 stride = 2; + * @generated from field: required uint32 stride = 2; */ - stride = 0; + stride: number; /** - * @generated from field: uint32 size = 3; + * @generated from field: required uint32 size = 3; */ - size = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoBufferInfo.ComponentInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "data_ptr", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "stride", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoBufferInfo_ComponentInfo { - return new VideoBufferInfo_ComponentInfo().fromBinary(bytes, options); - } + size: number; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): VideoBufferInfo_ComponentInfo { - return new VideoBufferInfo_ComponentInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VideoBufferInfo_ComponentInfo { - return new VideoBufferInfo_ComponentInfo().fromJsonString(jsonString, options); - } - - static equals(a: VideoBufferInfo_ComponentInfo | PlainMessage | undefined, b: VideoBufferInfo_ComponentInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoBufferInfo_ComponentInfo, a, b); - } -} +/** + * Describes the message livekit.proto.VideoBufferInfo.ComponentInfo. + * Use `create(VideoBufferInfo_ComponentInfoSchema)` to create a new message. + */ +export const VideoBufferInfo_ComponentInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 11, 0); /** * @generated from message livekit.proto.OwnedVideoBuffer */ -export class OwnedVideoBuffer extends Message { +export type OwnedVideoBuffer = Message<"livekit.proto.OwnedVideoBuffer"> & { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.VideoBufferInfo info = 2; + * @generated from field: required livekit.proto.VideoBufferInfo info = 2; */ info?: VideoBufferInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedVideoBuffer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: VideoBufferInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedVideoBuffer { - return new OwnedVideoBuffer().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedVideoBuffer { - return new OwnedVideoBuffer().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedVideoBuffer { - return new OwnedVideoBuffer().fromJsonString(jsonString, options); - } - - static equals(a: OwnedVideoBuffer | PlainMessage | undefined, b: OwnedVideoBuffer | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedVideoBuffer, a, b); - } -} +/** + * Describes the message livekit.proto.OwnedVideoBuffer. + * Use `create(OwnedVideoBufferSchema)` to create a new message. + */ +export const OwnedVideoBufferSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 12); /** * @generated from message livekit.proto.VideoStreamInfo */ -export class VideoStreamInfo extends Message { +export type VideoStreamInfo = Message<"livekit.proto.VideoStreamInfo"> & { /** - * @generated from field: livekit.proto.VideoStreamType type = 1; + * @generated from field: required livekit.proto.VideoStreamType type = 1; */ - type = VideoStreamType.VIDEO_STREAM_NATIVE; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoStreamInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoStreamType) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamInfo { - return new VideoStreamInfo().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoStreamInfo { - return new VideoStreamInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VideoStreamInfo { - return new VideoStreamInfo().fromJsonString(jsonString, options); - } + type: VideoStreamType; +}; - static equals(a: VideoStreamInfo | PlainMessage | undefined, b: VideoStreamInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamInfo, a, b); - } -} +/** + * Describes the message livekit.proto.VideoStreamInfo. + * Use `create(VideoStreamInfoSchema)` to create a new message. + */ +export const VideoStreamInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 13); /** * @generated from message livekit.proto.OwnedVideoStream */ -export class OwnedVideoStream extends Message { +export type OwnedVideoStream = Message<"livekit.proto.OwnedVideoStream"> & { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ handle?: FfiOwnedHandle; /** - * @generated from field: livekit.proto.VideoStreamInfo info = 2; + * @generated from field: required livekit.proto.VideoStreamInfo info = 2; */ info?: VideoStreamInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedVideoStream"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: VideoStreamInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedVideoStream { - return new OwnedVideoStream().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedVideoStream { - return new OwnedVideoStream().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedVideoStream { - return new OwnedVideoStream().fromJsonString(jsonString, options); - } - - static equals(a: OwnedVideoStream | PlainMessage | undefined, b: OwnedVideoStream | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedVideoStream, a, b); - } -} +/** + * Describes the message livekit.proto.OwnedVideoStream. + * Use `create(OwnedVideoStreamSchema)` to create a new message. + */ +export const OwnedVideoStreamSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 14); /** * @generated from message livekit.proto.VideoStreamEvent */ -export class VideoStreamEvent extends Message { +export type VideoStreamEvent = Message<"livekit.proto.VideoStreamEvent"> & { /** - * @generated from field: uint64 stream_handle = 1; + * @generated from field: required uint64 stream_handle = 1; */ - streamHandle = protoInt64.zero; + streamHandle: bigint; /** * @generated from oneof livekit.proto.VideoStreamEvent.message @@ -981,240 +475,286 @@ export class VideoStreamEvent extends Message { */ value: VideoStreamEOS; case: "eos"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoStreamEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "stream_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "frame_received", kind: "message", T: VideoFrameReceived, oneof: "message" }, - { no: 3, name: "eos", kind: "message", T: VideoStreamEOS, oneof: "message" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamEvent { - return new VideoStreamEvent().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoStreamEvent { - return new VideoStreamEvent().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VideoStreamEvent { - return new VideoStreamEvent().fromJsonString(jsonString, options); - } - - static equals(a: VideoStreamEvent | PlainMessage | undefined, b: VideoStreamEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamEvent, a, b); - } -} + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message livekit.proto.VideoStreamEvent. + * Use `create(VideoStreamEventSchema)` to create a new message. + */ +export const VideoStreamEventSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 15); /** * @generated from message livekit.proto.VideoFrameReceived */ -export class VideoFrameReceived extends Message { +export type VideoFrameReceived = Message<"livekit.proto.VideoFrameReceived"> & { /** - * @generated from field: livekit.proto.OwnedVideoBuffer buffer = 1; + * @generated from field: required livekit.proto.OwnedVideoBuffer buffer = 1; */ buffer?: OwnedVideoBuffer; /** * In microseconds * - * @generated from field: int64 timestamp_us = 2; + * @generated from field: required int64 timestamp_us = 2; */ - timestampUs = protoInt64.zero; + timestampUs: bigint; /** - * @generated from field: livekit.proto.VideoRotation rotation = 3; + * @generated from field: required livekit.proto.VideoRotation rotation = 3; */ - rotation = VideoRotation.VIDEO_ROTATION_0; + rotation: VideoRotation; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +/** + * Describes the message livekit.proto.VideoFrameReceived. + * Use `create(VideoFrameReceivedSchema)` to create a new message. + */ +export const VideoFrameReceivedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 16); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoFrameReceived"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "buffer", kind: "message", T: OwnedVideoBuffer }, - { no: 2, name: "timestamp_us", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 3, name: "rotation", kind: "enum", T: proto3.getEnumType(VideoRotation) }, - ]); +/** + * @generated from message livekit.proto.VideoStreamEOS + */ +export type VideoStreamEOS = Message<"livekit.proto.VideoStreamEOS"> & { +}; - static fromBinary(bytes: Uint8Array, options?: Partial): VideoFrameReceived { - return new VideoFrameReceived().fromBinary(bytes, options); - } +/** + * Describes the message livekit.proto.VideoStreamEOS. + * Use `create(VideoStreamEOSSchema)` to create a new message. + */ +export const VideoStreamEOSSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 17); - static fromJson(jsonValue: JsonValue, options?: Partial): VideoFrameReceived { - return new VideoFrameReceived().fromJson(jsonValue, options); - } +/** + * @generated from message livekit.proto.VideoSourceResolution + */ +export type VideoSourceResolution = Message<"livekit.proto.VideoSourceResolution"> & { + /** + * @generated from field: required uint32 width = 1; + */ + width: number; - static fromJsonString(jsonString: string, options?: Partial): VideoFrameReceived { - return new VideoFrameReceived().fromJsonString(jsonString, options); - } + /** + * @generated from field: required uint32 height = 2; + */ + height: number; +}; - static equals(a: VideoFrameReceived | PlainMessage | undefined, b: VideoFrameReceived | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoFrameReceived, a, b); - } -} +/** + * Describes the message livekit.proto.VideoSourceResolution. + * Use `create(VideoSourceResolutionSchema)` to create a new message. + */ +export const VideoSourceResolutionSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 18); /** - * @generated from message livekit.proto.VideoStreamEOS + * @generated from message livekit.proto.VideoSourceInfo */ -export class VideoStreamEOS extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoStreamEOS"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VideoStreamEOS { - return new VideoStreamEOS().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VideoStreamEOS { - return new VideoStreamEOS().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VideoStreamEOS { - return new VideoStreamEOS().fromJsonString(jsonString, options); - } - - static equals(a: VideoStreamEOS | PlainMessage | undefined, b: VideoStreamEOS | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoStreamEOS, a, b); - } -} +export type VideoSourceInfo = Message<"livekit.proto.VideoSourceInfo"> & { + /** + * @generated from field: required livekit.proto.VideoSourceType type = 1; + */ + type: VideoSourceType; +}; /** - * @generated from message livekit.proto.VideoSourceResolution + * Describes the message livekit.proto.VideoSourceInfo. + * Use `create(VideoSourceInfoSchema)` to create a new message. */ -export class VideoSourceResolution extends Message { +export const VideoSourceInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 19); + +/** + * @generated from message livekit.proto.OwnedVideoSource + */ +export type OwnedVideoSource = Message<"livekit.proto.OwnedVideoSource"> & { /** - * @generated from field: uint32 width = 1; + * @generated from field: required livekit.proto.FfiOwnedHandle handle = 1; */ - width = 0; + handle?: FfiOwnedHandle; /** - * @generated from field: uint32 height = 2; + * @generated from field: required livekit.proto.VideoSourceInfo info = 2; */ - height = 0; + info?: VideoSourceInfo; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +/** + * Describes the message livekit.proto.OwnedVideoSource. + * Use `create(OwnedVideoSourceSchema)` to create a new message. + */ +export const OwnedVideoSourceSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_video_frame, 20); - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoSourceResolution"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "width", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "height", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); +/** + * @generated from enum livekit.proto.VideoCodec + */ +export enum VideoCodec { + /** + * @generated from enum value: VP8 = 0; + */ + VP8 = 0, - static fromBinary(bytes: Uint8Array, options?: Partial): VideoSourceResolution { - return new VideoSourceResolution().fromBinary(bytes, options); - } + /** + * @generated from enum value: H264 = 1; + */ + H264 = 1, - static fromJson(jsonValue: JsonValue, options?: Partial): VideoSourceResolution { - return new VideoSourceResolution().fromJson(jsonValue, options); - } + /** + * @generated from enum value: AV1 = 2; + */ + AV1 = 2, - static fromJsonString(jsonString: string, options?: Partial): VideoSourceResolution { - return new VideoSourceResolution().fromJsonString(jsonString, options); - } + /** + * @generated from enum value: VP9 = 3; + */ + VP9 = 3, +} + +/** + * Describes the enum livekit.proto.VideoCodec. + */ +export const VideoCodecSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_video_frame, 0); - static equals(a: VideoSourceResolution | PlainMessage | undefined, b: VideoSourceResolution | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoSourceResolution, a, b); - } +/** + * @generated from enum livekit.proto.VideoRotation + */ +export enum VideoRotation { + /** + * @generated from enum value: VIDEO_ROTATION_0 = 0; + */ + VIDEO_ROTATION_0 = 0, + + /** + * @generated from enum value: VIDEO_ROTATION_90 = 1; + */ + VIDEO_ROTATION_90 = 1, + + /** + * @generated from enum value: VIDEO_ROTATION_180 = 2; + */ + VIDEO_ROTATION_180 = 2, + + /** + * @generated from enum value: VIDEO_ROTATION_270 = 3; + */ + VIDEO_ROTATION_270 = 3, } /** - * @generated from message livekit.proto.VideoSourceInfo + * Describes the enum livekit.proto.VideoRotation. */ -export class VideoSourceInfo extends Message { +export const VideoRotationSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_video_frame, 1); + +/** + * @generated from enum livekit.proto.VideoBufferType + */ +export enum VideoBufferType { /** - * @generated from field: livekit.proto.VideoSourceType type = 1; + * @generated from enum value: RGBA = 0; */ - type = VideoSourceType.VIDEO_SOURCE_NATIVE; + RGBA = 0, - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + /** + * @generated from enum value: ABGR = 1; + */ + ABGR = 1, - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.VideoSourceInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(VideoSourceType) }, - ]); + /** + * @generated from enum value: ARGB = 2; + */ + ARGB = 2, + + /** + * @generated from enum value: BGRA = 3; + */ + BGRA = 3, + + /** + * @generated from enum value: RGB24 = 4; + */ + RGB24 = 4, + + /** + * @generated from enum value: I420 = 5; + */ + I420 = 5, + + /** + * @generated from enum value: I420A = 6; + */ + I420A = 6, - static fromBinary(bytes: Uint8Array, options?: Partial): VideoSourceInfo { - return new VideoSourceInfo().fromBinary(bytes, options); - } + /** + * @generated from enum value: I422 = 7; + */ + I422 = 7, - static fromJson(jsonValue: JsonValue, options?: Partial): VideoSourceInfo { - return new VideoSourceInfo().fromJson(jsonValue, options); - } + /** + * @generated from enum value: I444 = 8; + */ + I444 = 8, - static fromJsonString(jsonString: string, options?: Partial): VideoSourceInfo { - return new VideoSourceInfo().fromJsonString(jsonString, options); - } + /** + * @generated from enum value: I010 = 9; + */ + I010 = 9, - static equals(a: VideoSourceInfo | PlainMessage | undefined, b: VideoSourceInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(VideoSourceInfo, a, b); - } + /** + * @generated from enum value: NV12 = 10; + */ + NV12 = 10, } /** - * @generated from message livekit.proto.OwnedVideoSource + * Describes the enum livekit.proto.VideoBufferType. */ -export class OwnedVideoSource extends Message { +export const VideoBufferTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_video_frame, 2); + +/** + * @generated from enum livekit.proto.VideoStreamType + */ +export enum VideoStreamType { /** - * @generated from field: livekit.proto.FfiOwnedHandle handle = 1; + * @generated from enum value: VIDEO_STREAM_NATIVE = 0; */ - handle?: FfiOwnedHandle; + VIDEO_STREAM_NATIVE = 0, /** - * @generated from field: livekit.proto.VideoSourceInfo info = 2; + * @generated from enum value: VIDEO_STREAM_WEBGL = 1; */ - info?: VideoSourceInfo; + VIDEO_STREAM_WEBGL = 1, - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.OwnedVideoSource"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "handle", kind: "message", T: FfiOwnedHandle }, - { no: 2, name: "info", kind: "message", T: VideoSourceInfo }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): OwnedVideoSource { - return new OwnedVideoSource().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): OwnedVideoSource { - return new OwnedVideoSource().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): OwnedVideoSource { - return new OwnedVideoSource().fromJsonString(jsonString, options); - } - - static equals(a: OwnedVideoSource | PlainMessage | undefined, b: OwnedVideoSource | PlainMessage | undefined): boolean { - return proto3.util.equals(OwnedVideoSource, a, b); - } + /** + * @generated from enum value: VIDEO_STREAM_HTML = 2; + */ + VIDEO_STREAM_HTML = 2, } +/** + * Describes the enum livekit.proto.VideoStreamType. + */ +export const VideoStreamTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_video_frame, 3); + +/** + * @generated from enum livekit.proto.VideoSourceType + */ +export enum VideoSourceType { + /** + * @generated from enum value: VIDEO_SOURCE_NATIVE = 0; + */ + VIDEO_SOURCE_NATIVE = 0, +} + +/** + * Describes the enum livekit.proto.VideoSourceType. + */ +export const VideoSourceTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_video_frame, 4); + From 052a4a5ab98d3161325bb00b4ba1bbc129993316 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 22 Oct 2024 16:28:11 -0700 Subject: [PATCH 104/126] r --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 35e7985e..ce48a34c 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 35e7985e2ce3b75a6fd42ceb16d507e1aacccd23 +Subproject commit ce48a34c66027e8c37b1daa49b6969aac2e88e3d From aad63ef74b97ea457fc7830533d7d8c2e70b8110 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 22 Oct 2024 16:29:15 -0700 Subject: [PATCH 105/126] pb --- packages/livekit-rtc/src/proto/ffi_pb.ts | 86 ++- packages/livekit-rtc/src/proto/rpc_pb.ts | 658 +++++++---------------- 2 files changed, 267 insertions(+), 477 deletions(-) diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index f1bfdd24..e1bdeafc 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -28,13 +28,15 @@ import type { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourc import { file_video_frame } from "./video_frame_pb"; import type { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb"; import { file_audio_frame } from "./audio_frame_pb"; +import type { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodCallback, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb"; +import { file_rpc } from "./rpc_pb"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file ffi.proto. */ export const file_ffi: GenFile = /*@__PURE__*/ - fileDesc("CglmZmkucHJvdG8SDWxpdmVraXQucHJvdG8i/BIKCkZmaVJlcXVlc3QSMAoHZGlzcG9zZRgCIAEoCzIdLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlcXVlc3RIABIwCgdjb25uZWN0GAMgASgLMh0ubGl2ZWtpdC5wcm90by5Db25uZWN0UmVxdWVzdEgAEjYKCmRpc2Nvbm5lY3QYBCABKAsyIC5saXZla2l0LnByb3RvLkRpc2Nvbm5lY3RSZXF1ZXN0SAASOwoNcHVibGlzaF90cmFjaxgFIAEoCzIiLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVxdWVzdEgAEj8KD3VucHVibGlzaF90cmFjaxgGIAEoCzIkLmxpdmVraXQucHJvdG8uVW5wdWJsaXNoVHJhY2tSZXF1ZXN0SAASOQoMcHVibGlzaF9kYXRhGAcgASgLMiEubGl2ZWtpdC5wcm90by5QdWJsaXNoRGF0YVJlcXVlc3RIABI9Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlcXVlc3RIABJEChJzZXRfbG9jYWxfbWV0YWRhdGEYCSABKAsyJi5saXZla2l0LnByb3RvLlNldExvY2FsTWV0YWRhdGFSZXF1ZXN0SAASPAoOc2V0X2xvY2FsX25hbWUYCiABKAsyIi5saXZla2l0LnByb3RvLlNldExvY2FsTmFtZVJlcXVlc3RIABJIChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIoLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVxdWVzdEgAEkIKEWdldF9zZXNzaW9uX3N0YXRzGAwgASgLMiUubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNSZXF1ZXN0SAASSwoVcHVibGlzaF90cmFuc2NyaXB0aW9uGA0gASgLMioubGl2ZWtpdC5wcm90by5QdWJsaXNoVHJhbnNjcmlwdGlvblJlcXVlc3RIABJAChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiQubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlcXVlc3RIABJEChJjcmVhdGVfdmlkZW9fdHJhY2sYDyABKAsyJi5saXZla2l0LnByb3RvLkNyZWF0ZVZpZGVvVHJhY2tSZXF1ZXN0SAASRAoSY3JlYXRlX2F1ZGlvX3RyYWNrGBAgASgLMiYubGl2ZWtpdC5wcm90by5DcmVhdGVBdWRpb1RyYWNrUmVxdWVzdEgAEkAKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJC5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVxdWVzdEgAEkYKE2VuYWJsZV9yZW1vdGVfdHJhY2sYEiABKAsyJy5saXZla2l0LnByb3RvLkVuYWJsZVJlbW90ZVRyYWNrUmVxdWVzdEgAEjMKCWdldF9zdGF0cxgTIAEoCzIeLmxpdmVraXQucHJvdG8uR2V0U3RhdHNSZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3NvdXJjZRgVIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9Tb3VyY2VSZXF1ZXN0SAASRgoTY2FwdHVyZV92aWRlb19mcmFtZRgWIAEoCzInLmxpdmVraXQucHJvdG8uQ2FwdHVyZVZpZGVvRnJhbWVSZXF1ZXN0SAASOwoNdmlkZW9fY29udmVydBgXIAEoCzIiLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVxdWVzdEgAElkKHXZpZGVvX3N0cmVhbV9mcm9tX3BhcnRpY2lwYW50GBggASgLMjAubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlcXVlc3RIABJAChBuZXdfYXVkaW9fc3RyZWFtGBkgASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1N0cmVhbVJlcXVlc3RIABJAChBuZXdfYXVkaW9fc291cmNlGBogASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlcXVlc3RIABJGChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGBsgASgLMicubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZVJlcXVlc3RIABJEChJjbGVhcl9hdWRpb19idWZmZXIYHCABKAsyJi5saXZla2l0LnByb3RvLkNsZWFyQXVkaW9CdWZmZXJSZXF1ZXN0SAASRgoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzInLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXF1ZXN0SAASRAoScmVtaXhfYW5kX3Jlc2FtcGxlGB4gASgLMiYubGl2ZWtpdC5wcm90by5SZW1peEFuZFJlc2FtcGxlUmVxdWVzdEgAEioKBGUyZWUYHyABKAsyGi5saXZla2l0LnByb3RvLkUyZWVSZXF1ZXN0SAASWQodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYICABKAsyMC5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVxdWVzdEgAEkIKEW5ld19zb3hfcmVzYW1wbGVyGCEgASgLMiUubGl2ZWtpdC5wcm90by5OZXdTb3hSZXNhbXBsZXJSZXF1ZXN0SAASRAoScHVzaF9zb3hfcmVzYW1wbGVyGCIgASgLMiYubGl2ZWtpdC5wcm90by5QdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkYKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyJy5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkIKEXNlbmRfY2hhdF9tZXNzYWdlGCQgASgLMiUubGl2ZWtpdC5wcm90by5TZW5kQ2hhdE1lc3NhZ2VSZXF1ZXN0SAASQgoRZWRpdF9jaGF0X21lc3NhZ2UYJSABKAsyJS5saXZla2l0LnByb3RvLkVkaXRDaGF0TWVzc2FnZVJlcXVlc3RIAEIJCgdtZXNzYWdlItwSCgtGZmlSZXNwb25zZRIxCgdkaXNwb3NlGAIgASgLMh4ubGl2ZWtpdC5wcm90by5EaXNwb3NlUmVzcG9uc2VIABIxCgdjb25uZWN0GAMgASgLMh4ubGl2ZWtpdC5wcm90by5Db25uZWN0UmVzcG9uc2VIABI3CgpkaXNjb25uZWN0GAQgASgLMiEubGl2ZWtpdC5wcm90by5EaXNjb25uZWN0UmVzcG9uc2VIABI8Cg1wdWJsaXNoX3RyYWNrGAUgASgLMiMubGl2ZWtpdC5wcm90by5QdWJsaXNoVHJhY2tSZXNwb25zZUgAEkAKD3VucHVibGlzaF90cmFjaxgGIAEoCzIlLmxpdmVraXQucHJvdG8uVW5wdWJsaXNoVHJhY2tSZXNwb25zZUgAEjoKDHB1Ymxpc2hfZGF0YRgHIAEoCzIiLmxpdmVraXQucHJvdG8uUHVibGlzaERhdGFSZXNwb25zZUgAEj4KDnNldF9zdWJzY3JpYmVkGAggASgLMiQubGl2ZWtpdC5wcm90by5TZXRTdWJzY3JpYmVkUmVzcG9uc2VIABJFChJzZXRfbG9jYWxfbWV0YWRhdGEYCSABKAsyJy5saXZla2l0LnByb3RvLlNldExvY2FsTWV0YWRhdGFSZXNwb25zZUgAEj0KDnNldF9sb2NhbF9uYW1lGAogASgLMiMubGl2ZWtpdC5wcm90by5TZXRMb2NhbE5hbWVSZXNwb25zZUgAEkkKFHNldF9sb2NhbF9hdHRyaWJ1dGVzGAsgASgLMikubGl2ZWtpdC5wcm90by5TZXRMb2NhbEF0dHJpYnV0ZXNSZXNwb25zZUgAEkMKEWdldF9zZXNzaW9uX3N0YXRzGAwgASgLMiYubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNSZXNwb25zZUgAEkwKFXB1Ymxpc2hfdHJhbnNjcmlwdGlvbhgNIAEoCzIrLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYW5zY3JpcHRpb25SZXNwb25zZUgAEkEKEHB1Ymxpc2hfc2lwX2R0bWYYDiABKAsyJS5saXZla2l0LnByb3RvLlB1Ymxpc2hTaXBEdG1mUmVzcG9uc2VIABJFChJjcmVhdGVfdmlkZW9fdHJhY2sYDyABKAsyJy5saXZla2l0LnByb3RvLkNyZWF0ZVZpZGVvVHJhY2tSZXNwb25zZUgAEkUKEmNyZWF0ZV9hdWRpb190cmFjaxgQIAEoCzInLmxpdmVraXQucHJvdG8uQ3JlYXRlQXVkaW9UcmFja1Jlc3BvbnNlSAASQQoQbG9jYWxfdHJhY2tfbXV0ZRgRIAEoCzIlLmxpdmVraXQucHJvdG8uTG9jYWxUcmFja011dGVSZXNwb25zZUgAEkcKE2VuYWJsZV9yZW1vdGVfdHJhY2sYEiABKAsyKC5saXZla2l0LnByb3RvLkVuYWJsZVJlbW90ZVRyYWNrUmVzcG9uc2VIABI0CglnZXRfc3RhdHMYEyABKAsyHy5saXZla2l0LnByb3RvLkdldFN0YXRzUmVzcG9uc2VIABJBChBuZXdfdmlkZW9fc3RyZWFtGBQgASgLMiUubGl2ZWtpdC5wcm90by5OZXdWaWRlb1N0cmVhbVJlc3BvbnNlSAASQQoQbmV3X3ZpZGVvX3NvdXJjZRgVIAEoCzIlLmxpdmVraXQucHJvdG8uTmV3VmlkZW9Tb3VyY2VSZXNwb25zZUgAEkcKE2NhcHR1cmVfdmlkZW9fZnJhbWUYFiABKAsyKC5saXZla2l0LnByb3RvLkNhcHR1cmVWaWRlb0ZyYW1lUmVzcG9uc2VIABI8Cg12aWRlb19jb252ZXJ0GBcgASgLMiMubGl2ZWtpdC5wcm90by5WaWRlb0NvbnZlcnRSZXNwb25zZUgAEloKHXZpZGVvX3N0cmVhbV9mcm9tX3BhcnRpY2lwYW50GBggASgLMjEubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlc3BvbnNlSAASQQoQbmV3X2F1ZGlvX3N0cmVhbRgZIAEoCzIlLmxpdmVraXQucHJvdG8uTmV3QXVkaW9TdHJlYW1SZXNwb25zZUgAEkEKEG5ld19hdWRpb19zb3VyY2UYGiABKAsyJS5saXZla2l0LnByb3RvLk5ld0F1ZGlvU291cmNlUmVzcG9uc2VIABJHChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGBsgASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZVJlc3BvbnNlSAASRQoSY2xlYXJfYXVkaW9fYnVmZmVyGBwgASgLMicubGl2ZWtpdC5wcm90by5DbGVhckF1ZGlvQnVmZmVyUmVzcG9uc2VIABJHChNuZXdfYXVkaW9fcmVzYW1wbGVyGB0gASgLMigubGl2ZWtpdC5wcm90by5OZXdBdWRpb1Jlc2FtcGxlclJlc3BvbnNlSAASRQoScmVtaXhfYW5kX3Jlc2FtcGxlGB4gASgLMicubGl2ZWtpdC5wcm90by5SZW1peEFuZFJlc2FtcGxlUmVzcG9uc2VIABJaCh1hdWRpb19zdHJlYW1fZnJvbV9wYXJ0aWNpcGFudBgfIAEoCzIxLmxpdmVraXQucHJvdG8uQXVkaW9TdHJlYW1Gcm9tUGFydGljaXBhbnRSZXNwb25zZUgAEisKBGUyZWUYICABKAsyGy5saXZla2l0LnByb3RvLkUyZWVSZXNwb25zZUgAEkMKEW5ld19zb3hfcmVzYW1wbGVyGCEgASgLMiYubGl2ZWtpdC5wcm90by5OZXdTb3hSZXNhbXBsZXJSZXNwb25zZUgAEkUKEnB1c2hfc294X3Jlc2FtcGxlchgiIAEoCzInLmxpdmVraXQucHJvdG8uUHVzaFNveFJlc2FtcGxlclJlc3BvbnNlSAASRwoTZmx1c2hfc294X3Jlc2FtcGxlchgjIAEoCzIoLmxpdmVraXQucHJvdG8uRmx1c2hTb3hSZXNhbXBsZXJSZXNwb25zZUgAEkMKEXNlbmRfY2hhdF9tZXNzYWdlGCQgASgLMiYubGl2ZWtpdC5wcm90by5TZW5kQ2hhdE1lc3NhZ2VSZXNwb25zZUgAQgkKB21lc3NhZ2UihgoKCEZmaUV2ZW50Ei4KCnJvb21fZXZlbnQYASABKAsyGC5saXZla2l0LnByb3RvLlJvb21FdmVudEgAEjAKC3RyYWNrX2V2ZW50GAIgASgLMhkubGl2ZWtpdC5wcm90by5UcmFja0V2ZW50SAASPQoSdmlkZW9fc3RyZWFtX2V2ZW50GAMgASgLMh8ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUV2ZW50SAASPQoSYXVkaW9fc3RyZWFtX2V2ZW50GAQgASgLMh8ubGl2ZWtpdC5wcm90by5BdWRpb1N0cmVhbUV2ZW50SAASMQoHY29ubmVjdBgFIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdENhbGxiYWNrSAASNwoKZGlzY29ubmVjdBgHIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdENhbGxiYWNrSAASMQoHZGlzcG9zZRgIIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZUNhbGxiYWNrSAASPAoNcHVibGlzaF90cmFjaxgJIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrQ2FsbGJhY2tIABJACg91bnB1Ymxpc2hfdHJhY2sYCiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrQ2FsbGJhY2tIABI6CgxwdWJsaXNoX2RhdGEYCyABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhQ2FsbGJhY2tIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDCABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uQ2FsbGJhY2tIABJHChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGA0gASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZUNhbGxiYWNrSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGA4gASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhQ2FsbGJhY2tIABI9Cg5zZXRfbG9jYWxfbmFtZRgPIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lQ2FsbGJhY2tIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgQIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzQ2FsbGJhY2tIABI0CglnZXRfc3RhdHMYESABKAsyHy5saXZla2l0LnByb3RvLkdldFN0YXRzQ2FsbGJhY2tIABInCgRsb2dzGBIgASgLMhcubGl2ZWtpdC5wcm90by5Mb2dCYXRjaEgAEkMKEWdldF9zZXNzaW9uX3N0YXRzGBMgASgLMiYubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNDYWxsYmFja0gAEiUKBXBhbmljGBQgASgLMhQubGl2ZWtpdC5wcm90by5QYW5pY0gAEkEKEHB1Ymxpc2hfc2lwX2R0bWYYFSABKAsyJS5saXZla2l0LnByb3RvLlB1Ymxpc2hTaXBEdG1mQ2FsbGJhY2tIABI+CgxjaGF0X21lc3NhZ2UYFiABKAsyJi5saXZla2l0LnByb3RvLlNlbmRDaGF0TWVzc2FnZUNhbGxiYWNrSABCCQoHbWVzc2FnZSIfCg5EaXNwb3NlUmVxdWVzdBINCgVhc3luYxgBIAIoCCIjCg9EaXNwb3NlUmVzcG9uc2USEAoIYXN5bmNfaWQYASABKAQiIwoPRGlzcG9zZUNhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEIoUBCglMb2dSZWNvcmQSJgoFbGV2ZWwYASACKA4yFy5saXZla2l0LnByb3RvLkxvZ0xldmVsEg4KBnRhcmdldBgCIAIoCRITCgttb2R1bGVfcGF0aBgDIAEoCRIMCgRmaWxlGAQgASgJEgwKBGxpbmUYBSABKA0SDwoHbWVzc2FnZRgGIAIoCSI1CghMb2dCYXRjaBIpCgdyZWNvcmRzGAEgAygLMhgubGl2ZWtpdC5wcm90by5Mb2dSZWNvcmQiGAoFUGFuaWMSDwoHbWVzc2FnZRgBIAIoCSpTCghMb2dMZXZlbBINCglMT0dfRVJST1IQABIMCghMT0dfV0FSThABEgwKCExPR19JTkZPEAISDQoJTE9HX0RFQlVHEAMSDQoJTE9HX1RSQUNFEARCEKoCDUxpdmVLaXQuUHJvdG8", [file_e2ee, file_track, file_room, file_video_frame, file_audio_frame]); + fileDesc("CglmZmkucHJvdG8SDWxpdmVraXQucHJvdG8iphUKCkZmaVJlcXVlc3QSMAoHZGlzcG9zZRgCIAEoCzIdLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlcXVlc3RIABIwCgdjb25uZWN0GAMgASgLMh0ubGl2ZWtpdC5wcm90by5Db25uZWN0UmVxdWVzdEgAEjYKCmRpc2Nvbm5lY3QYBCABKAsyIC5saXZla2l0LnByb3RvLkRpc2Nvbm5lY3RSZXF1ZXN0SAASOwoNcHVibGlzaF90cmFjaxgFIAEoCzIiLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVxdWVzdEgAEj8KD3VucHVibGlzaF90cmFjaxgGIAEoCzIkLmxpdmVraXQucHJvdG8uVW5wdWJsaXNoVHJhY2tSZXF1ZXN0SAASOQoMcHVibGlzaF9kYXRhGAcgASgLMiEubGl2ZWtpdC5wcm90by5QdWJsaXNoRGF0YVJlcXVlc3RIABI9Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlcXVlc3RIABJEChJzZXRfbG9jYWxfbWV0YWRhdGEYCSABKAsyJi5saXZla2l0LnByb3RvLlNldExvY2FsTWV0YWRhdGFSZXF1ZXN0SAASPAoOc2V0X2xvY2FsX25hbWUYCiABKAsyIi5saXZla2l0LnByb3RvLlNldExvY2FsTmFtZVJlcXVlc3RIABJIChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIoLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVxdWVzdEgAEkIKEWdldF9zZXNzaW9uX3N0YXRzGAwgASgLMiUubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNSZXF1ZXN0SAASSwoVcHVibGlzaF90cmFuc2NyaXB0aW9uGA0gASgLMioubGl2ZWtpdC5wcm90by5QdWJsaXNoVHJhbnNjcmlwdGlvblJlcXVlc3RIABJAChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiQubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlcXVlc3RIABJEChJjcmVhdGVfdmlkZW9fdHJhY2sYDyABKAsyJi5saXZla2l0LnByb3RvLkNyZWF0ZVZpZGVvVHJhY2tSZXF1ZXN0SAASRAoSY3JlYXRlX2F1ZGlvX3RyYWNrGBAgASgLMiYubGl2ZWtpdC5wcm90by5DcmVhdGVBdWRpb1RyYWNrUmVxdWVzdEgAEkAKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJC5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVxdWVzdEgAEkYKE2VuYWJsZV9yZW1vdGVfdHJhY2sYEiABKAsyJy5saXZla2l0LnByb3RvLkVuYWJsZVJlbW90ZVRyYWNrUmVxdWVzdEgAEjMKCWdldF9zdGF0cxgTIAEoCzIeLmxpdmVraXQucHJvdG8uR2V0U3RhdHNSZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3NvdXJjZRgVIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9Tb3VyY2VSZXF1ZXN0SAASRgoTY2FwdHVyZV92aWRlb19mcmFtZRgWIAEoCzInLmxpdmVraXQucHJvdG8uQ2FwdHVyZVZpZGVvRnJhbWVSZXF1ZXN0SAASOwoNdmlkZW9fY29udmVydBgXIAEoCzIiLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVxdWVzdEgAElkKHXZpZGVvX3N0cmVhbV9mcm9tX3BhcnRpY2lwYW50GBggASgLMjAubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlcXVlc3RIABJAChBuZXdfYXVkaW9fc3RyZWFtGBkgASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1N0cmVhbVJlcXVlc3RIABJAChBuZXdfYXVkaW9fc291cmNlGBogASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlcXVlc3RIABJGChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGBsgASgLMicubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZVJlcXVlc3RIABJEChJjbGVhcl9hdWRpb19idWZmZXIYHCABKAsyJi5saXZla2l0LnByb3RvLkNsZWFyQXVkaW9CdWZmZXJSZXF1ZXN0SAASRgoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzInLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXF1ZXN0SAASRAoScmVtaXhfYW5kX3Jlc2FtcGxlGB4gASgLMiYubGl2ZWtpdC5wcm90by5SZW1peEFuZFJlc2FtcGxlUmVxdWVzdEgAEioKBGUyZWUYHyABKAsyGi5saXZla2l0LnByb3RvLkUyZWVSZXF1ZXN0SAASWQodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYICABKAsyMC5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVxdWVzdEgAEkIKEW5ld19zb3hfcmVzYW1wbGVyGCEgASgLMiUubGl2ZWtpdC5wcm90by5OZXdTb3hSZXNhbXBsZXJSZXF1ZXN0SAASRAoScHVzaF9zb3hfcmVzYW1wbGVyGCIgASgLMiYubGl2ZWtpdC5wcm90by5QdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkYKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyJy5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkIKEXNlbmRfY2hhdF9tZXNzYWdlGCQgASgLMiUubGl2ZWtpdC5wcm90by5TZW5kQ2hhdE1lc3NhZ2VSZXF1ZXN0SAASQgoRZWRpdF9jaGF0X21lc3NhZ2UYJSABKAsyJS5saXZla2l0LnByb3RvLkVkaXRDaGF0TWVzc2FnZVJlcXVlc3RIABI3CgtwZXJmb3JtX3JwYxgmIAEoCzIgLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1JlcXVlc3RIABJGChNyZWdpc3Rlcl9ycGNfbWV0aG9kGCcgASgLMicubGl2ZWtpdC5wcm90by5SZWdpc3RlclJwY01ldGhvZFJlcXVlc3RIABJKChV1bnJlZ2lzdGVyX3JwY19tZXRob2QYKCABKAsyKS5saXZla2l0LnByb3RvLlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0SAASWwoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCkgASgLMjEubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXF1ZXN0SABCCQoHbWVzc2FnZSKKFQoLRmZpUmVzcG9uc2USMQoHZGlzcG9zZRgCIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlc3BvbnNlSAASMQoHY29ubmVjdBgDIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdFJlc3BvbnNlSAASNwoKZGlzY29ubmVjdBgEIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdFJlc3BvbnNlSAASPAoNcHVibGlzaF90cmFjaxgFIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVzcG9uc2VIABJACg91bnB1Ymxpc2hfdHJhY2sYBiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrUmVzcG9uc2VIABI6CgxwdWJsaXNoX2RhdGEYByABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhUmVzcG9uc2VIABI+Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIkLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlc3BvbnNlSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGAkgASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhUmVzcG9uc2VIABI9Cg5zZXRfbG9jYWxfbmFtZRgKIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lUmVzcG9uc2VIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVzcG9uc2VIABJDChFnZXRfc2Vzc2lvbl9zdGF0cxgMIAEoCzImLmxpdmVraXQucHJvdG8uR2V0U2Vzc2lvblN0YXRzUmVzcG9uc2VIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDSABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uUmVzcG9uc2VIABJBChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiUubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlc3BvbnNlSAASRQoSY3JlYXRlX3ZpZGVvX3RyYWNrGA8gASgLMicubGl2ZWtpdC5wcm90by5DcmVhdGVWaWRlb1RyYWNrUmVzcG9uc2VIABJFChJjcmVhdGVfYXVkaW9fdHJhY2sYECABKAsyJy5saXZla2l0LnByb3RvLkNyZWF0ZUF1ZGlvVHJhY2tSZXNwb25zZUgAEkEKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJS5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVzcG9uc2VIABJHChNlbmFibGVfcmVtb3RlX3RyYWNrGBIgASgLMigubGl2ZWtpdC5wcm90by5FbmFibGVSZW1vdGVUcmFja1Jlc3BvbnNlSAASNAoJZ2V0X3N0YXRzGBMgASgLMh8ubGl2ZWtpdC5wcm90by5HZXRTdGF0c1Jlc3BvbnNlSAASQQoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIlLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXNwb25zZUgAEkEKEG5ld192aWRlb19zb3VyY2UYFSABKAsyJS5saXZla2l0LnByb3RvLk5ld1ZpZGVvU291cmNlUmVzcG9uc2VIABJHChNjYXB0dXJlX3ZpZGVvX2ZyYW1lGBYgASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlVmlkZW9GcmFtZVJlc3BvbnNlSAASPAoNdmlkZW9fY29udmVydBgXIAEoCzIjLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVzcG9uc2VIABJaCh12aWRlb19zdHJlYW1fZnJvbV9wYXJ0aWNpcGFudBgYIAEoCzIxLmxpdmVraXQucHJvdG8uVmlkZW9TdHJlYW1Gcm9tUGFydGljaXBhbnRSZXNwb25zZUgAEkEKEG5ld19hdWRpb19zdHJlYW0YGSABKAsyJS5saXZla2l0LnByb3RvLk5ld0F1ZGlvU3RyZWFtUmVzcG9uc2VIABJBChBuZXdfYXVkaW9fc291cmNlGBogASgLMiUubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlc3BvbnNlSAASRwoTY2FwdHVyZV9hdWRpb19mcmFtZRgbIAEoCzIoLmxpdmVraXQucHJvdG8uQ2FwdHVyZUF1ZGlvRnJhbWVSZXNwb25zZUgAEkUKEmNsZWFyX2F1ZGlvX2J1ZmZlchgcIAEoCzInLmxpdmVraXQucHJvdG8uQ2xlYXJBdWRpb0J1ZmZlclJlc3BvbnNlSAASRwoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzIoLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXNwb25zZUgAEkUKEnJlbWl4X2FuZF9yZXNhbXBsZRgeIAEoCzInLmxpdmVraXQucHJvdG8uUmVtaXhBbmRSZXNhbXBsZVJlc3BvbnNlSAASWgodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYHyABKAsyMS5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVzcG9uc2VIABIrCgRlMmVlGCAgASgLMhsubGl2ZWtpdC5wcm90by5FMmVlUmVzcG9uc2VIABJDChFuZXdfc294X3Jlc2FtcGxlchghIAEoCzImLmxpdmVraXQucHJvdG8uTmV3U294UmVzYW1wbGVyUmVzcG9uc2VIABJFChJwdXNoX3NveF9yZXNhbXBsZXIYIiABKAsyJy5saXZla2l0LnByb3RvLlB1c2hTb3hSZXNhbXBsZXJSZXNwb25zZUgAEkcKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyKC5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVzcG9uc2VIABJDChFzZW5kX2NoYXRfbWVzc2FnZRgkIAEoCzImLmxpdmVraXQucHJvdG8uU2VuZENoYXRNZXNzYWdlUmVzcG9uc2VIABI4CgtwZXJmb3JtX3JwYxglIAEoCzIhLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1Jlc3BvbnNlSAASRwoTcmVnaXN0ZXJfcnBjX21ldGhvZBgmIAEoCzIoLmxpdmVraXQucHJvdG8uUmVnaXN0ZXJScGNNZXRob2RSZXNwb25zZUgAEksKFXVucmVnaXN0ZXJfcnBjX21ldGhvZBgnIAEoCzIqLmxpdmVraXQucHJvdG8uVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlSAASXAoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCggASgLMjIubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXNwb25zZUgAQgkKB21lc3NhZ2Ui/gwKCEZmaUV2ZW50Ei4KCnJvb21fZXZlbnQYASABKAsyGC5saXZla2l0LnByb3RvLlJvb21FdmVudEgAEjAKC3RyYWNrX2V2ZW50GAIgASgLMhkubGl2ZWtpdC5wcm90by5UcmFja0V2ZW50SAASPQoSdmlkZW9fc3RyZWFtX2V2ZW50GAMgASgLMh8ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUV2ZW50SAASPQoSYXVkaW9fc3RyZWFtX2V2ZW50GAQgASgLMh8ubGl2ZWtpdC5wcm90by5BdWRpb1N0cmVhbUV2ZW50SAASMQoHY29ubmVjdBgFIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdENhbGxiYWNrSAASNwoKZGlzY29ubmVjdBgHIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdENhbGxiYWNrSAASMQoHZGlzcG9zZRgIIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZUNhbGxiYWNrSAASPAoNcHVibGlzaF90cmFjaxgJIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrQ2FsbGJhY2tIABJACg91bnB1Ymxpc2hfdHJhY2sYCiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrQ2FsbGJhY2tIABI6CgxwdWJsaXNoX2RhdGEYCyABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhQ2FsbGJhY2tIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDCABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uQ2FsbGJhY2tIABJHChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGA0gASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZUNhbGxiYWNrSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGA4gASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhQ2FsbGJhY2tIABI9Cg5zZXRfbG9jYWxfbmFtZRgPIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lQ2FsbGJhY2tIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgQIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzQ2FsbGJhY2tIABI0CglnZXRfc3RhdHMYESABKAsyHy5saXZla2l0LnByb3RvLkdldFN0YXRzQ2FsbGJhY2tIABInCgRsb2dzGBIgASgLMhcubGl2ZWtpdC5wcm90by5Mb2dCYXRjaEgAEkMKEWdldF9zZXNzaW9uX3N0YXRzGBMgASgLMiYubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNDYWxsYmFja0gAEiUKBXBhbmljGBQgASgLMhQubGl2ZWtpdC5wcm90by5QYW5pY0gAEkEKEHB1Ymxpc2hfc2lwX2R0bWYYFSABKAsyJS5saXZla2l0LnByb3RvLlB1Ymxpc2hTaXBEdG1mQ2FsbGJhY2tIABI+CgxjaGF0X21lc3NhZ2UYFiABKAsyJi5saXZla2l0LnByb3RvLlNlbmRDaGF0TWVzc2FnZUNhbGxiYWNrSAASOAoLcGVyZm9ybV9ycGMYFyABKAsyIS5saXZla2l0LnByb3RvLlBlcmZvcm1ScGNDYWxsYmFja0gAEkcKE3JlZ2lzdGVyX3JwY19tZXRob2QYGCABKAsyKC5saXZla2l0LnByb3RvLlJlZ2lzdGVyUnBjTWV0aG9kQ2FsbGJhY2tIABJLChV1bnJlZ2lzdGVyX3JwY19tZXRob2QYGSABKAsyKi5saXZla2l0LnByb3RvLlVucmVnaXN0ZXJScGNNZXRob2RDYWxsYmFja0gAEkgKFXJwY19tZXRob2RfaW52b2NhdGlvbhgaIAEoCzInLmxpdmVraXQucHJvdG8uUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50SAASXAoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGBsgASgLMjIubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VDYWxsYmFja0gAQgkKB21lc3NhZ2UiHwoORGlzcG9zZVJlcXVlc3QSDQoFYXN5bmMYASACKAgiIwoPRGlzcG9zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgASgEIiMKD0Rpc3Bvc2VDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBCKFAQoJTG9nUmVjb3JkEiYKBWxldmVsGAEgAigOMhcubGl2ZWtpdC5wcm90by5Mb2dMZXZlbBIOCgZ0YXJnZXQYAiACKAkSEwoLbW9kdWxlX3BhdGgYAyABKAkSDAoEZmlsZRgEIAEoCRIMCgRsaW5lGAUgASgNEg8KB21lc3NhZ2UYBiACKAkiNQoITG9nQmF0Y2gSKQoHcmVjb3JkcxgBIAMoCzIYLmxpdmVraXQucHJvdG8uTG9nUmVjb3JkIhgKBVBhbmljEg8KB21lc3NhZ2UYASACKAkqUwoITG9nTGV2ZWwSDQoJTE9HX0VSUk9SEAASDAoITE9HX1dBUk4QARIMCghMT0dfSU5GTxACEg0KCUxPR19ERUJVRxADEg0KCUxPR19UUkFDRRAEQhCqAg1MaXZlS2l0LlByb3Rv", [file_e2ee, file_track, file_room, file_video_frame, file_audio_frame, file_rpc]); /** * This is the input of livekit_ffi_request function @@ -270,6 +272,32 @@ export type FfiRequest = Message<"livekit.proto.FfiRequest"> & { */ value: EditChatMessageRequest; case: "editChatMessage"; + } | { + /** + * RPC + * + * @generated from field: livekit.proto.PerformRpcRequest perform_rpc = 38; + */ + value: PerformRpcRequest; + case: "performRpc"; + } | { + /** + * @generated from field: livekit.proto.RegisterRpcMethodRequest register_rpc_method = 39; + */ + value: RegisterRpcMethodRequest; + case: "registerRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.UnregisterRpcMethodRequest unregister_rpc_method = 40; + */ + value: UnregisterRpcMethodRequest; + case: "unregisterRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.RpcMethodInvocationResponseRequest rpc_method_invocation_response = 41; + */ + value: RpcMethodInvocationResponseRequest; + case: "rpcMethodInvocationResponse"; } | { case: undefined; value?: undefined }; }; @@ -507,6 +535,32 @@ export type FfiResponse = Message<"livekit.proto.FfiResponse"> & { */ value: SendChatMessageResponse; case: "sendChatMessage"; + } | { + /** + * RPC + * + * @generated from field: livekit.proto.PerformRpcResponse perform_rpc = 37; + */ + value: PerformRpcResponse; + case: "performRpc"; + } | { + /** + * @generated from field: livekit.proto.RegisterRpcMethodResponse register_rpc_method = 38; + */ + value: RegisterRpcMethodResponse; + case: "registerRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.UnregisterRpcMethodResponse unregister_rpc_method = 39; + */ + value: UnregisterRpcMethodResponse; + case: "unregisterRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.RpcMethodInvocationResponseResponse rpc_method_invocation_response = 40; + */ + value: RpcMethodInvocationResponseResponse; + case: "rpcMethodInvocationResponse"; } | { case: undefined; value?: undefined }; }; @@ -654,6 +708,36 @@ export type FfiEvent = Message<"livekit.proto.FfiEvent"> & { */ value: SendChatMessageCallback; case: "chatMessage"; + } | { + /** + * @generated from field: livekit.proto.PerformRpcCallback perform_rpc = 23; + */ + value: PerformRpcCallback; + case: "performRpc"; + } | { + /** + * @generated from field: livekit.proto.RegisterRpcMethodCallback register_rpc_method = 24; + */ + value: RegisterRpcMethodCallback; + case: "registerRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.UnregisterRpcMethodCallback unregister_rpc_method = 25; + */ + value: UnregisterRpcMethodCallback; + case: "unregisterRpcMethod"; + } | { + /** + * @generated from field: livekit.proto.RpcMethodInvocationEvent rpc_method_invocation = 26; + */ + value: RpcMethodInvocationEvent; + case: "rpcMethodInvocation"; + } | { + /** + * @generated from field: livekit.proto.RpcMethodInvocationResponseCallback rpc_method_invocation_response = 27; + */ + value: RpcMethodInvocationResponseCallback; + case: "rpcMethodInvocationResponse"; } | { case: undefined; value?: undefined }; }; diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index c849b160..c2e27d92 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -12,657 +12,363 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" -// @generated from file rpc.proto (package livekit.proto, syntax proto3) +// @generated by protoc-gen-es v2.2.0 with parameter "target=ts" +// @generated from file rpc.proto (package livekit.proto, syntax proto2) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file rpc.proto. + */ +export const file_rpc: GenFile = /*@__PURE__*/ + fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIkwKGFJlZ2lzdGVyUnBjTWV0aG9kUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSDgoGbWV0aG9kGAIgAigJIk4KGlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIOCgZtZXRob2QYAiACKAkilgEKIlJwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhUKDWludm9jYXRpb25faWQYAiACKAQSDwoHcGF5bG9hZBgDIAEoCRImCgVlcnJvchgEIAEoCzIXLmxpdmVraXQucHJvdG8uUnBjRXJyb3IiJgoSUGVyZm9ybVJwY1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIi0KGVJlZ2lzdGVyUnBjTWV0aG9kUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQiLwobVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIjcKI1JwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIl8KElBlcmZvcm1ScGNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgdwYXlsb2FkGAIgASgJEiYKBWVycm9yGAMgASgLMhcubGl2ZWtpdC5wcm90by5ScGNFcnJvciItChlSZWdpc3RlclJwY01ldGhvZENhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEIi8KG1VucmVnaXN0ZXJScGNNZXRob2RDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBCJGCiNScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBINCgVlcnJvchgCIAEoCSK+AQoYUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIVCg1pbnZvY2F0aW9uX2lkGAIgAigEEg4KBm1ldGhvZBgDIAIoCRISCgpyZXF1ZXN0X2lkGAQgAigJEhcKD2NhbGxlcl9pZGVudGl0eRgFIAIoCRIPCgdwYXlsb2FkGAYgAigJEhsKE3Jlc3BvbnNlX3RpbWVvdXRfbXMYByACKA1CEKoCDUxpdmVLaXQuUHJvdG8"); /** * @generated from message livekit.proto.RpcError */ -export class RpcError extends Message { +export type RpcError = Message<"livekit.proto.RpcError"> & { /** - * @generated from field: uint32 code = 1; + * @generated from field: required uint32 code = 1; */ - code = 0; + code: number; /** - * @generated from field: string message = 2; + * @generated from field: required string message = 2; */ - message = ""; + message: string; /** * @generated from field: optional string data = 3; */ - data?: string; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RpcError"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "code", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "data", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RpcError { - return new RpcError().fromBinary(bytes, options); - } + data: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): RpcError { - return new RpcError().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RpcError { - return new RpcError().fromJsonString(jsonString, options); - } - - static equals(a: RpcError | PlainMessage | undefined, b: RpcError | PlainMessage | undefined): boolean { - return proto3.util.equals(RpcError, a, b); - } -} +/** + * Describes the message livekit.proto.RpcError. + * Use `create(RpcErrorSchema)` to create a new message. + */ +export const RpcErrorSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 0); /** * FFI Requests * * @generated from message livekit.proto.PerformRpcRequest */ -export class PerformRpcRequest extends Message { +export type PerformRpcRequest = Message<"livekit.proto.PerformRpcRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: string destination_identity = 2; + * @generated from field: required string destination_identity = 2; */ - destinationIdentity = ""; + destinationIdentity: string; /** - * @generated from field: string method = 3; + * @generated from field: required string method = 3; */ - method = ""; + method: string; /** - * @generated from field: string payload = 4; + * @generated from field: required string payload = 4; */ - payload = ""; + payload: string; /** * @generated from field: optional uint32 response_timeout_ms = 5; */ - responseTimeoutMs?: number; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PerformRpcRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "destination_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, - ]); + responseTimeoutMs: number; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcRequest { - return new PerformRpcRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcRequest { - return new PerformRpcRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PerformRpcRequest { - return new PerformRpcRequest().fromJsonString(jsonString, options); - } - - static equals(a: PerformRpcRequest | PlainMessage | undefined, b: PerformRpcRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(PerformRpcRequest, a, b); - } -} +/** + * Describes the message livekit.proto.PerformRpcRequest. + * Use `create(PerformRpcRequestSchema)` to create a new message. + */ +export const PerformRpcRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 1); /** * @generated from message livekit.proto.RegisterRpcMethodRequest */ -export class RegisterRpcMethodRequest extends Message { +export type RegisterRpcMethodRequest = Message<"livekit.proto.RegisterRpcMethodRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: string method = 2; + * @generated from field: required string method = 2; */ - method = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + method: string; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RegisterRpcMethodRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RegisterRpcMethodRequest { - return new RegisterRpcMethodRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RegisterRpcMethodRequest { - return new RegisterRpcMethodRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RegisterRpcMethodRequest { - return new RegisterRpcMethodRequest().fromJsonString(jsonString, options); - } - - static equals(a: RegisterRpcMethodRequest | PlainMessage | undefined, b: RegisterRpcMethodRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RegisterRpcMethodRequest, a, b); - } -} +/** + * Describes the message livekit.proto.RegisterRpcMethodRequest. + * Use `create(RegisterRpcMethodRequestSchema)` to create a new message. + */ +export const RegisterRpcMethodRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 2); /** * @generated from message livekit.proto.UnregisterRpcMethodRequest */ -export class UnregisterRpcMethodRequest extends Message { +export type UnregisterRpcMethodRequest = Message<"livekit.proto.UnregisterRpcMethodRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: string method = 2; + * @generated from field: required string method = 2; */ - method = ""; + method: string; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UnregisterRpcMethodRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): UnregisterRpcMethodRequest { - return new UnregisterRpcMethodRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): UnregisterRpcMethodRequest { - return new UnregisterRpcMethodRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): UnregisterRpcMethodRequest { - return new UnregisterRpcMethodRequest().fromJsonString(jsonString, options); - } - - static equals(a: UnregisterRpcMethodRequest | PlainMessage | undefined, b: UnregisterRpcMethodRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(UnregisterRpcMethodRequest, a, b); - } -} +/** + * Describes the message livekit.proto.UnregisterRpcMethodRequest. + * Use `create(UnregisterRpcMethodRequestSchema)` to create a new message. + */ +export const UnregisterRpcMethodRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 3); /** * @generated from message livekit.proto.RpcMethodInvocationResponseRequest */ -export class RpcMethodInvocationResponseRequest extends Message { +export type RpcMethodInvocationResponseRequest = Message<"livekit.proto.RpcMethodInvocationResponseRequest"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: uint64 invocation_id = 2; + * @generated from field: required uint64 invocation_id = 2; */ - invocationId = protoInt64.zero; + invocationId: bigint; /** * @generated from field: optional string payload = 3; */ - payload?: string; + payload: string; /** * @generated from field: optional livekit.proto.RpcError error = 4; */ error?: RpcError; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RpcMethodInvocationResponseRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "invocation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 3, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 4, name: "error", kind: "message", T: RpcError, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationResponseRequest { - return new RpcMethodInvocationResponseRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RpcMethodInvocationResponseRequest { - return new RpcMethodInvocationResponseRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RpcMethodInvocationResponseRequest { - return new RpcMethodInvocationResponseRequest().fromJsonString(jsonString, options); - } - - static equals(a: RpcMethodInvocationResponseRequest | PlainMessage | undefined, b: RpcMethodInvocationResponseRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RpcMethodInvocationResponseRequest, a, b); - } -} +/** + * Describes the message livekit.proto.RpcMethodInvocationResponseRequest. + * Use `create(RpcMethodInvocationResponseRequestSchema)` to create a new message. + */ +export const RpcMethodInvocationResponseRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 4); /** * FFI Responses * * @generated from message livekit.proto.PerformRpcResponse */ -export class PerformRpcResponse extends Message { +export type PerformRpcResponse = Message<"livekit.proto.PerformRpcResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.PerformRpcResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcResponse { - return new PerformRpcResponse().fromBinary(bytes, options); - } + asyncId: bigint; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcResponse { - return new PerformRpcResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PerformRpcResponse { - return new PerformRpcResponse().fromJsonString(jsonString, options); - } - - static equals(a: PerformRpcResponse | PlainMessage | undefined, b: PerformRpcResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(PerformRpcResponse, a, b); - } -} +/** + * Describes the message livekit.proto.PerformRpcResponse. + * Use `create(PerformRpcResponseSchema)` to create a new message. + */ +export const PerformRpcResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 5); /** * @generated from message livekit.proto.RegisterRpcMethodResponse */ -export class RegisterRpcMethodResponse extends Message { +export type RegisterRpcMethodResponse = Message<"livekit.proto.RegisterRpcMethodResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.RegisterRpcMethodResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); + asyncId: bigint; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): RegisterRpcMethodResponse { - return new RegisterRpcMethodResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RegisterRpcMethodResponse { - return new RegisterRpcMethodResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RegisterRpcMethodResponse { - return new RegisterRpcMethodResponse().fromJsonString(jsonString, options); - } - - static equals(a: RegisterRpcMethodResponse | PlainMessage | undefined, b: RegisterRpcMethodResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RegisterRpcMethodResponse, a, b); - } -} +/** + * Describes the message livekit.proto.RegisterRpcMethodResponse. + * Use `create(RegisterRpcMethodResponseSchema)` to create a new message. + */ +export const RegisterRpcMethodResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 6); /** * @generated from message livekit.proto.UnregisterRpcMethodResponse */ -export class UnregisterRpcMethodResponse extends Message { +export type UnregisterRpcMethodResponse = Message<"livekit.proto.UnregisterRpcMethodResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + asyncId: bigint; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.UnregisterRpcMethodResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): UnregisterRpcMethodResponse { - return new UnregisterRpcMethodResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): UnregisterRpcMethodResponse { - return new UnregisterRpcMethodResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): UnregisterRpcMethodResponse { - return new UnregisterRpcMethodResponse().fromJsonString(jsonString, options); - } - - static equals(a: UnregisterRpcMethodResponse | PlainMessage | undefined, b: UnregisterRpcMethodResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(UnregisterRpcMethodResponse, a, b); - } -} +/** + * Describes the message livekit.proto.UnregisterRpcMethodResponse. + * Use `create(UnregisterRpcMethodResponseSchema)` to create a new message. + */ +export const UnregisterRpcMethodResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 7); /** * @generated from message livekit.proto.RpcMethodInvocationResponseResponse */ -export class RpcMethodInvocationResponseResponse extends Message { +export type RpcMethodInvocationResponseResponse = Message<"livekit.proto.RpcMethodInvocationResponseResponse"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RpcMethodInvocationResponseResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationResponseResponse { - return new RpcMethodInvocationResponseResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RpcMethodInvocationResponseResponse { - return new RpcMethodInvocationResponseResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RpcMethodInvocationResponseResponse { - return new RpcMethodInvocationResponseResponse().fromJsonString(jsonString, options); - } - - static equals(a: RpcMethodInvocationResponseResponse | PlainMessage | undefined, b: RpcMethodInvocationResponseResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RpcMethodInvocationResponseResponse, a, b); - } -} +/** + * Describes the message livekit.proto.RpcMethodInvocationResponseResponse. + * Use `create(RpcMethodInvocationResponseResponseSchema)` to create a new message. + */ +export const RpcMethodInvocationResponseResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 8); /** * FFI Callbacks * * @generated from message livekit.proto.PerformRpcCallback */ -export class PerformRpcCallback extends Message { +export type PerformRpcCallback = Message<"livekit.proto.PerformRpcCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @generated from field: optional string payload = 2; */ - payload?: string; + payload: string; /** * @generated from field: optional livekit.proto.RpcError error = 3; */ error?: RpcError; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.PerformRpcCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 3, name: "error", kind: "message", T: RpcError, opt: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): PerformRpcCallback { - return new PerformRpcCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): PerformRpcCallback { - return new PerformRpcCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): PerformRpcCallback { - return new PerformRpcCallback().fromJsonString(jsonString, options); - } - - static equals(a: PerformRpcCallback | PlainMessage | undefined, b: PerformRpcCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(PerformRpcCallback, a, b); - } -} +/** + * Describes the message livekit.proto.PerformRpcCallback. + * Use `create(PerformRpcCallbackSchema)` to create a new message. + */ +export const PerformRpcCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 9); /** * @generated from message livekit.proto.RegisterRpcMethodCallback */ -export class RegisterRpcMethodCallback extends Message { +export type RegisterRpcMethodCallback = Message<"livekit.proto.RegisterRpcMethodCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.RegisterRpcMethodCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RegisterRpcMethodCallback { - return new RegisterRpcMethodCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RegisterRpcMethodCallback { - return new RegisterRpcMethodCallback().fromJson(jsonValue, options); - } + asyncId: bigint; +}; - static fromJsonString(jsonString: string, options?: Partial): RegisterRpcMethodCallback { - return new RegisterRpcMethodCallback().fromJsonString(jsonString, options); - } - - static equals(a: RegisterRpcMethodCallback | PlainMessage | undefined, b: RegisterRpcMethodCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(RegisterRpcMethodCallback, a, b); - } -} +/** + * Describes the message livekit.proto.RegisterRpcMethodCallback. + * Use `create(RegisterRpcMethodCallbackSchema)` to create a new message. + */ +export const RegisterRpcMethodCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 10); /** * @generated from message livekit.proto.UnregisterRpcMethodCallback */ -export class UnregisterRpcMethodCallback extends Message { +export type UnregisterRpcMethodCallback = Message<"livekit.proto.UnregisterRpcMethodCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required 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.UnregisterRpcMethodCallback"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): UnregisterRpcMethodCallback { - return new UnregisterRpcMethodCallback().fromBinary(bytes, options); - } + asyncId: bigint; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): UnregisterRpcMethodCallback { - return new UnregisterRpcMethodCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): UnregisterRpcMethodCallback { - return new UnregisterRpcMethodCallback().fromJsonString(jsonString, options); - } - - static equals(a: UnregisterRpcMethodCallback | PlainMessage | undefined, b: UnregisterRpcMethodCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(UnregisterRpcMethodCallback, a, b); - } -} +/** + * Describes the message livekit.proto.UnregisterRpcMethodCallback. + * Use `create(UnregisterRpcMethodCallbackSchema)` to create a new message. + */ +export const UnregisterRpcMethodCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 11); /** * @generated from message livekit.proto.RpcMethodInvocationResponseCallback */ -export class RpcMethodInvocationResponseCallback extends Message { +export type RpcMethodInvocationResponseCallback = Message<"livekit.proto.RpcMethodInvocationResponseCallback"> & { /** - * @generated from field: uint64 async_id = 1; + * @generated from field: required uint64 async_id = 1; */ - asyncId = protoInt64.zero; + asyncId: bigint; /** * @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.RpcMethodInvocationResponseCallback"; - 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 }, - ]); + error: string; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationResponseCallback { - return new RpcMethodInvocationResponseCallback().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RpcMethodInvocationResponseCallback { - return new RpcMethodInvocationResponseCallback().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RpcMethodInvocationResponseCallback { - return new RpcMethodInvocationResponseCallback().fromJsonString(jsonString, options); - } - - static equals(a: RpcMethodInvocationResponseCallback | PlainMessage | undefined, b: RpcMethodInvocationResponseCallback | PlainMessage | undefined): boolean { - return proto3.util.equals(RpcMethodInvocationResponseCallback, a, b); - } -} +/** + * Describes the message livekit.proto.RpcMethodInvocationResponseCallback. + * Use `create(RpcMethodInvocationResponseCallbackSchema)` to create a new message. + */ +export const RpcMethodInvocationResponseCallbackSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 12); /** * FFI Events * * @generated from message livekit.proto.RpcMethodInvocationEvent */ -export class RpcMethodInvocationEvent extends Message { +export type RpcMethodInvocationEvent = Message<"livekit.proto.RpcMethodInvocationEvent"> & { /** - * @generated from field: uint64 local_participant_handle = 1; + * @generated from field: required uint64 local_participant_handle = 1; */ - localParticipantHandle = protoInt64.zero; + localParticipantHandle: bigint; /** - * @generated from field: uint64 invocation_id = 2; + * @generated from field: required uint64 invocation_id = 2; */ - invocationId = protoInt64.zero; + invocationId: bigint; /** - * @generated from field: string method = 3; + * @generated from field: required string method = 3; */ - method = ""; + method: string; /** - * @generated from field: string request_id = 4; + * @generated from field: required string request_id = 4; */ - requestId = ""; + requestId: string; /** - * @generated from field: string caller_identity = 5; + * @generated from field: required string caller_identity = 5; */ - callerIdentity = ""; + callerIdentity: string; /** - * @generated from field: string payload = 6; + * @generated from field: required string payload = 6; */ - payload = ""; + payload: string; /** - * @generated from field: uint32 response_timeout_ms = 7; + * @generated from field: required uint32 response_timeout_ms = 7; */ - responseTimeoutMs = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + responseTimeoutMs: number; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "livekit.proto.RpcMethodInvocationEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 2, name: "invocation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, - { no: 3, name: "method", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "caller_identity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "payload", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "response_timeout_ms", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RpcMethodInvocationEvent { - return new RpcMethodInvocationEvent().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RpcMethodInvocationEvent { - return new RpcMethodInvocationEvent().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RpcMethodInvocationEvent { - return new RpcMethodInvocationEvent().fromJsonString(jsonString, options); - } - - static equals(a: RpcMethodInvocationEvent | PlainMessage | undefined, b: RpcMethodInvocationEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(RpcMethodInvocationEvent, a, b); - } -} +/** + * Describes the message livekit.proto.RpcMethodInvocationEvent. + * Use `create(RpcMethodInvocationEventSchema)` to create a new message. + */ +export const RpcMethodInvocationEventSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_rpc, 13); From ea3af0e95cab147798999df1e01834bc2546e21b Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 22 Oct 2024 16:30:29 -0700 Subject: [PATCH 106/126] Update comment in livekit-rtc/generate_proto.sh --- packages/livekit-rtc/generate_proto.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/livekit-rtc/generate_proto.sh b/packages/livekit-rtc/generate_proto.sh index 5b799dd5..c8b328c4 100755 --- a/packages/livekit-rtc/generate_proto.sh +++ b/packages/livekit-rtc/generate_proto.sh @@ -5,7 +5,7 @@ # SPDX-License-Identifier: Apache-2.0 # This script requires protobuf-compiler and https://www.npmjs.com/package/@bufbuild/protoc-gen-es -# `brew install protobuf-c && npm install -g @bufbuild/protoc-gen-es@1.10.0` +# `brew install protobuf-c && npm install -g @bufbuild/protoc-gen-es@2.2.0` FFI_PROTOCOL=./rust-sdks/livekit-ffi/protocol FFI_OUT_NODE=./src/proto @@ -24,4 +24,4 @@ PATH=$PATH:$(pwd)/node_modules/.bin \ $FFI_PROTOCOL/track.proto \ $FFI_PROTOCOL/video_frame.proto \ $FFI_PROTOCOL/e2ee.proto \ - $FFI_PROTOCOL/stats.proto + $FFI_PROTOCOL/stats.proto \ No newline at end of file From f062c4e5555a96e34c6714baec10246d555bd298 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 22 Oct 2024 16:32:52 -0700 Subject: [PATCH 107/126] nl --- packages/livekit-rtc/generate_proto.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/generate_proto.sh b/packages/livekit-rtc/generate_proto.sh index c8b328c4..de0ff20b 100755 --- a/packages/livekit-rtc/generate_proto.sh +++ b/packages/livekit-rtc/generate_proto.sh @@ -24,4 +24,4 @@ PATH=$PATH:$(pwd)/node_modules/.bin \ $FFI_PROTOCOL/track.proto \ $FFI_PROTOCOL/video_frame.proto \ $FFI_PROTOCOL/e2ee.proto \ - $FFI_PROTOCOL/stats.proto \ No newline at end of file + $FFI_PROTOCOL/stats.proto From 1ee78570a96b3c89d48bc4e4bf2640c421e34972 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Tue, 22 Oct 2024 16:38:43 -0700 Subject: [PATCH 108/126] fixes --- packages/livekit-rtc/src/participant.ts | 18 ++++++++---------- packages/livekit-rtc/src/rpc.ts | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 8993200d..e5fd2ded 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -48,8 +48,6 @@ import type { RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodResponse, -} from './proto/rpc_pb.js'; -import { PerformRpcRequest, RegisterRpcMethodRequest, RpcMethodInvocationResponseRequest, @@ -392,13 +390,13 @@ export class LocalParticipant extends Participant { payload: string, responseTimeoutMs?: number, ): Promise { - const req = new PerformRpcRequest({ + const req = { localParticipantHandle: this.ffi_handle.handle, destinationIdentity, method, payload, responseTimeoutMs, - }); + } as PerformRpcRequest; const res = FfiClient.instance.request({ message: { case: 'performRpc', value: req }, @@ -458,10 +456,10 @@ export class LocalParticipant extends Participant { ): Promise { this.rpcHandlers.set(method, handler); - const req = new RegisterRpcMethodRequest({ + const req = { localParticipantHandle: this.ffi_handle.handle, method, - }); + } as RegisterRpcMethodRequest; const res = FfiClient.instance.request({ message: { case: 'registerRpcMethod', value: req }, @@ -480,10 +478,10 @@ export class LocalParticipant extends Participant { async unregisterRpcMethod(method: string): Promise { this.rpcHandlers.delete(method); - const req = new UnregisterRpcMethodRequest({ + const req = { localParticipantHandle: this.ffi_handle.handle, method, - }); + } as UnregisterRpcMethodRequest; const res = FfiClient.instance.request({ message: { case: 'unregisterRpcMethod', value: req }, @@ -526,12 +524,12 @@ export class LocalParticipant extends Participant { } } - const req = new RpcMethodInvocationResponseRequest({ + const req = { localParticipantHandle: this.ffi_handle.handle, invocationId, error: responseError ? responseError.toProto() : undefined, payload: responsePayload ?? undefined, - }); + } as RpcMethodInvocationResponseRequest; const res = FfiClient.instance.request({ message: { case: 'rpcMethodInvocationResponse', value: req }, diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index 561a9fb9..b31987fa 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -35,11 +35,11 @@ export class RpcError extends Error { } toProto() { - return new RpcError_Proto({ + return { code: this.code as number, message: this.message, data: this.data, - }); + } as RpcError_Proto; } static ErrorCode = { From 7c2a356ddbb8fbaa40785fb97b2185bedf2e1213 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 23 Oct 2024 08:22:57 +0200 Subject: [PATCH 109/126] wip --- packages/livekit-rtc/src/index.ts | 10 +++++++--- packages/livekit-rtc/src/room.ts | 30 +++++++++++++----------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/livekit-rtc/src/index.ts b/packages/livekit-rtc/src/index.ts index c128f614..a2ddea68 100644 --- a/packages/livekit-rtc/src/index.ts +++ b/packages/livekit-rtc/src/index.ts @@ -87,11 +87,15 @@ export class TrackPublishOptions implements TrackPublishOptionsType { stream: string; red: boolean; - constructor(init: MessageInitShape) { + constructor(init: MessageInitShape = {}) { const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init; this.videoCodec = videoCodec ?? VideoCodec.VP8; - this.videoEncoding = create(VideoEncodingSchema, videoEncoding); - this.audioEncoding = create(AudioEncodingSchema, audioEncoding); + if (videoEncoding) { + this.videoEncoding = create(VideoEncodingSchema, videoEncoding); + } + if (audioEncoding) { + this.audioEncoding = create(AudioEncodingSchema, audioEncoding); + } this.dtx = dtx ?? false; this.simulcast = simulcast ?? false; this.source = source ?? TrackSource.SOURCE_UNKNOWN; diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 676086bf..93b06078 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -19,6 +19,7 @@ import type { DataPacketKind, DisconnectReason, DisconnectResponse, + RoomOptions as FfiRoomOptions, IceServer, RoomInfo, } from './proto/room_pb.js'; @@ -54,12 +55,14 @@ export interface RoomOptions { rtcConfig?: RtcConfiguration; } -export const defaultRoomOptions: RoomOptions = { +export const defaultRoomOptions = { autoSubscribe: true, dynacast: false, e2ee: undefined, rtcConfig: undefined, -}; + adaptiveStream: false, + joinRetries: 1, +} satisfies Omit; export class Room extends (EventEmitter as new () => TypedEmitter) { private info?: RoomInfo; @@ -115,19 +118,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter const req = create(ConnectRequestSchema, { url: url, token: token, - options: { - autoSubscribe: options.autoSubscribe, - dynacast: options.dynacast, - e2ee: { - encryptionType: options.e2ee?.encryptionType, - keyProviderOptions: { - failureTolerance: options.e2ee?.keyProviderOptions?.failureTolerance, - ratchetSalt: options.e2ee?.keyProviderOptions?.ratchetSalt, - ratchetWindowSize: options.e2ee?.keyProviderOptions?.ratchetWindowSize, - sharedKey: options.e2ee?.keyProviderOptions?.sharedKey, - }, - }, - }, + options, }); const res = FfiClient.instance.request({ @@ -148,7 +139,9 @@ export class Room extends (EventEmitter as new () => TypedEmitter const { room, localParticipant, participants } = cb.message.value; this.ffiHandle = new FfiHandle(room!.handle!.id); - this.e2eeManager = new E2EEManager(this.ffiHandle.handle, options.e2ee); + if (options.e2ee) { + this.e2eeManager = new E2EEManager(this.ffiHandle.handle, options.e2ee); + } this.info = room!.info; this.connectionState = ConnectionState.CONN_CONNECTED; @@ -321,7 +314,10 @@ export class Room extends (EventEmitter as new () => TypedEmitter this.emit(RoomEvent.ParticipantAttributesChanged, changedAttributes, participant); } } else if (ev.case == 'connectionQualityChanged') { - const participant = this.requireRemoteParticipant(ev.value.participantIdentity); + const participant = + this.localParticipant.identity === ev.value.participantIdentity + ? this.localParticipant + : this.requireRemoteParticipant(ev.value.participantIdentity); this.emit(RoomEvent.ConnectionQualityChanged, ev.value.quality, participant); } else if (ev.case == 'chatMessage') { const participant = this.retrieveParticipantByIdentity(ev.value.participantIdentity); From c26fb11eff4fe48062927a5fa10315f9023a3405 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 23 Oct 2024 08:43:54 +0200 Subject: [PATCH 110/126] fix remaining issues --- packages/livekit-rtc/src/room.ts | 36 +++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/packages/livekit-rtc/src/room.ts b/packages/livekit-rtc/src/room.ts index 93b06078..e5b2b138 100644 --- a/packages/livekit-rtc/src/room.ts +++ b/packages/livekit-rtc/src/room.ts @@ -259,7 +259,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter const participant = this.requireRemoteParticipant(ev.value.participantIdentity); this.emit(RoomEvent.TrackSubscriptionFailed, ev.value.trackSid, participant, ev.value.error); } else if (ev.case == 'trackMuted') { - const { participant, publication } = this.requirePublicationOfRemoteParticipant( + const { participant, publication } = this.requirePublicationOfParticipant( ev.value.participantIdentity, ev.value.trackSid, ); @@ -269,7 +269,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter } this.emit(RoomEvent.TrackMuted, publication, participant); } else if (ev.case == 'trackUnmuted') { - const { participant, publication } = this.requirePublicationOfRemoteParticipant( + const { participant, publication } = this.requirePublicationOfParticipant( ev.value.participantIdentity, ev.value.trackSid, ); @@ -280,22 +280,22 @@ export class Room extends (EventEmitter as new () => TypedEmitter this.emit(RoomEvent.TrackUnmuted, publication, participant); } else if (ev.case == 'activeSpeakersChanged') { const activeSpeakers = ev.value.participantIdentities.map((identity) => - this.requireRemoteParticipant(identity), + this.requireParticipantByIdentity(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.requireRemoteParticipant(ev.value.participantIdentity); + const participant = this.requireParticipantByIdentity(ev.value.participantIdentity); participant.info.metadata = ev.value.metadata; this.emit(RoomEvent.ParticipantMetadataChanged, participant.metadata, participant); } else if (ev.case == 'participantNameChanged') { - const participant = this.requireRemoteParticipant(ev.value.participantIdentity); + const participant = this.requireParticipantByIdentity(ev.value.participantIdentity); participant.info.name = ev.value.name; this.emit(RoomEvent.ParticipantNameChanged, participant.name, participant); } else if (ev.case == 'participantAttributesChanged') { - const participant = this.requireRemoteParticipant(ev.value.participantIdentity); + const participant = this.requireParticipantByIdentity(ev.value.participantIdentity); participant.info.attributes = ev.value.attributes.reduce( (acc, value) => { acc[value.key] = value.value; @@ -314,10 +314,7 @@ export class Room extends (EventEmitter as new () => TypedEmitter this.emit(RoomEvent.ParticipantAttributesChanged, changedAttributes, participant); } } else if (ev.case == 'connectionQualityChanged') { - const participant = - this.localParticipant.identity === ev.value.participantIdentity - ? this.localParticipant - : this.requireRemoteParticipant(ev.value.participantIdentity); + const participant = this.requireParticipantByIdentity(ev.value.participantIdentity); this.emit(RoomEvent.ConnectionQualityChanged, ev.value.quality, participant); } else if (ev.case == 'chatMessage') { const participant = this.retrieveParticipantByIdentity(ev.value.participantIdentity); @@ -383,6 +380,16 @@ export class Room extends (EventEmitter as new () => TypedEmitter } } + private requireParticipantByIdentity(identity: string): Participant { + if (this.localParticipant?.identity === identity) { + return this.localParticipant; + } else if (this.remoteParticipants.has(identity)) { + return this.remoteParticipants.get(identity)!; + } else { + throw new TypeError(`participant ${identity} not found`); + } + } + private requireRemoteParticipant(identity: string) { const participant = this.remoteParticipants.get(identity); if (!participant) { @@ -391,6 +398,15 @@ export class Room extends (EventEmitter as new () => TypedEmitter return participant; } + private requirePublicationOfParticipant(identity: string, trackSid: string) { + const participant = this.requireParticipantByIdentity(identity); + const publication = participant.trackPublications.get(trackSid); + if (!publication) { + throw new TypeError(`publication ${trackSid} not found`); + } + return { participant, publication }; + } + private requirePublicationOfRemoteParticipant(identity: string, trackSid: string) { const participant = this.requireRemoteParticipant(identity); const publication = participant.trackPublications.get(trackSid); From 2778e7997852cbca50ca2f56b1e0916fc9f0cd68 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 12:12:52 -0700 Subject: [PATCH 111/126] restore --- examples/rpc/index.ts | 198 ++++++++++++++++++++++++++++++++---------- 1 file changed, 154 insertions(+), 44 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 06b48b0b..c8263fd7 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,4 +1,5 @@ -import { Room } from '@livekit/rtc-node'; +import { Room, RpcError } from '@livekit/rtc-node'; +import type { RemoteParticipant } from '@livekit/rtc-node'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; import { AccessToken } from 'livekit-server-sdk'; @@ -12,65 +13,174 @@ if (!LIVEKIT_API_KEY || !LIVEKIT_API_SECRET || !LIVEKIT_URL) { } async function main() { - const roomName = `data-test-${randomBytes(4).toString('hex')}`; + const roomName = `rpc-test-${randomBytes(4).toString('hex')}`; console.log(`Connecting participants to room: ${roomName}`); - const [senderRoom, receiverRoom] = await Promise.all([ - connectParticipant('sender', roomName), - connectParticipant('receiver', roomName), + const [callersRoom, greetersRoom, mathGeniusRoom] = await Promise.all([ + connectParticipant('caller', roomName), + connectParticipant('greeter', roomName), + connectParticipant('math-genius', roomName), ]); - // Generate 256KB of random data in 32KB chunks - const totalSize = 256 * 1024; - const chunkSize = 32 * 1024; - const numChunks = totalSize / chunkSize; - const data = new Uint8Array(totalSize); + // Register all methods for the receiving participant + await registerReceiverMethods(greetersRoom, mathGeniusRoom); - for (let i = 0; i < numChunks; i++) { - const chunk = new Uint8Array(chunkSize); - crypto.getRandomValues(chunk); - data.set(chunk, i * chunkSize); + try { + console.log('\n\nRunning greeting example...'); + await Promise.all([performGreeting(callersRoom)]); + } catch (error) { + console.error('Error:', error); } - // Set up receiver to log received data - let totalReceivedBytes = 0; - const dataReceivedPromise = new Promise((resolve) => { - receiverRoom.on('dataReceived', (payload: Uint8Array, topic?: string) => { - totalReceivedBytes += payload.byteLength; - console.log(`[Receiver] Received data:`); - console.log(` Size: ${payload.byteLength} bytes`); - console.log(` Total received: ${totalReceivedBytes} bytes`); - console.log(` First 10 bytes: ${Array.from(payload.slice(0, 10)).map(b => b.toString(16).padStart(2, '0')).join(' ')}`); - console.log(` Last 10 bytes: ${Array.from(payload.slice(-10)).map(b => b.toString(16).padStart(2, '0')).join(' ')}`); - if (topic) { - console.log(` Topic: ${topic}`); - } - if (totalReceivedBytes >= totalSize) { - resolve(); - } - }); - }); - - // Send data - console.log('[Sender] Sending 256KB of data...'); - await senderRoom.localParticipant.publishData(data, { reliable: true }); - console.log('[Sender] Data sent'); + try { + console.log('\n\nRunning error handling example...'); + await Promise.all([performDivision(callersRoom)]); + } catch (error) { + console.error('Error:', error); + } - // Wait for all data to be received - console.log('Waiting for all data to be received...'); - await dataReceivedPromise; - console.log('All data received.'); + try { + console.log('\n\nRunning math example...'); + await Promise.all([ + performSquareRoot(callersRoom) + .then(() => new Promise((resolve) => setTimeout(resolve, 2000))) + .then(() => performQuantumHypergeometricSeries(callersRoom)), + ]); + } catch (error) { + console.error('Error:', error); + } - console.log('\nDisconnecting participants...'); - await senderRoom.disconnect(); - await receiverRoom.disconnect(); + console.log('\n\nParticipants done, disconnecting...'); + await callersRoom.disconnect(); + await greetersRoom.disconnect(); + await mathGeniusRoom.disconnect(); console.log('Participants disconnected. Example completed.'); process.exit(0); } +const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room): Promise => { + await greetersRoom.localParticipant?.registerRpcMethod( + 'arrival', + // eslint-disable-next-line @typescript-eslint/no-unused-vars + async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + console.log(`[Greeter] Oh ${caller.identity} arrived and said "${payload}"`); + await new Promise((resolve) => setTimeout(resolve, 2000)); + return "Welcome and have a wonderful day!"; + }, + ); + + await mathGeniusRoom.localParticipant?.registerRpcMethod( + 'square-root', + async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + const jsonData = JSON.parse(payload); + const number = jsonData.number; + console.log( + `[Math Genius] I guess ${caller.identity} wants the square root of ${number}. I've only got ${responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, + ); + + console.log(`[Math Genius] *doing math*…`); + await new Promise((resolve) => setTimeout(resolve, 2000)); + + const result = Math.sqrt(number); + console.log(`[Math Genius] Aha! It's ${result}`); + return JSON.stringify({ result }); + }, + ); + + await mathGeniusRoom.localParticipant?.registerRpcMethod( + 'divide', + // eslint-disable-next-line @typescript-eslint/no-unused-vars + async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + const jsonData = JSON.parse(payload); + const { numerator, denominator } = jsonData; + console.log( + `[Math Genius] ${caller.identity} wants to divide ${numerator} by ${denominator}. This could be interesting...`, + ); + + if (denominator === 0) { + console.log(`[Math Genius] Uh oh, divide by zero! This won't end well...`); + throw new Error('Cannot divide by zero'); + } + + const result = numerator / denominator; + console.log(`[Math Genius] The result is ${result}`); + return JSON.stringify({ result }); + }, + ); +}; + +const performGreeting = async (room: Room): Promise => { + console.log('[Caller] Letting the greeter know that I\'ve arrived'); + try { + const response = await room.localParticipant!.performRpc('greeter', 'arrival', 'Hello'); + console.log(`[Caller] That's nice, the greeter said: "${response}"`); + } catch (error) { + console.error('[Caller] RPC call failed:', error); + throw error; + } +}; + +const performSquareRoot = async (room: Room): Promise => { + console.log("[Caller] What's the square root of 16?"); + try { + const response = await room.localParticipant!.performRpc('math-genius', 'square-root', JSON.stringify({ number: 16 })); + const parsedResponse = JSON.parse(response); + console.log(`[Caller] Nice, the answer was ${parsedResponse.result}`); + } catch (error) { + console.error('[Caller] RPC call failed:', error); + throw error; + } +}; + +const performQuantumHypergeometricSeries = async (room: Room): Promise => { + console.log("[Caller] What's the quantum hypergeometric series of 42?"); + try { + const response = await room.localParticipant!.performRpc( + 'math-genius', + 'quantum-hypergeometric-series', + JSON.stringify({ number: 42 }) + ); + const parsedResponse = JSON.parse(response); + console.log(`[Caller] genius says ${parsedResponse.result}!`); + } catch (error) { + if (error instanceof RpcError) { + if (error.code === RpcError.ErrorCode.UNSUPPORTED_METHOD) { + console.log(`[Caller] Aww looks like the genius doesn't know that one.`); + return; + } + } + + console.error('[Caller] Unexpected error:', error); + throw error; + } +}; + +const performDivision = async (room: Room): Promise => { + console.log("[Caller] Let's try dividing 10 by 0"); + try { + const response = await room.localParticipant!.performRpc( + 'math-genius', + 'divide', + JSON.stringify({ numerator: 10, denominator: 0 }) + ); + const parsedResponse = JSON.parse(response); + console.log(`[Caller] The result is ${parsedResponse.result}`); + } catch (error) { + if (error instanceof RpcError) { + if (error.code === RpcError.ErrorCode.APPLICATION_ERROR) { + console.log(`[Caller] Oops! I guess that didn't work. Let's try something else.`); + } else { + console.error('[Caller] Unexpected RPC error:', error); + } + } else { + console.error('[Caller] Unexpected error:', error); + } + } +}; + const createToken = (identity: string, roomName: string) => { const token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET, { identity, From 522a7d7eb5a9981419976bf9787c75cb0e18fa39 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 12:31:48 -0700 Subject: [PATCH 112/126] fix --- examples/rpc/index.ts | 15 ++++++++------- packages/livekit-rtc/rust-sdks | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index c8263fd7..304d32c8 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -1,5 +1,4 @@ import { Room, RpcError } from '@livekit/rtc-node'; -import type { RemoteParticipant } from '@livekit/rtc-node'; import { randomBytes } from 'crypto'; import { config } from 'dotenv'; import { AccessToken } from 'livekit-server-sdk'; @@ -65,8 +64,8 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await greetersRoom.localParticipant?.registerRpcMethod( 'arrival', // eslint-disable-next-line @typescript-eslint/no-unused-vars - async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { - console.log(`[Greeter] Oh ${caller.identity} arrived and said "${payload}"`); + async (requestId: string, callerIdentity: string, payload: string, responseTimeoutMs: number) => { + console.log(`[Greeter] Oh ${callerIdentity} arrived and said "${payload}"`); await new Promise((resolve) => setTimeout(resolve, 2000)); return "Welcome and have a wonderful day!"; }, @@ -74,11 +73,11 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await mathGeniusRoom.localParticipant?.registerRpcMethod( 'square-root', - async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + async (requestId: string, callerIdentity: string, payload: string, responseTimeoutMs: number) => { const jsonData = JSON.parse(payload); const number = jsonData.number; console.log( - `[Math Genius] I guess ${caller.identity} wants the square root of ${number}. I've only got ${responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, + `[Math Genius] I guess ${callerIdentity} wants the square root of ${number}. I've only got ${responseTimeoutMs / 1000} seconds to respond but I think I can pull it off.`, ); console.log(`[Math Genius] *doing math*…`); @@ -93,11 +92,11 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await mathGeniusRoom.localParticipant?.registerRpcMethod( 'divide', // eslint-disable-next-line @typescript-eslint/no-unused-vars - async (requestId: string, caller: RemoteParticipant, payload: string, responseTimeoutMs: number) => { + async (requestId: string, callerIdentity: string, payload: string, responseTimeoutMs: number) => { const jsonData = JSON.parse(payload); const { numerator, denominator } = jsonData; console.log( - `[Math Genius] ${caller.identity} wants to divide ${numerator} by ${denominator}. This could be interesting...`, + `[Math Genius] ${callerIdentity} wants to divide ${numerator} by ${denominator}. This could be interesting...`, ); if (denominator === 0) { @@ -221,6 +220,8 @@ const connectParticipant = async (identity: string, roomName: string): Promise Date: Wed, 23 Oct 2024 12:33:40 -0700 Subject: [PATCH 113/126] fmt --- packages/livekit-rtc/src/participant.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index e5fd2ded..f3d09e1b 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -41,17 +41,17 @@ import { import { TranscriptionSegmentSchema } from './proto/room_pb.js'; import type { PerformRpcCallback, + PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodCallback, + RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationResponseCallback, + RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, - UnregisterRpcMethodResponse, - PerformRpcRequest, - RegisterRpcMethodRequest, - RpcMethodInvocationResponseRequest, UnregisterRpcMethodRequest, + UnregisterRpcMethodResponse, } from './proto/rpc_pb.js'; import { RpcError } from './rpc.js'; import type { LocalTrack } from './track.js'; From 912c065130b353e376936102374b732eef7571a9 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 13:40:26 -0700 Subject: [PATCH 114/126] remove callbacks --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 20 +++--------- packages/livekit-rtc/src/proto/ffi_pb.ts | 20 +++--------- packages/livekit-rtc/src/proto/rpc_pb.ts | 40 ++---------------------- 4 files changed, 13 insertions(+), 69 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 865cdcf1..c139217f 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 865cdcf1ab21ccc6da20abd63bfd58ac1242cff1 +Subproject commit c139217fb8395b0012a402e8ce9e5278a6b0688d diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index f3d09e1b..d145b906 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -43,13 +43,11 @@ import type { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, - RegisterRpcMethodCallback, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, - UnregisterRpcMethodCallback, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse, } from './proto/rpc_pb.js'; @@ -445,7 +443,7 @@ export class LocalParticipant extends Participant { * and they will be received on the caller's side with the message intact. * Other errors thrown in your handler will not be transmitted as-is, and will instead arrive to the caller as `1500` ("Application Error"). */ - async registerRpcMethod( + registerRpcMethod( method: string, handler: ( requestId: string, @@ -453,7 +451,7 @@ export class LocalParticipant extends Participant { payload: string, responseTimeoutMs: number, ) => Promise, - ): Promise { + ) { this.rpcHandlers.set(method, handler); const req = { @@ -461,13 +459,9 @@ export class LocalParticipant extends Participant { method, } as RegisterRpcMethodRequest; - const res = FfiClient.instance.request({ + FfiClient.instance.request({ message: { case: 'registerRpcMethod', value: req }, }); - - await FfiClient.instance.waitFor((ev) => { - return ev.message.case === 'registerRpcMethod' && ev.message.value.asyncId === res.asyncId; - }); } /** @@ -475,7 +469,7 @@ export class LocalParticipant extends Participant { * * @param method - The name of the RPC method to unregister */ - async unregisterRpcMethod(method: string): Promise { + unregisterRpcMethod(method: string) { this.rpcHandlers.delete(method); const req = { @@ -483,13 +477,9 @@ export class LocalParticipant extends Participant { method, } as UnregisterRpcMethodRequest; - const res = FfiClient.instance.request({ + FfiClient.instance.request({ message: { case: 'unregisterRpcMethod', value: req }, }); - - await FfiClient.instance.waitFor((ev) => { - return ev.message.case === 'unregisterRpcMethod' && ev.message.value.asyncId === res.asyncId; - }); } /** @internal */ diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index e1bdeafc..e001c471 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -28,7 +28,7 @@ import type { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourc import { file_video_frame } from "./video_frame_pb"; import type { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb"; import { file_audio_frame } from "./audio_frame_pb"; -import type { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodCallback, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodCallback, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb"; +import type { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb"; import { file_rpc } from "./rpc_pb"; import type { Message } from "@bufbuild/protobuf"; @@ -36,7 +36,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file ffi.proto. */ export const file_ffi: GenFile = /*@__PURE__*/ - fileDesc("CglmZmkucHJvdG8SDWxpdmVraXQucHJvdG8iphUKCkZmaVJlcXVlc3QSMAoHZGlzcG9zZRgCIAEoCzIdLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlcXVlc3RIABIwCgdjb25uZWN0GAMgASgLMh0ubGl2ZWtpdC5wcm90by5Db25uZWN0UmVxdWVzdEgAEjYKCmRpc2Nvbm5lY3QYBCABKAsyIC5saXZla2l0LnByb3RvLkRpc2Nvbm5lY3RSZXF1ZXN0SAASOwoNcHVibGlzaF90cmFjaxgFIAEoCzIiLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVxdWVzdEgAEj8KD3VucHVibGlzaF90cmFjaxgGIAEoCzIkLmxpdmVraXQucHJvdG8uVW5wdWJsaXNoVHJhY2tSZXF1ZXN0SAASOQoMcHVibGlzaF9kYXRhGAcgASgLMiEubGl2ZWtpdC5wcm90by5QdWJsaXNoRGF0YVJlcXVlc3RIABI9Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlcXVlc3RIABJEChJzZXRfbG9jYWxfbWV0YWRhdGEYCSABKAsyJi5saXZla2l0LnByb3RvLlNldExvY2FsTWV0YWRhdGFSZXF1ZXN0SAASPAoOc2V0X2xvY2FsX25hbWUYCiABKAsyIi5saXZla2l0LnByb3RvLlNldExvY2FsTmFtZVJlcXVlc3RIABJIChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIoLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVxdWVzdEgAEkIKEWdldF9zZXNzaW9uX3N0YXRzGAwgASgLMiUubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNSZXF1ZXN0SAASSwoVcHVibGlzaF90cmFuc2NyaXB0aW9uGA0gASgLMioubGl2ZWtpdC5wcm90by5QdWJsaXNoVHJhbnNjcmlwdGlvblJlcXVlc3RIABJAChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiQubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlcXVlc3RIABJEChJjcmVhdGVfdmlkZW9fdHJhY2sYDyABKAsyJi5saXZla2l0LnByb3RvLkNyZWF0ZVZpZGVvVHJhY2tSZXF1ZXN0SAASRAoSY3JlYXRlX2F1ZGlvX3RyYWNrGBAgASgLMiYubGl2ZWtpdC5wcm90by5DcmVhdGVBdWRpb1RyYWNrUmVxdWVzdEgAEkAKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJC5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVxdWVzdEgAEkYKE2VuYWJsZV9yZW1vdGVfdHJhY2sYEiABKAsyJy5saXZla2l0LnByb3RvLkVuYWJsZVJlbW90ZVRyYWNrUmVxdWVzdEgAEjMKCWdldF9zdGF0cxgTIAEoCzIeLmxpdmVraXQucHJvdG8uR2V0U3RhdHNSZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3NvdXJjZRgVIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9Tb3VyY2VSZXF1ZXN0SAASRgoTY2FwdHVyZV92aWRlb19mcmFtZRgWIAEoCzInLmxpdmVraXQucHJvdG8uQ2FwdHVyZVZpZGVvRnJhbWVSZXF1ZXN0SAASOwoNdmlkZW9fY29udmVydBgXIAEoCzIiLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVxdWVzdEgAElkKHXZpZGVvX3N0cmVhbV9mcm9tX3BhcnRpY2lwYW50GBggASgLMjAubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlcXVlc3RIABJAChBuZXdfYXVkaW9fc3RyZWFtGBkgASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1N0cmVhbVJlcXVlc3RIABJAChBuZXdfYXVkaW9fc291cmNlGBogASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlcXVlc3RIABJGChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGBsgASgLMicubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZVJlcXVlc3RIABJEChJjbGVhcl9hdWRpb19idWZmZXIYHCABKAsyJi5saXZla2l0LnByb3RvLkNsZWFyQXVkaW9CdWZmZXJSZXF1ZXN0SAASRgoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzInLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXF1ZXN0SAASRAoScmVtaXhfYW5kX3Jlc2FtcGxlGB4gASgLMiYubGl2ZWtpdC5wcm90by5SZW1peEFuZFJlc2FtcGxlUmVxdWVzdEgAEioKBGUyZWUYHyABKAsyGi5saXZla2l0LnByb3RvLkUyZWVSZXF1ZXN0SAASWQodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYICABKAsyMC5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVxdWVzdEgAEkIKEW5ld19zb3hfcmVzYW1wbGVyGCEgASgLMiUubGl2ZWtpdC5wcm90by5OZXdTb3hSZXNhbXBsZXJSZXF1ZXN0SAASRAoScHVzaF9zb3hfcmVzYW1wbGVyGCIgASgLMiYubGl2ZWtpdC5wcm90by5QdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkYKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyJy5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkIKEXNlbmRfY2hhdF9tZXNzYWdlGCQgASgLMiUubGl2ZWtpdC5wcm90by5TZW5kQ2hhdE1lc3NhZ2VSZXF1ZXN0SAASQgoRZWRpdF9jaGF0X21lc3NhZ2UYJSABKAsyJS5saXZla2l0LnByb3RvLkVkaXRDaGF0TWVzc2FnZVJlcXVlc3RIABI3CgtwZXJmb3JtX3JwYxgmIAEoCzIgLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1JlcXVlc3RIABJGChNyZWdpc3Rlcl9ycGNfbWV0aG9kGCcgASgLMicubGl2ZWtpdC5wcm90by5SZWdpc3RlclJwY01ldGhvZFJlcXVlc3RIABJKChV1bnJlZ2lzdGVyX3JwY19tZXRob2QYKCABKAsyKS5saXZla2l0LnByb3RvLlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0SAASWwoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCkgASgLMjEubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXF1ZXN0SABCCQoHbWVzc2FnZSKKFQoLRmZpUmVzcG9uc2USMQoHZGlzcG9zZRgCIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlc3BvbnNlSAASMQoHY29ubmVjdBgDIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdFJlc3BvbnNlSAASNwoKZGlzY29ubmVjdBgEIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdFJlc3BvbnNlSAASPAoNcHVibGlzaF90cmFjaxgFIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVzcG9uc2VIABJACg91bnB1Ymxpc2hfdHJhY2sYBiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrUmVzcG9uc2VIABI6CgxwdWJsaXNoX2RhdGEYByABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhUmVzcG9uc2VIABI+Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIkLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlc3BvbnNlSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGAkgASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhUmVzcG9uc2VIABI9Cg5zZXRfbG9jYWxfbmFtZRgKIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lUmVzcG9uc2VIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVzcG9uc2VIABJDChFnZXRfc2Vzc2lvbl9zdGF0cxgMIAEoCzImLmxpdmVraXQucHJvdG8uR2V0U2Vzc2lvblN0YXRzUmVzcG9uc2VIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDSABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uUmVzcG9uc2VIABJBChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiUubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlc3BvbnNlSAASRQoSY3JlYXRlX3ZpZGVvX3RyYWNrGA8gASgLMicubGl2ZWtpdC5wcm90by5DcmVhdGVWaWRlb1RyYWNrUmVzcG9uc2VIABJFChJjcmVhdGVfYXVkaW9fdHJhY2sYECABKAsyJy5saXZla2l0LnByb3RvLkNyZWF0ZUF1ZGlvVHJhY2tSZXNwb25zZUgAEkEKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJS5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVzcG9uc2VIABJHChNlbmFibGVfcmVtb3RlX3RyYWNrGBIgASgLMigubGl2ZWtpdC5wcm90by5FbmFibGVSZW1vdGVUcmFja1Jlc3BvbnNlSAASNAoJZ2V0X3N0YXRzGBMgASgLMh8ubGl2ZWtpdC5wcm90by5HZXRTdGF0c1Jlc3BvbnNlSAASQQoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIlLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXNwb25zZUgAEkEKEG5ld192aWRlb19zb3VyY2UYFSABKAsyJS5saXZla2l0LnByb3RvLk5ld1ZpZGVvU291cmNlUmVzcG9uc2VIABJHChNjYXB0dXJlX3ZpZGVvX2ZyYW1lGBYgASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlVmlkZW9GcmFtZVJlc3BvbnNlSAASPAoNdmlkZW9fY29udmVydBgXIAEoCzIjLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVzcG9uc2VIABJaCh12aWRlb19zdHJlYW1fZnJvbV9wYXJ0aWNpcGFudBgYIAEoCzIxLmxpdmVraXQucHJvdG8uVmlkZW9TdHJlYW1Gcm9tUGFydGljaXBhbnRSZXNwb25zZUgAEkEKEG5ld19hdWRpb19zdHJlYW0YGSABKAsyJS5saXZla2l0LnByb3RvLk5ld0F1ZGlvU3RyZWFtUmVzcG9uc2VIABJBChBuZXdfYXVkaW9fc291cmNlGBogASgLMiUubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlc3BvbnNlSAASRwoTY2FwdHVyZV9hdWRpb19mcmFtZRgbIAEoCzIoLmxpdmVraXQucHJvdG8uQ2FwdHVyZUF1ZGlvRnJhbWVSZXNwb25zZUgAEkUKEmNsZWFyX2F1ZGlvX2J1ZmZlchgcIAEoCzInLmxpdmVraXQucHJvdG8uQ2xlYXJBdWRpb0J1ZmZlclJlc3BvbnNlSAASRwoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzIoLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXNwb25zZUgAEkUKEnJlbWl4X2FuZF9yZXNhbXBsZRgeIAEoCzInLmxpdmVraXQucHJvdG8uUmVtaXhBbmRSZXNhbXBsZVJlc3BvbnNlSAASWgodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYHyABKAsyMS5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVzcG9uc2VIABIrCgRlMmVlGCAgASgLMhsubGl2ZWtpdC5wcm90by5FMmVlUmVzcG9uc2VIABJDChFuZXdfc294X3Jlc2FtcGxlchghIAEoCzImLmxpdmVraXQucHJvdG8uTmV3U294UmVzYW1wbGVyUmVzcG9uc2VIABJFChJwdXNoX3NveF9yZXNhbXBsZXIYIiABKAsyJy5saXZla2l0LnByb3RvLlB1c2hTb3hSZXNhbXBsZXJSZXNwb25zZUgAEkcKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyKC5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVzcG9uc2VIABJDChFzZW5kX2NoYXRfbWVzc2FnZRgkIAEoCzImLmxpdmVraXQucHJvdG8uU2VuZENoYXRNZXNzYWdlUmVzcG9uc2VIABI4CgtwZXJmb3JtX3JwYxglIAEoCzIhLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1Jlc3BvbnNlSAASRwoTcmVnaXN0ZXJfcnBjX21ldGhvZBgmIAEoCzIoLmxpdmVraXQucHJvdG8uUmVnaXN0ZXJScGNNZXRob2RSZXNwb25zZUgAEksKFXVucmVnaXN0ZXJfcnBjX21ldGhvZBgnIAEoCzIqLmxpdmVraXQucHJvdG8uVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlSAASXAoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCggASgLMjIubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXNwb25zZUgAQgkKB21lc3NhZ2Ui/gwKCEZmaUV2ZW50Ei4KCnJvb21fZXZlbnQYASABKAsyGC5saXZla2l0LnByb3RvLlJvb21FdmVudEgAEjAKC3RyYWNrX2V2ZW50GAIgASgLMhkubGl2ZWtpdC5wcm90by5UcmFja0V2ZW50SAASPQoSdmlkZW9fc3RyZWFtX2V2ZW50GAMgASgLMh8ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUV2ZW50SAASPQoSYXVkaW9fc3RyZWFtX2V2ZW50GAQgASgLMh8ubGl2ZWtpdC5wcm90by5BdWRpb1N0cmVhbUV2ZW50SAASMQoHY29ubmVjdBgFIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdENhbGxiYWNrSAASNwoKZGlzY29ubmVjdBgHIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdENhbGxiYWNrSAASMQoHZGlzcG9zZRgIIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZUNhbGxiYWNrSAASPAoNcHVibGlzaF90cmFjaxgJIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrQ2FsbGJhY2tIABJACg91bnB1Ymxpc2hfdHJhY2sYCiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrQ2FsbGJhY2tIABI6CgxwdWJsaXNoX2RhdGEYCyABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhQ2FsbGJhY2tIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDCABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uQ2FsbGJhY2tIABJHChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGA0gASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZUNhbGxiYWNrSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGA4gASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhQ2FsbGJhY2tIABI9Cg5zZXRfbG9jYWxfbmFtZRgPIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lQ2FsbGJhY2tIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgQIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzQ2FsbGJhY2tIABI0CglnZXRfc3RhdHMYESABKAsyHy5saXZla2l0LnByb3RvLkdldFN0YXRzQ2FsbGJhY2tIABInCgRsb2dzGBIgASgLMhcubGl2ZWtpdC5wcm90by5Mb2dCYXRjaEgAEkMKEWdldF9zZXNzaW9uX3N0YXRzGBMgASgLMiYubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNDYWxsYmFja0gAEiUKBXBhbmljGBQgASgLMhQubGl2ZWtpdC5wcm90by5QYW5pY0gAEkEKEHB1Ymxpc2hfc2lwX2R0bWYYFSABKAsyJS5saXZla2l0LnByb3RvLlB1Ymxpc2hTaXBEdG1mQ2FsbGJhY2tIABI+CgxjaGF0X21lc3NhZ2UYFiABKAsyJi5saXZla2l0LnByb3RvLlNlbmRDaGF0TWVzc2FnZUNhbGxiYWNrSAASOAoLcGVyZm9ybV9ycGMYFyABKAsyIS5saXZla2l0LnByb3RvLlBlcmZvcm1ScGNDYWxsYmFja0gAEkcKE3JlZ2lzdGVyX3JwY19tZXRob2QYGCABKAsyKC5saXZla2l0LnByb3RvLlJlZ2lzdGVyUnBjTWV0aG9kQ2FsbGJhY2tIABJLChV1bnJlZ2lzdGVyX3JwY19tZXRob2QYGSABKAsyKi5saXZla2l0LnByb3RvLlVucmVnaXN0ZXJScGNNZXRob2RDYWxsYmFja0gAEkgKFXJwY19tZXRob2RfaW52b2NhdGlvbhgaIAEoCzInLmxpdmVraXQucHJvdG8uUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50SAASXAoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGBsgASgLMjIubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VDYWxsYmFja0gAQgkKB21lc3NhZ2UiHwoORGlzcG9zZVJlcXVlc3QSDQoFYXN5bmMYASACKAgiIwoPRGlzcG9zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgASgEIiMKD0Rpc3Bvc2VDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBCKFAQoJTG9nUmVjb3JkEiYKBWxldmVsGAEgAigOMhcubGl2ZWtpdC5wcm90by5Mb2dMZXZlbBIOCgZ0YXJnZXQYAiACKAkSEwoLbW9kdWxlX3BhdGgYAyABKAkSDAoEZmlsZRgEIAEoCRIMCgRsaW5lGAUgASgNEg8KB21lc3NhZ2UYBiACKAkiNQoITG9nQmF0Y2gSKQoHcmVjb3JkcxgBIAMoCzIYLmxpdmVraXQucHJvdG8uTG9nUmVjb3JkIhgKBVBhbmljEg8KB21lc3NhZ2UYASACKAkqUwoITG9nTGV2ZWwSDQoJTE9HX0VSUk9SEAASDAoITE9HX1dBUk4QARIMCghMT0dfSU5GTxACEg0KCUxPR19ERUJVRxADEg0KCUxPR19UUkFDRRAEQhCqAg1MaXZlS2l0LlByb3Rv", [file_e2ee, file_track, file_room, file_video_frame, file_audio_frame, file_rpc]); + fileDesc("CglmZmkucHJvdG8SDWxpdmVraXQucHJvdG8iphUKCkZmaVJlcXVlc3QSMAoHZGlzcG9zZRgCIAEoCzIdLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlcXVlc3RIABIwCgdjb25uZWN0GAMgASgLMh0ubGl2ZWtpdC5wcm90by5Db25uZWN0UmVxdWVzdEgAEjYKCmRpc2Nvbm5lY3QYBCABKAsyIC5saXZla2l0LnByb3RvLkRpc2Nvbm5lY3RSZXF1ZXN0SAASOwoNcHVibGlzaF90cmFjaxgFIAEoCzIiLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVxdWVzdEgAEj8KD3VucHVibGlzaF90cmFjaxgGIAEoCzIkLmxpdmVraXQucHJvdG8uVW5wdWJsaXNoVHJhY2tSZXF1ZXN0SAASOQoMcHVibGlzaF9kYXRhGAcgASgLMiEubGl2ZWtpdC5wcm90by5QdWJsaXNoRGF0YVJlcXVlc3RIABI9Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlcXVlc3RIABJEChJzZXRfbG9jYWxfbWV0YWRhdGEYCSABKAsyJi5saXZla2l0LnByb3RvLlNldExvY2FsTWV0YWRhdGFSZXF1ZXN0SAASPAoOc2V0X2xvY2FsX25hbWUYCiABKAsyIi5saXZla2l0LnByb3RvLlNldExvY2FsTmFtZVJlcXVlc3RIABJIChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIoLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVxdWVzdEgAEkIKEWdldF9zZXNzaW9uX3N0YXRzGAwgASgLMiUubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNSZXF1ZXN0SAASSwoVcHVibGlzaF90cmFuc2NyaXB0aW9uGA0gASgLMioubGl2ZWtpdC5wcm90by5QdWJsaXNoVHJhbnNjcmlwdGlvblJlcXVlc3RIABJAChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiQubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlcXVlc3RIABJEChJjcmVhdGVfdmlkZW9fdHJhY2sYDyABKAsyJi5saXZla2l0LnByb3RvLkNyZWF0ZVZpZGVvVHJhY2tSZXF1ZXN0SAASRAoSY3JlYXRlX2F1ZGlvX3RyYWNrGBAgASgLMiYubGl2ZWtpdC5wcm90by5DcmVhdGVBdWRpb1RyYWNrUmVxdWVzdEgAEkAKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJC5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVxdWVzdEgAEkYKE2VuYWJsZV9yZW1vdGVfdHJhY2sYEiABKAsyJy5saXZla2l0LnByb3RvLkVuYWJsZVJlbW90ZVRyYWNrUmVxdWVzdEgAEjMKCWdldF9zdGF0cxgTIAEoCzIeLmxpdmVraXQucHJvdG8uR2V0U3RhdHNSZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3NvdXJjZRgVIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9Tb3VyY2VSZXF1ZXN0SAASRgoTY2FwdHVyZV92aWRlb19mcmFtZRgWIAEoCzInLmxpdmVraXQucHJvdG8uQ2FwdHVyZVZpZGVvRnJhbWVSZXF1ZXN0SAASOwoNdmlkZW9fY29udmVydBgXIAEoCzIiLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVxdWVzdEgAElkKHXZpZGVvX3N0cmVhbV9mcm9tX3BhcnRpY2lwYW50GBggASgLMjAubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlcXVlc3RIABJAChBuZXdfYXVkaW9fc3RyZWFtGBkgASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1N0cmVhbVJlcXVlc3RIABJAChBuZXdfYXVkaW9fc291cmNlGBogASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlcXVlc3RIABJGChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGBsgASgLMicubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZVJlcXVlc3RIABJEChJjbGVhcl9hdWRpb19idWZmZXIYHCABKAsyJi5saXZla2l0LnByb3RvLkNsZWFyQXVkaW9CdWZmZXJSZXF1ZXN0SAASRgoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzInLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXF1ZXN0SAASRAoScmVtaXhfYW5kX3Jlc2FtcGxlGB4gASgLMiYubGl2ZWtpdC5wcm90by5SZW1peEFuZFJlc2FtcGxlUmVxdWVzdEgAEioKBGUyZWUYHyABKAsyGi5saXZla2l0LnByb3RvLkUyZWVSZXF1ZXN0SAASWQodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYICABKAsyMC5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVxdWVzdEgAEkIKEW5ld19zb3hfcmVzYW1wbGVyGCEgASgLMiUubGl2ZWtpdC5wcm90by5OZXdTb3hSZXNhbXBsZXJSZXF1ZXN0SAASRAoScHVzaF9zb3hfcmVzYW1wbGVyGCIgASgLMiYubGl2ZWtpdC5wcm90by5QdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkYKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyJy5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkIKEXNlbmRfY2hhdF9tZXNzYWdlGCQgASgLMiUubGl2ZWtpdC5wcm90by5TZW5kQ2hhdE1lc3NhZ2VSZXF1ZXN0SAASQgoRZWRpdF9jaGF0X21lc3NhZ2UYJSABKAsyJS5saXZla2l0LnByb3RvLkVkaXRDaGF0TWVzc2FnZVJlcXVlc3RIABI3CgtwZXJmb3JtX3JwYxgmIAEoCzIgLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1JlcXVlc3RIABJGChNyZWdpc3Rlcl9ycGNfbWV0aG9kGCcgASgLMicubGl2ZWtpdC5wcm90by5SZWdpc3RlclJwY01ldGhvZFJlcXVlc3RIABJKChV1bnJlZ2lzdGVyX3JwY19tZXRob2QYKCABKAsyKS5saXZla2l0LnByb3RvLlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0SAASWwoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCkgASgLMjEubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXF1ZXN0SABCCQoHbWVzc2FnZSKKFQoLRmZpUmVzcG9uc2USMQoHZGlzcG9zZRgCIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlc3BvbnNlSAASMQoHY29ubmVjdBgDIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdFJlc3BvbnNlSAASNwoKZGlzY29ubmVjdBgEIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdFJlc3BvbnNlSAASPAoNcHVibGlzaF90cmFjaxgFIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVzcG9uc2VIABJACg91bnB1Ymxpc2hfdHJhY2sYBiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrUmVzcG9uc2VIABI6CgxwdWJsaXNoX2RhdGEYByABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhUmVzcG9uc2VIABI+Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIkLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlc3BvbnNlSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGAkgASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhUmVzcG9uc2VIABI9Cg5zZXRfbG9jYWxfbmFtZRgKIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lUmVzcG9uc2VIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVzcG9uc2VIABJDChFnZXRfc2Vzc2lvbl9zdGF0cxgMIAEoCzImLmxpdmVraXQucHJvdG8uR2V0U2Vzc2lvblN0YXRzUmVzcG9uc2VIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDSABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uUmVzcG9uc2VIABJBChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiUubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlc3BvbnNlSAASRQoSY3JlYXRlX3ZpZGVvX3RyYWNrGA8gASgLMicubGl2ZWtpdC5wcm90by5DcmVhdGVWaWRlb1RyYWNrUmVzcG9uc2VIABJFChJjcmVhdGVfYXVkaW9fdHJhY2sYECABKAsyJy5saXZla2l0LnByb3RvLkNyZWF0ZUF1ZGlvVHJhY2tSZXNwb25zZUgAEkEKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJS5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVzcG9uc2VIABJHChNlbmFibGVfcmVtb3RlX3RyYWNrGBIgASgLMigubGl2ZWtpdC5wcm90by5FbmFibGVSZW1vdGVUcmFja1Jlc3BvbnNlSAASNAoJZ2V0X3N0YXRzGBMgASgLMh8ubGl2ZWtpdC5wcm90by5HZXRTdGF0c1Jlc3BvbnNlSAASQQoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIlLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXNwb25zZUgAEkEKEG5ld192aWRlb19zb3VyY2UYFSABKAsyJS5saXZla2l0LnByb3RvLk5ld1ZpZGVvU291cmNlUmVzcG9uc2VIABJHChNjYXB0dXJlX3ZpZGVvX2ZyYW1lGBYgASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlVmlkZW9GcmFtZVJlc3BvbnNlSAASPAoNdmlkZW9fY29udmVydBgXIAEoCzIjLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVzcG9uc2VIABJaCh12aWRlb19zdHJlYW1fZnJvbV9wYXJ0aWNpcGFudBgYIAEoCzIxLmxpdmVraXQucHJvdG8uVmlkZW9TdHJlYW1Gcm9tUGFydGljaXBhbnRSZXNwb25zZUgAEkEKEG5ld19hdWRpb19zdHJlYW0YGSABKAsyJS5saXZla2l0LnByb3RvLk5ld0F1ZGlvU3RyZWFtUmVzcG9uc2VIABJBChBuZXdfYXVkaW9fc291cmNlGBogASgLMiUubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlc3BvbnNlSAASRwoTY2FwdHVyZV9hdWRpb19mcmFtZRgbIAEoCzIoLmxpdmVraXQucHJvdG8uQ2FwdHVyZUF1ZGlvRnJhbWVSZXNwb25zZUgAEkUKEmNsZWFyX2F1ZGlvX2J1ZmZlchgcIAEoCzInLmxpdmVraXQucHJvdG8uQ2xlYXJBdWRpb0J1ZmZlclJlc3BvbnNlSAASRwoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzIoLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXNwb25zZUgAEkUKEnJlbWl4X2FuZF9yZXNhbXBsZRgeIAEoCzInLmxpdmVraXQucHJvdG8uUmVtaXhBbmRSZXNhbXBsZVJlc3BvbnNlSAASWgodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYHyABKAsyMS5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVzcG9uc2VIABIrCgRlMmVlGCAgASgLMhsubGl2ZWtpdC5wcm90by5FMmVlUmVzcG9uc2VIABJDChFuZXdfc294X3Jlc2FtcGxlchghIAEoCzImLmxpdmVraXQucHJvdG8uTmV3U294UmVzYW1wbGVyUmVzcG9uc2VIABJFChJwdXNoX3NveF9yZXNhbXBsZXIYIiABKAsyJy5saXZla2l0LnByb3RvLlB1c2hTb3hSZXNhbXBsZXJSZXNwb25zZUgAEkcKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyKC5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVzcG9uc2VIABJDChFzZW5kX2NoYXRfbWVzc2FnZRgkIAEoCzImLmxpdmVraXQucHJvdG8uU2VuZENoYXRNZXNzYWdlUmVzcG9uc2VIABI4CgtwZXJmb3JtX3JwYxglIAEoCzIhLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1Jlc3BvbnNlSAASRwoTcmVnaXN0ZXJfcnBjX21ldGhvZBgmIAEoCzIoLmxpdmVraXQucHJvdG8uUmVnaXN0ZXJScGNNZXRob2RSZXNwb25zZUgAEksKFXVucmVnaXN0ZXJfcnBjX21ldGhvZBgnIAEoCzIqLmxpdmVraXQucHJvdG8uVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlSAASXAoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCggASgLMjIubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXNwb25zZUgAQgkKB21lc3NhZ2Ui6AsKCEZmaUV2ZW50Ei4KCnJvb21fZXZlbnQYASABKAsyGC5saXZla2l0LnByb3RvLlJvb21FdmVudEgAEjAKC3RyYWNrX2V2ZW50GAIgASgLMhkubGl2ZWtpdC5wcm90by5UcmFja0V2ZW50SAASPQoSdmlkZW9fc3RyZWFtX2V2ZW50GAMgASgLMh8ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUV2ZW50SAASPQoSYXVkaW9fc3RyZWFtX2V2ZW50GAQgASgLMh8ubGl2ZWtpdC5wcm90by5BdWRpb1N0cmVhbUV2ZW50SAASMQoHY29ubmVjdBgFIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdENhbGxiYWNrSAASNwoKZGlzY29ubmVjdBgHIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdENhbGxiYWNrSAASMQoHZGlzcG9zZRgIIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZUNhbGxiYWNrSAASPAoNcHVibGlzaF90cmFjaxgJIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrQ2FsbGJhY2tIABJACg91bnB1Ymxpc2hfdHJhY2sYCiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrQ2FsbGJhY2tIABI6CgxwdWJsaXNoX2RhdGEYCyABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhQ2FsbGJhY2tIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDCABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uQ2FsbGJhY2tIABJHChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGA0gASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZUNhbGxiYWNrSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGA4gASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhQ2FsbGJhY2tIABI9Cg5zZXRfbG9jYWxfbmFtZRgPIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lQ2FsbGJhY2tIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgQIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzQ2FsbGJhY2tIABI0CglnZXRfc3RhdHMYESABKAsyHy5saXZla2l0LnByb3RvLkdldFN0YXRzQ2FsbGJhY2tIABInCgRsb2dzGBIgASgLMhcubGl2ZWtpdC5wcm90by5Mb2dCYXRjaEgAEkMKEWdldF9zZXNzaW9uX3N0YXRzGBMgASgLMiYubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNDYWxsYmFja0gAEiUKBXBhbmljGBQgASgLMhQubGl2ZWtpdC5wcm90by5QYW5pY0gAEkEKEHB1Ymxpc2hfc2lwX2R0bWYYFSABKAsyJS5saXZla2l0LnByb3RvLlB1Ymxpc2hTaXBEdG1mQ2FsbGJhY2tIABI+CgxjaGF0X21lc3NhZ2UYFiABKAsyJi5saXZla2l0LnByb3RvLlNlbmRDaGF0TWVzc2FnZUNhbGxiYWNrSAASOAoLcGVyZm9ybV9ycGMYFyABKAsyIS5saXZla2l0LnByb3RvLlBlcmZvcm1ScGNDYWxsYmFja0gAEkgKFXJwY19tZXRob2RfaW52b2NhdGlvbhgYIAEoCzInLmxpdmVraXQucHJvdG8uUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50SAASXAoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGBkgASgLMjIubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VDYWxsYmFja0gAQgkKB21lc3NhZ2UiHwoORGlzcG9zZVJlcXVlc3QSDQoFYXN5bmMYASACKAgiIwoPRGlzcG9zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgASgEIiMKD0Rpc3Bvc2VDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBCKFAQoJTG9nUmVjb3JkEiYKBWxldmVsGAEgAigOMhcubGl2ZWtpdC5wcm90by5Mb2dMZXZlbBIOCgZ0YXJnZXQYAiACKAkSEwoLbW9kdWxlX3BhdGgYAyABKAkSDAoEZmlsZRgEIAEoCRIMCgRsaW5lGAUgASgNEg8KB21lc3NhZ2UYBiACKAkiNQoITG9nQmF0Y2gSKQoHcmVjb3JkcxgBIAMoCzIYLmxpdmVraXQucHJvdG8uTG9nUmVjb3JkIhgKBVBhbmljEg8KB21lc3NhZ2UYASACKAkqUwoITG9nTGV2ZWwSDQoJTE9HX0VSUk9SEAASDAoITE9HX1dBUk4QARIMCghMT0dfSU5GTxACEg0KCUxPR19ERUJVRxADEg0KCUxPR19UUkFDRRAEQhCqAg1MaXZlS2l0LlByb3Rv", [file_e2ee, file_track, file_room, file_video_frame, file_audio_frame, file_rpc]); /** * This is the input of livekit_ffi_request function @@ -716,25 +716,13 @@ export type FfiEvent = Message<"livekit.proto.FfiEvent"> & { case: "performRpc"; } | { /** - * @generated from field: livekit.proto.RegisterRpcMethodCallback register_rpc_method = 24; - */ - value: RegisterRpcMethodCallback; - case: "registerRpcMethod"; - } | { - /** - * @generated from field: livekit.proto.UnregisterRpcMethodCallback unregister_rpc_method = 25; - */ - value: UnregisterRpcMethodCallback; - case: "unregisterRpcMethod"; - } | { - /** - * @generated from field: livekit.proto.RpcMethodInvocationEvent rpc_method_invocation = 26; + * @generated from field: livekit.proto.RpcMethodInvocationEvent rpc_method_invocation = 24; */ value: RpcMethodInvocationEvent; case: "rpcMethodInvocation"; } | { /** - * @generated from field: livekit.proto.RpcMethodInvocationResponseCallback rpc_method_invocation_response = 27; + * @generated from field: livekit.proto.RpcMethodInvocationResponseCallback rpc_method_invocation_response = 25; */ value: RpcMethodInvocationResponseCallback; case: "rpcMethodInvocationResponse"; diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index c2e27d92..1156ffcc 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -24,7 +24,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file rpc.proto. */ export const file_rpc: GenFile = /*@__PURE__*/ - fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIkwKGFJlZ2lzdGVyUnBjTWV0aG9kUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSDgoGbWV0aG9kGAIgAigJIk4KGlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIOCgZtZXRob2QYAiACKAkilgEKIlJwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhUKDWludm9jYXRpb25faWQYAiACKAQSDwoHcGF5bG9hZBgDIAEoCRImCgVlcnJvchgEIAEoCzIXLmxpdmVraXQucHJvdG8uUnBjRXJyb3IiJgoSUGVyZm9ybVJwY1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIi0KGVJlZ2lzdGVyUnBjTWV0aG9kUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQiLwobVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIjcKI1JwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIl8KElBlcmZvcm1ScGNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgdwYXlsb2FkGAIgASgJEiYKBWVycm9yGAMgASgLMhcubGl2ZWtpdC5wcm90by5ScGNFcnJvciItChlSZWdpc3RlclJwY01ldGhvZENhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEIi8KG1VucmVnaXN0ZXJScGNNZXRob2RDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBCJGCiNScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBINCgVlcnJvchgCIAEoCSK+AQoYUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIVCg1pbnZvY2F0aW9uX2lkGAIgAigEEg4KBm1ldGhvZBgDIAIoCRISCgpyZXF1ZXN0X2lkGAQgAigJEhcKD2NhbGxlcl9pZGVudGl0eRgFIAIoCRIPCgdwYXlsb2FkGAYgAigJEhsKE3Jlc3BvbnNlX3RpbWVvdXRfbXMYByACKA1CEKoCDUxpdmVLaXQuUHJvdG8"); + fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIkwKGFJlZ2lzdGVyUnBjTWV0aG9kUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSDgoGbWV0aG9kGAIgAigJIk4KGlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIOCgZtZXRob2QYAiACKAkilgEKIlJwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhUKDWludm9jYXRpb25faWQYAiACKAQSDwoHcGF5bG9hZBgDIAEoCRImCgVlcnJvchgEIAEoCzIXLmxpdmVraXQucHJvdG8uUnBjRXJyb3IiJgoSUGVyZm9ybVJwY1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIi0KGVJlZ2lzdGVyUnBjTWV0aG9kUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQiLwobVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIjcKI1JwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIl8KElBlcmZvcm1ScGNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgdwYXlsb2FkGAIgASgJEiYKBWVycm9yGAMgASgLMhcubGl2ZWtpdC5wcm90by5ScGNFcnJvciJGCiNScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBINCgVlcnJvchgCIAEoCSK+AQoYUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIVCg1pbnZvY2F0aW9uX2lkGAIgAigEEg4KBm1ldGhvZBgDIAIoCRISCgpyZXF1ZXN0X2lkGAQgAigJEhcKD2NhbGxlcl9pZGVudGl0eRgFIAIoCRIPCgdwYXlsb2FkGAYgAigJEhsKE3Jlc3BvbnNlX3RpbWVvdXRfbXMYByACKA1CEKoCDUxpdmVLaXQuUHJvdG8"); /** * @generated from message livekit.proto.RpcError @@ -267,40 +267,6 @@ export type PerformRpcCallback = Message<"livekit.proto.PerformRpcCallback"> & { export const PerformRpcCallbackSchema: GenMessage = /*@__PURE__*/ messageDesc(file_rpc, 9); -/** - * @generated from message livekit.proto.RegisterRpcMethodCallback - */ -export type RegisterRpcMethodCallback = Message<"livekit.proto.RegisterRpcMethodCallback"> & { - /** - * @generated from field: required uint64 async_id = 1; - */ - asyncId: bigint; -}; - -/** - * Describes the message livekit.proto.RegisterRpcMethodCallback. - * Use `create(RegisterRpcMethodCallbackSchema)` to create a new message. - */ -export const RegisterRpcMethodCallbackSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_rpc, 10); - -/** - * @generated from message livekit.proto.UnregisterRpcMethodCallback - */ -export type UnregisterRpcMethodCallback = Message<"livekit.proto.UnregisterRpcMethodCallback"> & { - /** - * @generated from field: required uint64 async_id = 1; - */ - asyncId: bigint; -}; - -/** - * Describes the message livekit.proto.UnregisterRpcMethodCallback. - * Use `create(UnregisterRpcMethodCallbackSchema)` to create a new message. - */ -export const UnregisterRpcMethodCallbackSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_rpc, 11); - /** * @generated from message livekit.proto.RpcMethodInvocationResponseCallback */ @@ -321,7 +287,7 @@ export type RpcMethodInvocationResponseCallback = Message<"livekit.proto.RpcMeth * Use `create(RpcMethodInvocationResponseCallbackSchema)` to create a new message. */ export const RpcMethodInvocationResponseCallbackSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_rpc, 12); + messageDesc(file_rpc, 10); /** * FFI Events @@ -370,5 +336,5 @@ export type RpcMethodInvocationEvent = Message<"livekit.proto.RpcMethodInvocatio * Use `create(RpcMethodInvocationEventSchema)` to create a new message. */ export const RpcMethodInvocationEventSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_rpc, 13); + messageDesc(file_rpc, 11); From 4e238994dfc4dac026d8f4a914875403055af8eb Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 13:47:29 -0700 Subject: [PATCH 115/126] more --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/participant.ts | 11 ++------- packages/livekit-rtc/src/proto/ffi_pb.ts | 10 ++------ packages/livekit-rtc/src/proto/rpc_pb.ts | 31 ++++++------------------ 4 files changed, 12 insertions(+), 42 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index c139217f..90a5dc0f 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit c139217fb8395b0012a402e8ce9e5278a6b0688d +Subproject commit 90a5dc0ff4403d321088e34b68a8cbc70a326b14 diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index d145b906..3f552aa2 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -45,7 +45,6 @@ import type { PerformRpcResponse, RegisterRpcMethodRequest, RegisterRpcMethodResponse, - RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodRequest, @@ -525,14 +524,8 @@ export class LocalParticipant extends Participant { message: { case: 'rpcMethodInvocationResponse', value: req }, }); - const cb = await FfiClient.instance.waitFor((ev) => { - return ( - ev.message.case === 'rpcMethodInvocationResponse' && - ev.message.value.asyncId === res.asyncId - ); - }); - if (cb.error) { - console.warn(`error sending rpc method invocation response: ${cb.error}`); + if (res.error) { + console.warn(`error sending rpc method invocation response: ${res.error}`); } } } diff --git a/packages/livekit-rtc/src/proto/ffi_pb.ts b/packages/livekit-rtc/src/proto/ffi_pb.ts index e001c471..80e239cd 100644 --- a/packages/livekit-rtc/src/proto/ffi_pb.ts +++ b/packages/livekit-rtc/src/proto/ffi_pb.ts @@ -28,7 +28,7 @@ import type { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourc import { file_video_frame } from "./video_frame_pb"; import type { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb"; import { file_audio_frame } from "./audio_frame_pb"; -import type { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseCallback, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb"; +import type { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb"; import { file_rpc } from "./rpc_pb"; import type { Message } from "@bufbuild/protobuf"; @@ -36,7 +36,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file ffi.proto. */ export const file_ffi: GenFile = /*@__PURE__*/ - fileDesc("CglmZmkucHJvdG8SDWxpdmVraXQucHJvdG8iphUKCkZmaVJlcXVlc3QSMAoHZGlzcG9zZRgCIAEoCzIdLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlcXVlc3RIABIwCgdjb25uZWN0GAMgASgLMh0ubGl2ZWtpdC5wcm90by5Db25uZWN0UmVxdWVzdEgAEjYKCmRpc2Nvbm5lY3QYBCABKAsyIC5saXZla2l0LnByb3RvLkRpc2Nvbm5lY3RSZXF1ZXN0SAASOwoNcHVibGlzaF90cmFjaxgFIAEoCzIiLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVxdWVzdEgAEj8KD3VucHVibGlzaF90cmFjaxgGIAEoCzIkLmxpdmVraXQucHJvdG8uVW5wdWJsaXNoVHJhY2tSZXF1ZXN0SAASOQoMcHVibGlzaF9kYXRhGAcgASgLMiEubGl2ZWtpdC5wcm90by5QdWJsaXNoRGF0YVJlcXVlc3RIABI9Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlcXVlc3RIABJEChJzZXRfbG9jYWxfbWV0YWRhdGEYCSABKAsyJi5saXZla2l0LnByb3RvLlNldExvY2FsTWV0YWRhdGFSZXF1ZXN0SAASPAoOc2V0X2xvY2FsX25hbWUYCiABKAsyIi5saXZla2l0LnByb3RvLlNldExvY2FsTmFtZVJlcXVlc3RIABJIChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIoLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVxdWVzdEgAEkIKEWdldF9zZXNzaW9uX3N0YXRzGAwgASgLMiUubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNSZXF1ZXN0SAASSwoVcHVibGlzaF90cmFuc2NyaXB0aW9uGA0gASgLMioubGl2ZWtpdC5wcm90by5QdWJsaXNoVHJhbnNjcmlwdGlvblJlcXVlc3RIABJAChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiQubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlcXVlc3RIABJEChJjcmVhdGVfdmlkZW9fdHJhY2sYDyABKAsyJi5saXZla2l0LnByb3RvLkNyZWF0ZVZpZGVvVHJhY2tSZXF1ZXN0SAASRAoSY3JlYXRlX2F1ZGlvX3RyYWNrGBAgASgLMiYubGl2ZWtpdC5wcm90by5DcmVhdGVBdWRpb1RyYWNrUmVxdWVzdEgAEkAKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJC5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVxdWVzdEgAEkYKE2VuYWJsZV9yZW1vdGVfdHJhY2sYEiABKAsyJy5saXZla2l0LnByb3RvLkVuYWJsZVJlbW90ZVRyYWNrUmVxdWVzdEgAEjMKCWdldF9zdGF0cxgTIAEoCzIeLmxpdmVraXQucHJvdG8uR2V0U3RhdHNSZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3NvdXJjZRgVIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9Tb3VyY2VSZXF1ZXN0SAASRgoTY2FwdHVyZV92aWRlb19mcmFtZRgWIAEoCzInLmxpdmVraXQucHJvdG8uQ2FwdHVyZVZpZGVvRnJhbWVSZXF1ZXN0SAASOwoNdmlkZW9fY29udmVydBgXIAEoCzIiLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVxdWVzdEgAElkKHXZpZGVvX3N0cmVhbV9mcm9tX3BhcnRpY2lwYW50GBggASgLMjAubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlcXVlc3RIABJAChBuZXdfYXVkaW9fc3RyZWFtGBkgASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1N0cmVhbVJlcXVlc3RIABJAChBuZXdfYXVkaW9fc291cmNlGBogASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlcXVlc3RIABJGChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGBsgASgLMicubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZVJlcXVlc3RIABJEChJjbGVhcl9hdWRpb19idWZmZXIYHCABKAsyJi5saXZla2l0LnByb3RvLkNsZWFyQXVkaW9CdWZmZXJSZXF1ZXN0SAASRgoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzInLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXF1ZXN0SAASRAoScmVtaXhfYW5kX3Jlc2FtcGxlGB4gASgLMiYubGl2ZWtpdC5wcm90by5SZW1peEFuZFJlc2FtcGxlUmVxdWVzdEgAEioKBGUyZWUYHyABKAsyGi5saXZla2l0LnByb3RvLkUyZWVSZXF1ZXN0SAASWQodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYICABKAsyMC5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVxdWVzdEgAEkIKEW5ld19zb3hfcmVzYW1wbGVyGCEgASgLMiUubGl2ZWtpdC5wcm90by5OZXdTb3hSZXNhbXBsZXJSZXF1ZXN0SAASRAoScHVzaF9zb3hfcmVzYW1wbGVyGCIgASgLMiYubGl2ZWtpdC5wcm90by5QdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkYKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyJy5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkIKEXNlbmRfY2hhdF9tZXNzYWdlGCQgASgLMiUubGl2ZWtpdC5wcm90by5TZW5kQ2hhdE1lc3NhZ2VSZXF1ZXN0SAASQgoRZWRpdF9jaGF0X21lc3NhZ2UYJSABKAsyJS5saXZla2l0LnByb3RvLkVkaXRDaGF0TWVzc2FnZVJlcXVlc3RIABI3CgtwZXJmb3JtX3JwYxgmIAEoCzIgLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1JlcXVlc3RIABJGChNyZWdpc3Rlcl9ycGNfbWV0aG9kGCcgASgLMicubGl2ZWtpdC5wcm90by5SZWdpc3RlclJwY01ldGhvZFJlcXVlc3RIABJKChV1bnJlZ2lzdGVyX3JwY19tZXRob2QYKCABKAsyKS5saXZla2l0LnByb3RvLlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0SAASWwoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCkgASgLMjEubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXF1ZXN0SABCCQoHbWVzc2FnZSKKFQoLRmZpUmVzcG9uc2USMQoHZGlzcG9zZRgCIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlc3BvbnNlSAASMQoHY29ubmVjdBgDIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdFJlc3BvbnNlSAASNwoKZGlzY29ubmVjdBgEIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdFJlc3BvbnNlSAASPAoNcHVibGlzaF90cmFjaxgFIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVzcG9uc2VIABJACg91bnB1Ymxpc2hfdHJhY2sYBiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrUmVzcG9uc2VIABI6CgxwdWJsaXNoX2RhdGEYByABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhUmVzcG9uc2VIABI+Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIkLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlc3BvbnNlSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGAkgASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhUmVzcG9uc2VIABI9Cg5zZXRfbG9jYWxfbmFtZRgKIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lUmVzcG9uc2VIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVzcG9uc2VIABJDChFnZXRfc2Vzc2lvbl9zdGF0cxgMIAEoCzImLmxpdmVraXQucHJvdG8uR2V0U2Vzc2lvblN0YXRzUmVzcG9uc2VIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDSABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uUmVzcG9uc2VIABJBChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiUubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlc3BvbnNlSAASRQoSY3JlYXRlX3ZpZGVvX3RyYWNrGA8gASgLMicubGl2ZWtpdC5wcm90by5DcmVhdGVWaWRlb1RyYWNrUmVzcG9uc2VIABJFChJjcmVhdGVfYXVkaW9fdHJhY2sYECABKAsyJy5saXZla2l0LnByb3RvLkNyZWF0ZUF1ZGlvVHJhY2tSZXNwb25zZUgAEkEKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJS5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVzcG9uc2VIABJHChNlbmFibGVfcmVtb3RlX3RyYWNrGBIgASgLMigubGl2ZWtpdC5wcm90by5FbmFibGVSZW1vdGVUcmFja1Jlc3BvbnNlSAASNAoJZ2V0X3N0YXRzGBMgASgLMh8ubGl2ZWtpdC5wcm90by5HZXRTdGF0c1Jlc3BvbnNlSAASQQoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIlLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXNwb25zZUgAEkEKEG5ld192aWRlb19zb3VyY2UYFSABKAsyJS5saXZla2l0LnByb3RvLk5ld1ZpZGVvU291cmNlUmVzcG9uc2VIABJHChNjYXB0dXJlX3ZpZGVvX2ZyYW1lGBYgASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlVmlkZW9GcmFtZVJlc3BvbnNlSAASPAoNdmlkZW9fY29udmVydBgXIAEoCzIjLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVzcG9uc2VIABJaCh12aWRlb19zdHJlYW1fZnJvbV9wYXJ0aWNpcGFudBgYIAEoCzIxLmxpdmVraXQucHJvdG8uVmlkZW9TdHJlYW1Gcm9tUGFydGljaXBhbnRSZXNwb25zZUgAEkEKEG5ld19hdWRpb19zdHJlYW0YGSABKAsyJS5saXZla2l0LnByb3RvLk5ld0F1ZGlvU3RyZWFtUmVzcG9uc2VIABJBChBuZXdfYXVkaW9fc291cmNlGBogASgLMiUubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlc3BvbnNlSAASRwoTY2FwdHVyZV9hdWRpb19mcmFtZRgbIAEoCzIoLmxpdmVraXQucHJvdG8uQ2FwdHVyZUF1ZGlvRnJhbWVSZXNwb25zZUgAEkUKEmNsZWFyX2F1ZGlvX2J1ZmZlchgcIAEoCzInLmxpdmVraXQucHJvdG8uQ2xlYXJBdWRpb0J1ZmZlclJlc3BvbnNlSAASRwoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzIoLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXNwb25zZUgAEkUKEnJlbWl4X2FuZF9yZXNhbXBsZRgeIAEoCzInLmxpdmVraXQucHJvdG8uUmVtaXhBbmRSZXNhbXBsZVJlc3BvbnNlSAASWgodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYHyABKAsyMS5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVzcG9uc2VIABIrCgRlMmVlGCAgASgLMhsubGl2ZWtpdC5wcm90by5FMmVlUmVzcG9uc2VIABJDChFuZXdfc294X3Jlc2FtcGxlchghIAEoCzImLmxpdmVraXQucHJvdG8uTmV3U294UmVzYW1wbGVyUmVzcG9uc2VIABJFChJwdXNoX3NveF9yZXNhbXBsZXIYIiABKAsyJy5saXZla2l0LnByb3RvLlB1c2hTb3hSZXNhbXBsZXJSZXNwb25zZUgAEkcKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyKC5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVzcG9uc2VIABJDChFzZW5kX2NoYXRfbWVzc2FnZRgkIAEoCzImLmxpdmVraXQucHJvdG8uU2VuZENoYXRNZXNzYWdlUmVzcG9uc2VIABI4CgtwZXJmb3JtX3JwYxglIAEoCzIhLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1Jlc3BvbnNlSAASRwoTcmVnaXN0ZXJfcnBjX21ldGhvZBgmIAEoCzIoLmxpdmVraXQucHJvdG8uUmVnaXN0ZXJScGNNZXRob2RSZXNwb25zZUgAEksKFXVucmVnaXN0ZXJfcnBjX21ldGhvZBgnIAEoCzIqLmxpdmVraXQucHJvdG8uVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlSAASXAoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCggASgLMjIubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXNwb25zZUgAQgkKB21lc3NhZ2Ui6AsKCEZmaUV2ZW50Ei4KCnJvb21fZXZlbnQYASABKAsyGC5saXZla2l0LnByb3RvLlJvb21FdmVudEgAEjAKC3RyYWNrX2V2ZW50GAIgASgLMhkubGl2ZWtpdC5wcm90by5UcmFja0V2ZW50SAASPQoSdmlkZW9fc3RyZWFtX2V2ZW50GAMgASgLMh8ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUV2ZW50SAASPQoSYXVkaW9fc3RyZWFtX2V2ZW50GAQgASgLMh8ubGl2ZWtpdC5wcm90by5BdWRpb1N0cmVhbUV2ZW50SAASMQoHY29ubmVjdBgFIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdENhbGxiYWNrSAASNwoKZGlzY29ubmVjdBgHIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdENhbGxiYWNrSAASMQoHZGlzcG9zZRgIIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZUNhbGxiYWNrSAASPAoNcHVibGlzaF90cmFjaxgJIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrQ2FsbGJhY2tIABJACg91bnB1Ymxpc2hfdHJhY2sYCiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrQ2FsbGJhY2tIABI6CgxwdWJsaXNoX2RhdGEYCyABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhQ2FsbGJhY2tIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDCABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uQ2FsbGJhY2tIABJHChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGA0gASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZUNhbGxiYWNrSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGA4gASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhQ2FsbGJhY2tIABI9Cg5zZXRfbG9jYWxfbmFtZRgPIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lQ2FsbGJhY2tIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgQIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzQ2FsbGJhY2tIABI0CglnZXRfc3RhdHMYESABKAsyHy5saXZla2l0LnByb3RvLkdldFN0YXRzQ2FsbGJhY2tIABInCgRsb2dzGBIgASgLMhcubGl2ZWtpdC5wcm90by5Mb2dCYXRjaEgAEkMKEWdldF9zZXNzaW9uX3N0YXRzGBMgASgLMiYubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNDYWxsYmFja0gAEiUKBXBhbmljGBQgASgLMhQubGl2ZWtpdC5wcm90by5QYW5pY0gAEkEKEHB1Ymxpc2hfc2lwX2R0bWYYFSABKAsyJS5saXZla2l0LnByb3RvLlB1Ymxpc2hTaXBEdG1mQ2FsbGJhY2tIABI+CgxjaGF0X21lc3NhZ2UYFiABKAsyJi5saXZla2l0LnByb3RvLlNlbmRDaGF0TWVzc2FnZUNhbGxiYWNrSAASOAoLcGVyZm9ybV9ycGMYFyABKAsyIS5saXZla2l0LnByb3RvLlBlcmZvcm1ScGNDYWxsYmFja0gAEkgKFXJwY19tZXRob2RfaW52b2NhdGlvbhgYIAEoCzInLmxpdmVraXQucHJvdG8uUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50SAASXAoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGBkgASgLMjIubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VDYWxsYmFja0gAQgkKB21lc3NhZ2UiHwoORGlzcG9zZVJlcXVlc3QSDQoFYXN5bmMYASACKAgiIwoPRGlzcG9zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgASgEIiMKD0Rpc3Bvc2VDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBCKFAQoJTG9nUmVjb3JkEiYKBWxldmVsGAEgAigOMhcubGl2ZWtpdC5wcm90by5Mb2dMZXZlbBIOCgZ0YXJnZXQYAiACKAkSEwoLbW9kdWxlX3BhdGgYAyABKAkSDAoEZmlsZRgEIAEoCRIMCgRsaW5lGAUgASgNEg8KB21lc3NhZ2UYBiACKAkiNQoITG9nQmF0Y2gSKQoHcmVjb3JkcxgBIAMoCzIYLmxpdmVraXQucHJvdG8uTG9nUmVjb3JkIhgKBVBhbmljEg8KB21lc3NhZ2UYASACKAkqUwoITG9nTGV2ZWwSDQoJTE9HX0VSUk9SEAASDAoITE9HX1dBUk4QARIMCghMT0dfSU5GTxACEg0KCUxPR19ERUJVRxADEg0KCUxPR19UUkFDRRAEQhCqAg1MaXZlS2l0LlByb3Rv", [file_e2ee, file_track, file_room, file_video_frame, file_audio_frame, file_rpc]); + fileDesc("CglmZmkucHJvdG8SDWxpdmVraXQucHJvdG8iphUKCkZmaVJlcXVlc3QSMAoHZGlzcG9zZRgCIAEoCzIdLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlcXVlc3RIABIwCgdjb25uZWN0GAMgASgLMh0ubGl2ZWtpdC5wcm90by5Db25uZWN0UmVxdWVzdEgAEjYKCmRpc2Nvbm5lY3QYBCABKAsyIC5saXZla2l0LnByb3RvLkRpc2Nvbm5lY3RSZXF1ZXN0SAASOwoNcHVibGlzaF90cmFjaxgFIAEoCzIiLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVxdWVzdEgAEj8KD3VucHVibGlzaF90cmFjaxgGIAEoCzIkLmxpdmVraXQucHJvdG8uVW5wdWJsaXNoVHJhY2tSZXF1ZXN0SAASOQoMcHVibGlzaF9kYXRhGAcgASgLMiEubGl2ZWtpdC5wcm90by5QdWJsaXNoRGF0YVJlcXVlc3RIABI9Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlcXVlc3RIABJEChJzZXRfbG9jYWxfbWV0YWRhdGEYCSABKAsyJi5saXZla2l0LnByb3RvLlNldExvY2FsTWV0YWRhdGFSZXF1ZXN0SAASPAoOc2V0X2xvY2FsX25hbWUYCiABKAsyIi5saXZla2l0LnByb3RvLlNldExvY2FsTmFtZVJlcXVlc3RIABJIChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIoLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVxdWVzdEgAEkIKEWdldF9zZXNzaW9uX3N0YXRzGAwgASgLMiUubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNSZXF1ZXN0SAASSwoVcHVibGlzaF90cmFuc2NyaXB0aW9uGA0gASgLMioubGl2ZWtpdC5wcm90by5QdWJsaXNoVHJhbnNjcmlwdGlvblJlcXVlc3RIABJAChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiQubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlcXVlc3RIABJEChJjcmVhdGVfdmlkZW9fdHJhY2sYDyABKAsyJi5saXZla2l0LnByb3RvLkNyZWF0ZVZpZGVvVHJhY2tSZXF1ZXN0SAASRAoSY3JlYXRlX2F1ZGlvX3RyYWNrGBAgASgLMiYubGl2ZWtpdC5wcm90by5DcmVhdGVBdWRpb1RyYWNrUmVxdWVzdEgAEkAKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJC5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVxdWVzdEgAEkYKE2VuYWJsZV9yZW1vdGVfdHJhY2sYEiABKAsyJy5saXZla2l0LnByb3RvLkVuYWJsZVJlbW90ZVRyYWNrUmVxdWVzdEgAEjMKCWdldF9zdGF0cxgTIAEoCzIeLmxpdmVraXQucHJvdG8uR2V0U3RhdHNSZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXF1ZXN0SAASQAoQbmV3X3ZpZGVvX3NvdXJjZRgVIAEoCzIkLmxpdmVraXQucHJvdG8uTmV3VmlkZW9Tb3VyY2VSZXF1ZXN0SAASRgoTY2FwdHVyZV92aWRlb19mcmFtZRgWIAEoCzInLmxpdmVraXQucHJvdG8uQ2FwdHVyZVZpZGVvRnJhbWVSZXF1ZXN0SAASOwoNdmlkZW9fY29udmVydBgXIAEoCzIiLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVxdWVzdEgAElkKHXZpZGVvX3N0cmVhbV9mcm9tX3BhcnRpY2lwYW50GBggASgLMjAubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUZyb21QYXJ0aWNpcGFudFJlcXVlc3RIABJAChBuZXdfYXVkaW9fc3RyZWFtGBkgASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1N0cmVhbVJlcXVlc3RIABJAChBuZXdfYXVkaW9fc291cmNlGBogASgLMiQubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlcXVlc3RIABJGChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGBsgASgLMicubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZVJlcXVlc3RIABJEChJjbGVhcl9hdWRpb19idWZmZXIYHCABKAsyJi5saXZla2l0LnByb3RvLkNsZWFyQXVkaW9CdWZmZXJSZXF1ZXN0SAASRgoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzInLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXF1ZXN0SAASRAoScmVtaXhfYW5kX3Jlc2FtcGxlGB4gASgLMiYubGl2ZWtpdC5wcm90by5SZW1peEFuZFJlc2FtcGxlUmVxdWVzdEgAEioKBGUyZWUYHyABKAsyGi5saXZla2l0LnByb3RvLkUyZWVSZXF1ZXN0SAASWQodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYICABKAsyMC5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVxdWVzdEgAEkIKEW5ld19zb3hfcmVzYW1wbGVyGCEgASgLMiUubGl2ZWtpdC5wcm90by5OZXdTb3hSZXNhbXBsZXJSZXF1ZXN0SAASRAoScHVzaF9zb3hfcmVzYW1wbGVyGCIgASgLMiYubGl2ZWtpdC5wcm90by5QdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkYKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyJy5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVxdWVzdEgAEkIKEXNlbmRfY2hhdF9tZXNzYWdlGCQgASgLMiUubGl2ZWtpdC5wcm90by5TZW5kQ2hhdE1lc3NhZ2VSZXF1ZXN0SAASQgoRZWRpdF9jaGF0X21lc3NhZ2UYJSABKAsyJS5saXZla2l0LnByb3RvLkVkaXRDaGF0TWVzc2FnZVJlcXVlc3RIABI3CgtwZXJmb3JtX3JwYxgmIAEoCzIgLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1JlcXVlc3RIABJGChNyZWdpc3Rlcl9ycGNfbWV0aG9kGCcgASgLMicubGl2ZWtpdC5wcm90by5SZWdpc3RlclJwY01ldGhvZFJlcXVlc3RIABJKChV1bnJlZ2lzdGVyX3JwY19tZXRob2QYKCABKAsyKS5saXZla2l0LnByb3RvLlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0SAASWwoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCkgASgLMjEubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXF1ZXN0SABCCQoHbWVzc2FnZSKKFQoLRmZpUmVzcG9uc2USMQoHZGlzcG9zZRgCIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZVJlc3BvbnNlSAASMQoHY29ubmVjdBgDIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdFJlc3BvbnNlSAASNwoKZGlzY29ubmVjdBgEIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdFJlc3BvbnNlSAASPAoNcHVibGlzaF90cmFjaxgFIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrUmVzcG9uc2VIABJACg91bnB1Ymxpc2hfdHJhY2sYBiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrUmVzcG9uc2VIABI6CgxwdWJsaXNoX2RhdGEYByABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhUmVzcG9uc2VIABI+Cg5zZXRfc3Vic2NyaWJlZBgIIAEoCzIkLmxpdmVraXQucHJvdG8uU2V0U3Vic2NyaWJlZFJlc3BvbnNlSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGAkgASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhUmVzcG9uc2VIABI9Cg5zZXRfbG9jYWxfbmFtZRgKIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lUmVzcG9uc2VIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgLIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzUmVzcG9uc2VIABJDChFnZXRfc2Vzc2lvbl9zdGF0cxgMIAEoCzImLmxpdmVraXQucHJvdG8uR2V0U2Vzc2lvblN0YXRzUmVzcG9uc2VIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDSABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uUmVzcG9uc2VIABJBChBwdWJsaXNoX3NpcF9kdG1mGA4gASgLMiUubGl2ZWtpdC5wcm90by5QdWJsaXNoU2lwRHRtZlJlc3BvbnNlSAASRQoSY3JlYXRlX3ZpZGVvX3RyYWNrGA8gASgLMicubGl2ZWtpdC5wcm90by5DcmVhdGVWaWRlb1RyYWNrUmVzcG9uc2VIABJFChJjcmVhdGVfYXVkaW9fdHJhY2sYECABKAsyJy5saXZla2l0LnByb3RvLkNyZWF0ZUF1ZGlvVHJhY2tSZXNwb25zZUgAEkEKEGxvY2FsX3RyYWNrX211dGUYESABKAsyJS5saXZla2l0LnByb3RvLkxvY2FsVHJhY2tNdXRlUmVzcG9uc2VIABJHChNlbmFibGVfcmVtb3RlX3RyYWNrGBIgASgLMigubGl2ZWtpdC5wcm90by5FbmFibGVSZW1vdGVUcmFja1Jlc3BvbnNlSAASNAoJZ2V0X3N0YXRzGBMgASgLMh8ubGl2ZWtpdC5wcm90by5HZXRTdGF0c1Jlc3BvbnNlSAASQQoQbmV3X3ZpZGVvX3N0cmVhbRgUIAEoCzIlLmxpdmVraXQucHJvdG8uTmV3VmlkZW9TdHJlYW1SZXNwb25zZUgAEkEKEG5ld192aWRlb19zb3VyY2UYFSABKAsyJS5saXZla2l0LnByb3RvLk5ld1ZpZGVvU291cmNlUmVzcG9uc2VIABJHChNjYXB0dXJlX3ZpZGVvX2ZyYW1lGBYgASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlVmlkZW9GcmFtZVJlc3BvbnNlSAASPAoNdmlkZW9fY29udmVydBgXIAEoCzIjLmxpdmVraXQucHJvdG8uVmlkZW9Db252ZXJ0UmVzcG9uc2VIABJaCh12aWRlb19zdHJlYW1fZnJvbV9wYXJ0aWNpcGFudBgYIAEoCzIxLmxpdmVraXQucHJvdG8uVmlkZW9TdHJlYW1Gcm9tUGFydGljaXBhbnRSZXNwb25zZUgAEkEKEG5ld19hdWRpb19zdHJlYW0YGSABKAsyJS5saXZla2l0LnByb3RvLk5ld0F1ZGlvU3RyZWFtUmVzcG9uc2VIABJBChBuZXdfYXVkaW9fc291cmNlGBogASgLMiUubGl2ZWtpdC5wcm90by5OZXdBdWRpb1NvdXJjZVJlc3BvbnNlSAASRwoTY2FwdHVyZV9hdWRpb19mcmFtZRgbIAEoCzIoLmxpdmVraXQucHJvdG8uQ2FwdHVyZUF1ZGlvRnJhbWVSZXNwb25zZUgAEkUKEmNsZWFyX2F1ZGlvX2J1ZmZlchgcIAEoCzInLmxpdmVraXQucHJvdG8uQ2xlYXJBdWRpb0J1ZmZlclJlc3BvbnNlSAASRwoTbmV3X2F1ZGlvX3Jlc2FtcGxlchgdIAEoCzIoLmxpdmVraXQucHJvdG8uTmV3QXVkaW9SZXNhbXBsZXJSZXNwb25zZUgAEkUKEnJlbWl4X2FuZF9yZXNhbXBsZRgeIAEoCzInLmxpdmVraXQucHJvdG8uUmVtaXhBbmRSZXNhbXBsZVJlc3BvbnNlSAASWgodYXVkaW9fc3RyZWFtX2Zyb21fcGFydGljaXBhbnQYHyABKAsyMS5saXZla2l0LnByb3RvLkF1ZGlvU3RyZWFtRnJvbVBhcnRpY2lwYW50UmVzcG9uc2VIABIrCgRlMmVlGCAgASgLMhsubGl2ZWtpdC5wcm90by5FMmVlUmVzcG9uc2VIABJDChFuZXdfc294X3Jlc2FtcGxlchghIAEoCzImLmxpdmVraXQucHJvdG8uTmV3U294UmVzYW1wbGVyUmVzcG9uc2VIABJFChJwdXNoX3NveF9yZXNhbXBsZXIYIiABKAsyJy5saXZla2l0LnByb3RvLlB1c2hTb3hSZXNhbXBsZXJSZXNwb25zZUgAEkcKE2ZsdXNoX3NveF9yZXNhbXBsZXIYIyABKAsyKC5saXZla2l0LnByb3RvLkZsdXNoU294UmVzYW1wbGVyUmVzcG9uc2VIABJDChFzZW5kX2NoYXRfbWVzc2FnZRgkIAEoCzImLmxpdmVraXQucHJvdG8uU2VuZENoYXRNZXNzYWdlUmVzcG9uc2VIABI4CgtwZXJmb3JtX3JwYxglIAEoCzIhLmxpdmVraXQucHJvdG8uUGVyZm9ybVJwY1Jlc3BvbnNlSAASRwoTcmVnaXN0ZXJfcnBjX21ldGhvZBgmIAEoCzIoLmxpdmVraXQucHJvdG8uUmVnaXN0ZXJScGNNZXRob2RSZXNwb25zZUgAEksKFXVucmVnaXN0ZXJfcnBjX21ldGhvZBgnIAEoCzIqLmxpdmVraXQucHJvdG8uVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlSAASXAoecnBjX21ldGhvZF9pbnZvY2F0aW9uX3Jlc3BvbnNlGCggASgLMjIubGl2ZWtpdC5wcm90by5ScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VSZXNwb25zZUgAQgkKB21lc3NhZ2UiigsKCEZmaUV2ZW50Ei4KCnJvb21fZXZlbnQYASABKAsyGC5saXZla2l0LnByb3RvLlJvb21FdmVudEgAEjAKC3RyYWNrX2V2ZW50GAIgASgLMhkubGl2ZWtpdC5wcm90by5UcmFja0V2ZW50SAASPQoSdmlkZW9fc3RyZWFtX2V2ZW50GAMgASgLMh8ubGl2ZWtpdC5wcm90by5WaWRlb1N0cmVhbUV2ZW50SAASPQoSYXVkaW9fc3RyZWFtX2V2ZW50GAQgASgLMh8ubGl2ZWtpdC5wcm90by5BdWRpb1N0cmVhbUV2ZW50SAASMQoHY29ubmVjdBgFIAEoCzIeLmxpdmVraXQucHJvdG8uQ29ubmVjdENhbGxiYWNrSAASNwoKZGlzY29ubmVjdBgHIAEoCzIhLmxpdmVraXQucHJvdG8uRGlzY29ubmVjdENhbGxiYWNrSAASMQoHZGlzcG9zZRgIIAEoCzIeLmxpdmVraXQucHJvdG8uRGlzcG9zZUNhbGxiYWNrSAASPAoNcHVibGlzaF90cmFjaxgJIAEoCzIjLmxpdmVraXQucHJvdG8uUHVibGlzaFRyYWNrQ2FsbGJhY2tIABJACg91bnB1Ymxpc2hfdHJhY2sYCiABKAsyJS5saXZla2l0LnByb3RvLlVucHVibGlzaFRyYWNrQ2FsbGJhY2tIABI6CgxwdWJsaXNoX2RhdGEYCyABKAsyIi5saXZla2l0LnByb3RvLlB1Ymxpc2hEYXRhQ2FsbGJhY2tIABJMChVwdWJsaXNoX3RyYW5zY3JpcHRpb24YDCABKAsyKy5saXZla2l0LnByb3RvLlB1Ymxpc2hUcmFuc2NyaXB0aW9uQ2FsbGJhY2tIABJHChNjYXB0dXJlX2F1ZGlvX2ZyYW1lGA0gASgLMigubGl2ZWtpdC5wcm90by5DYXB0dXJlQXVkaW9GcmFtZUNhbGxiYWNrSAASRQoSc2V0X2xvY2FsX21ldGFkYXRhGA4gASgLMicubGl2ZWtpdC5wcm90by5TZXRMb2NhbE1ldGFkYXRhQ2FsbGJhY2tIABI9Cg5zZXRfbG9jYWxfbmFtZRgPIAEoCzIjLmxpdmVraXQucHJvdG8uU2V0TG9jYWxOYW1lQ2FsbGJhY2tIABJJChRzZXRfbG9jYWxfYXR0cmlidXRlcxgQIAEoCzIpLmxpdmVraXQucHJvdG8uU2V0TG9jYWxBdHRyaWJ1dGVzQ2FsbGJhY2tIABI0CglnZXRfc3RhdHMYESABKAsyHy5saXZla2l0LnByb3RvLkdldFN0YXRzQ2FsbGJhY2tIABInCgRsb2dzGBIgASgLMhcubGl2ZWtpdC5wcm90by5Mb2dCYXRjaEgAEkMKEWdldF9zZXNzaW9uX3N0YXRzGBMgASgLMiYubGl2ZWtpdC5wcm90by5HZXRTZXNzaW9uU3RhdHNDYWxsYmFja0gAEiUKBXBhbmljGBQgASgLMhQubGl2ZWtpdC5wcm90by5QYW5pY0gAEkEKEHB1Ymxpc2hfc2lwX2R0bWYYFSABKAsyJS5saXZla2l0LnByb3RvLlB1Ymxpc2hTaXBEdG1mQ2FsbGJhY2tIABI+CgxjaGF0X21lc3NhZ2UYFiABKAsyJi5saXZla2l0LnByb3RvLlNlbmRDaGF0TWVzc2FnZUNhbGxiYWNrSAASOAoLcGVyZm9ybV9ycGMYFyABKAsyIS5saXZla2l0LnByb3RvLlBlcmZvcm1ScGNDYWxsYmFja0gAEkgKFXJwY19tZXRob2RfaW52b2NhdGlvbhgYIAEoCzInLmxpdmVraXQucHJvdG8uUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50SABCCQoHbWVzc2FnZSIfCg5EaXNwb3NlUmVxdWVzdBINCgVhc3luYxgBIAIoCCIjCg9EaXNwb3NlUmVzcG9uc2USEAoIYXN5bmNfaWQYASABKAQiIwoPRGlzcG9zZUNhbGxiYWNrEhAKCGFzeW5jX2lkGAEgAigEIoUBCglMb2dSZWNvcmQSJgoFbGV2ZWwYASACKA4yFy5saXZla2l0LnByb3RvLkxvZ0xldmVsEg4KBnRhcmdldBgCIAIoCRITCgttb2R1bGVfcGF0aBgDIAEoCRIMCgRmaWxlGAQgASgJEgwKBGxpbmUYBSABKA0SDwoHbWVzc2FnZRgGIAIoCSI1CghMb2dCYXRjaBIpCgdyZWNvcmRzGAEgAygLMhgubGl2ZWtpdC5wcm90by5Mb2dSZWNvcmQiGAoFUGFuaWMSDwoHbWVzc2FnZRgBIAIoCSpTCghMb2dMZXZlbBINCglMT0dfRVJST1IQABIMCghMT0dfV0FSThABEgwKCExPR19JTkZPEAISDQoJTE9HX0RFQlVHEAMSDQoJTE9HX1RSQUNFEARCEKoCDUxpdmVLaXQuUHJvdG8", [file_e2ee, file_track, file_room, file_video_frame, file_audio_frame, file_rpc]); /** * This is the input of livekit_ffi_request function @@ -720,12 +720,6 @@ export type FfiEvent = Message<"livekit.proto.FfiEvent"> & { */ value: RpcMethodInvocationEvent; case: "rpcMethodInvocation"; - } | { - /** - * @generated from field: livekit.proto.RpcMethodInvocationResponseCallback rpc_method_invocation_response = 25; - */ - value: RpcMethodInvocationResponseCallback; - case: "rpcMethodInvocationResponse"; } | { case: undefined; value?: undefined }; }; diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index 1156ffcc..f4af4d62 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -24,7 +24,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file rpc.proto. */ export const file_rpc: GenFile = /*@__PURE__*/ - fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIkwKGFJlZ2lzdGVyUnBjTWV0aG9kUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSDgoGbWV0aG9kGAIgAigJIk4KGlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIOCgZtZXRob2QYAiACKAkilgEKIlJwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhUKDWludm9jYXRpb25faWQYAiACKAQSDwoHcGF5bG9hZBgDIAEoCRImCgVlcnJvchgEIAEoCzIXLmxpdmVraXQucHJvdG8uUnBjRXJyb3IiJgoSUGVyZm9ybVJwY1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIi0KGVJlZ2lzdGVyUnBjTWV0aG9kUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQiLwobVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIjcKI1JwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIl8KElBlcmZvcm1ScGNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgdwYXlsb2FkGAIgASgJEiYKBWVycm9yGAMgASgLMhcubGl2ZWtpdC5wcm90by5ScGNFcnJvciJGCiNScGNNZXRob2RJbnZvY2F0aW9uUmVzcG9uc2VDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBINCgVlcnJvchgCIAEoCSK+AQoYUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIVCg1pbnZvY2F0aW9uX2lkGAIgAigEEg4KBm1ldGhvZBgDIAIoCRISCgpyZXF1ZXN0X2lkGAQgAigJEhcKD2NhbGxlcl9pZGVudGl0eRgFIAIoCRIPCgdwYXlsb2FkGAYgAigJEhsKE3Jlc3BvbnNlX3RpbWVvdXRfbXMYByACKA1CEKoCDUxpdmVLaXQuUHJvdG8"); + fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIkwKGFJlZ2lzdGVyUnBjTWV0aG9kUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSDgoGbWV0aG9kGAIgAigJIk4KGlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIOCgZtZXRob2QYAiACKAkilgEKIlJwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhUKDWludm9jYXRpb25faWQYAiACKAQSDwoHcGF5bG9hZBgDIAEoCRImCgVlcnJvchgEIAEoCzIXLmxpdmVraXQucHJvdG8uUnBjRXJyb3IiJgoSUGVyZm9ybVJwY1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIi0KGVJlZ2lzdGVyUnBjTWV0aG9kUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQiLwobVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIkYKI1JwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEEg0KBWVycm9yGAIgASgJIl8KElBlcmZvcm1ScGNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgdwYXlsb2FkGAIgASgJEiYKBWVycm9yGAMgASgLMhcubGl2ZWtpdC5wcm90by5ScGNFcnJvciK+AQoYUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIVCg1pbnZvY2F0aW9uX2lkGAIgAigEEg4KBm1ldGhvZBgDIAIoCRISCgpyZXF1ZXN0X2lkGAQgAigJEhcKD2NhbGxlcl9pZGVudGl0eRgFIAIoCRIPCgdwYXlsb2FkGAYgAigJEhsKE3Jlc3BvbnNlX3RpbWVvdXRfbXMYByACKA1CEKoCDUxpdmVLaXQuUHJvdG8"); /** * @generated from message livekit.proto.RpcError @@ -229,6 +229,11 @@ export type RpcMethodInvocationResponseResponse = Message<"livekit.proto.RpcMeth * @generated from field: required uint64 async_id = 1; */ asyncId: bigint; + + /** + * @generated from field: optional string error = 2; + */ + error: string; }; /** @@ -267,28 +272,6 @@ export type PerformRpcCallback = Message<"livekit.proto.PerformRpcCallback"> & { export const PerformRpcCallbackSchema: GenMessage = /*@__PURE__*/ messageDesc(file_rpc, 9); -/** - * @generated from message livekit.proto.RpcMethodInvocationResponseCallback - */ -export type RpcMethodInvocationResponseCallback = Message<"livekit.proto.RpcMethodInvocationResponseCallback"> & { - /** - * @generated from field: required uint64 async_id = 1; - */ - asyncId: bigint; - - /** - * @generated from field: optional string error = 2; - */ - error: string; -}; - -/** - * Describes the message livekit.proto.RpcMethodInvocationResponseCallback. - * Use `create(RpcMethodInvocationResponseCallbackSchema)` to create a new message. - */ -export const RpcMethodInvocationResponseCallbackSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_rpc, 10); - /** * FFI Events * @@ -336,5 +319,5 @@ export type RpcMethodInvocationEvent = Message<"livekit.proto.RpcMethodInvocatio * Use `create(RpcMethodInvocationEventSchema)` to create a new message. */ export const RpcMethodInvocationEventSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_rpc, 11); + messageDesc(file_rpc, 10); From f7d2ada88dec6042f53e0c85018ec51c93e69d01 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 14:00:29 -0700 Subject: [PATCH 116/126] proto --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/proto/rpc_pb.ts | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 90a5dc0f..757ec343 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 90a5dc0ff4403d321088e34b68a8cbc70a326b14 +Subproject commit 757ec343669ea59cf6296179d27fb3a8c4ab3da4 diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index f4af4d62..26b9e2ac 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -24,7 +24,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file rpc.proto. */ export const file_rpc: GenFile = /*@__PURE__*/ - fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIkwKGFJlZ2lzdGVyUnBjTWV0aG9kUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSDgoGbWV0aG9kGAIgAigJIk4KGlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIOCgZtZXRob2QYAiACKAkilgEKIlJwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhUKDWludm9jYXRpb25faWQYAiACKAQSDwoHcGF5bG9hZBgDIAEoCRImCgVlcnJvchgEIAEoCzIXLmxpdmVraXQucHJvdG8uUnBjRXJyb3IiJgoSUGVyZm9ybVJwY1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIi0KGVJlZ2lzdGVyUnBjTWV0aG9kUmVzcG9uc2USEAoIYXN5bmNfaWQYASACKAQiLwobVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIkYKI1JwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEEg0KBWVycm9yGAIgASgJIl8KElBlcmZvcm1ScGNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgdwYXlsb2FkGAIgASgJEiYKBWVycm9yGAMgASgLMhcubGl2ZWtpdC5wcm90by5ScGNFcnJvciK+AQoYUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIVCg1pbnZvY2F0aW9uX2lkGAIgAigEEg4KBm1ldGhvZBgDIAIoCRISCgpyZXF1ZXN0X2lkGAQgAigJEhcKD2NhbGxlcl9pZGVudGl0eRgFIAIoCRIPCgdwYXlsb2FkGAYgAigJEhsKE3Jlc3BvbnNlX3RpbWVvdXRfbXMYByACKA1CEKoCDUxpdmVLaXQuUHJvdG8"); + fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIkwKGFJlZ2lzdGVyUnBjTWV0aG9kUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSDgoGbWV0aG9kGAIgAigJIk4KGlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIOCgZtZXRob2QYAiACKAkilgEKIlJwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhUKDWludm9jYXRpb25faWQYAiACKAQSDwoHcGF5bG9hZBgDIAEoCRImCgVlcnJvchgEIAEoCzIXLmxpdmVraXQucHJvdG8uUnBjRXJyb3IiJgoSUGVyZm9ybVJwY1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIhsKGVJlZ2lzdGVyUnBjTWV0aG9kUmVzcG9uc2UiHQobVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlIjQKI1JwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlc3BvbnNlEg0KBWVycm9yGAIgASgJIl8KElBlcmZvcm1ScGNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgdwYXlsb2FkGAIgASgJEiYKBWVycm9yGAMgASgLMhcubGl2ZWtpdC5wcm90by5ScGNFcnJvciK+AQoYUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIVCg1pbnZvY2F0aW9uX2lkGAIgAigEEg4KBm1ldGhvZBgDIAIoCRISCgpyZXF1ZXN0X2lkGAQgAigJEhcKD2NhbGxlcl9pZGVudGl0eRgFIAIoCRIPCgdwYXlsb2FkGAYgAigJEhsKE3Jlc3BvbnNlX3RpbWVvdXRfbXMYByACKA1CEKoCDUxpdmVLaXQuUHJvdG8"); /** * @generated from message livekit.proto.RpcError @@ -191,10 +191,6 @@ export const PerformRpcResponseSchema: GenMessage = /*@__PUR * @generated from message livekit.proto.RegisterRpcMethodResponse */ export type RegisterRpcMethodResponse = Message<"livekit.proto.RegisterRpcMethodResponse"> & { - /** - * @generated from field: required uint64 async_id = 1; - */ - asyncId: bigint; }; /** @@ -208,10 +204,6 @@ export const RegisterRpcMethodResponseSchema: GenMessage & { - /** - * @generated from field: required uint64 async_id = 1; - */ - asyncId: bigint; }; /** @@ -225,11 +217,6 @@ export const UnregisterRpcMethodResponseSchema: GenMessage & { - /** - * @generated from field: required uint64 async_id = 1; - */ - asyncId: bigint; - /** * @generated from field: optional string error = 2; */ From d63c0792612e2b9dfd6d3c0531a8e1535fd72838 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 14:06:23 -0700 Subject: [PATCH 117/126] 2 --- packages/livekit-rtc/rust-sdks | 2 +- packages/livekit-rtc/src/proto/rpc_pb.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 757ec343..d7511a6a 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 757ec343669ea59cf6296179d27fb3a8c4ab3da4 +Subproject commit d7511a6a63e4c22b9d34a4b3ebf238b667bc832b diff --git a/packages/livekit-rtc/src/proto/rpc_pb.ts b/packages/livekit-rtc/src/proto/rpc_pb.ts index 26b9e2ac..e9f6b1e4 100644 --- a/packages/livekit-rtc/src/proto/rpc_pb.ts +++ b/packages/livekit-rtc/src/proto/rpc_pb.ts @@ -24,7 +24,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file rpc.proto. */ export const file_rpc: GenFile = /*@__PURE__*/ - fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIkwKGFJlZ2lzdGVyUnBjTWV0aG9kUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSDgoGbWV0aG9kGAIgAigJIk4KGlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIOCgZtZXRob2QYAiACKAkilgEKIlJwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhUKDWludm9jYXRpb25faWQYAiACKAQSDwoHcGF5bG9hZBgDIAEoCRImCgVlcnJvchgEIAEoCzIXLmxpdmVraXQucHJvdG8uUnBjRXJyb3IiJgoSUGVyZm9ybVJwY1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIhsKGVJlZ2lzdGVyUnBjTWV0aG9kUmVzcG9uc2UiHQobVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlIjQKI1JwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlc3BvbnNlEg0KBWVycm9yGAIgASgJIl8KElBlcmZvcm1ScGNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgdwYXlsb2FkGAIgASgJEiYKBWVycm9yGAMgASgLMhcubGl2ZWtpdC5wcm90by5ScGNFcnJvciK+AQoYUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIVCg1pbnZvY2F0aW9uX2lkGAIgAigEEg4KBm1ldGhvZBgDIAIoCRISCgpyZXF1ZXN0X2lkGAQgAigJEhcKD2NhbGxlcl9pZGVudGl0eRgFIAIoCRIPCgdwYXlsb2FkGAYgAigJEhsKE3Jlc3BvbnNlX3RpbWVvdXRfbXMYByACKA1CEKoCDUxpdmVLaXQuUHJvdG8"); + fileDesc("CglycGMucHJvdG8SDWxpdmVraXQucHJvdG8iNwoIUnBjRXJyb3ISDAoEY29kZRgBIAIoDRIPCgdtZXNzYWdlGAIgAigJEgwKBGRhdGEYAyABKAkikQEKEVBlcmZvcm1ScGNSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIcChRkZXN0aW5hdGlvbl9pZGVudGl0eRgCIAIoCRIOCgZtZXRob2QYAyACKAkSDwoHcGF5bG9hZBgEIAIoCRIbChNyZXNwb25zZV90aW1lb3V0X21zGAUgASgNIkwKGFJlZ2lzdGVyUnBjTWV0aG9kUmVxdWVzdBIgChhsb2NhbF9wYXJ0aWNpcGFudF9oYW5kbGUYASACKAQSDgoGbWV0aG9kGAIgAigJIk4KGlVucmVnaXN0ZXJScGNNZXRob2RSZXF1ZXN0EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIOCgZtZXRob2QYAiACKAkilgEKIlJwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlcXVlc3QSIAoYbG9jYWxfcGFydGljaXBhbnRfaGFuZGxlGAEgAigEEhUKDWludm9jYXRpb25faWQYAiACKAQSDwoHcGF5bG9hZBgDIAEoCRImCgVlcnJvchgEIAEoCzIXLmxpdmVraXQucHJvdG8uUnBjRXJyb3IiJgoSUGVyZm9ybVJwY1Jlc3BvbnNlEhAKCGFzeW5jX2lkGAEgAigEIhsKGVJlZ2lzdGVyUnBjTWV0aG9kUmVzcG9uc2UiHQobVW5yZWdpc3RlclJwY01ldGhvZFJlc3BvbnNlIjQKI1JwY01ldGhvZEludm9jYXRpb25SZXNwb25zZVJlc3BvbnNlEg0KBWVycm9yGAEgASgJIl8KElBlcmZvcm1ScGNDYWxsYmFjaxIQCghhc3luY19pZBgBIAIoBBIPCgdwYXlsb2FkGAIgASgJEiYKBWVycm9yGAMgASgLMhcubGl2ZWtpdC5wcm90by5ScGNFcnJvciK+AQoYUnBjTWV0aG9kSW52b2NhdGlvbkV2ZW50EiAKGGxvY2FsX3BhcnRpY2lwYW50X2hhbmRsZRgBIAIoBBIVCg1pbnZvY2F0aW9uX2lkGAIgAigEEg4KBm1ldGhvZBgDIAIoCRISCgpyZXF1ZXN0X2lkGAQgAigJEhcKD2NhbGxlcl9pZGVudGl0eRgFIAIoCRIPCgdwYXlsb2FkGAYgAigJEhsKE3Jlc3BvbnNlX3RpbWVvdXRfbXMYByACKA1CEKoCDUxpdmVLaXQuUHJvdG8"); /** * @generated from message livekit.proto.RpcError @@ -218,7 +218,7 @@ export const UnregisterRpcMethodResponseSchema: GenMessage & { /** - * @generated from field: optional string error = 2; + * @generated from field: optional string error = 1; */ error: string; }; From 020a3d351bb1bad4d36333989c1b0905936825e8 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 15:28:52 -0700 Subject: [PATCH 118/126] e --- packages/livekit-rtc/src/rpc.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/livekit-rtc/src/rpc.ts b/packages/livekit-rtc/src/rpc.ts index b31987fa..6698b6a0 100644 --- a/packages/livekit-rtc/src/rpc.ts +++ b/packages/livekit-rtc/src/rpc.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 -import { RpcError as RpcError_Proto } from './proto/rpc_pb.js'; +import type { RpcError as RpcError_Proto } from './proto/rpc_pb.js'; /** * Specialized error handling for RPC methods. @@ -53,6 +53,7 @@ export class RpcError extends Error { UNSUPPORTED_METHOD: 1400, RECIPIENT_NOT_FOUND: 1401, REQUEST_PAYLOAD_TOO_LARGE: 1402, + UNSUPPORTED_SERVER: 1403, } as const; /** @@ -69,6 +70,7 @@ export class RpcError extends Error { UNSUPPORTED_METHOD: 'Method not supported at destination', RECIPIENT_NOT_FOUND: 'Recipient not found', REQUEST_PAYLOAD_TOO_LARGE: 'Request payload too large', + UNSUPPORTED_SERVER: 'RPC not supported by server', } as const; /** From 70c1f2b805a9bbcc5d938ba72233a8685d2f3801 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 21:23:37 -0700 Subject: [PATCH 119/126] c --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index d7511a6a..5742ac47 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit d7511a6a63e4c22b9d34a4b3ebf238b667bc832b +Subproject commit 5742ac4762948f5394b4af7eeb3abd4ab5b3ee96 From b1966684b10fd118d63cdd64f13a900a72d9293b Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 21:24:51 -0700 Subject: [PATCH 120/126] clean --- examples/rpc/index.ts | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 304d32c8..2dac7490 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -64,16 +64,26 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await greetersRoom.localParticipant?.registerRpcMethod( 'arrival', // eslint-disable-next-line @typescript-eslint/no-unused-vars - async (requestId: string, callerIdentity: string, payload: string, responseTimeoutMs: number) => { + async ( + requestId: string, + callerIdentity: string, + payload: string, + responseTimeoutMs: number, + ) => { console.log(`[Greeter] Oh ${callerIdentity} arrived and said "${payload}"`); await new Promise((resolve) => setTimeout(resolve, 2000)); - return "Welcome and have a wonderful day!"; + return 'Welcome and have a wonderful day!'; }, ); await mathGeniusRoom.localParticipant?.registerRpcMethod( 'square-root', - async (requestId: string, callerIdentity: string, payload: string, responseTimeoutMs: number) => { + async ( + requestId: string, + callerIdentity: string, + payload: string, + responseTimeoutMs: number, + ) => { const jsonData = JSON.parse(payload); const number = jsonData.number; console.log( @@ -92,7 +102,12 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) await mathGeniusRoom.localParticipant?.registerRpcMethod( 'divide', // eslint-disable-next-line @typescript-eslint/no-unused-vars - async (requestId: string, callerIdentity: string, payload: string, responseTimeoutMs: number) => { + async ( + requestId: string, + callerIdentity: string, + payload: string, + responseTimeoutMs: number, + ) => { const jsonData = JSON.parse(payload); const { numerator, denominator } = jsonData; console.log( @@ -112,7 +127,7 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) }; const performGreeting = async (room: Room): Promise => { - console.log('[Caller] Letting the greeter know that I\'ve arrived'); + console.log("[Caller] Letting the greeter know that I've arrived"); try { const response = await room.localParticipant!.performRpc('greeter', 'arrival', 'Hello'); console.log(`[Caller] That's nice, the greeter said: "${response}"`); @@ -125,7 +140,11 @@ const performGreeting = async (room: Room): Promise => { const performSquareRoot = async (room: Room): Promise => { console.log("[Caller] What's the square root of 16?"); try { - const response = await room.localParticipant!.performRpc('math-genius', 'square-root', JSON.stringify({ number: 16 })); + const response = await room.localParticipant!.performRpc( + 'math-genius', + 'square-root', + JSON.stringify({ number: 16 }), + ); const parsedResponse = JSON.parse(response); console.log(`[Caller] Nice, the answer was ${parsedResponse.result}`); } catch (error) { @@ -140,7 +159,7 @@ const performQuantumHypergeometricSeries = async (room: Room): Promise => const response = await room.localParticipant!.performRpc( 'math-genius', 'quantum-hypergeometric-series', - JSON.stringify({ number: 42 }) + JSON.stringify({ number: 42 }), ); const parsedResponse = JSON.parse(response); console.log(`[Caller] genius says ${parsedResponse.result}!`); @@ -163,7 +182,7 @@ const performDivision = async (room: Room): Promise => { const response = await room.localParticipant!.performRpc( 'math-genius', 'divide', - JSON.stringify({ numerator: 10, denominator: 0 }) + JSON.stringify({ numerator: 10, denominator: 0 }), ); const parsedResponse = JSON.parse(response); console.log(`[Caller] The result is ${parsedResponse.result}`); From 90a66888600f4ec6baf5af7c7ef1224d430a504f Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Wed, 23 Oct 2024 21:28:14 -0700 Subject: [PATCH 121/126] unneeded --- examples/rpc/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index 2dac7490..d18697fd 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -23,7 +23,7 @@ async function main() { ]); // Register all methods for the receiving participant - await registerReceiverMethods(greetersRoom, mathGeniusRoom); + registerReceiverMethods(greetersRoom, mathGeniusRoom); try { console.log('\n\nRunning greeting example...'); @@ -60,8 +60,8 @@ async function main() { process.exit(0); } -const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room): Promise => { - await greetersRoom.localParticipant?.registerRpcMethod( +const registerReceiverMethods = (greetersRoom: Room, mathGeniusRoom: Room) => { + greetersRoom.localParticipant?.registerRpcMethod( 'arrival', // eslint-disable-next-line @typescript-eslint/no-unused-vars async ( @@ -76,7 +76,7 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) }, ); - await mathGeniusRoom.localParticipant?.registerRpcMethod( + mathGeniusRoom.localParticipant?.registerRpcMethod( 'square-root', async ( requestId: string, @@ -99,7 +99,7 @@ const registerReceiverMethods = async (greetersRoom: Room, mathGeniusRoom: Room) }, ); - await mathGeniusRoom.localParticipant?.registerRpcMethod( + mathGeniusRoom.localParticipant?.registerRpcMethod( 'divide', // eslint-disable-next-line @typescript-eslint/no-unused-vars async ( @@ -199,7 +199,7 @@ const performDivision = async (room: Room): Promise => { } }; -const createToken = (identity: string, roomName: string) => { +const createToken = async (identity: string, roomName: string) => { const token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET, { identity, }); @@ -209,7 +209,7 @@ const createToken = (identity: string, roomName: string) => { canPublish: true, canSubscribe: true, }); - return token.toJwt(); + return await token.toJwt(); }; const connectParticipant = async (identity: string, roomName: string): Promise => { From 3907a8933ba655fba84824b36756cb22823079b5 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 24 Oct 2024 15:33:27 -0700 Subject: [PATCH 122/126] r --- packages/livekit-rtc/rust-sdks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/rust-sdks b/packages/livekit-rtc/rust-sdks index 5742ac47..2aa9500a 160000 --- a/packages/livekit-rtc/rust-sdks +++ b/packages/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit 5742ac4762948f5394b4af7eeb3abd4ab5b3ee96 +Subproject commit 2aa9500ad36c28b694cab671d742bfb01db5d75b From d64e40c38dfedd98dad8891f3aad5fd1a1d5e5a8 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 24 Oct 2024 15:35:47 -0700 Subject: [PATCH 123/126] fmt --- packages/livekit-rtc/src/participant.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 3f552aa2..6921bc51 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -28,26 +28,26 @@ import type { import { ChatMessageSchema, EditChatMessageRequestSchema, + PerformRpcRequestSchema, PublishDataRequestSchema, PublishSipDtmfRequestSchema, PublishTrackRequestSchema, PublishTranscriptionRequestSchema, + RegisterRpcMethodRequestSchema, + RpcMethodInvocationResponseRequestSchema, SendChatMessageRequestSchema, SetLocalAttributesRequestSchema, SetLocalMetadataRequestSchema, SetLocalNameRequestSchema, UnpublishTrackRequestSchema, + UnregisterRpcMethodRequestSchema, } from './proto/room_pb.js'; import { TranscriptionSegmentSchema } from './proto/room_pb.js'; import type { PerformRpcCallback, - PerformRpcRequest, PerformRpcResponse, - RegisterRpcMethodRequest, RegisterRpcMethodResponse, - RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, - UnregisterRpcMethodRequest, UnregisterRpcMethodResponse, } from './proto/rpc_pb.js'; import { RpcError } from './rpc.js'; @@ -387,13 +387,13 @@ export class LocalParticipant extends Participant { payload: string, responseTimeoutMs?: number, ): Promise { - const req = { + const req = create(PerformRpcRequestSchema, { localParticipantHandle: this.ffi_handle.handle, destinationIdentity, method, payload, responseTimeoutMs, - } as PerformRpcRequest; + }); const res = FfiClient.instance.request({ message: { case: 'performRpc', value: req }, @@ -453,10 +453,10 @@ export class LocalParticipant extends Participant { ) { this.rpcHandlers.set(method, handler); - const req = { + const req = create(RegisterRpcMethodRequestSchema, { localParticipantHandle: this.ffi_handle.handle, method, - } as RegisterRpcMethodRequest; + }); FfiClient.instance.request({ message: { case: 'registerRpcMethod', value: req }, @@ -471,10 +471,10 @@ export class LocalParticipant extends Participant { unregisterRpcMethod(method: string) { this.rpcHandlers.delete(method); - const req = { + const req = create(UnregisterRpcMethodRequestSchema, { localParticipantHandle: this.ffi_handle.handle, method, - } as UnregisterRpcMethodRequest; + }); FfiClient.instance.request({ message: { case: 'unregisterRpcMethod', value: req }, @@ -513,12 +513,12 @@ export class LocalParticipant extends Participant { } } - const req = { + const req = create(RpcMethodInvocationResponseRequestSchema, { localParticipantHandle: this.ffi_handle.handle, invocationId, error: responseError ? responseError.toProto() : undefined, payload: responsePayload ?? undefined, - } as RpcMethodInvocationResponseRequest; + }); const res = FfiClient.instance.request({ message: { case: 'rpcMethodInvocationResponse', value: req }, From f1f1648a5ee80ea4d4460914d42226d3bb2af2cc Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 24 Oct 2024 15:39:33 -0700 Subject: [PATCH 124/126] fix --- packages/livekit-rtc/src/participant.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index 6921bc51..ee608405 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -28,20 +28,22 @@ import type { import { ChatMessageSchema, EditChatMessageRequestSchema, - PerformRpcRequestSchema, PublishDataRequestSchema, PublishSipDtmfRequestSchema, PublishTrackRequestSchema, PublishTranscriptionRequestSchema, - RegisterRpcMethodRequestSchema, - RpcMethodInvocationResponseRequestSchema, SendChatMessageRequestSchema, SetLocalAttributesRequestSchema, SetLocalMetadataRequestSchema, SetLocalNameRequestSchema, UnpublishTrackRequestSchema, - UnregisterRpcMethodRequestSchema, } from './proto/room_pb.js'; +import { + PerformRpcRequestSchema, + RegisterRpcMethodRequestSchema, + RpcMethodInvocationResponseRequestSchema, + UnregisterRpcMethodRequestSchema, +} from './proto/rpc_pb.js'; import { TranscriptionSegmentSchema } from './proto/room_pb.js'; import type { PerformRpcCallback, From bd305d2ef5349988415135d636c4f4927f08323d Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 24 Oct 2024 15:39:59 -0700 Subject: [PATCH 125/126] fmt --- packages/livekit-rtc/src/participant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livekit-rtc/src/participant.ts b/packages/livekit-rtc/src/participant.ts index ee608405..16d00dd0 100644 --- a/packages/livekit-rtc/src/participant.ts +++ b/packages/livekit-rtc/src/participant.ts @@ -38,13 +38,13 @@ import { SetLocalNameRequestSchema, UnpublishTrackRequestSchema, } from './proto/room_pb.js'; +import { TranscriptionSegmentSchema } from './proto/room_pb.js'; import { PerformRpcRequestSchema, RegisterRpcMethodRequestSchema, RpcMethodInvocationResponseRequestSchema, UnregisterRpcMethodRequestSchema, } from './proto/rpc_pb.js'; -import { TranscriptionSegmentSchema } from './proto/room_pb.js'; import type { PerformRpcCallback, PerformRpcResponse, From 1afbd448188183e503055c2a29ea172051fd5e1b Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 24 Oct 2024 15:45:47 -0700 Subject: [PATCH 126/126] lint --- examples/rpc/index.ts | 7 +++++-- packages/livekit-rtc/src/ffi_client.ts | 3 ++- packages/livekit-rtc/src/index.ts | 10 ++++++---- packages/livekit-rtc/src/video_frame.ts | 6 +++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/examples/rpc/index.ts b/examples/rpc/index.ts index d18697fd..9ee62657 100644 --- a/examples/rpc/index.ts +++ b/examples/rpc/index.ts @@ -63,11 +63,12 @@ async function main() { const registerReceiverMethods = (greetersRoom: Room, mathGeniusRoom: Room) => { greetersRoom.localParticipant?.registerRpcMethod( 'arrival', - // eslint-disable-next-line @typescript-eslint/no-unused-vars async ( + // eslint-disable-next-line @typescript-eslint/no-unused-vars requestId: string, callerIdentity: string, payload: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars responseTimeoutMs: number, ) => { console.log(`[Greeter] Oh ${callerIdentity} arrived and said "${payload}"`); @@ -79,6 +80,7 @@ const registerReceiverMethods = (greetersRoom: Room, mathGeniusRoom: Room) => { mathGeniusRoom.localParticipant?.registerRpcMethod( 'square-root', async ( + // eslint-disable-next-line @typescript-eslint/no-unused-vars requestId: string, callerIdentity: string, payload: string, @@ -101,11 +103,12 @@ const registerReceiverMethods = (greetersRoom: Room, mathGeniusRoom: Room) => { mathGeniusRoom.localParticipant?.registerRpcMethod( 'divide', - // eslint-disable-next-line @typescript-eslint/no-unused-vars async ( + // eslint-disable-next-line @typescript-eslint/no-unused-vars requestId: string, callerIdentity: string, payload: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars responseTimeoutMs: number, ) => { const jsonData = JSON.parse(payload); diff --git a/packages/livekit-rtc/src/ffi_client.ts b/packages/livekit-rtc/src/ffi_client.ts index 982fbbb5..b68b24df 100644 --- a/packages/livekit-rtc/src/ffi_client.ts +++ b/packages/livekit-rtc/src/ffi_client.ts @@ -1,7 +1,8 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 -import { MessageInitShape, create, fromBinary, toBinary } from '@bufbuild/protobuf'; +import type { MessageInitShape} from '@bufbuild/protobuf'; +import { create, fromBinary, toBinary } from '@bufbuild/protobuf'; import type { TypedEventEmitter as TypedEmitter } from '@livekit/typed-emitter'; import EventEmitter from 'events'; import { diff --git a/packages/livekit-rtc/src/index.ts b/packages/livekit-rtc/src/index.ts index 3da53c59..7f34ed5f 100644 --- a/packages/livekit-rtc/src/index.ts +++ b/packages/livekit-rtc/src/index.ts @@ -1,15 +1,17 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 -import { MessageInitShape, create } from '@bufbuild/protobuf'; -import { +import type { MessageInitShape} from '@bufbuild/protobuf'; +import { create } from '@bufbuild/protobuf'; +import type { AudioEncoding, + TrackPublishOptionsSchema, + VideoEncoding} from './proto/room_pb.js'; +import { AudioEncodingSchema, IceServerSchema, type IceServer as IceServerType, - TrackPublishOptionsSchema, type TrackPublishOptions as TrackPublishOptionsType, - VideoEncoding, VideoEncodingSchema, } from './proto/room_pb.js'; import { TrackSource } from './proto/track_pb.js'; diff --git a/packages/livekit-rtc/src/video_frame.ts b/packages/livekit-rtc/src/video_frame.ts index fc835299..1865bd32 100644 --- a/packages/livekit-rtc/src/video_frame.ts +++ b/packages/livekit-rtc/src/video_frame.ts @@ -4,11 +4,11 @@ import { create } from '@bufbuild/protobuf'; import { FfiClient } from './ffi_client.js'; import { FfiRequestSchema } from './proto/ffi_pb.js'; -import type { OwnedVideoBuffer, VideoConvertResponse } from './proto/video_frame_pb.js'; -import { +import type { OwnedVideoBuffer, VideoConvertResponse , VideoBufferInfo, + VideoBufferInfo_ComponentInfo} from './proto/video_frame_pb.js'; +import { VideoBufferInfoSchema, - VideoBufferInfo_ComponentInfo, VideoBufferInfo_ComponentInfoSchema, VideoBufferType, } from './proto/video_frame_pb.js';