protobuf-platform 1.0.15 → 1.0.17

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.
@@ -9,6 +9,8 @@ service Config {
9
9
  //Set config for particular customer
10
10
  rpc setConfig(ConfigRequest) returns (ConfigStatusResponse);
11
11
  rpc getConfig(ConfigRequest) returns (ConfigDataResponse);
12
+ //Global settings
13
+ rpc addError(ErrorRequest) returns (ErrorStatusResponse);
12
14
  }
13
15
 
14
16
  message PingRequest { string ping = 1; }
@@ -37,4 +39,13 @@ message ConfigStatusResponse {
37
39
  }
38
40
  message ConfigDataResponse {
39
41
  string data = 1;
42
+ }
43
+ message ErrorRequest {
44
+ string error_key = 1;
45
+ int32 error_code = 2;
46
+ int32 http_code = 3;
47
+ optional string description = 4;
48
+ }
49
+ message ErrorStatusResponse {
50
+ string status = 1;
40
51
  }
@@ -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_ErrorRequest(arg) {
41
+ if (!(arg instanceof config_pb.ErrorRequest)) {
42
+ throw new Error('Expected argument of type config.ErrorRequest');
43
+ }
44
+ return Buffer.from(arg.serializeBinary());
45
+ }
46
+
47
+ function deserialize_config_ErrorRequest(buffer_arg) {
48
+ return config_pb.ErrorRequest.deserializeBinary(new Uint8Array(buffer_arg));
49
+ }
50
+
51
+ function serialize_config_ErrorStatusResponse(arg) {
52
+ if (!(arg instanceof config_pb.ErrorStatusResponse)) {
53
+ throw new Error('Expected argument of type config.ErrorStatusResponse');
54
+ }
55
+ return Buffer.from(arg.serializeBinary());
56
+ }
57
+
58
+ function deserialize_config_ErrorStatusResponse(buffer_arg) {
59
+ return config_pb.ErrorStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
60
+ }
61
+
40
62
  function serialize_config_PingRequest(arg) {
41
63
  if (!(arg instanceof config_pb.PingRequest)) {
42
64
  throw new Error('Expected argument of type config.PingRequest');
@@ -129,6 +151,18 @@ setConfig: {
129
151
  responseSerialize: serialize_config_ConfigDataResponse,
130
152
  responseDeserialize: deserialize_config_ConfigDataResponse,
131
153
  },
154
+ // Global settings
155
+ addError: {
156
+ path: '/config.Config/addError',
157
+ requestStream: false,
158
+ responseStream: false,
159
+ requestType: config_pb.ErrorRequest,
160
+ responseType: config_pb.ErrorStatusResponse,
161
+ requestSerialize: serialize_config_ErrorRequest,
162
+ requestDeserialize: deserialize_config_ErrorRequest,
163
+ responseSerialize: serialize_config_ErrorStatusResponse,
164
+ responseDeserialize: deserialize_config_ErrorStatusResponse,
165
+ },
132
166
  };
133
167
 
134
168
  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.ErrorRequest', null, global);
28
+ goog.exportSymbol('proto.config.ErrorStatusResponse', null, global);
27
29
  goog.exportSymbol('proto.config.PingRequest', null, global);
28
30
  goog.exportSymbol('proto.config.PongResponse', null, global);
29
31
  goog.exportSymbol('proto.config.SettingsRequest', null, global);
@@ -175,6 +177,48 @@ if (goog.DEBUG && !COMPILED) {
175
177
  */
176
178
  proto.config.ConfigDataResponse.displayName = 'proto.config.ConfigDataResponse';
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.config.ErrorRequest = function(opt_data) {
191
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
192
+ };
193
+ goog.inherits(proto.config.ErrorRequest, jspb.Message);
194
+ if (goog.DEBUG && !COMPILED) {
195
+ /**
196
+ * @public
197
+ * @override
198
+ */
199
+ proto.config.ErrorRequest.displayName = 'proto.config.ErrorRequest';
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.config.ErrorStatusResponse = function(opt_data) {
212
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
213
+ };
214
+ goog.inherits(proto.config.ErrorStatusResponse, jspb.Message);
215
+ if (goog.DEBUG && !COMPILED) {
216
+ /**
217
+ * @public
218
+ * @override
219
+ */
220
+ proto.config.ErrorStatusResponse.displayName = 'proto.config.ErrorStatusResponse';
221
+ }
178
222
 
179
223
 
180
224
 
@@ -1385,4 +1429,372 @@ proto.config.ConfigDataResponse.prototype.setData = function(value) {
1385
1429
  };
1386
1430
 
1387
1431
 
1432
+
1433
+
1434
+
1435
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1436
+ /**
1437
+ * Creates an object representation of this proto.
1438
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1439
+ * Optional fields that are not set will be set to undefined.
1440
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1441
+ * For the list of reserved names please see:
1442
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1443
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1444
+ * JSPB instance for transitional soy proto support:
1445
+ * http://goto/soy-param-migration
1446
+ * @return {!Object}
1447
+ */
1448
+ proto.config.ErrorRequest.prototype.toObject = function(opt_includeInstance) {
1449
+ return proto.config.ErrorRequest.toObject(opt_includeInstance, this);
1450
+ };
1451
+
1452
+
1453
+ /**
1454
+ * Static version of the {@see toObject} method.
1455
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1456
+ * the JSPB instance for transitional soy proto support:
1457
+ * http://goto/soy-param-migration
1458
+ * @param {!proto.config.ErrorRequest} msg The msg instance to transform.
1459
+ * @return {!Object}
1460
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1461
+ */
1462
+ proto.config.ErrorRequest.toObject = function(includeInstance, msg) {
1463
+ var f, obj = {
1464
+ errorKey: jspb.Message.getFieldWithDefault(msg, 1, ""),
1465
+ errorCode: jspb.Message.getFieldWithDefault(msg, 2, 0),
1466
+ httpCode: jspb.Message.getFieldWithDefault(msg, 3, 0),
1467
+ description: jspb.Message.getFieldWithDefault(msg, 4, "")
1468
+ };
1469
+
1470
+ if (includeInstance) {
1471
+ obj.$jspbMessageInstance = msg;
1472
+ }
1473
+ return obj;
1474
+ };
1475
+ }
1476
+
1477
+
1478
+ /**
1479
+ * Deserializes binary data (in protobuf wire format).
1480
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1481
+ * @return {!proto.config.ErrorRequest}
1482
+ */
1483
+ proto.config.ErrorRequest.deserializeBinary = function(bytes) {
1484
+ var reader = new jspb.BinaryReader(bytes);
1485
+ var msg = new proto.config.ErrorRequest;
1486
+ return proto.config.ErrorRequest.deserializeBinaryFromReader(msg, reader);
1487
+ };
1488
+
1489
+
1490
+ /**
1491
+ * Deserializes binary data (in protobuf wire format) from the
1492
+ * given reader into the given message object.
1493
+ * @param {!proto.config.ErrorRequest} msg The message object to deserialize into.
1494
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1495
+ * @return {!proto.config.ErrorRequest}
1496
+ */
1497
+ proto.config.ErrorRequest.deserializeBinaryFromReader = function(msg, reader) {
1498
+ while (reader.nextField()) {
1499
+ if (reader.isEndGroup()) {
1500
+ break;
1501
+ }
1502
+ var field = reader.getFieldNumber();
1503
+ switch (field) {
1504
+ case 1:
1505
+ var value = /** @type {string} */ (reader.readString());
1506
+ msg.setErrorKey(value);
1507
+ break;
1508
+ case 2:
1509
+ var value = /** @type {number} */ (reader.readInt32());
1510
+ msg.setErrorCode(value);
1511
+ break;
1512
+ case 3:
1513
+ var value = /** @type {number} */ (reader.readInt32());
1514
+ msg.setHttpCode(value);
1515
+ break;
1516
+ case 4:
1517
+ var value = /** @type {string} */ (reader.readString());
1518
+ msg.setDescription(value);
1519
+ break;
1520
+ default:
1521
+ reader.skipField();
1522
+ break;
1523
+ }
1524
+ }
1525
+ return msg;
1526
+ };
1527
+
1528
+
1529
+ /**
1530
+ * Serializes the message to binary data (in protobuf wire format).
1531
+ * @return {!Uint8Array}
1532
+ */
1533
+ proto.config.ErrorRequest.prototype.serializeBinary = function() {
1534
+ var writer = new jspb.BinaryWriter();
1535
+ proto.config.ErrorRequest.serializeBinaryToWriter(this, writer);
1536
+ return writer.getResultBuffer();
1537
+ };
1538
+
1539
+
1540
+ /**
1541
+ * Serializes the given message to binary data (in protobuf wire
1542
+ * format), writing to the given BinaryWriter.
1543
+ * @param {!proto.config.ErrorRequest} message
1544
+ * @param {!jspb.BinaryWriter} writer
1545
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1546
+ */
1547
+ proto.config.ErrorRequest.serializeBinaryToWriter = function(message, writer) {
1548
+ var f = undefined;
1549
+ f = message.getErrorKey();
1550
+ if (f.length > 0) {
1551
+ writer.writeString(
1552
+ 1,
1553
+ f
1554
+ );
1555
+ }
1556
+ f = message.getErrorCode();
1557
+ if (f !== 0) {
1558
+ writer.writeInt32(
1559
+ 2,
1560
+ f
1561
+ );
1562
+ }
1563
+ f = message.getHttpCode();
1564
+ if (f !== 0) {
1565
+ writer.writeInt32(
1566
+ 3,
1567
+ f
1568
+ );
1569
+ }
1570
+ f = /** @type {string} */ (jspb.Message.getField(message, 4));
1571
+ if (f != null) {
1572
+ writer.writeString(
1573
+ 4,
1574
+ f
1575
+ );
1576
+ }
1577
+ };
1578
+
1579
+
1580
+ /**
1581
+ * optional string error_key = 1;
1582
+ * @return {string}
1583
+ */
1584
+ proto.config.ErrorRequest.prototype.getErrorKey = function() {
1585
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1586
+ };
1587
+
1588
+
1589
+ /**
1590
+ * @param {string} value
1591
+ * @return {!proto.config.ErrorRequest} returns this
1592
+ */
1593
+ proto.config.ErrorRequest.prototype.setErrorKey = function(value) {
1594
+ return jspb.Message.setProto3StringField(this, 1, value);
1595
+ };
1596
+
1597
+
1598
+ /**
1599
+ * optional int32 error_code = 2;
1600
+ * @return {number}
1601
+ */
1602
+ proto.config.ErrorRequest.prototype.getErrorCode = function() {
1603
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
1604
+ };
1605
+
1606
+
1607
+ /**
1608
+ * @param {number} value
1609
+ * @return {!proto.config.ErrorRequest} returns this
1610
+ */
1611
+ proto.config.ErrorRequest.prototype.setErrorCode = function(value) {
1612
+ return jspb.Message.setProto3IntField(this, 2, value);
1613
+ };
1614
+
1615
+
1616
+ /**
1617
+ * optional int32 http_code = 3;
1618
+ * @return {number}
1619
+ */
1620
+ proto.config.ErrorRequest.prototype.getHttpCode = function() {
1621
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
1622
+ };
1623
+
1624
+
1625
+ /**
1626
+ * @param {number} value
1627
+ * @return {!proto.config.ErrorRequest} returns this
1628
+ */
1629
+ proto.config.ErrorRequest.prototype.setHttpCode = function(value) {
1630
+ return jspb.Message.setProto3IntField(this, 3, value);
1631
+ };
1632
+
1633
+
1634
+ /**
1635
+ * optional string description = 4;
1636
+ * @return {string}
1637
+ */
1638
+ proto.config.ErrorRequest.prototype.getDescription = function() {
1639
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
1640
+ };
1641
+
1642
+
1643
+ /**
1644
+ * @param {string} value
1645
+ * @return {!proto.config.ErrorRequest} returns this
1646
+ */
1647
+ proto.config.ErrorRequest.prototype.setDescription = function(value) {
1648
+ return jspb.Message.setField(this, 4, value);
1649
+ };
1650
+
1651
+
1652
+ /**
1653
+ * Clears the field making it undefined.
1654
+ * @return {!proto.config.ErrorRequest} returns this
1655
+ */
1656
+ proto.config.ErrorRequest.prototype.clearDescription = function() {
1657
+ return jspb.Message.setField(this, 4, undefined);
1658
+ };
1659
+
1660
+
1661
+ /**
1662
+ * Returns whether this field is set.
1663
+ * @return {boolean}
1664
+ */
1665
+ proto.config.ErrorRequest.prototype.hasDescription = function() {
1666
+ return jspb.Message.getField(this, 4) != null;
1667
+ };
1668
+
1669
+
1670
+
1671
+
1672
+
1673
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1674
+ /**
1675
+ * Creates an object representation of this proto.
1676
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1677
+ * Optional fields that are not set will be set to undefined.
1678
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1679
+ * For the list of reserved names please see:
1680
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1681
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1682
+ * JSPB instance for transitional soy proto support:
1683
+ * http://goto/soy-param-migration
1684
+ * @return {!Object}
1685
+ */
1686
+ proto.config.ErrorStatusResponse.prototype.toObject = function(opt_includeInstance) {
1687
+ return proto.config.ErrorStatusResponse.toObject(opt_includeInstance, this);
1688
+ };
1689
+
1690
+
1691
+ /**
1692
+ * Static version of the {@see toObject} method.
1693
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1694
+ * the JSPB instance for transitional soy proto support:
1695
+ * http://goto/soy-param-migration
1696
+ * @param {!proto.config.ErrorStatusResponse} msg The msg instance to transform.
1697
+ * @return {!Object}
1698
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1699
+ */
1700
+ proto.config.ErrorStatusResponse.toObject = function(includeInstance, msg) {
1701
+ var f, obj = {
1702
+ status: jspb.Message.getFieldWithDefault(msg, 1, "")
1703
+ };
1704
+
1705
+ if (includeInstance) {
1706
+ obj.$jspbMessageInstance = msg;
1707
+ }
1708
+ return obj;
1709
+ };
1710
+ }
1711
+
1712
+
1713
+ /**
1714
+ * Deserializes binary data (in protobuf wire format).
1715
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1716
+ * @return {!proto.config.ErrorStatusResponse}
1717
+ */
1718
+ proto.config.ErrorStatusResponse.deserializeBinary = function(bytes) {
1719
+ var reader = new jspb.BinaryReader(bytes);
1720
+ var msg = new proto.config.ErrorStatusResponse;
1721
+ return proto.config.ErrorStatusResponse.deserializeBinaryFromReader(msg, reader);
1722
+ };
1723
+
1724
+
1725
+ /**
1726
+ * Deserializes binary data (in protobuf wire format) from the
1727
+ * given reader into the given message object.
1728
+ * @param {!proto.config.ErrorStatusResponse} msg The message object to deserialize into.
1729
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1730
+ * @return {!proto.config.ErrorStatusResponse}
1731
+ */
1732
+ proto.config.ErrorStatusResponse.deserializeBinaryFromReader = function(msg, reader) {
1733
+ while (reader.nextField()) {
1734
+ if (reader.isEndGroup()) {
1735
+ break;
1736
+ }
1737
+ var field = reader.getFieldNumber();
1738
+ switch (field) {
1739
+ case 1:
1740
+ var value = /** @type {string} */ (reader.readString());
1741
+ msg.setStatus(value);
1742
+ break;
1743
+ default:
1744
+ reader.skipField();
1745
+ break;
1746
+ }
1747
+ }
1748
+ return msg;
1749
+ };
1750
+
1751
+
1752
+ /**
1753
+ * Serializes the message to binary data (in protobuf wire format).
1754
+ * @return {!Uint8Array}
1755
+ */
1756
+ proto.config.ErrorStatusResponse.prototype.serializeBinary = function() {
1757
+ var writer = new jspb.BinaryWriter();
1758
+ proto.config.ErrorStatusResponse.serializeBinaryToWriter(this, writer);
1759
+ return writer.getResultBuffer();
1760
+ };
1761
+
1762
+
1763
+ /**
1764
+ * Serializes the given message to binary data (in protobuf wire
1765
+ * format), writing to the given BinaryWriter.
1766
+ * @param {!proto.config.ErrorStatusResponse} message
1767
+ * @param {!jspb.BinaryWriter} writer
1768
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1769
+ */
1770
+ proto.config.ErrorStatusResponse.serializeBinaryToWriter = function(message, writer) {
1771
+ var f = undefined;
1772
+ f = message.getStatus();
1773
+ if (f.length > 0) {
1774
+ writer.writeString(
1775
+ 1,
1776
+ f
1777
+ );
1778
+ }
1779
+ };
1780
+
1781
+
1782
+ /**
1783
+ * optional string status = 1;
1784
+ * @return {string}
1785
+ */
1786
+ proto.config.ErrorStatusResponse.prototype.getStatus = function() {
1787
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1788
+ };
1789
+
1790
+
1791
+ /**
1792
+ * @param {string} value
1793
+ * @return {!proto.config.ErrorStatusResponse} returns this
1794
+ */
1795
+ proto.config.ErrorStatusResponse.prototype.setStatus = function(value) {
1796
+ return jspb.Message.setProto3StringField(this, 1, value);
1797
+ };
1798
+
1799
+
1388
1800
  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.15",
3
+ "version": "1.0.17",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {