protobuf-platform 1.0.238 → 1.0.240

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.238",
3
+ "version": "1.0.240",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,12 +4,81 @@ package tournament;
4
4
 
5
5
  service Tournament {
6
6
  rpc checkConnection(PingRequest) returns (PongResponse);
7
+ rpc getMediaResource(GetFileRequest) returns (stream File);
8
+ //Tournaments
9
+ rpc createSingleTournament(stream TournamentRequest) returns (TournamentResponse);
10
+ rpc readSingleTournament(GetTournamentRequest) returns (TournamentResponse);
11
+ rpc updateSingleTournament(stream TournamentRequest) returns (TournamentResponse);
12
+ rpc deleteSingleTournament(GetTournamentRequest) returns (TournamentStatusResponse);
13
+ rpc readListTournaments(PaginationRequest) returns (TournamentItemsResponse);
14
+ //Tournament Statuses
15
+ rpc readListTournamentStatuses(PaginationRequest) returns (TournamentStatusItemsResponse);
7
16
  }
17
+ //Technical
8
18
  message PingRequest { string ping = 1; }
9
19
  message PongResponse { string pong = 1; }
20
+ //Media
21
+ message File { bytes media = 1; optional string file_name = 2; optional string file_type = 3; }
22
+ message GetFileRequest { string file_name = 1; string instance_type = 2; }
10
23
  message PaginationRequest { int32 limit = 1; int32 offset = 2; optional UserSearchRequest user_search_params = 3; }
11
24
  message UserSearchRequest {
12
25
  optional int32 user_id = 1;
13
26
  optional string balance_type = 2;
14
27
  optional string currency = 3;
15
- }
28
+ }
29
+ //Tournament CRUD | Requests
30
+ message TournamentItem {
31
+ optional int32 id = 1;
32
+ optional string title = 2;
33
+ optional string description = 3;
34
+ optional int32 is_active = 4;
35
+ optional int32 current_members_count = 5;
36
+ optional int32 max_members_count = 6;
37
+ optional string started_at = 7;
38
+ optional string finished_at = 8;
39
+ optional string status = 9;
40
+ optional string image = 10;
41
+ }
42
+ message TournamentRequest {
43
+ oneof request {
44
+ TournamentItemRequest tournament_data = 1;
45
+ File file = 2;
46
+ }
47
+ }
48
+ message TournamentItemRequest {
49
+ optional int32 id = 1;
50
+ optional string title = 2;
51
+ optional string description = 3;
52
+ optional int32 is_active = 4;
53
+ optional int32 max_members_count = 5;
54
+ optional string started_at = 6;
55
+ optional string finished_at = 7;
56
+ optional int32 status_id = 8;
57
+ }
58
+ message GetTournamentRequest {
59
+ int32 id = 1;
60
+ }
61
+ //Tournament CRUD | Responses
62
+ message TournamentResponse {
63
+ TournamentItem data = 1;
64
+ }
65
+ message TournamentItemsResponse {
66
+ repeated TournamentItem items = 1;
67
+ optional int32 total_pages = 2;
68
+ optional int32 total_items = 3;
69
+ }
70
+ message TournamentStatusResponse {
71
+ string status = 1;
72
+ }
73
+ message TournamentStatusItem {
74
+ int32 id = 1;
75
+ string title = 2;
76
+ optional bool is_active = 3;
77
+ optional string description = 4;
78
+ }
79
+ message TournamentStatusItemsResponse {
80
+ repeated TournamentStatusItem items = 1;
81
+ optional int32 total_pages = 2;
82
+ optional int32 total_items = 3;
83
+ }
84
+
@@ -4,6 +4,50 @@
4
4
  var grpc = require('@grpc/grpc-js');
5
5
  var tournament_pb = require('./tournament_pb.js');
6
6
 
7
+ function serialize_tournament_File(arg) {
8
+ if (!(arg instanceof tournament_pb.File)) {
9
+ throw new Error('Expected argument of type tournament.File');
10
+ }
11
+ return Buffer.from(arg.serializeBinary());
12
+ }
13
+
14
+ function deserialize_tournament_File(buffer_arg) {
15
+ return tournament_pb.File.deserializeBinary(new Uint8Array(buffer_arg));
16
+ }
17
+
18
+ function serialize_tournament_GetFileRequest(arg) {
19
+ if (!(arg instanceof tournament_pb.GetFileRequest)) {
20
+ throw new Error('Expected argument of type tournament.GetFileRequest');
21
+ }
22
+ return Buffer.from(arg.serializeBinary());
23
+ }
24
+
25
+ function deserialize_tournament_GetFileRequest(buffer_arg) {
26
+ return tournament_pb.GetFileRequest.deserializeBinary(new Uint8Array(buffer_arg));
27
+ }
28
+
29
+ function serialize_tournament_GetTournamentRequest(arg) {
30
+ if (!(arg instanceof tournament_pb.GetTournamentRequest)) {
31
+ throw new Error('Expected argument of type tournament.GetTournamentRequest');
32
+ }
33
+ return Buffer.from(arg.serializeBinary());
34
+ }
35
+
36
+ function deserialize_tournament_GetTournamentRequest(buffer_arg) {
37
+ return tournament_pb.GetTournamentRequest.deserializeBinary(new Uint8Array(buffer_arg));
38
+ }
39
+
40
+ function serialize_tournament_PaginationRequest(arg) {
41
+ if (!(arg instanceof tournament_pb.PaginationRequest)) {
42
+ throw new Error('Expected argument of type tournament.PaginationRequest');
43
+ }
44
+ return Buffer.from(arg.serializeBinary());
45
+ }
46
+
47
+ function deserialize_tournament_PaginationRequest(buffer_arg) {
48
+ return tournament_pb.PaginationRequest.deserializeBinary(new Uint8Array(buffer_arg));
49
+ }
50
+
7
51
  function serialize_tournament_PingRequest(arg) {
8
52
  if (!(arg instanceof tournament_pb.PingRequest)) {
9
53
  throw new Error('Expected argument of type tournament.PingRequest');
@@ -26,6 +70,61 @@ function deserialize_tournament_PongResponse(buffer_arg) {
26
70
  return tournament_pb.PongResponse.deserializeBinary(new Uint8Array(buffer_arg));
27
71
  }
28
72
 
73
+ function serialize_tournament_TournamentItemsResponse(arg) {
74
+ if (!(arg instanceof tournament_pb.TournamentItemsResponse)) {
75
+ throw new Error('Expected argument of type tournament.TournamentItemsResponse');
76
+ }
77
+ return Buffer.from(arg.serializeBinary());
78
+ }
79
+
80
+ function deserialize_tournament_TournamentItemsResponse(buffer_arg) {
81
+ return tournament_pb.TournamentItemsResponse.deserializeBinary(new Uint8Array(buffer_arg));
82
+ }
83
+
84
+ function serialize_tournament_TournamentRequest(arg) {
85
+ if (!(arg instanceof tournament_pb.TournamentRequest)) {
86
+ throw new Error('Expected argument of type tournament.TournamentRequest');
87
+ }
88
+ return Buffer.from(arg.serializeBinary());
89
+ }
90
+
91
+ function deserialize_tournament_TournamentRequest(buffer_arg) {
92
+ return tournament_pb.TournamentRequest.deserializeBinary(new Uint8Array(buffer_arg));
93
+ }
94
+
95
+ function serialize_tournament_TournamentResponse(arg) {
96
+ if (!(arg instanceof tournament_pb.TournamentResponse)) {
97
+ throw new Error('Expected argument of type tournament.TournamentResponse');
98
+ }
99
+ return Buffer.from(arg.serializeBinary());
100
+ }
101
+
102
+ function deserialize_tournament_TournamentResponse(buffer_arg) {
103
+ return tournament_pb.TournamentResponse.deserializeBinary(new Uint8Array(buffer_arg));
104
+ }
105
+
106
+ function serialize_tournament_TournamentStatusItemsResponse(arg) {
107
+ if (!(arg instanceof tournament_pb.TournamentStatusItemsResponse)) {
108
+ throw new Error('Expected argument of type tournament.TournamentStatusItemsResponse');
109
+ }
110
+ return Buffer.from(arg.serializeBinary());
111
+ }
112
+
113
+ function deserialize_tournament_TournamentStatusItemsResponse(buffer_arg) {
114
+ return tournament_pb.TournamentStatusItemsResponse.deserializeBinary(new Uint8Array(buffer_arg));
115
+ }
116
+
117
+ function serialize_tournament_TournamentStatusResponse(arg) {
118
+ if (!(arg instanceof tournament_pb.TournamentStatusResponse)) {
119
+ throw new Error('Expected argument of type tournament.TournamentStatusResponse');
120
+ }
121
+ return Buffer.from(arg.serializeBinary());
122
+ }
123
+
124
+ function deserialize_tournament_TournamentStatusResponse(buffer_arg) {
125
+ return tournament_pb.TournamentStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
126
+ }
127
+
29
128
 
30
129
  var TournamentService = exports.TournamentService = {
31
130
  checkConnection: {
@@ -39,6 +138,85 @@ var TournamentService = exports.TournamentService = {
39
138
  responseSerialize: serialize_tournament_PongResponse,
40
139
  responseDeserialize: deserialize_tournament_PongResponse,
41
140
  },
141
+ getMediaResource: {
142
+ path: '/tournament.Tournament/getMediaResource',
143
+ requestStream: false,
144
+ responseStream: true,
145
+ requestType: tournament_pb.GetFileRequest,
146
+ responseType: tournament_pb.File,
147
+ requestSerialize: serialize_tournament_GetFileRequest,
148
+ requestDeserialize: deserialize_tournament_GetFileRequest,
149
+ responseSerialize: serialize_tournament_File,
150
+ responseDeserialize: deserialize_tournament_File,
151
+ },
152
+ // Tournaments
153
+ createSingleTournament: {
154
+ path: '/tournament.Tournament/createSingleTournament',
155
+ requestStream: true,
156
+ responseStream: false,
157
+ requestType: tournament_pb.TournamentRequest,
158
+ responseType: tournament_pb.TournamentResponse,
159
+ requestSerialize: serialize_tournament_TournamentRequest,
160
+ requestDeserialize: deserialize_tournament_TournamentRequest,
161
+ responseSerialize: serialize_tournament_TournamentResponse,
162
+ responseDeserialize: deserialize_tournament_TournamentResponse,
163
+ },
164
+ readSingleTournament: {
165
+ path: '/tournament.Tournament/readSingleTournament',
166
+ requestStream: false,
167
+ responseStream: false,
168
+ requestType: tournament_pb.GetTournamentRequest,
169
+ responseType: tournament_pb.TournamentResponse,
170
+ requestSerialize: serialize_tournament_GetTournamentRequest,
171
+ requestDeserialize: deserialize_tournament_GetTournamentRequest,
172
+ responseSerialize: serialize_tournament_TournamentResponse,
173
+ responseDeserialize: deserialize_tournament_TournamentResponse,
174
+ },
175
+ updateSingleTournament: {
176
+ path: '/tournament.Tournament/updateSingleTournament',
177
+ requestStream: true,
178
+ responseStream: false,
179
+ requestType: tournament_pb.TournamentRequest,
180
+ responseType: tournament_pb.TournamentResponse,
181
+ requestSerialize: serialize_tournament_TournamentRequest,
182
+ requestDeserialize: deserialize_tournament_TournamentRequest,
183
+ responseSerialize: serialize_tournament_TournamentResponse,
184
+ responseDeserialize: deserialize_tournament_TournamentResponse,
185
+ },
186
+ deleteSingleTournament: {
187
+ path: '/tournament.Tournament/deleteSingleTournament',
188
+ requestStream: false,
189
+ responseStream: false,
190
+ requestType: tournament_pb.GetTournamentRequest,
191
+ responseType: tournament_pb.TournamentStatusResponse,
192
+ requestSerialize: serialize_tournament_GetTournamentRequest,
193
+ requestDeserialize: deserialize_tournament_GetTournamentRequest,
194
+ responseSerialize: serialize_tournament_TournamentStatusResponse,
195
+ responseDeserialize: deserialize_tournament_TournamentStatusResponse,
196
+ },
197
+ readListTournaments: {
198
+ path: '/tournament.Tournament/readListTournaments',
199
+ requestStream: false,
200
+ responseStream: false,
201
+ requestType: tournament_pb.PaginationRequest,
202
+ responseType: tournament_pb.TournamentItemsResponse,
203
+ requestSerialize: serialize_tournament_PaginationRequest,
204
+ requestDeserialize: deserialize_tournament_PaginationRequest,
205
+ responseSerialize: serialize_tournament_TournamentItemsResponse,
206
+ responseDeserialize: deserialize_tournament_TournamentItemsResponse,
207
+ },
208
+ // Tournament Statuses
209
+ readListTournamentStatuses: {
210
+ path: '/tournament.Tournament/readListTournamentStatuses',
211
+ requestStream: false,
212
+ responseStream: false,
213
+ requestType: tournament_pb.PaginationRequest,
214
+ responseType: tournament_pb.TournamentStatusItemsResponse,
215
+ requestSerialize: serialize_tournament_PaginationRequest,
216
+ requestDeserialize: deserialize_tournament_PaginationRequest,
217
+ responseSerialize: serialize_tournament_TournamentStatusItemsResponse,
218
+ responseDeserialize: deserialize_tournament_TournamentStatusItemsResponse,
219
+ },
42
220
  };
43
221
 
44
222
  exports.TournamentClient = grpc.makeGenericClientConstructor(TournamentService);