forge
Explore
Log in

Don't you dare go Hollow

yumush

Clone
★ 0

0 watching0 forksRustAGPL-3.06.8 MiB27ceb05Tahinli8 hours ago399 commits

call.rs798 lines, 18.8 KiBHistoryRawDownload
1use bitcode::{Decode, DecodeOwned, Encode};
2
3use crate::{
4 constant::{MAXIMUM_AVATAR_BYTES, MAXIMUM_MESSAGE_LENGTH},
5 error::Error,
6 model::Hue,
7 model::{
8 Account, AdminActionKind, AdminLogEntry, AttachmentInfo, BackupInfo, Ban, BanScope,
9 Community, CommunitySummary, CommunityUsage, DayStat, Edit, Friends, Id, Invitation,
10 InviteCode, LogEntry, Member, Message, MessageHit, Overview, Presence, Rank, ReleaseInfo,
11 Report, ReportStatus, ServerBan, ServerSettings, SessionInfo, Unread, UpdateClient, Usage,
12 User, VoiceRoom,
13 },
14 share::{Codec, Kind, Quality, Share, Source},
15 stats::Stats,
16 validate::{
17 validate_avatar_size, validate_community_name, validate_forward, validate_new_message,
18 validate_password, validate_poll, validate_reaction, validate_reason,
19 validate_server_settings, validate_status, validate_username,
20 },
21};
22
23#[derive(Debug, Clone, Copy, PartialEq, Eq)]
24pub enum Gate {
25 Guest,
26 User,
27 Builder,
28}
29
30pub trait Call: Encode + DecodeOwned + Send + 'static {
31 type Reply: Encode + DecodeOwned + Send + 'static;
32 const GATE: Gate;
33
34 fn into_request(self) -> Request;
35
36 fn validate(&self) -> Result<(), Error> {
37 Ok(())
38 }
39}
40
41macro_rules! calls {
42 ($($name:ident: $gate:ident -> $reply:ty $(, |$c:ident| $check:expr)?;)*) => {
43 #[derive(Debug, Clone, Encode, Decode)]
44 pub enum Request {
45 $($name($name),)*
46 }
47
48 $(
49 impl Call for $name {
50 type Reply = $reply;
51 const GATE: Gate = Gate::$gate;
52
53 fn into_request(self) -> Request {
54 Request::$name(self)
55 }
56
57 $(
58 fn validate(&self) -> Result<(), Error> {
59 let $c = self;
60 $check
61 }
62 )?
63 }
64 )*
65 };
66}
67
68#[derive(Debug, Clone, Encode, Decode)]
69pub struct GetSettings;
70
71#[derive(Debug, Clone, Encode, Decode)]
72pub struct GetUser {
73 pub user_id: Id,
74}
75
76#[derive(Debug, Clone, Encode, Decode)]
77pub struct UpdateUser {
78 pub username: String,
79}
80
81#[derive(Debug, Clone, Encode, Decode)]
82pub struct UpdateStatus {
83 pub status: String,
84}
85
86#[derive(Debug, Clone, Encode, Decode)]
87pub struct UpdateHue {
88 pub hue: Option<Hue>,
89}
90
91#[derive(Debug, Clone, Encode, Decode)]
92pub struct UpdatePresence {
93 pub presence: Presence,
94}
95
96#[derive(Debug, Clone, Encode, Decode)]
97pub struct ListPresences;
98
99#[derive(Debug, Clone, Encode, Decode)]
100pub struct UpdateAvatar {
101 pub image: Vec<u8>,
102}
103
104#[derive(Debug, Clone, Encode, Decode)]
105pub struct RemoveAvatar;
106
107#[derive(Debug, Clone, Encode, Decode)]
108pub struct GetAvatar {
109 pub avatar_id: Id,
110}
111
112#[derive(Debug, Clone, Encode, Decode)]
113pub struct ListSessions {
114 pub user_id: Id,
115}
116
117#[derive(Debug, Clone, Encode, Decode)]
118pub struct RevokeSession {
119 pub user_id: Id,
120 pub session_id: Id,
121}
122
123#[derive(Debug, Clone, Encode, Decode)]
124pub struct CreateCommunity {
125 pub name: String,
126}
127
128#[derive(Debug, Clone, Encode, Decode)]
129pub struct GetCommunity {
130 pub community_id: Id,
131}
132
133#[derive(Debug, Clone, Encode, Decode)]
134pub struct UpdateCommunity {
135 pub community_id: Id,
136 pub name: String,
137}
138
139#[derive(Debug, Clone, Encode, Decode)]
140pub struct UpdateCommunityAvatar {
141 pub community_id: Id,
142 pub image: Option<Vec<u8>>,
143}
144
145#[derive(Debug, Clone, Encode, Decode)]
146pub struct DeleteCommunity {
147 pub community_id: Id,
148}
149
150#[derive(Debug, Clone, Encode, Decode)]
151pub struct LeaveCommunity {
152 pub community_id: Id,
153}
154
155#[derive(Debug, Clone, Encode, Decode)]
156pub struct ListCommunities;
157
158#[derive(Debug, Clone, Encode, Decode)]
159pub struct ListMembers {
160 pub community_id: Id,
161}
162
163#[derive(Debug, Clone, Encode, Decode)]
164pub struct Kick {
165 pub community_id: Id,
166 pub user_id: Id,
167 pub reason: Option<String>,
168}
169
170#[derive(Debug, Clone, Encode, Decode)]
171pub struct BanMember {
172 pub community_id: Id,
173 pub user_id: Id,
174 pub reason: Option<String>,
175}
176
177#[derive(Debug, Clone, Encode, Decode)]
178pub struct Unban {
179 pub community_id: Id,
180 pub user_id: Id,
181}
182
183#[derive(Debug, Clone, Encode, Decode)]
184pub struct ListBans {
185 pub community_id: Id,
186}
187
188#[derive(Debug, Clone, Encode, Decode)]
189pub struct SetRank {
190 pub community_id: Id,
191 pub user_id: Id,
192 pub rank: Rank,
193}
194
195#[derive(Debug, Clone, Encode, Decode)]
196pub struct ListLogs {
197 pub community_id: Id,
198}
199
200#[derive(Debug, Clone, Encode, Decode)]
201pub struct CreateMessage {
202 pub community_id: Id,
203 pub body: String,
204 pub attachments: Vec<Id>,
205 pub reply_to: Option<Id>,
206}
207
208#[derive(Debug, Clone, Encode, Decode)]
209pub struct ForwardMessages {
210 pub message_ids: Vec<Id>,
211 pub community_id: Id,
212 pub snippet: bool,
213}
214
215#[derive(Debug, Clone, Encode, Decode)]
216pub struct UpdateMessage {
217 pub message_id: Id,
218 pub body: String,
219}
220
221#[derive(Debug, Clone, Encode, Decode)]
222pub struct DeleteMessage {
223 pub message_id: Id,
224}
225
226#[derive(Debug, Clone, Encode, Decode)]
227pub struct ListEdits {
228 pub message_id: Id,
229}
230
231#[derive(Debug, Clone, Encode, Decode)]
232pub struct CreatePoll {
233 pub community_id: Id,
234 pub question: String,
235 pub options: Vec<String>,
236 pub multiple: bool,
237 pub public: bool,
238 pub duration: Option<u32>,
239}
240
241#[derive(Debug, Clone, Encode, Decode)]
242pub struct Vote {
243 pub message_id: Id,
244 pub positions: Vec<u32>,
245}
246
247#[derive(Debug, Clone, Encode, Decode)]
248pub struct ClosePoll {
249 pub message_id: Id,
250}
251
252#[derive(Debug, Clone, Encode, Decode)]
253pub struct MyVotes {
254 pub message_id: Id,
255}
256
257#[derive(Debug, Clone, Encode, Decode)]
258pub struct React {
259 pub message_id: Id,
260 pub emoji: String,
261}
262
263#[derive(Debug, Clone, Encode, Decode)]
264pub struct Pin {
265 pub message_id: Id,
266 pub pinned: bool,
267}
268
269#[derive(Debug, Clone, Encode, Decode)]
270pub struct ListPins {
271 pub community_id: Id,
272}
273
274#[derive(Debug, Clone, Encode, Decode)]
275pub struct ListMessages {
276 pub community_id: Id,
277 pub before: Option<Id>,
278}
279
280#[derive(Debug, Clone, Encode, Decode)]
281pub struct ListUnreads;
282
283#[derive(Debug, Clone, Encode, Decode)]
284pub struct MarkRead {
285 pub community_id: Id,
286 pub message_id: Id,
287}
288
289#[derive(Debug, Clone, Encode, Decode)]
290pub struct Typing {
291 pub community_id: Id,
292}
293
294#[derive(Debug, Clone, Encode, Decode)]
295pub struct FindUser {
296 pub username: String,
297}
298
299#[derive(Debug, Clone, Encode, Decode)]
300pub struct OpenDirect {
301 pub user_id: Id,
302}
303
304#[derive(Debug, Clone, Encode, Decode)]
305pub struct OpenNotes;
306
307#[derive(Debug, Clone, Encode, Decode)]
308pub struct ListFriends;
309
310#[derive(Debug, Clone, Encode, Decode)]
311pub struct AddFriend {
312 pub user_id: Id,
313}
314
315#[derive(Debug, Clone, Encode, Decode)]
316pub struct AcceptFriend {
317 pub user_id: Id,
318}
319
320#[derive(Debug, Clone, Encode, Decode)]
321pub struct RemoveFriend {
322 pub user_id: Id,
323}
324
325#[derive(Debug, Clone, Encode, Decode)]
326pub struct Invite {
327 pub community_id: Id,
328 pub user_id: Id,
329}
330
331#[derive(Debug, Clone, Encode, Decode)]
332pub struct ListInvitations;
333
334#[derive(Debug, Clone, Encode, Decode)]
335pub struct AcceptInvitation {
336 pub community_id: Id,
337}
338
339#[derive(Debug, Clone, Encode, Decode)]
340pub struct DeclineInvitation {
341 pub community_id: Id,
342}
343
344#[derive(Debug, Clone, Encode, Decode)]
345pub struct ReportMessage {
346 pub message_id: Id,
347 pub reason: String,
348}
349
350#[derive(Debug, Clone, Encode, Decode)]
351pub struct ReportUser {
352 pub user_id: Id,
353 pub reason: String,
354}
355
356#[derive(Debug, Clone, Encode, Decode)]
357pub struct ListReports {
358 pub status: Option<ReportStatus>,
359}
360
361#[derive(Debug, Clone, Encode, Decode)]
362pub struct HandleReport {
363 pub report_id: Id,
364 pub status: ReportStatus,
365}
366
367#[derive(Debug, Clone, Encode, Decode)]
368pub struct JoinVoice {
369 pub community_id: Id,
370}
371
372#[derive(Debug, Clone, Encode, Decode)]
373pub struct LeaveVoice;
374
375#[derive(Debug, Clone, Encode, Decode)]
376pub struct StartShare {
377 pub kind: Kind,
378 pub source: Source,
379}
380
381#[derive(Debug, Clone, Encode, Decode)]
382pub struct StopShare {
383 pub kind: Kind,
384}
385
386#[derive(Debug, Clone, Encode, Decode)]
387pub struct ListShares {
388 pub community_id: Id,
389}
390
391#[derive(Debug, Clone, Encode, Decode)]
392pub struct WatchShare {
393 pub user_id: Id,
394 pub kind: Kind,
395 pub quality: Quality,
396 pub decode: Vec<Codec>,
397}
398
399#[derive(Debug, Clone, Encode, Decode)]
400pub struct UnwatchShare {
401 pub user_id: Id,
402 pub kind: Kind,
403}
404
405#[derive(Debug, Clone, Encode, Decode)]
406pub struct RequestKeyframe {
407 pub user_id: Id,
408 pub kind: Kind,
409 pub recover: bool,
410}
411
412#[derive(Debug, Clone, Encode, Decode)]
413pub struct ReportLoss {
414 pub user_id: Id,
415 pub kind: Kind,
416 pub permille: u16,
417}
418
419#[derive(Debug, Clone, Encode, Decode)]
420pub struct DeclineCall {
421 pub community_id: Id,
422}
423
424#[derive(Debug, Clone, Encode, Decode)]
425pub struct ListVoiceParticipants {
426 pub community_id: Id,
427}
428
429#[derive(Debug, Clone, Encode, Decode)]
430pub struct ListVoiceRooms;
431
432#[derive(Debug, Clone, Encode, Decode)]
433pub struct KickFromVoice {
434 pub user_id: Id,
435}
436
437#[derive(Debug, Clone, Encode, Decode)]
438pub struct ServerMute {
439 pub user_id: Id,
440 pub muted: bool,
441}
442
443#[derive(Debug, Clone, Encode, Decode)]
444pub struct Register {
445 pub username: String,
446 pub password: String,
447 pub invite: Option<String>,
448}
449
450#[derive(Debug, Clone, Encode, Decode)]
451pub struct Login {
452 pub username: String,
453 pub password: String,
454}
455
456#[derive(Debug, Clone, Encode, Decode)]
457pub struct Logout;
458
459#[derive(Debug, Clone, Encode, Decode)]
460pub struct DeleteUser {
461 pub user_id: Id,
462}
463
464#[derive(Debug, Clone, Encode, Decode)]
465pub struct WatchCommunity {
466 pub community_id: Option<Id>,
467}
468
469#[derive(Debug, Clone, Encode, Decode)]
470pub struct ListUsers;
471
472#[derive(Debug, Clone, Encode, Decode)]
473pub struct ListUserFriends {
474 pub user_id: Id,
475}
476
477#[derive(Debug, Clone, Encode, Decode)]
478pub struct ListAdminLogs {
479 pub actor_id: Option<Id>,
480 pub target_id: Option<Id>,
481 pub action: Option<AdminActionKind>,
482 pub after_ms: Option<u64>,
483 pub before_ms: Option<u64>,
484}
485
486#[derive(Debug, Clone, Encode, Decode)]
487pub struct GetOverview;
488
489#[derive(Debug, Clone, Encode, Decode)]
490pub struct SuspendUser {
491 pub user_id: Id,
492 pub suspended: bool,
493}
494
495#[derive(Debug, Clone, Encode, Decode)]
496pub struct RevokeSessions {
497 pub user_id: Id,
498}
499
500#[derive(Debug, Clone, Encode, Decode)]
501pub struct ResetPassword {
502 pub user_id: Id,
503 pub password: String,
504}
505
506#[derive(Debug, Clone, Encode, Decode)]
507pub struct ClearProfile {
508 pub user_id: Id,
509}
510
511#[derive(Debug, Clone, Encode, Decode)]
512pub struct ListAllCommunities;
513
514#[derive(Debug, Clone, Encode, Decode)]
515pub struct TransferOwnership {
516 pub community_id: Id,
517 pub user_id: Id,
518}
519
520#[derive(Debug, Clone, Encode, Decode)]
521pub struct UpdateServerSettings {
522 pub settings: ServerSettings,
523}
524
525#[derive(Debug, Clone, Encode, Decode)]
526pub struct CreateUser {
527 pub username: String,
528 pub password: String,
529}
530
531#[derive(Debug, Clone, Encode, Decode)]
532pub struct RenameUser {
533 pub user_id: Id,
534 pub username: String,
535}
536
537#[derive(Debug, Clone, Encode, Decode)]
538pub struct TimeoutUser {
539 pub user_id: Id,
540 pub minutes: u32,
541}
542
543#[derive(Debug, Clone, Encode, Decode)]
544pub struct BanUser {
545 pub user_id: Id,
546 pub reason: Option<String>,
547 pub scope: BanScope,
548}
549
550#[derive(Debug, Clone, Encode, Decode)]
551pub struct ListServerBans;
552
553#[derive(Debug, Clone, Encode, Decode)]
554pub struct RemoveServerBan {
555 pub id: Id,
556}
557
558#[derive(Debug, Clone, Encode, Decode)]
559pub struct CreateInviteCode {
560 pub uses: u32,
561 pub hours: Option<u32>,
562}
563
564#[derive(Debug, Clone, Encode, Decode)]
565pub struct ListInviteCodes;
566
567#[derive(Debug, Clone, Encode, Decode)]
568pub struct DeleteInviteCode {
569 pub code: String,
570}
571
572#[derive(Debug, Clone, Encode, Decode)]
573pub struct SearchMessages {
574 pub text: Option<String>,
575 pub user_id: Option<Id>,
576 pub community_id: Option<Id>,
577 pub after_ms: Option<u64>,
578 pub before_ms: Option<u64>,
579}
580
581#[derive(Debug, Clone, Encode, Decode)]
582pub struct SearchCommunity {
583 pub community_id: Id,
584 pub text: String,
585}
586
587#[derive(Debug, Clone, Encode, Decode)]
588pub struct PurgeUser {
589 pub user_id: Id,
590}
591
592#[derive(Debug, Clone, Encode, Decode)]
593pub struct SetCommunityVoice {
594 pub community_id: Id,
595 pub enabled: bool,
596}
597
598#[derive(Debug, Clone, Encode, Decode)]
599pub struct ListAttachments {
600 pub user_id: Option<Id>,
601 pub community_id: Option<Id>,
602}
603
604#[derive(Debug, Clone, Encode, Decode)]
605pub struct DeleteAttachment {
606 pub attachment_id: Id,
607}
608
609#[derive(Debug, Clone, Encode, Decode)]
610pub struct GetStorageUsage;
611
612#[derive(Debug, Clone, Encode, Decode)]
613pub struct GetDailyStats {
614 pub days: u32,
615}
616
617#[derive(Debug, Clone, Encode, Decode)]
618pub struct SetGhost {
619 pub enabled: bool,
620}
621
622#[derive(Debug, Clone, Encode, Decode)]
623pub struct CreateBackup;
624
625#[derive(Debug, Clone, Encode, Decode)]
626pub struct ListBackups;
627
628#[derive(Debug, Clone, Encode, Decode)]
629pub struct ListReleases;
630
631#[derive(Debug, Clone, Encode, Decode)]
632pub struct ListUpdateClients {
633 pub user_id: Id,
634}
635
636#[derive(Debug, Clone, Encode, Decode)]
637pub struct PublishRelease {
638 pub files: Vec<crate::update::Sha>,
639 pub required: bool,
640}
641
642#[derive(Debug, Clone, Encode, Decode)]
643pub struct SetReleaseRequired {
644 pub seq: u64,
645 pub required: bool,
646}
647
648#[derive(Debug, Clone, Encode, Decode)]
649pub struct FollowStats {
650 pub user_id: Option<Id>,
651}
652
653#[derive(Debug, Clone, Encode, Decode)]
654pub struct GetServerStats;
655
656#[derive(Debug, Clone, Encode, Decode)]
657pub struct RestartServer;
658
659#[derive(Debug, Clone, Encode, Decode)]
660pub struct PushStats {
661 pub stats: Stats,
662}
663
664#[derive(Debug, Clone, Encode, Decode)]
665pub struct DeleteBackup {
666 pub name: String,
667}
668
669#[derive(Debug, Clone, Encode, Decode)]
670pub struct Session {
671 pub user: User,
672 pub token: String,
673}
674
675#[derive(Debug, Clone, Encode, Decode)]
676pub struct StorageUsage {
677 pub users: Vec<Usage>,
678 pub communities: Vec<CommunityUsage>,
679}
680
681calls! {
682 GetSettings: Guest -> ServerSettings;
683 GetUser: User -> User;
684 UpdateUser: User -> User, |c| validate_username(&c.username);
685 UpdateStatus: User -> User, |c| validate_status(&c.status);
686 UpdateHue: User -> User;
687 UpdatePresence: User -> ();
688 ListPresences: User -> Vec<(Id, Presence)>;
689 UpdateAvatar: User -> User, |c| validate_avatar_size(&c.image, MAXIMUM_AVATAR_BYTES as u64);
690 RemoveAvatar: User -> User;
691 GetAvatar: User -> Vec<u8>;
692 ListSessions: User -> Vec<SessionInfo>;
693 RevokeSession: User -> ();
694 CreateCommunity: User -> Community, |c| validate_community_name(&c.name);
695 GetCommunity: User -> Community;
696 UpdateCommunity: User -> Community, |c| validate_community_name(&c.name);
697 UpdateCommunityAvatar: User -> Community, |c| c.image.as_deref().map_or(Ok(()), |image| validate_avatar_size(image, MAXIMUM_AVATAR_BYTES as u64));
698 DeleteCommunity: User -> ();
699 LeaveCommunity: User -> ();
700 ListCommunities: User -> Vec<Community>;
701 ListMembers: User -> Vec<Member>;
702 Kick: User -> (), |c| validate_reason(c.reason.as_deref());
703 BanMember: User -> (), |c| validate_reason(c.reason.as_deref());
704 Unban: User -> ();
705 ListBans: User -> Vec<Ban>;
706 SetRank: User -> ();
707 ListLogs: User -> Vec<LogEntry>;
708 CreateMessage: User -> Message, |c| validate_new_message(&c.body, c.attachments.len(), MAXIMUM_MESSAGE_LENGTH);
709 ForwardMessages: User -> Vec<Message>, |c| validate_forward(c.message_ids.len());
710 UpdateMessage: User -> Message, |c| validate_new_message(&c.body, 0, MAXIMUM_MESSAGE_LENGTH);
711 DeleteMessage: User -> ();
712 ListEdits: User -> Vec<Edit>;
713 CreatePoll: User -> Message, |c| validate_poll(&c.question, &c.options);
714 Vote: User -> ();
715 ClosePoll: User -> ();
716 MyVotes: User -> Vec<u32>;
717 React: User -> (), |c| validate_reaction(&c.emoji);
718 Pin: User -> ();
719 ListPins: User -> Vec<Message>;
720 ListMessages: User -> Vec<Message>;
721 ListUnreads: User -> Vec<Unread>;
722 MarkRead: User -> ();
723 Typing: User -> ();
724 FindUser: User -> User;
725 OpenDirect: User -> Community;
726 OpenNotes: User -> Community;
727 ListFriends: User -> Friends;
728 AddFriend: User -> ();
729 AcceptFriend: User -> ();
730 RemoveFriend: User -> ();
731 Invite: User -> ();
732 ListInvitations: User -> Vec<Invitation>;
733 AcceptInvitation: User -> Community;
734 DeclineInvitation: User -> ();
735 ReportMessage: User -> (), |c| validate_reason(Some(&c.reason));
736 ReportUser: User -> (), |c| validate_reason(Some(&c.reason));
737 ListReports: Builder -> Vec<Report>;
738 HandleReport: User -> ();
739 JoinVoice: User -> Vec<Id>;
740 LeaveVoice: User -> ();
741 StartShare: User -> ();
742 StopShare: User -> ();
743 ListShares: User -> Vec<Share>;
744 WatchShare: User -> ();
745 UnwatchShare: User -> ();
746 RequestKeyframe: User -> ();
747 ReportLoss: User -> ();
748 DeclineCall: User -> ();
749 ListVoiceParticipants: User -> Vec<Id>;
750 ListVoiceRooms: Builder -> Vec<VoiceRoom>;
751 KickFromVoice: User -> ();
752 ServerMute: User -> ();
753 Register: Guest -> Session, |c| validate_username(&c.username).and(validate_password(&c.password));
754 Login: Guest -> Session, |c| validate_password(&c.password);
755 Logout: User -> ();
756 DeleteUser: User -> ();
757 WatchCommunity: User -> ();
758 ListUsers: Builder -> Vec<Account>;
759 ListAdminLogs: Builder -> Vec<AdminLogEntry>;
760 ListUserFriends: Builder -> Vec<User>;
761 GetOverview: Builder -> Overview;
762 SuspendUser: User -> ();
763 RevokeSessions: User -> ();
764 ResetPassword: User -> (), |c| validate_password(&c.password);
765 ClearProfile: User -> User;
766 ListAllCommunities: Builder -> Vec<CommunitySummary>;
767 TransferOwnership: User -> ();
768 UpdateServerSettings: Builder -> ServerSettings, |c| validate_server_settings(&c.settings);
769 CreateUser: Builder -> User, |c| validate_username(&c.username).and(validate_password(&c.password));
770 RenameUser: User -> User, |c| validate_username(&c.username);
771 TimeoutUser: User -> ();
772 BanUser: User -> (), |c| validate_reason(c.reason.as_deref());
773 ListServerBans: Builder -> Vec<ServerBan>;
774 RemoveServerBan: Builder -> ();
775 CreateInviteCode: User -> InviteCode;
776 ListInviteCodes: Builder -> Vec<InviteCode>;
777 DeleteInviteCode: Builder -> ();
778 SearchMessages: Builder -> Vec<MessageHit>;
779 SearchCommunity: User -> Vec<MessageHit>;
780 PurgeUser: User -> ();
781 SetCommunityVoice: User -> Community;
782 ListAttachments: Builder -> Vec<AttachmentInfo>;
783 DeleteAttachment: Builder -> ();
784 GetStorageUsage: Builder -> StorageUsage;
785 GetDailyStats: Builder -> Vec<DayStat>;
786 SetGhost: Builder -> ();
787 CreateBackup: Builder -> BackupInfo;
788 ListBackups: Builder -> Vec<BackupInfo>;
789 DeleteBackup: Builder -> ();
790 ListReleases: Builder -> Vec<ReleaseInfo>;
791 ListUpdateClients: Builder -> Vec<UpdateClient>;
792 PublishRelease: Builder -> ReleaseInfo;
793 SetReleaseRequired: Builder -> ();
794 FollowStats: Builder -> Option<Stats>;
795 PushStats: User -> ();
796 GetServerStats: Builder -> Stats;
797 RestartServer: Builder -> ();
798}