103 lines
2.6 KiB
Protocol Buffer
103 lines
2.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package profile;
|
|
|
|
service ProfileService {
|
|
rpc GetProfile (UserProfileRequest) returns (ProfileResponse);
|
|
rpc UpdateAvatar (UpdateAvatarRequest) returns (ProfileResponse);
|
|
rpc UpdateProfile (UpdateProfileRequest) returns (ProfileResponse);
|
|
rpc UpdateContacts (UpdateContactsRequest) returns (ProfileResponse);
|
|
rpc SetPassword (SetPasswordRequest) returns (SetPasswordResponse);
|
|
rpc SendPasswordVerificationOtp (SendPasswordVerificationOtpRequest) returns (PasswordVerificationOtpResponse);
|
|
rpc ChangePassword (ChangePasswordRequest) returns (SetPasswordResponse);
|
|
rpc RemovePassword (RemovePasswordRequest) returns (SetPasswordResponse);
|
|
rpc SoftDeleteProfile (UserProfileRequest) returns (SoftDeleteProfileResponse);
|
|
}
|
|
|
|
message SetPasswordRequest {
|
|
string userId = 1;
|
|
string password = 2;
|
|
}
|
|
|
|
message SendPasswordVerificationOtpRequest {
|
|
string userId = 1;
|
|
string channel = 2;
|
|
}
|
|
|
|
message PasswordVerificationOtpResponse {
|
|
bool sent = 1;
|
|
string maskedTarget = 2;
|
|
}
|
|
|
|
message ChangePasswordRequest {
|
|
string userId = 1;
|
|
string newPassword = 2;
|
|
optional string currentPassword = 3;
|
|
optional string otpCode = 4;
|
|
optional string otpChannel = 5;
|
|
optional string totpCode = 6;
|
|
}
|
|
|
|
message RemovePasswordRequest {
|
|
string userId = 1;
|
|
optional string currentPassword = 2;
|
|
optional string otpCode = 3;
|
|
optional string otpChannel = 4;
|
|
optional string totpCode = 5;
|
|
}
|
|
|
|
message SetPasswordResponse {
|
|
bool hasPassword = 1;
|
|
}
|
|
|
|
message UserProfileRequest {
|
|
string userId = 1;
|
|
}
|
|
|
|
message UpdateAvatarRequest {
|
|
string userId = 1;
|
|
optional string avatarUrl = 2;
|
|
optional string avatarStorageKey = 3;
|
|
}
|
|
|
|
message UpdateProfileRequest {
|
|
string userId = 1;
|
|
optional string firstName = 2;
|
|
optional string lastName = 3;
|
|
optional string bio = 4;
|
|
optional int32 age = 5;
|
|
optional string gender = 6;
|
|
optional string birthDate = 7;
|
|
}
|
|
|
|
message UpdateContactsRequest {
|
|
string userId = 1;
|
|
optional string email = 2;
|
|
optional string phone = 3;
|
|
optional string backupEmail = 4;
|
|
optional string backupPhone = 5;
|
|
}
|
|
|
|
message ProfileResponse {
|
|
string id = 1;
|
|
string userId = 2;
|
|
string displayName = 3;
|
|
optional string avatarUrl = 4;
|
|
optional bool hasAvatar = 14;
|
|
optional string firstName = 5;
|
|
optional string lastName = 6;
|
|
optional string bio = 7;
|
|
optional int32 age = 8;
|
|
optional string gender = 9;
|
|
optional string email = 10;
|
|
optional string phone = 11;
|
|
optional string backupEmail = 12;
|
|
optional string backupPhone = 13;
|
|
optional string birthDate = 15;
|
|
bool hasPassword = 16;
|
|
}
|
|
|
|
message SoftDeleteProfileResponse {
|
|
bool success = 1;
|
|
}
|