protobuf-platform 1.0.21 → 1.0.23

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,61 @@ package game;
4
4
 
5
5
  service Game {
6
6
  rpc checkConnection(PingRequest) returns (PongResponse);
7
+ //Categories
8
+ rpc createSingleCategory(CategoryRequest) returns (CategoryResponse);
9
+ rpc readSingleCategory(GetCategoryRequest) returns (CategoryResponse);
10
+ rpc updateSingleCategory(stream CategoryRequest) returns (CategoryResponse);
11
+ rpc deleteSingleCategory(GetCategoryRequest) returns (CategoryStatusResponse);
12
+ rpc readListCategories(GetListCategoryRequest) returns (CategoryListResponse);
7
13
  }
8
14
 
9
15
  message PingRequest { string ping = 1; }
10
16
  message PongResponse { string pong = 1; }
17
+
18
+ //Category CRUD
19
+ message CategoryItem {
20
+ optional int32 id = 1;
21
+ optional string title = 2;
22
+ optional string slug = 3;
23
+ optional string description = 4;
24
+ optional int32 is_active = 5;
25
+ optional string image_path = 6;
26
+ }
27
+ //Category CRUD | Requests
28
+ message CategoryRequest {
29
+ optional int32 id = 1;
30
+ optional string title = 2;
31
+ optional string slug = 3;
32
+ optional string description = 4;
33
+ optional int32 is_active = 5;
34
+ oneof request {
35
+ MetaDataFile metadata = 6;
36
+ File file = 7;
37
+ }
38
+ }
39
+ message GetCategoryRequest {
40
+ int32 id = 1;
41
+ }
42
+ message GetListCategoryRequest {
43
+ int32 limit = 1;
44
+ int32 offset = 2;
45
+ }
46
+ //Category CRUD | Responses
47
+ message CategoryResponse {
48
+ CategoryItem data = 1;
49
+ }
50
+ message CategoryListResponse {
51
+ repeated CategoryItem items = 1;
52
+ optional int32 total_pages = 2;
53
+ optional int32 total_items = 3;
54
+ }
55
+ message CategoryStatusResponse {
56
+ string status = 1;
57
+ }
58
+ message MetaDataFile {
59
+ string name = 1;
60
+ string type = 2;
61
+ }
62
+ message File {
63
+ bytes content = 1;
64
+ }
@@ -4,6 +4,72 @@
4
4
  var grpc = require('@grpc/grpc-js');
5
5
  var game_pb = require('./game_pb.js');
6
6
 
7
+ function serialize_game_CategoryListResponse(arg) {
8
+ if (!(arg instanceof game_pb.CategoryListResponse)) {
9
+ throw new Error('Expected argument of type game.CategoryListResponse');
10
+ }
11
+ return Buffer.from(arg.serializeBinary());
12
+ }
13
+
14
+ function deserialize_game_CategoryListResponse(buffer_arg) {
15
+ return game_pb.CategoryListResponse.deserializeBinary(new Uint8Array(buffer_arg));
16
+ }
17
+
18
+ function serialize_game_CategoryRequest(arg) {
19
+ if (!(arg instanceof game_pb.CategoryRequest)) {
20
+ throw new Error('Expected argument of type game.CategoryRequest');
21
+ }
22
+ return Buffer.from(arg.serializeBinary());
23
+ }
24
+
25
+ function deserialize_game_CategoryRequest(buffer_arg) {
26
+ return game_pb.CategoryRequest.deserializeBinary(new Uint8Array(buffer_arg));
27
+ }
28
+
29
+ function serialize_game_CategoryResponse(arg) {
30
+ if (!(arg instanceof game_pb.CategoryResponse)) {
31
+ throw new Error('Expected argument of type game.CategoryResponse');
32
+ }
33
+ return Buffer.from(arg.serializeBinary());
34
+ }
35
+
36
+ function deserialize_game_CategoryResponse(buffer_arg) {
37
+ return game_pb.CategoryResponse.deserializeBinary(new Uint8Array(buffer_arg));
38
+ }
39
+
40
+ function serialize_game_CategoryStatusResponse(arg) {
41
+ if (!(arg instanceof game_pb.CategoryStatusResponse)) {
42
+ throw new Error('Expected argument of type game.CategoryStatusResponse');
43
+ }
44
+ return Buffer.from(arg.serializeBinary());
45
+ }
46
+
47
+ function deserialize_game_CategoryStatusResponse(buffer_arg) {
48
+ return game_pb.CategoryStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
49
+ }
50
+
51
+ function serialize_game_GetCategoryRequest(arg) {
52
+ if (!(arg instanceof game_pb.GetCategoryRequest)) {
53
+ throw new Error('Expected argument of type game.GetCategoryRequest');
54
+ }
55
+ return Buffer.from(arg.serializeBinary());
56
+ }
57
+
58
+ function deserialize_game_GetCategoryRequest(buffer_arg) {
59
+ return game_pb.GetCategoryRequest.deserializeBinary(new Uint8Array(buffer_arg));
60
+ }
61
+
62
+ function serialize_game_GetListCategoryRequest(arg) {
63
+ if (!(arg instanceof game_pb.GetListCategoryRequest)) {
64
+ throw new Error('Expected argument of type game.GetListCategoryRequest');
65
+ }
66
+ return Buffer.from(arg.serializeBinary());
67
+ }
68
+
69
+ function deserialize_game_GetListCategoryRequest(buffer_arg) {
70
+ return game_pb.GetListCategoryRequest.deserializeBinary(new Uint8Array(buffer_arg));
71
+ }
72
+
7
73
  function serialize_game_PingRequest(arg) {
8
74
  if (!(arg instanceof game_pb.PingRequest)) {
9
75
  throw new Error('Expected argument of type game.PingRequest');
@@ -39,6 +105,62 @@ var GameService = exports.GameService = {
39
105
  responseSerialize: serialize_game_PongResponse,
40
106
  responseDeserialize: deserialize_game_PongResponse,
41
107
  },
108
+ // Categories
109
+ createSingleCategory: {
110
+ path: '/game.Game/createSingleCategory',
111
+ requestStream: false,
112
+ responseStream: false,
113
+ requestType: game_pb.CategoryRequest,
114
+ responseType: game_pb.CategoryResponse,
115
+ requestSerialize: serialize_game_CategoryRequest,
116
+ requestDeserialize: deserialize_game_CategoryRequest,
117
+ responseSerialize: serialize_game_CategoryResponse,
118
+ responseDeserialize: deserialize_game_CategoryResponse,
119
+ },
120
+ readSingleCategory: {
121
+ path: '/game.Game/readSingleCategory',
122
+ requestStream: false,
123
+ responseStream: false,
124
+ requestType: game_pb.GetCategoryRequest,
125
+ responseType: game_pb.CategoryResponse,
126
+ requestSerialize: serialize_game_GetCategoryRequest,
127
+ requestDeserialize: deserialize_game_GetCategoryRequest,
128
+ responseSerialize: serialize_game_CategoryResponse,
129
+ responseDeserialize: deserialize_game_CategoryResponse,
130
+ },
131
+ updateSingleCategory: {
132
+ path: '/game.Game/updateSingleCategory',
133
+ requestStream: true,
134
+ responseStream: false,
135
+ requestType: game_pb.CategoryRequest,
136
+ responseType: game_pb.CategoryResponse,
137
+ requestSerialize: serialize_game_CategoryRequest,
138
+ requestDeserialize: deserialize_game_CategoryRequest,
139
+ responseSerialize: serialize_game_CategoryResponse,
140
+ responseDeserialize: deserialize_game_CategoryResponse,
141
+ },
142
+ deleteSingleCategory: {
143
+ path: '/game.Game/deleteSingleCategory',
144
+ requestStream: false,
145
+ responseStream: false,
146
+ requestType: game_pb.GetCategoryRequest,
147
+ responseType: game_pb.CategoryStatusResponse,
148
+ requestSerialize: serialize_game_GetCategoryRequest,
149
+ requestDeserialize: deserialize_game_GetCategoryRequest,
150
+ responseSerialize: serialize_game_CategoryStatusResponse,
151
+ responseDeserialize: deserialize_game_CategoryStatusResponse,
152
+ },
153
+ readListCategories: {
154
+ path: '/game.Game/readListCategories',
155
+ requestStream: false,
156
+ responseStream: false,
157
+ requestType: game_pb.GetListCategoryRequest,
158
+ responseType: game_pb.CategoryListResponse,
159
+ requestSerialize: serialize_game_GetListCategoryRequest,
160
+ requestDeserialize: deserialize_game_GetListCategoryRequest,
161
+ responseSerialize: serialize_game_CategoryListResponse,
162
+ responseDeserialize: deserialize_game_CategoryListResponse,
163
+ },
42
164
  };
43
165
 
44
166
  exports.GameClient = grpc.makeGenericClientConstructor(GameService);