protobuf-platform 1.0.37 → 1.0.39

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
@@ -4,6 +4,7 @@ package game;
4
4
 
5
5
  service Game {
6
6
  rpc checkConnection(PingRequest) returns (PongResponse);
7
+ rpc getMediaResource(GetFileRequest) returns (File);
7
8
  //Categories
8
9
  rpc createSingleCategory(CategoryRequest) returns (CategoryResponse);
9
10
  rpc readSingleCategory(GetCategoryRequest) returns (CategoryResponse);
@@ -14,7 +15,13 @@ service Game {
14
15
 
15
16
  message PingRequest { string ping = 1; }
16
17
  message PongResponse { string pong = 1; }
17
-
18
+ //Media
19
+ message File {
20
+ bytes media = 1;
21
+ }
22
+ message GetFileRequest {
23
+ string file_path = 1;
24
+ }
18
25
  //Category CRUD
19
26
  message CategoryItem {
20
27
  optional int32 id = 1;
@@ -26,14 +33,10 @@ message CategoryItem {
26
33
  }
27
34
  //Category CRUD | Requests
28
35
  message CategoryRequest {
29
- //oneof request {
36
+ oneof request {
30
37
  CategoryItemRequest category_data = 1;
31
- //File file = 2;
32
- bytes media = 2;
33
- //}
34
- }
35
- message File {
36
- bytes media = 1;
38
+ File file = 2;
39
+ }
37
40
  }
38
41
  message CategoryItemRequest {
39
42
  int32 id = 1;
@@ -48,6 +48,17 @@ function deserialize_game_CategoryStatusResponse(buffer_arg) {
48
48
  return game_pb.CategoryStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
49
49
  }
50
50
 
51
+ function serialize_game_File(arg) {
52
+ if (!(arg instanceof game_pb.File)) {
53
+ throw new Error('Expected argument of type game.File');
54
+ }
55
+ return Buffer.from(arg.serializeBinary());
56
+ }
57
+
58
+ function deserialize_game_File(buffer_arg) {
59
+ return game_pb.File.deserializeBinary(new Uint8Array(buffer_arg));
60
+ }
61
+
51
62
  function serialize_game_GetCategoryRequest(arg) {
52
63
  if (!(arg instanceof game_pb.GetCategoryRequest)) {
53
64
  throw new Error('Expected argument of type game.GetCategoryRequest');
@@ -59,6 +70,17 @@ function deserialize_game_GetCategoryRequest(buffer_arg) {
59
70
  return game_pb.GetCategoryRequest.deserializeBinary(new Uint8Array(buffer_arg));
60
71
  }
61
72
 
73
+ function serialize_game_GetFileRequest(arg) {
74
+ if (!(arg instanceof game_pb.GetFileRequest)) {
75
+ throw new Error('Expected argument of type game.GetFileRequest');
76
+ }
77
+ return Buffer.from(arg.serializeBinary());
78
+ }
79
+
80
+ function deserialize_game_GetFileRequest(buffer_arg) {
81
+ return game_pb.GetFileRequest.deserializeBinary(new Uint8Array(buffer_arg));
82
+ }
83
+
62
84
  function serialize_game_GetListCategoryRequest(arg) {
63
85
  if (!(arg instanceof game_pb.GetListCategoryRequest)) {
64
86
  throw new Error('Expected argument of type game.GetListCategoryRequest');
@@ -105,6 +127,17 @@ var GameService = exports.GameService = {
105
127
  responseSerialize: serialize_game_PongResponse,
106
128
  responseDeserialize: deserialize_game_PongResponse,
107
129
  },
130
+ getMediaResource: {
131
+ path: '/game.Game/getMediaResource',
132
+ requestStream: false,
133
+ responseStream: false,
134
+ requestType: game_pb.GetFileRequest,
135
+ responseType: game_pb.File,
136
+ requestSerialize: serialize_game_GetFileRequest,
137
+ requestDeserialize: deserialize_game_GetFileRequest,
138
+ responseSerialize: serialize_game_File,
139
+ responseDeserialize: deserialize_game_File,
140
+ },
108
141
  // Categories
109
142
  createSingleCategory: {
110
143
  path: '/game.Game/createSingleCategory',
package/game/game_pb.js CHANGED
@@ -25,10 +25,12 @@ goog.exportSymbol('proto.game.CategoryItem', null, global);
25
25
  goog.exportSymbol('proto.game.CategoryItemRequest', null, global);
26
26
  goog.exportSymbol('proto.game.CategoryListResponse', null, global);
27
27
  goog.exportSymbol('proto.game.CategoryRequest', null, global);
28
+ goog.exportSymbol('proto.game.CategoryRequest.RequestCase', null, global);
28
29
  goog.exportSymbol('proto.game.CategoryResponse', null, global);
29
30
  goog.exportSymbol('proto.game.CategoryStatusResponse', null, global);
30
31
  goog.exportSymbol('proto.game.File', null, global);
31
32
  goog.exportSymbol('proto.game.GetCategoryRequest', null, global);
33
+ goog.exportSymbol('proto.game.GetFileRequest', null, global);
32
34
  goog.exportSymbol('proto.game.GetListCategoryRequest', null, global);
33
35
  goog.exportSymbol('proto.game.PingRequest', null, global);
34
36
  goog.exportSymbol('proto.game.PongResponse', null, global);
@@ -84,16 +86,16 @@ if (goog.DEBUG && !COMPILED) {
84
86
  * @extends {jspb.Message}
85
87
  * @constructor
86
88
  */
87
- proto.game.CategoryItem = function(opt_data) {
89
+ proto.game.File = function(opt_data) {
88
90
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
89
91
  };
90
- goog.inherits(proto.game.CategoryItem, jspb.Message);
92
+ goog.inherits(proto.game.File, jspb.Message);
91
93
  if (goog.DEBUG && !COMPILED) {
92
94
  /**
93
95
  * @public
94
96
  * @override
95
97
  */
96
- proto.game.CategoryItem.displayName = 'proto.game.CategoryItem';
98
+ proto.game.File.displayName = 'proto.game.File';
97
99
  }
98
100
  /**
99
101
  * Generated by JsPbCodeGenerator.
@@ -105,16 +107,16 @@ if (goog.DEBUG && !COMPILED) {
105
107
  * @extends {jspb.Message}
106
108
  * @constructor
107
109
  */
108
- proto.game.CategoryRequest = function(opt_data) {
110
+ proto.game.GetFileRequest = function(opt_data) {
109
111
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
110
112
  };
111
- goog.inherits(proto.game.CategoryRequest, jspb.Message);
113
+ goog.inherits(proto.game.GetFileRequest, jspb.Message);
112
114
  if (goog.DEBUG && !COMPILED) {
113
115
  /**
114
116
  * @public
115
117
  * @override
116
118
  */
117
- proto.game.CategoryRequest.displayName = 'proto.game.CategoryRequest';
119
+ proto.game.GetFileRequest.displayName = 'proto.game.GetFileRequest';
118
120
  }
119
121
  /**
120
122
  * Generated by JsPbCodeGenerator.
@@ -126,16 +128,37 @@ if (goog.DEBUG && !COMPILED) {
126
128
  * @extends {jspb.Message}
127
129
  * @constructor
128
130
  */
129
- proto.game.File = function(opt_data) {
131
+ proto.game.CategoryItem = function(opt_data) {
130
132
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
131
133
  };
132
- goog.inherits(proto.game.File, jspb.Message);
134
+ goog.inherits(proto.game.CategoryItem, jspb.Message);
133
135
  if (goog.DEBUG && !COMPILED) {
134
136
  /**
135
137
  * @public
136
138
  * @override
137
139
  */
138
- proto.game.File.displayName = 'proto.game.File';
140
+ proto.game.CategoryItem.displayName = 'proto.game.CategoryItem';
141
+ }
142
+ /**
143
+ * Generated by JsPbCodeGenerator.
144
+ * @param {Array=} opt_data Optional initial data array, typically from a
145
+ * server response, or constructed directly in Javascript. The array is used
146
+ * in place and becomes part of the constructed object. It is not cloned.
147
+ * If no data is provided, the constructed object will be empty, but still
148
+ * valid.
149
+ * @extends {jspb.Message}
150
+ * @constructor
151
+ */
152
+ proto.game.CategoryRequest = function(opt_data) {
153
+ jspb.Message.initialize(this, opt_data, 0, -1, null, proto.game.CategoryRequest.oneofGroups_);
154
+ };
155
+ goog.inherits(proto.game.CategoryRequest, jspb.Message);
156
+ if (goog.DEBUG && !COMPILED) {
157
+ /**
158
+ * @public
159
+ * @override
160
+ */
161
+ proto.game.CategoryRequest.displayName = 'proto.game.CategoryRequest';
139
162
  }
140
163
  /**
141
164
  * Generated by JsPbCodeGenerator.
@@ -526,6 +549,290 @@ proto.game.PongResponse.prototype.setPong = function(value) {
526
549
 
527
550
 
528
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.File.prototype.toObject = function(opt_includeInstance) {
566
+ return proto.game.File.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.File} msg The msg instance to transform.
576
+ * @return {!Object}
577
+ * @suppress {unusedLocalVariables} f is only used for nested messages
578
+ */
579
+ proto.game.File.toObject = function(includeInstance, msg) {
580
+ var f, obj = {
581
+ media: msg.getMedia_asB64()
582
+ };
583
+
584
+ if (includeInstance) {
585
+ obj.$jspbMessageInstance = msg;
586
+ }
587
+ return obj;
588
+ };
589
+ }
590
+
591
+
592
+ /**
593
+ * Deserializes binary data (in protobuf wire format).
594
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
595
+ * @return {!proto.game.File}
596
+ */
597
+ proto.game.File.deserializeBinary = function(bytes) {
598
+ var reader = new jspb.BinaryReader(bytes);
599
+ var msg = new proto.game.File;
600
+ return proto.game.File.deserializeBinaryFromReader(msg, reader);
601
+ };
602
+
603
+
604
+ /**
605
+ * Deserializes binary data (in protobuf wire format) from the
606
+ * given reader into the given message object.
607
+ * @param {!proto.game.File} msg The message object to deserialize into.
608
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
609
+ * @return {!proto.game.File}
610
+ */
611
+ proto.game.File.deserializeBinaryFromReader = function(msg, reader) {
612
+ while (reader.nextField()) {
613
+ if (reader.isEndGroup()) {
614
+ break;
615
+ }
616
+ var field = reader.getFieldNumber();
617
+ switch (field) {
618
+ case 1:
619
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
620
+ msg.setMedia(value);
621
+ break;
622
+ default:
623
+ reader.skipField();
624
+ break;
625
+ }
626
+ }
627
+ return msg;
628
+ };
629
+
630
+
631
+ /**
632
+ * Serializes the message to binary data (in protobuf wire format).
633
+ * @return {!Uint8Array}
634
+ */
635
+ proto.game.File.prototype.serializeBinary = function() {
636
+ var writer = new jspb.BinaryWriter();
637
+ proto.game.File.serializeBinaryToWriter(this, writer);
638
+ return writer.getResultBuffer();
639
+ };
640
+
641
+
642
+ /**
643
+ * Serializes the given message to binary data (in protobuf wire
644
+ * format), writing to the given BinaryWriter.
645
+ * @param {!proto.game.File} message
646
+ * @param {!jspb.BinaryWriter} writer
647
+ * @suppress {unusedLocalVariables} f is only used for nested messages
648
+ */
649
+ proto.game.File.serializeBinaryToWriter = function(message, writer) {
650
+ var f = undefined;
651
+ f = message.getMedia_asU8();
652
+ if (f.length > 0) {
653
+ writer.writeBytes(
654
+ 1,
655
+ f
656
+ );
657
+ }
658
+ };
659
+
660
+
661
+ /**
662
+ * optional bytes media = 1;
663
+ * @return {!(string|Uint8Array)}
664
+ */
665
+ proto.game.File.prototype.getMedia = function() {
666
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
667
+ };
668
+
669
+
670
+ /**
671
+ * optional bytes media = 1;
672
+ * This is a type-conversion wrapper around `getMedia()`
673
+ * @return {string}
674
+ */
675
+ proto.game.File.prototype.getMedia_asB64 = function() {
676
+ return /** @type {string} */ (jspb.Message.bytesAsB64(
677
+ this.getMedia()));
678
+ };
679
+
680
+
681
+ /**
682
+ * optional bytes media = 1;
683
+ * Note that Uint8Array is not supported on all browsers.
684
+ * @see http://caniuse.com/Uint8Array
685
+ * This is a type-conversion wrapper around `getMedia()`
686
+ * @return {!Uint8Array}
687
+ */
688
+ proto.game.File.prototype.getMedia_asU8 = function() {
689
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
690
+ this.getMedia()));
691
+ };
692
+
693
+
694
+ /**
695
+ * @param {!(string|Uint8Array)} value
696
+ * @return {!proto.game.File} returns this
697
+ */
698
+ proto.game.File.prototype.setMedia = function(value) {
699
+ return jspb.Message.setProto3BytesField(this, 1, value);
700
+ };
701
+
702
+
703
+
704
+
705
+
706
+ if (jspb.Message.GENERATE_TO_OBJECT) {
707
+ /**
708
+ * Creates an object representation of this proto.
709
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
710
+ * Optional fields that are not set will be set to undefined.
711
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
712
+ * For the list of reserved names please see:
713
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
714
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
715
+ * JSPB instance for transitional soy proto support:
716
+ * http://goto/soy-param-migration
717
+ * @return {!Object}
718
+ */
719
+ proto.game.GetFileRequest.prototype.toObject = function(opt_includeInstance) {
720
+ return proto.game.GetFileRequest.toObject(opt_includeInstance, this);
721
+ };
722
+
723
+
724
+ /**
725
+ * Static version of the {@see toObject} method.
726
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
727
+ * the JSPB instance for transitional soy proto support:
728
+ * http://goto/soy-param-migration
729
+ * @param {!proto.game.GetFileRequest} msg The msg instance to transform.
730
+ * @return {!Object}
731
+ * @suppress {unusedLocalVariables} f is only used for nested messages
732
+ */
733
+ proto.game.GetFileRequest.toObject = function(includeInstance, msg) {
734
+ var f, obj = {
735
+ filePath: jspb.Message.getFieldWithDefault(msg, 1, "")
736
+ };
737
+
738
+ if (includeInstance) {
739
+ obj.$jspbMessageInstance = msg;
740
+ }
741
+ return obj;
742
+ };
743
+ }
744
+
745
+
746
+ /**
747
+ * Deserializes binary data (in protobuf wire format).
748
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
749
+ * @return {!proto.game.GetFileRequest}
750
+ */
751
+ proto.game.GetFileRequest.deserializeBinary = function(bytes) {
752
+ var reader = new jspb.BinaryReader(bytes);
753
+ var msg = new proto.game.GetFileRequest;
754
+ return proto.game.GetFileRequest.deserializeBinaryFromReader(msg, reader);
755
+ };
756
+
757
+
758
+ /**
759
+ * Deserializes binary data (in protobuf wire format) from the
760
+ * given reader into the given message object.
761
+ * @param {!proto.game.GetFileRequest} msg The message object to deserialize into.
762
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
763
+ * @return {!proto.game.GetFileRequest}
764
+ */
765
+ proto.game.GetFileRequest.deserializeBinaryFromReader = function(msg, reader) {
766
+ while (reader.nextField()) {
767
+ if (reader.isEndGroup()) {
768
+ break;
769
+ }
770
+ var field = reader.getFieldNumber();
771
+ switch (field) {
772
+ case 1:
773
+ var value = /** @type {string} */ (reader.readString());
774
+ msg.setFilePath(value);
775
+ break;
776
+ default:
777
+ reader.skipField();
778
+ break;
779
+ }
780
+ }
781
+ return msg;
782
+ };
783
+
784
+
785
+ /**
786
+ * Serializes the message to binary data (in protobuf wire format).
787
+ * @return {!Uint8Array}
788
+ */
789
+ proto.game.GetFileRequest.prototype.serializeBinary = function() {
790
+ var writer = new jspb.BinaryWriter();
791
+ proto.game.GetFileRequest.serializeBinaryToWriter(this, writer);
792
+ return writer.getResultBuffer();
793
+ };
794
+
795
+
796
+ /**
797
+ * Serializes the given message to binary data (in protobuf wire
798
+ * format), writing to the given BinaryWriter.
799
+ * @param {!proto.game.GetFileRequest} message
800
+ * @param {!jspb.BinaryWriter} writer
801
+ * @suppress {unusedLocalVariables} f is only used for nested messages
802
+ */
803
+ proto.game.GetFileRequest.serializeBinaryToWriter = function(message, writer) {
804
+ var f = undefined;
805
+ f = message.getFilePath();
806
+ if (f.length > 0) {
807
+ writer.writeString(
808
+ 1,
809
+ f
810
+ );
811
+ }
812
+ };
813
+
814
+
815
+ /**
816
+ * optional string file_path = 1;
817
+ * @return {string}
818
+ */
819
+ proto.game.GetFileRequest.prototype.getFilePath = function() {
820
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
821
+ };
822
+
823
+
824
+ /**
825
+ * @param {string} value
826
+ * @return {!proto.game.GetFileRequest} returns this
827
+ */
828
+ proto.game.GetFileRequest.prototype.setFilePath = function(value) {
829
+ return jspb.Message.setProto3StringField(this, 1, value);
830
+ };
831
+
832
+
833
+
834
+
835
+
529
836
  if (jspb.Message.GENERATE_TO_OBJECT) {
530
837
  /**
531
838
  * Creates an object representation of this proto.
@@ -912,6 +1219,32 @@ proto.game.CategoryItem.prototype.hasImagePath = function() {
912
1219
 
913
1220
 
914
1221
 
1222
+ /**
1223
+ * Oneof group definitions for this message. Each group defines the field
1224
+ * numbers belonging to that group. When of these fields' value is set, all
1225
+ * other fields in the group are cleared. During deserialization, if multiple
1226
+ * fields are encountered for a group, only the last value seen will be kept.
1227
+ * @private {!Array<!Array<number>>}
1228
+ * @const
1229
+ */
1230
+ proto.game.CategoryRequest.oneofGroups_ = [[1,2]];
1231
+
1232
+ /**
1233
+ * @enum {number}
1234
+ */
1235
+ proto.game.CategoryRequest.RequestCase = {
1236
+ REQUEST_NOT_SET: 0,
1237
+ CATEGORY_DATA: 1,
1238
+ FILE: 2
1239
+ };
1240
+
1241
+ /**
1242
+ * @return {proto.game.CategoryRequest.RequestCase}
1243
+ */
1244
+ proto.game.CategoryRequest.prototype.getRequestCase = function() {
1245
+ return /** @type {proto.game.CategoryRequest.RequestCase} */(jspb.Message.computeOneofCase(this, proto.game.CategoryRequest.oneofGroups_[0]));
1246
+ };
1247
+
915
1248
 
916
1249
 
917
1250
  if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -944,7 +1277,7 @@ proto.game.CategoryRequest.prototype.toObject = function(opt_includeInstance) {
944
1277
  proto.game.CategoryRequest.toObject = function(includeInstance, msg) {
945
1278
  var f, obj = {
946
1279
  categoryData: (f = msg.getCategoryData()) && proto.game.CategoryItemRequest.toObject(includeInstance, f),
947
- media: msg.getMedia_asB64()
1280
+ file: (f = msg.getFile()) && proto.game.File.toObject(includeInstance, f)
948
1281
  };
949
1282
 
950
1283
  if (includeInstance) {
@@ -987,8 +1320,9 @@ proto.game.CategoryRequest.deserializeBinaryFromReader = function(msg, reader) {
987
1320
  msg.setCategoryData(value);
988
1321
  break;
989
1322
  case 2:
990
- var value = /** @type {!Uint8Array} */ (reader.readBytes());
991
- msg.setMedia(value);
1323
+ var value = new proto.game.File;
1324
+ reader.readMessage(value,proto.game.File.deserializeBinaryFromReader);
1325
+ msg.setFile(value);
992
1326
  break;
993
1327
  default:
994
1328
  reader.skipField();
@@ -1027,11 +1361,12 @@ proto.game.CategoryRequest.serializeBinaryToWriter = function(message, writer) {
1027
1361
  proto.game.CategoryItemRequest.serializeBinaryToWriter
1028
1362
  );
1029
1363
  }
1030
- f = message.getMedia_asU8();
1031
- if (f.length > 0) {
1032
- writer.writeBytes(
1364
+ f = message.getFile();
1365
+ if (f != null) {
1366
+ writer.writeMessage(
1033
1367
  2,
1034
- f
1368
+ f,
1369
+ proto.game.File.serializeBinaryToWriter
1035
1370
  );
1036
1371
  }
1037
1372
  };
@@ -1052,7 +1387,7 @@ proto.game.CategoryRequest.prototype.getCategoryData = function() {
1052
1387
  * @return {!proto.game.CategoryRequest} returns this
1053
1388
  */
1054
1389
  proto.game.CategoryRequest.prototype.setCategoryData = function(value) {
1055
- return jspb.Message.setWrapperField(this, 1, value);
1390
+ return jspb.Message.setOneofWrapperField(this, 1, proto.game.CategoryRequest.oneofGroups_[0], value);
1056
1391
  };
1057
1392
 
1058
1393
 
@@ -1075,198 +1410,39 @@ proto.game.CategoryRequest.prototype.hasCategoryData = function() {
1075
1410
 
1076
1411
 
1077
1412
  /**
1078
- * optional bytes media = 2;
1079
- * @return {!(string|Uint8Array)}
1413
+ * optional File file = 2;
1414
+ * @return {?proto.game.File}
1080
1415
  */
1081
- proto.game.CategoryRequest.prototype.getMedia = function() {
1082
- return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1416
+ proto.game.CategoryRequest.prototype.getFile = function() {
1417
+ return /** @type{?proto.game.File} */ (
1418
+ jspb.Message.getWrapperField(this, proto.game.File, 2));
1083
1419
  };
1084
1420
 
1085
1421
 
1086
1422
  /**
1087
- * optional bytes media = 2;
1088
- * This is a type-conversion wrapper around `getMedia()`
1089
- * @return {string}
1090
- */
1091
- proto.game.CategoryRequest.prototype.getMedia_asB64 = function() {
1092
- return /** @type {string} */ (jspb.Message.bytesAsB64(
1093
- this.getMedia()));
1094
- };
1095
-
1096
-
1097
- /**
1098
- * optional bytes media = 2;
1099
- * Note that Uint8Array is not supported on all browsers.
1100
- * @see http://caniuse.com/Uint8Array
1101
- * This is a type-conversion wrapper around `getMedia()`
1102
- * @return {!Uint8Array}
1103
- */
1104
- proto.game.CategoryRequest.prototype.getMedia_asU8 = function() {
1105
- return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1106
- this.getMedia()));
1107
- };
1108
-
1109
-
1110
- /**
1111
- * @param {!(string|Uint8Array)} value
1423
+ * @param {?proto.game.File|undefined} value
1112
1424
  * @return {!proto.game.CategoryRequest} returns this
1113
- */
1114
- proto.game.CategoryRequest.prototype.setMedia = function(value) {
1115
- return jspb.Message.setProto3BytesField(this, 2, value);
1116
- };
1117
-
1118
-
1119
-
1120
-
1121
-
1122
- if (jspb.Message.GENERATE_TO_OBJECT) {
1123
- /**
1124
- * Creates an object representation of this proto.
1125
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
1126
- * Optional fields that are not set will be set to undefined.
1127
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1128
- * For the list of reserved names please see:
1129
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1130
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1131
- * JSPB instance for transitional soy proto support:
1132
- * http://goto/soy-param-migration
1133
- * @return {!Object}
1134
- */
1135
- proto.game.File.prototype.toObject = function(opt_includeInstance) {
1136
- return proto.game.File.toObject(opt_includeInstance, this);
1137
- };
1138
-
1139
-
1140
- /**
1141
- * Static version of the {@see toObject} method.
1142
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1143
- * the JSPB instance for transitional soy proto support:
1144
- * http://goto/soy-param-migration
1145
- * @param {!proto.game.File} msg The msg instance to transform.
1146
- * @return {!Object}
1147
- * @suppress {unusedLocalVariables} f is only used for nested messages
1148
- */
1149
- proto.game.File.toObject = function(includeInstance, msg) {
1150
- var f, obj = {
1151
- media: msg.getMedia_asB64()
1152
- };
1153
-
1154
- if (includeInstance) {
1155
- obj.$jspbMessageInstance = msg;
1156
- }
1157
- return obj;
1158
- };
1159
- }
1160
-
1161
-
1162
- /**
1163
- * Deserializes binary data (in protobuf wire format).
1164
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
1165
- * @return {!proto.game.File}
1166
- */
1167
- proto.game.File.deserializeBinary = function(bytes) {
1168
- var reader = new jspb.BinaryReader(bytes);
1169
- var msg = new proto.game.File;
1170
- return proto.game.File.deserializeBinaryFromReader(msg, reader);
1171
- };
1172
-
1173
-
1174
- /**
1175
- * Deserializes binary data (in protobuf wire format) from the
1176
- * given reader into the given message object.
1177
- * @param {!proto.game.File} msg The message object to deserialize into.
1178
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1179
- * @return {!proto.game.File}
1180
- */
1181
- proto.game.File.deserializeBinaryFromReader = function(msg, reader) {
1182
- while (reader.nextField()) {
1183
- if (reader.isEndGroup()) {
1184
- break;
1185
- }
1186
- var field = reader.getFieldNumber();
1187
- switch (field) {
1188
- case 1:
1189
- var value = /** @type {!Uint8Array} */ (reader.readBytes());
1190
- msg.setMedia(value);
1191
- break;
1192
- default:
1193
- reader.skipField();
1194
- break;
1195
- }
1196
- }
1197
- return msg;
1198
- };
1199
-
1200
-
1201
- /**
1202
- * Serializes the message to binary data (in protobuf wire format).
1203
- * @return {!Uint8Array}
1204
- */
1205
- proto.game.File.prototype.serializeBinary = function() {
1206
- var writer = new jspb.BinaryWriter();
1207
- proto.game.File.serializeBinaryToWriter(this, writer);
1208
- return writer.getResultBuffer();
1209
- };
1210
-
1211
-
1212
- /**
1213
- * Serializes the given message to binary data (in protobuf wire
1214
- * format), writing to the given BinaryWriter.
1215
- * @param {!proto.game.File} message
1216
- * @param {!jspb.BinaryWriter} writer
1217
- * @suppress {unusedLocalVariables} f is only used for nested messages
1218
- */
1219
- proto.game.File.serializeBinaryToWriter = function(message, writer) {
1220
- var f = undefined;
1221
- f = message.getMedia_asU8();
1222
- if (f.length > 0) {
1223
- writer.writeBytes(
1224
- 1,
1225
- f
1226
- );
1227
- }
1228
- };
1229
-
1230
-
1231
- /**
1232
- * optional bytes media = 1;
1233
- * @return {!(string|Uint8Array)}
1234
- */
1235
- proto.game.File.prototype.getMedia = function() {
1236
- return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1237
- };
1238
-
1239
-
1240
- /**
1241
- * optional bytes media = 1;
1242
- * This is a type-conversion wrapper around `getMedia()`
1243
- * @return {string}
1244
- */
1245
- proto.game.File.prototype.getMedia_asB64 = function() {
1246
- return /** @type {string} */ (jspb.Message.bytesAsB64(
1247
- this.getMedia()));
1425
+ */
1426
+ proto.game.CategoryRequest.prototype.setFile = function(value) {
1427
+ return jspb.Message.setOneofWrapperField(this, 2, proto.game.CategoryRequest.oneofGroups_[0], value);
1248
1428
  };
1249
1429
 
1250
1430
 
1251
1431
  /**
1252
- * optional bytes media = 1;
1253
- * Note that Uint8Array is not supported on all browsers.
1254
- * @see http://caniuse.com/Uint8Array
1255
- * This is a type-conversion wrapper around `getMedia()`
1256
- * @return {!Uint8Array}
1432
+ * Clears the message field making it undefined.
1433
+ * @return {!proto.game.CategoryRequest} returns this
1257
1434
  */
1258
- proto.game.File.prototype.getMedia_asU8 = function() {
1259
- return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1260
- this.getMedia()));
1435
+ proto.game.CategoryRequest.prototype.clearFile = function() {
1436
+ return this.setFile(undefined);
1261
1437
  };
1262
1438
 
1263
1439
 
1264
1440
  /**
1265
- * @param {!(string|Uint8Array)} value
1266
- * @return {!proto.game.File} returns this
1441
+ * Returns whether this field is set.
1442
+ * @return {boolean}
1267
1443
  */
1268
- proto.game.File.prototype.setMedia = function(value) {
1269
- return jspb.Message.setProto3BytesField(this, 1, value);
1444
+ proto.game.CategoryRequest.prototype.hasFile = function() {
1445
+ return jspb.Message.getField(this, 2) != null;
1270
1446
  };
1271
1447
 
1272
1448
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {