protobuf-platform 1.0.34 → 1.0.35

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
@@ -28,9 +28,12 @@ message CategoryItem {
28
28
  message CategoryRequest {
29
29
  oneof request {
30
30
  CategoryItemRequest category_data = 1;
31
- bytes media = 2;
31
+ File file = 2;
32
32
  }
33
33
  }
34
+ message File {
35
+ bytes media = 2;
36
+ }
34
37
  message CategoryItemRequest {
35
38
  int32 id = 1;
36
39
  optional string title = 2;
package/game/game_pb.js CHANGED
@@ -28,6 +28,7 @@ goog.exportSymbol('proto.game.CategoryRequest', null, global);
28
28
  goog.exportSymbol('proto.game.CategoryRequest.RequestCase', null, global);
29
29
  goog.exportSymbol('proto.game.CategoryResponse', null, global);
30
30
  goog.exportSymbol('proto.game.CategoryStatusResponse', null, global);
31
+ goog.exportSymbol('proto.game.File', null, global);
31
32
  goog.exportSymbol('proto.game.GetCategoryRequest', null, global);
32
33
  goog.exportSymbol('proto.game.GetListCategoryRequest', null, global);
33
34
  goog.exportSymbol('proto.game.PingRequest', null, global);
@@ -116,6 +117,27 @@ if (goog.DEBUG && !COMPILED) {
116
117
  */
117
118
  proto.game.CategoryRequest.displayName = 'proto.game.CategoryRequest';
118
119
  }
120
+ /**
121
+ * Generated by JsPbCodeGenerator.
122
+ * @param {Array=} opt_data Optional initial data array, typically from a
123
+ * server response, or constructed directly in Javascript. The array is used
124
+ * in place and becomes part of the constructed object. It is not cloned.
125
+ * If no data is provided, the constructed object will be empty, but still
126
+ * valid.
127
+ * @extends {jspb.Message}
128
+ * @constructor
129
+ */
130
+ proto.game.File = function(opt_data) {
131
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
132
+ };
133
+ goog.inherits(proto.game.File, jspb.Message);
134
+ if (goog.DEBUG && !COMPILED) {
135
+ /**
136
+ * @public
137
+ * @override
138
+ */
139
+ proto.game.File.displayName = 'proto.game.File';
140
+ }
119
141
  /**
120
142
  * Generated by JsPbCodeGenerator.
121
143
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -907,7 +929,7 @@ proto.game.CategoryRequest.oneofGroups_ = [[1,2]];
907
929
  proto.game.CategoryRequest.RequestCase = {
908
930
  REQUEST_NOT_SET: 0,
909
931
  CATEGORY_DATA: 1,
910
- MEDIA: 2
932
+ FILE: 2
911
933
  };
912
934
 
913
935
  /**
@@ -949,7 +971,7 @@ proto.game.CategoryRequest.prototype.toObject = function(opt_includeInstance) {
949
971
  proto.game.CategoryRequest.toObject = function(includeInstance, msg) {
950
972
  var f, obj = {
951
973
  categoryData: (f = msg.getCategoryData()) && proto.game.CategoryItemRequest.toObject(includeInstance, f),
952
- media: msg.getMedia_asB64()
974
+ file: (f = msg.getFile()) && proto.game.File.toObject(includeInstance, f)
953
975
  };
954
976
 
955
977
  if (includeInstance) {
@@ -992,8 +1014,9 @@ proto.game.CategoryRequest.deserializeBinaryFromReader = function(msg, reader) {
992
1014
  msg.setCategoryData(value);
993
1015
  break;
994
1016
  case 2:
995
- var value = /** @type {!Uint8Array} */ (reader.readBytes());
996
- msg.setMedia(value);
1017
+ var value = new proto.game.File;
1018
+ reader.readMessage(value,proto.game.File.deserializeBinaryFromReader);
1019
+ msg.setFile(value);
997
1020
  break;
998
1021
  default:
999
1022
  reader.skipField();
@@ -1032,11 +1055,12 @@ proto.game.CategoryRequest.serializeBinaryToWriter = function(message, writer) {
1032
1055
  proto.game.CategoryItemRequest.serializeBinaryToWriter
1033
1056
  );
1034
1057
  }
1035
- f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2));
1058
+ f = message.getFile();
1036
1059
  if (f != null) {
1037
- writer.writeBytes(
1060
+ writer.writeMessage(
1038
1061
  2,
1039
- f
1062
+ f,
1063
+ proto.game.File.serializeBinaryToWriter
1040
1064
  );
1041
1065
  }
1042
1066
  };
@@ -1079,11 +1103,160 @@ proto.game.CategoryRequest.prototype.hasCategoryData = function() {
1079
1103
  };
1080
1104
 
1081
1105
 
1106
+ /**
1107
+ * optional File file = 2;
1108
+ * @return {?proto.game.File}
1109
+ */
1110
+ proto.game.CategoryRequest.prototype.getFile = function() {
1111
+ return /** @type{?proto.game.File} */ (
1112
+ jspb.Message.getWrapperField(this, proto.game.File, 2));
1113
+ };
1114
+
1115
+
1116
+ /**
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);
1122
+ };
1123
+
1124
+
1125
+ /**
1126
+ * Clears the message field making it undefined.
1127
+ * @return {!proto.game.CategoryRequest} returns this
1128
+ */
1129
+ proto.game.CategoryRequest.prototype.clearFile = function() {
1130
+ return this.setFile(undefined);
1131
+ };
1132
+
1133
+
1134
+ /**
1135
+ * Returns whether this field is set.
1136
+ * @return {boolean}
1137
+ */
1138
+ proto.game.CategoryRequest.prototype.hasFile = function() {
1139
+ return jspb.Message.getField(this, 2) != null;
1140
+ };
1141
+
1142
+
1143
+
1144
+
1145
+
1146
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1147
+ /**
1148
+ * Creates an object representation of this proto.
1149
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1150
+ * Optional fields that are not set will be set to undefined.
1151
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1152
+ * For the list of reserved names please see:
1153
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1154
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1155
+ * JSPB instance for transitional soy proto support:
1156
+ * http://goto/soy-param-migration
1157
+ * @return {!Object}
1158
+ */
1159
+ proto.game.File.prototype.toObject = function(opt_includeInstance) {
1160
+ return proto.game.File.toObject(opt_includeInstance, this);
1161
+ };
1162
+
1163
+
1164
+ /**
1165
+ * Static version of the {@see toObject} method.
1166
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1167
+ * the JSPB instance for transitional soy proto support:
1168
+ * http://goto/soy-param-migration
1169
+ * @param {!proto.game.File} msg The msg instance to transform.
1170
+ * @return {!Object}
1171
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1172
+ */
1173
+ proto.game.File.toObject = function(includeInstance, msg) {
1174
+ var f, obj = {
1175
+ media: msg.getMedia_asB64()
1176
+ };
1177
+
1178
+ if (includeInstance) {
1179
+ obj.$jspbMessageInstance = msg;
1180
+ }
1181
+ return obj;
1182
+ };
1183
+ }
1184
+
1185
+
1186
+ /**
1187
+ * Deserializes binary data (in protobuf wire format).
1188
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1189
+ * @return {!proto.game.File}
1190
+ */
1191
+ proto.game.File.deserializeBinary = function(bytes) {
1192
+ var reader = new jspb.BinaryReader(bytes);
1193
+ var msg = new proto.game.File;
1194
+ return proto.game.File.deserializeBinaryFromReader(msg, reader);
1195
+ };
1196
+
1197
+
1198
+ /**
1199
+ * Deserializes binary data (in protobuf wire format) from the
1200
+ * given reader into the given message object.
1201
+ * @param {!proto.game.File} msg The message object to deserialize into.
1202
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1203
+ * @return {!proto.game.File}
1204
+ */
1205
+ proto.game.File.deserializeBinaryFromReader = function(msg, reader) {
1206
+ while (reader.nextField()) {
1207
+ if (reader.isEndGroup()) {
1208
+ break;
1209
+ }
1210
+ var field = reader.getFieldNumber();
1211
+ switch (field) {
1212
+ case 2:
1213
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
1214
+ msg.setMedia(value);
1215
+ break;
1216
+ default:
1217
+ reader.skipField();
1218
+ break;
1219
+ }
1220
+ }
1221
+ return msg;
1222
+ };
1223
+
1224
+
1225
+ /**
1226
+ * Serializes the message to binary data (in protobuf wire format).
1227
+ * @return {!Uint8Array}
1228
+ */
1229
+ proto.game.File.prototype.serializeBinary = function() {
1230
+ var writer = new jspb.BinaryWriter();
1231
+ proto.game.File.serializeBinaryToWriter(this, writer);
1232
+ return writer.getResultBuffer();
1233
+ };
1234
+
1235
+
1236
+ /**
1237
+ * Serializes the given message to binary data (in protobuf wire
1238
+ * format), writing to the given BinaryWriter.
1239
+ * @param {!proto.game.File} message
1240
+ * @param {!jspb.BinaryWriter} writer
1241
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1242
+ */
1243
+ proto.game.File.serializeBinaryToWriter = function(message, writer) {
1244
+ var f = undefined;
1245
+ f = message.getMedia_asU8();
1246
+ if (f.length > 0) {
1247
+ writer.writeBytes(
1248
+ 2,
1249
+ f
1250
+ );
1251
+ }
1252
+ };
1253
+
1254
+
1082
1255
  /**
1083
1256
  * optional bytes media = 2;
1084
1257
  * @return {!(string|Uint8Array)}
1085
1258
  */
1086
- proto.game.CategoryRequest.prototype.getMedia = function() {
1259
+ proto.game.File.prototype.getMedia = function() {
1087
1260
  return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1088
1261
  };
1089
1262
 
@@ -1093,7 +1266,7 @@ proto.game.CategoryRequest.prototype.getMedia = function() {
1093
1266
  * This is a type-conversion wrapper around `getMedia()`
1094
1267
  * @return {string}
1095
1268
  */
1096
- proto.game.CategoryRequest.prototype.getMedia_asB64 = function() {
1269
+ proto.game.File.prototype.getMedia_asB64 = function() {
1097
1270
  return /** @type {string} */ (jspb.Message.bytesAsB64(
1098
1271
  this.getMedia()));
1099
1272
  };
@@ -1106,7 +1279,7 @@ proto.game.CategoryRequest.prototype.getMedia_asB64 = function() {
1106
1279
  * This is a type-conversion wrapper around `getMedia()`
1107
1280
  * @return {!Uint8Array}
1108
1281
  */
1109
- proto.game.CategoryRequest.prototype.getMedia_asU8 = function() {
1282
+ proto.game.File.prototype.getMedia_asU8 = function() {
1110
1283
  return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
1111
1284
  this.getMedia()));
1112
1285
  };
@@ -1114,28 +1287,10 @@ proto.game.CategoryRequest.prototype.getMedia_asU8 = function() {
1114
1287
 
1115
1288
  /**
1116
1289
  * @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
1127
- */
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}
1290
+ * @return {!proto.game.File} returns this
1136
1291
  */
1137
- proto.game.CategoryRequest.prototype.hasMedia = function() {
1138
- return jspb.Message.getField(this, 2) != null;
1292
+ proto.game.File.prototype.setMedia = function(value) {
1293
+ return jspb.Message.setProto3BytesField(this, 2, value);
1139
1294
  };
1140
1295
 
1141
1296
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {