Commit 1b291422 authored by Steven's avatar Steven

refactor: api version

parent 8bba7f70
This diff is collapsed.
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";
}
}
......
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"};
}
}
......
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;
......
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";
}
}
......
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";
}
}
......
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"};
}
}
......
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.
......
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";
}
}
......
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;
......
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";
}
}
......
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";
}
}
......
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"};
}
}
......
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";
}
}
......
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";
}
}
......
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"};
}
}
......
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";
......
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/activity_service.proto
// source: api/v1/activity_service.proto
/*
Package apiv2 is a reverse proxy.
Package apiv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package apiv2
package apiv1
import (
"context"
......@@ -97,7 +97,7 @@ func RegisterActivityServiceHandlerServer(ctx context.Context, mux *runtime.Serv
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ActivityService/GetActivity", runtime.WithHTTPPathPattern("/v2/activities/{id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.ActivityService/GetActivity", runtime.WithHTTPPathPattern("/api/v1/activities/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -161,7 +161,7 @@ func RegisterActivityServiceHandlerClient(ctx context.Context, mux *runtime.Serv
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ActivityService/GetActivity", runtime.WithHTTPPathPattern("/v2/activities/{id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.ActivityService/GetActivity", runtime.WithHTTPPathPattern("/api/v1/activities/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -181,7 +181,7 @@ func RegisterActivityServiceHandlerClient(ctx context.Context, mux *runtime.Serv
}
var (
pattern_ActivityService_GetActivity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v2", "activities", "id"}, ""))
pattern_ActivityService_GetActivity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "activities", "id"}, ""))
)
var (
......
......@@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/activity_service.proto
// source: api/v1/activity_service.proto
package apiv2
package apiv1
import (
context "context"
......@@ -19,7 +19,7 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
ActivityService_GetActivity_FullMethodName = "/memos.api.v2.ActivityService/GetActivity"
ActivityService_GetActivity_FullMethodName = "/memos.api.v1.ActivityService/GetActivity"
)
// ActivityServiceClient is the client API for ActivityService service.
......@@ -98,7 +98,7 @@ func _ActivityService_GetActivity_Handler(srv interface{}, ctx context.Context,
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ActivityService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "memos.api.v2.ActivityService",
ServiceName: "memos.api.v1.ActivityService",
HandlerType: (*ActivityServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
......@@ -107,5 +107,5 @@ var ActivityService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/activity_service.proto",
Metadata: "api/v1/activity_service.proto",
}
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/auth_service.proto
// source: api/v1/auth_service.proto
/*
Package apiv2 is a reverse proxy.
Package apiv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package apiv2
package apiv1
import (
"context"
......@@ -189,7 +189,7 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v2/auth/status"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v1/auth/status"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -214,7 +214,7 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v2/auth/signin"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v1/auth/signin"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -239,7 +239,7 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.AuthService/SignInWithSSO", runtime.WithHTTPPathPattern("/api/v2/auth/signin/sso"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/SignInWithSSO", runtime.WithHTTPPathPattern("/api/v1/auth/signin/sso"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -264,7 +264,7 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v2/auth/signup"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v1/auth/signup"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -289,7 +289,7 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v2/auth/signout"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v1/auth/signout"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -353,7 +353,7 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v2/auth/status"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v1/auth/status"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -375,7 +375,7 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v2/auth/signin"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v1/auth/signin"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -397,7 +397,7 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.AuthService/SignInWithSSO", runtime.WithHTTPPathPattern("/api/v2/auth/signin/sso"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/SignInWithSSO", runtime.WithHTTPPathPattern("/api/v1/auth/signin/sso"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -419,7 +419,7 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v2/auth/signup"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v1/auth/signup"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -441,7 +441,7 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v2/auth/signout"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v1/auth/signout"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -461,15 +461,15 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
}
var (
pattern_AuthService_GetAuthStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "auth", "status"}, ""))
pattern_AuthService_GetAuthStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "status"}, ""))
pattern_AuthService_SignIn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "auth", "signin"}, ""))
pattern_AuthService_SignIn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "signin"}, ""))
pattern_AuthService_SignInWithSSO_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v2", "auth", "signin", "sso"}, ""))
pattern_AuthService_SignInWithSSO_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "auth", "signin", "sso"}, ""))
pattern_AuthService_SignUp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "auth", "signup"}, ""))
pattern_AuthService_SignUp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "signup"}, ""))
pattern_AuthService_SignOut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "auth", "signout"}, ""))
pattern_AuthService_SignOut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "signout"}, ""))
)
var (
......
......@@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/auth_service.proto
// source: api/v1/auth_service.proto
package apiv2
package apiv1
import (
context "context"
......@@ -20,11 +20,11 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
AuthService_GetAuthStatus_FullMethodName = "/memos.api.v2.AuthService/GetAuthStatus"
AuthService_SignIn_FullMethodName = "/memos.api.v2.AuthService/SignIn"
AuthService_SignInWithSSO_FullMethodName = "/memos.api.v2.AuthService/SignInWithSSO"
AuthService_SignUp_FullMethodName = "/memos.api.v2.AuthService/SignUp"
AuthService_SignOut_FullMethodName = "/memos.api.v2.AuthService/SignOut"
AuthService_GetAuthStatus_FullMethodName = "/memos.api.v1.AuthService/GetAuthStatus"
AuthService_SignIn_FullMethodName = "/memos.api.v1.AuthService/SignIn"
AuthService_SignInWithSSO_FullMethodName = "/memos.api.v1.AuthService/SignInWithSSO"
AuthService_SignUp_FullMethodName = "/memos.api.v1.AuthService/SignUp"
AuthService_SignOut_FullMethodName = "/memos.api.v1.AuthService/SignOut"
)
// AuthServiceClient is the client API for AuthService service.
......@@ -239,7 +239,7 @@ func _AuthService_SignOut_Handler(srv interface{}, ctx context.Context, dec func
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AuthService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "memos.api.v2.AuthService",
ServiceName: "memos.api.v1.AuthService",
HandlerType: (*AuthServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
......@@ -264,5 +264,5 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/auth_service.proto",
Metadata: "api/v1/auth_service.proto",
}
......@@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.33.0
// protoc (unknown)
// source: api/v2/common.proto
// source: api/v1/common.proto
package apiv2
package apiv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
......@@ -53,11 +53,11 @@ func (x RowStatus) String() string {
}
func (RowStatus) Descriptor() protoreflect.EnumDescriptor {
return file_api_v2_common_proto_enumTypes[0].Descriptor()
return file_api_v1_common_proto_enumTypes[0].Descriptor()
}
func (RowStatus) Type() protoreflect.EnumType {
return &file_api_v2_common_proto_enumTypes[0]
return &file_api_v1_common_proto_enumTypes[0]
}
func (x RowStatus) Number() protoreflect.EnumNumber {
......@@ -66,7 +66,7 @@ func (x RowStatus) Number() protoreflect.EnumNumber {
// Deprecated: Use RowStatus.Descriptor instead.
func (RowStatus) EnumDescriptor() ([]byte, []int) {
return file_api_v2_common_proto_rawDescGZIP(), []int{0}
return file_api_v1_common_proto_rawDescGZIP(), []int{0}
}
// Used internally for obfuscating the page token.
......@@ -82,7 +82,7 @@ type PageToken struct {
func (x *PageToken) Reset() {
*x = PageToken{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_common_proto_msgTypes[0]
mi := &file_api_v1_common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
......@@ -95,7 +95,7 @@ func (x *PageToken) String() string {
func (*PageToken) ProtoMessage() {}
func (x *PageToken) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_common_proto_msgTypes[0]
mi := &file_api_v1_common_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
......@@ -108,7 +108,7 @@ func (x *PageToken) ProtoReflect() protoreflect.Message {
// Deprecated: Use PageToken.ProtoReflect.Descriptor instead.
func (*PageToken) Descriptor() ([]byte, []int) {
return file_api_v2_common_proto_rawDescGZIP(), []int{0}
return file_api_v1_common_proto_rawDescGZIP(), []int{0}
}
func (x *PageToken) GetLimit() int32 {
......@@ -125,12 +125,12 @@ func (x *PageToken) GetOffset() int32 {
return 0
}
var File_api_v2_common_proto protoreflect.FileDescriptor
var File_api_v1_common_proto protoreflect.FileDescriptor
var file_api_v2_common_proto_rawDesc = []byte{
0x0a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
var file_api_v1_common_proto_rawDesc = []byte{
0x0a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x22, 0x39, 0x0a, 0x09, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x2e, 0x76, 0x31, 0x22, 0x39, 0x0a, 0x09, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x2a, 0x41,
......@@ -139,37 +139,37 @@ var file_api_v2_common_proto_rawDesc = []byte{
0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56,
0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x44, 0x10,
0x02, 0x42, 0xa3, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72,
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c,
0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d,
0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65,
0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c,
0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d,
0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65,
0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a,
0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_api_v2_common_proto_rawDescOnce sync.Once
file_api_v2_common_proto_rawDescData = file_api_v2_common_proto_rawDesc
file_api_v1_common_proto_rawDescOnce sync.Once
file_api_v1_common_proto_rawDescData = file_api_v1_common_proto_rawDesc
)
func file_api_v2_common_proto_rawDescGZIP() []byte {
file_api_v2_common_proto_rawDescOnce.Do(func() {
file_api_v2_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_common_proto_rawDescData)
func file_api_v1_common_proto_rawDescGZIP() []byte {
file_api_v1_common_proto_rawDescOnce.Do(func() {
file_api_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_common_proto_rawDescData)
})
return file_api_v2_common_proto_rawDescData
return file_api_v1_common_proto_rawDescData
}
var file_api_v2_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_v2_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_api_v2_common_proto_goTypes = []interface{}{
(RowStatus)(0), // 0: memos.api.v2.RowStatus
(*PageToken)(nil), // 1: memos.api.v2.PageToken
var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_api_v1_common_proto_goTypes = []interface{}{
(RowStatus)(0), // 0: memos.api.v1.RowStatus
(*PageToken)(nil), // 1: memos.api.v1.PageToken
}
var file_api_v2_common_proto_depIdxs = []int32{
var file_api_v1_common_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
......@@ -177,13 +177,13 @@ var file_api_v2_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for field type_name
}
func init() { file_api_v2_common_proto_init() }
func file_api_v2_common_proto_init() {
if File_api_v2_common_proto != nil {
func init() { file_api_v1_common_proto_init() }
func file_api_v1_common_proto_init() {
if File_api_v1_common_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_api_v2_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PageToken); i {
case 0:
return &v.state
......@@ -200,19 +200,19 @@ func file_api_v2_common_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_v2_common_proto_rawDesc,
RawDescriptor: file_api_v1_common_proto_rawDesc,
NumEnums: 1,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_v2_common_proto_goTypes,
DependencyIndexes: file_api_v2_common_proto_depIdxs,
EnumInfos: file_api_v2_common_proto_enumTypes,
MessageInfos: file_api_v2_common_proto_msgTypes,
GoTypes: file_api_v1_common_proto_goTypes,
DependencyIndexes: file_api_v1_common_proto_depIdxs,
EnumInfos: file_api_v1_common_proto_enumTypes,
MessageInfos: file_api_v1_common_proto_msgTypes,
}.Build()
File_api_v2_common_proto = out.File
file_api_v2_common_proto_rawDesc = nil
file_api_v2_common_proto_goTypes = nil
file_api_v2_common_proto_depIdxs = nil
File_api_v1_common_proto = out.File
file_api_v1_common_proto_rawDesc = nil
file_api_v1_common_proto_goTypes = nil
file_api_v1_common_proto_depIdxs = nil
}
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/idp_service.proto
// source: api/v1/idp_service.proto
/*
Package apiv2 is a reverse proxy.
Package apiv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package apiv2
package apiv1
import (
"context"
......@@ -293,7 +293,7 @@ func RegisterIdentityProviderServiceHandlerServer(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v2/identityProviders"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v1/identityProviders"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -318,7 +318,7 @@ func RegisterIdentityProviderServiceHandlerServer(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{name=identityProviders/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -343,7 +343,7 @@ func RegisterIdentityProviderServiceHandlerServer(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/identityProviders"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/identityProviders"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -368,7 +368,7 @@ func RegisterIdentityProviderServiceHandlerServer(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{identity_provider.name=identityProviders/*}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{identity_provider.name=identityProviders/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -393,7 +393,7 @@ func RegisterIdentityProviderServiceHandlerServer(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{name=identityProviders/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -457,7 +457,7 @@ func RegisterIdentityProviderServiceHandlerClient(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v2/identityProviders"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v1/identityProviders"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -479,7 +479,7 @@ func RegisterIdentityProviderServiceHandlerClient(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{name=identityProviders/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -501,7 +501,7 @@ func RegisterIdentityProviderServiceHandlerClient(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/identityProviders"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/identityProviders"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -523,7 +523,7 @@ func RegisterIdentityProviderServiceHandlerClient(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{identity_provider.name=identityProviders/*}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{identity_provider.name=identityProviders/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -545,7 +545,7 @@ func RegisterIdentityProviderServiceHandlerClient(ctx context.Context, mux *runt
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v1/{name=identityProviders/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -565,15 +565,15 @@ func RegisterIdentityProviderServiceHandlerClient(ctx context.Context, mux *runt
}
var (
pattern_IdentityProviderService_ListIdentityProviders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "identityProviders"}, ""))
pattern_IdentityProviderService_ListIdentityProviders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "identityProviders"}, ""))
pattern_IdentityProviderService_GetIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "identityProviders", "name"}, ""))
pattern_IdentityProviderService_GetIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "identityProviders", "name"}, ""))
pattern_IdentityProviderService_CreateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "identityProviders"}, ""))
pattern_IdentityProviderService_CreateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "identityProviders"}, ""))
pattern_IdentityProviderService_UpdateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "identityProviders", "identity_provider.name"}, ""))
pattern_IdentityProviderService_UpdateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "identityProviders", "identity_provider.name"}, ""))
pattern_IdentityProviderService_DeleteIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "identityProviders", "name"}, ""))
pattern_IdentityProviderService_DeleteIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "identityProviders", "name"}, ""))
)
var (
......
......@@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/idp_service.proto
// source: api/v1/idp_service.proto
package apiv2
package apiv1
import (
context "context"
......@@ -20,11 +20,11 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
IdentityProviderService_ListIdentityProviders_FullMethodName = "/memos.api.v2.IdentityProviderService/ListIdentityProviders"
IdentityProviderService_GetIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/GetIdentityProvider"
IdentityProviderService_CreateIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/CreateIdentityProvider"
IdentityProviderService_UpdateIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/UpdateIdentityProvider"
IdentityProviderService_DeleteIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/DeleteIdentityProvider"
IdentityProviderService_ListIdentityProviders_FullMethodName = "/memos.api.v1.IdentityProviderService/ListIdentityProviders"
IdentityProviderService_GetIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/GetIdentityProvider"
IdentityProviderService_CreateIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/CreateIdentityProvider"
IdentityProviderService_UpdateIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/UpdateIdentityProvider"
IdentityProviderService_DeleteIdentityProvider_FullMethodName = "/memos.api.v1.IdentityProviderService/DeleteIdentityProvider"
)
// IdentityProviderServiceClient is the client API for IdentityProviderService service.
......@@ -240,7 +240,7 @@ func _IdentityProviderService_DeleteIdentityProvider_Handler(srv interface{}, ct
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IdentityProviderService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "memos.api.v2.IdentityProviderService",
ServiceName: "memos.api.v1.IdentityProviderService",
HandlerType: (*IdentityProviderServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
......@@ -265,5 +265,5 @@ var IdentityProviderService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/idp_service.proto",
Metadata: "api/v1/idp_service.proto",
}
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/inbox_service.proto
// source: api/v1/inbox_service.proto
/*
Package apiv2 is a reverse proxy.
Package apiv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package apiv2
package apiv1
import (
"context"
......@@ -233,7 +233,7 @@ func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.InboxService/ListInboxes", runtime.WithHTTPPathPattern("/api/v2/inboxes"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.InboxService/ListInboxes", runtime.WithHTTPPathPattern("/api/v1/inboxes"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -258,7 +258,7 @@ func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/api/v2/{inbox.name=inboxes/*}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/api/v1/{inbox.name=inboxes/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -283,7 +283,7 @@ func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/api/v2/{name=inboxes/*}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/api/v1/{name=inboxes/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -347,7 +347,7 @@ func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.InboxService/ListInboxes", runtime.WithHTTPPathPattern("/api/v2/inboxes"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.InboxService/ListInboxes", runtime.WithHTTPPathPattern("/api/v1/inboxes"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -369,7 +369,7 @@ func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/api/v2/{inbox.name=inboxes/*}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/api/v1/{inbox.name=inboxes/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -391,7 +391,7 @@ func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/api/v2/{name=inboxes/*}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/api/v1/{name=inboxes/*}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -411,11 +411,11 @@ func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu
}
var (
pattern_InboxService_ListInboxes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "inboxes"}, ""))
pattern_InboxService_ListInboxes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "inboxes"}, ""))
pattern_InboxService_UpdateInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "inboxes", "inbox.name"}, ""))
pattern_InboxService_UpdateInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "inboxes", "inbox.name"}, ""))
pattern_InboxService_DeleteInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "inboxes", "name"}, ""))
pattern_InboxService_DeleteInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "inboxes", "name"}, ""))
)
var (
......
......@@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/inbox_service.proto
// source: api/v1/inbox_service.proto
package apiv2
package apiv1
import (
context "context"
......@@ -20,9 +20,9 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
InboxService_ListInboxes_FullMethodName = "/memos.api.v2.InboxService/ListInboxes"
InboxService_UpdateInbox_FullMethodName = "/memos.api.v2.InboxService/UpdateInbox"
InboxService_DeleteInbox_FullMethodName = "/memos.api.v2.InboxService/DeleteInbox"
InboxService_ListInboxes_FullMethodName = "/memos.api.v1.InboxService/ListInboxes"
InboxService_UpdateInbox_FullMethodName = "/memos.api.v1.InboxService/UpdateInbox"
InboxService_DeleteInbox_FullMethodName = "/memos.api.v1.InboxService/DeleteInbox"
)
// InboxServiceClient is the client API for InboxService service.
......@@ -169,7 +169,7 @@ func _InboxService_DeleteInbox_Handler(srv interface{}, ctx context.Context, dec
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var InboxService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "memos.api.v2.InboxService",
ServiceName: "memos.api.v1.InboxService",
HandlerType: (*InboxServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
......@@ -186,5 +186,5 @@ var InboxService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/inbox_service.proto",
Metadata: "api/v1/inbox_service.proto",
}
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/link_service.proto
// source: api/v1/link_service.proto
/*
Package apiv2 is a reverse proxy.
Package apiv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package apiv2
package apiv1
import (
"context"
......@@ -81,7 +81,7 @@ func RegisterLinkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/linkMetadata"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v1/linkMetadata"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -145,7 +145,7 @@ func RegisterLinkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/linkMetadata"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v1/linkMetadata"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
......@@ -165,7 +165,7 @@ func RegisterLinkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
}
var (
pattern_LinkService_GetLinkMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "linkMetadata"}, ""))
pattern_LinkService_GetLinkMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "linkMetadata"}, ""))
)
var (
......
......@@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/link_service.proto
// source: api/v1/link_service.proto
package apiv2
package apiv1
import (
context "context"
......@@ -19,7 +19,7 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
LinkService_GetLinkMetadata_FullMethodName = "/memos.api.v2.LinkService/GetLinkMetadata"
LinkService_GetLinkMetadata_FullMethodName = "/memos.api.v1.LinkService/GetLinkMetadata"
)
// LinkServiceClient is the client API for LinkService service.
......@@ -98,7 +98,7 @@ func _LinkService_GetLinkMetadata_Handler(srv interface{}, ctx context.Context,
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LinkService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "memos.api.v2.LinkService",
ServiceName: "memos.api.v1.LinkService",
HandlerType: (*LinkServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
......@@ -107,5 +107,5 @@ var LinkService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/link_service.proto",
Metadata: "api/v1/link_service.proto",
}
The legacy API is deprecated and has be removed. Please use the v2 API instead.
......@@ -46,7 +46,7 @@ func (s *FrontendService) Serve(ctx context.Context, e *echo.Echo) {
HTML5: true,
Filesystem: getFileSystem("dist"),
Skipper: func(c echo.Context) bool {
return util.HasPrefixes(c.Path(), "/api", "/memos.api.v2", "/robots.txt", "/sitemap.xml", "/m/:name")
return util.HasPrefixes(c.Path(), "/api", "/memos.api.v1", "/robots.txt", "/sitemap.xml", "/m/:name")
},
}))
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import { Resource } from "@/types/proto/api/v2/resource_service";
import { Resource } from "@/types/proto/api/v1/resource_service";
import Icon from "../Icon";
import ResourceIcon from "../ResourceIcon";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment