chore: tweak comments

This commit is contained in:
Steven
2024-04-16 22:33:25 +08:00
parent f52e0e005a
commit 95df647265
28 changed files with 633 additions and 6968 deletions

View File

@@ -4,6 +4,7 @@ package memos.api.v2;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";
option go_package = "gen/api/v2";
@@ -17,25 +18,30 @@ service ActivityService {
}
message Activity {
// The system-generated unique identifier for the activity.
int32 id = 1;
// The system-generated unique identifier for the user who created the activity.
int32 creator_id = 2;
// The type of the activity.
string type = 3;
// The level of the activity.
string level = 4;
google.protobuf.Timestamp create_time = 5;
// The create time of the activity.
google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// The payload of the activity.
ActivityPayload payload = 6;
}
// ActivityMemoCommentPayload represents the payload of a memo comment activity.
message ActivityMemoCommentPayload {
// The memo id of comment.
int32 memo_id = 1;
// The memo id of related memo.
int32 related_memo_id = 2;
}
message ActivityVersionUpdatePayload {
// The updated version of memos.
string version = 1;
}
@@ -45,6 +51,7 @@ message ActivityPayload {
}
message GetActivityRequest {
// The system-generated unique identifier for the activity.
int32 id = 1;
}

View File

@@ -37,8 +37,11 @@ message GetAuthStatusResponse {
}
message SignInRequest {
// The username to sign in with.
string username = 1;
// The password to sign in with.
string password = 2;
// Whether the session should never expire.
bool never_expire = 3;
}
@@ -47,8 +50,11 @@ message SignInResponse {
}
message SignInWithSSORequest {
// The ID of the SSO provider.
int32 idp_id = 1;
// The code to sign in with.
string code = 2;
// The redirect URI.
string redirect_uri = 3;
}
@@ -57,7 +63,9 @@ message SignInWithSSOResponse {
}
message SignUpRequest {
// The username to sign up with.
string username = 1;
// The password to sign up with.
string password = 2;
}

View File

@@ -6,9 +6,7 @@ option go_package = "gen/api/v2";
enum RowStatus {
ROW_STATUS_UNSPECIFIED = 0;
ACTIVE = 1;
ARCHIVED = 2;
}

View File

@@ -9,15 +9,21 @@ import "google/protobuf/field_mask.proto";
option go_package = "gen/api/v2";
service IdentityProviderService {
// ListIdentityProviders lists identity providers.
rpc ListIdentityProviders(ListIdentityProvidersRequest) returns (ListIdentityProvidersResponse) {
option (google.api.http) = {get: "/api/v2/identityProviders"};
}
// GetIdentityProvider gets an identity provider.
rpc GetIdentityProvider(GetIdentityProviderRequest) returns (GetIdentityProviderResponse) {
option (google.api.http) = {get: "/api/v2/{name=identityProviders/*}"};
option (google.api.method_signature) = "name";
}
// CreateIdentityProvider creates an identity provider.
rpc CreateIdentityProvider(CreateIdentityProviderRequest) returns (CreateIdentityProviderResponse) {
option (google.api.http) = {post: "/api/v2/identityProviders"};
option (google.api.http) = {
post: "/api/v2/identityProviders",
body: "identity_provider"
};
}
// UpdateIdentityProvider updates an identity provider.
rpc UpdateIdentityProvider(UpdateIdentityProviderRequest) returns (UpdateIdentityProviderResponse) {

View File

@@ -7,8 +7,9 @@ import "google/api/annotations.proto";
option go_package = "gen/api/v2";
service LinkService {
// GetLinkMetadata returns metadata for a given link.
rpc GetLinkMetadata(GetLinkMetadataRequest) returns (GetLinkMetadataResponse) {
option (google.api.http) = {get: "/api/v2/link_metadata"};
option (google.api.http) = {get: "/api/v2/linkMetadata"};
}
}

View File

@@ -50,12 +50,15 @@ service MemoService {
}
// ExportMemos exports memos.
rpc ExportMemos(ExportMemosRequest) returns (ExportMemosResponse) {
option (google.api.http) = {post: "/api/v2/memos:export"};
option (google.api.http) = {
post: "/api/v2/memos:export",
body: "*"
};
}
// SetMemoResources sets resources for a memo.
rpc SetMemoResources(SetMemoResourcesRequest) returns (SetMemoResourcesResponse) {
option (google.api.http) = {
post: "/api/v2/{name=memos/*}/resources"
patch: "/api/v2/{name=memos/*}/resources"
body: "*"
};
option (google.api.method_signature) = "name";
@@ -68,7 +71,7 @@ service MemoService {
// SetMemoRelations sets relations for a memo.
rpc SetMemoRelations(SetMemoRelationsRequest) returns (SetMemoRelationsResponse) {
option (google.api.http) = {
post: "/api/v2/{name=memos/*}/relations"
patch: "/api/v2/{name=memos/*}/relations"
body: "*"
};
option (google.api.method_signature) = "name";
@@ -80,7 +83,10 @@ service MemoService {
}
// CreateMemoComment creates a comment for a memo.
rpc CreateMemoComment(CreateMemoCommentRequest) returns (CreateMemoCommentResponse) {
option (google.api.http) = {post: "/api/v2/{name=memos/*}/comments"};
option (google.api.http) = {
post: "/api/v2/{name=memos/*}/comments",
body: "*"
};
option (google.api.method_signature) = "name";
}
// ListMemoComments lists comments for a memo.
@@ -100,7 +106,10 @@ service MemoService {
}
// UpsertMemoReaction upserts a reaction for a memo.
rpc UpsertMemoReaction(UpsertMemoReactionRequest) returns (UpsertMemoReactionResponse) {
option (google.api.http) = {post: "/api/v2/{name=memos/*}/reactions"};
option (google.api.http) = {
post: "/api/v2/{name=memos/*}/reactions",
body: "*"
};
option (google.api.method_signature) = "name";
}
// DeleteMemoReaction deletes a reaction for a memo.
@@ -112,11 +121,8 @@ service MemoService {
enum Visibility {
VISIBILITY_UNSPECIFIED = 0;
PRIVATE = 1;
PROTECTED = 2;
PUBLIC = 3;
}

View File

@@ -13,7 +13,10 @@ option go_package = "gen/api/v2";
service ResourceService {
// CreateResource creates a new resource.
rpc CreateResource(CreateResourceRequest) returns (CreateResourceResponse) {
option (google.api.http) = {post: "/api/v2/resources"};
option (google.api.http) = {
post: "/api/v2/resources",
body: "resource"
};
}
// ListResources lists all resources.
rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) {

View File

@@ -9,11 +9,17 @@ option go_package = "gen/api/v2";
service TagService {
// UpsertTag upserts a tag.
rpc UpsertTag(UpsertTagRequest) returns (UpsertTagResponse) {
option (google.api.http) = {post: "/api/v2/tags"};
option (google.api.http) = {
post: "/api/v2/tags",
body: "*"
};
}
// BatchUpsertTag upserts multiple tags.
rpc BatchUpsertTag(BatchUpsertTagRequest) returns (BatchUpsertTagResponse) {
option (google.api.http) = {post: "/api/v2/tags:batchUpsert"};
option (google.api.http) = {
post: "/api/v2/tags:batchUpsert",
body: "*"
};
}
// ListTags lists tags.
rpc ListTags(ListTagsRequest) returns (ListTagsResponse) {
@@ -22,7 +28,10 @@ service TagService {
// RenameTag renames a tag.
// All related memos will be updated.
rpc RenameTag(RenameTagRequest) returns (RenameTagResponse) {
option (google.api.http) = {patch: "/api/v2/tags:rename"};
option (google.api.http) = {
patch: "/api/v2/tags:rename",
body: "*"
};
}
// DeleteTag deletes a tag.
rpc DeleteTag(DeleteTagRequest) returns (DeleteTagResponse) {

View File

@@ -16,18 +16,15 @@ service UserService {
rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {
option (google.api.http) = {get: "/api/v2/users"};
}
// SearchUsers searches users by filter.
rpc SearchUsers(SearchUsersRequest) returns (SearchUsersResponse) {
option (google.api.http) = {get: "/api/v2/users:search"};
}
// GetUser gets a user by name.
rpc GetUser(GetUserRequest) returns (GetUserResponse) {
option (google.api.http) = {get: "/api/v2/{name=users/*}"};
option (google.api.method_signature) = "name";
}
// CreateUser creates a new user.
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) {
option (google.api.http) = {
@@ -36,7 +33,6 @@ service UserService {
};
option (google.api.method_signature) = "user";
}
// UpdateUser updates a user.
rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) {
option (google.api.http) = {
@@ -45,19 +41,16 @@ service UserService {
};
option (google.api.method_signature) = "user,update_mask";
}
// DeleteUser deletes a user.
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) {
option (google.api.http) = {delete: "/api/v2/{name=users/*}"};
option (google.api.method_signature) = "name";
}
// GetUserSetting gets the setting of a user.
rpc GetUserSetting(GetUserSettingRequest) returns (GetUserSettingResponse) {
option (google.api.http) = {get: "/api/v2/{name=users/*}/setting"};
option (google.api.method_signature) = "name";
}
// UpdateUserSetting updates the setting of a user.
rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UpdateUserSettingResponse) {
option (google.api.http) = {
@@ -66,13 +59,11 @@ service UserService {
};
option (google.api.method_signature) = "setting,update_mask";
}
// ListUserAccessTokens returns a list of access tokens for a user.
rpc ListUserAccessTokens(ListUserAccessTokensRequest) returns (ListUserAccessTokensResponse) {
option (google.api.http) = {get: "/api/v2/{name=users/*}/access_tokens"};
option (google.api.method_signature) = "name";
}
// CreateUserAccessToken creates a new access token for a user.
rpc CreateUserAccessToken(CreateUserAccessTokenRequest) returns (CreateUserAccessTokenResponse) {
option (google.api.http) = {
@@ -81,7 +72,6 @@ service UserService {
};
option (google.api.method_signature) = "name";
}
// DeleteUserAccessToken deletes an access token for a user.
rpc DeleteUserAccessToken(DeleteUserAccessTokenRequest) returns (DeleteUserAccessTokenResponse) {
option (google.api.http) = {delete: "/api/v2/{name=users/*}/access_tokens/{access_token}"};