protobuf-platform 1.0.238 → 1.0.239

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.239",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,12 +4,68 @@ 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);
7
14
  }
15
+ //Technical
8
16
  message PingRequest { string ping = 1; }
9
17
  message PongResponse { string pong = 1; }
18
+ //Media
19
+ message File { bytes media = 1; optional string file_name = 2; optional string file_type = 3; }
20
+ message GetFileRequest { string file_name = 1; string instance_type = 2; }
10
21
  message PaginationRequest { int32 limit = 1; int32 offset = 2; optional UserSearchRequest user_search_params = 3; }
11
22
  message UserSearchRequest {
12
23
  optional int32 user_id = 1;
13
24
  optional string balance_type = 2;
14
25
  optional string currency = 3;
15
- }
26
+ }
27
+ //Tournament CRUD | Requests
28
+ message TournamentItem {
29
+ optional int32 id = 1;
30
+ optional string title = 2;
31
+ optional string description = 3;
32
+ optional int32 is_active = 4;
33
+ optional int32 current_members_count = 5;
34
+ optional int32 max_members_count = 6;
35
+ optional string started_at = 7;
36
+ optional string finished_at = 8;
37
+ optional string status = 9;
38
+ optional string image = 10;
39
+ }
40
+ message TournamentRequest {
41
+ oneof request {
42
+ TournamentItemRequest tournament_data = 1;
43
+ File file = 2;
44
+ }
45
+ }
46
+ message TournamentItemRequest {
47
+ optional int32 id = 1;
48
+ optional string title = 2;
49
+ optional string description = 3;
50
+ optional int32 is_active = 4;
51
+ optional int32 max_members_count = 5;
52
+ optional string started_at = 6;
53
+ optional string finished_at = 7;
54
+ optional int32 status_id = 8;
55
+ }
56
+ message GetTournamentRequest {
57
+ int32 id = 1;
58
+ }
59
+ //Tournament CRUD | Responses
60
+ message TournamentResponse {
61
+ TournamentItem data = 1;
62
+ }
63
+ message TournamentItemsResponse {
64
+ repeated TournamentItem items = 1;
65
+ optional int32 total_pages = 2;
66
+ optional int32 total_items = 3;
67
+ }
68
+ message TournamentStatusResponse {
69
+ string status = 1;
70
+ }
71
+
@@ -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,50 @@ 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_TournamentStatusResponse(arg) {
107
+ if (!(arg instanceof tournament_pb.TournamentStatusResponse)) {
108
+ throw new Error('Expected argument of type tournament.TournamentStatusResponse');
109
+ }
110
+ return Buffer.from(arg.serializeBinary());
111
+ }
112
+
113
+ function deserialize_tournament_TournamentStatusResponse(buffer_arg) {
114
+ return tournament_pb.TournamentStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
115
+ }
116
+
29
117
 
30
118
  var TournamentService = exports.TournamentService = {
31
119
  checkConnection: {
@@ -39,6 +127,73 @@ var TournamentService = exports.TournamentService = {
39
127
  responseSerialize: serialize_tournament_PongResponse,
40
128
  responseDeserialize: deserialize_tournament_PongResponse,
41
129
  },
130
+ getMediaResource: {
131
+ path: '/tournament.Tournament/getMediaResource',
132
+ requestStream: false,
133
+ responseStream: true,
134
+ requestType: tournament_pb.GetFileRequest,
135
+ responseType: tournament_pb.File,
136
+ requestSerialize: serialize_tournament_GetFileRequest,
137
+ requestDeserialize: deserialize_tournament_GetFileRequest,
138
+ responseSerialize: serialize_tournament_File,
139
+ responseDeserialize: deserialize_tournament_File,
140
+ },
141
+ // Tournaments
142
+ createSingleTournament: {
143
+ path: '/tournament.Tournament/createSingleTournament',
144
+ requestStream: true,
145
+ responseStream: false,
146
+ requestType: tournament_pb.TournamentRequest,
147
+ responseType: tournament_pb.TournamentResponse,
148
+ requestSerialize: serialize_tournament_TournamentRequest,
149
+ requestDeserialize: deserialize_tournament_TournamentRequest,
150
+ responseSerialize: serialize_tournament_TournamentResponse,
151
+ responseDeserialize: deserialize_tournament_TournamentResponse,
152
+ },
153
+ readSingleTournament: {
154
+ path: '/tournament.Tournament/readSingleTournament',
155
+ requestStream: false,
156
+ responseStream: false,
157
+ requestType: tournament_pb.GetTournamentRequest,
158
+ responseType: tournament_pb.TournamentResponse,
159
+ requestSerialize: serialize_tournament_GetTournamentRequest,
160
+ requestDeserialize: deserialize_tournament_GetTournamentRequest,
161
+ responseSerialize: serialize_tournament_TournamentResponse,
162
+ responseDeserialize: deserialize_tournament_TournamentResponse,
163
+ },
164
+ updateSingleTournament: {
165
+ path: '/tournament.Tournament/updateSingleTournament',
166
+ requestStream: true,
167
+ responseStream: false,
168
+ requestType: tournament_pb.TournamentRequest,
169
+ responseType: tournament_pb.TournamentResponse,
170
+ requestSerialize: serialize_tournament_TournamentRequest,
171
+ requestDeserialize: deserialize_tournament_TournamentRequest,
172
+ responseSerialize: serialize_tournament_TournamentResponse,
173
+ responseDeserialize: deserialize_tournament_TournamentResponse,
174
+ },
175
+ deleteSingleTournament: {
176
+ path: '/tournament.Tournament/deleteSingleTournament',
177
+ requestStream: false,
178
+ responseStream: false,
179
+ requestType: tournament_pb.GetTournamentRequest,
180
+ responseType: tournament_pb.TournamentStatusResponse,
181
+ requestSerialize: serialize_tournament_GetTournamentRequest,
182
+ requestDeserialize: deserialize_tournament_GetTournamentRequest,
183
+ responseSerialize: serialize_tournament_TournamentStatusResponse,
184
+ responseDeserialize: deserialize_tournament_TournamentStatusResponse,
185
+ },
186
+ readListTournaments: {
187
+ path: '/tournament.Tournament/readListTournaments',
188
+ requestStream: false,
189
+ responseStream: false,
190
+ requestType: tournament_pb.PaginationRequest,
191
+ responseType: tournament_pb.TournamentItemsResponse,
192
+ requestSerialize: serialize_tournament_PaginationRequest,
193
+ requestDeserialize: deserialize_tournament_PaginationRequest,
194
+ responseSerialize: serialize_tournament_TournamentItemsResponse,
195
+ responseDeserialize: deserialize_tournament_TournamentItemsResponse,
196
+ },
42
197
  };
43
198
 
44
199
  exports.TournamentClient = grpc.makeGenericClientConstructor(TournamentService);