protobuf-platform 1.2.14 → 1.2.16

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.2.14",
3
+ "version": "1.2.16",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/user/user.proto CHANGED
@@ -17,6 +17,7 @@ service User {
17
17
  rpc updateSingleUser(UserRequest) returns (UserDataResponse);
18
18
  rpc updateUserPassword(UserPasswordRequest) returns (UserStatusResponse);
19
19
  rpc setUserSelfExclusion(UserRequest) returns (UserStatusResponse);
20
+ rpc updateUserBalanceAfterAction(UserActionRequest) returns (UserStatusResponse);
20
21
  //Segments
21
22
  rpc createSingleSegment(SegmentRequest) returns (SegmentResponse);
22
23
  rpc readSingleSegment(GetSegmentRequest) returns (SegmentResponse);
@@ -222,6 +223,16 @@ message UsersResponse {
222
223
  message UserStatusResponse {
223
224
  string status = 1;
224
225
  }
226
+ message UserActionRequest {
227
+ int32 user_id = 1;
228
+ float action_amount = 2;
229
+ optional string balance_type = 3;
230
+ }
231
+ message UserActionResponse {
232
+ string status = 1;
233
+ optional float balance_real = 2;
234
+ optional float balance_bonus = 3;
235
+ }
225
236
  //Permissions
226
237
  message RolePermissionRequest {
227
238
  string role = 1;
@@ -444,6 +444,17 @@ function deserialize_user_TournamentRulesInfoResponse(buffer_arg) {
444
444
  return user_pb.TournamentRulesInfoResponse.deserializeBinary(new Uint8Array(buffer_arg));
445
445
  }
446
446
 
447
+ function serialize_user_UserActionRequest(arg) {
448
+ if (!(arg instanceof user_pb.UserActionRequest)) {
449
+ throw new Error('Expected argument of type user.UserActionRequest');
450
+ }
451
+ return Buffer.from(arg.serializeBinary());
452
+ }
453
+
454
+ function deserialize_user_UserActionRequest(buffer_arg) {
455
+ return user_pb.UserActionRequest.deserializeBinary(new Uint8Array(buffer_arg));
456
+ }
457
+
447
458
  function serialize_user_UserCookiesRequest(arg) {
448
459
  if (!(arg instanceof user_pb.UserCookiesRequest)) {
449
460
  throw new Error('Expected argument of type user.UserCookiesRequest');
@@ -680,6 +691,17 @@ readListUsers: {
680
691
  responseSerialize: serialize_user_UserStatusResponse,
681
692
  responseDeserialize: deserialize_user_UserStatusResponse,
682
693
  },
694
+ updateUserBalanceAfterAction: {
695
+ path: '/user.User/updateUserBalanceAfterAction',
696
+ requestStream: false,
697
+ responseStream: false,
698
+ requestType: user_pb.UserActionRequest,
699
+ responseType: user_pb.UserStatusResponse,
700
+ requestSerialize: serialize_user_UserActionRequest,
701
+ requestDeserialize: deserialize_user_UserActionRequest,
702
+ responseSerialize: serialize_user_UserStatusResponse,
703
+ responseDeserialize: deserialize_user_UserStatusResponse,
704
+ },
683
705
  // Segments
684
706
  createSingleSegment: {
685
707
  path: '/user.User/createSingleSegment',
package/user/user_pb.js CHANGED
@@ -78,6 +78,8 @@ goog.exportSymbol('proto.user.SumSubDocumentRequest', null, global);
78
78
  goog.exportSymbol('proto.user.SumSubDocumentRequest.RequestCase', null, global);
79
79
  goog.exportSymbol('proto.user.SumSubResponse', null, global);
80
80
  goog.exportSymbol('proto.user.TournamentRulesInfoResponse', null, global);
81
+ goog.exportSymbol('proto.user.UserActionRequest', null, global);
82
+ goog.exportSymbol('proto.user.UserActionResponse', null, global);
81
83
  goog.exportSymbol('proto.user.UserCookiesRequest', null, global);
82
84
  goog.exportSymbol('proto.user.UserDataRequest', null, global);
83
85
  goog.exportSymbol('proto.user.UserDataResponse', null, global);
@@ -427,6 +429,48 @@ if (goog.DEBUG && !COMPILED) {
427
429
  */
428
430
  proto.user.UserStatusResponse.displayName = 'proto.user.UserStatusResponse';
429
431
  }
432
+ /**
433
+ * Generated by JsPbCodeGenerator.
434
+ * @param {Array=} opt_data Optional initial data array, typically from a
435
+ * server response, or constructed directly in Javascript. The array is used
436
+ * in place and becomes part of the constructed object. It is not cloned.
437
+ * If no data is provided, the constructed object will be empty, but still
438
+ * valid.
439
+ * @extends {jspb.Message}
440
+ * @constructor
441
+ */
442
+ proto.user.UserActionRequest = function(opt_data) {
443
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
444
+ };
445
+ goog.inherits(proto.user.UserActionRequest, jspb.Message);
446
+ if (goog.DEBUG && !COMPILED) {
447
+ /**
448
+ * @public
449
+ * @override
450
+ */
451
+ proto.user.UserActionRequest.displayName = 'proto.user.UserActionRequest';
452
+ }
453
+ /**
454
+ * Generated by JsPbCodeGenerator.
455
+ * @param {Array=} opt_data Optional initial data array, typically from a
456
+ * server response, or constructed directly in Javascript. The array is used
457
+ * in place and becomes part of the constructed object. It is not cloned.
458
+ * If no data is provided, the constructed object will be empty, but still
459
+ * valid.
460
+ * @extends {jspb.Message}
461
+ * @constructor
462
+ */
463
+ proto.user.UserActionResponse = function(opt_data) {
464
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
465
+ };
466
+ goog.inherits(proto.user.UserActionResponse, jspb.Message);
467
+ if (goog.DEBUG && !COMPILED) {
468
+ /**
469
+ * @public
470
+ * @override
471
+ */
472
+ proto.user.UserActionResponse.displayName = 'proto.user.UserActionResponse';
473
+ }
430
474
  /**
431
475
  * Generated by JsPbCodeGenerator.
432
476
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -9147,6 +9191,440 @@ proto.user.UserStatusResponse.prototype.setStatus = function(value) {
9147
9191
 
9148
9192
 
9149
9193
 
9194
+ if (jspb.Message.GENERATE_TO_OBJECT) {
9195
+ /**
9196
+ * Creates an object representation of this proto.
9197
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
9198
+ * Optional fields that are not set will be set to undefined.
9199
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
9200
+ * For the list of reserved names please see:
9201
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
9202
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
9203
+ * JSPB instance for transitional soy proto support:
9204
+ * http://goto/soy-param-migration
9205
+ * @return {!Object}
9206
+ */
9207
+ proto.user.UserActionRequest.prototype.toObject = function(opt_includeInstance) {
9208
+ return proto.user.UserActionRequest.toObject(opt_includeInstance, this);
9209
+ };
9210
+
9211
+
9212
+ /**
9213
+ * Static version of the {@see toObject} method.
9214
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
9215
+ * the JSPB instance for transitional soy proto support:
9216
+ * http://goto/soy-param-migration
9217
+ * @param {!proto.user.UserActionRequest} msg The msg instance to transform.
9218
+ * @return {!Object}
9219
+ * @suppress {unusedLocalVariables} f is only used for nested messages
9220
+ */
9221
+ proto.user.UserActionRequest.toObject = function(includeInstance, msg) {
9222
+ var f, obj = {
9223
+ userId: jspb.Message.getFieldWithDefault(msg, 1, 0),
9224
+ actionAmount: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0),
9225
+ balanceType: jspb.Message.getFieldWithDefault(msg, 3, "")
9226
+ };
9227
+
9228
+ if (includeInstance) {
9229
+ obj.$jspbMessageInstance = msg;
9230
+ }
9231
+ return obj;
9232
+ };
9233
+ }
9234
+
9235
+
9236
+ /**
9237
+ * Deserializes binary data (in protobuf wire format).
9238
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
9239
+ * @return {!proto.user.UserActionRequest}
9240
+ */
9241
+ proto.user.UserActionRequest.deserializeBinary = function(bytes) {
9242
+ var reader = new jspb.BinaryReader(bytes);
9243
+ var msg = new proto.user.UserActionRequest;
9244
+ return proto.user.UserActionRequest.deserializeBinaryFromReader(msg, reader);
9245
+ };
9246
+
9247
+
9248
+ /**
9249
+ * Deserializes binary data (in protobuf wire format) from the
9250
+ * given reader into the given message object.
9251
+ * @param {!proto.user.UserActionRequest} msg The message object to deserialize into.
9252
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
9253
+ * @return {!proto.user.UserActionRequest}
9254
+ */
9255
+ proto.user.UserActionRequest.deserializeBinaryFromReader = function(msg, reader) {
9256
+ while (reader.nextField()) {
9257
+ if (reader.isEndGroup()) {
9258
+ break;
9259
+ }
9260
+ var field = reader.getFieldNumber();
9261
+ switch (field) {
9262
+ case 1:
9263
+ var value = /** @type {number} */ (reader.readInt32());
9264
+ msg.setUserId(value);
9265
+ break;
9266
+ case 2:
9267
+ var value = /** @type {number} */ (reader.readFloat());
9268
+ msg.setActionAmount(value);
9269
+ break;
9270
+ case 3:
9271
+ var value = /** @type {string} */ (reader.readString());
9272
+ msg.setBalanceType(value);
9273
+ break;
9274
+ default:
9275
+ reader.skipField();
9276
+ break;
9277
+ }
9278
+ }
9279
+ return msg;
9280
+ };
9281
+
9282
+
9283
+ /**
9284
+ * Serializes the message to binary data (in protobuf wire format).
9285
+ * @return {!Uint8Array}
9286
+ */
9287
+ proto.user.UserActionRequest.prototype.serializeBinary = function() {
9288
+ var writer = new jspb.BinaryWriter();
9289
+ proto.user.UserActionRequest.serializeBinaryToWriter(this, writer);
9290
+ return writer.getResultBuffer();
9291
+ };
9292
+
9293
+
9294
+ /**
9295
+ * Serializes the given message to binary data (in protobuf wire
9296
+ * format), writing to the given BinaryWriter.
9297
+ * @param {!proto.user.UserActionRequest} message
9298
+ * @param {!jspb.BinaryWriter} writer
9299
+ * @suppress {unusedLocalVariables} f is only used for nested messages
9300
+ */
9301
+ proto.user.UserActionRequest.serializeBinaryToWriter = function(message, writer) {
9302
+ var f = undefined;
9303
+ f = message.getUserId();
9304
+ if (f !== 0) {
9305
+ writer.writeInt32(
9306
+ 1,
9307
+ f
9308
+ );
9309
+ }
9310
+ f = message.getActionAmount();
9311
+ if (f !== 0.0) {
9312
+ writer.writeFloat(
9313
+ 2,
9314
+ f
9315
+ );
9316
+ }
9317
+ f = /** @type {string} */ (jspb.Message.getField(message, 3));
9318
+ if (f != null) {
9319
+ writer.writeString(
9320
+ 3,
9321
+ f
9322
+ );
9323
+ }
9324
+ };
9325
+
9326
+
9327
+ /**
9328
+ * optional int32 user_id = 1;
9329
+ * @return {number}
9330
+ */
9331
+ proto.user.UserActionRequest.prototype.getUserId = function() {
9332
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
9333
+ };
9334
+
9335
+
9336
+ /**
9337
+ * @param {number} value
9338
+ * @return {!proto.user.UserActionRequest} returns this
9339
+ */
9340
+ proto.user.UserActionRequest.prototype.setUserId = function(value) {
9341
+ return jspb.Message.setProto3IntField(this, 1, value);
9342
+ };
9343
+
9344
+
9345
+ /**
9346
+ * optional float action_amount = 2;
9347
+ * @return {number}
9348
+ */
9349
+ proto.user.UserActionRequest.prototype.getActionAmount = function() {
9350
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
9351
+ };
9352
+
9353
+
9354
+ /**
9355
+ * @param {number} value
9356
+ * @return {!proto.user.UserActionRequest} returns this
9357
+ */
9358
+ proto.user.UserActionRequest.prototype.setActionAmount = function(value) {
9359
+ return jspb.Message.setProto3FloatField(this, 2, value);
9360
+ };
9361
+
9362
+
9363
+ /**
9364
+ * optional string balance_type = 3;
9365
+ * @return {string}
9366
+ */
9367
+ proto.user.UserActionRequest.prototype.getBalanceType = function() {
9368
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
9369
+ };
9370
+
9371
+
9372
+ /**
9373
+ * @param {string} value
9374
+ * @return {!proto.user.UserActionRequest} returns this
9375
+ */
9376
+ proto.user.UserActionRequest.prototype.setBalanceType = function(value) {
9377
+ return jspb.Message.setField(this, 3, value);
9378
+ };
9379
+
9380
+
9381
+ /**
9382
+ * Clears the field making it undefined.
9383
+ * @return {!proto.user.UserActionRequest} returns this
9384
+ */
9385
+ proto.user.UserActionRequest.prototype.clearBalanceType = function() {
9386
+ return jspb.Message.setField(this, 3, undefined);
9387
+ };
9388
+
9389
+
9390
+ /**
9391
+ * Returns whether this field is set.
9392
+ * @return {boolean}
9393
+ */
9394
+ proto.user.UserActionRequest.prototype.hasBalanceType = function() {
9395
+ return jspb.Message.getField(this, 3) != null;
9396
+ };
9397
+
9398
+
9399
+
9400
+
9401
+
9402
+ if (jspb.Message.GENERATE_TO_OBJECT) {
9403
+ /**
9404
+ * Creates an object representation of this proto.
9405
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
9406
+ * Optional fields that are not set will be set to undefined.
9407
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
9408
+ * For the list of reserved names please see:
9409
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
9410
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
9411
+ * JSPB instance for transitional soy proto support:
9412
+ * http://goto/soy-param-migration
9413
+ * @return {!Object}
9414
+ */
9415
+ proto.user.UserActionResponse.prototype.toObject = function(opt_includeInstance) {
9416
+ return proto.user.UserActionResponse.toObject(opt_includeInstance, this);
9417
+ };
9418
+
9419
+
9420
+ /**
9421
+ * Static version of the {@see toObject} method.
9422
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
9423
+ * the JSPB instance for transitional soy proto support:
9424
+ * http://goto/soy-param-migration
9425
+ * @param {!proto.user.UserActionResponse} msg The msg instance to transform.
9426
+ * @return {!Object}
9427
+ * @suppress {unusedLocalVariables} f is only used for nested messages
9428
+ */
9429
+ proto.user.UserActionResponse.toObject = function(includeInstance, msg) {
9430
+ var f, obj = {
9431
+ status: jspb.Message.getFieldWithDefault(msg, 1, ""),
9432
+ balanceReal: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0),
9433
+ balanceBonus: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0)
9434
+ };
9435
+
9436
+ if (includeInstance) {
9437
+ obj.$jspbMessageInstance = msg;
9438
+ }
9439
+ return obj;
9440
+ };
9441
+ }
9442
+
9443
+
9444
+ /**
9445
+ * Deserializes binary data (in protobuf wire format).
9446
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
9447
+ * @return {!proto.user.UserActionResponse}
9448
+ */
9449
+ proto.user.UserActionResponse.deserializeBinary = function(bytes) {
9450
+ var reader = new jspb.BinaryReader(bytes);
9451
+ var msg = new proto.user.UserActionResponse;
9452
+ return proto.user.UserActionResponse.deserializeBinaryFromReader(msg, reader);
9453
+ };
9454
+
9455
+
9456
+ /**
9457
+ * Deserializes binary data (in protobuf wire format) from the
9458
+ * given reader into the given message object.
9459
+ * @param {!proto.user.UserActionResponse} msg The message object to deserialize into.
9460
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
9461
+ * @return {!proto.user.UserActionResponse}
9462
+ */
9463
+ proto.user.UserActionResponse.deserializeBinaryFromReader = function(msg, reader) {
9464
+ while (reader.nextField()) {
9465
+ if (reader.isEndGroup()) {
9466
+ break;
9467
+ }
9468
+ var field = reader.getFieldNumber();
9469
+ switch (field) {
9470
+ case 1:
9471
+ var value = /** @type {string} */ (reader.readString());
9472
+ msg.setStatus(value);
9473
+ break;
9474
+ case 2:
9475
+ var value = /** @type {number} */ (reader.readFloat());
9476
+ msg.setBalanceReal(value);
9477
+ break;
9478
+ case 3:
9479
+ var value = /** @type {number} */ (reader.readFloat());
9480
+ msg.setBalanceBonus(value);
9481
+ break;
9482
+ default:
9483
+ reader.skipField();
9484
+ break;
9485
+ }
9486
+ }
9487
+ return msg;
9488
+ };
9489
+
9490
+
9491
+ /**
9492
+ * Serializes the message to binary data (in protobuf wire format).
9493
+ * @return {!Uint8Array}
9494
+ */
9495
+ proto.user.UserActionResponse.prototype.serializeBinary = function() {
9496
+ var writer = new jspb.BinaryWriter();
9497
+ proto.user.UserActionResponse.serializeBinaryToWriter(this, writer);
9498
+ return writer.getResultBuffer();
9499
+ };
9500
+
9501
+
9502
+ /**
9503
+ * Serializes the given message to binary data (in protobuf wire
9504
+ * format), writing to the given BinaryWriter.
9505
+ * @param {!proto.user.UserActionResponse} message
9506
+ * @param {!jspb.BinaryWriter} writer
9507
+ * @suppress {unusedLocalVariables} f is only used for nested messages
9508
+ */
9509
+ proto.user.UserActionResponse.serializeBinaryToWriter = function(message, writer) {
9510
+ var f = undefined;
9511
+ f = message.getStatus();
9512
+ if (f.length > 0) {
9513
+ writer.writeString(
9514
+ 1,
9515
+ f
9516
+ );
9517
+ }
9518
+ f = /** @type {number} */ (jspb.Message.getField(message, 2));
9519
+ if (f != null) {
9520
+ writer.writeFloat(
9521
+ 2,
9522
+ f
9523
+ );
9524
+ }
9525
+ f = /** @type {number} */ (jspb.Message.getField(message, 3));
9526
+ if (f != null) {
9527
+ writer.writeFloat(
9528
+ 3,
9529
+ f
9530
+ );
9531
+ }
9532
+ };
9533
+
9534
+
9535
+ /**
9536
+ * optional string status = 1;
9537
+ * @return {string}
9538
+ */
9539
+ proto.user.UserActionResponse.prototype.getStatus = function() {
9540
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
9541
+ };
9542
+
9543
+
9544
+ /**
9545
+ * @param {string} value
9546
+ * @return {!proto.user.UserActionResponse} returns this
9547
+ */
9548
+ proto.user.UserActionResponse.prototype.setStatus = function(value) {
9549
+ return jspb.Message.setProto3StringField(this, 1, value);
9550
+ };
9551
+
9552
+
9553
+ /**
9554
+ * optional float balance_real = 2;
9555
+ * @return {number}
9556
+ */
9557
+ proto.user.UserActionResponse.prototype.getBalanceReal = function() {
9558
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
9559
+ };
9560
+
9561
+
9562
+ /**
9563
+ * @param {number} value
9564
+ * @return {!proto.user.UserActionResponse} returns this
9565
+ */
9566
+ proto.user.UserActionResponse.prototype.setBalanceReal = function(value) {
9567
+ return jspb.Message.setField(this, 2, value);
9568
+ };
9569
+
9570
+
9571
+ /**
9572
+ * Clears the field making it undefined.
9573
+ * @return {!proto.user.UserActionResponse} returns this
9574
+ */
9575
+ proto.user.UserActionResponse.prototype.clearBalanceReal = function() {
9576
+ return jspb.Message.setField(this, 2, undefined);
9577
+ };
9578
+
9579
+
9580
+ /**
9581
+ * Returns whether this field is set.
9582
+ * @return {boolean}
9583
+ */
9584
+ proto.user.UserActionResponse.prototype.hasBalanceReal = function() {
9585
+ return jspb.Message.getField(this, 2) != null;
9586
+ };
9587
+
9588
+
9589
+ /**
9590
+ * optional float balance_bonus = 3;
9591
+ * @return {number}
9592
+ */
9593
+ proto.user.UserActionResponse.prototype.getBalanceBonus = function() {
9594
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0));
9595
+ };
9596
+
9597
+
9598
+ /**
9599
+ * @param {number} value
9600
+ * @return {!proto.user.UserActionResponse} returns this
9601
+ */
9602
+ proto.user.UserActionResponse.prototype.setBalanceBonus = function(value) {
9603
+ return jspb.Message.setField(this, 3, value);
9604
+ };
9605
+
9606
+
9607
+ /**
9608
+ * Clears the field making it undefined.
9609
+ * @return {!proto.user.UserActionResponse} returns this
9610
+ */
9611
+ proto.user.UserActionResponse.prototype.clearBalanceBonus = function() {
9612
+ return jspb.Message.setField(this, 3, undefined);
9613
+ };
9614
+
9615
+
9616
+ /**
9617
+ * Returns whether this field is set.
9618
+ * @return {boolean}
9619
+ */
9620
+ proto.user.UserActionResponse.prototype.hasBalanceBonus = function() {
9621
+ return jspb.Message.getField(this, 3) != null;
9622
+ };
9623
+
9624
+
9625
+
9626
+
9627
+
9150
9628
  if (jspb.Message.GENERATE_TO_OBJECT) {
9151
9629
  /**
9152
9630
  * Creates an object representation of this proto.