diff --git a/proto/api/v2/memo_service.proto b/proto/api/v2/memo_service.proto index 9c99503c6..829b5d9d7 100644 --- a/proto/api/v2/memo_service.proto +++ b/proto/api/v2/memo_service.proto @@ -26,28 +26,27 @@ service MemoService { rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) { option (google.api.http) = {get: "/api/v2/memos"}; } - // GetMemo gets a memo by id. - rpc GetMemo(GetMemoRequest) returns (GetMemoResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}"}; - option (google.api.method_signature) = "id"; + // SearchMemosRequest searches memos. + rpc SearchMemos(SearchMemosRequest) returns (SearchMemosResponse) { + option (google.api.http) = {get: "/api/v2/memos:search"}; } - // GetMemoByName gets a memo by name. - rpc GetMemoByName(GetMemoByNameRequest) returns (GetMemoByNameResponse) { - option (google.api.http) = {get: "/api/v2/memos/name/{name}"}; + // GetMemo gets a memo. + rpc GetMemo(GetMemoRequest) returns (GetMemoResponse) { + option (google.api.http) = {get: "/api/v2/{name=memos/*}"}; option (google.api.method_signature) = "name"; } // UpdateMemo updates a memo. rpc UpdateMemo(UpdateMemoRequest) returns (UpdateMemoResponse) { option (google.api.http) = { - patch: "/api/v2/memos/{memo.id}" + patch: "/api/v2/{memo.name=memos/*}" body: "memo" }; option (google.api.method_signature) = "memo,update_mask"; } - // DeleteMemo deletes a memo by id. + // DeleteMemo deletes a memo. rpc DeleteMemo(DeleteMemoRequest) returns (DeleteMemoResponse) { - option (google.api.http) = {delete: "/api/v2/memos/{id}"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {delete: "/api/v2/{name=memos/*}"}; + option (google.api.method_signature) = "name"; } // ExportMemos exports memos. rpc ExportMemos(ExportMemosRequest) returns (ExportMemosResponse) { @@ -56,38 +55,38 @@ service MemoService { // SetMemoResources sets resources for a memo. rpc SetMemoResources(SetMemoResourcesRequest) returns (SetMemoResourcesResponse) { option (google.api.http) = { - post: "/api/v2/memos/{id}/resources" + post: "/api/v2/{name=memos/*}/resources" body: "*" }; - option (google.api.method_signature) = "id"; + option (google.api.method_signature) = "name"; } // ListMemoResources lists resources for a memo. rpc ListMemoResources(ListMemoResourcesRequest) returns (ListMemoResourcesResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/resources"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/resources"}; + option (google.api.method_signature) = "name"; } // SetMemoRelations sets relations for a memo. rpc SetMemoRelations(SetMemoRelationsRequest) returns (SetMemoRelationsResponse) { option (google.api.http) = { - post: "/api/v2/memos/{id}/relations" + post: "/api/v2/{name=memos/*}/relations" body: "*" }; - option (google.api.method_signature) = "id"; + option (google.api.method_signature) = "name"; } // ListMemoRelations lists relations for a memo. rpc ListMemoRelations(ListMemoRelationsRequest) returns (ListMemoRelationsResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/relations"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/relations"}; + option (google.api.method_signature) = "name"; } // CreateMemoComment creates a comment for a memo. rpc CreateMemoComment(CreateMemoCommentRequest) returns (CreateMemoCommentResponse) { - option (google.api.http) = {post: "/api/v2/memos/{id}/comments"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {post: "/api/v2/{name=memos/*}/comments"}; + option (google.api.method_signature) = "name"; } // ListMemoComments lists comments for a memo. rpc ListMemoComments(ListMemoCommentsRequest) returns (ListMemoCommentsResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/comments"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/comments"}; + option (google.api.method_signature) = "name"; } // GetUserMemosStats gets stats of memos for a user. rpc GetUserMemosStats(GetUserMemosStatsRequest) returns (GetUserMemosStatsResponse) { @@ -96,18 +95,18 @@ service MemoService { } // ListMemoReactions lists reactions for a memo. rpc ListMemoReactions(ListMemoReactionsRequest) returns (ListMemoReactionsResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/reactions"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/reactions"}; + option (google.api.method_signature) = "name"; } // UpsertMemoReaction upserts a reaction for a memo. rpc UpsertMemoReaction(UpsertMemoReactionRequest) returns (UpsertMemoReactionResponse) { - option (google.api.http) = {post: "/api/v2/memos/{id}/reactions"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {post: "/api/v2/{name=memos/*}/reactions"}; + option (google.api.method_signature) = "name"; } // DeleteMemoReaction deletes a reaction for a memo. rpc DeleteMemoReaction(DeleteMemoReactionRequest) returns (DeleteMemoReactionResponse) { - option (google.api.http) = {delete: "/api/v2/memos/{id}/reactions/{reaction_id}"}; - option (google.api.method_signature) = "id,reaction_id"; + option (google.api.http) = {delete: "/api/v2/{name=memos/*}/reactions/{reaction_id}"}; + option (google.api.method_signature) = "name,reaction_id"; } } @@ -122,11 +121,11 @@ enum Visibility { } message Memo { - // id is the system generated unique identifier. - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; - // name is the user provided name. - string name = 2; + string resource_id = 2; RowStatus row_status = 3; @@ -186,19 +185,23 @@ message ListMemosResponse { string next_page_token = 2; } -message GetMemoRequest { - int32 id = 1; +message SearchMemosRequest { + // Filter is used to filter memos returned. + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + string filter = 1; } -message GetMemoResponse { - Memo memo = 1; +message SearchMemosResponse { + repeated Memo memos = 1; } -message GetMemoByNameRequest { +message GetMemoRequest { + // The name of the memo. + // Format: memos/{uid} string name = 1; } -message GetMemoByNameResponse { +message GetMemoResponse { Memo memo = 1; } @@ -213,7 +216,9 @@ message UpdateMemoResponse { } message DeleteMemoRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; } message DeleteMemoResponse {} @@ -228,7 +233,9 @@ message ExportMemosResponse { } message SetMemoResourcesRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; repeated Resource resources = 2; } @@ -236,7 +243,9 @@ message SetMemoResourcesRequest { message SetMemoResourcesResponse {} message ListMemoResourcesRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; } message ListMemoResourcesResponse { @@ -244,7 +253,9 @@ message ListMemoResourcesResponse { } message SetMemoRelationsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; repeated MemoRelation relations = 2; } @@ -252,7 +263,9 @@ message SetMemoRelationsRequest { message SetMemoRelationsResponse {} message ListMemoRelationsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; } message ListMemoRelationsResponse { @@ -260,10 +273,11 @@ message ListMemoRelationsResponse { } message CreateMemoCommentRequest { - // id is the memo id to create comment for. - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; - CreateMemoRequest create = 2; + CreateMemoRequest comment = 2; } message CreateMemoCommentResponse { @@ -271,7 +285,9 @@ message CreateMemoCommentResponse { } message ListMemoCommentsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; } message ListMemoCommentsResponse { @@ -280,7 +296,7 @@ message ListMemoCommentsResponse { message GetUserMemosStatsRequest { // name is the name of the user to get stats for. - // Format: users/{username} + // Format: users/{uid} string name = 1; // timezone location @@ -299,7 +315,9 @@ message GetUserMemosStatsResponse { } message ListMemoReactionsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; } message ListMemoReactionsResponse { @@ -307,7 +325,9 @@ message ListMemoReactionsResponse { } message UpsertMemoReactionRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; Reaction reaction = 2; } @@ -317,7 +337,9 @@ message UpsertMemoReactionResponse { } message DeleteMemoReactionRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{uid} + string name = 1; int32 reaction_id = 2; } diff --git a/proto/api/v2/user_service.proto b/proto/api/v2/user_service.proto index c1105a867..af55188ad 100644 --- a/proto/api/v2/user_service.proto +++ b/proto/api/v2/user_service.proto @@ -19,7 +19,7 @@ service UserService { // SearchUsers searches users by filter. rpc SearchUsers(SearchUsersRequest) returns (SearchUsersResponse) { - option (google.api.http) = {get: "/api/v2/users/search"}; + option (google.api.http) = {get: "/api/v2/users:search"}; } // GetUser gets a user by name. diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index 6994815e8..d04fb0d9f 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -122,8 +122,6 @@ - [DeleteMemoResponse](#memos-api-v2-DeleteMemoResponse) - [ExportMemosRequest](#memos-api-v2-ExportMemosRequest) - [ExportMemosResponse](#memos-api-v2-ExportMemosResponse) - - [GetMemoByNameRequest](#memos-api-v2-GetMemoByNameRequest) - - [GetMemoByNameResponse](#memos-api-v2-GetMemoByNameResponse) - [GetMemoRequest](#memos-api-v2-GetMemoRequest) - [GetMemoResponse](#memos-api-v2-GetMemoResponse) - [GetUserMemosStatsRequest](#memos-api-v2-GetUserMemosStatsRequest) @@ -140,6 +138,8 @@ - [ListMemosRequest](#memos-api-v2-ListMemosRequest) - [ListMemosResponse](#memos-api-v2-ListMemosResponse) - [Memo](#memos-api-v2-Memo) + - [SearchMemosRequest](#memos-api-v2-SearchMemosRequest) + - [SearchMemosResponse](#memos-api-v2-SearchMemosResponse) - [SetMemoRelationsRequest](#memos-api-v2-SetMemoRelationsRequest) - [SetMemoRelationsResponse](#memos-api-v2-SetMemoRelationsResponse) - [SetMemoResourcesRequest](#memos-api-v2-SetMemoResourcesRequest) @@ -1556,8 +1556,8 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | id is the memo id to create comment for. | -| create | [CreateMemoRequest](#memos-api-v2-CreateMemoRequest) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | +| comment | [CreateMemoRequest](#memos-api-v2-CreateMemoRequest) | | | @@ -1618,7 +1618,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | | reaction_id | [int32](#int32) | | | @@ -1644,7 +1644,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | @@ -1691,36 +1691,6 @@ Used internally for obfuscating the page token. - - -### GetMemoByNameRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| name | [string](#string) | | | - - - - - - - - -### GetMemoByNameResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| memo | [Memo](#memos-api-v2-Memo) | | | - - - - - - ### GetMemoRequest @@ -1729,7 +1699,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | @@ -1759,7 +1729,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | name is the name of the user to get stats for. Format: users/{username} | +| name | [string](#string) | | name is the name of the user to get stats for. Format: users/{uid} | | timezone | [string](#string) | | timezone location Format: uses tz identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | | filter | [string](#string) | | Same as ListMemosRequest.filter | @@ -1807,7 +1777,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | @@ -1837,7 +1807,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | @@ -1867,7 +1837,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | @@ -1897,7 +1867,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | @@ -1960,8 +1930,8 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | id is the system generated unique identifier. | -| name | [string](#string) | | name is the user provided name. | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | +| resource_id | [string](#string) | | | | row_status | [RowStatus](#memos-api-v2-RowStatus) | | | | creator | [string](#string) | | The name of the creator. Format: users/{uid} | | create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | @@ -1980,6 +1950,36 @@ Used internally for obfuscating the page token. + + +### SearchMemosRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| filter | [string](#string) | | Filter is used to filter memos returned. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | + + + + + + + + +### SearchMemosResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| memos | [Memo](#memos-api-v2-Memo) | repeated | | + + + + + + ### SetMemoRelationsRequest @@ -1988,7 +1988,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | | relations | [MemoRelation](#memos-api-v2-MemoRelation) | repeated | | @@ -2014,7 +2014,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | | resources | [Resource](#memos-api-v2-Resource) | repeated | | @@ -2071,7 +2071,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{uid} | | reaction | [Reaction](#memos-api-v2-Reaction) | | | @@ -2123,10 +2123,10 @@ Used internally for obfuscating the page token. | ----------- | ------------ | ------------- | ------------| | CreateMemo | [CreateMemoRequest](#memos-api-v2-CreateMemoRequest) | [CreateMemoResponse](#memos-api-v2-CreateMemoResponse) | CreateMemo creates a memo. | | ListMemos | [ListMemosRequest](#memos-api-v2-ListMemosRequest) | [ListMemosResponse](#memos-api-v2-ListMemosResponse) | ListMemos lists memos with pagination and filter. | -| GetMemo | [GetMemoRequest](#memos-api-v2-GetMemoRequest) | [GetMemoResponse](#memos-api-v2-GetMemoResponse) | GetMemo gets a memo by id. | -| GetMemoByName | [GetMemoByNameRequest](#memos-api-v2-GetMemoByNameRequest) | [GetMemoByNameResponse](#memos-api-v2-GetMemoByNameResponse) | GetMemoByName gets a memo by name. | +| SearchMemos | [SearchMemosRequest](#memos-api-v2-SearchMemosRequest) | [SearchMemosResponse](#memos-api-v2-SearchMemosResponse) | SearchMemosRequest searches memos. | +| GetMemo | [GetMemoRequest](#memos-api-v2-GetMemoRequest) | [GetMemoResponse](#memos-api-v2-GetMemoResponse) | GetMemo gets a memo. | | UpdateMemo | [UpdateMemoRequest](#memos-api-v2-UpdateMemoRequest) | [UpdateMemoResponse](#memos-api-v2-UpdateMemoResponse) | UpdateMemo updates a memo. | -| DeleteMemo | [DeleteMemoRequest](#memos-api-v2-DeleteMemoRequest) | [DeleteMemoResponse](#memos-api-v2-DeleteMemoResponse) | DeleteMemo deletes a memo by id. | +| DeleteMemo | [DeleteMemoRequest](#memos-api-v2-DeleteMemoRequest) | [DeleteMemoResponse](#memos-api-v2-DeleteMemoResponse) | DeleteMemo deletes a memo. | | ExportMemos | [ExportMemosRequest](#memos-api-v2-ExportMemosRequest) | [ExportMemosResponse](#memos-api-v2-ExportMemosResponse) | ExportMemos exports memos. | | SetMemoResources | [SetMemoResourcesRequest](#memos-api-v2-SetMemoResourcesRequest) | [SetMemoResourcesResponse](#memos-api-v2-SetMemoResourcesResponse) | SetMemoResources sets resources for a memo. | | ListMemoResources | [ListMemoResourcesRequest](#memos-api-v2-ListMemoResourcesRequest) | [ListMemoResourcesResponse](#memos-api-v2-ListMemoResourcesResponse) | ListMemoResources lists resources for a memo. | diff --git a/proto/gen/api/v2/memo_service.pb.go b/proto/gen/api/v2/memo_service.pb.go index 262bc8488..a49077499 100644 --- a/proto/gen/api/v2/memo_service.pb.go +++ b/proto/gen/api/v2/memo_service.pb.go @@ -80,11 +80,11 @@ type Memo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id is the system generated unique identifier. - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // name is the user provided name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - RowStatus RowStatus `protobuf:"varint,3,opt,name=row_status,json=rowStatus,proto3,enum=memos.api.v2.RowStatus" json:"row_status,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + ResourceId string `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + RowStatus RowStatus `protobuf:"varint,3,opt,name=row_status,json=rowStatus,proto3,enum=memos.api.v2.RowStatus" json:"row_status,omitempty"` // The name of the creator. // Format: users/{uid} Creator string `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"` @@ -132,16 +132,16 @@ func (*Memo) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{0} } -func (x *Memo) GetId() int32 { +func (x *Memo) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } -func (x *Memo) GetName() string { +func (x *Memo) GetResourceId() string { if x != nil { - return x.Name + return x.ResourceId } return "" } @@ -457,16 +457,18 @@ func (x *ListMemosResponse) GetNextPageToken() string { return "" } -type GetMemoRequest struct { +type SearchMemosRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Filter is used to filter memos returned. + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` } -func (x *GetMemoRequest) Reset() { - *x = GetMemoRequest{} +func (x *SearchMemosRequest) Reset() { + *x = SearchMemosRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -474,13 +476,13 @@ func (x *GetMemoRequest) Reset() { } } -func (x *GetMemoRequest) String() string { +func (x *SearchMemosRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoRequest) ProtoMessage() {} +func (*SearchMemosRequest) ProtoMessage() {} -func (x *GetMemoRequest) ProtoReflect() protoreflect.Message { +func (x *SearchMemosRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -492,28 +494,28 @@ func (x *GetMemoRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoRequest.ProtoReflect.Descriptor instead. -func (*GetMemoRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchMemosRequest.ProtoReflect.Descriptor instead. +func (*SearchMemosRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{5} } -func (x *GetMemoRequest) GetId() int32 { +func (x *SearchMemosRequest) GetFilter() string { if x != nil { - return x.Id + return x.Filter } - return 0 + return "" } -type GetMemoResponse struct { +type SearchMemosResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Memo *Memo `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` + Memos []*Memo `protobuf:"bytes,1,rep,name=memos,proto3" json:"memos,omitempty"` } -func (x *GetMemoResponse) Reset() { - *x = GetMemoResponse{} +func (x *SearchMemosResponse) Reset() { + *x = SearchMemosResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -521,13 +523,13 @@ func (x *GetMemoResponse) Reset() { } } -func (x *GetMemoResponse) String() string { +func (x *SearchMemosResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoResponse) ProtoMessage() {} +func (*SearchMemosResponse) ProtoMessage() {} -func (x *GetMemoResponse) ProtoReflect() protoreflect.Message { +func (x *SearchMemosResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -539,28 +541,30 @@ func (x *GetMemoResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoResponse.ProtoReflect.Descriptor instead. -func (*GetMemoResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchMemosResponse.ProtoReflect.Descriptor instead. +func (*SearchMemosResponse) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{6} } -func (x *GetMemoResponse) GetMemo() *Memo { +func (x *SearchMemosResponse) GetMemos() []*Memo { if x != nil { - return x.Memo + return x.Memos } return nil } -type GetMemoByNameRequest struct { +type GetMemoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The name of the memo. + // Format: memos/{uid} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (x *GetMemoByNameRequest) Reset() { - *x = GetMemoByNameRequest{} +func (x *GetMemoRequest) Reset() { + *x = GetMemoRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -568,13 +572,13 @@ func (x *GetMemoByNameRequest) Reset() { } } -func (x *GetMemoByNameRequest) String() string { +func (x *GetMemoRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoByNameRequest) ProtoMessage() {} +func (*GetMemoRequest) ProtoMessage() {} -func (x *GetMemoByNameRequest) ProtoReflect() protoreflect.Message { +func (x *GetMemoRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -586,19 +590,19 @@ func (x *GetMemoByNameRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoByNameRequest.ProtoReflect.Descriptor instead. -func (*GetMemoByNameRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMemoRequest.ProtoReflect.Descriptor instead. +func (*GetMemoRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{7} } -func (x *GetMemoByNameRequest) GetName() string { +func (x *GetMemoRequest) GetName() string { if x != nil { return x.Name } return "" } -type GetMemoByNameResponse struct { +type GetMemoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -606,8 +610,8 @@ type GetMemoByNameResponse struct { Memo *Memo `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` } -func (x *GetMemoByNameResponse) Reset() { - *x = GetMemoByNameResponse{} +func (x *GetMemoResponse) Reset() { + *x = GetMemoResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -615,13 +619,13 @@ func (x *GetMemoByNameResponse) Reset() { } } -func (x *GetMemoByNameResponse) String() string { +func (x *GetMemoResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoByNameResponse) ProtoMessage() {} +func (*GetMemoResponse) ProtoMessage() {} -func (x *GetMemoByNameResponse) ProtoReflect() protoreflect.Message { +func (x *GetMemoResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -633,12 +637,12 @@ func (x *GetMemoByNameResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoByNameResponse.ProtoReflect.Descriptor instead. -func (*GetMemoByNameResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMemoResponse.ProtoReflect.Descriptor instead. +func (*GetMemoResponse) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{8} } -func (x *GetMemoByNameResponse) GetMemo() *Memo { +func (x *GetMemoResponse) GetMemo() *Memo { if x != nil { return x.Memo } @@ -752,7 +756,9 @@ type DeleteMemoRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *DeleteMemoRequest) Reset() { @@ -787,11 +793,11 @@ func (*DeleteMemoRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{11} } -func (x *DeleteMemoRequest) GetId() int32 { +func (x *DeleteMemoRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type DeleteMemoResponse struct { @@ -932,7 +938,9 @@ type SetMemoResourcesRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Resources []*Resource `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"` } @@ -968,11 +976,11 @@ func (*SetMemoResourcesRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{15} } -func (x *SetMemoResourcesRequest) GetId() int32 { +func (x *SetMemoResourcesRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *SetMemoResourcesRequest) GetResources() []*Resource { @@ -1025,7 +1033,9 @@ type ListMemoResourcesRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoResourcesRequest) Reset() { @@ -1060,11 +1070,11 @@ func (*ListMemoResourcesRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{17} } -func (x *ListMemoResourcesRequest) GetId() int32 { +func (x *ListMemoResourcesRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoResourcesResponse struct { @@ -1119,7 +1129,9 @@ type SetMemoRelationsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Relations []*MemoRelation `protobuf:"bytes,2,rep,name=relations,proto3" json:"relations,omitempty"` } @@ -1155,11 +1167,11 @@ func (*SetMemoRelationsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{19} } -func (x *SetMemoRelationsRequest) GetId() int32 { +func (x *SetMemoRelationsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *SetMemoRelationsRequest) GetRelations() []*MemoRelation { @@ -1212,7 +1224,9 @@ type ListMemoRelationsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoRelationsRequest) Reset() { @@ -1247,11 +1261,11 @@ func (*ListMemoRelationsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{21} } -func (x *ListMemoRelationsRequest) GetId() int32 { +func (x *ListMemoRelationsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoRelationsResponse struct { @@ -1306,9 +1320,10 @@ type CreateMemoCommentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id is the memo id to create comment for. - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Create *CreateMemoRequest `protobuf:"bytes,2,opt,name=create,proto3" json:"create,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Comment *CreateMemoRequest `protobuf:"bytes,2,opt,name=comment,proto3" json:"comment,omitempty"` } func (x *CreateMemoCommentRequest) Reset() { @@ -1343,16 +1358,16 @@ func (*CreateMemoCommentRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{23} } -func (x *CreateMemoCommentRequest) GetId() int32 { +func (x *CreateMemoCommentRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } -func (x *CreateMemoCommentRequest) GetCreate() *CreateMemoRequest { +func (x *CreateMemoCommentRequest) GetComment() *CreateMemoRequest { if x != nil { - return x.Create + return x.Comment } return nil } @@ -1409,7 +1424,9 @@ type ListMemoCommentsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoCommentsRequest) Reset() { @@ -1444,11 +1461,11 @@ func (*ListMemoCommentsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{25} } -func (x *ListMemoCommentsRequest) GetId() int32 { +func (x *ListMemoCommentsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoCommentsResponse struct { @@ -1504,7 +1521,7 @@ type GetUserMemosStatsRequest struct { unknownFields protoimpl.UnknownFields // name is the name of the user to get stats for. - // Format: users/{username} + // Format: users/{uid} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // timezone location // Format: uses tz identifier @@ -1621,7 +1638,9 @@ type ListMemoReactionsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoReactionsRequest) Reset() { @@ -1656,11 +1675,11 @@ func (*ListMemoReactionsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{29} } -func (x *ListMemoReactionsRequest) GetId() int32 { +func (x *ListMemoReactionsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoReactionsResponse struct { @@ -1715,7 +1734,9 @@ type UpsertMemoReactionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Reaction *Reaction `protobuf:"bytes,2,opt,name=reaction,proto3" json:"reaction,omitempty"` } @@ -1751,11 +1772,11 @@ func (*UpsertMemoReactionRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{31} } -func (x *UpsertMemoReactionRequest) GetId() int32 { +func (x *UpsertMemoReactionRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *UpsertMemoReactionRequest) GetReaction() *Reaction { @@ -1817,8 +1838,10 @@ type DeleteMemoReactionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - ReactionId int32 `protobuf:"varint,2,opt,name=reaction_id,json=reactionId,proto3" json:"reaction_id,omitempty"` + // The name of the memo. + // Format: memos/{uid} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + ReactionId int32 `protobuf:"varint,2,opt,name=reaction_id,json=reactionId,proto3" json:"reaction_id,omitempty"` } func (x *DeleteMemoReactionRequest) Reset() { @@ -1853,11 +1876,11 @@ func (*DeleteMemoReactionRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{33} } -func (x *DeleteMemoReactionRequest) GetId() int32 { +func (x *DeleteMemoReactionRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *DeleteMemoReactionRequest) GetReactionId() int32 { @@ -1927,358 +1950,365 @@ var file_api_v2_memo_service_proto_rawDesc = []byte{ 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x05, 0x0a, 0x04, - 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x77, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, - 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, - 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, - 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x12, - 0x25, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0e, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, - 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x67, 0x0a, 0x11, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x05, 0x0a, 0x04, + 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x77, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, + 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, 0x6e, + 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, + 0x12, 0x25, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0e, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0c, 0x0a, 0x0a, + 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x67, 0x0a, 0x11, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73, + 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x69, 0x73, + 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x22, 0x66, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, + 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x65, 0x0a, 0x11, 0x4c, 0x69, 0x73, + 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, + 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0x2c, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x3f, + 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x22, + 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, - 0x22, 0x66, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, - 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x65, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, - 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, - 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, + 0x22, 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x3b, 0x0a, + 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x3c, 0x0a, 0x12, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x27, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, 0x12, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x13, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x63, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, + 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x17, 0x53, 0x65, + 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, - 0x20, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x2a, 0x0a, 0x14, - 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3f, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2e, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x55, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x69, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x22, 0x43, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x73, 0x6b, 0x22, 0x3c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, - 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, - 0x6f, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, 0x12, - 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x13, 0x45, 0x78, - 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x5f, 0x0a, 0x17, 0x53, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x18, - 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, - 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x63, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1a, 0x0a, 0x18, - 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, - 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x69, 0x64, 0x22, 0x55, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x38, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, 0x18, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x22, 0x43, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, - 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x29, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x44, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x22, 0x62, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, - 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, - 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x9f, 0x01, 0x0a, 0x19, 0x47, + 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x2d, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, + 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x44, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x22, 0x62, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, - 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2a, 0x0a, 0x18, - 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, - 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5f, 0x0a, 0x19, 0x55, - 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x1a, - 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4c, - 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, - 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0a, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x1c, 0x0a, 0x1a, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x50, 0x0a, 0x0a, 0x56, 0x69, - 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, - 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, - 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x52, 0x4f, 0x54, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, - 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x32, 0x87, 0x12, 0x0a, - 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x0a, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, + 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, + 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, + 0x9f, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, + 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x2e, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, + 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, 0x19, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x1a, 0x55, 0x70, 0x73, + 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x19, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x1c, 0x0a, + 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x50, 0x0a, 0x0a, 0x56, + 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, + 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, + 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x52, 0x4f, 0x54, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, + 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x32, 0xba, 0x12, + 0x0a, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, + 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x67, 0x0a, 0x07, - 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x14, 0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x42, 0x79, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x28, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, - 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6e, - 0x61, 0x6d, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x89, 0x01, 0x0a, 0x0a, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0xda, 0x41, - 0x10, 0x6d, 0x65, 0x6d, 0x6f, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, - 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x32, 0x17, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x6d, 0x65, - 0x6d, 0x6f, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x70, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x70, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x70, 0x0a, + 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x20, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, + 0x6d, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8d, + 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x3c, 0xda, 0x41, 0x10, 0x6d, 0x65, 0x6d, 0x6f, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x32, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6d, 0x65, 0x6d, 0x6f, + 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x76, + 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x25, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x70, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x16, 0x22, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x8f, 0x01, 0x0a, 0x10, 0x53, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, - 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, - 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, - 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x8f, 0x01, 0x0a, - 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, - 0x12, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x8f, - 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2c, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, - 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x8f, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, + 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x16, 0x22, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x95, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda, 0x41, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x12, 0x95, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x95, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda, 0x41, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x95, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x8e, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, - 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, - 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda, 0x41, 0x02, 0x69, 0x64, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2e, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x91, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x2e, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0xda, 0x41, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x73, 0x12, 0x95, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, + 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, - 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0xda, 0x41, 0x08, 0x75, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, - 0x12, 0x8f, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, - 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x22, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xac, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x43, 0xda, 0x41, 0x0e, 0x69, 0x64, 0x2c, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x2a, 0x2a, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, - 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4d, 0x65, 0x6d, - 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, - 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, - 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, - 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, - 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, + 0x2f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x12, 0x55, + 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x22, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xb2, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, + 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x49, 0xda, 0x41, 0x10, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x2a, 0x2e, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, + 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x72, 0x65, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, + 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, + 0x10, 0x4d, 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, + 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, + 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, + 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, + 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2302,10 +2332,10 @@ var file_api_v2_memo_service_proto_goTypes = []interface{}{ (*CreateMemoResponse)(nil), // 3: memos.api.v2.CreateMemoResponse (*ListMemosRequest)(nil), // 4: memos.api.v2.ListMemosRequest (*ListMemosResponse)(nil), // 5: memos.api.v2.ListMemosResponse - (*GetMemoRequest)(nil), // 6: memos.api.v2.GetMemoRequest - (*GetMemoResponse)(nil), // 7: memos.api.v2.GetMemoResponse - (*GetMemoByNameRequest)(nil), // 8: memos.api.v2.GetMemoByNameRequest - (*GetMemoByNameResponse)(nil), // 9: memos.api.v2.GetMemoByNameResponse + (*SearchMemosRequest)(nil), // 6: memos.api.v2.SearchMemosRequest + (*SearchMemosResponse)(nil), // 7: memos.api.v2.SearchMemosResponse + (*GetMemoRequest)(nil), // 8: memos.api.v2.GetMemoRequest + (*GetMemoResponse)(nil), // 9: memos.api.v2.GetMemoResponse (*UpdateMemoRequest)(nil), // 10: memos.api.v2.UpdateMemoRequest (*UpdateMemoResponse)(nil), // 11: memos.api.v2.UpdateMemoResponse (*DeleteMemoRequest)(nil), // 12: memos.api.v2.DeleteMemoRequest @@ -2352,8 +2382,8 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 0, // 8: memos.api.v2.CreateMemoRequest.visibility:type_name -> memos.api.v2.Visibility 1, // 9: memos.api.v2.CreateMemoResponse.memo:type_name -> memos.api.v2.Memo 1, // 10: memos.api.v2.ListMemosResponse.memos:type_name -> memos.api.v2.Memo - 1, // 11: memos.api.v2.GetMemoResponse.memo:type_name -> memos.api.v2.Memo - 1, // 12: memos.api.v2.GetMemoByNameResponse.memo:type_name -> memos.api.v2.Memo + 1, // 11: memos.api.v2.SearchMemosResponse.memos:type_name -> memos.api.v2.Memo + 1, // 12: memos.api.v2.GetMemoResponse.memo:type_name -> memos.api.v2.Memo 1, // 13: memos.api.v2.UpdateMemoRequest.memo:type_name -> memos.api.v2.Memo 42, // 14: memos.api.v2.UpdateMemoRequest.update_mask:type_name -> google.protobuf.FieldMask 1, // 15: memos.api.v2.UpdateMemoResponse.memo:type_name -> memos.api.v2.Memo @@ -2361,7 +2391,7 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 39, // 17: memos.api.v2.ListMemoResourcesResponse.resources:type_name -> memos.api.v2.Resource 40, // 18: memos.api.v2.SetMemoRelationsRequest.relations:type_name -> memos.api.v2.MemoRelation 40, // 19: memos.api.v2.ListMemoRelationsResponse.relations:type_name -> memos.api.v2.MemoRelation - 2, // 20: memos.api.v2.CreateMemoCommentRequest.create:type_name -> memos.api.v2.CreateMemoRequest + 2, // 20: memos.api.v2.CreateMemoCommentRequest.comment:type_name -> memos.api.v2.CreateMemoRequest 1, // 21: memos.api.v2.CreateMemoCommentResponse.memo:type_name -> memos.api.v2.Memo 1, // 22: memos.api.v2.ListMemoCommentsResponse.memos:type_name -> memos.api.v2.Memo 36, // 23: memos.api.v2.GetUserMemosStatsResponse.stats:type_name -> memos.api.v2.GetUserMemosStatsResponse.StatsEntry @@ -2370,8 +2400,8 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 41, // 26: memos.api.v2.UpsertMemoReactionResponse.reaction:type_name -> memos.api.v2.Reaction 2, // 27: memos.api.v2.MemoService.CreateMemo:input_type -> memos.api.v2.CreateMemoRequest 4, // 28: memos.api.v2.MemoService.ListMemos:input_type -> memos.api.v2.ListMemosRequest - 6, // 29: memos.api.v2.MemoService.GetMemo:input_type -> memos.api.v2.GetMemoRequest - 8, // 30: memos.api.v2.MemoService.GetMemoByName:input_type -> memos.api.v2.GetMemoByNameRequest + 6, // 29: memos.api.v2.MemoService.SearchMemos:input_type -> memos.api.v2.SearchMemosRequest + 8, // 30: memos.api.v2.MemoService.GetMemo:input_type -> memos.api.v2.GetMemoRequest 10, // 31: memos.api.v2.MemoService.UpdateMemo:input_type -> memos.api.v2.UpdateMemoRequest 12, // 32: memos.api.v2.MemoService.DeleteMemo:input_type -> memos.api.v2.DeleteMemoRequest 14, // 33: memos.api.v2.MemoService.ExportMemos:input_type -> memos.api.v2.ExportMemosRequest @@ -2387,8 +2417,8 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 34, // 43: memos.api.v2.MemoService.DeleteMemoReaction:input_type -> memos.api.v2.DeleteMemoReactionRequest 3, // 44: memos.api.v2.MemoService.CreateMemo:output_type -> memos.api.v2.CreateMemoResponse 5, // 45: memos.api.v2.MemoService.ListMemos:output_type -> memos.api.v2.ListMemosResponse - 7, // 46: memos.api.v2.MemoService.GetMemo:output_type -> memos.api.v2.GetMemoResponse - 9, // 47: memos.api.v2.MemoService.GetMemoByName:output_type -> memos.api.v2.GetMemoByNameResponse + 7, // 46: memos.api.v2.MemoService.SearchMemos:output_type -> memos.api.v2.SearchMemosResponse + 9, // 47: memos.api.v2.MemoService.GetMemo:output_type -> memos.api.v2.GetMemoResponse 11, // 48: memos.api.v2.MemoService.UpdateMemo:output_type -> memos.api.v2.UpdateMemoResponse 13, // 49: memos.api.v2.MemoService.DeleteMemo:output_type -> memos.api.v2.DeleteMemoResponse 15, // 50: memos.api.v2.MemoService.ExportMemos:output_type -> memos.api.v2.ExportMemosResponse @@ -2480,7 +2510,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoRequest); i { + switch v := v.(*SearchMemosRequest); i { case 0: return &v.state case 1: @@ -2492,7 +2522,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoResponse); i { + switch v := v.(*SearchMemosResponse); i { case 0: return &v.state case 1: @@ -2504,7 +2534,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoByNameRequest); i { + switch v := v.(*GetMemoRequest); i { case 0: return &v.state case 1: @@ -2516,7 +2546,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoByNameResponse); i { + switch v := v.(*GetMemoResponse); i { case 0: return &v.state case 1: diff --git a/proto/gen/api/v2/memo_service.pb.gw.go b/proto/gen/api/v2/memo_service.pb.gw.go index c6e498f72..17e20c95c 100644 --- a/proto/gen/api/v2/memo_service.pb.gw.go +++ b/proto/gen/api/v2/memo_service.pb.gw.go @@ -101,60 +101,44 @@ func local_request_MemoService_ListMemos_0(ctx context.Context, marshaler runtim } -func request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoRequest - var metadata runtime.ServerMetadata +var ( + filter_MemoService_SearchMemos_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) - var ( - val string - ok bool - err error - _ = err - ) +func request_MemoService_SearchMemos_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchMemosRequest + var metadata runtime.ServerMetadata - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_SearchMemos_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.SearchMemos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoRequest +func local_request_MemoService_SearchMemos_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchMemosRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_SearchMemos_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetMemo(ctx, &protoReq) + msg, err := server.SearchMemos(ctx, &protoReq) return msg, metadata, err } -func request_MemoService_GetMemoByName_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoByNameRequest +func request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMemoRequest var metadata runtime.ServerMetadata var ( @@ -174,13 +158,13 @@ func request_MemoService_GetMemoByName_0(ctx context.Context, marshaler runtime. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := client.GetMemoByName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_MemoService_GetMemoByName_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoByNameRequest +func local_request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMemoRequest var metadata runtime.ServerMetadata var ( @@ -200,13 +184,13 @@ func local_request_MemoService_GetMemoByName_0(ctx context.Context, marshaler ru return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := server.GetMemoByName(ctx, &protoReq) + msg, err := server.GetMemo(ctx, &protoReq) return msg, metadata, err } var ( - filter_MemoService_UpdateMemo_0 = &utilities.DoubleArray{Encoding: map[string]int{"memo": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_MemoService_UpdateMemo_0 = &utilities.DoubleArray{Encoding: map[string]int{"memo": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} ) func request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -235,14 +219,14 @@ func request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runtime.Mar _ = err ) - val, ok = pathParams["memo.id"] + val, ok = pathParams["memo.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "memo.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "memo.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.name", err) } if err := req.ParseForm(); err != nil { @@ -283,14 +267,14 @@ func local_request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["memo.id"] + val, ok = pathParams["memo.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "memo.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "memo.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.name", err) } if err := req.ParseForm(); err != nil { @@ -316,14 +300,14 @@ func request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runtime.Mar _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.DeleteMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -342,14 +326,14 @@ func local_request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.DeleteMemo(ctx, &protoReq) @@ -412,14 +396,14 @@ func request_MemoService_SetMemoResources_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.SetMemoResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -446,14 +430,14 @@ func local_request_MemoService_SetMemoResources_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.SetMemoResources(ctx, &protoReq) @@ -472,14 +456,14 @@ func request_MemoService_ListMemoResources_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -498,14 +482,14 @@ func local_request_MemoService_ListMemoResources_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoResources(ctx, &protoReq) @@ -532,14 +516,14 @@ func request_MemoService_SetMemoRelations_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.SetMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -566,14 +550,14 @@ func local_request_MemoService_SetMemoRelations_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.SetMemoRelations(ctx, &protoReq) @@ -592,14 +576,14 @@ func request_MemoService_ListMemoRelations_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -618,14 +602,14 @@ func local_request_MemoService_ListMemoRelations_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoRelations(ctx, &protoReq) @@ -634,7 +618,7 @@ func local_request_MemoService_ListMemoRelations_0(ctx context.Context, marshale } var ( - filter_MemoService_CreateMemoComment_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_MemoService_CreateMemoComment_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_MemoService_CreateMemoComment_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -648,14 +632,14 @@ func request_MemoService_CreateMemoComment_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -681,14 +665,14 @@ func local_request_MemoService_CreateMemoComment_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -714,14 +698,14 @@ func request_MemoService_ListMemoComments_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoComments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -740,14 +724,14 @@ func local_request_MemoService_ListMemoComments_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoComments(ctx, &protoReq) @@ -802,14 +786,14 @@ func request_MemoService_ListMemoReactions_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoReactions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -828,14 +812,14 @@ func local_request_MemoService_ListMemoReactions_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoReactions(ctx, &protoReq) @@ -844,7 +828,7 @@ func local_request_MemoService_ListMemoReactions_0(ctx context.Context, marshale } var ( - filter_MemoService_UpsertMemoReaction_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_MemoService_UpsertMemoReaction_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -858,14 +842,14 @@ func request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -891,14 +875,14 @@ func local_request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -924,14 +908,14 @@ func request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } val, ok = pathParams["reaction_id"] @@ -960,14 +944,14 @@ func local_request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } val, ok = pathParams["reaction_id"] @@ -1041,7 +1025,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_SearchMemos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1049,12 +1033,12 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SearchMemos", runtime.WithHTTPPathPattern("/api/v2/memos:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_MemoService_SearchMemos_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 { @@ -1062,11 +1046,11 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_SearchMemos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_MemoService_GetMemoByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1074,12 +1058,12 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemoByName", runtime.WithHTTPPathPattern("/api/v2/memos/name/{name}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_MemoService_GetMemoByName_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_MemoService_GetMemo_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 { @@ -1087,7 +1071,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_MemoService_GetMemoByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1099,7 +1083,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{memo.id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/{memo.name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1124,7 +1108,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1174,7 +1158,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1199,7 +1183,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1224,7 +1208,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1249,7 +1233,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1274,7 +1258,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1299,7 +1283,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1349,7 +1333,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1374,7 +1358,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1399,7 +1383,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions/{reaction_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions/{reaction_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1501,47 +1485,47 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_SearchMemos_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) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SearchMemos", runtime.WithHTTPPathPattern("/api/v2/memos:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_MemoService_SearchMemos_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_SearchMemos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_MemoService_GetMemoByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_GetMemo_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) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemoByName", runtime.WithHTTPPathPattern("/api/v2/memos/name/{name}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_MemoService_GetMemoByName_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MemoService_GetMemoByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1551,7 +1535,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{memo.id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/{memo.name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1573,7 +1557,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1617,7 +1601,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1639,7 +1623,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1661,7 +1645,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1683,7 +1667,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1705,7 +1689,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1727,7 +1711,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1771,7 +1755,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1793,7 +1777,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1815,7 +1799,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions/{reaction_id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions/{reaction_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1839,35 +1823,35 @@ var ( pattern_MemoService_ListMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, "")) - pattern_MemoService_GetMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "id"}, "")) + pattern_MemoService_SearchMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, "search")) - pattern_MemoService_GetMemoByName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "name"}, "")) + pattern_MemoService_GetMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "memos", "name"}, "")) - pattern_MemoService_UpdateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "memo.id"}, "")) + pattern_MemoService_UpdateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "memos", "memo.name"}, "")) - pattern_MemoService_DeleteMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "id"}, "")) + pattern_MemoService_DeleteMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "memos", "name"}, "")) pattern_MemoService_ExportMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, "export")) - pattern_MemoService_SetMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "resources"}, "")) + pattern_MemoService_SetMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "resources"}, "")) - pattern_MemoService_ListMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "resources"}, "")) + pattern_MemoService_ListMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "resources"}, "")) - pattern_MemoService_SetMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "relations"}, "")) + pattern_MemoService_SetMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "relations"}, "")) - pattern_MemoService_ListMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "relations"}, "")) + pattern_MemoService_ListMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "relations"}, "")) - pattern_MemoService_CreateMemoComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "comments"}, "")) + pattern_MemoService_CreateMemoComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "comments"}, "")) - pattern_MemoService_ListMemoComments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "comments"}, "")) + pattern_MemoService_ListMemoComments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "comments"}, "")) pattern_MemoService_GetUserMemosStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "memos", "stats"}, "")) - pattern_MemoService_ListMemoReactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "reactions"}, "")) + pattern_MemoService_ListMemoReactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "reactions"}, "")) - pattern_MemoService_UpsertMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "reactions"}, "")) + pattern_MemoService_UpsertMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "reactions"}, "")) - pattern_MemoService_DeleteMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v2", "memos", "id", "reactions", "reaction_id"}, "")) + pattern_MemoService_DeleteMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v2", "memos", "name", "reactions", "reaction_id"}, "")) ) var ( @@ -1875,9 +1859,9 @@ var ( forward_MemoService_ListMemos_0 = runtime.ForwardResponseMessage - forward_MemoService_GetMemo_0 = runtime.ForwardResponseMessage + forward_MemoService_SearchMemos_0 = runtime.ForwardResponseMessage - forward_MemoService_GetMemoByName_0 = runtime.ForwardResponseMessage + forward_MemoService_GetMemo_0 = runtime.ForwardResponseMessage forward_MemoService_UpdateMemo_0 = runtime.ForwardResponseMessage diff --git a/proto/gen/api/v2/memo_service_grpc.pb.go b/proto/gen/api/v2/memo_service_grpc.pb.go index 1ea896a1a..41d0c443b 100644 --- a/proto/gen/api/v2/memo_service_grpc.pb.go +++ b/proto/gen/api/v2/memo_service_grpc.pb.go @@ -21,8 +21,8 @@ const _ = grpc.SupportPackageIsVersion7 const ( MemoService_CreateMemo_FullMethodName = "/memos.api.v2.MemoService/CreateMemo" MemoService_ListMemos_FullMethodName = "/memos.api.v2.MemoService/ListMemos" + MemoService_SearchMemos_FullMethodName = "/memos.api.v2.MemoService/SearchMemos" MemoService_GetMemo_FullMethodName = "/memos.api.v2.MemoService/GetMemo" - MemoService_GetMemoByName_FullMethodName = "/memos.api.v2.MemoService/GetMemoByName" MemoService_UpdateMemo_FullMethodName = "/memos.api.v2.MemoService/UpdateMemo" MemoService_DeleteMemo_FullMethodName = "/memos.api.v2.MemoService/DeleteMemo" MemoService_ExportMemos_FullMethodName = "/memos.api.v2.MemoService/ExportMemos" @@ -46,13 +46,13 @@ type MemoServiceClient interface { CreateMemo(ctx context.Context, in *CreateMemoRequest, opts ...grpc.CallOption) (*CreateMemoResponse, error) // ListMemos lists memos with pagination and filter. ListMemos(ctx context.Context, in *ListMemosRequest, opts ...grpc.CallOption) (*ListMemosResponse, error) - // GetMemo gets a memo by id. + // SearchMemosRequest searches memos. + SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error) + // GetMemo gets a memo. GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) - // GetMemoByName gets a memo by name. - GetMemoByName(ctx context.Context, in *GetMemoByNameRequest, opts ...grpc.CallOption) (*GetMemoByNameResponse, error) // UpdateMemo updates a memo. UpdateMemo(ctx context.Context, in *UpdateMemoRequest, opts ...grpc.CallOption) (*UpdateMemoResponse, error) - // DeleteMemo deletes a memo by id. + // DeleteMemo deletes a memo. DeleteMemo(ctx context.Context, in *DeleteMemoRequest, opts ...grpc.CallOption) (*DeleteMemoResponse, error) // ExportMemos exports memos. ExportMemos(ctx context.Context, in *ExportMemosRequest, opts ...grpc.CallOption) (*ExportMemosResponse, error) @@ -104,18 +104,18 @@ func (c *memoServiceClient) ListMemos(ctx context.Context, in *ListMemosRequest, return out, nil } -func (c *memoServiceClient) GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) { - out := new(GetMemoResponse) - err := c.cc.Invoke(ctx, MemoService_GetMemo_FullMethodName, in, out, opts...) +func (c *memoServiceClient) SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error) { + out := new(SearchMemosResponse) + err := c.cc.Invoke(ctx, MemoService_SearchMemos_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *memoServiceClient) GetMemoByName(ctx context.Context, in *GetMemoByNameRequest, opts ...grpc.CallOption) (*GetMemoByNameResponse, error) { - out := new(GetMemoByNameResponse) - err := c.cc.Invoke(ctx, MemoService_GetMemoByName_FullMethodName, in, out, opts...) +func (c *memoServiceClient) GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) { + out := new(GetMemoResponse) + err := c.cc.Invoke(ctx, MemoService_GetMemo_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -247,13 +247,13 @@ type MemoServiceServer interface { CreateMemo(context.Context, *CreateMemoRequest) (*CreateMemoResponse, error) // ListMemos lists memos with pagination and filter. ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error) - // GetMemo gets a memo by id. + // SearchMemosRequest searches memos. + SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error) + // GetMemo gets a memo. GetMemo(context.Context, *GetMemoRequest) (*GetMemoResponse, error) - // GetMemoByName gets a memo by name. - GetMemoByName(context.Context, *GetMemoByNameRequest) (*GetMemoByNameResponse, error) // UpdateMemo updates a memo. UpdateMemo(context.Context, *UpdateMemoRequest) (*UpdateMemoResponse, error) - // DeleteMemo deletes a memo by id. + // DeleteMemo deletes a memo. DeleteMemo(context.Context, *DeleteMemoRequest) (*DeleteMemoResponse, error) // ExportMemos exports memos. ExportMemos(context.Context, *ExportMemosRequest) (*ExportMemosResponse, error) @@ -290,12 +290,12 @@ func (UnimplementedMemoServiceServer) CreateMemo(context.Context, *CreateMemoReq func (UnimplementedMemoServiceServer) ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListMemos not implemented") } +func (UnimplementedMemoServiceServer) SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchMemos not implemented") +} func (UnimplementedMemoServiceServer) GetMemo(context.Context, *GetMemoRequest) (*GetMemoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMemo not implemented") } -func (UnimplementedMemoServiceServer) GetMemoByName(context.Context, *GetMemoByNameRequest) (*GetMemoByNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMemoByName not implemented") -} func (UnimplementedMemoServiceServer) UpdateMemo(context.Context, *UpdateMemoRequest) (*UpdateMemoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateMemo not implemented") } @@ -384,38 +384,38 @@ func _MemoService_ListMemos_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _MemoService_GetMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMemoRequest) +func _MemoService_SearchMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchMemosRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MemoServiceServer).GetMemo(ctx, in) + return srv.(MemoServiceServer).SearchMemos(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: MemoService_GetMemo_FullMethodName, + FullMethod: MemoService_SearchMemos_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MemoServiceServer).GetMemo(ctx, req.(*GetMemoRequest)) + return srv.(MemoServiceServer).SearchMemos(ctx, req.(*SearchMemosRequest)) } return interceptor(ctx, in, info, handler) } -func _MemoService_GetMemoByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMemoByNameRequest) +func _MemoService_GetMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMemoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MemoServiceServer).GetMemoByName(ctx, in) + return srv.(MemoServiceServer).GetMemo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: MemoService_GetMemoByName_FullMethodName, + FullMethod: MemoService_GetMemo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MemoServiceServer).GetMemoByName(ctx, req.(*GetMemoByNameRequest)) + return srv.(MemoServiceServer).GetMemo(ctx, req.(*GetMemoRequest)) } return interceptor(ctx, in, info, handler) } @@ -670,12 +670,12 @@ var MemoService_ServiceDesc = grpc.ServiceDesc{ Handler: _MemoService_ListMemos_Handler, }, { - MethodName: "GetMemo", - Handler: _MemoService_GetMemo_Handler, + MethodName: "SearchMemos", + Handler: _MemoService_SearchMemos_Handler, }, { - MethodName: "GetMemoByName", - Handler: _MemoService_GetMemoByName_Handler, + MethodName: "GetMemo", + Handler: _MemoService_GetMemo_Handler, }, { MethodName: "UpdateMemo", diff --git a/proto/gen/api/v2/user_service.pb.go b/proto/gen/api/v2/user_service.pb.go index 40772df46..444049a89 100644 --- a/proto/gen/api/v2/user_service.pb.go +++ b/proto/gen/api/v2/user_service.pb.go @@ -1612,7 +1612,7 @@ var file_api_v2_user_service_proto_rawDesc = []byte{ 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x6d, 0x0a, 0x07, 0x47, 0x65, 0x74, + 0x72, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x6d, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, diff --git a/proto/gen/api/v2/user_service.pb.gw.go b/proto/gen/api/v2/user_service.pb.gw.go index 491254d72..0c1a5bfc1 100644 --- a/proto/gen/api/v2/user_service.pb.gw.go +++ b/proto/gen/api/v2/user_service.pb.gw.go @@ -706,7 +706,7 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v2/users/search")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v2/users:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1017,7 +1017,7 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v2/users/search")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v2/users:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1237,7 +1237,7 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux var ( pattern_UserService_ListUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, "")) - pattern_UserService_SearchUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "users", "search"}, "")) + pattern_UserService_SearchUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, "search")) pattern_UserService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "users", "name"}, "")) diff --git a/server/route/api/v2/apidocs.swagger.md b/server/route/api/v2/apidocs.swagger.md index ee03dcf99..780834987 100644 --- a/server/route/api/v2/apidocs.swagger.md +++ b/server/route/api/v2/apidocs.swagger.md @@ -161,6 +161,25 @@ DeleteInbox deletes an inbox. | 200 | A successful response. | [v2DeleteInboxResponse](#v2deleteinboxresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | +--- +## LinkService + +### /api/v2/link_metadata + +#### GET +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| link | query | | No | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2GetLinkMetadataResponse](#v2getlinkmetadataresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + --- ## MemoService @@ -177,7 +196,7 @@ ListMemos lists memos with pagination and filter. | ---- | ---------- | ----------- | -------- | ------ | | pageSize | query | The maximum number of memos to return. | No | integer | | pageToken | query | A page token, received from a previous `ListMemos` call. Provide this to retrieve the subsequent page. | No | string | -| filter | query | Filter is used to filter memos returned in the list. Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" | No | string | +| filter | query | Filter is used to filter memos returned in the list. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | No | string | ##### Responses @@ -355,7 +374,7 @@ UpsertMemoReaction upserts a reaction for a memo. | ---- | ---------- | ----------- | -------- | ------ | | id | path | | Yes | integer | | reaction.id | query | | No | integer | -| reaction.creator | query | | No | string | +| reaction.creator | query | The name of the creator. Format: users/{uid} | No | string | | reaction.contentId | query | | No | string | | reaction.reactionType | query | | No | string | @@ -477,7 +496,7 @@ UpdateMemo updates a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | memo.id | path | id is the system generated unique identifier. | Yes | integer | -| memo | body | | Yes | { **"name"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"creator"**: string, **"creatorId"**: integer, **"createTime"**: dateTime, **"updateTime"**: dateTime, **"displayTime"**: dateTime, **"content"**: string, **"visibility"**: [v2Visibility](#v2visibility), **"pinned"**: boolean, **"parentId"**: integer, **"resources"**: [ [v2Resource](#v2resource) ], **"relations"**: [ [v2MemoRelation](#v2memorelation) ], **"reactions"**: [ [apiv2Reaction](#apiv2reaction) ] } | +| memo | body | | Yes | { **"name"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"creator"**: string, **"createTime"**: dateTime, **"updateTime"**: dateTime, **"displayTime"**: dateTime, **"content"**: string, **"visibility"**: [v2Visibility](#v2visibility), **"pinned"**: boolean, **"parentId"**: integer, **"resources"**: [ [v2Resource](#v2resource) ], **"relations"**: [ [v2MemoRelation](#v2memorelation) ], **"reactions"**: [ [apiv2Reaction](#apiv2reaction) ] } | ##### Responses @@ -506,6 +525,26 @@ ExportMemos exports memos. | 200 | A successful response. | [v2ExportMemosResponse](#v2exportmemosresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | +### /api/v2/memos:search + +#### GET +##### Summary + +SearchMemosRequest searches memos. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| filter | query | Filter is used to filter memos returned. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | No | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2SearchMemosResponse](#v2searchmemosresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + --- ## ResourceService @@ -637,7 +676,7 @@ ListTags lists tags. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user | query | The creator of tags. Format: users/{username} | No | string | +| user | query | The creator of tags. Format: users/{uid} | No | string | ##### Responses @@ -656,7 +695,7 @@ DeleteTag deletes a tag. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | tag.name | query | | No | string | -| tag.creator | query | The creator of tags. Format: users/{username} | No | string | +| tag.creator | query | The creator of tags. Format: users/{uid} | No | string | ##### Responses @@ -694,7 +733,7 @@ GetTagSuggestions gets tag suggestions from the user's memos. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user | query | The creator of tags. Format: users/{username} | No | string | +| user | query | The creator of tags. Format: users/{uid} | No | string | ##### Responses @@ -729,7 +768,7 @@ All related memos will be updated. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user | query | The creator of tags. Format: users/{username} | No | string | +| user | query | The creator of tags. Format: users/{uid} | No | string | | oldName | query | | No | string | | newName | query | | No | string | @@ -775,6 +814,26 @@ CreateUser creates a new user. | 200 | A successful response. | [v2CreateUserResponse](#v2createuserresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | +### /api/v2/users:search + +#### GET +##### Summary + +SearchUsers searches users by filter. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| filter | query | | No | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2SearchUsersResponse](#v2searchusersresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + ### /api/v2/{name} #### GET @@ -786,7 +845,7 @@ GetUser gets a user by name. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{uid} | Yes | string | ##### Responses @@ -804,7 +863,7 @@ DeleteUser deletes a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{uid} | Yes | string | ##### Responses @@ -824,7 +883,7 @@ ListUserAccessTokens returns a list of access tokens for a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{uid} | Yes | string | ##### Responses @@ -842,7 +901,7 @@ CreateUserAccessToken creates a new access token for a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{uid} | Yes | string | | body | body | | Yes | [UserServiceCreateUserAccessTokenBody](#userservicecreateuseraccesstokenbody) | ##### Responses @@ -863,7 +922,7 @@ DeleteUserAccessToken deletes an access token for a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{uid} | Yes | string | | accessToken | path | access_token is the access token to delete. | Yes | string | ##### Responses @@ -884,7 +943,7 @@ GetUserSetting gets the setting of a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{uid} | Yes | string | ##### Responses @@ -904,8 +963,8 @@ UpdateUserSetting updates the setting of a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| setting.name | path | The name of the user. Format: users/{username} | Yes | string | -| setting | body | | Yes | { **"locale"**: string, **"appearance"**: string, **"memoVisibility"**: string, **"telegramUserId"**: string, **"compactView"**: boolean } | +| setting.name | path | The name of the user. Format: users/{uid} | Yes | string | +| setting | body | | Yes | { **"locale"**: string, **"appearance"**: string, **"memoVisibility"**: string, **"telegramUserId"**: string } | ##### Responses @@ -925,8 +984,8 @@ UpdateUser updates a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user.name | path | The name of the user. Format: users/{username} | Yes | string | -| user | body | | Yes | { **"id"**: integer, **"role"**: [UserRole](#userrole), **"username"**: string, **"email"**: string, **"nickname"**: string, **"avatarUrl"**: string, **"password"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"createTime"**: dateTime, **"updateTime"**: dateTime } | +| user.name | path | The name of the user. Format: users/{uid} | Yes | string | +| user | body | | Yes | { **"id"**: integer, **"role"**: [UserRole](#userrole), **"username"**: string, **"email"**: string, **"nickname"**: string, **"avatarUrl"**: string, **"description"**: string, **"password"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"createTime"**: dateTime, **"updateTime"**: dateTime } | ##### Responses @@ -1197,7 +1256,6 @@ GetActivity returns the activity with the given id. | appearance | string | The preferred appearance of the user. | No | | memoVisibility | string | The default visibility of the memo. | No | | telegramUserId | string | The telegram user id of the user. | No | -| compactView | boolean | The compact view for a memo. | No | #### apiv2Webhook @@ -1375,6 +1433,12 @@ GetActivity returns the activity with the given id. | ---- | ---- | ----------- | -------- | | user | [v2User](#v2user) | | No | +#### v2GetLinkMetadataResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| linkMetadata | [v2LinkMetadata](#v2linkmetadata) | | No | + #### v2GetMemoByNameResponse | Name | Type | Description | Required | @@ -1465,6 +1529,14 @@ GetActivity returns the activity with the given id. | ---- | ---- | ----------- | -------- | | v2InboxType | string | | | +#### v2LinkMetadata + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| title | string | | No | +| description | string | | No | +| image | string | | No | + #### v2ListInboxesResponse | Name | Type | Description | Required | @@ -1540,7 +1612,6 @@ GetActivity returns the activity with the given id. | name | string | name is the user provided name. | No | | rowStatus | [apiv2RowStatus](#apiv2rowstatus) | | No | | creator | string | | No | -| creatorId | integer | | No | | createTime | dateTime | | No | | updateTime | dateTime | | No | | displayTime | dateTime | | No | @@ -1585,6 +1656,18 @@ GetActivity returns the activity with the given id. | size | string (int64) | | No | | memoId | integer | | No | +#### v2SearchMemosResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| memos | [ [v2Memo](#v2memo) ] | | No | + +#### v2SearchUsersResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| users | [ [v2User](#v2user) ] | | No | + #### v2SetMemoRelationsResponse | Name | Type | Description | Required | @@ -1693,12 +1776,13 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | name | string | | No | -| id | integer | | No | +| id | integer | The system generated uid of the user. | No | | role | [UserRole](#userrole) | | No | | username | string | | No | | email | string | | No | | nickname | string | | No | | avatarUrl | string | | No | +| description | string | | No | | password | string | | No | | rowStatus | [apiv2RowStatus](#apiv2rowstatus) | | No | | createTime | dateTime | | No | diff --git a/server/route/api/v2/apidocs.swagger.yaml b/server/route/api/v2/apidocs.swagger.yaml index da370efa8..53df0b1b2 100644 --- a/server/route/api/v2/apidocs.swagger.yaml +++ b/server/route/api/v2/apidocs.swagger.yaml @@ -226,26 +226,6 @@ paths: $ref: '#/definitions/v2CreateMemoRequest' tags: - MemoService - /api/v2/memos/name/{name}: - get: - summary: GetMemoByName gets a memo by name. - operationId: MemoService_GetMemoByName - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2GetMemoByNameResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: name - in: path - required: true - type: string - tags: - - MemoService /api/v2/memos/stats: get: summary: GetUserMemosStats gets stats of memos for a user. @@ -263,7 +243,7 @@ paths: - name: name description: |- name is the name of the user to get stats for. - Format: users/{username} + Format: users/{uid} in: query required: false type: string @@ -282,188 +262,126 @@ paths: type: string tags: - MemoService - /api/v2/memos/{id}: - get: - summary: GetMemo gets a memo by id. - operationId: MemoService_GetMemo + /api/v2/memos:export: + post: + summary: ExportMemos exports memos. + operationId: MemoService_ExportMemos responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetMemoResponse' + $ref: '#/definitions/v2ExportMemosResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: filter + description: Same as ListMemosRequest.filter + in: query + required: false + type: string tags: - MemoService - delete: - summary: DeleteMemo deletes a memo by id. - operationId: MemoService_DeleteMemo + /api/v2/memos:search: + get: + summary: SearchMemosRequest searches memos. + operationId: MemoService_SearchMemos responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteMemoResponse' + $ref: '#/definitions/v2SearchMemosResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: filter + description: |- + Filter is used to filter memos returned. + Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + in: query + required: false + type: string tags: - MemoService - /api/v2/memos/{id}/comments: + /api/v2/resources: get: - summary: ListMemoComments lists comments for a memo. - operationId: MemoService_ListMemoComments + summary: ListResources lists all resources. + operationId: ResourceService_ListResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoCommentsResponse' + $ref: '#/definitions/v2ListResourcesResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' - parameters: - - name: id - in: path - required: true - type: integer - format: int32 tags: - - MemoService + - ResourceService post: - summary: CreateMemoComment creates a comment for a memo. - operationId: MemoService_CreateMemoComment + summary: CreateResource creates a new resource. + operationId: ResourceService_CreateResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateMemoCommentResponse' + $ref: '#/definitions/v2CreateResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - description: id is the memo id to create comment for. - in: path - required: true - type: integer - format: int32 - - name: create.content + - name: filename in: query required: false type: string - - name: create.visibility + - name: externalLink in: query required: false type: string - enum: - - VISIBILITY_UNSPECIFIED - - PRIVATE - - PROTECTED - - PUBLIC - default: VISIBILITY_UNSPECIFIED - tags: - - MemoService - /api/v2/memos/{id}/reactions: - get: - summary: ListMemoReactions lists reactions for a memo. - operationId: MemoService_ListMemoReactions - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2ListMemoReactionsResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: id - in: path - required: true + - name: type + in: query + required: false + type: string + - name: memoId + in: query + required: false type: integer format: int32 tags: - - MemoService - post: - summary: UpsertMemoReaction upserts a reaction for a memo. - operationId: MemoService_UpsertMemoReaction + - ResourceService + /api/v2/resources/name/{name}: + get: + summary: GetResourceByName returns a resource by name. + operationId: ResourceService_GetResourceByName responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpsertMemoReactionResponse' + $ref: '#/definitions/v2GetResourceByNameResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: name in: path required: true - type: integer - format: int32 - - name: reaction.id - in: query - required: false - type: integer - format: int32 - - name: reaction.creator - description: |- - The name of the creator. - Format: users/{uid} - in: query - required: false - type: string - - name: reaction.contentId - in: query - required: false - type: string - - name: reaction.reactionType - in: query - required: false type: string - enum: - - TYPE_UNSPECIFIED - - THUMBS_UP - - THUMBS_DOWN - - HEART - - FIRE - - CLAPPING_HANDS - - LAUGH - - OK_HAND - - ROCKET - - EYES - - THINKING_FACE - - CLOWN_FACE - - QUESTION_MARK - default: TYPE_UNSPECIFIED tags: - - MemoService - /api/v2/memos/{id}/reactions/{reactionId}: - delete: - summary: DeleteMemoReaction deletes a reaction for a memo. - operationId: MemoService_DeleteMemoReaction + - ResourceService + /api/v2/resources/{id}: + get: + summary: GetResource returns a resource by id. + operationId: ResourceService_GetResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteMemoReactionResponse' + $ref: '#/definitions/v2GetResourceResponse' default: description: An unexpected error response. schema: @@ -474,22 +392,16 @@ paths: required: true type: integer format: int32 - - name: reactionId - in: path - required: true - type: integer - format: int32 tags: - - MemoService - /api/v2/memos/{id}/relations: - get: - summary: ListMemoRelations lists relations for a memo. - operationId: MemoService_ListMemoRelations + - ResourceService + delete: + summary: DeleteResource deletes a resource by id. + operationId: ResourceService_DeleteResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoRelationsResponse' + $ref: '#/definitions/v2DeleteResourceResponse' default: description: An unexpected error response. schema: @@ -501,270 +413,297 @@ paths: type: integer format: int32 tags: - - MemoService - post: - summary: SetMemoRelations sets relations for a memo. - operationId: MemoService_SetMemoRelations + - ResourceService + /api/v2/resources/{resource.id}: + patch: + summary: UpdateResource updates a resource. + operationId: ResourceService_UpdateResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SetMemoRelationsResponse' + $ref: '#/definitions/v2UpdateResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: resource.id + description: id is the system generated unique identifier. in: path required: true type: integer format: int32 - - name: body + - name: resource in: body required: true schema: - $ref: '#/definitions/MemoServiceSetMemoRelationsBody' + type: object + properties: + name: + type: string + description: name is the user provided name. + createTime: + type: string + format: date-time + filename: + type: string + externalLink: + type: string + type: + type: string + size: + type: string + format: int64 + memoId: + type: integer + format: int32 tags: - - MemoService - /api/v2/memos/{id}/resources: + - ResourceService + /api/v2/tags: get: - summary: ListMemoResources lists resources for a memo. - operationId: MemoService_ListMemoResources + summary: ListTags lists tags. + operationId: TagService_ListTags responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoResourcesResponse' + $ref: '#/definitions/v2ListTagsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: user + description: |- + The creator of tags. + Format: users/{uid} + in: query + required: false + type: string tags: - - MemoService - post: - summary: SetMemoResources sets resources for a memo. - operationId: MemoService_SetMemoResources + - TagService + delete: + summary: DeleteTag deletes a tag. + operationId: TagService_DeleteTag responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SetMemoResourcesResponse' + $ref: '#/definitions/v2DeleteTagResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 - - name: body - in: body - required: true - schema: - $ref: '#/definitions/MemoServiceSetMemoResourcesBody' + - name: tag.name + in: query + required: false + type: string + - name: tag.creator + description: |- + The creator of tags. + Format: users/{uid} + in: query + required: false + type: string tags: - - MemoService - /api/v2/memos/{memo.id}: - patch: - summary: UpdateMemo updates a memo. - operationId: MemoService_UpdateMemo + - TagService + post: + summary: UpsertTag upserts a tag. + operationId: TagService_UpsertTag responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateMemoResponse' + $ref: '#/definitions/v2UpsertTagResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: memo.id - description: id is the system generated unique identifier. - in: path - required: true - type: integer - format: int32 - - name: memo - in: body - required: true - schema: - type: object - properties: - name: - type: string - description: name is the user provided name. - rowStatus: - $ref: '#/definitions/apiv2RowStatus' - creator: - type: string - title: |- - The name of the creator. - Format: users/{uid} - createTime: - type: string - format: date-time - updateTime: - type: string - format: date-time - displayTime: - type: string - format: date-time - content: - type: string - visibility: - $ref: '#/definitions/v2Visibility' - pinned: - type: boolean - parentId: - type: integer - format: int32 - readOnly: true - resources: - type: array - items: - type: object - $ref: '#/definitions/v2Resource' - readOnly: true - relations: - type: array - items: - type: object - $ref: '#/definitions/v2MemoRelation' - readOnly: true - reactions: - type: array - items: - type: object - $ref: '#/definitions/apiv2Reaction' - readOnly: true + - name: name + in: query + required: false + type: string tags: - - MemoService - /api/v2/memos:export: - post: - summary: ExportMemos exports memos. - operationId: MemoService_ExportMemos + - TagService + /api/v2/tags/suggestion: + get: + summary: GetTagSuggestions gets tag suggestions from the user's memos. + operationId: TagService_GetTagSuggestions responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ExportMemosResponse' + $ref: '#/definitions/v2GetTagSuggestionsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: filter - description: Same as ListMemosRequest.filter + - name: user + description: |- + The creator of tags. + Format: users/{uid} in: query required: false type: string tags: - - MemoService - /api/v2/resources: - get: - summary: ListResources lists all resources. - operationId: ResourceService_ListResources + - TagService + /api/v2/tags:batchUpsert: + post: + summary: BatchUpsertTag upserts multiple tags. + operationId: TagService_BatchUpsertTag responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListResourcesResponse' + $ref: '#/definitions/v2BatchUpsertTagResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' tags: - - ResourceService - post: - summary: CreateResource creates a new resource. - operationId: ResourceService_CreateResource + - TagService + /api/v2/tags:rename: + patch: + summary: |- + RenameTag renames a tag. + All related memos will be updated. + operationId: TagService_RenameTag responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateResourceResponse' + $ref: '#/definitions/v2RenameTagResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: filename + - name: user + description: |- + The creator of tags. + Format: users/{uid} in: query required: false type: string - - name: externalLink + - name: oldName in: query required: false type: string - - name: type + - name: newName in: query required: false type: string - - name: memoId - in: query - required: false - type: integer - format: int32 tags: - - ResourceService - /api/v2/resources/name/{name}: + - TagService + /api/v2/users: get: - summary: GetResourceByName returns a resource by name. - operationId: ResourceService_GetResourceByName + summary: ListUsers returns a list of users. + operationId: UserService_ListUsers responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetResourceByNameResponse' + $ref: '#/definitions/v2ListUsersResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - UserService + post: + summary: CreateUser creates a new user. + operationId: UserService_CreateUser + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2CreateUserResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: name - in: path + - name: user + in: body required: true + schema: + $ref: '#/definitions/v2User' + tags: + - UserService + /api/v2/users:search: + get: + summary: SearchUsers searches users by filter. + operationId: UserService_SearchUsers + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2SearchUsersResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: filter + in: query + required: false type: string tags: - - ResourceService - /api/v2/resources/{id}: + - UserService + /api/v2/webhooks: get: - summary: GetResource returns a resource by id. - operationId: ResourceService_GetResource + summary: ListWebhooks returns a list of webhooks. + operationId: WebhookService_ListWebhooks responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetResourceResponse' + $ref: '#/definitions/v2ListWebhooksResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true + - name: creatorId + in: query + required: false type: integer format: int32 tags: - - ResourceService - delete: - summary: DeleteResource deletes a resource by id. - operationId: ResourceService_DeleteResource + - WebhookService + post: + summary: CreateWebhook creates a new webhook. + operationId: WebhookService_CreateWebhook responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteResourceResponse' + $ref: '#/definitions/v2CreateWebhookResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: body + in: body + required: true + schema: + $ref: '#/definitions/v2CreateWebhookRequest' + tags: + - WebhookService + /api/v2/webhooks/{id}: + get: + summary: GetWebhook returns a webhook by id. + operationId: WebhookService_GetWebhook + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2GetWebhookResponse' default: description: An unexpected error response. schema: @@ -776,395 +715,444 @@ paths: type: integer format: int32 tags: - - ResourceService - /api/v2/resources/{resource.id}: - patch: - summary: UpdateResource updates a resource. - operationId: ResourceService_UpdateResource + - WebhookService + delete: + summary: DeleteWebhook deletes a webhook by id. + operationId: WebhookService_DeleteWebhook responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateResourceResponse' + $ref: '#/definitions/v2DeleteWebhookResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: resource.id - description: id is the system generated unique identifier. + - name: id in: path required: true type: integer format: int32 - - name: resource + tags: + - WebhookService + /api/v2/webhooks/{webhook.id}: + patch: + summary: UpdateWebhook updates a webhook. + operationId: WebhookService_UpdateWebhook + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2UpdateWebhookResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: webhook.id + in: path + required: true + type: integer + format: int32 + - name: webhook in: body required: true schema: type: object properties: - name: - type: string - description: name is the user provided name. - createTime: + creatorId: + type: integer + format: int32 + createdTime: type: string format: date-time - filename: - type: string - externalLink: + updatedTime: type: string - type: + format: date-time + rowStatus: + $ref: '#/definitions/apiv2RowStatus' + name: type: string - size: + url: type: string - format: int64 - memoId: - type: integer - format: int32 tags: - - ResourceService - /api/v2/tags: + - WebhookService + /api/v2/workspace/profile: get: - summary: ListTags lists tags. - operationId: TagService_ListTags - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2ListTagsResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: user - description: |- - The creator of tags. - Format: users/{uid} - in: query - required: false - type: string - tags: - - TagService - delete: - summary: DeleteTag deletes a tag. - operationId: TagService_DeleteTag + summary: GetWorkspaceProfile returns the workspace profile. + operationId: WorkspaceService_GetWorkspaceProfile responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteTagResponse' + $ref: '#/definitions/v2GetWorkspaceProfileResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' - parameters: - - name: tag.name - in: query - required: false - type: string - - name: tag.creator - description: |- - The creator of tags. - Format: users/{uid} - in: query - required: false - type: string tags: - - TagService - post: - summary: UpsertTag upserts a tag. - operationId: TagService_UpsertTag + - WorkspaceService + /api/v2/workspace/{name}: + get: + summary: GetWorkspaceSetting returns the setting by name. + operationId: WorkspaceSettingService_GetWorkspaceSetting responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpsertTagResponse' + $ref: '#/definitions/v2GetWorkspaceSettingResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - name: name - in: query - required: false + description: |- + The resource name of the workspace setting. + Format: settings/{setting} + in: path + required: true type: string + pattern: settings/[^/]+ tags: - - TagService - /api/v2/tags/suggestion: - get: - summary: GetTagSuggestions gets tag suggestions from the user's memos. - operationId: TagService_GetTagSuggestions + - WorkspaceSettingService + /api/v2/workspace/{setting.name}: + patch: + summary: SetWorkspaceSetting updates the setting. + operationId: WorkspaceSettingService_SetWorkspaceSetting responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetTagSuggestionsResponse' + $ref: '#/definitions/v2SetWorkspaceSettingResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user + - name: setting.name description: |- - The creator of tags. - Format: users/{uid} - in: query - required: false + name is the name of the setting. + Format: settings/{setting} + in: path + required: true type: string - tags: - - TagService - /api/v2/tags:batchUpsert: - post: - summary: BatchUpsertTag upserts multiple tags. - operationId: TagService_BatchUpsertTag - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2BatchUpsertTagResponse' - default: - description: An unexpected error response. + pattern: settings/[^/]+ + - name: setting + description: setting is the setting to update. + in: body + required: true schema: - $ref: '#/definitions/googlerpcStatus' + type: object + properties: + generalSetting: + $ref: '#/definitions/apiv2WorkspaceGeneralSetting' + description: general_setting is the general setting of workspace. + title: setting is the setting to update. tags: - - TagService - /api/v2/tags:rename: + - WorkspaceSettingService + /api/v2/{inbox.name}: patch: - summary: |- - RenameTag renames a tag. - All related memos will be updated. - operationId: TagService_RenameTag + summary: UpdateInbox updates an inbox. + operationId: InboxService_UpdateInbox responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2RenameTagResponse' + $ref: '#/definitions/v2UpdateInboxResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user + - name: inbox.name description: |- - The creator of tags. - Format: users/{uid} - in: query - required: false - type: string - - name: oldName - in: query - required: false - type: string - - name: newName - in: query - required: false + The name of the inbox. + Format: inboxes/{uid} + in: path + required: true type: string - tags: - - TagService - /api/v2/users: - get: - summary: ListUsers returns a list of users. - operationId: UserService_ListUsers - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2ListUsersResponse' - default: - description: An unexpected error response. + pattern: inboxes/[^/]+ + - name: inbox + in: body + required: true schema: - $ref: '#/definitions/googlerpcStatus' + type: object + properties: + sender: + type: string + title: 'Format: users/{username}' + receiver: + type: string + title: 'Format: users/{username}' + status: + $ref: '#/definitions/v2InboxStatus' + createTime: + type: string + format: date-time + type: + $ref: '#/definitions/v2InboxType' + activityId: + type: integer + format: int32 tags: - - UserService - post: - summary: CreateUser creates a new user. - operationId: UserService_CreateUser + - InboxService + /api/v2/{memo.name}: + patch: + summary: UpdateMemo updates a memo. + operationId: MemoService_UpdateMemo responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateUserResponse' + $ref: '#/definitions/v2UpdateMemoResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user + - name: memo.name + description: |- + The name of the memo. + Format: memos/{uid} + in: path + required: true + type: string + pattern: memos/[^/]+ + - name: memo in: body required: true schema: - $ref: '#/definitions/v2User' + type: object + properties: + resourceId: + type: string + rowStatus: + $ref: '#/definitions/apiv2RowStatus' + creator: + type: string + title: |- + The name of the creator. + Format: users/{uid} + createTime: + type: string + format: date-time + updateTime: + type: string + format: date-time + displayTime: + type: string + format: date-time + content: + type: string + visibility: + $ref: '#/definitions/v2Visibility' + pinned: + type: boolean + parentId: + type: integer + format: int32 + readOnly: true + resources: + type: array + items: + type: object + $ref: '#/definitions/v2Resource' + readOnly: true + relations: + type: array + items: + type: object + $ref: '#/definitions/v2MemoRelation' + readOnly: true + reactions: + type: array + items: + type: object + $ref: '#/definitions/apiv2Reaction' + readOnly: true tags: - - UserService - /api/v2/users/search: + - MemoService + /api/v2/{name_1}: get: - summary: SearchUsers searches users by filter. - operationId: UserService_SearchUsers + summary: GetMemo gets a memo. + operationId: MemoService_GetMemo responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SearchUsersResponse' + $ref: '#/definitions/v2GetMemoResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: filter - in: query - required: false + - name: name_1 + description: |- + The name of the memo. + Format: memos/{uid} + in: path + required: true type: string + pattern: memos/[^/]+ tags: - - UserService - /api/v2/webhooks: - get: - summary: ListWebhooks returns a list of webhooks. - operationId: WebhookService_ListWebhooks + - MemoService + delete: + summary: DeleteInbox deletes an inbox. + operationId: InboxService_DeleteInbox responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListWebhooksResponse' + $ref: '#/definitions/v2DeleteInboxResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: creatorId - in: query - required: false - type: integer - format: int32 + - name: name_1 + description: |- + The name of the inbox to delete. + Format: inboxes/{uid} + in: path + required: true + type: string + pattern: inboxes/[^/]+ tags: - - WebhookService - post: - summary: CreateWebhook creates a new webhook. - operationId: WebhookService_CreateWebhook + - InboxService + /api/v2/{name_2}: + delete: + summary: DeleteMemo deletes a memo. + operationId: MemoService_DeleteMemo responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateWebhookResponse' + $ref: '#/definitions/v2DeleteMemoResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: body - in: body + - name: name_2 + description: |- + The name of the memo. + Format: memos/{uid} + in: path required: true - schema: - $ref: '#/definitions/v2CreateWebhookRequest' + type: string + pattern: memos/[^/]+ tags: - - WebhookService - /api/v2/webhooks/{id}: + - MemoService + /api/v2/{name}: get: - summary: GetWebhook returns a webhook by id. - operationId: WebhookService_GetWebhook + summary: GetUser gets a user by name. + operationId: UserService_GetUser responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetWebhookResponse' + $ref: '#/definitions/v2GetUserResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: name + description: |- + The name of the user. + Format: users/{uid} in: path required: true - type: integer - format: int32 + type: string + pattern: users/[^/]+ tags: - - WebhookService + - UserService delete: - summary: DeleteWebhook deletes a webhook by id. - operationId: WebhookService_DeleteWebhook + summary: DeleteUser deletes a user. + operationId: UserService_DeleteUser responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteWebhookResponse' + $ref: '#/definitions/v2DeleteUserResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: name + description: |- + The name of the user. + Format: users/{uid} in: path required: true - type: integer - format: int32 + type: string + pattern: users/[^/]+ tags: - - WebhookService - /api/v2/webhooks/{webhook.id}: - patch: - summary: UpdateWebhook updates a webhook. - operationId: WebhookService_UpdateWebhook + - UserService + /api/v2/{name}/access_tokens: + get: + summary: ListUserAccessTokens returns a list of access tokens for a user. + operationId: UserService_ListUserAccessTokens responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateWebhookResponse' + $ref: '#/definitions/v2ListUserAccessTokensResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: webhook.id + - name: name + description: |- + The name of the user. + Format: users/{uid} in: path required: true - type: integer - format: int32 - - name: webhook - in: body - required: true - schema: - type: object - properties: - creatorId: - type: integer - format: int32 - createdTime: - type: string - format: date-time - updatedTime: - type: string - format: date-time - rowStatus: - $ref: '#/definitions/apiv2RowStatus' - name: - type: string - url: - type: string + type: string + pattern: users/[^/]+ tags: - - WebhookService - /api/v2/workspace/profile: - get: - summary: GetWorkspaceProfile returns the workspace profile. - operationId: WorkspaceService_GetWorkspaceProfile + - UserService + post: + summary: CreateUserAccessToken creates a new access token for a user. + operationId: UserService_CreateUserAccessToken responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetWorkspaceProfileResponse' + $ref: '#/definitions/v2CreateUserAccessTokenResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' + parameters: + - name: name + description: |- + The name of the user. + Format: users/{uid} + in: path + required: true + type: string + pattern: users/[^/]+ + - name: body + in: body + required: true + schema: + $ref: '#/definitions/UserServiceCreateUserAccessTokenBody' tags: - - WorkspaceService - /api/v2/workspace/{name}: - get: - summary: GetWorkspaceSetting returns the setting by name. - operationId: WorkspaceSettingService_GetWorkspaceSetting + - UserService + /api/v2/{name}/access_tokens/{accessToken}: + delete: + summary: DeleteUserAccessToken deletes an access token for a user. + operationId: UserService_DeleteUserAccessToken responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetWorkspaceSettingResponse' + $ref: '#/definitions/v2DeleteUserAccessTokenResponse' default: description: An unexpected error response. schema: @@ -1172,128 +1160,112 @@ paths: parameters: - name: name description: |- - The resource name of the workspace setting. - Format: settings/{setting} + The name of the user. + Format: users/{uid} + in: path + required: true + type: string + pattern: users/[^/]+ + - name: accessToken + description: access_token is the access token to delete. in: path required: true type: string - pattern: settings/[^/]+ tags: - - WorkspaceSettingService - /api/v2/workspace/{setting.name}: - patch: - summary: SetWorkspaceSetting updates the setting. - operationId: WorkspaceSettingService_SetWorkspaceSetting + - UserService + /api/v2/{name}/comments: + get: + summary: ListMemoComments lists comments for a memo. + operationId: MemoService_ListMemoComments responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SetWorkspaceSettingResponse' + $ref: '#/definitions/v2ListMemoCommentsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: setting.name + - name: name description: |- - name is the name of the setting. - Format: settings/{setting} + The name of the memo. + Format: memos/{uid} in: path required: true type: string - pattern: settings/[^/]+ - - name: setting - description: setting is the setting to update. - in: body - required: true - schema: - type: object - properties: - generalSetting: - $ref: '#/definitions/apiv2WorkspaceGeneralSetting' - description: general_setting is the general setting of workspace. - title: setting is the setting to update. + pattern: memos/[^/]+ tags: - - WorkspaceSettingService - /api/v2/{inbox.name}: - patch: - summary: UpdateInbox updates an inbox. - operationId: InboxService_UpdateInbox + - MemoService + post: + summary: CreateMemoComment creates a comment for a memo. + operationId: MemoService_CreateMemoComment responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateInboxResponse' + $ref: '#/definitions/v2CreateMemoCommentResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: inbox.name + - name: name description: |- - The name of the inbox. - Format: inboxes/{uid} + The name of the memo. + Format: memos/{uid} in: path required: true type: string - pattern: inboxes/[^/]+ - - name: inbox - in: body - required: true - schema: - type: object - properties: - sender: - type: string - title: 'Format: users/{username}' - receiver: - type: string - title: 'Format: users/{username}' - status: - $ref: '#/definitions/v2InboxStatus' - createTime: - type: string - format: date-time - type: - $ref: '#/definitions/v2InboxType' - activityId: - type: integer - format: int32 + pattern: memos/[^/]+ + - name: comment.content + in: query + required: false + type: string + - name: comment.visibility + in: query + required: false + type: string + enum: + - VISIBILITY_UNSPECIFIED + - PRIVATE + - PROTECTED + - PUBLIC + default: VISIBILITY_UNSPECIFIED tags: - - InboxService - /api/v2/{name_1}: - delete: - summary: DeleteInbox deletes an inbox. - operationId: InboxService_DeleteInbox + - MemoService + /api/v2/{name}/reactions: + get: + summary: ListMemoReactions lists reactions for a memo. + operationId: MemoService_ListMemoReactions responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteInboxResponse' + $ref: '#/definitions/v2ListMemoReactionsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: name_1 + - name: name description: |- - The name of the inbox to delete. - Format: inboxes/{uid} + The name of the memo. + Format: memos/{uid} in: path required: true type: string - pattern: inboxes/[^/]+ + pattern: memos/[^/]+ tags: - - InboxService - /api/v2/{name}: - get: - summary: GetUser gets a user by name. - operationId: UserService_GetUser + - MemoService + post: + summary: UpsertMemoReaction upserts a reaction for a memo. + operationId: MemoService_UpsertMemoReaction responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetUserResponse' + $ref: '#/definitions/v2UpsertMemoReactionResponse' default: description: An unexpected error response. schema: @@ -1301,22 +1273,58 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{uid} + The name of the memo. + Format: memos/{uid} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ + - name: reaction.id + in: query + required: false + type: integer + format: int32 + - name: reaction.creator + description: |- + The name of the creator. + Format: users/{uid} + in: query + required: false + type: string + - name: reaction.contentId + in: query + required: false + type: string + - name: reaction.reactionType + in: query + required: false + type: string + enum: + - TYPE_UNSPECIFIED + - THUMBS_UP + - THUMBS_DOWN + - HEART + - FIRE + - CLAPPING_HANDS + - LAUGH + - OK_HAND + - ROCKET + - EYES + - THINKING_FACE + - CLOWN_FACE + - QUESTION_MARK + default: TYPE_UNSPECIFIED tags: - - UserService + - MemoService + /api/v2/{name}/reactions/{reactionId}: delete: - summary: DeleteUser deletes a user. - operationId: UserService_DeleteUser + summary: DeleteMemoReaction deletes a reaction for a memo. + operationId: MemoService_DeleteMemoReaction responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteUserResponse' + $ref: '#/definitions/v2DeleteMemoReactionResponse' default: description: An unexpected error response. schema: @@ -1324,23 +1332,28 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{uid} + The name of the memo. + Format: memos/{uid} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ + - name: reactionId + in: path + required: true + type: integer + format: int32 tags: - - UserService - /api/v2/{name}/access_tokens: + - MemoService + /api/v2/{name}/relations: get: - summary: ListUserAccessTokens returns a list of access tokens for a user. - operationId: UserService_ListUserAccessTokens + summary: ListMemoRelations lists relations for a memo. + operationId: MemoService_ListMemoRelations responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListUserAccessTokensResponse' + $ref: '#/definitions/v2ListMemoRelationsResponse' default: description: An unexpected error response. schema: @@ -1348,22 +1361,22 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{uid} + The name of the memo. + Format: memos/{uid} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ tags: - - UserService + - MemoService post: - summary: CreateUserAccessToken creates a new access token for a user. - operationId: UserService_CreateUserAccessToken + summary: SetMemoRelations sets relations for a memo. + operationId: MemoService_SetMemoRelations responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateUserAccessTokenResponse' + $ref: '#/definitions/v2SetMemoRelationsResponse' default: description: An unexpected error response. schema: @@ -1371,28 +1384,28 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{uid} + The name of the memo. + Format: memos/{uid} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ - name: body in: body required: true schema: - $ref: '#/definitions/UserServiceCreateUserAccessTokenBody' + $ref: '#/definitions/MemoServiceSetMemoRelationsBody' tags: - - UserService - /api/v2/{name}/access_tokens/{accessToken}: - delete: - summary: DeleteUserAccessToken deletes an access token for a user. - operationId: UserService_DeleteUserAccessToken + - MemoService + /api/v2/{name}/resources: + get: + summary: ListMemoResources lists resources for a memo. + operationId: MemoService_ListMemoResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteUserAccessTokenResponse' + $ref: '#/definitions/v2ListMemoResourcesResponse' default: description: An unexpected error response. schema: @@ -1400,19 +1413,42 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{uid} + The name of the memo. + Format: memos/{uid} in: path required: true type: string - pattern: users/[^/]+ - - name: accessToken - description: access_token is the access token to delete. + pattern: memos/[^/]+ + tags: + - MemoService + post: + summary: SetMemoResources sets resources for a memo. + operationId: MemoService_SetMemoResources + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2SetMemoResourcesResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: name + description: |- + The name of the memo. + Format: memos/{uid} in: path required: true type: string + pattern: memos/[^/]+ + - name: body + in: body + required: true + schema: + $ref: '#/definitions/MemoServiceSetMemoResourcesBody' tags: - - UserService + - MemoService /api/v2/{name}/setting: get: summary: GetUserSetting gets the setting of a user. @@ -1839,11 +1875,6 @@ definitions: properties: linkMetadata: $ref: '#/definitions/v2LinkMetadata' - v2GetMemoByNameResponse: - type: object - properties: - memo: - $ref: '#/definitions/v2Memo' v2GetMemoResponse: type: object properties: @@ -2045,13 +2076,13 @@ definitions: v2Memo: type: object properties: - id: - type: integer - format: int32 - description: id is the system generated unique identifier. name: type: string - description: name is the user provided name. + title: |- + The name of the memo. + Format: memos/{uid} + resourceId: + type: string rowStatus: $ref: '#/definitions/apiv2RowStatus' creator: @@ -2144,6 +2175,14 @@ definitions: memoId: type: integer format: int32 + v2SearchMemosResponse: + type: object + properties: + memos: + type: array + items: + type: object + $ref: '#/definitions/v2Memo' v2SearchUsersResponse: type: object properties: diff --git a/server/route/api/v2/memo_relation_service.go b/server/route/api/v2/memo_relation_service.go index 3c20e43f1..5aab45c78 100644 --- a/server/route/api/v2/memo_relation_service.go +++ b/server/route/api/v2/memo_relation_service.go @@ -11,10 +11,14 @@ import ( ) func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.SetMemoRelationsRequest) (*apiv2pb.SetMemoRelationsResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } referenceType := store.MemoRelationReference // Delete all reference relations first. if err := s.Store.DeleteMemoRelation(ctx, &store.DeleteMemoRelation{ - MemoID: &request.Id, + MemoID: &id, Type: &referenceType, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete memo relation") @@ -22,7 +26,7 @@ func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.Se for _, relation := range request.Relations { // Ignore reflexive relations. - if request.Id == relation.RelatedMemoId { + if id == relation.RelatedMemoId { continue } // Ignore comment relations as there's no need to update a comment's relation. @@ -31,7 +35,7 @@ func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.Se continue } if _, err := s.Store.UpsertMemoRelation(ctx, &store.MemoRelation{ - MemoID: request.Id, + MemoID: id, RelatedMemoID: relation.RelatedMemoId, Type: convertMemoRelationTypeToStore(relation.Type), }); err != nil { @@ -43,9 +47,13 @@ func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.Se } func (s *APIV2Service) ListMemoRelations(ctx context.Context, request *apiv2pb.ListMemoRelationsRequest) (*apiv2pb.ListMemoRelationsResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } relationList := []*apiv2pb.MemoRelation{} tempList, err := s.Store.ListMemoRelations(ctx, &store.FindMemoRelation{ - MemoID: &request.Id, + MemoID: &id, }) if err != nil { return nil, err @@ -54,7 +62,7 @@ func (s *APIV2Service) ListMemoRelations(ctx context.Context, request *apiv2pb.L relationList = append(relationList, convertMemoRelationFromStore(relation)) } tempList, err = s.Store.ListMemoRelations(ctx, &store.FindMemoRelation{ - RelatedMemoID: &request.Id, + RelatedMemoID: &id, }) if err != nil { return nil, err diff --git a/server/route/api/v2/memo_resource_service.go b/server/route/api/v2/memo_resource_service.go index 9071d115d..ae5b28ada 100644 --- a/server/route/api/v2/memo_resource_service.go +++ b/server/route/api/v2/memo_resource_service.go @@ -13,8 +13,12 @@ import ( ) func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.SetMemoResourcesRequest) (*apiv2pb.SetMemoResourcesResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } resources, err := s.Store.ListResources(ctx, &store.FindResource{ - MemoID: &request.Id, + MemoID: &id, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list resources") @@ -32,7 +36,7 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se if !found { if err = s.Store.DeleteResource(ctx, &store.DeleteResource{ ID: int32(resource.ID), - MemoID: &request.Id, + MemoID: &id, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete resource") } @@ -45,7 +49,7 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se updatedTs := time.Now().Unix() + int64(index) if _, err := s.Store.UpdateResource(ctx, &store.UpdateResource{ ID: resource.Id, - MemoID: &request.Id, + MemoID: &id, UpdatedTs: &updatedTs, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to update resource: %v", err) @@ -56,8 +60,12 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se } func (s *APIV2Service) ListMemoResources(ctx context.Context, request *apiv2pb.ListMemoResourcesRequest) (*apiv2pb.ListMemoResourcesResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } resources, err := s.Store.ListResources(ctx, &store.FindResource{ - MemoID: &request.Id, + MemoID: &id, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list resources") diff --git a/server/route/api/v2/memo_service.go b/server/route/api/v2/memo_service.go index 61e480a00..f62dadf53 100644 --- a/server/route/api/v2/memo_service.go +++ b/server/route/api/v2/memo_service.go @@ -133,42 +133,44 @@ func (s *APIV2Service) ListMemos(ctx context.Context, request *apiv2pb.ListMemos return response, nil } -func (s *APIV2Service) GetMemo(ctx context.Context, request *apiv2pb.GetMemoRequest) (*apiv2pb.GetMemoResponse, error) { - memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Id, - }) - if err != nil { - return nil, err +func (s *APIV2Service) SearchMemos(ctx context.Context, request *apiv2pb.SearchMemosRequest) (*apiv2pb.SearchMemosResponse, error) { + memoFind := &store.FindMemo{ + // Exclude comments by default. + ExcludeComments: true, } - if memo == nil { - return nil, status.Errorf(codes.NotFound, "memo not found") + if err := s.buildMemoFindWithFilter(ctx, memoFind, request.Filter); err != nil { + return nil, status.Errorf(codes.InvalidArgument, "failed to build find memos with filter") } - if memo.Visibility != store.Public { - user, err := getCurrentUser(ctx, s.Store) + + defaultSearchLimit := 10 + memoFind.Limit = &defaultSearchLimit + memos, err := s.Store.ListMemos(ctx, memoFind) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to search memos") + } + + memoMessages := []*apiv2pb.Memo{} + for _, memo := range memos { + memoMessage, err := s.convertMemoFromStore(ctx, memo) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get user") - } - if user == nil { - return nil, status.Errorf(codes.PermissionDenied, "permission denied") - } - if memo.Visibility == store.Private && memo.CreatorID != user.ID { - return nil, status.Errorf(codes.PermissionDenied, "permission denied") + return nil, errors.Wrap(err, "failed to convert memo") } + memoMessages = append(memoMessages, memoMessage) } - memoMessage, err := s.convertMemoFromStore(ctx, memo) - if err != nil { - return nil, errors.Wrap(err, "failed to convert memo") - } - response := &apiv2pb.GetMemoResponse{ - Memo: memoMessage, + response := &apiv2pb.SearchMemosResponse{ + Memos: memoMessages, } return response, nil } -func (s *APIV2Service) GetMemoByName(ctx context.Context, request *apiv2pb.GetMemoByNameRequest) (*apiv2pb.GetMemoByNameResponse, error) { +func (s *APIV2Service) GetMemo(ctx context.Context, request *apiv2pb.GetMemoRequest) (*apiv2pb.GetMemoResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ResourceName: &request.Name, + ID: &id, }) if err != nil { return nil, err @@ -193,20 +195,22 @@ func (s *APIV2Service) GetMemoByName(ctx context.Context, request *apiv2pb.GetMe if err != nil { return nil, errors.Wrap(err, "failed to convert memo") } - response := &apiv2pb.GetMemoByNameResponse{ + response := &apiv2pb.GetMemoResponse{ Memo: memoMessage, } return response, nil } func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMemoRequest) (*apiv2pb.UpdateMemoResponse, error) { + id, err := ExtractMemoIDFromName(request.Memo.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 { return nil, status.Errorf(codes.InvalidArgument, "update mask is required") } - memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Memo.Id, - }) + memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ID: &id}) if err != nil { return nil, err } @@ -221,7 +225,7 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe currentTs := time.Now().Unix() update := &store.UpdateMemo{ - ID: request.Memo.Id, + ID: id, UpdatedTs: ¤tTs, } for _, path := range request.UpdateMask.Paths { @@ -251,7 +255,7 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe update.CreatedTs = &createdTs } else if path == "pinned" { if _, err := s.Store.UpsertMemoOrganizer(ctx, &store.MemoOrganizer{ - MemoID: request.Memo.Id, + MemoID: id, UserID: user.ID, Pinned: request.Memo.Pinned, }); err != nil { @@ -268,7 +272,7 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe } memo, err = s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Memo.Id, + ID: &id, }) if err != nil { return nil, errors.Wrap(err, "failed to get memo") @@ -288,8 +292,12 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe } func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMemoRequest) (*apiv2pb.DeleteMemoResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Id, + ID: &id, }) if err != nil { return nil, err @@ -310,9 +318,7 @@ func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMe } } - if err = s.Store.DeleteMemo(ctx, &store.DeleteMemo{ - ID: request.Id, - }); err != nil { + if err = s.Store.DeleteMemo(ctx, &store.DeleteMemo{ID: id}); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete memo") } @@ -320,22 +326,30 @@ func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMe } func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.CreateMemoCommentRequest) (*apiv2pb.CreateMemoCommentResponse, error) { - relatedMemo, err := s.Store.GetMemo(ctx, &store.FindMemo{ID: &request.Id}) + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } + relatedMemo, err := s.Store.GetMemo(ctx, &store.FindMemo{ID: &id}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get memo") } // Create the comment memo first. - createMemoResponse, err := s.CreateMemo(ctx, request.Create) + createMemoResponse, err := s.CreateMemo(ctx, request.Comment) if err != nil { return nil, status.Errorf(codes.Internal, "failed to create memo") } // Build the relation between the comment memo and the original memo. memo := createMemoResponse.Memo + memoId, err := ExtractMemoIDFromName(memo.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } _, err = s.Store.UpsertMemoRelation(ctx, &store.MemoRelation{ - MemoID: memo.Id, - RelatedMemoID: request.Id, + MemoID: memoId, + RelatedMemoID: relatedMemo.ID, Type: store.MemoRelationComment, }) if err != nil { @@ -352,8 +366,8 @@ func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.C Level: store.ActivityLevelInfo, Payload: &storepb.ActivityPayload{ MemoComment: &storepb.ActivityMemoCommentPayload{ - MemoId: memo.Id, - RelatedMemoId: request.Id, + MemoId: memoId, + RelatedMemoId: relatedMemo.ID, }, }, }) @@ -380,9 +394,13 @@ func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.C } func (s *APIV2Service) ListMemoComments(ctx context.Context, request *apiv2pb.ListMemoCommentsRequest) (*apiv2pb.ListMemoCommentsResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } memoRelationComment := store.MemoRelationComment memoRelations, err := s.Store.ListMemoRelations(ctx, &store.FindMemoRelation{ - RelatedMemoID: &request.Id, + RelatedMemoID: &id, Type: &memoRelationComment, }) if err != nil { @@ -519,24 +537,25 @@ func (s *APIV2Service) convertMemoFromStore(ctx context.Context, memo *store.Mem return nil, errors.Wrap(err, "failed to get creator") } - listMemoRelationsResponse, err := s.ListMemoRelations(ctx, &apiv2pb.ListMemoRelationsRequest{Id: memo.ID}) + name := fmt.Sprintf("%s%d", MemoNamePrefix, memo.ID) + listMemoRelationsResponse, err := s.ListMemoRelations(ctx, &apiv2pb.ListMemoRelationsRequest{Name: name}) if err != nil { return nil, errors.Wrap(err, "failed to list memo relations") } - listMemoResourcesResponse, err := s.ListMemoResources(ctx, &apiv2pb.ListMemoResourcesRequest{Id: memo.ID}) + listMemoResourcesResponse, err := s.ListMemoResources(ctx, &apiv2pb.ListMemoResourcesRequest{Name: name}) if err != nil { return nil, errors.Wrap(err, "failed to list memo resources") } - listMemoReactionsResponse, err := s.ListMemoReactions(ctx, &apiv2pb.ListMemoReactionsRequest{Id: memo.ID}) + listMemoReactionsResponse, err := s.ListMemoReactions(ctx, &apiv2pb.ListMemoReactionsRequest{Name: name}) if err != nil { return nil, errors.Wrap(err, "failed to list memo reactions") } return &apiv2pb.Memo{ - Id: int32(memo.ID), - Name: memo.ResourceName, + Name: name, + ResourceId: memo.ResourceName, RowStatus: convertRowStatusFromStore(memo.RowStatus), Creator: fmt.Sprintf("%s%d", UserNamePrefix, creator.ID), CreateTime: timestamppb.New(time.Unix(memo.CreatedTs, 0)), @@ -620,7 +639,7 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. find = &store.FindMemo{} } if filter != "" { - filter, err := parseListMemosFilter(filter) + filter, err := parseSearchMemosFilter(filter) if err != nil { return status.Errorf(codes.InvalidArgument, "invalid filter: %v", err) } @@ -671,6 +690,9 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. } find.CreatorID = &user.ID } + if filter.ResourceName != nil { + find.ResourceName = filter.ResourceName + } if filter.RowStatus != nil { find.RowStatus = filter.RowStatus } @@ -698,29 +720,31 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. return nil } -// ListMemosFilterCELAttributes are the CEL attributes for ListMemosFilter. -var ListMemosFilterCELAttributes = []cel.EnvOption{ +// SearchMemosFilterCELAttributes are the CEL attributes. +var SearchMemosFilterCELAttributes = []cel.EnvOption{ cel.Variable("content_search", cel.ListType(cel.StringType)), cel.Variable("visibilities", cel.ListType(cel.StringType)), cel.Variable("order_by_pinned", cel.BoolType), cel.Variable("display_time_before", cel.IntType), cel.Variable("display_time_after", cel.IntType), cel.Variable("creator", cel.StringType), + cel.Variable("resource_name", cel.StringType), cel.Variable("row_status", cel.StringType), } -type ListMemosFilter struct { +type SearchMemosFilter struct { ContentSearch []string Visibilities []store.Visibility OrderByPinned bool DisplayTimeBefore *int64 DisplayTimeAfter *int64 Creator *string + ResourceName *string RowStatus *store.RowStatus } -func parseListMemosFilter(expression string) (*ListMemosFilter, error) { - e, err := cel.NewEnv(ListMemosFilterCELAttributes...) +func parseSearchMemosFilter(expression string) (*SearchMemosFilter, error) { + e, err := cel.NewEnv(SearchMemosFilterCELAttributes...) if err != nil { return nil, err } @@ -728,17 +752,17 @@ func parseListMemosFilter(expression string) (*ListMemosFilter, error) { if issues != nil { return nil, errors.Errorf("found issue %v", issues) } - filter := &ListMemosFilter{} + filter := &SearchMemosFilter{} expr, err := cel.AstToParsedExpr(ast) if err != nil { return nil, err } callExpr := expr.GetExpr().GetCallExpr() - findListMemosField(callExpr, filter) + findSearchMemosField(callExpr, filter) return filter, nil } -func findListMemosField(callExpr *expr.Expr_Call, filter *ListMemosFilter) { +func findSearchMemosField(callExpr *expr.Expr_Call, filter *SearchMemosFilter) { if len(callExpr.Args) == 2 { idExpr := callExpr.Args[0].GetIdentExpr() if idExpr != nil { @@ -768,6 +792,9 @@ func findListMemosField(callExpr *expr.Expr_Call, filter *ListMemosFilter) { } else if idExpr.Name == "creator" { creator := callExpr.Args[1].GetConstExpr().GetStringValue() filter.Creator = &creator + } else if idExpr.Name == "resource_name" { + resourceName := callExpr.Args[1].GetConstExpr().GetStringValue() + filter.ResourceName = &resourceName } else if idExpr.Name == "row_status" { rowStatus := store.RowStatus(callExpr.Args[1].GetConstExpr().GetStringValue()) filter.RowStatus = &rowStatus @@ -778,7 +805,7 @@ func findListMemosField(callExpr *expr.Expr_Call, filter *ListMemosFilter) { for _, arg := range callExpr.Args { callExpr := arg.GetCallExpr() if callExpr != nil { - findListMemosField(callExpr, filter) + findSearchMemosField(callExpr, filter) } } } @@ -828,11 +855,15 @@ func convertMemoToWebhookPayload(memo *apiv2pb.Memo) (*webhook.WebhookPayload, e if err != nil { return nil, errors.Wrap(err, "invalid memo creator") } + id, err := ExtractMemoIDFromName(memo.Name) + if err != nil { + return nil, errors.Wrap(err, "invalid memo name") + } return &webhook.WebhookPayload{ CreatorID: creatorID, CreatedTs: time.Now().Unix(), Memo: &webhook.Memo{ - ID: memo.Id, + ID: id, CreatorID: creatorID, CreatedTs: memo.CreateTime.Seconds, UpdatedTs: memo.UpdateTime.Seconds, diff --git a/server/route/api/v2/reaction_service.go b/server/route/api/v2/reaction_service.go index 8a507bc2d..c10a5fcc3 100644 --- a/server/route/api/v2/reaction_service.go +++ b/server/route/api/v2/reaction_service.go @@ -13,9 +13,8 @@ import ( ) func (s *APIV2Service) ListMemoReactions(ctx context.Context, request *apiv2pb.ListMemoReactionsRequest) (*apiv2pb.ListMemoReactionsResponse, error) { - contentID := fmt.Sprintf("memos/%d", request.Id) reactions, err := s.Store.ListReactions(ctx, &store.FindReaction{ - ContentID: &contentID, + ContentID: &request.Name, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list reactions") @@ -58,8 +57,12 @@ func (s *APIV2Service) UpsertMemoReaction(ctx context.Context, request *apiv2pb. } func (s *APIV2Service) DeleteMemoReaction(ctx context.Context, request *apiv2pb.DeleteMemoReactionRequest) (*apiv2pb.DeleteMemoReactionResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } if err := s.Store.DeleteReaction(ctx, &store.DeleteReaction{ - ID: request.Id, + ID: id, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete reaction") } @@ -76,7 +79,7 @@ func (s *APIV2Service) convertReactionFromStore(ctx context.Context, reaction *s } return &apiv2pb.Reaction{ Id: reaction.Id, - Creator: fmt.Sprintf("%s%s", UserNamePrefix, creator.Username), + Creator: fmt.Sprintf("%s%d", UserNamePrefix, creator.ID), ContentId: reaction.ContentId, ReactionType: apiv2pb.Reaction_Type(reaction.ReactionType), }, nil diff --git a/server/route/api/v2/resource_name.go b/server/route/api/v2/resource_name.go index abf3e0773..0e9c15d92 100644 --- a/server/route/api/v2/resource_name.go +++ b/server/route/api/v2/resource_name.go @@ -12,6 +12,7 @@ import ( const ( WorkspaceSettingNamePrefix = "settings/" UserNamePrefix = "users/" + MemoNamePrefix = "memos/" InboxNamePrefix = "inboxes/" ) @@ -56,6 +57,19 @@ func ExtractUserIDFromName(name string) (int32, error) { return id, nil } +// ExtractMemoIDFromName returns the memo ID from a resource name. +func ExtractMemoIDFromName(name string) (int32, error) { + tokens, err := GetNameParentTokens(name, MemoNamePrefix) + if err != nil { + return 0, err + } + id, err := util.ConvertStringToInt32(tokens[0]) + if err != nil { + return 0, errors.Errorf("invalid memo ID %q", tokens[0]) + } + return id, nil +} + // ExtractInboxIDFromName returns the inbox ID from a resource name. func ExtractInboxIDFromName(name string) (int32, error) { tokens, err := GetNameParentTokens(name, InboxNamePrefix) diff --git a/server/route/api/v2/tag_service.go b/server/route/api/v2/tag_service.go index cde8e5374..35f75fe16 100644 --- a/server/route/api/v2/tag_service.go +++ b/server/route/api/v2/tag_service.go @@ -244,7 +244,7 @@ func (s *APIV2Service) convertTagFromStore(ctx context.Context, tag *store.Tag) } return &apiv2pb.Tag{ Name: tag.Name, - Creator: fmt.Sprintf("%s%s", UserNamePrefix, user.Username), + Creator: fmt.Sprintf("%s%d", UserNamePrefix, user.ID), }, nil } diff --git a/web/src/components/ChangeMemoCreatedTsDialog.tsx b/web/src/components/ChangeMemoCreatedTsDialog.tsx index a07c1c867..0c769e299 100644 --- a/web/src/components/ChangeMemoCreatedTsDialog.tsx +++ b/web/src/components/ChangeMemoCreatedTsDialog.tsx @@ -2,7 +2,7 @@ import { Button, IconButton, Input } from "@mui/joy"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { getNormalizedTimeString } from "@/helpers/datetime"; -import { useMemoStore } from "@/store/v1"; +import { MemoNamePrefix, useMemoStore } from "@/store/v1"; import { useTranslate } from "@/utils/i18n"; import { generateDialog } from "./Dialog"; import Icon from "./Icon"; @@ -43,7 +43,7 @@ const ChangeMemoCreatedTsDialog: React.FC = (props: Props) => { try { await memoStore.updateMemo( { - id: memoId, + name: `${MemoNamePrefix}${memoId}`, createTime: new Date(createdAt), }, ["created_ts"], diff --git a/web/src/components/CreateMemoRelationDialog.tsx b/web/src/components/CreateMemoRelationDialog.tsx index dcc6aad59..32d82cb0e 100644 --- a/web/src/components/CreateMemoRelationDialog.tsx +++ b/web/src/components/CreateMemoRelationDialog.tsx @@ -106,7 +106,7 @@ const CreateMemoRelationDialog: React.FC = (props: Props) => { onInputChange={(_, value) => setSearchText(value.trim())} getOptionKey={(option) => option.name} getOptionLabel={(option) => option.content} - isOptionEqualToValue={(option, value) => option.id === value.id} + isOptionEqualToValue={(option, value) => option.name === value.name} renderOption={(props, option) => (
diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index 201265f3e..25b7932f6 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -4,7 +4,7 @@ import toast from "react-hot-toast"; import { useLocation } from "react-router-dom"; import Icon from "@/components/Icon"; import useNavigateTo from "@/hooks/useNavigateTo"; -import { useMemoStore } from "@/store/v1"; +import { extractMemoIdFromName, useMemoStore } from "@/store/v1"; import { RowStatus } from "@/types/proto/api/v2/common"; import { Memo } from "@/types/proto/api/v2/memo_service"; import { useTranslate } from "@/utils/i18n"; @@ -31,7 +31,7 @@ const MemoActionMenu = (props: Props) => { if (memo.pinned) { await memoStore.updateMemo( { - id: memo.id, + name: memo.name, pinned: false, }, ["pinned"], @@ -39,7 +39,7 @@ const MemoActionMenu = (props: Props) => { } else { await memoStore.updateMemo( { - id: memo.id, + name: memo.name, pinned: true, }, ["pinned"], @@ -52,8 +52,8 @@ const MemoActionMenu = (props: Props) => { const handleEditMemoClick = () => { showMemoEditorDialog({ - memoId: memo.id, - cacheKey: `${memo.id}-${memo.updateTime}`, + memoId: extractMemoIdFromName(memo.name), + cacheKey: `${memo.name}-${memo.updateTime}`, }); }; @@ -61,7 +61,7 @@ const MemoActionMenu = (props: Props) => { try { await memoStore.updateMemo( { - id: memo.id, + name: memo.name, rowStatus: RowStatus.ARCHIVED, }, ["row_status"], @@ -85,7 +85,7 @@ const MemoActionMenu = (props: Props) => { style: "danger", dialogName: "delete-memo-dialog", onConfirm: async () => { - await memoStore.deleteMemo(memo.id); + await memoStore.deleteMemo(extractMemoIdFromName(memo.name)); toast.success("Deleted successfully"); if (isInMemoDetailPage) { navigateTo("/"); @@ -115,7 +115,7 @@ const MemoActionMenu = (props: Props) => { )} {!hiddenActions?.includes("share") && ( - showShareMemoDialog(memo.id)}> + showShareMemoDialog(extractMemoIdFromName(memo.name))}> {t("common.share")} diff --git a/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx b/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx index af5108072..f3fca8a89 100644 --- a/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx +++ b/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx @@ -3,7 +3,7 @@ import { Link } from "react-router-dom"; import Icon from "@/components/Icon"; import MemoResourceListView from "@/components/MemoResourceListView"; import useLoading from "@/hooks/useLoading"; -import { useMemoStore } from "@/store/v1"; +import { extractMemoIdFromName, useMemoStore } from "@/store/v1"; import MemoContent from ".."; import { RendererContext } from "../types"; import Error from "./Error"; @@ -21,7 +21,7 @@ const EmbeddedMemo = ({ resourceId, params: paramsStr }: Props) => { const resourceName = `memos/${resourceId}`; useEffect(() => { - memoStore.getOrFetchMemoByName(resourceId).finally(() => loadingState.setFinish()); + memoStore.searchMemos(`resource_name == "${resourceId}"`).finally(() => loadingState.setFinish()); }, [resourceId]); if (loadingState.isLoading) { @@ -30,7 +30,7 @@ const EmbeddedMemo = ({ resourceId, params: paramsStr }: Props) => { if (!memo) { return ; } - if (memo.id === context.memoId || context.embeddedMemos.has(resourceName)) { + if (extractMemoIdFromName(memo.name) === context.memoId || context.embeddedMemos.has(resourceName)) { return ; } @@ -41,7 +41,12 @@ const EmbeddedMemo = ({ resourceId, params: paramsStr }: Props) => { if (inlineMode) { return (
- +
); @@ -57,7 +62,12 @@ const EmbeddedMemo = ({ resourceId, params: paramsStr }: Props) => {
- + ); diff --git a/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx b/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx index 5112ef593..c7dd12924 100644 --- a/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx +++ b/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx @@ -17,7 +17,7 @@ const ReferencedMemo = ({ resourceId, params: paramsStr }: Props) => { const params = new URLSearchParams(paramsStr); useEffect(() => { - memoStore.getOrFetchMemoByName(resourceId).finally(() => loadingState.setFinish()); + memoStore.searchMemos(`resource_name == "${resourceId}"`).finally(() => loadingState.setFinish()); }, [resourceId]); if (loadingState.isLoading) { diff --git a/web/src/components/MemoContent/TaskList.tsx b/web/src/components/MemoContent/TaskList.tsx index 90d8f11d2..4ee104de6 100644 --- a/web/src/components/MemoContent/TaskList.tsx +++ b/web/src/components/MemoContent/TaskList.tsx @@ -2,7 +2,7 @@ import { Checkbox } from "@mui/joy"; import classNames from "classnames"; import { repeat } from "lodash-es"; import { useContext, useState } from "react"; -import { useMemoStore } from "@/store/v1"; +import { MemoNamePrefix, useMemoStore } from "@/store/v1"; import { Node, NodeType, TaskListNode } from "@/types/node"; import Renderer from "./Renderer"; import { RendererContext } from "./types"; @@ -39,7 +39,7 @@ const TaskList: React.FC = ({ index, indent, complete, children }: Props) const content = window.restore(context.nodes); await memoStore.updateMemo( { - id: context.memoId, + name: `${MemoNamePrefix}${context.memoId}`, content, }, ["content"], diff --git a/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx b/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx index 0ee434391..5ccc242c7 100644 --- a/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx +++ b/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx @@ -5,6 +5,7 @@ import toast from "react-hot-toast"; import showCreateMemoRelationDialog from "@/components/CreateMemoRelationDialog"; import Icon from "@/components/Icon"; import { UNKNOWN_ID } from "@/helpers/consts"; +import { extractMemoIdFromName } from "@/store/v1"; import { MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service"; import { EditorRefActions } from "../Editor"; import { MemoEditorContext } from "../types"; @@ -45,7 +46,11 @@ const AddMemoRelationButton = (props: Props) => { context.setRelationList( uniqBy( [ - ...memos.map((memo) => ({ memoId: context.memoId || UNKNOWN_ID, relatedMemoId: memo.id, type: MemoRelation_Type.REFERENCE })), + ...memos.map((memo) => ({ + memoId: context.memoId || UNKNOWN_ID, + relatedMemoId: extractMemoIdFromName(memo.name), + type: MemoRelation_Type.REFERENCE, + })), ...context.relationList, ].filter((relation) => relation.relatedMemoId !== (context.memoId || UNKNOWN_ID)), "relatedMemoId", diff --git a/web/src/components/MemoEditor/RelationListView.tsx b/web/src/components/MemoEditor/RelationListView.tsx index 187ce87c2..a37f2d0fd 100644 --- a/web/src/components/MemoEditor/RelationListView.tsx +++ b/web/src/components/MemoEditor/RelationListView.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { useMemoStore } from "@/store/v1"; +import { extractMemoIdFromName, useMemoStore } from "@/store/v1"; import { MemoRelation, MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service"; import { Memo } from "@/types/proto/api/v2/memo_service"; import Icon from "../Icon"; @@ -27,7 +27,7 @@ const RelationListView = (props: Props) => { }, [relationList]); const handleDeleteRelation = async (memo: Memo) => { - setRelationList(relationList.filter((relation) => relation.relatedMemoId !== memo.id)); + setRelationList(relationList.filter((relation) => relation.relatedMemoId !== extractMemoIdFromName(memo.name))); }; return ( diff --git a/web/src/components/MemoEditor/index.tsx b/web/src/components/MemoEditor/index.tsx index ceb305936..b71b1aa10 100644 --- a/web/src/components/MemoEditor/index.tsx +++ b/web/src/components/MemoEditor/index.tsx @@ -8,7 +8,7 @@ import { TAB_SPACE_WIDTH, UNKNOWN_ID } from "@/helpers/consts"; import { isValidUrl } from "@/helpers/utils"; import useCurrentUser from "@/hooks/useCurrentUser"; import { useGlobalStore, useResourceStore, useTagStore } from "@/store/module"; -import { useMemoStore, useUserStore } from "@/store/v1"; +import { MemoNamePrefix, extractMemoIdFromName, useMemoStore, useUserStore } from "@/store/v1"; import { MemoRelation, MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service"; import { Memo, Visibility } from "@/types/proto/api/v2/memo_service"; import { Resource } from "@/types/proto/api/v2/resource_service"; @@ -291,23 +291,24 @@ const MemoEditor = (props: Props) => { if (prevMemo) { const memo = await memoStore.updateMemo( { - id: prevMemo.id, + name: prevMemo.name, content, visibility: state.memoVisibility, }, ["content", "visibility"], ); await memoServiceClient.setMemoResources({ - id: memo.id, + name: memo.name, resources: state.resourceList, }); await memoServiceClient.setMemoRelations({ - id: memo.id, + name: memo.name, relations: state.relationList, }); - await memoStore.getOrFetchMemoById(memo.id, { skipCache: true }); + const memoId = extractMemoIdFromName(memo.name); + await memoStore.getOrFetchMemoById(memoId, { skipCache: true }); if (onConfirm) { - onConfirm(memo.id); + onConfirm(memoId); } } } else { @@ -319,8 +320,8 @@ const MemoEditor = (props: Props) => { }) : memoServiceClient .createMemoComment({ - id: parentMemoId, - create: { + name: `${MemoNamePrefix}${parentMemoId}`, + comment: { content, visibility: state.memoVisibility, }, @@ -328,16 +329,17 @@ const MemoEditor = (props: Props) => { .then(({ memo }) => memo as Memo); const memo = await request; await memoServiceClient.setMemoResources({ - id: memo.id, + name: memo.name, resources: state.resourceList, }); await memoServiceClient.setMemoRelations({ - id: memo.id, + name: memo.name, relations: state.relationList, }); - await memoStore.getOrFetchMemoById(memo.id, { skipCache: true }); + const memoId = extractMemoIdFromName(memo.name); + await memoStore.getOrFetchMemoById(memoId, { skipCache: true }); if (onConfirm) { - onConfirm(memo.id); + onConfirm(memoId); } } editorRef.current?.setContent(""); diff --git a/web/src/components/MemoRelationListView.tsx b/web/src/components/MemoRelationListView.tsx index 1ef77ee16..b2d8badf5 100644 --- a/web/src/components/MemoRelationListView.tsx +++ b/web/src/components/MemoRelationListView.tsx @@ -1,7 +1,7 @@ import { Tooltip } from "@mui/joy"; import { memo, useEffect, useState } from "react"; import { Link } from "react-router-dom"; -import { useMemoStore } from "@/store/v1"; +import { extractMemoIdFromName, useMemoStore } from "@/store/v1"; import { MemoRelation } from "@/types/proto/api/v2/memo_relation_service"; import { Memo } from "@/types/proto/api/v2/memo_service"; import Icon from "./Icon"; @@ -21,13 +21,19 @@ const MemoRelationListView = (props: Props) => { (async () => { const referencingMemoList = await Promise.all( relationList - .filter((relation) => relation.memoId === memo.id && relation.relatedMemoId !== memo.id) + .filter( + (relation) => + relation.memoId === extractMemoIdFromName(memo.name) && relation.relatedMemoId !== extractMemoIdFromName(memo.name), + ) .map((relation) => memoStore.getOrFetchMemoById(relation.relatedMemoId, { skipStore: true })), ); setReferencingMemoList(referencingMemoList); const referencedMemoList = await Promise.all( relationList - .filter((relation) => relation.memoId !== memo.id && relation.relatedMemoId === memo.id) + .filter( + (relation) => + relation.memoId !== extractMemoIdFromName(memo.name) && relation.relatedMemoId === extractMemoIdFromName(memo.name), + ) .map((relation) => memoStore.getOrFetchMemoById(relation.memoId, { skipStore: true })), ); setReferencedMemoList(referencedMemoList); diff --git a/web/src/components/MemoView.tsx b/web/src/components/MemoView.tsx index 8e87886a0..a089907b6 100644 --- a/web/src/components/MemoView.tsx +++ b/web/src/components/MemoView.tsx @@ -4,7 +4,7 @@ import { memo, useCallback, useEffect, useRef, useState } from "react"; import { Link, useLocation } from "react-router-dom"; import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; -import { useUserStore } from "@/store/v1"; +import { extractMemoIdFromName, useUserStore } from "@/store/v1"; import { MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service"; import { Memo, Visibility } from "@/types/proto/api/v2/memo_service"; import { useTranslate } from "@/utils/i18n"; @@ -41,7 +41,7 @@ const MemoView: React.FC = (props: Props) => { const memoContainerRef = useRef(null); const referencedMemos = memo.relations.filter((relation) => relation.type === MemoRelation_Type.REFERENCE); const commentAmount = memo.relations.filter( - (relation) => relation.type === MemoRelation_Type.COMMENT && relation.relatedMemoId === memo.id, + (relation) => relation.type === MemoRelation_Type.COMMENT && relation.relatedMemoId === extractMemoIdFromName(memo.name), ).length; const readonly = memo.creator !== user?.name; const isInMemoDetailPage = location.pathname.startsWith(`/m/${memo.name}`); @@ -56,9 +56,9 @@ const MemoView: React.FC = (props: Props) => { const handleGotoMemoDetailPage = (event: React.MouseEvent) => { if (event.altKey) { - showChangeMemoCreatedTsDialog(memo.id); + showChangeMemoCreatedTsDialog(extractMemoIdFromName(memo.name)); } else { - navigateTo(`/m/${memo.name}`); + navigateTo(`/m/${memo.resourceId}`); } }; @@ -77,7 +77,6 @@ const MemoView: React.FC = (props: Props) => {
= (props: Props) => { "flex flex-row justify-start items-center hover:opacity-70", commentAmount === 0 && "invisible group-hover:visible", )} - to={`/m/${memo.name}#comments`} + to={`/m/${memo.resourceId}#comments`} unstable_viewTransition > @@ -138,8 +137,8 @@ const MemoView: React.FC = (props: Props) => {
{ (reaction) => reaction.reactionType === reactionType && reaction.creator === currentUser.name, ); for (const reaction of reactions) { - await memoServiceClient.deleteMemoReaction({ id: reaction.id }); + await memoServiceClient.deleteMemoReaction({ reactionId: reaction.id }); } } else { await memoServiceClient.upsertMemoReaction({ - id: memo.id, + name: memo.name, reaction: { - contentId: `${MemoNamePrefix}${memo.id}`, + contentId: memo.name, reactionType: reactionType, }, }); } - await memoStore.getOrFetchMemoById(memo.id, { + await memoStore.getOrFetchMemoById(extractMemoIdFromName(memo.name), { skipCache: true, }); } catch (error) { diff --git a/web/src/components/ReactionView.tsx b/web/src/components/ReactionView.tsx index 143d99dde..0c8266d3f 100644 --- a/web/src/components/ReactionView.tsx +++ b/web/src/components/ReactionView.tsx @@ -2,7 +2,7 @@ import { Tooltip } from "@mui/joy"; import classNames from "classnames"; import { memoServiceClient } from "@/grpcweb"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { MemoNamePrefix, useMemoStore } from "@/store/v1"; +import { extractMemoIdFromName, useMemoStore } from "@/store/v1"; import { Memo } from "@/types/proto/api/v2/memo_service"; import { Reaction_Type } from "@/types/proto/api/v2/reaction_service"; import { User } from "@/types/proto/api/v2/user_service"; @@ -74,9 +74,9 @@ const ReactionView = (props: Props) => { try { if (index === -1) { await memoServiceClient.upsertMemoReaction({ - id: memo.id, + name: memo.name, reaction: { - contentId: `${MemoNamePrefix}${memo.id}`, + contentId: memo.name, reactionType, }, }); @@ -85,13 +85,13 @@ const ReactionView = (props: Props) => { (reaction) => reaction.reactionType === reactionType && reaction.creator === currentUser.name, ); for (const reaction of reactions) { - await memoServiceClient.deleteMemoReaction({ id: reaction.id }); + await memoServiceClient.deleteMemoReaction({ reactionId: reaction.id }); } } } catch (error) { // Skip error. } - await memoStore.getOrFetchMemoById(memo.id, { skipCache: true }); + await memoStore.getOrFetchMemoById(extractMemoIdFromName(memo.name), { skipCache: true }); }; return ( diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsx index c513ef08f..9f9012acb 100644 --- a/web/src/components/Settings/MemberSection.tsx +++ b/web/src/components/Settings/MemberSection.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { userServiceClient } from "@/grpcweb"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { UserNamePrefix, stringifyUserRole, useUserStore } from "@/store/v1"; +import { stringifyUserRole, useUserStore } from "@/store/v1"; import { RowStatus } from "@/types/proto/api/v2/common"; import { User, User_Role } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; @@ -78,7 +78,7 @@ const MemberSection = () => { try { await userServiceClient.createUser({ user: { - name: `${UserNamePrefix}${state.creatingUser.username}`, + username: state.creatingUser.username, password: state.creatingUser.password, role: state.creatingUser.role, }, diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index 94eb4d3e8..5c4a3306e 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -7,7 +7,7 @@ import { downloadFileFromUrl } from "@/helpers/utils"; import useCurrentUser from "@/hooks/useCurrentUser"; import useLoading from "@/hooks/useLoading"; import toImage from "@/labs/html2image"; -import { useUserStore, useMemoStore } from "@/store/v1"; +import { useUserStore, useMemoStore, extractMemoIdFromName } from "@/store/v1"; import { Visibility } from "@/types/proto/api/v2/memo_service"; import { useTranslate } from "@/utils/i18n"; import { convertVisibilityToString } from "@/utils/memo"; @@ -85,7 +85,7 @@ const ShareMemoDialog: React.FC = (props: Props) => { const handleMemoVisibilityOptionChanged = async (visibility: Visibility) => { const updatedMemo = await memoStore.updateMemo( { - id: memo.id, + name: memo.name, visibility: visibility, }, ["visibility"], @@ -155,7 +155,7 @@ const ShareMemoDialog: React.FC = (props: Props) => { > {getDateTimeString(memo.displayTime)}
- +
diff --git a/web/src/pages/Archived.tsx b/web/src/pages/Archived.tsx index 9872a0b09..4c2a6d619 100644 --- a/web/src/pages/Archived.tsx +++ b/web/src/pages/Archived.tsx @@ -13,7 +13,7 @@ import { DEFAULT_LIST_MEMOS_PAGE_SIZE } from "@/helpers/consts"; import { getTimeStampByDate } from "@/helpers/datetime"; import useCurrentUser from "@/hooks/useCurrentUser"; import useFilterWithUrlParams from "@/hooks/useFilterWithUrlParams"; -import { useMemoList, useMemoStore } from "@/store/v1"; +import { extractMemoIdFromName, useMemoList, useMemoStore } from "@/store/v1"; import { RowStatus } from "@/types/proto/api/v2/common"; import { Memo } from "@/types/proto/api/v2/memo_service"; import { useTranslate } from "@/utils/i18n"; @@ -65,7 +65,7 @@ const Archived = () => { style: "danger", dialogName: "delete-memo-dialog", onConfirm: async () => { - await memoStore.deleteMemo(memo.id); + await memoStore.deleteMemo(extractMemoIdFromName(memo.name)); }, }); }; @@ -74,7 +74,7 @@ const Archived = () => { try { await memoStore.updateMemo( { - id: memo.id, + name: memo.name, rowStatus: RowStatus.ACTIVE, }, ["row_status"], @@ -99,7 +99,7 @@ const Archived = () => { {sortedMemos.map((memo) => (
@@ -121,7 +121,12 @@ const Archived = () => {
- +
))} {isRequesting ? ( diff --git a/web/src/pages/Explore.tsx b/web/src/pages/Explore.tsx index 57558bf74..fa6d313c8 100644 --- a/web/src/pages/Explore.tsx +++ b/web/src/pages/Explore.tsx @@ -56,7 +56,7 @@ const Explore = () => {
{sortedMemos.map((memo) => ( - + ))} {isRequesting ? (
diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx index 3da432714..c7ad5983a 100644 --- a/web/src/pages/Home.tsx +++ b/web/src/pages/Home.tsx @@ -73,7 +73,7 @@ const Home = () => {
{sortedMemos.map((memo) => ( - + ))} {isRequesting ? (
diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsx index b0a09f0ea..90bd6ea69 100644 --- a/web/src/pages/MemoDetail.tsx +++ b/web/src/pages/MemoDetail.tsx @@ -8,7 +8,7 @@ import MemoView from "@/components/MemoView"; import MobileHeader from "@/components/MobileHeader"; import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; -import { useMemoStore } from "@/store/v1"; +import { extractMemoIdFromName, useMemoStore } from "@/store/v1"; import { MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service"; import { Memo } from "@/types/proto/api/v2/memo_service"; import { useTranslate } from "@/utils/i18n"; @@ -23,13 +23,15 @@ const MemoDetail = () => { const memo = memoStore.getMemoByName(memoName || ""); const [parentMemo, setParentMemo] = useState(undefined); const commentRelations = - memo?.relations.filter((relation) => relation.relatedMemoId === memo?.id && relation.type === MemoRelation_Type.COMMENT) || []; + memo?.relations.filter( + (relation) => relation.relatedMemoId === extractMemoIdFromName(memo.name) && relation.type === MemoRelation_Type.COMMENT, + ) || []; const comments = commentRelations.map((relation) => memoStore.getMemoById(relation.memoId)).filter((memo) => memo) as any as Memo[]; // Prepare memo. useEffect(() => { if (memoName) { - memoStore.getOrFetchMemoByName(memoName).catch((error: ClientError) => { + memoStore.searchMemos(`resource_name == "${memoName}"`).catch((error: ClientError) => { toast.error(error.details); navigateTo("/403"); }); @@ -62,7 +64,7 @@ const MemoDetail = () => { const handleCommentCreated = async (commentId: number) => { await memoStore.getOrFetchMemoById(commentId); - await memoStore.getOrFetchMemoById(memo.id, { skipCache: true }); + await memoStore.getOrFetchMemoById(extractMemoIdFromName(memo.name), { skipCache: true }); }; return ( @@ -82,7 +84,7 @@ const MemoDetail = () => {
)} { ({comments.length})
{comments.map((comment) => ( - + ))} )} {/* Only show comment editor when user login */} {currentUser && ( - + )}
diff --git a/web/src/pages/Resources.tsx b/web/src/pages/Resources.tsx index 36e53e7aa..2b051a901 100644 --- a/web/src/pages/Resources.tsx +++ b/web/src/pages/Resources.tsx @@ -10,7 +10,7 @@ import ResourceIcon from "@/components/ResourceIcon"; import { resourceServiceClient } from "@/grpcweb"; import useLoading from "@/hooks/useLoading"; import i18n from "@/i18n"; -import { useMemoStore } from "@/store/v1"; +import { extractMemoIdFromName, useMemoStore } from "@/store/v1"; import { Resource } from "@/types/proto/api/v2/resource_service"; import { useTranslate } from "@/utils/i18n"; @@ -133,7 +133,7 @@ const Resources = () => { to={`/m/${relatedMemo.name}`} target="_blank" > - #{relatedMemo.id} + #{extractMemoIdFromName(relatedMemo.name)} )} diff --git a/web/src/pages/Timeline.tsx b/web/src/pages/Timeline.tsx index 03c9d4d1d..4d905759a 100644 --- a/web/src/pages/Timeline.tsx +++ b/web/src/pages/Timeline.tsx @@ -164,7 +164,7 @@ const Timeline = () => {
{group.memos.map((memo, index) => (
diff --git a/web/src/pages/UserProfile.tsx b/web/src/pages/UserProfile.tsx index 028d8cecc..8faa91839 100644 --- a/web/src/pages/UserProfile.tsx +++ b/web/src/pages/UserProfile.tsx @@ -132,7 +132,7 @@ const UserProfile = () => {
{sortedMemos.map((memo) => ( - + ))} {isRequesting ? (
diff --git a/web/src/store/v1/memo.ts b/web/src/store/v1/memo.ts index bbbdfad56..274a21244 100644 --- a/web/src/store/v1/memo.ts +++ b/web/src/store/v1/memo.ts @@ -2,6 +2,7 @@ import { create } from "zustand"; import { combine } from "zustand/middleware"; import { memoServiceClient } from "@/grpcweb"; import { CreateMemoRequest, ListMemosRequest, Memo } from "@/types/proto/api/v2/memo_service"; +import { MemoNamePrefix, extractMemoIdFromName } from "."; interface State { memoMapById: Record; @@ -19,7 +20,8 @@ export const useMemoStore = create( const { memos, nextPageToken } = await memoServiceClient.listMemos(request); const memoMap = get().memoMapById; for (const memo of memos) { - memoMap[memo.id] = memo; + const id = extractMemoIdFromName(memo.name); + memoMap[id] = memo; } set({ memoMapById: memoMap }); return { memos, nextPageToken }; @@ -32,7 +34,7 @@ export const useMemoStore = create( } const res = await memoServiceClient.getMemo({ - id, + name: `${MemoNamePrefix}${id}`, }); if (!res.memo) { throw new Error("Memo not found"); @@ -47,27 +49,21 @@ export const useMemoStore = create( getMemoById: (id: number) => { return get().memoMapById[id]; }, - getOrFetchMemoByName: async (name: string) => { - const memoMap = get().memoMapById; - const memo = Object.values(memoMap).find((memo) => memo.name === name); - if (memo) { - return memo; - } - - const res = await memoServiceClient.getMemoByName({ - name, + searchMemos: async (filter: string) => { + const { memos } = await memoServiceClient.searchMemos({ + filter, }); - if (!res.memo) { - throw new Error("Memo not found"); + const memoMap = get().memoMapById; + for (const memo of memos) { + const id = extractMemoIdFromName(memo.name); + memoMap[id] = memo; } - - memoMap[res.memo.id] = res.memo; set({ memoMapById: memoMap }); - return res.memo; + return memos; }, getMemoByName: (name: string) => { const memoMap = get().memoMapById; - return Object.values(memoMap).find((memo) => memo.name === name); + return Object.values(memoMap).find((memo) => memo.resourceId === name); }, createMemo: async (request: CreateMemoRequest) => { const { memo } = await memoServiceClient.createMemo(request); @@ -76,7 +72,8 @@ export const useMemoStore = create( } const memoMap = get().memoMapById; - memoMap[memo.id] = memo; + const id = extractMemoIdFromName(memo.name); + memoMap[id] = memo; set({ memoMapById: memoMap }); return memo; }, @@ -90,13 +87,14 @@ export const useMemoStore = create( } const memoMap = get().memoMapById; - memoMap[memo.id] = memo; + const id = extractMemoIdFromName(memo.name); + memoMap[id] = memo; set({ memoMapById: memoMap }); return memo; }, deleteMemo: async (id: number) => { await memoServiceClient.deleteMemo({ - id: id, + name: `${MemoNamePrefix}${id}`, }); const memoMap = get().memoMapById; diff --git a/web/src/store/v1/resourceName.ts b/web/src/store/v1/resourceName.ts index 4f8813613..9bc468409 100644 --- a/web/src/store/v1/resourceName.ts +++ b/web/src/store/v1/resourceName.ts @@ -1,3 +1,7 @@ export const WorkspaceSettingPrefix = "settings/"; export const UserNamePrefix = "users/"; export const MemoNamePrefix = "memos/"; + +export const extractMemoIdFromName = (name: string) => { + return parseInt(name.split(MemoNamePrefix).pop() || "", 10); +};