Skip to content

Commit

Permalink
Merge branch 'main' into protocol-squad
Browse files Browse the repository at this point in the history
Signed-off-by: Lean Mendoza <[email protected]>
  • Loading branch information
leanmendoza authored Feb 1, 2025
2 parents ea9043b + b3fea33 commit c95848f
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 119 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
branches:
- main
- protocol-squad
- experimental
pull_request:
release:
types:
Expand All @@ -11,6 +12,9 @@ env:
IS_A_PR: ${{ github.event.pull_request.number != 'null' && github.head_ref != 'protocol-squad' }}


env:
BRANCH_TAG: ${{ github.ref_name == 'experimental' && 'experimental' || '' }}

name: build-deploy
jobs:
check_and_build:
Expand All @@ -28,7 +32,7 @@ jobs:
echo "from env '${{env.IS_A_PR}}'"
echo "- '${{github.event.pull_request.number}}'"
echo "- env '${{github.head_ref}}'"
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: install
run: make install
- name: buf build
Expand Down Expand Up @@ -56,8 +60,10 @@ jobs:
## inform gitlab after publishing to proceed with CDN propagation
gitlab-token: ${{ secrets.GITLAB_TOKEN }}
gitlab-pipeline-url: ${{ secrets.GITLAB_URL }}
custom-tag: ${{ env.BRANCH_TAG }}
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
env:
BRANCH_NAME: ${{ github.head_ref }}
BRANCH_NAME: ${{ github.ref_name }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ message RealSendRequest {
message RealSendResponse {}

message SendBinaryRequest {
repeated bytes data = 1; // @deprecated old broadcasted messages. Use peerData with an empty array for broadcasting.
repeated PeerMessageData peer_data = 2; // peer-to-peer messages
}

message PeerMessageData {
repeated bytes data = 1;
repeated string address = 2; // if address is empty, its a broadcast message
}

message SendBinaryResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package decentraland.social.friendships;
package decentraland.social_service.v1;

// This message is a response that is sent from the server to the client
message FriendshipEventResponse {
Expand Down Expand Up @@ -142,6 +142,7 @@ message SubscribeFriendshipEventsUpdatesResponse {
}
}

// @deprecated, only available for old explorer compatibility
service FriendshipsService {
// Get the list of friends for the authenticated user
rpc GetFriends(Payload) returns (stream UsersResponse) {}
Expand Down
159 changes: 159 additions & 0 deletions proto/decentraland/social_service/v2/social_service_v2.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
syntax = "proto3";
package decentraland.social_service.v2;

import "google/protobuf/empty.proto";

// Errors
message InvalidFriendshipAction {}
message InternalServerError {}

// Types
message User { string address = 1; }

message Pagination {
int32 limit = 1;
int32 offset = 2;
}

message FriendshipRequestResponse {
User user = 1;
int64 created_at = 2;
optional string message = 3;
}

message FriendshipRequests {
repeated FriendshipRequestResponse requests = 1;
}

enum ConnectivityStatus {
ONLINE = 0;
OFFLINE = 1;
AWAY = 2;
}

message GetFriendsPayload {
optional Pagination pagination = 1;
optional ConnectivityStatus status = 2;
}

message GetFriendshipRequestsPayload {
optional Pagination pagination = 1;
}

message UpsertFriendshipPayload {
message RequestPayload {
User user = 1;
optional string message = 3;
}
message AcceptPayload { User user = 1; }
message RejectPayload { User user = 1; }
message DeletePayload { User user = 1; }
message CancelPayload { User user = 1; }

oneof action {
RequestPayload request = 1;
AcceptPayload accept = 2;
RejectPayload reject = 4;
DeletePayload delete = 5;
CancelPayload cancel = 6;
}
}

message GetMutualFriendsPayload {
User user = 1;
optional Pagination pagination = 2;
}

message PaginatedResponse {
int32 total = 1;
int32 page = 2;
}

message PaginatedUsersResponse {
repeated User users = 1;
PaginatedResponse pagination_data = 2;
}

message PaginatedFriendshipRequestsResponse {
oneof response {
FriendshipRequests requests = 1;
InternalServerError internal_server_error = 2;
}
optional PaginatedResponse pagination_data = 3;
}

message UpsertFriendshipResponse {
message Accepted {
string id = 1;
int64 created_at = 2;
}
oneof response {
Accepted accepted = 1;
InvalidFriendshipAction invalid_friendship_action = 2;
InternalServerError internal_server_error = 3;
}
}

message FriendshipUpdate {
message AcceptResponse { User user = 1; }
message RejectResponse { User user = 1; }
message DeleteResponse { User user = 1; }
message CancelResponse { User user = 1; }

oneof update {
FriendshipRequestResponse request = 1;
AcceptResponse accept = 2;
RejectResponse reject = 3;
DeleteResponse delete = 4;
CancelResponse cancel = 5;
}
}

message GetFriendshipStatusPayload {
User user = 1;
}

enum FriendshipStatus {
REQUEST_SENT = 0;
REQUEST_RECEIVED = 1;
CANCELED = 2;
ACCEPTED = 3;
REJECTED = 4;
DELETED = 5;
BLOCKED = 6;
}

message GetFriendshipStatusResponse {
message Ok {
FriendshipStatus status = 1;
optional string message = 2;
}
oneof response {
Ok accepted = 1;
InternalServerError internal_server_error = 2;
}
}

service SocialService {
// Get the list of friends for the authenticated user
rpc GetFriends(GetFriendsPayload) returns (PaginatedUsersResponse) {}

// Get the list of mutual friends between the authenticated user and the one in the parameter
rpc GetMutualFriends(GetMutualFriendsPayload) returns (PaginatedUsersResponse) {}

// Get the pending friendship requests for the authenticated user
rpc GetPendingFriendshipRequests(GetFriendshipRequestsPayload) returns (PaginatedFriendshipRequestsResponse) {}

// Get the sent friendship requests for the authenticated user
rpc GetSentFriendshipRequests(GetFriendshipRequestsPayload) returns (PaginatedFriendshipRequestsResponse) {}

// Create or update friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE
rpc UpsertFriendship(UpsertFriendshipPayload)
returns (UpsertFriendshipResponse) {}

// Subscribe to updates of friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE
rpc SubscribeToFriendshipUpdates(google.protobuf.Empty)
returns (stream FriendshipUpdate) {}

rpc GetFriendshipStatus(GetFriendshipStatusPayload) returns (GetFriendshipStatusResponse) {}
}
111 changes: 0 additions & 111 deletions proto/decentraland/social_service_v2/social_service.proto

This file was deleted.

4 changes: 3 additions & 1 deletion public/social.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
syntax = "proto3";

package decentraland.social;

import public "decentraland/social/friendships/friendships.proto";
import public "decentraland/social_service/v1/social_service_v1.proto";
import public "decentraland/social_service/v2/social_service_v2.proto";
4 changes: 0 additions & 4 deletions public/social_service_v2.proto

This file was deleted.

0 comments on commit c95848f

Please sign in to comment.