Commit edc3f1d9 authored by Steven's avatar Steven

chore: retire unused memo view

parent 14745834
...@@ -203,16 +203,6 @@ message CreateMemoRequest { ...@@ -203,16 +203,6 @@ message CreateMemoRequest {
optional Location location = 5; optional Location location = 5;
} }
enum MemoView {
MEMO_VIEW_UNSPECIFIED = 0;
// The full view of the memo. Includes all fields.
MEMO_VIEW_FULL = 1;
// The metadata only view of the memo. Excludes the content/snippet fields.
MEMO_VIEW_METADATA_ONLY = 2;
}
message ListMemosRequest { message ListMemosRequest {
// The maximum number of memos to return. // The maximum number of memos to return.
int32 page_size = 1; int32 page_size = 1;
...@@ -224,9 +214,6 @@ message ListMemosRequest { ...@@ -224,9 +214,6 @@ message ListMemosRequest {
// Filter is used to filter memos returned in the list. // Filter is used to filter memos returned in the list.
// Format: "creator == 'users/{user}' && visibilities == ['PUBLIC', 'PROTECTED']" // Format: "creator == 'users/{user}' && visibilities == ['PUBLIC', 'PROTECTED']"
string filter = 3; string filter = 3;
// The view of the memo.
MemoView view = 4;
} }
message ListMemosResponse { message ListMemosResponse {
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/activity_service.proto // source: api/v1/activity_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/auth_service.proto // source: api/v1/auth_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/common.proto // source: api/v1/common.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/idp_service.proto // source: api/v1/idp_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/inbox_service.proto // source: api/v1/inbox_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/markdown_service.proto // source: api/v1/markdown_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/memo_relation_service.proto // source: api/v1/memo_relation_service.proto
......
This diff is collapsed.
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/reaction_service.proto // source: api/v1/reaction_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/resource_service.proto // source: api/v1/resource_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/user_service.proto // source: api/v1/user_service.proto
...@@ -692,10 +692,7 @@ func (x *UserStats) GetTagCount() map[string]int32 { ...@@ -692,10 +692,7 @@ func (x *UserStats) GetTagCount() map[string]int32 {
} }
type ListAllUserStatsRequest struct { type ListAllUserStatsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// Filter is used to filter memos to calculate stats.
// Same as `ListMemosRequest.filter`.
Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
...@@ -730,13 +727,6 @@ func (*ListAllUserStatsRequest) Descriptor() ([]byte, []int) { ...@@ -730,13 +727,6 @@ func (*ListAllUserStatsRequest) Descriptor() ([]byte, []int) {
return file_api_v1_user_service_proto_rawDescGZIP(), []int{11} return file_api_v1_user_service_proto_rawDescGZIP(), []int{11}
} }
func (x *ListAllUserStatsRequest) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
type ListAllUserStatsResponse struct { type ListAllUserStatsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
UserStats []*UserStats `protobuf:"bytes,1,rep,name=user_stats,json=userStats,proto3" json:"user_stats,omitempty"` UserStats []*UserStats `protobuf:"bytes,1,rep,name=user_stats,json=userStats,proto3" json:"user_stats,omitempty"`
...@@ -785,10 +775,7 @@ type GetUserStatsRequest struct { ...@@ -785,10 +775,7 @@ type GetUserStatsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// The name of the user. // The name of the user.
// Format: users/{user}. // Format: users/{user}.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Filter is used to filter memos to calculate stats.
// Same as `ListMemosRequest.filter`.
Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
...@@ -830,13 +817,6 @@ func (x *GetUserStatsRequest) GetName() string { ...@@ -830,13 +817,6 @@ func (x *GetUserStatsRequest) GetName() string {
return "" return ""
} }
func (x *GetUserStatsRequest) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
type UserSetting struct { type UserSetting struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// The name of the user. // The name of the user.
...@@ -1465,19 +1445,16 @@ var file_api_v1_user_service_proto_rawDesc = []byte{ ...@@ -1465,19 +1445,16 @@ var file_api_v1_user_service_proto_rawDesc = []byte{
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x64, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x64,
0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x6e, 0x64, 0x6f, 0x5f, 0x63, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x6e, 0x64, 0x6f, 0x5f, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x6e, 0x64, 0x6f, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x6e, 0x64, 0x6f,
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x31, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x19, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c,
0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x22, 0x52, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x53,
0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x52, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0a,
0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x53,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x74, 0x61, 0x74, 0x73, 0x22, 0x29, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53,
0x73, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0x41, 0x0a, 0x13, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65,
0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22,
0x82, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12,
0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20,
......
...@@ -309,19 +309,11 @@ func local_request_UserService_DeleteUser_0(ctx context.Context, marshaler runti ...@@ -309,19 +309,11 @@ func local_request_UserService_DeleteUser_0(ctx context.Context, marshaler runti
return msg, metadata, err return msg, metadata, err
} }
var filter_UserService_ListAllUserStats_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
func request_UserService_ListAllUserStats_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_UserService_ListAllUserStats_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var ( var (
protoReq ListAllUserStatsRequest protoReq ListAllUserStatsRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListAllUserStats_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListAllUserStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.ListAllUserStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
...@@ -331,18 +323,10 @@ func local_request_UserService_ListAllUserStats_0(ctx context.Context, marshaler ...@@ -331,18 +323,10 @@ func local_request_UserService_ListAllUserStats_0(ctx context.Context, marshaler
protoReq ListAllUserStatsRequest protoReq ListAllUserStatsRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ListAllUserStats_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListAllUserStats(ctx, &protoReq) msg, err := server.ListAllUserStats(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
var filter_UserService_GetUserStats_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
func request_UserService_GetUserStats_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_UserService_GetUserStats_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var ( var (
protoReq GetUserStatsRequest protoReq GetUserStatsRequest
...@@ -357,12 +341,6 @@ func request_UserService_GetUserStats_0(ctx context.Context, marshaler runtime.M ...@@ -357,12 +341,6 @@ func request_UserService_GetUserStats_0(ctx context.Context, marshaler runtime.M
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUserStats_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetUserStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.GetUserStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
...@@ -381,12 +359,6 @@ func local_request_UserService_GetUserStats_0(ctx context.Context, marshaler run ...@@ -381,12 +359,6 @@ func local_request_UserService_GetUserStats_0(ctx context.Context, marshaler run
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUserStats_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetUserStats(ctx, &protoReq) msg, err := server.GetUserStats(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/webhook_service.proto // source: api/v1/webhook_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/workspace_service.proto // source: api/v1/workspace_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: api/v1/workspace_setting_service.proto // source: api/v1/workspace_setting_service.proto
......
...@@ -324,20 +324,6 @@ paths: ...@@ -324,20 +324,6 @@ paths:
in: query in: query
required: false required: false
type: string type: string
- name: view
description: |-
The view of the memo.
- MEMO_VIEW_FULL: The full view of the memo. Includes all fields.
- MEMO_VIEW_METADATA_ONLY: The metadata only view of the memo. Excludes the content/snippet fields.
in: query
required: false
type: string
enum:
- MEMO_VIEW_UNSPECIFIED
- MEMO_VIEW_FULL
- MEMO_VIEW_METADATA_ONLY
default: MEMO_VIEW_UNSPECIFIED
tags: tags:
- MemoService - MemoService
post: post:
...@@ -507,14 +493,6 @@ paths: ...@@ -507,14 +493,6 @@ paths:
description: An unexpected error response. description: An unexpected error response.
schema: schema:
$ref: '#/definitions/googlerpcStatus' $ref: '#/definitions/googlerpcStatus'
parameters:
- name: filter
description: |-
Filter is used to filter memos to calculate stats.
Same as `ListMemosRequest.filter`.
in: query
required: false
type: string
tags: tags:
- UserService - UserService
/api/v1/users:search: /api/v1/users:search:
...@@ -1509,13 +1487,6 @@ paths: ...@@ -1509,13 +1487,6 @@ paths:
required: true required: true
type: string type: string
pattern: users/[^/]+ pattern: users/[^/]+
- name: filter
description: |-
Filter is used to filter memos to calculate stats.
Same as `ListMemosRequest.filter`.
in: query
required: false
type: string
tags: tags:
- UserService - UserService
/api/v1/{parent}/tags/{tag}: /api/v1/{parent}/tags/{tag}:
...@@ -2785,16 +2756,6 @@ definitions: ...@@ -2785,16 +2756,6 @@ definitions:
- REFERENCE - REFERENCE
- COMMENT - COMMENT
default: TYPE_UNSPECIFIED default: TYPE_UNSPECIFIED
v1MemoView:
type: string
enum:
- MEMO_VIEW_UNSPECIFIED
- MEMO_VIEW_FULL
- MEMO_VIEW_METADATA_ONLY
default: MEMO_VIEW_UNSPECIFIED
description: |2-
- MEMO_VIEW_FULL: The full view of the memo. Includes all fields.
- MEMO_VIEW_METADATA_ONLY: The metadata only view of the memo. Excludes the content/snippet fields.
v1Node: v1Node:
type: object type: object
properties: properties:
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: store/activity.proto // source: store/activity.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: store/idp.proto // source: store/idp.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: store/inbox.proto // source: store/inbox.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: store/memo.proto // source: store/memo.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: store/resource.proto // source: store/resource.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: store/user_setting.proto // source: store/user_setting.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.2 // protoc-gen-go v1.36.3
// protoc (unknown) // protoc (unknown)
// source: store/workspace_setting.proto // source: store/workspace_setting.proto
......
...@@ -82,7 +82,7 @@ func (s *APIV1Service) CreateMemo(ctx context.Context, request *v1pb.CreateMemoR ...@@ -82,7 +82,7 @@ func (s *APIV1Service) CreateMemo(ctx context.Context, request *v1pb.CreateMemoR
} }
} }
memoMessage, err := s.convertMemoFromStore(ctx, memo, v1pb.MemoView_MEMO_VIEW_FULL) memoMessage, err := s.convertMemoFromStore(ctx, memo)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "failed to convert memo") return nil, errors.Wrap(err, "failed to convert memo")
} }
...@@ -120,9 +120,6 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq ...@@ -120,9 +120,6 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
limitPlusOne := limit + 1 limitPlusOne := limit + 1
memoFind.Limit = &limitPlusOne memoFind.Limit = &limitPlusOne
memoFind.Offset = &offset memoFind.Offset = &offset
if request.View == v1pb.MemoView_MEMO_VIEW_METADATA_ONLY {
memoFind.ExcludeContent = true
}
memos, err := s.Store.ListMemos(ctx, memoFind) memos, err := s.Store.ListMemos(ctx, memoFind)
if err != nil { if err != nil {
return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err) return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err)
...@@ -138,7 +135,7 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq ...@@ -138,7 +135,7 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
} }
} }
for _, memo := range memos { for _, memo := range memos {
memoMessage, err := s.convertMemoFromStore(ctx, memo, request.View) memoMessage, err := s.convertMemoFromStore(ctx, memo)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "failed to convert memo") return nil, errors.Wrap(err, "failed to convert memo")
} }
...@@ -179,7 +176,7 @@ func (s *APIV1Service) GetMemo(ctx context.Context, request *v1pb.GetMemoRequest ...@@ -179,7 +176,7 @@ func (s *APIV1Service) GetMemo(ctx context.Context, request *v1pb.GetMemoRequest
} }
} }
memoMessage, err := s.convertMemoFromStore(ctx, memo, v1pb.MemoView_MEMO_VIEW_FULL) memoMessage, err := s.convertMemoFromStore(ctx, memo)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "failed to convert memo") return nil, errors.Wrap(err, "failed to convert memo")
} }
...@@ -210,7 +207,7 @@ func (s *APIV1Service) GetMemoByUid(ctx context.Context, request *v1pb.GetMemoBy ...@@ -210,7 +207,7 @@ func (s *APIV1Service) GetMemoByUid(ctx context.Context, request *v1pb.GetMemoBy
} }
} }
memoMessage, err := s.convertMemoFromStore(ctx, memo, v1pb.MemoView_MEMO_VIEW_FULL) memoMessage, err := s.convertMemoFromStore(ctx, memo)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "failed to convert memo") return nil, errors.Wrap(err, "failed to convert memo")
} }
...@@ -335,7 +332,7 @@ func (s *APIV1Service) UpdateMemo(ctx context.Context, request *v1pb.UpdateMemoR ...@@ -335,7 +332,7 @@ func (s *APIV1Service) UpdateMemo(ctx context.Context, request *v1pb.UpdateMemoR
if err != nil { if err != nil {
return nil, errors.Wrap(err, "failed to get memo") return nil, errors.Wrap(err, "failed to get memo")
} }
memoMessage, err := s.convertMemoFromStore(ctx, memo, v1pb.MemoView_MEMO_VIEW_FULL) memoMessage, err := s.convertMemoFromStore(ctx, memo)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "failed to convert memo") return nil, errors.Wrap(err, "failed to convert memo")
} }
...@@ -371,7 +368,7 @@ func (s *APIV1Service) DeleteMemo(ctx context.Context, request *v1pb.DeleteMemoR ...@@ -371,7 +368,7 @@ func (s *APIV1Service) DeleteMemo(ctx context.Context, request *v1pb.DeleteMemoR
return nil, status.Errorf(codes.PermissionDenied, "permission denied") return nil, status.Errorf(codes.PermissionDenied, "permission denied")
} }
if memoMessage, err := s.convertMemoFromStore(ctx, memo, v1pb.MemoView_MEMO_VIEW_METADATA_ONLY); err == nil { if memoMessage, err := s.convertMemoFromStore(ctx, memo); err == nil {
// Try to dispatch webhook when memo is deleted. // Try to dispatch webhook when memo is deleted.
if err := s.DispatchMemoDeletedWebhook(ctx, memoMessage); err != nil { if err := s.DispatchMemoDeletedWebhook(ctx, memoMessage); err != nil {
slog.Warn("Failed to dispatch memo deleted webhook", slog.Any("err", err)) slog.Warn("Failed to dispatch memo deleted webhook", slog.Any("err", err))
...@@ -506,7 +503,7 @@ func (s *APIV1Service) ListMemoComments(ctx context.Context, request *v1pb.ListM ...@@ -506,7 +503,7 @@ func (s *APIV1Service) ListMemoComments(ctx context.Context, request *v1pb.ListM
return nil, status.Errorf(codes.Internal, "failed to get memo") return nil, status.Errorf(codes.Internal, "failed to get memo")
} }
if memo != nil { if memo != nil {
memoMessage, err := s.convertMemoFromStore(ctx, memo, v1pb.MemoView_MEMO_VIEW_FULL) memoMessage, err := s.convertMemoFromStore(ctx, memo)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "failed to convert memo") return nil, errors.Wrap(err, "failed to convert memo")
} }
......
...@@ -16,7 +16,7 @@ import ( ...@@ -16,7 +16,7 @@ import (
"github.com/usememos/memos/store" "github.com/usememos/memos/store"
) )
func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Memo, view v1pb.MemoView) (*v1pb.Memo, error) { func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Memo) (*v1pb.Memo, error) {
displayTs := memo.CreatedTs displayTs := memo.CreatedTs
workspaceMemoRelatedSetting, err := s.Store.GetWorkspaceMemoRelatedSetting(ctx) workspaceMemoRelatedSetting, err := s.Store.GetWorkspaceMemoRelatedSetting(ctx)
if err != nil { if err != nil {
...@@ -49,38 +49,35 @@ func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Mem ...@@ -49,38 +49,35 @@ func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Mem
memoMessage.Parent = &parent memoMessage.Parent = &parent
} }
// Fill content when view is MEMO_VIEW_FULL. listMemoRelationsResponse, err := s.ListMemoRelations(ctx, &v1pb.ListMemoRelationsRequest{Name: name})
if view == v1pb.MemoView_MEMO_VIEW_FULL { if err != nil {
listMemoRelationsResponse, err := s.ListMemoRelations(ctx, &v1pb.ListMemoRelationsRequest{Name: name}) return nil, errors.Wrap(err, "failed to list memo relations")
if err != nil { }
return nil, errors.Wrap(err, "failed to list memo relations") memoMessage.Relations = listMemoRelationsResponse.Relations
}
memoMessage.Relations = listMemoRelationsResponse.Relations listMemoResourcesResponse, err := s.ListMemoResources(ctx, &v1pb.ListMemoResourcesRequest{Name: name})
if err != nil {
listMemoResourcesResponse, err := s.ListMemoResources(ctx, &v1pb.ListMemoResourcesRequest{Name: name}) return nil, errors.Wrap(err, "failed to list memo resources")
if err != nil { }
return nil, errors.Wrap(err, "failed to list memo resources") memoMessage.Resources = listMemoResourcesResponse.Resources
}
memoMessage.Resources = listMemoResourcesResponse.Resources listMemoReactionsResponse, err := s.ListMemoReactions(ctx, &v1pb.ListMemoReactionsRequest{Name: name})
if err != nil {
listMemoReactionsResponse, err := s.ListMemoReactions(ctx, &v1pb.ListMemoReactionsRequest{Name: name}) return nil, errors.Wrap(err, "failed to list memo reactions")
if err != nil { }
return nil, errors.Wrap(err, "failed to list memo reactions") memoMessage.Reactions = listMemoReactionsResponse.Reactions
}
memoMessage.Reactions = listMemoReactionsResponse.Reactions nodes, err := parser.Parse(tokenizer.Tokenize(memo.Content))
if err != nil {
nodes, err := parser.Parse(tokenizer.Tokenize(memo.Content)) return nil, errors.Wrap(err, "failed to parse content")
if err != nil { }
return nil, errors.Wrap(err, "failed to parse content") memoMessage.Nodes = convertFromASTNodes(nodes)
}
memoMessage.Nodes = convertFromASTNodes(nodes) snippet, err := getMemoContentSnippet(memo.Content)
if err != nil {
snippet, err := getMemoContentSnippet(memo.Content) return nil, errors.Wrap(err, "failed to get memo content snippet")
if err != nil {
return nil, errors.Wrap(err, "failed to get memo content snippet")
}
memoMessage.Snippet = snippet
} }
memoMessage.Snippet = snippet
return memoMessage, nil return memoMessage, nil
} }
......
...@@ -10,7 +10,7 @@ import { memoServiceClient } from "@/grpcweb"; ...@@ -10,7 +10,7 @@ import { memoServiceClient } from "@/grpcweb";
import { DEFAULT_LIST_MEMOS_PAGE_SIZE } from "@/helpers/consts"; import { DEFAULT_LIST_MEMOS_PAGE_SIZE } from "@/helpers/consts";
import useCurrentUser from "@/hooks/useCurrentUser"; import useCurrentUser from "@/hooks/useCurrentUser";
import { MemoRelation_Memo, MemoRelation_Type } from "@/types/proto/api/v1/memo_relation_service"; import { MemoRelation_Memo, MemoRelation_Type } from "@/types/proto/api/v1/memo_relation_service";
import { Memo, MemoView } from "@/types/proto/api/v1/memo_service"; import { Memo } from "@/types/proto/api/v1/memo_service";
import { useTranslate } from "@/utils/i18n"; import { useTranslate } from "@/utils/i18n";
import { EditorRefActions } from "../Editor"; import { EditorRefActions } from "../Editor";
import { MemoEditorContext } from "../types"; import { MemoEditorContext } from "../types";
...@@ -51,7 +51,6 @@ const AddMemoRelationPopover = (props: Props) => { ...@@ -51,7 +51,6 @@ const AddMemoRelationPopover = (props: Props) => {
const { memos } = await memoServiceClient.listMemos({ const { memos } = await memoServiceClient.listMemos({
pageSize: DEFAULT_LIST_MEMOS_PAGE_SIZE, pageSize: DEFAULT_LIST_MEMOS_PAGE_SIZE,
filter: filters.length > 0 ? filters.join(" && ") : undefined, filter: filters.length > 0 ? filters.join(" && ") : undefined,
view: MemoView.MEMO_VIEW_FULL,
}); });
setFetchedMemos(memos); setFetchedMemos(memos);
} catch (error: any) { } catch (error: any) {
......
...@@ -2,7 +2,7 @@ import { uniqueId } from "lodash-es"; ...@@ -2,7 +2,7 @@ import { uniqueId } from "lodash-es";
import { create } from "zustand"; import { create } from "zustand";
import { combine } from "zustand/middleware"; import { combine } from "zustand/middleware";
import { memoServiceClient } from "@/grpcweb"; import { memoServiceClient } from "@/grpcweb";
import { CreateMemoRequest, ListMemosRequest, Memo, MemoView } from "@/types/proto/api/v1/memo_service"; import { CreateMemoRequest, ListMemosRequest, Memo } from "@/types/proto/api/v1/memo_service";
interface State { interface State {
// stateId is used to identify the store instance state. // stateId is used to identify the store instance state.
...@@ -36,7 +36,6 @@ export const useMemoStore = create( ...@@ -36,7 +36,6 @@ export const useMemoStore = create(
const { memos, nextPageToken } = await memoServiceClient.listMemos( const { memos, nextPageToken } = await memoServiceClient.listMemos(
{ {
...request, ...request,
view: MemoView.MEMO_VIEW_FULL,
}, },
{ signal: controller.signal }, { signal: controller.signal },
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment