Skip to content

Commit 6aa479e

Browse files
committed
wip: pagination concept
1 parent 3f252d3 commit 6aa479e

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

protos/polycentric/v2/common.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
syntax = "proto3";
2+
package polycentric.v2;
3+
4+
message PageInfo {
5+
string end_cursor = 1;
6+
bool has_next_page = 2;
7+
bool has_previous_page = 3;
8+
string start_cursor = 4;
9+
}

protos/polycentric/v2/notifications.proto

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
syntax = "proto3";
22
package polycentric.v2;
33

4+
import "polycentric/v2/common.proto";
5+
import "polycentric/v2/events.proto";
46
import "polycentric/v2/server.proto";
57

8+
message Notification {
9+
// Event that triggered the notification
10+
EventBundle trigger_event = 1;
11+
// Event that the notification is in relation to
12+
EventBundle subject_event = 2;
13+
}
14+
15+
message GetNotificationsRequest {
16+
string identity = 1;
17+
// Return the 1 X number of notifications
18+
optional uint32 first = 2;
19+
// Return notifications after a cursor
20+
optional string after = 3;
21+
}
22+
23+
message GetNotificationsResponse {
24+
repeated Notification notification = 1;
25+
// Events that help the client resolve with fewer network calls
26+
repeated EventHint event_hints = 2;
27+
PageInfo page_info = 3;
28+
}
29+
630
message RegisterPushNotificationRequest {
731
string service = 1;
832
string token = 2;
@@ -26,4 +50,4 @@ service NotificationService {
2650

2751
// This endpoint expects a signed UnregisterPushNotificationRequest message
2852
rpc UnregisterPushNotifications(SignedMessage) returns (UnregisterPushNotificationResponse);
29-
}
53+
}

0 commit comments

Comments
 (0)