protobuf-platform 1.0.20 → 1.0.22
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 +53 -0
- package/game/game_grpc_pb.js +166 -0
- package/game/game_pb.js +2037 -0
- package/index.js +6 -0
- package/package.json +1 -1
- package/update_protobuf.sh +2 -1
package/game/game.proto
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
syntax = "proto3";
|
2
|
+
|
3
|
+
package game;
|
4
|
+
|
5
|
+
service Game {
|
6
|
+
rpc checkConnection(PingRequest) returns (PongResponse);
|
7
|
+
//Categories
|
8
|
+
rpc createSingleCategory(CategoryRequest) returns (CategoryResponse);
|
9
|
+
rpc readSingleCategory(GetCategoryRequest) returns (CategoryResponse);
|
10
|
+
rpc updateSingleCategory(CategoryRequest) returns (CategoryResponse);
|
11
|
+
rpc deleteSingleCategory(GetCategoryRequest) returns (CategoryStatusResponse);
|
12
|
+
rpc readListCategories(GetListCategoryRequest) returns (CategoryListResponse);
|
13
|
+
}
|
14
|
+
|
15
|
+
message PingRequest { string ping = 1; }
|
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
|
+
}
|
35
|
+
message GetCategoryRequest {
|
36
|
+
int32 id = 1;
|
37
|
+
}
|
38
|
+
message GetListCategoryRequest {
|
39
|
+
int32 limit = 1;
|
40
|
+
int32 offset = 2;
|
41
|
+
}
|
42
|
+
//Category CRUD | Responses
|
43
|
+
message CategoryResponse {
|
44
|
+
CategoryItem data = 1;
|
45
|
+
}
|
46
|
+
message CategoryListResponse {
|
47
|
+
repeated CategoryItem items = 1;
|
48
|
+
optional int32 total_pages = 2;
|
49
|
+
optional int32 total_items = 3;
|
50
|
+
}
|
51
|
+
message CategoryStatusResponse {
|
52
|
+
string status = 1;
|
53
|
+
}
|
@@ -0,0 +1,166 @@
|
|
1
|
+
// GENERATED CODE -- DO NOT EDIT!
|
2
|
+
|
3
|
+
'use strict';
|
4
|
+
var grpc = require('@grpc/grpc-js');
|
5
|
+
var game_pb = require('./game_pb.js');
|
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
|
+
|
73
|
+
function serialize_game_PingRequest(arg) {
|
74
|
+
if (!(arg instanceof game_pb.PingRequest)) {
|
75
|
+
throw new Error('Expected argument of type game.PingRequest');
|
76
|
+
}
|
77
|
+
return Buffer.from(arg.serializeBinary());
|
78
|
+
}
|
79
|
+
|
80
|
+
function deserialize_game_PingRequest(buffer_arg) {
|
81
|
+
return game_pb.PingRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
82
|
+
}
|
83
|
+
|
84
|
+
function serialize_game_PongResponse(arg) {
|
85
|
+
if (!(arg instanceof game_pb.PongResponse)) {
|
86
|
+
throw new Error('Expected argument of type game.PongResponse');
|
87
|
+
}
|
88
|
+
return Buffer.from(arg.serializeBinary());
|
89
|
+
}
|
90
|
+
|
91
|
+
function deserialize_game_PongResponse(buffer_arg) {
|
92
|
+
return game_pb.PongResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
var GameService = exports.GameService = {
|
97
|
+
checkConnection: {
|
98
|
+
path: '/game.Game/checkConnection',
|
99
|
+
requestStream: false,
|
100
|
+
responseStream: false,
|
101
|
+
requestType: game_pb.PingRequest,
|
102
|
+
responseType: game_pb.PongResponse,
|
103
|
+
requestSerialize: serialize_game_PingRequest,
|
104
|
+
requestDeserialize: deserialize_game_PingRequest,
|
105
|
+
responseSerialize: serialize_game_PongResponse,
|
106
|
+
responseDeserialize: deserialize_game_PongResponse,
|
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: false,
|
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
|
+
},
|
164
|
+
};
|
165
|
+
|
166
|
+
exports.GameClient = grpc.makeGenericClientConstructor(GameService);
|