From 778e942b9f22288e96e2d5bcf9b6b56ecbf439de Mon Sep 17 00:00:00 2001 From: Sualeh Asif Date: Tue, 28 Jun 2022 15:52:14 -0700 Subject: [PATCH] update proto. time for disaster to happen. Gooddddd luck --- schema/daemon.proto | 79 +++++++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/schema/daemon.proto b/schema/daemon.proto index e662f88..ab7c1f3 100644 --- a/schema/daemon.proto +++ b/schema/daemon.proto @@ -16,31 +16,29 @@ package asphrdaemon; service Daemon { rpc RegisterUser(RegisterUserRequest) returns (RegisterUserResponse) {} - rpc GetFriendList(GetFriendListRequest) returns (GetFriendListResponse) {} - rpc GetMyPublicID(GetMyPublicIDRequest) returns (GetMyPublicIDResponse) {} - // use for in-person key exchange - rpc AddSyncFriend(AddSyncFriendRequest) returns (AddSyncFriendResponse) {} + rpc GetFriendList(GetFriendListRequest) returns (GetFriendListResponse) {} + rpc RemoveFriend(RemoveFriendRequest) returns (RemoveFriendResponse) {} + // Invitations (async + sync) section. Sync \similarTo InPerson. + rpc AddSyncFriend(AddSyncFriendRequest) returns (AddSyncFriendResponse) {} rpc AddAsyncFriend(AddAsyncFriendRequest) returns (AddAsyncFriendResponse) {} - rpc GetOutgoingFriendRequests(GetOutgoingFriendRequestsRequest) returns (GetOutgoingFriendRequestsResponse) {} + rpc GetOutgoingSyncInvitations(GetOutgoingSyncInvitationsRequest) returns (GetOutgoingSyncInvitationsResponse) {} + rpc GetOutgoingAsyncInvitations(GetOutgoingAsyncInvitationsRequest) returns (GetOutgoingAsyncInvitationsResponse) {} - rpc GetIncomingAsyncFriendRequests(GetIncomingAsyncFriendRequestsRequest) returns (GetIncomingAsyncFriendRequestsResponse) {} + rpc GetIncomingAsyncInvitations(GetIncomingAsyncInvitationsRequest) returns (GetIncomingAsyncInvitationsResponse) {} - rpc DecideAsyncFriendRequest(DecideAsyncFriendRequestRequest) returns (DecideAsyncFriendRequestResponse) {} - - rpc RemoveFriend(RemoveFriendRequest) returns (RemoveFriendResponse) {} + rpc AcceptAsyncInvitation(AcceptAsyncInvitationRequest) returns (AcceptAsyncInvitationResponse) {} + rpc RejectAsyncInvitation(RejectAsyncInvitationRequest) returns (RejectAsyncInvitationResponse) {} rpc SendMessage(SendMessageRequest) returns (SendMessageResponse) {} + // Get Messages section rpc GetMessages(GetMessagesRequest) returns (GetMessagesResponse) {} - rpc GetMessagesStreamed(GetMessagesRequest) returns (stream GetMessagesResponse) {} - rpc GetOutboxMessages(GetOutboxMessagesRequest) returns (GetOutboxMessagesResponse) {} - rpc GetSentMessages(GetSentMessagesRequest) returns (GetSentMessagesResponse) {} rpc MessageSeen(MessageSeenRequest) returns (MessageSeenResponse) {} @@ -105,29 +103,60 @@ message AddAsyncFriendRequest { message AddAsyncFriendResponse {} -message GetOutgoingFriendRequestsRequest {} +message GetOutgoingSyncInvitationsRequest {} -message FriendRequest { - FriendInfo friend_info = 1; - string message = 2; // this may be "" (the empty string) if it is a sync request +message GetOutgoingSyncInvitationsResponse { + message OutgoingSyncInvitationInfo { + string unique_name = 1; + string display_name = 2; + string story = 3; + google.protobuf.Timestamp sent_at = 4; + } + repeated OutgoingSyncInvitationInfo invitations = 1; } -message GetOutgoingFriendRequestsResponse { - repeated FriendRequest friend_requests = 1; +message GetOutgoingAsyncInvitationsRequest {} + +message GetOutgoingAsyncInvitationsResponse { + message OutgoingAsyncInvitationInfo { + string unique_name = 1; + string display_name = 2; + string public_id = 3; + string message = 4; + google.protobuf.Timestamp sent_at = 5; + } + repeated OutgoingAsyncInvitationInfo invitations = 1; } -message GetIncomingAsyncFriendRequestsRequest {} +message GetIncomingAsyncInvitationsRequest { + // TODO(sualeh): make it optionally take a public_id + // optional string public_id = 1; +} -message GetIncomingAsyncFriendRequestsResponse { - repeated FriendRequest friend_requests = 1; +message GetIncomingAsyncInvitationsResponse { + message IncomingAsyncInvitationInfo { + string public_id = 1; + string message = 2; + google.protobuf.Timestamp received_at = 3; + } + repeated IncomingAsyncInvitationInfo invitations = 1; } -message DecideAsyncFriendRequestRequest { - string unique_name = 1; - bool accept = 2; +// accepts an async friend requestj +message AcceptAsyncInvitationRequest { + string public_id = 1; + string unique_name = 2; + string display_name = 3; +} + +message AcceptAsyncInvitationResponse {} + +// rejects an async friend requestj +message RejectAsyncInvitationRequest { + string public_id = 1; } -message DecideAsyncFriendRequestResponse {} +message RejectAsyncInvitationResponse {} message RemoveFriendRequest { string unique_name = 1;