Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore(backend): retire inbox service (#10281)

boojackba3c7b031edb
diff --git a/backend/api/v1/acl_iam.go b/backend/api/v1/acl_iam.go
index af8c3e81d2..508f4e60ad 100644
--- a/backend/api/v1/acl_iam.go
+++ b/backend/api/v1/acl_iam.go
@@ -220,9 +220,6 @@ func isSkippedMethod(fullMethod string) bool {
v1pb.AuthService_Logout_FullMethodName,
v1pb.CelService_BatchParse_FullMethodName,
v1pb.CelService_BatchDeparse_FullMethodName,
- v1pb.InboxService_GetInboxSummary_FullMethodName,
- v1pb.InboxService_ListInbox_FullMethodName,
- v1pb.InboxService_UpdateInbox_FullMethodName,
v1pb.LoggingService_ListLogs_FullMethodName,
v1pb.LoggingService_GetLog_FullMethodName,
v1pb.LoggingService_ExportLogs_FullMethodName,
diff --git a/backend/api/v1/inbox_service.go b/backend/api/v1/inbox_service.go
deleted file mode 100644
index 4652e1cb37..0000000000
--- a/backend/api/v1/inbox_service.go
+++ /dev/null
@@ -1,208 +0,0 @@
-package v1
-
-import (
- "context"
- "fmt"
- "log/slog"
- "time"
-
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/common/log"
- api "github.com/bytebase/bytebase/backend/legacyapi"
- "github.com/bytebase/bytebase/backend/store"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-// InboxService implements the inbox service.
-type InboxService struct {
- v1pb.UnimplementedInboxServiceServer
- store *store.Store
-}
-
-// NewInboxService creates a new InboxService.
-func NewInboxService(store *store.Store) *InboxService {
- return &InboxService{
- store: store,
- }
-}
-
-// ListInbox lists the inbox messages.
-func (s *InboxService) ListInbox(ctx context.Context, request *v1pb.ListInboxRequest) (*v1pb.ListInboxResponse, error) {
- filters, err := parseFilter(request.Filter)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, err.Error())
- }
-
- var pageToken storepb.PageToken
- if request.PageToken != "" {
- if err := unmarshalPageToken(request.PageToken, &pageToken); err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "invalid page token: %v", err)
- }
- if pageToken.Limit != request.PageSize {
- return nil, status.Errorf(codes.InvalidArgument, "request page size does not match the page token")
- }
- } else {
- pageToken.Limit = request.PageSize
- }
- limit := int(pageToken.Limit)
- if limit <= 0 {
- limit = 100
- }
- if limit > 1000 {
- limit = 1000
- }
- limitPlusOne := limit + 1
- offset := int(pageToken.Offset)
-
- principalID, ok := ctx.Value(common.PrincipalIDContextKey).(int)
- if !ok {
- return nil, status.Errorf(codes.Internal, "principal ID not found")
- }
- find := &store.FindInboxMessage{
- ReceiverUID: &principalID,
- Limit: &limitPlusOne,
- Offset: &offset,
- }
-
- for _, spec := range filters {
- switch spec.key {
- case "create_time":
- if spec.operator != comparatorTypeGreaterEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support ">=" operation for "create_time" filter`)
- }
- t, err := time.Parse(time.RFC3339, spec.value)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "invalid start_time filter %q", spec.value)
- }
- ts := t.Unix()
- find.ReadCreatedAfterTs = &ts
- default:
- return nil, status.Errorf(codes.InvalidArgument, "unsupport filter %s", spec.key)
- }
- }
-
- inboxList, err := s.store.FindInbox(ctx, find)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to list inbox messages with error: %v", err.Error())
- }
-
- nextPageToken := ""
- if len(inboxList) == limitPlusOne {
- inboxList = inboxList[:limit]
- if nextPageToken, err = marshalPageToken(&storepb.PageToken{
- Limit: int32(limit),
- Offset: int32(limit + offset),
- }); err != nil {
- return nil, status.Errorf(codes.Internal, "failed to marshal next page token, error: %v", err)
- }
- }
-
- resp := &v1pb.ListInboxResponse{
- NextPageToken: nextPageToken,
- }
- for _, inbox := range inboxList {
- inboxV1, err := s.convertToInboxMessage(ctx, inbox)
- if err != nil {
- slog.Error("failed to convert inbox message", slog.Int("inbox", inbox.UID), log.BBError(err))
- continue
- }
- resp.InboxMessages = append(resp.InboxMessages, inboxV1)
- }
-
- return resp, nil
-}
-
-// GetInboxSummary gets the inbox summary.
-func (s *InboxService) GetInboxSummary(ctx context.Context, _ *v1pb.GetInboxSummaryRequest) (*v1pb.InboxSummary, error) {
- principalID, ok := ctx.Value(common.PrincipalIDContextKey).(int)
- if !ok {
- return nil, status.Errorf(codes.Internal, "principal ID not found")
- }
- summary, err := s.store.FindInboxSummary(ctx, principalID)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to find inbox summary with error: %v", err.Error())
- }
-
- return &v1pb.InboxSummary{
- Unread: int32(summary.Unread),
- UnreadError: int32(summary.UnreadError),
- }, nil
-}
-
-// UpdateInbox updates the inbox.
-func (s *InboxService) UpdateInbox(ctx context.Context, request *v1pb.UpdateInboxRequest) (*v1pb.InboxMessage, error) {
- if request.InboxMessage == nil {
- return nil, status.Errorf(codes.InvalidArgument, "inbox message must be set")
- }
- if request.UpdateMask == nil {
- return nil, status.Errorf(codes.InvalidArgument, "update_mask must be set")
- }
-
- inboxUID, err := common.GetUIDFromName(request.InboxMessage.Name, common.InboxNamePrefix)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, err.Error())
- }
-
- inboxPatch := &store.UpdateInboxMessage{
- UID: inboxUID,
- }
-
- for _, path := range request.UpdateMask.Paths {
- switch path {
- case "status":
- inboxStatus, err := converToInboxAPIStatus(request.InboxMessage.Status)
- if err != nil {
- return nil, err
- }
- inboxPatch.Status = inboxStatus
- default:
- return nil, status.Errorf(codes.InvalidArgument, "unsupport update_mask %s", path)
- }
- }
-
- inbox, err := s.store.PatchInbox(ctx, inboxPatch)
- if err != nil {
- if common.ErrorCode(err) == common.NotFound {
- return nil, status.Errorf(codes.NotFound, "cannot found inbox message %s", request.InboxMessage.Name)
- }
- return nil, status.Errorf(codes.Internal, "failed to update inbox message %s with error: %v", request.InboxMessage.Name, err.Error())
- }
-
- return s.convertToInboxMessage(ctx, inbox)
-}
-
-func converToInboxAPIStatus(inboxStatus v1pb.InboxMessage_Status) (api.InboxStatus, error) {
- switch inboxStatus {
- case v1pb.InboxMessage_STATUS_READ:
- return api.Read, nil
- case v1pb.InboxMessage_STATUS_UNREAD:
- return api.Unread, nil
- default:
- return api.Unread, status.Errorf(codes.InvalidArgument, "invalid inbox status %v", inboxStatus)
- }
-}
-
-func (s *InboxService) convertToInboxMessage(ctx context.Context, inbox *store.InboxMessage) (*v1pb.InboxMessage, error) {
- status := v1pb.InboxMessage_STATUS_UNSPECIFIED
- switch inbox.Status {
- case api.Unread:
- status = v1pb.InboxMessage_STATUS_UNREAD
- case api.Read:
- status = v1pb.InboxMessage_STATUS_READ
- }
- activity, err := convertToLogEntity(ctx, s.store, inbox.Activity)
- if err != nil {
- return nil, err
- }
-
- return &v1pb.InboxMessage{
- Name: fmt.Sprintf("%s%d", common.InboxNamePrefix, inbox.UID),
- ActivityUid: fmt.Sprintf("%d", inbox.ActivityUID),
- Status: status,
- Activity: activity,
- }, nil
-}
diff --git a/backend/common/resource_name.go b/backend/common/resource_name.go
index 7309127be5..b0c328f275 100644
--- a/backend/common/resource_name.go
+++ b/backend/common/resource_name.go
@@ -42,7 +42,6 @@ const (
IssueNamePrefix = "issues/"
PipelineNamePrefix = "pipelines/"
LogNamePrefix = "logs/"
- InboxNamePrefix = "inbox/"
BranchPrefix = "branches/"
DeploymentConfigPrefix = "deploymentConfigs/"
ChangelistsPrefix = "changelists/"
diff --git a/backend/component/activity/manager.go b/backend/component/activity/manager.go
index 448c970ed3..2d3412ac74 100644
--- a/backend/component/activity/manager.go
+++ b/backend/component/activity/manager.go
@@ -308,15 +308,6 @@ func (m *Manager) CreateActivity(ctx context.Context, create *store.ActivityMess
if meta.Issue == nil {
return activity, nil
}
- postInbox, err := shouldPostInbox(activity, create.Type)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to post webhook event after changing the issue task status: %s", meta.Issue.Title)
- }
- if postInbox {
- if err := m.postInboxIssueActivity(ctx, meta.Issue, activity.UID); err != nil {
- return nil, err
- }
- }
webhookList, err := m.store.FindProjectWebhookV2(ctx, &store.FindProjectWebhookMessage{
ProjectID: &meta.Issue.Project.UID,
@@ -767,72 +758,6 @@ func (m *Manager) getWebhookContext(ctx context.Context, activity *store.Activit
return &webhookCtx, nil
}
-func (m *Manager) postInboxIssueActivity(ctx context.Context, issue *store.IssueMessage, activityID int) error {
- if issue.Creator.ID != api.SystemBotID {
- if _, err := m.store.CreateInbox(ctx, &store.InboxMessage{
- ReceiverUID: issue.Creator.ID,
- ActivityUID: activityID,
- }); err != nil {
- return errors.Wrapf(err, "failed to post activity to creator inbox: %d", issue.Creator.ID)
- }
- }
-
- if issue.Assignee != nil && issue.Assignee.ID != api.SystemBotID && issue.Assignee.ID != issue.Creator.ID {
- if _, err := m.store.CreateInbox(ctx, &store.InboxMessage{
- ReceiverUID: issue.Assignee.ID,
- ActivityUID: activityID,
- }); err != nil {
- return errors.Wrapf(err, "failed to post activity to assignee inbox: %d", issue.Assignee.ID)
- }
- }
-
- for _, subscriber := range issue.Subscribers {
- if subscriber.ID != api.SystemBotID && subscriber.ID != issue.Creator.ID && (issue.Assignee == nil || subscriber.ID != issue.Assignee.ID) {
- if _, err := m.store.CreateInbox(ctx, &store.InboxMessage{
- ReceiverUID: subscriber.ID,
- ActivityUID: activityID,
- }); err != nil {
- return errors.Wrapf(err, "failed to post activity to subscriber inbox: %d", subscriber.ID)
- }
- }
- }
-
- return nil
-}
-
-func shouldPostInbox(activity *store.ActivityMessage, createType api.ActivityType) (bool, error) {
- switch createType {
- case api.ActivityIssueCreate:
- return true, nil
- case api.ActivityIssueStatusUpdate:
- return true, nil
- case api.ActivityIssueCommentCreate:
- return true, nil
- case api.ActivityIssueFieldUpdate:
- return true, nil
- case api.ActivityPipelineTaskStatementUpdate:
- return true, nil
- case api.ActivityPipelineTaskEarliestAllowedTimeUpdate:
- return true, nil
- case api.ActivityPipelineStageStatusUpdate:
- return false, nil
- case api.ActivityPipelineTaskStatusUpdate:
- update := new(api.ActivityPipelineTaskStatusUpdatePayload)
- if err := json.Unmarshal([]byte(activity.Payload), update); err != nil {
- return false, err
- }
- // To reduce noise, for now we only post status update to inbox upon task failure.
- if update.NewStatus == api.TaskFailed {
- return true, nil
- }
- case api.ActivityNotifyIssueApproved:
- return false, nil
- case api.ActivityNotifyPipelineRollout:
- return false, nil
- }
- return false, nil
-}
-
func getUsersFromWorkspaceRole(s *store.Store, role api.Role) func(context.Context) ([]*store.UserMessage, error) {
return func(ctx context.Context) ([]*store.UserMessage, error) {
return s.ListUsers(ctx, &store.FindUserMessage{
diff --git a/backend/enterprise/api/plan.yaml b/backend/enterprise/api/plan.yaml
index da004967a5..3619e40587 100644
--- a/backend/enterprise/api/plan.yaml
+++ b/backend/enterprise/api/plan.yaml
@@ -27,7 +27,6 @@ categoryList:
- read-replica
- type: collaboration
featureList:
- - inbox-notification
- ui-based-sql-review
- shared-sql-script
- gitops-workflow
@@ -105,7 +104,6 @@ planList:
- type: admin-mode
- type: saved-sql-script
# Collaboration
- - type: inbox-notification
- type: ui-based-sql-review
- type: gitops-workflow
content: gitops-workflow-basic
@@ -180,7 +178,6 @@ planList:
- type: admin-mode
- type: saved-sql-script
# Collaboration
- - type: inbox-notification
- type: ui-based-sql-review
- type: shared-sql-script
- type: gitops-workflow
@@ -258,7 +255,6 @@ planList:
- type: read-replica
- type: saved-sql-script
# Collaboration
- - type: inbox-notification
- type: ui-based-sql-review
- type: shared-sql-script
- type: gitops-workflow
diff --git a/backend/legacyapi/activity.go b/backend/legacyapi/activity.go
index dad1da2dbd..d0f9012bc2 100644
--- a/backend/legacyapi/activity.go
+++ b/backend/legacyapi/activity.go
@@ -102,7 +102,6 @@ const (
// json naming convention. More importantly, frontend code can simply use JSON.parse to
// convert to the expected struct there.
type ActivityIssueCreatePayload struct {
- // Used by inbox to display info without paying the join cost
IssueName string `json:"issueName"`
}
@@ -128,25 +127,22 @@ type ActivityIssueCommentCreatePayload struct {
ApprovalEvent *ApprovalEvent `json:"approvalEvent,omitempty"`
- // Used by inbox to display info without paying the join cost
IssueName string `json:"issueName"`
}
// ActivityIssueFieldUpdatePayload is the API message payloads for updating issue fields.
type ActivityIssueFieldUpdatePayload struct {
- FieldID IssueFieldID `json:"fieldId"`
- OldValue string `json:"oldValue,omitempty"`
- NewValue string `json:"newValue,omitempty"`
- // Used by inbox to display info without paying the join cost
- IssueName string `json:"issueName"`
+ FieldID IssueFieldID `json:"fieldId"`
+ OldValue string `json:"oldValue,omitempty"`
+ NewValue string `json:"newValue,omitempty"`
+ IssueName string `json:"issueName"`
}
// ActivityIssueStatusUpdatePayload is the API message payloads for updating issue status.
type ActivityIssueStatusUpdatePayload struct {
OldStatus IssueStatus `json:"oldStatus,omitempty"`
NewStatus IssueStatus `json:"newStatus,omitempty"`
- // Used by inbox to display info without paying the join cost
- IssueName string `json:"issueName"`
+ IssueName string `json:"issueName"`
}
// ActivityIssueApprovalNotifyPayload is the API message payloads for notifying issue approval.
@@ -160,7 +156,6 @@ type ActivityPipelineStageStatusUpdatePayload struct {
StageID int `json:"stageId"`
StageStatusUpdateType StageStatusUpdateType `json:"stageStatusUpdateType"`
- // Used by inbox to display info without paying the join cost
IssueName string `json:"issueName"`
StageName string `json:"stageName"`
}
@@ -170,17 +165,15 @@ type ActivityPipelineTaskStatusUpdatePayload struct {
TaskID int `json:"taskId"`
OldStatus TaskStatus `json:"oldStatus,omitempty"`
NewStatus TaskStatus `json:"newStatus,omitempty"`
- // Used by inbox to display info without paying the join cost
- IssueName string `json:"issueName"`
- TaskName string `json:"taskName"`
+ IssueName string `json:"issueName"`
+ TaskName string `json:"taskName"`
}
type ActivityPipelineTaskRunStatusUpdatePayload struct {
TaskID int `json:"taskId"`
NewStatus TaskRunStatus `json:"newStatus,omitempty"`
- // Used by inbox to display info without paying the join cost
- IssueName string `json:"issueName"`
- TaskName string `json:"taskName"`
+ IssueName string `json:"issueName"`
+ TaskName string `json:"taskName"`
}
// ActivityPipelineTaskFileCommitPayload is the API message payloads for committing pipeline task files.
@@ -200,19 +193,17 @@ type ActivityPipelineTaskStatementUpdatePayload struct {
NewStatement string `json:"newStatement,omitempty"`
OldSheetID int `json:"oldSheetId,omitempty"`
NewSheetID int `json:"newSheetId,omitempty"`
- // Used by inbox to display info without paying the join cost
- IssueName string `json:"issueName"`
- TaskName string `json:"taskName"`
+ IssueName string `json:"issueName"`
+ TaskName string `json:"taskName"`
}
// ActivityPipelineTaskEarliestAllowedTimeUpdatePayload is the API message payloads for pipeline task the earliest allowed time updates.
type ActivityPipelineTaskEarliestAllowedTimeUpdatePayload struct {
- TaskID int `json:"taskId"`
- OldEarliestAllowedTs int64 `json:"oldEarliestAllowedTs,omitempty"`
- NewEarliestAllowedTs int64 `json:"newEarliestAllowedTs,omitempty"`
- // Used by inbox to display info without paying the join cost
- IssueName string `json:"issueName"`
- TaskName string `json:"taskName"`
+ TaskID int `json:"taskId"`
+ OldEarliestAllowedTs int64 `json:"oldEarliestAllowedTs,omitempty"`
+ NewEarliestAllowedTs int64 `json:"newEarliestAllowedTs,omitempty"`
+ IssueName string `json:"issueName"`
+ TaskName string `json:"taskName"`
}
// ActivityPipelineTaskPriorBackupPayload is the API message payloads for pipeline task prior backup.
@@ -220,7 +211,6 @@ type ActivityPipelineTaskPriorBackupPayload struct {
TaskID int `json:"taskId"`
BackupSchemaMetadata []SchemaMetadata `json:"schemaMetadata"`
- // Used by inbox to display info without paying the join cost
IssueName string `json:"issueName"`
TaskName string `json:"taskName"`
}
diff --git a/backend/legacyapi/inbox.go b/backend/legacyapi/inbox.go
deleted file mode 100644
index 82a0ce58b7..0000000000
--- a/backend/legacyapi/inbox.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package api
-
-// InboxStatus is the status for inboxes.
-type InboxStatus string
-
-const (
- // Unread is the inbox status for UNREAD.
- Unread InboxStatus = "UNREAD"
- // Read is the inbox status for READ.
- Read InboxStatus = "READ"
-)
diff --git a/backend/server/grpc_routes.go b/backend/server/grpc_routes.go
index b3807b55d1..daa18f550f 100644
--- a/backend/server/grpc_routes.go
+++ b/backend/server/grpc_routes.go
@@ -88,7 +88,6 @@ func configureGrpcRouters(
v1pb.RegisterBranchServiceServer(grpcServer, apiv1.NewBranchService(stores, licenseService))
v1pb.RegisterCelServiceServer(grpcServer, apiv1.NewCelService())
v1pb.RegisterLoggingServiceServer(grpcServer, apiv1.NewLoggingService(stores))
- v1pb.RegisterInboxServiceServer(grpcServer, apiv1.NewInboxService(stores))
v1pb.RegisterChangelistServiceServer(grpcServer, apiv1.NewChangelistService(stores, profile, iamManager))
// REST gateway proxy.
@@ -155,9 +154,6 @@ func configureGrpcRouters(
if err := v1pb.RegisterLoggingServiceHandler(ctx, mux, grpcConn); err != nil {
return nil, nil, err
}
- if err := v1pb.RegisterInboxServiceHandler(ctx, mux, grpcConn); err != nil {
- return nil, nil, err
- }
if err := v1pb.RegisterChangelistServiceHandler(ctx, mux, grpcConn); err != nil {
return nil, nil, err
}
diff --git a/backend/store/inbox.go b/backend/store/inbox.go
deleted file mode 100644
index e42634fdd7..0000000000
--- a/backend/store/inbox.go
+++ /dev/null
@@ -1,331 +0,0 @@
-package store
-
-import (
- "context"
- "database/sql"
- "fmt"
- "strings"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- api "github.com/bytebase/bytebase/backend/legacyapi"
-)
-
-// InboxMessage is the API message for inbox.
-type InboxMessage struct {
- UID int
-
- // Domain specific fields
- ReceiverUID int
- ActivityUID int
- Status api.InboxStatus
- Activity *ActivityMessage
-}
-
-// InboxSummaryMessage is the API message for inbox summary info.
-// This is used by the frontend to render the inbox sidebar item without fetching the actual inbox items.
-// This returns json instead of jsonapi since it't not dealing with a particular resource.
-type InboxSummaryMessage struct {
- Unread int
- UnreadError int
-}
-
-// FindInboxMessage is the API message for finding the inbox.
-type FindInboxMessage struct {
- // Domain specific fields
- ReceiverUID *int
- // If specified, then it will only fetch "UNREAD" item or "READ" item whose activity created after "CreatedAfterTs"
- ReadCreatedAfterTs *int64
- Limit *int
- Offset *int
-}
-
-// UpdateInboxMessage is the API message to update the inbox.
-type UpdateInboxMessage struct {
- UID int
-
- // Domain specific fields
- Status api.InboxStatus
-}
-
-// CreateInbox creates an instance of Inbox.
-func (s *Store) CreateInbox(ctx context.Context, create *InboxMessage) (*InboxMessage, error) {
- tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return nil, err
- }
- defer tx.Rollback()
-
- inbox, err := createInboxImpl(ctx, tx, create)
- if err != nil {
- return nil, err
- }
-
- if err := tx.Commit(); err != nil {
- return nil, err
- }
-
- return inbox, nil
-}
-
-// FindInbox finds a list of Inbox instances.
-func (s *Store) FindInbox(ctx context.Context, find *FindInboxMessage) ([]*InboxMessage, error) {
- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})
- if err != nil {
- return nil, err
- }
- defer tx.Rollback()
-
- list, err := findInboxImpl(ctx, tx, find)
- if err != nil {
- return nil, err
- }
-
- if err := tx.Commit(); err != nil {
- return nil, err
- }
-
- return list, nil
-}
-
-// PatchInbox patches an instance of Inbox.
-// Returns ENOTFOUND if inbox does not exist.
-func (s *Store) PatchInbox(ctx context.Context, patch *UpdateInboxMessage) (*InboxMessage, error) {
- tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return nil, err
- }
- defer tx.Rollback()
-
- inbox, err := patchInboxImpl(ctx, tx, patch)
- if err != nil {
- return nil, err
- }
-
- if err := tx.Commit(); err != nil {
- return nil, err
- }
-
- return inbox, nil
-}
-
-// FindInboxSummary returns the inbox summary for a particular principal.
-func (s *Store) FindInboxSummary(ctx context.Context, principalID int) (*InboxSummaryMessage, error) {
- tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})
- if err != nil {
- return nil, err
- }
- defer tx.Rollback()
-
- query := `SELECT COUNT(*) FROM inbox WHERE receiver_id = $1 AND status = 'UNREAD'`
- var inboxSummary InboxSummaryMessage
- if err := tx.QueryRowContext(ctx, query, principalID).Scan(&inboxSummary.Unread); err != nil {
- if err == sql.ErrNoRows {
- return nil, common.FormatDBErrorEmptyRowWithQuery(query)
- }
- return nil, err
- }
-
- if inboxSummary.Unread > 0 {
- query2 := `SELECT COUNT(*) FROM inbox, activity WHERE inbox.receiver_id = $1 AND inbox.status = 'UNREAD' AND inbox.activity_id = activity.id AND activity.level = 'ERROR'`
- if err := tx.QueryRowContext(ctx, query2, principalID).Scan(&inboxSummary.UnreadError); err != nil {
- if err == sql.ErrNoRows {
- return nil, common.FormatDBErrorEmptyRowWithQuery(query2)
- }
- return nil, err
- }
- }
-
- if err := tx.Commit(); err != nil {
- return nil, err
- }
-
- return &inboxSummary, nil
-}
-
-//
-// private function
-//
-
-// createInboxImpl creates a new inbox.
-func createInboxImpl(ctx context.Context, tx *Tx, create *InboxMessage) (*InboxMessage, error) {
- // Insert row into database.
- query := `
- INSERT INTO inbox (
- receiver_id,
- activity_id,
- status
- )
- VALUES ($1, $2, 'UNREAD')
- RETURNING id, receiver_id, activity_id, status
- `
- var response InboxMessage
- if err := tx.QueryRowContext(ctx, query,
- create.ReceiverUID,
- create.ActivityUID,
- ).Scan(
- &response.UID,
- &response.ReceiverUID,
- &response.ActivityUID,
- &response.Status,
- ); err != nil {
- if err == sql.ErrNoRows {
- return nil, common.FormatDBErrorEmptyRowWithQuery(query)
- }
- return nil, err
- }
- return &response, nil
-}
-
-func findInboxImpl(ctx context.Context, tx *Tx, find *FindInboxMessage) ([]*InboxMessage, error) {
- // Build WHERE clause.
- where, args := []string{"TRUE"}, []any{}
- if v := find.ReceiverUID; v != nil {
- where, args = append(where, fmt.Sprintf("receiver_id = $%d", len(args)+1)), append(args, *v)
- }
- if v := find.ReadCreatedAfterTs; v != nil {
- where, args = append(where, fmt.Sprintf("(status != 'READ' OR created_ts >= $%d)", len(args)+1)), append(args, *v)
- }
-
- query := `
- SELECT
- inbox.id AS inbox_id,
- inbox.receiver_id,
- inbox.activity_id,
- inbox.status,
- activity.id AS activity_id,
- activity.creator_id,
- activity.updater_id,
- activity.created_ts,
- activity.updated_ts,
- activity.container_id,
- activity.type,
- activity.level,
- activity.comment,
- activity.payload
- FROM inbox
- LEFT JOIN activity ON inbox.activity_id = activity.id
- WHERE ` + strings.Join(where, " AND ") + `
- ORDER BY activity.created_ts DESC`
-
- if v := find.Limit; v != nil {
- query += fmt.Sprintf(" LIMIT %d", *v)
- }
- if v := find.Offset; v != nil {
- query += fmt.Sprintf(" OFFSET %d", *v)
- }
-
- rows, err := tx.QueryContext(ctx, query,
- args...,
- )
- if err != nil {
- return nil, err
- }
- defer rows.Close()
-
- // Iterate over result set and deserialize rows into inboxList.
- var inboxList []*InboxMessage
- for rows.Next() {
- var inbox InboxMessage
- var activity ActivityMessage
- var protoPayload string
- if err := rows.Scan(
- &inbox.UID,
- &inbox.ReceiverUID,
- &inbox.ActivityUID,
- &inbox.Status,
- &activity.UID,
- &activity.CreatorUID,
- &activity.UpdaterUID,
- &activity.CreatedTs,
- &activity.UpdatedTs,
- &activity.ContainerUID,
- &activity.Type,
- &activity.Level,
- &activity.Comment,
- &protoPayload,
- ); err != nil {
- return nil, err
- }
- if protoPayload == "" {
- protoPayload = "{}"
- }
- if activity.Payload, err = convertProtoPayloadToAPIPayload(activity.Type, protoPayload); err != nil {
- return nil, err
- }
- inbox.Activity = &activity
- inboxList = append(inboxList, &inbox)
- }
- if err := rows.Err(); err != nil {
- return nil, err
- }
-
- return inboxList, nil
-}
-
-// patchInboxImpl updates a inbox by ID. Returns the new state of the inbox after update.
-func patchInboxImpl(ctx context.Context, tx *Tx, patch *UpdateInboxMessage) (*InboxMessage, error) {
- // Build UPDATE clause.
- set, args := []string{"status = $1"}, []any{patch.Status}
- args = append(args, patch.UID)
-
- var response InboxMessage
- var activity ActivityMessage
- var protoPayload string
- // Execute update query with RETURNING.
- if err := tx.QueryRowContext(ctx, `
- UPDATE inbox
- SET `+strings.Join(set, ", ")+`
- FROM activity
- WHERE inbox.activity_id = activity.id AND inbox.id = $2
- RETURNING
- inbox.id AS inbox_id,
- inbox.receiver_id,
- inbox.activity_id,
- inbox.status,
- activity.id AS activity_id,
- activity.creator_id,
- activity.updater_id,
- activity.created_ts,
- activity.updated_ts,
- activity.container_id,
- activity.type,
- activity.level,
- activity.comment,
- activity.payload
- `,
- args...,
- ).Scan(
- &response.UID,
- &response.ReceiverUID,
- &response.ActivityUID,
- &response.Status,
- &activity.UID,
- &activity.CreatorUID,
- &activity.UpdaterUID,
- &activity.CreatedTs,
- &activity.UpdatedTs,
- &activity.ContainerUID,
- &activity.Type,
- &activity.Level,
- &activity.Comment,
- &protoPayload,
- ); err != nil {
- if err == sql.ErrNoRows {
- return nil, &common.Error{Code: common.NotFound, Err: errors.Errorf("inbox ID not found: %d", patch.UID)}
- }
- return nil, err
- }
-
- if protoPayload == "" {
- protoPayload = "{}"
- }
- payload, err := convertProtoPayloadToAPIPayload(activity.Type, protoPayload)
- if err != nil {
- return nil, err
- }
- activity.Payload = payload
- response.Activity = &activity
- return &response, nil
-}
diff --git a/frontend/src/grpcweb/index.ts b/frontend/src/grpcweb/index.ts
index fbaa4d4cc3..b0ed1482f0 100644
--- a/frontend/src/grpcweb/index.ts
+++ b/frontend/src/grpcweb/index.ts
@@ -15,7 +15,6 @@ import { DatabaseServiceDefinition } from "@/types/proto/v1/database_service";
import { EnvironmentServiceDefinition } from "@/types/proto/v1/environment_service";
import { ExternalVersionControlServiceDefinition } from "@/types/proto/v1/externalvs_service";
import { IdentityProviderServiceDefinition } from "@/types/proto/v1/idp_service";
-import { InboxServiceDefinition } from "@/types/proto/v1/inbox_service";
import { InstanceRoleServiceDefinition } from "@/types/proto/v1/instance_role_service";
import { InstanceServiceDefinition } from "@/types/proto/v1/instance_service";
import { IssueServiceDefinition } from "@/types/proto/v1/issue_service";
@@ -168,11 +167,6 @@ export const loggingServiceClient = clientFactory.create(
channel
);
-export const inboxServiceClient = clientFactory.create(
- InboxServiceDefinition,
- channel
-);
-
export const anomalyServiceClient = clientFactory.create(
AnomalyServiceDefinition,
channel
diff --git a/frontend/src/types/proto/store/activity.ts b/frontend/src/types/proto/store/activity.ts
index a0a847c1cb..80a7f27e6f 100644
--- a/frontend/src/types/proto/store/activity.ts
+++ b/frontend/src/types/proto/store/activity.ts
@@ -13,7 +13,6 @@ export const protobufPackage = "bytebase.store";
* convert to the expected struct there.
*/
export interface ActivityIssueCreatePayload {
- /** Used by inbox to display info without paying the join cost */
issueName: string;
}
@@ -21,10 +20,7 @@ export interface ActivityIssueCreatePayload {
export interface ActivityIssueCommentCreatePayload {
externalApprovalEvent?: ActivityIssueCommentCreatePayload_ExternalApprovalEvent | undefined;
taskRollbackBy?: ActivityIssueCommentCreatePayload_TaskRollbackBy | undefined;
- approvalEvent?:
- | ActivityIssueCommentCreatePayload_ApprovalEvent
- | undefined;
- /** Used by inbox to display info without paying the join cost */
+ approvalEvent?: ActivityIssueCommentCreatePayload_ApprovalEvent | undefined;
issueName: string;
}
diff --git a/frontend/src/types/proto/v1/deployment.ts b/frontend/src/types/proto/v1/deployment.ts
deleted file mode 100644
index e927a44dca..0000000000
--- a/frontend/src/types/proto/v1/deployment.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-/* eslint-disable */
-
-export const protobufPackage = "bytebase.v1";
-
-export enum DeploymentType {
- DEPLOYMENT_TYPE_UNSPECIFIED = 0,
- DATABASE_CREATE = 1,
- DATABASE_DDL = 2,
- DATABASE_DDL_GHOST = 3,
- DATABASE_DML = 4,
- DATABASE_RESTORE_PITR = 5,
- UNRECOGNIZED = -1,
-}
-
-export function deploymentTypeFromJSON(object: any): DeploymentType {
- switch (object) {
- case 0:
- case "DEPLOYMENT_TYPE_UNSPECIFIED":
- return DeploymentType.DEPLOYMENT_TYPE_UNSPECIFIED;
- case 1:
- case "DATABASE_CREATE":
- return DeploymentType.DATABASE_CREATE;
- case 2:
- case "DATABASE_DDL":
- return DeploymentType.DATABASE_DDL;
- case 3:
- case "DATABASE_DDL_GHOST":
- return DeploymentType.DATABASE_DDL_GHOST;
- case 4:
- case "DATABASE_DML":
- return DeploymentType.DATABASE_DML;
- case 5:
- case "DATABASE_RESTORE_PITR":
- return DeploymentType.DATABASE_RESTORE_PITR;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DeploymentType.UNRECOGNIZED;
- }
-}
-
-export function deploymentTypeToJSON(object: DeploymentType): string {
- switch (object) {
- case DeploymentType.DEPLOYMENT_TYPE_UNSPECIFIED:
- return "DEPLOYMENT_TYPE_UNSPECIFIED";
- case DeploymentType.DATABASE_CREATE:
- return "DATABASE_CREATE";
- case DeploymentType.DATABASE_DDL:
- return "DATABASE_DDL";
- case DeploymentType.DATABASE_DDL_GHOST:
- return "DATABASE_DDL_GHOST";
- case DeploymentType.DATABASE_DML:
- return "DATABASE_DML";
- case DeploymentType.DATABASE_RESTORE_PITR:
- return "DATABASE_RESTORE_PITR";
- case DeploymentType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
diff --git a/frontend/src/types/proto/v1/inbox_service.ts b/frontend/src/types/proto/v1/inbox_service.ts
deleted file mode 100644
index b42e2b4a98..0000000000
--- a/frontend/src/types/proto/v1/inbox_service.ts
+++ /dev/null
@@ -1,713 +0,0 @@
-/* eslint-disable */
-import Long from "long";
-import _m0 from "protobufjs/minimal";
-import { FieldMask } from "../google/protobuf/field_mask";
-import { LogEntity } from "./logging_service";
-
-export const protobufPackage = "bytebase.v1";
-
-export interface ListInboxRequest {
- /**
- * filter is the filter to apply on the list inbox request,
- * follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax.
- * The field only support in filter:
- * - "create_time" with ">=" operator, example:
- * - create_time >= "2022-01-01T12:00:00.000Z"
- */
- filter: string;
- /**
- * Not used. The maximum number of inbox to return.
- * The service may return fewer than this value.
- * If unspecified, at most 100 log entries 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 `ListInbox` call.
- * Provide this to retrieve the subsequent page.
- */
- pageToken: string;
-}
-
-export interface ListInboxResponse {
- /** The list of inbox messages. */
- inboxMessages: InboxMessage[];
- /**
- * A token to retrieve next page of inbox.
- * Pass this value in the page_token field in the subsequent call to `ListLogs` method
- * to retrieve the next page of log entities.
- */
- nextPageToken: string;
-}
-
-export interface GetInboxSummaryRequest {
-}
-
-export interface UpdateInboxRequest {
- /** The inbox message to update. */
- inboxMessage:
- | InboxMessage
- | undefined;
- /** The list of fields to update. */
- updateMask: string[] | undefined;
-}
-
-export interface InboxMessage {
- /** The message name in inbox/{uid} format. */
- name: string;
- activityUid: string;
- status: InboxMessage_Status;
- activity: LogEntity | undefined;
-}
-
-export enum InboxMessage_Status {
- STATUS_UNSPECIFIED = 0,
- STATUS_UNREAD = 1,
- STATUS_READ = 2,
- UNRECOGNIZED = -1,
-}
-
-export function inboxMessage_StatusFromJSON(object: any): InboxMessage_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return InboxMessage_Status.STATUS_UNSPECIFIED;
- case 1:
- case "STATUS_UNREAD":
- return InboxMessage_Status.STATUS_UNREAD;
- case 2:
- case "STATUS_READ":
- return InboxMessage_Status.STATUS_READ;
- case -1:
- case "UNRECOGNIZED":
- default:
- return InboxMessage_Status.UNRECOGNIZED;
- }
-}
-
-export function inboxMessage_StatusToJSON(object: InboxMessage_Status): string {
- switch (object) {
- case InboxMessage_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case InboxMessage_Status.STATUS_UNREAD:
- return "STATUS_UNREAD";
- case InboxMessage_Status.STATUS_READ:
- return "STATUS_READ";
- case InboxMessage_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export interface InboxSummary {
- unread: number;
- unreadError: number;
-}
-
-function createBaseListInboxRequest(): ListInboxRequest {
- return { filter: "", pageSize: 0, pageToken: "" };
-}
-
-export const ListInboxRequest = {
- encode(message: ListInboxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.filter !== "") {
- writer.uint32(10).string(message.filter);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): ListInboxRequest {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInboxRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- if (tag !== 10) {
- break;
- }
-
- message.filter = reader.string();
- continue;
- case 2:
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- case 3:
- if (tag !== 26) {
- break;
- }
-
- message.pageToken = reader.string();
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListInboxRequest {
- return {
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- };
- },
-
- toJSON(message: ListInboxRequest): unknown {
- const obj: any = {};
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInboxRequest>): ListInboxRequest {
- return ListInboxRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInboxRequest>): ListInboxRequest {
- const message = createBaseListInboxRequest();
- message.filter = object.filter ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- return message;
- },
-};
-
-function createBaseListInboxResponse(): ListInboxResponse {
- return { inboxMessages: [], nextPageToken: "" };
-}
-
-export const ListInboxResponse = {
- encode(message: ListInboxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- for (const v of message.inboxMessages) {
- InboxMessage.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): ListInboxResponse {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInboxResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- if (tag !== 10) {
- break;
- }
-
- message.inboxMessages.push(InboxMessage.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): ListInboxResponse {
- return {
- inboxMessages: globalThis.Array.isArray(object?.inboxMessages)
- ? object.inboxMessages.map((e: any) => InboxMessage.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListInboxResponse): unknown {
- const obj: any = {};
- if (message.inboxMessages?.length) {
- obj.inboxMessages = message.inboxMessages.map((e) => InboxMessage.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInboxResponse>): ListInboxResponse {
- return ListInboxResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInboxResponse>): ListInboxResponse {
- const message = createBaseListInboxResponse();
- message.inboxMessages = object.inboxMessages?.map((e) => InboxMessage.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseGetInboxSummaryRequest(): GetInboxSummaryRequest {
- return {};
-}
-
-export const GetInboxSummaryRequest = {
- encode(_: GetInboxSummaryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): GetInboxSummaryRequest {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseGetInboxSummaryRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(_: any): GetInboxSummaryRequest {
- return {};
- },
-
- toJSON(_: GetInboxSummaryRequest): unknown {
- const obj: any = {};
- return obj;
- },
-
- create(base?: DeepPartial<GetInboxSummaryRequest>): GetInboxSummaryRequest {
- return GetInboxSummaryRequest.fromPartial(base ?? {});
- },
- fromPartial(_: DeepPartial<GetInboxSummaryRequest>): GetInboxSummaryRequest {
- const message = createBaseGetInboxSummaryRequest();
- return message;
- },
-};
-
-function createBaseUpdateInboxRequest(): UpdateInboxRequest {
- return { inboxMessage: undefined, updateMask: undefined };
-}
-
-export const UpdateInboxRequest = {
- encode(message: UpdateInboxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.inboxMessage !== undefined) {
- InboxMessage.encode(message.inboxMessage, writer.uint32(10).fork()).ldelim();
- }
- if (message.updateMask !== undefined) {
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim();
- }
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): UpdateInboxRequest {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseUpdateInboxRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- if (tag !== 10) {
- break;
- }
-
- message.inboxMessage = InboxMessage.decode(reader, reader.uint32());
- continue;
- case 2:
- if (tag !== 18) {
- break;
- }
-
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): UpdateInboxRequest {
- return {
- inboxMessage: isSet(object.inboxMessage) ? InboxMessage.fromJSON(object.inboxMessage) : undefined,
- updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
- };
- },
-
- toJSON(message: UpdateInboxRequest): unknown {
- const obj: any = {};
- if (message.inboxMessage !== undefined) {
- obj.inboxMessage = InboxMessage.toJSON(message.inboxMessage);
- }
- if (message.updateMask !== undefined) {
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
- }
- return obj;
- },
-
- create(base?: DeepPartial<UpdateInboxRequest>): UpdateInboxRequest {
- return UpdateInboxRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<UpdateInboxRequest>): UpdateInboxRequest {
- const message = createBaseUpdateInboxRequest();
- message.inboxMessage = (object.inboxMessage !== undefined && object.inboxMessage !== null)
- ? InboxMessage.fromPartial(object.inboxMessage)
- : undefined;
- message.updateMask = object.updateMask ?? undefined;
- return message;
- },
-};
-
-function createBaseInboxMessage(): InboxMessage {
- return { name: "", activityUid: "", status: 0, activity: undefined };
-}
-
-export const InboxMessage = {
- encode(message: InboxMessage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.name !== "") {
- writer.uint32(10).string(message.name);
- }
- if (message.activityUid !== "") {
- writer.uint32(18).string(message.activityUid);
- }
- if (message.status !== 0) {
- writer.uint32(24).int32(message.status);
- }
- if (message.activity !== undefined) {
- LogEntity.encode(message.activity, writer.uint32(34).fork()).ldelim();
- }
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): InboxMessage {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseInboxMessage();
- 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.activityUid = reader.string();
- continue;
- case 3:
- if (tag !== 24) {
- break;
- }
-
- message.status = reader.int32() as any;
- continue;
- case 4:
- if (tag !== 34) {
- break;
- }
-
- message.activity = LogEntity.decode(reader, reader.uint32());
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): InboxMessage {
- return {
- name: isSet(object.name) ? globalThis.String(object.name) : "",
- activityUid: isSet(object.activityUid) ? globalThis.String(object.activityUid) : "",
- status: isSet(object.status) ? inboxMessage_StatusFromJSON(object.status) : 0,
- activity: isSet(object.activity) ? LogEntity.fromJSON(object.activity) : undefined,
- };
- },
-
- toJSON(message: InboxMessage): unknown {
- const obj: any = {};
- if (message.name !== "") {
- obj.name = message.name;
- }
- if (message.activityUid !== "") {
- obj.activityUid = message.activityUid;
- }
- if (message.status !== 0) {
- obj.status = inboxMessage_StatusToJSON(message.status);
- }
- if (message.activity !== undefined) {
- obj.activity = LogEntity.toJSON(message.activity);
- }
- return obj;
- },
-
- create(base?: DeepPartial<InboxMessage>): InboxMessage {
- return InboxMessage.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<InboxMessage>): InboxMessage {
- const message = createBaseInboxMessage();
- message.name = object.name ?? "";
- message.activityUid = object.activityUid ?? "";
- message.status = object.status ?? 0;
- message.activity = (object.activity !== undefined && object.activity !== null)
- ? LogEntity.fromPartial(object.activity)
- : undefined;
- return message;
- },
-};
-
-function createBaseInboxSummary(): InboxSummary {
- return { unread: 0, unreadError: 0 };
-}
-
-export const InboxSummary = {
- encode(message: InboxSummary, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.unread !== 0) {
- writer.uint32(8).int32(message.unread);
- }
- if (message.unreadError !== 0) {
- writer.uint32(16).int32(message.unreadError);
- }
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): InboxSummary {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseInboxSummary();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- if (tag !== 8) {
- break;
- }
-
- message.unread = reader.int32();
- continue;
- case 2:
- if (tag !== 16) {
- break;
- }
-
- message.unreadError = reader.int32();
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): InboxSummary {
- return {
- unread: isSet(object.unread) ? globalThis.Number(object.unread) : 0,
- unreadError: isSet(object.unreadError) ? globalThis.Number(object.unreadError) : 0,
- };
- },
-
- toJSON(message: InboxSummary): unknown {
- const obj: any = {};
- if (message.unread !== 0) {
- obj.unread = Math.round(message.unread);
- }
- if (message.unreadError !== 0) {
- obj.unreadError = Math.round(message.unreadError);
- }
- return obj;
- },
-
- create(base?: DeepPartial<InboxSummary>): InboxSummary {
- return InboxSummary.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<InboxSummary>): InboxSummary {
- const message = createBaseInboxSummary();
- message.unread = object.unread ?? 0;
- message.unreadError = object.unreadError ?? 0;
- return message;
- },
-};
-
-export type InboxServiceDefinition = typeof InboxServiceDefinition;
-export const InboxServiceDefinition = {
- name: "InboxService",
- fullName: "bytebase.v1.InboxService",
- methods: {
- listInbox: {
- name: "ListInbox",
- requestType: ListInboxRequest,
- requestStream: false,
- responseType: ListInboxResponse,
- responseStream: false,
- options: {
- _unknownFields: { 578365826: [new Uint8Array([11, 18, 9, 47, 118, 49, 47, 105, 110, 98, 111, 120])] },
- },
- },
- getInboxSummary: {
- name: "GetInboxSummary",
- requestType: GetInboxSummaryRequest,
- requestStream: false,
- responseType: InboxSummary,
- responseStream: false,
- options: {
- _unknownFields: {
- 578365826: [
- new Uint8Array([19, 18, 17, 47, 118, 49, 47, 105, 110, 98, 111, 120, 58, 115, 117, 109, 109, 97, 114, 121]),
- ],
- },
- },
- },
- updateInbox: {
- name: "UpdateInbox",
- requestType: UpdateInboxRequest,
- requestStream: false,
- responseType: InboxMessage,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [
- new Uint8Array([
- 25,
- 105,
- 110,
- 98,
- 111,
- 120,
- 95,
- 109,
- 101,
- 115,
- 115,
- 97,
- 103,
- 101,
- 44,
- 117,
- 112,
- 100,
- 97,
- 116,
- 101,
- 95,
- 109,
- 97,
- 115,
- 107,
- ]),
- ],
- 578365826: [
- new Uint8Array([
- 49,
- 58,
- 13,
- 105,
- 110,
- 98,
- 111,
- 120,
- 95,
- 109,
- 101,
- 115,
- 115,
- 97,
- 103,
- 101,
- 50,
- 32,
- 47,
- 118,
- 49,
- 47,
- 123,
- 105,
- 110,
- 98,
- 111,
- 120,
- 95,
- 109,
- 101,
- 115,
- 115,
- 97,
- 103,
- 101,
- 46,
- 110,
- 97,
- 109,
- 101,
- 61,
- 105,
- 110,
- 98,
- 111,
- 120,
- 47,
- 42,
- 125,
- ]),
- ],
- },
- },
- },
- },
-} 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/store/README.md b/proto/gen/grpc-doc/store/README.md
index 2e878c226e..342317ea1e 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -420,7 +420,7 @@ ActivityIssueCommentCreatePayload is the payloads for creating issue comments.
| external_approval_event | [ActivityIssueCommentCreatePayload.ExternalApprovalEvent](#bytebase-store-ActivityIssueCommentCreatePayload-ExternalApprovalEvent) | | |
| task_rollback_by | [ActivityIssueCommentCreatePayload.TaskRollbackBy](#bytebase-store-ActivityIssueCommentCreatePayload-TaskRollbackBy) | | |
| approval_event | [ActivityIssueCommentCreatePayload.ApprovalEvent](#bytebase-store-ActivityIssueCommentCreatePayload-ApprovalEvent) | | |
-| issue_name | [string](#string) | | Used by inbox to display info without paying the join cost |
+| issue_name | [string](#string) | | |
@@ -490,7 +490,7 @@ convert to the expected struct there.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| issue_name | [string](#string) | | Used by inbox to display info without paying the join cost |
+| issue_name | [string](#string) | | |
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 00b6ec3fed..ebc51c3e71 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -305,31 +305,6 @@
- [IdentityProviderService](#bytebase-v1-IdentityProviderService)
-- [v1/logging_service.proto](#v1_logging_service-proto)
- - [ExportLogsRequest](#bytebase-v1-ExportLogsRequest)
- - [ExportLogsResponse](#bytebase-v1-ExportLogsResponse)
- - [GetLogRequest](#bytebase-v1-GetLogRequest)
- - [ListLogsRequest](#bytebase-v1-ListLogsRequest)
- - [ListLogsResponse](#bytebase-v1-ListLogsResponse)
- - [LogEntity](#bytebase-v1-LogEntity)
-
- - [LogEntity.Action](#bytebase-v1-LogEntity-Action)
- - [LogEntity.Level](#bytebase-v1-LogEntity-Level)
-
- - [LoggingService](#bytebase-v1-LoggingService)
-
-- [v1/inbox_service.proto](#v1_inbox_service-proto)
- - [GetInboxSummaryRequest](#bytebase-v1-GetInboxSummaryRequest)
- - [InboxMessage](#bytebase-v1-InboxMessage)
- - [InboxSummary](#bytebase-v1-InboxSummary)
- - [ListInboxRequest](#bytebase-v1-ListInboxRequest)
- - [ListInboxResponse](#bytebase-v1-ListInboxResponse)
- - [UpdateInboxRequest](#bytebase-v1-UpdateInboxRequest)
-
- - [InboxMessage.Status](#bytebase-v1-InboxMessage-Status)
-
- - [InboxService](#bytebase-v1-InboxService)
-
- [v1/instance_role_service.proto](#v1_instance_role_service-proto)
- [CreateInstanceRoleRequest](#bytebase-v1-CreateInstanceRoleRequest)
- [DeleteInstanceRoleRequest](#bytebase-v1-DeleteInstanceRoleRequest)
@@ -373,6 +348,19 @@
- [IssueService](#bytebase-v1-IssueService)
+- [v1/logging_service.proto](#v1_logging_service-proto)
+ - [ExportLogsRequest](#bytebase-v1-ExportLogsRequest)
+ - [ExportLogsResponse](#bytebase-v1-ExportLogsResponse)
+ - [GetLogRequest](#bytebase-v1-GetLogRequest)
+ - [ListLogsRequest](#bytebase-v1-ListLogsRequest)
+ - [ListLogsResponse](#bytebase-v1-ListLogsResponse)
+ - [LogEntity](#bytebase-v1-LogEntity)
+
+ - [LogEntity.Action](#bytebase-v1-LogEntity-Action)
+ - [LogEntity.Level](#bytebase-v1-LogEntity-Level)
+
+ - [LoggingService](#bytebase-v1-LoggingService)
+
- [v1/project_service.proto](#v1_project_service-proto)
- [Activity](#bytebase-v1-Activity)
- [AddWebhookRequest](#bytebase-v1-AddWebhookRequest)
@@ -5190,328 +5178,6 @@ The identity provider&#39;s `name` field is used to identify the identity provid
-<a name="v1_logging_service-proto"></a>
-<p align="right"><a href="#top">Top</a></p>
-
-## v1/logging_service.proto
-
-
-
-<a name="bytebase-v1-ExportLogsRequest"></a>
-
-### ExportLogsRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| filter | [string](#string) | | Consistent with filter and order by in ListLogs. filter is the filter to apply on the list logs request, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. The field only support in filter: - creator, example: - creator = &#34;users/{email}&#34; - resource, example: - resource = &#34;projects/{project resource id}&#34; - level, example: - level = &#34;INFO&#34; - level = &#34;ERROR | WARN&#34; - action, example: - action = &#34;ACTION_MEMBER_CREATE&#34; | &#34;ACTION_ISSUE_CREATE&#34; - create_time, example: - create_time &lt;= &#34;2022-01-01T12:00:00.000Z&#34; - create_time &gt;= &#34;2022-01-01T12:00:00.000Z&#34; For example: List the logs of type &#39;ACTION_ISSUE_COMMENT_CREATE&#39; in issue/123: &#39;action=&#34;ACTION_ISSUE_COMMENT_CREATE&#34;, resource=&#34;issue/123&#34;&#39; |
-| order_by | [string](#string) | | The order by of the log. Only support order by create_time. For example: - order_by = &#34;create_time asc&#34; - order_by = &#34;create_time desc&#34; |
-| format | [ExportFormat](#bytebase-v1-ExportFormat) | | The export format. |
-
-
-
-
-
-
-<a name="bytebase-v1-ExportLogsResponse"></a>
-
-### ExportLogsResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| content | [bytes](#bytes) | | |
-
-
-
-
-
-
-<a name="bytebase-v1-GetLogRequest"></a>
-
-### GetLogRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the log to retrieve. Format: logs/{uid} |
-
-
-
-
-
-
-<a name="bytebase-v1-ListLogsRequest"></a>
-
-### ListLogsRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| filter | [string](#string) | | filter is the filter to apply on the list logs request, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. The field only support in filter: - creator, example: - creator = &#34;users/{email}&#34; - resource, example: - resource = &#34;projects/{project resource id}&#34; - level, example: - level = &#34;INFO&#34; - level = &#34;ERROR | WARN&#34; - action, example: - action = &#34;ACTION_MEMBER_CREATE&#34; | &#34;ACTION_ISSUE_CREATE&#34; - create_time, example: - create_time &lt;= &#34;2022-01-01T12:00:00.000Z&#34; - create_time &gt;= &#34;2022-01-01T12:00:00.000Z&#34; For example: List the logs of type &#39;ACTION_ISSUE_COMMENT_CREATE&#39; in issue/123: &#39;action=&#34;ACTION_ISSUE_COMMENT_CREATE&#34;, resource=&#34;issue/123&#34;&#39; |
-| order_by | [string](#string) | | The order by of the log. Only support order by create_time. For example: - order_by = &#34;create_time asc&#34; - order_by = &#34;create_time desc&#34; |
-| page_size | [int32](#int32) | | Not used. The maximum number of logs to return. The service may return fewer than this value. If unspecified, at most 100 log entries 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 `ListLogs` call. Provide this to retrieve the subsequent page. |
-
-
-
-
-
-
-<a name="bytebase-v1-ListLogsResponse"></a>
-
-### ListLogsResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| log_entities | [LogEntity](#bytebase-v1-LogEntity) | repeated | The list of log entities. |
-| next_page_token | [string](#string) | | A token to retrieve next page of log entities. Pass this value in the page_token field in the subsequent call to `ListLogs` method to retrieve the next page of log entities. |
-
-
-
-
-
-
-<a name="bytebase-v1-LogEntity"></a>
-
-### LogEntity
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the log. Format: logs/{uid} |
-| creator | [string](#string) | | The creator of the log entity. Format: users/{email} |
-| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
-| update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
-| action | [LogEntity.Action](#bytebase-v1-LogEntity-Action) | | |
-| level | [LogEntity.Level](#bytebase-v1-LogEntity-Level) | | |
-| resource | [string](#string) | | The name of the resource associated with this log entity. For example, the resource user associated with log entity type of &#34;ACTION_MEMBER_CREATE&#34;. Format: For ACTION_MEMBER_*: users/{email} For ACTION_ISSUE_*: issues/{issue uid} For ACTION_PIPELINE_*: pipelines/{pipeline uid} For ACTION_PROJECT_*: projects/{project resource id} For ACTION_DATABASE_*: instances/{instance resource id} |
-| payload | [string](#string) | | The payload of the log entity. TODO: use oneof |
-| comment | [string](#string) | | |
-
-
-
-
-
-
-
-
-<a name="bytebase-v1-LogEntity-Action"></a>
-
-### LogEntity.Action
-
-
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| ACTION_UNSPECIFIED | 0 | In worksapce resource only. |
-| ACTION_MEMBER_CREATE | 1 | Member related activity types. Enum value 1 - 20
-
-ACTION_MEMBER_CREATE is the type for creating a new member. |
-| ACTION_MEMBER_ROLE_UPDATE | 2 | ACTION_MEMBER_ROLE_UPDATE is the type for updating a member&#39;s role. |
-| ACTION_MEMBER_ACTIVATE | 3 | ACTION_MEMBER_ACTIVATE_UPDATE is the type for activating members. |
-| ACTION_MEMBER_DEACTIVE | 4 | ACTION_MEMBER_DEACTIVE is the type for deactiving members. |
-| ACTION_ISSUE_CREATE | 21 | Issue related activity types. Enum value 21 - 40
-
-ACTION_ISSUE_CREATE is the type for creating a new issue. |
-| ACTION_ISSUE_COMMENT_CREATE | 22 | ACTION_ISSUE_COMMENT_CREATE is the type for creating a new comment on an issue. |
-| ACTION_ISSUE_FIELD_UPDATE | 23 | ACTION_ISSUE_FIELD_UPDATE is the type for updating an issue&#39;s field. |
-| ACTION_ISSUE_STATUS_UPDATE | 24 | ACTION_ISSUE_STATUS_UPDATE is the type for updating an issue&#39;s status. |
-| ACTION_ISSUE_APPROVAL_NOTIFY | 25 | ACTION_ISSUE_APPROVAL_NOTIFY is the type for notifying issue approval. |
-| ACTION_PIPELINE_STAGE_STATUS_UPDATE | 31 | ACTION_PIPELINE_STAGE_STATUS_UPDATE represents the pipeline stage status change, including BEGIN, END for now. |
-| ACTION_PIPELINE_TASK_STATUS_UPDATE | 32 | ACTION_PIPELINE_TASK_STATUS_UPDATE represents the pipeline task status change, including PENDING, PENDING_APPROVAL, RUNNING, SUCCESS, FAILURE, CANCELED for now. |
-| ACTION_PIPELINE_TASK_FILE_COMMIT | 33 | ACTION_PIPELINE_TASK_FILE_COMMIT represents the VCS trigger to commit a file to update the task statement. |
-| ACTION_PIPELINE_TASK_STATEMENT_UPDATE | 34 | ACTION_PIPELINE_TASK_STATEMENT_UPDATE represents the manual update of the task statement. |
-| ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE | 35 | ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE represents the manual update of the task earliest allowed time. |
-| ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE | 36 | ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE represents the pipeline task run status change, including PENDING, RUNNING, SUCCESS, FAILURE, CANCELED for now. |
-| ACTION_PIPELINE_TASK_PRIOR_BACKUP | 37 | ACTION_PIPELINE_TASK_PRIOR_BACKUP represents the pipeline task prior backup activity. |
-| ACTION_PROJECT_REPOSITORY_PUSH | 41 | Project related activity types. Enum value 41 - 60
-
-ACTION_PROJECT_REPOSITORY_PUSH represents Bytebase receiving a push event from the project repository. |
-| ACTION_PROJECT_MEMBER_CREATE | 42 | ACTION_PROJECT_MEMBER_CREATE represents adding a member to the project. |
-| ACTION_PROJECT_MEMBER_DELETE | 43 | ACTION_PROJECT_MEMBER_DELETE represents removing a member from the project. |
-| ACTION_PROJECT_DATABASE_RECOVERY_PITR_DONE | 44 | ACTION_PROJECT_DATABASE_RECOVERY_PITR_DONE is the type for database PITR recovery done. |
-| ACTION_PROJECT_DATABASE_TRANSFER | 45 | ACTION_PROJECT_DATABASE_TRANSFER represents transfering the database from one project to another. |
-| ACTION_DATABASE_SQL_EDITOR_QUERY | 61 | Database related activity types. Enum value 61 - 80
-
-ACTION_DATABASE_SQL_EDITOR_QUERY is the type for SQL editor query. |
-| ACTION_DATABASE_SQL_EXPORT | 62 | ACTION_DATABASE_SQL_EXPORT is the type for exporting SQL. |
-
-
-
-<a name="bytebase-v1-LogEntity-Level"></a>
-
-### LogEntity.Level
-
-
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| LEVEL_UNSPECIFIED | 0 | |
-| LEVEL_INFO | 1 | LEVEL_INFO is the type for information. |
-| LEVEL_WARNING | 2 | LEVEL_WARNING is the type for warning. |
-| LEVEL_ERROR | 3 | LEVEL_ERROR is the type for error. |
-
-
-
-
-
-
-
-<a name="bytebase-v1-LoggingService"></a>
-
-### LoggingService
-
-
-| Method Name | Request Type | Response Type | Description |
-| ----------- | ------------ | ------------- | ------------|
-| ListLogs | [ListLogsRequest](#bytebase-v1-ListLogsRequest) | [ListLogsResponse](#bytebase-v1-ListLogsResponse) | |
-| GetLog | [GetLogRequest](#bytebase-v1-GetLogRequest) | [LogEntity](#bytebase-v1-LogEntity) | |
-| ExportLogs | [ExportLogsRequest](#bytebase-v1-ExportLogsRequest) | [ExportLogsResponse](#bytebase-v1-ExportLogsResponse) | |
-
-
-
-
-
-<a name="v1_inbox_service-proto"></a>
-<p align="right"><a href="#top">Top</a></p>
-
-## v1/inbox_service.proto
-
-
-
-<a name="bytebase-v1-GetInboxSummaryRequest"></a>
-
-### GetInboxSummaryRequest
-
-
-
-
-
-
-
-<a name="bytebase-v1-InboxMessage"></a>
-
-### InboxMessage
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The message name in inbox/{uid} format. |
-| activity_uid | [string](#string) | | |
-| status | [InboxMessage.Status](#bytebase-v1-InboxMessage-Status) | | |
-| activity | [LogEntity](#bytebase-v1-LogEntity) | | |
-
-
-
-
-
-
-<a name="bytebase-v1-InboxSummary"></a>
-
-### InboxSummary
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| unread | [int32](#int32) | | |
-| unread_error | [int32](#int32) | | |
-
-
-
-
-
-
-<a name="bytebase-v1-ListInboxRequest"></a>
-
-### ListInboxRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| filter | [string](#string) | | filter is the filter to apply on the list inbox request, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. The field only support in filter: - &#34;create_time&#34; with &#34;&gt;=&#34; operator, example: - create_time &gt;= &#34;2022-01-01T12:00:00.000Z&#34; |
-| page_size | [int32](#int32) | | Not used. The maximum number of inbox to return. The service may return fewer than this value. If unspecified, at most 100 log entries 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 `ListInbox` call. Provide this to retrieve the subsequent page. |
-
-
-
-
-
-
-<a name="bytebase-v1-ListInboxResponse"></a>
-
-### ListInboxResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| inbox_messages | [InboxMessage](#bytebase-v1-InboxMessage) | repeated | The list of inbox messages. |
-| next_page_token | [string](#string) | | A token to retrieve next page of inbox. Pass this value in the page_token field in the subsequent call to `ListLogs` method to retrieve the next page of log entities. |
-
-
-
-
-
-
-<a name="bytebase-v1-UpdateInboxRequest"></a>
-
-### UpdateInboxRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| inbox_message | [InboxMessage](#bytebase-v1-InboxMessage) | | The inbox message to update. |
-| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to update. |
-
-
-
-
-
-
-
-
-<a name="bytebase-v1-InboxMessage-Status"></a>
-
-### InboxMessage.Status
-
-
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| STATUS_UNSPECIFIED | 0 | |
-| STATUS_UNREAD | 1 | |
-| STATUS_READ | 2 | |
-
-
-
-
-
-
-
-<a name="bytebase-v1-InboxService"></a>
-
-### InboxService
-
-
-| Method Name | Request Type | Response Type | Description |
-| ----------- | ------------ | ------------- | ------------|
-| ListInbox | [ListInboxRequest](#bytebase-v1-ListInboxRequest) | [ListInboxResponse](#bytebase-v1-ListInboxResponse) | |
-| GetInboxSummary | [GetInboxSummaryRequest](#bytebase-v1-GetInboxSummaryRequest) | [InboxSummary](#bytebase-v1-InboxSummary) | |
-| UpdateInbox | [UpdateInboxRequest](#bytebase-v1-UpdateInboxRequest) | [InboxMessage](#bytebase-v1-InboxMessage) | |
-
-
-
-
-
<a name="v1_instance_role_service-proto"></a>
<p align="right"><a href="#top">Top</a></p>
@@ -6153,6 +5819,194 @@ ANY means approving any node will proceed.
+<a name="v1_logging_service-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## v1/logging_service.proto
+
+
+
+<a name="bytebase-v1-ExportLogsRequest"></a>
+
+### ExportLogsRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| filter | [string](#string) | | Consistent with filter and order by in ListLogs. filter is the filter to apply on the list logs request, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. The field only support in filter: - creator, example: - creator = &#34;users/{email}&#34; - resource, example: - resource = &#34;projects/{project resource id}&#34; - level, example: - level = &#34;INFO&#34; - level = &#34;ERROR | WARN&#34; - action, example: - action = &#34;ACTION_MEMBER_CREATE&#34; | &#34;ACTION_ISSUE_CREATE&#34; - create_time, example: - create_time &lt;= &#34;2022-01-01T12:00:00.000Z&#34; - create_time &gt;= &#34;2022-01-01T12:00:00.000Z&#34; For example: List the logs of type &#39;ACTION_ISSUE_COMMENT_CREATE&#39; in issue/123: &#39;action=&#34;ACTION_ISSUE_COMMENT_CREATE&#34;, resource=&#34;issue/123&#34;&#39; |
+| order_by | [string](#string) | | The order by of the log. Only support order by create_time. For example: - order_by = &#34;create_time asc&#34; - order_by = &#34;create_time desc&#34; |
+| format | [ExportFormat](#bytebase-v1-ExportFormat) | | The export format. |
+
+
+
+
+
+
+<a name="bytebase-v1-ExportLogsResponse"></a>
+
+### ExportLogsResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| content | [bytes](#bytes) | | |
+
+
+
+
+
+
+<a name="bytebase-v1-GetLogRequest"></a>
+
+### GetLogRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the log to retrieve. Format: logs/{uid} |
+
+
+
+
+
+
+<a name="bytebase-v1-ListLogsRequest"></a>
+
+### ListLogsRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| filter | [string](#string) | | filter is the filter to apply on the list logs request, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. The field only support in filter: - creator, example: - creator = &#34;users/{email}&#34; - resource, example: - resource = &#34;projects/{project resource id}&#34; - level, example: - level = &#34;INFO&#34; - level = &#34;ERROR | WARN&#34; - action, example: - action = &#34;ACTION_MEMBER_CREATE&#34; | &#34;ACTION_ISSUE_CREATE&#34; - create_time, example: - create_time &lt;= &#34;2022-01-01T12:00:00.000Z&#34; - create_time &gt;= &#34;2022-01-01T12:00:00.000Z&#34; For example: List the logs of type &#39;ACTION_ISSUE_COMMENT_CREATE&#39; in issue/123: &#39;action=&#34;ACTION_ISSUE_COMMENT_CREATE&#34;, resource=&#34;issue/123&#34;&#39; |
+| order_by | [string](#string) | | The order by of the log. Only support order by create_time. For example: - order_by = &#34;create_time asc&#34; - order_by = &#34;create_time desc&#34; |
+| page_size | [int32](#int32) | | Not used. The maximum number of logs to return. The service may return fewer than this value. If unspecified, at most 100 log entries 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 `ListLogs` call. Provide this to retrieve the subsequent page. |
+
+
+
+
+
+
+<a name="bytebase-v1-ListLogsResponse"></a>
+
+### ListLogsResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| log_entities | [LogEntity](#bytebase-v1-LogEntity) | repeated | The list of log entities. |
+| next_page_token | [string](#string) | | A token to retrieve next page of log entities. Pass this value in the page_token field in the subsequent call to `ListLogs` method to retrieve the next page of log entities. |
+
+
+
+
+
+
+<a name="bytebase-v1-LogEntity"></a>
+
+### LogEntity
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the log. Format: logs/{uid} |
+| creator | [string](#string) | | The creator of the log entity. Format: users/{email} |
+| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
+| update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
+| action | [LogEntity.Action](#bytebase-v1-LogEntity-Action) | | |
+| level | [LogEntity.Level](#bytebase-v1-LogEntity-Level) | | |
+| resource | [string](#string) | | The name of the resource associated with this log entity. For example, the resource user associated with log entity type of &#34;ACTION_MEMBER_CREATE&#34;. Format: For ACTION_MEMBER_*: users/{email} For ACTION_ISSUE_*: issues/{issue uid} For ACTION_PIPELINE_*: pipelines/{pipeline uid} For ACTION_PROJECT_*: projects/{project resource id} For ACTION_DATABASE_*: instances/{instance resource id} |
+| payload | [string](#string) | | The payload of the log entity. TODO: use oneof |
+| comment | [string](#string) | | |
+
+
+
+
+
+
+
+
+<a name="bytebase-v1-LogEntity-Action"></a>
+
+### LogEntity.Action
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| ACTION_UNSPECIFIED | 0 | In worksapce resource only. |
+| ACTION_MEMBER_CREATE | 1 | Member related activity types. Enum value 1 - 20
+
+ACTION_MEMBER_CREATE is the type for creating a new member. |
+| ACTION_MEMBER_ROLE_UPDATE | 2 | ACTION_MEMBER_ROLE_UPDATE is the type for updating a member&#39;s role. |
+| ACTION_MEMBER_ACTIVATE | 3 | ACTION_MEMBER_ACTIVATE_UPDATE is the type for activating members. |
+| ACTION_MEMBER_DEACTIVE | 4 | ACTION_MEMBER_DEACTIVE is the type for deactiving members. |
+| ACTION_ISSUE_CREATE | 21 | Issue related activity types. Enum value 21 - 40
+
+ACTION_ISSUE_CREATE is the type for creating a new issue. |
+| ACTION_ISSUE_COMMENT_CREATE | 22 | ACTION_ISSUE_COMMENT_CREATE is the type for creating a new comment on an issue. |
+| ACTION_ISSUE_FIELD_UPDATE | 23 | ACTION_ISSUE_FIELD_UPDATE is the type for updating an issue&#39;s field. |
+| ACTION_ISSUE_STATUS_UPDATE | 24 | ACTION_ISSUE_STATUS_UPDATE is the type for updating an issue&#39;s status. |
+| ACTION_ISSUE_APPROVAL_NOTIFY | 25 | ACTION_ISSUE_APPROVAL_NOTIFY is the type for notifying issue approval. |
+| ACTION_PIPELINE_STAGE_STATUS_UPDATE | 31 | ACTION_PIPELINE_STAGE_STATUS_UPDATE represents the pipeline stage status change, including BEGIN, END for now. |
+| ACTION_PIPELINE_TASK_STATUS_UPDATE | 32 | ACTION_PIPELINE_TASK_STATUS_UPDATE represents the pipeline task status change, including PENDING, PENDING_APPROVAL, RUNNING, SUCCESS, FAILURE, CANCELED for now. |
+| ACTION_PIPELINE_TASK_FILE_COMMIT | 33 | ACTION_PIPELINE_TASK_FILE_COMMIT represents the VCS trigger to commit a file to update the task statement. |
+| ACTION_PIPELINE_TASK_STATEMENT_UPDATE | 34 | ACTION_PIPELINE_TASK_STATEMENT_UPDATE represents the manual update of the task statement. |
+| ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE | 35 | ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE represents the manual update of the task earliest allowed time. |
+| ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE | 36 | ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE represents the pipeline task run status change, including PENDING, RUNNING, SUCCESS, FAILURE, CANCELED for now. |
+| ACTION_PIPELINE_TASK_PRIOR_BACKUP | 37 | ACTION_PIPELINE_TASK_PRIOR_BACKUP represents the pipeline task prior backup activity. |
+| ACTION_PROJECT_REPOSITORY_PUSH | 41 | Project related activity types. Enum value 41 - 60
+
+ACTION_PROJECT_REPOSITORY_PUSH represents Bytebase receiving a push event from the project repository. |
+| ACTION_PROJECT_MEMBER_CREATE | 42 | ACTION_PROJECT_MEMBER_CREATE represents adding a member to the project. |
+| ACTION_PROJECT_MEMBER_DELETE | 43 | ACTION_PROJECT_MEMBER_DELETE represents removing a member from the project. |
+| ACTION_PROJECT_DATABASE_RECOVERY_PITR_DONE | 44 | ACTION_PROJECT_DATABASE_RECOVERY_PITR_DONE is the type for database PITR recovery done. |
+| ACTION_PROJECT_DATABASE_TRANSFER | 45 | ACTION_PROJECT_DATABASE_TRANSFER represents transfering the database from one project to another. |
+| ACTION_DATABASE_SQL_EDITOR_QUERY | 61 | Database related activity types. Enum value 61 - 80
+
+ACTION_DATABASE_SQL_EDITOR_QUERY is the type for SQL editor query. |
+| ACTION_DATABASE_SQL_EXPORT | 62 | ACTION_DATABASE_SQL_EXPORT is the type for exporting SQL. |
+
+
+
+<a name="bytebase-v1-LogEntity-Level"></a>
+
+### LogEntity.Level
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| LEVEL_UNSPECIFIED | 0 | |
+| LEVEL_INFO | 1 | LEVEL_INFO is the type for information. |
+| LEVEL_WARNING | 2 | LEVEL_WARNING is the type for warning. |
+| LEVEL_ERROR | 3 | LEVEL_ERROR is the type for error. |
+
+
+
+
+
+
+
+<a name="bytebase-v1-LoggingService"></a>
+
+### LoggingService
+
+
+| Method Name | Request Type | Response Type | Description |
+| ----------- | ------------ | ------------- | ------------|
+| ListLogs | [ListLogsRequest](#bytebase-v1-ListLogsRequest) | [ListLogsResponse](#bytebase-v1-ListLogsResponse) | |
+| GetLog | [GetLogRequest](#bytebase-v1-GetLogRequest) | [LogEntity](#bytebase-v1-LogEntity) | |
+| ExportLogs | [ExportLogsRequest](#bytebase-v1-ExportLogsRequest) | [ExportLogsResponse](#bytebase-v1-ExportLogsResponse) | |
+
+
+
+
+
<a name="v1_project_service-proto"></a>
<p align="right"><a href="#top">Top</a></p>
diff --git a/proto/generated-go/store/activity.pb.go b/proto/generated-go/store/activity.pb.go
index c4524ade49..458b5b2c67 100644
--- a/proto/generated-go/store/activity.pb.go
+++ b/proto/generated-go/store/activity.pb.go
@@ -177,7 +177,6 @@ type ActivityIssueCreatePayload struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- // Used by inbox to display info without paying the join cost
IssueName string `protobuf:"bytes,1,opt,name=issue_name,json=issueName,proto3" json:"issue_name,omitempty"`
}
@@ -231,9 +230,8 @@ type ActivityIssueCommentCreatePayload struct {
// *ActivityIssueCommentCreatePayload_ExternalApprovalEvent_
// *ActivityIssueCommentCreatePayload_TaskRollbackBy_
// *ActivityIssueCommentCreatePayload_ApprovalEvent_
- Event isActivityIssueCommentCreatePayload_Event `protobuf_oneof:"event"`
- // Used by inbox to display info without paying the join cost
- IssueName string `protobuf:"bytes,4,opt,name=issue_name,json=issueName,proto3" json:"issue_name,omitempty"`
+ Event isActivityIssueCommentCreatePayload_Event `protobuf_oneof:"event"`
+ IssueName string `protobuf:"bytes,4,opt,name=issue_name,json=issueName,proto3" json:"issue_name,omitempty"`
}
func (x *ActivityIssueCommentCreatePayload) Reset() {
diff --git a/proto/generated-go/v1/inbox_service.pb.go b/proto/generated-go/v1/inbox_service.pb.go
deleted file mode 100644
index eb6f7046ea..0000000000
--- a/proto/generated-go/v1/inbox_service.pb.go
+++ /dev/null
@@ -1,661 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.32.0
-// protoc (unknown)
-// source: v1/inbox_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"
- fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
- 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 InboxMessage_Status int32
-
-const (
- InboxMessage_STATUS_UNSPECIFIED InboxMessage_Status = 0
- InboxMessage_STATUS_UNREAD InboxMessage_Status = 1
- InboxMessage_STATUS_READ InboxMessage_Status = 2
-)
-
-// Enum value maps for InboxMessage_Status.
-var (
- InboxMessage_Status_name = map[int32]string{
- 0: "STATUS_UNSPECIFIED",
- 1: "STATUS_UNREAD",
- 2: "STATUS_READ",
- }
- InboxMessage_Status_value = map[string]int32{
- "STATUS_UNSPECIFIED": 0,
- "STATUS_UNREAD": 1,
- "STATUS_READ": 2,
- }
-)
-
-func (x InboxMessage_Status) Enum() *InboxMessage_Status {
- p := new(InboxMessage_Status)
- *p = x
- return p
-}
-
-func (x InboxMessage_Status) String() string {
- return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (InboxMessage_Status) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_inbox_service_proto_enumTypes[0].Descriptor()
-}
-
-func (InboxMessage_Status) Type() protoreflect.EnumType {
- return &file_v1_inbox_service_proto_enumTypes[0]
-}
-
-func (x InboxMessage_Status) Number() protoreflect.EnumNumber {
- return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use InboxMessage_Status.Descriptor instead.
-func (InboxMessage_Status) EnumDescriptor() ([]byte, []int) {
- return file_v1_inbox_service_proto_rawDescGZIP(), []int{4, 0}
-}
-
-type ListInboxRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // filter is the filter to apply on the list inbox request,
- // follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax.
- // The field only support in filter:
- // - "create_time" with ">=" operator, example:
- // - create_time >= "2022-01-01T12:00:00.000Z"
- Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
- // Not used. The maximum number of inbox to return.
- // The service may return fewer than this value.
- // If unspecified, at most 100 log entries will be returned.
- // The maximum value is 1000; values above 1000 will be coerced to 1000.
- PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
- // Not used. A page token, received from a previous `ListInbox` call.
- // Provide this to retrieve the subsequent page.
- PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
-}
-
-func (x *ListInboxRequest) Reset() {
- *x = ListInboxRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_inbox_service_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *ListInboxRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListInboxRequest) ProtoMessage() {}
-
-func (x *ListInboxRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_inbox_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 ListInboxRequest.ProtoReflect.Descriptor instead.
-func (*ListInboxRequest) Descriptor() ([]byte, []int) {
- return file_v1_inbox_service_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *ListInboxRequest) GetFilter() string {
- if x != nil {
- return x.Filter
- }
- return ""
-}
-
-func (x *ListInboxRequest) GetPageSize() int32 {
- if x != nil {
- return x.PageSize
- }
- return 0
-}
-
-func (x *ListInboxRequest) GetPageToken() string {
- if x != nil {
- return x.PageToken
- }
- return ""
-}
-
-type ListInboxResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // The list of inbox messages.
- InboxMessages []*InboxMessage `protobuf:"bytes,1,rep,name=inbox_messages,json=inboxMessages,proto3" json:"inbox_messages,omitempty"`
- // A token to retrieve next page of inbox.
- // Pass this value in the page_token field in the subsequent call to `ListLogs` method
- // to retrieve the next page of log entities.
- NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
-}
-
-func (x *ListInboxResponse) Reset() {
- *x = ListInboxResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_inbox_service_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *ListInboxResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListInboxResponse) ProtoMessage() {}
-
-func (x *ListInboxResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_inbox_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 ListInboxResponse.ProtoReflect.Descriptor instead.
-func (*ListInboxResponse) Descriptor() ([]byte, []int) {
- return file_v1_inbox_service_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *ListInboxResponse) GetInboxMessages() []*InboxMessage {
- if x != nil {
- return x.InboxMessages
- }
- return nil
-}
-
-func (x *ListInboxResponse) GetNextPageToken() string {
- if x != nil {
- return x.NextPageToken
- }
- return ""
-}
-
-type GetInboxSummaryRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-}
-
-func (x *GetInboxSummaryRequest) Reset() {
- *x = GetInboxSummaryRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_inbox_service_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *GetInboxSummaryRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetInboxSummaryRequest) ProtoMessage() {}
-
-func (x *GetInboxSummaryRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_inbox_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 GetInboxSummaryRequest.ProtoReflect.Descriptor instead.
-func (*GetInboxSummaryRequest) Descriptor() ([]byte, []int) {
- return file_v1_inbox_service_proto_rawDescGZIP(), []int{2}
-}
-
-type UpdateInboxRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // The inbox message to update.
- InboxMessage *InboxMessage `protobuf:"bytes,1,opt,name=inbox_message,json=inboxMessage,proto3" json:"inbox_message,omitempty"`
- // The list of fields to update.
- UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
-}
-
-func (x *UpdateInboxRequest) Reset() {
- *x = UpdateInboxRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_inbox_service_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *UpdateInboxRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*UpdateInboxRequest) ProtoMessage() {}
-
-func (x *UpdateInboxRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_inbox_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 UpdateInboxRequest.ProtoReflect.Descriptor instead.
-func (*UpdateInboxRequest) Descriptor() ([]byte, []int) {
- return file_v1_inbox_service_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *UpdateInboxRequest) GetInboxMessage() *InboxMessage {
- if x != nil {
- return x.InboxMessage
- }
- return nil
-}
-
-func (x *UpdateInboxRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
- if x != nil {
- return x.UpdateMask
- }
- return nil
-}
-
-type InboxMessage struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // The message name in inbox/{uid} format.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- ActivityUid string `protobuf:"bytes,2,opt,name=activity_uid,json=activityUid,proto3" json:"activity_uid,omitempty"`
- Status InboxMessage_Status `protobuf:"varint,3,opt,name=status,proto3,enum=bytebase.v1.InboxMessage_Status" json:"status,omitempty"`
- Activity *LogEntity `protobuf:"bytes,4,opt,name=activity,proto3" json:"activity,omitempty"`
-}
-
-func (x *InboxMessage) Reset() {
- *x = InboxMessage{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_inbox_service_proto_msgTypes[4]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *InboxMessage) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*InboxMessage) ProtoMessage() {}
-
-func (x *InboxMessage) ProtoReflect() protoreflect.Message {
- mi := &file_v1_inbox_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 InboxMessage.ProtoReflect.Descriptor instead.
-func (*InboxMessage) Descriptor() ([]byte, []int) {
- return file_v1_inbox_service_proto_rawDescGZIP(), []int{4}
-}
-
-func (x *InboxMessage) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *InboxMessage) GetActivityUid() string {
- if x != nil {
- return x.ActivityUid
- }
- return ""
-}
-
-func (x *InboxMessage) GetStatus() InboxMessage_Status {
- if x != nil {
- return x.Status
- }
- return InboxMessage_STATUS_UNSPECIFIED
-}
-
-func (x *InboxMessage) GetActivity() *LogEntity {
- if x != nil {
- return x.Activity
- }
- return nil
-}
-
-type InboxSummary struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Unread int32 `protobuf:"varint,1,opt,name=unread,proto3" json:"unread,omitempty"`
- UnreadError int32 `protobuf:"varint,2,opt,name=unread_error,json=unreadError,proto3" json:"unread_error,omitempty"`
-}
-
-func (x *InboxSummary) Reset() {
- *x = InboxSummary{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_inbox_service_proto_msgTypes[5]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *InboxSummary) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*InboxSummary) ProtoMessage() {}
-
-func (x *InboxSummary) ProtoReflect() protoreflect.Message {
- mi := &file_v1_inbox_service_proto_msgTypes[5]
- 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 InboxSummary.ProtoReflect.Descriptor instead.
-func (*InboxSummary) Descriptor() ([]byte, []int) {
- return file_v1_inbox_service_proto_rawDescGZIP(), []int{5}
-}
-
-func (x *InboxSummary) GetUnread() int32 {
- if x != nil {
- return x.Unread
- }
- return 0
-}
-
-func (x *InboxSummary) GetUnreadError() int32 {
- if x != nil {
- return x.UnreadError
- }
- return 0
-}
-
-var File_v1_inbox_service_proto protoreflect.FileDescriptor
-
-var file_v1_inbox_service_proto_rawDesc = []byte{
- 0x0a, 0x16, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 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, 0x20, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66,
- 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
- 0x18, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76,
- 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x66, 0x0a, 0x10, 0x4c, 0x69, 0x73,
- 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a,
- 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66,
- 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69,
- 0x7a, 0x65, 0x18, 0x02, 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, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
- 0x6e, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52,
- 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x69, 0x6e, 0x62, 0x6f, 0x78,
- 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
- 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e,
- 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52,
- 0x0d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 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, 0x18, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62,
- 0x6f, 0x78, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0d, 0x69, 0x6e, 0x62, 0x6f, 0x78,
- 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x62,
- 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c,
- 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 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, 0xf9, 0x01, 0x0a, 0x0c, 0x49, 0x6e,
- 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21,
- 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x55, 0x69,
- 0x64, 0x12, 0x38, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x74, 0x61,
- 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x08, 0x61,
- 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x45,
- 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x22,
- 0x44, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41,
- 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
- 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x52, 0x45,
- 0x41, 0x44, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52,
- 0x45, 0x41, 0x44, 0x10, 0x02, 0x22, 0x49, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75,
- 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x12, 0x21, 0x0a,
- 0x0c, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x05, 0x52, 0x0b, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72,
- 0x32, 0xfc, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
- 0x65, 0x12, 0x5d, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x1d,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
- 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
- 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82,
- 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78,
- 0x12, 0x6c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75, 0x6d, 0x6d,
- 0x61, 0x72, 0x79, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72,
- 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75, 0x6d, 0x6d,
- 0x61, 0x72, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31,
- 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x3a, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x9e,
- 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x1f,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e,
- 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x53, 0xda, 0x41, 0x19, 0x69,
- 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2c, 0x75, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x0d,
- 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x20, 0x2f,
- 0x76, 0x31, 0x2f, 0x7b, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
- 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2f, 0x2a, 0x7d, 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_inbox_service_proto_rawDescOnce sync.Once
- file_v1_inbox_service_proto_rawDescData = file_v1_inbox_service_proto_rawDesc
-)
-
-func file_v1_inbox_service_proto_rawDescGZIP() []byte {
- file_v1_inbox_service_proto_rawDescOnce.Do(func() {
- file_v1_inbox_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_inbox_service_proto_rawDescData)
- })
- return file_v1_inbox_service_proto_rawDescData
-}
-
-var file_v1_inbox_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_v1_inbox_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
-var file_v1_inbox_service_proto_goTypes = []interface{}{
- (InboxMessage_Status)(0), // 0: bytebase.v1.InboxMessage.Status
- (*ListInboxRequest)(nil), // 1: bytebase.v1.ListInboxRequest
- (*ListInboxResponse)(nil), // 2: bytebase.v1.ListInboxResponse
- (*GetInboxSummaryRequest)(nil), // 3: bytebase.v1.GetInboxSummaryRequest
- (*UpdateInboxRequest)(nil), // 4: bytebase.v1.UpdateInboxRequest
- (*InboxMessage)(nil), // 5: bytebase.v1.InboxMessage
- (*InboxSummary)(nil), // 6: bytebase.v1.InboxSummary
- (*fieldmaskpb.FieldMask)(nil), // 7: google.protobuf.FieldMask
- (*LogEntity)(nil), // 8: bytebase.v1.LogEntity
-}
-var file_v1_inbox_service_proto_depIdxs = []int32{
- 5, // 0: bytebase.v1.ListInboxResponse.inbox_messages:type_name -> bytebase.v1.InboxMessage
- 5, // 1: bytebase.v1.UpdateInboxRequest.inbox_message:type_name -> bytebase.v1.InboxMessage
- 7, // 2: bytebase.v1.UpdateInboxRequest.update_mask:type_name -> google.protobuf.FieldMask
- 0, // 3: bytebase.v1.InboxMessage.status:type_name -> bytebase.v1.InboxMessage.Status
- 8, // 4: bytebase.v1.InboxMessage.activity:type_name -> bytebase.v1.LogEntity
- 1, // 5: bytebase.v1.InboxService.ListInbox:input_type -> bytebase.v1.ListInboxRequest
- 3, // 6: bytebase.v1.InboxService.GetInboxSummary:input_type -> bytebase.v1.GetInboxSummaryRequest
- 4, // 7: bytebase.v1.InboxService.UpdateInbox:input_type -> bytebase.v1.UpdateInboxRequest
- 2, // 8: bytebase.v1.InboxService.ListInbox:output_type -> bytebase.v1.ListInboxResponse
- 6, // 9: bytebase.v1.InboxService.GetInboxSummary:output_type -> bytebase.v1.InboxSummary
- 5, // 10: bytebase.v1.InboxService.UpdateInbox:output_type -> bytebase.v1.InboxMessage
- 8, // [8:11] is the sub-list for method output_type
- 5, // [5:8] is the sub-list for method input_type
- 5, // [5:5] is the sub-list for extension type_name
- 5, // [5:5] is the sub-list for extension extendee
- 0, // [0:5] is the sub-list for field type_name
-}
-
-func init() { file_v1_inbox_service_proto_init() }
-func file_v1_inbox_service_proto_init() {
- if File_v1_inbox_service_proto != nil {
- return
- }
- file_v1_logging_service_proto_init()
- if !protoimpl.UnsafeEnabled {
- file_v1_inbox_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*ListInboxRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_v1_inbox_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*ListInboxResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_v1_inbox_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*GetInboxSummaryRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_v1_inbox_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UpdateInboxRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_v1_inbox_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*InboxMessage); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_v1_inbox_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*InboxSummary); 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_inbox_service_proto_rawDesc,
- NumEnums: 1,
- NumMessages: 6,
- NumExtensions: 0,
- NumServices: 1,
- },
- GoTypes: file_v1_inbox_service_proto_goTypes,
- DependencyIndexes: file_v1_inbox_service_proto_depIdxs,
- EnumInfos: file_v1_inbox_service_proto_enumTypes,
- MessageInfos: file_v1_inbox_service_proto_msgTypes,
- }.Build()
- File_v1_inbox_service_proto = out.File
- file_v1_inbox_service_proto_rawDesc = nil
- file_v1_inbox_service_proto_goTypes = nil
- file_v1_inbox_service_proto_depIdxs = nil
-}
diff --git a/proto/generated-go/v1/inbox_service.pb.gw.go b/proto/generated-go/v1/inbox_service.pb.gw.go
deleted file mode 100644
index 666863d8a0..0000000000
--- a/proto/generated-go/v1/inbox_service.pb.gw.go
+++ /dev/null
@@ -1,393 +0,0 @@
-// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
-// source: v1/inbox_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
-
-var (
- filter_InboxService_ListInbox_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
-)
-
-func request_InboxService_ListInbox_0(ctx context.Context, marshaler runtime.Marshaler, client InboxServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq ListInboxRequest
- 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_InboxService_ListInbox_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
-
- msg, err := client.ListInbox(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-
-}
-
-func local_request_InboxService_ListInbox_0(ctx context.Context, marshaler runtime.Marshaler, server InboxServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq ListInboxRequest
- 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_InboxService_ListInbox_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
-
- msg, err := server.ListInbox(ctx, &protoReq)
- return msg, metadata, err
-
-}
-
-func request_InboxService_GetInboxSummary_0(ctx context.Context, marshaler runtime.Marshaler, client InboxServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq GetInboxSummaryRequest
- var metadata runtime.ServerMetadata
-
- msg, err := client.GetInboxSummary(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-
-}
-
-func local_request_InboxService_GetInboxSummary_0(ctx context.Context, marshaler runtime.Marshaler, server InboxServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq GetInboxSummaryRequest
- var metadata runtime.ServerMetadata
-
- msg, err := server.GetInboxSummary(ctx, &protoReq)
- return msg, metadata, err
-
-}
-
-var (
- filter_InboxService_UpdateInbox_0 = &utilities.DoubleArray{Encoding: map[string]int{"inbox_message": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
-)
-
-func request_InboxService_UpdateInbox_0(ctx context.Context, marshaler runtime.Marshaler, client InboxServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq UpdateInboxRequest
- 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.InboxMessage); err != nil && err != io.EOF {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
- if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.InboxMessage); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- } else {
- protoReq.UpdateMask = fieldMask
- }
- }
-
- var (
- val string
- ok bool
- err error
- _ = err
- )
-
- val, ok = pathParams["inbox_message.name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "inbox_message.name")
- }
-
- err = runtime.PopulateFieldFromPath(&protoReq, "inbox_message.name", val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "inbox_message.name", err)
- }
-
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_UpdateInbox_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
-
- msg, err := client.UpdateInbox(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-
-}
-
-func local_request_InboxService_UpdateInbox_0(ctx context.Context, marshaler runtime.Marshaler, server InboxServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq UpdateInboxRequest
- 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.InboxMessage); err != nil && err != io.EOF {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
- if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.InboxMessage); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- } else {
- protoReq.UpdateMask = fieldMask
- }
- }
-
- var (
- val string
- ok bool
- err error
- _ = err
- )
-
- val, ok = pathParams["inbox_message.name"]
- if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "inbox_message.name")
- }
-
- err = runtime.PopulateFieldFromPath(&protoReq, "inbox_message.name", val)
- if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "inbox_message.name", err)
- }
-
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_UpdateInbox_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
-
- msg, err := server.UpdateInbox(ctx, &protoReq)
- return msg, metadata, err
-
-}
-
-// RegisterInboxServiceHandlerServer registers the http handlers for service InboxService to "mux".
-// UnaryRPC :call InboxServiceServer 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 RegisterInboxServiceHandlerFromEndpoint instead.
-func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InboxServiceServer) error {
-
- mux.Handle("GET", pattern_InboxService_ListInbox_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.InboxService/ListInbox", runtime.WithHTTPPathPattern("/v1/inbox"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_InboxService_ListInbox_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_InboxService_ListInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
-
- })
-
- mux.Handle("GET", pattern_InboxService_GetInboxSummary_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.InboxService/GetInboxSummary", runtime.WithHTTPPathPattern("/v1/inbox:summary"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_InboxService_GetInboxSummary_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_InboxService_GetInboxSummary_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
-
- })
-
- mux.Handle("PATCH", pattern_InboxService_UpdateInbox_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.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/v1/{inbox_message.name=inbox/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_InboxService_UpdateInbox_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_InboxService_UpdateInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
-
- })
-
- return nil
-}
-
-// RegisterInboxServiceHandlerFromEndpoint is same as RegisterInboxServiceHandler but
-// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
-func RegisterInboxServiceHandlerFromEndpoint(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 RegisterInboxServiceHandler(ctx, mux, conn)
-}
-
-// RegisterInboxServiceHandler registers the http handlers for service InboxService to "mux".
-// The handlers forward requests to the grpc endpoint over "conn".
-func RegisterInboxServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
- return RegisterInboxServiceHandlerClient(ctx, mux, NewInboxServiceClient(conn))
-}
-
-// RegisterInboxServiceHandlerClient registers the http handlers for service InboxService
-// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "InboxServiceClient".
-// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "InboxServiceClient"
-// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
-// "InboxServiceClient" to call the correct interceptors.
-func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InboxServiceClient) error {
-
- mux.Handle("GET", pattern_InboxService_ListInbox_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.InboxService/ListInbox", runtime.WithHTTPPathPattern("/v1/inbox"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_InboxService_ListInbox_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
-
- forward_InboxService_ListInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
-
- })
-
- mux.Handle("GET", pattern_InboxService_GetInboxSummary_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.InboxService/GetInboxSummary", runtime.WithHTTPPathPattern("/v1/inbox:summary"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_InboxService_GetInboxSummary_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
-
- forward_InboxService_GetInboxSummary_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
-
- })
-
- mux.Handle("PATCH", pattern_InboxService_UpdateInbox_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.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/v1/{inbox_message.name=inbox/*}"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_InboxService_UpdateInbox_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
-
- forward_InboxService_UpdateInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
-
- })
-
- return nil
-}
-
-var (
- pattern_InboxService_ListInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "inbox"}, ""))
-
- pattern_InboxService_GetInboxSummary_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "inbox"}, "summary"))
-
- pattern_InboxService_UpdateInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "inbox", "inbox_message.name"}, ""))
-)
-
-var (
- forward_InboxService_ListInbox_0 = runtime.ForwardResponseMessage
-
- forward_InboxService_GetInboxSummary_0 = runtime.ForwardResponseMessage
-
- forward_InboxService_UpdateInbox_0 = runtime.ForwardResponseMessage
-)
diff --git a/proto/generated-go/v1/inbox_service_grpc.pb.go b/proto/generated-go/v1/inbox_service_grpc.pb.go
deleted file mode 100644
index 3df30fe134..0000000000
--- a/proto/generated-go/v1/inbox_service_grpc.pb.go
+++ /dev/null
@@ -1,183 +0,0 @@
-// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-// versions:
-// - protoc-gen-go-grpc v1.3.0
-// - protoc (unknown)
-// source: v1/inbox_service.proto
-
-package v1
-
-import (
- context "context"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
-)
-
-// 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 (
- InboxService_ListInbox_FullMethodName = "/bytebase.v1.InboxService/ListInbox"
- InboxService_GetInboxSummary_FullMethodName = "/bytebase.v1.InboxService/GetInboxSummary"
- InboxService_UpdateInbox_FullMethodName = "/bytebase.v1.InboxService/UpdateInbox"
-)
-
-// InboxServiceClient is the client API for InboxService 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 InboxServiceClient interface {
- ListInbox(ctx context.Context, in *ListInboxRequest, opts ...grpc.CallOption) (*ListInboxResponse, error)
- GetInboxSummary(ctx context.Context, in *GetInboxSummaryRequest, opts ...grpc.CallOption) (*InboxSummary, error)
- UpdateInbox(ctx context.Context, in *UpdateInboxRequest, opts ...grpc.CallOption) (*InboxMessage, error)
-}
-
-type inboxServiceClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewInboxServiceClient(cc grpc.ClientConnInterface) InboxServiceClient {
- return &inboxServiceClient{cc}
-}
-
-func (c *inboxServiceClient) ListInbox(ctx context.Context, in *ListInboxRequest, opts ...grpc.CallOption) (*ListInboxResponse, error) {
- out := new(ListInboxResponse)
- err := c.cc.Invoke(ctx, InboxService_ListInbox_FullMethodName, in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *inboxServiceClient) GetInboxSummary(ctx context.Context, in *GetInboxSummaryRequest, opts ...grpc.CallOption) (*InboxSummary, error) {
- out := new(InboxSummary)
- err := c.cc.Invoke(ctx, InboxService_GetInboxSummary_FullMethodName, in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *inboxServiceClient) UpdateInbox(ctx context.Context, in *UpdateInboxRequest, opts ...grpc.CallOption) (*InboxMessage, error) {
- out := new(InboxMessage)
- err := c.cc.Invoke(ctx, InboxService_UpdateInbox_FullMethodName, in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// InboxServiceServer is the server API for InboxService service.
-// All implementations must embed UnimplementedInboxServiceServer
-// for forward compatibility
-type InboxServiceServer interface {
- ListInbox(context.Context, *ListInboxRequest) (*ListInboxResponse, error)
- GetInboxSummary(context.Context, *GetInboxSummaryRequest) (*InboxSummary, error)
- UpdateInbox(context.Context, *UpdateInboxRequest) (*InboxMessage, error)
- mustEmbedUnimplementedInboxServiceServer()
-}
-
-// UnimplementedInboxServiceServer must be embedded to have forward compatible implementations.
-type UnimplementedInboxServiceServer struct {
-}
-
-func (UnimplementedInboxServiceServer) ListInbox(context.Context, *ListInboxRequest) (*ListInboxResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ListInbox not implemented")
-}
-func (UnimplementedInboxServiceServer) GetInboxSummary(context.Context, *GetInboxSummaryRequest) (*InboxSummary, error) {
- return nil, status.Errorf(codes.Unimplemented, "method GetInboxSummary not implemented")
-}
-func (UnimplementedInboxServiceServer) UpdateInbox(context.Context, *UpdateInboxRequest) (*InboxMessage, error) {
- return nil, status.Errorf(codes.Unimplemented, "method UpdateInbox not implemented")
-}
-func (UnimplementedInboxServiceServer) mustEmbedUnimplementedInboxServiceServer() {}
-
-// UnsafeInboxServiceServer may be embedded to opt out of forward compatibility for this service.
-// Use of this interface is not recommended, as added methods to InboxServiceServer will
-// result in compilation errors.
-type UnsafeInboxServiceServer interface {
- mustEmbedUnimplementedInboxServiceServer()
-}
-
-func RegisterInboxServiceServer(s grpc.ServiceRegistrar, srv InboxServiceServer) {
- s.RegisterService(&InboxService_ServiceDesc, srv)
-}
-
-func _InboxService_ListInbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListInboxRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(InboxServiceServer).ListInbox(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: InboxService_ListInbox_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(InboxServiceServer).ListInbox(ctx, req.(*ListInboxRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _InboxService_GetInboxSummary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetInboxSummaryRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(InboxServiceServer).GetInboxSummary(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: InboxService_GetInboxSummary_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(InboxServiceServer).GetInboxSummary(ctx, req.(*GetInboxSummaryRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _InboxService_UpdateInbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateInboxRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(InboxServiceServer).UpdateInbox(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: InboxService_UpdateInbox_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(InboxServiceServer).UpdateInbox(ctx, req.(*UpdateInboxRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-// InboxService_ServiceDesc is the grpc.ServiceDesc for InboxService service.
-// It's only intended for direct use with grpc.RegisterService,
-// and not to be introspected or modified (even as a copy)
-var InboxService_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "bytebase.v1.InboxService",
- HandlerType: (*InboxServiceServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "ListInbox",
- Handler: _InboxService_ListInbox_Handler,
- },
- {
- MethodName: "GetInboxSummary",
- Handler: _InboxService_GetInboxSummary_Handler,
- },
- {
- MethodName: "UpdateInbox",
- Handler: _InboxService_UpdateInbox_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "v1/inbox_service.proto",
-}
diff --git a/proto/store/activity.proto b/proto/store/activity.proto
index 0fac6c1e99..09f7d8587f 100644
--- a/proto/store/activity.proto
+++ b/proto/store/activity.proto
@@ -12,7 +12,6 @@ option go_package = "generated-go/store";
// json naming convention. More importantly, frontend code can simply use JSON.parse to
// convert to the expected struct there.
message ActivityIssueCreatePayload {
- // Used by inbox to display info without paying the join cost
string issue_name = 1;
}
@@ -59,7 +58,6 @@ message ActivityIssueCommentCreatePayload {
TaskRollbackBy task_rollback_by = 2;
ApprovalEvent approval_event = 3;
}
- // Used by inbox to display info without paying the join cost
string issue_name = 4;
}
diff --git a/proto/v1/inbox_service.proto b/proto/v1/inbox_service.proto
deleted file mode 100644
index 4c2b1ff34d..0000000000
--- a/proto/v1/inbox_service.proto
+++ /dev/null
@@ -1,90 +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/field_mask.proto";
-import "v1/logging_service.proto";
-
-option go_package = "generated-go/v1";
-
-service InboxService {
- rpc ListInbox(ListInboxRequest) returns (ListInboxResponse) {
- option (google.api.http) = {get: "/v1/inbox"};
- }
-
- rpc GetInboxSummary(GetInboxSummaryRequest) returns (InboxSummary) {
- option (google.api.http) = {get: "/v1/inbox:summary"};
- }
-
- rpc UpdateInbox(UpdateInboxRequest) returns (InboxMessage) {
- option (google.api.http) = {
- patch: "/v1/{inbox_message.name=inbox/*}"
- body: "inbox_message"
- };
- option (google.api.method_signature) = "inbox_message,update_mask";
- }
-}
-
-message ListInboxRequest {
- // filter is the filter to apply on the list inbox request,
- // follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax.
- // The field only support in filter:
- // - "create_time" with ">=" operator, example:
- // - create_time >= "2022-01-01T12:00:00.000Z"
- string filter = 1;
-
- // Not used. The maximum number of inbox to return.
- // The service may return fewer than this value.
- // If unspecified, at most 100 log entries will be returned.
- // The maximum value is 1000; values above 1000 will be coerced to 1000.
- int32 page_size = 2;
-
- // Not used. A page token, received from a previous `ListInbox` call.
- // Provide this to retrieve the subsequent page.
- string page_token = 3;
-}
-
-message ListInboxResponse {
- // The list of inbox messages.
- repeated InboxMessage inbox_messages = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
-
- // A token to retrieve next page of inbox.
- // Pass this value in the page_token field in the subsequent call to `ListLogs` method
- // to retrieve the next page of log entities.
- string next_page_token = 2;
-}
-
-message GetInboxSummaryRequest {}
-
-message UpdateInboxRequest {
- // The inbox message to update.
- InboxMessage inbox_message = 1 [(google.api.field_behavior) = REQUIRED];
-
- // The list of fields to update.
- google.protobuf.FieldMask update_mask = 2;
-}
-
-message InboxMessage {
- // The message name in inbox/{uid} format.
- string name = 1;
-
- string activity_uid = 2;
-
- enum Status {
- STATUS_UNSPECIFIED = 0;
- STATUS_UNREAD = 1;
- STATUS_READ = 2;
- }
- Status status = 3;
-
- LogEntity activity = 4;
-}
-
-message InboxSummary {
- int32 unread = 1;
-
- int32 unread_error = 2;
-}