protobuf-platform 1.0.181 → 1.0.183

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,16 +11,49 @@ service Notification {
11
11
  //rpc updateSingleLevel(stream LevelRequest) returns (LevelResponse);
12
12
  //rpc deleteSingleLevel(GetLevelRequest) returns (LevelStatusResponse);
13
13
  //rpc readListLevels(PaginationRequest) returns (LevelItemsResponse);
14
+ rpc sendNotificationToUsers(SendNotificationRequest) returns (NotificationStatusResponse);
15
+ rpc getNotificationForParticularUser(PaginationRequest) returns (UserNotificationItemsResponse);
14
16
  }
15
17
 
16
18
  message PingRequest { string ping = 1; }
17
19
  message PongResponse { string pong = 1; }
18
- message PaginationRequest { int32 limit = 1; int32 offset = 2; optional NotificationSearchRequest notification_search_params = 3; }
20
+ message PaginationRequest {
21
+ int32 limit = 1;
22
+ int32 offset = 2;
23
+ optional NotificationSearchRequest notification_search_params = 3;
24
+ optional UserSearchRequest user_search_params = 4;
25
+ }
19
26
  message NotificationSearchRequest {
20
27
  optional int32 notification_id = 1;
21
28
  optional int32 user_id = 2;
22
29
  optional string notification_title = 3;
23
30
  }
31
+ message UserSearchRequest {
32
+ int32 user_id = 1;
33
+ optional bool is_checked = 2;
34
+ optional int32 limit = 3;
35
+ optional int32 offset = 4;
36
+ }
24
37
  //Media
25
38
  message File { bytes media = 1; }
26
- message GetFileRequest { string file_name = 1; string instance_type = 2; }
39
+ message GetFileRequest { string file_name = 1; string instance_type = 2; }
40
+
41
+ //Notification
42
+ message SendNotificationRequest {
43
+ int32 notification_id = 1;
44
+ repeated int32 user_ids = 2;
45
+ }
46
+ message NotificationStatusResponse {
47
+ string status = 1;
48
+ }
49
+ message UserNotificationItem {
50
+ string title = 1;
51
+ string content = 2;
52
+ bool is_checked = 3;
53
+ optional string created = 4;
54
+ }
55
+ message UserNotificationItemsResponse {
56
+ repeated UserNotificationItem items = 1;
57
+ optional int32 total_pages = 2;
58
+ optional int32 total_items = 3;
59
+ }
@@ -26,6 +26,28 @@ function deserialize_notification_GetFileRequest(buffer_arg) {
26
26
  return notification_pb.GetFileRequest.deserializeBinary(new Uint8Array(buffer_arg));
27
27
  }
28
28
 
29
+ function serialize_notification_NotificationStatusResponse(arg) {
30
+ if (!(arg instanceof notification_pb.NotificationStatusResponse)) {
31
+ throw new Error('Expected argument of type notification.NotificationStatusResponse');
32
+ }
33
+ return Buffer.from(arg.serializeBinary());
34
+ }
35
+
36
+ function deserialize_notification_NotificationStatusResponse(buffer_arg) {
37
+ return notification_pb.NotificationStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
38
+ }
39
+
40
+ function serialize_notification_PaginationRequest(arg) {
41
+ if (!(arg instanceof notification_pb.PaginationRequest)) {
42
+ throw new Error('Expected argument of type notification.PaginationRequest');
43
+ }
44
+ return Buffer.from(arg.serializeBinary());
45
+ }
46
+
47
+ function deserialize_notification_PaginationRequest(buffer_arg) {
48
+ return notification_pb.PaginationRequest.deserializeBinary(new Uint8Array(buffer_arg));
49
+ }
50
+
29
51
  function serialize_notification_PingRequest(arg) {
30
52
  if (!(arg instanceof notification_pb.PingRequest)) {
31
53
  throw new Error('Expected argument of type notification.PingRequest');
@@ -48,6 +70,28 @@ function deserialize_notification_PongResponse(buffer_arg) {
48
70
  return notification_pb.PongResponse.deserializeBinary(new Uint8Array(buffer_arg));
49
71
  }
50
72
 
73
+ function serialize_notification_SendNotificationRequest(arg) {
74
+ if (!(arg instanceof notification_pb.SendNotificationRequest)) {
75
+ throw new Error('Expected argument of type notification.SendNotificationRequest');
76
+ }
77
+ return Buffer.from(arg.serializeBinary());
78
+ }
79
+
80
+ function deserialize_notification_SendNotificationRequest(buffer_arg) {
81
+ return notification_pb.SendNotificationRequest.deserializeBinary(new Uint8Array(buffer_arg));
82
+ }
83
+
84
+ function serialize_notification_UserNotificationItemsResponse(arg) {
85
+ if (!(arg instanceof notification_pb.UserNotificationItemsResponse)) {
86
+ throw new Error('Expected argument of type notification.UserNotificationItemsResponse');
87
+ }
88
+ return Buffer.from(arg.serializeBinary());
89
+ }
90
+
91
+ function deserialize_notification_UserNotificationItemsResponse(buffer_arg) {
92
+ return notification_pb.UserNotificationItemsResponse.deserializeBinary(new Uint8Array(buffer_arg));
93
+ }
94
+
51
95
 
52
96
  var NotificationService = exports.NotificationService = {
53
97
  checkConnection: {
@@ -78,6 +122,28 @@ var NotificationService = exports.NotificationService = {
78
122
  // rpc updateSingleLevel(stream LevelRequest) returns (LevelResponse);
79
123
  // rpc deleteSingleLevel(GetLevelRequest) returns (LevelStatusResponse);
80
124
  // rpc readListLevels(PaginationRequest) returns (LevelItemsResponse);
125
+ sendNotificationToUsers: {
126
+ path: '/notification.Notification/sendNotificationToUsers',
127
+ requestStream: false,
128
+ responseStream: false,
129
+ requestType: notification_pb.SendNotificationRequest,
130
+ responseType: notification_pb.NotificationStatusResponse,
131
+ requestSerialize: serialize_notification_SendNotificationRequest,
132
+ requestDeserialize: deserialize_notification_SendNotificationRequest,
133
+ responseSerialize: serialize_notification_NotificationStatusResponse,
134
+ responseDeserialize: deserialize_notification_NotificationStatusResponse,
135
+ },
136
+ getNotificationForParticularUser: {
137
+ path: '/notification.Notification/getNotificationForParticularUser',
138
+ requestStream: false,
139
+ responseStream: false,
140
+ requestType: notification_pb.PaginationRequest,
141
+ responseType: notification_pb.UserNotificationItemsResponse,
142
+ requestSerialize: serialize_notification_PaginationRequest,
143
+ requestDeserialize: deserialize_notification_PaginationRequest,
144
+ responseSerialize: serialize_notification_UserNotificationItemsResponse,
145
+ responseDeserialize: deserialize_notification_UserNotificationItemsResponse,
146
+ },
81
147
  };
82
148
 
83
149
  exports.NotificationClient = grpc.makeGenericClientConstructor(NotificationService);