protobuf-platform 1.0.34 → 1.0.36

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,10 +26,13 @@ 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
- bytes media = 2;
32
- }
31
+ File file = 2;
32
+ //}
33
+ }
34
+ message File {
35
+ bytes media = 2;
33
36
  }
34
37
  message CategoryItemRequest {
35
38
  int32 id = 1;
package/game/game_pb.js CHANGED
@@ -25,9 +25,9 @@ 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);
30
+ goog.exportSymbol('proto.game.File', null, global);
31
31
  goog.exportSymbol('proto.game.GetCategoryRequest', null, global);
32
32
  goog.exportSymbol('proto.game.GetListCategoryRequest', null, global);
33
33
  goog.exportSymbol('proto.game.PingRequest', null, global);
@@ -106,7 +106,7 @@ if (goog.DEBUG && !COMPILED) {
106
106
  * @constructor
107
107
  */
108
108
  proto.game.CategoryRequest = function(opt_data) {
109
- jspb.Message.initialize(this, opt_data, 0, -1, null, proto.game.CategoryRequest.oneofGroups_);
109
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
110
110
  };
111
111
  goog.inherits(proto.game.CategoryRequest, jspb.Message);
112
112
  if (goog.DEBUG && !COMPILED) {
@@ -116,6 +116,27 @@ if (goog.DEBUG && !COMPILED) {
116
116
  */
117
117
  proto.game.CategoryRequest.displayName = 'proto.game.CategoryRequest';
118
118
  }
119
+ /**
120
+ * Generated by JsPbCodeGenerator.
121
+ * @param {Array=} opt_data Optional initial data array, typically from a
122
+ * server response, or constructed directly in Javascript. The array is used
123
+ * in place and becomes part of the constructed object. It is not cloned.
124
+ * If no data is provided, the constructed object will be empty, but still
125
+ * valid.
126
+ * @extends {jspb.Message}
127
+ * @constructor
128
+ */
129
+ proto.game.File = function(opt_data) {
130
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
131
+ };
132
+ goog.inherits(proto.game.File, jspb.Message);
133
+ if (goog.DEBUG && !COMPILED) {
134
+ /**
135
+ * @public
136
+ * @override
137
+ */
138
+ proto.game.File.displayName = 'proto.game.File';
139
+ }
119
140
  /**
120
141
  * Generated by JsPbCodeGenerator.
121
142
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -891,32 +912,6 @@ proto.game.CategoryItem.prototype.hasImagePath = function() {
891
912
 
892
913
 
893
914
 
894
- /**
895
- * Oneof group definitions for this message. Each group defines the field
896
- * numbers belonging to that group. When of these fields' value is set, all
897
- * other fields in the group are cleared. During deserialization, if multiple
898
- * fields are encountered for a group, only the last value seen will be kept.
899
- * @private {!Array<!Array<number>>}
900
- * @const
901
- */
902
- proto.game.CategoryRequest.oneofGroups_ = [[1,2]];
903
-
904
- /**
905
- * @enum {number}
906
- */
907
- proto.game.CategoryRequest.RequestCase = {
908
- REQUEST_NOT_SET: 0,
909
- CATEGORY_DATA: 1,
910
- MEDIA: 2
911
- };
912
-
913
- /**
914
- * @return {proto.game.CategoryRequest.RequestCase}
915
- */
916
- proto.game.CategoryRequest.prototype.getRequestCase = function() {
917
- return /** @type {proto.game.CategoryRequest.RequestCase} */(jspb.Message.computeOneofCase(this, proto.game.CategoryRequest.oneofGroups_[0]));
918
- };
919
-
920
915
 
921
916
 
922
917
  if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -949,7 +944,7 @@ proto.game.CategoryRequest.prototype.toObject = function(opt_includeInstance) {
949
944
  proto.game.CategoryRequest.toObject = function(includeInstance, msg) {
950
945
  var f, obj = {
951
946
  categoryData: (f = msg.getCategoryData()) && proto.game.CategoryItemRequest.toObject(includeInstance, f),
952
- media: msg.getMedia_asB64()
947
+ file: (f = msg.getFile()) && proto.game.File.toObject(includeInstance, f)
953
948
  };
954
949
 
955
950
  if (includeInstance) {
@@ -992,8 +987,9 @@ proto.game.CategoryRequest.deserializeBinaryFromReader = function(msg, reader) {
992
987
  msg.setCategoryData(value);
993
988
  break;
994
989
  case 2:
995
- var value = /** @type {!Uint8Array} */ (reader.readBytes());
996
- msg.setMedia(value);
990
+ var value = new proto.game.File;
991
+ reader.readMessage(value,proto.game.File.deserializeBinaryFromReader);
992
+ msg.setFile(value);
997
993
  break;
998
994
  default:
999
995
  reader.skipField();
@@ -1032,11 +1028,12 @@ proto.game.CategoryRequest.serializeBinaryToWriter = function(message, writer) {
1032
1028
  proto.game.CategoryItemRequest.serializeBinaryToWriter
1033
1029
  );
1034
1030
  }
1035
- f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2));
1031
+ f = message.getFile();
1036
1032
  if (f != null) {
1037
- writer.writeBytes(
1033
+ writer.writeMessage(
1038
1034
  2,
1039
- f
1035
+ f,
1036
+ proto.game.File.serializeBinaryToWriter
1040
1037
  );
1041
1038
  }
1042
1039
  };
@@ -1057,7 +1054,7 @@ proto.game.CategoryRequest.prototype.getCategoryData = function() {
1057
1054
  * @return {!proto.game.CategoryRequest} returns this
1058
1055
  */
1059
1056
  proto.game.CategoryRequest.prototype.setCategoryData = function(value) {
1060
- return jspb.Message.setOneofWrapperField(this, 1, proto.game.CategoryRequest.oneofGroups_[0], value);
1057
+ return jspb.Message.setWrapperField(this, 1, value);
1061
1058
  };
1062
1059
 
1063
1060
 
@@ -1079,11 +1076,160 @@ proto.game.CategoryRequest.prototype.hasCategoryData = function() {
1079
1076
  };
1080
1077
 
1081
1078
 
1079
+ /**
1080
+ * optional File file = 2;
1081
+ * @return {?proto.game.File}
1082
+ */
1083
+ proto.game.CategoryRequest.prototype.getFile = function() {
1084
+ return /** @type{?proto.game.File} */ (
1085
+ jspb.Message.getWrapperField(this, proto.game.File, 2));
1086
+ };
1087
+
1088
+
1089
+ /**
1090
+ * @param {?proto.game.File|undefined} value
1091
+ * @return {!proto.game.CategoryRequest} returns this
1092
+ */
1093
+ proto.game.CategoryRequest.prototype.setFile = function(value) {
1094
+ return jspb.Message.setWrapperField(this, 2, value);
1095
+ };
1096
+
1097
+
1098
+ /**
1099
+ * Clears the message field making it undefined.
1100
+ * @return {!proto.game.CategoryRequest} returns this
1101
+ */
1102
+ proto.game.CategoryRequest.prototype.clearFile = function() {
1103
+ return this.setFile(undefined);
1104
+ };
1105
+
1106
+
1107
+ /**
1108
+ * Returns whether this field is set.
1109
+ * @return {boolean}
1110
+ */
1111
+ proto.game.CategoryRequest.prototype.hasFile = function() {
1112
+ return jspb.Message.getField(this, 2) != null;
1113
+ };
1114
+
1115
+
1116
+
1117
+
1118
+
1119
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1120
+ /**
1121
+ * Creates an object representation of this proto.
1122
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1123
+ * Optional fields that are not set will be set to undefined.
1124
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1125
+ * For the list of reserved names please see:
1126
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1127
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1128
+ * JSPB instance for transitional soy proto support:
1129
+ * http://goto/soy-param-migration
1130
+ * @return {!Object}
1131
+ */
1132
+ proto.game.File.prototype.toObject = function(opt_includeInstance) {
1133
+ return proto.game.File.toObject(opt_includeInstance, this);
1134
+ };
1135
+
1136
+
1137
+ /**
1138
+ * Static version of the {@see toObject} method.
1139
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1140
+ * the JSPB instance for transitional soy proto support:
1141
+ * http://goto/soy-param-migration
1142
+ * @param {!proto.game.File} msg The msg instance to transform.
1143
+ * @return {!Object}
1144
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1145
+ */
1146
+ proto.game.File.toObject = function(includeInstance, msg) {
1147
+ var f, obj = {
1148
+ media: msg.getMedia_asB64()
1149
+ };
1150
+
1151
+ if (includeInstance) {
1152
+ obj.$jspbMessageInstance = msg;
1153
+ }
1154
+ return obj;
1155
+ };
1156
+ }
1157
+
1158
+
1159
+ /**
1160
+ * Deserializes binary data (in protobuf wire format).
1161
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1162
+ * @return {!proto.game.File}
1163
+ */
1164
+ proto.game.File.deserializeBinary = function(bytes) {
1165
+ var reader = new jspb.BinaryReader(bytes);
1166
+ var msg = new proto.game.File;
1167
+ return proto.game.File.deserializeBinaryFromReader(msg, reader);
1168
+ };
1169
+
1170
+
1171
+ /**
1172
+ * Deserializes binary data (in protobuf wire format) from the
1173
+ * given reader into the given message object.
1174
+ * @param {!proto.game.File} msg The message object to deserialize into.
1175
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1176
+ * @return {!proto.game.File}
1177
+ */
1178
+ proto.game.File.deserializeBinaryFromReader = function(msg, reader) {
1179
+ while (reader.nextField()) {
1180
+ if (reader.isEndGroup()) {
1181
+ break;
1182
+ }
1183
+ var field = reader.getFieldNumber();
1184
+ switch (field) {
1185
+ case 2:
1186
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
1187
+ msg.setMedia(value);
1188
+ break;
1189
+ default:
1190
+ reader.skipField();
1191
+ break;
1192
+ }
1193
+ }
1194
+ return msg;
1195
+ };
1196
+
1197
+
1198
+ /**
1199
+ * Serializes the message to binary data (in protobuf wire format).
1200
+ * @return {!Uint8Array}
1201
+ */
1202
+ proto.game.File.prototype.serializeBinary = function() {
1203
+ var writer = new jspb.BinaryWriter();
1204
+ proto.game.File.serializeBinaryToWriter(this, writer);
1205
+ return writer.getResultBuffer();
1206
+ };
1207
+
1208
+
1209
+ /**
1210
+ * Serializes the given message to binary data (in protobuf wire
1211
+ * format), writing to the given BinaryWriter.
1212
+ * @param {!proto.game.File} message
1213
+ * @param {!jspb.BinaryWriter} writer
1214
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1215
+ */
1216
+ proto.game.File.serializeBinaryToWriter = function(message, writer) {
1217
+ var f = undefined;
1218
+ f = message.getMedia_asU8();
1219
+ if (f.length > 0) {
1220
+ writer.writeBytes(
1221
+ 2,
1222
+ f
1223
+ );
1224
+ }
1225
+ };
1226
+
1227
+
1082
1228
  /**
1083
1229
  * optional bytes media = 2;
1084
1230
  * @return {!(string|Uint8Array)}
1085
1231
  */
1086
- proto.game.CategoryRequest.prototype.getMedia = function() {
1232
+ proto.game.File.prototype.getMedia = function() {
1087
1233
  return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1088
1234
  };
1089
1235
 
@@ -1093,7 +1239,7 @@ proto.game.CategoryRequest.prototype.getMedia = function() {
1093
1239
  * This is a type-conversion wrapper around `getMedia()`
1094
1240
  * @return {string}
1095
1241
  */
1096
- proto.game.CategoryRequest.prototype.getMedia_asB64 = function() {
1242
+ proto.game.File.prototype.getMedia_asB64 = function() {
1097
1243
  return /** @type {string} */ (jspb.Message.bytesAsB64(
1098
1244
  this.getMedia()));
1099
1245
  };
@@ -1106,7 +1252,7 @@ proto.game.CategoryRequest.prototype.getMedia_asB64 = function() {
1106
1252
  * This is a type-conversion wrapper around `getMedia()`
1107
1253
  * @return {!Uint8Array}
1108
1254
  */
1109
- proto.game.CategoryRequest.prototype.getMedia_asU8 = function() {
1255
+ proto.game.File.prototype.getMedia_asU8 = function() {
1110
1256
  return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1111
1257
  this.getMedia()));
1112
1258
  };
@@ -1114,28 +1260,10 @@ proto.game.CategoryRequest.prototype.getMedia_asU8 = function() {
1114
1260
 
1115
1261
  /**
1116
1262
  * @param {!(string|Uint8Array)} value
1117
- * @return {!proto.game.CategoryRequest} returns this
1118
- */
1119
- proto.game.CategoryRequest.prototype.setMedia = function(value) {
1120
- return jspb.Message.setOneofField(this, 2, proto.game.CategoryRequest.oneofGroups_[0], value);
1121
- };
1122
-
1123
-
1124
- /**
1125
- * Clears the field making it undefined.
1126
- * @return {!proto.game.CategoryRequest} returns this
1263
+ * @return {!proto.game.File} returns this
1127
1264
  */
1128
- proto.game.CategoryRequest.prototype.clearMedia = function() {
1129
- return jspb.Message.setOneofField(this, 2, proto.game.CategoryRequest.oneofGroups_[0], undefined);
1130
- };
1131
-
1132
-
1133
- /**
1134
- * Returns whether this field is set.
1135
- * @return {boolean}
1136
- */
1137
- proto.game.CategoryRequest.prototype.hasMedia = function() {
1138
- return jspb.Message.getField(this, 2) != null;
1265
+ proto.game.File.prototype.setMedia = function(value) {
1266
+ return jspb.Message.setProto3BytesField(this, 2, value);
1139
1267
  };
1140
1268
 
1141
1269
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {