protobuf-platform 1.0.43 → 1.0.44

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.43",
3
+ "version": "1.0.44",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/user/user.proto CHANGED
@@ -8,6 +8,8 @@ service User {
8
8
  rpc signUp(RegistrationRequest) returns (LoggedInResponse);
9
9
  rpc signIn(LoginRequest) returns (LoggedInResponse);
10
10
  rpc getUserData(UserDataRequest) returns (UserDataResponse);
11
+ //Role and Permissions
12
+ rpc addPermissionToUserRole(RolePermissionRequest) returns (RolePermissionStatusResponse);
11
13
  }
12
14
 
13
15
  message PingRequest { string ping = 1; }
@@ -50,3 +52,13 @@ message UserDataResponse {
50
52
  optional string birthday = 8;
51
53
  optional string locale = 9;
52
54
  }
55
+ //Permissions
56
+ message RolePermissionRequest {
57
+ string role = 1;
58
+ string section1 = 2;
59
+ optional string section2 = 3;
60
+ optional string section3 = 4;
61
+ }
62
+ message RolePermissionStatusResponse {
63
+ string status = 1;
64
+ }
@@ -59,6 +59,28 @@ function deserialize_user_RegistrationRequest(buffer_arg) {
59
59
  return user_pb.RegistrationRequest.deserializeBinary(new Uint8Array(buffer_arg));
60
60
  }
61
61
 
62
+ function serialize_user_RolePermissionRequest(arg) {
63
+ if (!(arg instanceof user_pb.RolePermissionRequest)) {
64
+ throw new Error('Expected argument of type user.RolePermissionRequest');
65
+ }
66
+ return Buffer.from(arg.serializeBinary());
67
+ }
68
+
69
+ function deserialize_user_RolePermissionRequest(buffer_arg) {
70
+ return user_pb.RolePermissionRequest.deserializeBinary(new Uint8Array(buffer_arg));
71
+ }
72
+
73
+ function serialize_user_RolePermissionStatusResponse(arg) {
74
+ if (!(arg instanceof user_pb.RolePermissionStatusResponse)) {
75
+ throw new Error('Expected argument of type user.RolePermissionStatusResponse');
76
+ }
77
+ return Buffer.from(arg.serializeBinary());
78
+ }
79
+
80
+ function deserialize_user_RolePermissionStatusResponse(buffer_arg) {
81
+ return user_pb.RolePermissionStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
82
+ }
83
+
62
84
  function serialize_user_UserDataRequest(arg) {
63
85
  if (!(arg instanceof user_pb.UserDataRequest)) {
64
86
  throw new Error('Expected argument of type user.UserDataRequest');
@@ -128,6 +150,18 @@ signUp: {
128
150
  responseSerialize: serialize_user_UserDataResponse,
129
151
  responseDeserialize: deserialize_user_UserDataResponse,
130
152
  },
153
+ // Role and Permissions
154
+ addPermissionToUserRole: {
155
+ path: '/user.User/addPermissionToUserRole',
156
+ requestStream: false,
157
+ responseStream: false,
158
+ requestType: user_pb.RolePermissionRequest,
159
+ responseType: user_pb.RolePermissionStatusResponse,
160
+ requestSerialize: serialize_user_RolePermissionRequest,
161
+ requestDeserialize: deserialize_user_RolePermissionRequest,
162
+ responseSerialize: serialize_user_RolePermissionStatusResponse,
163
+ responseDeserialize: deserialize_user_RolePermissionStatusResponse,
164
+ },
131
165
  };
132
166
 
133
167
  exports.UserClient = grpc.makeGenericClientConstructor(UserService);
package/user/user_pb.js CHANGED
@@ -26,6 +26,8 @@ goog.exportSymbol('proto.user.LoginRequest', null, global);
26
26
  goog.exportSymbol('proto.user.PingRequest', null, global);
27
27
  goog.exportSymbol('proto.user.PongResponse', null, global);
28
28
  goog.exportSymbol('proto.user.RegistrationRequest', null, global);
29
+ goog.exportSymbol('proto.user.RolePermissionRequest', null, global);
30
+ goog.exportSymbol('proto.user.RolePermissionStatusResponse', null, global);
29
31
  goog.exportSymbol('proto.user.UserDataRequest', null, global);
30
32
  goog.exportSymbol('proto.user.UserDataResponse', null, global);
31
33
  /**
@@ -175,6 +177,48 @@ if (goog.DEBUG && !COMPILED) {
175
177
  */
176
178
  proto.user.UserDataResponse.displayName = 'proto.user.UserDataResponse';
177
179
  }
180
+ /**
181
+ * Generated by JsPbCodeGenerator.
182
+ * @param {Array=} opt_data Optional initial data array, typically from a
183
+ * server response, or constructed directly in Javascript. The array is used
184
+ * in place and becomes part of the constructed object. It is not cloned.
185
+ * If no data is provided, the constructed object will be empty, but still
186
+ * valid.
187
+ * @extends {jspb.Message}
188
+ * @constructor
189
+ */
190
+ proto.user.RolePermissionRequest = function(opt_data) {
191
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
192
+ };
193
+ goog.inherits(proto.user.RolePermissionRequest, jspb.Message);
194
+ if (goog.DEBUG && !COMPILED) {
195
+ /**
196
+ * @public
197
+ * @override
198
+ */
199
+ proto.user.RolePermissionRequest.displayName = 'proto.user.RolePermissionRequest';
200
+ }
201
+ /**
202
+ * Generated by JsPbCodeGenerator.
203
+ * @param {Array=} opt_data Optional initial data array, typically from a
204
+ * server response, or constructed directly in Javascript. The array is used
205
+ * in place and becomes part of the constructed object. It is not cloned.
206
+ * If no data is provided, the constructed object will be empty, but still
207
+ * valid.
208
+ * @extends {jspb.Message}
209
+ * @constructor
210
+ */
211
+ proto.user.RolePermissionStatusResponse = function(opt_data) {
212
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
213
+ };
214
+ goog.inherits(proto.user.RolePermissionStatusResponse, jspb.Message);
215
+ if (goog.DEBUG && !COMPILED) {
216
+ /**
217
+ * @public
218
+ * @override
219
+ */
220
+ proto.user.RolePermissionStatusResponse.displayName = 'proto.user.RolePermissionStatusResponse';
221
+ }
178
222
 
179
223
 
180
224
 
@@ -1913,4 +1957,390 @@ proto.user.UserDataResponse.prototype.hasLocale = function() {
1913
1957
  };
1914
1958
 
1915
1959
 
1960
+
1961
+
1962
+
1963
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1964
+ /**
1965
+ * Creates an object representation of this proto.
1966
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1967
+ * Optional fields that are not set will be set to undefined.
1968
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1969
+ * For the list of reserved names please see:
1970
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1971
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1972
+ * JSPB instance for transitional soy proto support:
1973
+ * http://goto/soy-param-migration
1974
+ * @return {!Object}
1975
+ */
1976
+ proto.user.RolePermissionRequest.prototype.toObject = function(opt_includeInstance) {
1977
+ return proto.user.RolePermissionRequest.toObject(opt_includeInstance, this);
1978
+ };
1979
+
1980
+
1981
+ /**
1982
+ * Static version of the {@see toObject} method.
1983
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1984
+ * the JSPB instance for transitional soy proto support:
1985
+ * http://goto/soy-param-migration
1986
+ * @param {!proto.user.RolePermissionRequest} msg The msg instance to transform.
1987
+ * @return {!Object}
1988
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1989
+ */
1990
+ proto.user.RolePermissionRequest.toObject = function(includeInstance, msg) {
1991
+ var f, obj = {
1992
+ role: jspb.Message.getFieldWithDefault(msg, 1, ""),
1993
+ section1: jspb.Message.getFieldWithDefault(msg, 2, ""),
1994
+ section2: jspb.Message.getFieldWithDefault(msg, 3, ""),
1995
+ section3: jspb.Message.getFieldWithDefault(msg, 4, "")
1996
+ };
1997
+
1998
+ if (includeInstance) {
1999
+ obj.$jspbMessageInstance = msg;
2000
+ }
2001
+ return obj;
2002
+ };
2003
+ }
2004
+
2005
+
2006
+ /**
2007
+ * Deserializes binary data (in protobuf wire format).
2008
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2009
+ * @return {!proto.user.RolePermissionRequest}
2010
+ */
2011
+ proto.user.RolePermissionRequest.deserializeBinary = function(bytes) {
2012
+ var reader = new jspb.BinaryReader(bytes);
2013
+ var msg = new proto.user.RolePermissionRequest;
2014
+ return proto.user.RolePermissionRequest.deserializeBinaryFromReader(msg, reader);
2015
+ };
2016
+
2017
+
2018
+ /**
2019
+ * Deserializes binary data (in protobuf wire format) from the
2020
+ * given reader into the given message object.
2021
+ * @param {!proto.user.RolePermissionRequest} msg The message object to deserialize into.
2022
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2023
+ * @return {!proto.user.RolePermissionRequest}
2024
+ */
2025
+ proto.user.RolePermissionRequest.deserializeBinaryFromReader = function(msg, reader) {
2026
+ while (reader.nextField()) {
2027
+ if (reader.isEndGroup()) {
2028
+ break;
2029
+ }
2030
+ var field = reader.getFieldNumber();
2031
+ switch (field) {
2032
+ case 1:
2033
+ var value = /** @type {string} */ (reader.readString());
2034
+ msg.setRole(value);
2035
+ break;
2036
+ case 2:
2037
+ var value = /** @type {string} */ (reader.readString());
2038
+ msg.setSection1(value);
2039
+ break;
2040
+ case 3:
2041
+ var value = /** @type {string} */ (reader.readString());
2042
+ msg.setSection2(value);
2043
+ break;
2044
+ case 4:
2045
+ var value = /** @type {string} */ (reader.readString());
2046
+ msg.setSection3(value);
2047
+ break;
2048
+ default:
2049
+ reader.skipField();
2050
+ break;
2051
+ }
2052
+ }
2053
+ return msg;
2054
+ };
2055
+
2056
+
2057
+ /**
2058
+ * Serializes the message to binary data (in protobuf wire format).
2059
+ * @return {!Uint8Array}
2060
+ */
2061
+ proto.user.RolePermissionRequest.prototype.serializeBinary = function() {
2062
+ var writer = new jspb.BinaryWriter();
2063
+ proto.user.RolePermissionRequest.serializeBinaryToWriter(this, writer);
2064
+ return writer.getResultBuffer();
2065
+ };
2066
+
2067
+
2068
+ /**
2069
+ * Serializes the given message to binary data (in protobuf wire
2070
+ * format), writing to the given BinaryWriter.
2071
+ * @param {!proto.user.RolePermissionRequest} message
2072
+ * @param {!jspb.BinaryWriter} writer
2073
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2074
+ */
2075
+ proto.user.RolePermissionRequest.serializeBinaryToWriter = function(message, writer) {
2076
+ var f = undefined;
2077
+ f = message.getRole();
2078
+ if (f.length > 0) {
2079
+ writer.writeString(
2080
+ 1,
2081
+ f
2082
+ );
2083
+ }
2084
+ f = message.getSection1();
2085
+ if (f.length > 0) {
2086
+ writer.writeString(
2087
+ 2,
2088
+ f
2089
+ );
2090
+ }
2091
+ f = /** @type {string} */ (jspb.Message.getField(message, 3));
2092
+ if (f != null) {
2093
+ writer.writeString(
2094
+ 3,
2095
+ f
2096
+ );
2097
+ }
2098
+ f = /** @type {string} */ (jspb.Message.getField(message, 4));
2099
+ if (f != null) {
2100
+ writer.writeString(
2101
+ 4,
2102
+ f
2103
+ );
2104
+ }
2105
+ };
2106
+
2107
+
2108
+ /**
2109
+ * optional string role = 1;
2110
+ * @return {string}
2111
+ */
2112
+ proto.user.RolePermissionRequest.prototype.getRole = function() {
2113
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
2114
+ };
2115
+
2116
+
2117
+ /**
2118
+ * @param {string} value
2119
+ * @return {!proto.user.RolePermissionRequest} returns this
2120
+ */
2121
+ proto.user.RolePermissionRequest.prototype.setRole = function(value) {
2122
+ return jspb.Message.setProto3StringField(this, 1, value);
2123
+ };
2124
+
2125
+
2126
+ /**
2127
+ * optional string section1 = 2;
2128
+ * @return {string}
2129
+ */
2130
+ proto.user.RolePermissionRequest.prototype.getSection1 = function() {
2131
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
2132
+ };
2133
+
2134
+
2135
+ /**
2136
+ * @param {string} value
2137
+ * @return {!proto.user.RolePermissionRequest} returns this
2138
+ */
2139
+ proto.user.RolePermissionRequest.prototype.setSection1 = function(value) {
2140
+ return jspb.Message.setProto3StringField(this, 2, value);
2141
+ };
2142
+
2143
+
2144
+ /**
2145
+ * optional string section2 = 3;
2146
+ * @return {string}
2147
+ */
2148
+ proto.user.RolePermissionRequest.prototype.getSection2 = function() {
2149
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
2150
+ };
2151
+
2152
+
2153
+ /**
2154
+ * @param {string} value
2155
+ * @return {!proto.user.RolePermissionRequest} returns this
2156
+ */
2157
+ proto.user.RolePermissionRequest.prototype.setSection2 = function(value) {
2158
+ return jspb.Message.setField(this, 3, value);
2159
+ };
2160
+
2161
+
2162
+ /**
2163
+ * Clears the field making it undefined.
2164
+ * @return {!proto.user.RolePermissionRequest} returns this
2165
+ */
2166
+ proto.user.RolePermissionRequest.prototype.clearSection2 = function() {
2167
+ return jspb.Message.setField(this, 3, undefined);
2168
+ };
2169
+
2170
+
2171
+ /**
2172
+ * Returns whether this field is set.
2173
+ * @return {boolean}
2174
+ */
2175
+ proto.user.RolePermissionRequest.prototype.hasSection2 = function() {
2176
+ return jspb.Message.getField(this, 3) != null;
2177
+ };
2178
+
2179
+
2180
+ /**
2181
+ * optional string section3 = 4;
2182
+ * @return {string}
2183
+ */
2184
+ proto.user.RolePermissionRequest.prototype.getSection3 = function() {
2185
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
2186
+ };
2187
+
2188
+
2189
+ /**
2190
+ * @param {string} value
2191
+ * @return {!proto.user.RolePermissionRequest} returns this
2192
+ */
2193
+ proto.user.RolePermissionRequest.prototype.setSection3 = function(value) {
2194
+ return jspb.Message.setField(this, 4, value);
2195
+ };
2196
+
2197
+
2198
+ /**
2199
+ * Clears the field making it undefined.
2200
+ * @return {!proto.user.RolePermissionRequest} returns this
2201
+ */
2202
+ proto.user.RolePermissionRequest.prototype.clearSection3 = function() {
2203
+ return jspb.Message.setField(this, 4, undefined);
2204
+ };
2205
+
2206
+
2207
+ /**
2208
+ * Returns whether this field is set.
2209
+ * @return {boolean}
2210
+ */
2211
+ proto.user.RolePermissionRequest.prototype.hasSection3 = function() {
2212
+ return jspb.Message.getField(this, 4) != null;
2213
+ };
2214
+
2215
+
2216
+
2217
+
2218
+
2219
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2220
+ /**
2221
+ * Creates an object representation of this proto.
2222
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2223
+ * Optional fields that are not set will be set to undefined.
2224
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2225
+ * For the list of reserved names please see:
2226
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2227
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2228
+ * JSPB instance for transitional soy proto support:
2229
+ * http://goto/soy-param-migration
2230
+ * @return {!Object}
2231
+ */
2232
+ proto.user.RolePermissionStatusResponse.prototype.toObject = function(opt_includeInstance) {
2233
+ return proto.user.RolePermissionStatusResponse.toObject(opt_includeInstance, this);
2234
+ };
2235
+
2236
+
2237
+ /**
2238
+ * Static version of the {@see toObject} method.
2239
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2240
+ * the JSPB instance for transitional soy proto support:
2241
+ * http://goto/soy-param-migration
2242
+ * @param {!proto.user.RolePermissionStatusResponse} msg The msg instance to transform.
2243
+ * @return {!Object}
2244
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2245
+ */
2246
+ proto.user.RolePermissionStatusResponse.toObject = function(includeInstance, msg) {
2247
+ var f, obj = {
2248
+ status: jspb.Message.getFieldWithDefault(msg, 1, "")
2249
+ };
2250
+
2251
+ if (includeInstance) {
2252
+ obj.$jspbMessageInstance = msg;
2253
+ }
2254
+ return obj;
2255
+ };
2256
+ }
2257
+
2258
+
2259
+ /**
2260
+ * Deserializes binary data (in protobuf wire format).
2261
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2262
+ * @return {!proto.user.RolePermissionStatusResponse}
2263
+ */
2264
+ proto.user.RolePermissionStatusResponse.deserializeBinary = function(bytes) {
2265
+ var reader = new jspb.BinaryReader(bytes);
2266
+ var msg = new proto.user.RolePermissionStatusResponse;
2267
+ return proto.user.RolePermissionStatusResponse.deserializeBinaryFromReader(msg, reader);
2268
+ };
2269
+
2270
+
2271
+ /**
2272
+ * Deserializes binary data (in protobuf wire format) from the
2273
+ * given reader into the given message object.
2274
+ * @param {!proto.user.RolePermissionStatusResponse} msg The message object to deserialize into.
2275
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2276
+ * @return {!proto.user.RolePermissionStatusResponse}
2277
+ */
2278
+ proto.user.RolePermissionStatusResponse.deserializeBinaryFromReader = function(msg, reader) {
2279
+ while (reader.nextField()) {
2280
+ if (reader.isEndGroup()) {
2281
+ break;
2282
+ }
2283
+ var field = reader.getFieldNumber();
2284
+ switch (field) {
2285
+ case 1:
2286
+ var value = /** @type {string} */ (reader.readString());
2287
+ msg.setStatus(value);
2288
+ break;
2289
+ default:
2290
+ reader.skipField();
2291
+ break;
2292
+ }
2293
+ }
2294
+ return msg;
2295
+ };
2296
+
2297
+
2298
+ /**
2299
+ * Serializes the message to binary data (in protobuf wire format).
2300
+ * @return {!Uint8Array}
2301
+ */
2302
+ proto.user.RolePermissionStatusResponse.prototype.serializeBinary = function() {
2303
+ var writer = new jspb.BinaryWriter();
2304
+ proto.user.RolePermissionStatusResponse.serializeBinaryToWriter(this, writer);
2305
+ return writer.getResultBuffer();
2306
+ };
2307
+
2308
+
2309
+ /**
2310
+ * Serializes the given message to binary data (in protobuf wire
2311
+ * format), writing to the given BinaryWriter.
2312
+ * @param {!proto.user.RolePermissionStatusResponse} message
2313
+ * @param {!jspb.BinaryWriter} writer
2314
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2315
+ */
2316
+ proto.user.RolePermissionStatusResponse.serializeBinaryToWriter = function(message, writer) {
2317
+ var f = undefined;
2318
+ f = message.getStatus();
2319
+ if (f.length > 0) {
2320
+ writer.writeString(
2321
+ 1,
2322
+ f
2323
+ );
2324
+ }
2325
+ };
2326
+
2327
+
2328
+ /**
2329
+ * optional string status = 1;
2330
+ * @return {string}
2331
+ */
2332
+ proto.user.RolePermissionStatusResponse.prototype.getStatus = function() {
2333
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
2334
+ };
2335
+
2336
+
2337
+ /**
2338
+ * @param {string} value
2339
+ * @return {!proto.user.RolePermissionStatusResponse} returns this
2340
+ */
2341
+ proto.user.RolePermissionStatusResponse.prototype.setStatus = function(value) {
2342
+ return jspb.Message.setProto3StringField(this, 1, value);
2343
+ };
2344
+
2345
+
1916
2346
  goog.object.extend(exports, proto.user);