protobuf-platform 1.0.235 → 1.0.237
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.
@@ -61,10 +61,11 @@ message NotificationStatusResponse {
|
|
61
61
|
string status = 1;
|
62
62
|
}
|
63
63
|
message UserNotificationItem {
|
64
|
-
|
65
|
-
string
|
66
|
-
|
67
|
-
|
64
|
+
int32 id = 1;
|
65
|
+
string title = 2;
|
66
|
+
string content = 3;
|
67
|
+
bool is_checked = 4;
|
68
|
+
optional string created = 5;
|
68
69
|
}
|
69
70
|
message UserNotificationItemsResponse {
|
70
71
|
repeated UserNotificationItem items = 1;
|
@@ -2627,10 +2627,11 @@ proto.notification.UserNotificationItem.prototype.toObject = function(opt_includ
|
|
2627
2627
|
*/
|
2628
2628
|
proto.notification.UserNotificationItem.toObject = function(includeInstance, msg) {
|
2629
2629
|
var f, obj = {
|
2630
|
-
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2630
|
+
id: jspb.Message.getFieldWithDefault(msg, 1, 0),
|
2631
|
+
title: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
2632
|
+
content: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
2633
|
+
isChecked: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
|
2634
|
+
created: jspb.Message.getFieldWithDefault(msg, 5, "")
|
2634
2635
|
};
|
2635
2636
|
|
2636
2637
|
if (includeInstance) {
|
@@ -2668,18 +2669,22 @@ proto.notification.UserNotificationItem.deserializeBinaryFromReader = function(m
|
|
2668
2669
|
var field = reader.getFieldNumber();
|
2669
2670
|
switch (field) {
|
2670
2671
|
case 1:
|
2672
|
+
var value = /** @type {number} */ (reader.readInt32());
|
2673
|
+
msg.setId(value);
|
2674
|
+
break;
|
2675
|
+
case 2:
|
2671
2676
|
var value = /** @type {string} */ (reader.readString());
|
2672
2677
|
msg.setTitle(value);
|
2673
2678
|
break;
|
2674
|
-
case
|
2679
|
+
case 3:
|
2675
2680
|
var value = /** @type {string} */ (reader.readString());
|
2676
2681
|
msg.setContent(value);
|
2677
2682
|
break;
|
2678
|
-
case
|
2683
|
+
case 4:
|
2679
2684
|
var value = /** @type {boolean} */ (reader.readBool());
|
2680
2685
|
msg.setIsChecked(value);
|
2681
2686
|
break;
|
2682
|
-
case
|
2687
|
+
case 5:
|
2683
2688
|
var value = /** @type {string} */ (reader.readString());
|
2684
2689
|
msg.setCreated(value);
|
2685
2690
|
break;
|
@@ -2712,31 +2717,38 @@ proto.notification.UserNotificationItem.prototype.serializeBinary = function() {
|
|
2712
2717
|
*/
|
2713
2718
|
proto.notification.UserNotificationItem.serializeBinaryToWriter = function(message, writer) {
|
2714
2719
|
var f = undefined;
|
2720
|
+
f = message.getId();
|
2721
|
+
if (f !== 0) {
|
2722
|
+
writer.writeInt32(
|
2723
|
+
1,
|
2724
|
+
f
|
2725
|
+
);
|
2726
|
+
}
|
2715
2727
|
f = message.getTitle();
|
2716
2728
|
if (f.length > 0) {
|
2717
2729
|
writer.writeString(
|
2718
|
-
|
2730
|
+
2,
|
2719
2731
|
f
|
2720
2732
|
);
|
2721
2733
|
}
|
2722
2734
|
f = message.getContent();
|
2723
2735
|
if (f.length > 0) {
|
2724
2736
|
writer.writeString(
|
2725
|
-
|
2737
|
+
3,
|
2726
2738
|
f
|
2727
2739
|
);
|
2728
2740
|
}
|
2729
2741
|
f = message.getIsChecked();
|
2730
2742
|
if (f) {
|
2731
2743
|
writer.writeBool(
|
2732
|
-
|
2744
|
+
4,
|
2733
2745
|
f
|
2734
2746
|
);
|
2735
2747
|
}
|
2736
|
-
f = /** @type {string} */ (jspb.Message.getField(message,
|
2748
|
+
f = /** @type {string} */ (jspb.Message.getField(message, 5));
|
2737
2749
|
if (f != null) {
|
2738
2750
|
writer.writeString(
|
2739
|
-
|
2751
|
+
5,
|
2740
2752
|
f
|
2741
2753
|
);
|
2742
2754
|
}
|
@@ -2744,11 +2756,29 @@ proto.notification.UserNotificationItem.serializeBinaryToWriter = function(messa
|
|
2744
2756
|
|
2745
2757
|
|
2746
2758
|
/**
|
2747
|
-
* optional
|
2759
|
+
* optional int32 id = 1;
|
2760
|
+
* @return {number}
|
2761
|
+
*/
|
2762
|
+
proto.notification.UserNotificationItem.prototype.getId = function() {
|
2763
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
|
2764
|
+
};
|
2765
|
+
|
2766
|
+
|
2767
|
+
/**
|
2768
|
+
* @param {number} value
|
2769
|
+
* @return {!proto.notification.UserNotificationItem} returns this
|
2770
|
+
*/
|
2771
|
+
proto.notification.UserNotificationItem.prototype.setId = function(value) {
|
2772
|
+
return jspb.Message.setProto3IntField(this, 1, value);
|
2773
|
+
};
|
2774
|
+
|
2775
|
+
|
2776
|
+
/**
|
2777
|
+
* optional string title = 2;
|
2748
2778
|
* @return {string}
|
2749
2779
|
*/
|
2750
2780
|
proto.notification.UserNotificationItem.prototype.getTitle = function() {
|
2751
|
-
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this,
|
2781
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
2752
2782
|
};
|
2753
2783
|
|
2754
2784
|
|
@@ -2757,16 +2787,16 @@ proto.notification.UserNotificationItem.prototype.getTitle = function() {
|
|
2757
2787
|
* @return {!proto.notification.UserNotificationItem} returns this
|
2758
2788
|
*/
|
2759
2789
|
proto.notification.UserNotificationItem.prototype.setTitle = function(value) {
|
2760
|
-
return jspb.Message.setProto3StringField(this,
|
2790
|
+
return jspb.Message.setProto3StringField(this, 2, value);
|
2761
2791
|
};
|
2762
2792
|
|
2763
2793
|
|
2764
2794
|
/**
|
2765
|
-
* optional string content =
|
2795
|
+
* optional string content = 3;
|
2766
2796
|
* @return {string}
|
2767
2797
|
*/
|
2768
2798
|
proto.notification.UserNotificationItem.prototype.getContent = function() {
|
2769
|
-
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this,
|
2799
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
2770
2800
|
};
|
2771
2801
|
|
2772
2802
|
|
@@ -2775,16 +2805,16 @@ proto.notification.UserNotificationItem.prototype.getContent = function() {
|
|
2775
2805
|
* @return {!proto.notification.UserNotificationItem} returns this
|
2776
2806
|
*/
|
2777
2807
|
proto.notification.UserNotificationItem.prototype.setContent = function(value) {
|
2778
|
-
return jspb.Message.setProto3StringField(this,
|
2808
|
+
return jspb.Message.setProto3StringField(this, 3, value);
|
2779
2809
|
};
|
2780
2810
|
|
2781
2811
|
|
2782
2812
|
/**
|
2783
|
-
* optional bool is_checked =
|
2813
|
+
* optional bool is_checked = 4;
|
2784
2814
|
* @return {boolean}
|
2785
2815
|
*/
|
2786
2816
|
proto.notification.UserNotificationItem.prototype.getIsChecked = function() {
|
2787
|
-
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this,
|
2817
|
+
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
|
2788
2818
|
};
|
2789
2819
|
|
2790
2820
|
|
@@ -2793,16 +2823,16 @@ proto.notification.UserNotificationItem.prototype.getIsChecked = function() {
|
|
2793
2823
|
* @return {!proto.notification.UserNotificationItem} returns this
|
2794
2824
|
*/
|
2795
2825
|
proto.notification.UserNotificationItem.prototype.setIsChecked = function(value) {
|
2796
|
-
return jspb.Message.setProto3BooleanField(this,
|
2826
|
+
return jspb.Message.setProto3BooleanField(this, 4, value);
|
2797
2827
|
};
|
2798
2828
|
|
2799
2829
|
|
2800
2830
|
/**
|
2801
|
-
* optional string created =
|
2831
|
+
* optional string created = 5;
|
2802
2832
|
* @return {string}
|
2803
2833
|
*/
|
2804
2834
|
proto.notification.UserNotificationItem.prototype.getCreated = function() {
|
2805
|
-
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this,
|
2835
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
|
2806
2836
|
};
|
2807
2837
|
|
2808
2838
|
|
@@ -2811,7 +2841,7 @@ proto.notification.UserNotificationItem.prototype.getCreated = function() {
|
|
2811
2841
|
* @return {!proto.notification.UserNotificationItem} returns this
|
2812
2842
|
*/
|
2813
2843
|
proto.notification.UserNotificationItem.prototype.setCreated = function(value) {
|
2814
|
-
return jspb.Message.setField(this,
|
2844
|
+
return jspb.Message.setField(this, 5, value);
|
2815
2845
|
};
|
2816
2846
|
|
2817
2847
|
|
@@ -2820,7 +2850,7 @@ proto.notification.UserNotificationItem.prototype.setCreated = function(value) {
|
|
2820
2850
|
* @return {!proto.notification.UserNotificationItem} returns this
|
2821
2851
|
*/
|
2822
2852
|
proto.notification.UserNotificationItem.prototype.clearCreated = function() {
|
2823
|
-
return jspb.Message.setField(this,
|
2853
|
+
return jspb.Message.setField(this, 5, undefined);
|
2824
2854
|
};
|
2825
2855
|
|
2826
2856
|
|
@@ -2829,7 +2859,7 @@ proto.notification.UserNotificationItem.prototype.clearCreated = function() {
|
|
2829
2859
|
* @return {boolean}
|
2830
2860
|
*/
|
2831
2861
|
proto.notification.UserNotificationItem.prototype.hasCreated = function() {
|
2832
|
-
return jspb.Message.getField(this,
|
2862
|
+
return jspb.Message.getField(this, 5) != null;
|
2833
2863
|
};
|
2834
2864
|
|
2835
2865
|
|
package/package.json
CHANGED
@@ -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);
|