protobuf-platform 1.0.187 → 1.0.188

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,8 +11,10 @@ service Notification {
11
11
  rpc updateSingleNotification(NotificationRequest) returns (NotificationResponse);
12
12
  rpc deleteSingleNotification(GetNotificationRequest) returns (NotificationStatusResponse);
13
13
  rpc readListNotifications(PaginationRequest) returns (NotificationItemsResponse);
14
+ //Users
14
15
  rpc sendNotificationToUsers(SendNotificationRequest) returns (NotificationStatusResponse);
15
16
  rpc getNotificationForParticularUser(PaginationRequest) returns (UserNotificationItemsResponse);
17
+ rpc getNotificationsCountForUser(NotificationSearchRequest) returns (UserNotificationsCountResponse);
16
18
  }
17
19
 
18
20
  message PingRequest { string ping = 1; }
@@ -82,4 +84,7 @@ message NotificationItemsResponse {
82
84
  repeated NotificationItem items = 1;
83
85
  optional int32 total_pages = 2;
84
86
  optional int32 total_items = 3;
87
+ }
88
+ message UserNotificationsCountResponse {
89
+ int32 count = 1;
85
90
  }
@@ -70,6 +70,17 @@ function deserialize_notification_NotificationResponse(buffer_arg) {
70
70
  return notification_pb.NotificationResponse.deserializeBinary(new Uint8Array(buffer_arg));
71
71
  }
72
72
 
73
+ function serialize_notification_NotificationSearchRequest(arg) {
74
+ if (!(arg instanceof notification_pb.NotificationSearchRequest)) {
75
+ throw new Error('Expected argument of type notification.NotificationSearchRequest');
76
+ }
77
+ return Buffer.from(arg.serializeBinary());
78
+ }
79
+
80
+ function deserialize_notification_NotificationSearchRequest(buffer_arg) {
81
+ return notification_pb.NotificationSearchRequest.deserializeBinary(new Uint8Array(buffer_arg));
82
+ }
83
+
73
84
  function serialize_notification_NotificationStatusResponse(arg) {
74
85
  if (!(arg instanceof notification_pb.NotificationStatusResponse)) {
75
86
  throw new Error('Expected argument of type notification.NotificationStatusResponse');
@@ -136,6 +147,17 @@ function deserialize_notification_UserNotificationItemsResponse(buffer_arg) {
136
147
  return notification_pb.UserNotificationItemsResponse.deserializeBinary(new Uint8Array(buffer_arg));
137
148
  }
138
149
 
150
+ function serialize_notification_UserNotificationsCountResponse(arg) {
151
+ if (!(arg instanceof notification_pb.UserNotificationsCountResponse)) {
152
+ throw new Error('Expected argument of type notification.UserNotificationsCountResponse');
153
+ }
154
+ return Buffer.from(arg.serializeBinary());
155
+ }
156
+
157
+ function deserialize_notification_UserNotificationsCountResponse(buffer_arg) {
158
+ return notification_pb.UserNotificationsCountResponse.deserializeBinary(new Uint8Array(buffer_arg));
159
+ }
160
+
139
161
 
140
162
  var NotificationService = exports.NotificationService = {
141
163
  checkConnection: {
@@ -216,7 +238,8 @@ createSingleNotification: {
216
238
  responseSerialize: serialize_notification_NotificationItemsResponse,
217
239
  responseDeserialize: deserialize_notification_NotificationItemsResponse,
218
240
  },
219
- sendNotificationToUsers: {
241
+ // Users
242
+ sendNotificationToUsers: {
220
243
  path: '/notification.Notification/sendNotificationToUsers',
221
244
  requestStream: false,
222
245
  responseStream: false,
@@ -238,6 +261,17 @@ createSingleNotification: {
238
261
  responseSerialize: serialize_notification_UserNotificationItemsResponse,
239
262
  responseDeserialize: deserialize_notification_UserNotificationItemsResponse,
240
263
  },
264
+ getNotificationsCountForUser: {
265
+ path: '/notification.Notification/getNotificationsCountForUser',
266
+ requestStream: false,
267
+ responseStream: false,
268
+ requestType: notification_pb.NotificationSearchRequest,
269
+ responseType: notification_pb.UserNotificationsCountResponse,
270
+ requestSerialize: serialize_notification_NotificationSearchRequest,
271
+ requestDeserialize: deserialize_notification_NotificationSearchRequest,
272
+ responseSerialize: serialize_notification_UserNotificationsCountResponse,
273
+ responseDeserialize: deserialize_notification_UserNotificationsCountResponse,
274
+ },
241
275
  };
242
276
 
243
277
  exports.NotificationClient = grpc.makeGenericClientConstructor(NotificationService);
@@ -36,6 +36,7 @@ goog.exportSymbol('proto.notification.PongResponse', null, global);
36
36
  goog.exportSymbol('proto.notification.SendNotificationRequest', null, global);
37
37
  goog.exportSymbol('proto.notification.UserNotificationItem', null, global);
38
38
  goog.exportSymbol('proto.notification.UserNotificationItemsResponse', null, global);
39
+ goog.exportSymbol('proto.notification.UserNotificationsCountResponse', null, global);
39
40
  goog.exportSymbol('proto.notification.UserSearchRequest', null, global);
40
41
  /**
41
42
  * Generated by JsPbCodeGenerator.
@@ -373,6 +374,27 @@ if (goog.DEBUG && !COMPILED) {
373
374
  */
374
375
  proto.notification.NotificationItemsResponse.displayName = 'proto.notification.NotificationItemsResponse';
375
376
  }
377
+ /**
378
+ * Generated by JsPbCodeGenerator.
379
+ * @param {Array=} opt_data Optional initial data array, typically from a
380
+ * server response, or constructed directly in Javascript. The array is used
381
+ * in place and becomes part of the constructed object. It is not cloned.
382
+ * If no data is provided, the constructed object will be empty, but still
383
+ * valid.
384
+ * @extends {jspb.Message}
385
+ * @constructor
386
+ */
387
+ proto.notification.UserNotificationsCountResponse = function(opt_data) {
388
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
389
+ };
390
+ goog.inherits(proto.notification.UserNotificationsCountResponse, jspb.Message);
391
+ if (goog.DEBUG && !COMPILED) {
392
+ /**
393
+ * @public
394
+ * @override
395
+ */
396
+ proto.notification.UserNotificationsCountResponse.displayName = 'proto.notification.UserNotificationsCountResponse';
397
+ }
376
398
 
377
399
 
378
400
 
@@ -3714,4 +3736,134 @@ proto.notification.NotificationItemsResponse.prototype.hasTotalItems = function(
3714
3736
  };
3715
3737
 
3716
3738
 
3739
+
3740
+
3741
+
3742
+ if (jspb.Message.GENERATE_TO_OBJECT) {
3743
+ /**
3744
+ * Creates an object representation of this proto.
3745
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
3746
+ * Optional fields that are not set will be set to undefined.
3747
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
3748
+ * For the list of reserved names please see:
3749
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
3750
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
3751
+ * JSPB instance for transitional soy proto support:
3752
+ * http://goto/soy-param-migration
3753
+ * @return {!Object}
3754
+ */
3755
+ proto.notification.UserNotificationsCountResponse.prototype.toObject = function(opt_includeInstance) {
3756
+ return proto.notification.UserNotificationsCountResponse.toObject(opt_includeInstance, this);
3757
+ };
3758
+
3759
+
3760
+ /**
3761
+ * Static version of the {@see toObject} method.
3762
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
3763
+ * the JSPB instance for transitional soy proto support:
3764
+ * http://goto/soy-param-migration
3765
+ * @param {!proto.notification.UserNotificationsCountResponse} msg The msg instance to transform.
3766
+ * @return {!Object}
3767
+ * @suppress {unusedLocalVariables} f is only used for nested messages
3768
+ */
3769
+ proto.notification.UserNotificationsCountResponse.toObject = function(includeInstance, msg) {
3770
+ var f, obj = {
3771
+ count: jspb.Message.getFieldWithDefault(msg, 1, 0)
3772
+ };
3773
+
3774
+ if (includeInstance) {
3775
+ obj.$jspbMessageInstance = msg;
3776
+ }
3777
+ return obj;
3778
+ };
3779
+ }
3780
+
3781
+
3782
+ /**
3783
+ * Deserializes binary data (in protobuf wire format).
3784
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
3785
+ * @return {!proto.notification.UserNotificationsCountResponse}
3786
+ */
3787
+ proto.notification.UserNotificationsCountResponse.deserializeBinary = function(bytes) {
3788
+ var reader = new jspb.BinaryReader(bytes);
3789
+ var msg = new proto.notification.UserNotificationsCountResponse;
3790
+ return proto.notification.UserNotificationsCountResponse.deserializeBinaryFromReader(msg, reader);
3791
+ };
3792
+
3793
+
3794
+ /**
3795
+ * Deserializes binary data (in protobuf wire format) from the
3796
+ * given reader into the given message object.
3797
+ * @param {!proto.notification.UserNotificationsCountResponse} msg The message object to deserialize into.
3798
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3799
+ * @return {!proto.notification.UserNotificationsCountResponse}
3800
+ */
3801
+ proto.notification.UserNotificationsCountResponse.deserializeBinaryFromReader = function(msg, reader) {
3802
+ while (reader.nextField()) {
3803
+ if (reader.isEndGroup()) {
3804
+ break;
3805
+ }
3806
+ var field = reader.getFieldNumber();
3807
+ switch (field) {
3808
+ case 1:
3809
+ var value = /** @type {number} */ (reader.readInt32());
3810
+ msg.setCount(value);
3811
+ break;
3812
+ default:
3813
+ reader.skipField();
3814
+ break;
3815
+ }
3816
+ }
3817
+ return msg;
3818
+ };
3819
+
3820
+
3821
+ /**
3822
+ * Serializes the message to binary data (in protobuf wire format).
3823
+ * @return {!Uint8Array}
3824
+ */
3825
+ proto.notification.UserNotificationsCountResponse.prototype.serializeBinary = function() {
3826
+ var writer = new jspb.BinaryWriter();
3827
+ proto.notification.UserNotificationsCountResponse.serializeBinaryToWriter(this, writer);
3828
+ return writer.getResultBuffer();
3829
+ };
3830
+
3831
+
3832
+ /**
3833
+ * Serializes the given message to binary data (in protobuf wire
3834
+ * format), writing to the given BinaryWriter.
3835
+ * @param {!proto.notification.UserNotificationsCountResponse} message
3836
+ * @param {!jspb.BinaryWriter} writer
3837
+ * @suppress {unusedLocalVariables} f is only used for nested messages
3838
+ */
3839
+ proto.notification.UserNotificationsCountResponse.serializeBinaryToWriter = function(message, writer) {
3840
+ var f = undefined;
3841
+ f = message.getCount();
3842
+ if (f !== 0) {
3843
+ writer.writeInt32(
3844
+ 1,
3845
+ f
3846
+ );
3847
+ }
3848
+ };
3849
+
3850
+
3851
+ /**
3852
+ * optional int32 count = 1;
3853
+ * @return {number}
3854
+ */
3855
+ proto.notification.UserNotificationsCountResponse.prototype.getCount = function() {
3856
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
3857
+ };
3858
+
3859
+
3860
+ /**
3861
+ * @param {number} value
3862
+ * @return {!proto.notification.UserNotificationsCountResponse} returns this
3863
+ */
3864
+ proto.notification.UserNotificationsCountResponse.prototype.setCount = function(value) {
3865
+ return jspb.Message.setProto3IntField(this, 1, value);
3866
+ };
3867
+
3868
+
3717
3869
  goog.object.extend(exports, proto.notification);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.187",
3
+ "version": "1.0.188",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {