protobuf-platform 1.0.248 → 1.0.250

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.
@@ -12,6 +12,8 @@ service Config {
12
12
  //Global settings
13
13
  rpc addError(ErrorRequest) returns (ErrorStatusResponse);
14
14
  rpc changeGlobalData(GlobalDataRequest) returns (ConfigStatusResponse);
15
+ //Currency Rates
16
+ rpc getCurrencyRate(CurrencyRateRequest) returns (CurrencyRateResponse);
15
17
  }
16
18
 
17
19
  message PingRequest { string ping = 1; }
@@ -57,4 +59,12 @@ message GlobalDataRequest {
57
59
  string key = 3;
58
60
  repeated string string_values = 4;
59
61
  repeated int32 integer_values = 5;
62
+ }
63
+ //Currency Rate
64
+ message CurrencyRateRequest {
65
+ string currency_from = 1;
66
+ string currency_to = 2;
67
+ }
68
+ message CurrencyRateResponse {
69
+ float rate = 1;
60
70
  }
@@ -37,6 +37,28 @@ function deserialize_config_ConfigStatusResponse(buffer_arg) {
37
37
  return config_pb.ConfigStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
38
38
  }
39
39
 
40
+ function serialize_config_CurrencyRateRequest(arg) {
41
+ if (!(arg instanceof config_pb.CurrencyRateRequest)) {
42
+ throw new Error('Expected argument of type config.CurrencyRateRequest');
43
+ }
44
+ return Buffer.from(arg.serializeBinary());
45
+ }
46
+
47
+ function deserialize_config_CurrencyRateRequest(buffer_arg) {
48
+ return config_pb.CurrencyRateRequest.deserializeBinary(new Uint8Array(buffer_arg));
49
+ }
50
+
51
+ function serialize_config_CurrencyRateResponse(arg) {
52
+ if (!(arg instanceof config_pb.CurrencyRateResponse)) {
53
+ throw new Error('Expected argument of type config.CurrencyRateResponse');
54
+ }
55
+ return Buffer.from(arg.serializeBinary());
56
+ }
57
+
58
+ function deserialize_config_CurrencyRateResponse(buffer_arg) {
59
+ return config_pb.CurrencyRateResponse.deserializeBinary(new Uint8Array(buffer_arg));
60
+ }
61
+
40
62
  function serialize_config_ErrorRequest(arg) {
41
63
  if (!(arg instanceof config_pb.ErrorRequest)) {
42
64
  throw new Error('Expected argument of type config.ErrorRequest');
@@ -185,6 +207,18 @@ addError: {
185
207
  responseSerialize: serialize_config_ConfigStatusResponse,
186
208
  responseDeserialize: deserialize_config_ConfigStatusResponse,
187
209
  },
210
+ // Currency Rates
211
+ getCurrencyRate: {
212
+ path: '/config.Config/getCurrencyRate',
213
+ requestStream: false,
214
+ responseStream: false,
215
+ requestType: config_pb.CurrencyRateRequest,
216
+ responseType: config_pb.CurrencyRateResponse,
217
+ requestSerialize: serialize_config_CurrencyRateRequest,
218
+ requestDeserialize: deserialize_config_CurrencyRateRequest,
219
+ responseSerialize: serialize_config_CurrencyRateResponse,
220
+ responseDeserialize: deserialize_config_CurrencyRateResponse,
221
+ },
188
222
  };
189
223
 
190
224
  exports.ConfigClient = grpc.makeGenericClientConstructor(ConfigService);
@@ -24,6 +24,8 @@ var global = (function() {
24
24
  goog.exportSymbol('proto.config.ConfigDataResponse', null, global);
25
25
  goog.exportSymbol('proto.config.ConfigRequest', null, global);
26
26
  goog.exportSymbol('proto.config.ConfigStatusResponse', null, global);
27
+ goog.exportSymbol('proto.config.CurrencyRateRequest', null, global);
28
+ goog.exportSymbol('proto.config.CurrencyRateResponse', null, global);
27
29
  goog.exportSymbol('proto.config.ErrorRequest', null, global);
28
30
  goog.exportSymbol('proto.config.ErrorStatusResponse', null, global);
29
31
  goog.exportSymbol('proto.config.GlobalDataRequest', null, global);
@@ -241,6 +243,48 @@ if (goog.DEBUG && !COMPILED) {
241
243
  */
242
244
  proto.config.GlobalDataRequest.displayName = 'proto.config.GlobalDataRequest';
243
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.config.CurrencyRateRequest = function(opt_data) {
257
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
258
+ };
259
+ goog.inherits(proto.config.CurrencyRateRequest, jspb.Message);
260
+ if (goog.DEBUG && !COMPILED) {
261
+ /**
262
+ * @public
263
+ * @override
264
+ */
265
+ proto.config.CurrencyRateRequest.displayName = 'proto.config.CurrencyRateRequest';
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.config.CurrencyRateResponse = function(opt_data) {
278
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
279
+ };
280
+ goog.inherits(proto.config.CurrencyRateResponse, jspb.Message);
281
+ if (goog.DEBUG && !COMPILED) {
282
+ /**
283
+ * @public
284
+ * @override
285
+ */
286
+ proto.config.CurrencyRateResponse.displayName = 'proto.config.CurrencyRateResponse';
287
+ }
244
288
 
245
289
 
246
290
 
@@ -2116,4 +2160,294 @@ proto.config.GlobalDataRequest.prototype.clearIntegerValuesList = function() {
2116
2160
  };
2117
2161
 
2118
2162
 
2163
+
2164
+
2165
+
2166
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2167
+ /**
2168
+ * Creates an object representation of this proto.
2169
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2170
+ * Optional fields that are not set will be set to undefined.
2171
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2172
+ * For the list of reserved names please see:
2173
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2174
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2175
+ * JSPB instance for transitional soy proto support:
2176
+ * http://goto/soy-param-migration
2177
+ * @return {!Object}
2178
+ */
2179
+ proto.config.CurrencyRateRequest.prototype.toObject = function(opt_includeInstance) {
2180
+ return proto.config.CurrencyRateRequest.toObject(opt_includeInstance, this);
2181
+ };
2182
+
2183
+
2184
+ /**
2185
+ * Static version of the {@see toObject} method.
2186
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2187
+ * the JSPB instance for transitional soy proto support:
2188
+ * http://goto/soy-param-migration
2189
+ * @param {!proto.config.CurrencyRateRequest} msg The msg instance to transform.
2190
+ * @return {!Object}
2191
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2192
+ */
2193
+ proto.config.CurrencyRateRequest.toObject = function(includeInstance, msg) {
2194
+ var f, obj = {
2195
+ currencyFrom: jspb.Message.getFieldWithDefault(msg, 1, ""),
2196
+ currencyTo: jspb.Message.getFieldWithDefault(msg, 2, "")
2197
+ };
2198
+
2199
+ if (includeInstance) {
2200
+ obj.$jspbMessageInstance = msg;
2201
+ }
2202
+ return obj;
2203
+ };
2204
+ }
2205
+
2206
+
2207
+ /**
2208
+ * Deserializes binary data (in protobuf wire format).
2209
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2210
+ * @return {!proto.config.CurrencyRateRequest}
2211
+ */
2212
+ proto.config.CurrencyRateRequest.deserializeBinary = function(bytes) {
2213
+ var reader = new jspb.BinaryReader(bytes);
2214
+ var msg = new proto.config.CurrencyRateRequest;
2215
+ return proto.config.CurrencyRateRequest.deserializeBinaryFromReader(msg, reader);
2216
+ };
2217
+
2218
+
2219
+ /**
2220
+ * Deserializes binary data (in protobuf wire format) from the
2221
+ * given reader into the given message object.
2222
+ * @param {!proto.config.CurrencyRateRequest} msg The message object to deserialize into.
2223
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2224
+ * @return {!proto.config.CurrencyRateRequest}
2225
+ */
2226
+ proto.config.CurrencyRateRequest.deserializeBinaryFromReader = function(msg, reader) {
2227
+ while (reader.nextField()) {
2228
+ if (reader.isEndGroup()) {
2229
+ break;
2230
+ }
2231
+ var field = reader.getFieldNumber();
2232
+ switch (field) {
2233
+ case 1:
2234
+ var value = /** @type {string} */ (reader.readString());
2235
+ msg.setCurrencyFrom(value);
2236
+ break;
2237
+ case 2:
2238
+ var value = /** @type {string} */ (reader.readString());
2239
+ msg.setCurrencyTo(value);
2240
+ break;
2241
+ default:
2242
+ reader.skipField();
2243
+ break;
2244
+ }
2245
+ }
2246
+ return msg;
2247
+ };
2248
+
2249
+
2250
+ /**
2251
+ * Serializes the message to binary data (in protobuf wire format).
2252
+ * @return {!Uint8Array}
2253
+ */
2254
+ proto.config.CurrencyRateRequest.prototype.serializeBinary = function() {
2255
+ var writer = new jspb.BinaryWriter();
2256
+ proto.config.CurrencyRateRequest.serializeBinaryToWriter(this, writer);
2257
+ return writer.getResultBuffer();
2258
+ };
2259
+
2260
+
2261
+ /**
2262
+ * Serializes the given message to binary data (in protobuf wire
2263
+ * format), writing to the given BinaryWriter.
2264
+ * @param {!proto.config.CurrencyRateRequest} message
2265
+ * @param {!jspb.BinaryWriter} writer
2266
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2267
+ */
2268
+ proto.config.CurrencyRateRequest.serializeBinaryToWriter = function(message, writer) {
2269
+ var f = undefined;
2270
+ f = message.getCurrencyFrom();
2271
+ if (f.length > 0) {
2272
+ writer.writeString(
2273
+ 1,
2274
+ f
2275
+ );
2276
+ }
2277
+ f = message.getCurrencyTo();
2278
+ if (f.length > 0) {
2279
+ writer.writeString(
2280
+ 2,
2281
+ f
2282
+ );
2283
+ }
2284
+ };
2285
+
2286
+
2287
+ /**
2288
+ * optional string currency_from = 1;
2289
+ * @return {string}
2290
+ */
2291
+ proto.config.CurrencyRateRequest.prototype.getCurrencyFrom = function() {
2292
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
2293
+ };
2294
+
2295
+
2296
+ /**
2297
+ * @param {string} value
2298
+ * @return {!proto.config.CurrencyRateRequest} returns this
2299
+ */
2300
+ proto.config.CurrencyRateRequest.prototype.setCurrencyFrom = function(value) {
2301
+ return jspb.Message.setProto3StringField(this, 1, value);
2302
+ };
2303
+
2304
+
2305
+ /**
2306
+ * optional string currency_to = 2;
2307
+ * @return {string}
2308
+ */
2309
+ proto.config.CurrencyRateRequest.prototype.getCurrencyTo = function() {
2310
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
2311
+ };
2312
+
2313
+
2314
+ /**
2315
+ * @param {string} value
2316
+ * @return {!proto.config.CurrencyRateRequest} returns this
2317
+ */
2318
+ proto.config.CurrencyRateRequest.prototype.setCurrencyTo = function(value) {
2319
+ return jspb.Message.setProto3StringField(this, 2, value);
2320
+ };
2321
+
2322
+
2323
+
2324
+
2325
+
2326
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2327
+ /**
2328
+ * Creates an object representation of this proto.
2329
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2330
+ * Optional fields that are not set will be set to undefined.
2331
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2332
+ * For the list of reserved names please see:
2333
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2334
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2335
+ * JSPB instance for transitional soy proto support:
2336
+ * http://goto/soy-param-migration
2337
+ * @return {!Object}
2338
+ */
2339
+ proto.config.CurrencyRateResponse.prototype.toObject = function(opt_includeInstance) {
2340
+ return proto.config.CurrencyRateResponse.toObject(opt_includeInstance, this);
2341
+ };
2342
+
2343
+
2344
+ /**
2345
+ * Static version of the {@see toObject} method.
2346
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2347
+ * the JSPB instance for transitional soy proto support:
2348
+ * http://goto/soy-param-migration
2349
+ * @param {!proto.config.CurrencyRateResponse} msg The msg instance to transform.
2350
+ * @return {!Object}
2351
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2352
+ */
2353
+ proto.config.CurrencyRateResponse.toObject = function(includeInstance, msg) {
2354
+ var f, obj = {
2355
+ rate: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0)
2356
+ };
2357
+
2358
+ if (includeInstance) {
2359
+ obj.$jspbMessageInstance = msg;
2360
+ }
2361
+ return obj;
2362
+ };
2363
+ }
2364
+
2365
+
2366
+ /**
2367
+ * Deserializes binary data (in protobuf wire format).
2368
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2369
+ * @return {!proto.config.CurrencyRateResponse}
2370
+ */
2371
+ proto.config.CurrencyRateResponse.deserializeBinary = function(bytes) {
2372
+ var reader = new jspb.BinaryReader(bytes);
2373
+ var msg = new proto.config.CurrencyRateResponse;
2374
+ return proto.config.CurrencyRateResponse.deserializeBinaryFromReader(msg, reader);
2375
+ };
2376
+
2377
+
2378
+ /**
2379
+ * Deserializes binary data (in protobuf wire format) from the
2380
+ * given reader into the given message object.
2381
+ * @param {!proto.config.CurrencyRateResponse} msg The message object to deserialize into.
2382
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2383
+ * @return {!proto.config.CurrencyRateResponse}
2384
+ */
2385
+ proto.config.CurrencyRateResponse.deserializeBinaryFromReader = function(msg, reader) {
2386
+ while (reader.nextField()) {
2387
+ if (reader.isEndGroup()) {
2388
+ break;
2389
+ }
2390
+ var field = reader.getFieldNumber();
2391
+ switch (field) {
2392
+ case 1:
2393
+ var value = /** @type {number} */ (reader.readFloat());
2394
+ msg.setRate(value);
2395
+ break;
2396
+ default:
2397
+ reader.skipField();
2398
+ break;
2399
+ }
2400
+ }
2401
+ return msg;
2402
+ };
2403
+
2404
+
2405
+ /**
2406
+ * Serializes the message to binary data (in protobuf wire format).
2407
+ * @return {!Uint8Array}
2408
+ */
2409
+ proto.config.CurrencyRateResponse.prototype.serializeBinary = function() {
2410
+ var writer = new jspb.BinaryWriter();
2411
+ proto.config.CurrencyRateResponse.serializeBinaryToWriter(this, writer);
2412
+ return writer.getResultBuffer();
2413
+ };
2414
+
2415
+
2416
+ /**
2417
+ * Serializes the given message to binary data (in protobuf wire
2418
+ * format), writing to the given BinaryWriter.
2419
+ * @param {!proto.config.CurrencyRateResponse} message
2420
+ * @param {!jspb.BinaryWriter} writer
2421
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2422
+ */
2423
+ proto.config.CurrencyRateResponse.serializeBinaryToWriter = function(message, writer) {
2424
+ var f = undefined;
2425
+ f = message.getRate();
2426
+ if (f !== 0.0) {
2427
+ writer.writeFloat(
2428
+ 1,
2429
+ f
2430
+ );
2431
+ }
2432
+ };
2433
+
2434
+
2435
+ /**
2436
+ * optional float rate = 1;
2437
+ * @return {number}
2438
+ */
2439
+ proto.config.CurrencyRateResponse.prototype.getRate = function() {
2440
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0));
2441
+ };
2442
+
2443
+
2444
+ /**
2445
+ * @param {number} value
2446
+ * @return {!proto.config.CurrencyRateResponse} returns this
2447
+ */
2448
+ proto.config.CurrencyRateResponse.prototype.setRate = function(value) {
2449
+ return jspb.Message.setProto3FloatField(this, 1, value);
2450
+ };
2451
+
2452
+
2119
2453
  goog.object.extend(exports, proto.config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.248",
3
+ "version": "1.0.250",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {