protobuf-platform 1.0.235 → 1.0.236

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.235",
3
+ "version": "1.0.236",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,6 +4,12 @@ package promocode;
4
4
 
5
5
  service Promocode {
6
6
  rpc checkConnection(PingRequest) returns (PongResponse);
7
+ //Main
8
+ rpc createSingleCode(CodeRequest) returns (CodeResponse);
9
+ rpc readSingleCode(GetCodeRequest) returns (CodeResponse);
10
+ rpc updateSingleCode(CodeRequest) returns (CodeResponse);
11
+ rpc deleteSingleCode(GetCodeRequest) returns (CodeStatusResponse);
12
+ rpc readListCodes(PaginationRequest) returns (CodeItemsResponse);
7
13
  }
8
14
  message PingRequest { string ping = 1; }
9
15
  message PongResponse { string pong = 1; }
@@ -12,4 +18,38 @@ message UserSearchRequest {
12
18
  optional int32 user_id = 1;
13
19
  optional string balance_type = 2;
14
20
  optional string currency = 3;
21
+ }
22
+ //Main CRUD
23
+ message GetCodeRequest {
24
+ int32 id = 1;
25
+ }
26
+ message CodeRequest {
27
+ optional int32 id = 1;
28
+ optional string title = 2;
29
+ optional string code = 3;
30
+ optional string description = 4;
31
+ optional int32 max_used_count = 5;
32
+ optional int32 is_active = 6;
33
+ optional string type = 7;
34
+ }
35
+ message CodeItem {
36
+ optional int32 id = 1;
37
+ optional string title = 2;
38
+ optional string code = 3;
39
+ optional string description = 4;
40
+ optional int32 max_used_count = 5;
41
+ optional int32 current_used_count = 6;
42
+ optional int32 is_active = 7;
43
+ optional string type = 8;
44
+ }
45
+ message CodeResponse {
46
+ CodeItem data = 1;
47
+ }
48
+ message CodeItemsResponse {
49
+ repeated CodeItem items = 1;
50
+ optional int32 total_pages = 2;
51
+ optional int32 total_items = 3;
52
+ }
53
+ message CodeStatusResponse {
54
+ string status = 1;
15
55
  }
@@ -4,6 +4,72 @@
4
4
  var grpc = require('@grpc/grpc-js');
5
5
  var promocode_pb = require('./promocode_pb.js');
6
6
 
7
+ function serialize_promocode_CodeItemsResponse(arg) {
8
+ if (!(arg instanceof promocode_pb.CodeItemsResponse)) {
9
+ throw new Error('Expected argument of type promocode.CodeItemsResponse');
10
+ }
11
+ return Buffer.from(arg.serializeBinary());
12
+ }
13
+
14
+ function deserialize_promocode_CodeItemsResponse(buffer_arg) {
15
+ return promocode_pb.CodeItemsResponse.deserializeBinary(new Uint8Array(buffer_arg));
16
+ }
17
+
18
+ function serialize_promocode_CodeRequest(arg) {
19
+ if (!(arg instanceof promocode_pb.CodeRequest)) {
20
+ throw new Error('Expected argument of type promocode.CodeRequest');
21
+ }
22
+ return Buffer.from(arg.serializeBinary());
23
+ }
24
+
25
+ function deserialize_promocode_CodeRequest(buffer_arg) {
26
+ return promocode_pb.CodeRequest.deserializeBinary(new Uint8Array(buffer_arg));
27
+ }
28
+
29
+ function serialize_promocode_CodeResponse(arg) {
30
+ if (!(arg instanceof promocode_pb.CodeResponse)) {
31
+ throw new Error('Expected argument of type promocode.CodeResponse');
32
+ }
33
+ return Buffer.from(arg.serializeBinary());
34
+ }
35
+
36
+ function deserialize_promocode_CodeResponse(buffer_arg) {
37
+ return promocode_pb.CodeResponse.deserializeBinary(new Uint8Array(buffer_arg));
38
+ }
39
+
40
+ function serialize_promocode_CodeStatusResponse(arg) {
41
+ if (!(arg instanceof promocode_pb.CodeStatusResponse)) {
42
+ throw new Error('Expected argument of type promocode.CodeStatusResponse');
43
+ }
44
+ return Buffer.from(arg.serializeBinary());
45
+ }
46
+
47
+ function deserialize_promocode_CodeStatusResponse(buffer_arg) {
48
+ return promocode_pb.CodeStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
49
+ }
50
+
51
+ function serialize_promocode_GetCodeRequest(arg) {
52
+ if (!(arg instanceof promocode_pb.GetCodeRequest)) {
53
+ throw new Error('Expected argument of type promocode.GetCodeRequest');
54
+ }
55
+ return Buffer.from(arg.serializeBinary());
56
+ }
57
+
58
+ function deserialize_promocode_GetCodeRequest(buffer_arg) {
59
+ return promocode_pb.GetCodeRequest.deserializeBinary(new Uint8Array(buffer_arg));
60
+ }
61
+
62
+ function serialize_promocode_PaginationRequest(arg) {
63
+ if (!(arg instanceof promocode_pb.PaginationRequest)) {
64
+ throw new Error('Expected argument of type promocode.PaginationRequest');
65
+ }
66
+ return Buffer.from(arg.serializeBinary());
67
+ }
68
+
69
+ function deserialize_promocode_PaginationRequest(buffer_arg) {
70
+ return promocode_pb.PaginationRequest.deserializeBinary(new Uint8Array(buffer_arg));
71
+ }
72
+
7
73
  function serialize_promocode_PingRequest(arg) {
8
74
  if (!(arg instanceof promocode_pb.PingRequest)) {
9
75
  throw new Error('Expected argument of type promocode.PingRequest');
@@ -39,6 +105,62 @@ var PromocodeService = exports.PromocodeService = {
39
105
  responseSerialize: serialize_promocode_PongResponse,
40
106
  responseDeserialize: deserialize_promocode_PongResponse,
41
107
  },
108
+ // Main
109
+ createSingleCode: {
110
+ path: '/promocode.Promocode/createSingleCode',
111
+ requestStream: false,
112
+ responseStream: false,
113
+ requestType: promocode_pb.CodeRequest,
114
+ responseType: promocode_pb.CodeResponse,
115
+ requestSerialize: serialize_promocode_CodeRequest,
116
+ requestDeserialize: deserialize_promocode_CodeRequest,
117
+ responseSerialize: serialize_promocode_CodeResponse,
118
+ responseDeserialize: deserialize_promocode_CodeResponse,
119
+ },
120
+ readSingleCode: {
121
+ path: '/promocode.Promocode/readSingleCode',
122
+ requestStream: false,
123
+ responseStream: false,
124
+ requestType: promocode_pb.GetCodeRequest,
125
+ responseType: promocode_pb.CodeResponse,
126
+ requestSerialize: serialize_promocode_GetCodeRequest,
127
+ requestDeserialize: deserialize_promocode_GetCodeRequest,
128
+ responseSerialize: serialize_promocode_CodeResponse,
129
+ responseDeserialize: deserialize_promocode_CodeResponse,
130
+ },
131
+ updateSingleCode: {
132
+ path: '/promocode.Promocode/updateSingleCode',
133
+ requestStream: false,
134
+ responseStream: false,
135
+ requestType: promocode_pb.CodeRequest,
136
+ responseType: promocode_pb.CodeResponse,
137
+ requestSerialize: serialize_promocode_CodeRequest,
138
+ requestDeserialize: deserialize_promocode_CodeRequest,
139
+ responseSerialize: serialize_promocode_CodeResponse,
140
+ responseDeserialize: deserialize_promocode_CodeResponse,
141
+ },
142
+ deleteSingleCode: {
143
+ path: '/promocode.Promocode/deleteSingleCode',
144
+ requestStream: false,
145
+ responseStream: false,
146
+ requestType: promocode_pb.GetCodeRequest,
147
+ responseType: promocode_pb.CodeStatusResponse,
148
+ requestSerialize: serialize_promocode_GetCodeRequest,
149
+ requestDeserialize: deserialize_promocode_GetCodeRequest,
150
+ responseSerialize: serialize_promocode_CodeStatusResponse,
151
+ responseDeserialize: deserialize_promocode_CodeStatusResponse,
152
+ },
153
+ readListCodes: {
154
+ path: '/promocode.Promocode/readListCodes',
155
+ requestStream: false,
156
+ responseStream: false,
157
+ requestType: promocode_pb.PaginationRequest,
158
+ responseType: promocode_pb.CodeItemsResponse,
159
+ requestSerialize: serialize_promocode_PaginationRequest,
160
+ requestDeserialize: deserialize_promocode_PaginationRequest,
161
+ responseSerialize: serialize_promocode_CodeItemsResponse,
162
+ responseDeserialize: deserialize_promocode_CodeItemsResponse,
163
+ },
42
164
  };
43
165
 
44
166
  exports.PromocodeClient = grpc.makeGenericClientConstructor(PromocodeService);