Commit 506b477d authored by johnnyjoy's avatar johnnyjoy

fix: get user by username

parent fa2fa8a5
......@@ -36,6 +36,11 @@ var MemoFilterCELAttributes = []cel.EnvOption{
),
}
// UserFilterCELAttributes are the CEL attributes for user.
var UserFilterCELAttributes = []cel.EnvOption{
cel.Variable("username", cel.StringType),
}
// Parse parses the filter string and returns the parsed expression.
// The filter string should be a CEL expression.
func Parse(filter string, opts ...cel.EnvOption) (expr *exprv1.ParsedExpr, err error) {
......
......@@ -50,12 +50,6 @@ service UserService {
option (google.api.method_signature) = "name";
}
// SearchUsers searches for users based on query.
rpc SearchUsers(SearchUsersRequest) returns (SearchUsersResponse) {
option (google.api.http) = {get: "/api/v1/users:search"};
option (google.api.method_signature) = "query";
}
// GetUserAvatar gets the avatar of a user.
rpc GetUserAvatar(GetUserAvatarRequest) returns (google.api.HttpBody) {
option (google.api.http) = {get: "/api/v1/{name=users/*}/avatar"};
......@@ -231,12 +225,8 @@ message ListUsersRequest {
// Supported fields: username, email, role, state, create_time, update_time
string filter = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. The order to sort results by.
// Example: "create_time desc" or "username asc"
string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. If true, show deleted users in the response.
bool show_deleted = 5 [(google.api.field_behavior) = OPTIONAL];
bool show_deleted = 4 [(google.api.field_behavior) = OPTIONAL];
}
message ListUsersResponse {
......@@ -307,28 +297,6 @@ message DeleteUserRequest {
bool force = 2 [(google.api.field_behavior) = OPTIONAL];
}
message SearchUsersRequest {
// Required. The search query.
string query = 1 [(google.api.field_behavior) = REQUIRED];
// Optional. The maximum number of users to return.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. A page token for pagination.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
}
message SearchUsersResponse {
// The list of users matching the search query.
repeated User users = 1;
// A token for the next page of results.
string next_page_token = 2;
// The total count of matching users.
int32 total_size = 3;
}
message GetUserAvatarRequest {
// Required. The resource name of the user.
// Format: users/{user}
......
......@@ -140,7 +140,7 @@ func (x UserSetting_Key) Number() protoreflect.EnumNumber {
// Deprecated: Use UserSetting_Key.Descriptor instead.
func (UserSetting_Key) EnumDescriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 0}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{12, 0}
}
type User struct {
......@@ -294,11 +294,8 @@ type ListUsersRequest struct {
// Supported operators: =, !=, <, <=, >, >=, :
// Supported fields: username, email, role, state, create_time, update_time
Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
// Optional. The order to sort results by.
// Example: "create_time desc" or "username asc"
OrderBy string `protobuf:"bytes,4,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
// Optional. If true, show deleted users in the response.
ShowDeleted bool `protobuf:"varint,5,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"`
ShowDeleted bool `protobuf:"varint,4,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
......@@ -354,13 +351,6 @@ func (x *ListUsersRequest) GetFilter() string {
return ""
}
func (x *ListUsersRequest) GetOrderBy() string {
if x != nil {
return x.OrderBy
}
return ""
}
func (x *ListUsersRequest) GetShowDeleted() bool {
if x != nil {
return x.ShowDeleted
......@@ -681,132 +671,6 @@ func (x *DeleteUserRequest) GetForce() bool {
return false
}
type SearchUsersRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Required. The search query.
Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
// Optional. The maximum number of users to return.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Optional. A page token for pagination.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SearchUsersRequest) Reset() {
*x = SearchUsersRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SearchUsersRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchUsersRequest) ProtoMessage() {}
func (x *SearchUsersRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SearchUsersRequest.ProtoReflect.Descriptor instead.
func (*SearchUsersRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{7}
}
func (x *SearchUsersRequest) GetQuery() string {
if x != nil {
return x.Query
}
return ""
}
func (x *SearchUsersRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *SearchUsersRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
type SearchUsersResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The list of users matching the search query.
Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
// A token for the next page of results.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// The total count of matching users.
TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SearchUsersResponse) Reset() {
*x = SearchUsersResponse{}
mi := &file_api_v1_user_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SearchUsersResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchUsersResponse) ProtoMessage() {}
func (x *SearchUsersResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SearchUsersResponse.ProtoReflect.Descriptor instead.
func (*SearchUsersResponse) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{8}
}
func (x *SearchUsersResponse) GetUsers() []*User {
if x != nil {
return x.Users
}
return nil
}
func (x *SearchUsersResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
func (x *SearchUsersResponse) GetTotalSize() int32 {
if x != nil {
return x.TotalSize
}
return 0
}
type GetUserAvatarRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Required. The resource name of the user.
......@@ -818,7 +682,7 @@ type GetUserAvatarRequest struct {
func (x *GetUserAvatarRequest) Reset() {
*x = GetUserAvatarRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[9]
mi := &file_api_v1_user_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -830,7 +694,7 @@ func (x *GetUserAvatarRequest) String() string {
func (*GetUserAvatarRequest) ProtoMessage() {}
func (x *GetUserAvatarRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[9]
mi := &file_api_v1_user_service_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -843,7 +707,7 @@ func (x *GetUserAvatarRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetUserAvatarRequest.ProtoReflect.Descriptor instead.
func (*GetUserAvatarRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{9}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{7}
}
func (x *GetUserAvatarRequest) GetName() string {
......@@ -875,7 +739,7 @@ type UserStats struct {
func (x *UserStats) Reset() {
*x = UserStats{}
mi := &file_api_v1_user_service_proto_msgTypes[10]
mi := &file_api_v1_user_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -887,7 +751,7 @@ func (x *UserStats) String() string {
func (*UserStats) ProtoMessage() {}
func (x *UserStats) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[10]
mi := &file_api_v1_user_service_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -900,7 +764,7 @@ func (x *UserStats) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserStats.ProtoReflect.Descriptor instead.
func (*UserStats) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{10}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{8}
}
func (x *UserStats) GetName() string {
......@@ -956,7 +820,7 @@ type GetUserStatsRequest struct {
func (x *GetUserStatsRequest) Reset() {
*x = GetUserStatsRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[11]
mi := &file_api_v1_user_service_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -968,7 +832,7 @@ func (x *GetUserStatsRequest) String() string {
func (*GetUserStatsRequest) ProtoMessage() {}
func (x *GetUserStatsRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[11]
mi := &file_api_v1_user_service_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -981,7 +845,7 @@ func (x *GetUserStatsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetUserStatsRequest.ProtoReflect.Descriptor instead.
func (*GetUserStatsRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{11}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{9}
}
func (x *GetUserStatsRequest) GetName() string {
......@@ -999,7 +863,7 @@ type ListAllUserStatsRequest struct {
func (x *ListAllUserStatsRequest) Reset() {
*x = ListAllUserStatsRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[12]
mi := &file_api_v1_user_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1011,7 +875,7 @@ func (x *ListAllUserStatsRequest) String() string {
func (*ListAllUserStatsRequest) ProtoMessage() {}
func (x *ListAllUserStatsRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[12]
mi := &file_api_v1_user_service_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1024,7 +888,7 @@ func (x *ListAllUserStatsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListAllUserStatsRequest.ProtoReflect.Descriptor instead.
func (*ListAllUserStatsRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{12}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{10}
}
type ListAllUserStatsResponse struct {
......@@ -1037,7 +901,7 @@ type ListAllUserStatsResponse struct {
func (x *ListAllUserStatsResponse) Reset() {
*x = ListAllUserStatsResponse{}
mi := &file_api_v1_user_service_proto_msgTypes[13]
mi := &file_api_v1_user_service_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1049,7 +913,7 @@ func (x *ListAllUserStatsResponse) String() string {
func (*ListAllUserStatsResponse) ProtoMessage() {}
func (x *ListAllUserStatsResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[13]
mi := &file_api_v1_user_service_proto_msgTypes[11]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1062,7 +926,7 @@ func (x *ListAllUserStatsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListAllUserStatsResponse.ProtoReflect.Descriptor instead.
func (*ListAllUserStatsResponse) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{13}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{11}
}
func (x *ListAllUserStatsResponse) GetStats() []*UserStats {
......@@ -1092,7 +956,7 @@ type UserSetting struct {
func (x *UserSetting) Reset() {
*x = UserSetting{}
mi := &file_api_v1_user_service_proto_msgTypes[14]
mi := &file_api_v1_user_service_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1104,7 +968,7 @@ func (x *UserSetting) String() string {
func (*UserSetting) ProtoMessage() {}
func (x *UserSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[14]
mi := &file_api_v1_user_service_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1117,7 +981,7 @@ func (x *UserSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserSetting.ProtoReflect.Descriptor instead.
func (*UserSetting) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{12}
}
func (x *UserSetting) GetName() string {
......@@ -1209,7 +1073,7 @@ type GetUserSettingRequest struct {
func (x *GetUserSettingRequest) Reset() {
*x = GetUserSettingRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[15]
mi := &file_api_v1_user_service_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1221,7 +1085,7 @@ func (x *GetUserSettingRequest) String() string {
func (*GetUserSettingRequest) ProtoMessage() {}
func (x *GetUserSettingRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[15]
mi := &file_api_v1_user_service_proto_msgTypes[13]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1234,7 +1098,7 @@ func (x *GetUserSettingRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetUserSettingRequest.ProtoReflect.Descriptor instead.
func (*GetUserSettingRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{15}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{13}
}
func (x *GetUserSettingRequest) GetName() string {
......@@ -1256,7 +1120,7 @@ type UpdateUserSettingRequest struct {
func (x *UpdateUserSettingRequest) Reset() {
*x = UpdateUserSettingRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[16]
mi := &file_api_v1_user_service_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1268,7 +1132,7 @@ func (x *UpdateUserSettingRequest) String() string {
func (*UpdateUserSettingRequest) ProtoMessage() {}
func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[16]
mi := &file_api_v1_user_service_proto_msgTypes[14]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1281,7 +1145,7 @@ func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateUserSettingRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserSettingRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{16}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14}
}
func (x *UpdateUserSettingRequest) GetSetting() *UserSetting {
......@@ -1318,7 +1182,7 @@ type ListUserSettingsRequest struct {
func (x *ListUserSettingsRequest) Reset() {
*x = ListUserSettingsRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[17]
mi := &file_api_v1_user_service_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1330,7 +1194,7 @@ func (x *ListUserSettingsRequest) String() string {
func (*ListUserSettingsRequest) ProtoMessage() {}
func (x *ListUserSettingsRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[17]
mi := &file_api_v1_user_service_proto_msgTypes[15]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1343,7 +1207,7 @@ func (x *ListUserSettingsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserSettingsRequest.ProtoReflect.Descriptor instead.
func (*ListUserSettingsRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{17}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{15}
}
func (x *ListUserSettingsRequest) GetParent() string {
......@@ -1383,7 +1247,7 @@ type ListUserSettingsResponse struct {
func (x *ListUserSettingsResponse) Reset() {
*x = ListUserSettingsResponse{}
mi := &file_api_v1_user_service_proto_msgTypes[18]
mi := &file_api_v1_user_service_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1395,7 +1259,7 @@ func (x *ListUserSettingsResponse) String() string {
func (*ListUserSettingsResponse) ProtoMessage() {}
func (x *ListUserSettingsResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[18]
mi := &file_api_v1_user_service_proto_msgTypes[16]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1408,7 +1272,7 @@ func (x *ListUserSettingsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserSettingsResponse.ProtoReflect.Descriptor instead.
func (*ListUserSettingsResponse) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{18}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{16}
}
func (x *ListUserSettingsResponse) GetSettings() []*UserSetting {
......@@ -1452,7 +1316,7 @@ type UserAccessToken struct {
func (x *UserAccessToken) Reset() {
*x = UserAccessToken{}
mi := &file_api_v1_user_service_proto_msgTypes[19]
mi := &file_api_v1_user_service_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1464,7 +1328,7 @@ func (x *UserAccessToken) String() string {
func (*UserAccessToken) ProtoMessage() {}
func (x *UserAccessToken) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[19]
mi := &file_api_v1_user_service_proto_msgTypes[17]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1477,7 +1341,7 @@ func (x *UserAccessToken) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserAccessToken.ProtoReflect.Descriptor instead.
func (*UserAccessToken) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{19}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{17}
}
func (x *UserAccessToken) GetName() string {
......@@ -1530,7 +1394,7 @@ type ListUserAccessTokensRequest struct {
func (x *ListUserAccessTokensRequest) Reset() {
*x = ListUserAccessTokensRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[20]
mi := &file_api_v1_user_service_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1542,7 +1406,7 @@ func (x *ListUserAccessTokensRequest) String() string {
func (*ListUserAccessTokensRequest) ProtoMessage() {}
func (x *ListUserAccessTokensRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[20]
mi := &file_api_v1_user_service_proto_msgTypes[18]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1555,7 +1419,7 @@ func (x *ListUserAccessTokensRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserAccessTokensRequest.ProtoReflect.Descriptor instead.
func (*ListUserAccessTokensRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{20}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{18}
}
func (x *ListUserAccessTokensRequest) GetParent() string {
......@@ -1593,7 +1457,7 @@ type ListUserAccessTokensResponse struct {
func (x *ListUserAccessTokensResponse) Reset() {
*x = ListUserAccessTokensResponse{}
mi := &file_api_v1_user_service_proto_msgTypes[21]
mi := &file_api_v1_user_service_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1605,7 +1469,7 @@ func (x *ListUserAccessTokensResponse) String() string {
func (*ListUserAccessTokensResponse) ProtoMessage() {}
func (x *ListUserAccessTokensResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[21]
mi := &file_api_v1_user_service_proto_msgTypes[19]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1618,7 +1482,7 @@ func (x *ListUserAccessTokensResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserAccessTokensResponse.ProtoReflect.Descriptor instead.
func (*ListUserAccessTokensResponse) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{21}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{19}
}
func (x *ListUserAccessTokensResponse) GetAccessTokens() []*UserAccessToken {
......@@ -1657,7 +1521,7 @@ type CreateUserAccessTokenRequest struct {
func (x *CreateUserAccessTokenRequest) Reset() {
*x = CreateUserAccessTokenRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[22]
mi := &file_api_v1_user_service_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1669,7 +1533,7 @@ func (x *CreateUserAccessTokenRequest) String() string {
func (*CreateUserAccessTokenRequest) ProtoMessage() {}
func (x *CreateUserAccessTokenRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[22]
mi := &file_api_v1_user_service_proto_msgTypes[20]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1682,7 +1546,7 @@ func (x *CreateUserAccessTokenRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateUserAccessTokenRequest.ProtoReflect.Descriptor instead.
func (*CreateUserAccessTokenRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{22}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{20}
}
func (x *CreateUserAccessTokenRequest) GetParent() string {
......@@ -1717,7 +1581,7 @@ type DeleteUserAccessTokenRequest struct {
func (x *DeleteUserAccessTokenRequest) Reset() {
*x = DeleteUserAccessTokenRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[23]
mi := &file_api_v1_user_service_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1729,7 +1593,7 @@ func (x *DeleteUserAccessTokenRequest) String() string {
func (*DeleteUserAccessTokenRequest) ProtoMessage() {}
func (x *DeleteUserAccessTokenRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[23]
mi := &file_api_v1_user_service_proto_msgTypes[21]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1742,7 +1606,7 @@ func (x *DeleteUserAccessTokenRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteUserAccessTokenRequest.ProtoReflect.Descriptor instead.
func (*DeleteUserAccessTokenRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{23}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{21}
}
func (x *DeleteUserAccessTokenRequest) GetName() string {
......@@ -1772,7 +1636,7 @@ type UserSession struct {
func (x *UserSession) Reset() {
*x = UserSession{}
mi := &file_api_v1_user_service_proto_msgTypes[24]
mi := &file_api_v1_user_service_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1784,7 +1648,7 @@ func (x *UserSession) String() string {
func (*UserSession) ProtoMessage() {}
func (x *UserSession) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[24]
mi := &file_api_v1_user_service_proto_msgTypes[22]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1797,7 +1661,7 @@ func (x *UserSession) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserSession.ProtoReflect.Descriptor instead.
func (*UserSession) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{24}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{22}
}
func (x *UserSession) GetName() string {
......@@ -1846,7 +1710,7 @@ type ListUserSessionsRequest struct {
func (x *ListUserSessionsRequest) Reset() {
*x = ListUserSessionsRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[25]
mi := &file_api_v1_user_service_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1858,7 +1722,7 @@ func (x *ListUserSessionsRequest) String() string {
func (*ListUserSessionsRequest) ProtoMessage() {}
func (x *ListUserSessionsRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[25]
mi := &file_api_v1_user_service_proto_msgTypes[23]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1871,7 +1735,7 @@ func (x *ListUserSessionsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserSessionsRequest.ProtoReflect.Descriptor instead.
func (*ListUserSessionsRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{25}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{23}
}
func (x *ListUserSessionsRequest) GetParent() string {
......@@ -1891,7 +1755,7 @@ type ListUserSessionsResponse struct {
func (x *ListUserSessionsResponse) Reset() {
*x = ListUserSessionsResponse{}
mi := &file_api_v1_user_service_proto_msgTypes[26]
mi := &file_api_v1_user_service_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1903,7 +1767,7 @@ func (x *ListUserSessionsResponse) String() string {
func (*ListUserSessionsResponse) ProtoMessage() {}
func (x *ListUserSessionsResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[26]
mi := &file_api_v1_user_service_proto_msgTypes[24]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1916,7 +1780,7 @@ func (x *ListUserSessionsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserSessionsResponse.ProtoReflect.Descriptor instead.
func (*ListUserSessionsResponse) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{26}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{24}
}
func (x *ListUserSessionsResponse) GetSessions() []*UserSession {
......@@ -1937,7 +1801,7 @@ type RevokeUserSessionRequest struct {
func (x *RevokeUserSessionRequest) Reset() {
*x = RevokeUserSessionRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[27]
mi := &file_api_v1_user_service_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -1949,7 +1813,7 @@ func (x *RevokeUserSessionRequest) String() string {
func (*RevokeUserSessionRequest) ProtoMessage() {}
func (x *RevokeUserSessionRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[27]
mi := &file_api_v1_user_service_proto_msgTypes[25]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -1962,7 +1826,7 @@ func (x *RevokeUserSessionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RevokeUserSessionRequest.ProtoReflect.Descriptor instead.
func (*RevokeUserSessionRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{27}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{25}
}
func (x *RevokeUserSessionRequest) GetName() string {
......@@ -1992,7 +1856,7 @@ type UserWebhook struct {
func (x *UserWebhook) Reset() {
*x = UserWebhook{}
mi := &file_api_v1_user_service_proto_msgTypes[28]
mi := &file_api_v1_user_service_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2004,7 +1868,7 @@ func (x *UserWebhook) String() string {
func (*UserWebhook) ProtoMessage() {}
func (x *UserWebhook) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[28]
mi := &file_api_v1_user_service_proto_msgTypes[26]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2017,7 +1881,7 @@ func (x *UserWebhook) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserWebhook.ProtoReflect.Descriptor instead.
func (*UserWebhook) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{28}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{26}
}
func (x *UserWebhook) GetName() string {
......@@ -2066,7 +1930,7 @@ type ListUserWebhooksRequest struct {
func (x *ListUserWebhooksRequest) Reset() {
*x = ListUserWebhooksRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[29]
mi := &file_api_v1_user_service_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2078,7 +1942,7 @@ func (x *ListUserWebhooksRequest) String() string {
func (*ListUserWebhooksRequest) ProtoMessage() {}
func (x *ListUserWebhooksRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[29]
mi := &file_api_v1_user_service_proto_msgTypes[27]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2091,7 +1955,7 @@ func (x *ListUserWebhooksRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserWebhooksRequest.ProtoReflect.Descriptor instead.
func (*ListUserWebhooksRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{29}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{27}
}
func (x *ListUserWebhooksRequest) GetParent() string {
......@@ -2111,7 +1975,7 @@ type ListUserWebhooksResponse struct {
func (x *ListUserWebhooksResponse) Reset() {
*x = ListUserWebhooksResponse{}
mi := &file_api_v1_user_service_proto_msgTypes[30]
mi := &file_api_v1_user_service_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2123,7 +1987,7 @@ func (x *ListUserWebhooksResponse) String() string {
func (*ListUserWebhooksResponse) ProtoMessage() {}
func (x *ListUserWebhooksResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[30]
mi := &file_api_v1_user_service_proto_msgTypes[28]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2136,7 +2000,7 @@ func (x *ListUserWebhooksResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListUserWebhooksResponse.ProtoReflect.Descriptor instead.
func (*ListUserWebhooksResponse) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{30}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{28}
}
func (x *ListUserWebhooksResponse) GetWebhooks() []*UserWebhook {
......@@ -2159,7 +2023,7 @@ type CreateUserWebhookRequest struct {
func (x *CreateUserWebhookRequest) Reset() {
*x = CreateUserWebhookRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[31]
mi := &file_api_v1_user_service_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2171,7 +2035,7 @@ func (x *CreateUserWebhookRequest) String() string {
func (*CreateUserWebhookRequest) ProtoMessage() {}
func (x *CreateUserWebhookRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[31]
mi := &file_api_v1_user_service_proto_msgTypes[29]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2184,7 +2048,7 @@ func (x *CreateUserWebhookRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateUserWebhookRequest.ProtoReflect.Descriptor instead.
func (*CreateUserWebhookRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{31}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{29}
}
func (x *CreateUserWebhookRequest) GetParent() string {
......@@ -2213,7 +2077,7 @@ type UpdateUserWebhookRequest struct {
func (x *UpdateUserWebhookRequest) Reset() {
*x = UpdateUserWebhookRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[32]
mi := &file_api_v1_user_service_proto_msgTypes[30]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2225,7 +2089,7 @@ func (x *UpdateUserWebhookRequest) String() string {
func (*UpdateUserWebhookRequest) ProtoMessage() {}
func (x *UpdateUserWebhookRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[32]
mi := &file_api_v1_user_service_proto_msgTypes[30]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2238,7 +2102,7 @@ func (x *UpdateUserWebhookRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateUserWebhookRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserWebhookRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{32}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{30}
}
func (x *UpdateUserWebhookRequest) GetWebhook() *UserWebhook {
......@@ -2266,7 +2130,7 @@ type DeleteUserWebhookRequest struct {
func (x *DeleteUserWebhookRequest) Reset() {
*x = DeleteUserWebhookRequest{}
mi := &file_api_v1_user_service_proto_msgTypes[33]
mi := &file_api_v1_user_service_proto_msgTypes[31]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2278,7 +2142,7 @@ func (x *DeleteUserWebhookRequest) String() string {
func (*DeleteUserWebhookRequest) ProtoMessage() {}
func (x *DeleteUserWebhookRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[33]
mi := &file_api_v1_user_service_proto_msgTypes[31]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2291,7 +2155,7 @@ func (x *DeleteUserWebhookRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteUserWebhookRequest.ProtoReflect.Descriptor instead.
func (*DeleteUserWebhookRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{33}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{31}
}
func (x *DeleteUserWebhookRequest) GetName() string {
......@@ -2314,7 +2178,7 @@ type UserStats_MemoTypeStats struct {
func (x *UserStats_MemoTypeStats) Reset() {
*x = UserStats_MemoTypeStats{}
mi := &file_api_v1_user_service_proto_msgTypes[35]
mi := &file_api_v1_user_service_proto_msgTypes[33]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2326,7 +2190,7 @@ func (x *UserStats_MemoTypeStats) String() string {
func (*UserStats_MemoTypeStats) ProtoMessage() {}
func (x *UserStats_MemoTypeStats) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[35]
mi := &file_api_v1_user_service_proto_msgTypes[33]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2339,7 +2203,7 @@ func (x *UserStats_MemoTypeStats) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserStats_MemoTypeStats.ProtoReflect.Descriptor instead.
func (*UserStats_MemoTypeStats) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{10, 1}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{8, 1}
}
func (x *UserStats_MemoTypeStats) GetLinkCount() int32 {
......@@ -2389,7 +2253,7 @@ type UserSetting_GeneralSetting struct {
func (x *UserSetting_GeneralSetting) Reset() {
*x = UserSetting_GeneralSetting{}
mi := &file_api_v1_user_service_proto_msgTypes[36]
mi := &file_api_v1_user_service_proto_msgTypes[34]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2401,7 +2265,7 @@ func (x *UserSetting_GeneralSetting) String() string {
func (*UserSetting_GeneralSetting) ProtoMessage() {}
func (x *UserSetting_GeneralSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[36]
mi := &file_api_v1_user_service_proto_msgTypes[34]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2414,7 +2278,7 @@ func (x *UserSetting_GeneralSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserSetting_GeneralSetting.ProtoReflect.Descriptor instead.
func (*UserSetting_GeneralSetting) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 0}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{12, 0}
}
func (x *UserSetting_GeneralSetting) GetLocale() string {
......@@ -2456,7 +2320,7 @@ type UserSetting_SessionsSetting struct {
func (x *UserSetting_SessionsSetting) Reset() {
*x = UserSetting_SessionsSetting{}
mi := &file_api_v1_user_service_proto_msgTypes[37]
mi := &file_api_v1_user_service_proto_msgTypes[35]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2468,7 +2332,7 @@ func (x *UserSetting_SessionsSetting) String() string {
func (*UserSetting_SessionsSetting) ProtoMessage() {}
func (x *UserSetting_SessionsSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[37]
mi := &file_api_v1_user_service_proto_msgTypes[35]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2481,7 +2345,7 @@ func (x *UserSetting_SessionsSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserSetting_SessionsSetting.ProtoReflect.Descriptor instead.
func (*UserSetting_SessionsSetting) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 1}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{12, 1}
}
func (x *UserSetting_SessionsSetting) GetSessions() []*UserSession {
......@@ -2502,7 +2366,7 @@ type UserSetting_AccessTokensSetting struct {
func (x *UserSetting_AccessTokensSetting) Reset() {
*x = UserSetting_AccessTokensSetting{}
mi := &file_api_v1_user_service_proto_msgTypes[38]
mi := &file_api_v1_user_service_proto_msgTypes[36]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2514,7 +2378,7 @@ func (x *UserSetting_AccessTokensSetting) String() string {
func (*UserSetting_AccessTokensSetting) ProtoMessage() {}
func (x *UserSetting_AccessTokensSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[38]
mi := &file_api_v1_user_service_proto_msgTypes[36]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2527,7 +2391,7 @@ func (x *UserSetting_AccessTokensSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserSetting_AccessTokensSetting.ProtoReflect.Descriptor instead.
func (*UserSetting_AccessTokensSetting) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 2}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{12, 2}
}
func (x *UserSetting_AccessTokensSetting) GetAccessTokens() []*UserAccessToken {
......@@ -2548,7 +2412,7 @@ type UserSetting_WebhooksSetting struct {
func (x *UserSetting_WebhooksSetting) Reset() {
*x = UserSetting_WebhooksSetting{}
mi := &file_api_v1_user_service_proto_msgTypes[39]
mi := &file_api_v1_user_service_proto_msgTypes[37]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2560,7 +2424,7 @@ func (x *UserSetting_WebhooksSetting) String() string {
func (*UserSetting_WebhooksSetting) ProtoMessage() {}
func (x *UserSetting_WebhooksSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[39]
mi := &file_api_v1_user_service_proto_msgTypes[37]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2573,7 +2437,7 @@ func (x *UserSetting_WebhooksSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserSetting_WebhooksSetting.ProtoReflect.Descriptor instead.
func (*UserSetting_WebhooksSetting) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{14, 3}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{12, 3}
}
func (x *UserSetting_WebhooksSetting) GetWebhooks() []*UserWebhook {
......@@ -2601,7 +2465,7 @@ type UserSession_ClientInfo struct {
func (x *UserSession_ClientInfo) Reset() {
*x = UserSession_ClientInfo{}
mi := &file_api_v1_user_service_proto_msgTypes[40]
mi := &file_api_v1_user_service_proto_msgTypes[38]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -2613,7 +2477,7 @@ func (x *UserSession_ClientInfo) String() string {
func (*UserSession_ClientInfo) ProtoMessage() {}
func (x *UserSession_ClientInfo) ProtoReflect() protoreflect.Message {
mi := &file_api_v1_user_service_proto_msgTypes[40]
mi := &file_api_v1_user_service_proto_msgTypes[38]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -2626,7 +2490,7 @@ func (x *UserSession_ClientInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserSession_ClientInfo.ProtoReflect.Descriptor instead.
func (*UserSession_ClientInfo) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{24, 0}
return file_api_v1_user_service_proto_rawDescGZIP(), []int{22, 0}
}
func (x *UserSession_ClientInfo) GetUserAgent() string {
......@@ -2690,14 +2554,13 @@ const file_api_v1_user_service_proto_rawDesc = "" +
"\x04HOST\x10\x01\x12\t\n" +
"\x05ADMIN\x10\x02\x12\b\n" +
"\x04USER\x10\x03:7\xeaA4\n" +
"\x11memos.api.v1/User\x12\fusers/{user}\x1a\x04name*\x05users2\x04user\"\xbd\x01\n" +
"\x11memos.api.v1/User\x12\fusers/{user}\x1a\x04name*\x05users2\x04user\"\x9d\x01\n" +
"\x10ListUsersRequest\x12 \n" +
"\tpage_size\x18\x01 \x01(\x05B\x03\xe0A\x01R\bpageSize\x12\"\n" +
"\n" +
"page_token\x18\x02 \x01(\tB\x03\xe0A\x01R\tpageToken\x12\x1b\n" +
"\x06filter\x18\x03 \x01(\tB\x03\xe0A\x01R\x06filter\x12\x1e\n" +
"\border_by\x18\x04 \x01(\tB\x03\xe0A\x01R\aorderBy\x12&\n" +
"\fshow_deleted\x18\x05 \x01(\bB\x03\xe0A\x01R\vshowDeleted\"\x84\x01\n" +
"\x06filter\x18\x03 \x01(\tB\x03\xe0A\x01R\x06filter\x12&\n" +
"\fshow_deleted\x18\x04 \x01(\bB\x03\xe0A\x01R\vshowDeleted\"\x84\x01\n" +
"\x11ListUsersResponse\x12(\n" +
"\x05users\x18\x01 \x03(\v2\x12.memos.api.v1.UserR\x05users\x12&\n" +
"\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12\x1d\n" +
......@@ -2721,17 +2584,7 @@ const file_api_v1_user_service_proto_rawDesc = "" +
"\x11DeleteUserRequest\x12-\n" +
"\x04name\x18\x01 \x01(\tB\x19\xe0A\x02\xfaA\x13\n" +
"\x11memos.api.v1/UserR\x04name\x12\x19\n" +
"\x05force\x18\x02 \x01(\bB\x03\xe0A\x01R\x05force\"u\n" +
"\x12SearchUsersRequest\x12\x19\n" +
"\x05query\x18\x01 \x01(\tB\x03\xe0A\x02R\x05query\x12 \n" +
"\tpage_size\x18\x02 \x01(\x05B\x03\xe0A\x01R\bpageSize\x12\"\n" +
"\n" +
"page_token\x18\x03 \x01(\tB\x03\xe0A\x01R\tpageToken\"\x86\x01\n" +
"\x13SearchUsersResponse\x12(\n" +
"\x05users\x18\x01 \x03(\v2\x12.memos.api.v1.UserR\x05users\x12&\n" +
"\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12\x1d\n" +
"\n" +
"total_size\x18\x03 \x01(\x05R\ttotalSize\"E\n" +
"\x05force\x18\x02 \x01(\bB\x03\xe0A\x01R\x05force\"E\n" +
"\x14GetUserAvatarRequest\x12-\n" +
"\x04name\x18\x01 \x01(\tB\x19\xe0A\x02\xfaA\x13\n" +
"\x11memos.api.v1/UserR\x04name\"\xe4\x04\n" +
......@@ -2880,7 +2733,7 @@ const file_api_v1_user_service_proto_rawDesc = "" +
"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskR\n" +
"updateMask\"3\n" +
"\x18DeleteUserWebhookRequest\x12\x17\n" +
"\x04name\x18\x01 \x01(\tB\x03\xe0A\x02R\x04name2\xe0\x16\n" +
"\x04name\x18\x01 \x01(\tB\x03\xe0A\x02R\x04name2\xe6\x15\n" +
"\vUserService\x12c\n" +
"\tListUsers\x12\x1e.memos.api.v1.ListUsersRequest\x1a\x1f.memos.api.v1.ListUsersResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\x12\r/api/v1/users\x12b\n" +
"\aGetUser\x12\x1c.memos.api.v1.GetUserRequest\x1a\x12.memos.api.v1.User\"%\xdaA\x04name\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/{name=users/*}\x12e\n" +
......@@ -2889,8 +2742,7 @@ const file_api_v1_user_service_proto_rawDesc = "" +
"\n" +
"UpdateUser\x12\x1f.memos.api.v1.UpdateUserRequest\x1a\x12.memos.api.v1.User\"<\xdaA\x10user,update_mask\x82\xd3\xe4\x93\x02#:\x04user2\x1b/api/v1/{user.name=users/*}\x12l\n" +
"\n" +
"DeleteUser\x12\x1f.memos.api.v1.DeleteUserRequest\x1a\x16.google.protobuf.Empty\"%\xdaA\x04name\x82\xd3\xe4\x93\x02\x18*\x16/api/v1/{name=users/*}\x12x\n" +
"\vSearchUsers\x12 .memos.api.v1.SearchUsersRequest\x1a!.memos.api.v1.SearchUsersResponse\"$\xdaA\x05query\x82\xd3\xe4\x93\x02\x16\x12\x14/api/v1/users:search\x12w\n" +
"DeleteUser\x12\x1f.memos.api.v1.DeleteUserRequest\x1a\x16.google.protobuf.Empty\"%\xdaA\x04name\x82\xd3\xe4\x93\x02\x18*\x16/api/v1/{name=users/*}\x12w\n" +
"\rGetUserAvatar\x12\".memos.api.v1.GetUserAvatarRequest\x1a\x14.google.api.HttpBody\",\xdaA\x04name\x82\xd3\xe4\x93\x02\x1f\x12\x1d/api/v1/{name=users/*}/avatar\x12~\n" +
"\x10ListAllUserStats\x12%.memos.api.v1.ListAllUserStatsRequest\x1a&.memos.api.v1.ListAllUserStatsResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/api/v1/users:stats\x12z\n" +
"\fGetUserStats\x12!.memos.api.v1.GetUserStatsRequest\x1a\x17.memos.api.v1.UserStats\".\xdaA\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/{name=users/*}:getStats\x12\x82\x01\n" +
......@@ -2921,7 +2773,7 @@ func file_api_v1_user_service_proto_rawDescGZIP() []byte {
}
var file_api_v1_user_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_api_v1_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 41)
var file_api_v1_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 39)
var file_api_v1_user_service_proto_goTypes = []any{
(User_Role)(0), // 0: memos.api.v1.User.Role
(UserSetting_Key)(0), // 1: memos.api.v1.UserSetting.Key
......@@ -2932,132 +2784,127 @@ var file_api_v1_user_service_proto_goTypes = []any{
(*CreateUserRequest)(nil), // 6: memos.api.v1.CreateUserRequest
(*UpdateUserRequest)(nil), // 7: memos.api.v1.UpdateUserRequest
(*DeleteUserRequest)(nil), // 8: memos.api.v1.DeleteUserRequest
(*SearchUsersRequest)(nil), // 9: memos.api.v1.SearchUsersRequest
(*SearchUsersResponse)(nil), // 10: memos.api.v1.SearchUsersResponse
(*GetUserAvatarRequest)(nil), // 11: memos.api.v1.GetUserAvatarRequest
(*UserStats)(nil), // 12: memos.api.v1.UserStats
(*GetUserStatsRequest)(nil), // 13: memos.api.v1.GetUserStatsRequest
(*ListAllUserStatsRequest)(nil), // 14: memos.api.v1.ListAllUserStatsRequest
(*ListAllUserStatsResponse)(nil), // 15: memos.api.v1.ListAllUserStatsResponse
(*UserSetting)(nil), // 16: memos.api.v1.UserSetting
(*GetUserSettingRequest)(nil), // 17: memos.api.v1.GetUserSettingRequest
(*UpdateUserSettingRequest)(nil), // 18: memos.api.v1.UpdateUserSettingRequest
(*ListUserSettingsRequest)(nil), // 19: memos.api.v1.ListUserSettingsRequest
(*ListUserSettingsResponse)(nil), // 20: memos.api.v1.ListUserSettingsResponse
(*UserAccessToken)(nil), // 21: memos.api.v1.UserAccessToken
(*ListUserAccessTokensRequest)(nil), // 22: memos.api.v1.ListUserAccessTokensRequest
(*ListUserAccessTokensResponse)(nil), // 23: memos.api.v1.ListUserAccessTokensResponse
(*CreateUserAccessTokenRequest)(nil), // 24: memos.api.v1.CreateUserAccessTokenRequest
(*DeleteUserAccessTokenRequest)(nil), // 25: memos.api.v1.DeleteUserAccessTokenRequest
(*UserSession)(nil), // 26: memos.api.v1.UserSession
(*ListUserSessionsRequest)(nil), // 27: memos.api.v1.ListUserSessionsRequest
(*ListUserSessionsResponse)(nil), // 28: memos.api.v1.ListUserSessionsResponse
(*RevokeUserSessionRequest)(nil), // 29: memos.api.v1.RevokeUserSessionRequest
(*UserWebhook)(nil), // 30: memos.api.v1.UserWebhook
(*ListUserWebhooksRequest)(nil), // 31: memos.api.v1.ListUserWebhooksRequest
(*ListUserWebhooksResponse)(nil), // 32: memos.api.v1.ListUserWebhooksResponse
(*CreateUserWebhookRequest)(nil), // 33: memos.api.v1.CreateUserWebhookRequest
(*UpdateUserWebhookRequest)(nil), // 34: memos.api.v1.UpdateUserWebhookRequest
(*DeleteUserWebhookRequest)(nil), // 35: memos.api.v1.DeleteUserWebhookRequest
nil, // 36: memos.api.v1.UserStats.TagCountEntry
(*UserStats_MemoTypeStats)(nil), // 37: memos.api.v1.UserStats.MemoTypeStats
(*UserSetting_GeneralSetting)(nil), // 38: memos.api.v1.UserSetting.GeneralSetting
(*UserSetting_SessionsSetting)(nil), // 39: memos.api.v1.UserSetting.SessionsSetting
(*UserSetting_AccessTokensSetting)(nil), // 40: memos.api.v1.UserSetting.AccessTokensSetting
(*UserSetting_WebhooksSetting)(nil), // 41: memos.api.v1.UserSetting.WebhooksSetting
(*UserSession_ClientInfo)(nil), // 42: memos.api.v1.UserSession.ClientInfo
(State)(0), // 43: memos.api.v1.State
(*timestamppb.Timestamp)(nil), // 44: google.protobuf.Timestamp
(*fieldmaskpb.FieldMask)(nil), // 45: google.protobuf.FieldMask
(*emptypb.Empty)(nil), // 46: google.protobuf.Empty
(*httpbody.HttpBody)(nil), // 47: google.api.HttpBody
(*GetUserAvatarRequest)(nil), // 9: memos.api.v1.GetUserAvatarRequest
(*UserStats)(nil), // 10: memos.api.v1.UserStats
(*GetUserStatsRequest)(nil), // 11: memos.api.v1.GetUserStatsRequest
(*ListAllUserStatsRequest)(nil), // 12: memos.api.v1.ListAllUserStatsRequest
(*ListAllUserStatsResponse)(nil), // 13: memos.api.v1.ListAllUserStatsResponse
(*UserSetting)(nil), // 14: memos.api.v1.UserSetting
(*GetUserSettingRequest)(nil), // 15: memos.api.v1.GetUserSettingRequest
(*UpdateUserSettingRequest)(nil), // 16: memos.api.v1.UpdateUserSettingRequest
(*ListUserSettingsRequest)(nil), // 17: memos.api.v1.ListUserSettingsRequest
(*ListUserSettingsResponse)(nil), // 18: memos.api.v1.ListUserSettingsResponse
(*UserAccessToken)(nil), // 19: memos.api.v1.UserAccessToken
(*ListUserAccessTokensRequest)(nil), // 20: memos.api.v1.ListUserAccessTokensRequest
(*ListUserAccessTokensResponse)(nil), // 21: memos.api.v1.ListUserAccessTokensResponse
(*CreateUserAccessTokenRequest)(nil), // 22: memos.api.v1.CreateUserAccessTokenRequest
(*DeleteUserAccessTokenRequest)(nil), // 23: memos.api.v1.DeleteUserAccessTokenRequest
(*UserSession)(nil), // 24: memos.api.v1.UserSession
(*ListUserSessionsRequest)(nil), // 25: memos.api.v1.ListUserSessionsRequest
(*ListUserSessionsResponse)(nil), // 26: memos.api.v1.ListUserSessionsResponse
(*RevokeUserSessionRequest)(nil), // 27: memos.api.v1.RevokeUserSessionRequest
(*UserWebhook)(nil), // 28: memos.api.v1.UserWebhook
(*ListUserWebhooksRequest)(nil), // 29: memos.api.v1.ListUserWebhooksRequest
(*ListUserWebhooksResponse)(nil), // 30: memos.api.v1.ListUserWebhooksResponse
(*CreateUserWebhookRequest)(nil), // 31: memos.api.v1.CreateUserWebhookRequest
(*UpdateUserWebhookRequest)(nil), // 32: memos.api.v1.UpdateUserWebhookRequest
(*DeleteUserWebhookRequest)(nil), // 33: memos.api.v1.DeleteUserWebhookRequest
nil, // 34: memos.api.v1.UserStats.TagCountEntry
(*UserStats_MemoTypeStats)(nil), // 35: memos.api.v1.UserStats.MemoTypeStats
(*UserSetting_GeneralSetting)(nil), // 36: memos.api.v1.UserSetting.GeneralSetting
(*UserSetting_SessionsSetting)(nil), // 37: memos.api.v1.UserSetting.SessionsSetting
(*UserSetting_AccessTokensSetting)(nil), // 38: memos.api.v1.UserSetting.AccessTokensSetting
(*UserSetting_WebhooksSetting)(nil), // 39: memos.api.v1.UserSetting.WebhooksSetting
(*UserSession_ClientInfo)(nil), // 40: memos.api.v1.UserSession.ClientInfo
(State)(0), // 41: memos.api.v1.State
(*timestamppb.Timestamp)(nil), // 42: google.protobuf.Timestamp
(*fieldmaskpb.FieldMask)(nil), // 43: google.protobuf.FieldMask
(*emptypb.Empty)(nil), // 44: google.protobuf.Empty
(*httpbody.HttpBody)(nil), // 45: google.api.HttpBody
}
var file_api_v1_user_service_proto_depIdxs = []int32{
0, // 0: memos.api.v1.User.role:type_name -> memos.api.v1.User.Role
43, // 1: memos.api.v1.User.state:type_name -> memos.api.v1.State
44, // 2: memos.api.v1.User.create_time:type_name -> google.protobuf.Timestamp
44, // 3: memos.api.v1.User.update_time:type_name -> google.protobuf.Timestamp
41, // 1: memos.api.v1.User.state:type_name -> memos.api.v1.State
42, // 2: memos.api.v1.User.create_time:type_name -> google.protobuf.Timestamp
42, // 3: memos.api.v1.User.update_time:type_name -> google.protobuf.Timestamp
2, // 4: memos.api.v1.ListUsersResponse.users:type_name -> memos.api.v1.User
45, // 5: memos.api.v1.GetUserRequest.read_mask:type_name -> google.protobuf.FieldMask
43, // 5: memos.api.v1.GetUserRequest.read_mask:type_name -> google.protobuf.FieldMask
2, // 6: memos.api.v1.CreateUserRequest.user:type_name -> memos.api.v1.User
2, // 7: memos.api.v1.UpdateUserRequest.user:type_name -> memos.api.v1.User
45, // 8: memos.api.v1.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask
2, // 9: memos.api.v1.SearchUsersResponse.users:type_name -> memos.api.v1.User
44, // 10: memos.api.v1.UserStats.memo_display_timestamps:type_name -> google.protobuf.Timestamp
37, // 11: memos.api.v1.UserStats.memo_type_stats:type_name -> memos.api.v1.UserStats.MemoTypeStats
36, // 12: memos.api.v1.UserStats.tag_count:type_name -> memos.api.v1.UserStats.TagCountEntry
12, // 13: memos.api.v1.ListAllUserStatsResponse.stats:type_name -> memos.api.v1.UserStats
38, // 14: memos.api.v1.UserSetting.general_setting:type_name -> memos.api.v1.UserSetting.GeneralSetting
39, // 15: memos.api.v1.UserSetting.sessions_setting:type_name -> memos.api.v1.UserSetting.SessionsSetting
40, // 16: memos.api.v1.UserSetting.access_tokens_setting:type_name -> memos.api.v1.UserSetting.AccessTokensSetting
41, // 17: memos.api.v1.UserSetting.webhooks_setting:type_name -> memos.api.v1.UserSetting.WebhooksSetting
16, // 18: memos.api.v1.UpdateUserSettingRequest.setting:type_name -> memos.api.v1.UserSetting
45, // 19: memos.api.v1.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
16, // 20: memos.api.v1.ListUserSettingsResponse.settings:type_name -> memos.api.v1.UserSetting
44, // 21: memos.api.v1.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp
44, // 22: memos.api.v1.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp
21, // 23: memos.api.v1.ListUserAccessTokensResponse.access_tokens:type_name -> memos.api.v1.UserAccessToken
21, // 24: memos.api.v1.CreateUserAccessTokenRequest.access_token:type_name -> memos.api.v1.UserAccessToken
44, // 25: memos.api.v1.UserSession.create_time:type_name -> google.protobuf.Timestamp
44, // 26: memos.api.v1.UserSession.last_accessed_time:type_name -> google.protobuf.Timestamp
42, // 27: memos.api.v1.UserSession.client_info:type_name -> memos.api.v1.UserSession.ClientInfo
26, // 28: memos.api.v1.ListUserSessionsResponse.sessions:type_name -> memos.api.v1.UserSession
44, // 29: memos.api.v1.UserWebhook.create_time:type_name -> google.protobuf.Timestamp
44, // 30: memos.api.v1.UserWebhook.update_time:type_name -> google.protobuf.Timestamp
30, // 31: memos.api.v1.ListUserWebhooksResponse.webhooks:type_name -> memos.api.v1.UserWebhook
30, // 32: memos.api.v1.CreateUserWebhookRequest.webhook:type_name -> memos.api.v1.UserWebhook
30, // 33: memos.api.v1.UpdateUserWebhookRequest.webhook:type_name -> memos.api.v1.UserWebhook
45, // 34: memos.api.v1.UpdateUserWebhookRequest.update_mask:type_name -> google.protobuf.FieldMask
26, // 35: memos.api.v1.UserSetting.SessionsSetting.sessions:type_name -> memos.api.v1.UserSession
21, // 36: memos.api.v1.UserSetting.AccessTokensSetting.access_tokens:type_name -> memos.api.v1.UserAccessToken
30, // 37: memos.api.v1.UserSetting.WebhooksSetting.webhooks:type_name -> memos.api.v1.UserWebhook
3, // 38: memos.api.v1.UserService.ListUsers:input_type -> memos.api.v1.ListUsersRequest
5, // 39: memos.api.v1.UserService.GetUser:input_type -> memos.api.v1.GetUserRequest
6, // 40: memos.api.v1.UserService.CreateUser:input_type -> memos.api.v1.CreateUserRequest
7, // 41: memos.api.v1.UserService.UpdateUser:input_type -> memos.api.v1.UpdateUserRequest
8, // 42: memos.api.v1.UserService.DeleteUser:input_type -> memos.api.v1.DeleteUserRequest
9, // 43: memos.api.v1.UserService.SearchUsers:input_type -> memos.api.v1.SearchUsersRequest
11, // 44: memos.api.v1.UserService.GetUserAvatar:input_type -> memos.api.v1.GetUserAvatarRequest
14, // 45: memos.api.v1.UserService.ListAllUserStats:input_type -> memos.api.v1.ListAllUserStatsRequest
13, // 46: memos.api.v1.UserService.GetUserStats:input_type -> memos.api.v1.GetUserStatsRequest
17, // 47: memos.api.v1.UserService.GetUserSetting:input_type -> memos.api.v1.GetUserSettingRequest
18, // 48: memos.api.v1.UserService.UpdateUserSetting:input_type -> memos.api.v1.UpdateUserSettingRequest
19, // 49: memos.api.v1.UserService.ListUserSettings:input_type -> memos.api.v1.ListUserSettingsRequest
22, // 50: memos.api.v1.UserService.ListUserAccessTokens:input_type -> memos.api.v1.ListUserAccessTokensRequest
24, // 51: memos.api.v1.UserService.CreateUserAccessToken:input_type -> memos.api.v1.CreateUserAccessTokenRequest
25, // 52: memos.api.v1.UserService.DeleteUserAccessToken:input_type -> memos.api.v1.DeleteUserAccessTokenRequest
27, // 53: memos.api.v1.UserService.ListUserSessions:input_type -> memos.api.v1.ListUserSessionsRequest
29, // 54: memos.api.v1.UserService.RevokeUserSession:input_type -> memos.api.v1.RevokeUserSessionRequest
31, // 55: memos.api.v1.UserService.ListUserWebhooks:input_type -> memos.api.v1.ListUserWebhooksRequest
33, // 56: memos.api.v1.UserService.CreateUserWebhook:input_type -> memos.api.v1.CreateUserWebhookRequest
34, // 57: memos.api.v1.UserService.UpdateUserWebhook:input_type -> memos.api.v1.UpdateUserWebhookRequest
35, // 58: memos.api.v1.UserService.DeleteUserWebhook:input_type -> memos.api.v1.DeleteUserWebhookRequest
4, // 59: memos.api.v1.UserService.ListUsers:output_type -> memos.api.v1.ListUsersResponse
2, // 60: memos.api.v1.UserService.GetUser:output_type -> memos.api.v1.User
2, // 61: memos.api.v1.UserService.CreateUser:output_type -> memos.api.v1.User
2, // 62: memos.api.v1.UserService.UpdateUser:output_type -> memos.api.v1.User
46, // 63: memos.api.v1.UserService.DeleteUser:output_type -> google.protobuf.Empty
10, // 64: memos.api.v1.UserService.SearchUsers:output_type -> memos.api.v1.SearchUsersResponse
47, // 65: memos.api.v1.UserService.GetUserAvatar:output_type -> google.api.HttpBody
15, // 66: memos.api.v1.UserService.ListAllUserStats:output_type -> memos.api.v1.ListAllUserStatsResponse
12, // 67: memos.api.v1.UserService.GetUserStats:output_type -> memos.api.v1.UserStats
16, // 68: memos.api.v1.UserService.GetUserSetting:output_type -> memos.api.v1.UserSetting
16, // 69: memos.api.v1.UserService.UpdateUserSetting:output_type -> memos.api.v1.UserSetting
20, // 70: memos.api.v1.UserService.ListUserSettings:output_type -> memos.api.v1.ListUserSettingsResponse
23, // 71: memos.api.v1.UserService.ListUserAccessTokens:output_type -> memos.api.v1.ListUserAccessTokensResponse
21, // 72: memos.api.v1.UserService.CreateUserAccessToken:output_type -> memos.api.v1.UserAccessToken
46, // 73: memos.api.v1.UserService.DeleteUserAccessToken:output_type -> google.protobuf.Empty
28, // 74: memos.api.v1.UserService.ListUserSessions:output_type -> memos.api.v1.ListUserSessionsResponse
46, // 75: memos.api.v1.UserService.RevokeUserSession:output_type -> google.protobuf.Empty
32, // 76: memos.api.v1.UserService.ListUserWebhooks:output_type -> memos.api.v1.ListUserWebhooksResponse
30, // 77: memos.api.v1.UserService.CreateUserWebhook:output_type -> memos.api.v1.UserWebhook
30, // 78: memos.api.v1.UserService.UpdateUserWebhook:output_type -> memos.api.v1.UserWebhook
46, // 79: memos.api.v1.UserService.DeleteUserWebhook:output_type -> google.protobuf.Empty
59, // [59:80] is the sub-list for method output_type
38, // [38:59] is the sub-list for method input_type
38, // [38:38] is the sub-list for extension type_name
38, // [38:38] is the sub-list for extension extendee
0, // [0:38] is the sub-list for field type_name
43, // 8: memos.api.v1.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask
42, // 9: memos.api.v1.UserStats.memo_display_timestamps:type_name -> google.protobuf.Timestamp
35, // 10: memos.api.v1.UserStats.memo_type_stats:type_name -> memos.api.v1.UserStats.MemoTypeStats
34, // 11: memos.api.v1.UserStats.tag_count:type_name -> memos.api.v1.UserStats.TagCountEntry
10, // 12: memos.api.v1.ListAllUserStatsResponse.stats:type_name -> memos.api.v1.UserStats
36, // 13: memos.api.v1.UserSetting.general_setting:type_name -> memos.api.v1.UserSetting.GeneralSetting
37, // 14: memos.api.v1.UserSetting.sessions_setting:type_name -> memos.api.v1.UserSetting.SessionsSetting
38, // 15: memos.api.v1.UserSetting.access_tokens_setting:type_name -> memos.api.v1.UserSetting.AccessTokensSetting
39, // 16: memos.api.v1.UserSetting.webhooks_setting:type_name -> memos.api.v1.UserSetting.WebhooksSetting
14, // 17: memos.api.v1.UpdateUserSettingRequest.setting:type_name -> memos.api.v1.UserSetting
43, // 18: memos.api.v1.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
14, // 19: memos.api.v1.ListUserSettingsResponse.settings:type_name -> memos.api.v1.UserSetting
42, // 20: memos.api.v1.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp
42, // 21: memos.api.v1.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp
19, // 22: memos.api.v1.ListUserAccessTokensResponse.access_tokens:type_name -> memos.api.v1.UserAccessToken
19, // 23: memos.api.v1.CreateUserAccessTokenRequest.access_token:type_name -> memos.api.v1.UserAccessToken
42, // 24: memos.api.v1.UserSession.create_time:type_name -> google.protobuf.Timestamp
42, // 25: memos.api.v1.UserSession.last_accessed_time:type_name -> google.protobuf.Timestamp
40, // 26: memos.api.v1.UserSession.client_info:type_name -> memos.api.v1.UserSession.ClientInfo
24, // 27: memos.api.v1.ListUserSessionsResponse.sessions:type_name -> memos.api.v1.UserSession
42, // 28: memos.api.v1.UserWebhook.create_time:type_name -> google.protobuf.Timestamp
42, // 29: memos.api.v1.UserWebhook.update_time:type_name -> google.protobuf.Timestamp
28, // 30: memos.api.v1.ListUserWebhooksResponse.webhooks:type_name -> memos.api.v1.UserWebhook
28, // 31: memos.api.v1.CreateUserWebhookRequest.webhook:type_name -> memos.api.v1.UserWebhook
28, // 32: memos.api.v1.UpdateUserWebhookRequest.webhook:type_name -> memos.api.v1.UserWebhook
43, // 33: memos.api.v1.UpdateUserWebhookRequest.update_mask:type_name -> google.protobuf.FieldMask
24, // 34: memos.api.v1.UserSetting.SessionsSetting.sessions:type_name -> memos.api.v1.UserSession
19, // 35: memos.api.v1.UserSetting.AccessTokensSetting.access_tokens:type_name -> memos.api.v1.UserAccessToken
28, // 36: memos.api.v1.UserSetting.WebhooksSetting.webhooks:type_name -> memos.api.v1.UserWebhook
3, // 37: memos.api.v1.UserService.ListUsers:input_type -> memos.api.v1.ListUsersRequest
5, // 38: memos.api.v1.UserService.GetUser:input_type -> memos.api.v1.GetUserRequest
6, // 39: memos.api.v1.UserService.CreateUser:input_type -> memos.api.v1.CreateUserRequest
7, // 40: memos.api.v1.UserService.UpdateUser:input_type -> memos.api.v1.UpdateUserRequest
8, // 41: memos.api.v1.UserService.DeleteUser:input_type -> memos.api.v1.DeleteUserRequest
9, // 42: memos.api.v1.UserService.GetUserAvatar:input_type -> memos.api.v1.GetUserAvatarRequest
12, // 43: memos.api.v1.UserService.ListAllUserStats:input_type -> memos.api.v1.ListAllUserStatsRequest
11, // 44: memos.api.v1.UserService.GetUserStats:input_type -> memos.api.v1.GetUserStatsRequest
15, // 45: memos.api.v1.UserService.GetUserSetting:input_type -> memos.api.v1.GetUserSettingRequest
16, // 46: memos.api.v1.UserService.UpdateUserSetting:input_type -> memos.api.v1.UpdateUserSettingRequest
17, // 47: memos.api.v1.UserService.ListUserSettings:input_type -> memos.api.v1.ListUserSettingsRequest
20, // 48: memos.api.v1.UserService.ListUserAccessTokens:input_type -> memos.api.v1.ListUserAccessTokensRequest
22, // 49: memos.api.v1.UserService.CreateUserAccessToken:input_type -> memos.api.v1.CreateUserAccessTokenRequest
23, // 50: memos.api.v1.UserService.DeleteUserAccessToken:input_type -> memos.api.v1.DeleteUserAccessTokenRequest
25, // 51: memos.api.v1.UserService.ListUserSessions:input_type -> memos.api.v1.ListUserSessionsRequest
27, // 52: memos.api.v1.UserService.RevokeUserSession:input_type -> memos.api.v1.RevokeUserSessionRequest
29, // 53: memos.api.v1.UserService.ListUserWebhooks:input_type -> memos.api.v1.ListUserWebhooksRequest
31, // 54: memos.api.v1.UserService.CreateUserWebhook:input_type -> memos.api.v1.CreateUserWebhookRequest
32, // 55: memos.api.v1.UserService.UpdateUserWebhook:input_type -> memos.api.v1.UpdateUserWebhookRequest
33, // 56: memos.api.v1.UserService.DeleteUserWebhook:input_type -> memos.api.v1.DeleteUserWebhookRequest
4, // 57: memos.api.v1.UserService.ListUsers:output_type -> memos.api.v1.ListUsersResponse
2, // 58: memos.api.v1.UserService.GetUser:output_type -> memos.api.v1.User
2, // 59: memos.api.v1.UserService.CreateUser:output_type -> memos.api.v1.User
2, // 60: memos.api.v1.UserService.UpdateUser:output_type -> memos.api.v1.User
44, // 61: memos.api.v1.UserService.DeleteUser:output_type -> google.protobuf.Empty
45, // 62: memos.api.v1.UserService.GetUserAvatar:output_type -> google.api.HttpBody
13, // 63: memos.api.v1.UserService.ListAllUserStats:output_type -> memos.api.v1.ListAllUserStatsResponse
10, // 64: memos.api.v1.UserService.GetUserStats:output_type -> memos.api.v1.UserStats
14, // 65: memos.api.v1.UserService.GetUserSetting:output_type -> memos.api.v1.UserSetting
14, // 66: memos.api.v1.UserService.UpdateUserSetting:output_type -> memos.api.v1.UserSetting
18, // 67: memos.api.v1.UserService.ListUserSettings:output_type -> memos.api.v1.ListUserSettingsResponse
21, // 68: memos.api.v1.UserService.ListUserAccessTokens:output_type -> memos.api.v1.ListUserAccessTokensResponse
19, // 69: memos.api.v1.UserService.CreateUserAccessToken:output_type -> memos.api.v1.UserAccessToken
44, // 70: memos.api.v1.UserService.DeleteUserAccessToken:output_type -> google.protobuf.Empty
26, // 71: memos.api.v1.UserService.ListUserSessions:output_type -> memos.api.v1.ListUserSessionsResponse
44, // 72: memos.api.v1.UserService.RevokeUserSession:output_type -> google.protobuf.Empty
30, // 73: memos.api.v1.UserService.ListUserWebhooks:output_type -> memos.api.v1.ListUserWebhooksResponse
28, // 74: memos.api.v1.UserService.CreateUserWebhook:output_type -> memos.api.v1.UserWebhook
28, // 75: memos.api.v1.UserService.UpdateUserWebhook:output_type -> memos.api.v1.UserWebhook
44, // 76: memos.api.v1.UserService.DeleteUserWebhook:output_type -> google.protobuf.Empty
57, // [57:77] is the sub-list for method output_type
37, // [37:57] is the sub-list for method input_type
37, // [37:37] is the sub-list for extension type_name
37, // [37:37] is the sub-list for extension extendee
0, // [0:37] is the sub-list for field type_name
}
func init() { file_api_v1_user_service_proto_init() }
......@@ -3066,7 +2913,7 @@ func file_api_v1_user_service_proto_init() {
return
}
file_api_v1_common_proto_init()
file_api_v1_user_service_proto_msgTypes[14].OneofWrappers = []any{
file_api_v1_user_service_proto_msgTypes[12].OneofWrappers = []any{
(*UserSetting_GeneralSetting_)(nil),
(*UserSetting_SessionsSetting_)(nil),
(*UserSetting_AccessTokensSetting_)(nil),
......@@ -3078,7 +2925,7 @@ func file_api_v1_user_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_user_service_proto_rawDesc), len(file_api_v1_user_service_proto_rawDesc)),
NumEnums: 2,
NumMessages: 41,
NumMessages: 39,
NumExtensions: 0,
NumServices: 1,
},
......
......@@ -298,41 +298,6 @@ func local_request_UserService_DeleteUser_0(ctx context.Context, marshaler runti
return msg, metadata, err
}
var filter_UserService_SearchUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
func request_UserService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq SearchUsersRequest
metadata runtime.ServerMetadata
)
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_SearchUsers_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.SearchUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_UserService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq SearchUsersRequest
metadata runtime.ServerMetadata
)
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_SearchUsers_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.SearchUsers(ctx, &protoReq)
return msg, metadata, err
}
func request_UserService_GetUserAvatar_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq GetUserAvatarRequest
......@@ -1144,26 +1109,6 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
}
forward_UserService_DeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodGet, pattern_UserService_SearchUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v1/users:search"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_UserService_SearchUsers_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_UserService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodGet, pattern_UserService_GetUserAvatar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
......@@ -1589,23 +1534,6 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
}
forward_UserService_DeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodGet, pattern_UserService_SearchUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v1/users:search"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_UserService_SearchUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_UserService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodGet, pattern_UserService_GetUserAvatar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
......@@ -1870,7 +1798,6 @@ var (
pattern_UserService_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "users"}, ""))
pattern_UserService_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "users", "user.name"}, ""))
pattern_UserService_DeleteUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "users", "name"}, ""))
pattern_UserService_SearchUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "users"}, "search"))
pattern_UserService_GetUserAvatar_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v1", "users", "name", "avatar"}, ""))
pattern_UserService_ListAllUserStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "users"}, "stats"))
pattern_UserService_GetUserStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "users", "name"}, "getStats"))
......@@ -1894,7 +1821,6 @@ var (
forward_UserService_CreateUser_0 = runtime.ForwardResponseMessage
forward_UserService_UpdateUser_0 = runtime.ForwardResponseMessage
forward_UserService_DeleteUser_0 = runtime.ForwardResponseMessage
forward_UserService_SearchUsers_0 = runtime.ForwardResponseMessage
forward_UserService_GetUserAvatar_0 = runtime.ForwardResponseMessage
forward_UserService_ListAllUserStats_0 = runtime.ForwardResponseMessage
forward_UserService_GetUserStats_0 = runtime.ForwardResponseMessage
......
......@@ -26,7 +26,6 @@ const (
UserService_CreateUser_FullMethodName = "/memos.api.v1.UserService/CreateUser"
UserService_UpdateUser_FullMethodName = "/memos.api.v1.UserService/UpdateUser"
UserService_DeleteUser_FullMethodName = "/memos.api.v1.UserService/DeleteUser"
UserService_SearchUsers_FullMethodName = "/memos.api.v1.UserService/SearchUsers"
UserService_GetUserAvatar_FullMethodName = "/memos.api.v1.UserService/GetUserAvatar"
UserService_ListAllUserStats_FullMethodName = "/memos.api.v1.UserService/ListAllUserStats"
UserService_GetUserStats_FullMethodName = "/memos.api.v1.UserService/GetUserStats"
......@@ -58,8 +57,6 @@ type UserServiceClient interface {
UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error)
// DeleteUser deletes a user.
DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// SearchUsers searches for users based on query.
SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error)
// GetUserAvatar gets the avatar of a user.
GetUserAvatar(ctx context.Context, in *GetUserAvatarRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
// ListAllUserStats returns statistics for all users.
......@@ -150,16 +147,6 @@ func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserReques
return out, nil
}
func (c *userServiceClient) SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SearchUsersResponse)
err := c.cc.Invoke(ctx, UserService_SearchUsers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) GetUserAvatar(ctx context.Context, in *GetUserAvatarRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(httpbody.HttpBody)
......@@ -324,8 +311,6 @@ type UserServiceServer interface {
UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
// DeleteUser deletes a user.
DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error)
// SearchUsers searches for users based on query.
SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error)
// GetUserAvatar gets the avatar of a user.
GetUserAvatar(context.Context, *GetUserAvatarRequest) (*httpbody.HttpBody, error)
// ListAllUserStats returns statistics for all users.
......@@ -381,9 +366,6 @@ func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserReq
func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")
}
func (UnimplementedUserServiceServer) SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SearchUsers not implemented")
}
func (UnimplementedUserServiceServer) GetUserAvatar(context.Context, *GetUserAvatarRequest) (*httpbody.HttpBody, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserAvatar not implemented")
}
......@@ -540,24 +522,6 @@ func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
func _UserService_SearchUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchUsersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).SearchUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_SearchUsers_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).SearchUsers(ctx, req.(*SearchUsersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_GetUserAvatar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserAvatarRequest)
if err := dec(in); err != nil {
......@@ -855,10 +819,6 @@ var UserService_ServiceDesc = grpc.ServiceDesc{
MethodName: "DeleteUser",
Handler: _UserService_DeleteUser_Handler,
},
{
MethodName: "SearchUsers",
Handler: _UserService_SearchUsers_Handler,
},
{
MethodName: "GetUserAvatar",
Handler: _UserService_GetUserAvatar_Handler,
......
......@@ -15,19 +15,13 @@ paths:
parameters:
- name: pageSize
in: query
description: |-
The maximum number of activities to return.
The service may return fewer than this value.
If unspecified, at most 100 activities will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
description: "The maximum number of activities to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 100 activities will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
schema:
type: integer
format: int32
- name: pageToken
in: query
description: |-
A page token, received from a previous `ListActivities` call.
Provide this to retrieve the subsequent page.
description: "A page token, received from a previous `ListActivities` call.\r\n Provide this to retrieve the subsequent page."
schema:
type: string
responses:
......@@ -78,35 +72,23 @@ paths:
parameters:
- name: pageSize
in: query
description: |-
Optional. The maximum number of attachments to return.
The service may return fewer than this value.
If unspecified, at most 50 attachments will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
description: "Optional. The maximum number of attachments to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 attachments will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
schema:
type: integer
format: int32
- name: pageToken
in: query
description: |-
Optional. A page token, received from a previous `ListAttachments` call.
Provide this to retrieve the subsequent page.
description: "Optional. A page token, received from a previous `ListAttachments` call.\r\n Provide this to retrieve the subsequent page."
schema:
type: string
- name: filter
in: query
description: |-
Optional. Filter to apply to the list results.
Example: "type=image/png" or "filename:*.jpg"
Supported operators: =, !=, <, <=, >, >=, :
Supported fields: filename, type, size, create_time, memo
description: "Optional. Filter to apply to the list results.\r\n Example: \"type=image/png\" or \"filename:*.jpg\"\r\n Supported operators: =, !=, <, <=, >, >=, :\r\n Supported fields: filename, type, size, create_time, memo"
schema:
type: string
- name: orderBy
in: query
description: |-
Optional. The order to sort results by.
Example: "create_time desc" or "filename asc"
description: "Optional. The order to sort results by.\r\n Example: \"create_time desc\" or \"filename asc\""
schema:
type: string
responses:
......@@ -130,9 +112,7 @@ paths:
parameters:
- name: attachmentId
in: query
description: |-
Optional. The attachment ID to use for this attachment.
If empty, a unique ID will be generated.
description: "Optional. The attachment ID to use for this attachment.\r\n If empty, a unique ID will be generated."
schema:
type: string
requestBody:
......@@ -243,9 +223,7 @@ paths:
post:
tags:
- AuthService
description: |-
CreateSession authenticates a user and creates a new session.
Returns the authenticated user information upon successful authentication.
description: "CreateSession authenticates a user and creates a new session.\r\n Returns the authenticated user information upon successful authentication."
operationId: AuthService_CreateSession
requestBody:
content:
......@@ -270,9 +248,7 @@ paths:
get:
tags:
- AuthService
description: |-
GetCurrentSession returns the current active session information.
This method is idempotent and safe, suitable for checking current session state.
description: "GetCurrentSession returns the current active session information.\r\n This method is idempotent and safe, suitable for checking current session state."
operationId: AuthService_GetCurrentSession
responses:
"200":
......@@ -290,9 +266,7 @@ paths:
delete:
tags:
- AuthService
description: |-
DeleteSession terminates the current user session.
This is an idempotent operation that invalidates the user's authentication.
description: "DeleteSession terminates the current user session.\r\n This is an idempotent operation that invalidates the user's authentication."
operationId: AuthService_DeleteSession
responses:
"200":
......@@ -331,9 +305,7 @@ paths:
parameters:
- name: identityProviderId
in: query
description: |-
Optional. The ID to use for the identity provider, which will become the final component of the resource name.
If not provided, the system will generate one.
description: "Optional. The ID to use for the identity provider, which will become the final component of the resource name.\r\n If not provided, the system will generate one."
schema:
type: string
requestBody:
......@@ -417,9 +389,7 @@ paths:
type: string
- name: updateMask
in: query
description: |-
Required. The update mask applies to the resource. Only the top level fields of
IdentityProvider are supported.
description: "Required. The update mask applies to the resource. Only the top level fields of\r\n IdentityProvider are supported."
schema:
type: string
format: field-mask
......@@ -511,9 +481,7 @@ paths:
get:
tags:
- MarkdownService
description: |-
GetLinkMetadata returns metadata for a given link.
This is useful for generating link previews.
description: "GetLinkMetadata returns metadata for a given link.\r\n This is useful for generating link previews."
operationId: MarkdownService_GetLinkMetadata
parameters:
- name: link
......@@ -538,9 +506,7 @@ paths:
post:
tags:
- MarkdownService
description: |-
ParseMarkdown parses the given markdown content and returns a list of nodes.
This is a utility method that transforms markdown text into structured nodes.
description: "ParseMarkdown parses the given markdown content and returns a list of nodes.\r\n This is a utility method that transforms markdown text into structured nodes."
operationId: MarkdownService_ParseMarkdown
requestBody:
content:
......@@ -565,9 +531,7 @@ paths:
post:
tags:
- MarkdownService
description: |-
RestoreMarkdownNodes restores the given nodes to markdown content.
This is the inverse operation of ParseMarkdown.
description: "RestoreMarkdownNodes restores the given nodes to markdown content.\r\n This is the inverse operation of ParseMarkdown."
operationId: MarkdownService_RestoreMarkdownNodes
requestBody:
content:
......@@ -592,9 +556,7 @@ paths:
post:
tags:
- MarkdownService
description: |-
StringifyMarkdownNodes stringify the given nodes to plain text content.
This removes all markdown formatting and returns plain text.
description: "StringifyMarkdownNodes stringify the given nodes to plain text content.\r\n This removes all markdown formatting and returns plain text."
operationId: MarkdownService_StringifyMarkdownNodes
requestBody:
content:
......@@ -624,26 +586,18 @@ paths:
parameters:
- name: pageSize
in: query
description: |-
Optional. The maximum number of memos to return.
The service may return fewer than this value.
If unspecified, at most 50 memos will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
description: "Optional. The maximum number of memos to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 memos will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
schema:
type: integer
format: int32
- name: pageToken
in: query
description: |-
Optional. A page token, received from a previous `ListMemos` call.
Provide this to retrieve the subsequent page.
description: "Optional. A page token, received from a previous `ListMemos` call.\r\n Provide this to retrieve the subsequent page."
schema:
type: string
- name: state
in: query
description: |-
Optional. The state of the memos to list.
Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
description: "Optional. The state of the memos to list.\r\n Default to `NORMAL`. Set to `ARCHIVED` to list archived memos."
schema:
enum:
- STATE_UNSPECIFIED
......@@ -653,18 +607,12 @@ paths:
format: enum
- name: orderBy
in: query
description: |-
Optional. The order to sort results by.
Default to "display_time desc".
Example: "display_time desc" or "create_time asc"
description: "Optional. The order to sort results by.\r\n Default to \"display_time desc\".\r\n Example: \"display_time desc\" or \"create_time asc\""
schema:
type: string
- name: filter
in: query
description: |-
Optional. Filter to apply to the list results.
Filter is a CEL expression to filter memos.
Refer to `Shortcut.filter`.
description: "Optional. Filter to apply to the list results.\r\n Filter is a CEL expression to filter memos.\r\n Refer to `Shortcut.filter`."
schema:
type: string
- name: showDeleted
......@@ -693,9 +641,7 @@ paths:
parameters:
- name: memoId
in: query
description: |-
Optional. The memo ID to use for this memo.
If empty, a unique ID will be generated.
description: "Optional. The memo ID to use for this memo.\r\n If empty, a unique ID will be generated."
schema:
type: string
- name: validateOnly
......@@ -742,9 +688,7 @@ paths:
type: string
- name: readMask
in: query
description: |-
Optional. The fields to return in the response.
If not specified, all fields are returned.
description: "Optional. The fields to return in the response.\r\n If not specified, all fields are returned."
schema:
type: string
format: field-mask
......@@ -1207,35 +1151,18 @@ paths:
parameters:
- name: pageSize
in: query
description: |-
Optional. The maximum number of users to return.
The service may return fewer than this value.
If unspecified, at most 50 users will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
description: "Optional. The maximum number of users to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 users will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
schema:
type: integer
format: int32
- name: pageToken
in: query
description: |-
Optional. A page token, received from a previous `ListUsers` call.
Provide this to retrieve the subsequent page.
description: "Optional. A page token, received from a previous `ListUsers` call.\r\n Provide this to retrieve the subsequent page."
schema:
type: string
- name: filter
in: query
description: |-
Optional. Filter to apply to the list results.
Example: "state=ACTIVE" or "role=USER" or "email:@example.com"
Supported operators: =, !=, <, <=, >, >=, :
Supported fields: username, email, role, state, create_time, update_time
schema:
type: string
- name: orderBy
in: query
description: |-
Optional. The order to sort results by.
Example: "create_time desc" or "username asc"
description: "Optional. Filter to apply to the list results.\r\n Example: \"state=ACTIVE\" or \"role=USER\" or \"email:@example.com\"\r\n Supported operators: =, !=, <, <=, >, >=, :\r\n Supported fields: username, email, role, state, create_time, update_time"
schema:
type: string
- name: showDeleted
......@@ -1264,10 +1191,7 @@ paths:
parameters:
- name: userId
in: query
description: |-
Optional. The user ID to use for this user.
If empty, a unique ID will be generated.
Must match the pattern [a-z0-9-]+
description: "Optional. The user ID to use for this user.\r\n If empty, a unique ID will be generated.\r\n Must match the pattern [a-z0-9-]+"
schema:
type: string
- name: validateOnly
......@@ -1277,9 +1201,7 @@ paths:
type: boolean
- name: requestId
in: query
description: |-
Optional. An idempotency token that can be used to ensure that multiple
requests to create a user have the same result.
description: "Optional. An idempotency token that can be used to ensure that multiple\r\n requests to create a user have the same result."
schema:
type: string
requestBody:
......@@ -1316,9 +1238,7 @@ paths:
type: string
- name: readMask
in: query
description: |-
Optional. The fields to return in the response.
If not specified, all fields are returned.
description: "Optional. The fields to return in the response.\r\n If not specified, all fields are returned."
schema:
type: string
format: field-mask
......@@ -1545,35 +1465,23 @@ paths:
type: string
- name: pageSize
in: query
description: |-
Optional. The maximum number of inboxes to return.
The service may return fewer than this value.
If unspecified, at most 50 inboxes will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
description: "Optional. The maximum number of inboxes to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 inboxes will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
schema:
type: integer
format: int32
- name: pageToken
in: query
description: |-
Optional. A page token, received from a previous `ListInboxes` call.
Provide this to retrieve the subsequent page.
description: "Optional. A page token, received from a previous `ListInboxes` call.\r\n Provide this to retrieve the subsequent page."
schema:
type: string
- name: filter
in: query
description: |-
Optional. Filter to apply to the list results.
Example: "status=UNREAD" or "type=MEMO_COMMENT"
Supported operators: =, !=
Supported fields: status, type, sender, create_time
description: "Optional. Filter to apply to the list results.\r\n Example: \"status=UNREAD\" or \"type=MEMO_COMMENT\"\r\n Supported operators: =, !=\r\n Supported fields: status, type, sender, create_time"
schema:
type: string
- name: orderBy
in: query
description: |-
Optional. The order to sort results by.
Example: "create_time desc" or "status asc"
description: "Optional. The order to sort results by.\r\n Example: \"create_time desc\" or \"status asc\""
schema:
type: string
responses:
......@@ -1659,19 +1567,13 @@ paths:
type: string
- name: pageSize
in: query
description: |-
Optional. The maximum number of settings to return.
The service may return fewer than this value.
If unspecified, at most 50 settings will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
description: "Optional. The maximum number of settings to return.\r\n The service may return fewer than this value.\r\n If unspecified, at most 50 settings will be returned.\r\n The maximum value is 1000; values above 1000 will be coerced to 1000."
schema:
type: integer
format: int32
- name: pageToken
in: query
description: |-
Optional. A page token, received from a previous `ListUserSettings` call.
Provide this to retrieve the subsequent page.
description: "Optional. A page token, received from a previous `ListUserSettings` call.\r\n Provide this to retrieve the subsequent page."
schema:
type: string
responses:
......@@ -2082,42 +1984,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/api/v1/users:search:
get:
tags:
- UserService
description: SearchUsers searches for users based on query.
operationId: UserService_SearchUsers
parameters:
- name: query
in: query
description: Required. The search query.
schema:
type: string
- name: pageSize
in: query
description: Optional. The maximum number of users to return.
schema:
type: integer
format: int32
- name: pageToken
in: query
description: Optional. A page token for pagination.
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SearchUsersResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/api/v1/users:stats:
get:
tags:
......@@ -2262,15 +2128,11 @@ components:
name:
readOnly: true
type: string
description: |-
The name of the activity.
Format: activities/{id}
description: "The name of the activity.\r\n Format: activities/{id}"
creator:
readOnly: true
type: string
description: |-
The name of the creator.
Format: users/{user}
description: "The name of the creator.\r\n Format: users/{user}"
type:
readOnly: true
enum:
......@@ -2305,14 +2167,10 @@ components:
properties:
memo:
type: string
description: |-
The memo name of comment.
Format: memos/{memo}
description: "The memo name of comment.\r\n Format: memos/{memo}"
relatedMemo:
type: string
description: |-
The name of related memo.
Format: memos/{memo}
description: "The name of related memo.\r\n Format: memos/{memo}"
description: ActivityMemoCommentPayload represents the payload of a memo comment activity.
ActivityPayload:
type: object
......@@ -2329,9 +2187,7 @@ components:
properties:
name:
type: string
description: |-
The name of the attachment.
Format: attachments/{attachment}
description: "The name of the attachment.\r\n Format: attachments/{attachment}"
createTime:
readOnly: true
type: string
......@@ -2357,9 +2213,7 @@ components:
description: Output only. The size of the attachment in bytes.
memo:
type: string
description: |-
Optional. The related memo. Refer to `Memo.name`.
Format: memos/{memo}
description: "Optional. The related memo. Refer to `Memo.name`.\r\n Format: memos/{memo}"
AutoLinkNode:
type: object
properties:
......@@ -2421,14 +2275,10 @@ components:
properties:
username:
type: string
description: |-
The username to sign in with.
Required field for password-based authentication.
description: "The username to sign in with.\r\n Required field for password-based authentication."
password:
type: string
description: |-
The password to sign in with.
Required field for password-based authentication.
description: "The password to sign in with.\r\n Required field for password-based authentication."
description: Nested message for password-based authentication credentials.
CreateSessionRequest_SSOCredentials:
required:
......@@ -2439,20 +2289,14 @@ components:
properties:
idpId:
type: integer
description: |-
The ID of the SSO provider.
Required field to identify the SSO provider.
description: "The ID of the SSO provider.\r\n Required field to identify the SSO provider."
format: int32
code:
type: string
description: |-
The authorization code from the SSO provider.
Required field for completing the SSO flow.
description: "The authorization code from the SSO provider.\r\n Required field for completing the SSO flow."
redirectUri:
type: string
description: |-
The redirect URI used in the SSO flow.
Required field for security validation.
description: "The redirect URI used in the SSO flow.\r\n Required field for security validation."
description: Nested message for SSO authentication credentials.
CreateSessionResponse:
type: object
......@@ -2463,9 +2307,7 @@ components:
description: The authenticated user information.
lastAccessedAt:
type: string
description: |-
Last time the session was accessed.
Used for sliding expiration calculation (last_accessed_time + 2 weeks).
description: "Last time the session was accessed.\r\n Used for sliding expiration calculation (last_accessed_time + 2 weeks)."
format: date-time
EmbeddedContentNode:
type: object
......@@ -2513,9 +2355,7 @@ components:
$ref: '#/components/schemas/User'
lastAccessedAt:
type: string
description: |-
Last time the session was accessed.
Used for sliding expiration calculation (last_accessed_time + 2 weeks).
description: "Last time the session was accessed.\r\n Used for sliding expiration calculation (last_accessed_time + 2 weeks)."
format: date-time
GoogleProtobufAny:
type: object
......@@ -2563,9 +2403,7 @@ components:
properties:
name:
type: string
description: |-
The resource name of the identity provider.
Format: identityProviders/{idp}
description: "The resource name of the identity provider.\r\n Format: identityProviders/{idp}"
type:
enum:
- TYPE_UNSPECIFIED
......@@ -2600,21 +2438,15 @@ components:
properties:
name:
type: string
description: |-
The resource name of the inbox.
Format: inboxes/{inbox}
description: "The resource name of the inbox.\r\n Format: inboxes/{inbox}"
sender:
readOnly: true
type: string
description: |-
The sender of the inbox notification.
Format: users/{user}
description: "The sender of the inbox notification.\r\n Format: users/{user}"
receiver:
readOnly: true
type: string
description: |-
The receiver of the inbox notification.
Format: users/{user}
description: "The receiver of the inbox notification.\r\n Format: users/{user}"
status:
enum:
- STATUS_UNSPECIFIED
......@@ -2684,10 +2516,7 @@ components:
description: The activities.
nextPageToken:
type: string
description: |-
A token to retrieve the next page of results.
Pass this value in the page_token field in the subsequent call to `ListActivities`
method to retrieve the next page of results.
description: "A token to retrieve the next page of results.\r\n Pass this value in the page_token field in the subsequent call to `ListActivities`\r\n method to retrieve the next page of results."
ListAllUserStatsResponse:
type: object
properties:
......@@ -2706,9 +2535,7 @@ components:
description: The list of attachments.
nextPageToken:
type: string
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
totalSize:
type: integer
description: The total count of attachments (may be approximate).
......@@ -2731,9 +2558,7 @@ components:
description: The list of inboxes.
nextPageToken:
type: string
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
totalSize:
type: integer
description: The total count of inboxes (may be approximate).
......@@ -2808,9 +2633,7 @@ components:
description: The list of memos.
nextPageToken:
type: string
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
totalSize:
type: integer
description: The total count of memos (may be approximate).
......@@ -2874,9 +2697,7 @@ components:
description: The list of user settings.
nextPageToken:
type: string
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
totalSize:
type: integer
description: The total count of settings (may be approximate).
......@@ -2900,9 +2721,7 @@ components:
description: The list of users.
nextPageToken:
type: string
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
description: "A token that can be sent as `page_token` to retrieve the next page.\r\n If this field is omitted, there are no subsequent pages."
totalSize:
type: integer
description: The total count of users (may be approximate).
......@@ -2940,9 +2759,7 @@ components:
properties:
name:
type: string
description: |-
The resource name of the memo.
Format: memos/{memo}, memo is the user defined id or uuid.
description: "The resource name of the memo.\r\n Format: memos/{memo}, memo is the user defined id or uuid."
state:
enum:
- STATE_UNSPECIFIED
......@@ -2954,9 +2771,7 @@ components:
creator:
readOnly: true
type: string
description: |-
The name of the creator.
Format: users/{user}
description: "The name of the creator.\r\n Format: users/{user}"
createTime:
readOnly: true
type: string
......@@ -3022,9 +2837,7 @@ components:
parent:
readOnly: true
type: string
description: |-
Output only. The name of the parent memo.
Format: memos/{memo}
description: "Output only. The name of the parent memo.\r\n Format: memos/{memo}"
snippet:
readOnly: true
type: string
......@@ -3062,9 +2875,7 @@ components:
properties:
name:
type: string
description: |-
The resource name of the memo.
Format: memos/{memo}
description: "The resource name of the memo.\r\n Format: memos/{memo}"
snippet:
readOnly: true
type: string
......@@ -3250,21 +3061,14 @@ components:
name:
readOnly: true
type: string
description: |-
The resource name of the reaction.
Format: reactions/{reaction}
description: "The resource name of the reaction.\r\n Format: reactions/{reaction}"
creator:
readOnly: true
type: string
description: |-
The resource name of the creator.
Format: users/{user}
description: "The resource name of the creator.\r\n Format: users/{user}"
contentId:
type: string
description: |-
The resource name of the content.
For memo reactions, this should be the memo's resource name.
Format: memos/{memo}
description: "The resource name of the content.\r\n For memo reactions, this should be the memo's resource name.\r\n Format: memos/{memo}"
reactionType:
type: string
description: "Required. The type of reaction (e.g., \"\U0001F44D\", \"❤️\", \"\U0001F604\")."
......@@ -3291,9 +3095,7 @@ components:
properties:
parent:
type: string
description: |-
Required. The parent, who owns the tags.
Format: memos/{memo}. Use "memos/-" to rename all tags.
description: "Required. The parent, who owns the tags.\r\n Format: memos/{memo}. Use \"memos/-\" to rename all tags."
oldTag:
type: string
description: Required. The old tag name to rename.
......@@ -3316,21 +3118,6 @@ components:
markdown:
type: string
description: The restored markdown content.
SearchUsersResponse:
type: object
properties:
users:
type: array
items:
$ref: '#/components/schemas/User'
description: The list of users matching the search query.
nextPageToken:
type: string
description: A token for the next page of results.
totalSize:
type: integer
description: The total count of matching users.
format: int32
SetMemoAttachmentsRequest:
required:
- name
......@@ -3339,9 +3126,7 @@ components:
properties:
name:
type: string
description: |-
Required. The resource name of the memo.
Format: memos/{memo}
description: "Required. The resource name of the memo.\r\n Format: memos/{memo}"
attachments:
type: array
items:
......@@ -3355,9 +3140,7 @@ components:
properties:
name:
type: string
description: |-
Required. The resource name of the memo.
Format: memos/{memo}
description: "Required. The resource name of the memo.\r\n Format: memos/{memo}"
relations:
type: array
items:
......@@ -3370,9 +3153,7 @@ components:
properties:
name:
type: string
description: |-
The resource name of the shortcut.
Format: users/{user}/shortcuts/{shortcut}
description: "The resource name of the shortcut.\r\n Format: users/{user}/shortcuts/{shortcut}"
title:
type: string
description: The title of the shortcut.
......@@ -3415,9 +3196,7 @@ components:
type: string
usePathStyle:
type: boolean
description: |-
S3 configuration for cloud storage backend.
Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/
description: "S3 configuration for cloud storage backend.\r\n Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/"
StrikethroughNode:
type: object
properties:
......@@ -3515,9 +3294,7 @@ components:
properties:
name:
type: string
description: |-
Required. The resource name of the memo.
Format: memos/{memo}
description: "Required. The resource name of the memo.\r\n Format: memos/{memo}"
reaction:
allOf:
- $ref: '#/components/schemas/Reaction'
......@@ -3531,9 +3308,7 @@ components:
properties:
name:
type: string
description: |-
The resource name of the user.
Format: users/{user}
description: "The resource name of the user.\r\n Format: users/{user}"
role:
enum:
- ROLE_UNSPECIFIED
......@@ -3585,9 +3360,7 @@ components:
properties:
name:
type: string
description: |-
The resource name of the access token.
Format: users/{user}/accessTokens/{access_token}
description: "The resource name of the access token.\r\n Format: users/{user}/accessTokens/{access_token}"
accessToken:
readOnly: true
type: string
......@@ -3610,9 +3383,7 @@ components:
properties:
name:
type: string
description: |-
The resource name of the session.
Format: users/{user}/sessions/{session}
description: "The resource name of the session.\r\n Format: users/{user}/sessions/{session}"
sessionId:
readOnly: true
type: string
......@@ -3625,9 +3396,7 @@ components:
lastAccessedTime:
readOnly: true
type: string
description: |-
The timestamp when the session was last accessed.
Used for sliding expiration calculation (last_accessed_time + 2 weeks).
description: "The timestamp when the session was last accessed.\r\n Used for sliding expiration calculation (last_accessed_time + 2 weeks)."
format: date-time
clientInfo:
readOnly: true
......@@ -3657,10 +3426,7 @@ components:
properties:
name:
type: string
description: |-
The name of the user setting.
Format: users/{user}/settings/{setting}, {setting} is the key for the setting.
For example, "users/123/settings/GENERAL" for general settings.
description: "The name of the user setting.\r\n Format: users/{user}/settings/{setting}, {setting} is the key for the setting.\r\n For example, \"users/123/settings/GENERAL\" for general settings."
generalSetting:
$ref: '#/components/schemas/UserSetting_GeneralSetting'
sessionsSetting:
......@@ -3693,10 +3459,7 @@ components:
description: The default visibility of the memo.
theme:
type: string
description: |-
The preferred theme of the user.
This references a CSS file in the web/public/themes/ directory.
If not set, the default theme will be used.
description: "The preferred theme of the user.\r\n This references a CSS file in the web/public/themes/ directory.\r\n If not set, the default theme will be used."
description: General user settings configuration.
UserSetting_SessionsSetting:
type: object
......@@ -3721,9 +3484,7 @@ components:
properties:
name:
type: string
description: |-
The resource name of the user whose stats these are.
Format: users/{user}
description: "The resource name of the user whose stats these are.\r\n Format: users/{user}"
memoDisplayTimestamps:
type: array
items:
......@@ -3771,9 +3532,7 @@ components:
properties:
name:
type: string
description: |-
The name of the webhook.
Format: users/{user}/webhooks/{webhook}
description: "The name of the webhook.\r\n Format: users/{user}/webhooks/{webhook}"
url:
type: string
description: The URL to send the webhook to.
......@@ -3796,9 +3555,7 @@ components:
properties:
owner:
type: string
description: |-
The name of instance owner.
Format: users/{user}
description: "The name of instance owner.\r\n Format: users/{user}"
version:
type: string
description: Version is the current version of instance.
......@@ -3814,9 +3571,7 @@ components:
properties:
name:
type: string
description: |-
The name of the workspace setting.
Format: workspace/settings/{setting}
description: "The name of the workspace setting.\r\n Format: workspace/settings/{setting}"
generalSetting:
$ref: '#/components/schemas/WorkspaceSetting_GeneralSetting'
storageSetting:
......@@ -3829,9 +3584,7 @@ components:
properties:
theme:
type: string
description: |-
theme is the name of the selected theme.
This references a CSS file in the web/public/themes/ directory.
description: "theme is the name of the selected theme.\r\n This references a CSS file in the web/public/themes/ directory."
disallowUserRegistration:
type: boolean
description: disallow_user_registration disallows user registration.
......@@ -3850,10 +3603,7 @@ components:
description: custom_profile is the custom profile.
weekStartDayOffset:
type: integer
description: |-
week_start_day_offset is the week start day offset from Sunday.
0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
Default is Sunday.
description: "week_start_day_offset is the week start day offset from Sunday.\r\n 0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday\r\n Default is Sunday."
format: int32
disallowChangeUsername:
type: boolean
......@@ -3912,9 +3662,7 @@ components:
format: enum
filepathTemplate:
type: string
description: |-
The template of file path.
e.g. assets/{timestamp}_{filename}
description: "The template of file path.\r\n e.g. assets/{timestamp}_{filename}"
uploadSizeLimitMb:
type: string
description: The max upload size in megabytes.
......
package v1
import (
"testing"
"github.com/usememos/memos/plugin/filter"
)
func TestUserFilterValidation(t *testing.T) {
testCases := []struct {
name string
filter string
expectErr bool
}{
{
name: "valid username filter with equals",
filter: `username == "testuser"`,
expectErr: false,
},
{
name: "valid username filter with contains",
filter: `username.contains("admin")`,
expectErr: false,
},
{
name: "invalid filter - unknown field",
filter: `invalid_field == "test"`,
expectErr: true,
},
{
name: "empty filter",
filter: "",
expectErr: true,
},
{
name: "invalid syntax",
filter: `username ==`,
expectErr: true,
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
// Test the filter parsing directly
_, err := filter.Parse(tc.filter, filter.UserFilterCELAttributes...)
if tc.expectErr && err == nil {
t.Errorf("Expected error for filter %q, but got none", tc.filter)
}
if !tc.expectErr && err != nil {
t.Errorf("Expected no error for filter %q, but got: %v", tc.filter, err)
}
})
}
}
func TestUserFilterCELAttributes(t *testing.T) {
// Test that our UserFilterCELAttributes contains the username variable
expectedAttributes := map[string]bool{
"username": true,
}
// This is a basic test to ensure the attributes are defined
// In a real test, you would create a CEL environment and verify the attributes
for attrName := range expectedAttributes {
t.Logf("Expected attribute %s should be available in UserFilterCELAttributes", attrName)
}
}
......@@ -25,12 +25,13 @@ import (
"github.com/usememos/memos/internal/base"
"github.com/usememos/memos/internal/util"
"github.com/usememos/memos/plugin/filter"
v1pb "github.com/usememos/memos/proto/gen/api/v1"
storepb "github.com/usememos/memos/proto/gen/store"
"github.com/usememos/memos/store"
)
func (s *APIV1Service) ListUsers(ctx context.Context, _ *v1pb.ListUsersRequest) (*v1pb.ListUsersResponse, error) {
func (s *APIV1Service) ListUsers(ctx context.Context, request *v1pb.ListUsersRequest) (*v1pb.ListUsersResponse, error) {
currentUser, err := s.GetCurrentUser(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
......@@ -39,12 +40,21 @@ func (s *APIV1Service) ListUsers(ctx context.Context, _ *v1pb.ListUsersRequest)
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
}
users, err := s.Store.ListUsers(ctx, &store.FindUser{})
userFind := &store.FindUser{}
if request.Filter != "" {
if err := s.validateUserFilter(ctx, request.Filter); err != nil {
return nil, status.Errorf(codes.InvalidArgument, "invalid filter: %v", err)
}
userFind.Filters = append(userFind.Filters, request.Filter)
}
users, err := s.Store.ListUsers(ctx, userFind)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to list users: %v", err)
}
// TODO: Implement proper filtering, ordering, and pagination
// TODO: Implement proper ordering, and pagination
// For now, return all users with basic structure
response := &v1pb.ListUsersResponse{
Users: []*v1pb.User{},
......@@ -70,47 +80,7 @@ func (s *APIV1Service) GetUser(ctx context.Context, request *v1pb.GetUserRequest
if user == nil {
return nil, status.Errorf(codes.NotFound, "user not found")
}
userPb := convertUserFromStore(user)
// TODO: Implement read_mask field filtering
// For now, return all fields
return userPb, nil
}
func (s *APIV1Service) SearchUsers(ctx context.Context, request *v1pb.SearchUsersRequest) (*v1pb.SearchUsersResponse, error) {
currentUser, err := s.GetCurrentUser(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
}
if currentUser.Role != store.RoleHost && currentUser.Role != store.RoleAdmin {
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
}
// Search users by username, email, or display name
users, err := s.Store.ListUsers(ctx, &store.FindUser{})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to list users: %v", err)
}
var filteredUsers []*store.User
query := strings.ToLower(request.Query)
for _, user := range users {
if strings.Contains(strings.ToLower(user.Username), query) ||
strings.Contains(strings.ToLower(user.Email), query) ||
strings.Contains(strings.ToLower(user.Nickname), query) {
filteredUsers = append(filteredUsers, user)
}
}
response := &v1pb.SearchUsersResponse{
Users: []*v1pb.User{},
TotalSize: int32(len(filteredUsers)),
}
for _, user := range filteredUsers {
response.Users = append(response.Users, convertUserFromStore(user))
}
return response, nil
return convertUserFromStore(user), nil
}
func (s *APIV1Service) GetUserAvatar(ctx context.Context, request *v1pb.GetUserAvatarRequest) (*httpbody.HttpBody, error) {
......@@ -1316,3 +1286,37 @@ func extractWebhookIDFromName(name string) string {
}
return ""
}
// validateUserFilter validates the user filter string.
func (s *APIV1Service) validateUserFilter(_ context.Context, filterStr string) error {
if filterStr == "" {
return errors.New("filter cannot be empty")
}
// Validate the filter.
parsedExpr, err := filter.Parse(filterStr, filter.UserFilterCELAttributes...)
if err != nil {
return errors.Wrap(err, "failed to parse filter")
}
convertCtx := filter.NewConvertContext()
// Determine the dialect based on the actual database driver
var dialect filter.SQLDialect
switch s.Profile.Driver {
case "sqlite":
dialect = &filter.SQLiteDialect{}
case "mysql":
dialect = &filter.MySQLDialect{}
case "postgres":
dialect = &filter.PostgreSQLDialect{}
default:
// Default to SQLite for unknown drivers
dialect = &filter.SQLiteDialect{}
}
converter := filter.NewCommonSQLConverter(dialect)
err = converter.ConvertExprToSQL(convertCtx, parsedExpr.GetExpr())
if err != nil {
return errors.Wrap(err, "failed to convert filter to SQL")
}
return nil
}
......@@ -7,6 +7,7 @@ import (
"github.com/pkg/errors"
"github.com/usememos/memos/plugin/filter"
"github.com/usememos/memos/store"
)
......@@ -84,6 +85,26 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U
func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User, error) {
where, args := []string{"1 = 1"}, []any{}
for _, filterStr := range find.Filters {
// Parse filter string and return the parsed expression.
// The filter string should be a CEL expression.
parsedExpr, err := filter.Parse(filterStr, filter.UserFilterCELAttributes...)
if err != nil {
return nil, err
}
convertCtx := filter.NewConvertContext()
// ConvertExprToSQL converts the parsed expression to a SQL condition string.
converter := filter.NewCommonSQLConverter(&filter.MySQLDialect{})
if err := converter.ConvertExprToSQL(convertCtx, parsedExpr.GetExpr()); err != nil {
return nil, err
}
condition := convertCtx.Buffer.String()
if condition != "" {
where = append(where, fmt.Sprintf("(%s)", condition))
args = append(args, convertCtx.Args...)
}
}
if v := find.ID; v != nil {
where, args = append(where, "`id` = ?"), append(args, *v)
}
......
......@@ -5,6 +5,7 @@ import (
"fmt"
"strings"
"github.com/usememos/memos/plugin/filter"
"github.com/usememos/memos/store"
)
......@@ -85,6 +86,26 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U
func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User, error) {
where, args := []string{"1 = 1"}, []any{}
for _, filterStr := range find.Filters {
// Parse filter string and return the parsed expression.
// The filter string should be a CEL expression.
parsedExpr, err := filter.Parse(filterStr, filter.UserFilterCELAttributes...)
if err != nil {
return nil, err
}
convertCtx := filter.NewConvertContext()
// ConvertExprToSQL converts the parsed expression to a SQL condition string.
converter := filter.NewCommonSQLConverter(&filter.PostgreSQLDialect{})
if err := converter.ConvertExprToSQL(convertCtx, parsedExpr.GetExpr()); err != nil {
return nil, err
}
condition := convertCtx.Buffer.String()
if condition != "" {
where = append(where, fmt.Sprintf("(%s)", condition))
args = append(args, convertCtx.Args...)
}
}
if v := find.ID; v != nil {
where, args = append(where, "id = "+placeholder(len(args)+1)), append(args, *v)
}
......
......@@ -5,6 +5,7 @@ import (
"fmt"
"strings"
"github.com/usememos/memos/plugin/filter"
"github.com/usememos/memos/store"
)
......@@ -86,6 +87,26 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U
func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User, error) {
where, args := []string{"1 = 1"}, []any{}
for _, filterStr := range find.Filters {
// Parse filter string and return the parsed expression.
// The filter string should be a CEL expression.
parsedExpr, err := filter.Parse(filterStr, filter.UserFilterCELAttributes...)
if err != nil {
return nil, err
}
convertCtx := filter.NewConvertContext()
// ConvertExprToSQL converts the parsed expression to a SQL condition string.
converter := filter.NewCommonSQLConverter(&filter.SQLiteDialect{})
if err := converter.ConvertExprToSQL(convertCtx, parsedExpr.GetExpr()); err != nil {
return nil, err
}
condition := convertCtx.Buffer.String()
if condition != "" {
where = append(where, fmt.Sprintf("(%s)", condition))
args = append(args, convertCtx.Args...)
}
}
if v := find.ID; v != nil {
where, args = append(where, "id = ?"), append(args, *v)
}
......
......@@ -83,6 +83,9 @@ type FindUser struct {
Email *string
Nickname *string
// Domain specific fields
Filters []string
// The maximum number of users to return.
Limit *int
}
......
......@@ -84,8 +84,8 @@ const userStore = (() => {
}
}
// Use search instead of the deprecated getUserByUsername
const { users } = await userServiceClient.searchUsers({
query: username,
const { users } = await userServiceClient.listUsers({
filter: `username == "${username}"`,
pageSize: 10,
});
const user = users.find((u) => u.username === username);
......
......@@ -114,11 +114,6 @@ export interface ListUsersRequest {
* Supported fields: username, email, role, state, create_time, update_time
*/
filter: string;
/**
* Optional. The order to sort results by.
* Example: "create_time desc" or "username asc"
*/
orderBy: string;
/** Optional. If true, show deleted users in the response. */
showDeleted: boolean;
}
......@@ -191,24 +186,6 @@ export interface DeleteUserRequest {
force: boolean;
}
export interface SearchUsersRequest {
/** Required. The search query. */
query: string;
/** Optional. The maximum number of users to return. */
pageSize: number;
/** Optional. A page token for pagination. */
pageToken: string;
}
export interface SearchUsersResponse {
/** The list of users matching the search query. */
users: User[];
/** A token for the next page of results. */
nextPageToken: string;
/** The total count of matching users. */
totalSize: number;
}
export interface GetUserAvatarRequest {
/**
* Required. The resource name of the user.
......@@ -780,7 +757,7 @@ export const User: MessageFns<User> = {
};
function createBaseListUsersRequest(): ListUsersRequest {
return { pageSize: 0, pageToken: "", filter: "", orderBy: "", showDeleted: false };
return { pageSize: 0, pageToken: "", filter: "", showDeleted: false };
}
export const ListUsersRequest: MessageFns<ListUsersRequest> = {
......@@ -794,11 +771,8 @@ export const ListUsersRequest: MessageFns<ListUsersRequest> = {
if (message.filter !== "") {
writer.uint32(26).string(message.filter);
}
if (message.orderBy !== "") {
writer.uint32(34).string(message.orderBy);
}
if (message.showDeleted !== false) {
writer.uint32(40).bool(message.showDeleted);
writer.uint32(32).bool(message.showDeleted);
}
return writer;
},
......@@ -835,15 +809,7 @@ export const ListUsersRequest: MessageFns<ListUsersRequest> = {
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.orderBy = reader.string();
continue;
}
case 5: {
if (tag !== 40) {
if (tag !== 32) {
break;
}
......@@ -867,7 +833,6 @@ export const ListUsersRequest: MessageFns<ListUsersRequest> = {
message.pageSize = object.pageSize ?? 0;
message.pageToken = object.pageToken ?? "";
message.filter = object.filter ?? "";
message.orderBy = object.orderBy ?? "";
message.showDeleted = object.showDeleted ?? false;
return message;
},
......@@ -1211,146 +1176,6 @@ export const DeleteUserRequest: MessageFns<DeleteUserRequest> = {
},
};
function createBaseSearchUsersRequest(): SearchUsersRequest {
return { query: "", pageSize: 0, pageToken: "" };
}
export const SearchUsersRequest: MessageFns<SearchUsersRequest> = {
encode(message: SearchUsersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.query !== "") {
writer.uint32(10).string(message.query);
}
if (message.pageSize !== 0) {
writer.uint32(16).int32(message.pageSize);
}
if (message.pageToken !== "") {
writer.uint32(26).string(message.pageToken);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): SearchUsersRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSearchUsersRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.query = reader.string();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.pageSize = reader.int32();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.pageToken = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<SearchUsersRequest>): SearchUsersRequest {
return SearchUsersRequest.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<SearchUsersRequest>): SearchUsersRequest {
const message = createBaseSearchUsersRequest();
message.query = object.query ?? "";
message.pageSize = object.pageSize ?? 0;
message.pageToken = object.pageToken ?? "";
return message;
},
};
function createBaseSearchUsersResponse(): SearchUsersResponse {
return { users: [], nextPageToken: "", totalSize: 0 };
}
export const SearchUsersResponse: MessageFns<SearchUsersResponse> = {
encode(message: SearchUsersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.users) {
User.encode(v!, writer.uint32(10).fork()).join();
}
if (message.nextPageToken !== "") {
writer.uint32(18).string(message.nextPageToken);
}
if (message.totalSize !== 0) {
writer.uint32(24).int32(message.totalSize);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): SearchUsersResponse {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSearchUsersResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.users.push(User.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.nextPageToken = reader.string();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.totalSize = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
create(base?: DeepPartial<SearchUsersResponse>): SearchUsersResponse {
return SearchUsersResponse.fromPartial(base ?? {});
},
fromPartial(object: DeepPartial<SearchUsersResponse>): SearchUsersResponse {
const message = createBaseSearchUsersResponse();
message.users = object.users?.map((e) => User.fromPartial(e)) || [];
message.nextPageToken = object.nextPageToken ?? "";
message.totalSize = object.totalSize ?? 0;
return message;
},
};
function createBaseGetUserAvatarRequest(): GetUserAvatarRequest {
return { name: "" };
}
......@@ -3586,46 +3411,6 @@ export const UserServiceDefinition = {
},
},
},
/** SearchUsers searches for users based on query. */
searchUsers: {
name: "SearchUsers",
requestType: SearchUsersRequest,
requestStream: false,
responseType: SearchUsersResponse,
responseStream: false,
options: {
_unknownFields: {
8410: [new Uint8Array([5, 113, 117, 101, 114, 121])],
578365826: [
new Uint8Array([
22,
18,
20,
47,
97,
112,
105,
47,
118,
49,
47,
117,
115,
101,
114,
115,
58,
115,
101,
97,
114,
99,
104,
]),
],
},
},
},
/** GetUserAvatar gets the avatar of a user. */
getUserAvatar: {
name: "GetUserAvatar",
......
......@@ -35,7 +35,7 @@ export enum Edition {
EDITION_2024 = "EDITION_2024",
/**
* EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be
* used or relied on outside of tests.
* used or relyed on outside of tests.
*/
EDITION_1_TEST_ONLY = "EDITION_1_TEST_ONLY",
EDITION_2_TEST_ONLY = "EDITION_2_TEST_ONLY",
......@@ -177,19 +177,11 @@ export interface FileDescriptorProto {
* The supported values are "proto2", "proto3", and "editions".
*
* If `edition` is present, this value must be "editions".
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
syntax?:
| string
| undefined;
/**
* The edition of the proto file.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
/** The edition of the proto file. */
edition?: Edition | undefined;
}
......@@ -836,12 +828,7 @@ export interface FileOptions {
rubyPackage?:
| string
| undefined;
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
/** Any features defined in the specific edition. */
features?:
| FeatureSet
| undefined;
......@@ -979,12 +966,7 @@ export interface MessageOptions {
deprecatedLegacyJsonFieldConflicts?:
| boolean
| undefined;
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
/** Any features defined in the specific edition. */
features?:
| FeatureSet
| undefined;
......@@ -994,13 +976,12 @@ export interface MessageOptions {
export interface FieldOptions {
/**
* NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
* The ctype option instructs the C++ code generator to use a different
* representation of the field than it normally would. See the specific
* options below. This option is only implemented to support use of
* [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
* type "bytes" in the open source release.
* TODO: make ctype actually deprecated.
* type "bytes" in the open source release -- sorry, we'll try to include
* other types in a future version!
*/
ctype?:
| FieldOptions_CType
......@@ -1089,12 +1070,7 @@ export interface FieldOptions {
retention?: FieldOptions_OptionRetention | undefined;
targets: FieldOptions_OptionTargetType[];
editionDefaults: FieldOptions_EditionDefault[];
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
/** Any features defined in the specific edition. */
features?: FeatureSet | undefined;
featureSupport?:
| FieldOptions_FeatureSupport
......@@ -1193,7 +1169,11 @@ export function fieldOptions_JSTypeToNumber(object: FieldOptions_JSType): number
}
}
/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */
/**
* If set to RETENTION_SOURCE, the option will be omitted from the binary.
* Note: as of January 2023, support for this is in progress and does not yet
* have an effect (b/264593489).
*/
export enum FieldOptions_OptionRetention {
RETENTION_UNKNOWN = "RETENTION_UNKNOWN",
RETENTION_RUNTIME = "RETENTION_RUNTIME",
......@@ -1236,7 +1216,8 @@ export function fieldOptions_OptionRetentionToNumber(object: FieldOptions_Option
/**
* This indicates the types of entities that the field may apply to when used
* as an option. If it is unset, then the field may be freely used as an
* option on any kind of entity.
* option on any kind of entity. Note: as of January 2023, support for this is
* in progress and does not yet have an effect (b/264593489).
*/
export enum FieldOptions_OptionTargetType {
TARGET_TYPE_UNKNOWN = "TARGET_TYPE_UNKNOWN",
......@@ -1360,12 +1341,7 @@ export interface FieldOptions_FeatureSupport {
}
export interface OneofOptions {
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
/** Any features defined in the specific edition. */
features?:
| FeatureSet
| undefined;
......@@ -1403,12 +1379,7 @@ export interface EnumOptions {
deprecatedLegacyJsonFieldConflicts?:
| boolean
| undefined;
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
/** Any features defined in the specific edition. */
features?:
| FeatureSet
| undefined;
......@@ -1426,12 +1397,7 @@ export interface EnumValueOptions {
deprecated?:
| boolean
| undefined;
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
/** Any features defined in the specific edition. */
features?:
| FeatureSet
| undefined;
......@@ -1452,12 +1418,7 @@ export interface EnumValueOptions {
}
export interface ServiceOptions {
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
/** Any features defined in the specific edition. */
features?:
| FeatureSet
| undefined;
......@@ -1485,12 +1446,7 @@ export interface MethodOptions {
idempotencyLevel?:
| MethodOptions_IdempotencyLevel
| undefined;
/**
* Any features defined in the specific edition.
* WARNING: This field should only be used by protobuf plugins or special
* cases like the proto compiler. Other uses are discouraged and
* developers should rely on the protoreflect APIs for their client language.
*/
/** Any features defined in the specific edition. */
features?:
| FeatureSet
| undefined;
......@@ -1593,7 +1549,6 @@ export interface FeatureSet {
utf8Validation?: FeatureSet_Utf8Validation | undefined;
messageEncoding?: FeatureSet_MessageEncoding | undefined;
jsonFormat?: FeatureSet_JsonFormat | undefined;
enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined;
}
export enum FeatureSet_FieldPresence {
......@@ -1836,45 +1791,6 @@ export function featureSet_JsonFormatToNumber(object: FeatureSet_JsonFormat): nu
}
}
export enum FeatureSet_EnforceNamingStyle {
ENFORCE_NAMING_STYLE_UNKNOWN = "ENFORCE_NAMING_STYLE_UNKNOWN",
STYLE2024 = "STYLE2024",
STYLE_LEGACY = "STYLE_LEGACY",
UNRECOGNIZED = "UNRECOGNIZED",
}
export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle {
switch (object) {
case 0:
case "ENFORCE_NAMING_STYLE_UNKNOWN":
return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
case 1:
case "STYLE2024":
return FeatureSet_EnforceNamingStyle.STYLE2024;
case 2:
case "STYLE_LEGACY":
return FeatureSet_EnforceNamingStyle.STYLE_LEGACY;
case -1:
case "UNRECOGNIZED":
default:
return FeatureSet_EnforceNamingStyle.UNRECOGNIZED;
}
}
export function featureSet_EnforceNamingStyleToNumber(object: FeatureSet_EnforceNamingStyle): number {
switch (object) {
case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:
return 0;
case FeatureSet_EnforceNamingStyle.STYLE2024:
return 1;
case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:
return 2;
case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:
default:
return -1;
}
}
/**
* A compiled specification for the defaults of a set of features. These
* messages are generated from FeatureSet extensions and can be used to seed
......@@ -4998,7 +4914,6 @@ function createBaseFeatureSet(): FeatureSet {
utf8Validation: FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN,
messageEncoding: FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN,
jsonFormat: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
enforceNamingStyle: FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
};
}
......@@ -5033,12 +4948,6 @@ export const FeatureSet: MessageFns<FeatureSet> = {
if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {
writer.uint32(48).int32(featureSet_JsonFormatToNumber(message.jsonFormat));
}
if (
message.enforceNamingStyle !== undefined &&
message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN
) {
writer.uint32(56).int32(featureSet_EnforceNamingStyleToNumber(message.enforceNamingStyle));
}
return writer;
},
......@@ -5097,14 +5006,6 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.jsonFormat = featureSet_JsonFormatFromJSON(reader.int32());
continue;
}
case 7: {
if (tag !== 56) {
break;
}
message.enforceNamingStyle = featureSet_EnforceNamingStyleFromJSON(reader.int32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
......@@ -5126,8 +5027,6 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.utf8Validation = object.utf8Validation ?? FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;
message.messageEncoding = object.messageEncoding ?? FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;
message.jsonFormat = object.jsonFormat ?? FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;
message.enforceNamingStyle = object.enforceNamingStyle ??
FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
return message;
},
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment