protobuf-platform 1.2.124 → 1.2.126

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.124",
3
+ "version": "1.2.126",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/user/user.proto CHANGED
@@ -7,9 +7,11 @@ service User {
7
7
  //Fetch settings for particular service
8
8
  rpc signUp(RegistrationRequest) returns (LoggedInResponse);
9
9
  rpc signIn(LoginRequest) returns (LoggedInResponse);
10
+ rpc confirmUserTwoFa(ConfirmTwoFaRequest) returns (LoggedInResponse);
10
11
  rpc getUserData(UserDataRequest) returns (UserDataResponse);
11
12
  rpc getUserBalance(UserDataRequest) returns (UserDataResponse);
12
13
  rpc updateUserBalance(UserBalanceRequest) returns (UserDataResponse);
14
+ rpc getUserCachedData(UserDataRequest) returns (UserDataResponse);
13
15
  //Role and Permissions
14
16
  rpc addPermissionToUserRole(RolePermissionRequest) returns (RolePermissionStatusResponse);
15
17
  rpc rolesList(PaginationRequest) returns (RolesItemsResponse);
@@ -132,15 +134,18 @@ message LoggedInResponse {
132
134
  int32 id = 1;
133
135
  string public_id = 2;
134
136
  string currency = 3;
135
- string country = 4;
136
- string role = 5;
137
- string permissions = 6;
138
- string locale = 7;
137
+ optional string country = 4;
138
+ optional string role = 5;
139
+ optional string permissions = 6;
140
+ optional string locale = 7;
139
141
  optional string first_name = 8;
140
142
  optional string last_name = 9;
141
143
  optional string session_id = 10;
142
144
  optional string axiom_session_hash = 11;
143
145
  optional string nickname = 12;
146
+ optional string two_fa_status = 13;
147
+ optional string two_fa_temp_token = 14;
148
+ optional string two_fa_qr_data_url = 15;
144
149
  }
145
150
  message LoginRequest {
146
151
  string email = 1;
@@ -150,6 +155,16 @@ message LoginRequest {
150
155
  optional string device = 5;
151
156
  optional string country = 6;
152
157
  optional string city = 7;
158
+ optional int32 two_fa = 8;
159
+ }
160
+ message ConfirmTwoFaRequest {
161
+ string code = 1;
162
+ string temp_token = 2;
163
+ optional int32 is_admin = 3;
164
+ optional string user_ip = 4;
165
+ optional string device = 5;
166
+ optional string country = 6;
167
+ optional string city = 7;
153
168
  }
154
169
  message UserDataRequest {
155
170
  optional int32 id = 1;
@@ -15,6 +15,17 @@ function deserialize_user_CategoryItemsResponse(buffer_arg) {
15
15
  return user_pb.CategoryItemsResponse.deserializeBinary(new Uint8Array(buffer_arg));
16
16
  }
17
17
 
18
+ function serialize_user_ConfirmTwoFaRequest(arg) {
19
+ if (!(arg instanceof user_pb.ConfirmTwoFaRequest)) {
20
+ throw new Error('Expected argument of type user.ConfirmTwoFaRequest');
21
+ }
22
+ return Buffer.from(arg.serializeBinary());
23
+ }
24
+
25
+ function deserialize_user_ConfirmTwoFaRequest(buffer_arg) {
26
+ return user_pb.ConfirmTwoFaRequest.deserializeBinary(new Uint8Array(buffer_arg));
27
+ }
28
+
18
29
  function serialize_user_ConfirmationStatusResponse(arg) {
19
30
  if (!(arg instanceof user_pb.ConfirmationStatusResponse)) {
20
31
  throw new Error('Expected argument of type user.ConfirmationStatusResponse');
@@ -623,6 +634,17 @@ signUp: {
623
634
  responseSerialize: serialize_user_LoggedInResponse,
624
635
  responseDeserialize: deserialize_user_LoggedInResponse,
625
636
  },
637
+ confirmUserTwoFa: {
638
+ path: '/user.User/confirmUserTwoFa',
639
+ requestStream: false,
640
+ responseStream: false,
641
+ requestType: user_pb.ConfirmTwoFaRequest,
642
+ responseType: user_pb.LoggedInResponse,
643
+ requestSerialize: serialize_user_ConfirmTwoFaRequest,
644
+ requestDeserialize: deserialize_user_ConfirmTwoFaRequest,
645
+ responseSerialize: serialize_user_LoggedInResponse,
646
+ responseDeserialize: deserialize_user_LoggedInResponse,
647
+ },
626
648
  getUserData: {
627
649
  path: '/user.User/getUserData',
628
650
  requestStream: false,
@@ -656,6 +678,17 @@ signUp: {
656
678
  responseSerialize: serialize_user_UserDataResponse,
657
679
  responseDeserialize: deserialize_user_UserDataResponse,
658
680
  },
681
+ getUserCachedData: {
682
+ path: '/user.User/getUserCachedData',
683
+ requestStream: false,
684
+ responseStream: false,
685
+ requestType: user_pb.UserDataRequest,
686
+ responseType: user_pb.UserDataResponse,
687
+ requestSerialize: serialize_user_UserDataRequest,
688
+ requestDeserialize: deserialize_user_UserDataRequest,
689
+ responseSerialize: serialize_user_UserDataResponse,
690
+ responseDeserialize: deserialize_user_UserDataResponse,
691
+ },
659
692
  // Role and Permissions
660
693
  addPermissionToUserRole: {
661
694
  path: '/user.User/addPermissionToUserRole',
package/user/user_pb.js CHANGED
@@ -23,6 +23,7 @@ var global = (function() {
23
23
 
24
24
  goog.exportSymbol('proto.user.CategoryItem', null, global);
25
25
  goog.exportSymbol('proto.user.CategoryItemsResponse', null, global);
26
+ goog.exportSymbol('proto.user.ConfirmTwoFaRequest', null, global);
26
27
  goog.exportSymbol('proto.user.ConfirmationStatusResponse', null, global);
27
28
  goog.exportSymbol('proto.user.DashboardRequest', null, global);
28
29
  goog.exportSymbol('proto.user.DashboardResponse', null, global);
@@ -304,6 +305,27 @@ if (goog.DEBUG && !COMPILED) {
304
305
  */
305
306
  proto.user.LoginRequest.displayName = 'proto.user.LoginRequest';
306
307
  }
308
+ /**
309
+ * Generated by JsPbCodeGenerator.
310
+ * @param {Array=} opt_data Optional initial data array, typically from a
311
+ * server response, or constructed directly in Javascript. The array is used
312
+ * in place and becomes part of the constructed object. It is not cloned.
313
+ * If no data is provided, the constructed object will be empty, but still
314
+ * valid.
315
+ * @extends {jspb.Message}
316
+ * @constructor
317
+ */
318
+ proto.user.ConfirmTwoFaRequest = function(opt_data) {
319
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
320
+ };
321
+ goog.inherits(proto.user.ConfirmTwoFaRequest, jspb.Message);
322
+ if (goog.DEBUG && !COMPILED) {
323
+ /**
324
+ * @public
325
+ * @override
326
+ */
327
+ proto.user.ConfirmTwoFaRequest.displayName = 'proto.user.ConfirmTwoFaRequest';
328
+ }
307
329
  /**
308
330
  * Generated by JsPbCodeGenerator.
309
331
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -4808,7 +4830,10 @@ proto.user.LoggedInResponse.toObject = function(includeInstance, msg) {
4808
4830
  lastName: jspb.Message.getFieldWithDefault(msg, 9, ""),
4809
4831
  sessionId: jspb.Message.getFieldWithDefault(msg, 10, ""),
4810
4832
  axiomSessionHash: jspb.Message.getFieldWithDefault(msg, 11, ""),
4811
- nickname: jspb.Message.getFieldWithDefault(msg, 12, "")
4833
+ nickname: jspb.Message.getFieldWithDefault(msg, 12, ""),
4834
+ twoFaStatus: jspb.Message.getFieldWithDefault(msg, 13, ""),
4835
+ twoFaTempToken: jspb.Message.getFieldWithDefault(msg, 14, ""),
4836
+ twoFaQrDataUrl: jspb.Message.getFieldWithDefault(msg, 15, "")
4812
4837
  };
4813
4838
 
4814
4839
  if (includeInstance) {
@@ -4893,6 +4918,18 @@ proto.user.LoggedInResponse.deserializeBinaryFromReader = function(msg, reader)
4893
4918
  var value = /** @type {string} */ (reader.readString());
4894
4919
  msg.setNickname(value);
4895
4920
  break;
4921
+ case 13:
4922
+ var value = /** @type {string} */ (reader.readString());
4923
+ msg.setTwoFaStatus(value);
4924
+ break;
4925
+ case 14:
4926
+ var value = /** @type {string} */ (reader.readString());
4927
+ msg.setTwoFaTempToken(value);
4928
+ break;
4929
+ case 15:
4930
+ var value = /** @type {string} */ (reader.readString());
4931
+ msg.setTwoFaQrDataUrl(value);
4932
+ break;
4896
4933
  default:
4897
4934
  reader.skipField();
4898
4935
  break;
@@ -4943,29 +4980,29 @@ proto.user.LoggedInResponse.serializeBinaryToWriter = function(message, writer)
4943
4980
  f
4944
4981
  );
4945
4982
  }
4946
- f = message.getCountry();
4947
- if (f.length > 0) {
4983
+ f = /** @type {string} */ (jspb.Message.getField(message, 4));
4984
+ if (f != null) {
4948
4985
  writer.writeString(
4949
4986
  4,
4950
4987
  f
4951
4988
  );
4952
4989
  }
4953
- f = message.getRole();
4954
- if (f.length > 0) {
4990
+ f = /** @type {string} */ (jspb.Message.getField(message, 5));
4991
+ if (f != null) {
4955
4992
  writer.writeString(
4956
4993
  5,
4957
4994
  f
4958
4995
  );
4959
4996
  }
4960
- f = message.getPermissions();
4961
- if (f.length > 0) {
4997
+ f = /** @type {string} */ (jspb.Message.getField(message, 6));
4998
+ if (f != null) {
4962
4999
  writer.writeString(
4963
5000
  6,
4964
5001
  f
4965
5002
  );
4966
5003
  }
4967
- f = message.getLocale();
4968
- if (f.length > 0) {
5004
+ f = /** @type {string} */ (jspb.Message.getField(message, 7));
5005
+ if (f != null) {
4969
5006
  writer.writeString(
4970
5007
  7,
4971
5008
  f
@@ -5006,6 +5043,27 @@ proto.user.LoggedInResponse.serializeBinaryToWriter = function(message, writer)
5006
5043
  f
5007
5044
  );
5008
5045
  }
5046
+ f = /** @type {string} */ (jspb.Message.getField(message, 13));
5047
+ if (f != null) {
5048
+ writer.writeString(
5049
+ 13,
5050
+ f
5051
+ );
5052
+ }
5053
+ f = /** @type {string} */ (jspb.Message.getField(message, 14));
5054
+ if (f != null) {
5055
+ writer.writeString(
5056
+ 14,
5057
+ f
5058
+ );
5059
+ }
5060
+ f = /** @type {string} */ (jspb.Message.getField(message, 15));
5061
+ if (f != null) {
5062
+ writer.writeString(
5063
+ 15,
5064
+ f
5065
+ );
5066
+ }
5009
5067
  };
5010
5068
 
5011
5069
 
@@ -5077,7 +5135,25 @@ proto.user.LoggedInResponse.prototype.getCountry = function() {
5077
5135
  * @return {!proto.user.LoggedInResponse} returns this
5078
5136
  */
5079
5137
  proto.user.LoggedInResponse.prototype.setCountry = function(value) {
5080
- return jspb.Message.setProto3StringField(this, 4, value);
5138
+ return jspb.Message.setField(this, 4, value);
5139
+ };
5140
+
5141
+
5142
+ /**
5143
+ * Clears the field making it undefined.
5144
+ * @return {!proto.user.LoggedInResponse} returns this
5145
+ */
5146
+ proto.user.LoggedInResponse.prototype.clearCountry = function() {
5147
+ return jspb.Message.setField(this, 4, undefined);
5148
+ };
5149
+
5150
+
5151
+ /**
5152
+ * Returns whether this field is set.
5153
+ * @return {boolean}
5154
+ */
5155
+ proto.user.LoggedInResponse.prototype.hasCountry = function() {
5156
+ return jspb.Message.getField(this, 4) != null;
5081
5157
  };
5082
5158
 
5083
5159
 
@@ -5095,7 +5171,25 @@ proto.user.LoggedInResponse.prototype.getRole = function() {
5095
5171
  * @return {!proto.user.LoggedInResponse} returns this
5096
5172
  */
5097
5173
  proto.user.LoggedInResponse.prototype.setRole = function(value) {
5098
- return jspb.Message.setProto3StringField(this, 5, value);
5174
+ return jspb.Message.setField(this, 5, value);
5175
+ };
5176
+
5177
+
5178
+ /**
5179
+ * Clears the field making it undefined.
5180
+ * @return {!proto.user.LoggedInResponse} returns this
5181
+ */
5182
+ proto.user.LoggedInResponse.prototype.clearRole = function() {
5183
+ return jspb.Message.setField(this, 5, undefined);
5184
+ };
5185
+
5186
+
5187
+ /**
5188
+ * Returns whether this field is set.
5189
+ * @return {boolean}
5190
+ */
5191
+ proto.user.LoggedInResponse.prototype.hasRole = function() {
5192
+ return jspb.Message.getField(this, 5) != null;
5099
5193
  };
5100
5194
 
5101
5195
 
@@ -5113,7 +5207,25 @@ proto.user.LoggedInResponse.prototype.getPermissions = function() {
5113
5207
  * @return {!proto.user.LoggedInResponse} returns this
5114
5208
  */
5115
5209
  proto.user.LoggedInResponse.prototype.setPermissions = function(value) {
5116
- return jspb.Message.setProto3StringField(this, 6, value);
5210
+ return jspb.Message.setField(this, 6, value);
5211
+ };
5212
+
5213
+
5214
+ /**
5215
+ * Clears the field making it undefined.
5216
+ * @return {!proto.user.LoggedInResponse} returns this
5217
+ */
5218
+ proto.user.LoggedInResponse.prototype.clearPermissions = function() {
5219
+ return jspb.Message.setField(this, 6, undefined);
5220
+ };
5221
+
5222
+
5223
+ /**
5224
+ * Returns whether this field is set.
5225
+ * @return {boolean}
5226
+ */
5227
+ proto.user.LoggedInResponse.prototype.hasPermissions = function() {
5228
+ return jspb.Message.getField(this, 6) != null;
5117
5229
  };
5118
5230
 
5119
5231
 
@@ -5131,7 +5243,25 @@ proto.user.LoggedInResponse.prototype.getLocale = function() {
5131
5243
  * @return {!proto.user.LoggedInResponse} returns this
5132
5244
  */
5133
5245
  proto.user.LoggedInResponse.prototype.setLocale = function(value) {
5134
- return jspb.Message.setProto3StringField(this, 7, value);
5246
+ return jspb.Message.setField(this, 7, value);
5247
+ };
5248
+
5249
+
5250
+ /**
5251
+ * Clears the field making it undefined.
5252
+ * @return {!proto.user.LoggedInResponse} returns this
5253
+ */
5254
+ proto.user.LoggedInResponse.prototype.clearLocale = function() {
5255
+ return jspb.Message.setField(this, 7, undefined);
5256
+ };
5257
+
5258
+
5259
+ /**
5260
+ * Returns whether this field is set.
5261
+ * @return {boolean}
5262
+ */
5263
+ proto.user.LoggedInResponse.prototype.hasLocale = function() {
5264
+ return jspb.Message.getField(this, 7) != null;
5135
5265
  };
5136
5266
 
5137
5267
 
@@ -5315,6 +5445,114 @@ proto.user.LoggedInResponse.prototype.hasNickname = function() {
5315
5445
  };
5316
5446
 
5317
5447
 
5448
+ /**
5449
+ * optional string two_fa_status = 13;
5450
+ * @return {string}
5451
+ */
5452
+ proto.user.LoggedInResponse.prototype.getTwoFaStatus = function() {
5453
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, ""));
5454
+ };
5455
+
5456
+
5457
+ /**
5458
+ * @param {string} value
5459
+ * @return {!proto.user.LoggedInResponse} returns this
5460
+ */
5461
+ proto.user.LoggedInResponse.prototype.setTwoFaStatus = function(value) {
5462
+ return jspb.Message.setField(this, 13, value);
5463
+ };
5464
+
5465
+
5466
+ /**
5467
+ * Clears the field making it undefined.
5468
+ * @return {!proto.user.LoggedInResponse} returns this
5469
+ */
5470
+ proto.user.LoggedInResponse.prototype.clearTwoFaStatus = function() {
5471
+ return jspb.Message.setField(this, 13, undefined);
5472
+ };
5473
+
5474
+
5475
+ /**
5476
+ * Returns whether this field is set.
5477
+ * @return {boolean}
5478
+ */
5479
+ proto.user.LoggedInResponse.prototype.hasTwoFaStatus = function() {
5480
+ return jspb.Message.getField(this, 13) != null;
5481
+ };
5482
+
5483
+
5484
+ /**
5485
+ * optional string two_fa_temp_token = 14;
5486
+ * @return {string}
5487
+ */
5488
+ proto.user.LoggedInResponse.prototype.getTwoFaTempToken = function() {
5489
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 14, ""));
5490
+ };
5491
+
5492
+
5493
+ /**
5494
+ * @param {string} value
5495
+ * @return {!proto.user.LoggedInResponse} returns this
5496
+ */
5497
+ proto.user.LoggedInResponse.prototype.setTwoFaTempToken = function(value) {
5498
+ return jspb.Message.setField(this, 14, value);
5499
+ };
5500
+
5501
+
5502
+ /**
5503
+ * Clears the field making it undefined.
5504
+ * @return {!proto.user.LoggedInResponse} returns this
5505
+ */
5506
+ proto.user.LoggedInResponse.prototype.clearTwoFaTempToken = function() {
5507
+ return jspb.Message.setField(this, 14, undefined);
5508
+ };
5509
+
5510
+
5511
+ /**
5512
+ * Returns whether this field is set.
5513
+ * @return {boolean}
5514
+ */
5515
+ proto.user.LoggedInResponse.prototype.hasTwoFaTempToken = function() {
5516
+ return jspb.Message.getField(this, 14) != null;
5517
+ };
5518
+
5519
+
5520
+ /**
5521
+ * optional string two_fa_qr_data_url = 15;
5522
+ * @return {string}
5523
+ */
5524
+ proto.user.LoggedInResponse.prototype.getTwoFaQrDataUrl = function() {
5525
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 15, ""));
5526
+ };
5527
+
5528
+
5529
+ /**
5530
+ * @param {string} value
5531
+ * @return {!proto.user.LoggedInResponse} returns this
5532
+ */
5533
+ proto.user.LoggedInResponse.prototype.setTwoFaQrDataUrl = function(value) {
5534
+ return jspb.Message.setField(this, 15, value);
5535
+ };
5536
+
5537
+
5538
+ /**
5539
+ * Clears the field making it undefined.
5540
+ * @return {!proto.user.LoggedInResponse} returns this
5541
+ */
5542
+ proto.user.LoggedInResponse.prototype.clearTwoFaQrDataUrl = function() {
5543
+ return jspb.Message.setField(this, 15, undefined);
5544
+ };
5545
+
5546
+
5547
+ /**
5548
+ * Returns whether this field is set.
5549
+ * @return {boolean}
5550
+ */
5551
+ proto.user.LoggedInResponse.prototype.hasTwoFaQrDataUrl = function() {
5552
+ return jspb.Message.getField(this, 15) != null;
5553
+ };
5554
+
5555
+
5318
5556
 
5319
5557
 
5320
5558
 
@@ -5353,7 +5591,8 @@ proto.user.LoginRequest.toObject = function(includeInstance, msg) {
5353
5591
  userIp: jspb.Message.getFieldWithDefault(msg, 4, ""),
5354
5592
  device: jspb.Message.getFieldWithDefault(msg, 5, ""),
5355
5593
  country: jspb.Message.getFieldWithDefault(msg, 6, ""),
5356
- city: jspb.Message.getFieldWithDefault(msg, 7, "")
5594
+ city: jspb.Message.getFieldWithDefault(msg, 7, ""),
5595
+ twoFa: jspb.Message.getFieldWithDefault(msg, 8, 0)
5357
5596
  };
5358
5597
 
5359
5598
  if (includeInstance) {
@@ -5418,6 +5657,10 @@ proto.user.LoginRequest.deserializeBinaryFromReader = function(msg, reader) {
5418
5657
  var value = /** @type {string} */ (reader.readString());
5419
5658
  msg.setCity(value);
5420
5659
  break;
5660
+ case 8:
5661
+ var value = /** @type {number} */ (reader.readInt32());
5662
+ msg.setTwoFa(value);
5663
+ break;
5421
5664
  default:
5422
5665
  reader.skipField();
5423
5666
  break;
@@ -5496,6 +5739,13 @@ proto.user.LoginRequest.serializeBinaryToWriter = function(message, writer) {
5496
5739
  f
5497
5740
  );
5498
5741
  }
5742
+ f = /** @type {number} */ (jspb.Message.getField(message, 8));
5743
+ if (f != null) {
5744
+ writer.writeInt32(
5745
+ 8,
5746
+ f
5747
+ );
5748
+ }
5499
5749
  };
5500
5750
 
5501
5751
 
@@ -5715,6 +5965,442 @@ proto.user.LoginRequest.prototype.hasCity = function() {
5715
5965
  };
5716
5966
 
5717
5967
 
5968
+ /**
5969
+ * optional int32 two_fa = 8;
5970
+ * @return {number}
5971
+ */
5972
+ proto.user.LoginRequest.prototype.getTwoFa = function() {
5973
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
5974
+ };
5975
+
5976
+
5977
+ /**
5978
+ * @param {number} value
5979
+ * @return {!proto.user.LoginRequest} returns this
5980
+ */
5981
+ proto.user.LoginRequest.prototype.setTwoFa = function(value) {
5982
+ return jspb.Message.setField(this, 8, value);
5983
+ };
5984
+
5985
+
5986
+ /**
5987
+ * Clears the field making it undefined.
5988
+ * @return {!proto.user.LoginRequest} returns this
5989
+ */
5990
+ proto.user.LoginRequest.prototype.clearTwoFa = function() {
5991
+ return jspb.Message.setField(this, 8, undefined);
5992
+ };
5993
+
5994
+
5995
+ /**
5996
+ * Returns whether this field is set.
5997
+ * @return {boolean}
5998
+ */
5999
+ proto.user.LoginRequest.prototype.hasTwoFa = function() {
6000
+ return jspb.Message.getField(this, 8) != null;
6001
+ };
6002
+
6003
+
6004
+
6005
+
6006
+
6007
+ if (jspb.Message.GENERATE_TO_OBJECT) {
6008
+ /**
6009
+ * Creates an object representation of this proto.
6010
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
6011
+ * Optional fields that are not set will be set to undefined.
6012
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
6013
+ * For the list of reserved names please see:
6014
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
6015
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
6016
+ * JSPB instance for transitional soy proto support:
6017
+ * http://goto/soy-param-migration
6018
+ * @return {!Object}
6019
+ */
6020
+ proto.user.ConfirmTwoFaRequest.prototype.toObject = function(opt_includeInstance) {
6021
+ return proto.user.ConfirmTwoFaRequest.toObject(opt_includeInstance, this);
6022
+ };
6023
+
6024
+
6025
+ /**
6026
+ * Static version of the {@see toObject} method.
6027
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
6028
+ * the JSPB instance for transitional soy proto support:
6029
+ * http://goto/soy-param-migration
6030
+ * @param {!proto.user.ConfirmTwoFaRequest} msg The msg instance to transform.
6031
+ * @return {!Object}
6032
+ * @suppress {unusedLocalVariables} f is only used for nested messages
6033
+ */
6034
+ proto.user.ConfirmTwoFaRequest.toObject = function(includeInstance, msg) {
6035
+ var f, obj = {
6036
+ code: jspb.Message.getFieldWithDefault(msg, 1, ""),
6037
+ tempToken: jspb.Message.getFieldWithDefault(msg, 2, ""),
6038
+ isAdmin: jspb.Message.getFieldWithDefault(msg, 3, 0),
6039
+ userIp: jspb.Message.getFieldWithDefault(msg, 4, ""),
6040
+ device: jspb.Message.getFieldWithDefault(msg, 5, ""),
6041
+ country: jspb.Message.getFieldWithDefault(msg, 6, ""),
6042
+ city: jspb.Message.getFieldWithDefault(msg, 7, "")
6043
+ };
6044
+
6045
+ if (includeInstance) {
6046
+ obj.$jspbMessageInstance = msg;
6047
+ }
6048
+ return obj;
6049
+ };
6050
+ }
6051
+
6052
+
6053
+ /**
6054
+ * Deserializes binary data (in protobuf wire format).
6055
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
6056
+ * @return {!proto.user.ConfirmTwoFaRequest}
6057
+ */
6058
+ proto.user.ConfirmTwoFaRequest.deserializeBinary = function(bytes) {
6059
+ var reader = new jspb.BinaryReader(bytes);
6060
+ var msg = new proto.user.ConfirmTwoFaRequest;
6061
+ return proto.user.ConfirmTwoFaRequest.deserializeBinaryFromReader(msg, reader);
6062
+ };
6063
+
6064
+
6065
+ /**
6066
+ * Deserializes binary data (in protobuf wire format) from the
6067
+ * given reader into the given message object.
6068
+ * @param {!proto.user.ConfirmTwoFaRequest} msg The message object to deserialize into.
6069
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
6070
+ * @return {!proto.user.ConfirmTwoFaRequest}
6071
+ */
6072
+ proto.user.ConfirmTwoFaRequest.deserializeBinaryFromReader = function(msg, reader) {
6073
+ while (reader.nextField()) {
6074
+ if (reader.isEndGroup()) {
6075
+ break;
6076
+ }
6077
+ var field = reader.getFieldNumber();
6078
+ switch (field) {
6079
+ case 1:
6080
+ var value = /** @type {string} */ (reader.readString());
6081
+ msg.setCode(value);
6082
+ break;
6083
+ case 2:
6084
+ var value = /** @type {string} */ (reader.readString());
6085
+ msg.setTempToken(value);
6086
+ break;
6087
+ case 3:
6088
+ var value = /** @type {number} */ (reader.readInt32());
6089
+ msg.setIsAdmin(value);
6090
+ break;
6091
+ case 4:
6092
+ var value = /** @type {string} */ (reader.readString());
6093
+ msg.setUserIp(value);
6094
+ break;
6095
+ case 5:
6096
+ var value = /** @type {string} */ (reader.readString());
6097
+ msg.setDevice(value);
6098
+ break;
6099
+ case 6:
6100
+ var value = /** @type {string} */ (reader.readString());
6101
+ msg.setCountry(value);
6102
+ break;
6103
+ case 7:
6104
+ var value = /** @type {string} */ (reader.readString());
6105
+ msg.setCity(value);
6106
+ break;
6107
+ default:
6108
+ reader.skipField();
6109
+ break;
6110
+ }
6111
+ }
6112
+ return msg;
6113
+ };
6114
+
6115
+
6116
+ /**
6117
+ * Serializes the message to binary data (in protobuf wire format).
6118
+ * @return {!Uint8Array}
6119
+ */
6120
+ proto.user.ConfirmTwoFaRequest.prototype.serializeBinary = function() {
6121
+ var writer = new jspb.BinaryWriter();
6122
+ proto.user.ConfirmTwoFaRequest.serializeBinaryToWriter(this, writer);
6123
+ return writer.getResultBuffer();
6124
+ };
6125
+
6126
+
6127
+ /**
6128
+ * Serializes the given message to binary data (in protobuf wire
6129
+ * format), writing to the given BinaryWriter.
6130
+ * @param {!proto.user.ConfirmTwoFaRequest} message
6131
+ * @param {!jspb.BinaryWriter} writer
6132
+ * @suppress {unusedLocalVariables} f is only used for nested messages
6133
+ */
6134
+ proto.user.ConfirmTwoFaRequest.serializeBinaryToWriter = function(message, writer) {
6135
+ var f = undefined;
6136
+ f = message.getCode();
6137
+ if (f.length > 0) {
6138
+ writer.writeString(
6139
+ 1,
6140
+ f
6141
+ );
6142
+ }
6143
+ f = message.getTempToken();
6144
+ if (f.length > 0) {
6145
+ writer.writeString(
6146
+ 2,
6147
+ f
6148
+ );
6149
+ }
6150
+ f = /** @type {number} */ (jspb.Message.getField(message, 3));
6151
+ if (f != null) {
6152
+ writer.writeInt32(
6153
+ 3,
6154
+ f
6155
+ );
6156
+ }
6157
+ f = /** @type {string} */ (jspb.Message.getField(message, 4));
6158
+ if (f != null) {
6159
+ writer.writeString(
6160
+ 4,
6161
+ f
6162
+ );
6163
+ }
6164
+ f = /** @type {string} */ (jspb.Message.getField(message, 5));
6165
+ if (f != null) {
6166
+ writer.writeString(
6167
+ 5,
6168
+ f
6169
+ );
6170
+ }
6171
+ f = /** @type {string} */ (jspb.Message.getField(message, 6));
6172
+ if (f != null) {
6173
+ writer.writeString(
6174
+ 6,
6175
+ f
6176
+ );
6177
+ }
6178
+ f = /** @type {string} */ (jspb.Message.getField(message, 7));
6179
+ if (f != null) {
6180
+ writer.writeString(
6181
+ 7,
6182
+ f
6183
+ );
6184
+ }
6185
+ };
6186
+
6187
+
6188
+ /**
6189
+ * optional string code = 1;
6190
+ * @return {string}
6191
+ */
6192
+ proto.user.ConfirmTwoFaRequest.prototype.getCode = function() {
6193
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
6194
+ };
6195
+
6196
+
6197
+ /**
6198
+ * @param {string} value
6199
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6200
+ */
6201
+ proto.user.ConfirmTwoFaRequest.prototype.setCode = function(value) {
6202
+ return jspb.Message.setProto3StringField(this, 1, value);
6203
+ };
6204
+
6205
+
6206
+ /**
6207
+ * optional string temp_token = 2;
6208
+ * @return {string}
6209
+ */
6210
+ proto.user.ConfirmTwoFaRequest.prototype.getTempToken = function() {
6211
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
6212
+ };
6213
+
6214
+
6215
+ /**
6216
+ * @param {string} value
6217
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6218
+ */
6219
+ proto.user.ConfirmTwoFaRequest.prototype.setTempToken = function(value) {
6220
+ return jspb.Message.setProto3StringField(this, 2, value);
6221
+ };
6222
+
6223
+
6224
+ /**
6225
+ * optional int32 is_admin = 3;
6226
+ * @return {number}
6227
+ */
6228
+ proto.user.ConfirmTwoFaRequest.prototype.getIsAdmin = function() {
6229
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
6230
+ };
6231
+
6232
+
6233
+ /**
6234
+ * @param {number} value
6235
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6236
+ */
6237
+ proto.user.ConfirmTwoFaRequest.prototype.setIsAdmin = function(value) {
6238
+ return jspb.Message.setField(this, 3, value);
6239
+ };
6240
+
6241
+
6242
+ /**
6243
+ * Clears the field making it undefined.
6244
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6245
+ */
6246
+ proto.user.ConfirmTwoFaRequest.prototype.clearIsAdmin = function() {
6247
+ return jspb.Message.setField(this, 3, undefined);
6248
+ };
6249
+
6250
+
6251
+ /**
6252
+ * Returns whether this field is set.
6253
+ * @return {boolean}
6254
+ */
6255
+ proto.user.ConfirmTwoFaRequest.prototype.hasIsAdmin = function() {
6256
+ return jspb.Message.getField(this, 3) != null;
6257
+ };
6258
+
6259
+
6260
+ /**
6261
+ * optional string user_ip = 4;
6262
+ * @return {string}
6263
+ */
6264
+ proto.user.ConfirmTwoFaRequest.prototype.getUserIp = function() {
6265
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
6266
+ };
6267
+
6268
+
6269
+ /**
6270
+ * @param {string} value
6271
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6272
+ */
6273
+ proto.user.ConfirmTwoFaRequest.prototype.setUserIp = function(value) {
6274
+ return jspb.Message.setField(this, 4, value);
6275
+ };
6276
+
6277
+
6278
+ /**
6279
+ * Clears the field making it undefined.
6280
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6281
+ */
6282
+ proto.user.ConfirmTwoFaRequest.prototype.clearUserIp = function() {
6283
+ return jspb.Message.setField(this, 4, undefined);
6284
+ };
6285
+
6286
+
6287
+ /**
6288
+ * Returns whether this field is set.
6289
+ * @return {boolean}
6290
+ */
6291
+ proto.user.ConfirmTwoFaRequest.prototype.hasUserIp = function() {
6292
+ return jspb.Message.getField(this, 4) != null;
6293
+ };
6294
+
6295
+
6296
+ /**
6297
+ * optional string device = 5;
6298
+ * @return {string}
6299
+ */
6300
+ proto.user.ConfirmTwoFaRequest.prototype.getDevice = function() {
6301
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
6302
+ };
6303
+
6304
+
6305
+ /**
6306
+ * @param {string} value
6307
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6308
+ */
6309
+ proto.user.ConfirmTwoFaRequest.prototype.setDevice = function(value) {
6310
+ return jspb.Message.setField(this, 5, value);
6311
+ };
6312
+
6313
+
6314
+ /**
6315
+ * Clears the field making it undefined.
6316
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6317
+ */
6318
+ proto.user.ConfirmTwoFaRequest.prototype.clearDevice = function() {
6319
+ return jspb.Message.setField(this, 5, undefined);
6320
+ };
6321
+
6322
+
6323
+ /**
6324
+ * Returns whether this field is set.
6325
+ * @return {boolean}
6326
+ */
6327
+ proto.user.ConfirmTwoFaRequest.prototype.hasDevice = function() {
6328
+ return jspb.Message.getField(this, 5) != null;
6329
+ };
6330
+
6331
+
6332
+ /**
6333
+ * optional string country = 6;
6334
+ * @return {string}
6335
+ */
6336
+ proto.user.ConfirmTwoFaRequest.prototype.getCountry = function() {
6337
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
6338
+ };
6339
+
6340
+
6341
+ /**
6342
+ * @param {string} value
6343
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6344
+ */
6345
+ proto.user.ConfirmTwoFaRequest.prototype.setCountry = function(value) {
6346
+ return jspb.Message.setField(this, 6, value);
6347
+ };
6348
+
6349
+
6350
+ /**
6351
+ * Clears the field making it undefined.
6352
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6353
+ */
6354
+ proto.user.ConfirmTwoFaRequest.prototype.clearCountry = function() {
6355
+ return jspb.Message.setField(this, 6, undefined);
6356
+ };
6357
+
6358
+
6359
+ /**
6360
+ * Returns whether this field is set.
6361
+ * @return {boolean}
6362
+ */
6363
+ proto.user.ConfirmTwoFaRequest.prototype.hasCountry = function() {
6364
+ return jspb.Message.getField(this, 6) != null;
6365
+ };
6366
+
6367
+
6368
+ /**
6369
+ * optional string city = 7;
6370
+ * @return {string}
6371
+ */
6372
+ proto.user.ConfirmTwoFaRequest.prototype.getCity = function() {
6373
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
6374
+ };
6375
+
6376
+
6377
+ /**
6378
+ * @param {string} value
6379
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6380
+ */
6381
+ proto.user.ConfirmTwoFaRequest.prototype.setCity = function(value) {
6382
+ return jspb.Message.setField(this, 7, value);
6383
+ };
6384
+
6385
+
6386
+ /**
6387
+ * Clears the field making it undefined.
6388
+ * @return {!proto.user.ConfirmTwoFaRequest} returns this
6389
+ */
6390
+ proto.user.ConfirmTwoFaRequest.prototype.clearCity = function() {
6391
+ return jspb.Message.setField(this, 7, undefined);
6392
+ };
6393
+
6394
+
6395
+ /**
6396
+ * Returns whether this field is set.
6397
+ * @return {boolean}
6398
+ */
6399
+ proto.user.ConfirmTwoFaRequest.prototype.hasCity = function() {
6400
+ return jspb.Message.getField(this, 7) != null;
6401
+ };
6402
+
6403
+
5718
6404
 
5719
6405
 
5720
6406