Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: deprecate bookmark (#9383)
Danny Xu851bd86e338e
diff --git a/backend/api/v1/bookmark_service.go b/backend/api/v1/bookmark_service.godeleted file mode 100644index 8ff8bfc39b..0000000000--- a/backend/api/v1/bookmark_service.go+++ /dev/null@@ -1,107 +0,0 @@-package v1--import (- "context"- "fmt"-- "google.golang.org/grpc/codes"- "google.golang.org/grpc/status"- "google.golang.org/protobuf/types/known/emptypb"-- "github.com/bytebase/bytebase/backend/common"- "github.com/bytebase/bytebase/backend/store"- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"-)--// BookmarkService implments the v1pb.BookmarkServiceServer interface.-type BookmarkService struct {- v1pb.UnimplementedBookmarkServiceServer- store *store.Store-}--// NewBookmarkService returns a new BookmarkService.-func NewBookmarkService(store *store.Store) *BookmarkService {- return &BookmarkService{- store: store,- }-}--// CreateBookmark creates a new bookmark.-func (s *BookmarkService) CreateBookmark(ctx context.Context, request *v1pb.CreateBookmarkRequest) (*v1pb.Bookmark, error) {- principalID, ok := ctx.Value(common.PrincipalIDContextKey).(int)- if !ok {- return nil, status.Errorf(codes.Internal, "principal ID not found")- }-- if request.Bookmark == nil {- return nil, status.Errorf(codes.InvalidArgument, "Missing bookmark")- }-- bookmark, err := s.store.CreateBookmarkV2(ctx, convertToStoreBookmark(request.Bookmark), principalID)- if err != nil {- return nil, status.Errorf(codes.Internal, "Failed to create bookmark: %v", err)- }-- return convertToAPIBookmark(bookmark), nil-}--// ListBookmarks lists bookmarks.-func (s *BookmarkService) ListBookmarks(ctx context.Context, _ *v1pb.ListBookmarksRequest) (*v1pb.ListBookmarksResponse, error) {- principalID, ok := ctx.Value(common.PrincipalIDContextKey).(int)- if !ok {- return nil, status.Errorf(codes.Internal, "principal ID not found")- }- bookmarkList, err := s.store.ListBookmarkV2(ctx, principalID)- if err != nil {- return nil, status.Errorf(codes.Internal, "Failed to list bookmarks: %v", err)- }-- var bookmarks []*v1pb.Bookmark- for _, bookmark := range bookmarkList {- bookmarks = append(bookmarks, convertToAPIBookmark(bookmark))- }-- return &v1pb.ListBookmarksResponse{- Bookmarks: bookmarks,- }, nil-}--// DeleteBookmark deletes a bookmark.-func (s *BookmarkService) DeleteBookmark(ctx context.Context, request *v1pb.DeleteBookmarkRequest) (*emptypb.Empty, error) {- principalID, ok := ctx.Value(common.PrincipalIDContextKey).(int)- if !ok {- return nil, status.Errorf(codes.Internal, "principal ID not found")- }-- bookmarkUID, err := common.GetBookmarkID(request.Name)- if err != nil {- return nil, status.Errorf(codes.InvalidArgument, "Invalid book mark name: %v", err)- }-- if err := s.store.DeleteBookmarkV2(ctx, &store.DeleteBookmarkMessage{- UID: bookmarkUID,- CreatorUID: principalID,- }); err != nil {- if common.ErrorCode(err) == common.NotFound {- return nil, status.Errorf(codes.NotFound, "Bookmark not found: %v", err)- }- return nil, status.Errorf(codes.Internal, "Failed to delete bookmark: %v", err)- }-- return &emptypb.Empty{}, nil-}--func convertToStoreBookmark(request *v1pb.Bookmark) *store.BookmarkMessage {- return &store.BookmarkMessage{- Name: request.Title,- Link: request.Link,- }-}--func convertToAPIBookmark(bookmark *store.BookmarkMessage) *v1pb.Bookmark {- return &v1pb.Bookmark{- Name: fmt.Sprintf("%s%d", common.BookmarkPrefix, bookmark.UID),- Title: bookmark.Name,- Link: bookmark.Link,- }-}diff --git a/backend/common/resource_name.go b/backend/common/resource_name.goindex 78c8e02009..119cb20c42 100644--- a/backend/common/resource_name.go+++ b/backend/common/resource_name.go@@ -20,7 +20,6 @@ const (IdentityProviderNamePrefix = "idps/"SettingNamePrefix = "settings/"BackupPrefix = "backups/"- BookmarkPrefix = "bookmarks/"ExternalVersionControlPrefix = "externalVersionControls/"RiskPrefix = "risks/"IssuePrefix = "issues/"@@ -246,11 +245,6 @@ func GetIdentityProviderID(name string) (string, error) {return tokens[0], nil}-// GetBookmarkID returns the bookmark ID from a resource name.-func GetBookmarkID(name string) (int, error) {- return GetUIDFromName(name, BookmarkPrefix)-}-// GetExternalVersionControlID returns the external version control ID from a resource name.func GetExternalVersionControlID(name string) (int, error) {return GetUIDFromName(name, ExternalVersionControlPrefix)diff --git a/backend/server/grpc_routes.go b/backend/server/grpc_routes.goindex c6f24d8cc5..0b2c8aab67 100644--- a/backend/server/grpc_routes.go+++ b/backend/server/grpc_routes.go@@ -85,7 +85,6 @@ func configureGrpcRouters(v1pb.RegisterSchemaDesignServiceServer(grpcServer, apiv1.NewSchemaDesignService(stores, licenseService))v1pb.RegisterCelServiceServer(grpcServer, apiv1.NewCelService())v1pb.RegisterLoggingServiceServer(grpcServer, apiv1.NewLoggingService(stores))- v1pb.RegisterBookmarkServiceServer(grpcServer, apiv1.NewBookmarkService(stores))v1pb.RegisterInboxServiceServer(grpcServer, apiv1.NewInboxService(stores))v1pb.RegisterChangelistServiceServer(grpcServer, apiv1.NewChangelistService(stores))@@ -153,9 +152,6 @@ func configureGrpcRouters(if err := v1pb.RegisterLoggingServiceHandler(ctx, mux, grpcConn); err != nil {return nil, nil, err}- if err := v1pb.RegisterBookmarkServiceHandler(ctx, mux, grpcConn); err != nil {- return nil, nil, err- }if err := v1pb.RegisterInboxServiceHandler(ctx, mux, grpcConn); err != nil {return nil, nil, err}diff --git a/backend/server/onboard.go b/backend/server/onboard.goindex a08ff83177..9008caef70 100644--- a/backend/server/onboard.go+++ b/backend/server/onboard.go@@ -7,7 +7,6 @@ import ("strconv""github.com/google/uuid"- "github.com/gosimple/slug""github.com/pkg/errors""google.golang.org/protobuf/encoding/protojson"@@ -223,7 +222,6 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMesreturn errors.Wrapf(err, "failed to create prod sheet for sample project")}- var issueLink string// Use new CI/CD API.childCtx := context.WithValue(ctx, common.PrincipalIDContextKey, user.ID)plan, err := s.rolloutService.CreatePlan(childCtx, &v1pb.CreatePlanRequest{@@ -274,7 +272,7 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMesif err != nil {return errors.Wrapf(err, "failed to create rollout for sample project")}- issue, err := s.issueService.CreateIssue(childCtx, &v1pb.CreateIssueRequest{+ if _, err := s.issueService.CreateIssue(childCtx, &v1pb.CreateIssueRequest{Parent: fmt.Sprintf("projects/%s", project.ResourceID),Issue: &v1pb.Issue{Title: "👉👉👉 [START HERE] Add email column to Employee table",@@ -286,19 +284,9 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMesPlan: plan.Name,Rollout: rollout.Name,},- })- if err != nil {+ }); err != nil {return errors.Wrapf(err, "failed to create issue for sample project")}- issueLink = fmt.Sprintf("/issue/%s-%s", slug.Make(issue.Title), issue.Uid)-- // Bookmark the issue.- if _, err := s.store.CreateBookmarkV2(ctx, &store.BookmarkMessage{- Name: "Sample Issue",- Link: issueLink,- }, userID); err != nil {- return errors.Wrapf(err, "failed to bookmark sample issue")- }// Add a sensitive data policy to pair it with the sample query below. So that user can// experience the sensitive data masking feature from SQL Editor.diff --git a/backend/store/bookmark.go b/backend/store/bookmark.godeleted file mode 100644index 2aad6eb0bc..0000000000--- a/backend/store/bookmark.go+++ /dev/null@@ -1,174 +0,0 @@-package store--import (- "context"- "database/sql"- "fmt"- "strings"-- "github.com/pkg/errors"-- "github.com/bytebase/bytebase/backend/common"-)--// BookmarkMessage is the message for bookmark.-type BookmarkMessage struct {- // Link is the link of the bookmark.- Link string-- // Name is the name of the bookmark.- Name string-- // Output only fields.- //- // UID is the unique ID of the bookmark.- UID int- // CreatorUID is the unique ID of the creator.- CreatorUID int-}--// DeleteBookmarkMessage is the message to delete a bookmark.-type DeleteBookmarkMessage struct {- // UID is the unique ID of the bookmark.- UID int-- // CreatorUID is the unique ID of the creator.- CreatorUID int-}--// CreateBookmarkV2 creates a new bookmark.-func (s *Store) CreateBookmarkV2(ctx context.Context, create *BookmarkMessage, principleUID int) (*BookmarkMessage, error) {- query := `- INSERT INTO bookmark (- creator_id,- updater_id,- name,- link- )- VALUES ($1, $2, $3, $4)- RETURNING id, name, creator_id, link- `-- tx, err := s.db.BeginTx(ctx, nil)- if err != nil {- return nil, errors.Wrapf(err, "failed to begin transaction")- }- defer tx.Rollback()-- var bookmark BookmarkMessage- if err := tx.QueryRowContext(ctx, query,- principleUID,- principleUID,- create.Name,- create.Link,- ).Scan(- &bookmark.UID,- &bookmark.Name,- &bookmark.CreatorUID,- &bookmark.Link,- ); err != nil {- if err == sql.ErrNoRows {- return nil, common.FormatDBErrorEmptyRowWithQuery(query)- }- return nil, errors.Wrapf(err, "failed to query row")- }-- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }-- return &bookmark, nil-}--// ListBookmarkV2 lists all bookmarks.-func (s *Store) ListBookmarkV2(ctx context.Context, principalUID int) ([]*BookmarkMessage, error) {- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})- if err != nil {- return nil, errors.Wrapf(err, "failed to begin transaction")- }-- bookmarks, err := s.listBookmarkImplV2(ctx, tx, principalUID)- if err != nil {- return nil, errors.Wrapf(err, "failed to list bookmarks")- }-- if err := tx.Commit(); err != nil {- return nil, errors.Wrapf(err, "failed to commit transaction")- }-- return bookmarks, nil-}--// DeleteBookmarkV2 try to delete a bookmark.-func (s *Store) DeleteBookmarkV2(ctx context.Context, delete *DeleteBookmarkMessage) error {- var args []any- var where []string- where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, delete.UID)- where, args = append(where, fmt.Sprintf("creator_id = $%d", len(args)+1)), append(args, delete.CreatorUID)-- query := fmt.Sprintf(`- DELETE FROM bookmark WHERE %s- `, strings.Join(where, " AND "))-- tx, err := s.db.BeginTx(ctx, nil)- if err != nil {- return errors.Wrapf(err, "failed to begin transaction")- }- defer tx.Rollback()-- result, err := tx.ExecContext(ctx, query, args...)- if err != nil {- return errors.Wrapf(err, "failed to delete bookmark %v", delete)- }- rows, _ := result.RowsAffected()- if rows == 0 {- return &common.Error{Code: common.NotFound, Err: errors.Errorf("bookmark not found: %v", delete)}- }-- if err := tx.Commit(); err != nil {- return errors.Wrapf(err, "failed to commit transaction")- }-- return nil-}--func (*Store) listBookmarkImplV2(ctx context.Context, tx *Tx, creatorUID int) ([]*BookmarkMessage, error) {- where, args := []string{"TRUE"}, []any{}- where, args = append(where, fmt.Sprintf("creator_id = $%d", len(args)+1)), append(args, creatorUID)-- query := fmt.Sprintf(`- SELECT- id,- creator_id,- name,- link- FROM bookmark WHERE %s- `, strings.Join(where, " AND "))-- rows, err := tx.QueryContext(ctx, query, args...)- if err != nil {- return nil, errors.Wrapf(err, "failed to query bookmark for user %v", creatorUID)- }- defer rows.Close()-- var bookmarks []*BookmarkMessage-- for rows.Next() {- var bookmark BookmarkMessage- if err := rows.Scan(- &bookmark.UID,- &bookmark.CreatorUID,- &bookmark.Name,- &bookmark.Link,- ); err != nil {- return nil, errors.Wrapf(err, "failed to scan bookmark for user %v", creatorUID)- }-- bookmarks = append(bookmarks, &bookmark)- }- if err := rows.Err(); err != nil {- return nil, errors.Wrapf(err, "failed to iterate bookmark for user %v", creatorUID)- }-- return bookmarks, nil-}diff --git a/frontend/src/components/KBar/utils.ts b/frontend/src/components/KBar/utils.tsindex 22f6d1fcce..3d23029f94 100644--- a/frontend/src/components/KBar/utils.ts+++ b/frontend/src/components/KBar/utils.ts@@ -6,7 +6,6 @@ export const ACTION_RANKINGS = ["bb.recently_visited.","bb.quickaction.","bb.navigation.",- "bb.bookmark.","bb.project.","bb.database.","bb.preferences.",diff --git a/frontend/src/grpcweb/index.ts b/frontend/src/grpcweb/index.tsindex 6e479b4633..287798c533 100644--- a/frontend/src/grpcweb/index.ts+++ b/frontend/src/grpcweb/index.ts@@ -8,7 +8,6 @@ import {import { ActuatorServiceDefinition } from "@/types/proto/v1/actuator_service";import { AnomalyServiceDefinition } from "@/types/proto/v1/anomaly_service";import { AuthServiceDefinition } from "@/types/proto/v1/auth_service";-import { BookmarkServiceDefinition } from "@/types/proto/v1/bookmark_service";import { CelServiceDefinition } from "@/types/proto/v1/cel_service";import { ChangelistServiceDefinition } from "@/types/proto/v1/changelist_service";import { DatabaseServiceDefinition } from "@/types/proto/v1/database_service";@@ -169,11 +168,6 @@ export const loggingServiceClient = clientFactory.create(channel);-export const bookmarkServiceClient = clientFactory.create(- BookmarkServiceDefinition,- channel-);-export const inboxServiceClient = clientFactory.create(InboxServiceDefinition,channeldiff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 0bfbd35cc4..b68854b243 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -50,8 +50,6 @@"environment": "Environment","environments": "Environments","environment-name": "Environment Name",- "bookmark": "Bookmark",- "bookmarks": "Bookmarks","quick-action": "Quick Action","archive": "Archive","archived": "Archived",diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex a689b88517..b24b03697d 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -50,8 +50,6 @@"environment": "Entorno","environments": "Entornos","environment-name": "Nombre del entorno",- "bookmark": "Marcador",- "bookmarks": "Marcadores","quick-action": "Acción rápida","archive": "Archivo","archived": "Archivada",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 08d5b41e4a..55501ca96f 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -50,8 +50,6 @@"environment": "环境","environments": "环境","environment-name": "环境名",- "bookmark": "书签",- "bookmarks": "书签","quick-action": "快捷操作","archive": "归档","archived": "已归档",diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.tsindex 452dab6129..9ade4c2e13 100644--- a/frontend/src/router/index.ts+++ b/frontend/src/router/index.ts@@ -246,7 +246,6 @@ const routes: Array<RouteRecordRaw> = [path: "/project/:projectSlug/changelists/:changelistName",name: "workspace.changelist.detail",meta: {- allowBookmark: true,overrideTitle: true,},components: {@@ -263,7 +262,6 @@ const routes: Array<RouteRecordRaw> = [path: "/project/:projectSlug/branches/:branchName",name: "workspace.branch.detail",meta: {- allowBookmark: true,overrideTitle: true,},components: {@@ -649,7 +647,6 @@ const routes: Array<RouteRecordRaw> = [String(idFromSlug(slug))).title;},- allowBookmark: true,},components: {content: () => import("../views/EnvironmentDetail.vue"),@@ -707,7 +704,6 @@ const routes: Array<RouteRecordRaw> = [);return projectV1.title;},- allowBookmark: true,},component: () => import("../views/ProjectDetail.vue"),props: true,@@ -742,7 +738,6 @@ const routes: Array<RouteRecordRaw> = [webhook?.title ?? "unknown"}`;},- allowBookmark: true,},component: () => import("../views/ProjectWebhookDetail.vue"),props: true,@@ -833,7 +828,6 @@ const routes: Array<RouteRecordRaw> = [String(idFromSlug(slug))).databaseName;},- allowBookmark: true,},component: () => import("../views/DatabaseDetail.vue"),props: true,@@ -893,7 +887,6 @@ const routes: Array<RouteRecordRaw> = [path: "issue/:issueSlug",name: "workspace.issue.detail",meta: {- allowBookmark: true,overrideTitle: true,},components: {diff --git a/frontend/src/shims-vue-router.d.ts b/frontend/src/shims-vue-router.d.tsindex 7e6198857c..28a819b70d 100644--- a/frontend/src/shims-vue-router.d.ts+++ b/frontend/src/shims-vue-router.d.ts@@ -4,7 +4,6 @@ export {};declare module "vue-router" {interface RouteMeta {- allowBookmark?: boolean;title?: (route: RouteLocationNormalized) => string;quickActionListByRole?: (route: RouteLocationNormalizeddiff --git a/frontend/src/store/modules/v1/bookmark.ts b/frontend/src/store/modules/v1/bookmark.tsdeleted file mode 100644index 98abfd8eee..0000000000--- a/frontend/src/store/modules/v1/bookmark.ts+++ /dev/null@@ -1,58 +0,0 @@-import { defineStore } from "pinia";-import { reactive } from "vue";-import { bookmarkServiceClient } from "@/grpcweb";-import { Bookmark } from "@/types/proto/v1/bookmark_service";--export const useBookmarkV1Store = defineStore("bookmark_v1", () => {- const bookmarkList = reactive<Bookmark[]>([]);-- const fetchBookmarkList = async () => {- const resp = await bookmarkServiceClient.listBookmarks({});- bookmarkList.splice(0, bookmarkList.length);- for (const bookmark of resp.bookmarks) {- bookmarkList.push(bookmark);- }- return bookmarkList;- };-- const getBookmarkList = () => {- return bookmarkList;- };-- const createBookmark = async ({- title,- link,- }: {- title: string;- link: string;- }) => {- const bookmark = await bookmarkServiceClient.createBookmark({- bookmark: {- title,- link,- },- });- bookmarkList.push(bookmark);- return bookmark;- };-- const deleteBookmark = async (name: string) => {- await bookmarkServiceClient.deleteBookmark({- name,- });- const index = bookmarkList.findIndex((b) => b.name === name);- bookmarkList.splice(index, 1);- };-- const findBookmarkByLink = (link: string) => {- return bookmarkList.find((b) => b.link === link);- };-- return {- getBookmarkList,- fetchBookmarkList,- createBookmark,- deleteBookmark,- findBookmarkByLink,- };-});diff --git a/frontend/src/store/modules/v1/index.ts b/frontend/src/store/modules/v1/index.tsindex da6a24ada0..7c6321c4f1 100644--- a/frontend/src/store/modules/v1/index.ts+++ b/frontend/src/store/modules/v1/index.ts@@ -22,7 +22,6 @@ export * from "./vcs";export * from "./changeHistory";export * from "./dbSchema";export * from "./activity";-export * from "./bookmark";export * from "./inbox";export * from "./anomaly";export * from "./schemaEditor";diff --git a/frontend/src/types/proto/v1/bookmark_service.ts b/frontend/src/types/proto/v1/bookmark_service.tsdeleted file mode 100644index f6fa688921..0000000000--- a/frontend/src/types/proto/v1/bookmark_service.ts+++ /dev/null@@ -1,543 +0,0 @@-/* eslint-disable */-import Long from "long";-import _m0 from "protobufjs/minimal";-import { Empty } from "../google/protobuf/empty";--export const protobufPackage = "bytebase.v1";--export interface CreateBookmarkRequest {- /** The bookmark to create. */- bookmark: Bookmark | undefined;-}--export interface DeleteBookmarkRequest {- /**- * The name of the bookmark to delete.- * Format: bookmarks/{bookmark}- */- name: string;-}--export interface ListBookmarksRequest {- /**- * Not used. The maximum number of bookmarks to return. The service may return fewer than- * this value.- * If unspecified, at most 50 bookmarks will be returned.- * The maximum value is 1000; values above 1000 will be coerced to 1000.- */- pageSize: number;- /**- * Not used. A page token, received from a previous `ListBookmarks` call.- * Provide this to retrieve the subsequent page.- *- * When paginating, all other parameters provided to `ListBookmarks` must match- * the call that provided the page token.- */- pageToken: string;-}--export interface ListBookmarksResponse {- /** The list of bookmarks. */- bookmarks: Bookmark[];- /**- * Not used. A token, which can be sent as `page_token` to retrieve the next page.- * If this field is omitted, there are no subsequent pages.- */- nextPageToken: string;-}--export interface Bookmark {- /**- * The name of the bookmark.- * Format: bookmarks/{bookmark}, user and bookmark are server-generated unique IDs.- */- name: string;- /** The title of the bookmark. */- title: string;- /**- * The resource link of the bookmark. Only support issue link for now.- * Format:- * Issue: /issue/slug(issue_name)-{issue_uid}- * Example: /issue/start-here-add-email-column-to-employee-table-101- */- link: string;-}--function createBaseCreateBookmarkRequest(): CreateBookmarkRequest {- return { bookmark: undefined };-}--export const CreateBookmarkRequest = {- encode(message: CreateBookmarkRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.bookmark !== undefined) {- Bookmark.encode(message.bookmark, writer.uint32(10).fork()).ldelim();- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): CreateBookmarkRequest {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseCreateBookmarkRequest();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 10) {- break;- }-- message.bookmark = Bookmark.decode(reader, reader.uint32());- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): CreateBookmarkRequest {- return { bookmark: isSet(object.bookmark) ? Bookmark.fromJSON(object.bookmark) : undefined };- },-- toJSON(message: CreateBookmarkRequest): unknown {- const obj: any = {};- if (message.bookmark !== undefined) {- obj.bookmark = Bookmark.toJSON(message.bookmark);- }- return obj;- },-- create(base?: DeepPartial<CreateBookmarkRequest>): CreateBookmarkRequest {- return CreateBookmarkRequest.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<CreateBookmarkRequest>): CreateBookmarkRequest {- const message = createBaseCreateBookmarkRequest();- message.bookmark = (object.bookmark !== undefined && object.bookmark !== null)- ? Bookmark.fromPartial(object.bookmark)- : undefined;- return message;- },-};--function createBaseDeleteBookmarkRequest(): DeleteBookmarkRequest {- return { name: "" };-}--export const DeleteBookmarkRequest = {- encode(message: DeleteBookmarkRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.name !== "") {- writer.uint32(10).string(message.name);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): DeleteBookmarkRequest {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseDeleteBookmarkRequest();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 10) {- break;- }-- message.name = reader.string();- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): DeleteBookmarkRequest {- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };- },-- toJSON(message: DeleteBookmarkRequest): unknown {- const obj: any = {};- if (message.name !== "") {- obj.name = message.name;- }- return obj;- },-- create(base?: DeepPartial<DeleteBookmarkRequest>): DeleteBookmarkRequest {- return DeleteBookmarkRequest.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<DeleteBookmarkRequest>): DeleteBookmarkRequest {- const message = createBaseDeleteBookmarkRequest();- message.name = object.name ?? "";- return message;- },-};--function createBaseListBookmarksRequest(): ListBookmarksRequest {- return { pageSize: 0, pageToken: "" };-}--export const ListBookmarksRequest = {- encode(message: ListBookmarksRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.pageSize !== 0) {- writer.uint32(8).int32(message.pageSize);- }- if (message.pageToken !== "") {- writer.uint32(18).string(message.pageToken);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): ListBookmarksRequest {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseListBookmarksRequest();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 8) {- break;- }-- message.pageSize = reader.int32();- continue;- case 2:- if (tag !== 18) {- break;- }-- message.pageToken = reader.string();- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): ListBookmarksRequest {- return {- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",- };- },-- toJSON(message: ListBookmarksRequest): unknown {- const obj: any = {};- if (message.pageSize !== 0) {- obj.pageSize = Math.round(message.pageSize);- }- if (message.pageToken !== "") {- obj.pageToken = message.pageToken;- }- return obj;- },-- create(base?: DeepPartial<ListBookmarksRequest>): ListBookmarksRequest {- return ListBookmarksRequest.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<ListBookmarksRequest>): ListBookmarksRequest {- const message = createBaseListBookmarksRequest();- message.pageSize = object.pageSize ?? 0;- message.pageToken = object.pageToken ?? "";- return message;- },-};--function createBaseListBookmarksResponse(): ListBookmarksResponse {- return { bookmarks: [], nextPageToken: "" };-}--export const ListBookmarksResponse = {- encode(message: ListBookmarksResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- for (const v of message.bookmarks) {- Bookmark.encode(v!, writer.uint32(10).fork()).ldelim();- }- if (message.nextPageToken !== "") {- writer.uint32(18).string(message.nextPageToken);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): ListBookmarksResponse {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseListBookmarksResponse();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 10) {- break;- }-- message.bookmarks.push(Bookmark.decode(reader, reader.uint32()));- continue;- case 2:- if (tag !== 18) {- break;- }-- message.nextPageToken = reader.string();- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): ListBookmarksResponse {- return {- bookmarks: globalThis.Array.isArray(object?.bookmarks)- ? object.bookmarks.map((e: any) => Bookmark.fromJSON(e))- : [],- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",- };- },-- toJSON(message: ListBookmarksResponse): unknown {- const obj: any = {};- if (message.bookmarks?.length) {- obj.bookmarks = message.bookmarks.map((e) => Bookmark.toJSON(e));- }- if (message.nextPageToken !== "") {- obj.nextPageToken = message.nextPageToken;- }- return obj;- },-- create(base?: DeepPartial<ListBookmarksResponse>): ListBookmarksResponse {- return ListBookmarksResponse.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<ListBookmarksResponse>): ListBookmarksResponse {- const message = createBaseListBookmarksResponse();- message.bookmarks = object.bookmarks?.map((e) => Bookmark.fromPartial(e)) || [];- message.nextPageToken = object.nextPageToken ?? "";- return message;- },-};--function createBaseBookmark(): Bookmark {- return { name: "", title: "", link: "" };-}--export const Bookmark = {- encode(message: Bookmark, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.name !== "") {- writer.uint32(10).string(message.name);- }- if (message.title !== "") {- writer.uint32(18).string(message.title);- }- if (message.link !== "") {- writer.uint32(26).string(message.link);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): Bookmark {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseBookmark();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 10) {- break;- }-- message.name = reader.string();- continue;- case 2:- if (tag !== 18) {- break;- }-- message.title = reader.string();- continue;- case 3:- if (tag !== 26) {- break;- }-- message.link = reader.string();- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): Bookmark {- return {- name: isSet(object.name) ? globalThis.String(object.name) : "",- title: isSet(object.title) ? globalThis.String(object.title) : "",- link: isSet(object.link) ? globalThis.String(object.link) : "",- };- },-- toJSON(message: Bookmark): unknown {- const obj: any = {};- if (message.name !== "") {- obj.name = message.name;- }- if (message.title !== "") {- obj.title = message.title;- }- if (message.link !== "") {- obj.link = message.link;- }- return obj;- },-- create(base?: DeepPartial<Bookmark>): Bookmark {- return Bookmark.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<Bookmark>): Bookmark {- const message = createBaseBookmark();- message.name = object.name ?? "";- message.title = object.title ?? "";- message.link = object.link ?? "";- return message;- },-};--export type BookmarkServiceDefinition = typeof BookmarkServiceDefinition;-export const BookmarkServiceDefinition = {- name: "BookmarkService",- fullName: "bytebase.v1.BookmarkService",- methods: {- /** CreateBookmark creates a new bookmark. */- createBookmark: {- name: "CreateBookmark",- requestType: CreateBookmarkRequest,- requestStream: false,- responseType: Bookmark,- responseStream: false,- options: {- _unknownFields: {- 8410: [new Uint8Array([0])],- 578365826: [- new Uint8Array([- 25,- 58,- 8,- 98,- 111,- 111,- 107,- 109,- 97,- 114,- 107,- 34,- 13,- 47,- 118,- 49,- 47,- 98,- 111,- 111,- 107,- 109,- 97,- 114,- 107,- 115,- ]),- ],- },- },- },- /** DeleteBookmark deletes a bookmark. */- deleteBookmark: {- name: "DeleteBookmark",- requestType: DeleteBookmarkRequest,- requestStream: false,- responseType: Empty,- responseStream: false,- options: {- _unknownFields: {- 8410: [new Uint8Array([4, 110, 97, 109, 101])],- 578365826: [- new Uint8Array([- 24,- 42,- 22,- 47,- 118,- 49,- 47,- 123,- 110,- 97,- 109,- 101,- 61,- 98,- 111,- 111,- 107,- 109,- 97,- 114,- 107,- 115,- 47,- 42,- 125,- ]),- ],- },- },- },- /** ListBookmarks lists bookmarks. */- listBookmarks: {- name: "ListBookmarks",- requestType: ListBookmarksRequest,- requestStream: false,- responseType: ListBookmarksResponse,- responseStream: false,- options: {- _unknownFields: {- 8410: [new Uint8Array([0])],- 578365826: [new Uint8Array([15, 18, 13, 47, 118, 49, 47, 98, 111, 111, 107, 109, 97, 114, 107, 115])],- },- },- },- },-} as const;--type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;--export type DeepPartial<T> = T extends Builtin ? T- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }- : Partial<T>;--if (_m0.util.Long !== Long) {- _m0.util.Long = Long as any;- _m0.configure();-}--function isSet(value: any): boolean {- return value !== null && value !== undefined;-}diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex ccb6dfb82e..09d9ae9c43 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -96,15 +96,6 @@- [AuthService](#bytebase-v1-AuthService)-- [v1/bookmark_service.proto](#v1_bookmark_service-proto)- - [Bookmark](#bytebase-v1-Bookmark)- - [CreateBookmarkRequest](#bytebase-v1-CreateBookmarkRequest)- - [DeleteBookmarkRequest](#bytebase-v1-DeleteBookmarkRequest)- - [ListBookmarksRequest](#bytebase-v1-ListBookmarksRequest)- - [ListBookmarksResponse](#bytebase-v1-ListBookmarksResponse)-- - [BookmarkService](#bytebase-v1-BookmarkService)-- [v1/cel_service.proto](#v1_cel_service-proto)- [BatchDeparseRequest](#bytebase-v1-BatchDeparseRequest)- [BatchDeparseResponse](#bytebase-v1-BatchDeparseResponse)@@ -1951,115 +1942,6 @@ The user's `name` field is used to identify the user to update. Format: user-<a name="v1_bookmark_service-proto"></a>-<p align="right"><a href="#top">Top</a></p>--## v1/bookmark_service.proto----<a name="bytebase-v1-Bookmark"></a>--### Bookmark----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| name | [string](#string) | | The name of the bookmark. Format: bookmarks/{bookmark}, user and bookmark are server-generated unique IDs. |-| title | [string](#string) | | The title of the bookmark. |-| link | [string](#string) | | The resource link of the bookmark. Only support issue link for now. Format: Issue: /issue/slug(issue_name)-{issue_uid} Example: /issue/start-here-add-email-column-to-employee-table-101 |-------<a name="bytebase-v1-CreateBookmarkRequest"></a>--### CreateBookmarkRequest----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| bookmark | [Bookmark](#bytebase-v1-Bookmark) | | The bookmark to create. |-------<a name="bytebase-v1-DeleteBookmarkRequest"></a>--### DeleteBookmarkRequest----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| name | [string](#string) | | The name of the bookmark to delete. Format: bookmarks/{bookmark} |-------<a name="bytebase-v1-ListBookmarksRequest"></a>--### ListBookmarksRequest----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| page_size | [int32](#int32) | | Not used. The maximum number of bookmarks to return. The service may return fewer than this value. If unspecified, at most 50 bookmarks will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |-| page_token | [string](#string) | | Not used. A page token, received from a previous `ListBookmarks` call. Provide this to retrieve the subsequent page.--When paginating, all other parameters provided to `ListBookmarks` must match the call that provided the page token. |-------<a name="bytebase-v1-ListBookmarksResponse"></a>--### ListBookmarksResponse----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| bookmarks | [Bookmark](#bytebase-v1-Bookmark) | repeated | The list of bookmarks. |-| next_page_token | [string](#string) | | Not used. A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |-------------<a name="bytebase-v1-BookmarkService"></a>--### BookmarkService---| Method Name | Request Type | Response Type | Description |-| ----------- | ------------ | ------------- | ------------|-| CreateBookmark | [CreateBookmarkRequest](#bytebase-v1-CreateBookmarkRequest) | [Bookmark](#bytebase-v1-Bookmark) | CreateBookmark creates a new bookmark. |-| DeleteBookmark | [DeleteBookmarkRequest](#bytebase-v1-DeleteBookmarkRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | DeleteBookmark deletes a bookmark. |-| ListBookmarks | [ListBookmarksRequest](#bytebase-v1-ListBookmarksRequest) | [ListBookmarksResponse](#bytebase-v1-ListBookmarksResponse) | ListBookmarks lists bookmarks. |-----<a name="v1_cel_service-proto"></a><p align="right"><a href="#top">Top</a></p>diff --git a/proto/generated-go/v1/bookmark_service.pb.go b/proto/generated-go/v1/bookmark_service.pb.godeleted file mode 100644index 3b761ed1cd..0000000000--- a/proto/generated-go/v1/bookmark_service.pb.go+++ /dev/null@@ -1,502 +0,0 @@-// Code generated by protoc-gen-go. DO NOT EDIT.-// versions:-// protoc-gen-go v1.31.0-// protoc (unknown)-// source: v1/bookmark_service.proto--package v1--import (- _ "google.golang.org/genproto/googleapis/api/annotations"- protoreflect "google.golang.org/protobuf/reflect/protoreflect"- protoimpl "google.golang.org/protobuf/runtime/protoimpl"- emptypb "google.golang.org/protobuf/types/known/emptypb"- reflect "reflect"- sync "sync"-)--const (- // Verify that this generated code is sufficiently up-to-date.- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)- // Verify that runtime/protoimpl is sufficiently up-to-date.- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)-)--type CreateBookmarkRequest struct {- state protoimpl.MessageState- sizeCache protoimpl.SizeCache- unknownFields protoimpl.UnknownFields-- // The bookmark to create.- Bookmark *Bookmark `protobuf:"bytes,1,opt,name=bookmark,proto3" json:"bookmark,omitempty"`-}--func (x *CreateBookmarkRequest) Reset() {- *x = CreateBookmarkRequest{}- if protoimpl.UnsafeEnabled {- mi := &file_v1_bookmark_service_proto_msgTypes[0]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)- }-}--func (x *CreateBookmarkRequest) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*CreateBookmarkRequest) ProtoMessage() {}--func (x *CreateBookmarkRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_bookmark_service_proto_msgTypes[0]- if protoimpl.UnsafeEnabled && x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use CreateBookmarkRequest.ProtoReflect.Descriptor instead.-func (*CreateBookmarkRequest) Descriptor() ([]byte, []int) {- return file_v1_bookmark_service_proto_rawDescGZIP(), []int{0}-}--func (x *CreateBookmarkRequest) GetBookmark() *Bookmark {- if x != nil {- return x.Bookmark- }- return nil-}--type DeleteBookmarkRequest struct {- state protoimpl.MessageState- sizeCache protoimpl.SizeCache- unknownFields protoimpl.UnknownFields-- // The name of the bookmark to delete.- // Format: bookmarks/{bookmark}- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`-}--func (x *DeleteBookmarkRequest) Reset() {- *x = DeleteBookmarkRequest{}- if protoimpl.UnsafeEnabled {- mi := &file_v1_bookmark_service_proto_msgTypes[1]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)- }-}--func (x *DeleteBookmarkRequest) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*DeleteBookmarkRequest) ProtoMessage() {}--func (x *DeleteBookmarkRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_bookmark_service_proto_msgTypes[1]- if protoimpl.UnsafeEnabled && x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use DeleteBookmarkRequest.ProtoReflect.Descriptor instead.-func (*DeleteBookmarkRequest) Descriptor() ([]byte, []int) {- return file_v1_bookmark_service_proto_rawDescGZIP(), []int{1}-}--func (x *DeleteBookmarkRequest) GetName() string {- if x != nil {- return x.Name- }- return ""-}--type ListBookmarksRequest struct {- state protoimpl.MessageState- sizeCache protoimpl.SizeCache- unknownFields protoimpl.UnknownFields-- // Not used. The maximum number of bookmarks to return. The service may return fewer than- // this value.- // If unspecified, at most 50 bookmarks will be returned.- // The maximum value is 1000; values above 1000 will be coerced to 1000.- PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`- // Not used. A page token, received from a previous `ListBookmarks` call.- // Provide this to retrieve the subsequent page.- //- // When paginating, all other parameters provided to `ListBookmarks` must match- // the call that provided the page token.- PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`-}--func (x *ListBookmarksRequest) Reset() {- *x = ListBookmarksRequest{}- if protoimpl.UnsafeEnabled {- mi := &file_v1_bookmark_service_proto_msgTypes[2]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)- }-}--func (x *ListBookmarksRequest) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*ListBookmarksRequest) ProtoMessage() {}--func (x *ListBookmarksRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_bookmark_service_proto_msgTypes[2]- if protoimpl.UnsafeEnabled && x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use ListBookmarksRequest.ProtoReflect.Descriptor instead.-func (*ListBookmarksRequest) Descriptor() ([]byte, []int) {- return file_v1_bookmark_service_proto_rawDescGZIP(), []int{2}-}--func (x *ListBookmarksRequest) GetPageSize() int32 {- if x != nil {- return x.PageSize- }- return 0-}--func (x *ListBookmarksRequest) GetPageToken() string {- if x != nil {- return x.PageToken- }- return ""-}--type ListBookmarksResponse struct {- state protoimpl.MessageState- sizeCache protoimpl.SizeCache- unknownFields protoimpl.UnknownFields-- // The list of bookmarks.- Bookmarks []*Bookmark `protobuf:"bytes,1,rep,name=bookmarks,proto3" json:"bookmarks,omitempty"`- // Not used. A token, which can be sent as `page_token` to retrieve the next page.- // If this field is omitted, there are no subsequent pages.- NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`-}--func (x *ListBookmarksResponse) Reset() {- *x = ListBookmarksResponse{}- if protoimpl.UnsafeEnabled {- mi := &file_v1_bookmark_service_proto_msgTypes[3]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)- }-}--func (x *ListBookmarksResponse) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*ListBookmarksResponse) ProtoMessage() {}--func (x *ListBookmarksResponse) ProtoReflect() protoreflect.Message {- mi := &file_v1_bookmark_service_proto_msgTypes[3]- if protoimpl.UnsafeEnabled && x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use ListBookmarksResponse.ProtoReflect.Descriptor instead.-func (*ListBookmarksResponse) Descriptor() ([]byte, []int) {- return file_v1_bookmark_service_proto_rawDescGZIP(), []int{3}-}--func (x *ListBookmarksResponse) GetBookmarks() []*Bookmark {- if x != nil {- return x.Bookmarks- }- return nil-}--func (x *ListBookmarksResponse) GetNextPageToken() string {- if x != nil {- return x.NextPageToken- }- return ""-}--type Bookmark struct {- state protoimpl.MessageState- sizeCache protoimpl.SizeCache- unknownFields protoimpl.UnknownFields-- // The name of the bookmark.- // Format: bookmarks/{bookmark}, user and bookmark are server-generated unique IDs.- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`- // The title of the bookmark.- Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`- // The resource link of the bookmark. Only support issue link for now.- // Format:- // Issue: /issue/slug(issue_name)-{issue_uid}- // Example: /issue/start-here-add-email-column-to-employee-table-101- Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"`-}--func (x *Bookmark) Reset() {- *x = Bookmark{}- if protoimpl.UnsafeEnabled {- mi := &file_v1_bookmark_service_proto_msgTypes[4]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)- }-}--func (x *Bookmark) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*Bookmark) ProtoMessage() {}--func (x *Bookmark) ProtoReflect() protoreflect.Message {- mi := &file_v1_bookmark_service_proto_msgTypes[4]- if protoimpl.UnsafeEnabled && x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use Bookmark.ProtoReflect.Descriptor instead.-func (*Bookmark) Descriptor() ([]byte, []int) {- return file_v1_bookmark_service_proto_rawDescGZIP(), []int{4}-}--func (x *Bookmark) GetName() string {- if x != nil {- return x.Name- }- return ""-}--func (x *Bookmark) GetTitle() string {- if x != nil {- return x.Title- }- return ""-}--func (x *Bookmark) GetLink() string {- if x != nil {- return x.Link- }- return ""-}--var File_v1_bookmark_service_proto protoreflect.FileDescriptor--var file_v1_bookmark_service_proto_rawDesc = []byte{- 0x0a, 0x19, 0x76, 0x31, 0x2f, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x73, 0x65,- 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x79, 0x74,- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 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,- 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,- 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,- 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a,- 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x52,- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61,- 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x42,- 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x30,- 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b,- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,- 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,- 0x22, 0x52, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b,- 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65,- 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67,- 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f,- 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54,- 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x74, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6b,- 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a,- 0x09, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,- 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42,- 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72,- 0x6b, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f,- 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78,- 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x57, 0x0a, 0x08, 0x42, 0x6f,- 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,- 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,- 0x19, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,- 0xe0, 0x41, 0x02, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6c, 0x69,- 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6c,- 0x69, 0x6e, 0x6b, 0x32, 0xe9, 0x02, 0x0a, 0x0f, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b,- 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6f, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74,- 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f,- 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b,- 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x22, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a,- 0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x62,- 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x73, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65,- 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74,- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42,- 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,- 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x25, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82,- 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,- 0x3d, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x70, 0x0a,- 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x21,- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,- 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,- 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,- 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x52, 0x65, 0x73,- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f,- 0x12, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x42,- 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f,- 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,-}--var (- file_v1_bookmark_service_proto_rawDescOnce sync.Once- file_v1_bookmark_service_proto_rawDescData = file_v1_bookmark_service_proto_rawDesc-)--func file_v1_bookmark_service_proto_rawDescGZIP() []byte {- file_v1_bookmark_service_proto_rawDescOnce.Do(func() {- file_v1_bookmark_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_bookmark_service_proto_rawDescData)- })- return file_v1_bookmark_service_proto_rawDescData-}--var file_v1_bookmark_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)-var file_v1_bookmark_service_proto_goTypes = []interface{}{- (*CreateBookmarkRequest)(nil), // 0: bytebase.v1.CreateBookmarkRequest- (*DeleteBookmarkRequest)(nil), // 1: bytebase.v1.DeleteBookmarkRequest- (*ListBookmarksRequest)(nil), // 2: bytebase.v1.ListBookmarksRequest- (*ListBookmarksResponse)(nil), // 3: bytebase.v1.ListBookmarksResponse- (*Bookmark)(nil), // 4: bytebase.v1.Bookmark- (*emptypb.Empty)(nil), // 5: google.protobuf.Empty-}-var file_v1_bookmark_service_proto_depIdxs = []int32{- 4, // 0: bytebase.v1.CreateBookmarkRequest.bookmark:type_name -> bytebase.v1.Bookmark- 4, // 1: bytebase.v1.ListBookmarksResponse.bookmarks:type_name -> bytebase.v1.Bookmark- 0, // 2: bytebase.v1.BookmarkService.CreateBookmark:input_type -> bytebase.v1.CreateBookmarkRequest- 1, // 3: bytebase.v1.BookmarkService.DeleteBookmark:input_type -> bytebase.v1.DeleteBookmarkRequest- 2, // 4: bytebase.v1.BookmarkService.ListBookmarks:input_type -> bytebase.v1.ListBookmarksRequest- 4, // 5: bytebase.v1.BookmarkService.CreateBookmark:output_type -> bytebase.v1.Bookmark- 5, // 6: bytebase.v1.BookmarkService.DeleteBookmark:output_type -> google.protobuf.Empty- 3, // 7: bytebase.v1.BookmarkService.ListBookmarks:output_type -> bytebase.v1.ListBookmarksResponse- 5, // [5:8] is the sub-list for method output_type- 2, // [2:5] is the sub-list for method input_type- 2, // [2:2] is the sub-list for extension type_name- 2, // [2:2] is the sub-list for extension extendee- 0, // [0:2] is the sub-list for field type_name-}--func init() { file_v1_bookmark_service_proto_init() }-func file_v1_bookmark_service_proto_init() {- if File_v1_bookmark_service_proto != nil {- return- }- if !protoimpl.UnsafeEnabled {- file_v1_bookmark_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*CreateBookmarkRequest); i {- case 0:- return &v.state- case 1:- return &v.sizeCache- case 2:- return &v.unknownFields- default:- return nil- }- }- file_v1_bookmark_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*DeleteBookmarkRequest); i {- case 0:- return &v.state- case 1:- return &v.sizeCache- case 2:- return &v.unknownFields- default:- return nil- }- }- file_v1_bookmark_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*ListBookmarksRequest); i {- case 0:- return &v.state- case 1:- return &v.sizeCache- case 2:- return &v.unknownFields- default:- return nil- }- }- file_v1_bookmark_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*ListBookmarksResponse); i {- case 0:- return &v.state- case 1:- return &v.sizeCache- case 2:- return &v.unknownFields- default:- return nil- }- }- file_v1_bookmark_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*Bookmark); i {- case 0:- return &v.state- case 1:- return &v.sizeCache- case 2:- return &v.unknownFields- default:- return nil- }- }- }- type x struct{}- out := protoimpl.TypeBuilder{- File: protoimpl.DescBuilder{- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),- RawDescriptor: file_v1_bookmark_service_proto_rawDesc,- NumEnums: 0,- NumMessages: 5,- NumExtensions: 0,- NumServices: 1,- },- GoTypes: file_v1_bookmark_service_proto_goTypes,- DependencyIndexes: file_v1_bookmark_service_proto_depIdxs,- MessageInfos: file_v1_bookmark_service_proto_msgTypes,- }.Build()- File_v1_bookmark_service_proto = out.File- file_v1_bookmark_service_proto_rawDesc = nil- file_v1_bookmark_service_proto_goTypes = nil- file_v1_bookmark_service_proto_depIdxs = nil-}diff --git a/proto/generated-go/v1/bookmark_service.pb.gw.go b/proto/generated-go/v1/bookmark_service.pb.gw.godeleted file mode 100644index 2d348c7fbc..0000000000--- a/proto/generated-go/v1/bookmark_service.pb.gw.go+++ /dev/null@@ -1,361 +0,0 @@-// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.-// source: v1/bookmark_service.proto--/*-Package v1 is a reverse proxy.--It translates gRPC into RESTful JSON APIs.-*/-package v1--import (- "context"- "io"- "net/http"-- "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"- "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"- "google.golang.org/grpc"- "google.golang.org/grpc/codes"- "google.golang.org/grpc/grpclog"- "google.golang.org/grpc/metadata"- "google.golang.org/grpc/status"- "google.golang.org/protobuf/proto"-)--// Suppress "imported and not used" errors-var _ codes.Code-var _ io.Reader-var _ status.Status-var _ = runtime.String-var _ = utilities.NewDoubleArray-var _ = metadata.Join--func request_BookmarkService_CreateBookmark_0(ctx context.Context, marshaler runtime.Marshaler, client BookmarkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {- var protoReq CreateBookmarkRequest- var metadata runtime.ServerMetadata-- newReader, berr := utilities.IOReaderFactory(req.Body)- if berr != nil {- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)- }- if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Bookmark); err != nil && err != io.EOF {- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)- }-- msg, err := client.CreateBookmark(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))- return msg, metadata, err--}--func local_request_BookmarkService_CreateBookmark_0(ctx context.Context, marshaler runtime.Marshaler, server BookmarkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {- var protoReq CreateBookmarkRequest- var metadata runtime.ServerMetadata-- newReader, berr := utilities.IOReaderFactory(req.Body)- if berr != nil {- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)- }- if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Bookmark); err != nil && err != io.EOF {- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)- }-- msg, err := server.CreateBookmark(ctx, &protoReq)- return msg, metadata, err--}--func request_BookmarkService_DeleteBookmark_0(ctx context.Context, marshaler runtime.Marshaler, client BookmarkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {- var protoReq DeleteBookmarkRequest- var metadata runtime.ServerMetadata-- var (- val string- ok bool- err error- _ = err- )-- val, ok = pathParams["name"]- if !ok {- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")- }-- protoReq.Name, err = runtime.String(val)- if err != nil {- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)- }-- msg, err := client.DeleteBookmark(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))- return msg, metadata, err--}--func local_request_BookmarkService_DeleteBookmark_0(ctx context.Context, marshaler runtime.Marshaler, server BookmarkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {- var protoReq DeleteBookmarkRequest- var metadata runtime.ServerMetadata-- var (- val string- ok bool- err error- _ = err- )-- val, ok = pathParams["name"]- if !ok {- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")- }-- protoReq.Name, err = runtime.String(val)- if err != nil {- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)- }-- msg, err := server.DeleteBookmark(ctx, &protoReq)- return msg, metadata, err--}--var (- filter_BookmarkService_ListBookmarks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}-)--func request_BookmarkService_ListBookmarks_0(ctx context.Context, marshaler runtime.Marshaler, client BookmarkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {- var protoReq ListBookmarksRequest- var metadata runtime.ServerMetadata-- if err := req.ParseForm(); err != nil {- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)- }- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BookmarkService_ListBookmarks_0); err != nil {- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)- }-- msg, err := client.ListBookmarks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))- return msg, metadata, err--}--func local_request_BookmarkService_ListBookmarks_0(ctx context.Context, marshaler runtime.Marshaler, server BookmarkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {- var protoReq ListBookmarksRequest- var metadata runtime.ServerMetadata-- if err := req.ParseForm(); err != nil {- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)- }- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BookmarkService_ListBookmarks_0); err != nil {- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)- }-- msg, err := server.ListBookmarks(ctx, &protoReq)- return msg, metadata, err--}--// RegisterBookmarkServiceHandlerServer registers the http handlers for service BookmarkService to "mux".-// UnaryRPC :call BookmarkServiceServer directly.-// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.-// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBookmarkServiceHandlerFromEndpoint instead.-func RegisterBookmarkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BookmarkServiceServer) error {-- mux.Handle("POST", pattern_BookmarkService_CreateBookmark_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {- ctx, cancel := context.WithCancel(req.Context())- defer cancel()- var stream runtime.ServerTransportStream- ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)- var err error- var annotatedContext context.Context- annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.BookmarkService/CreateBookmark", runtime.WithHTTPPathPattern("/v1/bookmarks"))- if err != nil {- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)- return- }- resp, md, err := local_request_BookmarkService_CreateBookmark_0(annotatedContext, inboundMarshaler, server, req, pathParams)- md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)- if err != nil {- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)- return- }-- forward_BookmarkService_CreateBookmark_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)-- })-- mux.Handle("DELETE", pattern_BookmarkService_DeleteBookmark_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {- ctx, cancel := context.WithCancel(req.Context())- defer cancel()- var stream runtime.ServerTransportStream- ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)- var err error- var annotatedContext context.Context- annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.BookmarkService/DeleteBookmark", runtime.WithHTTPPathPattern("/v1/{name=bookmarks/*}"))- if err != nil {- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)- return- }- resp, md, err := local_request_BookmarkService_DeleteBookmark_0(annotatedContext, inboundMarshaler, server, req, pathParams)- md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)- if err != nil {- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)- return- }-- forward_BookmarkService_DeleteBookmark_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)-- })-- mux.Handle("GET", pattern_BookmarkService_ListBookmarks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {- ctx, cancel := context.WithCancel(req.Context())- defer cancel()- var stream runtime.ServerTransportStream- ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)- var err error- var annotatedContext context.Context- annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.BookmarkService/ListBookmarks", runtime.WithHTTPPathPattern("/v1/bookmarks"))- if err != nil {- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)- return- }- resp, md, err := local_request_BookmarkService_ListBookmarks_0(annotatedContext, inboundMarshaler, server, req, pathParams)- md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)- if err != nil {- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)- return- }-- forward_BookmarkService_ListBookmarks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)-- })-- return nil-}--// RegisterBookmarkServiceHandlerFromEndpoint is same as RegisterBookmarkServiceHandler but-// automatically dials to "endpoint" and closes the connection when "ctx" gets done.-func RegisterBookmarkServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {- conn, err := grpc.DialContext(ctx, endpoint, opts...)- if err != nil {- return err- }- defer func() {- if err != nil {- if cerr := conn.Close(); cerr != nil {- grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)- }- return- }- go func() {- <-ctx.Done()- if cerr := conn.Close(); cerr != nil {- grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)- }- }()- }()-- return RegisterBookmarkServiceHandler(ctx, mux, conn)-}--// RegisterBookmarkServiceHandler registers the http handlers for service BookmarkService to "mux".-// The handlers forward requests to the grpc endpoint over "conn".-func RegisterBookmarkServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {- return RegisterBookmarkServiceHandlerClient(ctx, mux, NewBookmarkServiceClient(conn))-}--// RegisterBookmarkServiceHandlerClient registers the http handlers for service BookmarkService-// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BookmarkServiceClient".-// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BookmarkServiceClient"-// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in-// "BookmarkServiceClient" to call the correct interceptors.-func RegisterBookmarkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BookmarkServiceClient) error {-- mux.Handle("POST", pattern_BookmarkService_CreateBookmark_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {- ctx, cancel := context.WithCancel(req.Context())- defer cancel()- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)- var err error- var annotatedContext context.Context- annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.BookmarkService/CreateBookmark", runtime.WithHTTPPathPattern("/v1/bookmarks"))- if err != nil {- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)- return- }- resp, md, err := request_BookmarkService_CreateBookmark_0(annotatedContext, inboundMarshaler, client, req, pathParams)- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)- if err != nil {- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)- return- }-- forward_BookmarkService_CreateBookmark_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)-- })-- mux.Handle("DELETE", pattern_BookmarkService_DeleteBookmark_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {- ctx, cancel := context.WithCancel(req.Context())- defer cancel()- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)- var err error- var annotatedContext context.Context- annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.BookmarkService/DeleteBookmark", runtime.WithHTTPPathPattern("/v1/{name=bookmarks/*}"))- if err != nil {- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)- return- }- resp, md, err := request_BookmarkService_DeleteBookmark_0(annotatedContext, inboundMarshaler, client, req, pathParams)- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)- if err != nil {- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)- return- }-- forward_BookmarkService_DeleteBookmark_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)-- })-- mux.Handle("GET", pattern_BookmarkService_ListBookmarks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {- ctx, cancel := context.WithCancel(req.Context())- defer cancel()- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)- var err error- var annotatedContext context.Context- annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.BookmarkService/ListBookmarks", runtime.WithHTTPPathPattern("/v1/bookmarks"))- if err != nil {- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)- return- }- resp, md, err := request_BookmarkService_ListBookmarks_0(annotatedContext, inboundMarshaler, client, req, pathParams)- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)- if err != nil {- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)- return- }-- forward_BookmarkService_ListBookmarks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)-- })-- return nil-}--var (- pattern_BookmarkService_CreateBookmark_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "bookmarks"}, ""))-- pattern_BookmarkService_DeleteBookmark_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "bookmarks", "name"}, ""))-- pattern_BookmarkService_ListBookmarks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "bookmarks"}, ""))-)--var (- forward_BookmarkService_CreateBookmark_0 = runtime.ForwardResponseMessage-- forward_BookmarkService_DeleteBookmark_0 = runtime.ForwardResponseMessage-- forward_BookmarkService_ListBookmarks_0 = runtime.ForwardResponseMessage-)diff --git a/proto/generated-go/v1/bookmark_service_grpc.pb.go b/proto/generated-go/v1/bookmark_service_grpc.pb.godeleted file mode 100644index 6ea4d174ef..0000000000--- a/proto/generated-go/v1/bookmark_service_grpc.pb.go+++ /dev/null@@ -1,190 +0,0 @@-// Code generated by protoc-gen-go-grpc. DO NOT EDIT.-// versions:-// - protoc-gen-go-grpc v1.3.0-// - protoc (unknown)-// source: v1/bookmark_service.proto--package v1--import (- context "context"- grpc "google.golang.org/grpc"- codes "google.golang.org/grpc/codes"- status "google.golang.org/grpc/status"- emptypb "google.golang.org/protobuf/types/known/emptypb"-)--// This is a compile-time assertion to ensure that this generated file-// is compatible with the grpc package it is being compiled against.-// Requires gRPC-Go v1.32.0 or later.-const _ = grpc.SupportPackageIsVersion7--const (- BookmarkService_CreateBookmark_FullMethodName = "/bytebase.v1.BookmarkService/CreateBookmark"- BookmarkService_DeleteBookmark_FullMethodName = "/bytebase.v1.BookmarkService/DeleteBookmark"- BookmarkService_ListBookmarks_FullMethodName = "/bytebase.v1.BookmarkService/ListBookmarks"-)--// BookmarkServiceClient is the client API for BookmarkService service.-//-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.-type BookmarkServiceClient interface {- // CreateBookmark creates a new bookmark.- CreateBookmark(ctx context.Context, in *CreateBookmarkRequest, opts ...grpc.CallOption) (*Bookmark, error)- // DeleteBookmark deletes a bookmark.- DeleteBookmark(ctx context.Context, in *DeleteBookmarkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)- // ListBookmarks lists bookmarks.- ListBookmarks(ctx context.Context, in *ListBookmarksRequest, opts ...grpc.CallOption) (*ListBookmarksResponse, error)-}--type bookmarkServiceClient struct {- cc grpc.ClientConnInterface-}--func NewBookmarkServiceClient(cc grpc.ClientConnInterface) BookmarkServiceClient {- return &bookmarkServiceClient{cc}-}--func (c *bookmarkServiceClient) CreateBookmark(ctx context.Context, in *CreateBookmarkRequest, opts ...grpc.CallOption) (*Bookmark, error) {- out := new(Bookmark)- err := c.cc.Invoke(ctx, BookmarkService_CreateBookmark_FullMethodName, in, out, opts...)- if err != nil {- return nil, err- }- return out, nil-}--func (c *bookmarkServiceClient) DeleteBookmark(ctx context.Context, in *DeleteBookmarkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {- out := new(emptypb.Empty)- err := c.cc.Invoke(ctx, BookmarkService_DeleteBookmark_FullMethodName, in, out, opts...)- if err != nil {- return nil, err- }- return out, nil-}--func (c *bookmarkServiceClient) ListBookmarks(ctx context.Context, in *ListBookmarksRequest, opts ...grpc.CallOption) (*ListBookmarksResponse, error) {- out := new(ListBookmarksResponse)- err := c.cc.Invoke(ctx, BookmarkService_ListBookmarks_FullMethodName, in, out, opts...)- if err != nil {- return nil, err- }- return out, nil-}--// BookmarkServiceServer is the server API for BookmarkService service.-// All implementations must embed UnimplementedBookmarkServiceServer-// for forward compatibility-type BookmarkServiceServer interface {- // CreateBookmark creates a new bookmark.- CreateBookmark(context.Context, *CreateBookmarkRequest) (*Bookmark, error)- // DeleteBookmark deletes a bookmark.- DeleteBookmark(context.Context, *DeleteBookmarkRequest) (*emptypb.Empty, error)- // ListBookmarks lists bookmarks.- ListBookmarks(context.Context, *ListBookmarksRequest) (*ListBookmarksResponse, error)- mustEmbedUnimplementedBookmarkServiceServer()-}--// UnimplementedBookmarkServiceServer must be embedded to have forward compatible implementations.-type UnimplementedBookmarkServiceServer struct {-}--func (UnimplementedBookmarkServiceServer) CreateBookmark(context.Context, *CreateBookmarkRequest) (*Bookmark, error) {- return nil, status.Errorf(codes.Unimplemented, "method CreateBookmark not implemented")-}-func (UnimplementedBookmarkServiceServer) DeleteBookmark(context.Context, *DeleteBookmarkRequest) (*emptypb.Empty, error) {- return nil, status.Errorf(codes.Unimplemented, "method DeleteBookmark not implemented")-}-func (UnimplementedBookmarkServiceServer) ListBookmarks(context.Context, *ListBookmarksRequest) (*ListBookmarksResponse, error) {- return nil, status.Errorf(codes.Unimplemented, "method ListBookmarks not implemented")-}-func (UnimplementedBookmarkServiceServer) mustEmbedUnimplementedBookmarkServiceServer() {}--// UnsafeBookmarkServiceServer may be embedded to opt out of forward compatibility for this service.-// Use of this interface is not recommended, as added methods to BookmarkServiceServer will-// result in compilation errors.-type UnsafeBookmarkServiceServer interface {- mustEmbedUnimplementedBookmarkServiceServer()-}--func RegisterBookmarkServiceServer(s grpc.ServiceRegistrar, srv BookmarkServiceServer) {- s.RegisterService(&BookmarkService_ServiceDesc, srv)-}--func _BookmarkService_CreateBookmark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {- in := new(CreateBookmarkRequest)- if err := dec(in); err != nil {- return nil, err- }- if interceptor == nil {- return srv.(BookmarkServiceServer).CreateBookmark(ctx, in)- }- info := &grpc.UnaryServerInfo{- Server: srv,- FullMethod: BookmarkService_CreateBookmark_FullMethodName,- }- handler := func(ctx context.Context, req interface{}) (interface{}, error) {- return srv.(BookmarkServiceServer).CreateBookmark(ctx, req.(*CreateBookmarkRequest))- }- return interceptor(ctx, in, info, handler)-}--func _BookmarkService_DeleteBookmark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {- in := new(DeleteBookmarkRequest)- if err := dec(in); err != nil {- return nil, err- }- if interceptor == nil {- return srv.(BookmarkServiceServer).DeleteBookmark(ctx, in)- }- info := &grpc.UnaryServerInfo{- Server: srv,- FullMethod: BookmarkService_DeleteBookmark_FullMethodName,- }- handler := func(ctx context.Context, req interface{}) (interface{}, error) {- return srv.(BookmarkServiceServer).DeleteBookmark(ctx, req.(*DeleteBookmarkRequest))- }- return interceptor(ctx, in, info, handler)-}--func _BookmarkService_ListBookmarks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {- in := new(ListBookmarksRequest)- if err := dec(in); err != nil {- return nil, err- }- if interceptor == nil {- return srv.(BookmarkServiceServer).ListBookmarks(ctx, in)- }- info := &grpc.UnaryServerInfo{- Server: srv,- FullMethod: BookmarkService_ListBookmarks_FullMethodName,- }- handler := func(ctx context.Context, req interface{}) (interface{}, error) {- return srv.(BookmarkServiceServer).ListBookmarks(ctx, req.(*ListBookmarksRequest))- }- return interceptor(ctx, in, info, handler)-}--// BookmarkService_ServiceDesc is the grpc.ServiceDesc for BookmarkService service.-// It's only intended for direct use with grpc.RegisterService,-// and not to be introspected or modified (even as a copy)-var BookmarkService_ServiceDesc = grpc.ServiceDesc{- ServiceName: "bytebase.v1.BookmarkService",- HandlerType: (*BookmarkServiceServer)(nil),- Methods: []grpc.MethodDesc{- {- MethodName: "CreateBookmark",- Handler: _BookmarkService_CreateBookmark_Handler,- },- {- MethodName: "DeleteBookmark",- Handler: _BookmarkService_DeleteBookmark_Handler,- },- {- MethodName: "ListBookmarks",- Handler: _BookmarkService_ListBookmarks_Handler,- },- },- Streams: []grpc.StreamDesc{},- Metadata: "v1/bookmark_service.proto",-}diff --git a/proto/v1/bookmark_service.proto b/proto/v1/bookmark_service.protodeleted file mode 100644index 7c3faf54c7..0000000000--- a/proto/v1/bookmark_service.proto+++ /dev/null@@ -1,83 +0,0 @@-syntax = "proto3";--package bytebase.v1;--import "google/api/annotations.proto";-import "google/api/client.proto";-import "google/api/field_behavior.proto";-import "google/protobuf/empty.proto";--option go_package = "generated-go/v1";--service BookmarkService {- // CreateBookmark creates a new bookmark.- rpc CreateBookmark(CreateBookmarkRequest) returns (Bookmark) {- option (google.api.http) = {- post: "/v1/bookmarks"- body: "bookmark"- };- option (google.api.method_signature) = "";- }-- // DeleteBookmark deletes a bookmark.- rpc DeleteBookmark(DeleteBookmarkRequest) returns (google.protobuf.Empty) {- option (google.api.http) = {delete: "/v1/{name=bookmarks/*}"};- option (google.api.method_signature) = "name";- }-- // ListBookmarks lists bookmarks.- rpc ListBookmarks(ListBookmarksRequest) returns (ListBookmarksResponse) {- option (google.api.http) = {get: "/v1/bookmarks"};- option (google.api.method_signature) = "";- }-}--message CreateBookmarkRequest {- // The bookmark to create.- Bookmark bookmark = 1 [(google.api.field_behavior) = REQUIRED];-}--message DeleteBookmarkRequest {- // The name of the bookmark to delete.- // Format: bookmarks/{bookmark}- string name = 1 [(google.api.field_behavior) = REQUIRED];-}--message ListBookmarksRequest {- // Not used. The maximum number of bookmarks to return. The service may return fewer than- // this value.- // If unspecified, at most 50 bookmarks will be returned.- // The maximum value is 1000; values above 1000 will be coerced to 1000.- int32 page_size = 1;-- // Not used. A page token, received from a previous `ListBookmarks` call.- // Provide this to retrieve the subsequent page.- //- // When paginating, all other parameters provided to `ListBookmarks` must match- // the call that provided the page token.- string page_token = 2;-}--message ListBookmarksResponse {- // The list of bookmarks.- repeated Bookmark bookmarks = 1;-- // Not used. A token, which can be sent as `page_token` to retrieve the next page.- // If this field is omitted, there are no subsequent pages.- string next_page_token = 2;-}--message Bookmark {- // The name of the bookmark.- // Format: bookmarks/{bookmark}, user and bookmark are server-generated unique IDs.- string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];-- // The title of the bookmark.- string title = 2 [(google.api.field_behavior) = REQUIRED];-- // The resource link of the bookmark. Only support issue link for now.- // Format:- // Issue: /issue/slug(issue_name)-{issue_uid}- // Example: /issue/start-here-add-email-column-to-employee-table-101- string link = 3 [(google.api.field_behavior) = REQUIRED];-}