protobuf-platform 1.0.48 → 1.0.50
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 +1 -1
- package/user/user.proto +14 -0
- package/user/user_grpc_pb.js +33 -0
- package/user/user_pb.js +703 -1
package/package.json
CHANGED
package/user/user.proto
CHANGED
@@ -10,10 +10,12 @@ service User {
|
|
10
10
|
rpc getUserData(UserDataRequest) returns (UserDataResponse);
|
11
11
|
//Role and Permissions
|
12
12
|
rpc addPermissionToUserRole(RolePermissionRequest) returns (RolePermissionStatusResponse);
|
13
|
+
rpc rolesList(PaginationRequest) returns (RolesItemsResponse);
|
13
14
|
}
|
14
15
|
|
15
16
|
message PingRequest { string ping = 1; }
|
16
17
|
message PongResponse { string pong = 1; }
|
18
|
+
message PaginationRequest { int32 limit = 1; int32 offset = 2; }
|
17
19
|
|
18
20
|
//Auth [Registration & Login]
|
19
21
|
message RegistrationRequest {
|
@@ -52,6 +54,7 @@ message UserDataResponse {
|
|
52
54
|
optional string last_name = 7;
|
53
55
|
optional string birthday = 8;
|
54
56
|
optional string locale = 9;
|
57
|
+
optional string permissions = 10;
|
55
58
|
}
|
56
59
|
//Permissions
|
57
60
|
message RolePermissionRequest {
|
@@ -65,3 +68,14 @@ message RolePermissionRequest {
|
|
65
68
|
message RolePermissionStatusResponse {
|
66
69
|
string status = 1;
|
67
70
|
}
|
71
|
+
//Roles
|
72
|
+
message Role {
|
73
|
+
int32 id = 1;
|
74
|
+
string title = 2;
|
75
|
+
optional string description = 3;
|
76
|
+
}
|
77
|
+
message RolesItemsResponse {
|
78
|
+
repeated Role roles = 1;
|
79
|
+
int32 total_items = 2;
|
80
|
+
int32 total_pages = 3;
|
81
|
+
}
|
package/user/user_grpc_pb.js
CHANGED
@@ -26,6 +26,17 @@ function deserialize_user_LoginRequest(buffer_arg) {
|
|
26
26
|
return user_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
27
27
|
}
|
28
28
|
|
29
|
+
function serialize_user_PaginationRequest(arg) {
|
30
|
+
if (!(arg instanceof user_pb.PaginationRequest)) {
|
31
|
+
throw new Error('Expected argument of type user.PaginationRequest');
|
32
|
+
}
|
33
|
+
return Buffer.from(arg.serializeBinary());
|
34
|
+
}
|
35
|
+
|
36
|
+
function deserialize_user_PaginationRequest(buffer_arg) {
|
37
|
+
return user_pb.PaginationRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
38
|
+
}
|
39
|
+
|
29
40
|
function serialize_user_PingRequest(arg) {
|
30
41
|
if (!(arg instanceof user_pb.PingRequest)) {
|
31
42
|
throw new Error('Expected argument of type user.PingRequest');
|
@@ -81,6 +92,17 @@ function deserialize_user_RolePermissionStatusResponse(buffer_arg) {
|
|
81
92
|
return user_pb.RolePermissionStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
82
93
|
}
|
83
94
|
|
95
|
+
function serialize_user_RolesItemsResponse(arg) {
|
96
|
+
if (!(arg instanceof user_pb.RolesItemsResponse)) {
|
97
|
+
throw new Error('Expected argument of type user.RolesItemsResponse');
|
98
|
+
}
|
99
|
+
return Buffer.from(arg.serializeBinary());
|
100
|
+
}
|
101
|
+
|
102
|
+
function deserialize_user_RolesItemsResponse(buffer_arg) {
|
103
|
+
return user_pb.RolesItemsResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
104
|
+
}
|
105
|
+
|
84
106
|
function serialize_user_UserDataRequest(arg) {
|
85
107
|
if (!(arg instanceof user_pb.UserDataRequest)) {
|
86
108
|
throw new Error('Expected argument of type user.UserDataRequest');
|
@@ -162,6 +184,17 @@ addPermissionToUserRole: {
|
|
162
184
|
responseSerialize: serialize_user_RolePermissionStatusResponse,
|
163
185
|
responseDeserialize: deserialize_user_RolePermissionStatusResponse,
|
164
186
|
},
|
187
|
+
rolesList: {
|
188
|
+
path: '/user.User/rolesList',
|
189
|
+
requestStream: false,
|
190
|
+
responseStream: false,
|
191
|
+
requestType: user_pb.PaginationRequest,
|
192
|
+
responseType: user_pb.RolesItemsResponse,
|
193
|
+
requestSerialize: serialize_user_PaginationRequest,
|
194
|
+
requestDeserialize: deserialize_user_PaginationRequest,
|
195
|
+
responseSerialize: serialize_user_RolesItemsResponse,
|
196
|
+
responseDeserialize: deserialize_user_RolesItemsResponse,
|
197
|
+
},
|
165
198
|
};
|
166
199
|
|
167
200
|
exports.UserClient = grpc.makeGenericClientConstructor(UserService);
|
package/user/user_pb.js
CHANGED
@@ -23,11 +23,14 @@ var global = (function() {
|
|
23
23
|
|
24
24
|
goog.exportSymbol('proto.user.LoggedInResponse', null, global);
|
25
25
|
goog.exportSymbol('proto.user.LoginRequest', null, global);
|
26
|
+
goog.exportSymbol('proto.user.PaginationRequest', null, global);
|
26
27
|
goog.exportSymbol('proto.user.PingRequest', null, global);
|
27
28
|
goog.exportSymbol('proto.user.PongResponse', null, global);
|
28
29
|
goog.exportSymbol('proto.user.RegistrationRequest', null, global);
|
30
|
+
goog.exportSymbol('proto.user.Role', null, global);
|
29
31
|
goog.exportSymbol('proto.user.RolePermissionRequest', null, global);
|
30
32
|
goog.exportSymbol('proto.user.RolePermissionStatusResponse', null, global);
|
33
|
+
goog.exportSymbol('proto.user.RolesItemsResponse', null, global);
|
31
34
|
goog.exportSymbol('proto.user.UserDataRequest', null, global);
|
32
35
|
goog.exportSymbol('proto.user.UserDataResponse', null, global);
|
33
36
|
/**
|
@@ -72,6 +75,27 @@ if (goog.DEBUG && !COMPILED) {
|
|
72
75
|
*/
|
73
76
|
proto.user.PongResponse.displayName = 'proto.user.PongResponse';
|
74
77
|
}
|
78
|
+
/**
|
79
|
+
* Generated by JsPbCodeGenerator.
|
80
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
81
|
+
* server response, or constructed directly in Javascript. The array is used
|
82
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
83
|
+
* If no data is provided, the constructed object will be empty, but still
|
84
|
+
* valid.
|
85
|
+
* @extends {jspb.Message}
|
86
|
+
* @constructor
|
87
|
+
*/
|
88
|
+
proto.user.PaginationRequest = function(opt_data) {
|
89
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
90
|
+
};
|
91
|
+
goog.inherits(proto.user.PaginationRequest, jspb.Message);
|
92
|
+
if (goog.DEBUG && !COMPILED) {
|
93
|
+
/**
|
94
|
+
* @public
|
95
|
+
* @override
|
96
|
+
*/
|
97
|
+
proto.user.PaginationRequest.displayName = 'proto.user.PaginationRequest';
|
98
|
+
}
|
75
99
|
/**
|
76
100
|
* Generated by JsPbCodeGenerator.
|
77
101
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
@@ -219,6 +243,48 @@ if (goog.DEBUG && !COMPILED) {
|
|
219
243
|
*/
|
220
244
|
proto.user.RolePermissionStatusResponse.displayName = 'proto.user.RolePermissionStatusResponse';
|
221
245
|
}
|
246
|
+
/**
|
247
|
+
* Generated by JsPbCodeGenerator.
|
248
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
249
|
+
* server response, or constructed directly in Javascript. The array is used
|
250
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
251
|
+
* If no data is provided, the constructed object will be empty, but still
|
252
|
+
* valid.
|
253
|
+
* @extends {jspb.Message}
|
254
|
+
* @constructor
|
255
|
+
*/
|
256
|
+
proto.user.Role = function(opt_data) {
|
257
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
258
|
+
};
|
259
|
+
goog.inherits(proto.user.Role, jspb.Message);
|
260
|
+
if (goog.DEBUG && !COMPILED) {
|
261
|
+
/**
|
262
|
+
* @public
|
263
|
+
* @override
|
264
|
+
*/
|
265
|
+
proto.user.Role.displayName = 'proto.user.Role';
|
266
|
+
}
|
267
|
+
/**
|
268
|
+
* Generated by JsPbCodeGenerator.
|
269
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
270
|
+
* server response, or constructed directly in Javascript. The array is used
|
271
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
272
|
+
* If no data is provided, the constructed object will be empty, but still
|
273
|
+
* valid.
|
274
|
+
* @extends {jspb.Message}
|
275
|
+
* @constructor
|
276
|
+
*/
|
277
|
+
proto.user.RolesItemsResponse = function(opt_data) {
|
278
|
+
jspb.Message.initialize(this, opt_data, 0, -1, proto.user.RolesItemsResponse.repeatedFields_, null);
|
279
|
+
};
|
280
|
+
goog.inherits(proto.user.RolesItemsResponse, jspb.Message);
|
281
|
+
if (goog.DEBUG && !COMPILED) {
|
282
|
+
/**
|
283
|
+
* @public
|
284
|
+
* @override
|
285
|
+
*/
|
286
|
+
proto.user.RolesItemsResponse.displayName = 'proto.user.RolesItemsResponse';
|
287
|
+
}
|
222
288
|
|
223
289
|
|
224
290
|
|
@@ -482,6 +548,166 @@ proto.user.PongResponse.prototype.setPong = function(value) {
|
|
482
548
|
|
483
549
|
|
484
550
|
|
551
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
552
|
+
/**
|
553
|
+
* Creates an object representation of this proto.
|
554
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
555
|
+
* Optional fields that are not set will be set to undefined.
|
556
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
557
|
+
* For the list of reserved names please see:
|
558
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
559
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
560
|
+
* JSPB instance for transitional soy proto support:
|
561
|
+
* http://goto/soy-param-migration
|
562
|
+
* @return {!Object}
|
563
|
+
*/
|
564
|
+
proto.user.PaginationRequest.prototype.toObject = function(opt_includeInstance) {
|
565
|
+
return proto.user.PaginationRequest.toObject(opt_includeInstance, this);
|
566
|
+
};
|
567
|
+
|
568
|
+
|
569
|
+
/**
|
570
|
+
* Static version of the {@see toObject} method.
|
571
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
572
|
+
* the JSPB instance for transitional soy proto support:
|
573
|
+
* http://goto/soy-param-migration
|
574
|
+
* @param {!proto.user.PaginationRequest} msg The msg instance to transform.
|
575
|
+
* @return {!Object}
|
576
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
577
|
+
*/
|
578
|
+
proto.user.PaginationRequest.toObject = function(includeInstance, msg) {
|
579
|
+
var f, obj = {
|
580
|
+
limit: jspb.Message.getFieldWithDefault(msg, 1, 0),
|
581
|
+
offset: jspb.Message.getFieldWithDefault(msg, 2, 0)
|
582
|
+
};
|
583
|
+
|
584
|
+
if (includeInstance) {
|
585
|
+
obj.$jspbMessageInstance = msg;
|
586
|
+
}
|
587
|
+
return obj;
|
588
|
+
};
|
589
|
+
}
|
590
|
+
|
591
|
+
|
592
|
+
/**
|
593
|
+
* Deserializes binary data (in protobuf wire format).
|
594
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
595
|
+
* @return {!proto.user.PaginationRequest}
|
596
|
+
*/
|
597
|
+
proto.user.PaginationRequest.deserializeBinary = function(bytes) {
|
598
|
+
var reader = new jspb.BinaryReader(bytes);
|
599
|
+
var msg = new proto.user.PaginationRequest;
|
600
|
+
return proto.user.PaginationRequest.deserializeBinaryFromReader(msg, reader);
|
601
|
+
};
|
602
|
+
|
603
|
+
|
604
|
+
/**
|
605
|
+
* Deserializes binary data (in protobuf wire format) from the
|
606
|
+
* given reader into the given message object.
|
607
|
+
* @param {!proto.user.PaginationRequest} msg The message object to deserialize into.
|
608
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
609
|
+
* @return {!proto.user.PaginationRequest}
|
610
|
+
*/
|
611
|
+
proto.user.PaginationRequest.deserializeBinaryFromReader = function(msg, reader) {
|
612
|
+
while (reader.nextField()) {
|
613
|
+
if (reader.isEndGroup()) {
|
614
|
+
break;
|
615
|
+
}
|
616
|
+
var field = reader.getFieldNumber();
|
617
|
+
switch (field) {
|
618
|
+
case 1:
|
619
|
+
var value = /** @type {number} */ (reader.readInt32());
|
620
|
+
msg.setLimit(value);
|
621
|
+
break;
|
622
|
+
case 2:
|
623
|
+
var value = /** @type {number} */ (reader.readInt32());
|
624
|
+
msg.setOffset(value);
|
625
|
+
break;
|
626
|
+
default:
|
627
|
+
reader.skipField();
|
628
|
+
break;
|
629
|
+
}
|
630
|
+
}
|
631
|
+
return msg;
|
632
|
+
};
|
633
|
+
|
634
|
+
|
635
|
+
/**
|
636
|
+
* Serializes the message to binary data (in protobuf wire format).
|
637
|
+
* @return {!Uint8Array}
|
638
|
+
*/
|
639
|
+
proto.user.PaginationRequest.prototype.serializeBinary = function() {
|
640
|
+
var writer = new jspb.BinaryWriter();
|
641
|
+
proto.user.PaginationRequest.serializeBinaryToWriter(this, writer);
|
642
|
+
return writer.getResultBuffer();
|
643
|
+
};
|
644
|
+
|
645
|
+
|
646
|
+
/**
|
647
|
+
* Serializes the given message to binary data (in protobuf wire
|
648
|
+
* format), writing to the given BinaryWriter.
|
649
|
+
* @param {!proto.user.PaginationRequest} message
|
650
|
+
* @param {!jspb.BinaryWriter} writer
|
651
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
652
|
+
*/
|
653
|
+
proto.user.PaginationRequest.serializeBinaryToWriter = function(message, writer) {
|
654
|
+
var f = undefined;
|
655
|
+
f = message.getLimit();
|
656
|
+
if (f !== 0) {
|
657
|
+
writer.writeInt32(
|
658
|
+
1,
|
659
|
+
f
|
660
|
+
);
|
661
|
+
}
|
662
|
+
f = message.getOffset();
|
663
|
+
if (f !== 0) {
|
664
|
+
writer.writeInt32(
|
665
|
+
2,
|
666
|
+
f
|
667
|
+
);
|
668
|
+
}
|
669
|
+
};
|
670
|
+
|
671
|
+
|
672
|
+
/**
|
673
|
+
* optional int32 limit = 1;
|
674
|
+
* @return {number}
|
675
|
+
*/
|
676
|
+
proto.user.PaginationRequest.prototype.getLimit = function() {
|
677
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
|
678
|
+
};
|
679
|
+
|
680
|
+
|
681
|
+
/**
|
682
|
+
* @param {number} value
|
683
|
+
* @return {!proto.user.PaginationRequest} returns this
|
684
|
+
*/
|
685
|
+
proto.user.PaginationRequest.prototype.setLimit = function(value) {
|
686
|
+
return jspb.Message.setProto3IntField(this, 1, value);
|
687
|
+
};
|
688
|
+
|
689
|
+
|
690
|
+
/**
|
691
|
+
* optional int32 offset = 2;
|
692
|
+
* @return {number}
|
693
|
+
*/
|
694
|
+
proto.user.PaginationRequest.prototype.getOffset = function() {
|
695
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
|
696
|
+
};
|
697
|
+
|
698
|
+
|
699
|
+
/**
|
700
|
+
* @param {number} value
|
701
|
+
* @return {!proto.user.PaginationRequest} returns this
|
702
|
+
*/
|
703
|
+
proto.user.PaginationRequest.prototype.setOffset = function(value) {
|
704
|
+
return jspb.Message.setProto3IntField(this, 2, value);
|
705
|
+
};
|
706
|
+
|
707
|
+
|
708
|
+
|
709
|
+
|
710
|
+
|
485
711
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
486
712
|
/**
|
487
713
|
* Creates an object representation of this proto.
|
@@ -1549,7 +1775,8 @@ proto.user.UserDataResponse.toObject = function(includeInstance, msg) {
|
|
1549
1775
|
firstName: jspb.Message.getFieldWithDefault(msg, 6, ""),
|
1550
1776
|
lastName: jspb.Message.getFieldWithDefault(msg, 7, ""),
|
1551
1777
|
birthday: jspb.Message.getFieldWithDefault(msg, 8, ""),
|
1552
|
-
locale: jspb.Message.getFieldWithDefault(msg, 9, "")
|
1778
|
+
locale: jspb.Message.getFieldWithDefault(msg, 9, ""),
|
1779
|
+
permissions: jspb.Message.getFieldWithDefault(msg, 10, "")
|
1553
1780
|
};
|
1554
1781
|
|
1555
1782
|
if (includeInstance) {
|
@@ -1622,6 +1849,10 @@ proto.user.UserDataResponse.deserializeBinaryFromReader = function(msg, reader)
|
|
1622
1849
|
var value = /** @type {string} */ (reader.readString());
|
1623
1850
|
msg.setLocale(value);
|
1624
1851
|
break;
|
1852
|
+
case 10:
|
1853
|
+
var value = /** @type {string} */ (reader.readString());
|
1854
|
+
msg.setPermissions(value);
|
1855
|
+
break;
|
1625
1856
|
default:
|
1626
1857
|
reader.skipField();
|
1627
1858
|
break;
|
@@ -1714,6 +1945,13 @@ proto.user.UserDataResponse.serializeBinaryToWriter = function(message, writer)
|
|
1714
1945
|
f
|
1715
1946
|
);
|
1716
1947
|
}
|
1948
|
+
f = /** @type {string} */ (jspb.Message.getField(message, 10));
|
1949
|
+
if (f != null) {
|
1950
|
+
writer.writeString(
|
1951
|
+
10,
|
1952
|
+
f
|
1953
|
+
);
|
1954
|
+
}
|
1717
1955
|
};
|
1718
1956
|
|
1719
1957
|
|
@@ -1987,6 +2225,42 @@ proto.user.UserDataResponse.prototype.hasLocale = function() {
|
|
1987
2225
|
};
|
1988
2226
|
|
1989
2227
|
|
2228
|
+
/**
|
2229
|
+
* optional string permissions = 10;
|
2230
|
+
* @return {string}
|
2231
|
+
*/
|
2232
|
+
proto.user.UserDataResponse.prototype.getPermissions = function() {
|
2233
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, ""));
|
2234
|
+
};
|
2235
|
+
|
2236
|
+
|
2237
|
+
/**
|
2238
|
+
* @param {string} value
|
2239
|
+
* @return {!proto.user.UserDataResponse} returns this
|
2240
|
+
*/
|
2241
|
+
proto.user.UserDataResponse.prototype.setPermissions = function(value) {
|
2242
|
+
return jspb.Message.setField(this, 10, value);
|
2243
|
+
};
|
2244
|
+
|
2245
|
+
|
2246
|
+
/**
|
2247
|
+
* Clears the field making it undefined.
|
2248
|
+
* @return {!proto.user.UserDataResponse} returns this
|
2249
|
+
*/
|
2250
|
+
proto.user.UserDataResponse.prototype.clearPermissions = function() {
|
2251
|
+
return jspb.Message.setField(this, 10, undefined);
|
2252
|
+
};
|
2253
|
+
|
2254
|
+
|
2255
|
+
/**
|
2256
|
+
* Returns whether this field is set.
|
2257
|
+
* @return {boolean}
|
2258
|
+
*/
|
2259
|
+
proto.user.UserDataResponse.prototype.hasPermissions = function() {
|
2260
|
+
return jspb.Message.getField(this, 10) != null;
|
2261
|
+
};
|
2262
|
+
|
2263
|
+
|
1990
2264
|
|
1991
2265
|
|
1992
2266
|
|
@@ -2433,4 +2707,432 @@ proto.user.RolePermissionStatusResponse.prototype.setStatus = function(value) {
|
|
2433
2707
|
};
|
2434
2708
|
|
2435
2709
|
|
2710
|
+
|
2711
|
+
|
2712
|
+
|
2713
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
2714
|
+
/**
|
2715
|
+
* Creates an object representation of this proto.
|
2716
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
2717
|
+
* Optional fields that are not set will be set to undefined.
|
2718
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
2719
|
+
* For the list of reserved names please see:
|
2720
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
2721
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
2722
|
+
* JSPB instance for transitional soy proto support:
|
2723
|
+
* http://goto/soy-param-migration
|
2724
|
+
* @return {!Object}
|
2725
|
+
*/
|
2726
|
+
proto.user.Role.prototype.toObject = function(opt_includeInstance) {
|
2727
|
+
return proto.user.Role.toObject(opt_includeInstance, this);
|
2728
|
+
};
|
2729
|
+
|
2730
|
+
|
2731
|
+
/**
|
2732
|
+
* Static version of the {@see toObject} method.
|
2733
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
2734
|
+
* the JSPB instance for transitional soy proto support:
|
2735
|
+
* http://goto/soy-param-migration
|
2736
|
+
* @param {!proto.user.Role} msg The msg instance to transform.
|
2737
|
+
* @return {!Object}
|
2738
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
2739
|
+
*/
|
2740
|
+
proto.user.Role.toObject = function(includeInstance, msg) {
|
2741
|
+
var f, obj = {
|
2742
|
+
id: jspb.Message.getFieldWithDefault(msg, 1, 0),
|
2743
|
+
title: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
2744
|
+
description: jspb.Message.getFieldWithDefault(msg, 3, "")
|
2745
|
+
};
|
2746
|
+
|
2747
|
+
if (includeInstance) {
|
2748
|
+
obj.$jspbMessageInstance = msg;
|
2749
|
+
}
|
2750
|
+
return obj;
|
2751
|
+
};
|
2752
|
+
}
|
2753
|
+
|
2754
|
+
|
2755
|
+
/**
|
2756
|
+
* Deserializes binary data (in protobuf wire format).
|
2757
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
2758
|
+
* @return {!proto.user.Role}
|
2759
|
+
*/
|
2760
|
+
proto.user.Role.deserializeBinary = function(bytes) {
|
2761
|
+
var reader = new jspb.BinaryReader(bytes);
|
2762
|
+
var msg = new proto.user.Role;
|
2763
|
+
return proto.user.Role.deserializeBinaryFromReader(msg, reader);
|
2764
|
+
};
|
2765
|
+
|
2766
|
+
|
2767
|
+
/**
|
2768
|
+
* Deserializes binary data (in protobuf wire format) from the
|
2769
|
+
* given reader into the given message object.
|
2770
|
+
* @param {!proto.user.Role} msg The message object to deserialize into.
|
2771
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
2772
|
+
* @return {!proto.user.Role}
|
2773
|
+
*/
|
2774
|
+
proto.user.Role.deserializeBinaryFromReader = function(msg, reader) {
|
2775
|
+
while (reader.nextField()) {
|
2776
|
+
if (reader.isEndGroup()) {
|
2777
|
+
break;
|
2778
|
+
}
|
2779
|
+
var field = reader.getFieldNumber();
|
2780
|
+
switch (field) {
|
2781
|
+
case 1:
|
2782
|
+
var value = /** @type {number} */ (reader.readInt32());
|
2783
|
+
msg.setId(value);
|
2784
|
+
break;
|
2785
|
+
case 2:
|
2786
|
+
var value = /** @type {string} */ (reader.readString());
|
2787
|
+
msg.setTitle(value);
|
2788
|
+
break;
|
2789
|
+
case 3:
|
2790
|
+
var value = /** @type {string} */ (reader.readString());
|
2791
|
+
msg.setDescription(value);
|
2792
|
+
break;
|
2793
|
+
default:
|
2794
|
+
reader.skipField();
|
2795
|
+
break;
|
2796
|
+
}
|
2797
|
+
}
|
2798
|
+
return msg;
|
2799
|
+
};
|
2800
|
+
|
2801
|
+
|
2802
|
+
/**
|
2803
|
+
* Serializes the message to binary data (in protobuf wire format).
|
2804
|
+
* @return {!Uint8Array}
|
2805
|
+
*/
|
2806
|
+
proto.user.Role.prototype.serializeBinary = function() {
|
2807
|
+
var writer = new jspb.BinaryWriter();
|
2808
|
+
proto.user.Role.serializeBinaryToWriter(this, writer);
|
2809
|
+
return writer.getResultBuffer();
|
2810
|
+
};
|
2811
|
+
|
2812
|
+
|
2813
|
+
/**
|
2814
|
+
* Serializes the given message to binary data (in protobuf wire
|
2815
|
+
* format), writing to the given BinaryWriter.
|
2816
|
+
* @param {!proto.user.Role} message
|
2817
|
+
* @param {!jspb.BinaryWriter} writer
|
2818
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
2819
|
+
*/
|
2820
|
+
proto.user.Role.serializeBinaryToWriter = function(message, writer) {
|
2821
|
+
var f = undefined;
|
2822
|
+
f = message.getId();
|
2823
|
+
if (f !== 0) {
|
2824
|
+
writer.writeInt32(
|
2825
|
+
1,
|
2826
|
+
f
|
2827
|
+
);
|
2828
|
+
}
|
2829
|
+
f = message.getTitle();
|
2830
|
+
if (f.length > 0) {
|
2831
|
+
writer.writeString(
|
2832
|
+
2,
|
2833
|
+
f
|
2834
|
+
);
|
2835
|
+
}
|
2836
|
+
f = /** @type {string} */ (jspb.Message.getField(message, 3));
|
2837
|
+
if (f != null) {
|
2838
|
+
writer.writeString(
|
2839
|
+
3,
|
2840
|
+
f
|
2841
|
+
);
|
2842
|
+
}
|
2843
|
+
};
|
2844
|
+
|
2845
|
+
|
2846
|
+
/**
|
2847
|
+
* optional int32 id = 1;
|
2848
|
+
* @return {number}
|
2849
|
+
*/
|
2850
|
+
proto.user.Role.prototype.getId = function() {
|
2851
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
|
2852
|
+
};
|
2853
|
+
|
2854
|
+
|
2855
|
+
/**
|
2856
|
+
* @param {number} value
|
2857
|
+
* @return {!proto.user.Role} returns this
|
2858
|
+
*/
|
2859
|
+
proto.user.Role.prototype.setId = function(value) {
|
2860
|
+
return jspb.Message.setProto3IntField(this, 1, value);
|
2861
|
+
};
|
2862
|
+
|
2863
|
+
|
2864
|
+
/**
|
2865
|
+
* optional string title = 2;
|
2866
|
+
* @return {string}
|
2867
|
+
*/
|
2868
|
+
proto.user.Role.prototype.getTitle = function() {
|
2869
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
2870
|
+
};
|
2871
|
+
|
2872
|
+
|
2873
|
+
/**
|
2874
|
+
* @param {string} value
|
2875
|
+
* @return {!proto.user.Role} returns this
|
2876
|
+
*/
|
2877
|
+
proto.user.Role.prototype.setTitle = function(value) {
|
2878
|
+
return jspb.Message.setProto3StringField(this, 2, value);
|
2879
|
+
};
|
2880
|
+
|
2881
|
+
|
2882
|
+
/**
|
2883
|
+
* optional string description = 3;
|
2884
|
+
* @return {string}
|
2885
|
+
*/
|
2886
|
+
proto.user.Role.prototype.getDescription = function() {
|
2887
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
2888
|
+
};
|
2889
|
+
|
2890
|
+
|
2891
|
+
/**
|
2892
|
+
* @param {string} value
|
2893
|
+
* @return {!proto.user.Role} returns this
|
2894
|
+
*/
|
2895
|
+
proto.user.Role.prototype.setDescription = function(value) {
|
2896
|
+
return jspb.Message.setField(this, 3, value);
|
2897
|
+
};
|
2898
|
+
|
2899
|
+
|
2900
|
+
/**
|
2901
|
+
* Clears the field making it undefined.
|
2902
|
+
* @return {!proto.user.Role} returns this
|
2903
|
+
*/
|
2904
|
+
proto.user.Role.prototype.clearDescription = function() {
|
2905
|
+
return jspb.Message.setField(this, 3, undefined);
|
2906
|
+
};
|
2907
|
+
|
2908
|
+
|
2909
|
+
/**
|
2910
|
+
* Returns whether this field is set.
|
2911
|
+
* @return {boolean}
|
2912
|
+
*/
|
2913
|
+
proto.user.Role.prototype.hasDescription = function() {
|
2914
|
+
return jspb.Message.getField(this, 3) != null;
|
2915
|
+
};
|
2916
|
+
|
2917
|
+
|
2918
|
+
|
2919
|
+
/**
|
2920
|
+
* List of repeated fields within this message type.
|
2921
|
+
* @private {!Array<number>}
|
2922
|
+
* @const
|
2923
|
+
*/
|
2924
|
+
proto.user.RolesItemsResponse.repeatedFields_ = [1];
|
2925
|
+
|
2926
|
+
|
2927
|
+
|
2928
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
2929
|
+
/**
|
2930
|
+
* Creates an object representation of this proto.
|
2931
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
2932
|
+
* Optional fields that are not set will be set to undefined.
|
2933
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
2934
|
+
* For the list of reserved names please see:
|
2935
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
2936
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
2937
|
+
* JSPB instance for transitional soy proto support:
|
2938
|
+
* http://goto/soy-param-migration
|
2939
|
+
* @return {!Object}
|
2940
|
+
*/
|
2941
|
+
proto.user.RolesItemsResponse.prototype.toObject = function(opt_includeInstance) {
|
2942
|
+
return proto.user.RolesItemsResponse.toObject(opt_includeInstance, this);
|
2943
|
+
};
|
2944
|
+
|
2945
|
+
|
2946
|
+
/**
|
2947
|
+
* Static version of the {@see toObject} method.
|
2948
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
2949
|
+
* the JSPB instance for transitional soy proto support:
|
2950
|
+
* http://goto/soy-param-migration
|
2951
|
+
* @param {!proto.user.RolesItemsResponse} msg The msg instance to transform.
|
2952
|
+
* @return {!Object}
|
2953
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
2954
|
+
*/
|
2955
|
+
proto.user.RolesItemsResponse.toObject = function(includeInstance, msg) {
|
2956
|
+
var f, obj = {
|
2957
|
+
rolesList: jspb.Message.toObjectList(msg.getRolesList(),
|
2958
|
+
proto.user.Role.toObject, includeInstance),
|
2959
|
+
totalItems: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
2960
|
+
totalPages: jspb.Message.getFieldWithDefault(msg, 3, 0)
|
2961
|
+
};
|
2962
|
+
|
2963
|
+
if (includeInstance) {
|
2964
|
+
obj.$jspbMessageInstance = msg;
|
2965
|
+
}
|
2966
|
+
return obj;
|
2967
|
+
};
|
2968
|
+
}
|
2969
|
+
|
2970
|
+
|
2971
|
+
/**
|
2972
|
+
* Deserializes binary data (in protobuf wire format).
|
2973
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
2974
|
+
* @return {!proto.user.RolesItemsResponse}
|
2975
|
+
*/
|
2976
|
+
proto.user.RolesItemsResponse.deserializeBinary = function(bytes) {
|
2977
|
+
var reader = new jspb.BinaryReader(bytes);
|
2978
|
+
var msg = new proto.user.RolesItemsResponse;
|
2979
|
+
return proto.user.RolesItemsResponse.deserializeBinaryFromReader(msg, reader);
|
2980
|
+
};
|
2981
|
+
|
2982
|
+
|
2983
|
+
/**
|
2984
|
+
* Deserializes binary data (in protobuf wire format) from the
|
2985
|
+
* given reader into the given message object.
|
2986
|
+
* @param {!proto.user.RolesItemsResponse} msg The message object to deserialize into.
|
2987
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
2988
|
+
* @return {!proto.user.RolesItemsResponse}
|
2989
|
+
*/
|
2990
|
+
proto.user.RolesItemsResponse.deserializeBinaryFromReader = function(msg, reader) {
|
2991
|
+
while (reader.nextField()) {
|
2992
|
+
if (reader.isEndGroup()) {
|
2993
|
+
break;
|
2994
|
+
}
|
2995
|
+
var field = reader.getFieldNumber();
|
2996
|
+
switch (field) {
|
2997
|
+
case 1:
|
2998
|
+
var value = new proto.user.Role;
|
2999
|
+
reader.readMessage(value,proto.user.Role.deserializeBinaryFromReader);
|
3000
|
+
msg.addRoles(value);
|
3001
|
+
break;
|
3002
|
+
case 2:
|
3003
|
+
var value = /** @type {number} */ (reader.readInt32());
|
3004
|
+
msg.setTotalItems(value);
|
3005
|
+
break;
|
3006
|
+
case 3:
|
3007
|
+
var value = /** @type {number} */ (reader.readInt32());
|
3008
|
+
msg.setTotalPages(value);
|
3009
|
+
break;
|
3010
|
+
default:
|
3011
|
+
reader.skipField();
|
3012
|
+
break;
|
3013
|
+
}
|
3014
|
+
}
|
3015
|
+
return msg;
|
3016
|
+
};
|
3017
|
+
|
3018
|
+
|
3019
|
+
/**
|
3020
|
+
* Serializes the message to binary data (in protobuf wire format).
|
3021
|
+
* @return {!Uint8Array}
|
3022
|
+
*/
|
3023
|
+
proto.user.RolesItemsResponse.prototype.serializeBinary = function() {
|
3024
|
+
var writer = new jspb.BinaryWriter();
|
3025
|
+
proto.user.RolesItemsResponse.serializeBinaryToWriter(this, writer);
|
3026
|
+
return writer.getResultBuffer();
|
3027
|
+
};
|
3028
|
+
|
3029
|
+
|
3030
|
+
/**
|
3031
|
+
* Serializes the given message to binary data (in protobuf wire
|
3032
|
+
* format), writing to the given BinaryWriter.
|
3033
|
+
* @param {!proto.user.RolesItemsResponse} message
|
3034
|
+
* @param {!jspb.BinaryWriter} writer
|
3035
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
3036
|
+
*/
|
3037
|
+
proto.user.RolesItemsResponse.serializeBinaryToWriter = function(message, writer) {
|
3038
|
+
var f = undefined;
|
3039
|
+
f = message.getRolesList();
|
3040
|
+
if (f.length > 0) {
|
3041
|
+
writer.writeRepeatedMessage(
|
3042
|
+
1,
|
3043
|
+
f,
|
3044
|
+
proto.user.Role.serializeBinaryToWriter
|
3045
|
+
);
|
3046
|
+
}
|
3047
|
+
f = message.getTotalItems();
|
3048
|
+
if (f !== 0) {
|
3049
|
+
writer.writeInt32(
|
3050
|
+
2,
|
3051
|
+
f
|
3052
|
+
);
|
3053
|
+
}
|
3054
|
+
f = message.getTotalPages();
|
3055
|
+
if (f !== 0) {
|
3056
|
+
writer.writeInt32(
|
3057
|
+
3,
|
3058
|
+
f
|
3059
|
+
);
|
3060
|
+
}
|
3061
|
+
};
|
3062
|
+
|
3063
|
+
|
3064
|
+
/**
|
3065
|
+
* repeated Role roles = 1;
|
3066
|
+
* @return {!Array<!proto.user.Role>}
|
3067
|
+
*/
|
3068
|
+
proto.user.RolesItemsResponse.prototype.getRolesList = function() {
|
3069
|
+
return /** @type{!Array<!proto.user.Role>} */ (
|
3070
|
+
jspb.Message.getRepeatedWrapperField(this, proto.user.Role, 1));
|
3071
|
+
};
|
3072
|
+
|
3073
|
+
|
3074
|
+
/**
|
3075
|
+
* @param {!Array<!proto.user.Role>} value
|
3076
|
+
* @return {!proto.user.RolesItemsResponse} returns this
|
3077
|
+
*/
|
3078
|
+
proto.user.RolesItemsResponse.prototype.setRolesList = function(value) {
|
3079
|
+
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
3080
|
+
};
|
3081
|
+
|
3082
|
+
|
3083
|
+
/**
|
3084
|
+
* @param {!proto.user.Role=} opt_value
|
3085
|
+
* @param {number=} opt_index
|
3086
|
+
* @return {!proto.user.Role}
|
3087
|
+
*/
|
3088
|
+
proto.user.RolesItemsResponse.prototype.addRoles = function(opt_value, opt_index) {
|
3089
|
+
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.user.Role, opt_index);
|
3090
|
+
};
|
3091
|
+
|
3092
|
+
|
3093
|
+
/**
|
3094
|
+
* Clears the list making it empty but non-null.
|
3095
|
+
* @return {!proto.user.RolesItemsResponse} returns this
|
3096
|
+
*/
|
3097
|
+
proto.user.RolesItemsResponse.prototype.clearRolesList = function() {
|
3098
|
+
return this.setRolesList([]);
|
3099
|
+
};
|
3100
|
+
|
3101
|
+
|
3102
|
+
/**
|
3103
|
+
* optional int32 total_items = 2;
|
3104
|
+
* @return {number}
|
3105
|
+
*/
|
3106
|
+
proto.user.RolesItemsResponse.prototype.getTotalItems = function() {
|
3107
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
|
3108
|
+
};
|
3109
|
+
|
3110
|
+
|
3111
|
+
/**
|
3112
|
+
* @param {number} value
|
3113
|
+
* @return {!proto.user.RolesItemsResponse} returns this
|
3114
|
+
*/
|
3115
|
+
proto.user.RolesItemsResponse.prototype.setTotalItems = function(value) {
|
3116
|
+
return jspb.Message.setProto3IntField(this, 2, value);
|
3117
|
+
};
|
3118
|
+
|
3119
|
+
|
3120
|
+
/**
|
3121
|
+
* optional int32 total_pages = 3;
|
3122
|
+
* @return {number}
|
3123
|
+
*/
|
3124
|
+
proto.user.RolesItemsResponse.prototype.getTotalPages = function() {
|
3125
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
|
3126
|
+
};
|
3127
|
+
|
3128
|
+
|
3129
|
+
/**
|
3130
|
+
* @param {number} value
|
3131
|
+
* @return {!proto.user.RolesItemsResponse} returns this
|
3132
|
+
*/
|
3133
|
+
proto.user.RolesItemsResponse.prototype.setTotalPages = function(value) {
|
3134
|
+
return jspb.Message.setProto3IntField(this, 3, value);
|
3135
|
+
};
|
3136
|
+
|
3137
|
+
|
2436
3138
|
goog.object.extend(exports, proto.user);
|