protobuf-platform 1.0.37 → 1.0.38

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
@@ -26,11 +26,10 @@ message CategoryItem {
26
26
  }
27
27
  //Category CRUD | Requests
28
28
  message CategoryRequest {
29
- //oneof request {
29
+ oneof request {
30
30
  CategoryItemRequest category_data = 1;
31
- //File file = 2;
32
- bytes media = 2;
33
- //}
31
+ File file = 2;
32
+ }
34
33
  }
35
34
  message File {
36
35
  bytes media = 1;
package/game/game_pb.js CHANGED
@@ -25,6 +25,7 @@ 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);
@@ -106,7 +107,7 @@ if (goog.DEBUG && !COMPILED) {
106
107
  * @constructor
107
108
  */
108
109
  proto.game.CategoryRequest = function(opt_data) {
109
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
110
+ jspb.Message.initialize(this, opt_data, 0, -1, null, proto.game.CategoryRequest.oneofGroups_);
110
111
  };
111
112
  goog.inherits(proto.game.CategoryRequest, jspb.Message);
112
113
  if (goog.DEBUG && !COMPILED) {
@@ -912,6 +913,32 @@ proto.game.CategoryItem.prototype.hasImagePath = function() {
912
913
 
913
914
 
914
915
 
916
+ /**
917
+ * Oneof group definitions for this message. Each group defines the field
918
+ * numbers belonging to that group. When of these fields' value is set, all
919
+ * other fields in the group are cleared. During deserialization, if multiple
920
+ * fields are encountered for a group, only the last value seen will be kept.
921
+ * @private {!Array<!Array<number>>}
922
+ * @const
923
+ */
924
+ proto.game.CategoryRequest.oneofGroups_ = [[1,2]];
925
+
926
+ /**
927
+ * @enum {number}
928
+ */
929
+ proto.game.CategoryRequest.RequestCase = {
930
+ REQUEST_NOT_SET: 0,
931
+ CATEGORY_DATA: 1,
932
+ FILE: 2
933
+ };
934
+
935
+ /**
936
+ * @return {proto.game.CategoryRequest.RequestCase}
937
+ */
938
+ proto.game.CategoryRequest.prototype.getRequestCase = function() {
939
+ return /** @type {proto.game.CategoryRequest.RequestCase} */(jspb.Message.computeOneofCase(this, proto.game.CategoryRequest.oneofGroups_[0]));
940
+ };
941
+
915
942
 
916
943
 
917
944
  if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -944,7 +971,7 @@ proto.game.CategoryRequest.prototype.toObject = function(opt_includeInstance) {
944
971
  proto.game.CategoryRequest.toObject = function(includeInstance, msg) {
945
972
  var f, obj = {
946
973
  categoryData: (f = msg.getCategoryData()) && proto.game.CategoryItemRequest.toObject(includeInstance, f),
947
- media: msg.getMedia_asB64()
974
+ file: (f = msg.getFile()) && proto.game.File.toObject(includeInstance, f)
948
975
  };
949
976
 
950
977
  if (includeInstance) {
@@ -987,8 +1014,9 @@ proto.game.CategoryRequest.deserializeBinaryFromReader = function(msg, reader) {
987
1014
  msg.setCategoryData(value);
988
1015
  break;
989
1016
  case 2:
990
- var value = /** @type {!Uint8Array} */ (reader.readBytes());
991
- msg.setMedia(value);
1017
+ var value = new proto.game.File;
1018
+ reader.readMessage(value,proto.game.File.deserializeBinaryFromReader);
1019
+ msg.setFile(value);
992
1020
  break;
993
1021
  default:
994
1022
  reader.skipField();
@@ -1027,11 +1055,12 @@ proto.game.CategoryRequest.serializeBinaryToWriter = function(message, writer) {
1027
1055
  proto.game.CategoryItemRequest.serializeBinaryToWriter
1028
1056
  );
1029
1057
  }
1030
- f = message.getMedia_asU8();
1031
- if (f.length > 0) {
1032
- writer.writeBytes(
1058
+ f = message.getFile();
1059
+ if (f != null) {
1060
+ writer.writeMessage(
1033
1061
  2,
1034
- f
1062
+ f,
1063
+ proto.game.File.serializeBinaryToWriter
1035
1064
  );
1036
1065
  }
1037
1066
  };
@@ -1052,7 +1081,7 @@ proto.game.CategoryRequest.prototype.getCategoryData = function() {
1052
1081
  * @return {!proto.game.CategoryRequest} returns this
1053
1082
  */
1054
1083
  proto.game.CategoryRequest.prototype.setCategoryData = function(value) {
1055
- return jspb.Message.setWrapperField(this, 1, value);
1084
+ return jspb.Message.setOneofWrapperField(this, 1, proto.game.CategoryRequest.oneofGroups_[0], value);
1056
1085
  };
1057
1086
 
1058
1087
 
@@ -1075,44 +1104,39 @@ proto.game.CategoryRequest.prototype.hasCategoryData = function() {
1075
1104
 
1076
1105
 
1077
1106
  /**
1078
- * optional bytes media = 2;
1079
- * @return {!(string|Uint8Array)}
1107
+ * optional File file = 2;
1108
+ * @return {?proto.game.File}
1080
1109
  */
1081
- proto.game.CategoryRequest.prototype.getMedia = function() {
1082
- return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1110
+ proto.game.CategoryRequest.prototype.getFile = function() {
1111
+ return /** @type{?proto.game.File} */ (
1112
+ jspb.Message.getWrapperField(this, proto.game.File, 2));
1083
1113
  };
1084
1114
 
1085
1115
 
1086
1116
  /**
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()));
1117
+ * @param {?proto.game.File|undefined} value
1118
+ * @return {!proto.game.CategoryRequest} returns this
1119
+ */
1120
+ proto.game.CategoryRequest.prototype.setFile = function(value) {
1121
+ return jspb.Message.setOneofWrapperField(this, 2, proto.game.CategoryRequest.oneofGroups_[0], value);
1094
1122
  };
1095
1123
 
1096
1124
 
1097
1125
  /**
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}
1126
+ * Clears the message field making it undefined.
1127
+ * @return {!proto.game.CategoryRequest} returns this
1103
1128
  */
1104
- proto.game.CategoryRequest.prototype.getMedia_asU8 = function() {
1105
- return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1106
- this.getMedia()));
1129
+ proto.game.CategoryRequest.prototype.clearFile = function() {
1130
+ return this.setFile(undefined);
1107
1131
  };
1108
1132
 
1109
1133
 
1110
1134
  /**
1111
- * @param {!(string|Uint8Array)} value
1112
- * @return {!proto.game.CategoryRequest} returns this
1135
+ * Returns whether this field is set.
1136
+ * @return {boolean}
1113
1137
  */
1114
- proto.game.CategoryRequest.prototype.setMedia = function(value) {
1115
- return jspb.Message.setProto3BytesField(this, 2, value);
1138
+ proto.game.CategoryRequest.prototype.hasFile = function() {
1139
+ return jspb.Message.getField(this, 2) != null;
1116
1140
  };
1117
1141
 
1118
1142
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {