refactor: update api version

This commit is contained in:
Steven 2024-02-19 20:45:54 +08:00
parent b5f5ae2483
commit fafacc92eb
103 changed files with 2140 additions and 3986 deletions

View File

@ -1 +0,0 @@
> The v1 API has been deprecated. Please use the v2 API instead.

View File

@ -1,4 +1,4 @@
package v2
package v1
import (
"context"

35
api/v1/acl_config.go Normal file
View File

@ -0,0 +1,35 @@
package v1
import "strings"
var allowedMethodsWhenUnauthorized = map[string]bool{
"/slash.api.v1.WorkspaceService/GetWorkspaceProfile": true,
"/slash.api.v1.WorkspaceService/GetWorkspaceSetting": true,
"/slash.api.v1.AuthService/SignIn": true,
"/slash.api.v1.AuthService/SignUp": true,
"/slash.api.v1.AuthService/SignOut": true,
"/memos.api.v1.AuthService/GetAuthStatus": true,
"/slash.api.v1.ShortcutService/GetShortcutByName": true,
"/slash.api.v1.ShortcutService/GetShortcut": true,
"/slash.api.v1.CollectionService/GetCollectionByName": true,
}
// isUnauthorizeAllowedMethod returns true if the method is allowed to be called when the user is not authorized.
func isUnauthorizeAllowedMethod(methodName string) bool {
if strings.HasPrefix(methodName, "/grpc.reflection") {
return true
}
return allowedMethodsWhenUnauthorized[methodName]
}
var allowedMethodsOnlyForAdmin = map[string]bool{
"/slash.api.v1.UserService/CreateUser": true,
"/slash.api.v1.UserService/DeleteUser": true,
"/slash.api.v1.WorkspaceService/UpdateWorkspaceSetting": true,
"/slash.api.v1.SubscriptionService/UpdateSubscription": true,
}
// isOnlyForAdminAllowedMethod returns true if the method is allowed to be called only by admin.
func isOnlyForAdminAllowedMethod(methodName string) bool {
return allowedMethodsOnlyForAdmin[methodName]
}

View File

@ -1,12 +0,0 @@
package v1
type ActivityShorcutCreatePayload struct {
ShortcutID int32 `json:"shortcutId"`
}
type ActivityShorcutViewPayload struct {
ShortcutID int32 `json:"shortcutId"`
IP string `json:"ip"`
Referer string `json:"referer"`
UserAgent string `json:"userAgent"`
}

View File

@ -1,131 +0,0 @@
package v1
import (
"encoding/json"
"fmt"
"net/http"
"github.com/labstack/echo/v4"
"github.com/mssola/useragent"
"golang.org/x/exp/slices"
"github.com/yourselfhosted/slash/internal/util"
"github.com/yourselfhosted/slash/server/metric"
"github.com/yourselfhosted/slash/store"
)
type ReferenceInfo struct {
Name string `json:"name"`
Count int `json:"count"`
}
type DeviceInfo struct {
Name string `json:"name"`
Count int `json:"count"`
}
type BrowserInfo struct {
Name string `json:"name"`
Count int `json:"count"`
}
type AnalysisData struct {
ReferenceData []ReferenceInfo `json:"referenceData"`
DeviceData []DeviceInfo `json:"deviceData"`
BrowserData []BrowserInfo `json:"browserData"`
}
func (s *APIV1Service) registerAnalyticsRoutes(g *echo.Group) {
g.GET("/shortcut/:shortcutId/analytics", func(c echo.Context) error {
ctx := c.Request().Context()
shortcutID, err := util.ConvertStringToInt32(c.Param("shortcutId"))
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("shortcut id is not a number: %s", c.Param("shortcutId"))).SetInternal(err)
}
activities, err := s.Store.ListActivities(ctx, &store.FindActivity{
Type: store.ActivityShortcutView,
PayloadShortcutID: &shortcutID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to get activities, err: %s", err)).SetInternal(err)
}
referenceMap := make(map[string]int)
deviceMap := make(map[string]int)
browserMap := make(map[string]int)
for _, activity := range activities {
payload := &ActivityShorcutViewPayload{}
if err := json.Unmarshal([]byte(activity.Payload), payload); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to unmarshal payload, err: %s", err)).SetInternal(err)
}
if _, ok := referenceMap[payload.Referer]; !ok {
referenceMap[payload.Referer] = 0
}
referenceMap[payload.Referer]++
ua := useragent.New(payload.UserAgent)
deviceName := ua.OSInfo().Name
browserName, _ := ua.Browser()
if _, ok := deviceMap[deviceName]; !ok {
deviceMap[deviceName] = 0
}
deviceMap[deviceName]++
if _, ok := browserMap[browserName]; !ok {
browserMap[browserName] = 0
}
browserMap[browserName]++
}
metric.Enqueue("shortcut analytics")
return c.JSON(http.StatusOK, &AnalysisData{
ReferenceData: mapToReferenceInfoSlice(referenceMap),
DeviceData: mapToDeviceInfoSlice(deviceMap),
BrowserData: mapToBrowserInfoSlice(browserMap),
})
})
}
func mapToReferenceInfoSlice(m map[string]int) []ReferenceInfo {
referenceInfoSlice := make([]ReferenceInfo, 0)
for key, value := range m {
referenceInfoSlice = append(referenceInfoSlice, ReferenceInfo{
Name: key,
Count: value,
})
}
slices.SortFunc(referenceInfoSlice, func(i, j ReferenceInfo) int {
return i.Count - j.Count
})
return referenceInfoSlice
}
func mapToDeviceInfoSlice(m map[string]int) []DeviceInfo {
deviceInfoSlice := make([]DeviceInfo, 0)
for key, value := range m {
deviceInfoSlice = append(deviceInfoSlice, DeviceInfo{
Name: key,
Count: value,
})
}
slices.SortFunc(deviceInfoSlice, func(i, j DeviceInfo) int {
return i.Count - j.Count
})
return deviceInfoSlice
}
func mapToBrowserInfoSlice(m map[string]int) []BrowserInfo {
browserInfoSlice := make([]BrowserInfo, 0)
for key, value := range m {
browserInfoSlice = append(browserInfoSlice, BrowserInfo{
Name: key,
Count: value,
})
}
slices.SortFunc(browserInfoSlice, func(i, j BrowserInfo) int {
return i.Count - j.Count
})
return browserInfoSlice
}

View File

@ -1,211 +0,0 @@
package v1
import (
"context"
"encoding/json"
"fmt"
"net/http"
"time"
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
"golang.org/x/crypto/bcrypt"
"github.com/yourselfhosted/slash/api/auth"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/server/metric"
"github.com/yourselfhosted/slash/server/service/license"
"github.com/yourselfhosted/slash/store"
)
type SignInRequest struct {
Email string `json:"email"`
Password string `json:"password"`
}
type SignUpRequest struct {
Nickname string `json:"nickname"`
Email string `json:"email"`
Password string `json:"password"`
}
func (s *APIV1Service) registerAuthRoutes(g *echo.Group, secret string) {
g.POST("/auth/signin", func(c echo.Context) error {
ctx := c.Request().Context()
signin := &SignInRequest{}
if err := json.NewDecoder(c.Request().Body).Decode(signin); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("malformatted signin request, err: %s", err))
}
user, err := s.Store.GetUser(ctx, &store.FindUser{
Email: &signin.Email,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to find user by email %s", signin.Email)).SetInternal(err)
}
if user == nil {
return echo.NewHTTPError(http.StatusUnauthorized, fmt.Sprintf("user not found with email %s", signin.Email))
} else if user.RowStatus == store.Archived {
return echo.NewHTTPError(http.StatusForbidden, fmt.Sprintf("user has been archived with email %s", signin.Email))
}
// Compare the stored hashed password, with the hashed version of the password that was received.
if err := bcrypt.CompareHashAndPassword([]byte(user.PasswordHash), []byte(signin.Password)); err != nil {
return echo.NewHTTPError(http.StatusUnauthorized, "unmatched email and password")
}
accessToken, err := auth.GenerateAccessToken(user.Email, user.ID, time.Now().Add(auth.AccessTokenDuration), []byte(secret))
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to generate tokens, err: %s", err)).SetInternal(err)
}
if err := s.UpsertAccessTokenToStore(ctx, user, accessToken); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert access token, err: %s", err)).SetInternal(err)
}
cookieExp := time.Now().Add(auth.CookieExpDuration)
setTokenCookie(c, auth.AccessTokenCookieName, accessToken, cookieExp)
metric.Enqueue("user sign in")
return c.JSON(http.StatusOK, convertUserFromStore(user))
})
g.POST("/auth/signup", func(c echo.Context) error {
ctx := c.Request().Context()
enableSignUpSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSAPCE_SETTING_ENABLE_SIGNUP,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to get workspace setting, err: %s", err)).SetInternal(err)
}
if enableSignUpSetting != nil && !enableSignUpSetting.GetEnableSignup() {
return echo.NewHTTPError(http.StatusForbidden, "sign up has been disabled")
}
if !s.LicenseService.IsFeatureEnabled(license.FeatureTypeUnlimitedAccounts) {
userList, err := s.Store.ListUsers(ctx, &store.FindUser{})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to list users").SetInternal(err)
}
if len(userList) >= 5 {
return echo.NewHTTPError(http.StatusBadRequest, "Maximum number of users reached")
}
}
signup := &SignUpRequest{}
if err := json.NewDecoder(c.Request().Body).Decode(signup); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("malformatted signup request, err: %s", err)).SetInternal(err)
}
passwordHash, err := bcrypt.GenerateFromPassword([]byte(signup.Password), bcrypt.DefaultCost)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "failed to generate password hash").SetInternal(err)
}
create := &store.User{
Email: signup.Email,
Nickname: signup.Nickname,
PasswordHash: string(passwordHash),
}
existingUsers, err := s.Store.ListUsers(ctx, &store.FindUser{})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to find existing users, err: %s", err)).SetInternal(err)
}
// The first user to sign up is an admin by default.
if len(existingUsers) == 0 {
create.Role = store.RoleAdmin
} else {
create.Role = store.RoleUser
}
user, err := s.Store.CreateUser(ctx, create)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to create user, err: %s", err)).SetInternal(err)
}
accessToken, err := auth.GenerateAccessToken(user.Email, user.ID, time.Now().Add(auth.AccessTokenDuration), []byte(secret))
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to generate tokens, err: %s", err)).SetInternal(err)
}
if err := s.UpsertAccessTokenToStore(ctx, user, accessToken); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert access token, err: %s", err)).SetInternal(err)
}
cookieExp := time.Now().Add(auth.CookieExpDuration)
setTokenCookie(c, auth.AccessTokenCookieName, accessToken, cookieExp)
metric.Enqueue("user sign up")
return c.JSON(http.StatusOK, convertUserFromStore(user))
})
g.POST("/auth/logout", func(c echo.Context) error {
ctx := c.Request().Context()
RemoveTokensAndCookies(c)
accessToken := findAccessToken(c)
userID, _ := getUserIDFromAccessToken(accessToken, secret)
userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, userID)
// Auto remove the current access token from the user access tokens.
if err == nil && len(userAccessTokens) != 0 {
accessTokens := []*storepb.AccessTokensUserSetting_AccessToken{}
for _, userAccessToken := range userAccessTokens {
if accessToken != userAccessToken.AccessToken {
accessTokens = append(accessTokens, userAccessToken)
}
}
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: userID,
Key: storepb.UserSettingKey_USER_SETTING_ACCESS_TOKENS,
Value: &storepb.UserSetting_AccessTokens{
AccessTokens: &storepb.AccessTokensUserSetting{
AccessTokens: accessTokens,
},
},
}); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert user setting, err: %s", err)).SetInternal(err)
}
}
c.Response().WriteHeader(http.StatusOK)
return nil
})
}
func (s *APIV1Service) UpsertAccessTokenToStore(ctx context.Context, user *store.User, accessToken string) error {
userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, user.ID)
if err != nil {
return errors.Wrap(err, "failed to get user access tokens")
}
userAccessToken := storepb.AccessTokensUserSetting_AccessToken{
AccessToken: accessToken,
Description: "Account sign in",
}
userAccessTokens = append(userAccessTokens, &userAccessToken)
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_ACCESS_TOKENS,
Value: &storepb.UserSetting_AccessTokens{
AccessTokens: &storepb.AccessTokensUserSetting{
AccessTokens: userAccessTokens,
},
},
}); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert user setting, err: %s", err)).SetInternal(err)
}
return nil
}
// RemoveTokensAndCookies removes the jwt token from the cookies.
func RemoveTokensAndCookies(c echo.Context) {
cookieExp := time.Now().Add(-1 * time.Hour)
setTokenCookie(c, auth.AccessTokenCookieName, "", cookieExp)
}
// setTokenCookie sets the token to the cookie.
func setTokenCookie(c echo.Context, name, token string, expiration time.Time) {
cookie := new(http.Cookie)
cookie.Name = name
cookie.Value = token
cookie.Expires = expiration
cookie.Path = "/"
// Http-only helps mitigate the risk of client side script accessing the protected cookie.
cookie.HttpOnly = true
cookie.SameSite = http.SameSiteStrictMode
c.SetCookie(cookie)
}

View File

@ -1,4 +1,4 @@
package v2
package v1
import (
"context"
@ -12,14 +12,14 @@ import (
"google.golang.org/grpc/status"
"github.com/yourselfhosted/slash/api/auth"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/server/metric"
"github.com/yourselfhosted/slash/server/service/license"
"github.com/yourselfhosted/slash/store"
)
func (s *APIV2Service) GetAuthStatus(ctx context.Context, _ *apiv2pb.GetAuthStatusRequest) (*apiv2pb.GetAuthStatusResponse, error) {
func (s *APIV2Service) GetAuthStatus(ctx context.Context, _ *apiv1pb.GetAuthStatusRequest) (*apiv1pb.GetAuthStatusResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
@ -27,12 +27,12 @@ func (s *APIV2Service) GetAuthStatus(ctx context.Context, _ *apiv2pb.GetAuthStat
if user == nil {
return nil, status.Errorf(codes.Unauthenticated, "user not found")
}
return &apiv2pb.GetAuthStatusResponse{
return &apiv1pb.GetAuthStatusResponse{
User: convertUserFromStore(user),
}, nil
}
func (s *APIV2Service) SignIn(ctx context.Context, request *apiv2pb.SignInRequest) (*apiv2pb.SignInResponse, error) {
func (s *APIV2Service) SignIn(ctx context.Context, request *apiv1pb.SignInRequest) (*apiv1pb.SignInResponse, error) {
user, err := s.Store.GetUser(ctx, &store.FindUser{
Email: &request.Email,
})
@ -65,12 +65,12 @@ func (s *APIV2Service) SignIn(ctx context.Context, request *apiv2pb.SignInReques
}
metric.Enqueue("user sign in")
return &apiv2pb.SignInResponse{
return &apiv1pb.SignInResponse{
User: convertUserFromStore(user),
}, nil
}
func (s *APIV2Service) SignUp(ctx context.Context, request *apiv2pb.SignUpRequest) (*apiv2pb.SignUpResponse, error) {
func (s *APIV2Service) SignUp(ctx context.Context, request *apiv1pb.SignUpRequest) (*apiv1pb.SignUpResponse, error) {
enableSignUpSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSAPCE_SETTING_ENABLE_SIGNUP,
})
@ -132,12 +132,12 @@ func (s *APIV2Service) SignUp(ctx context.Context, request *apiv2pb.SignUpReques
}
metric.Enqueue("user sign up")
return &apiv2pb.SignUpResponse{
return &apiv1pb.SignUpResponse{
User: convertUserFromStore(user),
}, nil
}
func (*APIV2Service) SignOut(ctx context.Context, _ *apiv2pb.SignOutRequest) (*apiv2pb.SignOutResponse, error) {
func (*APIV2Service) SignOut(ctx context.Context, _ *apiv1pb.SignOutRequest) (*apiv1pb.SignOutResponse, error) {
// Set the cookie header to expire access token.
if err := grpc.SetHeader(ctx, metadata.New(map[string]string{
"Set-Cookie": fmt.Sprintf("%s=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly; SameSite=Strict", auth.AccessTokenCookieName),
@ -145,5 +145,5 @@ func (*APIV2Service) SignOut(ctx context.Context, _ *apiv2pb.SignOutRequest) (*a
return nil, status.Errorf(codes.Internal, "failed to set grpc header, error: %v", err)
}
return &apiv2pb.SignOutResponse{}, nil
return &apiv1pb.SignOutResponse{}, nil
}

View File

@ -1,4 +1,4 @@
package v2
package v1
import (
"context"
@ -8,17 +8,20 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/server/metric"
"github.com/yourselfhosted/slash/server/service/license"
"github.com/yourselfhosted/slash/store"
)
func (s *APIV2Service) ListCollections(ctx context.Context, _ *apiv2pb.ListCollectionsRequest) (*apiv2pb.ListCollectionsResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
func (s *APIV2Service) ListCollections(ctx context.Context, _ *apiv1pb.ListCollectionsRequest) (*apiv1pb.ListCollectionsResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
collections, err := s.Store.ListCollections(ctx, &store.FindCollection{
CreatorID: &userID,
CreatorID: &user.ID,
VisibilityList: []store.Visibility{
store.VisibilityPrivate,
},
@ -38,18 +41,18 @@ func (s *APIV2Service) ListCollections(ctx context.Context, _ *apiv2pb.ListColle
}
collections = append(collections, sharedCollections...)
convertedCollections := []*apiv2pb.Collection{}
convertedCollections := []*apiv1pb.Collection{}
for _, collection := range collections {
convertedCollections = append(convertedCollections, convertCollectionFromStore(collection))
}
response := &apiv2pb.ListCollectionsResponse{
response := &apiv1pb.ListCollectionsResponse{
Collections: convertedCollections,
}
return response, nil
}
func (s *APIV2Service) GetCollection(ctx context.Context, request *apiv2pb.GetCollectionRequest) (*apiv2pb.GetCollectionResponse, error) {
func (s *APIV2Service) GetCollection(ctx context.Context, request *apiv1pb.GetCollectionRequest) (*apiv1pb.GetCollectionResponse, error) {
collection, err := s.Store.GetCollection(ctx, &store.FindCollection{
ID: &request.Id,
})
@ -60,17 +63,20 @@ func (s *APIV2Service) GetCollection(ctx context.Context, request *apiv2pb.GetCo
return nil, status.Errorf(codes.NotFound, "collection not found")
}
userID := ctx.Value(userIDContextKey).(int32)
if collection.Visibility == storepb.Visibility_PRIVATE && collection.CreatorId != userID {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
if collection.Visibility == storepb.Visibility_PRIVATE && collection.CreatorId != user.ID {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
response := &apiv2pb.GetCollectionResponse{
response := &apiv1pb.GetCollectionResponse{
Collection: convertCollectionFromStore(collection),
}
return response, nil
}
func (s *APIV2Service) GetCollectionByName(ctx context.Context, request *apiv2pb.GetCollectionByNameRequest) (*apiv2pb.GetCollectionByNameResponse, error) {
func (s *APIV2Service) GetCollectionByName(ctx context.Context, request *apiv1pb.GetCollectionByNameRequest) (*apiv1pb.GetCollectionByNameResponse, error) {
collection, err := s.Store.GetCollection(ctx, &store.FindCollection{
Name: &request.Name,
})
@ -91,14 +97,14 @@ func (s *APIV2Service) GetCollectionByName(ctx context.Context, request *apiv2pb
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
}
response := &apiv2pb.GetCollectionByNameResponse{
response := &apiv1pb.GetCollectionByNameResponse{
Collection: convertCollectionFromStore(collection),
}
metric.Enqueue("collection view")
return response, nil
}
func (s *APIV2Service) CreateCollection(ctx context.Context, request *apiv2pb.CreateCollectionRequest) (*apiv2pb.CreateCollectionResponse, error) {
func (s *APIV2Service) CreateCollection(ctx context.Context, request *apiv1pb.CreateCollectionRequest) (*apiv1pb.CreateCollectionResponse, error) {
if request.Collection.Name == "" || request.Collection.Title == "" {
return nil, status.Errorf(codes.InvalidArgument, "name and title are required")
}
@ -115,38 +121,38 @@ func (s *APIV2Service) CreateCollection(ctx context.Context, request *apiv2pb.Cr
}
}
userID := ctx.Value(userIDContextKey).(int32)
collection := &storepb.Collection{
CreatorId: userID,
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
collectionCreate := &storepb.Collection{
CreatorId: user.ID,
Name: request.Collection.Name,
Title: request.Collection.Title,
Description: request.Collection.Description,
ShortcutIds: request.Collection.ShortcutIds,
Visibility: storepb.Visibility(request.Collection.Visibility),
}
collection, err := s.Store.CreateCollection(ctx, collection)
collection, err := s.Store.CreateCollection(ctx, collectionCreate)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to create collection, err: %v", err)
}
response := &apiv2pb.CreateCollectionResponse{
response := &apiv1pb.CreateCollectionResponse{
Collection: convertCollectionFromStore(collection),
}
metric.Enqueue("collection create")
return response, nil
}
func (s *APIV2Service) UpdateCollection(ctx context.Context, request *apiv2pb.UpdateCollectionRequest) (*apiv2pb.UpdateCollectionResponse, error) {
func (s *APIV2Service) UpdateCollection(ctx context.Context, request *apiv1pb.UpdateCollectionRequest) (*apiv1pb.UpdateCollectionResponse, error) {
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
return nil, status.Errorf(codes.InvalidArgument, "updateMask is required")
}
userID := ctx.Value(userIDContextKey).(int32)
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get current user, err: %v", err)
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
collection, err := s.Store.GetCollection(ctx, &store.FindCollection{
ID: &request.Collection.Id,
@ -157,7 +163,7 @@ func (s *APIV2Service) UpdateCollection(ctx context.Context, request *apiv2pb.Up
if collection == nil {
return nil, status.Errorf(codes.NotFound, "collection not found")
}
if collection.CreatorId != userID && currentUser.Role != store.RoleAdmin {
if collection.CreatorId != user.ID && user.Role != store.RoleAdmin {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
@ -184,19 +190,16 @@ func (s *APIV2Service) UpdateCollection(ctx context.Context, request *apiv2pb.Up
return nil, status.Errorf(codes.Internal, "failed to update collection, err: %v", err)
}
response := &apiv2pb.UpdateCollectionResponse{
response := &apiv1pb.UpdateCollectionResponse{
Collection: convertCollectionFromStore(collection),
}
return response, nil
}
func (s *APIV2Service) DeleteCollection(ctx context.Context, request *apiv2pb.DeleteCollectionRequest) (*apiv2pb.DeleteCollectionResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
func (s *APIV2Service) DeleteCollection(ctx context.Context, request *apiv1pb.DeleteCollectionRequest) (*apiv1pb.DeleteCollectionResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get current user, err: %v", err)
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
collection, err := s.Store.GetCollection(ctx, &store.FindCollection{
ID: &request.Id,
@ -207,7 +210,7 @@ func (s *APIV2Service) DeleteCollection(ctx context.Context, request *apiv2pb.De
if collection == nil {
return nil, status.Errorf(codes.NotFound, "collection not found")
}
if collection.CreatorId != userID && currentUser.Role != store.RoleAdmin {
if collection.CreatorId != user.ID && user.Role != store.RoleAdmin {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
@ -217,12 +220,12 @@ func (s *APIV2Service) DeleteCollection(ctx context.Context, request *apiv2pb.De
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to delete collection, err: %v", err)
}
response := &apiv2pb.DeleteCollectionResponse{}
response := &apiv1pb.DeleteCollectionResponse{}
return response, nil
}
func convertCollectionFromStore(collection *storepb.Collection) *apiv2pb.Collection {
return &apiv2pb.Collection{
func convertCollectionFromStore(collection *storepb.Collection) *apiv1pb.Collection {
return &apiv1pb.Collection{
Id: collection.Id,
CreatorId: collection.CreatorId,
CreatedTime: timestamppb.New(time.Unix(collection.CreatedTs, 0)),
@ -231,6 +234,6 @@ func convertCollectionFromStore(collection *storepb.Collection) *apiv2pb.Collect
Title: collection.Title,
Description: collection.Description,
ShortcutIds: collection.ShortcutIds,
Visibility: apiv2pb.Visibility(collection.Visibility),
Visibility: apiv1pb.Visibility(collection.Visibility),
}
}

View File

@ -1,15 +1,33 @@
package v1
// RowStatus is the status for a row.
type RowStatus string
import (
"context"
const (
// Normal is the status for a normal row.
Normal RowStatus = "NORMAL"
// Archived is the status for an archived row.
Archived RowStatus = "ARCHIVED"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
"github.com/yourselfhosted/slash/store"
)
func (s RowStatus) String() string {
return string(s)
func convertRowStatusFromStore(rowStatus store.RowStatus) apiv1pb.RowStatus {
switch rowStatus {
case store.Normal:
return apiv1pb.RowStatus_NORMAL
case store.Archived:
return apiv1pb.RowStatus_ARCHIVED
default:
return apiv1pb.RowStatus_ROW_STATUS_UNSPECIFIED
}
}
func getCurrentUser(ctx context.Context, s *store.Store) (*store.User, error) {
userID, ok := ctx.Value(userIDContextKey).(int32)
if !ok {
return nil, nil
}
user, err := s.GetUser(ctx, &store.FindUser{
ID: &userID,
})
if err != nil {
return nil, err
}
return user, nil
}

View File

@ -1,133 +0,0 @@
package v1
import (
"fmt"
"net/http"
"strings"
"github.com/golang-jwt/jwt/v4"
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
"github.com/yourselfhosted/slash/api/auth"
"github.com/yourselfhosted/slash/internal/util"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/store"
)
const (
// The key name used to store user id in the context
// user id is extracted from the jwt token subject field.
userIDContextKey = "user-id"
)
func extractTokenFromHeader(c echo.Context) (string, error) {
authHeader := c.Request().Header.Get("Authorization")
if authHeader == "" {
return "", nil
}
authHeaderParts := strings.Fields(authHeader)
if len(authHeaderParts) != 2 || strings.ToLower(authHeaderParts[0]) != "bearer" {
return "", errors.New("Authorization header format must be Bearer {token}")
}
return authHeaderParts[1], nil
}
func findAccessToken(c echo.Context) string {
// Check the HTTP request header first.
accessToken, _ := extractTokenFromHeader(c)
if accessToken == "" {
// Check the cookie.
cookie, _ := c.Cookie(auth.AccessTokenCookieName)
if cookie != nil {
accessToken = cookie.Value
}
}
return accessToken
}
// JWTMiddleware validates the access token.
func JWTMiddleware(s *APIV1Service, next echo.HandlerFunc, secret string) echo.HandlerFunc {
return func(c echo.Context) error {
ctx := c.Request().Context()
path := c.Request().URL.Path
method := c.Request().Method
// Pass auth and profile endpoints.
if util.HasPrefixes(path, "/api/v1/auth", "/api/v1/workspace/profile") {
return next(c)
}
accessToken := findAccessToken(c)
if accessToken == "" {
// When the request is not authenticated, we allow the user to access the shortcut endpoints for those public shortcuts.
if util.HasPrefixes(path, "/s/", "/api/v1/user/") && method == http.MethodGet {
return next(c)
}
return echo.NewHTTPError(http.StatusUnauthorized, "Missing access token")
}
userID, err := getUserIDFromAccessToken(accessToken, secret)
if err != nil {
return echo.NewHTTPError(http.StatusUnauthorized, "Invalid or expired access token")
}
accessTokens, err := s.Store.GetUserAccessTokens(ctx, userID)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to get user access tokens.").WithInternal(err)
}
if !validateAccessToken(accessToken, accessTokens) {
return echo.NewHTTPError(http.StatusUnauthorized, "Invalid access token.")
}
// Even if there is no error, we still need to make sure the user still exists.
user, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Server error to find user ID: %d", userID)).SetInternal(err)
}
if user == nil {
return echo.NewHTTPError(http.StatusUnauthorized, fmt.Sprintf("Failed to find user ID: %d", userID))
}
// Stores userID into context.
c.Set(userIDContextKey, userID)
return next(c)
}
}
func getUserIDFromAccessToken(accessToken, secret string) (int32, error) {
claims := &auth.ClaimsMessage{}
_, err := jwt.ParseWithClaims(accessToken, claims, func(t *jwt.Token) (any, error) {
if t.Method.Alg() != jwt.SigningMethodHS256.Name {
return nil, errors.Errorf("unexpected access token signing method=%v, expect %v", t.Header["alg"], jwt.SigningMethodHS256)
}
if kid, ok := t.Header["kid"].(string); ok {
if kid == "v1" {
return []byte(secret), nil
}
}
return nil, errors.Errorf("unexpected access token kid=%v", t.Header["kid"])
})
if err != nil {
return 0, errors.Wrap(err, "Invalid or expired access token")
}
// We either have a valid access token or we will attempt to generate new access token.
userID, err := util.ConvertStringToInt32(claims.Subject)
if err != nil {
return 0, errors.Wrap(err, "Malformed ID in the token")
}
return userID, nil
}
func validateAccessToken(accessTokenString string, userAccessTokens []*storepb.AccessTokensUserSetting_AccessToken) bool {
for _, userAccessToken := range userAccessTokens {
if accessTokenString == userAccessToken.AccessToken {
return true
}
}
return false
}

View File

@ -1,4 +1,4 @@
package v2
package v1
import (
"context"
@ -9,19 +9,19 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/store"
)
func (s *APIV2Service) ListMemos(ctx context.Context, _ *apiv2pb.ListMemosRequest) (*apiv2pb.ListMemosResponse, error) {
func (s *APIV2Service) ListMemos(ctx context.Context, _ *apiv1pb.ListMemosRequest) (*apiv1pb.ListMemosResponse, error) {
find := &store.FindMemo{}
memos, err := s.Store.ListMemos(ctx, find)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to fetch memo list, err: %v", err)
}
composedMemos := []*apiv2pb.Memo{}
composedMemos := []*apiv1pb.Memo{}
for _, memo := range memos {
composedMemo, err := s.convertMemoFromStorepb(ctx, memo)
if err != nil {
@ -30,13 +30,13 @@ func (s *APIV2Service) ListMemos(ctx context.Context, _ *apiv2pb.ListMemosReques
composedMemos = append(composedMemos, composedMemo)
}
response := &apiv2pb.ListMemosResponse{
response := &apiv1pb.ListMemosResponse{
Memos: composedMemos,
}
return response, nil
}
func (s *APIV2Service) GetMemo(ctx context.Context, request *apiv2pb.GetMemoRequest) (*apiv2pb.GetMemoResponse, error) {
func (s *APIV2Service) GetMemo(ctx context.Context, request *apiv1pb.GetMemoRequest) (*apiv1pb.GetMemoResponse, error) {
memo, err := s.Store.GetMemo(ctx, &store.FindMemo{
ID: &request.Id,
})
@ -51,23 +51,26 @@ func (s *APIV2Service) GetMemo(ctx context.Context, request *apiv2pb.GetMemoRequ
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert memo, err: %v", err)
}
response := &apiv2pb.GetMemoResponse{
response := &apiv1pb.GetMemoResponse{
Memo: composedMemo,
}
return response, nil
}
func (s *APIV2Service) CreateMemo(ctx context.Context, request *apiv2pb.CreateMemoRequest) (*apiv2pb.CreateMemoResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
memo := &storepb.Memo{
CreatorId: userID,
func (s *APIV2Service) CreateMemo(ctx context.Context, request *apiv1pb.CreateMemoRequest) (*apiv1pb.CreateMemoResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
memoCreate := &storepb.Memo{
CreatorId: user.ID,
Name: request.Memo.Name,
Title: request.Memo.Title,
Content: request.Memo.Content,
Tags: request.Memo.Tags,
Visibility: storepb.Visibility(request.Memo.Visibility),
}
memo, err := s.Store.CreateMemo(ctx, memo)
memo, err := s.Store.CreateMemo(ctx, memoCreate)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to create memo, err: %v", err)
}
@ -76,20 +79,23 @@ func (s *APIV2Service) CreateMemo(ctx context.Context, request *apiv2pb.CreateMe
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert memo, err: %v", err)
}
response := &apiv2pb.CreateMemoResponse{
response := &apiv1pb.CreateMemoResponse{
Memo: composedMemo,
}
return response, nil
}
func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMemoRequest) (*apiv2pb.UpdateMemoResponse, error) {
func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv1pb.UpdateMemoRequest) (*apiv1pb.UpdateMemoResponse, error) {
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
return nil, status.Errorf(codes.InvalidArgument, "updateMask is required")
}
userID := ctx.Value(userIDContextKey).(int32)
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
ID: &user.ID,
})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get current user, err: %v", err)
@ -103,7 +109,7 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe
if memo == nil {
return nil, status.Errorf(codes.NotFound, "memo not found")
}
if memo.CreatorId != userID && currentUser.Role != store.RoleAdmin {
if memo.CreatorId != user.ID && currentUser.Role != store.RoleAdmin {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
@ -135,16 +141,19 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert memo, err: %v", err)
}
response := &apiv2pb.UpdateMemoResponse{
response := &apiv1pb.UpdateMemoResponse{
Memo: composedMemo,
}
return response, nil
}
func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMemoRequest) (*apiv2pb.DeleteMemoResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv1pb.DeleteMemoRequest) (*apiv1pb.DeleteMemoResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
ID: &user.ID,
})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get current user, err: %v", err)
@ -158,7 +167,7 @@ func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMe
if memo == nil {
return nil, status.Errorf(codes.NotFound, "memo not found")
}
if memo.CreatorId != userID && currentUser.Role != store.RoleAdmin {
if memo.CreatorId != user.ID && currentUser.Role != store.RoleAdmin {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
@ -168,12 +177,12 @@ func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMe
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to delete memo, err: %v", err)
}
response := &apiv2pb.DeleteMemoResponse{}
response := &apiv1pb.DeleteMemoResponse{}
return response, nil
}
func (*APIV2Service) convertMemoFromStorepb(_ context.Context, memo *storepb.Memo) (*apiv2pb.Memo, error) {
return &apiv2pb.Memo{
func (*APIV2Service) convertMemoFromStorepb(_ context.Context, memo *storepb.Memo) (*apiv1pb.Memo, error) {
return &apiv1pb.Memo{
Id: memo.Id,
CreatedTime: timestamppb.New(time.Unix(memo.CreatedTs, 0)),
UpdatedTime: timestamppb.New(time.Unix(memo.UpdatedTs, 0)),
@ -182,6 +191,6 @@ func (*APIV2Service) convertMemoFromStorepb(_ context.Context, memo *storepb.Mem
Title: memo.Title,
Content: memo.Content,
Tags: memo.Tags,
Visibility: apiv2pb.Visibility(memo.Visibility),
Visibility: apiv1pb.Visibility(memo.Visibility),
}, nil
}

View File

@ -1,386 +0,0 @@
package v1
import (
"context"
"encoding/json"
"fmt"
"net/http"
"strings"
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
"github.com/yourselfhosted/slash/internal/util"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/server/metric"
"github.com/yourselfhosted/slash/store"
)
// Visibility is the type of a shortcut visibility.
type Visibility string
const (
// VisibilityPublic is the PUBLIC visibility.
VisibilityPublic Visibility = "PUBLIC"
// VisibilityWorkspace is the WORKSPACE visibility.
VisibilityWorkspace Visibility = "WORKSPACE"
// VisibilityPrivate is the PRIVATE visibility.
VisibilityPrivate Visibility = "PRIVATE"
)
func (v Visibility) String() string {
return string(v)
}
type OpenGraphMetadata struct {
Title string `json:"title"`
Description string `json:"description"`
Image string `json:"image"`
}
type Shortcut struct {
ID int32 `json:"id"`
// Standard fields
CreatorID int32 `json:"creatorId"`
Creator *User `json:"creator"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
RowStatus RowStatus `json:"rowStatus"`
// Domain specific fields
Name string `json:"name"`
Link string `json:"link"`
Title string `json:"title"`
Description string `json:"description"`
Visibility Visibility `json:"visibility"`
Tags []string `json:"tags"`
View int `json:"view"`
OpenGraphMetadata *OpenGraphMetadata `json:"openGraphMetadata"`
}
type CreateShortcutRequest struct {
Name string `json:"name"`
Link string `json:"link"`
Title string `json:"title"`
Description string `json:"description"`
Visibility Visibility `json:"visibility"`
Tags []string `json:"tags"`
OpenGraphMetadata *OpenGraphMetadata `json:"openGraphMetadata"`
}
type PatchShortcutRequest struct {
RowStatus *RowStatus `json:"rowStatus"`
Name *string `json:"name"`
Link *string `json:"link"`
Title *string `json:"title"`
Description *string `json:"description"`
Visibility *Visibility `json:"visibility"`
Tags []string `json:"tags"`
OpenGraphMetadata *OpenGraphMetadata `json:"openGraphMetadata"`
}
func (s *APIV1Service) registerShortcutRoutes(g *echo.Group) {
g.POST("/shortcut", func(c echo.Context) error {
ctx := c.Request().Context()
userID, ok := c.Get(userIDContextKey).(int32)
if !ok {
return echo.NewHTTPError(http.StatusUnauthorized, "missing user in session")
}
create := &CreateShortcutRequest{}
if err := json.NewDecoder(c.Request().Body).Decode(create); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("malformatted post shortcut request, err: %s", err)).SetInternal(err)
}
shortcut := &storepb.Shortcut{
CreatorId: userID,
Name: create.Name,
Link: create.Link,
Title: create.Title,
Description: create.Description,
Visibility: convertVisibilityToStorepb(create.Visibility),
Tags: create.Tags,
OgMetadata: &storepb.OpenGraphMetadata{},
}
if create.Name == "" {
return echo.NewHTTPError(http.StatusBadRequest, "name is required")
}
if create.OpenGraphMetadata != nil {
shortcut.OgMetadata = &storepb.OpenGraphMetadata{
Title: create.OpenGraphMetadata.Title,
Description: create.OpenGraphMetadata.Description,
Image: create.OpenGraphMetadata.Image,
}
}
shortcut, err := s.Store.CreateShortcut(ctx, shortcut)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to create shortcut, err: %s", err)).SetInternal(err)
}
if err := s.createShortcutCreateActivity(ctx, shortcut); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to create shortcut activity, err: %s", err)).SetInternal(err)
}
shortcutMessage, err := s.composeShortcut(ctx, convertShortcutFromStorepb(shortcut))
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to compose shortcut, err: %s", err)).SetInternal(err)
}
metric.Enqueue("shortcut create")
return c.JSON(http.StatusOK, shortcutMessage)
})
g.PATCH("/shortcut/:shortcutId", func(c echo.Context) error {
ctx := c.Request().Context()
shortcutID, err := util.ConvertStringToInt32(c.Param("shortcutId"))
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("shortcut ID is not a number: %s", c.Param("shortcutId"))).SetInternal(err)
}
userID, ok := c.Get(userIDContextKey).(int32)
if !ok {
return echo.NewHTTPError(http.StatusUnauthorized, "missing user in session")
}
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to find user, err: %s", err)).SetInternal(err)
}
shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{
ID: &shortcutID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to find shortcut, err: %s", err)).SetInternal(err)
}
if shortcut == nil {
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("not found shortcut with id: %d", shortcutID))
}
if shortcut.CreatorId != userID && currentUser.Role != store.RoleAdmin {
return echo.NewHTTPError(http.StatusForbidden, "unauthorized to update shortcut")
}
patch := &PatchShortcutRequest{}
if err := json.NewDecoder(c.Request().Body).Decode(patch); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("failed to decode patch shortcut request, err: %s", err)).SetInternal(err)
}
shortcutUpdate := &store.UpdateShortcut{
ID: shortcutID,
Name: patch.Name,
Link: patch.Link,
Title: patch.Title,
Description: patch.Description,
}
if patch.RowStatus != nil {
shortcutUpdate.RowStatus = (*store.RowStatus)(patch.RowStatus)
}
if patch.Visibility != nil {
shortcutUpdate.Visibility = (*store.Visibility)(patch.Visibility)
}
if patch.Tags != nil {
tag := strings.Join(patch.Tags, " ")
shortcutUpdate.Tag = &tag
}
if patch.OpenGraphMetadata != nil {
shortcutUpdate.OpenGraphMetadata = &storepb.OpenGraphMetadata{
Title: patch.OpenGraphMetadata.Title,
Description: patch.OpenGraphMetadata.Description,
Image: patch.OpenGraphMetadata.Image,
}
}
shortcut, err = s.Store.UpdateShortcut(ctx, shortcutUpdate)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to patch shortcut, err: %s", err)).SetInternal(err)
}
shortcutMessage, err := s.composeShortcut(ctx, convertShortcutFromStorepb(shortcut))
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to compose shortcut, err: %s", err)).SetInternal(err)
}
return c.JSON(http.StatusOK, shortcutMessage)
})
g.GET("/shortcut", func(c echo.Context) error {
ctx := c.Request().Context()
userID, ok := c.Get(userIDContextKey).(int32)
if !ok {
return echo.NewHTTPError(http.StatusUnauthorized, "missing user in session")
}
find := &store.FindShortcut{}
if tag := c.QueryParam("tag"); tag != "" {
find.Tag = &tag
}
list := []*storepb.Shortcut{}
find.VisibilityList = []store.Visibility{store.VisibilityWorkspace, store.VisibilityPublic}
visibleShortcutList, err := s.Store.ListShortcuts(ctx, find)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to fetch shortcut list, err: %s", err)).SetInternal(err)
}
list = append(list, visibleShortcutList...)
find.VisibilityList = []store.Visibility{store.VisibilityPrivate}
find.CreatorID = &userID
privateShortcutList, err := s.Store.ListShortcuts(ctx, find)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to fetch private shortcut list, err: %s", err)).SetInternal(err)
}
list = append(list, privateShortcutList...)
shortcutMessageList := []*Shortcut{}
for _, shortcut := range list {
shortcutMessage, err := s.composeShortcut(ctx, convertShortcutFromStorepb(shortcut))
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to compose shortcut, err: %s", err)).SetInternal(err)
}
shortcutMessageList = append(shortcutMessageList, shortcutMessage)
}
return c.JSON(http.StatusOK, shortcutMessageList)
})
g.GET("/shortcut/:id", func(c echo.Context) error {
ctx := c.Request().Context()
shortcutID, err := util.ConvertStringToInt32(c.Param("id"))
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("shortcut id is not a number: %s", c.Param("id"))).SetInternal(err)
}
shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{
ID: &shortcutID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to fetch shortcut by id, err: %s", err)).SetInternal(err)
}
if shortcut == nil {
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("not found shortcut with id: %d", shortcutID))
}
shortcutMessage, err := s.composeShortcut(ctx, convertShortcutFromStorepb(shortcut))
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to compose shortcut, err: %s", err)).SetInternal(err)
}
return c.JSON(http.StatusOK, shortcutMessage)
})
g.DELETE("/shortcut/:id", func(c echo.Context) error {
ctx := c.Request().Context()
shortcutID, err := util.ConvertStringToInt32(c.Param("id"))
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("shortcut id is not a number: %s", c.Param("id"))).SetInternal(err)
}
userID, ok := c.Get(userIDContextKey).(int32)
if !ok {
return echo.NewHTTPError(http.StatusUnauthorized, "missing user in session")
}
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to find user, err: %s", err)).SetInternal(err)
}
shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{
ID: &shortcutID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to fetch shortcut by id, err: %s", err)).SetInternal(err)
}
if shortcut == nil {
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("not found shortcut with id: %d", shortcutID))
}
if shortcut.CreatorId != userID && currentUser.Role != store.RoleAdmin {
return echo.NewHTTPError(http.StatusForbidden, "Unauthorized to delete shortcut")
}
err = s.Store.DeleteShortcut(ctx, &store.DeleteShortcut{ID: shortcutID})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to delete shortcut, err: %s", err)).SetInternal(err)
}
return c.JSON(http.StatusOK, true)
})
}
func (s *APIV1Service) composeShortcut(ctx context.Context, shortcut *Shortcut) (*Shortcut, error) {
if shortcut == nil {
return nil, nil
}
user, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &shortcut.CreatorID,
})
if err != nil {
return nil, errors.Wrap(err, "Failed to get creator")
}
if user == nil {
return nil, errors.New("Creator not found")
}
shortcut.Creator = convertUserFromStore(user)
activityList, err := s.Store.ListActivities(ctx, &store.FindActivity{
Type: store.ActivityShortcutView,
Level: store.ActivityInfo,
PayloadShortcutID: &shortcut.ID,
})
if err != nil {
return nil, errors.Wrap(err, "Failed to list activities")
}
shortcut.View = len(activityList)
return shortcut, nil
}
func convertShortcutFromStorepb(shortcut *storepb.Shortcut) *Shortcut {
return &Shortcut{
ID: shortcut.Id,
CreatedTs: shortcut.CreatedTs,
UpdatedTs: shortcut.UpdatedTs,
CreatorID: shortcut.CreatorId,
RowStatus: RowStatus(shortcut.RowStatus.String()),
Name: shortcut.Name,
Link: shortcut.Link,
Title: shortcut.Title,
Description: shortcut.Description,
Visibility: Visibility(shortcut.Visibility.String()),
Tags: shortcut.Tags,
OpenGraphMetadata: &OpenGraphMetadata{
Title: shortcut.OgMetadata.Title,
Description: shortcut.OgMetadata.Description,
Image: shortcut.OgMetadata.Image,
},
}
}
func convertVisibilityToStorepb(visibility Visibility) storepb.Visibility {
switch visibility {
case VisibilityPublic:
return storepb.Visibility_PUBLIC
case VisibilityWorkspace:
return storepb.Visibility_WORKSPACE
case VisibilityPrivate:
return storepb.Visibility_PRIVATE
default:
return storepb.Visibility_PUBLIC
}
}
func (s *APIV1Service) createShortcutCreateActivity(ctx context.Context, shortcut *storepb.Shortcut) error {
payload := &ActivityShorcutCreatePayload{
ShortcutID: shortcut.Id,
}
payloadStr, err := json.Marshal(payload)
if err != nil {
return errors.Wrap(err, "Failed to marshal activity payload")
}
activity := &store.Activity{
CreatorID: shortcut.CreatorId,
Type: store.ActivityShortcutCreate,
Level: store.ActivityInfo,
Payload: string(payloadStr),
}
_, err = s.Store.CreateActivity(ctx, activity)
if err != nil {
return errors.Wrap(err, "Failed to create activity")
}
return nil
}

View File

@ -1,4 +1,4 @@
package v2
package v1
import (
"context"
@ -16,14 +16,17 @@ import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/types/known/timestamppb"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/server/metric"
"github.com/yourselfhosted/slash/store"
)
func (s *APIV2Service) ListShortcuts(ctx context.Context, _ *apiv2pb.ListShortcutsRequest) (*apiv2pb.ListShortcutsResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
func (s *APIV2Service) ListShortcuts(ctx context.Context, _ *apiv1pb.ListShortcutsRequest) (*apiv1pb.ListShortcutsResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
find := &store.FindShortcut{}
find.VisibilityList = []store.Visibility{store.VisibilityWorkspace, store.VisibilityPublic}
visibleShortcutList, err := s.Store.ListShortcuts(ctx, find)
@ -32,14 +35,14 @@ func (s *APIV2Service) ListShortcuts(ctx context.Context, _ *apiv2pb.ListShortcu
}
find.VisibilityList = []store.Visibility{store.VisibilityPrivate}
find.CreatorID = &userID
find.CreatorID = &user.ID
shortcutList, err := s.Store.ListShortcuts(ctx, find)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to fetch private shortcut list, err: %v", err)
}
shortcutList = append(shortcutList, visibleShortcutList...)
shortcuts := []*apiv2pb.Shortcut{}
shortcuts := []*apiv1pb.Shortcut{}
for _, shortcut := range shortcutList {
composedShortcut, err := s.convertShortcutFromStorepb(ctx, shortcut)
if err != nil {
@ -48,13 +51,13 @@ func (s *APIV2Service) ListShortcuts(ctx context.Context, _ *apiv2pb.ListShortcu
shortcuts = append(shortcuts, composedShortcut)
}
response := &apiv2pb.ListShortcutsResponse{
response := &apiv1pb.ListShortcutsResponse{
Shortcuts: shortcuts,
}
return response, nil
}
func (s *APIV2Service) GetShortcut(ctx context.Context, request *apiv2pb.GetShortcutRequest) (*apiv2pb.GetShortcutResponse, error) {
func (s *APIV2Service) GetShortcut(ctx context.Context, request *apiv1pb.GetShortcutRequest) (*apiv1pb.GetShortcutResponse, error) {
shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{
ID: &request.Id,
})
@ -80,13 +83,13 @@ func (s *APIV2Service) GetShortcut(ctx context.Context, request *apiv2pb.GetShor
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert shortcut, err: %v", err)
}
response := &apiv2pb.GetShortcutResponse{
response := &apiv1pb.GetShortcutResponse{
Shortcut: composedShortcut,
}
return response, nil
}
func (s *APIV2Service) GetShortcutByName(ctx context.Context, request *apiv2pb.GetShortcutByNameRequest) (*apiv2pb.GetShortcutByNameResponse, error) {
func (s *APIV2Service) GetShortcutByName(ctx context.Context, request *apiv1pb.GetShortcutByNameRequest) (*apiv1pb.GetShortcutByNameResponse, error) {
shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{
Name: &request.Name,
})
@ -117,20 +120,23 @@ func (s *APIV2Service) GetShortcutByName(ctx context.Context, request *apiv2pb.G
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert shortcut, err: %v", err)
}
response := &apiv2pb.GetShortcutByNameResponse{
response := &apiv1pb.GetShortcutByNameResponse{
Shortcut: composedShortcut,
}
return response, nil
}
func (s *APIV2Service) CreateShortcut(ctx context.Context, request *apiv2pb.CreateShortcutRequest) (*apiv2pb.CreateShortcutResponse, error) {
func (s *APIV2Service) CreateShortcut(ctx context.Context, request *apiv1pb.CreateShortcutRequest) (*apiv1pb.CreateShortcutResponse, error) {
if request.Shortcut.Name == "" || request.Shortcut.Link == "" {
return nil, status.Errorf(codes.InvalidArgument, "name and link are required")
}
userID := ctx.Value(userIDContextKey).(int32)
shortcut := &storepb.Shortcut{
CreatorId: userID,
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
shortcutCreate := &storepb.Shortcut{
CreatorId: user.ID,
Name: request.Shortcut.Name,
Link: request.Shortcut.Link,
Title: request.Shortcut.Title,
@ -140,13 +146,13 @@ func (s *APIV2Service) CreateShortcut(ctx context.Context, request *apiv2pb.Crea
OgMetadata: &storepb.OpenGraphMetadata{},
}
if request.Shortcut.OgMetadata != nil {
shortcut.OgMetadata = &storepb.OpenGraphMetadata{
shortcutCreate.OgMetadata = &storepb.OpenGraphMetadata{
Title: request.Shortcut.OgMetadata.Title,
Description: request.Shortcut.OgMetadata.Description,
Image: request.Shortcut.OgMetadata.Image,
}
}
shortcut, err := s.Store.CreateShortcut(ctx, shortcut)
shortcut, err := s.Store.CreateShortcut(ctx, shortcutCreate)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to create shortcut, err: %v", err)
}
@ -158,23 +164,20 @@ func (s *APIV2Service) CreateShortcut(ctx context.Context, request *apiv2pb.Crea
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert shortcut, err: %v", err)
}
response := &apiv2pb.CreateShortcutResponse{
response := &apiv1pb.CreateShortcutResponse{
Shortcut: composedShortcut,
}
return response, nil
}
func (s *APIV2Service) UpdateShortcut(ctx context.Context, request *apiv2pb.UpdateShortcutRequest) (*apiv2pb.UpdateShortcutResponse, error) {
func (s *APIV2Service) UpdateShortcut(ctx context.Context, request *apiv1pb.UpdateShortcutRequest) (*apiv1pb.UpdateShortcutResponse, error) {
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
return nil, status.Errorf(codes.InvalidArgument, "updateMask is required")
}
userID := ctx.Value(userIDContextKey).(int32)
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get current user, err: %v", err)
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{
ID: &request.Shortcut.Id,
@ -185,7 +188,7 @@ func (s *APIV2Service) UpdateShortcut(ctx context.Context, request *apiv2pb.Upda
if shortcut == nil {
return nil, status.Errorf(codes.NotFound, "shortcut not found")
}
if shortcut.CreatorId != userID && currentUser.Role != store.RoleAdmin {
if shortcut.CreatorId != user.ID && user.Role != store.RoleAdmin {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
@ -227,19 +230,16 @@ func (s *APIV2Service) UpdateShortcut(ctx context.Context, request *apiv2pb.Upda
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert shortcut, err: %v", err)
}
response := &apiv2pb.UpdateShortcutResponse{
response := &apiv1pb.UpdateShortcutResponse{
Shortcut: composedShortcut,
}
return response, nil
}
func (s *APIV2Service) DeleteShortcut(ctx context.Context, request *apiv2pb.DeleteShortcutRequest) (*apiv2pb.DeleteShortcutResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
func (s *APIV2Service) DeleteShortcut(ctx context.Context, request *apiv1pb.DeleteShortcutRequest) (*apiv1pb.DeleteShortcutResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get current user, err: %v", err)
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{
ID: &request.Id,
@ -250,7 +250,7 @@ func (s *APIV2Service) DeleteShortcut(ctx context.Context, request *apiv2pb.Dele
if shortcut == nil {
return nil, status.Errorf(codes.NotFound, "shortcut not found")
}
if shortcut.CreatorId != userID && currentUser.Role != store.RoleAdmin {
if shortcut.CreatorId != user.ID && user.Role != store.RoleAdmin {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
@ -260,11 +260,11 @@ func (s *APIV2Service) DeleteShortcut(ctx context.Context, request *apiv2pb.Dele
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to delete shortcut, err: %v", err)
}
response := &apiv2pb.DeleteShortcutResponse{}
response := &apiv1pb.DeleteShortcutResponse{}
return response, nil
}
func (s *APIV2Service) GetShortcutAnalytics(ctx context.Context, request *apiv2pb.GetShortcutAnalyticsRequest) (*apiv2pb.GetShortcutAnalyticsResponse, error) {
func (s *APIV2Service) GetShortcutAnalytics(ctx context.Context, request *apiv1pb.GetShortcutAnalyticsRequest) (*apiv1pb.GetShortcutAnalyticsResponse, error) {
shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{
ID: &request.Id,
})
@ -313,7 +313,7 @@ func (s *APIV2Service) GetShortcutAnalytics(ctx context.Context, request *apiv2p
}
metric.Enqueue("shortcut analytics")
response := &apiv2pb.GetShortcutAnalyticsResponse{
response := &apiv1pb.GetShortcutAnalyticsResponse{
References: mapToAnalyticsSlice(referenceMap),
Devices: mapToAnalyticsSlice(deviceMap),
Browsers: mapToAnalyticsSlice(browserMap),
@ -321,15 +321,15 @@ func (s *APIV2Service) GetShortcutAnalytics(ctx context.Context, request *apiv2p
return response, nil
}
func mapToAnalyticsSlice(m map[string]int32) []*apiv2pb.GetShortcutAnalyticsResponse_AnalyticsItem {
analyticsSlice := make([]*apiv2pb.GetShortcutAnalyticsResponse_AnalyticsItem, 0)
func mapToAnalyticsSlice(m map[string]int32) []*apiv1pb.GetShortcutAnalyticsResponse_AnalyticsItem {
analyticsSlice := make([]*apiv1pb.GetShortcutAnalyticsResponse_AnalyticsItem, 0)
for key, value := range m {
analyticsSlice = append(analyticsSlice, &apiv2pb.GetShortcutAnalyticsResponse_AnalyticsItem{
analyticsSlice = append(analyticsSlice, &apiv1pb.GetShortcutAnalyticsResponse_AnalyticsItem{
Name: key,
Count: value,
})
}
slices.SortFunc(analyticsSlice, func(i, j *apiv2pb.GetShortcutAnalyticsResponse_AnalyticsItem) int {
slices.SortFunc(analyticsSlice, func(i, j *apiv1pb.GetShortcutAnalyticsResponse_AnalyticsItem) int {
return int(i.Count - j.Count)
})
return analyticsSlice
@ -385,20 +385,20 @@ func (s *APIV2Service) createShortcutCreateActivity(ctx context.Context, shortcu
return nil
}
func (s *APIV2Service) convertShortcutFromStorepb(ctx context.Context, shortcut *storepb.Shortcut) (*apiv2pb.Shortcut, error) {
composedShortcut := &apiv2pb.Shortcut{
func (s *APIV2Service) convertShortcutFromStorepb(ctx context.Context, shortcut *storepb.Shortcut) (*apiv1pb.Shortcut, error) {
composedShortcut := &apiv1pb.Shortcut{
Id: shortcut.Id,
CreatorId: shortcut.CreatorId,
CreatedTime: timestamppb.New(time.Unix(shortcut.CreatedTs, 0)),
UpdatedTime: timestamppb.New(time.Unix(shortcut.UpdatedTs, 0)),
RowStatus: apiv2pb.RowStatus(shortcut.RowStatus),
RowStatus: apiv1pb.RowStatus(shortcut.RowStatus),
Name: shortcut.Name,
Link: shortcut.Link,
Title: shortcut.Title,
Tags: shortcut.Tags,
Description: shortcut.Description,
Visibility: apiv2pb.Visibility(shortcut.Visibility),
OgMetadata: &apiv2pb.OpenGraphMetadata{
Visibility: apiv1pb.Visibility(shortcut.Visibility),
OgMetadata: &apiv1pb.OpenGraphMetadata{
Title: shortcut.OgMetadata.Title,
Description: shortcut.OgMetadata.Description,
Image: shortcut.OgMetadata.Image,

View File

@ -1,4 +1,4 @@
package v2
package v1
import (
"context"
@ -6,25 +6,25 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
)
func (s *APIV2Service) GetSubscription(ctx context.Context, _ *apiv2pb.GetSubscriptionRequest) (*apiv2pb.GetSubscriptionResponse, error) {
func (s *APIV2Service) GetSubscription(ctx context.Context, _ *apiv1pb.GetSubscriptionRequest) (*apiv1pb.GetSubscriptionResponse, error) {
subscription, err := s.LicenseService.LoadSubscription(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to load subscription: %v", err)
}
return &apiv2pb.GetSubscriptionResponse{
return &apiv1pb.GetSubscriptionResponse{
Subscription: subscription,
}, nil
}
func (s *APIV2Service) UpdateSubscription(ctx context.Context, request *apiv2pb.UpdateSubscriptionRequest) (*apiv2pb.UpdateSubscriptionResponse, error) {
func (s *APIV2Service) UpdateSubscription(ctx context.Context, request *apiv1pb.UpdateSubscriptionRequest) (*apiv1pb.UpdateSubscriptionResponse, error) {
subscription, err := s.LicenseService.UpdateSubscription(ctx, request.LicenseKey)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to load subscription: %v", err)
}
return &apiv2pb.UpdateSubscriptionResponse{
return &apiv1pb.UpdateSubscriptionResponse{
Subscription: subscription,
}, nil
}

View File

@ -1,340 +0,0 @@
package v1
import (
"encoding/json"
"fmt"
"net/http"
"net/mail"
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
"golang.org/x/crypto/bcrypt"
"github.com/yourselfhosted/slash/internal/util"
"github.com/yourselfhosted/slash/server/metric"
"github.com/yourselfhosted/slash/server/service/license"
"github.com/yourselfhosted/slash/store"
)
const (
// BotID is the id of bot.
BotID = 0
)
// Role is the type of a role.
type Role string
const (
// RoleAdmin is the ADMIN role.
RoleAdmin Role = "ADMIN"
// RoleUser is the USER role.
RoleUser Role = "USER"
)
func (r Role) String() string {
switch r {
case RoleAdmin:
return "ADMIN"
case RoleUser:
return "USER"
}
return "USER"
}
type User struct {
ID int32 `json:"id"`
// Standard fields
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
RowStatus RowStatus `json:"rowStatus"`
// Domain specific fields
Email string `json:"email"`
Nickname string `json:"nickname"`
Role Role `json:"role"`
}
type CreateUserRequest struct {
Email string `json:"email"`
Nickname string `json:"nickname"`
Password string `json:"password"`
Role Role `json:"role"`
}
func (create CreateUserRequest) Validate() error {
if create.Email != "" && !validateEmail(create.Email) {
return errors.New("invalid email format")
}
if create.Nickname != "" && len(create.Nickname) < 3 {
return errors.New("nickname is too short, minimum length is 3")
}
if len(create.Password) < 3 {
return errors.New("password is too short, minimum length is 3")
}
return nil
}
type PatchUserRequest struct {
RowStatus *RowStatus `json:"rowStatus"`
Email *string `json:"email"`
Nickname *string `json:"nickname"`
Password *string `json:"password"`
Role *Role `json:"role"`
}
func (s *APIV1Service) registerUserRoutes(g *echo.Group) {
g.POST("/user", func(c echo.Context) error {
ctx := c.Request().Context()
userID, ok := c.Get(userIDContextKey).(int32)
if !ok {
return echo.NewHTTPError(http.StatusUnauthorized, "Missing auth session")
}
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user by id").SetInternal(err)
}
if currentUser == nil {
return echo.NewHTTPError(http.StatusUnauthorized, "Missing auth session")
}
if currentUser.Role != store.RoleAdmin {
return echo.NewHTTPError(http.StatusUnauthorized, "Unauthorized to create user")
}
if !s.LicenseService.IsFeatureEnabled(license.FeatureTypeUnlimitedAccounts) {
userList, err := s.Store.ListUsers(ctx, &store.FindUser{})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to list users").SetInternal(err)
}
if len(userList) >= 5 {
return echo.NewHTTPError(http.StatusBadRequest, "Maximum number of users reached")
}
}
userCreate := &CreateUserRequest{}
if err := json.NewDecoder(c.Request().Body).Decode(userCreate); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "Malformatted post user request").SetInternal(err)
}
if err := userCreate.Validate(); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "Invalid user create format").SetInternal(err)
}
passwordHash, err := bcrypt.GenerateFromPassword([]byte(userCreate.Password), bcrypt.DefaultCost)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to generate password hash").SetInternal(err)
}
user, err := s.Store.CreateUser(ctx, &store.User{
Role: store.Role(userCreate.Role),
Email: userCreate.Email,
Nickname: userCreate.Nickname,
PasswordHash: string(passwordHash),
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create user").SetInternal(err)
}
userMessage := convertUserFromStore(user)
metric.Enqueue("user create")
return c.JSON(http.StatusOK, userMessage)
})
g.GET("/user", func(c echo.Context) error {
ctx := c.Request().Context()
list, err := s.Store.ListUsers(ctx, &store.FindUser{})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to list users, err: %s", err)).SetInternal(err)
}
userList := []*User{}
for _, user := range list {
userList = append(userList, convertUserFromStore(user))
}
return c.JSON(http.StatusOK, userList)
})
// GET /api/user/me is used to check if the user is logged in.
g.GET("/user/me", func(c echo.Context) error {
ctx := c.Request().Context()
userID, ok := c.Get(userIDContextKey).(int32)
if !ok {
return echo.NewHTTPError(http.StatusUnauthorized, "missing auth session")
}
user, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to find user, err: %s", err)).SetInternal(err)
}
return c.JSON(http.StatusOK, convertUserFromStore(user))
})
g.GET("/user/:id", func(c echo.Context) error {
ctx := c.Request().Context()
userID, err := util.ConvertStringToInt32(c.Param("id"))
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("user id is not a number: %s", c.Param("id"))).SetInternal(err)
}
user, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to find user, err: %s", err)).SetInternal(err)
}
userMessage := convertUserFromStore(user)
userID, ok := c.Get(userIDContextKey).(int32)
if !ok {
userMessage.Email = ""
}
return c.JSON(http.StatusOK, userMessage)
})
g.PATCH("/user/:id", func(c echo.Context) error {
ctx := c.Request().Context()
userID, err := util.ConvertStringToInt32(c.Param("id"))
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("user id is not a number: %s", c.Param("id"))).SetInternal(err)
}
currentUserID, ok := c.Get(userIDContextKey).(int32)
if !ok {
return echo.NewHTTPError(http.StatusUnauthorized, "missing user in session")
}
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &currentUserID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "failed to find current user").SetInternal(err)
}
if currentUser == nil {
return echo.NewHTTPError(http.StatusUnauthorized, "missing user in session")
}
if currentUser.ID != userID && currentUser.Role != store.RoleAdmin {
return echo.NewHTTPError(http.StatusForbidden, "access forbidden for current session user").SetInternal(err)
}
userPatch := &PatchUserRequest{}
if err := json.NewDecoder(c.Request().Body).Decode(userPatch); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("failed to decode request body, err: %s", err)).SetInternal(err)
}
updateUser := &store.UpdateUser{
ID: userID,
}
if userPatch.Email != nil {
if !validateEmail(*userPatch.Email) {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("invalid email format: %s", *userPatch.Email))
}
updateUser.Email = userPatch.Email
}
if userPatch.Nickname != nil {
updateUser.Nickname = userPatch.Nickname
}
if userPatch.Password != nil && *userPatch.Password != "" {
passwordHash, err := bcrypt.GenerateFromPassword([]byte(*userPatch.Password), bcrypt.DefaultCost)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to hash password, err: %s", err)).SetInternal(err)
}
passwordHashStr := string(passwordHash)
updateUser.PasswordHash = &passwordHashStr
}
if userPatch.RowStatus != nil {
rowStatus := store.RowStatus(*userPatch.RowStatus)
updateUser.RowStatus = &rowStatus
}
if userPatch.Role != nil {
adminRole := store.RoleAdmin
adminUsers, err := s.Store.ListUsers(ctx, &store.FindUser{
Role: &adminRole,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to list admin users, err: %s", err)).SetInternal(err)
}
if len(adminUsers) == 1 && adminUsers[0].ID == userID && *userPatch.Role != RoleAdmin {
return echo.NewHTTPError(http.StatusBadRequest, "cannot remove admin role from the last admin user")
}
role := store.Role(*userPatch.Role)
updateUser.Role = &role
}
user, err := s.Store.UpdateUser(ctx, updateUser)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to update user, err: %s", err)).SetInternal(err)
}
return c.JSON(http.StatusOK, convertUserFromStore(user))
})
g.DELETE("/user/:id", func(c echo.Context) error {
ctx := c.Request().Context()
currentUserID, ok := c.Get(userIDContextKey).(int32)
if !ok {
return echo.NewHTTPError(http.StatusUnauthorized, "missing user in session")
}
currentUser, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &currentUserID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to find current session user, err: %s", err)).SetInternal(err)
}
if currentUser == nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("current session user not found with ID: %d", currentUserID)).SetInternal(err)
}
if currentUser.Role != store.RoleAdmin {
return echo.NewHTTPError(http.StatusForbidden, "access forbidden for current session user").SetInternal(err)
}
userID, err := util.ConvertStringToInt32(c.Param("id"))
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("user id is not a number: %s", c.Param("id"))).SetInternal(err)
}
user, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to find user, err: %s", err)).SetInternal(err)
}
if user == nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("user not found with ID: %d", userID)).SetInternal(err)
}
if user.Role == store.RoleAdmin {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("cannot delete admin user with ID: %d", userID)).SetInternal(err)
}
if err := s.Store.DeleteUser(ctx, &store.DeleteUser{
ID: userID,
}); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to delete user, err: %s", err)).SetInternal(err)
}
return c.JSON(http.StatusOK, true)
})
}
// validateEmail validates the email.
func validateEmail(email string) bool {
if _, err := mail.ParseAddress(email); err != nil {
return false
}
return true
}
// convertUserFromStore converts a store user to a user.
func convertUserFromStore(user *store.User) *User {
return &User{
ID: user.ID,
CreatedTs: user.CreatedTs,
UpdatedTs: user.UpdatedTs,
RowStatus: RowStatus(user.RowStatus),
Email: user.Email,
Nickname: user.Nickname,
Role: Role(user.Role),
}
}

View File

@ -1,4 +1,4 @@
package v2
package v1
import (
"context"
@ -13,7 +13,7 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"
"github.com/yourselfhosted/slash/api/auth"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/server/service/license"
"github.com/yourselfhosted/slash/store"
@ -24,23 +24,23 @@ const (
BotID = 0
)
func (s *APIV2Service) ListUsers(ctx context.Context, _ *apiv2pb.ListUsersRequest) (*apiv2pb.ListUsersResponse, error) {
func (s *APIV2Service) ListUsers(ctx context.Context, _ *apiv1pb.ListUsersRequest) (*apiv1pb.ListUsersResponse, error) {
users, err := s.Store.ListUsers(ctx, &store.FindUser{})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to list users: %v", err)
}
userMessages := []*apiv2pb.User{}
userMessages := []*apiv1pb.User{}
for _, user := range users {
userMessages = append(userMessages, convertUserFromStore(user))
}
response := &apiv2pb.ListUsersResponse{
response := &apiv1pb.ListUsersResponse{
Users: userMessages,
}
return response, nil
}
func (s *APIV2Service) GetUser(ctx context.Context, request *apiv2pb.GetUserRequest) (*apiv2pb.GetUserResponse, error) {
func (s *APIV2Service) GetUser(ctx context.Context, request *apiv1pb.GetUserRequest) (*apiv1pb.GetUserResponse, error) {
user, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &request.Id,
})
@ -52,13 +52,13 @@ func (s *APIV2Service) GetUser(ctx context.Context, request *apiv2pb.GetUserRequ
}
userMessage := convertUserFromStore(user)
response := &apiv2pb.GetUserResponse{
response := &apiv1pb.GetUserResponse{
User: userMessage,
}
return response, nil
}
func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUserRequest) (*apiv2pb.CreateUserResponse, error) {
func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv1pb.CreateUserRequest) (*apiv1pb.CreateUserResponse, error) {
passwordHash, err := bcrypt.GenerateFromPassword([]byte(request.User.Password), bcrypt.DefaultCost)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to hash password: %v", err)
@ -83,15 +83,18 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to create user: %v", err)
}
response := &apiv2pb.CreateUserResponse{
response := &apiv1pb.CreateUserResponse{
User: convertUserFromStore(user),
}
return response, nil
}
func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUserRequest) (*apiv2pb.UpdateUserResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
if userID != request.User.Id {
func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv1pb.UpdateUserRequest) (*apiv1pb.UpdateUserResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
if user.ID != request.User.Id {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
@ -108,43 +111,46 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs
userUpdate.Nickname = &request.User.Nickname
}
}
user, err := s.Store.UpdateUser(ctx, userUpdate)
user, err = s.Store.UpdateUser(ctx, userUpdate)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to update user: %v", err)
}
return &apiv2pb.UpdateUserResponse{
return &apiv1pb.UpdateUserResponse{
User: convertUserFromStore(user),
}, nil
}
func (s *APIV2Service) DeleteUser(ctx context.Context, request *apiv2pb.DeleteUserRequest) (*apiv2pb.DeleteUserResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
if userID == request.Id {
func (s *APIV2Service) DeleteUser(ctx context.Context, request *apiv1pb.DeleteUserRequest) (*apiv1pb.DeleteUserResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
if user.ID == request.Id {
return nil, status.Errorf(codes.InvalidArgument, "cannot delete yourself")
}
err := s.Store.DeleteUser(ctx, &store.DeleteUser{
ID: request.Id,
})
if err != nil {
if err := s.Store.DeleteUser(ctx, &store.DeleteUser{ID: request.Id}); err != nil {
return nil, status.Errorf(codes.Internal, "failed to delete user: %v", err)
}
response := &apiv2pb.DeleteUserResponse{}
response := &apiv1pb.DeleteUserResponse{}
return response, nil
}
func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, request *apiv2pb.ListUserAccessTokensRequest) (*apiv2pb.ListUserAccessTokensResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
if userID != request.Id {
func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, request *apiv1pb.ListUserAccessTokensRequest) (*apiv1pb.ListUserAccessTokensResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
if user.ID != request.Id {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, userID)
userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, user.ID)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to list access tokens: %v", err)
}
accessTokens := []*apiv2pb.UserAccessToken{}
accessTokens := []*apiv1pb.UserAccessToken{}
for _, userAccessToken := range userAccessTokens {
claims := &auth.ClaimsMessage{}
_, err := jwt.ParseWithClaims(userAccessToken.AccessToken, claims, func(t *jwt.Token) (any, error) {
@ -163,7 +169,7 @@ func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, request *apiv2p
continue
}
userAccessToken := &apiv2pb.UserAccessToken{
userAccessToken := &apiv1pb.UserAccessToken{
AccessToken: userAccessToken.AccessToken,
Description: userAccessToken.Description,
IssuedAt: timestamppb.New(claims.IssuedAt.Time),
@ -175,29 +181,22 @@ func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, request *apiv2p
}
// Sort by issued time in descending order.
slices.SortFunc(accessTokens, func(i, j *apiv2pb.UserAccessToken) int {
slices.SortFunc(accessTokens, func(i, j *apiv1pb.UserAccessToken) int {
return int(i.IssuedAt.Seconds - j.IssuedAt.Seconds)
})
response := &apiv2pb.ListUserAccessTokensResponse{
response := &apiv1pb.ListUserAccessTokensResponse{
AccessTokens: accessTokens,
}
return response, nil
}
func (s *APIV2Service) CreateUserAccessToken(ctx context.Context, request *apiv2pb.CreateUserAccessTokenRequest) (*apiv2pb.CreateUserAccessTokenResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
if userID != request.Id {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
user, err := s.Store.GetUser(ctx, &store.FindUser{
ID: &userID,
})
func (s *APIV2Service) CreateUserAccessToken(ctx context.Context, request *apiv1pb.CreateUserAccessTokenRequest) (*apiv1pb.CreateUserAccessTokenResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
if user == nil {
return nil, status.Errorf(codes.NotFound, "user not found")
if user.ID != request.Id {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
}
expiresAt := time.Time{}
@ -230,7 +229,7 @@ func (s *APIV2Service) CreateUserAccessToken(ctx context.Context, request *apiv2
return nil, status.Errorf(codes.Internal, "failed to upsert access token to store: %v", err)
}
userAccessToken := &apiv2pb.UserAccessToken{
userAccessToken := &apiv1pb.UserAccessToken{
AccessToken: accessToken,
Description: request.Description,
IssuedAt: timestamppb.New(claims.IssuedAt.Time),
@ -238,19 +237,18 @@ func (s *APIV2Service) CreateUserAccessToken(ctx context.Context, request *apiv2
if claims.ExpiresAt != nil {
userAccessToken.ExpiresAt = timestamppb.New(claims.ExpiresAt.Time)
}
response := &apiv2pb.CreateUserAccessTokenResponse{
response := &apiv1pb.CreateUserAccessTokenResponse{
AccessToken: userAccessToken,
}
return response, nil
}
func (s *APIV2Service) DeleteUserAccessToken(ctx context.Context, request *apiv2pb.DeleteUserAccessTokenRequest) (*apiv2pb.DeleteUserAccessTokenResponse, error) {
userID := ctx.Value(userIDContextKey).(int32)
if userID != request.Id {
return nil, status.Errorf(codes.PermissionDenied, "Permission denied")
func (s *APIV2Service) DeleteUserAccessToken(ctx context.Context, request *apiv1pb.DeleteUserAccessTokenRequest) (*apiv1pb.DeleteUserAccessTokenResponse, error) {
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, userID)
userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, user.ID)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to list access tokens: %v", err)
}
@ -262,7 +260,7 @@ func (s *APIV2Service) DeleteUserAccessToken(ctx context.Context, request *apiv2
updatedUserAccessTokens = append(updatedUserAccessTokens, userAccessToken)
}
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: userID,
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_ACCESS_TOKENS,
Value: &storepb.UserSetting_AccessTokens{
AccessTokens: &storepb.AccessTokensUserSetting{
@ -273,7 +271,7 @@ func (s *APIV2Service) DeleteUserAccessToken(ctx context.Context, request *apiv2
return nil, status.Errorf(codes.Internal, "failed to upsert user setting: %v", err)
}
return &apiv2pb.DeleteUserAccessTokenResponse{}, nil
return &apiv1pb.DeleteUserAccessTokenResponse{}, nil
}
func (s *APIV2Service) UpsertAccessTokenToStore(ctx context.Context, user *store.User, accessToken, description string) error {
@ -300,8 +298,8 @@ func (s *APIV2Service) UpsertAccessTokenToStore(ctx context.Context, user *store
return nil
}
func convertUserFromStore(user *store.User) *apiv2pb.User {
return &apiv2pb.User{
func convertUserFromStore(user *store.User) *apiv1pb.User {
return &apiv1pb.User{
Id: int32(user.ID),
RowStatus: convertRowStatusFromStore(user.RowStatus),
CreatedTime: timestamppb.New(time.Unix(user.CreatedTs, 0)),
@ -312,13 +310,13 @@ func convertUserFromStore(user *store.User) *apiv2pb.User {
}
}
func convertUserRoleFromStore(role store.Role) apiv2pb.Role {
func convertUserRoleFromStore(role store.Role) apiv1pb.Role {
switch role {
case store.RoleAdmin:
return apiv2pb.Role_ADMIN
return apiv1pb.Role_ADMIN
case store.RoleUser:
return apiv2pb.Role_USER
return apiv1pb.Role_USER
default:
return apiv2pb.Role_ROLE_UNSPECIFIED
return apiv1pb.Role_ROLE_UNSPECIFIED
}
}

View File

@ -1,67 +0,0 @@
package v1
import (
"encoding/json"
"github.com/pkg/errors"
)
type UserSettingKey string
const (
// UserSettingLocaleKey is the key type for user locale.
UserSettingLocaleKey UserSettingKey = "locale"
)
// String returns the string format of UserSettingKey type.
func (k UserSettingKey) String() string {
return string(k)
}
var (
UserSettingLocaleValue = []string{"en", "zh"}
)
type UserSetting struct {
UserID int
Key UserSettingKey `json:"key"`
// Value is a JSON string with basic value.
Value string `json:"value"`
}
type UserSettingUpsert struct {
UserID int
Key UserSettingKey `json:"key"`
Value string `json:"value"`
}
func (upsert UserSettingUpsert) Validate() error {
if upsert.Key == UserSettingLocaleKey {
localeValue := "en"
err := json.Unmarshal([]byte(upsert.Value), &localeValue)
if err != nil {
return errors.New("failed to unmarshal user setting locale value")
}
invalid := true
for _, value := range UserSettingLocaleValue {
if localeValue == value {
invalid = false
break
}
}
if invalid {
return errors.New("invalid user setting locale value")
}
} else {
return errors.New("invalid user setting key")
}
return nil
}
type UserSettingFind struct {
UserID int
Key *UserSettingKey `json:"key"`
}

View File

@ -1,4 +1,4 @@
package v2
package v1
import (
"context"
@ -7,31 +7,34 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/store"
)
func (s *APIV2Service) GetUserSetting(ctx context.Context, request *apiv2pb.GetUserSettingRequest) (*apiv2pb.GetUserSettingResponse, error) {
func (s *APIV2Service) GetUserSetting(ctx context.Context, request *apiv1pb.GetUserSettingRequest) (*apiv1pb.GetUserSettingResponse, error) {
userSetting, err := getUserSetting(ctx, s.Store, request.Id)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get user setting: %v", err)
}
return &apiv2pb.GetUserSettingResponse{
return &apiv1pb.GetUserSettingResponse{
UserSetting: userSetting,
}, nil
}
func (s *APIV2Service) UpdateUserSetting(ctx context.Context, request *apiv2pb.UpdateUserSettingRequest) (*apiv2pb.UpdateUserSettingResponse, error) {
func (s *APIV2Service) UpdateUserSetting(ctx context.Context, request *apiv1pb.UpdateUserSettingRequest) (*apiv1pb.UpdateUserSettingResponse, error) {
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
return nil, status.Errorf(codes.InvalidArgument, "update mask is empty")
}
userID := ctx.Value(userIDContextKey).(int32)
user, err := getCurrentUser(ctx, s.Store)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
for _, path := range request.UpdateMask.Paths {
if path == "locale" {
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: userID,
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_LOCALE,
Value: &storepb.UserSetting_Locale{
Locale: convertUserSettingLocaleToStore(request.UserSetting.Locale),
@ -41,7 +44,7 @@ func (s *APIV2Service) UpdateUserSetting(ctx context.Context, request *apiv2pb.U
}
} else if path == "color_theme" {
if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{
UserId: userID,
UserId: user.ID,
Key: storepb.UserSettingKey_USER_SETTING_COLOR_THEME,
Value: &storepb.UserSetting_ColorTheme{
ColorTheme: convertUserSettingColorThemeToStore(request.UserSetting.ColorTheme),
@ -58,12 +61,12 @@ func (s *APIV2Service) UpdateUserSetting(ctx context.Context, request *apiv2pb.U
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get user setting: %v", err)
}
return &apiv2pb.UpdateUserSettingResponse{
return &apiv1pb.UpdateUserSettingResponse{
UserSetting: userSetting,
}, nil
}
func getUserSetting(ctx context.Context, s *store.Store, userID int32) (*apiv2pb.UserSetting, error) {
func getUserSetting(ctx context.Context, s *store.Store, userID int32) (*apiv1pb.UserSetting, error) {
userSettings, err := s.ListUserSettings(ctx, &store.FindUserSetting{
UserID: &userID,
})
@ -71,10 +74,10 @@ func getUserSetting(ctx context.Context, s *store.Store, userID int32) (*apiv2pb
return nil, errors.Wrap(err, "failed to find user setting")
}
userSetting := &apiv2pb.UserSetting{
userSetting := &apiv1pb.UserSetting{
Id: userID,
Locale: apiv2pb.UserSetting_LOCALE_EN,
ColorTheme: apiv2pb.UserSetting_COLOR_THEME_SYSTEM,
Locale: apiv1pb.UserSetting_LOCALE_EN,
ColorTheme: apiv1pb.UserSetting_COLOR_THEME_SYSTEM,
}
for _, setting := range userSettings {
if setting.Key == storepb.UserSettingKey_USER_SETTING_LOCALE {
@ -86,50 +89,50 @@ func getUserSetting(ctx context.Context, s *store.Store, userID int32) (*apiv2pb
return userSetting, nil
}
func convertUserSettingLocaleToStore(locale apiv2pb.UserSetting_Locale) storepb.LocaleUserSetting {
func convertUserSettingLocaleToStore(locale apiv1pb.UserSetting_Locale) storepb.LocaleUserSetting {
switch locale {
case apiv2pb.UserSetting_LOCALE_EN:
case apiv1pb.UserSetting_LOCALE_EN:
return storepb.LocaleUserSetting_LOCALE_USER_SETTING_EN
case apiv2pb.UserSetting_LOCALE_ZH:
case apiv1pb.UserSetting_LOCALE_ZH:
return storepb.LocaleUserSetting_LOCALE_USER_SETTING_ZH
default:
return storepb.LocaleUserSetting_LOCALE_USER_SETTING_UNSPECIFIED
}
}
func convertUserSettingLocaleFromStore(locale storepb.LocaleUserSetting) apiv2pb.UserSetting_Locale {
func convertUserSettingLocaleFromStore(locale storepb.LocaleUserSetting) apiv1pb.UserSetting_Locale {
switch locale {
case storepb.LocaleUserSetting_LOCALE_USER_SETTING_EN:
return apiv2pb.UserSetting_LOCALE_EN
return apiv1pb.UserSetting_LOCALE_EN
case storepb.LocaleUserSetting_LOCALE_USER_SETTING_ZH:
return apiv2pb.UserSetting_LOCALE_ZH
return apiv1pb.UserSetting_LOCALE_ZH
default:
return apiv2pb.UserSetting_LOCALE_UNSPECIFIED
return apiv1pb.UserSetting_LOCALE_UNSPECIFIED
}
}
func convertUserSettingColorThemeToStore(colorTheme apiv2pb.UserSetting_ColorTheme) storepb.ColorThemeUserSetting {
func convertUserSettingColorThemeToStore(colorTheme apiv1pb.UserSetting_ColorTheme) storepb.ColorThemeUserSetting {
switch colorTheme {
case apiv2pb.UserSetting_COLOR_THEME_SYSTEM:
case apiv1pb.UserSetting_COLOR_THEME_SYSTEM:
return storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_SYSTEM
case apiv2pb.UserSetting_COLOR_THEME_LIGHT:
case apiv1pb.UserSetting_COLOR_THEME_LIGHT:
return storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_LIGHT
case apiv2pb.UserSetting_COLOR_THEME_DARK:
case apiv1pb.UserSetting_COLOR_THEME_DARK:
return storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_DARK
default:
return storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_UNSPECIFIED
}
}
func convertUserSettingColorThemeFromStore(colorTheme storepb.ColorThemeUserSetting) apiv2pb.UserSetting_ColorTheme {
func convertUserSettingColorThemeFromStore(colorTheme storepb.ColorThemeUserSetting) apiv1pb.UserSetting_ColorTheme {
switch colorTheme {
case storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_SYSTEM:
return apiv2pb.UserSetting_COLOR_THEME_SYSTEM
return apiv1pb.UserSetting_COLOR_THEME_SYSTEM
case storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_LIGHT:
return apiv2pb.UserSetting_COLOR_THEME_LIGHT
return apiv1pb.UserSetting_COLOR_THEME_LIGHT
case storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_DARK:
return apiv2pb.UserSetting_COLOR_THEME_DARK
return apiv1pb.UserSetting_COLOR_THEME_DARK
default:
return apiv2pb.UserSetting_COLOR_THEME_UNSPECIFIED
return apiv1pb.UserSetting_COLOR_THEME_UNSPECIFIED
}
}

View File

@ -1,35 +1,123 @@
package v1
import (
"github.com/labstack/echo/v4"
"context"
"fmt"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/improbable-eng/grpc-web/go/grpcweb"
"github.com/labstack/echo/v4"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/reflection"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
"github.com/yourselfhosted/slash/server/profile"
"github.com/yourselfhosted/slash/server/service/license"
"github.com/yourselfhosted/slash/store"
)
type APIV1Service struct {
type APIV2Service struct {
apiv1pb.UnimplementedWorkspaceServiceServer
apiv1pb.UnimplementedSubscriptionServiceServer
apiv1pb.UnimplementedAuthServiceServer
apiv1pb.UnimplementedUserServiceServer
apiv1pb.UnimplementedUserSettingServiceServer
apiv1pb.UnimplementedShortcutServiceServer
apiv1pb.UnimplementedCollectionServiceServer
apiv1pb.UnimplementedMemoServiceServer
Secret string
Profile *profile.Profile
Store *store.Store
LicenseService *license.LicenseService
grpcServer *grpc.Server
grpcServerPort int
}
func NewAPIV1Service(profile *profile.Profile, store *store.Store, licenseService *license.LicenseService) *APIV1Service {
return &APIV1Service{
func NewAPIV2Service(secret string, profile *profile.Profile, store *store.Store, licenseService *license.LicenseService, grpcServerPort int) *APIV2Service {
authProvider := NewGRPCAuthInterceptor(store, secret)
grpcServer := grpc.NewServer(
grpc.ChainUnaryInterceptor(
authProvider.AuthenticationInterceptor,
),
)
apiV2Service := &APIV2Service{
Secret: secret,
Profile: profile,
Store: store,
LicenseService: licenseService,
grpcServer: grpcServer,
grpcServerPort: grpcServerPort,
}
apiv1pb.RegisterSubscriptionServiceServer(grpcServer, apiV2Service)
apiv1pb.RegisterWorkspaceServiceServer(grpcServer, apiV2Service)
apiv1pb.RegisterAuthServiceServer(grpcServer, apiV2Service)
apiv1pb.RegisterUserServiceServer(grpcServer, apiV2Service)
apiv1pb.RegisterUserSettingServiceServer(grpcServer, apiV2Service)
apiv1pb.RegisterShortcutServiceServer(grpcServer, apiV2Service)
apiv1pb.RegisterCollectionServiceServer(grpcServer, apiV2Service)
apiv1pb.RegisterMemoServiceServer(grpcServer, apiV2Service)
reflection.Register(grpcServer)
return apiV2Service
}
func (s *APIV1Service) Start(apiGroup *echo.Group, secret string) {
apiV1Group := apiGroup.Group("/api/v1")
apiV1Group.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
return JWTMiddleware(s, next, secret)
})
s.registerWorkspaceRoutes(apiV1Group)
s.registerAuthRoutes(apiV1Group, secret)
s.registerUserRoutes(apiV1Group)
s.registerShortcutRoutes(apiV1Group)
s.registerAnalyticsRoutes(apiV1Group)
func (s *APIV2Service) GetGRPCServer() *grpc.Server {
return s.grpcServer
}
// RegisterGateway registers the gRPC-Gateway with the given Echo instance.
func (s *APIV2Service) RegisterGateway(ctx context.Context, e *echo.Echo) error {
// Create a client connection to the gRPC Server we just started.
// This is where the gRPC-Gateway proxies the requests.
conn, err := grpc.DialContext(
ctx,
fmt.Sprintf(":%d", s.grpcServerPort),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil {
return err
}
gwMux := runtime.NewServeMux()
if err := apiv1pb.RegisterSubscriptionServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv1pb.RegisterWorkspaceServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv1pb.RegisterAuthServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv1pb.RegisterUserServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv1pb.RegisterUserSettingServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv1pb.RegisterShortcutServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv1pb.RegisterCollectionServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv1pb.RegisterMemoServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
e.Any("/api/v1/*", echo.WrapHandler(gwMux))
// GRPC web proxy.
options := []grpcweb.Option{
grpcweb.WithCorsForRegisteredEndpointsOnly(false),
grpcweb.WithOriginFunc(func(_ string) bool {
return true
}),
}
wrappedGrpc := grpcweb.WrapServer(s.grpcServer, options...)
e.Any("/slash.api.v1.*", echo.WrapHandler(wrappedGrpc))
return nil
}

View File

@ -1,39 +0,0 @@
package v1
import (
"fmt"
"net/http"
"github.com/labstack/echo/v4"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/server/profile"
"github.com/yourselfhosted/slash/store"
)
type WorkspaceProfile struct {
Profile *profile.Profile `json:"profile"`
DisallowSignUp bool `json:"disallowSignUp"`
}
func (s *APIV1Service) registerWorkspaceRoutes(g *echo.Group) {
g.GET("/workspace/profile", func(c echo.Context) error {
ctx := c.Request().Context()
workspaceProfile := WorkspaceProfile{
Profile: s.Profile,
DisallowSignUp: false,
}
enableSignUpSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSAPCE_SETTING_ENABLE_SIGNUP,
})
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to find workspace setting, err: %s", err)).SetInternal(err)
}
if enableSignUpSetting != nil {
workspaceProfile.DisallowSignUp = !enableSignUpSetting.GetEnableSignup()
}
return c.JSON(http.StatusOK, workspaceProfile)
})
}

View File

@ -1,4 +1,4 @@
package v2
package v1
import (
"context"
@ -6,16 +6,16 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/store"
)
func (s *APIV2Service) GetWorkspaceProfile(ctx context.Context, _ *apiv2pb.GetWorkspaceProfileRequest) (*apiv2pb.GetWorkspaceProfileResponse, error) {
profile := &apiv2pb.WorkspaceProfile{
func (s *APIV2Service) GetWorkspaceProfile(ctx context.Context, _ *apiv1pb.GetWorkspaceProfileRequest) (*apiv1pb.GetWorkspaceProfileResponse, error) {
profile := &apiv1pb.WorkspaceProfile{
Mode: s.Profile.Mode,
Version: s.Profile.Version,
Plan: apiv2pb.PlanType_FREE,
Plan: apiv1pb.PlanType_FREE,
}
// Load subscription plan from license service.
@ -25,7 +25,7 @@ func (s *APIV2Service) GetWorkspaceProfile(ctx context.Context, _ *apiv2pb.GetWo
}
profile.Plan = subscription.Plan
workspaceSetting, err := s.GetWorkspaceSetting(ctx, &apiv2pb.GetWorkspaceSettingRequest{})
workspaceSetting, err := s.GetWorkspaceSetting(ctx, &apiv1pb.GetWorkspaceSettingRequest{})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get workspace setting: %v", err)
}
@ -35,12 +35,12 @@ func (s *APIV2Service) GetWorkspaceProfile(ctx context.Context, _ *apiv2pb.GetWo
profile.CustomStyle = setting.GetCustomStyle()
profile.CustomScript = setting.GetCustomScript()
}
return &apiv2pb.GetWorkspaceProfileResponse{
return &apiv1pb.GetWorkspaceProfileResponse{
Profile: profile,
}, nil
}
func (s *APIV2Service) GetWorkspaceSetting(ctx context.Context, _ *apiv2pb.GetWorkspaceSettingRequest) (*apiv2pb.GetWorkspaceSettingResponse, error) {
func (s *APIV2Service) GetWorkspaceSetting(ctx context.Context, _ *apiv1pb.GetWorkspaceSettingRequest) (*apiv1pb.GetWorkspaceSettingResponse, error) {
isAdmin := false
userID, ok := ctx.Value(userIDContextKey).(int32)
if ok {
@ -56,7 +56,7 @@ func (s *APIV2Service) GetWorkspaceSetting(ctx context.Context, _ *apiv2pb.GetWo
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to list workspace settings: %v", err)
}
workspaceSetting := &apiv2pb.WorkspaceSetting{
workspaceSetting := &apiv1pb.WorkspaceSetting{
EnableSignup: true,
}
for _, v := range workspaceSettings {
@ -75,12 +75,12 @@ func (s *APIV2Service) GetWorkspaceSetting(ctx context.Context, _ *apiv2pb.GetWo
}
}
}
return &apiv2pb.GetWorkspaceSettingResponse{
return &apiv1pb.GetWorkspaceSettingResponse{
Setting: workspaceSetting,
}, nil
}
func (s *APIV2Service) UpdateWorkspaceSetting(ctx context.Context, request *apiv2pb.UpdateWorkspaceSettingRequest) (*apiv2pb.UpdateWorkspaceSettingResponse, error) {
func (s *APIV2Service) UpdateWorkspaceSetting(ctx context.Context, request *apiv1pb.UpdateWorkspaceSettingRequest) (*apiv1pb.UpdateWorkspaceSettingResponse, error) {
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
return nil, status.Errorf(codes.InvalidArgument, "update mask is empty")
}
@ -136,11 +136,11 @@ func (s *APIV2Service) UpdateWorkspaceSetting(ctx context.Context, request *apiv
}
}
getWorkspaceSettingResponse, err := s.GetWorkspaceSetting(ctx, &apiv2pb.GetWorkspaceSettingRequest{})
getWorkspaceSettingResponse, err := s.GetWorkspaceSetting(ctx, &apiv1pb.GetWorkspaceSettingRequest{})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get workspace setting: %v", err)
}
return &apiv2pb.UpdateWorkspaceSettingResponse{
return &apiv1pb.UpdateWorkspaceSettingResponse{
Setting: getWorkspaceSettingResponse.Setting,
}, nil
}

View File

@ -1,35 +0,0 @@
package v2
import "strings"
var allowedMethodsWhenUnauthorized = map[string]bool{
"/slash.api.v2.WorkspaceService/GetWorkspaceProfile": true,
"/slash.api.v2.WorkspaceService/GetWorkspaceSetting": true,
"/slash.api.v2.AuthService/SignIn": true,
"/slash.api.v2.AuthService/SignUp": true,
"/slash.api.v2.AuthService/SignOut": true,
"/memos.api.v2.AuthService/GetAuthStatus": true,
"/slash.api.v2.ShortcutService/GetShortcutByName": true,
"/slash.api.v2.ShortcutService/GetShortcut": true,
"/slash.api.v2.CollectionService/GetCollectionByName": true,
}
// isUnauthorizeAllowedMethod returns true if the method is allowed to be called when the user is not authorized.
func isUnauthorizeAllowedMethod(methodName string) bool {
if strings.HasPrefix(methodName, "/grpc.reflection") {
return true
}
return allowedMethodsWhenUnauthorized[methodName]
}
var allowedMethodsOnlyForAdmin = map[string]bool{
"/slash.api.v2.UserService/CreateUser": true,
"/slash.api.v2.UserService/DeleteUser": true,
"/slash.api.v2.WorkspaceService/UpdateWorkspaceSetting": true,
"/slash.api.v2.SubscriptionService/UpdateSubscription": true,
}
// isOnlyForAdminAllowedMethod returns true if the method is allowed to be called only by admin.
func isOnlyForAdminAllowedMethod(methodName string) bool {
return allowedMethodsOnlyForAdmin[methodName]
}

View File

@ -1,33 +0,0 @@
package v2
import (
"context"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
"github.com/yourselfhosted/slash/store"
)
func convertRowStatusFromStore(rowStatus store.RowStatus) apiv2pb.RowStatus {
switch rowStatus {
case store.Normal:
return apiv2pb.RowStatus_NORMAL
case store.Archived:
return apiv2pb.RowStatus_ARCHIVED
default:
return apiv2pb.RowStatus_ROW_STATUS_UNSPECIFIED
}
}
func getCurrentUser(ctx context.Context, s *store.Store) (*store.User, error) {
userID, ok := ctx.Value(userIDContextKey).(int32)
if !ok {
return nil, nil
}
user, err := s.GetUser(ctx, &store.FindUser{
ID: &userID,
})
if err != nil {
return nil, err
}
return user, nil
}

View File

@ -1,123 +0,0 @@
package v2
import (
"context"
"fmt"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/improbable-eng/grpc-web/go/grpcweb"
"github.com/labstack/echo/v4"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/reflection"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
"github.com/yourselfhosted/slash/server/profile"
"github.com/yourselfhosted/slash/server/service/license"
"github.com/yourselfhosted/slash/store"
)
type APIV2Service struct {
apiv2pb.UnimplementedWorkspaceServiceServer
apiv2pb.UnimplementedSubscriptionServiceServer
apiv2pb.UnimplementedAuthServiceServer
apiv2pb.UnimplementedUserServiceServer
apiv2pb.UnimplementedUserSettingServiceServer
apiv2pb.UnimplementedShortcutServiceServer
apiv2pb.UnimplementedCollectionServiceServer
apiv2pb.UnimplementedMemoServiceServer
Secret string
Profile *profile.Profile
Store *store.Store
LicenseService *license.LicenseService
grpcServer *grpc.Server
grpcServerPort int
}
func NewAPIV2Service(secret string, profile *profile.Profile, store *store.Store, licenseService *license.LicenseService, grpcServerPort int) *APIV2Service {
authProvider := NewGRPCAuthInterceptor(store, secret)
grpcServer := grpc.NewServer(
grpc.ChainUnaryInterceptor(
authProvider.AuthenticationInterceptor,
),
)
apiV2Service := &APIV2Service{
Secret: secret,
Profile: profile,
Store: store,
LicenseService: licenseService,
grpcServer: grpcServer,
grpcServerPort: grpcServerPort,
}
apiv2pb.RegisterSubscriptionServiceServer(grpcServer, apiV2Service)
apiv2pb.RegisterWorkspaceServiceServer(grpcServer, apiV2Service)
apiv2pb.RegisterAuthServiceServer(grpcServer, apiV2Service)
apiv2pb.RegisterUserServiceServer(grpcServer, apiV2Service)
apiv2pb.RegisterUserSettingServiceServer(grpcServer, apiV2Service)
apiv2pb.RegisterShortcutServiceServer(grpcServer, apiV2Service)
apiv2pb.RegisterCollectionServiceServer(grpcServer, apiV2Service)
apiv2pb.RegisterMemoServiceServer(grpcServer, apiV2Service)
reflection.Register(grpcServer)
return apiV2Service
}
func (s *APIV2Service) GetGRPCServer() *grpc.Server {
return s.grpcServer
}
// RegisterGateway registers the gRPC-Gateway with the given Echo instance.
func (s *APIV2Service) RegisterGateway(ctx context.Context, e *echo.Echo) error {
// Create a client connection to the gRPC Server we just started.
// This is where the gRPC-Gateway proxies the requests.
conn, err := grpc.DialContext(
ctx,
fmt.Sprintf(":%d", s.grpcServerPort),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil {
return err
}
gwMux := runtime.NewServeMux()
if err := apiv2pb.RegisterSubscriptionServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv2pb.RegisterWorkspaceServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv2pb.RegisterAuthServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv2pb.RegisterUserServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv2pb.RegisterUserSettingServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv2pb.RegisterShortcutServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv2pb.RegisterCollectionServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
if err := apiv2pb.RegisterMemoServiceHandler(context.Background(), gwMux, conn); err != nil {
return err
}
e.Any("/api/v2/*", echo.WrapHandler(gwMux))
// GRPC web proxy.
options := []grpcweb.Option{
grpcweb.WithCorsForRegisteredEndpointsOnly(false),
grpcweb.WithOriginFunc(func(origin string) bool {
return true
}),
}
wrappedGrpc := grpcweb.WrapServer(s.grpcServer, options...)
e.Any("/slash.api.v2.*", echo.WrapHandler(wrappedGrpc))
return nil
}

View File

@ -3,8 +3,8 @@ import { useStorage } from "@plasmohq/storage/hook";
import { useEffect, useState } from "react";
import { toast } from "react-hot-toast";
import useShortcutStore from "@/store/shortcut";
import { Visibility } from "@/types/proto/api/v2/common";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Visibility } from "@/types/proto/api/v1/common";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import Icon from "./Icon";
interface State {

View File

@ -1,7 +1,7 @@
import { useStorage } from "@plasmohq/storage/hook";
import classNames from "classnames";
import { getFaviconWithGoogleS2 } from "@/helpers/utils";
import type { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import type { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import Icon from "./Icon";
interface Props {

View File

@ -1,7 +1,7 @@
import axios from "axios";
import { create } from "zustand";
import { combine } from "zustand/middleware";
import { CreateShortcutResponse, ListShortcutsResponse, Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { CreateShortcutResponse, ListShortcutsResponse, Shortcut } from "@/types/proto/api/v1/shortcut_service";
interface State {
shortcutMapById: Record<number, Shortcut>;

View File

@ -2,7 +2,7 @@ import classNames from "classnames";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { shortcutServiceClient } from "@/grpcweb";
import { GetShortcutAnalyticsResponse } from "@/types/proto/api/v2/shortcut_service";
import { GetShortcutAnalyticsResponse } from "@/types/proto/api/v1/shortcut_service";
import Icon from "./Icon";
interface Props {

View File

@ -10,8 +10,8 @@ import useResponsiveWidth from "@/hooks/useResponsiveWidth";
import useCollectionStore from "@/stores/v1/collection";
import useShortcutStore from "@/stores/v1/shortcut";
import useUserStore from "@/stores/v1/user";
import { Collection } from "@/types/proto/api/v2/collection_service";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Collection } from "@/types/proto/api/v1/collection_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { showCommonDialog } from "./Alert";
import CreateCollectionDialog from "./CreateCollectionDrawer";
import Icon from "./Icon";

View File

@ -5,9 +5,9 @@ import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next";
import useCollectionStore from "@/stores/v1/collection";
import useShortcutStore from "@/stores/v1/shortcut";
import { Collection } from "@/types/proto/api/v2/collection_service";
import { Visibility } from "@/types/proto/api/v2/common";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Collection } from "@/types/proto/api/v1/collection_service";
import { Visibility } from "@/types/proto/api/v1/common";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { convertVisibilityFromPb } from "@/utils/visibility";
import useLoading from "../hooks/useLoading";
import Icon from "./Icon";

View File

@ -17,8 +17,8 @@ import { useEffect, useState } from "react";
import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next";
import useShortcutStore, { getShortcutUpdateMask } from "@/stores/v1/shortcut";
import { Visibility } from "@/types/proto/api/v2/common";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Visibility } from "@/types/proto/api/v1/common";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { convertVisibilityFromPb } from "@/utils/visibility";
import useLoading from "../hooks/useLoading";
import Icon from "./Icon";

View File

@ -3,7 +3,7 @@ import { isUndefined } from "lodash-es";
import { useEffect, useState } from "react";
import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { Role, User } from "@/types/proto/api/v2/user_service";
import { Role, User } from "@/types/proto/api/v1/user_service";
import useLoading from "../hooks/useLoading";
import useUserStore from "../stores/v1/user";
import Icon from "./Icon";

View File

@ -3,7 +3,7 @@ import { QRCodeCanvas } from "qrcode.react";
import { useRef } from "react";
import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { absolutifyLink } from "../helpers/utils";
import Icon from "./Icon";

View File

@ -4,8 +4,8 @@ import { useTranslation } from "react-i18next";
import { Link, useLocation } from "react-router-dom";
import { authServiceClient } from "@/grpcweb";
import useWorkspaceStore from "@/stores/v1/workspace";
import { PlanType } from "@/types/proto/api/v2/subscription_service";
import { Role } from "@/types/proto/api/v2/user_service";
import { PlanType } from "@/types/proto/api/v1/subscription_service";
import { Role } from "@/types/proto/api/v1/user_service";
import useUserStore from "../stores/v1/user";
import AboutDialog from "./AboutDialog";
import Icon from "./Icon";

View File

@ -2,8 +2,8 @@ import { useState } from "react";
import { useTranslation } from "react-i18next";
import useNavigateTo from "@/hooks/useNavigateTo";
import useShortcutStore from "@/stores/v1/shortcut";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Role } from "@/types/proto/api/v2/user_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { Role } from "@/types/proto/api/v1/user_service";
import useUserStore from "../stores/v1/user";
import { showCommonDialog } from "./Alert";
import CreateShortcutDrawer from "./CreateShortcutDrawer";

View File

@ -6,7 +6,7 @@ import toast from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import useUserStore from "@/stores/v1/user";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { convertVisibilityFromPb } from "@/utils/visibility";
import { absolutifyLink, getFaviconWithGoogleS2 } from "../helpers/utils";
import useViewStore from "../stores/v1/view";

View File

@ -2,7 +2,7 @@ import { Divider } from "@mui/joy";
import classNames from "classnames";
import { Link } from "react-router-dom";
import { getFaviconWithGoogleS2 } from "@/helpers/utils";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import Icon from "./Icon";
interface Props {

View File

@ -1,6 +1,6 @@
import classNames from "classnames";
import { Link } from "react-router-dom";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { getFaviconWithGoogleS2 } from "../helpers/utils";
import Icon from "./Icon";
import ShortcutActionsDropdown from "./ShortcutActionsDropdown";

View File

@ -1,6 +1,6 @@
import classNames from "classnames";
import useNavigateTo from "@/hooks/useNavigateTo";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import useViewStore from "../stores/v1/view";
import ShortcutCard from "./ShortcutCard";
import ShortcutView from "./ShortcutView";

View File

@ -1,4 +1,4 @@
import { Visibility } from "@/types/proto/api/v2/common";
import { Visibility } from "@/types/proto/api/v1/common";
import Icon from "./Icon";
interface Props {

View File

@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { userServiceClient } from "@/grpcweb";
import { UserAccessToken } from "@/types/proto/api/v2/user_service";
import { UserAccessToken } from "@/types/proto/api/v1/user_service";
import useUserStore from "../../stores/v1/user";
import { showCommonDialog } from "../Alert";
import CreateAccessTokenDialog from "../CreateAccessTokenDialog";

View File

@ -1,7 +1,7 @@
import { Button } from "@mui/joy";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Role } from "@/types/proto/api/v2/user_service";
import { Role } from "@/types/proto/api/v1/user_service";
import useUserStore from "../../stores/v1/user";
import ChangePasswordDialog from "../ChangePasswordDialog";
import EditUserinfoDialog from "../EditUserinfoDialog";

View File

@ -2,7 +2,7 @@ import { Button, IconButton } from "@mui/joy";
import { useEffect, useState } from "react";
import toast from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { User } from "@/types/proto/api/v2/user_service";
import { User } from "@/types/proto/api/v1/user_service";
import { convertRoleFromPb } from "@/utils/user";
import useUserStore from "../../stores/v1/user";
import { showCommonDialog } from "../Alert";

View File

@ -1,6 +1,6 @@
import { Option, Select } from "@mui/joy";
import { useTranslation } from "react-i18next";
import { UserSetting, UserSetting_ColorTheme, UserSetting_Locale } from "@/types/proto/api/v2/user_setting_service";
import { UserSetting, UserSetting_ColorTheme, UserSetting_Locale } from "@/types/proto/api/v1/user_setting_service";
import useUserStore from "../../stores/v1/user";
import BetaBadge from "../BetaBadge";

View File

@ -5,7 +5,7 @@ import toast from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { workspaceServiceClient } from "@/grpcweb";
import useWorkspaceStore from "@/stores/v1/workspace";
import { WorkspaceSetting } from "@/types/proto/api/v2/workspace_service";
import { WorkspaceSetting } from "@/types/proto/api/v1/workspace_service";
const WorkspaceSection: React.FC = () => {
const { t } = useTranslation();

View File

@ -1,11 +1,11 @@
import { createChannel, createClientFactory, FetchTransport } from "nice-grpc-web";
import { AuthServiceDefinition } from "./types/proto/api/v2/auth_service";
import { CollectionServiceDefinition } from "./types/proto/api/v2/collection_service";
import { ShortcutServiceDefinition } from "./types/proto/api/v2/shortcut_service";
import { SubscriptionServiceDefinition } from "./types/proto/api/v2/subscription_service";
import { UserServiceDefinition } from "./types/proto/api/v2/user_service";
import { UserSettingServiceDefinition } from "./types/proto/api/v2/user_setting_service";
import { WorkspaceServiceDefinition } from "./types/proto/api/v2/workspace_service";
import { AuthServiceDefinition } from "./types/proto/api/v1/auth_service";
import { CollectionServiceDefinition } from "./types/proto/api/v1/collection_service";
import { ShortcutServiceDefinition } from "./types/proto/api/v1/shortcut_service";
import { SubscriptionServiceDefinition } from "./types/proto/api/v1/subscription_service";
import { UserServiceDefinition } from "./types/proto/api/v1/user_service";
import { UserSettingServiceDefinition } from "./types/proto/api/v1/user_setting_service";
import { WorkspaceServiceDefinition } from "./types/proto/api/v1/workspace_service";
const address = import.meta.env.MODE === "development" ? "http://localhost:8082" : window.location.origin;

View File

@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next";
import { Outlet } from "react-router-dom";
import Navigator from "@/components/Navigator";
import useNavigateTo from "@/hooks/useNavigateTo";
import { UserSetting_ColorTheme, UserSetting_Locale } from "@/types/proto/api/v2/user_setting_service";
import { UserSetting_ColorTheme, UserSetting_Locale } from "@/types/proto/api/v1/user_setting_service";
import Header from "../components/Header";
import useUserStore from "../stores/v1/user";

View File

@ -10,8 +10,8 @@ import useResponsiveWidth from "@/hooks/useResponsiveWidth";
import useCollectionStore from "@/stores/v1/collection";
import useShortcutStore from "@/stores/v1/shortcut";
import useUserStore from "@/stores/v1/user";
import { Collection } from "@/types/proto/api/v2/collection_service";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Collection } from "@/types/proto/api/v1/collection_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
const CollectionSpace = () => {
const params = useParams();

View File

@ -8,8 +8,8 @@ import { useParams } from "react-router-dom";
import useLoading from "@/hooks/useLoading";
import useNavigateTo from "@/hooks/useNavigateTo";
import useShortcutStore from "@/stores/v1/shortcut";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Role } from "@/types/proto/api/v2/user_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { Role } from "@/types/proto/api/v1/user_service";
import { convertVisibilityFromPb } from "@/utils/visibility";
import { showCommonDialog } from "../components/Alert";
import AnalyticsView from "../components/AnalyticsView";

View File

@ -7,7 +7,7 @@ import { isURL } from "@/helpers/utils";
import useNavigateTo from "@/hooks/useNavigateTo";
import useShortcutStore from "@/stores/v1/shortcut";
import useUserStore from "@/stores/v1/user";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
const ShortcutSpace = () => {
const params = useParams();

View File

@ -3,6 +3,7 @@ import React, { FormEvent, useEffect, useState } from "react";
import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import Icon from "@/components/Icon";
import { authServiceClient } from "@/grpcweb";
import useNavigateTo from "@/hooks/useNavigateTo";
import useUserStore from "@/stores/v1/user";
@ -64,7 +65,7 @@ const SignIn: React.FC = () => {
<div className="w-80 max-w-full h-full py-4 flex flex-col justify-start items-center">
<div className="w-full py-4 grow flex flex-col justify-center items-center">
<div className="flex flex-row justify-start items-center w-auto mx-auto gap-y-2 mb-4">
<img id="logo-img" src="/logo.png" className="w-12 h-auto mr-2 -mt-1 rounded-full shadow" alt="logo" />
<Icon.CircleSlash className="w-12 h-auto dark:text-gray-500 mr-2" strokeWidth={1.5} />
<span className="text-3xl opacity-80 dark:text-gray-500">Slash</span>
</div>
<form className="w-full mt-6" onSubmit={handleSigninBtnClick}>

View File

@ -6,8 +6,8 @@ import SubscriptionFAQ from "@/components/SubscriptionFAQ";
import { subscriptionServiceClient } from "@/grpcweb";
import { stringifyPlanType } from "@/stores/v1/subscription";
import useWorkspaceStore from "@/stores/v1/workspace";
import { PlanType } from "@/types/proto/api/v2/subscription_service";
import { Role } from "@/types/proto/api/v2/user_service";
import { PlanType } from "@/types/proto/api/v1/subscription_service";
import { Role } from "@/types/proto/api/v1/user_service";
import useUserStore from "../stores/v1/user";
const SubscriptionSetting: React.FC = () => {

View File

@ -4,7 +4,7 @@ import { Link } from "react-router-dom";
import Icon from "@/components/Icon";
import { stringifyPlanType } from "@/stores/v1/subscription";
import useWorkspaceStore from "@/stores/v1/workspace";
import { Role } from "@/types/proto/api/v2/user_service";
import { Role } from "@/types/proto/api/v1/user_service";
import MemberSection from "../components/setting/MemberSection";
import WorkspaceSection from "../components/setting/WorkspaceSection";
import useUserStore from "../stores/v1/user";

View File

@ -1,6 +1,6 @@
import { create } from "zustand";
import { collectionServiceClient } from "@/grpcweb";
import { Collection } from "@/types/proto/api/v2/collection_service";
import { Collection } from "@/types/proto/api/v1/collection_service";
interface CollectionState {
collectionMapById: Record<number, Collection>;

View File

@ -2,7 +2,7 @@ import { isEqual } from "lodash-es";
import { create } from "zustand";
import { combine } from "zustand/middleware";
import { shortcutServiceClient } from "@/grpcweb";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
interface State {
shortcutMapById: Record<number, Shortcut>;

View File

@ -1,4 +1,4 @@
import { PlanType } from "@/types/proto/api/v2/subscription_service";
import { PlanType } from "@/types/proto/api/v1/subscription_service";
export const stringifyPlanType = (planType: PlanType) => {
if (planType === PlanType.FREE) {

View File

@ -1,7 +1,7 @@
import { create } from "zustand";
import { authServiceClient, userServiceClient, userSettingServiceClient } from "@/grpcweb";
import { User } from "@/types/proto/api/v2/user_service";
import { UserSetting } from "@/types/proto/api/v2/user_setting_service";
import { User } from "@/types/proto/api/v1/user_service";
import { UserSetting } from "@/types/proto/api/v1/user_setting_service";
interface UserState {
userMapById: Record<number, User>;

View File

@ -1,8 +1,8 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
import { Visibility } from "@/types/proto/api/v2/common";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service";
import { User } from "@/types/proto/api/v2/user_service";
import { Visibility } from "@/types/proto/api/v1/common";
import { Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { User } from "@/types/proto/api/v1/user_service";
export interface Filter {
tab?: string;

View File

@ -1,6 +1,6 @@
import { create } from "zustand";
import { workspaceServiceClient } from "@/grpcweb";
import { WorkspaceProfile, WorkspaceSetting } from "@/types/proto/api/v2/workspace_service";
import { WorkspaceProfile, WorkspaceSetting } from "@/types/proto/api/v1/workspace_service";
interface WorkspaceState {
profile: WorkspaceProfile;

View File

@ -1,4 +1,4 @@
import { Role } from "@/types/proto/api/v2/user_service";
import { Role } from "@/types/proto/api/v1/user_service";
export const convertRoleFromPb = (role: Role): string => {
if (role === Role.ADMIN) {

View File

@ -1,4 +1,4 @@
import { Visibility } from "@/types/proto/api/v2/common";
import { Visibility } from "@/types/proto/api/v1/common";
export const convertVisibilityFromPb = (visibility: Visibility): string => {
if (visibility === Visibility.PRIVATE) {

View File

@ -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"};
}
}

View File

@ -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";
}
}

View File

@ -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;

View File

@ -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";
}
}

View File

@ -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";
}
}

View File

@ -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) {

View File

@ -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";
}
}

View File

@ -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";

View File

@ -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";

File diff suppressed because it is too large Load Diff

View File

@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: api/v2/auth_service.proto
// source: api/v1/auth_service.proto
package apiv2
package apiv1
import (
_ "google.golang.org/genproto/googleapis/api/annotations"
@ -30,7 +30,7 @@ type GetAuthStatusRequest struct {
func (x *GetAuthStatusRequest) Reset() {
*x = GetAuthStatusRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_auth_service_proto_msgTypes[0]
mi := &file_api_v1_auth_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -43,7 +43,7 @@ func (x *GetAuthStatusRequest) String() string {
func (*GetAuthStatusRequest) ProtoMessage() {}
func (x *GetAuthStatusRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_auth_service_proto_msgTypes[0]
mi := &file_api_v1_auth_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -56,7 +56,7 @@ func (x *GetAuthStatusRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetAuthStatusRequest.ProtoReflect.Descriptor instead.
func (*GetAuthStatusRequest) Descriptor() ([]byte, []int) {
return file_api_v2_auth_service_proto_rawDescGZIP(), []int{0}
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{0}
}
type GetAuthStatusResponse struct {
@ -70,7 +70,7 @@ type GetAuthStatusResponse struct {
func (x *GetAuthStatusResponse) Reset() {
*x = GetAuthStatusResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_auth_service_proto_msgTypes[1]
mi := &file_api_v1_auth_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -83,7 +83,7 @@ func (x *GetAuthStatusResponse) String() string {
func (*GetAuthStatusResponse) ProtoMessage() {}
func (x *GetAuthStatusResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_auth_service_proto_msgTypes[1]
mi := &file_api_v1_auth_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -96,7 +96,7 @@ func (x *GetAuthStatusResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetAuthStatusResponse.ProtoReflect.Descriptor instead.
func (*GetAuthStatusResponse) Descriptor() ([]byte, []int) {
return file_api_v2_auth_service_proto_rawDescGZIP(), []int{1}
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{1}
}
func (x *GetAuthStatusResponse) GetUser() *User {
@ -118,7 +118,7 @@ type SignInRequest struct {
func (x *SignInRequest) Reset() {
*x = SignInRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_auth_service_proto_msgTypes[2]
mi := &file_api_v1_auth_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -131,7 +131,7 @@ func (x *SignInRequest) String() string {
func (*SignInRequest) ProtoMessage() {}
func (x *SignInRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_auth_service_proto_msgTypes[2]
mi := &file_api_v1_auth_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -144,7 +144,7 @@ func (x *SignInRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SignInRequest.ProtoReflect.Descriptor instead.
func (*SignInRequest) Descriptor() ([]byte, []int) {
return file_api_v2_auth_service_proto_rawDescGZIP(), []int{2}
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{2}
}
func (x *SignInRequest) GetEmail() string {
@ -172,7 +172,7 @@ type SignInResponse struct {
func (x *SignInResponse) Reset() {
*x = SignInResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_auth_service_proto_msgTypes[3]
mi := &file_api_v1_auth_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -185,7 +185,7 @@ func (x *SignInResponse) String() string {
func (*SignInResponse) ProtoMessage() {}
func (x *SignInResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_auth_service_proto_msgTypes[3]
mi := &file_api_v1_auth_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -198,7 +198,7 @@ func (x *SignInResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SignInResponse.ProtoReflect.Descriptor instead.
func (*SignInResponse) Descriptor() ([]byte, []int) {
return file_api_v2_auth_service_proto_rawDescGZIP(), []int{3}
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{3}
}
func (x *SignInResponse) GetUser() *User {
@ -221,7 +221,7 @@ type SignUpRequest struct {
func (x *SignUpRequest) Reset() {
*x = SignUpRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_auth_service_proto_msgTypes[4]
mi := &file_api_v1_auth_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -234,7 +234,7 @@ func (x *SignUpRequest) String() string {
func (*SignUpRequest) ProtoMessage() {}
func (x *SignUpRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_auth_service_proto_msgTypes[4]
mi := &file_api_v1_auth_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -247,7 +247,7 @@ func (x *SignUpRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SignUpRequest.ProtoReflect.Descriptor instead.
func (*SignUpRequest) Descriptor() ([]byte, []int) {
return file_api_v2_auth_service_proto_rawDescGZIP(), []int{4}
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{4}
}
func (x *SignUpRequest) GetEmail() string {
@ -282,7 +282,7 @@ type SignUpResponse struct {
func (x *SignUpResponse) Reset() {
*x = SignUpResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_auth_service_proto_msgTypes[5]
mi := &file_api_v1_auth_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -295,7 +295,7 @@ func (x *SignUpResponse) String() string {
func (*SignUpResponse) ProtoMessage() {}
func (x *SignUpResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_auth_service_proto_msgTypes[5]
mi := &file_api_v1_auth_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -308,7 +308,7 @@ func (x *SignUpResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SignUpResponse.ProtoReflect.Descriptor instead.
func (*SignUpResponse) Descriptor() ([]byte, []int) {
return file_api_v2_auth_service_proto_rawDescGZIP(), []int{5}
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{5}
}
func (x *SignUpResponse) GetUser() *User {
@ -327,7 +327,7 @@ type SignOutRequest struct {
func (x *SignOutRequest) Reset() {
*x = SignOutRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_auth_service_proto_msgTypes[6]
mi := &file_api_v1_auth_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -340,7 +340,7 @@ func (x *SignOutRequest) String() string {
func (*SignOutRequest) ProtoMessage() {}
func (x *SignOutRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_auth_service_proto_msgTypes[6]
mi := &file_api_v1_auth_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -353,7 +353,7 @@ func (x *SignOutRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SignOutRequest.ProtoReflect.Descriptor instead.
func (*SignOutRequest) Descriptor() ([]byte, []int) {
return file_api_v2_auth_service_proto_rawDescGZIP(), []int{6}
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{6}
}
type SignOutResponse struct {
@ -365,7 +365,7 @@ type SignOutResponse struct {
func (x *SignOutResponse) Reset() {
*x = SignOutResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_auth_service_proto_msgTypes[7]
mi := &file_api_v1_auth_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -378,7 +378,7 @@ func (x *SignOutResponse) String() string {
func (*SignOutResponse) ProtoMessage() {}
func (x *SignOutResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_auth_service_proto_msgTypes[7]
mi := &file_api_v1_auth_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -391,23 +391,23 @@ func (x *SignOutResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SignOutResponse.ProtoReflect.Descriptor instead.
func (*SignOutResponse) Descriptor() ([]byte, []int) {
return file_api_v2_auth_service_proto_rawDescGZIP(), []int{7}
return file_api_v1_auth_service_proto_rawDescGZIP(), []int{7}
}
var File_api_v2_auth_service_proto protoreflect.FileDescriptor
var File_api_v1_auth_service_proto protoreflect.FileDescriptor
var file_api_v2_auth_service_proto_rawDesc = []byte{
0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x65,
var file_api_v1_auth_service_proto_rawDesc = []byte{
0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3f, 0x0a, 0x15, 0x47, 0x65,
0x74, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x41, 0x0a, 0x0d, 0x53,
0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05,
0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61,
@ -415,7 +415,7 @@ var file_api_v2_auth_service_proto_rawDesc = []byte{
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x38,
0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x5d, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e,
0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61,
0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12,
@ -425,86 +425,86 @@ var file_api_v2_auth_service_proto_rawDesc = []byte{
0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x38, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x55,
0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65,
0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65,
0x72, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x4f, 0x75, 0x74, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xae, 0x03, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x75, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74,
0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74,
0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x6c,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75,
0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x32, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x60, 0x0a,
0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x60, 0x0a,
0x06, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x12, 0x1b, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x71,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x76, 0x32, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x12,
0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x12,
0x60, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x12, 0x1b, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x52,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x52, 0x65, 0x73, 0x70,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x13, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x75,
0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x75,
0x70, 0x12, 0x64, 0x0a, 0x07, 0x53, 0x69, 0x67, 0x6e, 0x4f, 0x75, 0x74, 0x12, 0x1c, 0x2e, 0x73,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e,
0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4f, 0x75,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4f, 0x75,
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x16, 0x22, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f,
0x16, 0x22, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f,
0x73, 0x69, 0x67, 0x6e, 0x6f, 0x75, 0x74, 0x42, 0xae, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x41, 0x75,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x41, 0x75,
0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75,
0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73,
0x68, 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, 0x53, 0x41, 0x58, 0xaa, 0x02,
0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c,
0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x53,
0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d,
0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02,
0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c,
0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53,
0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a,
0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_api_v2_auth_service_proto_rawDescOnce sync.Once
file_api_v2_auth_service_proto_rawDescData = file_api_v2_auth_service_proto_rawDesc
file_api_v1_auth_service_proto_rawDescOnce sync.Once
file_api_v1_auth_service_proto_rawDescData = file_api_v1_auth_service_proto_rawDesc
)
func file_api_v2_auth_service_proto_rawDescGZIP() []byte {
file_api_v2_auth_service_proto_rawDescOnce.Do(func() {
file_api_v2_auth_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_auth_service_proto_rawDescData)
func file_api_v1_auth_service_proto_rawDescGZIP() []byte {
file_api_v1_auth_service_proto_rawDescOnce.Do(func() {
file_api_v1_auth_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_auth_service_proto_rawDescData)
})
return file_api_v2_auth_service_proto_rawDescData
return file_api_v1_auth_service_proto_rawDescData
}
var file_api_v2_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_api_v2_auth_service_proto_goTypes = []interface{}{
(*GetAuthStatusRequest)(nil), // 0: slash.api.v2.GetAuthStatusRequest
(*GetAuthStatusResponse)(nil), // 1: slash.api.v2.GetAuthStatusResponse
(*SignInRequest)(nil), // 2: slash.api.v2.SignInRequest
(*SignInResponse)(nil), // 3: slash.api.v2.SignInResponse
(*SignUpRequest)(nil), // 4: slash.api.v2.SignUpRequest
(*SignUpResponse)(nil), // 5: slash.api.v2.SignUpResponse
(*SignOutRequest)(nil), // 6: slash.api.v2.SignOutRequest
(*SignOutResponse)(nil), // 7: slash.api.v2.SignOutResponse
(*User)(nil), // 8: slash.api.v2.User
var file_api_v1_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_api_v1_auth_service_proto_goTypes = []interface{}{
(*GetAuthStatusRequest)(nil), // 0: slash.api.v1.GetAuthStatusRequest
(*GetAuthStatusResponse)(nil), // 1: slash.api.v1.GetAuthStatusResponse
(*SignInRequest)(nil), // 2: slash.api.v1.SignInRequest
(*SignInResponse)(nil), // 3: slash.api.v1.SignInResponse
(*SignUpRequest)(nil), // 4: slash.api.v1.SignUpRequest
(*SignUpResponse)(nil), // 5: slash.api.v1.SignUpResponse
(*SignOutRequest)(nil), // 6: slash.api.v1.SignOutRequest
(*SignOutResponse)(nil), // 7: slash.api.v1.SignOutResponse
(*User)(nil), // 8: slash.api.v1.User
}
var file_api_v2_auth_service_proto_depIdxs = []int32{
8, // 0: slash.api.v2.GetAuthStatusResponse.user:type_name -> slash.api.v2.User
8, // 1: slash.api.v2.SignInResponse.user:type_name -> slash.api.v2.User
8, // 2: slash.api.v2.SignUpResponse.user:type_name -> slash.api.v2.User
0, // 3: slash.api.v2.AuthService.GetAuthStatus:input_type -> slash.api.v2.GetAuthStatusRequest
2, // 4: slash.api.v2.AuthService.SignIn:input_type -> slash.api.v2.SignInRequest
4, // 5: slash.api.v2.AuthService.SignUp:input_type -> slash.api.v2.SignUpRequest
6, // 6: slash.api.v2.AuthService.SignOut:input_type -> slash.api.v2.SignOutRequest
1, // 7: slash.api.v2.AuthService.GetAuthStatus:output_type -> slash.api.v2.GetAuthStatusResponse
3, // 8: slash.api.v2.AuthService.SignIn:output_type -> slash.api.v2.SignInResponse
5, // 9: slash.api.v2.AuthService.SignUp:output_type -> slash.api.v2.SignUpResponse
7, // 10: slash.api.v2.AuthService.SignOut:output_type -> slash.api.v2.SignOutResponse
var file_api_v1_auth_service_proto_depIdxs = []int32{
8, // 0: slash.api.v1.GetAuthStatusResponse.user:type_name -> slash.api.v1.User
8, // 1: slash.api.v1.SignInResponse.user:type_name -> slash.api.v1.User
8, // 2: slash.api.v1.SignUpResponse.user:type_name -> slash.api.v1.User
0, // 3: slash.api.v1.AuthService.GetAuthStatus:input_type -> slash.api.v1.GetAuthStatusRequest
2, // 4: slash.api.v1.AuthService.SignIn:input_type -> slash.api.v1.SignInRequest
4, // 5: slash.api.v1.AuthService.SignUp:input_type -> slash.api.v1.SignUpRequest
6, // 6: slash.api.v1.AuthService.SignOut:input_type -> slash.api.v1.SignOutRequest
1, // 7: slash.api.v1.AuthService.GetAuthStatus:output_type -> slash.api.v1.GetAuthStatusResponse
3, // 8: slash.api.v1.AuthService.SignIn:output_type -> slash.api.v1.SignInResponse
5, // 9: slash.api.v1.AuthService.SignUp:output_type -> slash.api.v1.SignUpResponse
7, // 10: slash.api.v1.AuthService.SignOut:output_type -> slash.api.v1.SignOutResponse
7, // [7:11] is the sub-list for method output_type
3, // [3:7] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
@ -512,14 +512,14 @@ var file_api_v2_auth_service_proto_depIdxs = []int32{
0, // [0:3] is the sub-list for field type_name
}
func init() { file_api_v2_auth_service_proto_init() }
func file_api_v2_auth_service_proto_init() {
if File_api_v2_auth_service_proto != nil {
func init() { file_api_v1_auth_service_proto_init() }
func file_api_v1_auth_service_proto_init() {
if File_api_v1_auth_service_proto != nil {
return
}
file_api_v2_user_service_proto_init()
file_api_v1_user_service_proto_init()
if !protoimpl.UnsafeEnabled {
file_api_v2_auth_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_auth_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetAuthStatusRequest); i {
case 0:
return &v.state
@ -531,7 +531,7 @@ func file_api_v2_auth_service_proto_init() {
return nil
}
}
file_api_v2_auth_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_auth_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetAuthStatusResponse); i {
case 0:
return &v.state
@ -543,7 +543,7 @@ func file_api_v2_auth_service_proto_init() {
return nil
}
}
file_api_v2_auth_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_auth_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignInRequest); i {
case 0:
return &v.state
@ -555,7 +555,7 @@ func file_api_v2_auth_service_proto_init() {
return nil
}
}
file_api_v2_auth_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_auth_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignInResponse); i {
case 0:
return &v.state
@ -567,7 +567,7 @@ func file_api_v2_auth_service_proto_init() {
return nil
}
}
file_api_v2_auth_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_auth_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignUpRequest); i {
case 0:
return &v.state
@ -579,7 +579,7 @@ func file_api_v2_auth_service_proto_init() {
return nil
}
}
file_api_v2_auth_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_auth_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignUpResponse); i {
case 0:
return &v.state
@ -591,7 +591,7 @@ func file_api_v2_auth_service_proto_init() {
return nil
}
}
file_api_v2_auth_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_auth_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignOutRequest); i {
case 0:
return &v.state
@ -603,7 +603,7 @@ func file_api_v2_auth_service_proto_init() {
return nil
}
}
file_api_v2_auth_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_auth_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignOutResponse); i {
case 0:
return &v.state
@ -620,18 +620,18 @@ func file_api_v2_auth_service_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_v2_auth_service_proto_rawDesc,
RawDescriptor: file_api_v1_auth_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_v2_auth_service_proto_goTypes,
DependencyIndexes: file_api_v2_auth_service_proto_depIdxs,
MessageInfos: file_api_v2_auth_service_proto_msgTypes,
GoTypes: file_api_v1_auth_service_proto_goTypes,
DependencyIndexes: file_api_v1_auth_service_proto_depIdxs,
MessageInfos: file_api_v1_auth_service_proto_msgTypes,
}.Build()
File_api_v2_auth_service_proto = out.File
file_api_v2_auth_service_proto_rawDesc = nil
file_api_v2_auth_service_proto_goTypes = nil
file_api_v2_auth_service_proto_depIdxs = nil
File_api_v1_auth_service_proto = out.File
file_api_v1_auth_service_proto_rawDesc = nil
file_api_v1_auth_service_proto_goTypes = nil
file_api_v1_auth_service_proto_depIdxs = nil
}

View File

@ -1,12 +1,12 @@
// 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"
@ -153,7 +153,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, "/slash.api.v2.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v2/auth/status"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v1/auth/status"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -178,7 +178,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, "/slash.api.v2.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v2/auth/signin"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v1/auth/signin"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -203,7 +203,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, "/slash.api.v2.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v2/auth/signup"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v1/auth/signup"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -228,7 +228,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, "/slash.api.v2.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v2/auth/signout"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v1/auth/signout"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -292,7 +292,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, "/slash.api.v2.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v2/auth/status"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.AuthService/GetAuthStatus", runtime.WithHTTPPathPattern("/api/v1/auth/status"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -314,7 +314,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, "/slash.api.v2.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v2/auth/signin"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.AuthService/SignIn", runtime.WithHTTPPathPattern("/api/v1/auth/signin"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -336,7 +336,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, "/slash.api.v2.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v2/auth/signup"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v1/auth/signup"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -358,7 +358,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, "/slash.api.v2.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v2/auth/signout"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.AuthService/SignOut", runtime.WithHTTPPathPattern("/api/v1/auth/signout"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -378,13 +378,13 @@ 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_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 (

View File

@ -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"
@ -19,10 +19,10 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
AuthService_GetAuthStatus_FullMethodName = "/slash.api.v2.AuthService/GetAuthStatus"
AuthService_SignIn_FullMethodName = "/slash.api.v2.AuthService/SignIn"
AuthService_SignUp_FullMethodName = "/slash.api.v2.AuthService/SignUp"
AuthService_SignOut_FullMethodName = "/slash.api.v2.AuthService/SignOut"
AuthService_GetAuthStatus_FullMethodName = "/slash.api.v1.AuthService/GetAuthStatus"
AuthService_SignIn_FullMethodName = "/slash.api.v1.AuthService/SignIn"
AuthService_SignUp_FullMethodName = "/slash.api.v1.AuthService/SignUp"
AuthService_SignOut_FullMethodName = "/slash.api.v1.AuthService/SignOut"
)
// AuthServiceClient is the client API for AuthService service.
@ -195,7 +195,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: "slash.api.v2.AuthService",
ServiceName: "slash.api.v1.AuthService",
HandlerType: (*AuthServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
@ -216,5 +216,5 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/auth_service.proto",
Metadata: "api/v1/auth_service.proto",
}

View File

@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: api/v2/collection_service.proto
// source: api/v1/collection_service.proto
package apiv2
package apiv1
import (
_ "google.golang.org/genproto/googleapis/api/annotations"
@ -36,13 +36,13 @@ type Collection struct {
Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"`
ShortcutIds []int32 `protobuf:"varint,9,rep,packed,name=shortcut_ids,json=shortcutIds,proto3" json:"shortcut_ids,omitempty"`
Visibility Visibility `protobuf:"varint,10,opt,name=visibility,proto3,enum=slash.api.v2.Visibility" json:"visibility,omitempty"`
Visibility Visibility `protobuf:"varint,10,opt,name=visibility,proto3,enum=slash.api.v1.Visibility" json:"visibility,omitempty"`
}
func (x *Collection) Reset() {
*x = Collection{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[0]
mi := &file_api_v1_collection_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -55,7 +55,7 @@ func (x *Collection) String() string {
func (*Collection) ProtoMessage() {}
func (x *Collection) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[0]
mi := &file_api_v1_collection_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -68,7 +68,7 @@ func (x *Collection) ProtoReflect() protoreflect.Message {
// Deprecated: Use Collection.ProtoReflect.Descriptor instead.
func (*Collection) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{0}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{0}
}
func (x *Collection) GetId() int32 {
@ -143,7 +143,7 @@ type ListCollectionsRequest struct {
func (x *ListCollectionsRequest) Reset() {
*x = ListCollectionsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[1]
mi := &file_api_v1_collection_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -156,7 +156,7 @@ func (x *ListCollectionsRequest) String() string {
func (*ListCollectionsRequest) ProtoMessage() {}
func (x *ListCollectionsRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[1]
mi := &file_api_v1_collection_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -169,7 +169,7 @@ func (x *ListCollectionsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListCollectionsRequest.ProtoReflect.Descriptor instead.
func (*ListCollectionsRequest) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{1}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{1}
}
type ListCollectionsResponse struct {
@ -183,7 +183,7 @@ type ListCollectionsResponse struct {
func (x *ListCollectionsResponse) Reset() {
*x = ListCollectionsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[2]
mi := &file_api_v1_collection_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -196,7 +196,7 @@ func (x *ListCollectionsResponse) String() string {
func (*ListCollectionsResponse) ProtoMessage() {}
func (x *ListCollectionsResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[2]
mi := &file_api_v1_collection_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -209,7 +209,7 @@ func (x *ListCollectionsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListCollectionsResponse.ProtoReflect.Descriptor instead.
func (*ListCollectionsResponse) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{2}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{2}
}
func (x *ListCollectionsResponse) GetCollections() []*Collection {
@ -230,7 +230,7 @@ type GetCollectionRequest struct {
func (x *GetCollectionRequest) Reset() {
*x = GetCollectionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[3]
mi := &file_api_v1_collection_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -243,7 +243,7 @@ func (x *GetCollectionRequest) String() string {
func (*GetCollectionRequest) ProtoMessage() {}
func (x *GetCollectionRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[3]
mi := &file_api_v1_collection_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -256,7 +256,7 @@ func (x *GetCollectionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetCollectionRequest.ProtoReflect.Descriptor instead.
func (*GetCollectionRequest) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{3}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{3}
}
func (x *GetCollectionRequest) GetId() int32 {
@ -277,7 +277,7 @@ type GetCollectionResponse struct {
func (x *GetCollectionResponse) Reset() {
*x = GetCollectionResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[4]
mi := &file_api_v1_collection_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -290,7 +290,7 @@ func (x *GetCollectionResponse) String() string {
func (*GetCollectionResponse) ProtoMessage() {}
func (x *GetCollectionResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[4]
mi := &file_api_v1_collection_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -303,7 +303,7 @@ func (x *GetCollectionResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetCollectionResponse.ProtoReflect.Descriptor instead.
func (*GetCollectionResponse) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{4}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{4}
}
func (x *GetCollectionResponse) GetCollection() *Collection {
@ -324,7 +324,7 @@ type GetCollectionByNameRequest struct {
func (x *GetCollectionByNameRequest) Reset() {
*x = GetCollectionByNameRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[5]
mi := &file_api_v1_collection_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -337,7 +337,7 @@ func (x *GetCollectionByNameRequest) String() string {
func (*GetCollectionByNameRequest) ProtoMessage() {}
func (x *GetCollectionByNameRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[5]
mi := &file_api_v1_collection_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -350,7 +350,7 @@ func (x *GetCollectionByNameRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetCollectionByNameRequest.ProtoReflect.Descriptor instead.
func (*GetCollectionByNameRequest) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{5}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{5}
}
func (x *GetCollectionByNameRequest) GetName() string {
@ -371,7 +371,7 @@ type GetCollectionByNameResponse struct {
func (x *GetCollectionByNameResponse) Reset() {
*x = GetCollectionByNameResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[6]
mi := &file_api_v1_collection_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -384,7 +384,7 @@ func (x *GetCollectionByNameResponse) String() string {
func (*GetCollectionByNameResponse) ProtoMessage() {}
func (x *GetCollectionByNameResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[6]
mi := &file_api_v1_collection_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -397,7 +397,7 @@ func (x *GetCollectionByNameResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetCollectionByNameResponse.ProtoReflect.Descriptor instead.
func (*GetCollectionByNameResponse) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{6}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{6}
}
func (x *GetCollectionByNameResponse) GetCollection() *Collection {
@ -418,7 +418,7 @@ type CreateCollectionRequest struct {
func (x *CreateCollectionRequest) Reset() {
*x = CreateCollectionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[7]
mi := &file_api_v1_collection_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -431,7 +431,7 @@ func (x *CreateCollectionRequest) String() string {
func (*CreateCollectionRequest) ProtoMessage() {}
func (x *CreateCollectionRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[7]
mi := &file_api_v1_collection_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -444,7 +444,7 @@ func (x *CreateCollectionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateCollectionRequest.ProtoReflect.Descriptor instead.
func (*CreateCollectionRequest) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{7}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{7}
}
func (x *CreateCollectionRequest) GetCollection() *Collection {
@ -465,7 +465,7 @@ type CreateCollectionResponse struct {
func (x *CreateCollectionResponse) Reset() {
*x = CreateCollectionResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[8]
mi := &file_api_v1_collection_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -478,7 +478,7 @@ func (x *CreateCollectionResponse) String() string {
func (*CreateCollectionResponse) ProtoMessage() {}
func (x *CreateCollectionResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[8]
mi := &file_api_v1_collection_service_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -491,7 +491,7 @@ func (x *CreateCollectionResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateCollectionResponse.ProtoReflect.Descriptor instead.
func (*CreateCollectionResponse) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{8}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{8}
}
func (x *CreateCollectionResponse) GetCollection() *Collection {
@ -513,7 +513,7 @@ type UpdateCollectionRequest struct {
func (x *UpdateCollectionRequest) Reset() {
*x = UpdateCollectionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[9]
mi := &file_api_v1_collection_service_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -526,7 +526,7 @@ func (x *UpdateCollectionRequest) String() string {
func (*UpdateCollectionRequest) ProtoMessage() {}
func (x *UpdateCollectionRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[9]
mi := &file_api_v1_collection_service_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -539,7 +539,7 @@ func (x *UpdateCollectionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateCollectionRequest.ProtoReflect.Descriptor instead.
func (*UpdateCollectionRequest) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{9}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{9}
}
func (x *UpdateCollectionRequest) GetCollection() *Collection {
@ -567,7 +567,7 @@ type UpdateCollectionResponse struct {
func (x *UpdateCollectionResponse) Reset() {
*x = UpdateCollectionResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[10]
mi := &file_api_v1_collection_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -580,7 +580,7 @@ func (x *UpdateCollectionResponse) String() string {
func (*UpdateCollectionResponse) ProtoMessage() {}
func (x *UpdateCollectionResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[10]
mi := &file_api_v1_collection_service_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -593,7 +593,7 @@ func (x *UpdateCollectionResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateCollectionResponse.ProtoReflect.Descriptor instead.
func (*UpdateCollectionResponse) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{10}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{10}
}
func (x *UpdateCollectionResponse) GetCollection() *Collection {
@ -614,7 +614,7 @@ type DeleteCollectionRequest struct {
func (x *DeleteCollectionRequest) Reset() {
*x = DeleteCollectionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[11]
mi := &file_api_v1_collection_service_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -627,7 +627,7 @@ func (x *DeleteCollectionRequest) String() string {
func (*DeleteCollectionRequest) ProtoMessage() {}
func (x *DeleteCollectionRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[11]
mi := &file_api_v1_collection_service_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -640,7 +640,7 @@ func (x *DeleteCollectionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteCollectionRequest.ProtoReflect.Descriptor instead.
func (*DeleteCollectionRequest) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{11}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{11}
}
func (x *DeleteCollectionRequest) GetId() int32 {
@ -659,7 +659,7 @@ type DeleteCollectionResponse struct {
func (x *DeleteCollectionResponse) Reset() {
*x = DeleteCollectionResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_collection_service_proto_msgTypes[12]
mi := &file_api_v1_collection_service_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -672,7 +672,7 @@ func (x *DeleteCollectionResponse) String() string {
func (*DeleteCollectionResponse) ProtoMessage() {}
func (x *DeleteCollectionResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_collection_service_proto_msgTypes[12]
mi := &file_api_v1_collection_service_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -685,16 +685,16 @@ func (x *DeleteCollectionResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteCollectionResponse.ProtoReflect.Descriptor instead.
func (*DeleteCollectionResponse) Descriptor() ([]byte, []int) {
return file_api_v2_collection_service_proto_rawDescGZIP(), []int{12}
return file_api_v1_collection_service_proto_rawDescGZIP(), []int{12}
}
var File_api_v2_collection_service_proto protoreflect.FileDescriptor
var File_api_v1_collection_service_proto protoreflect.FileDescriptor
var file_api_v2_collection_service_proto_rawDesc = []byte{
0x0a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
var file_api_v1_collection_service_proto_rawDesc = []byte{
0x0a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x0c, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a,
0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
0x6f, 0x12, 0x0c, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a,
0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63,
@ -723,14 +723,14 @@ var file_api_v2_collection_service_proto_rawDesc = []byte{
0x75, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x68,
0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x49, 0x64, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73,
0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x69, 0x73,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x73,
0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c,
0x69, 0x74, 0x79, 0x22, 0x18, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x55, 0x0a,
0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6c,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c,
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x26, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02,
@ -738,7 +738,7 @@ var file_api_v2_collection_service_proto_rawDesc = []byte{
0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22,
0x30, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a,
@ -747,23 +747,23 @@ var file_api_v2_collection_service_proto_rawDesc = []byte{
0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a,
0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a,
0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x53, 0x0a, 0x17, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22,
0x54, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63,
0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43,
0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43,
0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x90, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0b, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
@ -772,7 +772,7 @@ var file_api_v2_collection_service_proto_rawDesc = []byte{
0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x29,
0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
@ -781,126 +781,126 @@ var file_api_v2_collection_service_proto_rawDesc = []byte{
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xcd, 0x06, 0x0a, 0x11, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0f, 0x4c,
0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,
0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6c,
0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6c,
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x7f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43,
0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x25, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12,
0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x6c, 0x0a, 0x13, 0x47, 0x65, 0x74,
0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x28, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
0x12, 0x28, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x4e,
0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c,
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8a, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x73,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x21, 0x3a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22,
0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x12, 0xb3, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43,
0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43,
0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
0x1a, 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0xda, 0x41, 0x16, 0x63, 0x6f, 0x6c,
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d,
0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x23, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x23, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63,
0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6c, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x88, 0x01, 0x0a, 0x10, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x25, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44,
0x25, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25,
0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xb4, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x16, 0x43, 0x6f, 0x6c, 0x6c,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x16, 0x43, 0x6f, 0x6c, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f,
0x73, 0x6c, 0x61, 0x73, 0x68, 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, 0x53,
0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53,
0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56,
0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32,
0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c,
0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31,
0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c,
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c,
0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72,
0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_api_v2_collection_service_proto_rawDescOnce sync.Once
file_api_v2_collection_service_proto_rawDescData = file_api_v2_collection_service_proto_rawDesc
file_api_v1_collection_service_proto_rawDescOnce sync.Once
file_api_v1_collection_service_proto_rawDescData = file_api_v1_collection_service_proto_rawDesc
)
func file_api_v2_collection_service_proto_rawDescGZIP() []byte {
file_api_v2_collection_service_proto_rawDescOnce.Do(func() {
file_api_v2_collection_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_collection_service_proto_rawDescData)
func file_api_v1_collection_service_proto_rawDescGZIP() []byte {
file_api_v1_collection_service_proto_rawDescOnce.Do(func() {
file_api_v1_collection_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_collection_service_proto_rawDescData)
})
return file_api_v2_collection_service_proto_rawDescData
return file_api_v1_collection_service_proto_rawDescData
}
var file_api_v2_collection_service_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_api_v2_collection_service_proto_goTypes = []interface{}{
(*Collection)(nil), // 0: slash.api.v2.Collection
(*ListCollectionsRequest)(nil), // 1: slash.api.v2.ListCollectionsRequest
(*ListCollectionsResponse)(nil), // 2: slash.api.v2.ListCollectionsResponse
(*GetCollectionRequest)(nil), // 3: slash.api.v2.GetCollectionRequest
(*GetCollectionResponse)(nil), // 4: slash.api.v2.GetCollectionResponse
(*GetCollectionByNameRequest)(nil), // 5: slash.api.v2.GetCollectionByNameRequest
(*GetCollectionByNameResponse)(nil), // 6: slash.api.v2.GetCollectionByNameResponse
(*CreateCollectionRequest)(nil), // 7: slash.api.v2.CreateCollectionRequest
(*CreateCollectionResponse)(nil), // 8: slash.api.v2.CreateCollectionResponse
(*UpdateCollectionRequest)(nil), // 9: slash.api.v2.UpdateCollectionRequest
(*UpdateCollectionResponse)(nil), // 10: slash.api.v2.UpdateCollectionResponse
(*DeleteCollectionRequest)(nil), // 11: slash.api.v2.DeleteCollectionRequest
(*DeleteCollectionResponse)(nil), // 12: slash.api.v2.DeleteCollectionResponse
var file_api_v1_collection_service_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_api_v1_collection_service_proto_goTypes = []interface{}{
(*Collection)(nil), // 0: slash.api.v1.Collection
(*ListCollectionsRequest)(nil), // 1: slash.api.v1.ListCollectionsRequest
(*ListCollectionsResponse)(nil), // 2: slash.api.v1.ListCollectionsResponse
(*GetCollectionRequest)(nil), // 3: slash.api.v1.GetCollectionRequest
(*GetCollectionResponse)(nil), // 4: slash.api.v1.GetCollectionResponse
(*GetCollectionByNameRequest)(nil), // 5: slash.api.v1.GetCollectionByNameRequest
(*GetCollectionByNameResponse)(nil), // 6: slash.api.v1.GetCollectionByNameResponse
(*CreateCollectionRequest)(nil), // 7: slash.api.v1.CreateCollectionRequest
(*CreateCollectionResponse)(nil), // 8: slash.api.v1.CreateCollectionResponse
(*UpdateCollectionRequest)(nil), // 9: slash.api.v1.UpdateCollectionRequest
(*UpdateCollectionResponse)(nil), // 10: slash.api.v1.UpdateCollectionResponse
(*DeleteCollectionRequest)(nil), // 11: slash.api.v1.DeleteCollectionRequest
(*DeleteCollectionResponse)(nil), // 12: slash.api.v1.DeleteCollectionResponse
(*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp
(Visibility)(0), // 14: slash.api.v2.Visibility
(Visibility)(0), // 14: slash.api.v1.Visibility
(*fieldmaskpb.FieldMask)(nil), // 15: google.protobuf.FieldMask
}
var file_api_v2_collection_service_proto_depIdxs = []int32{
13, // 0: slash.api.v2.Collection.created_time:type_name -> google.protobuf.Timestamp
13, // 1: slash.api.v2.Collection.updated_time:type_name -> google.protobuf.Timestamp
14, // 2: slash.api.v2.Collection.visibility:type_name -> slash.api.v2.Visibility
0, // 3: slash.api.v2.ListCollectionsResponse.collections:type_name -> slash.api.v2.Collection
0, // 4: slash.api.v2.GetCollectionResponse.collection:type_name -> slash.api.v2.Collection
0, // 5: slash.api.v2.GetCollectionByNameResponse.collection:type_name -> slash.api.v2.Collection
0, // 6: slash.api.v2.CreateCollectionRequest.collection:type_name -> slash.api.v2.Collection
0, // 7: slash.api.v2.CreateCollectionResponse.collection:type_name -> slash.api.v2.Collection
0, // 8: slash.api.v2.UpdateCollectionRequest.collection:type_name -> slash.api.v2.Collection
15, // 9: slash.api.v2.UpdateCollectionRequest.update_mask:type_name -> google.protobuf.FieldMask
0, // 10: slash.api.v2.UpdateCollectionResponse.collection:type_name -> slash.api.v2.Collection
1, // 11: slash.api.v2.CollectionService.ListCollections:input_type -> slash.api.v2.ListCollectionsRequest
3, // 12: slash.api.v2.CollectionService.GetCollection:input_type -> slash.api.v2.GetCollectionRequest
5, // 13: slash.api.v2.CollectionService.GetCollectionByName:input_type -> slash.api.v2.GetCollectionByNameRequest
7, // 14: slash.api.v2.CollectionService.CreateCollection:input_type -> slash.api.v2.CreateCollectionRequest
9, // 15: slash.api.v2.CollectionService.UpdateCollection:input_type -> slash.api.v2.UpdateCollectionRequest
11, // 16: slash.api.v2.CollectionService.DeleteCollection:input_type -> slash.api.v2.DeleteCollectionRequest
2, // 17: slash.api.v2.CollectionService.ListCollections:output_type -> slash.api.v2.ListCollectionsResponse
4, // 18: slash.api.v2.CollectionService.GetCollection:output_type -> slash.api.v2.GetCollectionResponse
6, // 19: slash.api.v2.CollectionService.GetCollectionByName:output_type -> slash.api.v2.GetCollectionByNameResponse
8, // 20: slash.api.v2.CollectionService.CreateCollection:output_type -> slash.api.v2.CreateCollectionResponse
10, // 21: slash.api.v2.CollectionService.UpdateCollection:output_type -> slash.api.v2.UpdateCollectionResponse
12, // 22: slash.api.v2.CollectionService.DeleteCollection:output_type -> slash.api.v2.DeleteCollectionResponse
var file_api_v1_collection_service_proto_depIdxs = []int32{
13, // 0: slash.api.v1.Collection.created_time:type_name -> google.protobuf.Timestamp
13, // 1: slash.api.v1.Collection.updated_time:type_name -> google.protobuf.Timestamp
14, // 2: slash.api.v1.Collection.visibility:type_name -> slash.api.v1.Visibility
0, // 3: slash.api.v1.ListCollectionsResponse.collections:type_name -> slash.api.v1.Collection
0, // 4: slash.api.v1.GetCollectionResponse.collection:type_name -> slash.api.v1.Collection
0, // 5: slash.api.v1.GetCollectionByNameResponse.collection:type_name -> slash.api.v1.Collection
0, // 6: slash.api.v1.CreateCollectionRequest.collection:type_name -> slash.api.v1.Collection
0, // 7: slash.api.v1.CreateCollectionResponse.collection:type_name -> slash.api.v1.Collection
0, // 8: slash.api.v1.UpdateCollectionRequest.collection:type_name -> slash.api.v1.Collection
15, // 9: slash.api.v1.UpdateCollectionRequest.update_mask:type_name -> google.protobuf.FieldMask
0, // 10: slash.api.v1.UpdateCollectionResponse.collection:type_name -> slash.api.v1.Collection
1, // 11: slash.api.v1.CollectionService.ListCollections:input_type -> slash.api.v1.ListCollectionsRequest
3, // 12: slash.api.v1.CollectionService.GetCollection:input_type -> slash.api.v1.GetCollectionRequest
5, // 13: slash.api.v1.CollectionService.GetCollectionByName:input_type -> slash.api.v1.GetCollectionByNameRequest
7, // 14: slash.api.v1.CollectionService.CreateCollection:input_type -> slash.api.v1.CreateCollectionRequest
9, // 15: slash.api.v1.CollectionService.UpdateCollection:input_type -> slash.api.v1.UpdateCollectionRequest
11, // 16: slash.api.v1.CollectionService.DeleteCollection:input_type -> slash.api.v1.DeleteCollectionRequest
2, // 17: slash.api.v1.CollectionService.ListCollections:output_type -> slash.api.v1.ListCollectionsResponse
4, // 18: slash.api.v1.CollectionService.GetCollection:output_type -> slash.api.v1.GetCollectionResponse
6, // 19: slash.api.v1.CollectionService.GetCollectionByName:output_type -> slash.api.v1.GetCollectionByNameResponse
8, // 20: slash.api.v1.CollectionService.CreateCollection:output_type -> slash.api.v1.CreateCollectionResponse
10, // 21: slash.api.v1.CollectionService.UpdateCollection:output_type -> slash.api.v1.UpdateCollectionResponse
12, // 22: slash.api.v1.CollectionService.DeleteCollection:output_type -> slash.api.v1.DeleteCollectionResponse
17, // [17:23] is the sub-list for method output_type
11, // [11:17] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name
@ -908,14 +908,14 @@ var file_api_v2_collection_service_proto_depIdxs = []int32{
0, // [0:11] is the sub-list for field type_name
}
func init() { file_api_v2_collection_service_proto_init() }
func file_api_v2_collection_service_proto_init() {
if File_api_v2_collection_service_proto != nil {
func init() { file_api_v1_collection_service_proto_init() }
func file_api_v1_collection_service_proto_init() {
if File_api_v1_collection_service_proto != nil {
return
}
file_api_v2_common_proto_init()
file_api_v1_common_proto_init()
if !protoimpl.UnsafeEnabled {
file_api_v2_collection_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Collection); i {
case 0:
return &v.state
@ -927,7 +927,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListCollectionsRequest); i {
case 0:
return &v.state
@ -939,7 +939,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListCollectionsResponse); i {
case 0:
return &v.state
@ -951,7 +951,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetCollectionRequest); i {
case 0:
return &v.state
@ -963,7 +963,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetCollectionResponse); i {
case 0:
return &v.state
@ -975,7 +975,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetCollectionByNameRequest); i {
case 0:
return &v.state
@ -987,7 +987,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetCollectionByNameResponse); i {
case 0:
return &v.state
@ -999,7 +999,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateCollectionRequest); i {
case 0:
return &v.state
@ -1011,7 +1011,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateCollectionResponse); i {
case 0:
return &v.state
@ -1023,7 +1023,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateCollectionRequest); i {
case 0:
return &v.state
@ -1035,7 +1035,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateCollectionResponse); i {
case 0:
return &v.state
@ -1047,7 +1047,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteCollectionRequest); i {
case 0:
return &v.state
@ -1059,7 +1059,7 @@ func file_api_v2_collection_service_proto_init() {
return nil
}
}
file_api_v2_collection_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_collection_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteCollectionResponse); i {
case 0:
return &v.state
@ -1076,18 +1076,18 @@ func file_api_v2_collection_service_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_v2_collection_service_proto_rawDesc,
RawDescriptor: file_api_v1_collection_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 13,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_v2_collection_service_proto_goTypes,
DependencyIndexes: file_api_v2_collection_service_proto_depIdxs,
MessageInfos: file_api_v2_collection_service_proto_msgTypes,
GoTypes: file_api_v1_collection_service_proto_goTypes,
DependencyIndexes: file_api_v1_collection_service_proto_depIdxs,
MessageInfos: file_api_v1_collection_service_proto_msgTypes,
}.Build()
File_api_v2_collection_service_proto = out.File
file_api_v2_collection_service_proto_rawDesc = nil
file_api_v2_collection_service_proto_goTypes = nil
file_api_v2_collection_service_proto_depIdxs = nil
File_api_v1_collection_service_proto = out.File
file_api_v1_collection_service_proto_rawDesc = nil
file_api_v1_collection_service_proto_goTypes = nil
file_api_v1_collection_service_proto_depIdxs = nil
}

View File

@ -1,12 +1,12 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/collection_service.proto
// source: api/v1/collection_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"
@ -287,7 +287,7 @@ func RegisterCollectionServiceHandlerServer(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.CollectionService/ListCollections", runtime.WithHTTPPathPattern("/api/v2/collections"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.CollectionService/ListCollections", runtime.WithHTTPPathPattern("/api/v1/collections"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -312,7 +312,7 @@ func RegisterCollectionServiceHandlerServer(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.CollectionService/GetCollection", runtime.WithHTTPPathPattern("/api/v2/collections/{id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.CollectionService/GetCollection", runtime.WithHTTPPathPattern("/api/v1/collections/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -337,7 +337,7 @@ func RegisterCollectionServiceHandlerServer(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.CollectionService/CreateCollection", runtime.WithHTTPPathPattern("/api/v2/collections"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.CollectionService/CreateCollection", runtime.WithHTTPPathPattern("/api/v1/collections"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -362,7 +362,7 @@ func RegisterCollectionServiceHandlerServer(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.CollectionService/UpdateCollection", runtime.WithHTTPPathPattern("/api/v2/collections/{collection.id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.CollectionService/UpdateCollection", runtime.WithHTTPPathPattern("/api/v1/collections/{collection.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -387,7 +387,7 @@ func RegisterCollectionServiceHandlerServer(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.CollectionService/DeleteCollection", runtime.WithHTTPPathPattern("/api/v2/collections/{id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.CollectionService/DeleteCollection", runtime.WithHTTPPathPattern("/api/v1/collections/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -451,7 +451,7 @@ func RegisterCollectionServiceHandlerClient(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.CollectionService/ListCollections", runtime.WithHTTPPathPattern("/api/v2/collections"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.CollectionService/ListCollections", runtime.WithHTTPPathPattern("/api/v1/collections"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -473,7 +473,7 @@ func RegisterCollectionServiceHandlerClient(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.CollectionService/GetCollection", runtime.WithHTTPPathPattern("/api/v2/collections/{id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.CollectionService/GetCollection", runtime.WithHTTPPathPattern("/api/v1/collections/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -495,7 +495,7 @@ func RegisterCollectionServiceHandlerClient(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.CollectionService/CreateCollection", runtime.WithHTTPPathPattern("/api/v2/collections"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.CollectionService/CreateCollection", runtime.WithHTTPPathPattern("/api/v1/collections"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -517,7 +517,7 @@ func RegisterCollectionServiceHandlerClient(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.CollectionService/UpdateCollection", runtime.WithHTTPPathPattern("/api/v2/collections/{collection.id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.CollectionService/UpdateCollection", runtime.WithHTTPPathPattern("/api/v1/collections/{collection.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -539,7 +539,7 @@ func RegisterCollectionServiceHandlerClient(ctx context.Context, mux *runtime.Se
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.CollectionService/DeleteCollection", runtime.WithHTTPPathPattern("/api/v2/collections/{id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.CollectionService/DeleteCollection", runtime.WithHTTPPathPattern("/api/v1/collections/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -559,15 +559,15 @@ func RegisterCollectionServiceHandlerClient(ctx context.Context, mux *runtime.Se
}
var (
pattern_CollectionService_ListCollections_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "collections"}, ""))
pattern_CollectionService_ListCollections_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "collections"}, ""))
pattern_CollectionService_GetCollection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "collections", "id"}, ""))
pattern_CollectionService_GetCollection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "collections", "id"}, ""))
pattern_CollectionService_CreateCollection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "collections"}, ""))
pattern_CollectionService_CreateCollection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "collections"}, ""))
pattern_CollectionService_UpdateCollection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "collections", "collection.id"}, ""))
pattern_CollectionService_UpdateCollection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "collections", "collection.id"}, ""))
pattern_CollectionService_DeleteCollection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "collections", "id"}, ""))
pattern_CollectionService_DeleteCollection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "collections", "id"}, ""))
)
var (

View File

@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/collection_service.proto
// source: api/v1/collection_service.proto
package apiv2
package apiv1
import (
context "context"
@ -19,12 +19,12 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
CollectionService_ListCollections_FullMethodName = "/slash.api.v2.CollectionService/ListCollections"
CollectionService_GetCollection_FullMethodName = "/slash.api.v2.CollectionService/GetCollection"
CollectionService_GetCollectionByName_FullMethodName = "/slash.api.v2.CollectionService/GetCollectionByName"
CollectionService_CreateCollection_FullMethodName = "/slash.api.v2.CollectionService/CreateCollection"
CollectionService_UpdateCollection_FullMethodName = "/slash.api.v2.CollectionService/UpdateCollection"
CollectionService_DeleteCollection_FullMethodName = "/slash.api.v2.CollectionService/DeleteCollection"
CollectionService_ListCollections_FullMethodName = "/slash.api.v1.CollectionService/ListCollections"
CollectionService_GetCollection_FullMethodName = "/slash.api.v1.CollectionService/GetCollection"
CollectionService_GetCollectionByName_FullMethodName = "/slash.api.v1.CollectionService/GetCollectionByName"
CollectionService_CreateCollection_FullMethodName = "/slash.api.v1.CollectionService/CreateCollection"
CollectionService_UpdateCollection_FullMethodName = "/slash.api.v1.CollectionService/UpdateCollection"
CollectionService_DeleteCollection_FullMethodName = "/slash.api.v1.CollectionService/DeleteCollection"
)
// CollectionServiceClient is the client API for CollectionService service.
@ -273,7 +273,7 @@ func _CollectionService_DeleteCollection_Handler(srv interface{}, ctx context.Co
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CollectionService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "slash.api.v2.CollectionService",
ServiceName: "slash.api.v1.CollectionService",
HandlerType: (*CollectionServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
@ -302,5 +302,5 @@ var CollectionService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/collection_service.proto",
Metadata: "api/v1/collection_service.proto",
}

View File

@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.31.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}
}
type Visibility int32
@ -105,11 +105,11 @@ func (x Visibility) String() string {
}
func (Visibility) Descriptor() protoreflect.EnumDescriptor {
return file_api_v2_common_proto_enumTypes[1].Descriptor()
return file_api_v1_common_proto_enumTypes[1].Descriptor()
}
func (Visibility) Type() protoreflect.EnumType {
return &file_api_v2_common_proto_enumTypes[1]
return &file_api_v1_common_proto_enumTypes[1]
}
func (x Visibility) Number() protoreflect.EnumNumber {
@ -118,15 +118,15 @@ func (x Visibility) Number() protoreflect.EnumNumber {
// Deprecated: Use Visibility.Descriptor instead.
func (Visibility) EnumDescriptor() ([]byte, []int) {
return file_api_v2_common_proto_rawDescGZIP(), []int{1}
return file_api_v1_common_proto_rawDescGZIP(), []int{1}
}
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, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2a, 0x41, 0x0a, 0x09, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x2e, 0x76, 0x31, 0x2a, 0x41, 0x0a, 0x09, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x12, 0x1a, 0x0a, 0x16, 0x52, 0x4f, 0x57, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55,
0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06,
0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48,
@ -136,37 +136,37 @@ var file_api_v2_common_proto_rawDesc = []byte{
0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a,
0x09, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06,
0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x0b, 0x43,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c,
0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 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, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73,
0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68,
0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61,
0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73,
0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68,
0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69,
0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
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, 2)
var file_api_v2_common_proto_goTypes = []interface{}{
(RowStatus)(0), // 0: slash.api.v2.RowStatus
(Visibility)(0), // 1: slash.api.v2.Visibility
var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_api_v1_common_proto_goTypes = []interface{}{
(RowStatus)(0), // 0: slash.api.v1.RowStatus
(Visibility)(0), // 1: slash.api.v1.Visibility
}
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
@ -174,27 +174,27 @@ 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
}
type x struct{}
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: 2,
NumMessages: 0,
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,
GoTypes: file_api_v1_common_proto_goTypes,
DependencyIndexes: file_api_v1_common_proto_depIdxs,
EnumInfos: file_api_v1_common_proto_enumTypes,
}.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
}

View File

@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: api/v2/memo_service.proto
// source: api/v1/memo_service.proto
package apiv2
package apiv1
import (
_ "google.golang.org/genproto/googleapis/api/annotations"
@ -32,18 +32,18 @@ type Memo struct {
CreatorId int32 `protobuf:"varint,2,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"`
CreatedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"`
UpdatedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"`
RowStatus RowStatus `protobuf:"varint,5,opt,name=row_status,json=rowStatus,proto3,enum=slash.api.v2.RowStatus" json:"row_status,omitempty"`
RowStatus RowStatus `protobuf:"varint,5,opt,name=row_status,json=rowStatus,proto3,enum=slash.api.v1.RowStatus" json:"row_status,omitempty"`
Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"`
Content string `protobuf:"bytes,8,opt,name=content,proto3" json:"content,omitempty"`
Tags []string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"`
Visibility Visibility `protobuf:"varint,10,opt,name=visibility,proto3,enum=slash.api.v2.Visibility" json:"visibility,omitempty"`
Visibility Visibility `protobuf:"varint,10,opt,name=visibility,proto3,enum=slash.api.v1.Visibility" json:"visibility,omitempty"`
}
func (x *Memo) Reset() {
*x = Memo{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[0]
mi := &file_api_v1_memo_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -56,7 +56,7 @@ func (x *Memo) String() string {
func (*Memo) ProtoMessage() {}
func (x *Memo) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[0]
mi := &file_api_v1_memo_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -69,7 +69,7 @@ func (x *Memo) ProtoReflect() protoreflect.Message {
// Deprecated: Use Memo.ProtoReflect.Descriptor instead.
func (*Memo) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{0}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{0}
}
func (x *Memo) GetId() int32 {
@ -151,7 +151,7 @@ type ListMemosRequest struct {
func (x *ListMemosRequest) Reset() {
*x = ListMemosRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[1]
mi := &file_api_v1_memo_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -164,7 +164,7 @@ func (x *ListMemosRequest) String() string {
func (*ListMemosRequest) ProtoMessage() {}
func (x *ListMemosRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[1]
mi := &file_api_v1_memo_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -177,7 +177,7 @@ func (x *ListMemosRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListMemosRequest.ProtoReflect.Descriptor instead.
func (*ListMemosRequest) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{1}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{1}
}
type ListMemosResponse struct {
@ -191,7 +191,7 @@ type ListMemosResponse struct {
func (x *ListMemosResponse) Reset() {
*x = ListMemosResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[2]
mi := &file_api_v1_memo_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -204,7 +204,7 @@ func (x *ListMemosResponse) String() string {
func (*ListMemosResponse) ProtoMessage() {}
func (x *ListMemosResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[2]
mi := &file_api_v1_memo_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -217,7 +217,7 @@ func (x *ListMemosResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListMemosResponse.ProtoReflect.Descriptor instead.
func (*ListMemosResponse) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{2}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{2}
}
func (x *ListMemosResponse) GetMemos() []*Memo {
@ -238,7 +238,7 @@ type GetMemoRequest struct {
func (x *GetMemoRequest) Reset() {
*x = GetMemoRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[3]
mi := &file_api_v1_memo_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -251,7 +251,7 @@ func (x *GetMemoRequest) String() string {
func (*GetMemoRequest) ProtoMessage() {}
func (x *GetMemoRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[3]
mi := &file_api_v1_memo_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -264,7 +264,7 @@ func (x *GetMemoRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetMemoRequest.ProtoReflect.Descriptor instead.
func (*GetMemoRequest) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{3}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{3}
}
func (x *GetMemoRequest) GetId() int32 {
@ -285,7 +285,7 @@ type GetMemoResponse struct {
func (x *GetMemoResponse) Reset() {
*x = GetMemoResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[4]
mi := &file_api_v1_memo_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -298,7 +298,7 @@ func (x *GetMemoResponse) String() string {
func (*GetMemoResponse) ProtoMessage() {}
func (x *GetMemoResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[4]
mi := &file_api_v1_memo_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -311,7 +311,7 @@ func (x *GetMemoResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetMemoResponse.ProtoReflect.Descriptor instead.
func (*GetMemoResponse) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{4}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{4}
}
func (x *GetMemoResponse) GetMemo() *Memo {
@ -332,7 +332,7 @@ type CreateMemoRequest struct {
func (x *CreateMemoRequest) Reset() {
*x = CreateMemoRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[5]
mi := &file_api_v1_memo_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -345,7 +345,7 @@ func (x *CreateMemoRequest) String() string {
func (*CreateMemoRequest) ProtoMessage() {}
func (x *CreateMemoRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[5]
mi := &file_api_v1_memo_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -358,7 +358,7 @@ func (x *CreateMemoRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateMemoRequest.ProtoReflect.Descriptor instead.
func (*CreateMemoRequest) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{5}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{5}
}
func (x *CreateMemoRequest) GetMemo() *Memo {
@ -379,7 +379,7 @@ type CreateMemoResponse struct {
func (x *CreateMemoResponse) Reset() {
*x = CreateMemoResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[6]
mi := &file_api_v1_memo_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -392,7 +392,7 @@ func (x *CreateMemoResponse) String() string {
func (*CreateMemoResponse) ProtoMessage() {}
func (x *CreateMemoResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[6]
mi := &file_api_v1_memo_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -405,7 +405,7 @@ func (x *CreateMemoResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateMemoResponse.ProtoReflect.Descriptor instead.
func (*CreateMemoResponse) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{6}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{6}
}
func (x *CreateMemoResponse) GetMemo() *Memo {
@ -427,7 +427,7 @@ type UpdateMemoRequest struct {
func (x *UpdateMemoRequest) Reset() {
*x = UpdateMemoRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[7]
mi := &file_api_v1_memo_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -440,7 +440,7 @@ func (x *UpdateMemoRequest) String() string {
func (*UpdateMemoRequest) ProtoMessage() {}
func (x *UpdateMemoRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[7]
mi := &file_api_v1_memo_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -453,7 +453,7 @@ func (x *UpdateMemoRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateMemoRequest.ProtoReflect.Descriptor instead.
func (*UpdateMemoRequest) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{7}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{7}
}
func (x *UpdateMemoRequest) GetMemo() *Memo {
@ -481,7 +481,7 @@ type UpdateMemoResponse struct {
func (x *UpdateMemoResponse) Reset() {
*x = UpdateMemoResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[8]
mi := &file_api_v1_memo_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -494,7 +494,7 @@ func (x *UpdateMemoResponse) String() string {
func (*UpdateMemoResponse) ProtoMessage() {}
func (x *UpdateMemoResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[8]
mi := &file_api_v1_memo_service_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -507,7 +507,7 @@ func (x *UpdateMemoResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateMemoResponse.ProtoReflect.Descriptor instead.
func (*UpdateMemoResponse) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{8}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{8}
}
func (x *UpdateMemoResponse) GetMemo() *Memo {
@ -528,7 +528,7 @@ type DeleteMemoRequest struct {
func (x *DeleteMemoRequest) Reset() {
*x = DeleteMemoRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[9]
mi := &file_api_v1_memo_service_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -541,7 +541,7 @@ func (x *DeleteMemoRequest) String() string {
func (*DeleteMemoRequest) ProtoMessage() {}
func (x *DeleteMemoRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[9]
mi := &file_api_v1_memo_service_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -554,7 +554,7 @@ func (x *DeleteMemoRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteMemoRequest.ProtoReflect.Descriptor instead.
func (*DeleteMemoRequest) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{9}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{9}
}
func (x *DeleteMemoRequest) GetId() int32 {
@ -573,7 +573,7 @@ type DeleteMemoResponse struct {
func (x *DeleteMemoResponse) Reset() {
*x = DeleteMemoResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_memo_service_proto_msgTypes[10]
mi := &file_api_v1_memo_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -586,7 +586,7 @@ func (x *DeleteMemoResponse) String() string {
func (*DeleteMemoResponse) ProtoMessage() {}
func (x *DeleteMemoResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_memo_service_proto_msgTypes[10]
mi := &file_api_v1_memo_service_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -599,16 +599,16 @@ func (x *DeleteMemoResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteMemoResponse.ProtoReflect.Descriptor instead.
func (*DeleteMemoResponse) Descriptor() ([]byte, []int) {
return file_api_v2_memo_service_proto_rawDescGZIP(), []int{10}
return file_api_v1_memo_service_proto_rawDescGZIP(), []int{10}
}
var File_api_v2_memo_service_proto protoreflect.FileDescriptor
var File_api_v1_memo_service_proto protoreflect.FileDescriptor
var file_api_v2_memo_service_proto_rawDesc = []byte{
0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x73, 0x65,
var file_api_v1_memo_service_proto_rawDesc = []byte{
0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e,
@ -630,7 +630,7 @@ var file_api_v2_memo_service_proto_rawDesc = []byte{
0x70, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x36,
0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x17, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
0x32, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77,
0x31, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69,
0x74, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
@ -639,37 +639,37 @@ var file_api_v2_memo_service_proto_rawDesc = []byte{
0x67, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x38,
0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
0x32, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69,
0x31, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69,
0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74,
0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x11,
0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x28, 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x22, 0x20, 0x0a, 0x0e, 0x47,
0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x39, 0x0a,
0x0f, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65,
0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x3b, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a,
0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52,
0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d,
0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d,
0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d,
0x65, 0x6d, 0x6f, 0x22, 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d,
0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f,
0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73,
0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x3c, 0x0a,
0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31,
0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x23, 0x0a, 0x11, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64,
@ -677,106 +677,106 @@ var file_api_v2_memo_service_proto_rawDesc = []byte{
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xc7, 0x04, 0x0a, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65,
0x6d, 0x6f, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75,
0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70,
0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x67, 0x0a, 0x07, 0x47,
0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x67, 0x0a, 0x07, 0x47,
0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14,
0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f,
0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f,
0x7b, 0x69, 0x64, 0x7d, 0x12, 0x6c, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65,
0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75,
0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73,
0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x04, 0x6d,
0x65, 0x6d, 0x6f, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d,
0x65, 0x6d, 0x6f, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6d,
0x6f, 0x73, 0x12, 0x89, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d,
0x6f, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
0x6f, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31,
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70,
0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0xda, 0x41, 0x10, 0x6d, 0x65, 0x6d, 0x6f, 0x2c, 0x75, 0x70,
0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a,
0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x1a, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d,
0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x1a, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d,
0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x6d, 0x65, 0x6d, 0x6f, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x70,
0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x73,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d,
0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d,
0x42, 0xae, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4d, 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x4d, 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f,
0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 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, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41,
0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70,
0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76,
0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41,
0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70,
0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56,
0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_api_v2_memo_service_proto_rawDescOnce sync.Once
file_api_v2_memo_service_proto_rawDescData = file_api_v2_memo_service_proto_rawDesc
file_api_v1_memo_service_proto_rawDescOnce sync.Once
file_api_v1_memo_service_proto_rawDescData = file_api_v1_memo_service_proto_rawDesc
)
func file_api_v2_memo_service_proto_rawDescGZIP() []byte {
file_api_v2_memo_service_proto_rawDescOnce.Do(func() {
file_api_v2_memo_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_memo_service_proto_rawDescData)
func file_api_v1_memo_service_proto_rawDescGZIP() []byte {
file_api_v1_memo_service_proto_rawDescOnce.Do(func() {
file_api_v1_memo_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_memo_service_proto_rawDescData)
})
return file_api_v2_memo_service_proto_rawDescData
return file_api_v1_memo_service_proto_rawDescData
}
var file_api_v2_memo_service_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_api_v2_memo_service_proto_goTypes = []interface{}{
(*Memo)(nil), // 0: slash.api.v2.Memo
(*ListMemosRequest)(nil), // 1: slash.api.v2.ListMemosRequest
(*ListMemosResponse)(nil), // 2: slash.api.v2.ListMemosResponse
(*GetMemoRequest)(nil), // 3: slash.api.v2.GetMemoRequest
(*GetMemoResponse)(nil), // 4: slash.api.v2.GetMemoResponse
(*CreateMemoRequest)(nil), // 5: slash.api.v2.CreateMemoRequest
(*CreateMemoResponse)(nil), // 6: slash.api.v2.CreateMemoResponse
(*UpdateMemoRequest)(nil), // 7: slash.api.v2.UpdateMemoRequest
(*UpdateMemoResponse)(nil), // 8: slash.api.v2.UpdateMemoResponse
(*DeleteMemoRequest)(nil), // 9: slash.api.v2.DeleteMemoRequest
(*DeleteMemoResponse)(nil), // 10: slash.api.v2.DeleteMemoResponse
var file_api_v1_memo_service_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_api_v1_memo_service_proto_goTypes = []interface{}{
(*Memo)(nil), // 0: slash.api.v1.Memo
(*ListMemosRequest)(nil), // 1: slash.api.v1.ListMemosRequest
(*ListMemosResponse)(nil), // 2: slash.api.v1.ListMemosResponse
(*GetMemoRequest)(nil), // 3: slash.api.v1.GetMemoRequest
(*GetMemoResponse)(nil), // 4: slash.api.v1.GetMemoResponse
(*CreateMemoRequest)(nil), // 5: slash.api.v1.CreateMemoRequest
(*CreateMemoResponse)(nil), // 6: slash.api.v1.CreateMemoResponse
(*UpdateMemoRequest)(nil), // 7: slash.api.v1.UpdateMemoRequest
(*UpdateMemoResponse)(nil), // 8: slash.api.v1.UpdateMemoResponse
(*DeleteMemoRequest)(nil), // 9: slash.api.v1.DeleteMemoRequest
(*DeleteMemoResponse)(nil), // 10: slash.api.v1.DeleteMemoResponse
(*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp
(RowStatus)(0), // 12: slash.api.v2.RowStatus
(Visibility)(0), // 13: slash.api.v2.Visibility
(RowStatus)(0), // 12: slash.api.v1.RowStatus
(Visibility)(0), // 13: slash.api.v1.Visibility
(*fieldmaskpb.FieldMask)(nil), // 14: google.protobuf.FieldMask
}
var file_api_v2_memo_service_proto_depIdxs = []int32{
11, // 0: slash.api.v2.Memo.created_time:type_name -> google.protobuf.Timestamp
11, // 1: slash.api.v2.Memo.updated_time:type_name -> google.protobuf.Timestamp
12, // 2: slash.api.v2.Memo.row_status:type_name -> slash.api.v2.RowStatus
13, // 3: slash.api.v2.Memo.visibility:type_name -> slash.api.v2.Visibility
0, // 4: slash.api.v2.ListMemosResponse.memos:type_name -> slash.api.v2.Memo
0, // 5: slash.api.v2.GetMemoResponse.memo:type_name -> slash.api.v2.Memo
0, // 6: slash.api.v2.CreateMemoRequest.memo:type_name -> slash.api.v2.Memo
0, // 7: slash.api.v2.CreateMemoResponse.memo:type_name -> slash.api.v2.Memo
0, // 8: slash.api.v2.UpdateMemoRequest.memo:type_name -> slash.api.v2.Memo
14, // 9: slash.api.v2.UpdateMemoRequest.update_mask:type_name -> google.protobuf.FieldMask
0, // 10: slash.api.v2.UpdateMemoResponse.memo:type_name -> slash.api.v2.Memo
1, // 11: slash.api.v2.MemoService.ListMemos:input_type -> slash.api.v2.ListMemosRequest
3, // 12: slash.api.v2.MemoService.GetMemo:input_type -> slash.api.v2.GetMemoRequest
5, // 13: slash.api.v2.MemoService.CreateMemo:input_type -> slash.api.v2.CreateMemoRequest
7, // 14: slash.api.v2.MemoService.UpdateMemo:input_type -> slash.api.v2.UpdateMemoRequest
9, // 15: slash.api.v2.MemoService.DeleteMemo:input_type -> slash.api.v2.DeleteMemoRequest
2, // 16: slash.api.v2.MemoService.ListMemos:output_type -> slash.api.v2.ListMemosResponse
4, // 17: slash.api.v2.MemoService.GetMemo:output_type -> slash.api.v2.GetMemoResponse
6, // 18: slash.api.v2.MemoService.CreateMemo:output_type -> slash.api.v2.CreateMemoResponse
8, // 19: slash.api.v2.MemoService.UpdateMemo:output_type -> slash.api.v2.UpdateMemoResponse
10, // 20: slash.api.v2.MemoService.DeleteMemo:output_type -> slash.api.v2.DeleteMemoResponse
var file_api_v1_memo_service_proto_depIdxs = []int32{
11, // 0: slash.api.v1.Memo.created_time:type_name -> google.protobuf.Timestamp
11, // 1: slash.api.v1.Memo.updated_time:type_name -> google.protobuf.Timestamp
12, // 2: slash.api.v1.Memo.row_status:type_name -> slash.api.v1.RowStatus
13, // 3: slash.api.v1.Memo.visibility:type_name -> slash.api.v1.Visibility
0, // 4: slash.api.v1.ListMemosResponse.memos:type_name -> slash.api.v1.Memo
0, // 5: slash.api.v1.GetMemoResponse.memo:type_name -> slash.api.v1.Memo
0, // 6: slash.api.v1.CreateMemoRequest.memo:type_name -> slash.api.v1.Memo
0, // 7: slash.api.v1.CreateMemoResponse.memo:type_name -> slash.api.v1.Memo
0, // 8: slash.api.v1.UpdateMemoRequest.memo:type_name -> slash.api.v1.Memo
14, // 9: slash.api.v1.UpdateMemoRequest.update_mask:type_name -> google.protobuf.FieldMask
0, // 10: slash.api.v1.UpdateMemoResponse.memo:type_name -> slash.api.v1.Memo
1, // 11: slash.api.v1.MemoService.ListMemos:input_type -> slash.api.v1.ListMemosRequest
3, // 12: slash.api.v1.MemoService.GetMemo:input_type -> slash.api.v1.GetMemoRequest
5, // 13: slash.api.v1.MemoService.CreateMemo:input_type -> slash.api.v1.CreateMemoRequest
7, // 14: slash.api.v1.MemoService.UpdateMemo:input_type -> slash.api.v1.UpdateMemoRequest
9, // 15: slash.api.v1.MemoService.DeleteMemo:input_type -> slash.api.v1.DeleteMemoRequest
2, // 16: slash.api.v1.MemoService.ListMemos:output_type -> slash.api.v1.ListMemosResponse
4, // 17: slash.api.v1.MemoService.GetMemo:output_type -> slash.api.v1.GetMemoResponse
6, // 18: slash.api.v1.MemoService.CreateMemo:output_type -> slash.api.v1.CreateMemoResponse
8, // 19: slash.api.v1.MemoService.UpdateMemo:output_type -> slash.api.v1.UpdateMemoResponse
10, // 20: slash.api.v1.MemoService.DeleteMemo:output_type -> slash.api.v1.DeleteMemoResponse
16, // [16:21] is the sub-list for method output_type
11, // [11:16] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name
@ -784,14 +784,14 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{
0, // [0:11] is the sub-list for field type_name
}
func init() { file_api_v2_memo_service_proto_init() }
func file_api_v2_memo_service_proto_init() {
if File_api_v2_memo_service_proto != nil {
func init() { file_api_v1_memo_service_proto_init() }
func file_api_v1_memo_service_proto_init() {
if File_api_v1_memo_service_proto != nil {
return
}
file_api_v2_common_proto_init()
file_api_v1_common_proto_init()
if !protoimpl.UnsafeEnabled {
file_api_v2_memo_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Memo); i {
case 0:
return &v.state
@ -803,7 +803,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListMemosRequest); i {
case 0:
return &v.state
@ -815,7 +815,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListMemosResponse); i {
case 0:
return &v.state
@ -827,7 +827,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetMemoRequest); i {
case 0:
return &v.state
@ -839,7 +839,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetMemoResponse); i {
case 0:
return &v.state
@ -851,7 +851,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateMemoRequest); i {
case 0:
return &v.state
@ -863,7 +863,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateMemoResponse); i {
case 0:
return &v.state
@ -875,7 +875,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateMemoRequest); i {
case 0:
return &v.state
@ -887,7 +887,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateMemoResponse); i {
case 0:
return &v.state
@ -899,7 +899,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteMemoRequest); i {
case 0:
return &v.state
@ -911,7 +911,7 @@ func file_api_v2_memo_service_proto_init() {
return nil
}
}
file_api_v2_memo_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_memo_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteMemoResponse); i {
case 0:
return &v.state
@ -928,18 +928,18 @@ func file_api_v2_memo_service_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_v2_memo_service_proto_rawDesc,
RawDescriptor: file_api_v1_memo_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_v2_memo_service_proto_goTypes,
DependencyIndexes: file_api_v2_memo_service_proto_depIdxs,
MessageInfos: file_api_v2_memo_service_proto_msgTypes,
GoTypes: file_api_v1_memo_service_proto_goTypes,
DependencyIndexes: file_api_v1_memo_service_proto_depIdxs,
MessageInfos: file_api_v1_memo_service_proto_msgTypes,
}.Build()
File_api_v2_memo_service_proto = out.File
file_api_v2_memo_service_proto_rawDesc = nil
file_api_v2_memo_service_proto_goTypes = nil
file_api_v2_memo_service_proto_depIdxs = nil
File_api_v1_memo_service_proto = out.File
file_api_v1_memo_service_proto_rawDesc = nil
file_api_v1_memo_service_proto_goTypes = nil
file_api_v1_memo_service_proto_depIdxs = nil
}

View File

@ -1,12 +1,12 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/memo_service.proto
// source: api/v1/memo_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"
@ -287,7 +287,7 @@ func RegisterMemoServiceHandlerServer(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, "/slash.api.v2.MemoService/ListMemos", runtime.WithHTTPPathPattern("/api/v2/memos"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.MemoService/ListMemos", runtime.WithHTTPPathPattern("/api/v1/memos"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -312,7 +312,7 @@ func RegisterMemoServiceHandlerServer(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, "/slash.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v1/memos/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -337,7 +337,7 @@ func RegisterMemoServiceHandlerServer(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, "/slash.api.v2.MemoService/CreateMemo", runtime.WithHTTPPathPattern("/api/v2/memos"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.MemoService/CreateMemo", runtime.WithHTTPPathPattern("/api/v1/memos"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -362,7 +362,7 @@ func RegisterMemoServiceHandlerServer(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, "/slash.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{memo.id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v1/memos/{memo.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -387,7 +387,7 @@ func RegisterMemoServiceHandlerServer(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, "/slash.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v1/memos/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -451,7 +451,7 @@ func RegisterMemoServiceHandlerClient(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, "/slash.api.v2.MemoService/ListMemos", runtime.WithHTTPPathPattern("/api/v2/memos"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.MemoService/ListMemos", runtime.WithHTTPPathPattern("/api/v1/memos"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -473,7 +473,7 @@ func RegisterMemoServiceHandlerClient(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, "/slash.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v1/memos/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -495,7 +495,7 @@ func RegisterMemoServiceHandlerClient(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, "/slash.api.v2.MemoService/CreateMemo", runtime.WithHTTPPathPattern("/api/v2/memos"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.MemoService/CreateMemo", runtime.WithHTTPPathPattern("/api/v1/memos"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -517,7 +517,7 @@ func RegisterMemoServiceHandlerClient(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, "/slash.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{memo.id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v1/memos/{memo.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -539,7 +539,7 @@ func RegisterMemoServiceHandlerClient(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, "/slash.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v1/memos/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -559,15 +559,15 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
}
var (
pattern_MemoService_ListMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, ""))
pattern_MemoService_ListMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "memos"}, ""))
pattern_MemoService_GetMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "id"}, ""))
pattern_MemoService_GetMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "memos", "id"}, ""))
pattern_MemoService_CreateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, ""))
pattern_MemoService_CreateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "memos"}, ""))
pattern_MemoService_UpdateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "memo.id"}, ""))
pattern_MemoService_UpdateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "memos", "memo.id"}, ""))
pattern_MemoService_DeleteMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "id"}, ""))
pattern_MemoService_DeleteMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "memos", "id"}, ""))
)
var (

View File

@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/memo_service.proto
// source: api/v1/memo_service.proto
package apiv2
package apiv1
import (
context "context"
@ -19,11 +19,11 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
MemoService_ListMemos_FullMethodName = "/slash.api.v2.MemoService/ListMemos"
MemoService_GetMemo_FullMethodName = "/slash.api.v2.MemoService/GetMemo"
MemoService_CreateMemo_FullMethodName = "/slash.api.v2.MemoService/CreateMemo"
MemoService_UpdateMemo_FullMethodName = "/slash.api.v2.MemoService/UpdateMemo"
MemoService_DeleteMemo_FullMethodName = "/slash.api.v2.MemoService/DeleteMemo"
MemoService_ListMemos_FullMethodName = "/slash.api.v1.MemoService/ListMemos"
MemoService_GetMemo_FullMethodName = "/slash.api.v1.MemoService/GetMemo"
MemoService_CreateMemo_FullMethodName = "/slash.api.v1.MemoService/CreateMemo"
MemoService_UpdateMemo_FullMethodName = "/slash.api.v1.MemoService/UpdateMemo"
MemoService_DeleteMemo_FullMethodName = "/slash.api.v1.MemoService/DeleteMemo"
)
// MemoServiceClient is the client API for MemoService service.
@ -238,7 +238,7 @@ func _MemoService_DeleteMemo_Handler(srv interface{}, ctx context.Context, dec f
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MemoService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "slash.api.v2.MemoService",
ServiceName: "slash.api.v1.MemoService",
HandlerType: (*MemoServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
@ -263,5 +263,5 @@ var MemoService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/memo_service.proto",
Metadata: "api/v1/memo_service.proto",
}

View File

@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: api/v2/shortcut_service.proto
// source: api/v1/shortcut_service.proto
package apiv2
package apiv1
import (
_ "google.golang.org/genproto/googleapis/api/annotations"
@ -32,13 +32,13 @@ type Shortcut struct {
CreatorId int32 `protobuf:"varint,2,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"`
CreatedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"`
UpdatedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"`
RowStatus RowStatus `protobuf:"varint,5,opt,name=row_status,json=rowStatus,proto3,enum=slash.api.v2.RowStatus" json:"row_status,omitempty"`
RowStatus RowStatus `protobuf:"varint,5,opt,name=row_status,json=rowStatus,proto3,enum=slash.api.v1.RowStatus" json:"row_status,omitempty"`
Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
Link string `protobuf:"bytes,7,opt,name=link,proto3" json:"link,omitempty"`
Title string `protobuf:"bytes,8,opt,name=title,proto3" json:"title,omitempty"`
Tags []string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"`
Description string `protobuf:"bytes,10,opt,name=description,proto3" json:"description,omitempty"`
Visibility Visibility `protobuf:"varint,11,opt,name=visibility,proto3,enum=slash.api.v2.Visibility" json:"visibility,omitempty"`
Visibility Visibility `protobuf:"varint,11,opt,name=visibility,proto3,enum=slash.api.v1.Visibility" json:"visibility,omitempty"`
ViewCount int32 `protobuf:"varint,12,opt,name=view_count,json=viewCount,proto3" json:"view_count,omitempty"`
OgMetadata *OpenGraphMetadata `protobuf:"bytes,13,opt,name=og_metadata,json=ogMetadata,proto3" json:"og_metadata,omitempty"`
}
@ -46,7 +46,7 @@ type Shortcut struct {
func (x *Shortcut) Reset() {
*x = Shortcut{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[0]
mi := &file_api_v1_shortcut_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -59,7 +59,7 @@ func (x *Shortcut) String() string {
func (*Shortcut) ProtoMessage() {}
func (x *Shortcut) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[0]
mi := &file_api_v1_shortcut_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -72,7 +72,7 @@ func (x *Shortcut) ProtoReflect() protoreflect.Message {
// Deprecated: Use Shortcut.ProtoReflect.Descriptor instead.
func (*Shortcut) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{0}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{0}
}
func (x *Shortcut) GetId() int32 {
@ -179,7 +179,7 @@ type OpenGraphMetadata struct {
func (x *OpenGraphMetadata) Reset() {
*x = OpenGraphMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[1]
mi := &file_api_v1_shortcut_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -192,7 +192,7 @@ func (x *OpenGraphMetadata) String() string {
func (*OpenGraphMetadata) ProtoMessage() {}
func (x *OpenGraphMetadata) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[1]
mi := &file_api_v1_shortcut_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -205,7 +205,7 @@ func (x *OpenGraphMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use OpenGraphMetadata.ProtoReflect.Descriptor instead.
func (*OpenGraphMetadata) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{1}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{1}
}
func (x *OpenGraphMetadata) GetTitle() string {
@ -238,7 +238,7 @@ type ListShortcutsRequest struct {
func (x *ListShortcutsRequest) Reset() {
*x = ListShortcutsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[2]
mi := &file_api_v1_shortcut_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -251,7 +251,7 @@ func (x *ListShortcutsRequest) String() string {
func (*ListShortcutsRequest) ProtoMessage() {}
func (x *ListShortcutsRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[2]
mi := &file_api_v1_shortcut_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -264,7 +264,7 @@ func (x *ListShortcutsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListShortcutsRequest.ProtoReflect.Descriptor instead.
func (*ListShortcutsRequest) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{2}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{2}
}
type ListShortcutsResponse struct {
@ -278,7 +278,7 @@ type ListShortcutsResponse struct {
func (x *ListShortcutsResponse) Reset() {
*x = ListShortcutsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[3]
mi := &file_api_v1_shortcut_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -291,7 +291,7 @@ func (x *ListShortcutsResponse) String() string {
func (*ListShortcutsResponse) ProtoMessage() {}
func (x *ListShortcutsResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[3]
mi := &file_api_v1_shortcut_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -304,7 +304,7 @@ func (x *ListShortcutsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListShortcutsResponse.ProtoReflect.Descriptor instead.
func (*ListShortcutsResponse) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{3}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{3}
}
func (x *ListShortcutsResponse) GetShortcuts() []*Shortcut {
@ -325,7 +325,7 @@ type GetShortcutRequest struct {
func (x *GetShortcutRequest) Reset() {
*x = GetShortcutRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[4]
mi := &file_api_v1_shortcut_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -338,7 +338,7 @@ func (x *GetShortcutRequest) String() string {
func (*GetShortcutRequest) ProtoMessage() {}
func (x *GetShortcutRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[4]
mi := &file_api_v1_shortcut_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -351,7 +351,7 @@ func (x *GetShortcutRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetShortcutRequest.ProtoReflect.Descriptor instead.
func (*GetShortcutRequest) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{4}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{4}
}
func (x *GetShortcutRequest) GetId() int32 {
@ -372,7 +372,7 @@ type GetShortcutResponse struct {
func (x *GetShortcutResponse) Reset() {
*x = GetShortcutResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[5]
mi := &file_api_v1_shortcut_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -385,7 +385,7 @@ func (x *GetShortcutResponse) String() string {
func (*GetShortcutResponse) ProtoMessage() {}
func (x *GetShortcutResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[5]
mi := &file_api_v1_shortcut_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -398,7 +398,7 @@ func (x *GetShortcutResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetShortcutResponse.ProtoReflect.Descriptor instead.
func (*GetShortcutResponse) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{5}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{5}
}
func (x *GetShortcutResponse) GetShortcut() *Shortcut {
@ -419,7 +419,7 @@ type GetShortcutByNameRequest struct {
func (x *GetShortcutByNameRequest) Reset() {
*x = GetShortcutByNameRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[6]
mi := &file_api_v1_shortcut_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -432,7 +432,7 @@ func (x *GetShortcutByNameRequest) String() string {
func (*GetShortcutByNameRequest) ProtoMessage() {}
func (x *GetShortcutByNameRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[6]
mi := &file_api_v1_shortcut_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -445,7 +445,7 @@ func (x *GetShortcutByNameRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetShortcutByNameRequest.ProtoReflect.Descriptor instead.
func (*GetShortcutByNameRequest) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{6}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{6}
}
func (x *GetShortcutByNameRequest) GetName() string {
@ -466,7 +466,7 @@ type GetShortcutByNameResponse struct {
func (x *GetShortcutByNameResponse) Reset() {
*x = GetShortcutByNameResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[7]
mi := &file_api_v1_shortcut_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -479,7 +479,7 @@ func (x *GetShortcutByNameResponse) String() string {
func (*GetShortcutByNameResponse) ProtoMessage() {}
func (x *GetShortcutByNameResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[7]
mi := &file_api_v1_shortcut_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -492,7 +492,7 @@ func (x *GetShortcutByNameResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetShortcutByNameResponse.ProtoReflect.Descriptor instead.
func (*GetShortcutByNameResponse) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{7}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{7}
}
func (x *GetShortcutByNameResponse) GetShortcut() *Shortcut {
@ -513,7 +513,7 @@ type CreateShortcutRequest struct {
func (x *CreateShortcutRequest) Reset() {
*x = CreateShortcutRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[8]
mi := &file_api_v1_shortcut_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -526,7 +526,7 @@ func (x *CreateShortcutRequest) String() string {
func (*CreateShortcutRequest) ProtoMessage() {}
func (x *CreateShortcutRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[8]
mi := &file_api_v1_shortcut_service_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -539,7 +539,7 @@ func (x *CreateShortcutRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateShortcutRequest.ProtoReflect.Descriptor instead.
func (*CreateShortcutRequest) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{8}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{8}
}
func (x *CreateShortcutRequest) GetShortcut() *Shortcut {
@ -560,7 +560,7 @@ type CreateShortcutResponse struct {
func (x *CreateShortcutResponse) Reset() {
*x = CreateShortcutResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[9]
mi := &file_api_v1_shortcut_service_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -573,7 +573,7 @@ func (x *CreateShortcutResponse) String() string {
func (*CreateShortcutResponse) ProtoMessage() {}
func (x *CreateShortcutResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[9]
mi := &file_api_v1_shortcut_service_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -586,7 +586,7 @@ func (x *CreateShortcutResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateShortcutResponse.ProtoReflect.Descriptor instead.
func (*CreateShortcutResponse) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{9}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{9}
}
func (x *CreateShortcutResponse) GetShortcut() *Shortcut {
@ -608,7 +608,7 @@ type UpdateShortcutRequest struct {
func (x *UpdateShortcutRequest) Reset() {
*x = UpdateShortcutRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[10]
mi := &file_api_v1_shortcut_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -621,7 +621,7 @@ func (x *UpdateShortcutRequest) String() string {
func (*UpdateShortcutRequest) ProtoMessage() {}
func (x *UpdateShortcutRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[10]
mi := &file_api_v1_shortcut_service_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -634,7 +634,7 @@ func (x *UpdateShortcutRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateShortcutRequest.ProtoReflect.Descriptor instead.
func (*UpdateShortcutRequest) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{10}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{10}
}
func (x *UpdateShortcutRequest) GetShortcut() *Shortcut {
@ -662,7 +662,7 @@ type UpdateShortcutResponse struct {
func (x *UpdateShortcutResponse) Reset() {
*x = UpdateShortcutResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[11]
mi := &file_api_v1_shortcut_service_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -675,7 +675,7 @@ func (x *UpdateShortcutResponse) String() string {
func (*UpdateShortcutResponse) ProtoMessage() {}
func (x *UpdateShortcutResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[11]
mi := &file_api_v1_shortcut_service_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -688,7 +688,7 @@ func (x *UpdateShortcutResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateShortcutResponse.ProtoReflect.Descriptor instead.
func (*UpdateShortcutResponse) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{11}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{11}
}
func (x *UpdateShortcutResponse) GetShortcut() *Shortcut {
@ -709,7 +709,7 @@ type DeleteShortcutRequest struct {
func (x *DeleteShortcutRequest) Reset() {
*x = DeleteShortcutRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[12]
mi := &file_api_v1_shortcut_service_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -722,7 +722,7 @@ func (x *DeleteShortcutRequest) String() string {
func (*DeleteShortcutRequest) ProtoMessage() {}
func (x *DeleteShortcutRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[12]
mi := &file_api_v1_shortcut_service_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -735,7 +735,7 @@ func (x *DeleteShortcutRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteShortcutRequest.ProtoReflect.Descriptor instead.
func (*DeleteShortcutRequest) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{12}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{12}
}
func (x *DeleteShortcutRequest) GetId() int32 {
@ -754,7 +754,7 @@ type DeleteShortcutResponse struct {
func (x *DeleteShortcutResponse) Reset() {
*x = DeleteShortcutResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[13]
mi := &file_api_v1_shortcut_service_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -767,7 +767,7 @@ func (x *DeleteShortcutResponse) String() string {
func (*DeleteShortcutResponse) ProtoMessage() {}
func (x *DeleteShortcutResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[13]
mi := &file_api_v1_shortcut_service_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -780,7 +780,7 @@ func (x *DeleteShortcutResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteShortcutResponse.ProtoReflect.Descriptor instead.
func (*DeleteShortcutResponse) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{13}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{13}
}
type GetShortcutAnalyticsRequest struct {
@ -794,7 +794,7 @@ type GetShortcutAnalyticsRequest struct {
func (x *GetShortcutAnalyticsRequest) Reset() {
*x = GetShortcutAnalyticsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[14]
mi := &file_api_v1_shortcut_service_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -807,7 +807,7 @@ func (x *GetShortcutAnalyticsRequest) String() string {
func (*GetShortcutAnalyticsRequest) ProtoMessage() {}
func (x *GetShortcutAnalyticsRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[14]
mi := &file_api_v1_shortcut_service_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -820,7 +820,7 @@ func (x *GetShortcutAnalyticsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetShortcutAnalyticsRequest.ProtoReflect.Descriptor instead.
func (*GetShortcutAnalyticsRequest) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{14}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{14}
}
func (x *GetShortcutAnalyticsRequest) GetId() int32 {
@ -843,7 +843,7 @@ type GetShortcutAnalyticsResponse struct {
func (x *GetShortcutAnalyticsResponse) Reset() {
*x = GetShortcutAnalyticsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[15]
mi := &file_api_v1_shortcut_service_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -856,7 +856,7 @@ func (x *GetShortcutAnalyticsResponse) String() string {
func (*GetShortcutAnalyticsResponse) ProtoMessage() {}
func (x *GetShortcutAnalyticsResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[15]
mi := &file_api_v1_shortcut_service_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -869,7 +869,7 @@ func (x *GetShortcutAnalyticsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetShortcutAnalyticsResponse.ProtoReflect.Descriptor instead.
func (*GetShortcutAnalyticsResponse) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{15}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{15}
}
func (x *GetShortcutAnalyticsResponse) GetReferences() []*GetShortcutAnalyticsResponse_AnalyticsItem {
@ -905,7 +905,7 @@ type GetShortcutAnalyticsResponse_AnalyticsItem struct {
func (x *GetShortcutAnalyticsResponse_AnalyticsItem) Reset() {
*x = GetShortcutAnalyticsResponse_AnalyticsItem{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_shortcut_service_proto_msgTypes[16]
mi := &file_api_v1_shortcut_service_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -918,7 +918,7 @@ func (x *GetShortcutAnalyticsResponse_AnalyticsItem) String() string {
func (*GetShortcutAnalyticsResponse_AnalyticsItem) ProtoMessage() {}
func (x *GetShortcutAnalyticsResponse_AnalyticsItem) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_shortcut_service_proto_msgTypes[16]
mi := &file_api_v1_shortcut_service_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -931,7 +931,7 @@ func (x *GetShortcutAnalyticsResponse_AnalyticsItem) ProtoReflect() protoreflect
// Deprecated: Use GetShortcutAnalyticsResponse_AnalyticsItem.ProtoReflect.Descriptor instead.
func (*GetShortcutAnalyticsResponse_AnalyticsItem) Descriptor() ([]byte, []int) {
return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{15, 0}
return file_api_v1_shortcut_service_proto_rawDescGZIP(), []int{15, 0}
}
func (x *GetShortcutAnalyticsResponse_AnalyticsItem) GetName() string {
@ -948,13 +948,13 @@ func (x *GetShortcutAnalyticsResponse_AnalyticsItem) GetCount() int32 {
return 0
}
var File_api_v2_shortcut_service_proto protoreflect.FileDescriptor
var File_api_v1_shortcut_service_proto protoreflect.FileDescriptor
var file_api_v2_shortcut_service_proto_rawDesc = []byte{
0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75,
var file_api_v1_shortcut_service_proto_rawDesc = []byte{
0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75,
0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x0c, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x13, 0x61,
0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
0x0c, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x61,
0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61,
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69,
@ -976,7 +976,7 @@ var file_api_v2_shortcut_service_proto_rawDesc = []byte{
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x73, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
@ -987,12 +987,12 @@ var file_api_v2_shortcut_service_proto_rawDesc = []byte{
0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a,
0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05,
0x52, 0x09, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x6f,
0x67, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
0x32, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
0x4f, 0x70, 0x65, 0x6e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
0x61, 0x52, 0x0a, 0x6f, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x61, 0x0a,
0x11, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
@ -1006,14 +1006,14 @@ var file_api_v2_shortcut_service_proto_rawDesc = []byte{
0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x34, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x09, 0x73, 0x68,
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x09, 0x73, 0x68,
0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x68,
0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x49, 0x0a,
0x13, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08,
0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x2e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53,
0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
@ -1021,21 +1021,21 @@ var file_api_v2_shortcut_service_proto_rawDesc = []byte{
0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52,
0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x4b, 0x0a, 0x15, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x32, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68,
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68,
0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x32, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
0x32, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72,
0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72,
0x74, 0x63, 0x75, 0x74, 0x22, 0x88, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32,
0x0a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63,
0x75, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73,
0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
@ -1044,7 +1044,7 @@ var file_api_v2_shortcut_service_proto_rawDesc = []byte{
0x4c, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75,
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x73, 0x68, 0x6f,
0x72, 0x74, 0x63, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x6c,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74,
0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x27, 0x0a,
0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
@ -1057,17 +1057,17 @@ var file_api_v2_shortcut_service_proto_rawDesc = []byte{
0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x58, 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41,
0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41,
0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a,
0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x07, 0x64, 0x65,
0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x6c,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68,
0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63,
0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x54,
0x0a, 0x08, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x38, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
0x32, 0x38, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79,
0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x6e, 0x61,
0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, 0x62, 0x72, 0x6f, 0x77,
@ -1078,144 +1078,144 @@ var file_api_v2_shortcut_service_proto_rawDesc = []byte{
0xb4, 0x07, 0x0a, 0x0f, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x12, 0x73, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74,
0x63, 0x75, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74,
0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72,
0x74, 0x63, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73,
0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73,
0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x12, 0x77, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53,
0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63,
0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72,
0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0xda, 0x41,
0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x76, 0x32, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64,
0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64,
0x7d, 0x12, 0x66, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74,
0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75,
0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65,
0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x0e, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x23, 0x2e, 0x73,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31,
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a,
0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x76, 0x32, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x12, 0xa5, 0x01, 0x0a,
0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x12, 0xa5, 0x01, 0x0a,
0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12,
0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55,
0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63,
0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63,
0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0xda, 0x41, 0x14, 0x73,
0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d,
0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74,
0x63, 0x75, 0x74, 0x1a, 0x1f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, 0x6f,
0x63, 0x75, 0x74, 0x1a, 0x1f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f,
0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74,
0x2e, 0x69, 0x64, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53,
0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x6f,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x6f,
0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x23, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a,
0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75,
0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75,
0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53,
0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73,
0x12, 0x29, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
0x12, 0x29, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79,
0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x73, 0x6c,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68,
0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68,
0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68,
0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x6e, 0x61,
0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x42, 0xb2, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x14, 0x53, 0x68, 0x6f,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x53, 0x68, 0x6f,
0x72, 0x74, 0x63, 0x75, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73,
0x6c, 0x61, 0x73, 0x68, 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, 0x53, 0x41,
0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32,
0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2,
0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47,
0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41,
0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31,
0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2,
0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47,
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61,
0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_api_v2_shortcut_service_proto_rawDescOnce sync.Once
file_api_v2_shortcut_service_proto_rawDescData = file_api_v2_shortcut_service_proto_rawDesc
file_api_v1_shortcut_service_proto_rawDescOnce sync.Once
file_api_v1_shortcut_service_proto_rawDescData = file_api_v1_shortcut_service_proto_rawDesc
)
func file_api_v2_shortcut_service_proto_rawDescGZIP() []byte {
file_api_v2_shortcut_service_proto_rawDescOnce.Do(func() {
file_api_v2_shortcut_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_shortcut_service_proto_rawDescData)
func file_api_v1_shortcut_service_proto_rawDescGZIP() []byte {
file_api_v1_shortcut_service_proto_rawDescOnce.Do(func() {
file_api_v1_shortcut_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_shortcut_service_proto_rawDescData)
})
return file_api_v2_shortcut_service_proto_rawDescData
return file_api_v1_shortcut_service_proto_rawDescData
}
var file_api_v2_shortcut_service_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
var file_api_v2_shortcut_service_proto_goTypes = []interface{}{
(*Shortcut)(nil), // 0: slash.api.v2.Shortcut
(*OpenGraphMetadata)(nil), // 1: slash.api.v2.OpenGraphMetadata
(*ListShortcutsRequest)(nil), // 2: slash.api.v2.ListShortcutsRequest
(*ListShortcutsResponse)(nil), // 3: slash.api.v2.ListShortcutsResponse
(*GetShortcutRequest)(nil), // 4: slash.api.v2.GetShortcutRequest
(*GetShortcutResponse)(nil), // 5: slash.api.v2.GetShortcutResponse
(*GetShortcutByNameRequest)(nil), // 6: slash.api.v2.GetShortcutByNameRequest
(*GetShortcutByNameResponse)(nil), // 7: slash.api.v2.GetShortcutByNameResponse
(*CreateShortcutRequest)(nil), // 8: slash.api.v2.CreateShortcutRequest
(*CreateShortcutResponse)(nil), // 9: slash.api.v2.CreateShortcutResponse
(*UpdateShortcutRequest)(nil), // 10: slash.api.v2.UpdateShortcutRequest
(*UpdateShortcutResponse)(nil), // 11: slash.api.v2.UpdateShortcutResponse
(*DeleteShortcutRequest)(nil), // 12: slash.api.v2.DeleteShortcutRequest
(*DeleteShortcutResponse)(nil), // 13: slash.api.v2.DeleteShortcutResponse
(*GetShortcutAnalyticsRequest)(nil), // 14: slash.api.v2.GetShortcutAnalyticsRequest
(*GetShortcutAnalyticsResponse)(nil), // 15: slash.api.v2.GetShortcutAnalyticsResponse
(*GetShortcutAnalyticsResponse_AnalyticsItem)(nil), // 16: slash.api.v2.GetShortcutAnalyticsResponse.AnalyticsItem
var file_api_v1_shortcut_service_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
var file_api_v1_shortcut_service_proto_goTypes = []interface{}{
(*Shortcut)(nil), // 0: slash.api.v1.Shortcut
(*OpenGraphMetadata)(nil), // 1: slash.api.v1.OpenGraphMetadata
(*ListShortcutsRequest)(nil), // 2: slash.api.v1.ListShortcutsRequest
(*ListShortcutsResponse)(nil), // 3: slash.api.v1.ListShortcutsResponse
(*GetShortcutRequest)(nil), // 4: slash.api.v1.GetShortcutRequest
(*GetShortcutResponse)(nil), // 5: slash.api.v1.GetShortcutResponse
(*GetShortcutByNameRequest)(nil), // 6: slash.api.v1.GetShortcutByNameRequest
(*GetShortcutByNameResponse)(nil), // 7: slash.api.v1.GetShortcutByNameResponse
(*CreateShortcutRequest)(nil), // 8: slash.api.v1.CreateShortcutRequest
(*CreateShortcutResponse)(nil), // 9: slash.api.v1.CreateShortcutResponse
(*UpdateShortcutRequest)(nil), // 10: slash.api.v1.UpdateShortcutRequest
(*UpdateShortcutResponse)(nil), // 11: slash.api.v1.UpdateShortcutResponse
(*DeleteShortcutRequest)(nil), // 12: slash.api.v1.DeleteShortcutRequest
(*DeleteShortcutResponse)(nil), // 13: slash.api.v1.DeleteShortcutResponse
(*GetShortcutAnalyticsRequest)(nil), // 14: slash.api.v1.GetShortcutAnalyticsRequest
(*GetShortcutAnalyticsResponse)(nil), // 15: slash.api.v1.GetShortcutAnalyticsResponse
(*GetShortcutAnalyticsResponse_AnalyticsItem)(nil), // 16: slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem
(*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp
(RowStatus)(0), // 18: slash.api.v2.RowStatus
(Visibility)(0), // 19: slash.api.v2.Visibility
(RowStatus)(0), // 18: slash.api.v1.RowStatus
(Visibility)(0), // 19: slash.api.v1.Visibility
(*fieldmaskpb.FieldMask)(nil), // 20: google.protobuf.FieldMask
}
var file_api_v2_shortcut_service_proto_depIdxs = []int32{
17, // 0: slash.api.v2.Shortcut.created_time:type_name -> google.protobuf.Timestamp
17, // 1: slash.api.v2.Shortcut.updated_time:type_name -> google.protobuf.Timestamp
18, // 2: slash.api.v2.Shortcut.row_status:type_name -> slash.api.v2.RowStatus
19, // 3: slash.api.v2.Shortcut.visibility:type_name -> slash.api.v2.Visibility
1, // 4: slash.api.v2.Shortcut.og_metadata:type_name -> slash.api.v2.OpenGraphMetadata
0, // 5: slash.api.v2.ListShortcutsResponse.shortcuts:type_name -> slash.api.v2.Shortcut
0, // 6: slash.api.v2.GetShortcutResponse.shortcut:type_name -> slash.api.v2.Shortcut
0, // 7: slash.api.v2.GetShortcutByNameResponse.shortcut:type_name -> slash.api.v2.Shortcut
0, // 8: slash.api.v2.CreateShortcutRequest.shortcut:type_name -> slash.api.v2.Shortcut
0, // 9: slash.api.v2.CreateShortcutResponse.shortcut:type_name -> slash.api.v2.Shortcut
0, // 10: slash.api.v2.UpdateShortcutRequest.shortcut:type_name -> slash.api.v2.Shortcut
20, // 11: slash.api.v2.UpdateShortcutRequest.update_mask:type_name -> google.protobuf.FieldMask
0, // 12: slash.api.v2.UpdateShortcutResponse.shortcut:type_name -> slash.api.v2.Shortcut
16, // 13: slash.api.v2.GetShortcutAnalyticsResponse.references:type_name -> slash.api.v2.GetShortcutAnalyticsResponse.AnalyticsItem
16, // 14: slash.api.v2.GetShortcutAnalyticsResponse.devices:type_name -> slash.api.v2.GetShortcutAnalyticsResponse.AnalyticsItem
16, // 15: slash.api.v2.GetShortcutAnalyticsResponse.browsers:type_name -> slash.api.v2.GetShortcutAnalyticsResponse.AnalyticsItem
2, // 16: slash.api.v2.ShortcutService.ListShortcuts:input_type -> slash.api.v2.ListShortcutsRequest
4, // 17: slash.api.v2.ShortcutService.GetShortcut:input_type -> slash.api.v2.GetShortcutRequest
6, // 18: slash.api.v2.ShortcutService.GetShortcutByName:input_type -> slash.api.v2.GetShortcutByNameRequest
8, // 19: slash.api.v2.ShortcutService.CreateShortcut:input_type -> slash.api.v2.CreateShortcutRequest
10, // 20: slash.api.v2.ShortcutService.UpdateShortcut:input_type -> slash.api.v2.UpdateShortcutRequest
12, // 21: slash.api.v2.ShortcutService.DeleteShortcut:input_type -> slash.api.v2.DeleteShortcutRequest
14, // 22: slash.api.v2.ShortcutService.GetShortcutAnalytics:input_type -> slash.api.v2.GetShortcutAnalyticsRequest
3, // 23: slash.api.v2.ShortcutService.ListShortcuts:output_type -> slash.api.v2.ListShortcutsResponse
5, // 24: slash.api.v2.ShortcutService.GetShortcut:output_type -> slash.api.v2.GetShortcutResponse
7, // 25: slash.api.v2.ShortcutService.GetShortcutByName:output_type -> slash.api.v2.GetShortcutByNameResponse
9, // 26: slash.api.v2.ShortcutService.CreateShortcut:output_type -> slash.api.v2.CreateShortcutResponse
11, // 27: slash.api.v2.ShortcutService.UpdateShortcut:output_type -> slash.api.v2.UpdateShortcutResponse
13, // 28: slash.api.v2.ShortcutService.DeleteShortcut:output_type -> slash.api.v2.DeleteShortcutResponse
15, // 29: slash.api.v2.ShortcutService.GetShortcutAnalytics:output_type -> slash.api.v2.GetShortcutAnalyticsResponse
var file_api_v1_shortcut_service_proto_depIdxs = []int32{
17, // 0: slash.api.v1.Shortcut.created_time:type_name -> google.protobuf.Timestamp
17, // 1: slash.api.v1.Shortcut.updated_time:type_name -> google.protobuf.Timestamp
18, // 2: slash.api.v1.Shortcut.row_status:type_name -> slash.api.v1.RowStatus
19, // 3: slash.api.v1.Shortcut.visibility:type_name -> slash.api.v1.Visibility
1, // 4: slash.api.v1.Shortcut.og_metadata:type_name -> slash.api.v1.OpenGraphMetadata
0, // 5: slash.api.v1.ListShortcutsResponse.shortcuts:type_name -> slash.api.v1.Shortcut
0, // 6: slash.api.v1.GetShortcutResponse.shortcut:type_name -> slash.api.v1.Shortcut
0, // 7: slash.api.v1.GetShortcutByNameResponse.shortcut:type_name -> slash.api.v1.Shortcut
0, // 8: slash.api.v1.CreateShortcutRequest.shortcut:type_name -> slash.api.v1.Shortcut
0, // 9: slash.api.v1.CreateShortcutResponse.shortcut:type_name -> slash.api.v1.Shortcut
0, // 10: slash.api.v1.UpdateShortcutRequest.shortcut:type_name -> slash.api.v1.Shortcut
20, // 11: slash.api.v1.UpdateShortcutRequest.update_mask:type_name -> google.protobuf.FieldMask
0, // 12: slash.api.v1.UpdateShortcutResponse.shortcut:type_name -> slash.api.v1.Shortcut
16, // 13: slash.api.v1.GetShortcutAnalyticsResponse.references:type_name -> slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem
16, // 14: slash.api.v1.GetShortcutAnalyticsResponse.devices:type_name -> slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem
16, // 15: slash.api.v1.GetShortcutAnalyticsResponse.browsers:type_name -> slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem
2, // 16: slash.api.v1.ShortcutService.ListShortcuts:input_type -> slash.api.v1.ListShortcutsRequest
4, // 17: slash.api.v1.ShortcutService.GetShortcut:input_type -> slash.api.v1.GetShortcutRequest
6, // 18: slash.api.v1.ShortcutService.GetShortcutByName:input_type -> slash.api.v1.GetShortcutByNameRequest
8, // 19: slash.api.v1.ShortcutService.CreateShortcut:input_type -> slash.api.v1.CreateShortcutRequest
10, // 20: slash.api.v1.ShortcutService.UpdateShortcut:input_type -> slash.api.v1.UpdateShortcutRequest
12, // 21: slash.api.v1.ShortcutService.DeleteShortcut:input_type -> slash.api.v1.DeleteShortcutRequest
14, // 22: slash.api.v1.ShortcutService.GetShortcutAnalytics:input_type -> slash.api.v1.GetShortcutAnalyticsRequest
3, // 23: slash.api.v1.ShortcutService.ListShortcuts:output_type -> slash.api.v1.ListShortcutsResponse
5, // 24: slash.api.v1.ShortcutService.GetShortcut:output_type -> slash.api.v1.GetShortcutResponse
7, // 25: slash.api.v1.ShortcutService.GetShortcutByName:output_type -> slash.api.v1.GetShortcutByNameResponse
9, // 26: slash.api.v1.ShortcutService.CreateShortcut:output_type -> slash.api.v1.CreateShortcutResponse
11, // 27: slash.api.v1.ShortcutService.UpdateShortcut:output_type -> slash.api.v1.UpdateShortcutResponse
13, // 28: slash.api.v1.ShortcutService.DeleteShortcut:output_type -> slash.api.v1.DeleteShortcutResponse
15, // 29: slash.api.v1.ShortcutService.GetShortcutAnalytics:output_type -> slash.api.v1.GetShortcutAnalyticsResponse
23, // [23:30] is the sub-list for method output_type
16, // [16:23] is the sub-list for method input_type
16, // [16:16] is the sub-list for extension type_name
@ -1223,14 +1223,14 @@ var file_api_v2_shortcut_service_proto_depIdxs = []int32{
0, // [0:16] is the sub-list for field type_name
}
func init() { file_api_v2_shortcut_service_proto_init() }
func file_api_v2_shortcut_service_proto_init() {
if File_api_v2_shortcut_service_proto != nil {
func init() { file_api_v1_shortcut_service_proto_init() }
func file_api_v1_shortcut_service_proto_init() {
if File_api_v1_shortcut_service_proto != nil {
return
}
file_api_v2_common_proto_init()
file_api_v1_common_proto_init()
if !protoimpl.UnsafeEnabled {
file_api_v2_shortcut_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Shortcut); i {
case 0:
return &v.state
@ -1242,7 +1242,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OpenGraphMetadata); i {
case 0:
return &v.state
@ -1254,7 +1254,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListShortcutsRequest); i {
case 0:
return &v.state
@ -1266,7 +1266,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListShortcutsResponse); i {
case 0:
return &v.state
@ -1278,7 +1278,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetShortcutRequest); i {
case 0:
return &v.state
@ -1290,7 +1290,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetShortcutResponse); i {
case 0:
return &v.state
@ -1302,7 +1302,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetShortcutByNameRequest); i {
case 0:
return &v.state
@ -1314,7 +1314,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetShortcutByNameResponse); i {
case 0:
return &v.state
@ -1326,7 +1326,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateShortcutRequest); i {
case 0:
return &v.state
@ -1338,7 +1338,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateShortcutResponse); i {
case 0:
return &v.state
@ -1350,7 +1350,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateShortcutRequest); i {
case 0:
return &v.state
@ -1362,7 +1362,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateShortcutResponse); i {
case 0:
return &v.state
@ -1374,7 +1374,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteShortcutRequest); i {
case 0:
return &v.state
@ -1386,7 +1386,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteShortcutResponse); i {
case 0:
return &v.state
@ -1398,7 +1398,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetShortcutAnalyticsRequest); i {
case 0:
return &v.state
@ -1410,7 +1410,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetShortcutAnalyticsResponse); i {
case 0:
return &v.state
@ -1422,7 +1422,7 @@ func file_api_v2_shortcut_service_proto_init() {
return nil
}
}
file_api_v2_shortcut_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_shortcut_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetShortcutAnalyticsResponse_AnalyticsItem); i {
case 0:
return &v.state
@ -1439,18 +1439,18 @@ func file_api_v2_shortcut_service_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_v2_shortcut_service_proto_rawDesc,
RawDescriptor: file_api_v1_shortcut_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 17,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_v2_shortcut_service_proto_goTypes,
DependencyIndexes: file_api_v2_shortcut_service_proto_depIdxs,
MessageInfos: file_api_v2_shortcut_service_proto_msgTypes,
GoTypes: file_api_v1_shortcut_service_proto_goTypes,
DependencyIndexes: file_api_v1_shortcut_service_proto_depIdxs,
MessageInfos: file_api_v1_shortcut_service_proto_msgTypes,
}.Build()
File_api_v2_shortcut_service_proto = out.File
file_api_v2_shortcut_service_proto_rawDesc = nil
file_api_v2_shortcut_service_proto_goTypes = nil
file_api_v2_shortcut_service_proto_depIdxs = nil
File_api_v1_shortcut_service_proto = out.File
file_api_v1_shortcut_service_proto_rawDesc = nil
file_api_v1_shortcut_service_proto_goTypes = nil
file_api_v1_shortcut_service_proto_depIdxs = nil
}

View File

@ -1,12 +1,12 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/shortcut_service.proto
// source: api/v1/shortcut_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"
@ -339,7 +339,7 @@ func RegisterShortcutServiceHandlerServer(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, "/slash.api.v2.ShortcutService/ListShortcuts", runtime.WithHTTPPathPattern("/api/v2/shortcuts"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.ShortcutService/ListShortcuts", runtime.WithHTTPPathPattern("/api/v1/shortcuts"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -364,7 +364,7 @@ func RegisterShortcutServiceHandlerServer(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, "/slash.api.v2.ShortcutService/GetShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.ShortcutService/GetShortcut", runtime.WithHTTPPathPattern("/api/v1/shortcuts/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -389,7 +389,7 @@ func RegisterShortcutServiceHandlerServer(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, "/slash.api.v2.ShortcutService/CreateShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.ShortcutService/CreateShortcut", runtime.WithHTTPPathPattern("/api/v1/shortcuts"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -414,7 +414,7 @@ func RegisterShortcutServiceHandlerServer(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, "/slash.api.v2.ShortcutService/UpdateShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{shortcut.id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.ShortcutService/UpdateShortcut", runtime.WithHTTPPathPattern("/api/v1/shortcuts/{shortcut.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -439,7 +439,7 @@ func RegisterShortcutServiceHandlerServer(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, "/slash.api.v2.ShortcutService/DeleteShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.ShortcutService/DeleteShortcut", runtime.WithHTTPPathPattern("/api/v1/shortcuts/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -464,7 +464,7 @@ func RegisterShortcutServiceHandlerServer(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, "/slash.api.v2.ShortcutService/GetShortcutAnalytics", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{id}/analytics"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.ShortcutService/GetShortcutAnalytics", runtime.WithHTTPPathPattern("/api/v1/shortcuts/{id}/analytics"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -528,7 +528,7 @@ func RegisterShortcutServiceHandlerClient(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, "/slash.api.v2.ShortcutService/ListShortcuts", runtime.WithHTTPPathPattern("/api/v2/shortcuts"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.ShortcutService/ListShortcuts", runtime.WithHTTPPathPattern("/api/v1/shortcuts"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -550,7 +550,7 @@ func RegisterShortcutServiceHandlerClient(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, "/slash.api.v2.ShortcutService/GetShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.ShortcutService/GetShortcut", runtime.WithHTTPPathPattern("/api/v1/shortcuts/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -572,7 +572,7 @@ func RegisterShortcutServiceHandlerClient(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, "/slash.api.v2.ShortcutService/CreateShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.ShortcutService/CreateShortcut", runtime.WithHTTPPathPattern("/api/v1/shortcuts"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -594,7 +594,7 @@ func RegisterShortcutServiceHandlerClient(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, "/slash.api.v2.ShortcutService/UpdateShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{shortcut.id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.ShortcutService/UpdateShortcut", runtime.WithHTTPPathPattern("/api/v1/shortcuts/{shortcut.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -616,7 +616,7 @@ func RegisterShortcutServiceHandlerClient(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, "/slash.api.v2.ShortcutService/DeleteShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.ShortcutService/DeleteShortcut", runtime.WithHTTPPathPattern("/api/v1/shortcuts/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -638,7 +638,7 @@ func RegisterShortcutServiceHandlerClient(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, "/slash.api.v2.ShortcutService/GetShortcutAnalytics", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{id}/analytics"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.ShortcutService/GetShortcutAnalytics", runtime.WithHTTPPathPattern("/api/v1/shortcuts/{id}/analytics"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -658,17 +658,17 @@ func RegisterShortcutServiceHandlerClient(ctx context.Context, mux *runtime.Serv
}
var (
pattern_ShortcutService_ListShortcuts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "shortcuts"}, ""))
pattern_ShortcutService_ListShortcuts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "shortcuts"}, ""))
pattern_ShortcutService_GetShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "shortcuts", "id"}, ""))
pattern_ShortcutService_GetShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "shortcuts", "id"}, ""))
pattern_ShortcutService_CreateShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "shortcuts"}, ""))
pattern_ShortcutService_CreateShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "shortcuts"}, ""))
pattern_ShortcutService_UpdateShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "shortcuts", "shortcut.id"}, ""))
pattern_ShortcutService_UpdateShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "shortcuts", "shortcut.id"}, ""))
pattern_ShortcutService_DeleteShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "shortcuts", "id"}, ""))
pattern_ShortcutService_DeleteShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "shortcuts", "id"}, ""))
pattern_ShortcutService_GetShortcutAnalytics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "shortcuts", "id", "analytics"}, ""))
pattern_ShortcutService_GetShortcutAnalytics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "shortcuts", "id", "analytics"}, ""))
)
var (

View File

@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/shortcut_service.proto
// source: api/v1/shortcut_service.proto
package apiv2
package apiv1
import (
context "context"
@ -19,13 +19,13 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
ShortcutService_ListShortcuts_FullMethodName = "/slash.api.v2.ShortcutService/ListShortcuts"
ShortcutService_GetShortcut_FullMethodName = "/slash.api.v2.ShortcutService/GetShortcut"
ShortcutService_GetShortcutByName_FullMethodName = "/slash.api.v2.ShortcutService/GetShortcutByName"
ShortcutService_CreateShortcut_FullMethodName = "/slash.api.v2.ShortcutService/CreateShortcut"
ShortcutService_UpdateShortcut_FullMethodName = "/slash.api.v2.ShortcutService/UpdateShortcut"
ShortcutService_DeleteShortcut_FullMethodName = "/slash.api.v2.ShortcutService/DeleteShortcut"
ShortcutService_GetShortcutAnalytics_FullMethodName = "/slash.api.v2.ShortcutService/GetShortcutAnalytics"
ShortcutService_ListShortcuts_FullMethodName = "/slash.api.v1.ShortcutService/ListShortcuts"
ShortcutService_GetShortcut_FullMethodName = "/slash.api.v1.ShortcutService/GetShortcut"
ShortcutService_GetShortcutByName_FullMethodName = "/slash.api.v1.ShortcutService/GetShortcutByName"
ShortcutService_CreateShortcut_FullMethodName = "/slash.api.v1.ShortcutService/CreateShortcut"
ShortcutService_UpdateShortcut_FullMethodName = "/slash.api.v1.ShortcutService/UpdateShortcut"
ShortcutService_DeleteShortcut_FullMethodName = "/slash.api.v1.ShortcutService/DeleteShortcut"
ShortcutService_GetShortcutAnalytics_FullMethodName = "/slash.api.v1.ShortcutService/GetShortcutAnalytics"
)
// ShortcutServiceClient is the client API for ShortcutService service.
@ -308,7 +308,7 @@ func _ShortcutService_GetShortcutAnalytics_Handler(srv interface{}, ctx context.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ShortcutService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "slash.api.v2.ShortcutService",
ServiceName: "slash.api.v1.ShortcutService",
HandlerType: (*ShortcutServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
@ -341,5 +341,5 @@ var ShortcutService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/shortcut_service.proto",
Metadata: "api/v1/shortcut_service.proto",
}

View File

@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: api/v2/subscription_service.proto
// source: api/v1/subscription_service.proto
package apiv2
package apiv1
import (
_ "google.golang.org/genproto/googleapis/api/annotations"
@ -55,11 +55,11 @@ func (x PlanType) String() string {
}
func (PlanType) Descriptor() protoreflect.EnumDescriptor {
return file_api_v2_subscription_service_proto_enumTypes[0].Descriptor()
return file_api_v1_subscription_service_proto_enumTypes[0].Descriptor()
}
func (PlanType) Type() protoreflect.EnumType {
return &file_api_v2_subscription_service_proto_enumTypes[0]
return &file_api_v1_subscription_service_proto_enumTypes[0]
}
func (x PlanType) Number() protoreflect.EnumNumber {
@ -68,7 +68,7 @@ func (x PlanType) Number() protoreflect.EnumNumber {
// Deprecated: Use PlanType.Descriptor instead.
func (PlanType) EnumDescriptor() ([]byte, []int) {
return file_api_v2_subscription_service_proto_rawDescGZIP(), []int{0}
return file_api_v1_subscription_service_proto_rawDescGZIP(), []int{0}
}
type Subscription struct {
@ -76,7 +76,7 @@ type Subscription struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Plan PlanType `protobuf:"varint,1,opt,name=plan,proto3,enum=slash.api.v2.PlanType" json:"plan,omitempty"`
Plan PlanType `protobuf:"varint,1,opt,name=plan,proto3,enum=slash.api.v1.PlanType" json:"plan,omitempty"`
StartedTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=started_time,json=startedTime,proto3" json:"started_time,omitempty"`
ExpiresTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires_time,json=expiresTime,proto3" json:"expires_time,omitempty"`
}
@ -84,7 +84,7 @@ type Subscription struct {
func (x *Subscription) Reset() {
*x = Subscription{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_subscription_service_proto_msgTypes[0]
mi := &file_api_v1_subscription_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -97,7 +97,7 @@ func (x *Subscription) String() string {
func (*Subscription) ProtoMessage() {}
func (x *Subscription) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_subscription_service_proto_msgTypes[0]
mi := &file_api_v1_subscription_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -110,7 +110,7 @@ func (x *Subscription) ProtoReflect() protoreflect.Message {
// Deprecated: Use Subscription.ProtoReflect.Descriptor instead.
func (*Subscription) Descriptor() ([]byte, []int) {
return file_api_v2_subscription_service_proto_rawDescGZIP(), []int{0}
return file_api_v1_subscription_service_proto_rawDescGZIP(), []int{0}
}
func (x *Subscription) GetPlan() PlanType {
@ -143,7 +143,7 @@ type GetSubscriptionRequest struct {
func (x *GetSubscriptionRequest) Reset() {
*x = GetSubscriptionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_subscription_service_proto_msgTypes[1]
mi := &file_api_v1_subscription_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -156,7 +156,7 @@ func (x *GetSubscriptionRequest) String() string {
func (*GetSubscriptionRequest) ProtoMessage() {}
func (x *GetSubscriptionRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_subscription_service_proto_msgTypes[1]
mi := &file_api_v1_subscription_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -169,7 +169,7 @@ func (x *GetSubscriptionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetSubscriptionRequest.ProtoReflect.Descriptor instead.
func (*GetSubscriptionRequest) Descriptor() ([]byte, []int) {
return file_api_v2_subscription_service_proto_rawDescGZIP(), []int{1}
return file_api_v1_subscription_service_proto_rawDescGZIP(), []int{1}
}
type GetSubscriptionResponse struct {
@ -183,7 +183,7 @@ type GetSubscriptionResponse struct {
func (x *GetSubscriptionResponse) Reset() {
*x = GetSubscriptionResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_subscription_service_proto_msgTypes[2]
mi := &file_api_v1_subscription_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -196,7 +196,7 @@ func (x *GetSubscriptionResponse) String() string {
func (*GetSubscriptionResponse) ProtoMessage() {}
func (x *GetSubscriptionResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_subscription_service_proto_msgTypes[2]
mi := &file_api_v1_subscription_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -209,7 +209,7 @@ func (x *GetSubscriptionResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetSubscriptionResponse.ProtoReflect.Descriptor instead.
func (*GetSubscriptionResponse) Descriptor() ([]byte, []int) {
return file_api_v2_subscription_service_proto_rawDescGZIP(), []int{2}
return file_api_v1_subscription_service_proto_rawDescGZIP(), []int{2}
}
func (x *GetSubscriptionResponse) GetSubscription() *Subscription {
@ -230,7 +230,7 @@ type UpdateSubscriptionRequest struct {
func (x *UpdateSubscriptionRequest) Reset() {
*x = UpdateSubscriptionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_subscription_service_proto_msgTypes[3]
mi := &file_api_v1_subscription_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -243,7 +243,7 @@ func (x *UpdateSubscriptionRequest) String() string {
func (*UpdateSubscriptionRequest) ProtoMessage() {}
func (x *UpdateSubscriptionRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_subscription_service_proto_msgTypes[3]
mi := &file_api_v1_subscription_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -256,7 +256,7 @@ func (x *UpdateSubscriptionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateSubscriptionRequest.ProtoReflect.Descriptor instead.
func (*UpdateSubscriptionRequest) Descriptor() ([]byte, []int) {
return file_api_v2_subscription_service_proto_rawDescGZIP(), []int{3}
return file_api_v1_subscription_service_proto_rawDescGZIP(), []int{3}
}
func (x *UpdateSubscriptionRequest) GetLicenseKey() string {
@ -277,7 +277,7 @@ type UpdateSubscriptionResponse struct {
func (x *UpdateSubscriptionResponse) Reset() {
*x = UpdateSubscriptionResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_subscription_service_proto_msgTypes[4]
mi := &file_api_v1_subscription_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -290,7 +290,7 @@ func (x *UpdateSubscriptionResponse) String() string {
func (*UpdateSubscriptionResponse) ProtoMessage() {}
func (x *UpdateSubscriptionResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_subscription_service_proto_msgTypes[4]
mi := &file_api_v1_subscription_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -303,7 +303,7 @@ func (x *UpdateSubscriptionResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateSubscriptionResponse.ProtoReflect.Descriptor instead.
func (*UpdateSubscriptionResponse) Descriptor() ([]byte, []int) {
return file_api_v2_subscription_service_proto_rawDescGZIP(), []int{4}
return file_api_v1_subscription_service_proto_rawDescGZIP(), []int{4}
}
func (x *UpdateSubscriptionResponse) GetSubscription() *Subscription {
@ -313,13 +313,13 @@ func (x *UpdateSubscriptionResponse) GetSubscription() *Subscription {
return nil
}
var File_api_v2_subscription_service_proto protoreflect.FileDescriptor
var File_api_v1_subscription_service_proto protoreflect.FileDescriptor
var file_api_v2_subscription_service_proto_rawDesc = []byte{
0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
var file_api_v1_subscription_service_proto_rawDesc = []byte{
0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c,
0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
@ -327,7 +327,7 @@ var file_api_v2_subscription_service_proto_rawDesc = []byte{
0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0xc7, 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e,
0x50, 0x6c, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x70,
0x6c, 0x61, 0x6e, 0x12, 0x42, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74,
0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
@ -343,7 +343,7 @@ var file_api_v2_subscription_service_proto_rawDesc = []byte{
0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x3e, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x52, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x22, 0x41, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a,
@ -353,7 +353,7 @@ var file_api_v2_subscription_service_proto_rawDesc = []byte{
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x2a, 0x38, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a,
0x15, 0x50, 0x4c, 0x41, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
@ -362,68 +362,68 @@ var file_api_v2_subscription_service_proto_rawDesc = []byte{
0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53,
0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31,
0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x84, 0x01,
0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a,
0x01, 0x2a, 0x32, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x42, 0xb6, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x18, 0x53, 0x75, 0x62, 0x73, 0x63,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x18, 0x53, 0x75, 0x62, 0x73, 0x63,
0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72,
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64,
0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 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,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03,
0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e,
0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56,
0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32,
0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56,
0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31,
0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53,
0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70,
0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_api_v2_subscription_service_proto_rawDescOnce sync.Once
file_api_v2_subscription_service_proto_rawDescData = file_api_v2_subscription_service_proto_rawDesc
file_api_v1_subscription_service_proto_rawDescOnce sync.Once
file_api_v1_subscription_service_proto_rawDescData = file_api_v1_subscription_service_proto_rawDesc
)
func file_api_v2_subscription_service_proto_rawDescGZIP() []byte {
file_api_v2_subscription_service_proto_rawDescOnce.Do(func() {
file_api_v2_subscription_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_subscription_service_proto_rawDescData)
func file_api_v1_subscription_service_proto_rawDescGZIP() []byte {
file_api_v1_subscription_service_proto_rawDescOnce.Do(func() {
file_api_v1_subscription_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_subscription_service_proto_rawDescData)
})
return file_api_v2_subscription_service_proto_rawDescData
return file_api_v1_subscription_service_proto_rawDescData
}
var file_api_v2_subscription_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_v2_subscription_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_api_v2_subscription_service_proto_goTypes = []interface{}{
(PlanType)(0), // 0: slash.api.v2.PlanType
(*Subscription)(nil), // 1: slash.api.v2.Subscription
(*GetSubscriptionRequest)(nil), // 2: slash.api.v2.GetSubscriptionRequest
(*GetSubscriptionResponse)(nil), // 3: slash.api.v2.GetSubscriptionResponse
(*UpdateSubscriptionRequest)(nil), // 4: slash.api.v2.UpdateSubscriptionRequest
(*UpdateSubscriptionResponse)(nil), // 5: slash.api.v2.UpdateSubscriptionResponse
var file_api_v1_subscription_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_v1_subscription_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_api_v1_subscription_service_proto_goTypes = []interface{}{
(PlanType)(0), // 0: slash.api.v1.PlanType
(*Subscription)(nil), // 1: slash.api.v1.Subscription
(*GetSubscriptionRequest)(nil), // 2: slash.api.v1.GetSubscriptionRequest
(*GetSubscriptionResponse)(nil), // 3: slash.api.v1.GetSubscriptionResponse
(*UpdateSubscriptionRequest)(nil), // 4: slash.api.v1.UpdateSubscriptionRequest
(*UpdateSubscriptionResponse)(nil), // 5: slash.api.v1.UpdateSubscriptionResponse
(*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp
}
var file_api_v2_subscription_service_proto_depIdxs = []int32{
0, // 0: slash.api.v2.Subscription.plan:type_name -> slash.api.v2.PlanType
6, // 1: slash.api.v2.Subscription.started_time:type_name -> google.protobuf.Timestamp
6, // 2: slash.api.v2.Subscription.expires_time:type_name -> google.protobuf.Timestamp
1, // 3: slash.api.v2.GetSubscriptionResponse.subscription:type_name -> slash.api.v2.Subscription
1, // 4: slash.api.v2.UpdateSubscriptionResponse.subscription:type_name -> slash.api.v2.Subscription
2, // 5: slash.api.v2.SubscriptionService.GetSubscription:input_type -> slash.api.v2.GetSubscriptionRequest
4, // 6: slash.api.v2.SubscriptionService.UpdateSubscription:input_type -> slash.api.v2.UpdateSubscriptionRequest
3, // 7: slash.api.v2.SubscriptionService.GetSubscription:output_type -> slash.api.v2.GetSubscriptionResponse
5, // 8: slash.api.v2.SubscriptionService.UpdateSubscription:output_type -> slash.api.v2.UpdateSubscriptionResponse
var file_api_v1_subscription_service_proto_depIdxs = []int32{
0, // 0: slash.api.v1.Subscription.plan:type_name -> slash.api.v1.PlanType
6, // 1: slash.api.v1.Subscription.started_time:type_name -> google.protobuf.Timestamp
6, // 2: slash.api.v1.Subscription.expires_time:type_name -> google.protobuf.Timestamp
1, // 3: slash.api.v1.GetSubscriptionResponse.subscription:type_name -> slash.api.v1.Subscription
1, // 4: slash.api.v1.UpdateSubscriptionResponse.subscription:type_name -> slash.api.v1.Subscription
2, // 5: slash.api.v1.SubscriptionService.GetSubscription:input_type -> slash.api.v1.GetSubscriptionRequest
4, // 6: slash.api.v1.SubscriptionService.UpdateSubscription:input_type -> slash.api.v1.UpdateSubscriptionRequest
3, // 7: slash.api.v1.SubscriptionService.GetSubscription:output_type -> slash.api.v1.GetSubscriptionResponse
5, // 8: slash.api.v1.SubscriptionService.UpdateSubscription:output_type -> slash.api.v1.UpdateSubscriptionResponse
7, // [7:9] is the sub-list for method output_type
5, // [5:7] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
@ -431,13 +431,13 @@ var file_api_v2_subscription_service_proto_depIdxs = []int32{
0, // [0:5] is the sub-list for field type_name
}
func init() { file_api_v2_subscription_service_proto_init() }
func file_api_v2_subscription_service_proto_init() {
if File_api_v2_subscription_service_proto != nil {
func init() { file_api_v1_subscription_service_proto_init() }
func file_api_v1_subscription_service_proto_init() {
if File_api_v1_subscription_service_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_api_v2_subscription_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_subscription_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Subscription); i {
case 0:
return &v.state
@ -449,7 +449,7 @@ func file_api_v2_subscription_service_proto_init() {
return nil
}
}
file_api_v2_subscription_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_subscription_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetSubscriptionRequest); i {
case 0:
return &v.state
@ -461,7 +461,7 @@ func file_api_v2_subscription_service_proto_init() {
return nil
}
}
file_api_v2_subscription_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_subscription_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetSubscriptionResponse); i {
case 0:
return &v.state
@ -473,7 +473,7 @@ func file_api_v2_subscription_service_proto_init() {
return nil
}
}
file_api_v2_subscription_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_subscription_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateSubscriptionRequest); i {
case 0:
return &v.state
@ -485,7 +485,7 @@ func file_api_v2_subscription_service_proto_init() {
return nil
}
}
file_api_v2_subscription_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_subscription_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateSubscriptionResponse); i {
case 0:
return &v.state
@ -502,19 +502,19 @@ func file_api_v2_subscription_service_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_v2_subscription_service_proto_rawDesc,
RawDescriptor: file_api_v1_subscription_service_proto_rawDesc,
NumEnums: 1,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_v2_subscription_service_proto_goTypes,
DependencyIndexes: file_api_v2_subscription_service_proto_depIdxs,
EnumInfos: file_api_v2_subscription_service_proto_enumTypes,
MessageInfos: file_api_v2_subscription_service_proto_msgTypes,
GoTypes: file_api_v1_subscription_service_proto_goTypes,
DependencyIndexes: file_api_v1_subscription_service_proto_depIdxs,
EnumInfos: file_api_v1_subscription_service_proto_enumTypes,
MessageInfos: file_api_v1_subscription_service_proto_msgTypes,
}.Build()
File_api_v2_subscription_service_proto = out.File
file_api_v2_subscription_service_proto_rawDesc = nil
file_api_v2_subscription_service_proto_goTypes = nil
file_api_v2_subscription_service_proto_depIdxs = nil
File_api_v1_subscription_service_proto = out.File
file_api_v1_subscription_service_proto_rawDesc = nil
file_api_v1_subscription_service_proto_goTypes = nil
file_api_v1_subscription_service_proto_depIdxs = nil
}

View File

@ -1,12 +1,12 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/subscription_service.proto
// source: api/v1/subscription_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 RegisterSubscriptionServiceHandlerServer(ctx context.Context, mux *runtime.
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.SubscriptionService/GetSubscription", runtime.WithHTTPPathPattern("/v1/subscription"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.SubscriptionService/GetSubscription", runtime.WithHTTPPathPattern("/v1/subscription"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -122,7 +122,7 @@ func RegisterSubscriptionServiceHandlerServer(ctx context.Context, mux *runtime.
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.SubscriptionService/UpdateSubscription", runtime.WithHTTPPathPattern("/v1/subscription"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.SubscriptionService/UpdateSubscription", runtime.WithHTTPPathPattern("/v1/subscription"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -186,7 +186,7 @@ func RegisterSubscriptionServiceHandlerClient(ctx context.Context, mux *runtime.
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.SubscriptionService/GetSubscription", runtime.WithHTTPPathPattern("/v1/subscription"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.SubscriptionService/GetSubscription", runtime.WithHTTPPathPattern("/v1/subscription"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -208,7 +208,7 @@ func RegisterSubscriptionServiceHandlerClient(ctx context.Context, mux *runtime.
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.SubscriptionService/UpdateSubscription", runtime.WithHTTPPathPattern("/v1/subscription"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.SubscriptionService/UpdateSubscription", runtime.WithHTTPPathPattern("/v1/subscription"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return

View File

@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/subscription_service.proto
// source: api/v1/subscription_service.proto
package apiv2
package apiv1
import (
context "context"
@ -19,8 +19,8 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
SubscriptionService_GetSubscription_FullMethodName = "/slash.api.v2.SubscriptionService/GetSubscription"
SubscriptionService_UpdateSubscription_FullMethodName = "/slash.api.v2.SubscriptionService/UpdateSubscription"
SubscriptionService_GetSubscription_FullMethodName = "/slash.api.v1.SubscriptionService/GetSubscription"
SubscriptionService_UpdateSubscription_FullMethodName = "/slash.api.v1.SubscriptionService/UpdateSubscription"
)
// SubscriptionServiceClient is the client API for SubscriptionService service.
@ -129,7 +129,7 @@ func _SubscriptionService_UpdateSubscription_Handler(srv interface{}, ctx contex
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SubscriptionService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "slash.api.v2.SubscriptionService",
ServiceName: "slash.api.v1.SubscriptionService",
HandlerType: (*SubscriptionServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
@ -142,5 +142,5 @@ var SubscriptionService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/subscription_service.proto",
Metadata: "api/v1/subscription_service.proto",
}

View File

@ -1,12 +1,12 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/user_service.proto
// source: api/v1/user_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"
@ -493,7 +493,7 @@ func RegisterUserServiceHandlerServer(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, "/slash.api.v2.UserService/ListUsers", runtime.WithHTTPPathPattern("/api/v2/users"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserService/ListUsers", runtime.WithHTTPPathPattern("/api/v1/users"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -518,7 +518,7 @@ func RegisterUserServiceHandlerServer(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, "/slash.api.v2.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v2/users/{id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v1/users/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -543,7 +543,7 @@ func RegisterUserServiceHandlerServer(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, "/slash.api.v2.UserService/CreateUser", runtime.WithHTTPPathPattern("/api/v2/users"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserService/CreateUser", runtime.WithHTTPPathPattern("/api/v1/users"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -568,7 +568,7 @@ func RegisterUserServiceHandlerServer(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, "/slash.api.v2.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v2/users/{user.id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v1/users/{user.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -593,7 +593,7 @@ func RegisterUserServiceHandlerServer(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, "/slash.api.v2.UserService/DeleteUser", runtime.WithHTTPPathPattern("/api/v2/users/{id}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserService/DeleteUser", runtime.WithHTTPPathPattern("/api/v1/users/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -618,7 +618,7 @@ func RegisterUserServiceHandlerServer(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, "/slash.api.v2.UserService/ListUserAccessTokens", runtime.WithHTTPPathPattern("/api/v2/users/{id}/access_tokens"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserService/ListUserAccessTokens", runtime.WithHTTPPathPattern("/api/v1/users/{id}/access_tokens"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -643,7 +643,7 @@ func RegisterUserServiceHandlerServer(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, "/slash.api.v2.UserService/CreateUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/users/{id}/access_tokens"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserService/CreateUserAccessToken", runtime.WithHTTPPathPattern("/api/v1/users/{id}/access_tokens"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -668,7 +668,7 @@ func RegisterUserServiceHandlerServer(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, "/slash.api.v2.UserService/DeleteUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/users/{id}/access_tokens/{access_token}"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserService/DeleteUserAccessToken", runtime.WithHTTPPathPattern("/api/v1/users/{id}/access_tokens/{access_token}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -732,7 +732,7 @@ func RegisterUserServiceHandlerClient(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, "/slash.api.v2.UserService/ListUsers", runtime.WithHTTPPathPattern("/api/v2/users"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserService/ListUsers", runtime.WithHTTPPathPattern("/api/v1/users"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -754,7 +754,7 @@ func RegisterUserServiceHandlerClient(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, "/slash.api.v2.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v2/users/{id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v1/users/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -776,7 +776,7 @@ func RegisterUserServiceHandlerClient(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, "/slash.api.v2.UserService/CreateUser", runtime.WithHTTPPathPattern("/api/v2/users"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserService/CreateUser", runtime.WithHTTPPathPattern("/api/v1/users"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -798,7 +798,7 @@ func RegisterUserServiceHandlerClient(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, "/slash.api.v2.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v2/users/{user.id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v1/users/{user.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -820,7 +820,7 @@ func RegisterUserServiceHandlerClient(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, "/slash.api.v2.UserService/DeleteUser", runtime.WithHTTPPathPattern("/api/v2/users/{id}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserService/DeleteUser", runtime.WithHTTPPathPattern("/api/v1/users/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -842,7 +842,7 @@ func RegisterUserServiceHandlerClient(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, "/slash.api.v2.UserService/ListUserAccessTokens", runtime.WithHTTPPathPattern("/api/v2/users/{id}/access_tokens"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserService/ListUserAccessTokens", runtime.WithHTTPPathPattern("/api/v1/users/{id}/access_tokens"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -864,7 +864,7 @@ func RegisterUserServiceHandlerClient(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, "/slash.api.v2.UserService/CreateUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/users/{id}/access_tokens"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserService/CreateUserAccessToken", runtime.WithHTTPPathPattern("/api/v1/users/{id}/access_tokens"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -886,7 +886,7 @@ func RegisterUserServiceHandlerClient(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, "/slash.api.v2.UserService/DeleteUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/users/{id}/access_tokens/{access_token}"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserService/DeleteUserAccessToken", runtime.WithHTTPPathPattern("/api/v1/users/{id}/access_tokens/{access_token}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -906,21 +906,21 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
}
var (
pattern_UserService_ListUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, ""))
pattern_UserService_ListUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "users"}, ""))
pattern_UserService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "users", "id"}, ""))
pattern_UserService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "users", "id"}, ""))
pattern_UserService_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, ""))
pattern_UserService_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "users"}, ""))
pattern_UserService_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "users", "user.id"}, ""))
pattern_UserService_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "users", "user.id"}, ""))
pattern_UserService_DeleteUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "users", "id"}, ""))
pattern_UserService_DeleteUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "users", "id"}, ""))
pattern_UserService_ListUserAccessTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "users", "id", "access_tokens"}, ""))
pattern_UserService_ListUserAccessTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "users", "id", "access_tokens"}, ""))
pattern_UserService_CreateUserAccessToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "users", "id", "access_tokens"}, ""))
pattern_UserService_CreateUserAccessToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "users", "id", "access_tokens"}, ""))
pattern_UserService_DeleteUserAccessToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v2", "users", "id", "access_tokens", "access_token"}, ""))
pattern_UserService_DeleteUserAccessToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v1", "users", "id", "access_tokens", "access_token"}, ""))
)
var (

View File

@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/user_service.proto
// source: api/v1/user_service.proto
package apiv2
package apiv1
import (
context "context"
@ -19,14 +19,14 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
UserService_ListUsers_FullMethodName = "/slash.api.v2.UserService/ListUsers"
UserService_GetUser_FullMethodName = "/slash.api.v2.UserService/GetUser"
UserService_CreateUser_FullMethodName = "/slash.api.v2.UserService/CreateUser"
UserService_UpdateUser_FullMethodName = "/slash.api.v2.UserService/UpdateUser"
UserService_DeleteUser_FullMethodName = "/slash.api.v2.UserService/DeleteUser"
UserService_ListUserAccessTokens_FullMethodName = "/slash.api.v2.UserService/ListUserAccessTokens"
UserService_CreateUserAccessToken_FullMethodName = "/slash.api.v2.UserService/CreateUserAccessToken"
UserService_DeleteUserAccessToken_FullMethodName = "/slash.api.v2.UserService/DeleteUserAccessToken"
UserService_ListUsers_FullMethodName = "/slash.api.v1.UserService/ListUsers"
UserService_GetUser_FullMethodName = "/slash.api.v1.UserService/GetUser"
UserService_CreateUser_FullMethodName = "/slash.api.v1.UserService/CreateUser"
UserService_UpdateUser_FullMethodName = "/slash.api.v1.UserService/UpdateUser"
UserService_DeleteUser_FullMethodName = "/slash.api.v1.UserService/DeleteUser"
UserService_ListUserAccessTokens_FullMethodName = "/slash.api.v1.UserService/ListUserAccessTokens"
UserService_CreateUserAccessToken_FullMethodName = "/slash.api.v1.UserService/CreateUserAccessToken"
UserService_DeleteUserAccessToken_FullMethodName = "/slash.api.v1.UserService/DeleteUserAccessToken"
)
// UserServiceClient is the client API for UserService service.
@ -341,7 +341,7 @@ func _UserService_DeleteUserAccessToken_Handler(srv interface{}, ctx context.Con
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "slash.api.v2.UserService",
ServiceName: "slash.api.v1.UserService",
HandlerType: (*UserServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
@ -378,5 +378,5 @@ var UserService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/user_service.proto",
Metadata: "api/v1/user_service.proto",
}

View File

@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: api/v2/user_setting_service.proto
// source: api/v1/user_setting_service.proto
package apiv2
package apiv1
import (
_ "google.golang.org/genproto/googleapis/api/annotations"
@ -55,11 +55,11 @@ func (x UserSetting_Locale) String() string {
}
func (UserSetting_Locale) Descriptor() protoreflect.EnumDescriptor {
return file_api_v2_user_setting_service_proto_enumTypes[0].Descriptor()
return file_api_v1_user_setting_service_proto_enumTypes[0].Descriptor()
}
func (UserSetting_Locale) Type() protoreflect.EnumType {
return &file_api_v2_user_setting_service_proto_enumTypes[0]
return &file_api_v1_user_setting_service_proto_enumTypes[0]
}
func (x UserSetting_Locale) Number() protoreflect.EnumNumber {
@ -68,7 +68,7 @@ func (x UserSetting_Locale) Number() protoreflect.EnumNumber {
// Deprecated: Use UserSetting_Locale.Descriptor instead.
func (UserSetting_Locale) EnumDescriptor() ([]byte, []int) {
return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{0, 0}
return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{0, 0}
}
type UserSetting_ColorTheme int32
@ -107,11 +107,11 @@ func (x UserSetting_ColorTheme) String() string {
}
func (UserSetting_ColorTheme) Descriptor() protoreflect.EnumDescriptor {
return file_api_v2_user_setting_service_proto_enumTypes[1].Descriptor()
return file_api_v1_user_setting_service_proto_enumTypes[1].Descriptor()
}
func (UserSetting_ColorTheme) Type() protoreflect.EnumType {
return &file_api_v2_user_setting_service_proto_enumTypes[1]
return &file_api_v1_user_setting_service_proto_enumTypes[1]
}
func (x UserSetting_ColorTheme) Number() protoreflect.EnumNumber {
@ -120,7 +120,7 @@ func (x UserSetting_ColorTheme) Number() protoreflect.EnumNumber {
// Deprecated: Use UserSetting_ColorTheme.Descriptor instead.
func (UserSetting_ColorTheme) EnumDescriptor() ([]byte, []int) {
return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{0, 1}
return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{0, 1}
}
type UserSetting struct {
@ -131,15 +131,15 @@ type UserSetting struct {
// id is the user id.
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// locale is the user locale.
Locale UserSetting_Locale `protobuf:"varint,2,opt,name=locale,proto3,enum=slash.api.v2.UserSetting_Locale" json:"locale,omitempty"`
Locale UserSetting_Locale `protobuf:"varint,2,opt,name=locale,proto3,enum=slash.api.v1.UserSetting_Locale" json:"locale,omitempty"`
// color_theme is the user color theme.
ColorTheme UserSetting_ColorTheme `protobuf:"varint,3,opt,name=color_theme,json=colorTheme,proto3,enum=slash.api.v2.UserSetting_ColorTheme" json:"color_theme,omitempty"`
ColorTheme UserSetting_ColorTheme `protobuf:"varint,3,opt,name=color_theme,json=colorTheme,proto3,enum=slash.api.v1.UserSetting_ColorTheme" json:"color_theme,omitempty"`
}
func (x *UserSetting) Reset() {
*x = UserSetting{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_user_setting_service_proto_msgTypes[0]
mi := &file_api_v1_user_setting_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -152,7 +152,7 @@ func (x *UserSetting) String() string {
func (*UserSetting) ProtoMessage() {}
func (x *UserSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_user_setting_service_proto_msgTypes[0]
mi := &file_api_v1_user_setting_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -165,7 +165,7 @@ func (x *UserSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserSetting.ProtoReflect.Descriptor instead.
func (*UserSetting) Descriptor() ([]byte, []int) {
return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{0}
return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{0}
}
func (x *UserSetting) GetId() int32 {
@ -201,7 +201,7 @@ type GetUserSettingRequest struct {
func (x *GetUserSettingRequest) Reset() {
*x = GetUserSettingRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_user_setting_service_proto_msgTypes[1]
mi := &file_api_v1_user_setting_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -214,7 +214,7 @@ func (x *GetUserSettingRequest) String() string {
func (*GetUserSettingRequest) ProtoMessage() {}
func (x *GetUserSettingRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_user_setting_service_proto_msgTypes[1]
mi := &file_api_v1_user_setting_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -227,7 +227,7 @@ func (x *GetUserSettingRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetUserSettingRequest.ProtoReflect.Descriptor instead.
func (*GetUserSettingRequest) Descriptor() ([]byte, []int) {
return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{1}
return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{1}
}
func (x *GetUserSettingRequest) GetId() int32 {
@ -248,7 +248,7 @@ type GetUserSettingResponse struct {
func (x *GetUserSettingResponse) Reset() {
*x = GetUserSettingResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_user_setting_service_proto_msgTypes[2]
mi := &file_api_v1_user_setting_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -261,7 +261,7 @@ func (x *GetUserSettingResponse) String() string {
func (*GetUserSettingResponse) ProtoMessage() {}
func (x *GetUserSettingResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_user_setting_service_proto_msgTypes[2]
mi := &file_api_v1_user_setting_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -274,7 +274,7 @@ func (x *GetUserSettingResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetUserSettingResponse.ProtoReflect.Descriptor instead.
func (*GetUserSettingResponse) Descriptor() ([]byte, []int) {
return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{2}
return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{2}
}
func (x *GetUserSettingResponse) GetUserSetting() *UserSetting {
@ -300,7 +300,7 @@ type UpdateUserSettingRequest struct {
func (x *UpdateUserSettingRequest) Reset() {
*x = UpdateUserSettingRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_user_setting_service_proto_msgTypes[3]
mi := &file_api_v1_user_setting_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -313,7 +313,7 @@ func (x *UpdateUserSettingRequest) String() string {
func (*UpdateUserSettingRequest) ProtoMessage() {}
func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_user_setting_service_proto_msgTypes[3]
mi := &file_api_v1_user_setting_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -326,7 +326,7 @@ func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateUserSettingRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserSettingRequest) Descriptor() ([]byte, []int) {
return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{3}
return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{3}
}
func (x *UpdateUserSettingRequest) GetId() int32 {
@ -361,7 +361,7 @@ type UpdateUserSettingResponse struct {
func (x *UpdateUserSettingResponse) Reset() {
*x = UpdateUserSettingResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_user_setting_service_proto_msgTypes[4]
mi := &file_api_v1_user_setting_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -374,7 +374,7 @@ func (x *UpdateUserSettingResponse) String() string {
func (*UpdateUserSettingResponse) ProtoMessage() {}
func (x *UpdateUserSettingResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_user_setting_service_proto_msgTypes[4]
mi := &file_api_v1_user_setting_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -387,7 +387,7 @@ func (x *UpdateUserSettingResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateUserSettingResponse.ProtoReflect.Descriptor instead.
func (*UpdateUserSettingResponse) Descriptor() ([]byte, []int) {
return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{4}
return file_api_v1_user_setting_service_proto_rawDescGZIP(), []int{4}
}
func (x *UpdateUserSettingResponse) GetUserSetting() *UserSetting {
@ -397,13 +397,13 @@ func (x *UpdateUserSettingResponse) GetUserSetting() *UserSetting {
return nil
}
var File_api_v2_user_setting_service_proto protoreflect.FileDescriptor
var File_api_v1_user_setting_service_proto protoreflect.FileDescriptor
var file_api_v2_user_setting_service_proto_rawDesc = []byte{
0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65,
var file_api_v1_user_setting_service_proto_rawDesc = []byte{
0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
@ -412,11 +412,11 @@ var file_api_v2_user_setting_service_proto_rawDesc = []byte{
0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x06, 0x6c, 0x6f,
0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x73, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x52, 0x06, 0x6c, 0x6f,
0x63, 0x61, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x74, 0x68,
0x65, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74,
0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x52,
0x0a, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3e, 0x0a, 0x06, 0x4c,
0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f,
@ -436,13 +436,13 @@ var file_api_v2_user_setting_service_proto_rawDesc = []byte{
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c,
0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52,
0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52,
0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xa5, 0x01, 0x0a,
0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65,
0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55,
0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72,
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
@ -452,79 +452,79 @@ var file_api_v2_user_setting_service_proto_rawDesc = []byte{
0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e,
0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32,
0xd1, 0x02, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x85, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73,
0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72,
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65,
0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65,
0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73,
0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73,
0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xb2,
0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74,
0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0xda, 0x41, 0x18, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61,
0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f,
0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x73, 0x42, 0xb5, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73,
0x6c, 0x61, 0x73, 0x68, 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, 0x53, 0x41,
0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32,
0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2,
0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47,
0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41,
0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31,
0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2,
0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47,
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61,
0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_api_v2_user_setting_service_proto_rawDescOnce sync.Once
file_api_v2_user_setting_service_proto_rawDescData = file_api_v2_user_setting_service_proto_rawDesc
file_api_v1_user_setting_service_proto_rawDescOnce sync.Once
file_api_v1_user_setting_service_proto_rawDescData = file_api_v1_user_setting_service_proto_rawDesc
)
func file_api_v2_user_setting_service_proto_rawDescGZIP() []byte {
file_api_v2_user_setting_service_proto_rawDescOnce.Do(func() {
file_api_v2_user_setting_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_user_setting_service_proto_rawDescData)
func file_api_v1_user_setting_service_proto_rawDescGZIP() []byte {
file_api_v1_user_setting_service_proto_rawDescOnce.Do(func() {
file_api_v1_user_setting_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_user_setting_service_proto_rawDescData)
})
return file_api_v2_user_setting_service_proto_rawDescData
return file_api_v1_user_setting_service_proto_rawDescData
}
var file_api_v2_user_setting_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_api_v2_user_setting_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_api_v2_user_setting_service_proto_goTypes = []interface{}{
(UserSetting_Locale)(0), // 0: slash.api.v2.UserSetting.Locale
(UserSetting_ColorTheme)(0), // 1: slash.api.v2.UserSetting.ColorTheme
(*UserSetting)(nil), // 2: slash.api.v2.UserSetting
(*GetUserSettingRequest)(nil), // 3: slash.api.v2.GetUserSettingRequest
(*GetUserSettingResponse)(nil), // 4: slash.api.v2.GetUserSettingResponse
(*UpdateUserSettingRequest)(nil), // 5: slash.api.v2.UpdateUserSettingRequest
(*UpdateUserSettingResponse)(nil), // 6: slash.api.v2.UpdateUserSettingResponse
var file_api_v1_user_setting_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_api_v1_user_setting_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_api_v1_user_setting_service_proto_goTypes = []interface{}{
(UserSetting_Locale)(0), // 0: slash.api.v1.UserSetting.Locale
(UserSetting_ColorTheme)(0), // 1: slash.api.v1.UserSetting.ColorTheme
(*UserSetting)(nil), // 2: slash.api.v1.UserSetting
(*GetUserSettingRequest)(nil), // 3: slash.api.v1.GetUserSettingRequest
(*GetUserSettingResponse)(nil), // 4: slash.api.v1.GetUserSettingResponse
(*UpdateUserSettingRequest)(nil), // 5: slash.api.v1.UpdateUserSettingRequest
(*UpdateUserSettingResponse)(nil), // 6: slash.api.v1.UpdateUserSettingResponse
(*fieldmaskpb.FieldMask)(nil), // 7: google.protobuf.FieldMask
}
var file_api_v2_user_setting_service_proto_depIdxs = []int32{
0, // 0: slash.api.v2.UserSetting.locale:type_name -> slash.api.v2.UserSetting.Locale
1, // 1: slash.api.v2.UserSetting.color_theme:type_name -> slash.api.v2.UserSetting.ColorTheme
2, // 2: slash.api.v2.GetUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting
2, // 3: slash.api.v2.UpdateUserSettingRequest.user_setting:type_name -> slash.api.v2.UserSetting
7, // 4: slash.api.v2.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
2, // 5: slash.api.v2.UpdateUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting
3, // 6: slash.api.v2.UserSettingService.GetUserSetting:input_type -> slash.api.v2.GetUserSettingRequest
5, // 7: slash.api.v2.UserSettingService.UpdateUserSetting:input_type -> slash.api.v2.UpdateUserSettingRequest
4, // 8: slash.api.v2.UserSettingService.GetUserSetting:output_type -> slash.api.v2.GetUserSettingResponse
6, // 9: slash.api.v2.UserSettingService.UpdateUserSetting:output_type -> slash.api.v2.UpdateUserSettingResponse
var file_api_v1_user_setting_service_proto_depIdxs = []int32{
0, // 0: slash.api.v1.UserSetting.locale:type_name -> slash.api.v1.UserSetting.Locale
1, // 1: slash.api.v1.UserSetting.color_theme:type_name -> slash.api.v1.UserSetting.ColorTheme
2, // 2: slash.api.v1.GetUserSettingResponse.user_setting:type_name -> slash.api.v1.UserSetting
2, // 3: slash.api.v1.UpdateUserSettingRequest.user_setting:type_name -> slash.api.v1.UserSetting
7, // 4: slash.api.v1.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
2, // 5: slash.api.v1.UpdateUserSettingResponse.user_setting:type_name -> slash.api.v1.UserSetting
3, // 6: slash.api.v1.UserSettingService.GetUserSetting:input_type -> slash.api.v1.GetUserSettingRequest
5, // 7: slash.api.v1.UserSettingService.UpdateUserSetting:input_type -> slash.api.v1.UpdateUserSettingRequest
4, // 8: slash.api.v1.UserSettingService.GetUserSetting:output_type -> slash.api.v1.GetUserSettingResponse
6, // 9: slash.api.v1.UserSettingService.UpdateUserSetting:output_type -> slash.api.v1.UpdateUserSettingResponse
8, // [8:10] is the sub-list for method output_type
6, // [6:8] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
@ -532,13 +532,13 @@ var file_api_v2_user_setting_service_proto_depIdxs = []int32{
0, // [0:6] is the sub-list for field type_name
}
func init() { file_api_v2_user_setting_service_proto_init() }
func file_api_v2_user_setting_service_proto_init() {
if File_api_v2_user_setting_service_proto != nil {
func init() { file_api_v1_user_setting_service_proto_init() }
func file_api_v1_user_setting_service_proto_init() {
if File_api_v1_user_setting_service_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_api_v2_user_setting_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_user_setting_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserSetting); i {
case 0:
return &v.state
@ -550,7 +550,7 @@ func file_api_v2_user_setting_service_proto_init() {
return nil
}
}
file_api_v2_user_setting_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_user_setting_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetUserSettingRequest); i {
case 0:
return &v.state
@ -562,7 +562,7 @@ func file_api_v2_user_setting_service_proto_init() {
return nil
}
}
file_api_v2_user_setting_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_user_setting_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetUserSettingResponse); i {
case 0:
return &v.state
@ -574,7 +574,7 @@ func file_api_v2_user_setting_service_proto_init() {
return nil
}
}
file_api_v2_user_setting_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_user_setting_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateUserSettingRequest); i {
case 0:
return &v.state
@ -586,7 +586,7 @@ func file_api_v2_user_setting_service_proto_init() {
return nil
}
}
file_api_v2_user_setting_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_user_setting_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateUserSettingResponse); i {
case 0:
return &v.state
@ -603,19 +603,19 @@ func file_api_v2_user_setting_service_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_v2_user_setting_service_proto_rawDesc,
RawDescriptor: file_api_v1_user_setting_service_proto_rawDesc,
NumEnums: 2,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_v2_user_setting_service_proto_goTypes,
DependencyIndexes: file_api_v2_user_setting_service_proto_depIdxs,
EnumInfos: file_api_v2_user_setting_service_proto_enumTypes,
MessageInfos: file_api_v2_user_setting_service_proto_msgTypes,
GoTypes: file_api_v1_user_setting_service_proto_goTypes,
DependencyIndexes: file_api_v1_user_setting_service_proto_depIdxs,
EnumInfos: file_api_v1_user_setting_service_proto_enumTypes,
MessageInfos: file_api_v1_user_setting_service_proto_msgTypes,
}.Build()
File_api_v2_user_setting_service_proto = out.File
file_api_v2_user_setting_service_proto_rawDesc = nil
file_api_v2_user_setting_service_proto_goTypes = nil
file_api_v2_user_setting_service_proto_depIdxs = nil
File_api_v1_user_setting_service_proto = out.File
file_api_v1_user_setting_service_proto_rawDesc = nil
file_api_v1_user_setting_service_proto_goTypes = nil
file_api_v1_user_setting_service_proto_depIdxs = nil
}

View File

@ -1,12 +1,12 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/user_setting_service.proto
// source: api/v1/user_setting_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"
@ -197,7 +197,7 @@ func RegisterUserSettingServiceHandlerServer(ctx context.Context, mux *runtime.S
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.UserSettingService/GetUserSetting", runtime.WithHTTPPathPattern("/api/v2/users/{id}/settings"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserSettingService/GetUserSetting", runtime.WithHTTPPathPattern("/api/v1/users/{id}/settings"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -222,7 +222,7 @@ func RegisterUserSettingServiceHandlerServer(ctx context.Context, mux *runtime.S
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.UserSettingService/UpdateUserSetting", runtime.WithHTTPPathPattern("/api/v2/users/{id}/settings"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.UserSettingService/UpdateUserSetting", runtime.WithHTTPPathPattern("/api/v1/users/{id}/settings"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -286,7 +286,7 @@ func RegisterUserSettingServiceHandlerClient(ctx context.Context, mux *runtime.S
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.UserSettingService/GetUserSetting", runtime.WithHTTPPathPattern("/api/v2/users/{id}/settings"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserSettingService/GetUserSetting", runtime.WithHTTPPathPattern("/api/v1/users/{id}/settings"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -308,7 +308,7 @@ func RegisterUserSettingServiceHandlerClient(ctx context.Context, mux *runtime.S
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.UserSettingService/UpdateUserSetting", runtime.WithHTTPPathPattern("/api/v2/users/{id}/settings"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.UserSettingService/UpdateUserSetting", runtime.WithHTTPPathPattern("/api/v1/users/{id}/settings"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -328,9 +328,9 @@ func RegisterUserSettingServiceHandlerClient(ctx context.Context, mux *runtime.S
}
var (
pattern_UserSettingService_GetUserSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "users", "id", "settings"}, ""))
pattern_UserSettingService_GetUserSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "users", "id", "settings"}, ""))
pattern_UserSettingService_UpdateUserSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "users", "id", "settings"}, ""))
pattern_UserSettingService_UpdateUserSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "users", "id", "settings"}, ""))
)
var (

View File

@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/user_setting_service.proto
// source: api/v1/user_setting_service.proto
package apiv2
package apiv1
import (
context "context"
@ -19,8 +19,8 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
UserSettingService_GetUserSetting_FullMethodName = "/slash.api.v2.UserSettingService/GetUserSetting"
UserSettingService_UpdateUserSetting_FullMethodName = "/slash.api.v2.UserSettingService/UpdateUserSetting"
UserSettingService_GetUserSetting_FullMethodName = "/slash.api.v1.UserSettingService/GetUserSetting"
UserSettingService_UpdateUserSetting_FullMethodName = "/slash.api.v1.UserSettingService/UpdateUserSetting"
)
// UserSettingServiceClient is the client API for UserSettingService service.
@ -133,7 +133,7 @@ func _UserSettingService_UpdateUserSetting_Handler(srv interface{}, ctx context.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserSettingService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "slash.api.v2.UserSettingService",
ServiceName: "slash.api.v1.UserSettingService",
HandlerType: (*UserSettingServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
@ -146,5 +146,5 @@ var UserSettingService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/user_setting_service.proto",
Metadata: "api/v1/user_setting_service.proto",
}

View File

@ -2,9 +2,9 @@
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: api/v2/workspace_service.proto
// source: api/v1/workspace_service.proto
package apiv2
package apiv1
import (
_ "google.golang.org/genproto/googleapis/api/annotations"
@ -32,7 +32,7 @@ type WorkspaceProfile struct {
// Current workspace version.
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
// The workspace plan.
Plan PlanType `protobuf:"varint,3,opt,name=plan,proto3,enum=slash.api.v2.PlanType" json:"plan,omitempty"`
Plan PlanType `protobuf:"varint,3,opt,name=plan,proto3,enum=slash.api.v1.PlanType" json:"plan,omitempty"`
// Whether to enable other users to sign up.
EnableSignup bool `protobuf:"varint,4,opt,name=enable_signup,json=enableSignup,proto3" json:"enable_signup,omitempty"`
// The custom style.
@ -44,7 +44,7 @@ type WorkspaceProfile struct {
func (x *WorkspaceProfile) Reset() {
*x = WorkspaceProfile{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_workspace_service_proto_msgTypes[0]
mi := &file_api_v1_workspace_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -57,7 +57,7 @@ func (x *WorkspaceProfile) String() string {
func (*WorkspaceProfile) ProtoMessage() {}
func (x *WorkspaceProfile) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_workspace_service_proto_msgTypes[0]
mi := &file_api_v1_workspace_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -70,7 +70,7 @@ func (x *WorkspaceProfile) ProtoReflect() protoreflect.Message {
// Deprecated: Use WorkspaceProfile.ProtoReflect.Descriptor instead.
func (*WorkspaceProfile) Descriptor() ([]byte, []int) {
return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{0}
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{0}
}
func (x *WorkspaceProfile) GetMode() string {
@ -136,7 +136,7 @@ type WorkspaceSetting struct {
func (x *WorkspaceSetting) Reset() {
*x = WorkspaceSetting{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_workspace_service_proto_msgTypes[1]
mi := &file_api_v1_workspace_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -149,7 +149,7 @@ func (x *WorkspaceSetting) String() string {
func (*WorkspaceSetting) ProtoMessage() {}
func (x *WorkspaceSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_workspace_service_proto_msgTypes[1]
mi := &file_api_v1_workspace_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -162,7 +162,7 @@ func (x *WorkspaceSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use WorkspaceSetting.ProtoReflect.Descriptor instead.
func (*WorkspaceSetting) Descriptor() ([]byte, []int) {
return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{1}
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{1}
}
func (x *WorkspaceSetting) GetLicenseKey() string {
@ -225,7 +225,7 @@ type AutoBackupWorkspaceSetting struct {
func (x *AutoBackupWorkspaceSetting) Reset() {
*x = AutoBackupWorkspaceSetting{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_workspace_service_proto_msgTypes[2]
mi := &file_api_v1_workspace_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -238,7 +238,7 @@ func (x *AutoBackupWorkspaceSetting) String() string {
func (*AutoBackupWorkspaceSetting) ProtoMessage() {}
func (x *AutoBackupWorkspaceSetting) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_workspace_service_proto_msgTypes[2]
mi := &file_api_v1_workspace_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -251,7 +251,7 @@ func (x *AutoBackupWorkspaceSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use AutoBackupWorkspaceSetting.ProtoReflect.Descriptor instead.
func (*AutoBackupWorkspaceSetting) Descriptor() ([]byte, []int) {
return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{2}
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{2}
}
func (x *AutoBackupWorkspaceSetting) GetEnabled() bool {
@ -284,7 +284,7 @@ type GetWorkspaceProfileRequest struct {
func (x *GetWorkspaceProfileRequest) Reset() {
*x = GetWorkspaceProfileRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_workspace_service_proto_msgTypes[3]
mi := &file_api_v1_workspace_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -297,7 +297,7 @@ func (x *GetWorkspaceProfileRequest) String() string {
func (*GetWorkspaceProfileRequest) ProtoMessage() {}
func (x *GetWorkspaceProfileRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_workspace_service_proto_msgTypes[3]
mi := &file_api_v1_workspace_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -310,7 +310,7 @@ func (x *GetWorkspaceProfileRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetWorkspaceProfileRequest.ProtoReflect.Descriptor instead.
func (*GetWorkspaceProfileRequest) Descriptor() ([]byte, []int) {
return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{3}
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{3}
}
type GetWorkspaceProfileResponse struct {
@ -325,7 +325,7 @@ type GetWorkspaceProfileResponse struct {
func (x *GetWorkspaceProfileResponse) Reset() {
*x = GetWorkspaceProfileResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_workspace_service_proto_msgTypes[4]
mi := &file_api_v1_workspace_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -338,7 +338,7 @@ func (x *GetWorkspaceProfileResponse) String() string {
func (*GetWorkspaceProfileResponse) ProtoMessage() {}
func (x *GetWorkspaceProfileResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_workspace_service_proto_msgTypes[4]
mi := &file_api_v1_workspace_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -351,7 +351,7 @@ func (x *GetWorkspaceProfileResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetWorkspaceProfileResponse.ProtoReflect.Descriptor instead.
func (*GetWorkspaceProfileResponse) Descriptor() ([]byte, []int) {
return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{4}
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{4}
}
func (x *GetWorkspaceProfileResponse) GetProfile() *WorkspaceProfile {
@ -370,7 +370,7 @@ type GetWorkspaceSettingRequest struct {
func (x *GetWorkspaceSettingRequest) Reset() {
*x = GetWorkspaceSettingRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_workspace_service_proto_msgTypes[5]
mi := &file_api_v1_workspace_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -383,7 +383,7 @@ func (x *GetWorkspaceSettingRequest) String() string {
func (*GetWorkspaceSettingRequest) ProtoMessage() {}
func (x *GetWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_workspace_service_proto_msgTypes[5]
mi := &file_api_v1_workspace_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -396,7 +396,7 @@ func (x *GetWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetWorkspaceSettingRequest.ProtoReflect.Descriptor instead.
func (*GetWorkspaceSettingRequest) Descriptor() ([]byte, []int) {
return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{5}
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{5}
}
type GetWorkspaceSettingResponse struct {
@ -411,7 +411,7 @@ type GetWorkspaceSettingResponse struct {
func (x *GetWorkspaceSettingResponse) Reset() {
*x = GetWorkspaceSettingResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_workspace_service_proto_msgTypes[6]
mi := &file_api_v1_workspace_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -424,7 +424,7 @@ func (x *GetWorkspaceSettingResponse) String() string {
func (*GetWorkspaceSettingResponse) ProtoMessage() {}
func (x *GetWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_workspace_service_proto_msgTypes[6]
mi := &file_api_v1_workspace_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -437,7 +437,7 @@ func (x *GetWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetWorkspaceSettingResponse.ProtoReflect.Descriptor instead.
func (*GetWorkspaceSettingResponse) Descriptor() ([]byte, []int) {
return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{6}
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{6}
}
func (x *GetWorkspaceSettingResponse) GetSetting() *WorkspaceSetting {
@ -461,7 +461,7 @@ type UpdateWorkspaceSettingRequest struct {
func (x *UpdateWorkspaceSettingRequest) Reset() {
*x = UpdateWorkspaceSettingRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_workspace_service_proto_msgTypes[7]
mi := &file_api_v1_workspace_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -474,7 +474,7 @@ func (x *UpdateWorkspaceSettingRequest) String() string {
func (*UpdateWorkspaceSettingRequest) ProtoMessage() {}
func (x *UpdateWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_workspace_service_proto_msgTypes[7]
mi := &file_api_v1_workspace_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -487,7 +487,7 @@ func (x *UpdateWorkspaceSettingRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateWorkspaceSettingRequest.ProtoReflect.Descriptor instead.
func (*UpdateWorkspaceSettingRequest) Descriptor() ([]byte, []int) {
return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{7}
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{7}
}
func (x *UpdateWorkspaceSettingRequest) GetSetting() *WorkspaceSetting {
@ -516,7 +516,7 @@ type UpdateWorkspaceSettingResponse struct {
func (x *UpdateWorkspaceSettingResponse) Reset() {
*x = UpdateWorkspaceSettingResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_api_v2_workspace_service_proto_msgTypes[8]
mi := &file_api_v1_workspace_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -529,7 +529,7 @@ func (x *UpdateWorkspaceSettingResponse) String() string {
func (*UpdateWorkspaceSettingResponse) ProtoMessage() {}
func (x *UpdateWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_workspace_service_proto_msgTypes[8]
mi := &file_api_v1_workspace_service_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -542,7 +542,7 @@ func (x *UpdateWorkspaceSettingResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateWorkspaceSettingResponse.ProtoReflect.Descriptor instead.
func (*UpdateWorkspaceSettingResponse) Descriptor() ([]byte, []int) {
return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{8}
return file_api_v1_workspace_service_proto_rawDescGZIP(), []int{8}
}
func (x *UpdateWorkspaceSettingResponse) GetSetting() *WorkspaceSetting {
@ -552,13 +552,13 @@ func (x *UpdateWorkspaceSettingResponse) GetSetting() *WorkspaceSetting {
return nil
}
var File_api_v2_workspace_service_proto protoreflect.FileDescriptor
var File_api_v1_workspace_service_proto protoreflect.FileDescriptor
var file_api_v2_workspace_service_proto_rawDesc = []byte{
0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
var file_api_v1_workspace_service_proto_rawDesc = []byte{
0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x0c, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x21,
0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x12, 0x0c, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x21,
0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
@ -571,7 +571,7 @@ var file_api_v2_workspace_service_proto_rawDesc = []byte{
0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a,
0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x73, 0x6c,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x54,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x54,
0x79, 0x70, 0x65, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08,
0x52, 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x21,
@ -593,7 +593,7 @@ var file_api_v2_workspace_service_proto_rawDesc = []byte{
0x6d, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x49, 0x0a, 0x0b,
0x61, 0x75, 0x74, 0x6f, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x28, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
0x0b, 0x32, 0x28, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31,
0x2e, 0x41, 0x75, 0x74, 0x6f, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73,
0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x61, 0x75, 0x74,
0x6f, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x22, 0x7a, 0x0a, 0x1a, 0x41, 0x75, 0x74, 0x6f, 0x42,
@ -609,7 +609,7 @@ var file_api_v2_workspace_service_proto_rawDesc = []byte{
0x74, 0x22, 0x57, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x38, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31,
0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c,
0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x47, 0x65,
0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
@ -617,13 +617,13 @@ var file_api_v2_workspace_service_proto_rawDesc = []byte{
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e,
0x67, 0x22, 0x96, 0x01, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b,
0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74,
0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74,
0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3b, 0x0a,
0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
@ -632,94 +632,94 @@ var file_api_v2_workspace_service_proto_rawDesc = []byte{
0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74,
0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x07,
0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x6f, 0x72,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72,
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0xea, 0x03, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73,
0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x13,
0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66,
0x69, 0x6c, 0x65, 0x12, 0x28, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50,
0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50,
0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b,
0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x13,
0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74,
0x69, 0x6e, 0x67, 0x12, 0x28, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53,
0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74,
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b,
0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0xb5, 0x01, 0x0a, 0x16,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b,
0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b,
0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x40, 0xda, 0x41, 0x13, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2c, 0x75, 0x70,
0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a,
0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x32, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x74, 0x74,
0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x74, 0x74,
0x69, 0x6e, 0x67, 0x42, 0xb3, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f,
0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61,
0x73, 0x68, 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, 0x53, 0x41, 0x58, 0xaa,
0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02,
0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18,
0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42,
0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa,
0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02,
0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18,
0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68,
0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_api_v2_workspace_service_proto_rawDescOnce sync.Once
file_api_v2_workspace_service_proto_rawDescData = file_api_v2_workspace_service_proto_rawDesc
file_api_v1_workspace_service_proto_rawDescOnce sync.Once
file_api_v1_workspace_service_proto_rawDescData = file_api_v1_workspace_service_proto_rawDesc
)
func file_api_v2_workspace_service_proto_rawDescGZIP() []byte {
file_api_v2_workspace_service_proto_rawDescOnce.Do(func() {
file_api_v2_workspace_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_workspace_service_proto_rawDescData)
func file_api_v1_workspace_service_proto_rawDescGZIP() []byte {
file_api_v1_workspace_service_proto_rawDescOnce.Do(func() {
file_api_v1_workspace_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_workspace_service_proto_rawDescData)
})
return file_api_v2_workspace_service_proto_rawDescData
return file_api_v1_workspace_service_proto_rawDescData
}
var file_api_v2_workspace_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_api_v2_workspace_service_proto_goTypes = []interface{}{
(*WorkspaceProfile)(nil), // 0: slash.api.v2.WorkspaceProfile
(*WorkspaceSetting)(nil), // 1: slash.api.v2.WorkspaceSetting
(*AutoBackupWorkspaceSetting)(nil), // 2: slash.api.v2.AutoBackupWorkspaceSetting
(*GetWorkspaceProfileRequest)(nil), // 3: slash.api.v2.GetWorkspaceProfileRequest
(*GetWorkspaceProfileResponse)(nil), // 4: slash.api.v2.GetWorkspaceProfileResponse
(*GetWorkspaceSettingRequest)(nil), // 5: slash.api.v2.GetWorkspaceSettingRequest
(*GetWorkspaceSettingResponse)(nil), // 6: slash.api.v2.GetWorkspaceSettingResponse
(*UpdateWorkspaceSettingRequest)(nil), // 7: slash.api.v2.UpdateWorkspaceSettingRequest
(*UpdateWorkspaceSettingResponse)(nil), // 8: slash.api.v2.UpdateWorkspaceSettingResponse
(PlanType)(0), // 9: slash.api.v2.PlanType
var file_api_v1_workspace_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_api_v1_workspace_service_proto_goTypes = []interface{}{
(*WorkspaceProfile)(nil), // 0: slash.api.v1.WorkspaceProfile
(*WorkspaceSetting)(nil), // 1: slash.api.v1.WorkspaceSetting
(*AutoBackupWorkspaceSetting)(nil), // 2: slash.api.v1.AutoBackupWorkspaceSetting
(*GetWorkspaceProfileRequest)(nil), // 3: slash.api.v1.GetWorkspaceProfileRequest
(*GetWorkspaceProfileResponse)(nil), // 4: slash.api.v1.GetWorkspaceProfileResponse
(*GetWorkspaceSettingRequest)(nil), // 5: slash.api.v1.GetWorkspaceSettingRequest
(*GetWorkspaceSettingResponse)(nil), // 6: slash.api.v1.GetWorkspaceSettingResponse
(*UpdateWorkspaceSettingRequest)(nil), // 7: slash.api.v1.UpdateWorkspaceSettingRequest
(*UpdateWorkspaceSettingResponse)(nil), // 8: slash.api.v1.UpdateWorkspaceSettingResponse
(PlanType)(0), // 9: slash.api.v1.PlanType
(*fieldmaskpb.FieldMask)(nil), // 10: google.protobuf.FieldMask
}
var file_api_v2_workspace_service_proto_depIdxs = []int32{
9, // 0: slash.api.v2.WorkspaceProfile.plan:type_name -> slash.api.v2.PlanType
2, // 1: slash.api.v2.WorkspaceSetting.auto_backup:type_name -> slash.api.v2.AutoBackupWorkspaceSetting
0, // 2: slash.api.v2.GetWorkspaceProfileResponse.profile:type_name -> slash.api.v2.WorkspaceProfile
1, // 3: slash.api.v2.GetWorkspaceSettingResponse.setting:type_name -> slash.api.v2.WorkspaceSetting
1, // 4: slash.api.v2.UpdateWorkspaceSettingRequest.setting:type_name -> slash.api.v2.WorkspaceSetting
10, // 5: slash.api.v2.UpdateWorkspaceSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
1, // 6: slash.api.v2.UpdateWorkspaceSettingResponse.setting:type_name -> slash.api.v2.WorkspaceSetting
3, // 7: slash.api.v2.WorkspaceService.GetWorkspaceProfile:input_type -> slash.api.v2.GetWorkspaceProfileRequest
5, // 8: slash.api.v2.WorkspaceService.GetWorkspaceSetting:input_type -> slash.api.v2.GetWorkspaceSettingRequest
7, // 9: slash.api.v2.WorkspaceService.UpdateWorkspaceSetting:input_type -> slash.api.v2.UpdateWorkspaceSettingRequest
4, // 10: slash.api.v2.WorkspaceService.GetWorkspaceProfile:output_type -> slash.api.v2.GetWorkspaceProfileResponse
6, // 11: slash.api.v2.WorkspaceService.GetWorkspaceSetting:output_type -> slash.api.v2.GetWorkspaceSettingResponse
8, // 12: slash.api.v2.WorkspaceService.UpdateWorkspaceSetting:output_type -> slash.api.v2.UpdateWorkspaceSettingResponse
var file_api_v1_workspace_service_proto_depIdxs = []int32{
9, // 0: slash.api.v1.WorkspaceProfile.plan:type_name -> slash.api.v1.PlanType
2, // 1: slash.api.v1.WorkspaceSetting.auto_backup:type_name -> slash.api.v1.AutoBackupWorkspaceSetting
0, // 2: slash.api.v1.GetWorkspaceProfileResponse.profile:type_name -> slash.api.v1.WorkspaceProfile
1, // 3: slash.api.v1.GetWorkspaceSettingResponse.setting:type_name -> slash.api.v1.WorkspaceSetting
1, // 4: slash.api.v1.UpdateWorkspaceSettingRequest.setting:type_name -> slash.api.v1.WorkspaceSetting
10, // 5: slash.api.v1.UpdateWorkspaceSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
1, // 6: slash.api.v1.UpdateWorkspaceSettingResponse.setting:type_name -> slash.api.v1.WorkspaceSetting
3, // 7: slash.api.v1.WorkspaceService.GetWorkspaceProfile:input_type -> slash.api.v1.GetWorkspaceProfileRequest
5, // 8: slash.api.v1.WorkspaceService.GetWorkspaceSetting:input_type -> slash.api.v1.GetWorkspaceSettingRequest
7, // 9: slash.api.v1.WorkspaceService.UpdateWorkspaceSetting:input_type -> slash.api.v1.UpdateWorkspaceSettingRequest
4, // 10: slash.api.v1.WorkspaceService.GetWorkspaceProfile:output_type -> slash.api.v1.GetWorkspaceProfileResponse
6, // 11: slash.api.v1.WorkspaceService.GetWorkspaceSetting:output_type -> slash.api.v1.GetWorkspaceSettingResponse
8, // 12: slash.api.v1.WorkspaceService.UpdateWorkspaceSetting:output_type -> slash.api.v1.UpdateWorkspaceSettingResponse
10, // [10:13] is the sub-list for method output_type
7, // [7:10] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
@ -727,14 +727,14 @@ var file_api_v2_workspace_service_proto_depIdxs = []int32{
0, // [0:7] is the sub-list for field type_name
}
func init() { file_api_v2_workspace_service_proto_init() }
func file_api_v2_workspace_service_proto_init() {
if File_api_v2_workspace_service_proto != nil {
func init() { file_api_v1_workspace_service_proto_init() }
func file_api_v1_workspace_service_proto_init() {
if File_api_v1_workspace_service_proto != nil {
return
}
file_api_v2_subscription_service_proto_init()
file_api_v1_subscription_service_proto_init()
if !protoimpl.UnsafeEnabled {
file_api_v2_workspace_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_workspace_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorkspaceProfile); i {
case 0:
return &v.state
@ -746,7 +746,7 @@ func file_api_v2_workspace_service_proto_init() {
return nil
}
}
file_api_v2_workspace_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_workspace_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorkspaceSetting); i {
case 0:
return &v.state
@ -758,7 +758,7 @@ func file_api_v2_workspace_service_proto_init() {
return nil
}
}
file_api_v2_workspace_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_workspace_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AutoBackupWorkspaceSetting); i {
case 0:
return &v.state
@ -770,7 +770,7 @@ func file_api_v2_workspace_service_proto_init() {
return nil
}
}
file_api_v2_workspace_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_workspace_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetWorkspaceProfileRequest); i {
case 0:
return &v.state
@ -782,7 +782,7 @@ func file_api_v2_workspace_service_proto_init() {
return nil
}
}
file_api_v2_workspace_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_workspace_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetWorkspaceProfileResponse); i {
case 0:
return &v.state
@ -794,7 +794,7 @@ func file_api_v2_workspace_service_proto_init() {
return nil
}
}
file_api_v2_workspace_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_workspace_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetWorkspaceSettingRequest); i {
case 0:
return &v.state
@ -806,7 +806,7 @@ func file_api_v2_workspace_service_proto_init() {
return nil
}
}
file_api_v2_workspace_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_workspace_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetWorkspaceSettingResponse); i {
case 0:
return &v.state
@ -818,7 +818,7 @@ func file_api_v2_workspace_service_proto_init() {
return nil
}
}
file_api_v2_workspace_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_workspace_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateWorkspaceSettingRequest); i {
case 0:
return &v.state
@ -830,7 +830,7 @@ func file_api_v2_workspace_service_proto_init() {
return nil
}
}
file_api_v2_workspace_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_api_v1_workspace_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateWorkspaceSettingResponse); i {
case 0:
return &v.state
@ -847,18 +847,18 @@ func file_api_v2_workspace_service_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_v2_workspace_service_proto_rawDesc,
RawDescriptor: file_api_v1_workspace_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 9,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_v2_workspace_service_proto_goTypes,
DependencyIndexes: file_api_v2_workspace_service_proto_depIdxs,
MessageInfos: file_api_v2_workspace_service_proto_msgTypes,
GoTypes: file_api_v1_workspace_service_proto_goTypes,
DependencyIndexes: file_api_v1_workspace_service_proto_depIdxs,
MessageInfos: file_api_v1_workspace_service_proto_msgTypes,
}.Build()
File_api_v2_workspace_service_proto = out.File
file_api_v2_workspace_service_proto_rawDesc = nil
file_api_v2_workspace_service_proto_goTypes = nil
file_api_v2_workspace_service_proto_depIdxs = nil
File_api_v1_workspace_service_proto = out.File
file_api_v1_workspace_service_proto_rawDesc = nil
file_api_v1_workspace_service_proto_goTypes = nil
file_api_v1_workspace_service_proto_depIdxs = nil
}

View File

@ -1,12 +1,12 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: api/v2/workspace_service.proto
// source: api/v1/workspace_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"
@ -147,7 +147,7 @@ func RegisterWorkspaceServiceHandlerServer(ctx context.Context, mux *runtime.Ser
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.WorkspaceService/GetWorkspaceProfile", runtime.WithHTTPPathPattern("/api/v2/workspace/profile"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.WorkspaceService/GetWorkspaceProfile", runtime.WithHTTPPathPattern("/api/v1/workspace/profile"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -172,7 +172,7 @@ func RegisterWorkspaceServiceHandlerServer(ctx context.Context, mux *runtime.Ser
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.WorkspaceService/GetWorkspaceSetting", runtime.WithHTTPPathPattern("/api/v2/workspace/setting"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.WorkspaceService/GetWorkspaceSetting", runtime.WithHTTPPathPattern("/api/v1/workspace/setting"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -197,7 +197,7 @@ func RegisterWorkspaceServiceHandlerServer(ctx context.Context, mux *runtime.Ser
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.WorkspaceService/UpdateWorkspaceSetting", runtime.WithHTTPPathPattern("/api/v2/workspace/setting"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v1.WorkspaceService/UpdateWorkspaceSetting", runtime.WithHTTPPathPattern("/api/v1/workspace/setting"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -261,7 +261,7 @@ func RegisterWorkspaceServiceHandlerClient(ctx context.Context, mux *runtime.Ser
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.WorkspaceService/GetWorkspaceProfile", runtime.WithHTTPPathPattern("/api/v2/workspace/profile"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.WorkspaceService/GetWorkspaceProfile", runtime.WithHTTPPathPattern("/api/v1/workspace/profile"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -283,7 +283,7 @@ func RegisterWorkspaceServiceHandlerClient(ctx context.Context, mux *runtime.Ser
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.WorkspaceService/GetWorkspaceSetting", runtime.WithHTTPPathPattern("/api/v2/workspace/setting"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.WorkspaceService/GetWorkspaceSetting", runtime.WithHTTPPathPattern("/api/v1/workspace/setting"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -305,7 +305,7 @@ func RegisterWorkspaceServiceHandlerClient(ctx context.Context, mux *runtime.Ser
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.WorkspaceService/UpdateWorkspaceSetting", runtime.WithHTTPPathPattern("/api/v2/workspace/setting"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v1.WorkspaceService/UpdateWorkspaceSetting", runtime.WithHTTPPathPattern("/api/v1/workspace/setting"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@ -325,11 +325,11 @@ func RegisterWorkspaceServiceHandlerClient(ctx context.Context, mux *runtime.Ser
}
var (
pattern_WorkspaceService_GetWorkspaceProfile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "workspace", "profile"}, ""))
pattern_WorkspaceService_GetWorkspaceProfile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "workspace", "profile"}, ""))
pattern_WorkspaceService_GetWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "workspace", "setting"}, ""))
pattern_WorkspaceService_GetWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "workspace", "setting"}, ""))
pattern_WorkspaceService_UpdateWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "workspace", "setting"}, ""))
pattern_WorkspaceService_UpdateWorkspaceSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "workspace", "setting"}, ""))
)
var (

View File

@ -2,9 +2,9 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/workspace_service.proto
// source: api/v1/workspace_service.proto
package apiv2
package apiv1
import (
context "context"
@ -19,9 +19,9 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
WorkspaceService_GetWorkspaceProfile_FullMethodName = "/slash.api.v2.WorkspaceService/GetWorkspaceProfile"
WorkspaceService_GetWorkspaceSetting_FullMethodName = "/slash.api.v2.WorkspaceService/GetWorkspaceSetting"
WorkspaceService_UpdateWorkspaceSetting_FullMethodName = "/slash.api.v2.WorkspaceService/UpdateWorkspaceSetting"
WorkspaceService_GetWorkspaceProfile_FullMethodName = "/slash.api.v1.WorkspaceService/GetWorkspaceProfile"
WorkspaceService_GetWorkspaceSetting_FullMethodName = "/slash.api.v1.WorkspaceService/GetWorkspaceSetting"
WorkspaceService_UpdateWorkspaceSetting_FullMethodName = "/slash.api.v1.WorkspaceService/UpdateWorkspaceSetting"
)
// WorkspaceServiceClient is the client API for WorkspaceService service.
@ -162,7 +162,7 @@ func _WorkspaceService_UpdateWorkspaceSetting_Handler(srv interface{}, ctx conte
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WorkspaceService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "slash.api.v2.WorkspaceService",
ServiceName: "slash.api.v1.WorkspaceService",
HandlerType: (*WorkspaceServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
@ -179,5 +179,5 @@ var WorkspaceService_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/workspace_service.proto",
Metadata: "api/v1/workspace_service.proto",
}

View File

@ -39,7 +39,7 @@ func (s *FrontendService) Serve(ctx context.Context, e *echo.Echo) {
HTML5: true,
Root: "dist",
Skipper: func(c echo.Context) bool {
return util.HasPrefixes(c.Path(), "/api", "/slash.api.v2", "/robots.txt", "/sitemap.xml", "/s/:shortcutName")
return util.HasPrefixes(c.Path(), "/api", "/slash.api.v1", "/robots.txt", "/sitemap.xml", "/s/:shortcutName")
},
}))

View File

@ -6,7 +6,6 @@ import (
"log/slog"
"net"
"net/http"
"strings"
"time"
"github.com/google/uuid"
@ -16,7 +15,6 @@ import (
"go.uber.org/zap"
apiv1 "github.com/yourselfhosted/slash/api/v1"
apiv2 "github.com/yourselfhosted/slash/api/v2"
"github.com/yourselfhosted/slash/internal/log"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/server/metric"
@ -36,7 +34,7 @@ type Server struct {
licenseService *license.LicenseService
// API services.
apiV2Service *apiv2.APIV2Service
apiV2Service *apiv1.APIV2Service
}
func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store) (*Server, error) {
@ -60,34 +58,6 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
`"status":${status},"error":"${error}"}` + "\n",
}))
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
Skipper: grpcRequestSkipper,
AllowOrigins: []string{"*"},
AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
}))
e.Use(middleware.TimeoutWithConfig(middleware.TimeoutConfig{
Skipper: grpcRequestSkipper,
Timeout: 30 * time.Second,
}))
e.Use(middleware.RateLimiterWithConfig(middleware.RateLimiterConfig{
Skipper: grpcRequestSkipper,
Store: middleware.NewRateLimiterMemoryStoreWithConfig(
middleware.RateLimiterMemoryStoreConfig{Rate: 30, Burst: 60, ExpiresIn: 3 * time.Minute},
),
IdentifierExtractor: func(ctx echo.Context) (string, error) {
id := ctx.RealIP()
return id, nil
},
ErrorHandler: func(context echo.Context, err error) error {
return context.JSON(http.StatusForbidden, nil)
},
DenyHandler: func(context echo.Context, identifier string, err error) error {
return context.JSON(http.StatusTooManyRequests, nil)
},
}))
// Serve frontend.
frontendService := NewFrontendService(profile, store)
frontendService.Serve(ctx, e)
@ -109,12 +79,8 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
})
rootGroup := e.Group("")
// Register API v1 routes.
apiV1Service := apiv1.NewAPIV1Service(profile, store, licenseService)
apiV1Service.Start(rootGroup, secret)
s.apiV2Service = apiv2.NewAPIV2Service(secret, profile, store, licenseService, s.Profile.Port+1)
// Register gRPC gateway as api v2.
s.apiV2Service = apiv1.NewAPIV2Service(secret, profile, store, licenseService, s.Profile.Port+1)
// Register gRPC gateway as api v1.
if err := s.apiV2Service.RegisterGateway(ctx, e); err != nil {
return nil, errors.Wrap(err, "failed to register gRPC gateway")
}
@ -167,10 +133,6 @@ func (s *Server) GetEcho() *echo.Echo {
return s.e
}
func grpcRequestSkipper(c echo.Context) bool {
return strings.HasPrefix(c.Request().URL.Path, "/slash.api.v2.")
}
func (s *Server) getSecretSessionName(ctx context.Context) (string, error) {
secretSessionSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_SECRET_SESSION,

View File

@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
"google.golang.org/protobuf/types/known/timestamppb"
apiv2pb "github.com/yourselfhosted/slash/proto/gen/api/v2"
apiv1pb "github.com/yourselfhosted/slash/proto/gen/api/v1"
storepb "github.com/yourselfhosted/slash/proto/gen/store"
"github.com/yourselfhosted/slash/server/profile"
"github.com/yourselfhosted/slash/store"
@ -17,7 +17,7 @@ type LicenseService struct {
Profile *profile.Profile
Store *store.Store
cachedSubscription *apiv2pb.Subscription
cachedSubscription *apiv1pb.Subscription
}
// NewLicenseService creates a new LicenseService.
@ -25,21 +25,21 @@ func NewLicenseService(profile *profile.Profile, store *store.Store) *LicenseSer
return &LicenseService{
Profile: profile,
Store: store,
cachedSubscription: &apiv2pb.Subscription{
Plan: apiv2pb.PlanType_FREE,
cachedSubscription: &apiv1pb.Subscription{
Plan: apiv1pb.PlanType_FREE,
},
}
}
func (s *LicenseService) LoadSubscription(ctx context.Context) (*apiv2pb.Subscription, error) {
func (s *LicenseService) LoadSubscription(ctx context.Context) (*apiv1pb.Subscription, error) {
workspaceSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_LICENSE_KEY,
})
if err != nil {
return nil, errors.Wrap(err, "failed to get workspace setting")
}
subscription := &apiv2pb.Subscription{
Plan: apiv2pb.PlanType_FREE,
subscription := &apiv1pb.Subscription{
Plan: apiv1pb.PlanType_FREE,
}
licenseKey := ""
if workspaceSetting != nil {
@ -54,7 +54,7 @@ func (s *LicenseService) LoadSubscription(ctx context.Context) (*apiv2pb.Subscri
return nil, errors.Wrap(err, "failed to validate license key")
}
if validateResponse.Valid {
subscription.Plan = apiv2pb.PlanType_PRO
subscription.Plan = apiv1pb.PlanType_PRO
if validateResponse.LicenseKey.ExpiresAt != nil && *validateResponse.LicenseKey.ExpiresAt != "" {
expiresTime, err := time.Parse("2006-01-02 15:04:05", *validateResponse.LicenseKey.ExpiresAt)
if err != nil {
@ -72,7 +72,7 @@ func (s *LicenseService) LoadSubscription(ctx context.Context) (*apiv2pb.Subscri
return subscription, nil
}
func (s *LicenseService) UpdateSubscription(ctx context.Context, licenseKey string) (*apiv2pb.Subscription, error) {
func (s *LicenseService) UpdateSubscription(ctx context.Context, licenseKey string) (*apiv1pb.Subscription, error) {
if licenseKey == "" {
return nil, errors.New("license key is required")
}
@ -95,7 +95,7 @@ func (s *LicenseService) UpdateSubscription(ctx context.Context, licenseKey stri
return s.LoadSubscription(ctx)
}
func (s *LicenseService) GetSubscription(ctx context.Context) (*apiv2pb.Subscription, error) {
func (s *LicenseService) GetSubscription(ctx context.Context) (*apiv1pb.Subscription, error) {
return s.LoadSubscription(ctx)
}

View File

@ -1,94 +0,0 @@
package testserver
import (
"bytes"
"context"
"encoding/json"
"testing"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
apiv1 "github.com/yourselfhosted/slash/api/v1"
)
func TestAuthServer(t *testing.T) {
ctx := context.Background()
s, err := NewTestingServer(ctx, t)
require.NoError(t, err)
defer s.Shutdown(ctx)
signup := &apiv1.SignUpRequest{
Email: "slash@yourselfhosted.com",
Password: "testpassword",
}
user, err := s.postAuthSignUp(signup)
require.NoError(t, err)
require.Equal(t, signup.Email, user.Email)
signin := &apiv1.SignInRequest{
Email: "slash@yourselfhosted.com",
Password: "testpassword",
}
user, err = s.postAuthSignIn(signin)
require.NoError(t, err)
require.Equal(t, signup.Email, user.Email)
err = s.postLogout()
require.NoError(t, err)
}
func (s *TestingServer) postAuthSignUp(signup *apiv1.SignUpRequest) (*apiv1.User, error) {
rawData, err := json.Marshal(&signup)
if err != nil {
return nil, errors.Wrap(err, "failed to marshal signup")
}
reader := bytes.NewReader(rawData)
body, err := s.post("/api/v1/auth/signup", reader, nil)
if err != nil {
return nil, errors.Wrap(err, "fail to post request")
}
buf := &bytes.Buffer{}
_, err = buf.ReadFrom(body)
if err != nil {
return nil, errors.Wrap(err, "fail to read response body")
}
user := &apiv1.User{}
if err = json.Unmarshal(buf.Bytes(), user); err != nil {
return nil, errors.Wrap(err, "fail to unmarshal post signup response")
}
return user, nil
}
func (s *TestingServer) postAuthSignIn(signip *apiv1.SignInRequest) (*apiv1.User, error) {
rawData, err := json.Marshal(&signip)
if err != nil {
return nil, errors.Wrap(err, "failed to marshal signin")
}
reader := bytes.NewReader(rawData)
body, err := s.post("/api/v1/auth/signin", reader, nil)
if err != nil {
return nil, errors.Wrap(err, "fail to post request")
}
buf := &bytes.Buffer{}
_, err = buf.ReadFrom(body)
if err != nil {
return nil, errors.Wrap(err, "fail to read response body")
}
user := &apiv1.User{}
if err = json.Unmarshal(buf.Bytes(), user); err != nil {
return nil, errors.Wrap(err, "fail to unmarshal post signin response")
}
return user, nil
}
func (s *TestingServer) postLogout() error {
_, err := s.post("/api/v1/auth/logout", nil, nil)
if err != nil {
return errors.Wrap(err, "fail to post request")
}
return nil
}

Some files were not shown because too many files have changed in this diff Show More