Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
9972a77d
Commit
9972a77d
authored
Jun 18, 2025
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: memo service
parent
91c2a4ce
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
2413 additions
and
1012 deletions
+2413
-1012
memo_service.proto
proto/api/v1/memo_service.proto
+331
-94
reaction_service.proto
proto/api/v1/reaction_service.proto
+0
-19
memo_service.pb.go
proto/gen/api/v1/memo_service.pb.go
+817
-380
memo_service.pb.gw.go
proto/gen/api/v1/memo_service.pb.gw.go
+123
-11
reaction_service.pb.go
proto/gen/api/v1/reaction_service.pb.go
+0
-155
apidocs.swagger.yaml
proto/gen/apidocs.swagger.yaml
+344
-116
memo_service.go
server/router/api/v1/memo_service.go
+52
-4
reaction_service.go
server/router/api/v1/reaction_service.go
+13
-2
resource_name.go
server/router/api/v1/resource_name.go
+15
-0
reaction.go
store/reaction.go
+0
-1
index.tsx
web/src/components/MemoEditor/index.tsx
+4
-0
MemoReactionListView.tsx
web/src/components/MemoReactionListView.tsx
+1
-1
PagedMemoList.tsx
web/src/components/PagedMemoList/PagedMemoList.tsx
+4
-4
ReactionSelector.tsx
web/src/components/ReactionSelector.tsx
+1
-1
ReactionView.tsx
web/src/components/ReactionView.tsx
+1
-1
Archived.tsx
web/src/pages/Archived.tsx
+2
-2
Explore.tsx
web/src/pages/Explore.tsx
+2
-2
Home.tsx
web/src/pages/Home.tsx
+2
-2
UserProfile.tsx
web/src/pages/UserProfile.tsx
+2
-2
memo_service.ts
web/src/types/proto/api/v1/memo_service.ts
+699
-93
reaction_service.ts
web/src/types/proto/api/v1/reaction_service.ts
+0
-122
No files found.
proto/api/v1/memo_service.proto
View file @
9972a77d
...
...
@@ -5,10 +5,10 @@ package memos.api.v1;
import
"api/v1/attachment_service.proto"
;
import
"api/v1/common.proto"
;
import
"api/v1/markdown_service.proto"
;
import
"api/v1/reaction_service.proto"
;
import
"google/api/annotations.proto"
;
import
"google/api/client.proto"
;
import
"google/api/field_behavior.proto"
;
import
"google/api/resource.proto"
;
import
"google/protobuf/empty.proto"
;
import
"google/protobuf/field_mask.proto"
;
import
"google/protobuf/timestamp.proto"
;
...
...
@@ -22,6 +22,7 @@ service MemoService {
post
:
"/api/v1/memos"
body
:
"memo"
};
option
(
google.api.method_signature
)
=
"memo"
;
}
// ListMemos lists memos with pagination and filter.
rpc
ListMemos
(
ListMemosRequest
)
returns
(
ListMemosResponse
)
{
...
...
@@ -29,6 +30,8 @@ service MemoService {
get
:
"/api/v1/memos"
additional_bindings
:
{
get
:
"/api/v1/{parent=users/*}/memos"
}
};
option
(
google.api.method_signature
)
=
""
;
option
(
google.api.method_signature
)
=
"parent"
;
}
// GetMemo gets a memo.
rpc
GetMemo
(
GetMemoRequest
)
returns
(
Memo
)
{
...
...
@@ -54,10 +57,12 @@ service MemoService {
patch
:
"/api/v1/{parent=memos/*}/tags:rename"
body
:
"*"
};
option
(
google.api.method_signature
)
=
"parent,old_tag,new_tag"
;
}
// DeleteMemoTag deletes a tag for a memo.
rpc
DeleteMemoTag
(
DeleteMemoTagRequest
)
returns
(
google.protobuf.Empty
)
{
option
(
google.api.http
)
=
{
delete
:
"/api/v1/{parent=memos/*}/tags/{tag}"
};
option
(
google.api.method_signature
)
=
"parent,tag"
;
}
// SetMemoAttachments sets attachments for a memo.
rpc
SetMemoAttachments
(
SetMemoAttachmentsRequest
)
returns
(
google.protobuf.Empty
)
{
...
...
@@ -91,7 +96,7 @@ service MemoService {
post
:
"/api/v1/{name=memos/*}/comments"
body
:
"comment"
};
option
(
google.api.method_signature
)
=
"name"
;
option
(
google.api.method_signature
)
=
"name
,comment
"
;
}
// ListMemoComments lists comments for a memo.
rpc
ListMemoComments
(
ListMemoCommentsRequest
)
returns
(
ListMemoCommentsResponse
)
{
...
...
@@ -113,8 +118,8 @@ service MemoService {
}
// DeleteMemoReaction deletes a reaction for a memo.
rpc
DeleteMemoReaction
(
DeleteMemoReactionRequest
)
returns
(
google.protobuf.Empty
)
{
option
(
google.api.http
)
=
{
delete
:
"/api/v1/
reactions/{id
}"
};
option
(
google.api.method_signature
)
=
"
id
"
;
option
(
google.api.http
)
=
{
delete
:
"/api/v1/
{name=reactions/*
}"
};
option
(
google.api.method_signature
)
=
"
name
"
;
}
}
...
...
@@ -125,56 +130,122 @@ enum Visibility {
PUBLIC
=
3
;
}
message
Memo
{
reserved
2
;
// The name of the memo.
// Format: memos/{memo}, memo is the user defined id or uuid.
message
Reaction
{
option
(
google.api.resource
)
=
{
type
:
"memos.api.v1/Reaction"
pattern
:
"reactions/{reaction}"
name_field
:
"name"
singular
:
"reaction"
plural
:
"reactions"
};
// The resource name of the reaction.
// Format: reactions/{reaction}
string
name
=
1
[
(
google.api.field_behavior
)
=
OUTPUT_ONLY
,
(
google.api.field_behavior
)
=
IDENTIFIER
];
State
state
=
3
;
// Output only. The system generated unique identifier.
string
uid
=
2
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
// The resource name of the creator.
// Format: users/{user}
string
creator
=
3
[
(
google.api.field_behavior
)
=
OUTPUT_ONLY
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/User"
}
];
// The resource name of the content.
// For memo reactions, this should be the memo's resource name.
// Format: memos/{memo}
string
content_id
=
4
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Required. The type of reaction (e.g., "👍", "❤️", "😄").
string
reaction_type
=
5
[(
google.api.field_behavior
)
=
REQUIRED
];
// Output only. The creation timestamp.
google.protobuf.Timestamp
create_time
=
6
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
}
message
Memo
{
option
(
google.api.resource
)
=
{
type
:
"memos.api.v1/Memo"
pattern
:
"memos/{memo}"
name_field
:
"name"
singular
:
"memo"
plural
:
"memos"
};
reserved
2
;
// The resource name of the memo.
// Format: memos/{memo}, memo is the user defined id or uuid.
string
name
=
1
[(
google.api.field_behavior
)
=
IDENTIFIER
];
// The state of the memo.
State
state
=
3
[(
google.api.field_behavior
)
=
REQUIRED
];
// The name of the creator.
// Format: users/{user}
string
creator
=
4
;
string
creator
=
4
[
(
google.api.field_behavior
)
=
OUTPUT_ONLY
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/User"
}
];
google.protobuf.Timestamp
create_time
=
5
;
// Output only. The creation timestamp.
google.protobuf.Timestamp
create_time
=
5
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
google.protobuf.Timestamp
update_time
=
6
;
// Output only. The last update timestamp.
google.protobuf.Timestamp
update_time
=
6
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
google.protobuf.Timestamp
display_time
=
7
;
// The display timestamp of the memo.
google.protobuf.Timestamp
display_time
=
7
[(
google.api.field_behavior
)
=
OPTIONAL
];
string
content
=
8
;
// Required. The content of the memo in Markdown format.
string
content
=
8
[(
google.api.field_behavior
)
=
REQUIRED
];
// Output only. The parsed nodes from the content.
repeated
Node
nodes
=
9
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
Visibility
visibility
=
10
;
// The visibility of the memo.
Visibility
visibility
=
10
[(
google.api.field_behavior
)
=
REQUIRED
];
// Output only. The tags extracted from the content.
repeated
string
tags
=
11
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
bool
pinned
=
12
;
// Whether the memo is pinned.
bool
pinned
=
12
[(
google.api.field_behavior
)
=
OPTIONAL
];
repeated
Attachment
attachments
=
14
;
// Optional. The attachments of the memo.
repeated
Attachment
attachments
=
14
[(
google.api.field_behavior
)
=
OPTIONAL
];
repeated
MemoRelation
relations
=
15
;
// Optional. The relations of the memo.
repeated
MemoRelation
relations
=
15
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Output only. The reactions to the memo.
repeated
Reaction
reactions
=
16
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
// Output only. The computed properties of the memo.
Property
property
=
17
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
// The name of the parent memo.
// Format: memos/{id}
optional
string
parent
=
18
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
// Output only. The name of the parent memo.
// Format: memos/{memo}
optional
string
parent
=
18
[
(
google.api.field_behavior
)
=
OUTPUT_ONLY
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// The snippet of the memo content. Plain text only.
//
Output only.
The snippet of the memo content. Plain text only.
string
snippet
=
19
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
// The location of the memo.
optional
Location
location
=
20
;
//
Optional.
The location of the memo.
optional
Location
location
=
20
[(
google.api.field_behavior
)
=
OPTIONAL
]
;
// Computed properties of a memo.
message
Property
{
bool
has_link
=
1
;
bool
has_task_list
=
2
;
...
...
@@ -184,43 +255,66 @@ message Memo {
}
message
Location
{
string
placeholder
=
1
;
double
latitude
=
2
;
double
longitude
=
3
;
// A placeholder text for the location.
string
placeholder
=
1
[(
google.api.field_behavior
)
=
OPTIONAL
];
// The latitude of the location.
double
latitude
=
2
[(
google.api.field_behavior
)
=
OPTIONAL
];
// The longitude of the location.
double
longitude
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
CreateMemoRequest
{
// The memo to create.
//
Required.
The memo to create.
Memo
memo
=
1
[(
google.api.field_behavior
)
=
REQUIRED
];
// Optional. The memo ID to use for this memo.
// If empty, a unique ID will be generated.
string
memo_id
=
2
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Optional. If set, validate the request but don't actually create the memo.
bool
validate_only
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Optional. An idempotency token.
string
request_id
=
4
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
ListMemosRequest
{
// The parent is the owner of the memos.
//
Optional.
The parent is the owner of the memos.
// If not specified or `users/-`, it will list all memos.
string
parent
=
1
;
// Format: users/{user}
string
parent
=
1
[
(
google.api.field_behavior
)
=
OPTIONAL
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/User"
}
];
// The maximum number of memos to return.
int32
page_size
=
2
;
// Optional. The maximum number of memos to return.
// The service may return fewer than this value.
// If unspecified, at most 50 memos will be returned.
// The maximum value is 1000; values above 1000 will be coerced to 1000.
int32
page_size
=
2
[(
google.api.field_behavior
)
=
OPTIONAL
];
// A page token, received from a previous `ListMemos` call.
//
Optional.
A page token, received from a previous `ListMemos` call.
// Provide this to retrieve the subsequent page.
string
page_token
=
3
;
string
page_token
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
]
;
// The state of the memos to list.
//
Optional.
The state of the memos to list.
// Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
State
state
=
4
;
// What field to sort the results by.
// Default to display_time.
string
sort
=
5
;
State
state
=
4
[(
google.api.field_behavior
)
=
OPTIONAL
];
// The direction to sort the results by.
// Default to DESC.
Direction
direction
=
6
;
// Optional. The order to sort results by.
// Default to "display_time desc".
// Example: "display_time desc" or "create_time asc"
string
order_by
=
5
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Optional. Filter to apply to the list results.
// Filter is a CEL expression to filter memos.
// Refer to `Shortcut.filter`.
string
filter
=
7
;
string
filter
=
6
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Optional. If true, show deleted memos in the response.
bool
show_deleted
=
7
[(
google.api.field_behavior
)
=
OPTIONAL
];
// [Deprecated] Old filter contains some specific conditions to filter memos.
// Format: "creator == 'users/{user}' && visibilities == ['PUBLIC', 'PROTECTED']"
...
...
@@ -228,136 +322,279 @@ message ListMemosRequest {
}
message
ListMemosResponse
{
// The list of memos.
repeated
Memo
memos
=
1
;
// A token
, which
can be sent as `page_token` to retrieve the next page.
// A token
that
can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string
next_page_token
=
2
;
// The total count of memos (may be approximate).
int32
total_size
=
3
;
}
message
GetMemoRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Optional. The fields to return in the response.
// If not specified, all fields are returned.
google.protobuf.FieldMask
read_mask
=
2
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
UpdateMemoRequest
{
// The memo to update.
//
Required.
The memo to update.
// The `name` field is required.
Memo
memo
=
1
[(
google.api.field_behavior
)
=
REQUIRED
];
google.protobuf.FieldMask
update_mask
=
2
;
// Required. The list of fields to update.
google.protobuf.FieldMask
update_mask
=
2
[(
google.api.field_behavior
)
=
REQUIRED
];
// Optional. If set to true, allows updating sensitive fields.
bool
allow_missing
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
DeleteMemoRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo to delete.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Optional. If set to true, the memo will be deleted even if it has associated data.
bool
force
=
2
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
RenameMemoTagRequest
{
// The parent, who owns the tags.
// Format: memos/{id}. Use "memos/-" to rename all tags.
string
parent
=
1
;
string
old_tag
=
2
;
string
new_tag
=
3
;
// Required. The parent, who owns the tags.
// Format: memos/{memo}. Use "memos/-" to rename all tags.
string
parent
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Required. The old tag name to rename.
string
old_tag
=
2
[(
google.api.field_behavior
)
=
REQUIRED
];
// Required. The new tag name.
string
new_tag
=
3
[(
google.api.field_behavior
)
=
REQUIRED
];
}
message
DeleteMemoTagRequest
{
// The parent, who owns the tags.
// Format: memos/{id}. Use "memos/-" to delete all tags.
string
parent
=
1
;
string
tag
=
2
;
bool
delete_related_memos
=
3
;
// Required. The parent, who owns the tags.
// Format: memos/{memo}. Use "memos/-" to delete all tags.
string
parent
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Required. The tag name to delete.
string
tag
=
2
[(
google.api.field_behavior
)
=
REQUIRED
];
// Optional. Whether to delete related memos.
bool
delete_related_memos
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
SetMemoAttachmentsRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
repeated
Attachment
attachments
=
2
;
// Required. The attachments to set for the memo.
repeated
Attachment
attachments
=
2
[(
google.api.field_behavior
)
=
REQUIRED
];
}
message
ListMemoAttachmentsRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Optional. The maximum number of attachments to return.
int32
page_size
=
2
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Optional. A page token for pagination.
string
page_token
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
ListMemoAttachmentsResponse
{
// The list of attachments.
repeated
Attachment
attachments
=
1
;
// A token for the next page of results.
string
next_page_token
=
2
;
// The total count of attachments.
int32
total_size
=
3
;
}
message
MemoRelation
{
Memo
memo
=
1
;
// The memo in the relation.
Memo
memo
=
1
[(
google.api.field_behavior
)
=
REQUIRED
];
Memo
related_memo
=
2
;
// The related memo.
Memo
related_memo
=
2
[(
google.api.field_behavior
)
=
REQUIRED
];
// The type of the relation.
enum
Type
{
TYPE_UNSPECIFIED
=
0
;
REFERENCE
=
1
;
COMMENT
=
2
;
}
Type
type
=
3
;
Type
type
=
3
[(
google.api.field_behavior
)
=
REQUIRED
]
;
// Memo reference in relations.
message
Memo
{
// The name of the memo.
// Format: memos/{id}
string
name
=
1
;
string
uid
=
2
;
// The snippet of the memo content. Plain text only.
// The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Output only. The unique identifier of the memo.
string
uid
=
2
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
// Output only. The snippet of the memo content. Plain text only.
string
snippet
=
3
[(
google.api.field_behavior
)
=
OUTPUT_ONLY
];
}
}
message
SetMemoRelationsRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
repeated
MemoRelation
relations
=
2
;
// Required. The relations to set for the memo.
repeated
MemoRelation
relations
=
2
[(
google.api.field_behavior
)
=
REQUIRED
];
}
message
ListMemoRelationsRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Optional. The maximum number of relations to return.
int32
page_size
=
2
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Optional. A page token for pagination.
string
page_token
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
ListMemoRelationsResponse
{
// The list of relations.
repeated
MemoRelation
relations
=
1
;
// A token for the next page of results.
string
next_page_token
=
2
;
// The total count of relations.
int32
total_size
=
3
;
}
message
CreateMemoCommentRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// The comment to create.
Memo
comment
=
2
;
// Required. The comment to create.
Memo
comment
=
2
[(
google.api.field_behavior
)
=
REQUIRED
];
// Optional. The comment ID to use.
string
comment_id
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
ListMemoCommentsRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Optional. The maximum number of comments to return.
int32
page_size
=
2
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Optional. A page token for pagination.
string
page_token
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Optional. The order to sort results by.
string
order_by
=
4
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
ListMemoCommentsResponse
{
// The list of comment memos.
repeated
Memo
memos
=
1
;
// A token for the next page of results.
string
next_page_token
=
2
;
// The total count of comments.
int32
total_size
=
3
;
}
message
ListMemoReactionsRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
// Optional. The maximum number of reactions to return.
int32
page_size
=
2
[(
google.api.field_behavior
)
=
OPTIONAL
];
// Optional. A page token for pagination.
string
page_token
=
3
[(
google.api.field_behavior
)
=
OPTIONAL
];
}
message
ListMemoReactionsResponse
{
// The list of reactions.
repeated
Reaction
reactions
=
1
;
// A token for the next page of results.
string
next_page_token
=
2
;
// The total count of reactions.
int32
total_size
=
3
;
}
message
UpsertMemoReactionRequest
{
// The name of the memo.
string
name
=
1
;
// Required. The resource name of the memo.
// Format: memos/{memo}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Memo"
}
];
Reaction
reaction
=
2
;
// Required. The reaction to upsert.
Reaction
reaction
=
2
[(
google.api.field_behavior
)
=
REQUIRED
];
}
message
DeleteMemoReactionRequest
{
// The id of the reaction.
// Refer to the `Reaction.id`.
int32
id
=
1
;
// Required. The resource name of the reaction to delete.
// Format: reactions/{reaction}
string
name
=
1
[
(
google.api.field_behavior
)
=
REQUIRED
,
(
google.api.resource_reference
)
=
{
type
:
"memos.api.v1/Reaction"
}
];
}
proto/api/v1/reaction_service.proto
deleted
100644 → 0
View file @
91c2a4ce
syntax
=
"proto3"
;
package
memos
.
api.v1
;
option
go_package
=
"gen/api/v1"
;
message
Reaction
{
int32
id
=
1
;
// The name of the creator.
// Format: users/{user}
string
creator
=
2
;
// The content identifier.
// For memo, it should be the `Memo.name`.
string
content_id
=
3
;
string
reaction_type
=
4
;
}
proto/gen/api/v1/memo_service.pb.go
View file @
9972a77d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
proto/gen/api/v1/memo_service.pb.gw.go
View file @
9972a77d
...
...
@@ -35,6 +35,8 @@ var (
_
=
metadata
.
Join
)
var
filter_MemoService_CreateMemo_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"memo"
:
0
},
Base
:
[]
int
{
1
,
1
,
0
},
Check
:
[]
int
{
0
,
1
,
2
}}
func
request_MemoService_CreateMemo_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
MemoServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
(
protoReq
CreateMemoRequest
...
...
@@ -43,6 +45,12 @@ func request_MemoService_CreateMemo_0(ctx context.Context, marshaler runtime.Mar
if
err
:=
marshaler
.
NewDecoder
(
req
.
Body
)
.
Decode
(
&
protoReq
.
Memo
);
err
!=
nil
&&
!
errors
.
Is
(
err
,
io
.
EOF
)
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
if
err
:=
req
.
ParseForm
();
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
if
err
:=
runtime
.
PopulateQueryParameters
(
&
protoReq
,
req
.
Form
,
filter_MemoService_CreateMemo_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
client
.
CreateMemo
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
...
...
@@ -55,6 +63,12 @@ func local_request_MemoService_CreateMemo_0(ctx context.Context, marshaler runti
if
err
:=
marshaler
.
NewDecoder
(
req
.
Body
)
.
Decode
(
&
protoReq
.
Memo
);
err
!=
nil
&&
!
errors
.
Is
(
err
,
io
.
EOF
)
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
if
err
:=
req
.
ParseForm
();
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
if
err
:=
runtime
.
PopulateQueryParameters
(
&
protoReq
,
req
.
Form
,
filter_MemoService_CreateMemo_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
CreateMemo
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
...
...
@@ -143,6 +157,8 @@ func local_request_MemoService_ListMemos_1(ctx context.Context, marshaler runtim
return
msg
,
metadata
,
err
}
var
filter_MemoService_GetMemo_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"name"
:
0
},
Base
:
[]
int
{
1
,
1
,
0
},
Check
:
[]
int
{
0
,
1
,
2
}}
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
...
...
@@ -158,6 +174,12 @@ func request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marsha
if
err
!=
nil
{
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_MemoService_GetMemo_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
))
return
msg
,
metadata
,
err
}
...
...
@@ -176,6 +198,12 @@ func local_request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.
if
err
!=
nil
{
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_MemoService_GetMemo_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
GetMemo
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
...
...
@@ -258,6 +286,8 @@ func local_request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runti
return
msg
,
metadata
,
err
}
var
filter_MemoService_DeleteMemo_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"name"
:
0
},
Base
:
[]
int
{
1
,
1
,
0
},
Check
:
[]
int
{
0
,
1
,
2
}}
func
request_MemoService_DeleteMemo_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
MemoServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
(
protoReq
DeleteMemoRequest
...
...
@@ -273,6 +303,12 @@ func request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runtime.Mar
if
err
!=
nil
{
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_MemoService_DeleteMemo_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
client
.
DeleteMemo
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
...
...
@@ -291,6 +327,12 @@ func local_request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runti
if
err
!=
nil
{
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_MemoService_DeleteMemo_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
DeleteMemo
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
...
...
@@ -446,6 +488,8 @@ func local_request_MemoService_SetMemoAttachments_0(ctx context.Context, marshal
return
msg
,
metadata
,
err
}
var
filter_MemoService_ListMemoAttachments_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"name"
:
0
},
Base
:
[]
int
{
1
,
1
,
0
},
Check
:
[]
int
{
0
,
1
,
2
}}
func
request_MemoService_ListMemoAttachments_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
MemoServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
(
protoReq
ListMemoAttachmentsRequest
...
...
@@ -461,6 +505,12 @@ func request_MemoService_ListMemoAttachments_0(ctx context.Context, marshaler ru
if
err
!=
nil
{
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_MemoService_ListMemoAttachments_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
client
.
ListMemoAttachments
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
...
...
@@ -479,6 +529,12 @@ func local_request_MemoService_ListMemoAttachments_0(ctx context.Context, marsha
if
err
!=
nil
{
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_MemoService_ListMemoAttachments_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
ListMemoAttachments
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
...
...
@@ -525,6 +581,8 @@ func local_request_MemoService_SetMemoRelations_0(ctx context.Context, marshaler
return
msg
,
metadata
,
err
}
var
filter_MemoService_ListMemoRelations_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"name"
:
0
},
Base
:
[]
int
{
1
,
1
,
0
},
Check
:
[]
int
{
0
,
1
,
2
}}
func
request_MemoService_ListMemoRelations_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
MemoServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
(
protoReq
ListMemoRelationsRequest
...
...
@@ -540,6 +598,12 @@ func request_MemoService_ListMemoRelations_0(ctx context.Context, marshaler runt
if
err
!=
nil
{
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_MemoService_ListMemoRelations_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
client
.
ListMemoRelations
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
...
...
@@ -558,10 +622,18 @@ func local_request_MemoService_ListMemoRelations_0(ctx context.Context, marshale
if
err
!=
nil
{
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_MemoService_ListMemoRelations_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
ListMemoRelations
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
var
filter_MemoService_CreateMemoComment_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"comment"
:
0
,
"name"
:
1
},
Base
:
[]
int
{
1
,
1
,
2
,
0
,
0
},
Check
:
[]
int
{
0
,
1
,
1
,
2
,
3
}}
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
)
{
var
(
protoReq
CreateMemoCommentRequest
...
...
@@ -579,6 +651,12 @@ func request_MemoService_CreateMemoComment_0(ctx context.Context, marshaler runt
if
err
!=
nil
{
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_MemoService_CreateMemoComment_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
client
.
CreateMemoComment
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
...
...
@@ -600,10 +678,18 @@ func local_request_MemoService_CreateMemoComment_0(ctx context.Context, marshale
if
err
!=
nil
{
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_MemoService_CreateMemoComment_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
CreateMemoComment
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
var
filter_MemoService_ListMemoComments_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"name"
:
0
},
Base
:
[]
int
{
1
,
1
,
0
},
Check
:
[]
int
{
0
,
1
,
2
}}
func
request_MemoService_ListMemoComments_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
MemoServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
(
protoReq
ListMemoCommentsRequest
...
...
@@ -619,6 +705,12 @@ func request_MemoService_ListMemoComments_0(ctx context.Context, marshaler runti
if
err
!=
nil
{
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_MemoService_ListMemoComments_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
client
.
ListMemoComments
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
...
...
@@ -637,10 +729,18 @@ func local_request_MemoService_ListMemoComments_0(ctx context.Context, marshaler
if
err
!=
nil
{
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_MemoService_ListMemoComments_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
ListMemoComments
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
var
filter_MemoService_ListMemoReactions_0
=
&
utilities
.
DoubleArray
{
Encoding
:
map
[
string
]
int
{
"name"
:
0
},
Base
:
[]
int
{
1
,
1
,
0
},
Check
:
[]
int
{
0
,
1
,
2
}}
func
request_MemoService_ListMemoReactions_0
(
ctx
context
.
Context
,
marshaler
runtime
.
Marshaler
,
client
MemoServiceClient
,
req
*
http
.
Request
,
pathParams
map
[
string
]
string
)
(
proto
.
Message
,
runtime
.
ServerMetadata
,
error
)
{
var
(
protoReq
ListMemoReactionsRequest
...
...
@@ -656,6 +756,12 @@ func request_MemoService_ListMemoReactions_0(ctx context.Context, marshaler runt
if
err
!=
nil
{
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_MemoService_ListMemoReactions_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
client
.
ListMemoReactions
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
}
...
...
@@ -674,6 +780,12 @@ func local_request_MemoService_ListMemoReactions_0(ctx context.Context, marshale
if
err
!=
nil
{
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_MemoService_ListMemoReactions_0
);
err
!=
nil
{
return
nil
,
metadata
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"%v"
,
err
)
}
msg
,
err
:=
server
.
ListMemoReactions
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
}
...
...
@@ -727,13 +839,13 @@ func request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshaler run
err
error
)
io
.
Copy
(
io
.
Discard
,
req
.
Body
)
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
.
DeleteMemoReaction
(
ctx
,
&
protoReq
,
grpc
.
Header
(
&
metadata
.
HeaderMD
),
grpc
.
Trailer
(
&
metadata
.
TrailerMD
))
return
msg
,
metadata
,
err
...
...
@@ -745,13 +857,13 @@ func local_request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshal
metadata
runtime
.
ServerMetadata
err
error
)
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
.
DeleteMemoReaction
(
ctx
,
&
protoReq
)
return
msg
,
metadata
,
err
...
...
@@ -1089,7 +1201,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
var
stream
runtime
.
ServerTransportStream
ctx
=
grpc
.
NewContextWithServerTransportStream
(
ctx
,
&
stream
)
inboundMarshaler
,
outboundMarshaler
:=
runtime
.
MarshalerForRequest
(
mux
,
req
)
annotatedContext
,
err
:=
runtime
.
AnnotateIncomingContext
(
ctx
,
mux
,
req
,
"/memos.api.v1.MemoService/DeleteMemoReaction"
,
runtime
.
WithHTTPPathPattern
(
"/api/v1/
reactions/{id
}"
))
annotatedContext
,
err
:=
runtime
.
AnnotateIncomingContext
(
ctx
,
mux
,
req
,
"/memos.api.v1.MemoService/DeleteMemoReaction"
,
runtime
.
WithHTTPPathPattern
(
"/api/v1/
{name=reactions/*
}"
))
if
err
!=
nil
{
runtime
.
HTTPError
(
ctx
,
mux
,
outboundMarshaler
,
w
,
req
,
err
)
return
...
...
@@ -1419,7 +1531,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
ctx
,
cancel
:=
context
.
WithCancel
(
req
.
Context
())
defer
cancel
()
inboundMarshaler
,
outboundMarshaler
:=
runtime
.
MarshalerForRequest
(
mux
,
req
)
annotatedContext
,
err
:=
runtime
.
AnnotateContext
(
ctx
,
mux
,
req
,
"/memos.api.v1.MemoService/DeleteMemoReaction"
,
runtime
.
WithHTTPPathPattern
(
"/api/v1/
reactions/{id
}"
))
annotatedContext
,
err
:=
runtime
.
AnnotateContext
(
ctx
,
mux
,
req
,
"/memos.api.v1.MemoService/DeleteMemoReaction"
,
runtime
.
WithHTTPPathPattern
(
"/api/v1/
{name=reactions/*
}"
))
if
err
!=
nil
{
runtime
.
HTTPError
(
ctx
,
mux
,
outboundMarshaler
,
w
,
req
,
err
)
return
...
...
@@ -1452,7 +1564,7 @@ var (
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"
,
"v1"
,
"memos"
,
"name"
,
"comments"
},
""
))
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"
,
"v1"
,
"memos"
,
"name"
,
"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"
,
"v1"
,
"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
},
[]
string
{
"api"
,
"v1"
,
"reactions"
,
"id
"
},
""
))
pattern_MemoService_DeleteMemoReaction_0
=
runtime
.
MustPattern
(
runtime
.
NewPattern
(
1
,
[]
int
{
2
,
0
,
2
,
1
,
2
,
2
,
1
,
0
,
4
,
2
,
5
,
3
},
[]
string
{
"api"
,
"v1"
,
"reactions"
,
"name
"
},
""
))
)
var
(
...
...
proto/gen/api/v1/reaction_service.pb.go
deleted
100644 → 0
View file @
91c2a4ce
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: api/v1/reaction_service.proto
package
apiv1
import
(
protoreflect
"google.golang.org/protobuf/reflect/protoreflect"
protoimpl
"google.golang.org/protobuf/runtime/protoimpl"
reflect
"reflect"
sync
"sync"
unsafe
"unsafe"
)
const
(
// Verify that this generated code is sufficiently up-to-date.
_
=
protoimpl
.
EnforceVersion
(
20
-
protoimpl
.
MinVersion
)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_
=
protoimpl
.
EnforceVersion
(
protoimpl
.
MaxVersion
-
20
)
)
type
Reaction
struct
{
state
protoimpl
.
MessageState
`protogen:"open.v1"`
Id
int32
`protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// The name of the creator.
// Format: users/{user}
Creator
string
`protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"`
// The content identifier.
// For memo, it should be the `Memo.name`.
ContentId
string
`protobuf:"bytes,3,opt,name=content_id,json=contentId,proto3" json:"content_id,omitempty"`
ReactionType
string
`protobuf:"bytes,4,opt,name=reaction_type,json=reactionType,proto3" json:"reaction_type,omitempty"`
unknownFields
protoimpl
.
UnknownFields
sizeCache
protoimpl
.
SizeCache
}
func
(
x
*
Reaction
)
Reset
()
{
*
x
=
Reaction
{}
mi
:=
&
file_api_v1_reaction_service_proto_msgTypes
[
0
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
}
func
(
x
*
Reaction
)
String
()
string
{
return
protoimpl
.
X
.
MessageStringOf
(
x
)
}
func
(
*
Reaction
)
ProtoMessage
()
{}
func
(
x
*
Reaction
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_api_v1_reaction_service_proto_msgTypes
[
0
]
if
x
!=
nil
{
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
if
ms
.
LoadMessageInfo
()
==
nil
{
ms
.
StoreMessageInfo
(
mi
)
}
return
ms
}
return
mi
.
MessageOf
(
x
)
}
// Deprecated: Use Reaction.ProtoReflect.Descriptor instead.
func
(
*
Reaction
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_api_v1_reaction_service_proto_rawDescGZIP
(),
[]
int
{
0
}
}
func
(
x
*
Reaction
)
GetId
()
int32
{
if
x
!=
nil
{
return
x
.
Id
}
return
0
}
func
(
x
*
Reaction
)
GetCreator
()
string
{
if
x
!=
nil
{
return
x
.
Creator
}
return
""
}
func
(
x
*
Reaction
)
GetContentId
()
string
{
if
x
!=
nil
{
return
x
.
ContentId
}
return
""
}
func
(
x
*
Reaction
)
GetReactionType
()
string
{
if
x
!=
nil
{
return
x
.
ReactionType
}
return
""
}
var
File_api_v1_reaction_service_proto
protoreflect
.
FileDescriptor
const
file_api_v1_reaction_service_proto_rawDesc
=
""
+
"
\n
"
+
"
\x1d
api/v1/reaction_service.proto
\x12\f
memos.api.v1
\"
x
\n
"
+
"
\b
Reaction
\x12\x0e\n
"
+
"
\x02
id
\x18\x01
\x01
(
\x05
R
\x02
id
\x12\x18\n
"
+
"
\a
creator
\x18\x02
\x01
(
\t
R
\a
creator
\x12\x1d\n
"
+
"
\n
"
+
"content_id
\x18\x03
\x01
(
\t
R
\t
contentId
\x12
#
\n
"
+
"
\r
reaction_type
\x18\x04
\x01
(
\t
R
\f
reactionTypeB
\xac\x01\n
"
+
"
\x10
com.memos.api.v1B
\x14
ReactionServiceProtoP
\x01
Z0github.com/usememos/memos/proto/gen/api/v1;apiv1
\xa2\x02\x03
MAX
\xaa\x02\f
Memos.Api.V1
\xca\x02\f
Memos
\\
Api
\\
V1
\xe2\x02\x18
Memos
\\
Api
\\
V1
\\
GPBMetadata
\xea\x02\x0e
Memos::Api::V1b
\x06
proto3"
var
(
file_api_v1_reaction_service_proto_rawDescOnce
sync
.
Once
file_api_v1_reaction_service_proto_rawDescData
[]
byte
)
func
file_api_v1_reaction_service_proto_rawDescGZIP
()
[]
byte
{
file_api_v1_reaction_service_proto_rawDescOnce
.
Do
(
func
()
{
file_api_v1_reaction_service_proto_rawDescData
=
protoimpl
.
X
.
CompressGZIP
(
unsafe
.
Slice
(
unsafe
.
StringData
(
file_api_v1_reaction_service_proto_rawDesc
),
len
(
file_api_v1_reaction_service_proto_rawDesc
)))
})
return
file_api_v1_reaction_service_proto_rawDescData
}
var
file_api_v1_reaction_service_proto_msgTypes
=
make
([]
protoimpl
.
MessageInfo
,
1
)
var
file_api_v1_reaction_service_proto_goTypes
=
[]
any
{
(
*
Reaction
)(
nil
),
// 0: memos.api.v1.Reaction
}
var
file_api_v1_reaction_service_proto_depIdxs
=
[]
int32
{
0
,
// [0:0] is the sub-list for method output_type
0
,
// [0:0] is the sub-list for method input_type
0
,
// [0:0] is the sub-list for extension type_name
0
,
// [0:0] is the sub-list for extension extendee
0
,
// [0:0] is the sub-list for field type_name
}
func
init
()
{
file_api_v1_reaction_service_proto_init
()
}
func
file_api_v1_reaction_service_proto_init
()
{
if
File_api_v1_reaction_service_proto
!=
nil
{
return
}
type
x
struct
{}
out
:=
protoimpl
.
TypeBuilder
{
File
:
protoimpl
.
DescBuilder
{
GoPackagePath
:
reflect
.
TypeOf
(
x
{})
.
PkgPath
(),
RawDescriptor
:
unsafe
.
Slice
(
unsafe
.
StringData
(
file_api_v1_reaction_service_proto_rawDesc
),
len
(
file_api_v1_reaction_service_proto_rawDesc
)),
NumEnums
:
0
,
NumMessages
:
1
,
NumExtensions
:
0
,
NumServices
:
0
,
},
GoTypes
:
file_api_v1_reaction_service_proto_goTypes
,
DependencyIndexes
:
file_api_v1_reaction_service_proto_depIdxs
,
MessageInfos
:
file_api_v1_reaction_service_proto_msgTypes
,
}
.
Build
()
File_api_v1_reaction_service_proto
=
out
.
File
file_api_v1_reaction_service_proto_goTypes
=
nil
file_api_v1_reaction_service_proto_depIdxs
=
nil
}
proto/gen/apidocs.swagger.yaml
View file @
9972a77d
...
...
@@ -391,27 +391,32 @@ paths:
parameters
:
-
name
:
parent
description
:
|-
The parent is the owner of the memos.
Optional.
The parent is the owner of the memos.
If not specified or `users/-`, it will list all memos.
Format: users/{user}
in: query
required: false
type: string
-
name
:
pageSize
description
:
The maximum number of memos to return.
description
:
|-
Optional. The maximum number of memos to return.
The service may return fewer than this value.
If unspecified, at most 50 memos will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
in: query
required: false
type: integer
format: int32
-
name
:
pageToken
description
:
|-
A page token, received from a previous `ListMemos` call.
Optional.
A page token, received from a previous `ListMemos` call.
Provide this to retrieve the subsequent page.
in: query
required: false
type: string
-
name
:
state
description
:
|-
The state of the memos to list.
Optional.
The state of the memos to list.
Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
in: query
required: false
...
...
@@ -421,32 +426,27 @@ paths:
- NORMAL
- ARCHIVED
default: STATE_UNSPECIFIED
-
name
:
sort
description
:
|-
What field to sort the results by.
Default to display_time.
in: query
required: false
type: string
-
name
:
direction
-
name
:
orderBy
description
:
|-
The direction to sort the results by.
Default to DESC.
Optional. The order to sort results by.
Default to "display_time desc".
Example: "display_time desc" or "create_time asc"
in: query
required: false
type: string
enum:
- DIRECTION_UNSPECIFIED
- ASC
- DESC
default: DIRECTION_UNSPECIFIED
-
name
:
filter
description
:
|-
Optional. Filter to apply to the list results.
Filter is a CEL expression to filter memos.
Refer to `Shortcut.filter`.
in: query
required: false
type: string
-
name
:
showDeleted
description
:
Optional. If
true
, show deleted memos in the response.
in
:
query
required
:
false
type
:
boolean
-
name
:
oldFilter
description
:
|-
[Deprecated] Old filter contains some specific conditions to filter memos.
...
...
@@ -470,38 +470,30 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
memo
description
:
The memo to create.
description
:
Required.
The memo to create.
in
:
body
required
:
true
schema
:
$ref
:
'
#/definitions/apiv1Memo'
required
:
-
memo
tags
:
-
MemoService
/api/v1/reactions/{id}
:
delete
:
summary
:
DeleteMemoReaction deletes a reaction for a memo.
operationId
:
MemoService_DeleteMemoReaction
responses
:
"
200"
:
description
:
A successful response.
schema
:
type
:
object
properties
:
{}
default
:
description
:
An unexpected error response.
schema
:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
id
-
name
:
memoId
description
:
|-
The id of the reaction.
Refer to the `Reaction.id`.
in: path
required: true
type: integer
format: int32
Optional. The memo ID to use for this memo.
If empty, a unique ID will be generated.
in: query
required: false
type: string
-
name
:
validateOnly
description
:
Optional. If set, validate the request but don't actually create the memo.
in
:
query
required
:
false
type
:
boolean
-
name
:
requestId
description
:
Optional. An idempotency token.
in
:
query
required
:
false
type
:
string
tags
:
-
MemoService
/api/v1/users
:
...
...
@@ -972,7 +964,7 @@ paths:
parameters
:
-
name
:
memo.name
description
:
|-
The name of the memo.
The
resource
name of the memo.
Format: memos/{memo}, memo is the user defined id or uuid.
in: path
required: true
...
...
@@ -980,7 +972,7 @@ paths:
pattern: memos/[^/]+
-
name
:
memo
description
:
|-
The memo to update.
Required.
The memo to update.
The `name` field is required.
in: body
required: true
...
...
@@ -989,74 +981,98 @@ paths:
properties:
state:
$ref: '#/definitions/v1State'
description: The state of the memo.
creator:
type: string
title: |-
The name of the creator.
Format: users/{user}
readOnly: true
createTime:
type: string
format: date-time
description: Output only. The creation timestamp.
readOnly: true
updateTime:
type: string
format: date-time
description: Output only. The last update timestamp.
readOnly: true
displayTime:
type: string
format: date-time
description: The display timestamp of the memo.
content:
type: string
description: Required. The content of the memo in Markdown format.
nodes:
type: array
items:
type: object
$ref: '#/definitions/v1Node'
description: Output only. The parsed nodes from the content.
readOnly: true
visibility:
$ref: '#/definitions/v1Visibility'
description: The visibility of the memo.
tags:
type: array
items:
type: string
description: Output only. The tags extracted from the content.
readOnly: true
pinned:
type: boolean
description: Whether the memo is pinned.
attachments:
type: array
items:
type: object
$ref: '#/definitions/v1Attachment'
description: Optional. The attachments of the memo.
relations:
type: array
items:
type: object
$ref: '#/definitions/v1MemoRelation'
description: Optional. The relations of the memo.
reactions:
type: array
items:
type: object
$ref: '#/definitions/v1Reaction'
description: Output only. The reactions to the memo.
readOnly: true
property:
$ref: '#/definitions/v1MemoProperty'
description: Output only. The computed properties of the memo.
readOnly: true
parent:
type: string
title: |-
The name of the parent memo.
Format: memos/{
id
}
Output only.
The name of the parent memo.
Format: memos/{
memo
}
readOnly: true
snippet:
type: string
description: The snippet of the memo content. Plain text only.
description:
Output only.
The snippet of the memo content. Plain text only.
readOnly: true
location:
$ref: '#/definitions/apiv1Location'
description: The location of the memo.
description:
Optional.
The location of the memo.
title: |-
The memo to update.
Required.
The memo to update.
The `name` field is required.
required:
- state
- content
- visibility
- memo
-
name
:
allowMissing
description
:
Optional. If set to
true
, allows updating sensitive fields.
in
:
query
required
:
false
type
:
boolean
tags
:
-
MemoService
/api/v1/{name_1}
:
...
...
@@ -1230,11 +1246,20 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name_4
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo.
Format: memos/{memo}
in: path
required: true
type: string
pattern: memos/[^/]+
-
name
:
readMask
description
:
|-
Optional. The fields to return in the response.
If not specified, all fields are returned.
in: query
required: false
type: string
tags
:
-
MemoService
delete
:
...
...
@@ -1300,11 +1325,18 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name_5
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo to delete.
Format: memos/{memo}
in: path
required: true
type: string
pattern: memos/[^/]+
-
name
:
force
description
:
Optional. If set to
true
, the memo will be deleted even if it has associated data.
in
:
query
required
:
false
type
:
boolean
tags
:
-
MemoService
/api/v1/{name_6}
:
...
...
@@ -1339,8 +1371,8 @@ paths:
tags
:
-
WebhookService
delete
:
summary
:
Delete
Shortcut deletes a shortcut for a user
.
operationId
:
ShortcutService_DeleteShortcut
summary
:
Delete
MemoReaction deletes a reaction for a memo
.
operationId
:
MemoService_DeleteMemoReaction
responses
:
"
200"
:
description
:
A successful response.
...
...
@@ -1354,14 +1386,14 @@ paths:
parameters
:
-
name
:
name_6
description
:
|-
Required. The resource name of the
shortcut
to delete.
Format:
users/{user}/shortcuts/{shortcut
}
Required. The resource name of the
reaction
to delete.
Format:
reactions/{reaction
}
in: path
required: true
type: string
pattern:
users/[^/]+/shortcut
s/[^/]+
pattern:
reaction
s/[^/]+
tags
:
-
Shortcut
Service
-
Memo
Service
/api/v1/{name_7}
:
get
:
summary
:
Gets a workspace setting.
...
...
@@ -1386,6 +1418,31 @@ paths:
pattern: workspace/settings/[^/]+
tags
:
-
WorkspaceService
delete
:
summary
:
DeleteShortcut deletes a shortcut for a user.
operationId
:
ShortcutService_DeleteShortcut
responses
:
"
200"
:
description
:
A successful response.
schema
:
type
:
object
properties
:
{}
default
:
description
:
An unexpected error response.
schema
:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name_7
description
:
|-
Required. The resource name of the shortcut to delete.
Format: users/{user}/shortcuts/{shortcut}
in: path
required: true
type: string
pattern: users/[^/]+/shortcuts/[^/]+
tags
:
-
ShortcutService
/api/v1/{name_8}
:
delete
:
summary
:
DeleteWebhook deletes a webhook.
operationId
:
WebhookService_DeleteWebhook
...
...
@@ -1400,7 +1457,7 @@ paths:
schema
:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name_
7
-
name
:
name_
8
description
:
|-
Required. The resource name of the webhook to delete.
Format: webhooks/{webhook}
...
...
@@ -1478,11 +1535,24 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo.
Format: memos/{memo}
in: path
required: true
type: string
pattern: memos/[^/]+
-
name
:
pageSize
description
:
Optional. The maximum number of attachments to return.
in
:
query
required
:
false
type
:
integer
format
:
int32
-
name
:
pageToken
description
:
Optional. A page token for pagination.
in
:
query
required
:
false
type
:
string
tags
:
-
MemoService
patch
:
...
...
@@ -1500,7 +1570,9 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo.
Format: memos/{memo}
in: path
required: true
type: string
...
...
@@ -1551,11 +1623,29 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo.
Format: memos/{memo}
in: path
required: true
type: string
pattern: memos/[^/]+
-
name
:
pageSize
description
:
Optional. The maximum number of comments to return.
in
:
query
required
:
false
type
:
integer
format
:
int32
-
name
:
pageToken
description
:
Optional. A page token for pagination.
in
:
query
required
:
false
type
:
string
-
name
:
orderBy
description
:
Optional. The order to sort results by.
in
:
query
required
:
false
type
:
string
tags
:
-
MemoService
post
:
...
...
@@ -1572,17 +1662,26 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo.
Format: memos/{memo}
in: path
required: true
type: string
pattern: memos/[^/]+
-
name
:
comment
description
:
The comment to create.
description
:
Required.
The comment to create.
in
:
body
required
:
true
schema
:
$ref
:
'
#/definitions/apiv1Memo'
required
:
-
comment
-
name
:
commentId
description
:
Optional. The comment ID to use.
in
:
query
required
:
false
type
:
string
tags
:
-
MemoService
/api/v1/{name}/reactions
:
...
...
@@ -1600,11 +1699,24 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo.
Format: memos/{memo}
in: path
required: true
type: string
pattern: memos/[^/]+
-
name
:
pageSize
description
:
Optional. The maximum number of reactions to return.
in
:
query
required
:
false
type
:
integer
format
:
int32
-
name
:
pageToken
description
:
Optional. A page token for pagination.
in
:
query
required
:
false
type
:
string
tags
:
-
MemoService
post
:
...
...
@@ -1621,7 +1733,9 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo.
Format: memos/{memo}
in: path
required: true
type: string
...
...
@@ -1648,11 +1762,24 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo.
Format: memos/{memo}
in: path
required: true
type: string
pattern: memos/[^/]+
-
name
:
pageSize
description
:
Optional. The maximum number of relations to return.
in
:
query
required
:
false
type
:
integer
format
:
int32
-
name
:
pageToken
description
:
Optional. A page token for pagination.
in
:
query
required
:
false
type
:
string
tags
:
-
MemoService
patch
:
...
...
@@ -1670,7 +1797,9 @@ paths:
$ref
:
'
#/definitions/googlerpcStatus'
parameters
:
-
name
:
name
description
:
The name of the memo.
description
:
|-
Required. The resource name of the memo.
Format: memos/{memo}
in: path
required: true
type: string
...
...
@@ -1874,28 +2003,33 @@ paths:
parameters
:
-
name
:
parent
description
:
|-
The parent is the owner of the memos.
Optional.
The parent is the owner of the memos.
If not specified or `users/-`, it will list all memos.
Format: users/{user}
in: path
required: true
type: string
pattern: users/[^/]+
-
name
:
pageSize
description
:
The maximum number of memos to return.
description
:
|-
Optional. The maximum number of memos to return.
The service may return fewer than this value.
If unspecified, at most 50 memos will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
in: query
required: false
type: integer
format: int32
-
name
:
pageToken
description
:
|-
A page token, received from a previous `ListMemos` call.
Optional.
A page token, received from a previous `ListMemos` call.
Provide this to retrieve the subsequent page.
in: query
required: false
type: string
-
name
:
state
description
:
|-
The state of the memos to list.
Optional.
The state of the memos to list.
Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
in: query
required: false
...
...
@@ -1905,32 +2039,27 @@ paths:
- NORMAL
- ARCHIVED
default: STATE_UNSPECIFIED
-
name
:
sort
description
:
|-
What field to sort the results by.
Default to display_time.
in: query
required: false
type: string
-
name
:
direction
-
name
:
orderBy
description
:
|-
The direction to sort the results by.
Default to DESC.
Optional. The order to sort results by.
Default to "display_time desc".
Example: "display_time desc" or "create_time asc"
in: query
required: false
type: string
enum:
- DIRECTION_UNSPECIFIED
- ASC
- DESC
default: DIRECTION_UNSPECIFIED
-
name
:
filter
description
:
|-
Optional. Filter to apply to the list results.
Filter is a CEL expression to filter memos.
Refer to `Shortcut.filter`.
in: query
required: false
type: string
-
name
:
showDeleted
description
:
Optional. If
true
, show deleted memos in the response.
in
:
query
required
:
false
type
:
boolean
-
name
:
oldFilter
description
:
|-
[Deprecated] Old filter contains some specific conditions to filter memos.
...
...
@@ -2028,17 +2157,19 @@ paths:
parameters
:
-
name
:
parent
description
:
|-
The parent, who owns the tags.
Format: memos/{
id
}. Use "memos/-" to delete all tags.
Required.
The parent, who owns the tags.
Format: memos/{
memo
}. Use "memos/-" to delete all tags.
in: path
required: true
type: string
pattern: memos/[^/]+
-
name
:
tag
description
:
Required. The tag name to delete.
in
:
path
required
:
true
type
:
string
-
name
:
deleteRelatedMemos
description
:
Optional. Whether to delete related memos.
in
:
query
required
:
false
type
:
boolean
...
...
@@ -2061,8 +2192,8 @@ paths:
parameters
:
-
name
:
parent
description
:
|-
The parent, who owns the tags.
Format: memos/{
id
}. Use "memos/-" to rename all tags.
Required.
The parent, who owns the tags.
Format: memos/{
memo
}. Use "memos/-" to rename all tags.
in: path
required: true
type: string
...
...
@@ -2420,8 +2551,13 @@ definitions:
properties
:
oldTag
:
type
:
string
description
:
Required. The old tag name to rename.
newTag
:
type
:
string
description
:
Required. The new tag name.
required
:
-
oldTag
-
newTag
MemoServiceSetMemoAttachmentsBody
:
type
:
object
properties
:
...
...
@@ -2430,6 +2566,9 @@ definitions:
items
:
type
:
object
$ref
:
'
#/definitions/v1Attachment'
description
:
Required. The attachments to set for the memo.
required
:
-
attachments
MemoServiceSetMemoRelationsBody
:
type
:
object
properties
:
...
...
@@ -2438,11 +2577,17 @@ definitions:
items
:
type
:
object
$ref
:
'
#/definitions/v1MemoRelation'
description
:
Required. The relations to set for the memo.
required
:
-
relations
MemoServiceUpsertMemoReactionBody
:
type
:
object
properties
:
reaction
:
$ref
:
'
#/definitions/v1Reaction'
description
:
Required. The reaction to upsert.
required
:
-
reaction
TableNodeRow
:
type
:
object
properties
:
...
...
@@ -2635,86 +2780,108 @@ definitions:
properties
:
placeholder
:
type
:
string
description
:
A placeholder text for the location.
latitude
:
type
:
number
format
:
double
description
:
The latitude of the location.
longitude
:
type
:
number
format
:
double
description
:
The longitude of the location.
apiv1Memo
:
type
:
object
properties
:
name
:
type
:
string
description
:
|-
The name of the memo.
The
resource
name of the memo.
Format: memos/{memo}, memo is the user defined id or uuid.
readOnly: true
state
:
$ref
:
'
#/definitions/v1State'
description
:
The state of the memo.
creator
:
type
:
string
title
:
|-
The name of the creator.
Format: users/{user}
readOnly: true
createTime
:
type
:
string
format
:
date-time
description
:
Output only. The creation timestamp.
readOnly
:
true
updateTime
:
type
:
string
format
:
date-time
description
:
Output only. The last update timestamp.
readOnly
:
true
displayTime
:
type
:
string
format
:
date-time
description
:
The display timestamp of the memo.
content
:
type
:
string
description
:
Required. The content of the memo in Markdown format.
nodes
:
type
:
array
items
:
type
:
object
$ref
:
'
#/definitions/v1Node'
description
:
Output only. The parsed nodes from the content.
readOnly
:
true
visibility
:
$ref
:
'
#/definitions/v1Visibility'
description
:
The visibility of the memo.
tags
:
type
:
array
items
:
type
:
string
description
:
Output only. The tags extracted from the content.
readOnly
:
true
pinned
:
type
:
boolean
description
:
Whether the memo is pinned.
attachments
:
type
:
array
items
:
type
:
object
$ref
:
'
#/definitions/v1Attachment'
description
:
Optional. The attachments of the memo.
relations
:
type
:
array
items
:
type
:
object
$ref
:
'
#/definitions/v1MemoRelation'
description
:
Optional. The relations of the memo.
reactions
:
type
:
array
items
:
type
:
object
$ref
:
'
#/definitions/v1Reaction'
description
:
Output only. The reactions to the memo.
readOnly
:
true
property
:
$ref
:
'
#/definitions/v1MemoProperty'
description
:
Output only. The computed properties of the memo.
readOnly
:
true
parent
:
type
:
string
title
:
|-
The name of the parent memo.
Format: memos/{
id
}
Output only.
The name of the parent memo.
Format: memos/{
memo
}
readOnly: true
snippet
:
type
:
string
description
:
The snippet of the memo content. Plain text only.
description
:
Output only.
The snippet of the memo content. Plain text only.
readOnly
:
true
location
:
$ref
:
'
#/definitions/apiv1Location'
description
:
The location of the memo.
description
:
Optional. The location of the memo.
required
:
-
state
-
content
-
visibility
apiv1OAuth2Config
:
type
:
object
properties
:
...
...
@@ -3157,13 +3324,6 @@ definitions:
properties
:
content
:
type
:
string
v1Direction
:
type
:
string
enum
:
-
DIRECTION_UNSPECIFIED
-
ASC
-
DESC
default
:
DIRECTION_UNSPECIFIED
v1EmbeddedContentNode
:
type
:
object
properties
:
...
...
@@ -3393,6 +3553,14 @@ definitions:
items
:
type
:
object
$ref
:
'
#/definitions/v1Attachment'
description
:
The list of attachments.
nextPageToken
:
type
:
string
description
:
A token for the next page of results.
totalSize
:
type
:
integer
format
:
int32
description
:
The total count of attachments.
v1ListMemoCommentsResponse
:
type
:
object
properties
:
...
...
@@ -3401,6 +3569,14 @@ definitions:
items
:
type
:
object
$ref
:
'
#/definitions/apiv1Memo'
description
:
The list of comment memos.
nextPageToken
:
type
:
string
description
:
A token for the next page of results.
totalSize
:
type
:
integer
format
:
int32
description
:
The total count of comments.
v1ListMemoReactionsResponse
:
type
:
object
properties
:
...
...
@@ -3409,6 +3585,14 @@ definitions:
items
:
type
:
object
$ref
:
'
#/definitions/v1Reaction'
description
:
The list of reactions.
nextPageToken
:
type
:
string
description
:
A token for the next page of results.
totalSize
:
type
:
integer
format
:
int32
description
:
The total count of reactions.
v1ListMemoRelationsResponse
:
type
:
object
properties
:
...
...
@@ -3417,6 +3601,14 @@ definitions:
items
:
type
:
object
$ref
:
'
#/definitions/v1MemoRelation'
description
:
The list of relations.
nextPageToken
:
type
:
string
description
:
A token for the next page of results.
totalSize
:
type
:
integer
format
:
int32
description
:
The total count of relations.
v1ListMemosResponse
:
type
:
object
properties
:
...
...
@@ -3425,11 +3617,16 @@ definitions:
items
:
type
:
object
$ref
:
'
#/definitions/apiv1Memo'
description
:
The list of memos.
nextPageToken
:
type
:
string
description
:
|-
A token
, which
can be sent as `page_token` to retrieve the next page.
A token
that
can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
totalSize
:
type
:
integer
format
:
int32
description
:
The total count of memos (may be approximate).
v1ListNode
:
type
:
object
properties
:
...
...
@@ -3532,29 +3729,41 @@ definitions:
type
:
boolean
hasIncompleteTasks
:
type
:
boolean
description
:
Computed properties of a memo.
v1MemoRelation
:
type
:
object
properties
:
memo
:
$ref
:
'
#/definitions/v1MemoRelationMemo'
description
:
The memo in the relation.
relatedMemo
:
$ref
:
'
#/definitions/v1MemoRelationMemo'
description
:
The related memo.
type
:
$ref
:
'
#/definitions/v1MemoRelationType'
required
:
-
memo
-
relatedMemo
-
type
v1MemoRelationMemo
:
type
:
object
properties
:
name
:
type
:
string
title
:
|-
The name of the memo.
Format: memos/{
id
}
The
resource
name of the memo.
Format: memos/{
memo
}
uid
:
type
:
string
description
:
Output only. The unique identifier of the memo.
readOnly
:
true
snippet
:
type
:
string
description
:
The snippet of the memo content. Plain text only.
description
:
Output only.
The snippet of the memo content. Plain text only.
readOnly
:
true
description
:
Memo reference in relations.
required
:
-
name
v1MemoRelationType
:
type
:
string
enum
:
...
...
@@ -3562,6 +3771,7 @@ definitions:
-
REFERENCE
-
COMMENT
default
:
TYPE_UNSPECIFIED
description
:
The type of the relation.
v1Node
:
type
:
object
properties
:
...
...
@@ -3716,21 +3926,39 @@ definitions:
v1Reaction
:
type
:
object
properties
:
id
:
type
:
integer
format
:
int32
name
:
type
:
string
title
:
|-
The resource name of the reaction.
Format: reactions/{reaction}
readOnly: true
uid
:
type
:
string
description
:
Output only. The system generated unique identifier.
readOnly
:
true
creator
:
type
:
string
title
:
|-
The name of the creator.
The
resource
name of the creator.
Format: users/{user}
readOnly: true
contentId
:
type
:
string
description
:
|-
The content identifier.
For memo, it should be the `Memo.name`.
title
:
|-
The resource name of the content.
For memo reactions, this should be the memo's resource name.
Format: memos/{memo}
reactionType
:
type
:
string
description
:
"
Required.
The
type
of
reaction
(e.g.,
\"\U0001F44D\"
,
\"
❤️
\"
,
\"\U0001F604\"
)."
createTime
:
type
:
string
format
:
date-time
description
:
Output only. The creation timestamp.
readOnly
:
true
required
:
-
contentId
-
reactionType
v1ReferencedContentNode
:
type
:
object
properties
:
...
...
server/router/api/v1/memo_service.go
View file @
9972a77d
...
...
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log/slog"
"strings"
"time"
"unicode/utf8"
...
...
@@ -99,8 +100,12 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
// Exclude comments by default.
ExcludeComments
:
true
,
}
if
err
:=
s
.
buildMemoFindWithFilter
(
ctx
,
memoFind
,
request
.
OldFilter
);
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"failed to build find memos with filter: %v"
,
err
)
// Handle deprecated old_filter for backward compatibility
if
request
.
OldFilter
!=
""
&&
request
.
Filter
==
""
{
//nolint:staticcheck // SA1019: Using deprecated field for backward compatibility
if
err
:=
s
.
buildMemoFindWithFilter
(
ctx
,
memoFind
,
request
.
OldFilter
);
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"failed to build find memos with filter: %v"
,
err
)
}
}
if
request
.
Parent
!=
""
&&
request
.
Parent
!=
"users/-"
{
userID
,
err
:=
ExtractUserIDFromName
(
request
.
Parent
)
...
...
@@ -117,9 +122,17 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
state
:=
store
.
Normal
memoFind
.
RowStatus
=
&
state
}
if
request
.
Direction
==
v1pb
.
Direction_ASC
{
memoFind
.
OrderByTimeAsc
=
true
// Parse order_by field (replaces the old sort and direction fields)
if
request
.
OrderBy
!=
""
{
if
err
:=
s
.
parseMemoOrderBy
(
request
.
OrderBy
,
memoFind
);
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"invalid order_by: %v"
,
err
)
}
}
else
{
// Default ordering by display_time desc
memoFind
.
OrderByTimeAsc
=
false
}
if
request
.
Filter
!=
""
{
if
err
:=
s
.
validateFilter
(
ctx
,
request
.
Filter
);
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"invalid filter: %v"
,
err
)
...
...
@@ -739,3 +752,38 @@ func substring(s string, length int) string {
return
s
[
:
byteIndex
]
}
// parseMemoOrderBy parses the order_by field and sets the appropriate ordering in memoFind.
func
(
*
APIV1Service
)
parseMemoOrderBy
(
orderBy
string
,
memoFind
*
store
.
FindMemo
)
error
{
// Parse order_by field like "display_time desc" or "create_time asc"
parts
:=
strings
.
Fields
(
strings
.
TrimSpace
(
orderBy
))
if
len
(
parts
)
==
0
{
return
errors
.
New
(
"empty order_by"
)
}
field
:=
parts
[
0
]
direction
:=
"desc"
// default
if
len
(
parts
)
>
1
{
direction
=
strings
.
ToLower
(
parts
[
1
])
if
direction
!=
"asc"
&&
direction
!=
"desc"
{
return
errors
.
Errorf
(
"invalid order direction: %s, must be 'asc' or 'desc'"
,
parts
[
1
])
}
}
switch
field
{
case
"display_time"
:
memoFind
.
OrderByTimeAsc
=
direction
==
"asc"
case
"create_time"
:
memoFind
.
OrderByTimeAsc
=
direction
==
"asc"
case
"update_time"
:
memoFind
.
OrderByUpdatedTs
=
true
memoFind
.
OrderByTimeAsc
=
direction
==
"asc"
case
"name"
:
// For ordering by memo name/id - not commonly used but supported
memoFind
.
OrderByTimeAsc
=
direction
==
"asc"
default
:
return
errors
.
Errorf
(
"unsupported order field: %s, supported fields are: display_time, create_time, update_time, name"
,
field
)
}
return
nil
}
server/router/api/v1/reaction_service.go
View file @
9972a77d
...
...
@@ -3,10 +3,12 @@ package v1
import
(
"context"
"fmt"
"time"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/timestamppb"
v1pb
"github.com/usememos/memos/proto/gen/api/v1"
"github.com/usememos/memos/store"
...
...
@@ -55,8 +57,13 @@ func (s *APIV1Service) UpsertMemoReaction(ctx context.Context, request *v1pb.Ups
}
func
(
s
*
APIV1Service
)
DeleteMemoReaction
(
ctx
context
.
Context
,
request
*
v1pb
.
DeleteMemoReactionRequest
)
(
*
emptypb
.
Empty
,
error
)
{
reactionID
,
err
:=
ExtractReactionIDFromName
(
request
.
Name
)
if
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"invalid reaction name: %v"
,
err
)
}
if
err
:=
s
.
Store
.
DeleteReaction
(
ctx
,
&
store
.
DeleteReaction
{
ID
:
re
quest
.
Id
,
ID
:
re
actionID
,
});
err
!=
nil
{
return
nil
,
status
.
Errorf
(
codes
.
Internal
,
"failed to delete reaction"
)
}
...
...
@@ -71,10 +78,14 @@ func (s *APIV1Service) convertReactionFromStore(ctx context.Context, reaction *s
if
err
!=
nil
{
return
nil
,
err
}
reactionUID
:=
fmt
.
Sprintf
(
"%d"
,
reaction
.
ID
)
return
&
v1pb
.
Reaction
{
Id
:
reaction
.
ID
,
Name
:
fmt
.
Sprintf
(
"%s%s"
,
ReactionNamePrefix
,
reactionUID
),
Uid
:
reactionUID
,
Creator
:
fmt
.
Sprintf
(
"%s%d"
,
UserNamePrefix
,
creator
.
ID
),
ContentId
:
reaction
.
ContentID
,
ReactionType
:
reaction
.
ReactionType
,
CreateTime
:
timestamppb
.
New
(
time
.
Unix
(
reaction
.
CreatedTs
,
0
)),
},
nil
}
server/router/api/v1/resource_name.go
View file @
9972a77d
...
...
@@ -14,6 +14,7 @@ const (
UserNamePrefix
=
"users/"
MemoNamePrefix
=
"memos/"
AttachmentNamePrefix
=
"attachments/"
ReactionNamePrefix
=
"reactions/"
InboxNamePrefix
=
"inboxes/"
IdentityProviderNamePrefix
=
"identityProviders/"
ActivityNamePrefix
=
"activities/"
...
...
@@ -93,6 +94,20 @@ func ExtractAttachmentUIDFromName(name string) (string, error) {
return
id
,
nil
}
// ExtractReactionIDFromName returns the reaction ID from a resource name.
// e.g., "reactions/123" -> 123.
func
ExtractReactionIDFromName
(
name
string
)
(
int32
,
error
)
{
tokens
,
err
:=
GetNameParentTokens
(
name
,
ReactionNamePrefix
)
if
err
!=
nil
{
return
0
,
err
}
id
,
err
:=
util
.
ConvertStringToInt32
(
tokens
[
0
])
if
err
!=
nil
{
return
0
,
errors
.
Errorf
(
"invalid reaction 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
)
...
...
store/reaction.go
View file @
9972a77d
...
...
@@ -9,7 +9,6 @@ type Reaction struct {
CreatedTs
int64
CreatorID
int32
// ContentID is the id of the content that the reaction is for.
// This can be a memo. e.g. memos/101
ContentID
string
ReactionType
string
}
...
...
web/src/components/MemoEditor/index.tsx
View file @
9972a77d
...
...
@@ -396,6 +396,10 @@ const MemoEditor = observer((props: Props) => {
relations
:
state
.
relationList
,
location
:
state
.
location
,
}),
// Optional fields can be omitted
memoId
:
""
,
validateOnly
:
false
,
requestId
:
""
,
})
:
memoServiceClient
.
createMemoComment
({
...
...
web/src/components/MemoReactionListView.tsx
View file @
9972a77d
...
...
@@ -5,7 +5,7 @@ import useCurrentUser from "@/hooks/useCurrentUser";
import
{
userStore
}
from
"@/store/v2"
;
import
{
State
}
from
"@/types/proto/api/v1/common"
;
import
{
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
Reaction
}
from
"@/types/proto/api/v1/
reaction
_service"
;
import
{
Reaction
}
from
"@/types/proto/api/v1/
memo
_service"
;
import
{
User
}
from
"@/types/proto/api/v1/user_service"
;
import
ReactionSelector
from
"./ReactionSelector"
;
import
ReactionView
from
"./ReactionView"
;
...
...
web/src/components/PagedMemoList/PagedMemoList.tsx
View file @
9972a77d
...
...
@@ -8,7 +8,7 @@ import { DEFAULT_LIST_MEMOS_PAGE_SIZE } from "@/helpers/consts";
import
useResponsiveWidth
from
"@/hooks/useResponsiveWidth"
;
import
{
Routes
}
from
"@/router"
;
import
{
memoStore
,
viewStore
}
from
"@/store/v2"
;
import
{
Direction
,
State
}
from
"@/types/proto/api/v1/common"
;
import
{
State
}
from
"@/types/proto/api/v1/common"
;
import
{
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
Empty
from
"../Empty"
;
...
...
@@ -20,7 +20,7 @@ interface Props {
listSort
?:
(
list
:
Memo
[])
=>
Memo
[];
owner
?:
string
;
state
?:
State
;
direction
?:
Direction
;
orderBy
?:
string
;
filter
?:
string
;
oldFilter
?:
string
;
pageSize
?:
number
;
...
...
@@ -51,7 +51,7 @@ const PagedMemoList = observer((props: Props) => {
const
response
=
await
memoStore
.
fetchMemos
({
parent
:
props
.
owner
||
""
,
state
:
props
.
state
||
State
.
NORMAL
,
direction
:
props
.
direction
||
Direction
.
DESC
,
orderBy
:
props
.
orderBy
||
"display_time desc"
,
filter
:
props
.
filter
||
""
,
oldFilter
:
props
.
oldFilter
||
""
,
pageSize
:
props
.
pageSize
||
DEFAULT_LIST_MEMOS_PAGE_SIZE
,
...
...
@@ -103,7 +103,7 @@ const PagedMemoList = observer((props: Props) => {
// Initial load and reload when props change
useEffect
(()
=>
{
refreshList
();
},
[
props
.
owner
,
props
.
state
,
props
.
direction
,
props
.
filter
,
props
.
oldFilter
,
props
.
pageSize
]);
},
[
props
.
owner
,
props
.
state
,
props
.
orderBy
,
props
.
filter
,
props
.
oldFilter
,
props
.
pageSize
]);
// Auto-fetch more content when list changes and page isn't full
useEffect
(()
=>
{
...
...
web/src/components/ReactionSelector.tsx
View file @
9972a77d
...
...
@@ -36,7 +36,7 @@ const ReactionSelector = observer((props: Props) => {
(
reaction
)
=>
reaction
.
reactionType
===
reactionType
&&
reaction
.
creator
===
currentUser
.
name
,
);
for
(
const
reaction
of
reactions
)
{
await
memoServiceClient
.
deleteMemoReaction
({
id
:
reaction
.
id
});
await
memoServiceClient
.
deleteMemoReaction
({
name
:
reaction
.
name
});
}
}
else
{
await
memoServiceClient
.
upsertMemoReaction
({
...
...
web/src/components/ReactionView.tsx
View file @
9972a77d
...
...
@@ -55,7 +55,7 @@ const ReactionView = observer((props: Props) => {
(
reaction
)
=>
reaction
.
reactionType
===
reactionType
&&
reaction
.
creator
===
currentUser
.
name
,
);
for
(
const
reaction
of
reactions
)
{
await
memoServiceClient
.
deleteMemoReaction
({
id
:
reaction
.
id
});
await
memoServiceClient
.
deleteMemoReaction
({
name
:
reaction
.
name
});
}
}
}
catch
{
...
...
web/src/pages/Archived.tsx
View file @
9972a77d
...
...
@@ -6,7 +6,7 @@ import PagedMemoList from "@/components/PagedMemoList";
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
{
viewStore
}
from
"@/store/v2"
;
import
memoFilterStore
from
"@/store/v2/memoFilter"
;
import
{
Direction
,
State
}
from
"@/types/proto/api/v1/common"
;
import
{
State
}
from
"@/types/proto/api/v1/common"
;
import
{
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
const
Archived
=
observer
(()
=>
{
...
...
@@ -46,7 +46,7 @@ const Archived = observer(() => {
}
owner=
{
user
.
name
}
state=
{
State
.
ARCHIVED
}
direction=
{
viewStore
.
state
.
orderByTimeAsc
?
Direction
.
ASC
:
Direction
.
DESC
}
orderBy=
{
viewStore
.
state
.
orderByTimeAsc
?
"display_time asc"
:
"display_time desc"
}
oldFilter=
{
memoListFilter
}
/>
);
...
...
web/src/pages/Explore.tsx
View file @
9972a77d
...
...
@@ -5,7 +5,7 @@ import MobileHeader from "@/components/MobileHeader";
import
PagedMemoList
from
"@/components/PagedMemoList"
;
import
useResponsiveWidth
from
"@/hooks/useResponsiveWidth"
;
import
{
viewStore
}
from
"@/store/v2"
;
import
{
Direction
,
State
}
from
"@/types/proto/api/v1/common"
;
import
{
State
}
from
"@/types/proto/api/v1/common"
;
import
{
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
const
Explore
=
observer
(()
=>
{
...
...
@@ -26,7 +26,7 @@ const Explore = observer(() => {
:
dayjs
(
b
.
displayTime
).
unix
()
-
dayjs
(
a
.
displayTime
).
unix
(),
)
}
direction=
{
viewStore
.
state
.
orderByTimeAsc
?
Direction
.
ASC
:
Direction
.
DESC
}
orderBy=
{
viewStore
.
state
.
orderByTimeAsc
?
"display_time asc"
:
"display_time desc"
}
/>
</
div
>
</
section
>
...
...
web/src/pages/Home.tsx
View file @
9972a77d
...
...
@@ -6,7 +6,7 @@ import PagedMemoList from "@/components/PagedMemoList";
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
{
viewStore
,
userStore
}
from
"@/store/v2"
;
import
memoFilterStore
from
"@/store/v2/memoFilter"
;
import
{
Direction
,
State
}
from
"@/types/proto/api/v1/common"
;
import
{
State
}
from
"@/types/proto/api/v1/common"
;
import
{
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
// Helper function to extract shortcut ID from resource name
...
...
@@ -68,7 +68,7 @@ const Home = observer(() => {
.
sort
((
a
,
b
)
=>
Number
(
b
.
pinned
)
-
Number
(
a
.
pinned
))
}
owner=
{
user
.
name
}
direction=
{
viewStore
.
state
.
orderByTimeAsc
?
Direction
.
ASC
:
Direction
.
DESC
}
orderBy=
{
viewStore
.
state
.
orderByTimeAsc
?
"display_time asc"
:
"display_time desc"
}
filter=
{
selectedShortcut
?.
filter
||
""
}
oldFilter=
{
memoListFilter
}
/>
...
...
web/src/pages/UserProfile.tsx
View file @
9972a77d
...
...
@@ -12,7 +12,7 @@ import UserAvatar from "@/components/UserAvatar";
import
useLoading
from
"@/hooks/useLoading"
;
import
{
viewStore
,
userStore
}
from
"@/store/v2"
;
import
memoFilterStore
from
"@/store/v2/memoFilter"
;
import
{
Direction
,
State
}
from
"@/types/proto/api/v1/common"
;
import
{
State
}
from
"@/types/proto/api/v1/common"
;
import
{
Memo
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
User
}
from
"@/types/proto/api/v1/user_service"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
...
...
@@ -112,7 +112,7 @@ const UserProfile = observer(() => {
.
sort
((
a
,
b
)
=>
Number
(
b
.
pinned
)
-
Number
(
a
.
pinned
))
}
owner=
{
user
.
name
}
direction=
{
viewStore
.
state
.
orderByTimeAsc
?
Direction
.
ASC
:
Direction
.
DESC
}
orderBy=
{
viewStore
.
state
.
orderByTimeAsc
?
"display_time asc"
:
"display_time desc"
}
oldFilter=
{
memoListFilter
}
/>
</>
...
...
web/src/types/proto/api/v1/memo_service.ts
View file @
9972a77d
...
...
@@ -10,9 +10,8 @@ import { Empty } from "../../google/protobuf/empty";
import
{
FieldMask
}
from
"../../google/protobuf/field_mask"
;
import
{
Timestamp
}
from
"../../google/protobuf/timestamp"
;
import
{
Attachment
}
from
"./attachment_service"
;
import
{
Direction
,
directionFromJSON
,
directionToNumber
,
State
,
stateFromJSON
,
stateToNumber
}
from
"./common"
;
import
{
State
,
stateFromJSON
,
stateToNumber
}
from
"./common"
;
import
{
Node
}
from
"./markdown_service"
;
import
{
Reaction
}
from
"./reaction_service"
;
export
const
protobufPackage
=
"memos.api.v1"
;
...
...
@@ -61,45 +60,90 @@ export function visibilityToNumber(object: Visibility): number {
}
}
export
interface
Reaction
{
/**
* The resource name of the reaction.
* Format: reactions/{reaction}
*/
name
:
string
;
/** Output only. The system generated unique identifier. */
uid
:
string
;
/**
* The resource name of the creator.
* Format: users/{user}
*/
creator
:
string
;
/**
* The resource name of the content.
* For memo reactions, this should be the memo's resource name.
* Format: memos/{memo}
*/
contentId
:
string
;
/** Required. The type of reaction (e.g., "👍", "❤️", "😄"). */
reactionType
:
string
;
/** Output only. The creation timestamp. */
createTime
?:
Date
|
undefined
;
}
export
interface
Memo
{
/**
* The name of the memo.
* The
resource
name of the memo.
* Format: memos/{memo}, memo is the user defined id or uuid.
*/
name
:
string
;
/** The state of the memo. */
state
:
State
;
/**
* The name of the creator.
* Format: users/{user}
*/
creator
:
string
;
createTime
?:
Date
|
undefined
;
updateTime
?:
Date
|
undefined
;
displayTime
?:
Date
|
undefined
;
/** Output only. The creation timestamp. */
createTime
?:
|
Date
|
undefined
;
/** Output only. The last update timestamp. */
updateTime
?:
|
Date
|
undefined
;
/** The display timestamp of the memo. */
displayTime
?:
|
Date
|
undefined
;
/** Required. The content of the memo in Markdown format. */
content
:
string
;
/** Output only. The parsed nodes from the content. */
nodes
:
Node
[];
/** The visibility of the memo. */
visibility
:
Visibility
;
/** Output only. The tags extracted from the content. */
tags
:
string
[];
/** Whether the memo is pinned. */
pinned
:
boolean
;
/** Optional. The attachments of the memo. */
attachments
:
Attachment
[];
/** Optional. The relations of the memo. */
relations
:
MemoRelation
[];
/** Output only. The reactions to the memo. */
reactions
:
Reaction
[];
/** Output only. The computed properties of the memo. */
property
?:
|
Memo_Property
|
undefined
;
/**
* The name of the parent memo.
* Format: memos/{
id
}
*
Output only.
The name of the parent memo.
* Format: memos/{
memo
}
*/
parent
?:
|
string
|
undefined
;
/** The snippet of the memo content. Plain text only. */
/**
Output only.
The snippet of the memo content. Plain text only. */
snippet
:
string
;
/** The location of the memo. */
/**
Optional.
The location of the memo. */
location
?:
Location
|
undefined
;
}
/** Computed properties of a memo. */
export
interface
Memo_Property
{
hasLink
:
boolean
;
hasTaskList
:
boolean
;
...
...
@@ -108,49 +152,68 @@ export interface Memo_Property {
}
export
interface
Location
{
/** A placeholder text for the location. */
placeholder
:
string
;
/** The latitude of the location. */
latitude
:
number
;
/** The longitude of the location. */
longitude
:
number
;
}
export
interface
CreateMemoRequest
{
/** The memo to create. */
memo
?:
Memo
|
undefined
;
/** Required. The memo to create. */
memo
?:
|
Memo
|
undefined
;
/**
* Optional. The memo ID to use for this memo.
* If empty, a unique ID will be generated.
*/
memoId
:
string
;
/** Optional. If set, validate the request but don't actually create the memo. */
validateOnly
:
boolean
;
/** Optional. An idempotency token. */
requestId
:
string
;
}
export
interface
ListMemosRequest
{
/**
* The parent is the owner of the memos.
*
Optional.
The parent is the owner of the memos.
* If not specified or `users/-`, it will list all memos.
* Format: users/{user}
*/
parent
:
string
;
/** The maximum number of memos to return. */
/**
* Optional. The maximum number of memos to return.
* The service may return fewer than this value.
* If unspecified, at most 50 memos will be returned.
* The maximum value is 1000; values above 1000 will be coerced to 1000.
*/
pageSize
:
number
;
/**
* A page token, received from a previous `ListMemos` call.
*
Optional.
A page token, received from a previous `ListMemos` call.
* Provide this to retrieve the subsequent page.
*/
pageToken
:
string
;
/**
* The state of the memos to list.
*
Optional.
The state of the memos to list.
* Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
*/
state
:
State
;
/**
* What field to sort the results by.
* Default to display_time.
*/
sort
:
string
;
/**
* The direction to sort the results by.
* Default to DESC.
* Optional. The order to sort results by.
* Default to "display_time desc".
* Example: "display_time desc" or "create_time asc"
*/
direction
:
Direction
;
orderBy
:
string
;
/**
* Optional. Filter to apply to the list results.
* Filter is a CEL expression to filter memos.
* Refer to `Shortcut.filter`.
*/
filter
:
string
;
/** Optional. If true, show deleted memos in the response. */
showDeleted
:
boolean
;
/**
* [Deprecated] Old filter contains some specific conditions to filter memos.
* Format: "creator == 'users/{user}' && visibilities == ['PUBLIC', 'PROTECTED']"
...
...
@@ -159,74 +222,122 @@ export interface ListMemosRequest {
}
export
interface
ListMemosResponse
{
/** The list of memos. */
memos
:
Memo
[];
/**
* A token
, which
can be sent as `page_token` to retrieve the next page.
* A token
that
can be sent as `page_token` to retrieve the next page.
* If this field is omitted, there are no subsequent pages.
*/
nextPageToken
:
string
;
/** The total count of memos (may be approximate). */
totalSize
:
number
;
}
export
interface
GetMemoRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo.
* Format: memos/{memo}
*/
name
:
string
;
/**
* Optional. The fields to return in the response.
* If not specified, all fields are returned.
*/
readMask
?:
string
[]
|
undefined
;
}
export
interface
UpdateMemoRequest
{
/**
* The memo to update.
*
Required.
The memo to update.
* The `name` field is required.
*/
memo
?:
Memo
|
undefined
;
updateMask
?:
string
[]
|
undefined
;
memo
?:
|
Memo
|
undefined
;
/** Required. The list of fields to update. */
updateMask
?:
|
string
[]
|
undefined
;
/** Optional. If set to true, allows updating sensitive fields. */
allowMissing
:
boolean
;
}
export
interface
DeleteMemoRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo to delete.
* Format: memos/{memo}
*/
name
:
string
;
/** Optional. If set to true, the memo will be deleted even if it has associated data. */
force
:
boolean
;
}
export
interface
RenameMemoTagRequest
{
/**
* The parent, who owns the tags.
* Format: memos/{
id
}. Use "memos/-" to rename all tags.
*
Required.
The parent, who owns the tags.
* Format: memos/{
memo
}. Use "memos/-" to rename all tags.
*/
parent
:
string
;
/** Required. The old tag name to rename. */
oldTag
:
string
;
/** Required. The new tag name. */
newTag
:
string
;
}
export
interface
DeleteMemoTagRequest
{
/**
* The parent, who owns the tags.
* Format: memos/{
id
}. Use "memos/-" to delete all tags.
*
Required.
The parent, who owns the tags.
* Format: memos/{
memo
}. Use "memos/-" to delete all tags.
*/
parent
:
string
;
/** Required. The tag name to delete. */
tag
:
string
;
/** Optional. Whether to delete related memos. */
deleteRelatedMemos
:
boolean
;
}
export
interface
SetMemoAttachmentsRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo.
* Format: memos/{memo}
*/
name
:
string
;
/** Required. The attachments to set for the memo. */
attachments
:
Attachment
[];
}
export
interface
ListMemoAttachmentsRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo.
* Format: memos/{memo}
*/
name
:
string
;
/** Optional. The maximum number of attachments to return. */
pageSize
:
number
;
/** Optional. A page token for pagination. */
pageToken
:
string
;
}
export
interface
ListMemoAttachmentsResponse
{
/** The list of attachments. */
attachments
:
Attachment
[];
/** A token for the next page of results. */
nextPageToken
:
string
;
/** The total count of attachments. */
totalSize
:
number
;
}
export
interface
MemoRelation
{
memo
?:
MemoRelation_Memo
|
undefined
;
/** The memo in the relation. */
memo
?:
|
MemoRelation_Memo
|
undefined
;
/** The related memo. */
relatedMemo
?:
MemoRelation_Memo
|
undefined
;
type
:
MemoRelation_Type
;
}
/** The type of the relation. */
export
enum
MemoRelation_Type
{
TYPE_UNSPECIFIED
=
"TYPE_UNSPECIFIED"
,
REFERENCE
=
"REFERENCE"
,
...
...
@@ -266,71 +377,232 @@ export function memoRelation_TypeToNumber(object: MemoRelation_Type): number {
}
}
/** Memo reference in relations. */
export
interface
MemoRelation_Memo
{
/**
* The name of the memo.
* Format: memos/{
id
}
* The
resource
name of the memo.
* Format: memos/{
memo
}
*/
name
:
string
;
/** Output only. The unique identifier of the memo. */
uid
:
string
;
/** The snippet of the memo content. Plain text only. */
/**
Output only.
The snippet of the memo content. Plain text only. */
snippet
:
string
;
}
export
interface
SetMemoRelationsRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo.
* Format: memos/{memo}
*/
name
:
string
;
/** Required. The relations to set for the memo. */
relations
:
MemoRelation
[];
}
export
interface
ListMemoRelationsRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo.
* Format: memos/{memo}
*/
name
:
string
;
/** Optional. The maximum number of relations to return. */
pageSize
:
number
;
/** Optional. A page token for pagination. */
pageToken
:
string
;
}
export
interface
ListMemoRelationsResponse
{
/** The list of relations. */
relations
:
MemoRelation
[];
/** A token for the next page of results. */
nextPageToken
:
string
;
/** The total count of relations. */
totalSize
:
number
;
}
export
interface
CreateMemoCommentRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo.
* Format: memos/{memo}
*/
name
:
string
;
/** The comment to create. */
comment
?:
Memo
|
undefined
;
/** Required. The comment to create. */
comment
?:
|
Memo
|
undefined
;
/** Optional. The comment ID to use. */
commentId
:
string
;
}
export
interface
ListMemoCommentsRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo.
* Format: memos/{memo}
*/
name
:
string
;
/** Optional. The maximum number of comments to return. */
pageSize
:
number
;
/** Optional. A page token for pagination. */
pageToken
:
string
;
/** Optional. The order to sort results by. */
orderBy
:
string
;
}
export
interface
ListMemoCommentsResponse
{
/** The list of comment memos. */
memos
:
Memo
[];
/** A token for the next page of results. */
nextPageToken
:
string
;
/** The total count of comments. */
totalSize
:
number
;
}
export
interface
ListMemoReactionsRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo.
* Format: memos/{memo}
*/
name
:
string
;
/** Optional. The maximum number of reactions to return. */
pageSize
:
number
;
/** Optional. A page token for pagination. */
pageToken
:
string
;
}
export
interface
ListMemoReactionsResponse
{
/** The list of reactions. */
reactions
:
Reaction
[];
/** A token for the next page of results. */
nextPageToken
:
string
;
/** The total count of reactions. */
totalSize
:
number
;
}
export
interface
UpsertMemoReactionRequest
{
/** The name of the memo. */
/**
* Required. The resource name of the memo.
* Format: memos/{memo}
*/
name
:
string
;
/** Required. The reaction to upsert. */
reaction
?:
Reaction
|
undefined
;
}
export
interface
DeleteMemoReactionRequest
{
/**
*
The id of the reaction
.
*
Refer to the `Reaction.id`.
*
Required. The resource name of the reaction to delete
.
*
Format: reactions/{reaction}
*/
id
:
number
;
name
:
string
;
}
function
createBaseReaction
():
Reaction
{
return
{
name
:
""
,
uid
:
""
,
creator
:
""
,
contentId
:
""
,
reactionType
:
""
,
createTime
:
undefined
};
}
export
const
Reaction
:
MessageFns
<
Reaction
>
=
{
encode
(
message
:
Reaction
,
writer
:
BinaryWriter
=
new
BinaryWriter
()):
BinaryWriter
{
if
(
message
.
name
!==
""
)
{
writer
.
uint32
(
10
).
string
(
message
.
name
);
}
if
(
message
.
uid
!==
""
)
{
writer
.
uint32
(
18
).
string
(
message
.
uid
);
}
if
(
message
.
creator
!==
""
)
{
writer
.
uint32
(
26
).
string
(
message
.
creator
);
}
if
(
message
.
contentId
!==
""
)
{
writer
.
uint32
(
34
).
string
(
message
.
contentId
);
}
if
(
message
.
reactionType
!==
""
)
{
writer
.
uint32
(
42
).
string
(
message
.
reactionType
);
}
if
(
message
.
createTime
!==
undefined
)
{
Timestamp
.
encode
(
toTimestamp
(
message
.
createTime
),
writer
.
uint32
(
50
).
fork
()).
join
();
}
return
writer
;
},
decode
(
input
:
BinaryReader
|
Uint8Array
,
length
?:
number
):
Reaction
{
const
reader
=
input
instanceof
BinaryReader
?
input
:
new
BinaryReader
(
input
);
let
end
=
length
===
undefined
?
reader
.
len
:
reader
.
pos
+
length
;
const
message
=
createBaseReaction
();
while
(
reader
.
pos
<
end
)
{
const
tag
=
reader
.
uint32
();
switch
(
tag
>>>
3
)
{
case
1
:
{
if
(
tag
!==
10
)
{
break
;
}
message
.
name
=
reader
.
string
();
continue
;
}
case
2
:
{
if
(
tag
!==
18
)
{
break
;
}
message
.
uid
=
reader
.
string
();
continue
;
}
case
3
:
{
if
(
tag
!==
26
)
{
break
;
}
message
.
creator
=
reader
.
string
();
continue
;
}
case
4
:
{
if
(
tag
!==
34
)
{
break
;
}
message
.
contentId
=
reader
.
string
();
continue
;
}
case
5
:
{
if
(
tag
!==
42
)
{
break
;
}
message
.
reactionType
=
reader
.
string
();
continue
;
}
case
6
:
{
if
(
tag
!==
50
)
{
break
;
}
message
.
createTime
=
fromTimestamp
(
Timestamp
.
decode
(
reader
,
reader
.
uint32
()));
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
}
reader
.
skip
(
tag
&
7
);
}
return
message
;
},
create
(
base
?:
DeepPartial
<
Reaction
>
):
Reaction
{
return
Reaction
.
fromPartial
(
base
??
{});
},
fromPartial
(
object
:
DeepPartial
<
Reaction
>
):
Reaction
{
const
message
=
createBaseReaction
();
message
.
name
=
object
.
name
??
""
;
message
.
uid
=
object
.
uid
??
""
;
message
.
creator
=
object
.
creator
??
""
;
message
.
contentId
=
object
.
contentId
??
""
;
message
.
reactionType
=
object
.
reactionType
??
""
;
message
.
createTime
=
object
.
createTime
??
undefined
;
return
message
;
},
};
function
createBaseMemo
():
Memo
{
return
{
name
:
""
,
...
...
@@ -757,7 +1029,7 @@ export const Location: MessageFns<Location> = {
};
function
createBaseCreateMemoRequest
():
CreateMemoRequest
{
return
{
memo
:
undefined
};
return
{
memo
:
undefined
,
memoId
:
""
,
validateOnly
:
false
,
requestId
:
""
};
}
export
const
CreateMemoRequest
:
MessageFns
<
CreateMemoRequest
>
=
{
...
...
@@ -765,6 +1037,15 @@ export const CreateMemoRequest: MessageFns<CreateMemoRequest> = {
if
(
message
.
memo
!==
undefined
)
{
Memo
.
encode
(
message
.
memo
,
writer
.
uint32
(
10
).
fork
()).
join
();
}
if
(
message
.
memoId
!==
""
)
{
writer
.
uint32
(
18
).
string
(
message
.
memoId
);
}
if
(
message
.
validateOnly
!==
false
)
{
writer
.
uint32
(
24
).
bool
(
message
.
validateOnly
);
}
if
(
message
.
requestId
!==
""
)
{
writer
.
uint32
(
34
).
string
(
message
.
requestId
);
}
return
writer
;
},
...
...
@@ -783,6 +1064,30 @@ export const CreateMemoRequest: MessageFns<CreateMemoRequest> = {
message
.
memo
=
Memo
.
decode
(
reader
,
reader
.
uint32
());
continue
;
}
case
2
:
{
if
(
tag
!==
18
)
{
break
;
}
message
.
memoId
=
reader
.
string
();
continue
;
}
case
3
:
{
if
(
tag
!==
24
)
{
break
;
}
message
.
validateOnly
=
reader
.
bool
();
continue
;
}
case
4
:
{
if
(
tag
!==
34
)
{
break
;
}
message
.
requestId
=
reader
.
string
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -798,6 +1103,9 @@ export const CreateMemoRequest: MessageFns<CreateMemoRequest> = {
fromPartial
(
object
:
DeepPartial
<
CreateMemoRequest
>
):
CreateMemoRequest
{
const
message
=
createBaseCreateMemoRequest
();
message
.
memo
=
(
object
.
memo
!==
undefined
&&
object
.
memo
!==
null
)
?
Memo
.
fromPartial
(
object
.
memo
)
:
undefined
;
message
.
memoId
=
object
.
memoId
??
""
;
message
.
validateOnly
=
object
.
validateOnly
??
false
;
message
.
requestId
=
object
.
requestId
??
""
;
return
message
;
},
};
...
...
@@ -808,9 +1116,9 @@ function createBaseListMemosRequest(): ListMemosRequest {
pageSize
:
0
,
pageToken
:
""
,
state
:
State
.
STATE_UNSPECIFIED
,
sort
:
""
,
direction
:
Direction
.
DIRECTION_UNSPECIFIED
,
orderBy
:
""
,
filter
:
""
,
showDeleted
:
false
,
oldFilter
:
""
,
};
}
...
...
@@ -829,14 +1137,14 @@ export const ListMemosRequest: MessageFns<ListMemosRequest> = {
if
(
message
.
state
!==
State
.
STATE_UNSPECIFIED
)
{
writer
.
uint32
(
32
).
int32
(
stateToNumber
(
message
.
state
));
}
if
(
message
.
sort
!==
""
)
{
writer
.
uint32
(
42
).
string
(
message
.
sort
);
}
if
(
message
.
direction
!==
Direction
.
DIRECTION_UNSPECIFIED
)
{
writer
.
uint32
(
48
).
int32
(
directionToNumber
(
message
.
direction
));
if
(
message
.
orderBy
!==
""
)
{
writer
.
uint32
(
42
).
string
(
message
.
orderBy
);
}
if
(
message
.
filter
!==
""
)
{
writer
.
uint32
(
58
).
string
(
message
.
filter
);
writer
.
uint32
(
50
).
string
(
message
.
filter
);
}
if
(
message
.
showDeleted
!==
false
)
{
writer
.
uint32
(
56
).
bool
(
message
.
showDeleted
);
}
if
(
message
.
oldFilter
!==
""
)
{
writer
.
uint32
(
66
).
string
(
message
.
oldFilter
);
...
...
@@ -888,23 +1196,23 @@ export const ListMemosRequest: MessageFns<ListMemosRequest> = {
break
;
}
message
.
sort
=
reader
.
string
();
message
.
orderBy
=
reader
.
string
();
continue
;
}
case
6
:
{
if
(
tag
!==
48
)
{
if
(
tag
!==
50
)
{
break
;
}
message
.
direction
=
directionFromJSON
(
reader
.
int32
()
);
message
.
filter
=
reader
.
string
(
);
continue
;
}
case
7
:
{
if
(
tag
!==
5
8
)
{
if
(
tag
!==
5
6
)
{
break
;
}
message
.
filter
=
reader
.
string
();
message
.
showDeleted
=
reader
.
bool
();
continue
;
}
case
8
:
{
...
...
@@ -933,16 +1241,16 @@ export const ListMemosRequest: MessageFns<ListMemosRequest> = {
message
.
pageSize
=
object
.
pageSize
??
0
;
message
.
pageToken
=
object
.
pageToken
??
""
;
message
.
state
=
object
.
state
??
State
.
STATE_UNSPECIFIED
;
message
.
sort
=
object
.
sort
??
""
;
message
.
direction
=
object
.
direction
??
Direction
.
DIRECTION_UNSPECIFIED
;
message
.
orderBy
=
object
.
orderBy
??
""
;
message
.
filter
=
object
.
filter
??
""
;
message
.
showDeleted
=
object
.
showDeleted
??
false
;
message
.
oldFilter
=
object
.
oldFilter
??
""
;
return
message
;
},
};
function
createBaseListMemosResponse
():
ListMemosResponse
{
return
{
memos
:
[],
nextPageToken
:
""
};
return
{
memos
:
[],
nextPageToken
:
""
,
totalSize
:
0
};
}
export
const
ListMemosResponse
:
MessageFns
<
ListMemosResponse
>
=
{
...
...
@@ -953,6 +1261,9 @@ export const ListMemosResponse: MessageFns<ListMemosResponse> = {
if
(
message
.
nextPageToken
!==
""
)
{
writer
.
uint32
(
18
).
string
(
message
.
nextPageToken
);
}
if
(
message
.
totalSize
!==
0
)
{
writer
.
uint32
(
24
).
int32
(
message
.
totalSize
);
}
return
writer
;
},
...
...
@@ -979,6 +1290,14 @@ export const ListMemosResponse: MessageFns<ListMemosResponse> = {
message
.
nextPageToken
=
reader
.
string
();
continue
;
}
case
3
:
{
if
(
tag
!==
24
)
{
break
;
}
message
.
totalSize
=
reader
.
int32
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -995,12 +1314,13 @@ export const ListMemosResponse: MessageFns<ListMemosResponse> = {
const
message
=
createBaseListMemosResponse
();
message
.
memos
=
object
.
memos
?.
map
((
e
)
=>
Memo
.
fromPartial
(
e
))
||
[];
message
.
nextPageToken
=
object
.
nextPageToken
??
""
;
message
.
totalSize
=
object
.
totalSize
??
0
;
return
message
;
},
};
function
createBaseGetMemoRequest
():
GetMemoRequest
{
return
{
name
:
""
};
return
{
name
:
""
,
readMask
:
undefined
};
}
export
const
GetMemoRequest
:
MessageFns
<
GetMemoRequest
>
=
{
...
...
@@ -1008,6 +1328,9 @@ export const GetMemoRequest: MessageFns<GetMemoRequest> = {
if
(
message
.
name
!==
""
)
{
writer
.
uint32
(
10
).
string
(
message
.
name
);
}
if
(
message
.
readMask
!==
undefined
)
{
FieldMask
.
encode
(
FieldMask
.
wrap
(
message
.
readMask
),
writer
.
uint32
(
18
).
fork
()).
join
();
}
return
writer
;
},
...
...
@@ -1026,6 +1349,14 @@ export const GetMemoRequest: MessageFns<GetMemoRequest> = {
message
.
name
=
reader
.
string
();
continue
;
}
case
2
:
{
if
(
tag
!==
18
)
{
break
;
}
message
.
readMask
=
FieldMask
.
unwrap
(
FieldMask
.
decode
(
reader
,
reader
.
uint32
()));
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1041,12 +1372,13 @@ export const GetMemoRequest: MessageFns<GetMemoRequest> = {
fromPartial
(
object
:
DeepPartial
<
GetMemoRequest
>
):
GetMemoRequest
{
const
message
=
createBaseGetMemoRequest
();
message
.
name
=
object
.
name
??
""
;
message
.
readMask
=
object
.
readMask
??
undefined
;
return
message
;
},
};
function
createBaseUpdateMemoRequest
():
UpdateMemoRequest
{
return
{
memo
:
undefined
,
updateMask
:
undefined
};
return
{
memo
:
undefined
,
updateMask
:
undefined
,
allowMissing
:
false
};
}
export
const
UpdateMemoRequest
:
MessageFns
<
UpdateMemoRequest
>
=
{
...
...
@@ -1057,6 +1389,9 @@ export const UpdateMemoRequest: MessageFns<UpdateMemoRequest> = {
if
(
message
.
updateMask
!==
undefined
)
{
FieldMask
.
encode
(
FieldMask
.
wrap
(
message
.
updateMask
),
writer
.
uint32
(
18
).
fork
()).
join
();
}
if
(
message
.
allowMissing
!==
false
)
{
writer
.
uint32
(
24
).
bool
(
message
.
allowMissing
);
}
return
writer
;
},
...
...
@@ -1083,6 +1418,14 @@ export const UpdateMemoRequest: MessageFns<UpdateMemoRequest> = {
message
.
updateMask
=
FieldMask
.
unwrap
(
FieldMask
.
decode
(
reader
,
reader
.
uint32
()));
continue
;
}
case
3
:
{
if
(
tag
!==
24
)
{
break
;
}
message
.
allowMissing
=
reader
.
bool
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1099,12 +1442,13 @@ export const UpdateMemoRequest: MessageFns<UpdateMemoRequest> = {
const
message
=
createBaseUpdateMemoRequest
();
message
.
memo
=
(
object
.
memo
!==
undefined
&&
object
.
memo
!==
null
)
?
Memo
.
fromPartial
(
object
.
memo
)
:
undefined
;
message
.
updateMask
=
object
.
updateMask
??
undefined
;
message
.
allowMissing
=
object
.
allowMissing
??
false
;
return
message
;
},
};
function
createBaseDeleteMemoRequest
():
DeleteMemoRequest
{
return
{
name
:
""
};
return
{
name
:
""
,
force
:
false
};
}
export
const
DeleteMemoRequest
:
MessageFns
<
DeleteMemoRequest
>
=
{
...
...
@@ -1112,6 +1456,9 @@ export const DeleteMemoRequest: MessageFns<DeleteMemoRequest> = {
if
(
message
.
name
!==
""
)
{
writer
.
uint32
(
10
).
string
(
message
.
name
);
}
if
(
message
.
force
!==
false
)
{
writer
.
uint32
(
16
).
bool
(
message
.
force
);
}
return
writer
;
},
...
...
@@ -1130,6 +1477,14 @@ export const DeleteMemoRequest: MessageFns<DeleteMemoRequest> = {
message
.
name
=
reader
.
string
();
continue
;
}
case
2
:
{
if
(
tag
!==
16
)
{
break
;
}
message
.
force
=
reader
.
bool
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1145,6 +1500,7 @@ export const DeleteMemoRequest: MessageFns<DeleteMemoRequest> = {
fromPartial
(
object
:
DeepPartial
<
DeleteMemoRequest
>
):
DeleteMemoRequest
{
const
message
=
createBaseDeleteMemoRequest
();
message
.
name
=
object
.
name
??
""
;
message
.
force
=
object
.
force
??
false
;
return
message
;
},
};
...
...
@@ -1348,7 +1704,7 @@ export const SetMemoAttachmentsRequest: MessageFns<SetMemoAttachmentsRequest> =
};
function
createBaseListMemoAttachmentsRequest
():
ListMemoAttachmentsRequest
{
return
{
name
:
""
};
return
{
name
:
""
,
pageSize
:
0
,
pageToken
:
""
};
}
export
const
ListMemoAttachmentsRequest
:
MessageFns
<
ListMemoAttachmentsRequest
>
=
{
...
...
@@ -1356,6 +1712,12 @@ export const ListMemoAttachmentsRequest: MessageFns<ListMemoAttachmentsRequest>
if
(
message
.
name
!==
""
)
{
writer
.
uint32
(
10
).
string
(
message
.
name
);
}
if
(
message
.
pageSize
!==
0
)
{
writer
.
uint32
(
16
).
int32
(
message
.
pageSize
);
}
if
(
message
.
pageToken
!==
""
)
{
writer
.
uint32
(
26
).
string
(
message
.
pageToken
);
}
return
writer
;
},
...
...
@@ -1374,6 +1736,22 @@ export const ListMemoAttachmentsRequest: MessageFns<ListMemoAttachmentsRequest>
message
.
name
=
reader
.
string
();
continue
;
}
case
2
:
{
if
(
tag
!==
16
)
{
break
;
}
message
.
pageSize
=
reader
.
int32
();
continue
;
}
case
3
:
{
if
(
tag
!==
26
)
{
break
;
}
message
.
pageToken
=
reader
.
string
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1389,12 +1767,14 @@ export const ListMemoAttachmentsRequest: MessageFns<ListMemoAttachmentsRequest>
fromPartial
(
object
:
DeepPartial
<
ListMemoAttachmentsRequest
>
):
ListMemoAttachmentsRequest
{
const
message
=
createBaseListMemoAttachmentsRequest
();
message
.
name
=
object
.
name
??
""
;
message
.
pageSize
=
object
.
pageSize
??
0
;
message
.
pageToken
=
object
.
pageToken
??
""
;
return
message
;
},
};
function
createBaseListMemoAttachmentsResponse
():
ListMemoAttachmentsResponse
{
return
{
attachments
:
[]
};
return
{
attachments
:
[]
,
nextPageToken
:
""
,
totalSize
:
0
};
}
export
const
ListMemoAttachmentsResponse
:
MessageFns
<
ListMemoAttachmentsResponse
>
=
{
...
...
@@ -1402,6 +1782,12 @@ export const ListMemoAttachmentsResponse: MessageFns<ListMemoAttachmentsResponse
for
(
const
v
of
message
.
attachments
)
{
Attachment
.
encode
(
v
!
,
writer
.
uint32
(
10
).
fork
()).
join
();
}
if
(
message
.
nextPageToken
!==
""
)
{
writer
.
uint32
(
18
).
string
(
message
.
nextPageToken
);
}
if
(
message
.
totalSize
!==
0
)
{
writer
.
uint32
(
24
).
int32
(
message
.
totalSize
);
}
return
writer
;
},
...
...
@@ -1420,6 +1806,22 @@ export const ListMemoAttachmentsResponse: MessageFns<ListMemoAttachmentsResponse
message
.
attachments
.
push
(
Attachment
.
decode
(
reader
,
reader
.
uint32
()));
continue
;
}
case
2
:
{
if
(
tag
!==
18
)
{
break
;
}
message
.
nextPageToken
=
reader
.
string
();
continue
;
}
case
3
:
{
if
(
tag
!==
24
)
{
break
;
}
message
.
totalSize
=
reader
.
int32
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1435,6 +1837,8 @@ export const ListMemoAttachmentsResponse: MessageFns<ListMemoAttachmentsResponse
fromPartial
(
object
:
DeepPartial
<
ListMemoAttachmentsResponse
>
):
ListMemoAttachmentsResponse
{
const
message
=
createBaseListMemoAttachmentsResponse
();
message
.
attachments
=
object
.
attachments
?.
map
((
e
)
=>
Attachment
.
fromPartial
(
e
))
||
[];
message
.
nextPageToken
=
object
.
nextPageToken
??
""
;
message
.
totalSize
=
object
.
totalSize
??
0
;
return
message
;
},
};
...
...
@@ -1642,7 +2046,7 @@ export const SetMemoRelationsRequest: MessageFns<SetMemoRelationsRequest> = {
};
function
createBaseListMemoRelationsRequest
():
ListMemoRelationsRequest
{
return
{
name
:
""
};
return
{
name
:
""
,
pageSize
:
0
,
pageToken
:
""
};
}
export
const
ListMemoRelationsRequest
:
MessageFns
<
ListMemoRelationsRequest
>
=
{
...
...
@@ -1650,6 +2054,12 @@ export const ListMemoRelationsRequest: MessageFns<ListMemoRelationsRequest> = {
if
(
message
.
name
!==
""
)
{
writer
.
uint32
(
10
).
string
(
message
.
name
);
}
if
(
message
.
pageSize
!==
0
)
{
writer
.
uint32
(
16
).
int32
(
message
.
pageSize
);
}
if
(
message
.
pageToken
!==
""
)
{
writer
.
uint32
(
26
).
string
(
message
.
pageToken
);
}
return
writer
;
},
...
...
@@ -1668,6 +2078,22 @@ export const ListMemoRelationsRequest: MessageFns<ListMemoRelationsRequest> = {
message
.
name
=
reader
.
string
();
continue
;
}
case
2
:
{
if
(
tag
!==
16
)
{
break
;
}
message
.
pageSize
=
reader
.
int32
();
continue
;
}
case
3
:
{
if
(
tag
!==
26
)
{
break
;
}
message
.
pageToken
=
reader
.
string
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1683,12 +2109,14 @@ export const ListMemoRelationsRequest: MessageFns<ListMemoRelationsRequest> = {
fromPartial
(
object
:
DeepPartial
<
ListMemoRelationsRequest
>
):
ListMemoRelationsRequest
{
const
message
=
createBaseListMemoRelationsRequest
();
message
.
name
=
object
.
name
??
""
;
message
.
pageSize
=
object
.
pageSize
??
0
;
message
.
pageToken
=
object
.
pageToken
??
""
;
return
message
;
},
};
function
createBaseListMemoRelationsResponse
():
ListMemoRelationsResponse
{
return
{
relations
:
[]
};
return
{
relations
:
[]
,
nextPageToken
:
""
,
totalSize
:
0
};
}
export
const
ListMemoRelationsResponse
:
MessageFns
<
ListMemoRelationsResponse
>
=
{
...
...
@@ -1696,6 +2124,12 @@ export const ListMemoRelationsResponse: MessageFns<ListMemoRelationsResponse> =
for
(
const
v
of
message
.
relations
)
{
MemoRelation
.
encode
(
v
!
,
writer
.
uint32
(
10
).
fork
()).
join
();
}
if
(
message
.
nextPageToken
!==
""
)
{
writer
.
uint32
(
18
).
string
(
message
.
nextPageToken
);
}
if
(
message
.
totalSize
!==
0
)
{
writer
.
uint32
(
24
).
int32
(
message
.
totalSize
);
}
return
writer
;
},
...
...
@@ -1714,6 +2148,22 @@ export const ListMemoRelationsResponse: MessageFns<ListMemoRelationsResponse> =
message
.
relations
.
push
(
MemoRelation
.
decode
(
reader
,
reader
.
uint32
()));
continue
;
}
case
2
:
{
if
(
tag
!==
18
)
{
break
;
}
message
.
nextPageToken
=
reader
.
string
();
continue
;
}
case
3
:
{
if
(
tag
!==
24
)
{
break
;
}
message
.
totalSize
=
reader
.
int32
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1729,12 +2179,14 @@ export const ListMemoRelationsResponse: MessageFns<ListMemoRelationsResponse> =
fromPartial
(
object
:
DeepPartial
<
ListMemoRelationsResponse
>
):
ListMemoRelationsResponse
{
const
message
=
createBaseListMemoRelationsResponse
();
message
.
relations
=
object
.
relations
?.
map
((
e
)
=>
MemoRelation
.
fromPartial
(
e
))
||
[];
message
.
nextPageToken
=
object
.
nextPageToken
??
""
;
message
.
totalSize
=
object
.
totalSize
??
0
;
return
message
;
},
};
function
createBaseCreateMemoCommentRequest
():
CreateMemoCommentRequest
{
return
{
name
:
""
,
comment
:
undefined
};
return
{
name
:
""
,
comment
:
undefined
,
commentId
:
""
};
}
export
const
CreateMemoCommentRequest
:
MessageFns
<
CreateMemoCommentRequest
>
=
{
...
...
@@ -1745,6 +2197,9 @@ export const CreateMemoCommentRequest: MessageFns<CreateMemoCommentRequest> = {
if
(
message
.
comment
!==
undefined
)
{
Memo
.
encode
(
message
.
comment
,
writer
.
uint32
(
18
).
fork
()).
join
();
}
if
(
message
.
commentId
!==
""
)
{
writer
.
uint32
(
26
).
string
(
message
.
commentId
);
}
return
writer
;
},
...
...
@@ -1771,6 +2226,14 @@ export const CreateMemoCommentRequest: MessageFns<CreateMemoCommentRequest> = {
message
.
comment
=
Memo
.
decode
(
reader
,
reader
.
uint32
());
continue
;
}
case
3
:
{
if
(
tag
!==
26
)
{
break
;
}
message
.
commentId
=
reader
.
string
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1789,12 +2252,13 @@ export const CreateMemoCommentRequest: MessageFns<CreateMemoCommentRequest> = {
message
.
comment
=
(
object
.
comment
!==
undefined
&&
object
.
comment
!==
null
)
?
Memo
.
fromPartial
(
object
.
comment
)
:
undefined
;
message
.
commentId
=
object
.
commentId
??
""
;
return
message
;
},
};
function
createBaseListMemoCommentsRequest
():
ListMemoCommentsRequest
{
return
{
name
:
""
};
return
{
name
:
""
,
pageSize
:
0
,
pageToken
:
""
,
orderBy
:
""
};
}
export
const
ListMemoCommentsRequest
:
MessageFns
<
ListMemoCommentsRequest
>
=
{
...
...
@@ -1802,6 +2266,15 @@ export const ListMemoCommentsRequest: MessageFns<ListMemoCommentsRequest> = {
if
(
message
.
name
!==
""
)
{
writer
.
uint32
(
10
).
string
(
message
.
name
);
}
if
(
message
.
pageSize
!==
0
)
{
writer
.
uint32
(
16
).
int32
(
message
.
pageSize
);
}
if
(
message
.
pageToken
!==
""
)
{
writer
.
uint32
(
26
).
string
(
message
.
pageToken
);
}
if
(
message
.
orderBy
!==
""
)
{
writer
.
uint32
(
34
).
string
(
message
.
orderBy
);
}
return
writer
;
},
...
...
@@ -1820,6 +2293,30 @@ export const ListMemoCommentsRequest: MessageFns<ListMemoCommentsRequest> = {
message
.
name
=
reader
.
string
();
continue
;
}
case
2
:
{
if
(
tag
!==
16
)
{
break
;
}
message
.
pageSize
=
reader
.
int32
();
continue
;
}
case
3
:
{
if
(
tag
!==
26
)
{
break
;
}
message
.
pageToken
=
reader
.
string
();
continue
;
}
case
4
:
{
if
(
tag
!==
34
)
{
break
;
}
message
.
orderBy
=
reader
.
string
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1835,12 +2332,15 @@ export const ListMemoCommentsRequest: MessageFns<ListMemoCommentsRequest> = {
fromPartial
(
object
:
DeepPartial
<
ListMemoCommentsRequest
>
):
ListMemoCommentsRequest
{
const
message
=
createBaseListMemoCommentsRequest
();
message
.
name
=
object
.
name
??
""
;
message
.
pageSize
=
object
.
pageSize
??
0
;
message
.
pageToken
=
object
.
pageToken
??
""
;
message
.
orderBy
=
object
.
orderBy
??
""
;
return
message
;
},
};
function
createBaseListMemoCommentsResponse
():
ListMemoCommentsResponse
{
return
{
memos
:
[]
};
return
{
memos
:
[]
,
nextPageToken
:
""
,
totalSize
:
0
};
}
export
const
ListMemoCommentsResponse
:
MessageFns
<
ListMemoCommentsResponse
>
=
{
...
...
@@ -1848,6 +2348,12 @@ export const ListMemoCommentsResponse: MessageFns<ListMemoCommentsResponse> = {
for
(
const
v
of
message
.
memos
)
{
Memo
.
encode
(
v
!
,
writer
.
uint32
(
10
).
fork
()).
join
();
}
if
(
message
.
nextPageToken
!==
""
)
{
writer
.
uint32
(
18
).
string
(
message
.
nextPageToken
);
}
if
(
message
.
totalSize
!==
0
)
{
writer
.
uint32
(
24
).
int32
(
message
.
totalSize
);
}
return
writer
;
},
...
...
@@ -1866,6 +2372,22 @@ export const ListMemoCommentsResponse: MessageFns<ListMemoCommentsResponse> = {
message
.
memos
.
push
(
Memo
.
decode
(
reader
,
reader
.
uint32
()));
continue
;
}
case
2
:
{
if
(
tag
!==
18
)
{
break
;
}
message
.
nextPageToken
=
reader
.
string
();
continue
;
}
case
3
:
{
if
(
tag
!==
24
)
{
break
;
}
message
.
totalSize
=
reader
.
int32
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1881,12 +2403,14 @@ export const ListMemoCommentsResponse: MessageFns<ListMemoCommentsResponse> = {
fromPartial
(
object
:
DeepPartial
<
ListMemoCommentsResponse
>
):
ListMemoCommentsResponse
{
const
message
=
createBaseListMemoCommentsResponse
();
message
.
memos
=
object
.
memos
?.
map
((
e
)
=>
Memo
.
fromPartial
(
e
))
||
[];
message
.
nextPageToken
=
object
.
nextPageToken
??
""
;
message
.
totalSize
=
object
.
totalSize
??
0
;
return
message
;
},
};
function
createBaseListMemoReactionsRequest
():
ListMemoReactionsRequest
{
return
{
name
:
""
};
return
{
name
:
""
,
pageSize
:
0
,
pageToken
:
""
};
}
export
const
ListMemoReactionsRequest
:
MessageFns
<
ListMemoReactionsRequest
>
=
{
...
...
@@ -1894,6 +2418,12 @@ export const ListMemoReactionsRequest: MessageFns<ListMemoReactionsRequest> = {
if
(
message
.
name
!==
""
)
{
writer
.
uint32
(
10
).
string
(
message
.
name
);
}
if
(
message
.
pageSize
!==
0
)
{
writer
.
uint32
(
16
).
int32
(
message
.
pageSize
);
}
if
(
message
.
pageToken
!==
""
)
{
writer
.
uint32
(
26
).
string
(
message
.
pageToken
);
}
return
writer
;
},
...
...
@@ -1912,6 +2442,22 @@ export const ListMemoReactionsRequest: MessageFns<ListMemoReactionsRequest> = {
message
.
name
=
reader
.
string
();
continue
;
}
case
2
:
{
if
(
tag
!==
16
)
{
break
;
}
message
.
pageSize
=
reader
.
int32
();
continue
;
}
case
3
:
{
if
(
tag
!==
26
)
{
break
;
}
message
.
pageToken
=
reader
.
string
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1927,12 +2473,14 @@ export const ListMemoReactionsRequest: MessageFns<ListMemoReactionsRequest> = {
fromPartial
(
object
:
DeepPartial
<
ListMemoReactionsRequest
>
):
ListMemoReactionsRequest
{
const
message
=
createBaseListMemoReactionsRequest
();
message
.
name
=
object
.
name
??
""
;
message
.
pageSize
=
object
.
pageSize
??
0
;
message
.
pageToken
=
object
.
pageToken
??
""
;
return
message
;
},
};
function
createBaseListMemoReactionsResponse
():
ListMemoReactionsResponse
{
return
{
reactions
:
[]
};
return
{
reactions
:
[]
,
nextPageToken
:
""
,
totalSize
:
0
};
}
export
const
ListMemoReactionsResponse
:
MessageFns
<
ListMemoReactionsResponse
>
=
{
...
...
@@ -1940,6 +2488,12 @@ export const ListMemoReactionsResponse: MessageFns<ListMemoReactionsResponse> =
for
(
const
v
of
message
.
reactions
)
{
Reaction
.
encode
(
v
!
,
writer
.
uint32
(
10
).
fork
()).
join
();
}
if
(
message
.
nextPageToken
!==
""
)
{
writer
.
uint32
(
18
).
string
(
message
.
nextPageToken
);
}
if
(
message
.
totalSize
!==
0
)
{
writer
.
uint32
(
24
).
int32
(
message
.
totalSize
);
}
return
writer
;
},
...
...
@@ -1958,6 +2512,22 @@ export const ListMemoReactionsResponse: MessageFns<ListMemoReactionsResponse> =
message
.
reactions
.
push
(
Reaction
.
decode
(
reader
,
reader
.
uint32
()));
continue
;
}
case
2
:
{
if
(
tag
!==
18
)
{
break
;
}
message
.
nextPageToken
=
reader
.
string
();
continue
;
}
case
3
:
{
if
(
tag
!==
24
)
{
break
;
}
message
.
totalSize
=
reader
.
int32
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
...
...
@@ -1973,6 +2543,8 @@ export const ListMemoReactionsResponse: MessageFns<ListMemoReactionsResponse> =
fromPartial
(
object
:
DeepPartial
<
ListMemoReactionsResponse
>
):
ListMemoReactionsResponse
{
const
message
=
createBaseListMemoReactionsResponse
();
message
.
reactions
=
object
.
reactions
?.
map
((
e
)
=>
Reaction
.
fromPartial
(
e
))
||
[];
message
.
nextPageToken
=
object
.
nextPageToken
??
""
;
message
.
totalSize
=
object
.
totalSize
??
0
;
return
message
;
},
};
...
...
@@ -2038,13 +2610,13 @@ export const UpsertMemoReactionRequest: MessageFns<UpsertMemoReactionRequest> =
};
function
createBaseDeleteMemoReactionRequest
():
DeleteMemoReactionRequest
{
return
{
id
:
0
};
return
{
name
:
""
};
}
export
const
DeleteMemoReactionRequest
:
MessageFns
<
DeleteMemoReactionRequest
>
=
{
encode
(
message
:
DeleteMemoReactionRequest
,
writer
:
BinaryWriter
=
new
BinaryWriter
()):
BinaryWriter
{
if
(
message
.
id
!==
0
)
{
writer
.
uint32
(
8
).
int32
(
message
.
id
);
if
(
message
.
name
!==
""
)
{
writer
.
uint32
(
10
).
string
(
message
.
name
);
}
return
writer
;
},
...
...
@@ -2057,11 +2629,11 @@ export const DeleteMemoReactionRequest: MessageFns<DeleteMemoReactionRequest> =
const
tag
=
reader
.
uint32
();
switch
(
tag
>>>
3
)
{
case
1
:
{
if
(
tag
!==
8
)
{
if
(
tag
!==
10
)
{
break
;
}
message
.
id
=
reader
.
int32
();
message
.
name
=
reader
.
string
();
continue
;
}
}
...
...
@@ -2078,7 +2650,7 @@ export const DeleteMemoReactionRequest: MessageFns<DeleteMemoReactionRequest> =
},
fromPartial
(
object
:
DeepPartial
<
DeleteMemoReactionRequest
>
):
DeleteMemoReactionRequest
{
const
message
=
createBaseDeleteMemoReactionRequest
();
message
.
id
=
object
.
id
??
0
;
message
.
name
=
object
.
name
??
""
;
return
message
;
},
};
...
...
@@ -2097,6 +2669,7 @@ export const MemoServiceDefinition = {
responseStream
:
false
,
options
:
{
_unknownFields
:
{
8410
:
[
new
Uint8Array
([
4
,
109
,
101
,
109
,
111
])],
578365826
:
[
new
Uint8Array
([
21
,
...
...
@@ -2135,6 +2708,7 @@ export const MemoServiceDefinition = {
responseStream
:
false
,
options
:
{
_unknownFields
:
{
8410
:
[
new
Uint8Array
([
0
]),
new
Uint8Array
([
6
,
112
,
97
,
114
,
101
,
110
,
116
])],
578365826
:
[
new
Uint8Array
([
49
,
...
...
@@ -2338,6 +2912,33 @@ export const MemoServiceDefinition = {
responseStream
:
false
,
options
:
{
_unknownFields
:
{
8410
:
[
new
Uint8Array
([
22
,
112
,
97
,
114
,
101
,
110
,
116
,
44
,
111
,
108
,
100
,
95
,
116
,
97
,
103
,
44
,
110
,
101
,
119
,
95
,
116
,
97
,
103
,
]),
],
578365826
:
[
new
Uint8Array
([
41
,
...
...
@@ -2396,6 +2997,7 @@ export const MemoServiceDefinition = {
responseStream
:
false
,
options
:
{
_unknownFields
:
{
8410
:
[
new
Uint8Array
([
10
,
112
,
97
,
114
,
101
,
110
,
116
,
44
,
116
,
97
,
103
])],
578365826
:
[
new
Uint8Array
([
37
,
...
...
@@ -2668,7 +3270,7 @@ export const MemoServiceDefinition = {
responseStream
:
false
,
options
:
{
_unknownFields
:
{
8410
:
[
new
Uint8Array
([
4
,
110
,
97
,
109
,
101
])],
8410
:
[
new
Uint8Array
([
12
,
110
,
97
,
109
,
101
,
44
,
99
,
111
,
109
,
109
,
101
,
110
,
116
])],
578365826
:
[
new
Uint8Array
([
42
,
...
...
@@ -2886,12 +3488,12 @@ export const MemoServiceDefinition = {
responseStream
:
false
,
options
:
{
_unknownFields
:
{
8410
:
[
new
Uint8Array
([
2
,
105
,
100
])],
8410
:
[
new
Uint8Array
([
4
,
110
,
97
,
109
,
101
])],
578365826
:
[
new
Uint8Array
([
2
4
,
2
8
,
42
,
2
2
,
2
6
,
47
,
97
,
112
,
...
...
@@ -2900,6 +3502,12 @@ export const MemoServiceDefinition = {
118
,
49
,
47
,
123
,
110
,
97
,
109
,
101
,
61
,
114
,
101
,
97
,
...
...
@@ -2910,9 +3518,7 @@ export const MemoServiceDefinition = {
110
,
115
,
47
,
123
,
105
,
100
,
42
,
125
,
]),
],
...
...
web/src/types/proto/api/v1/reaction_service.ts
deleted
100644 → 0
View file @
91c2a4ce
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: api/v1/reaction_service.proto
/* eslint-disable */
import
{
BinaryReader
,
BinaryWriter
}
from
"@bufbuild/protobuf/wire"
;
export
const
protobufPackage
=
"memos.api.v1"
;
export
interface
Reaction
{
id
:
number
;
/**
* The name of the creator.
* Format: users/{user}
*/
creator
:
string
;
/**
* The content identifier.
* For memo, it should be the `Memo.name`.
*/
contentId
:
string
;
reactionType
:
string
;
}
function
createBaseReaction
():
Reaction
{
return
{
id
:
0
,
creator
:
""
,
contentId
:
""
,
reactionType
:
""
};
}
export
const
Reaction
:
MessageFns
<
Reaction
>
=
{
encode
(
message
:
Reaction
,
writer
:
BinaryWriter
=
new
BinaryWriter
()):
BinaryWriter
{
if
(
message
.
id
!==
0
)
{
writer
.
uint32
(
8
).
int32
(
message
.
id
);
}
if
(
message
.
creator
!==
""
)
{
writer
.
uint32
(
18
).
string
(
message
.
creator
);
}
if
(
message
.
contentId
!==
""
)
{
writer
.
uint32
(
26
).
string
(
message
.
contentId
);
}
if
(
message
.
reactionType
!==
""
)
{
writer
.
uint32
(
34
).
string
(
message
.
reactionType
);
}
return
writer
;
},
decode
(
input
:
BinaryReader
|
Uint8Array
,
length
?:
number
):
Reaction
{
const
reader
=
input
instanceof
BinaryReader
?
input
:
new
BinaryReader
(
input
);
let
end
=
length
===
undefined
?
reader
.
len
:
reader
.
pos
+
length
;
const
message
=
createBaseReaction
();
while
(
reader
.
pos
<
end
)
{
const
tag
=
reader
.
uint32
();
switch
(
tag
>>>
3
)
{
case
1
:
{
if
(
tag
!==
8
)
{
break
;
}
message
.
id
=
reader
.
int32
();
continue
;
}
case
2
:
{
if
(
tag
!==
18
)
{
break
;
}
message
.
creator
=
reader
.
string
();
continue
;
}
case
3
:
{
if
(
tag
!==
26
)
{
break
;
}
message
.
contentId
=
reader
.
string
();
continue
;
}
case
4
:
{
if
(
tag
!==
34
)
{
break
;
}
message
.
reactionType
=
reader
.
string
();
continue
;
}
}
if
((
tag
&
7
)
===
4
||
tag
===
0
)
{
break
;
}
reader
.
skip
(
tag
&
7
);
}
return
message
;
},
create
(
base
?:
DeepPartial
<
Reaction
>
):
Reaction
{
return
Reaction
.
fromPartial
(
base
??
{});
},
fromPartial
(
object
:
DeepPartial
<
Reaction
>
):
Reaction
{
const
message
=
createBaseReaction
();
message
.
id
=
object
.
id
??
0
;
message
.
creator
=
object
.
creator
??
""
;
message
.
contentId
=
object
.
contentId
??
""
;
message
.
reactionType
=
object
.
reactionType
??
""
;
return
message
;
},
};
type
Builtin
=
Date
|
Function
|
Uint8Array
|
string
|
number
|
boolean
|
undefined
;
export
type
DeepPartial
<
T
>
=
T
extends
Builtin
?
T
:
T
extends
globalThis
.
Array
<
infer
U
>
?
globalThis
.
Array
<
DeepPartial
<
U
>>
:
T
extends
ReadonlyArray
<
infer
U
>
?
ReadonlyArray
<
DeepPartial
<
U
>>
:
T
extends
{}
?
{
[
K
in
keyof
T
]?:
DeepPartial
<
T
[
K
]
>
}
:
Partial
<
T
>
;
export
interface
MessageFns
<
T
>
{
encode
(
message
:
T
,
writer
?:
BinaryWriter
):
BinaryWriter
;
decode
(
input
:
BinaryReader
|
Uint8Array
,
length
?:
number
):
T
;
create
(
base
?:
DeepPartial
<
T
>
):
T
;
fromPartial
(
object
:
DeepPartial
<
T
>
):
T
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment