protobuf-platform 1.0.52 → 1.0.54

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/game/game.proto CHANGED
@@ -10,11 +10,12 @@ service Game {
10
10
  rpc readSingleCategory(GetCategoryRequest) returns (CategoryResponse);
11
11
  rpc updateSingleCategory(stream CategoryRequest) returns (CategoryResponse);
12
12
  rpc deleteSingleCategory(GetCategoryRequest) returns (CategoryStatusResponse);
13
- rpc readListCategories(GetListCategoryRequest) returns (CategoryListResponse);
13
+ rpc readListCategories(PaginationRequest) returns (CategoryListResponse);
14
14
  }
15
15
 
16
16
  message PingRequest { string ping = 1; }
17
17
  message PongResponse { string pong = 1; }
18
+ message PaginationRequest { int32 limit = 1; int32 offset = 2; }
18
19
  //Media
19
20
  message File { bytes media = 1; }
20
21
  message GetFileRequest { string file_name = 1; string instance_type = 2; }
@@ -35,7 +36,7 @@ message CategoryRequest {
35
36
  }
36
37
  }
37
38
  message CategoryItemRequest {
38
- int32 id = 1;
39
+ optional int32 id = 1;
39
40
  optional string title = 2;
40
41
  optional string slug = 3;
41
42
  optional string description = 4;
@@ -46,10 +47,6 @@ message CategoryItemRequest {
46
47
  message GetCategoryRequest {
47
48
  int32 id = 1;
48
49
  }
49
- message GetListCategoryRequest {
50
- int32 limit = 1;
51
- int32 offset = 2;
52
- }
53
50
  //Category CRUD | Responses
54
51
  message CategoryResponse {
55
52
  CategoryItem data = 1;
@@ -81,15 +81,15 @@ function deserialize_game_GetFileRequest(buffer_arg) {
81
81
  return game_pb.GetFileRequest.deserializeBinary(new Uint8Array(buffer_arg));
82
82
  }
83
83
 
84
- function serialize_game_GetListCategoryRequest(arg) {
85
- if (!(arg instanceof game_pb.GetListCategoryRequest)) {
86
- throw new Error('Expected argument of type game.GetListCategoryRequest');
84
+ function serialize_game_PaginationRequest(arg) {
85
+ if (!(arg instanceof game_pb.PaginationRequest)) {
86
+ throw new Error('Expected argument of type game.PaginationRequest');
87
87
  }
88
88
  return Buffer.from(arg.serializeBinary());
89
89
  }
90
90
 
91
- function deserialize_game_GetListCategoryRequest(buffer_arg) {
92
- return game_pb.GetListCategoryRequest.deserializeBinary(new Uint8Array(buffer_arg));
91
+ function deserialize_game_PaginationRequest(buffer_arg) {
92
+ return game_pb.PaginationRequest.deserializeBinary(new Uint8Array(buffer_arg));
93
93
  }
94
94
 
95
95
  function serialize_game_PingRequest(arg) {
@@ -187,10 +187,10 @@ createSingleCategory: {
187
187
  path: '/game.Game/readListCategories',
188
188
  requestStream: false,
189
189
  responseStream: false,
190
- requestType: game_pb.GetListCategoryRequest,
190
+ requestType: game_pb.PaginationRequest,
191
191
  responseType: game_pb.CategoryListResponse,
192
- requestSerialize: serialize_game_GetListCategoryRequest,
193
- requestDeserialize: deserialize_game_GetListCategoryRequest,
192
+ requestSerialize: serialize_game_PaginationRequest,
193
+ requestDeserialize: deserialize_game_PaginationRequest,
194
194
  responseSerialize: serialize_game_CategoryListResponse,
195
195
  responseDeserialize: deserialize_game_CategoryListResponse,
196
196
  },
package/game/game_pb.js CHANGED
@@ -31,7 +31,7 @@ goog.exportSymbol('proto.game.CategoryStatusResponse', null, global);
31
31
  goog.exportSymbol('proto.game.File', null, global);
32
32
  goog.exportSymbol('proto.game.GetCategoryRequest', null, global);
33
33
  goog.exportSymbol('proto.game.GetFileRequest', null, global);
34
- goog.exportSymbol('proto.game.GetListCategoryRequest', null, global);
34
+ goog.exportSymbol('proto.game.PaginationRequest', null, global);
35
35
  goog.exportSymbol('proto.game.PingRequest', null, global);
36
36
  goog.exportSymbol('proto.game.PongResponse', null, global);
37
37
  /**
@@ -76,6 +76,27 @@ if (goog.DEBUG && !COMPILED) {
76
76
  */
77
77
  proto.game.PongResponse.displayName = 'proto.game.PongResponse';
78
78
  }
79
+ /**
80
+ * Generated by JsPbCodeGenerator.
81
+ * @param {Array=} opt_data Optional initial data array, typically from a
82
+ * server response, or constructed directly in Javascript. The array is used
83
+ * in place and becomes part of the constructed object. It is not cloned.
84
+ * If no data is provided, the constructed object will be empty, but still
85
+ * valid.
86
+ * @extends {jspb.Message}
87
+ * @constructor
88
+ */
89
+ proto.game.PaginationRequest = function(opt_data) {
90
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
91
+ };
92
+ goog.inherits(proto.game.PaginationRequest, jspb.Message);
93
+ if (goog.DEBUG && !COMPILED) {
94
+ /**
95
+ * @public
96
+ * @override
97
+ */
98
+ proto.game.PaginationRequest.displayName = 'proto.game.PaginationRequest';
99
+ }
79
100
  /**
80
101
  * Generated by JsPbCodeGenerator.
81
102
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -202,27 +223,6 @@ if (goog.DEBUG && !COMPILED) {
202
223
  */
203
224
  proto.game.GetCategoryRequest.displayName = 'proto.game.GetCategoryRequest';
204
225
  }
205
- /**
206
- * Generated by JsPbCodeGenerator.
207
- * @param {Array=} opt_data Optional initial data array, typically from a
208
- * server response, or constructed directly in Javascript. The array is used
209
- * in place and becomes part of the constructed object. It is not cloned.
210
- * If no data is provided, the constructed object will be empty, but still
211
- * valid.
212
- * @extends {jspb.Message}
213
- * @constructor
214
- */
215
- proto.game.GetListCategoryRequest = function(opt_data) {
216
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
217
- };
218
- goog.inherits(proto.game.GetListCategoryRequest, jspb.Message);
219
- if (goog.DEBUG && !COMPILED) {
220
- /**
221
- * @public
222
- * @override
223
- */
224
- proto.game.GetListCategoryRequest.displayName = 'proto.game.GetListCategoryRequest';
225
- }
226
226
  /**
227
227
  * Generated by JsPbCodeGenerator.
228
228
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -549,6 +549,166 @@ proto.game.PongResponse.prototype.setPong = function(value) {
549
549
 
550
550
 
551
551
 
552
+ if (jspb.Message.GENERATE_TO_OBJECT) {
553
+ /**
554
+ * Creates an object representation of this proto.
555
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
556
+ * Optional fields that are not set will be set to undefined.
557
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
558
+ * For the list of reserved names please see:
559
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
560
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
561
+ * JSPB instance for transitional soy proto support:
562
+ * http://goto/soy-param-migration
563
+ * @return {!Object}
564
+ */
565
+ proto.game.PaginationRequest.prototype.toObject = function(opt_includeInstance) {
566
+ return proto.game.PaginationRequest.toObject(opt_includeInstance, this);
567
+ };
568
+
569
+
570
+ /**
571
+ * Static version of the {@see toObject} method.
572
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
573
+ * the JSPB instance for transitional soy proto support:
574
+ * http://goto/soy-param-migration
575
+ * @param {!proto.game.PaginationRequest} msg The msg instance to transform.
576
+ * @return {!Object}
577
+ * @suppress {unusedLocalVariables} f is only used for nested messages
578
+ */
579
+ proto.game.PaginationRequest.toObject = function(includeInstance, msg) {
580
+ var f, obj = {
581
+ limit: jspb.Message.getFieldWithDefault(msg, 1, 0),
582
+ offset: jspb.Message.getFieldWithDefault(msg, 2, 0)
583
+ };
584
+
585
+ if (includeInstance) {
586
+ obj.$jspbMessageInstance = msg;
587
+ }
588
+ return obj;
589
+ };
590
+ }
591
+
592
+
593
+ /**
594
+ * Deserializes binary data (in protobuf wire format).
595
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
596
+ * @return {!proto.game.PaginationRequest}
597
+ */
598
+ proto.game.PaginationRequest.deserializeBinary = function(bytes) {
599
+ var reader = new jspb.BinaryReader(bytes);
600
+ var msg = new proto.game.PaginationRequest;
601
+ return proto.game.PaginationRequest.deserializeBinaryFromReader(msg, reader);
602
+ };
603
+
604
+
605
+ /**
606
+ * Deserializes binary data (in protobuf wire format) from the
607
+ * given reader into the given message object.
608
+ * @param {!proto.game.PaginationRequest} msg The message object to deserialize into.
609
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
610
+ * @return {!proto.game.PaginationRequest}
611
+ */
612
+ proto.game.PaginationRequest.deserializeBinaryFromReader = function(msg, reader) {
613
+ while (reader.nextField()) {
614
+ if (reader.isEndGroup()) {
615
+ break;
616
+ }
617
+ var field = reader.getFieldNumber();
618
+ switch (field) {
619
+ case 1:
620
+ var value = /** @type {number} */ (reader.readInt32());
621
+ msg.setLimit(value);
622
+ break;
623
+ case 2:
624
+ var value = /** @type {number} */ (reader.readInt32());
625
+ msg.setOffset(value);
626
+ break;
627
+ default:
628
+ reader.skipField();
629
+ break;
630
+ }
631
+ }
632
+ return msg;
633
+ };
634
+
635
+
636
+ /**
637
+ * Serializes the message to binary data (in protobuf wire format).
638
+ * @return {!Uint8Array}
639
+ */
640
+ proto.game.PaginationRequest.prototype.serializeBinary = function() {
641
+ var writer = new jspb.BinaryWriter();
642
+ proto.game.PaginationRequest.serializeBinaryToWriter(this, writer);
643
+ return writer.getResultBuffer();
644
+ };
645
+
646
+
647
+ /**
648
+ * Serializes the given message to binary data (in protobuf wire
649
+ * format), writing to the given BinaryWriter.
650
+ * @param {!proto.game.PaginationRequest} message
651
+ * @param {!jspb.BinaryWriter} writer
652
+ * @suppress {unusedLocalVariables} f is only used for nested messages
653
+ */
654
+ proto.game.PaginationRequest.serializeBinaryToWriter = function(message, writer) {
655
+ var f = undefined;
656
+ f = message.getLimit();
657
+ if (f !== 0) {
658
+ writer.writeInt32(
659
+ 1,
660
+ f
661
+ );
662
+ }
663
+ f = message.getOffset();
664
+ if (f !== 0) {
665
+ writer.writeInt32(
666
+ 2,
667
+ f
668
+ );
669
+ }
670
+ };
671
+
672
+
673
+ /**
674
+ * optional int32 limit = 1;
675
+ * @return {number}
676
+ */
677
+ proto.game.PaginationRequest.prototype.getLimit = function() {
678
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
679
+ };
680
+
681
+
682
+ /**
683
+ * @param {number} value
684
+ * @return {!proto.game.PaginationRequest} returns this
685
+ */
686
+ proto.game.PaginationRequest.prototype.setLimit = function(value) {
687
+ return jspb.Message.setProto3IntField(this, 1, value);
688
+ };
689
+
690
+
691
+ /**
692
+ * optional int32 offset = 2;
693
+ * @return {number}
694
+ */
695
+ proto.game.PaginationRequest.prototype.getOffset = function() {
696
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
697
+ };
698
+
699
+
700
+ /**
701
+ * @param {number} value
702
+ * @return {!proto.game.PaginationRequest} returns this
703
+ */
704
+ proto.game.PaginationRequest.prototype.setOffset = function(value) {
705
+ return jspb.Message.setProto3IntField(this, 2, value);
706
+ };
707
+
708
+
709
+
710
+
711
+
552
712
  if (jspb.Message.GENERATE_TO_OBJECT) {
553
713
  /**
554
714
  * Creates an object representation of this proto.
@@ -1608,8 +1768,8 @@ proto.game.CategoryItemRequest.prototype.serializeBinary = function() {
1608
1768
  */
1609
1769
  proto.game.CategoryItemRequest.serializeBinaryToWriter = function(message, writer) {
1610
1770
  var f = undefined;
1611
- f = message.getId();
1612
- if (f !== 0) {
1771
+ f = /** @type {number} */ (jspb.Message.getField(message, 1));
1772
+ if (f != null) {
1613
1773
  writer.writeInt32(
1614
1774
  1,
1615
1775
  f
@@ -1674,7 +1834,25 @@ proto.game.CategoryItemRequest.prototype.getId = function() {
1674
1834
  * @return {!proto.game.CategoryItemRequest} returns this
1675
1835
  */
1676
1836
  proto.game.CategoryItemRequest.prototype.setId = function(value) {
1677
- return jspb.Message.setProto3IntField(this, 1, value);
1837
+ return jspb.Message.setField(this, 1, value);
1838
+ };
1839
+
1840
+
1841
+ /**
1842
+ * Clears the field making it undefined.
1843
+ * @return {!proto.game.CategoryItemRequest} returns this
1844
+ */
1845
+ proto.game.CategoryItemRequest.prototype.clearId = function() {
1846
+ return jspb.Message.setField(this, 1, undefined);
1847
+ };
1848
+
1849
+
1850
+ /**
1851
+ * Returns whether this field is set.
1852
+ * @return {boolean}
1853
+ */
1854
+ proto.game.CategoryItemRequest.prototype.hasId = function() {
1855
+ return jspb.Message.getField(this, 1) != null;
1678
1856
  };
1679
1857
 
1680
1858
 
@@ -2027,166 +2205,6 @@ proto.game.GetCategoryRequest.prototype.setId = function(value) {
2027
2205
 
2028
2206
 
2029
2207
 
2030
- if (jspb.Message.GENERATE_TO_OBJECT) {
2031
- /**
2032
- * Creates an object representation of this proto.
2033
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
2034
- * Optional fields that are not set will be set to undefined.
2035
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2036
- * For the list of reserved names please see:
2037
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2038
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2039
- * JSPB instance for transitional soy proto support:
2040
- * http://goto/soy-param-migration
2041
- * @return {!Object}
2042
- */
2043
- proto.game.GetListCategoryRequest.prototype.toObject = function(opt_includeInstance) {
2044
- return proto.game.GetListCategoryRequest.toObject(opt_includeInstance, this);
2045
- };
2046
-
2047
-
2048
- /**
2049
- * Static version of the {@see toObject} method.
2050
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2051
- * the JSPB instance for transitional soy proto support:
2052
- * http://goto/soy-param-migration
2053
- * @param {!proto.game.GetListCategoryRequest} msg The msg instance to transform.
2054
- * @return {!Object}
2055
- * @suppress {unusedLocalVariables} f is only used for nested messages
2056
- */
2057
- proto.game.GetListCategoryRequest.toObject = function(includeInstance, msg) {
2058
- var f, obj = {
2059
- limit: jspb.Message.getFieldWithDefault(msg, 1, 0),
2060
- offset: jspb.Message.getFieldWithDefault(msg, 2, 0)
2061
- };
2062
-
2063
- if (includeInstance) {
2064
- obj.$jspbMessageInstance = msg;
2065
- }
2066
- return obj;
2067
- };
2068
- }
2069
-
2070
-
2071
- /**
2072
- * Deserializes binary data (in protobuf wire format).
2073
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
2074
- * @return {!proto.game.GetListCategoryRequest}
2075
- */
2076
- proto.game.GetListCategoryRequest.deserializeBinary = function(bytes) {
2077
- var reader = new jspb.BinaryReader(bytes);
2078
- var msg = new proto.game.GetListCategoryRequest;
2079
- return proto.game.GetListCategoryRequest.deserializeBinaryFromReader(msg, reader);
2080
- };
2081
-
2082
-
2083
- /**
2084
- * Deserializes binary data (in protobuf wire format) from the
2085
- * given reader into the given message object.
2086
- * @param {!proto.game.GetListCategoryRequest} msg The message object to deserialize into.
2087
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2088
- * @return {!proto.game.GetListCategoryRequest}
2089
- */
2090
- proto.game.GetListCategoryRequest.deserializeBinaryFromReader = function(msg, reader) {
2091
- while (reader.nextField()) {
2092
- if (reader.isEndGroup()) {
2093
- break;
2094
- }
2095
- var field = reader.getFieldNumber();
2096
- switch (field) {
2097
- case 1:
2098
- var value = /** @type {number} */ (reader.readInt32());
2099
- msg.setLimit(value);
2100
- break;
2101
- case 2:
2102
- var value = /** @type {number} */ (reader.readInt32());
2103
- msg.setOffset(value);
2104
- break;
2105
- default:
2106
- reader.skipField();
2107
- break;
2108
- }
2109
- }
2110
- return msg;
2111
- };
2112
-
2113
-
2114
- /**
2115
- * Serializes the message to binary data (in protobuf wire format).
2116
- * @return {!Uint8Array}
2117
- */
2118
- proto.game.GetListCategoryRequest.prototype.serializeBinary = function() {
2119
- var writer = new jspb.BinaryWriter();
2120
- proto.game.GetListCategoryRequest.serializeBinaryToWriter(this, writer);
2121
- return writer.getResultBuffer();
2122
- };
2123
-
2124
-
2125
- /**
2126
- * Serializes the given message to binary data (in protobuf wire
2127
- * format), writing to the given BinaryWriter.
2128
- * @param {!proto.game.GetListCategoryRequest} message
2129
- * @param {!jspb.BinaryWriter} writer
2130
- * @suppress {unusedLocalVariables} f is only used for nested messages
2131
- */
2132
- proto.game.GetListCategoryRequest.serializeBinaryToWriter = function(message, writer) {
2133
- var f = undefined;
2134
- f = message.getLimit();
2135
- if (f !== 0) {
2136
- writer.writeInt32(
2137
- 1,
2138
- f
2139
- );
2140
- }
2141
- f = message.getOffset();
2142
- if (f !== 0) {
2143
- writer.writeInt32(
2144
- 2,
2145
- f
2146
- );
2147
- }
2148
- };
2149
-
2150
-
2151
- /**
2152
- * optional int32 limit = 1;
2153
- * @return {number}
2154
- */
2155
- proto.game.GetListCategoryRequest.prototype.getLimit = function() {
2156
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
2157
- };
2158
-
2159
-
2160
- /**
2161
- * @param {number} value
2162
- * @return {!proto.game.GetListCategoryRequest} returns this
2163
- */
2164
- proto.game.GetListCategoryRequest.prototype.setLimit = function(value) {
2165
- return jspb.Message.setProto3IntField(this, 1, value);
2166
- };
2167
-
2168
-
2169
- /**
2170
- * optional int32 offset = 2;
2171
- * @return {number}
2172
- */
2173
- proto.game.GetListCategoryRequest.prototype.getOffset = function() {
2174
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
2175
- };
2176
-
2177
-
2178
- /**
2179
- * @param {number} value
2180
- * @return {!proto.game.GetListCategoryRequest} returns this
2181
- */
2182
- proto.game.GetListCategoryRequest.prototype.setOffset = function(value) {
2183
- return jspb.Message.setProto3IntField(this, 2, value);
2184
- };
2185
-
2186
-
2187
-
2188
-
2189
-
2190
2208
  if (jspb.Message.GENERATE_TO_OBJECT) {
2191
2209
  /**
2192
2210
  * Creates an object representation of this proto.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {