protobuf-platform 1.0.58 → 1.0.59

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.58",
3
+ "version": "1.0.59",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/user/user.proto CHANGED
@@ -11,6 +11,7 @@ service User {
11
11
  //Role and Permissions
12
12
  rpc addPermissionToUserRole(RolePermissionRequest) returns (RolePermissionStatusResponse);
13
13
  rpc rolesList(PaginationRequest) returns (RolesItemsResponse);
14
+ rpc getSingleRole(GetRoleRequest) returns (Role);
14
15
  }
15
16
 
16
17
  message PingRequest { string ping = 1; }
@@ -73,7 +74,9 @@ message Role {
73
74
  int32 id = 1;
74
75
  string title = 2;
75
76
  optional string description = 3;
77
+ optional string permissions = 4;
76
78
  }
79
+ message GetRoleRequest { int32 id = 1; }
77
80
  message RolesItemsResponse {
78
81
  repeated Role items = 1;
79
82
  int32 total_items = 2;
@@ -4,6 +4,17 @@
4
4
  var grpc = require('@grpc/grpc-js');
5
5
  var user_pb = require('./user_pb.js');
6
6
 
7
+ function serialize_user_GetRoleRequest(arg) {
8
+ if (!(arg instanceof user_pb.GetRoleRequest)) {
9
+ throw new Error('Expected argument of type user.GetRoleRequest');
10
+ }
11
+ return Buffer.from(arg.serializeBinary());
12
+ }
13
+
14
+ function deserialize_user_GetRoleRequest(buffer_arg) {
15
+ return user_pb.GetRoleRequest.deserializeBinary(new Uint8Array(buffer_arg));
16
+ }
17
+
7
18
  function serialize_user_LoggedInResponse(arg) {
8
19
  if (!(arg instanceof user_pb.LoggedInResponse)) {
9
20
  throw new Error('Expected argument of type user.LoggedInResponse');
@@ -70,6 +81,17 @@ function deserialize_user_RegistrationRequest(buffer_arg) {
70
81
  return user_pb.RegistrationRequest.deserializeBinary(new Uint8Array(buffer_arg));
71
82
  }
72
83
 
84
+ function serialize_user_Role(arg) {
85
+ if (!(arg instanceof user_pb.Role)) {
86
+ throw new Error('Expected argument of type user.Role');
87
+ }
88
+ return Buffer.from(arg.serializeBinary());
89
+ }
90
+
91
+ function deserialize_user_Role(buffer_arg) {
92
+ return user_pb.Role.deserializeBinary(new Uint8Array(buffer_arg));
93
+ }
94
+
73
95
  function serialize_user_RolePermissionRequest(arg) {
74
96
  if (!(arg instanceof user_pb.RolePermissionRequest)) {
75
97
  throw new Error('Expected argument of type user.RolePermissionRequest');
@@ -195,6 +217,17 @@ addPermissionToUserRole: {
195
217
  responseSerialize: serialize_user_RolesItemsResponse,
196
218
  responseDeserialize: deserialize_user_RolesItemsResponse,
197
219
  },
220
+ getSingleRole: {
221
+ path: '/user.User/getSingleRole',
222
+ requestStream: false,
223
+ responseStream: false,
224
+ requestType: user_pb.GetRoleRequest,
225
+ responseType: user_pb.Role,
226
+ requestSerialize: serialize_user_GetRoleRequest,
227
+ requestDeserialize: deserialize_user_GetRoleRequest,
228
+ responseSerialize: serialize_user_Role,
229
+ responseDeserialize: deserialize_user_Role,
230
+ },
198
231
  };
199
232
 
200
233
  exports.UserClient = grpc.makeGenericClientConstructor(UserService);
package/user/user_pb.js CHANGED
@@ -21,6 +21,7 @@ var global = (function() {
21
21
  return Function('return this')();
22
22
  }.call(null));
23
23
 
24
+ goog.exportSymbol('proto.user.GetRoleRequest', null, global);
24
25
  goog.exportSymbol('proto.user.LoggedInResponse', null, global);
25
26
  goog.exportSymbol('proto.user.LoginRequest', null, global);
26
27
  goog.exportSymbol('proto.user.PaginationRequest', null, global);
@@ -264,6 +265,27 @@ if (goog.DEBUG && !COMPILED) {
264
265
  */
265
266
  proto.user.Role.displayName = 'proto.user.Role';
266
267
  }
268
+ /**
269
+ * Generated by JsPbCodeGenerator.
270
+ * @param {Array=} opt_data Optional initial data array, typically from a
271
+ * server response, or constructed directly in Javascript. The array is used
272
+ * in place and becomes part of the constructed object. It is not cloned.
273
+ * If no data is provided, the constructed object will be empty, but still
274
+ * valid.
275
+ * @extends {jspb.Message}
276
+ * @constructor
277
+ */
278
+ proto.user.GetRoleRequest = function(opt_data) {
279
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
280
+ };
281
+ goog.inherits(proto.user.GetRoleRequest, jspb.Message);
282
+ if (goog.DEBUG && !COMPILED) {
283
+ /**
284
+ * @public
285
+ * @override
286
+ */
287
+ proto.user.GetRoleRequest.displayName = 'proto.user.GetRoleRequest';
288
+ }
267
289
  /**
268
290
  * Generated by JsPbCodeGenerator.
269
291
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -2741,7 +2763,8 @@ proto.user.Role.toObject = function(includeInstance, msg) {
2741
2763
  var f, obj = {
2742
2764
  id: jspb.Message.getFieldWithDefault(msg, 1, 0),
2743
2765
  title: jspb.Message.getFieldWithDefault(msg, 2, ""),
2744
- description: jspb.Message.getFieldWithDefault(msg, 3, "")
2766
+ description: jspb.Message.getFieldWithDefault(msg, 3, ""),
2767
+ permissions: jspb.Message.getFieldWithDefault(msg, 4, "")
2745
2768
  };
2746
2769
 
2747
2770
  if (includeInstance) {
@@ -2790,6 +2813,10 @@ proto.user.Role.deserializeBinaryFromReader = function(msg, reader) {
2790
2813
  var value = /** @type {string} */ (reader.readString());
2791
2814
  msg.setDescription(value);
2792
2815
  break;
2816
+ case 4:
2817
+ var value = /** @type {string} */ (reader.readString());
2818
+ msg.setPermissions(value);
2819
+ break;
2793
2820
  default:
2794
2821
  reader.skipField();
2795
2822
  break;
@@ -2840,6 +2867,13 @@ proto.user.Role.serializeBinaryToWriter = function(message, writer) {
2840
2867
  f
2841
2868
  );
2842
2869
  }
2870
+ f = /** @type {string} */ (jspb.Message.getField(message, 4));
2871
+ if (f != null) {
2872
+ writer.writeString(
2873
+ 4,
2874
+ f
2875
+ );
2876
+ }
2843
2877
  };
2844
2878
 
2845
2879
 
@@ -2915,6 +2949,172 @@ proto.user.Role.prototype.hasDescription = function() {
2915
2949
  };
2916
2950
 
2917
2951
 
2952
+ /**
2953
+ * optional string permissions = 4;
2954
+ * @return {string}
2955
+ */
2956
+ proto.user.Role.prototype.getPermissions = function() {
2957
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
2958
+ };
2959
+
2960
+
2961
+ /**
2962
+ * @param {string} value
2963
+ * @return {!proto.user.Role} returns this
2964
+ */
2965
+ proto.user.Role.prototype.setPermissions = function(value) {
2966
+ return jspb.Message.setField(this, 4, value);
2967
+ };
2968
+
2969
+
2970
+ /**
2971
+ * Clears the field making it undefined.
2972
+ * @return {!proto.user.Role} returns this
2973
+ */
2974
+ proto.user.Role.prototype.clearPermissions = function() {
2975
+ return jspb.Message.setField(this, 4, undefined);
2976
+ };
2977
+
2978
+
2979
+ /**
2980
+ * Returns whether this field is set.
2981
+ * @return {boolean}
2982
+ */
2983
+ proto.user.Role.prototype.hasPermissions = function() {
2984
+ return jspb.Message.getField(this, 4) != null;
2985
+ };
2986
+
2987
+
2988
+
2989
+
2990
+
2991
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2992
+ /**
2993
+ * Creates an object representation of this proto.
2994
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2995
+ * Optional fields that are not set will be set to undefined.
2996
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2997
+ * For the list of reserved names please see:
2998
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2999
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
3000
+ * JSPB instance for transitional soy proto support:
3001
+ * http://goto/soy-param-migration
3002
+ * @return {!Object}
3003
+ */
3004
+ proto.user.GetRoleRequest.prototype.toObject = function(opt_includeInstance) {
3005
+ return proto.user.GetRoleRequest.toObject(opt_includeInstance, this);
3006
+ };
3007
+
3008
+
3009
+ /**
3010
+ * Static version of the {@see toObject} method.
3011
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
3012
+ * the JSPB instance for transitional soy proto support:
3013
+ * http://goto/soy-param-migration
3014
+ * @param {!proto.user.GetRoleRequest} msg The msg instance to transform.
3015
+ * @return {!Object}
3016
+ * @suppress {unusedLocalVariables} f is only used for nested messages
3017
+ */
3018
+ proto.user.GetRoleRequest.toObject = function(includeInstance, msg) {
3019
+ var f, obj = {
3020
+ id: jspb.Message.getFieldWithDefault(msg, 1, 0)
3021
+ };
3022
+
3023
+ if (includeInstance) {
3024
+ obj.$jspbMessageInstance = msg;
3025
+ }
3026
+ return obj;
3027
+ };
3028
+ }
3029
+
3030
+
3031
+ /**
3032
+ * Deserializes binary data (in protobuf wire format).
3033
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
3034
+ * @return {!proto.user.GetRoleRequest}
3035
+ */
3036
+ proto.user.GetRoleRequest.deserializeBinary = function(bytes) {
3037
+ var reader = new jspb.BinaryReader(bytes);
3038
+ var msg = new proto.user.GetRoleRequest;
3039
+ return proto.user.GetRoleRequest.deserializeBinaryFromReader(msg, reader);
3040
+ };
3041
+
3042
+
3043
+ /**
3044
+ * Deserializes binary data (in protobuf wire format) from the
3045
+ * given reader into the given message object.
3046
+ * @param {!proto.user.GetRoleRequest} msg The message object to deserialize into.
3047
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
3048
+ * @return {!proto.user.GetRoleRequest}
3049
+ */
3050
+ proto.user.GetRoleRequest.deserializeBinaryFromReader = function(msg, reader) {
3051
+ while (reader.nextField()) {
3052
+ if (reader.isEndGroup()) {
3053
+ break;
3054
+ }
3055
+ var field = reader.getFieldNumber();
3056
+ switch (field) {
3057
+ case 1:
3058
+ var value = /** @type {number} */ (reader.readInt32());
3059
+ msg.setId(value);
3060
+ break;
3061
+ default:
3062
+ reader.skipField();
3063
+ break;
3064
+ }
3065
+ }
3066
+ return msg;
3067
+ };
3068
+
3069
+
3070
+ /**
3071
+ * Serializes the message to binary data (in protobuf wire format).
3072
+ * @return {!Uint8Array}
3073
+ */
3074
+ proto.user.GetRoleRequest.prototype.serializeBinary = function() {
3075
+ var writer = new jspb.BinaryWriter();
3076
+ proto.user.GetRoleRequest.serializeBinaryToWriter(this, writer);
3077
+ return writer.getResultBuffer();
3078
+ };
3079
+
3080
+
3081
+ /**
3082
+ * Serializes the given message to binary data (in protobuf wire
3083
+ * format), writing to the given BinaryWriter.
3084
+ * @param {!proto.user.GetRoleRequest} message
3085
+ * @param {!jspb.BinaryWriter} writer
3086
+ * @suppress {unusedLocalVariables} f is only used for nested messages
3087
+ */
3088
+ proto.user.GetRoleRequest.serializeBinaryToWriter = function(message, writer) {
3089
+ var f = undefined;
3090
+ f = message.getId();
3091
+ if (f !== 0) {
3092
+ writer.writeInt32(
3093
+ 1,
3094
+ f
3095
+ );
3096
+ }
3097
+ };
3098
+
3099
+
3100
+ /**
3101
+ * optional int32 id = 1;
3102
+ * @return {number}
3103
+ */
3104
+ proto.user.GetRoleRequest.prototype.getId = function() {
3105
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
3106
+ };
3107
+
3108
+
3109
+ /**
3110
+ * @param {number} value
3111
+ * @return {!proto.user.GetRoleRequest} returns this
3112
+ */
3113
+ proto.user.GetRoleRequest.prototype.setId = function(value) {
3114
+ return jspb.Message.setProto3IntField(this, 1, value);
3115
+ };
3116
+
3117
+
2918
3118
 
2919
3119
  /**
2920
3120
  * List of repeated fields within this message type.