Skip to content

Commit 8c12be6

Browse files
bump protocol to v1.46.4 and expose client_protocol via FFI (#1121)
### PR description - bumps the protocol to v1.46.4 and adds the `livekit_analytics.proto` messages to the generated stubs. - exposes participant `client_protocol` via FFI - Adds a `remove_participant_with_options` method that allows to pass new remove options to the API without a previous `remove_participant` call breaking. ### Breaking changes for the `livekit-api` crate I've added a `derive(default)` and an additional (option) field to the EgressListOptions struct. I don't see a good way around this though. Open for suggestions. --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 68979fc commit 8c12be6

14 files changed

Lines changed: 5934 additions & 411 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
livekit: patch
3+
livekit-api: minor
4+
livekit-datatrack: patch
5+
livekit-ffi: patch
6+
livekit-protocol: patch
7+
livekit-uniffi: patch
8+
---
9+
10+
bump protocol to v1.46.4 - #1121 (@lukasIO)

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Generated from the LiveKit protocol definitions; do not edit by hand.
2+
livekit-protocol/src/livekit.rs linguist-generated=true
3+
livekit-protocol/src/livekit.serde.rs linguist-generated=true

livekit-api/src/services/egress.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,20 @@ pub enum TrackEgressOutput {
8484
WebSocket(String),
8585
}
8686

87-
#[derive(Debug, Clone)]
87+
#[derive(Debug, Clone, Default)]
8888
pub enum EgressListFilter {
89+
#[default]
8990
All,
9091
Egress(String),
9192
Room(String),
9293
}
9394

94-
#[derive(Debug, Clone)]
95+
#[derive(Debug, Clone, Default)]
9596
pub struct EgressListOptions {
9697
pub filter: EgressListFilter,
9798
pub active: bool,
99+
/// Pagination token, e.g. from a previous response's `next_page_token`.
100+
pub page_token: Option<proto::TokenPagination>,
98101
}
99102

100103
const SVC: &str = "Egress";
@@ -340,7 +343,12 @@ impl EgressClient {
340343
.request(
341344
SVC,
342345
"ListEgress",
343-
proto::ListEgressRequest { room_name, egress_id, active: options.active },
346+
proto::ListEgressRequest {
347+
room_name,
348+
egress_id,
349+
active: options.active,
350+
page_token: options.page_token,
351+
},
344352
self.base
345353
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
346354
)

livekit-api/src/services/room.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ pub struct UpdateParticipantOptions {
3939
pub name: String, // No effect if left empty
4040
}
4141

42+
#[derive(Debug, Clone, Default)]
43+
pub struct RemoveParticipantOptions {
44+
/// Revoke all tokens issued to this participant before this Unix timestamp (ms).
45+
pub revoke_token_ts: i64,
46+
}
47+
4248
#[derive(Debug, Clone, Default)]
4349
pub struct SendDataOptions {
4450
pub kind: proto::data_packet::Kind,
@@ -206,6 +212,7 @@ impl RoomClient {
206212
proto::RoomParticipantIdentity {
207213
room: room.to_owned(),
208214
identity: identity.to_owned(),
215+
..Default::default()
209216
},
210217
self.base.auth_header(
211218
VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() },
@@ -217,13 +224,24 @@ impl RoomClient {
217224
}
218225

219226
pub async fn remove_participant(&self, room: &str, identity: &str) -> ServiceResult<()> {
227+
self.remove_participant_with_options(room, identity, RemoveParticipantOptions::default())
228+
.await
229+
}
230+
231+
pub async fn remove_participant_with_options(
232+
&self,
233+
room: &str,
234+
identity: &str,
235+
options: RemoveParticipantOptions,
236+
) -> ServiceResult<()> {
220237
self.client
221238
.request(
222239
SVC,
223240
"RemoveParticipant",
224241
proto::RoomParticipantIdentity {
225242
room: room.to_owned(),
226243
identity: identity.to_owned(),
244+
revoke_token_ts: options.revoke_token_ts,
227245
},
228246
self.base.auth_header(
229247
VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() },

livekit-api/src/services/sip.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ pub struct CreateSIPInboundTrunkOptions {
7878
pub max_call_duration: Option<Duration>,
7979
pub ringing_timeout: Option<Duration>,
8080
pub krisp_enabled: Option<bool>,
81+
/// Authentication realm advertised on inbound SIP invites.
82+
pub auth_realm: Option<String>,
8183
}
8284

8385
#[derive(Default, Clone, Debug)]
@@ -191,6 +193,7 @@ impl SIPClient {
191193
allowed_addresses: options.allowed_addresses.unwrap_or_default(),
192194
auth_username: options.auth_username.unwrap_or_default(),
193195
auth_password: options.auth_password.unwrap_or_default(),
196+
auth_realm: options.auth_realm.unwrap_or_default(),
194197
headers: options.headers.unwrap_or_default(),
195198
headers_to_attributes: options.headers_to_attributes.unwrap_or_default(),
196199
attributes_to_headers: options.attributes_to_headers.unwrap_or_default(),

livekit-ffi-node-bindings/proto/participant_pb.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ export declare class ParticipantInfo extends Message<ParticipantInfo> {
294294
*/
295295
permission?: ParticipantPermission;
296296

297+
/**
298+
* @generated from field: required int32 client_protocol = 12;
299+
*/
300+
clientProtocol?: number;
301+
297302
constructor(data?: PartialMessage<ParticipantInfo>);
298303

299304
static readonly runtime: typeof proto2;

livekit-ffi-node-bindings/proto/participant_pb.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const ParticipantInfo = /*@__PURE__*/ proto2.makeMessageType(
110110
{ no: 9, name: "joined_at", kind: "scalar", T: 3 /* ScalarType.INT64 */, req: true },
111111
{ no: 10, name: "kind_details", kind: "enum", T: proto2.getEnumType(ParticipantKindDetail), repeated: true },
112112
{ no: 11, name: "permission", kind: "message", T: ParticipantPermission, opt: true },
113+
{ no: 12, name: "client_protocol", kind: "scalar", T: 5 /* ScalarType.INT32 */, req: true },
113114
],
114115
);
115116

livekit-ffi/protocol/participant.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ message ParticipantInfo {
3333
required int64 joined_at = 9;
3434
repeated ParticipantKindDetail kind_details = 10;
3535
optional ParticipantPermission permission = 11;
36+
required int32 client_protocol = 12;
3637
}
3738

3839
message OwnedParticipant {

livekit-ffi/src/conversion/participant.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ impl From<&Participant> for proto::ParticipantInfo {
4848
.map(|k| proto::ParticipantKindDetail::from(k).into())
4949
.collect(),
5050
permission,
51+
client_protocol: participant.client_protocol(),
5152
}
5253
}
5354
}

livekit-protocol/generate_proto.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ protoc \
3434
$PROTOCOL/livekit_models.proto \
3535
$PROTOCOL/livekit_connector.proto \
3636
$PROTOCOL/livekit_connector_whatsapp.proto \
37-
$PROTOCOL/livekit_connector_twilio.proto
37+
$PROTOCOL/livekit_connector_twilio.proto \
38+
$PROTOCOL/livekit_analytics.proto

0 commit comments

Comments
 (0)