protobuf-platform 1.1.1 → 1.1.3

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.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -41,6 +41,9 @@ message TournamentItem {
41
41
  optional string finished_at = 8;
42
42
  optional string status = 9;
43
43
  optional string image = 10;
44
+ repeated ActivationRuleItem rules = 11;
45
+ repeated ScoringRule scores = 12;
46
+ repeated RewardItem rewards = 13;
44
47
  }
45
48
  message TournamentRequest {
46
49
  oneof request {
@@ -54,9 +57,10 @@ message TournamentItemRequest {
54
57
  optional string description = 3;
55
58
  optional int32 is_active = 4;
56
59
  optional int32 max_members_count = 5;
57
- optional string started_at = 6;
58
- optional string finished_at = 7;
59
- optional int32 status_id = 8;
60
+ optional int32 bots_count = 6;
61
+ optional string started_at = 7;
62
+ optional string finished_at = 8;
63
+ optional int32 status_id = 9;
60
64
  }
61
65
  message GetTournamentRequest {
62
66
  int32 id = 1;
@@ -180,7 +180,7 @@ if (goog.DEBUG && !COMPILED) {
180
180
  * @constructor
181
181
  */
182
182
  proto.tournament.TournamentItem = function(opt_data) {
183
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
183
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.tournament.TournamentItem.repeatedFields_, null);
184
184
  };
185
185
  goog.inherits(proto.tournament.TournamentItem, jspb.Message);
186
186
  if (goog.DEBUG && !COMPILED) {
@@ -1610,6 +1610,13 @@ proto.tournament.UserSearchRequest.prototype.hasCurrency = function() {
1610
1610
 
1611
1611
 
1612
1612
 
1613
+ /**
1614
+ * List of repeated fields within this message type.
1615
+ * @private {!Array<number>}
1616
+ * @const
1617
+ */
1618
+ proto.tournament.TournamentItem.repeatedFields_ = [11,12,13];
1619
+
1613
1620
 
1614
1621
 
1615
1622
  if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -1650,7 +1657,13 @@ proto.tournament.TournamentItem.toObject = function(includeInstance, msg) {
1650
1657
  startedAt: jspb.Message.getFieldWithDefault(msg, 7, ""),
1651
1658
  finishedAt: jspb.Message.getFieldWithDefault(msg, 8, ""),
1652
1659
  status: jspb.Message.getFieldWithDefault(msg, 9, ""),
1653
- image: jspb.Message.getFieldWithDefault(msg, 10, "")
1660
+ image: jspb.Message.getFieldWithDefault(msg, 10, ""),
1661
+ rulesList: jspb.Message.toObjectList(msg.getRulesList(),
1662
+ proto.tournament.ActivationRuleItem.toObject, includeInstance),
1663
+ scoresList: jspb.Message.toObjectList(msg.getScoresList(),
1664
+ proto.tournament.ScoringRule.toObject, includeInstance),
1665
+ rewardsList: jspb.Message.toObjectList(msg.getRewardsList(),
1666
+ proto.tournament.RewardItem.toObject, includeInstance)
1654
1667
  };
1655
1668
 
1656
1669
  if (includeInstance) {
@@ -1727,6 +1740,21 @@ proto.tournament.TournamentItem.deserializeBinaryFromReader = function(msg, read
1727
1740
  var value = /** @type {string} */ (reader.readString());
1728
1741
  msg.setImage(value);
1729
1742
  break;
1743
+ case 11:
1744
+ var value = new proto.tournament.ActivationRuleItem;
1745
+ reader.readMessage(value,proto.tournament.ActivationRuleItem.deserializeBinaryFromReader);
1746
+ msg.addRules(value);
1747
+ break;
1748
+ case 12:
1749
+ var value = new proto.tournament.ScoringRule;
1750
+ reader.readMessage(value,proto.tournament.ScoringRule.deserializeBinaryFromReader);
1751
+ msg.addScores(value);
1752
+ break;
1753
+ case 13:
1754
+ var value = new proto.tournament.RewardItem;
1755
+ reader.readMessage(value,proto.tournament.RewardItem.deserializeBinaryFromReader);
1756
+ msg.addRewards(value);
1757
+ break;
1730
1758
  default:
1731
1759
  reader.skipField();
1732
1760
  break;
@@ -1826,6 +1854,30 @@ proto.tournament.TournamentItem.serializeBinaryToWriter = function(message, writ
1826
1854
  f
1827
1855
  );
1828
1856
  }
1857
+ f = message.getRulesList();
1858
+ if (f.length > 0) {
1859
+ writer.writeRepeatedMessage(
1860
+ 11,
1861
+ f,
1862
+ proto.tournament.ActivationRuleItem.serializeBinaryToWriter
1863
+ );
1864
+ }
1865
+ f = message.getScoresList();
1866
+ if (f.length > 0) {
1867
+ writer.writeRepeatedMessage(
1868
+ 12,
1869
+ f,
1870
+ proto.tournament.ScoringRule.serializeBinaryToWriter
1871
+ );
1872
+ }
1873
+ f = message.getRewardsList();
1874
+ if (f.length > 0) {
1875
+ writer.writeRepeatedMessage(
1876
+ 13,
1877
+ f,
1878
+ proto.tournament.RewardItem.serializeBinaryToWriter
1879
+ );
1880
+ }
1829
1881
  };
1830
1882
 
1831
1883
 
@@ -2189,6 +2241,120 @@ proto.tournament.TournamentItem.prototype.hasImage = function() {
2189
2241
  };
2190
2242
 
2191
2243
 
2244
+ /**
2245
+ * repeated ActivationRuleItem rules = 11;
2246
+ * @return {!Array<!proto.tournament.ActivationRuleItem>}
2247
+ */
2248
+ proto.tournament.TournamentItem.prototype.getRulesList = function() {
2249
+ return /** @type{!Array<!proto.tournament.ActivationRuleItem>} */ (
2250
+ jspb.Message.getRepeatedWrapperField(this, proto.tournament.ActivationRuleItem, 11));
2251
+ };
2252
+
2253
+
2254
+ /**
2255
+ * @param {!Array<!proto.tournament.ActivationRuleItem>} value
2256
+ * @return {!proto.tournament.TournamentItem} returns this
2257
+ */
2258
+ proto.tournament.TournamentItem.prototype.setRulesList = function(value) {
2259
+ return jspb.Message.setRepeatedWrapperField(this, 11, value);
2260
+ };
2261
+
2262
+
2263
+ /**
2264
+ * @param {!proto.tournament.ActivationRuleItem=} opt_value
2265
+ * @param {number=} opt_index
2266
+ * @return {!proto.tournament.ActivationRuleItem}
2267
+ */
2268
+ proto.tournament.TournamentItem.prototype.addRules = function(opt_value, opt_index) {
2269
+ return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, proto.tournament.ActivationRuleItem, opt_index);
2270
+ };
2271
+
2272
+
2273
+ /**
2274
+ * Clears the list making it empty but non-null.
2275
+ * @return {!proto.tournament.TournamentItem} returns this
2276
+ */
2277
+ proto.tournament.TournamentItem.prototype.clearRulesList = function() {
2278
+ return this.setRulesList([]);
2279
+ };
2280
+
2281
+
2282
+ /**
2283
+ * repeated ScoringRule scores = 12;
2284
+ * @return {!Array<!proto.tournament.ScoringRule>}
2285
+ */
2286
+ proto.tournament.TournamentItem.prototype.getScoresList = function() {
2287
+ return /** @type{!Array<!proto.tournament.ScoringRule>} */ (
2288
+ jspb.Message.getRepeatedWrapperField(this, proto.tournament.ScoringRule, 12));
2289
+ };
2290
+
2291
+
2292
+ /**
2293
+ * @param {!Array<!proto.tournament.ScoringRule>} value
2294
+ * @return {!proto.tournament.TournamentItem} returns this
2295
+ */
2296
+ proto.tournament.TournamentItem.prototype.setScoresList = function(value) {
2297
+ return jspb.Message.setRepeatedWrapperField(this, 12, value);
2298
+ };
2299
+
2300
+
2301
+ /**
2302
+ * @param {!proto.tournament.ScoringRule=} opt_value
2303
+ * @param {number=} opt_index
2304
+ * @return {!proto.tournament.ScoringRule}
2305
+ */
2306
+ proto.tournament.TournamentItem.prototype.addScores = function(opt_value, opt_index) {
2307
+ return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.tournament.ScoringRule, opt_index);
2308
+ };
2309
+
2310
+
2311
+ /**
2312
+ * Clears the list making it empty but non-null.
2313
+ * @return {!proto.tournament.TournamentItem} returns this
2314
+ */
2315
+ proto.tournament.TournamentItem.prototype.clearScoresList = function() {
2316
+ return this.setScoresList([]);
2317
+ };
2318
+
2319
+
2320
+ /**
2321
+ * repeated RewardItem rewards = 13;
2322
+ * @return {!Array<!proto.tournament.RewardItem>}
2323
+ */
2324
+ proto.tournament.TournamentItem.prototype.getRewardsList = function() {
2325
+ return /** @type{!Array<!proto.tournament.RewardItem>} */ (
2326
+ jspb.Message.getRepeatedWrapperField(this, proto.tournament.RewardItem, 13));
2327
+ };
2328
+
2329
+
2330
+ /**
2331
+ * @param {!Array<!proto.tournament.RewardItem>} value
2332
+ * @return {!proto.tournament.TournamentItem} returns this
2333
+ */
2334
+ proto.tournament.TournamentItem.prototype.setRewardsList = function(value) {
2335
+ return jspb.Message.setRepeatedWrapperField(this, 13, value);
2336
+ };
2337
+
2338
+
2339
+ /**
2340
+ * @param {!proto.tournament.RewardItem=} opt_value
2341
+ * @param {number=} opt_index
2342
+ * @return {!proto.tournament.RewardItem}
2343
+ */
2344
+ proto.tournament.TournamentItem.prototype.addRewards = function(opt_value, opt_index) {
2345
+ return jspb.Message.addToRepeatedWrapperField(this, 13, opt_value, proto.tournament.RewardItem, opt_index);
2346
+ };
2347
+
2348
+
2349
+ /**
2350
+ * Clears the list making it empty but non-null.
2351
+ * @return {!proto.tournament.TournamentItem} returns this
2352
+ */
2353
+ proto.tournament.TournamentItem.prototype.clearRewardsList = function() {
2354
+ return this.setRewardsList([]);
2355
+ };
2356
+
2357
+
2192
2358
 
2193
2359
  /**
2194
2360
  * Oneof group definitions for this message. Each group defines the field
@@ -2454,9 +2620,10 @@ proto.tournament.TournamentItemRequest.toObject = function(includeInstance, msg)
2454
2620
  description: jspb.Message.getFieldWithDefault(msg, 3, ""),
2455
2621
  isActive: jspb.Message.getFieldWithDefault(msg, 4, 0),
2456
2622
  maxMembersCount: jspb.Message.getFieldWithDefault(msg, 5, 0),
2457
- startedAt: jspb.Message.getFieldWithDefault(msg, 6, ""),
2458
- finishedAt: jspb.Message.getFieldWithDefault(msg, 7, ""),
2459
- statusId: jspb.Message.getFieldWithDefault(msg, 8, 0)
2623
+ botsCount: jspb.Message.getFieldWithDefault(msg, 6, 0),
2624
+ startedAt: jspb.Message.getFieldWithDefault(msg, 7, ""),
2625
+ finishedAt: jspb.Message.getFieldWithDefault(msg, 8, ""),
2626
+ statusId: jspb.Message.getFieldWithDefault(msg, 9, 0)
2460
2627
  };
2461
2628
 
2462
2629
  if (includeInstance) {
@@ -2514,14 +2681,18 @@ proto.tournament.TournamentItemRequest.deserializeBinaryFromReader = function(ms
2514
2681
  msg.setMaxMembersCount(value);
2515
2682
  break;
2516
2683
  case 6:
2684
+ var value = /** @type {number} */ (reader.readInt32());
2685
+ msg.setBotsCount(value);
2686
+ break;
2687
+ case 7:
2517
2688
  var value = /** @type {string} */ (reader.readString());
2518
2689
  msg.setStartedAt(value);
2519
2690
  break;
2520
- case 7:
2691
+ case 8:
2521
2692
  var value = /** @type {string} */ (reader.readString());
2522
2693
  msg.setFinishedAt(value);
2523
2694
  break;
2524
- case 8:
2695
+ case 9:
2525
2696
  var value = /** @type {number} */ (reader.readInt32());
2526
2697
  msg.setStatusId(value);
2527
2698
  break;
@@ -2589,9 +2760,9 @@ proto.tournament.TournamentItemRequest.serializeBinaryToWriter = function(messag
2589
2760
  f
2590
2761
  );
2591
2762
  }
2592
- f = /** @type {string} */ (jspb.Message.getField(message, 6));
2763
+ f = /** @type {number} */ (jspb.Message.getField(message, 6));
2593
2764
  if (f != null) {
2594
- writer.writeString(
2765
+ writer.writeInt32(
2595
2766
  6,
2596
2767
  f
2597
2768
  );
@@ -2603,13 +2774,20 @@ proto.tournament.TournamentItemRequest.serializeBinaryToWriter = function(messag
2603
2774
  f
2604
2775
  );
2605
2776
  }
2606
- f = /** @type {number} */ (jspb.Message.getField(message, 8));
2777
+ f = /** @type {string} */ (jspb.Message.getField(message, 8));
2607
2778
  if (f != null) {
2608
- writer.writeInt32(
2779
+ writer.writeString(
2609
2780
  8,
2610
2781
  f
2611
2782
  );
2612
2783
  }
2784
+ f = /** @type {number} */ (jspb.Message.getField(message, 9));
2785
+ if (f != null) {
2786
+ writer.writeInt32(
2787
+ 9,
2788
+ f
2789
+ );
2790
+ }
2613
2791
  };
2614
2792
 
2615
2793
 
@@ -2794,11 +2972,47 @@ proto.tournament.TournamentItemRequest.prototype.hasMaxMembersCount = function()
2794
2972
 
2795
2973
 
2796
2974
  /**
2797
- * optional string started_at = 6;
2975
+ * optional int32 bots_count = 6;
2976
+ * @return {number}
2977
+ */
2978
+ proto.tournament.TournamentItemRequest.prototype.getBotsCount = function() {
2979
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
2980
+ };
2981
+
2982
+
2983
+ /**
2984
+ * @param {number} value
2985
+ * @return {!proto.tournament.TournamentItemRequest} returns this
2986
+ */
2987
+ proto.tournament.TournamentItemRequest.prototype.setBotsCount = function(value) {
2988
+ return jspb.Message.setField(this, 6, value);
2989
+ };
2990
+
2991
+
2992
+ /**
2993
+ * Clears the field making it undefined.
2994
+ * @return {!proto.tournament.TournamentItemRequest} returns this
2995
+ */
2996
+ proto.tournament.TournamentItemRequest.prototype.clearBotsCount = function() {
2997
+ return jspb.Message.setField(this, 6, undefined);
2998
+ };
2999
+
3000
+
3001
+ /**
3002
+ * Returns whether this field is set.
3003
+ * @return {boolean}
3004
+ */
3005
+ proto.tournament.TournamentItemRequest.prototype.hasBotsCount = function() {
3006
+ return jspb.Message.getField(this, 6) != null;
3007
+ };
3008
+
3009
+
3010
+ /**
3011
+ * optional string started_at = 7;
2798
3012
  * @return {string}
2799
3013
  */
2800
3014
  proto.tournament.TournamentItemRequest.prototype.getStartedAt = function() {
2801
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
3015
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
2802
3016
  };
2803
3017
 
2804
3018
 
@@ -2807,7 +3021,7 @@ proto.tournament.TournamentItemRequest.prototype.getStartedAt = function() {
2807
3021
  * @return {!proto.tournament.TournamentItemRequest} returns this
2808
3022
  */
2809
3023
  proto.tournament.TournamentItemRequest.prototype.setStartedAt = function(value) {
2810
- return jspb.Message.setField(this, 6, value);
3024
+ return jspb.Message.setField(this, 7, value);
2811
3025
  };
2812
3026
 
2813
3027
 
@@ -2816,7 +3030,7 @@ proto.tournament.TournamentItemRequest.prototype.setStartedAt = function(value)
2816
3030
  * @return {!proto.tournament.TournamentItemRequest} returns this
2817
3031
  */
2818
3032
  proto.tournament.TournamentItemRequest.prototype.clearStartedAt = function() {
2819
- return jspb.Message.setField(this, 6, undefined);
3033
+ return jspb.Message.setField(this, 7, undefined);
2820
3034
  };
2821
3035
 
2822
3036
 
@@ -2825,16 +3039,16 @@ proto.tournament.TournamentItemRequest.prototype.clearStartedAt = function() {
2825
3039
  * @return {boolean}
2826
3040
  */
2827
3041
  proto.tournament.TournamentItemRequest.prototype.hasStartedAt = function() {
2828
- return jspb.Message.getField(this, 6) != null;
3042
+ return jspb.Message.getField(this, 7) != null;
2829
3043
  };
2830
3044
 
2831
3045
 
2832
3046
  /**
2833
- * optional string finished_at = 7;
3047
+ * optional string finished_at = 8;
2834
3048
  * @return {string}
2835
3049
  */
2836
3050
  proto.tournament.TournamentItemRequest.prototype.getFinishedAt = function() {
2837
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
3051
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
2838
3052
  };
2839
3053
 
2840
3054
 
@@ -2843,7 +3057,7 @@ proto.tournament.TournamentItemRequest.prototype.getFinishedAt = function() {
2843
3057
  * @return {!proto.tournament.TournamentItemRequest} returns this
2844
3058
  */
2845
3059
  proto.tournament.TournamentItemRequest.prototype.setFinishedAt = function(value) {
2846
- return jspb.Message.setField(this, 7, value);
3060
+ return jspb.Message.setField(this, 8, value);
2847
3061
  };
2848
3062
 
2849
3063
 
@@ -2852,7 +3066,7 @@ proto.tournament.TournamentItemRequest.prototype.setFinishedAt = function(value)
2852
3066
  * @return {!proto.tournament.TournamentItemRequest} returns this
2853
3067
  */
2854
3068
  proto.tournament.TournamentItemRequest.prototype.clearFinishedAt = function() {
2855
- return jspb.Message.setField(this, 7, undefined);
3069
+ return jspb.Message.setField(this, 8, undefined);
2856
3070
  };
2857
3071
 
2858
3072
 
@@ -2861,16 +3075,16 @@ proto.tournament.TournamentItemRequest.prototype.clearFinishedAt = function() {
2861
3075
  * @return {boolean}
2862
3076
  */
2863
3077
  proto.tournament.TournamentItemRequest.prototype.hasFinishedAt = function() {
2864
- return jspb.Message.getField(this, 7) != null;
3078
+ return jspb.Message.getField(this, 8) != null;
2865
3079
  };
2866
3080
 
2867
3081
 
2868
3082
  /**
2869
- * optional int32 status_id = 8;
3083
+ * optional int32 status_id = 9;
2870
3084
  * @return {number}
2871
3085
  */
2872
3086
  proto.tournament.TournamentItemRequest.prototype.getStatusId = function() {
2873
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
3087
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0));
2874
3088
  };
2875
3089
 
2876
3090
 
@@ -2879,7 +3093,7 @@ proto.tournament.TournamentItemRequest.prototype.getStatusId = function() {
2879
3093
  * @return {!proto.tournament.TournamentItemRequest} returns this
2880
3094
  */
2881
3095
  proto.tournament.TournamentItemRequest.prototype.setStatusId = function(value) {
2882
- return jspb.Message.setField(this, 8, value);
3096
+ return jspb.Message.setField(this, 9, value);
2883
3097
  };
2884
3098
 
2885
3099
 
@@ -2888,7 +3102,7 @@ proto.tournament.TournamentItemRequest.prototype.setStatusId = function(value) {
2888
3102
  * @return {!proto.tournament.TournamentItemRequest} returns this
2889
3103
  */
2890
3104
  proto.tournament.TournamentItemRequest.prototype.clearStatusId = function() {
2891
- return jspb.Message.setField(this, 8, undefined);
3105
+ return jspb.Message.setField(this, 9, undefined);
2892
3106
  };
2893
3107
 
2894
3108
 
@@ -2897,7 +3111,7 @@ proto.tournament.TournamentItemRequest.prototype.clearStatusId = function() {
2897
3111
  * @return {boolean}
2898
3112
  */
2899
3113
  proto.tournament.TournamentItemRequest.prototype.hasStatusId = function() {
2900
- return jspb.Message.getField(this, 8) != null;
3114
+ return jspb.Message.getField(this, 9) != null;
2901
3115
  };
2902
3116
 
2903
3117