mirror of
https://github.com/aykhans/slash-e.git
synced 2025-06-15 12:27:49 +00:00
refactor: update api version
This commit is contained in:
@ -1,24 +1,24 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
package slash.api.v1;
|
||||
|
||||
import "api/v2/user_service.proto";
|
||||
import "api/v1/user_service.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service AuthService {
|
||||
rpc GetAuthStatus(GetAuthStatusRequest) returns (GetAuthStatusResponse) {
|
||||
option (google.api.http) = {post: "/api/v2/auth/status"};
|
||||
option (google.api.http) = {post: "/api/v1/auth/status"};
|
||||
}
|
||||
rpc SignIn(SignInRequest) returns (SignInResponse) {
|
||||
option (google.api.http) = {post: "/api/v2/auth/signin"};
|
||||
option (google.api.http) = {post: "/api/v1/auth/signin"};
|
||||
}
|
||||
rpc SignUp(SignUpRequest) returns (SignUpResponse) {
|
||||
option (google.api.http) = {post: "/api/v2/auth/signup"};
|
||||
option (google.api.http) = {post: "/api/v1/auth/signup"};
|
||||
}
|
||||
rpc SignOut(SignOutRequest) returns (SignOutResponse) {
|
||||
option (google.api.http) = {post: "/api/v2/auth/signout"};
|
||||
option (google.api.http) = {post: "/api/v1/auth/signout"};
|
||||
}
|
||||
}
|
||||
|
@ -1,23 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
package slash.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/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service CollectionService {
|
||||
// ListCollections returns a list of collections.
|
||||
rpc ListCollections(ListCollectionsRequest) returns (ListCollectionsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/collections"};
|
||||
option (google.api.http) = {get: "/api/v1/collections"};
|
||||
}
|
||||
// GetCollection returns a collection by id.
|
||||
rpc GetCollection(GetCollectionRequest) returns (GetCollectionResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/collections/{id}"};
|
||||
option (google.api.http) = {get: "/api/v1/collections/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// GetCollectionByName returns a collection by name.
|
||||
@ -25,21 +25,21 @@ service CollectionService {
|
||||
// CreateCollection creates a collection.
|
||||
rpc CreateCollection(CreateCollectionRequest) returns (CreateCollectionResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/collections"
|
||||
post: "/api/v1/collections"
|
||||
body: "collection"
|
||||
};
|
||||
}
|
||||
// UpdateCollection updates a collection.
|
||||
rpc UpdateCollection(UpdateCollectionRequest) returns (UpdateCollectionResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/api/v2/collections/{collection.id}"
|
||||
put: "/api/v1/collections/{collection.id}"
|
||||
body: "collection"
|
||||
};
|
||||
option (google.api.method_signature) = "collection,update_mask";
|
||||
}
|
||||
// DeleteCollection deletes a collection by id.
|
||||
rpc DeleteCollection(DeleteCollectionRequest) returns (DeleteCollectionResponse) {
|
||||
option (google.api.http) = {delete: "/api/v2/collections/{id}"};
|
||||
option (google.api.http) = {delete: "/api/v1/collections/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
package slash.api.v1;
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
enum RowStatus {
|
||||
ROW_STATUS_UNSPECIFIED = 0;
|
@ -1,43 +1,43 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
package slash.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/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service MemoService {
|
||||
// ListMemos returns a list of memos.
|
||||
rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/memos"};
|
||||
option (google.api.http) = {get: "/api/v1/memos"};
|
||||
}
|
||||
// GetMemo returns a memo by id.
|
||||
rpc GetMemo(GetMemoRequest) returns (GetMemoResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/memos/{id}"};
|
||||
option (google.api.http) = {get: "/api/v1/memos/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// CreateMemo creates a memo.
|
||||
rpc CreateMemo(CreateMemoRequest) returns (CreateMemoResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/memos"
|
||||
post: "/api/v1/memos"
|
||||
body: "memo"
|
||||
};
|
||||
}
|
||||
// UpdateMemo updates a memo.
|
||||
rpc UpdateMemo(UpdateMemoRequest) returns (UpdateMemoResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/api/v2/memos/{memo.id}"
|
||||
put: "/api/v1/memos/{memo.id}"
|
||||
body: "memo"
|
||||
};
|
||||
option (google.api.method_signature) = "memo,update_mask";
|
||||
}
|
||||
// DeleteMemo deletes a memo by id.
|
||||
rpc DeleteMemo(DeleteMemoRequest) returns (DeleteMemoResponse) {
|
||||
option (google.api.http) = {delete: "/api/v2/memos/{id}"};
|
||||
option (google.api.http) = {delete: "/api/v1/memos/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
}
|
@ -1,23 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
package slash.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/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
option go_package = "gen/api/v1";
|
||||
|
||||
service ShortcutService {
|
||||
// ListShortcuts returns a list of shortcuts.
|
||||
rpc ListShortcuts(ListShortcutsRequest) returns (ListShortcutsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/shortcuts"};
|
||||
option (google.api.http) = {get: "/api/v1/shortcuts"};
|
||||
}
|
||||
// GetShortcut returns a shortcut by id.
|
||||
rpc GetShortcut(GetShortcutRequest) returns (GetShortcutResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/shortcuts/{id}"};
|
||||
option (google.api.http) = {get: "/api/v1/shortcuts/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// GetShortcutByName returns a shortcut by name.
|
||||
@ -25,26 +25,26 @@ service ShortcutService {
|
||||
// CreateShortcut creates a shortcut.
|
||||
rpc CreateShortcut(CreateShortcutRequest) returns (CreateShortcutResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/shortcuts"
|
||||
post: "/api/v1/shortcuts"
|
||||
body: "shortcut"
|
||||
};
|
||||
}
|
||||
// UpdateShortcut updates a shortcut.
|
||||
rpc UpdateShortcut(UpdateShortcutRequest) returns (UpdateShortcutResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/api/v2/shortcuts/{shortcut.id}"
|
||||
put: "/api/v1/shortcuts/{shortcut.id}"
|
||||
body: "shortcut"
|
||||
};
|
||||
option (google.api.method_signature) = "shortcut,update_mask";
|
||||
}
|
||||
// DeleteShortcut deletes a shortcut by name.
|
||||
rpc DeleteShortcut(DeleteShortcutRequest) returns (DeleteShortcutResponse) {
|
||||
option (google.api.http) = {delete: "/api/v2/shortcuts/{id}"};
|
||||
option (google.api.http) = {delete: "/api/v1/shortcuts/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// GetShortcutAnalytics returns the analytics for a shortcut.
|
||||
rpc GetShortcutAnalytics(GetShortcutAnalyticsRequest) returns (GetShortcutAnalyticsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/shortcuts/{id}/analytics"};
|
||||
option (google.api.http) = {get: "/api/v1/shortcuts/{id}/analytics"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
package slash.api.v1;
|
||||
|
||||
import "google/api/annotations.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 SubscriptionService {
|
||||
rpc GetSubscription(GetSubscriptionRequest) returns (GetSubscriptionResponse) {
|
@ -1,60 +1,60 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
package slash.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/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"};
|
||||
}
|
||||
// GetUser returns a user by id.
|
||||
rpc GetUser(GetUserRequest) returns (GetUserResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/users/{id}"};
|
||||
option (google.api.http) = {get: "/api/v1/users/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// CreateUser creates a new user.
|
||||
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/users"
|
||||
post: "/api/v1/users"
|
||||
body: "user"
|
||||
};
|
||||
}
|
||||
rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/users/{user.id}"
|
||||
patch: "/api/v1/users/{user.id}"
|
||||
body: "user"
|
||||
};
|
||||
option (google.api.method_signature) = "user,update_mask";
|
||||
}
|
||||
// DeleteUser deletes a user by id.
|
||||
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) {
|
||||
option (google.api.http) = {delete: "/api/v2/users/{id}"};
|
||||
option (google.api.http) = {delete: "/api/v1/users/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// ListUserAccessTokens returns a list of access tokens for a user.
|
||||
rpc ListUserAccessTokens(ListUserAccessTokensRequest) returns (ListUserAccessTokensResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/users/{id}/access_tokens"};
|
||||
option (google.api.http) = {get: "/api/v1/users/{id}/access_tokens"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// CreateUserAccessToken creates a new access token for a user.
|
||||
rpc CreateUserAccessToken(CreateUserAccessTokenRequest) returns (CreateUserAccessTokenResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/users/{id}/access_tokens"
|
||||
post: "/api/v1/users/{id}/access_tokens"
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// DeleteUserAccessToken deletes an access token for a user.
|
||||
rpc DeleteUserAccessToken(DeleteUserAccessTokenRequest) returns (DeleteUserAccessTokenResponse) {
|
||||
option (google.api.http) = {delete: "/api/v2/users/{id}/access_tokens/{access_token}"};
|
||||
option (google.api.http) = {delete: "/api/v1/users/{id}/access_tokens/{access_token}"};
|
||||
option (google.api.method_signature) = "id,access_token";
|
||||
}
|
||||
}
|
@ -1,23 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
package slash.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 UserSettingService {
|
||||
// GetUserSetting returns the user setting.
|
||||
rpc GetUserSetting(GetUserSettingRequest) returns (GetUserSettingResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/users/{id}/settings"};
|
||||
option (google.api.http) = {get: "/api/v1/users/{id}/settings"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// UpdateUserSetting updates the user setting.
|
||||
rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UpdateUserSettingResponse) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/users/{id}/settings"
|
||||
patch: "/api/v1/users/{id}/settings"
|
||||
body: "user_setting"
|
||||
};
|
||||
option (google.api.method_signature) = "user_setting,update_mask";
|
@ -1,24 +1,24 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
package slash.api.v1;
|
||||
|
||||
import "api/v2/subscription_service.proto";
|
||||
import "api/v1/subscription_service.proto";
|
||||
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 WorkspaceService {
|
||||
rpc GetWorkspaceProfile(GetWorkspaceProfileRequest) returns (GetWorkspaceProfileResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/workspace/profile"};
|
||||
option (google.api.http) = {get: "/api/v1/workspace/profile"};
|
||||
}
|
||||
rpc GetWorkspaceSetting(GetWorkspaceSettingRequest) returns (GetWorkspaceSettingResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/workspace/setting"};
|
||||
option (google.api.http) = {get: "/api/v1/workspace/setting"};
|
||||
}
|
||||
rpc UpdateWorkspaceSetting(UpdateWorkspaceSettingRequest) returns (UpdateWorkspaceSettingResponse) {
|
||||
option (google.api.http) = {
|
||||
patch: "/api/v2/workspace/setting"
|
||||
patch: "/api/v1/workspace/setting"
|
||||
body: "setting"
|
||||
};
|
||||
option (google.api.method_signature) = "setting,update_mask";
|
Reference in New Issue
Block a user