mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
refactor: api version
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
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";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service ActivityService {
|
||||
// GetActivity returns the activity with the given id.
|
||||
rpc GetActivity(GetActivityRequest) returns (Activity) {
|
||||
option (google.api.http) = {get: "/v2/activities/{id}"};
|
||||
option (google.api.http) = {get: "/api/v1/activities/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
}
|
@@ -1,33 +1,33 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "api/v2/user_service.proto";
|
||||
import "api/v1/user_service.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service AuthService {
|
||||
// GetAuthStatus returns the current auth status of the user.
|
||||
rpc GetAuthStatus(GetAuthStatusRequest) returns (User) {
|
||||
option (google.api.http) = {post: "/api/v2/auth/status"};
|
||||
option (google.api.http) = {post: "/api/v1/auth/status"};
|
||||
}
|
||||
// SignIn signs in the user with the given username and password.
|
||||
rpc SignIn(SignInRequest) returns (User) {
|
||||
option (google.api.http) = {post: "/api/v2/auth/signin"};
|
||||
option (google.api.http) = {post: "/api/v1/auth/signin"};
|
||||
}
|
||||
// SignInWithSSO signs in the user with the given SSO code.
|
||||
rpc SignInWithSSO(SignInWithSSORequest) returns (User) {
|
||||
option (google.api.http) = {post: "/api/v2/auth/signin/sso"};
|
||||
option (google.api.http) = {post: "/api/v1/auth/signin/sso"};
|
||||
}
|
||||
// SignUp signs up the user with the given username and password.
|
||||
rpc SignUp(SignUpRequest) returns (User) {
|
||||
option (google.api.http) = {post: "/api/v2/auth/signup"};
|
||||
option (google.api.http) = {post: "/api/v1/auth/signup"};
|
||||
}
|
||||
// SignOut signs out the user.
|
||||
rpc SignOut(SignOutRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {post: "/api/v2/auth/signout"};
|
||||
option (google.api.http) = {post: "/api/v1/auth/signout"};
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
enum RowStatus {
|
||||
ROW_STATUS_UNSPECIFIED = 0;
|
@@ -1,42 +1,42 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service IdentityProviderService {
|
||||
// ListIdentityProviders lists identity providers.
|
||||
rpc ListIdentityProviders(ListIdentityProvidersRequest) returns (ListIdentityProvidersResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/identityProviders"};
|
||||
option (google.api.http) = {get: "/api/v1/identityProviders"};
|
||||
}
|
||||
// GetIdentityProvider gets an identity provider.
|
||||
rpc GetIdentityProvider(GetIdentityProviderRequest) returns (IdentityProvider) {
|
||||
option (google.api.http) = {get: "/api/v2/{name=identityProviders/*}"};
|
||||
option (google.api.http) = {get: "/api/v1/{name=identityProviders/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// CreateIdentityProvider creates an identity provider.
|
||||
rpc CreateIdentityProvider(CreateIdentityProviderRequest) returns (IdentityProvider) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/identityProviders",
|
||||
post: "/api/v1/identityProviders",
|
||||
body: "identity_provider"
|
||||
};
|
||||
}
|
||||
// UpdateIdentityProvider updates an identity provider.
|
||||
rpc UpdateIdentityProvider(UpdateIdentityProviderRequest) returns (IdentityProvider) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/{identity_provider.name=identityProviders/*}"
|
||||
patch: "/api/v1/{identity_provider.name=identityProviders/*}"
|
||||
body: "identity_provider"
|
||||
};
|
||||
option (google.api.method_signature) = "identity_provider,update_mask";
|
||||
}
|
||||
// DeleteIdentityProvider deletes an identity provider.
|
||||
rpc DeleteIdentityProvider(DeleteIdentityProviderRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v2/{name=identityProviders/*}"};
|
||||
option (google.api.http) = {delete: "/api/v1/{name=identityProviders/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
@@ -8,24 +8,24 @@ import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service InboxService {
|
||||
// ListInboxes lists inboxes for a user.
|
||||
rpc ListInboxes(ListInboxesRequest) returns (ListInboxesResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/inboxes"};
|
||||
option (google.api.http) = {get: "/api/v1/inboxes"};
|
||||
}
|
||||
// UpdateInbox updates an inbox.
|
||||
rpc UpdateInbox(UpdateInboxRequest) returns (Inbox) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/{inbox.name=inboxes/*}"
|
||||
patch: "/api/v1/{inbox.name=inboxes/*}"
|
||||
body: "inbox"
|
||||
};
|
||||
option (google.api.method_signature) = "inbox,update_mask";
|
||||
}
|
||||
// DeleteInbox deletes an inbox.
|
||||
rpc DeleteInbox(DeleteInboxRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v2/{name=inboxes/*}"};
|
||||
option (google.api.http) = {delete: "/api/v1/{name=inboxes/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
}
|
@@ -1,15 +1,15 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service LinkService {
|
||||
// GetLinkMetadata returns metadata for a given link.
|
||||
rpc GetLinkMetadata(GetLinkMetadataRequest) returns (GetLinkMetadataResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/linkMetadata"};
|
||||
option (google.api.http) = {get: "/api/v1/linkMetadata"};
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
message MemoRelation {
|
||||
// The name of memo.
|
@@ -1,11 +1,11 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "api/v2/common.proto";
|
||||
import "api/v2/memo_relation_service.proto";
|
||||
import "api/v2/reaction_service.proto";
|
||||
import "api/v2/resource_service.proto";
|
||||
import "api/v1/common.proto";
|
||||
import "api/v1/memo_relation_service.proto";
|
||||
import "api/v1/reaction_service.proto";
|
||||
import "api/v1/resource_service.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
@@ -13,109 +13,109 @@ import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service MemoService {
|
||||
// CreateMemo creates a memo.
|
||||
rpc CreateMemo(CreateMemoRequest) returns (Memo) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/memos"
|
||||
post: "/api/v1/memos"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// ListMemos lists memos with pagination and filter.
|
||||
rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/memos"};
|
||||
option (google.api.http) = {get: "/api/v1/memos"};
|
||||
}
|
||||
// SearchMemos searches memos.
|
||||
rpc SearchMemos(SearchMemosRequest) returns (SearchMemosResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/memos:search"};
|
||||
option (google.api.http) = {get: "/api/v1/memos:search"};
|
||||
}
|
||||
// GetMemo gets a memo.
|
||||
rpc GetMemo(GetMemoRequest) returns (Memo) {
|
||||
option (google.api.http) = {get: "/api/v2/{name=memos/*}"};
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// UpdateMemo updates a memo.
|
||||
rpc UpdateMemo(UpdateMemoRequest) returns (Memo) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/{memo.name=memos/*}"
|
||||
patch: "/api/v1/{memo.name=memos/*}"
|
||||
body: "memo"
|
||||
};
|
||||
option (google.api.method_signature) = "memo,update_mask";
|
||||
}
|
||||
// DeleteMemo deletes a memo.
|
||||
rpc DeleteMemo(DeleteMemoRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v2/{name=memos/*}"};
|
||||
option (google.api.http) = {delete: "/api/v1/{name=memos/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// ExportMemos exports memos.
|
||||
rpc ExportMemos(ExportMemosRequest) returns (ExportMemosResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/memos:export",
|
||||
post: "/api/v1/memos:export",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// SetMemoResources sets resources for a memo.
|
||||
rpc SetMemoResources(SetMemoResourcesRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/{name=memos/*}/resources"
|
||||
patch: "/api/v1/{name=memos/*}/resources"
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// ListMemoResources lists resources for a memo.
|
||||
rpc ListMemoResources(ListMemoResourcesRequest) returns (ListMemoResourcesResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/{name=memos/*}/resources"};
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}/resources"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// SetMemoRelations sets relations for a memo.
|
||||
rpc SetMemoRelations(SetMemoRelationsRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/{name=memos/*}/relations"
|
||||
patch: "/api/v1/{name=memos/*}/relations"
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// ListMemoRelations lists relations for a memo.
|
||||
rpc ListMemoRelations(ListMemoRelationsRequest) returns (ListMemoRelationsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/{name=memos/*}/relations"};
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}/relations"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// CreateMemoComment creates a comment for a memo.
|
||||
rpc CreateMemoComment(CreateMemoCommentRequest) returns (Memo) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/{name=memos/*}/comments",
|
||||
post: "/api/v1/{name=memos/*}/comments",
|
||||
body: "comment"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// ListMemoComments lists comments for a memo.
|
||||
rpc ListMemoComments(ListMemoCommentsRequest) returns (ListMemoCommentsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/{name=memos/*}/comments"};
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}/comments"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// GetUserMemosStats gets stats of memos for a user.
|
||||
rpc GetUserMemosStats(GetUserMemosStatsRequest) returns (GetUserMemosStatsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/memos/stats"};
|
||||
option (google.api.http) = {get: "/api/v1/memos/stats"};
|
||||
option (google.api.method_signature) = "username";
|
||||
}
|
||||
// ListMemoReactions lists reactions for a memo.
|
||||
rpc ListMemoReactions(ListMemoReactionsRequest) returns (ListMemoReactionsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/{name=memos/*}/reactions"};
|
||||
option (google.api.http) = {get: "/api/v1/{name=memos/*}/reactions"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// UpsertMemoReaction upserts a reaction for a memo.
|
||||
rpc UpsertMemoReaction(UpsertMemoReactionRequest) returns (Reaction) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/{name=memos/*}/reactions",
|
||||
post: "/api/v1/{name=memos/*}/reactions",
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// DeleteMemoReaction deletes a reaction for a memo.
|
||||
rpc DeleteMemoReaction(DeleteMemoReactionRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v2/reactions/{reaction_id}"};
|
||||
option (google.api.http) = {delete: "/api/v1/reactions/{reaction_id}"};
|
||||
option (google.api.method_signature) = "reaction_id";
|
||||
}
|
||||
}
|
@@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
message Reaction {
|
||||
int32 id = 1;
|
@@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
@@ -9,40 +9,40 @@ import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service ResourceService {
|
||||
// CreateResource creates a new resource.
|
||||
rpc CreateResource(CreateResourceRequest) returns (Resource) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/resources",
|
||||
post: "/api/v1/resources",
|
||||
body: "resource"
|
||||
};
|
||||
}
|
||||
// ListResources lists all resources.
|
||||
rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/resources"};
|
||||
option (google.api.http) = {get: "/api/v1/resources"};
|
||||
}
|
||||
// SearchResources searches memos.
|
||||
rpc SearchResources(SearchResourcesRequest) returns (SearchResourcesResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/resources:search"};
|
||||
option (google.api.http) = {get: "/api/v1/resources:search"};
|
||||
}
|
||||
// GetResource returns a resource by name.
|
||||
rpc GetResource(GetResourceRequest) returns (Resource) {
|
||||
option (google.api.http) = {get: "/api/v2/{name=resources/*}"};
|
||||
option (google.api.http) = {get: "/api/v1/{name=resources/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// UpdateResource updates a resource.
|
||||
rpc UpdateResource(UpdateResourceRequest) returns (Resource) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/{resource.name=resources/*}",
|
||||
patch: "/api/v1/{resource.name=resources/*}",
|
||||
body: "resource"
|
||||
};
|
||||
option (google.api.method_signature) = "resource,update_mask";
|
||||
}
|
||||
// DeleteResource deletes a resource by name.
|
||||
rpc DeleteResource(DeleteResourceRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v2/{name=resources/*}"};
|
||||
option (google.api.http) = {delete: "/api/v1/{name=resources/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
}
|
@@ -1,41 +1,41 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service StorageService {
|
||||
// CreateStorage creates a new storage.
|
||||
rpc CreateStorage(CreateStorageRequest) returns (CreateStorageResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/storages"
|
||||
post: "/api/v1/storages"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// GetStorage returns a storage by id.
|
||||
rpc GetStorage(GetStorageRequest) returns (GetStorageResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/storages/{id}"};
|
||||
option (google.api.http) = {get: "/api/v1/storages/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// ListStorages returns a list of storages.
|
||||
rpc ListStorages(ListStoragesRequest) returns (ListStoragesResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/storages"};
|
||||
option (google.api.http) = {get: "/api/v1/storages"};
|
||||
}
|
||||
// UpdateStorage updates a storage.
|
||||
rpc UpdateStorage(UpdateStorageRequest) returns (UpdateStorageResponse) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/storages/{storage.id}"
|
||||
patch: "/api/v1/storages/{storage.id}"
|
||||
body: "storage"
|
||||
};
|
||||
option (google.api.method_signature) = "storage,update_mask";
|
||||
}
|
||||
// DeleteStorage deletes a storage by id.
|
||||
rpc DeleteStorage(DeleteStorageRequest) returns (DeleteStorageResponse) {
|
||||
option (google.api.http) = {delete: "/api/v2/storages/{id}"};
|
||||
option (google.api.http) = {delete: "/api/v1/storages/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
}
|
@@ -1,46 +1,46 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service TagService {
|
||||
// UpsertTag upserts a tag.
|
||||
rpc UpsertTag(UpsertTagRequest) returns (Tag) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/tags",
|
||||
post: "/api/v1/tags",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// BatchUpsertTag upserts multiple tags.
|
||||
rpc BatchUpsertTag(BatchUpsertTagRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/tags:batchUpsert",
|
||||
post: "/api/v1/tags:batchUpsert",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// ListTags lists tags.
|
||||
rpc ListTags(ListTagsRequest) returns (ListTagsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/tags"};
|
||||
option (google.api.http) = {get: "/api/v1/tags"};
|
||||
}
|
||||
// RenameTag renames a tag.
|
||||
// All related memos will be updated.
|
||||
rpc RenameTag(RenameTagRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/tags:rename",
|
||||
patch: "/api/v1/tags:rename",
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// DeleteTag deletes a tag.
|
||||
rpc DeleteTag(DeleteTagRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v2/tags"};
|
||||
option (google.api.http) = {delete: "/api/v1/tags"};
|
||||
}
|
||||
// GetTagSuggestions gets tag suggestions from the user's memos.
|
||||
rpc GetTagSuggestions(GetTagSuggestionsRequest) returns (GetTagSuggestionsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/tags/suggestion"};
|
||||
option (google.api.http) = {get: "/api/v1/tags/suggestion"};
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "api/v2/common.proto";
|
||||
import "api/v1/common.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
@@ -10,26 +10,26 @@ import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service UserService {
|
||||
// ListUsers returns a list of users.
|
||||
rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/users"};
|
||||
option (google.api.http) = {get: "/api/v1/users"};
|
||||
}
|
||||
// SearchUsers searches users by filter.
|
||||
rpc SearchUsers(SearchUsersRequest) returns (SearchUsersResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/users:search"};
|
||||
option (google.api.http) = {get: "/api/v1/users:search"};
|
||||
}
|
||||
// GetUser gets a user by name.
|
||||
rpc GetUser(GetUserRequest) returns (User) {
|
||||
option (google.api.http) = {get: "/api/v2/{name=users/*}"};
|
||||
option (google.api.http) = {get: "/api/v1/{name=users/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// CreateUser creates a new user.
|
||||
rpc CreateUser(CreateUserRequest) returns (User) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/users"
|
||||
post: "/api/v1/users"
|
||||
body: "user"
|
||||
};
|
||||
option (google.api.method_signature) = "user";
|
||||
@@ -37,45 +37,45 @@ service UserService {
|
||||
// UpdateUser updates a user.
|
||||
rpc UpdateUser(UpdateUserRequest) returns (User) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/{user.name=users/*}"
|
||||
patch: "/api/v1/{user.name=users/*}"
|
||||
body: "user"
|
||||
};
|
||||
option (google.api.method_signature) = "user,update_mask";
|
||||
}
|
||||
// DeleteUser deletes a user.
|
||||
rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v2/{name=users/*}"};
|
||||
option (google.api.http) = {delete: "/api/v1/{name=users/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// GetUserSetting gets the setting of a user.
|
||||
rpc GetUserSetting(GetUserSettingRequest) returns (UserSetting) {
|
||||
option (google.api.http) = {get: "/api/v2/{name=users/*}/setting"};
|
||||
option (google.api.http) = {get: "/api/v1/{name=users/*}/setting"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// UpdateUserSetting updates the setting of a user.
|
||||
rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UserSetting) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/{setting.name=users/*/setting}"
|
||||
patch: "/api/v1/{setting.name=users/*/setting}"
|
||||
body: "setting"
|
||||
};
|
||||
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.http) = {get: "/api/v1/{name=users/*}/access_tokens"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// CreateUserAccessToken creates a new access token for a user.
|
||||
rpc CreateUserAccessToken(CreateUserAccessTokenRequest) returns (UserAccessToken) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/{name=users/*}/access_tokens"
|
||||
post: "/api/v1/{name=users/*}/access_tokens"
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// DeleteUserAccessToken deletes an access token for a user.
|
||||
rpc DeleteUserAccessToken(DeleteUserAccessTokenRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v2/{name=users/*}/access_tokens/{access_token}"};
|
||||
option (google.api.http) = {delete: "/api/v1/{name=users/*}/access_tokens/{access_token}"};
|
||||
option (google.api.method_signature) = "name,access_token";
|
||||
}
|
||||
}
|
@@ -1,44 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "api/v2/common.proto";
|
||||
import "api/v1/common.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service WebhookService {
|
||||
// CreateWebhook creates a new webhook.
|
||||
rpc CreateWebhook(CreateWebhookRequest) returns (Webhook) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/webhooks"
|
||||
post: "/api/v1/webhooks"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
// GetWebhook returns a webhook by id.
|
||||
rpc GetWebhook(GetWebhookRequest) returns (Webhook) {
|
||||
option (google.api.http) = {get: "/api/v2/webhooks/{id}"};
|
||||
option (google.api.http) = {get: "/api/v1/webhooks/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// ListWebhooks returns a list of webhooks.
|
||||
rpc ListWebhooks(ListWebhooksRequest) returns (ListWebhooksResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/webhooks"};
|
||||
option (google.api.http) = {get: "/api/v1/webhooks"};
|
||||
}
|
||||
// UpdateWebhook updates a webhook.
|
||||
rpc UpdateWebhook(UpdateWebhookRequest) returns (Webhook) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/webhooks/{webhook.id}"
|
||||
patch: "/api/v1/webhooks/{webhook.id}"
|
||||
body: "webhook"
|
||||
};
|
||||
option (google.api.method_signature) = "webhook,update_mask";
|
||||
}
|
||||
// DeleteWebhook deletes a webhook by id.
|
||||
rpc DeleteWebhook(DeleteWebhookRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/api/v2/webhooks/{id}"};
|
||||
option (google.api.http) = {delete: "/api/v1/webhooks/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
}
|
@@ -1,15 +1,15 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service WorkspaceService {
|
||||
// GetWorkspaceProfile returns the workspace profile.
|
||||
rpc GetWorkspaceProfile(GetWorkspaceProfileRequest) returns (WorkspaceProfile) {
|
||||
option (google.api.http) = {get: "/api/v2/workspace/profile"};
|
||||
option (google.api.http) = {get: "/api/v1/workspace/profile"};
|
||||
}
|
||||
}
|
||||
|
@@ -1,27 +1,27 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package memos.api.v2;
|
||||
package memos.api.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service WorkspaceSettingService {
|
||||
// ListWorkspaceSetting returns the list of settings.
|
||||
rpc ListWorkspaceSettings(ListWorkspaceSettingsRequest) returns (ListWorkspaceSettingsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/workspace/settings"};
|
||||
option (google.api.http) = {get: "/api/v1/workspace/settings"};
|
||||
}
|
||||
// GetWorkspaceSetting returns the setting by name.
|
||||
rpc GetWorkspaceSetting(GetWorkspaceSettingRequest) returns (WorkspaceSetting) {
|
||||
option (google.api.http) = {get: "/api/v2/workspace/{name=settings/*}"};
|
||||
option (google.api.http) = {get: "/api/v1/workspace/{name=settings/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// SetWorkspaceSetting updates the setting.
|
||||
rpc SetWorkspaceSetting(SetWorkspaceSettingRequest) returns (WorkspaceSetting) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/workspace/{setting.name=settings/*}",
|
||||
patch: "/api/v1/workspace/{setting.name=settings/*}",
|
||||
body: "setting"
|
||||
};
|
||||
option (google.api.method_signature) = "setting";
|
Reference in New Issue
Block a user