-
Notifications
You must be signed in to change notification settings - Fork 0
/
livekitx_room.proto
277 lines (229 loc) · 6.43 KB
/
livekitx_room.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
syntax = "proto3";
package livekitx;
option go_package = "github.com/lgcshy/protocol/livekitx";
import "livekitx_model.proto";
// Room service that can be performed on any node
// they are Twirp-based HTTP req/responses
service RoomService {
// Creates a room with settings. Requires `roomCreate` permission.
// This method is optional; rooms are automatically created when clients connect to them for the first time.
rpc CreateRoom(CreateRoomRequest) returns (Room);
// List rooms that are active on the server. Requires `roomList` permission.
rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse);
// Deletes an existing room by name or id. Requires `roomCreate` permission.
// DeleteRoom will disconnect all participants that are currently in the room.
rpc DeleteRoom(DeleteRoomRequest) returns (DeleteRoomResponse);
// Lists participants in a room, Requires `roomAdmin`
rpc ListParticipants(ListParticipantsRequest) returns (ListParticipantsResponse);
// Get information on a specific participant, Requires `roomAdmin`
rpc GetParticipant(RoomParticipantIdentity) returns (ParticipantInfo);
// Removes a participant from room. Requires `roomAdmin`
rpc RemoveParticipant(RoomParticipantIdentity) returns (RemoveParticipantResponse);
// Mute/unmute a participant's track, Requires `roomAdmin`
rpc MutePublishedTrack(MuteRoomTrackRequest) returns (MuteRoomTrackResponse);
// Update participant metadata, will cause updates to be broadcasted to everyone in the room. Requires `roomAdmin`
rpc UpdateParticipant(UpdateParticipantRequest) returns (ParticipantInfo);
// Subscribes or unsubscribe a participant from tracks. Requires `roomAdmin`
rpc UpdateSubscriptions(UpdateSubscriptionsRequest) returns (UpdateSubscriptionsResponse);
// Send data over data channel to participants in a room, Requires `roomAdmin`
rpc SendData(SendDataRequest) returns (SendDataResponse);
// Update room metadata, will cause updates to be broadcasted to everyone in the room, Requires `roomAdmin`
rpc UpdateRoomMetadata (UpdateRoomMetadataRequest) returns (Room);
// PushMsg push by identity
rpc PushMsg(PushMsgRequest) returns (PushMsgReply);
rpc Broadcast(BroadcastRequest) returns (BroadcastReply);
// BroadcastRoom broadcast to one room
rpc BroadcastRoom(BroadcastRoomRequest) returns (BroadcastRoomReply);
}
message CreateRoomRequest {
// name of the room
string name = 1;
// number of seconds to keep the room open if no one joins
uint32 empty_timeout = 2;
// limit number of participants that can be in a room
uint32 max_participants = 3;
// override the node room is allocated to, for debugging
string node_id = 4;
// metadata of room
string metadata = 5;
}
message ListRoomsRequest {
// when set, will only return rooms with name match
repeated string names = 1;
}
message ListRoomsResponse {
repeated Room rooms = 1;
}
message DeleteRoomRequest {
// name of the room
string room = 1;
}
message DeleteRoomResponse {
}
message ListParticipantsRequest {
// name of the room
string room = 1;
}
message ListParticipantsResponse {
repeated ParticipantInfo participants = 1;
}
message RoomParticipantIdentity {
// name of the room
string room = 1;
// identity of the participant
string identity = 2;
}
message RemoveParticipantResponse {
}
message MuteRoomTrackRequest {
// name of the room
string room = 1;
string identity = 2;
// sid of the track to mute
string track_sid = 3;
// set to true to mute, false to unmute
bool muted = 4;
}
message MuteRoomTrackResponse {
TrackInfo track = 1;
}
message ParticipantPermission {
// allow participant to subscribe to other tracks in the room
bool can_subscribe = 1;
// allow participant to publish new tracks to room
bool can_publish = 2;
// allow participant to publish data
bool can_publish_data = 3;
}
message UpdateParticipantRequest {
string room = 1;
string identity = 2;
// metadata to update. skipping updates if left empty
string metadata = 3;
// set to update the participant's permissions
ParticipantPermission permission = 4;
}
message UpdateSubscriptionsRequest {
string room = 1;
string identity = 2;
// list of sids of tracks
repeated string track_sids = 3;
// set to true to subscribe, false to unsubscribe from tracks
bool subscribe = 4;
// list of participants and their tracks
repeated ParticipantTracks participant_tracks = 5;
}
message UpdateSubscriptionsResponse {
// empty for now
}
message SendDataRequest {
string room = 1;
bytes data = 2;
DataPacket.Kind kind = 3;
repeated string destination_sids = 4;
string identity = 5;
}
message SendDataResponse {
//
}
message UpdateRoomMetadataRequest {
string room = 1;
// metadata to update. skipping updates if left empty
string metadata = 2;
}
//im
message Proto {
int32 ver = 1;
int32 op = 2;
int32 seq = 3;
bytes body = 4;
}
// im msg type
enum MESSAGE_TYPE {
TEXT = 0; //文本 图片 语音 视频 音乐 图文 表情 位置
PICTURE = 1;
VOICE = 2;
//VIDEO = 3;
MUSIC = 4;
EMOTION = 5;
LOCATION = 6;
}
// text message
message TextMessage {
string content = 1;
}
message PictureMessage {
}
message From {
uint64 id = 1;
string identity = 2;
string name = 3;
string avatar = 4;
}
message Target {
uint64 id = 1;
string identity = 2;
string name = 3;
string avatar = 4;
}
message PushMsgRequest {
oneof message {
TextMessage text = 1;
PictureMessage picture = 2;
}
repeated string keys = 3;
string room = 4;
bytes data = 5;
string identity = 6;
string content = 7;
From from = 8;
Target to = 9;
}
message PushMsgReply {}
message BroadcastRequest {
string room = 1;
string identity = 2;
Proto proto = 3;
bytes data = 4;
string content = 5;
}
message BroadcastReply{}
message BroadcastRoomRequest {
string room = 1;
string identity = 2;
Proto proto = 3;
bytes data = 4;
string content = 5;
string type = 6;
}
message BroadcastRoomReply{}
message PushMsg {
oneof message {
TextMessage text = 1;
PictureMessage pic = 2;
}
enum Type {
PUSH = 0;
ROOM = 1;
BROADCAST = 2;
}
Type type = 3;
From from = 4;
Target to = 5;
string data = 6;
}
message WhiteboardRequest {
oneof message {
TextMessage text = 1;
PictureMessage picture = 2;
}
repeated string keys = 3;
string room = 4;
bytes data = 5;
string identity = 6;
string content = 7;
From from = 8;
Target to = 9;
string type = 10;
}
message WhiteboardReply {}