protobuf-platform 1.0.41 → 1.0.43

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,7 +4,7 @@ package game;
4
4
 
5
5
  service Game {
6
6
  rpc checkConnection(PingRequest) returns (PongResponse);
7
- rpc getMediaResource(GetFileRequest) returns (File);
7
+ rpc getMediaResource(GetFileRequest) returns (stream File);
8
8
  //Categories
9
9
  rpc createSingleCategory(CategoryRequest) returns (CategoryResponse);
10
10
  rpc readSingleCategory(GetCategoryRequest) returns (CategoryResponse);
@@ -16,12 +16,8 @@ service Game {
16
16
  message PingRequest { string ping = 1; }
17
17
  message PongResponse { string pong = 1; }
18
18
  //Media
19
- message File {
20
- bytes media = 1;
21
- }
22
- message GetFileRequest {
23
- string file_path = 1;
24
- }
19
+ message File { bytes media = 1; }
20
+ message GetFileRequest { string file_name = 1; string instance_type = 2; }
25
21
  //Category CRUD
26
22
  message CategoryItem {
27
23
  optional int32 id = 1;
@@ -29,7 +25,7 @@ message CategoryItem {
29
25
  optional string slug = 3;
30
26
  optional string description = 4;
31
27
  optional int32 is_active = 5;
32
- optional string image_path = 6;
28
+ optional string image = 6;
33
29
  }
34
30
  //Category CRUD | Requests
35
31
  message CategoryRequest {
@@ -130,7 +130,7 @@ var GameService = exports.GameService = {
130
130
  getMediaResource: {
131
131
  path: '/game.Game/getMediaResource',
132
132
  requestStream: false,
133
- responseStream: false,
133
+ responseStream: true,
134
134
  requestType: game_pb.GetFileRequest,
135
135
  responseType: game_pb.File,
136
136
  requestSerialize: serialize_game_GetFileRequest,
package/game/game_pb.js CHANGED
@@ -732,7 +732,8 @@ proto.game.GetFileRequest.prototype.toObject = function(opt_includeInstance) {
732
732
  */
733
733
  proto.game.GetFileRequest.toObject = function(includeInstance, msg) {
734
734
  var f, obj = {
735
- filePath: jspb.Message.getFieldWithDefault(msg, 1, "")
735
+ fileName: jspb.Message.getFieldWithDefault(msg, 1, ""),
736
+ instanceType: jspb.Message.getFieldWithDefault(msg, 2, "")
736
737
  };
737
738
 
738
739
  if (includeInstance) {
@@ -771,7 +772,11 @@ proto.game.GetFileRequest.deserializeBinaryFromReader = function(msg, reader) {
771
772
  switch (field) {
772
773
  case 1:
773
774
  var value = /** @type {string} */ (reader.readString());
774
- msg.setFilePath(value);
775
+ msg.setFileName(value);
776
+ break;
777
+ case 2:
778
+ var value = /** @type {string} */ (reader.readString());
779
+ msg.setInstanceType(value);
775
780
  break;
776
781
  default:
777
782
  reader.skipField();
@@ -802,21 +807,28 @@ proto.game.GetFileRequest.prototype.serializeBinary = function() {
802
807
  */
803
808
  proto.game.GetFileRequest.serializeBinaryToWriter = function(message, writer) {
804
809
  var f = undefined;
805
- f = message.getFilePath();
810
+ f = message.getFileName();
806
811
  if (f.length > 0) {
807
812
  writer.writeString(
808
813
  1,
809
814
  f
810
815
  );
811
816
  }
817
+ f = message.getInstanceType();
818
+ if (f.length > 0) {
819
+ writer.writeString(
820
+ 2,
821
+ f
822
+ );
823
+ }
812
824
  };
813
825
 
814
826
 
815
827
  /**
816
- * optional string file_path = 1;
828
+ * optional string file_name = 1;
817
829
  * @return {string}
818
830
  */
819
- proto.game.GetFileRequest.prototype.getFilePath = function() {
831
+ proto.game.GetFileRequest.prototype.getFileName = function() {
820
832
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
821
833
  };
822
834
 
@@ -825,11 +837,29 @@ proto.game.GetFileRequest.prototype.getFilePath = function() {
825
837
  * @param {string} value
826
838
  * @return {!proto.game.GetFileRequest} returns this
827
839
  */
828
- proto.game.GetFileRequest.prototype.setFilePath = function(value) {
840
+ proto.game.GetFileRequest.prototype.setFileName = function(value) {
829
841
  return jspb.Message.setProto3StringField(this, 1, value);
830
842
  };
831
843
 
832
844
 
845
+ /**
846
+ * optional string instance_type = 2;
847
+ * @return {string}
848
+ */
849
+ proto.game.GetFileRequest.prototype.getInstanceType = function() {
850
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
851
+ };
852
+
853
+
854
+ /**
855
+ * @param {string} value
856
+ * @return {!proto.game.GetFileRequest} returns this
857
+ */
858
+ proto.game.GetFileRequest.prototype.setInstanceType = function(value) {
859
+ return jspb.Message.setProto3StringField(this, 2, value);
860
+ };
861
+
862
+
833
863
 
834
864
 
835
865
 
@@ -867,7 +897,7 @@ proto.game.CategoryItem.toObject = function(includeInstance, msg) {
867
897
  slug: jspb.Message.getFieldWithDefault(msg, 3, ""),
868
898
  description: jspb.Message.getFieldWithDefault(msg, 4, ""),
869
899
  isActive: jspb.Message.getFieldWithDefault(msg, 5, 0),
870
- imagePath: jspb.Message.getFieldWithDefault(msg, 6, "")
900
+ image: jspb.Message.getFieldWithDefault(msg, 6, "")
871
901
  };
872
902
 
873
903
  if (includeInstance) {
@@ -926,7 +956,7 @@ proto.game.CategoryItem.deserializeBinaryFromReader = function(msg, reader) {
926
956
  break;
927
957
  case 6:
928
958
  var value = /** @type {string} */ (reader.readString());
929
- msg.setImagePath(value);
959
+ msg.setImage(value);
930
960
  break;
931
961
  default:
932
962
  reader.skipField();
@@ -1183,10 +1213,10 @@ proto.game.CategoryItem.prototype.hasIsActive = function() {
1183
1213
 
1184
1214
 
1185
1215
  /**
1186
- * optional string image_path = 6;
1216
+ * optional string image = 6;
1187
1217
  * @return {string}
1188
1218
  */
1189
- proto.game.CategoryItem.prototype.getImagePath = function() {
1219
+ proto.game.CategoryItem.prototype.getImage = function() {
1190
1220
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
1191
1221
  };
1192
1222
 
@@ -1195,7 +1225,7 @@ proto.game.CategoryItem.prototype.getImagePath = function() {
1195
1225
  * @param {string} value
1196
1226
  * @return {!proto.game.CategoryItem} returns this
1197
1227
  */
1198
- proto.game.CategoryItem.prototype.setImagePath = function(value) {
1228
+ proto.game.CategoryItem.prototype.setImage = function(value) {
1199
1229
  return jspb.Message.setField(this, 6, value);
1200
1230
  };
1201
1231
 
@@ -1204,7 +1234,7 @@ proto.game.CategoryItem.prototype.setImagePath = function(value) {
1204
1234
  * Clears the field making it undefined.
1205
1235
  * @return {!proto.game.CategoryItem} returns this
1206
1236
  */
1207
- proto.game.CategoryItem.prototype.clearImagePath = function() {
1237
+ proto.game.CategoryItem.prototype.clearImage = function() {
1208
1238
  return jspb.Message.setField(this, 6, undefined);
1209
1239
  };
1210
1240
 
@@ -1213,7 +1243,7 @@ proto.game.CategoryItem.prototype.clearImagePath = function() {
1213
1243
  * Returns whether this field is set.
1214
1244
  * @return {boolean}
1215
1245
  */
1216
- proto.game.CategoryItem.prototype.hasImagePath = function() {
1246
+ proto.game.CategoryItem.prototype.hasImage = function() {
1217
1247
  return jspb.Message.getField(this, 6) != null;
1218
1248
  };
1219
1249
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {