diff --git a/backend/daemon/api/activity/v1alpha/activity.go b/backend/daemon/api/activity/v1alpha/activity.go index 89f13a5a1..29976036a 100644 --- a/backend/daemon/api/activity/v1alpha/activity.go +++ b/backend/daemon/api/activity/v1alpha/activity.go @@ -9,7 +9,6 @@ import ( "mintter/backend/pkg/dqb" "mintter/backend/pkg/future" "strconv" - sync "sync" "time" "github.com/ipfs/go-cid" @@ -28,9 +27,9 @@ type Repo interface { // Server implements the Activity gRPC API. type Server struct { - db *sqlitex.Pool - startTime time.Time - mu sync.Mutex // we only want one register request at a time. + db *sqlitex.Pool + startTime time.Time + NextPageToken string } // NewServer creates a new Server. @@ -51,6 +50,7 @@ func (srv *Server) ListEvents(ctx context.Context, req *activity.ListEventsReque return nil, fmt.Errorf("Token not valid: %w", err) } } + fmt.Println(token) conn, cancel, err := srv.db.Conn(ctx) if err != nil { return nil, err @@ -59,15 +59,28 @@ func (srv *Server) ListEvents(ctx context.Context, req *activity.ListEventsReque var events []*activity.Event - var qGetEvents = dqb.Str(` + var qGetEventsTrusted = dqb.Str(` SELECT structural_blobs.type ,public_keys.principal, resources.iri, structural_blobs.ts, blobs.insert_time, blobs.multihash, blobs.codec FROM structural_blobs JOIN blobs ON blobs.id=structural_blobs.id JOIN public_keys ON structural_blobs.author=public_keys.id JOIN resources ON structural_blobs.resource=resources.id - WHERE structural_blobs.id >= ?; + JOIN trusted_accounts ON trusted_accounts.id=public_keys.id + ORDER BY blobs.id desc limit ?; `) - err = sqlitex.Exec(conn, qGetEvents(), func(stmt *sqlite.Stmt) error { + var qGetEventsAll = dqb.Str(` + SELECT structural_blobs.type ,public_keys.principal, resources.iri, structural_blobs.ts, blobs.insert_time, blobs.multihash, blobs.codec + FROM structural_blobs + JOIN blobs ON blobs.id=structural_blobs.id + JOIN public_keys ON structural_blobs.author=public_keys.id + JOIN resources ON structural_blobs.resource=resources.id + ORDER BY blobs.id desc limit ?; + `) + query := qGetEventsAll() + if req.TrustedOnly { + query = qGetEventsTrusted() + } + err = sqlitex.Exec(conn, query, func(stmt *sqlite.Stmt) error { eventType := stmt.ColumnText(0) author := stmt.ColumnBytes(1) resource := stmt.ColumnText(2) @@ -91,10 +104,18 @@ func (srv *Server) ListEvents(ctx context.Context, req *activity.ListEventsReque } events = append(events, &event) return nil - }, token) + }, req.PageSize) + var pageSize int32 = 20 + if req.PageSize != 0 { + pageSize = req.PageSize + } + var nextToken string + if pageSize < int32(len(events)) { + nextToken = strconv.Itoa(len(events)) + } return &activity.ListEventsResponse{ Events: events, - NextPageToken: "", + NextPageToken: nextToken, }, err } diff --git a/backend/daemon/api/activity/v1alpha/activity_test.go b/backend/daemon/api/activity/v1alpha/activity_test.go index c5d1b7f79..8ab2acc8e 100644 --- a/backend/daemon/api/activity/v1alpha/activity_test.go +++ b/backend/daemon/api/activity/v1alpha/activity_test.go @@ -20,6 +20,7 @@ func TestListEvents(t *testing.T) { events, err := alice.ListEvents(ctx, req) require.NoError(t, err) require.NotNil(t, events) + require.Len(t, events.Events, 0) } // TODO: update profile idempotent no change diff --git a/backend/genproto/activity/v1alpha/activity.pb.go b/backend/genproto/activity/v1alpha/activity.pb.go index f72b0fd86..c64d17acd 100644 --- a/backend/genproto/activity/v1alpha/activity.pb.go +++ b/backend/genproto/activity/v1alpha/activity.pb.go @@ -31,6 +31,8 @@ type ListEventsRequest struct { PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // Optional. The page token for requesting next pages. PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // Optional. If we want events from trusted peers only. All peers by default. + TrustedOnly bool `protobuf:"varint,3,opt,name=trusted_only,json=trustedOnly,proto3" json:"trusted_only,omitempty"` } func (x *ListEventsRequest) Reset() { @@ -79,6 +81,13 @@ func (x *ListEventsRequest) GetPageToken() string { return "" } +func (x *ListEventsRequest) GetTrustedOnly() bool { + if x != nil { + return x.TrustedOnly + } + return false +} + // The response with the list of events. type ListEventsResponse struct { state protoimpl.MessageState @@ -328,53 +337,55 @@ var file_activity_v1alpha_activity_proto_rawDesc = []byte{ 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x4f, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x22, 0x72, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x22, 0x79, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x69, - 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, - 0x65, 0x6e, 0x74, 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, 0xec, 0x01, 0x0a, - 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x62, 0x6c, - 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, - 0x69, 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4e, 0x65, 0x77, 0x42, 0x6c, 0x6f, 0x62, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x42, 0x6c, 0x6f, 0x62, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, + 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x79, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, + 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, + 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 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, + 0xec, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x08, 0x6e, 0x65, 0x77, + 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4e, 0x65, 0x77, 0x42, 0x6c, + 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x42, 0x6c, + 0x6f, 0x62, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x6f, 0x62, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x71, 0x0a, 0x0c, 0x4e, - 0x65, 0x77, 0x42, 0x6c, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x63, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x1b, 0x0a, - 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x32, 0x7f, - 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x46, 0x65, 0x65, 0x64, 0x12, 0x6f, - 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, - 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2e, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x34, 0x5a, 0x32, 0x6d, 0x69, 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, - 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x69, 0x74, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x6f, 0x62, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x71, + 0x0a, 0x0c, 0x4e, 0x65, 0x77, 0x42, 0x6c, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, + 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x32, 0x7f, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x46, 0x65, 0x65, + 0x64, 0x12, 0x6f, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2e, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2e, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x34, 0x5a, 0x32, 0x6d, 0x69, 0x6e, 0x74, 0x74, 0x65, 0x72, 0x2f, 0x62, 0x61, + 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, + 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/frontend/packages/shared/src/client/.generated/activity/v1alpha/activity_pb.ts b/frontend/packages/shared/src/client/.generated/activity/v1alpha/activity_pb.ts index 3a013c4e9..bb166b273 100644 --- a/frontend/packages/shared/src/client/.generated/activity/v1alpha/activity_pb.ts +++ b/frontend/packages/shared/src/client/.generated/activity/v1alpha/activity_pb.ts @@ -26,6 +26,13 @@ export class ListEventsRequest extends Message { */ pageToken = ""; + /** + * Optional. If we want events from trusted peers only. All peers by default. + * + * @generated from field: bool trusted_only = 3; + */ + trustedOnly = false; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -36,6 +43,7 @@ export class ListEventsRequest extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 2, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "trusted_only", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListEventsRequest { diff --git a/proto/activity/v1alpha/activity.proto b/proto/activity/v1alpha/activity.proto index 84777e4a3..9b4f6e11d 100644 --- a/proto/activity/v1alpha/activity.proto +++ b/proto/activity/v1alpha/activity.proto @@ -21,7 +21,9 @@ message ListEventsRequest { // Optional. The page token for requesting next pages. string page_token = 2; - // TODO: add filtering options. + // Optional. If we want events from trusted peers only. All peers by default. + bool trusted_only = 3; + } // The response with the list of events. diff --git a/proto/activity/v1alpha/go.gensum b/proto/activity/v1alpha/go.gensum index 2b2f2df1a..3f7044650 100644 --- a/proto/activity/v1alpha/go.gensum +++ b/proto/activity/v1alpha/go.gensum @@ -1,2 +1,2 @@ -srcs: 67073275389dafc231a09fc47630ec57 -outs: 89ed2f89f62bf355718fabc3f8d15d2d +srcs: 08c7670fc311b065826a85e61a2dc9a0 +outs: f7394d08dcc87852df0deeb0dd8cfdc4 diff --git a/proto/activity/v1alpha/js.gensum b/proto/activity/v1alpha/js.gensum index 4659eeb31..63daefd6c 100644 --- a/proto/activity/v1alpha/js.gensum +++ b/proto/activity/v1alpha/js.gensum @@ -1,2 +1,2 @@ -srcs: 67073275389dafc231a09fc47630ec57 -outs: ff6e3daacd6da650a65cce6d39dc5dec +srcs: 08c7670fc311b065826a85e61a2dc9a0 +outs: 7eb64f85ef272bfadf32da03a366cdc7