protobuf-platform 1.0.211 → 1.0.212

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.211",
3
+ "version": "1.0.212",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/user/user.proto CHANGED
@@ -26,6 +26,8 @@ service User {
26
26
  rpc removeUsersFromSegments(GetSegmentRequest) returns (SegmentStatusResponse);
27
27
  //Risk Status
28
28
  rpc readListRiskStatuses(PaginationRequest) returns (RiskStatusItemsResponse);
29
+ //Dashboard
30
+ rpc getDashboardInfo(DashboardRequest) returns (DashboardResponse);
29
31
  }
30
32
 
31
33
  message PingRequest { string ping = 1; }
@@ -212,3 +214,12 @@ message RiskStatusItemsResponse {
212
214
  optional int32 total_pages = 2;
213
215
  optional int32 total_items = 3;
214
216
  }
217
+ //Dashboard
218
+ message DashboardRequest {
219
+ string start_date = 1;
220
+ string end_date = 2;
221
+ }
222
+ message DashboardResponse {
223
+ optional int32 registration_count = 1;
224
+ optional int32 login_count = 2;
225
+ }
@@ -4,6 +4,28 @@
4
4
  var grpc = require('@grpc/grpc-js');
5
5
  var user_pb = require('./user_pb.js');
6
6
 
7
+ function serialize_user_DashboardRequest(arg) {
8
+ if (!(arg instanceof user_pb.DashboardRequest)) {
9
+ throw new Error('Expected argument of type user.DashboardRequest');
10
+ }
11
+ return Buffer.from(arg.serializeBinary());
12
+ }
13
+
14
+ function deserialize_user_DashboardRequest(buffer_arg) {
15
+ return user_pb.DashboardRequest.deserializeBinary(new Uint8Array(buffer_arg));
16
+ }
17
+
18
+ function serialize_user_DashboardResponse(arg) {
19
+ if (!(arg instanceof user_pb.DashboardResponse)) {
20
+ throw new Error('Expected argument of type user.DashboardResponse');
21
+ }
22
+ return Buffer.from(arg.serializeBinary());
23
+ }
24
+
25
+ function deserialize_user_DashboardResponse(buffer_arg) {
26
+ return user_pb.DashboardResponse.deserializeBinary(new Uint8Array(buffer_arg));
27
+ }
28
+
7
29
  function serialize_user_GetRoleRequest(arg) {
8
30
  if (!(arg instanceof user_pb.GetRoleRequest)) {
9
31
  throw new Error('Expected argument of type user.GetRoleRequest');
@@ -440,6 +462,18 @@ readListRiskStatuses: {
440
462
  responseSerialize: serialize_user_RiskStatusItemsResponse,
441
463
  responseDeserialize: deserialize_user_RiskStatusItemsResponse,
442
464
  },
465
+ // Dashboard
466
+ getDashboardInfo: {
467
+ path: '/user.User/getDashboardInfo',
468
+ requestStream: false,
469
+ responseStream: false,
470
+ requestType: user_pb.DashboardRequest,
471
+ responseType: user_pb.DashboardResponse,
472
+ requestSerialize: serialize_user_DashboardRequest,
473
+ requestDeserialize: deserialize_user_DashboardRequest,
474
+ responseSerialize: serialize_user_DashboardResponse,
475
+ responseDeserialize: deserialize_user_DashboardResponse,
476
+ },
443
477
  };
444
478
 
445
479
  exports.UserClient = grpc.makeGenericClientConstructor(UserService);
package/user/user_pb.js CHANGED
@@ -21,6 +21,8 @@ var global = (function() {
21
21
  return Function('return this')();
22
22
  }.call(null));
23
23
 
24
+ goog.exportSymbol('proto.user.DashboardRequest', null, global);
25
+ goog.exportSymbol('proto.user.DashboardResponse', null, global);
24
26
  goog.exportSymbol('proto.user.GetRoleRequest', null, global);
25
27
  goog.exportSymbol('proto.user.GetSegmentRequest', null, global);
26
28
  goog.exportSymbol('proto.user.LoggedInResponse', null, global);
@@ -571,6 +573,48 @@ if (goog.DEBUG && !COMPILED) {
571
573
  */
572
574
  proto.user.RiskStatusItemsResponse.displayName = 'proto.user.RiskStatusItemsResponse';
573
575
  }
576
+ /**
577
+ * Generated by JsPbCodeGenerator.
578
+ * @param {Array=} opt_data Optional initial data array, typically from a
579
+ * server response, or constructed directly in Javascript. The array is used
580
+ * in place and becomes part of the constructed object. It is not cloned.
581
+ * If no data is provided, the constructed object will be empty, but still
582
+ * valid.
583
+ * @extends {jspb.Message}
584
+ * @constructor
585
+ */
586
+ proto.user.DashboardRequest = function(opt_data) {
587
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
588
+ };
589
+ goog.inherits(proto.user.DashboardRequest, jspb.Message);
590
+ if (goog.DEBUG && !COMPILED) {
591
+ /**
592
+ * @public
593
+ * @override
594
+ */
595
+ proto.user.DashboardRequest.displayName = 'proto.user.DashboardRequest';
596
+ }
597
+ /**
598
+ * Generated by JsPbCodeGenerator.
599
+ * @param {Array=} opt_data Optional initial data array, typically from a
600
+ * server response, or constructed directly in Javascript. The array is used
601
+ * in place and becomes part of the constructed object. It is not cloned.
602
+ * If no data is provided, the constructed object will be empty, but still
603
+ * valid.
604
+ * @extends {jspb.Message}
605
+ * @constructor
606
+ */
607
+ proto.user.DashboardResponse = function(opt_data) {
608
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
609
+ };
610
+ goog.inherits(proto.user.DashboardResponse, jspb.Message);
611
+ if (goog.DEBUG && !COMPILED) {
612
+ /**
613
+ * @public
614
+ * @override
615
+ */
616
+ proto.user.DashboardResponse.displayName = 'proto.user.DashboardResponse';
617
+ }
574
618
 
575
619
 
576
620
 
@@ -8888,4 +8932,360 @@ proto.user.RiskStatusItemsResponse.prototype.hasTotalItems = function() {
8888
8932
  };
8889
8933
 
8890
8934
 
8935
+
8936
+
8937
+
8938
+ if (jspb.Message.GENERATE_TO_OBJECT) {
8939
+ /**
8940
+ * Creates an object representation of this proto.
8941
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
8942
+ * Optional fields that are not set will be set to undefined.
8943
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
8944
+ * For the list of reserved names please see:
8945
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
8946
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
8947
+ * JSPB instance for transitional soy proto support:
8948
+ * http://goto/soy-param-migration
8949
+ * @return {!Object}
8950
+ */
8951
+ proto.user.DashboardRequest.prototype.toObject = function(opt_includeInstance) {
8952
+ return proto.user.DashboardRequest.toObject(opt_includeInstance, this);
8953
+ };
8954
+
8955
+
8956
+ /**
8957
+ * Static version of the {@see toObject} method.
8958
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
8959
+ * the JSPB instance for transitional soy proto support:
8960
+ * http://goto/soy-param-migration
8961
+ * @param {!proto.user.DashboardRequest} msg The msg instance to transform.
8962
+ * @return {!Object}
8963
+ * @suppress {unusedLocalVariables} f is only used for nested messages
8964
+ */
8965
+ proto.user.DashboardRequest.toObject = function(includeInstance, msg) {
8966
+ var f, obj = {
8967
+ startDate: jspb.Message.getFieldWithDefault(msg, 1, ""),
8968
+ endDate: jspb.Message.getFieldWithDefault(msg, 2, "")
8969
+ };
8970
+
8971
+ if (includeInstance) {
8972
+ obj.$jspbMessageInstance = msg;
8973
+ }
8974
+ return obj;
8975
+ };
8976
+ }
8977
+
8978
+
8979
+ /**
8980
+ * Deserializes binary data (in protobuf wire format).
8981
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
8982
+ * @return {!proto.user.DashboardRequest}
8983
+ */
8984
+ proto.user.DashboardRequest.deserializeBinary = function(bytes) {
8985
+ var reader = new jspb.BinaryReader(bytes);
8986
+ var msg = new proto.user.DashboardRequest;
8987
+ return proto.user.DashboardRequest.deserializeBinaryFromReader(msg, reader);
8988
+ };
8989
+
8990
+
8991
+ /**
8992
+ * Deserializes binary data (in protobuf wire format) from the
8993
+ * given reader into the given message object.
8994
+ * @param {!proto.user.DashboardRequest} msg The message object to deserialize into.
8995
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
8996
+ * @return {!proto.user.DashboardRequest}
8997
+ */
8998
+ proto.user.DashboardRequest.deserializeBinaryFromReader = function(msg, reader) {
8999
+ while (reader.nextField()) {
9000
+ if (reader.isEndGroup()) {
9001
+ break;
9002
+ }
9003
+ var field = reader.getFieldNumber();
9004
+ switch (field) {
9005
+ case 1:
9006
+ var value = /** @type {string} */ (reader.readString());
9007
+ msg.setStartDate(value);
9008
+ break;
9009
+ case 2:
9010
+ var value = /** @type {string} */ (reader.readString());
9011
+ msg.setEndDate(value);
9012
+ break;
9013
+ default:
9014
+ reader.skipField();
9015
+ break;
9016
+ }
9017
+ }
9018
+ return msg;
9019
+ };
9020
+
9021
+
9022
+ /**
9023
+ * Serializes the message to binary data (in protobuf wire format).
9024
+ * @return {!Uint8Array}
9025
+ */
9026
+ proto.user.DashboardRequest.prototype.serializeBinary = function() {
9027
+ var writer = new jspb.BinaryWriter();
9028
+ proto.user.DashboardRequest.serializeBinaryToWriter(this, writer);
9029
+ return writer.getResultBuffer();
9030
+ };
9031
+
9032
+
9033
+ /**
9034
+ * Serializes the given message to binary data (in protobuf wire
9035
+ * format), writing to the given BinaryWriter.
9036
+ * @param {!proto.user.DashboardRequest} message
9037
+ * @param {!jspb.BinaryWriter} writer
9038
+ * @suppress {unusedLocalVariables} f is only used for nested messages
9039
+ */
9040
+ proto.user.DashboardRequest.serializeBinaryToWriter = function(message, writer) {
9041
+ var f = undefined;
9042
+ f = message.getStartDate();
9043
+ if (f.length > 0) {
9044
+ writer.writeString(
9045
+ 1,
9046
+ f
9047
+ );
9048
+ }
9049
+ f = message.getEndDate();
9050
+ if (f.length > 0) {
9051
+ writer.writeString(
9052
+ 2,
9053
+ f
9054
+ );
9055
+ }
9056
+ };
9057
+
9058
+
9059
+ /**
9060
+ * optional string start_date = 1;
9061
+ * @return {string}
9062
+ */
9063
+ proto.user.DashboardRequest.prototype.getStartDate = function() {
9064
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
9065
+ };
9066
+
9067
+
9068
+ /**
9069
+ * @param {string} value
9070
+ * @return {!proto.user.DashboardRequest} returns this
9071
+ */
9072
+ proto.user.DashboardRequest.prototype.setStartDate = function(value) {
9073
+ return jspb.Message.setProto3StringField(this, 1, value);
9074
+ };
9075
+
9076
+
9077
+ /**
9078
+ * optional string end_date = 2;
9079
+ * @return {string}
9080
+ */
9081
+ proto.user.DashboardRequest.prototype.getEndDate = function() {
9082
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
9083
+ };
9084
+
9085
+
9086
+ /**
9087
+ * @param {string} value
9088
+ * @return {!proto.user.DashboardRequest} returns this
9089
+ */
9090
+ proto.user.DashboardRequest.prototype.setEndDate = function(value) {
9091
+ return jspb.Message.setProto3StringField(this, 2, value);
9092
+ };
9093
+
9094
+
9095
+
9096
+
9097
+
9098
+ if (jspb.Message.GENERATE_TO_OBJECT) {
9099
+ /**
9100
+ * Creates an object representation of this proto.
9101
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
9102
+ * Optional fields that are not set will be set to undefined.
9103
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
9104
+ * For the list of reserved names please see:
9105
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
9106
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
9107
+ * JSPB instance for transitional soy proto support:
9108
+ * http://goto/soy-param-migration
9109
+ * @return {!Object}
9110
+ */
9111
+ proto.user.DashboardResponse.prototype.toObject = function(opt_includeInstance) {
9112
+ return proto.user.DashboardResponse.toObject(opt_includeInstance, this);
9113
+ };
9114
+
9115
+
9116
+ /**
9117
+ * Static version of the {@see toObject} method.
9118
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
9119
+ * the JSPB instance for transitional soy proto support:
9120
+ * http://goto/soy-param-migration
9121
+ * @param {!proto.user.DashboardResponse} msg The msg instance to transform.
9122
+ * @return {!Object}
9123
+ * @suppress {unusedLocalVariables} f is only used for nested messages
9124
+ */
9125
+ proto.user.DashboardResponse.toObject = function(includeInstance, msg) {
9126
+ var f, obj = {
9127
+ registrationCount: jspb.Message.getFieldWithDefault(msg, 1, 0),
9128
+ loginCount: jspb.Message.getFieldWithDefault(msg, 2, 0)
9129
+ };
9130
+
9131
+ if (includeInstance) {
9132
+ obj.$jspbMessageInstance = msg;
9133
+ }
9134
+ return obj;
9135
+ };
9136
+ }
9137
+
9138
+
9139
+ /**
9140
+ * Deserializes binary data (in protobuf wire format).
9141
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
9142
+ * @return {!proto.user.DashboardResponse}
9143
+ */
9144
+ proto.user.DashboardResponse.deserializeBinary = function(bytes) {
9145
+ var reader = new jspb.BinaryReader(bytes);
9146
+ var msg = new proto.user.DashboardResponse;
9147
+ return proto.user.DashboardResponse.deserializeBinaryFromReader(msg, reader);
9148
+ };
9149
+
9150
+
9151
+ /**
9152
+ * Deserializes binary data (in protobuf wire format) from the
9153
+ * given reader into the given message object.
9154
+ * @param {!proto.user.DashboardResponse} msg The message object to deserialize into.
9155
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
9156
+ * @return {!proto.user.DashboardResponse}
9157
+ */
9158
+ proto.user.DashboardResponse.deserializeBinaryFromReader = function(msg, reader) {
9159
+ while (reader.nextField()) {
9160
+ if (reader.isEndGroup()) {
9161
+ break;
9162
+ }
9163
+ var field = reader.getFieldNumber();
9164
+ switch (field) {
9165
+ case 1:
9166
+ var value = /** @type {number} */ (reader.readInt32());
9167
+ msg.setRegistrationCount(value);
9168
+ break;
9169
+ case 2:
9170
+ var value = /** @type {number} */ (reader.readInt32());
9171
+ msg.setLoginCount(value);
9172
+ break;
9173
+ default:
9174
+ reader.skipField();
9175
+ break;
9176
+ }
9177
+ }
9178
+ return msg;
9179
+ };
9180
+
9181
+
9182
+ /**
9183
+ * Serializes the message to binary data (in protobuf wire format).
9184
+ * @return {!Uint8Array}
9185
+ */
9186
+ proto.user.DashboardResponse.prototype.serializeBinary = function() {
9187
+ var writer = new jspb.BinaryWriter();
9188
+ proto.user.DashboardResponse.serializeBinaryToWriter(this, writer);
9189
+ return writer.getResultBuffer();
9190
+ };
9191
+
9192
+
9193
+ /**
9194
+ * Serializes the given message to binary data (in protobuf wire
9195
+ * format), writing to the given BinaryWriter.
9196
+ * @param {!proto.user.DashboardResponse} message
9197
+ * @param {!jspb.BinaryWriter} writer
9198
+ * @suppress {unusedLocalVariables} f is only used for nested messages
9199
+ */
9200
+ proto.user.DashboardResponse.serializeBinaryToWriter = function(message, writer) {
9201
+ var f = undefined;
9202
+ f = /** @type {number} */ (jspb.Message.getField(message, 1));
9203
+ if (f != null) {
9204
+ writer.writeInt32(
9205
+ 1,
9206
+ f
9207
+ );
9208
+ }
9209
+ f = /** @type {number} */ (jspb.Message.getField(message, 2));
9210
+ if (f != null) {
9211
+ writer.writeInt32(
9212
+ 2,
9213
+ f
9214
+ );
9215
+ }
9216
+ };
9217
+
9218
+
9219
+ /**
9220
+ * optional int32 registration_count = 1;
9221
+ * @return {number}
9222
+ */
9223
+ proto.user.DashboardResponse.prototype.getRegistrationCount = function() {
9224
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
9225
+ };
9226
+
9227
+
9228
+ /**
9229
+ * @param {number} value
9230
+ * @return {!proto.user.DashboardResponse} returns this
9231
+ */
9232
+ proto.user.DashboardResponse.prototype.setRegistrationCount = function(value) {
9233
+ return jspb.Message.setField(this, 1, value);
9234
+ };
9235
+
9236
+
9237
+ /**
9238
+ * Clears the field making it undefined.
9239
+ * @return {!proto.user.DashboardResponse} returns this
9240
+ */
9241
+ proto.user.DashboardResponse.prototype.clearRegistrationCount = function() {
9242
+ return jspb.Message.setField(this, 1, undefined);
9243
+ };
9244
+
9245
+
9246
+ /**
9247
+ * Returns whether this field is set.
9248
+ * @return {boolean}
9249
+ */
9250
+ proto.user.DashboardResponse.prototype.hasRegistrationCount = function() {
9251
+ return jspb.Message.getField(this, 1) != null;
9252
+ };
9253
+
9254
+
9255
+ /**
9256
+ * optional int32 login_count = 2;
9257
+ * @return {number}
9258
+ */
9259
+ proto.user.DashboardResponse.prototype.getLoginCount = function() {
9260
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
9261
+ };
9262
+
9263
+
9264
+ /**
9265
+ * @param {number} value
9266
+ * @return {!proto.user.DashboardResponse} returns this
9267
+ */
9268
+ proto.user.DashboardResponse.prototype.setLoginCount = function(value) {
9269
+ return jspb.Message.setField(this, 2, value);
9270
+ };
9271
+
9272
+
9273
+ /**
9274
+ * Clears the field making it undefined.
9275
+ * @return {!proto.user.DashboardResponse} returns this
9276
+ */
9277
+ proto.user.DashboardResponse.prototype.clearLoginCount = function() {
9278
+ return jspb.Message.setField(this, 2, undefined);
9279
+ };
9280
+
9281
+
9282
+ /**
9283
+ * Returns whether this field is set.
9284
+ * @return {boolean}
9285
+ */
9286
+ proto.user.DashboardResponse.prototype.hasLoginCount = function() {
9287
+ return jspb.Message.getField(this, 2) != null;
9288
+ };
9289
+
9290
+
8891
9291
  goog.object.extend(exports, proto.user);