Skip to content

Commit f692c7a

Browse files
lauti7leanmendoza
andauthored
feat: new proto for the new social service (#197)
* feat: new proto for new EA social service * fix: rename * fix: wrong folder Co-authored-by: Lean Mendoza <[email protected]> Signed-off-by: Lautaro Bustos <[email protected]> * fix: wrong pkg --------- Signed-off-by: Lautaro Bustos <[email protected]> Co-authored-by: Lean Mendoza <[email protected]>
1 parent 44aab53 commit f692c7a

File tree

3 files changed

+115
-5
lines changed

3 files changed

+115
-5
lines changed

proto/decentraland/social/friendships/friendships.proto

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// ***
2-
// FOR INTERNAL USE ONLY, IN BETA VERSION OF THE PROTOCOL.
3-
// SUBJECT TO CHANGE.
4-
// ***
5-
61
syntax = "proto3";
72
package decentraland.social.friendships;
83

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
syntax = "proto3";
2+
package decentraland.social_service_v2;
3+
4+
import "google/protobuf/empty.proto";
5+
6+
// Errors
7+
8+
message InvalidFriendshipAction {}
9+
10+
message InternalServerError {}
11+
12+
// Types
13+
14+
message User { string address = 1; }
15+
16+
message RequestResponse {
17+
User user = 1;
18+
int64 created_at = 2;
19+
optional string message = 3;
20+
}
21+
22+
message RequestPayload {
23+
User user = 1;
24+
optional string message = 3;
25+
}
26+
27+
message Requests {
28+
repeated RequestResponse requests = 1;
29+
}
30+
31+
message AcceptResponse { User user = 1; }
32+
33+
message AcceptPayload { User user = 1; }
34+
35+
message RejectResponse { User user = 1; }
36+
37+
message RejectPayload { User user = 1; }
38+
39+
message DeleteResponse { User user = 1; }
40+
41+
message DeletePayload { User user = 1; }
42+
43+
message CancelResponse { User user = 1; }
44+
45+
message CancelPayload { User user = 1; }
46+
47+
message UpsertFriendshipPayload {
48+
oneof action {
49+
RequestPayload request = 1;
50+
AcceptPayload accept = 2;
51+
RejectPayload reject = 4;
52+
DeletePayload delete = 5;
53+
CancelPayload cancel = 6;
54+
}
55+
}
56+
57+
message MutualFriendsPayload {
58+
User user = 1;
59+
}
60+
61+
message UsersResponse {
62+
repeated User users = 1;
63+
}
64+
65+
message FriendshipRequestsResponse {
66+
oneof response {
67+
Requests requests = 1;
68+
InternalServerError internal_server_error = 2;
69+
}
70+
}
71+
72+
message UpsertFriendshipResponse {
73+
message Accepted {}
74+
oneof response {
75+
Accepted accepted = 1;
76+
InvalidFriendshipAction invalid_friendship_action = 2;
77+
InternalServerError internal_server_error = 3;
78+
}
79+
}
80+
81+
message FriendshipUpdate {
82+
oneof update {
83+
RequestResponse request = 1;
84+
AcceptResponse accept = 2;
85+
RejectResponse reject = 4;
86+
DeleteResponse delete = 5;
87+
CancelResponse cancel = 6;
88+
}
89+
}
90+
91+
service SocialService {
92+
// Get the list of friends for the authenticated user
93+
rpc GetFriends(google.protobuf.Empty) returns (stream UsersResponse) {}
94+
95+
// Get the list of mutual friends between the authenticated user and the one in the parameter
96+
rpc GetMutualFriends(MutualFriendsPayload) returns (stream UsersResponse) {}
97+
98+
// Get the pending friendship requests for the authenticated user
99+
rpc GetPendingFriendshipRequests(google.protobuf.Empty) returns (FriendshipRequestsResponse) {}
100+
101+
// Get the sent friendship requests for the authenticated user
102+
rpc GetSentFriendshipRequests(google.protobuf.Empty) returns (FriendshipRequestsResponse) {}
103+
104+
// Create or update friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE
105+
rpc UpsertFriendship(UpsertFriendshipPayload)
106+
returns (UpsertFriendshipResponse) {}
107+
108+
// Subscribe to updates of friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE
109+
rpc SubscribeToFriendshipUpdates(google.protobuf.Empty)
110+
returns (stream FriendshipUpdate) {}
111+
}

public/social_service_v2.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
syntax = "proto3";
2+
package decentraland.social;
3+
4+
import public "decentraland/social_service_v2/social_service.proto";

0 commit comments

Comments
 (0)