protobuf-platform 1.0.35 → 1.0.37

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,13 +26,14 @@ 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
- }
31
+ //File file = 2;
32
+ bytes media = 2;
33
+ //}
33
34
  }
34
35
  message File {
35
- bytes media = 2;
36
+ bytes media = 1;
36
37
  }
37
38
  message CategoryItemRequest {
38
39
  int32 id = 1;
package/game/game_pb.js CHANGED
@@ -25,7 +25,6 @@ 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);
29
28
  goog.exportSymbol('proto.game.CategoryResponse', null, global);
30
29
  goog.exportSymbol('proto.game.CategoryStatusResponse', null, global);
31
30
  goog.exportSymbol('proto.game.File', null, global);
@@ -107,7 +106,7 @@ if (goog.DEBUG && !COMPILED) {
107
106
  * @constructor
108
107
  */
109
108
  proto.game.CategoryRequest = function(opt_data) {
110
- jspb.Message.initialize(this, opt_data, 0, -1, null, proto.game.CategoryRequest.oneofGroups_);
109
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
111
110
  };
112
111
  goog.inherits(proto.game.CategoryRequest, jspb.Message);
113
112
  if (goog.DEBUG && !COMPILED) {
@@ -913,32 +912,6 @@ proto.game.CategoryItem.prototype.hasImagePath = function() {
913
912
 
914
913
 
915
914
 
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
-
942
915
 
943
916
 
944
917
  if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -971,7 +944,7 @@ proto.game.CategoryRequest.prototype.toObject = function(opt_includeInstance) {
971
944
  proto.game.CategoryRequest.toObject = function(includeInstance, msg) {
972
945
  var f, obj = {
973
946
  categoryData: (f = msg.getCategoryData()) && proto.game.CategoryItemRequest.toObject(includeInstance, f),
974
- file: (f = msg.getFile()) && proto.game.File.toObject(includeInstance, f)
947
+ media: msg.getMedia_asB64()
975
948
  };
976
949
 
977
950
  if (includeInstance) {
@@ -1014,9 +987,8 @@ proto.game.CategoryRequest.deserializeBinaryFromReader = function(msg, reader) {
1014
987
  msg.setCategoryData(value);
1015
988
  break;
1016
989
  case 2:
1017
- var value = new proto.game.File;
1018
- reader.readMessage(value,proto.game.File.deserializeBinaryFromReader);
1019
- msg.setFile(value);
990
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
991
+ msg.setMedia(value);
1020
992
  break;
1021
993
  default:
1022
994
  reader.skipField();
@@ -1055,12 +1027,11 @@ proto.game.CategoryRequest.serializeBinaryToWriter = function(message, writer) {
1055
1027
  proto.game.CategoryItemRequest.serializeBinaryToWriter
1056
1028
  );
1057
1029
  }
1058
- f = message.getFile();
1059
- if (f != null) {
1060
- writer.writeMessage(
1030
+ f = message.getMedia_asU8();
1031
+ if (f.length > 0) {
1032
+ writer.writeBytes(
1061
1033
  2,
1062
- f,
1063
- proto.game.File.serializeBinaryToWriter
1034
+ f
1064
1035
  );
1065
1036
  }
1066
1037
  };
@@ -1081,7 +1052,7 @@ proto.game.CategoryRequest.prototype.getCategoryData = function() {
1081
1052
  * @return {!proto.game.CategoryRequest} returns this
1082
1053
  */
1083
1054
  proto.game.CategoryRequest.prototype.setCategoryData = function(value) {
1084
- return jspb.Message.setOneofWrapperField(this, 1, proto.game.CategoryRequest.oneofGroups_[0], value);
1055
+ return jspb.Message.setWrapperField(this, 1, value);
1085
1056
  };
1086
1057
 
1087
1058
 
@@ -1104,39 +1075,44 @@ proto.game.CategoryRequest.prototype.hasCategoryData = function() {
1104
1075
 
1105
1076
 
1106
1077
  /**
1107
- * optional File file = 2;
1108
- * @return {?proto.game.File}
1078
+ * optional bytes media = 2;
1079
+ * @return {!(string|Uint8Array)}
1109
1080
  */
1110
- proto.game.CategoryRequest.prototype.getFile = function() {
1111
- return /** @type{?proto.game.File} */ (
1112
- jspb.Message.getWrapperField(this, proto.game.File, 2));
1081
+ proto.game.CategoryRequest.prototype.getMedia = function() {
1082
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1113
1083
  };
1114
1084
 
1115
1085
 
1116
1086
  /**
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);
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()));
1122
1094
  };
1123
1095
 
1124
1096
 
1125
1097
  /**
1126
- * Clears the message field making it undefined.
1127
- * @return {!proto.game.CategoryRequest} returns this
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}
1128
1103
  */
1129
- proto.game.CategoryRequest.prototype.clearFile = function() {
1130
- return this.setFile(undefined);
1104
+ proto.game.CategoryRequest.prototype.getMedia_asU8 = function() {
1105
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1106
+ this.getMedia()));
1131
1107
  };
1132
1108
 
1133
1109
 
1134
1110
  /**
1135
- * Returns whether this field is set.
1136
- * @return {boolean}
1111
+ * @param {!(string|Uint8Array)} value
1112
+ * @return {!proto.game.CategoryRequest} returns this
1137
1113
  */
1138
- proto.game.CategoryRequest.prototype.hasFile = function() {
1139
- return jspb.Message.getField(this, 2) != null;
1114
+ proto.game.CategoryRequest.prototype.setMedia = function(value) {
1115
+ return jspb.Message.setProto3BytesField(this, 2, value);
1140
1116
  };
1141
1117
 
1142
1118
 
@@ -1209,7 +1185,7 @@ proto.game.File.deserializeBinaryFromReader = function(msg, reader) {
1209
1185
  }
1210
1186
  var field = reader.getFieldNumber();
1211
1187
  switch (field) {
1212
- case 2:
1188
+ case 1:
1213
1189
  var value = /** @type {!Uint8Array} */ (reader.readBytes());
1214
1190
  msg.setMedia(value);
1215
1191
  break;
@@ -1245,7 +1221,7 @@ proto.game.File.serializeBinaryToWriter = function(message, writer) {
1245
1221
  f = message.getMedia_asU8();
1246
1222
  if (f.length > 0) {
1247
1223
  writer.writeBytes(
1248
- 2,
1224
+ 1,
1249
1225
  f
1250
1226
  );
1251
1227
  }
@@ -1253,16 +1229,16 @@ proto.game.File.serializeBinaryToWriter = function(message, writer) {
1253
1229
 
1254
1230
 
1255
1231
  /**
1256
- * optional bytes media = 2;
1232
+ * optional bytes media = 1;
1257
1233
  * @return {!(string|Uint8Array)}
1258
1234
  */
1259
1235
  proto.game.File.prototype.getMedia = function() {
1260
- return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1236
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1261
1237
  };
1262
1238
 
1263
1239
 
1264
1240
  /**
1265
- * optional bytes media = 2;
1241
+ * optional bytes media = 1;
1266
1242
  * This is a type-conversion wrapper around `getMedia()`
1267
1243
  * @return {string}
1268
1244
  */
@@ -1273,7 +1249,7 @@ proto.game.File.prototype.getMedia_asB64 = function() {
1273
1249
 
1274
1250
 
1275
1251
  /**
1276
- * optional bytes media = 2;
1252
+ * optional bytes media = 1;
1277
1253
  * Note that Uint8Array is not supported on all browsers.
1278
1254
  * @see http://caniuse.com/Uint8Array
1279
1255
  * This is a type-conversion wrapper around `getMedia()`
@@ -1290,7 +1266,7 @@ proto.game.File.prototype.getMedia_asU8 = function() {
1290
1266
  * @return {!proto.game.File} returns this
1291
1267
  */
1292
1268
  proto.game.File.prototype.setMedia = function(value) {
1293
- return jspb.Message.setProto3BytesField(this, 2, value);
1269
+ return jspb.Message.setProto3BytesField(this, 1, value);
1294
1270
  };
1295
1271
 
1296
1272
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {