@kurrent/kurrentdb-client 1.2.0-alpha.0 → 1.2.0

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.
Files changed (136) hide show
  1. package/dist/Client/http.d.ts +7 -1
  2. package/dist/Client/http.js +50 -48
  3. package/dist/Client/http.js.map +1 -1
  4. package/dist/Client/index.d.ts +30 -6
  5. package/dist/Client/index.js +77 -11
  6. package/dist/Client/index.js.map +1 -1
  7. package/dist/Client/parseConnectionString.d.ts +2 -2
  8. package/dist/constants.d.ts +3 -0
  9. package/dist/constants.js +6 -1
  10. package/dist/constants.js.map +1 -1
  11. package/dist/events/binaryEvent.js +2 -2
  12. package/dist/events/binaryEvent.js.map +1 -1
  13. package/dist/events/jsonEvent.js +2 -2
  14. package/dist/events/jsonEvent.js.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +4 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/projections/createProjection.d.ts +10 -1
  19. package/dist/projections/createProjection.js +13 -2
  20. package/dist/projections/createProjection.js.map +1 -1
  21. package/dist/streams/appendToStream/appendRecords.d.ts +3 -0
  22. package/dist/streams/appendToStream/appendRecords.js +132 -0
  23. package/dist/streams/appendToStream/appendRecords.js.map +1 -0
  24. package/dist/streams/appendToStream/batchAppend.js +2 -2
  25. package/dist/streams/appendToStream/batchAppend.js.map +1 -1
  26. package/dist/streams/appendToStream/index.d.ts +9 -1
  27. package/dist/streams/appendToStream/index.js +8 -0
  28. package/dist/streams/appendToStream/index.js.map +1 -1
  29. package/dist/streams/readAll.js +18 -18
  30. package/dist/streams/readAll.js.map +1 -1
  31. package/dist/streams/readStream.js +26 -34
  32. package/dist/streams/readStream.js.map +1 -1
  33. package/dist/types/index.d.ts +88 -2
  34. package/dist/types/index.js.map +1 -1
  35. package/dist/utils/CommandError.d.ts +9 -3
  36. package/dist/utils/CommandError.js +50 -1
  37. package/dist/utils/CommandError.js.map +1 -1
  38. package/dist/utils/convertBridgeError.d.ts +2 -1
  39. package/dist/utils/convertBridgeError.js +14 -24
  40. package/dist/utils/convertBridgeError.js.map +1 -1
  41. package/dist/utils/credentials.d.ts +19 -0
  42. package/dist/utils/credentials.js +31 -0
  43. package/dist/utils/credentials.js.map +1 -0
  44. package/dist/utils/grpcUUID.d.ts +1 -0
  45. package/dist/utils/grpcUUID.js +12 -12
  46. package/dist/utils/grpcUUID.js.map +1 -1
  47. package/generated/kurrentdb/protocols/v1/projectionmanagement_pb.d.ts +3 -0
  48. package/generated/kurrentdb/protocols/v1/projectionmanagement_pb.js +31 -1
  49. package/generated/kurrentdb/protocols/v2/core_pb.d.ts +188 -188
  50. package/generated/kurrentdb/protocols/v2/core_pb.js +1301 -1301
  51. package/generated/kurrentdb/protocols/v2/features/service_grpc_pb.d.ts +43 -43
  52. package/generated/kurrentdb/protocols/v2/features/service_grpc_pb.js +50 -50
  53. package/generated/kurrentdb/protocols/v2/features/service_pb.d.ts +227 -227
  54. package/generated/kurrentdb/protocols/v2/features/service_pb.js +1753 -1753
  55. package/generated/kurrentdb/protocols/v2/streams/errors_pb.d.ts +85 -0
  56. package/generated/kurrentdb/protocols/v2/streams/errors_pb.js +625 -1
  57. package/generated/kurrentdb/protocols/v2/streams/shared_pb.d.ts +218 -218
  58. package/generated/kurrentdb/protocols/v2/streams/shared_pb.js +1561 -1561
  59. package/generated/kurrentdb/protocols/v2/streams/streams_grpc_pb.d.ts +17 -0
  60. package/generated/kurrentdb/protocols/v2/streams/streams_grpc_pb.js +53 -0
  61. package/generated/kurrentdb/protocols/v2/streams/streams_pb.d.ts +134 -0
  62. package/generated/kurrentdb/protocols/v2/streams/streams_pb.js +1041 -1
  63. package/package.json +64 -66
  64. package/dist/schemaRegistry/checkSchemaCompatibility.d.ts +0 -12
  65. package/dist/schemaRegistry/checkSchemaCompatibility.js +0 -60
  66. package/dist/schemaRegistry/checkSchemaCompatibility.js.map +0 -1
  67. package/dist/schemaRegistry/createSchema.d.ts +0 -13
  68. package/dist/schemaRegistry/createSchema.js +0 -36
  69. package/dist/schemaRegistry/createSchema.js.map +0 -1
  70. package/dist/schemaRegistry/deleteSchema.d.ts +0 -11
  71. package/dist/schemaRegistry/deleteSchema.js +0 -23
  72. package/dist/schemaRegistry/deleteSchema.js.map +0 -1
  73. package/dist/schemaRegistry/deleteSchemaVersions.d.ts +0 -13
  74. package/dist/schemaRegistry/deleteSchemaVersions.js +0 -29
  75. package/dist/schemaRegistry/deleteSchemaVersions.js.map +0 -1
  76. package/dist/schemaRegistry/getSchema.d.ts +0 -12
  77. package/dist/schemaRegistry/getSchema.js +0 -28
  78. package/dist/schemaRegistry/getSchema.js.map +0 -1
  79. package/dist/schemaRegistry/getSchemaVersion.d.ts +0 -12
  80. package/dist/schemaRegistry/getSchemaVersion.js +0 -33
  81. package/dist/schemaRegistry/getSchemaVersion.js.map +0 -1
  82. package/dist/schemaRegistry/getSchemaVersionById.d.ts +0 -12
  83. package/dist/schemaRegistry/getSchemaVersionById.js +0 -28
  84. package/dist/schemaRegistry/getSchemaVersionById.js.map +0 -1
  85. package/dist/schemaRegistry/index.d.ts +0 -14
  86. package/dist/schemaRegistry/index.js +0 -35
  87. package/dist/schemaRegistry/index.js.map +0 -1
  88. package/dist/schemaRegistry/listRegisteredSchemas.d.ts +0 -11
  89. package/dist/schemaRegistry/listRegisteredSchemas.js +0 -41
  90. package/dist/schemaRegistry/listRegisteredSchemas.js.map +0 -1
  91. package/dist/schemaRegistry/listSchemaVersions.d.ts +0 -12
  92. package/dist/schemaRegistry/listSchemaVersions.js +0 -28
  93. package/dist/schemaRegistry/listSchemaVersions.js.map +0 -1
  94. package/dist/schemaRegistry/listSchemas.d.ts +0 -11
  95. package/dist/schemaRegistry/listSchemas.js +0 -35
  96. package/dist/schemaRegistry/listSchemas.js.map +0 -1
  97. package/dist/schemaRegistry/lookupSchemaName.d.ts +0 -12
  98. package/dist/schemaRegistry/lookupSchemaName.js +0 -23
  99. package/dist/schemaRegistry/lookupSchemaName.js.map +0 -1
  100. package/dist/schemaRegistry/registerSchemaVersion.d.ts +0 -13
  101. package/dist/schemaRegistry/registerSchemaVersion.js +0 -31
  102. package/dist/schemaRegistry/registerSchemaVersion.js.map +0 -1
  103. package/dist/schemaRegistry/types.d.ts +0 -347
  104. package/dist/schemaRegistry/types.js +0 -3
  105. package/dist/schemaRegistry/types.js.map +0 -1
  106. package/dist/schemaRegistry/updateSchema.d.ts +0 -11
  107. package/dist/schemaRegistry/updateSchema.js +0 -51
  108. package/dist/schemaRegistry/updateSchema.js.map +0 -1
  109. package/dist/schemaRegistry/utils/index.d.ts +0 -1
  110. package/dist/schemaRegistry/utils/index.js +0 -18
  111. package/dist/schemaRegistry/utils/index.js.map +0 -1
  112. package/dist/schemaRegistry/utils/mappers.d.ts +0 -24
  113. package/dist/schemaRegistry/utils/mappers.js +0 -198
  114. package/dist/schemaRegistry/utils/mappers.js.map +0 -1
  115. package/generated/kurrentdb/protocols/v2/registry/errors_grpc_pb.js +0 -1
  116. package/generated/kurrentdb/protocols/v2/registry/errors_pb.d.ts +0 -75
  117. package/generated/kurrentdb/protocols/v2/registry/errors_pb.js +0 -493
  118. package/generated/kurrentdb/protocols/v2/registry/events_grpc_pb.js +0 -1
  119. package/generated/kurrentdb/protocols/v2/registry/events_pb.d.ts +0 -255
  120. package/generated/kurrentdb/protocols/v2/registry/events_pb.js +0 -2057
  121. package/generated/kurrentdb/protocols/v2/registry/groups_grpc_pb.js +0 -1
  122. package/generated/kurrentdb/protocols/v2/registry/groups_pb.d.ts +0 -474
  123. package/generated/kurrentdb/protocols/v2/registry/groups_pb.js +0 -3593
  124. package/generated/kurrentdb/protocols/v2/registry/schemas_grpc_pb.js +0 -1
  125. package/generated/kurrentdb/protocols/v2/registry/schemas_pb.d.ts +0 -825
  126. package/generated/kurrentdb/protocols/v2/registry/schemas_pb.js +0 -6500
  127. package/generated/kurrentdb/protocols/v2/registry/service_grpc_pb.d.ts +0 -350
  128. package/generated/kurrentdb/protocols/v2/registry/service_grpc_pb.js +0 -654
  129. package/generated/kurrentdb/protocols/v2/registry/service_pb.d.ts +0 -10
  130. package/generated/kurrentdb/protocols/v2/registry/service_pb.js +0 -29
  131. package/generated/kurrentdb/protocols/v2/registry/shared_grpc_pb.js +0 -1
  132. package/generated/kurrentdb/protocols/v2/registry/shared_pb.d.ts +0 -26
  133. package/generated/kurrentdb/protocols/v2/registry/shared_pb.js +0 -51
  134. package/generated/kurrentdb/protocols/v2/registry/validation_grpc_pb.js +0 -1
  135. package/generated/kurrentdb/protocols/v2/registry/validation_pb.d.ts +0 -247
  136. package/generated/kurrentdb/protocols/v2/registry/validation_pb.js +0 -1789
@@ -23,8 +23,12 @@ var global = (function() {
23
23
 
24
24
  var kurrentdb_protocols_v2_rpc_pb = require('../../../../kurrentdb/protocols/v2/rpc_pb.js');
25
25
  goog.object.extend(proto, kurrentdb_protocols_v2_rpc_pb);
26
+ goog.exportSymbol('proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails', null, global);
26
27
  goog.exportSymbol('proto.kurrentdb.protocol.v2.streams.errors.AppendRecordSizeExceededErrorDetails', null, global);
27
28
  goog.exportSymbol('proto.kurrentdb.protocol.v2.streams.errors.AppendTransactionSizeExceededErrorDetails', null, global);
29
+ goog.exportSymbol('proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation', null, global);
30
+ goog.exportSymbol('proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation', null, global);
31
+ goog.exportSymbol('proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.TypeCase', null, global);
28
32
  goog.exportSymbol('proto.kurrentdb.protocol.v2.streams.errors.StreamAlreadyExistsErrorDetails', null, global);
29
33
  goog.exportSymbol('proto.kurrentdb.protocol.v2.streams.errors.StreamAlreadyInAppendSessionErrorDetails', null, global);
30
34
  goog.exportSymbol('proto.kurrentdb.protocol.v2.streams.errors.StreamDeletedErrorDetails', null, global);
@@ -200,6 +204,69 @@ if (goog.DEBUG && !COMPILED) {
200
204
  */
201
205
  proto.kurrentdb.protocol.v2.streams.errors.StreamAlreadyInAppendSessionErrorDetails.displayName = 'proto.kurrentdb.protocol.v2.streams.errors.StreamAlreadyInAppendSessionErrorDetails';
202
206
  }
207
+ /**
208
+ * Generated by JsPbCodeGenerator.
209
+ * @param {Array=} opt_data Optional initial data array, typically from a
210
+ * server response, or constructed directly in Javascript. The array is used
211
+ * in place and becomes part of the constructed object. It is not cloned.
212
+ * If no data is provided, the constructed object will be empty, but still
213
+ * valid.
214
+ * @extends {jspb.Message}
215
+ * @constructor
216
+ */
217
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails = function(opt_data) {
218
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.repeatedFields_, null);
219
+ };
220
+ goog.inherits(proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails, jspb.Message);
221
+ if (goog.DEBUG && !COMPILED) {
222
+ /**
223
+ * @public
224
+ * @override
225
+ */
226
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.displayName = 'proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails';
227
+ }
228
+ /**
229
+ * Generated by JsPbCodeGenerator.
230
+ * @param {Array=} opt_data Optional initial data array, typically from a
231
+ * server response, or constructed directly in Javascript. The array is used
232
+ * in place and becomes part of the constructed object. It is not cloned.
233
+ * If no data is provided, the constructed object will be empty, but still
234
+ * valid.
235
+ * @extends {jspb.Message}
236
+ * @constructor
237
+ */
238
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation = function(opt_data) {
239
+ jspb.Message.initialize(this, opt_data, 0, -1, null, proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.oneofGroups_);
240
+ };
241
+ goog.inherits(proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation, jspb.Message);
242
+ if (goog.DEBUG && !COMPILED) {
243
+ /**
244
+ * @public
245
+ * @override
246
+ */
247
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.displayName = 'proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation';
248
+ }
249
+ /**
250
+ * Generated by JsPbCodeGenerator.
251
+ * @param {Array=} opt_data Optional initial data array, typically from a
252
+ * server response, or constructed directly in Javascript. The array is used
253
+ * in place and becomes part of the constructed object. It is not cloned.
254
+ * If no data is provided, the constructed object will be empty, but still
255
+ * valid.
256
+ * @extends {jspb.Message}
257
+ * @constructor
258
+ */
259
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation = function(opt_data) {
260
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
261
+ };
262
+ goog.inherits(proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation, jspb.Message);
263
+ if (goog.DEBUG && !COMPILED) {
264
+ /**
265
+ * @public
266
+ * @override
267
+ */
268
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.displayName = 'proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation';
269
+ }
203
270
 
204
271
 
205
272
 
@@ -1420,6 +1487,562 @@ proto.kurrentdb.protocol.v2.streams.errors.StreamAlreadyInAppendSessionErrorDeta
1420
1487
  };
1421
1488
 
1422
1489
 
1490
+
1491
+ /**
1492
+ * List of repeated fields within this message type.
1493
+ * @private {!Array<number>}
1494
+ * @const
1495
+ */
1496
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.repeatedFields_ = [1];
1497
+
1498
+
1499
+
1500
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1501
+ /**
1502
+ * Creates an object representation of this proto.
1503
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1504
+ * Optional fields that are not set will be set to undefined.
1505
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1506
+ * For the list of reserved names please see:
1507
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1508
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1509
+ * JSPB instance for transitional soy proto support:
1510
+ * http://goto/soy-param-migration
1511
+ * @return {!Object}
1512
+ */
1513
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.prototype.toObject = function(opt_includeInstance) {
1514
+ return proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.toObject(opt_includeInstance, this);
1515
+ };
1516
+
1517
+
1518
+ /**
1519
+ * Static version of the {@see toObject} method.
1520
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1521
+ * the JSPB instance for transitional soy proto support:
1522
+ * http://goto/soy-param-migration
1523
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails} msg The msg instance to transform.
1524
+ * @return {!Object}
1525
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1526
+ */
1527
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.toObject = function(includeInstance, msg) {
1528
+ var f, obj = {
1529
+ violationsList: jspb.Message.toObjectList(msg.getViolationsList(),
1530
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.toObject, includeInstance)
1531
+ };
1532
+
1533
+ if (includeInstance) {
1534
+ obj.$jspbMessageInstance = msg;
1535
+ }
1536
+ return obj;
1537
+ };
1538
+ }
1539
+
1540
+
1541
+ /**
1542
+ * Deserializes binary data (in protobuf wire format).
1543
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1544
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails}
1545
+ */
1546
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.deserializeBinary = function(bytes) {
1547
+ var reader = new jspb.BinaryReader(bytes);
1548
+ var msg = new proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails;
1549
+ return proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.deserializeBinaryFromReader(msg, reader);
1550
+ };
1551
+
1552
+
1553
+ /**
1554
+ * Deserializes binary data (in protobuf wire format) from the
1555
+ * given reader into the given message object.
1556
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails} msg The message object to deserialize into.
1557
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1558
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails}
1559
+ */
1560
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.deserializeBinaryFromReader = function(msg, reader) {
1561
+ while (reader.nextField()) {
1562
+ if (reader.isEndGroup()) {
1563
+ break;
1564
+ }
1565
+ var field = reader.getFieldNumber();
1566
+ switch (field) {
1567
+ case 1:
1568
+ var value = new proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation;
1569
+ reader.readMessage(value,proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.deserializeBinaryFromReader);
1570
+ msg.addViolations(value);
1571
+ break;
1572
+ default:
1573
+ reader.skipField();
1574
+ break;
1575
+ }
1576
+ }
1577
+ return msg;
1578
+ };
1579
+
1580
+
1581
+ /**
1582
+ * Serializes the message to binary data (in protobuf wire format).
1583
+ * @return {!Uint8Array}
1584
+ */
1585
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.prototype.serializeBinary = function() {
1586
+ var writer = new jspb.BinaryWriter();
1587
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.serializeBinaryToWriter(this, writer);
1588
+ return writer.getResultBuffer();
1589
+ };
1590
+
1591
+
1592
+ /**
1593
+ * Serializes the given message to binary data (in protobuf wire
1594
+ * format), writing to the given BinaryWriter.
1595
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails} message
1596
+ * @param {!jspb.BinaryWriter} writer
1597
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1598
+ */
1599
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.serializeBinaryToWriter = function(message, writer) {
1600
+ var f = undefined;
1601
+ f = message.getViolationsList();
1602
+ if (f.length > 0) {
1603
+ writer.writeRepeatedMessage(
1604
+ 1,
1605
+ f,
1606
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.serializeBinaryToWriter
1607
+ );
1608
+ }
1609
+ };
1610
+
1611
+
1612
+ /**
1613
+ * repeated ConsistencyViolation violations = 1;
1614
+ * @return {!Array<!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation>}
1615
+ */
1616
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.prototype.getViolationsList = function() {
1617
+ return /** @type{!Array<!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation>} */ (
1618
+ jspb.Message.getRepeatedWrapperField(this, proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation, 1));
1619
+ };
1620
+
1621
+
1622
+ /**
1623
+ * @param {!Array<!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation>} value
1624
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails} returns this
1625
+ */
1626
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.prototype.setViolationsList = function(value) {
1627
+ return jspb.Message.setRepeatedWrapperField(this, 1, value);
1628
+ };
1629
+
1630
+
1631
+ /**
1632
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation=} opt_value
1633
+ * @param {number=} opt_index
1634
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation}
1635
+ */
1636
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.prototype.addViolations = function(opt_value, opt_index) {
1637
+ return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation, opt_index);
1638
+ };
1639
+
1640
+
1641
+ /**
1642
+ * Clears the list making it empty but non-null.
1643
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails} returns this
1644
+ */
1645
+ proto.kurrentdb.protocol.v2.streams.errors.AppendConsistencyViolationErrorDetails.prototype.clearViolationsList = function() {
1646
+ return this.setViolationsList([]);
1647
+ };
1648
+
1649
+
1650
+
1651
+ /**
1652
+ * Oneof group definitions for this message. Each group defines the field
1653
+ * numbers belonging to that group. When of these fields' value is set, all
1654
+ * other fields in the group are cleared. During deserialization, if multiple
1655
+ * fields are encountered for a group, only the last value seen will be kept.
1656
+ * @private {!Array<!Array<number>>}
1657
+ * @const
1658
+ */
1659
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.oneofGroups_ = [[2]];
1660
+
1661
+ /**
1662
+ * @enum {number}
1663
+ */
1664
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.TypeCase = {
1665
+ TYPE_NOT_SET: 0,
1666
+ STREAM_STATE: 2
1667
+ };
1668
+
1669
+ /**
1670
+ * @return {proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.TypeCase}
1671
+ */
1672
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.prototype.getTypeCase = function() {
1673
+ return /** @type {proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.TypeCase} */(jspb.Message.computeOneofCase(this, proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.oneofGroups_[0]));
1674
+ };
1675
+
1676
+
1677
+
1678
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1679
+ /**
1680
+ * Creates an object representation of this proto.
1681
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1682
+ * Optional fields that are not set will be set to undefined.
1683
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1684
+ * For the list of reserved names please see:
1685
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1686
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1687
+ * JSPB instance for transitional soy proto support:
1688
+ * http://goto/soy-param-migration
1689
+ * @return {!Object}
1690
+ */
1691
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.prototype.toObject = function(opt_includeInstance) {
1692
+ return proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.toObject(opt_includeInstance, this);
1693
+ };
1694
+
1695
+
1696
+ /**
1697
+ * Static version of the {@see toObject} method.
1698
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1699
+ * the JSPB instance for transitional soy proto support:
1700
+ * http://goto/soy-param-migration
1701
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation} msg The msg instance to transform.
1702
+ * @return {!Object}
1703
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1704
+ */
1705
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.toObject = function(includeInstance, msg) {
1706
+ var f, obj = {
1707
+ checkIndex: jspb.Message.getFieldWithDefault(msg, 1, 0),
1708
+ streamState: (f = msg.getStreamState()) && proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.toObject(includeInstance, f)
1709
+ };
1710
+
1711
+ if (includeInstance) {
1712
+ obj.$jspbMessageInstance = msg;
1713
+ }
1714
+ return obj;
1715
+ };
1716
+ }
1717
+
1718
+
1719
+ /**
1720
+ * Deserializes binary data (in protobuf wire format).
1721
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1722
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation}
1723
+ */
1724
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.deserializeBinary = function(bytes) {
1725
+ var reader = new jspb.BinaryReader(bytes);
1726
+ var msg = new proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation;
1727
+ return proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.deserializeBinaryFromReader(msg, reader);
1728
+ };
1729
+
1730
+
1731
+ /**
1732
+ * Deserializes binary data (in protobuf wire format) from the
1733
+ * given reader into the given message object.
1734
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation} msg The message object to deserialize into.
1735
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1736
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation}
1737
+ */
1738
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.deserializeBinaryFromReader = function(msg, reader) {
1739
+ while (reader.nextField()) {
1740
+ if (reader.isEndGroup()) {
1741
+ break;
1742
+ }
1743
+ var field = reader.getFieldNumber();
1744
+ switch (field) {
1745
+ case 1:
1746
+ var value = /** @type {number} */ (reader.readInt32());
1747
+ msg.setCheckIndex(value);
1748
+ break;
1749
+ case 2:
1750
+ var value = new proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation;
1751
+ reader.readMessage(value,proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.deserializeBinaryFromReader);
1752
+ msg.setStreamState(value);
1753
+ break;
1754
+ default:
1755
+ reader.skipField();
1756
+ break;
1757
+ }
1758
+ }
1759
+ return msg;
1760
+ };
1761
+
1762
+
1763
+ /**
1764
+ * Serializes the message to binary data (in protobuf wire format).
1765
+ * @return {!Uint8Array}
1766
+ */
1767
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.prototype.serializeBinary = function() {
1768
+ var writer = new jspb.BinaryWriter();
1769
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.serializeBinaryToWriter(this, writer);
1770
+ return writer.getResultBuffer();
1771
+ };
1772
+
1773
+
1774
+ /**
1775
+ * Serializes the given message to binary data (in protobuf wire
1776
+ * format), writing to the given BinaryWriter.
1777
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation} message
1778
+ * @param {!jspb.BinaryWriter} writer
1779
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1780
+ */
1781
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.serializeBinaryToWriter = function(message, writer) {
1782
+ var f = undefined;
1783
+ f = message.getCheckIndex();
1784
+ if (f !== 0) {
1785
+ writer.writeInt32(
1786
+ 1,
1787
+ f
1788
+ );
1789
+ }
1790
+ f = message.getStreamState();
1791
+ if (f != null) {
1792
+ writer.writeMessage(
1793
+ 2,
1794
+ f,
1795
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.serializeBinaryToWriter
1796
+ );
1797
+ }
1798
+ };
1799
+
1800
+
1801
+
1802
+
1803
+
1804
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1805
+ /**
1806
+ * Creates an object representation of this proto.
1807
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1808
+ * Optional fields that are not set will be set to undefined.
1809
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1810
+ * For the list of reserved names please see:
1811
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1812
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1813
+ * JSPB instance for transitional soy proto support:
1814
+ * http://goto/soy-param-migration
1815
+ * @return {!Object}
1816
+ */
1817
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.prototype.toObject = function(opt_includeInstance) {
1818
+ return proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.toObject(opt_includeInstance, this);
1819
+ };
1820
+
1821
+
1822
+ /**
1823
+ * Static version of the {@see toObject} method.
1824
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1825
+ * the JSPB instance for transitional soy proto support:
1826
+ * http://goto/soy-param-migration
1827
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation} msg The msg instance to transform.
1828
+ * @return {!Object}
1829
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1830
+ */
1831
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.toObject = function(includeInstance, msg) {
1832
+ var f, obj = {
1833
+ stream: jspb.Message.getFieldWithDefault(msg, 1, ""),
1834
+ expectedState: jspb.Message.getFieldWithDefault(msg, 2, "0"),
1835
+ actualState: jspb.Message.getFieldWithDefault(msg, 3, "0")
1836
+ };
1837
+
1838
+ if (includeInstance) {
1839
+ obj.$jspbMessageInstance = msg;
1840
+ }
1841
+ return obj;
1842
+ };
1843
+ }
1844
+
1845
+
1846
+ /**
1847
+ * Deserializes binary data (in protobuf wire format).
1848
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1849
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation}
1850
+ */
1851
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.deserializeBinary = function(bytes) {
1852
+ var reader = new jspb.BinaryReader(bytes);
1853
+ var msg = new proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation;
1854
+ return proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.deserializeBinaryFromReader(msg, reader);
1855
+ };
1856
+
1857
+
1858
+ /**
1859
+ * Deserializes binary data (in protobuf wire format) from the
1860
+ * given reader into the given message object.
1861
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation} msg The message object to deserialize into.
1862
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1863
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation}
1864
+ */
1865
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.deserializeBinaryFromReader = function(msg, reader) {
1866
+ while (reader.nextField()) {
1867
+ if (reader.isEndGroup()) {
1868
+ break;
1869
+ }
1870
+ var field = reader.getFieldNumber();
1871
+ switch (field) {
1872
+ case 1:
1873
+ var value = /** @type {string} */ (reader.readString());
1874
+ msg.setStream(value);
1875
+ break;
1876
+ case 2:
1877
+ var value = /** @type {string} */ (reader.readSint64String());
1878
+ msg.setExpectedState(value);
1879
+ break;
1880
+ case 3:
1881
+ var value = /** @type {string} */ (reader.readSint64String());
1882
+ msg.setActualState(value);
1883
+ break;
1884
+ default:
1885
+ reader.skipField();
1886
+ break;
1887
+ }
1888
+ }
1889
+ return msg;
1890
+ };
1891
+
1892
+
1893
+ /**
1894
+ * Serializes the message to binary data (in protobuf wire format).
1895
+ * @return {!Uint8Array}
1896
+ */
1897
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.prototype.serializeBinary = function() {
1898
+ var writer = new jspb.BinaryWriter();
1899
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.serializeBinaryToWriter(this, writer);
1900
+ return writer.getResultBuffer();
1901
+ };
1902
+
1903
+
1904
+ /**
1905
+ * Serializes the given message to binary data (in protobuf wire
1906
+ * format), writing to the given BinaryWriter.
1907
+ * @param {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation} message
1908
+ * @param {!jspb.BinaryWriter} writer
1909
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1910
+ */
1911
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.serializeBinaryToWriter = function(message, writer) {
1912
+ var f = undefined;
1913
+ f = message.getStream();
1914
+ if (f.length > 0) {
1915
+ writer.writeString(
1916
+ 1,
1917
+ f
1918
+ );
1919
+ }
1920
+ f = message.getExpectedState();
1921
+ if (parseInt(f, 10) !== 0) {
1922
+ writer.writeSint64String(
1923
+ 2,
1924
+ f
1925
+ );
1926
+ }
1927
+ f = message.getActualState();
1928
+ if (parseInt(f, 10) !== 0) {
1929
+ writer.writeSint64String(
1930
+ 3,
1931
+ f
1932
+ );
1933
+ }
1934
+ };
1935
+
1936
+
1937
+ /**
1938
+ * optional string stream = 1;
1939
+ * @return {string}
1940
+ */
1941
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.prototype.getStream = function() {
1942
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1943
+ };
1944
+
1945
+
1946
+ /**
1947
+ * @param {string} value
1948
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation} returns this
1949
+ */
1950
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.prototype.setStream = function(value) {
1951
+ return jspb.Message.setProto3StringField(this, 1, value);
1952
+ };
1953
+
1954
+
1955
+ /**
1956
+ * optional sint64 expected_state = 2;
1957
+ * @return {string}
1958
+ */
1959
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.prototype.getExpectedState = function() {
1960
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0"));
1961
+ };
1962
+
1963
+
1964
+ /**
1965
+ * @param {string} value
1966
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation} returns this
1967
+ */
1968
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.prototype.setExpectedState = function(value) {
1969
+ return jspb.Message.setProto3StringIntField(this, 2, value);
1970
+ };
1971
+
1972
+
1973
+ /**
1974
+ * optional sint64 actual_state = 3;
1975
+ * @return {string}
1976
+ */
1977
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.prototype.getActualState = function() {
1978
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "0"));
1979
+ };
1980
+
1981
+
1982
+ /**
1983
+ * @param {string} value
1984
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation} returns this
1985
+ */
1986
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation.prototype.setActualState = function(value) {
1987
+ return jspb.Message.setProto3StringIntField(this, 3, value);
1988
+ };
1989
+
1990
+
1991
+ /**
1992
+ * optional int32 check_index = 1;
1993
+ * @return {number}
1994
+ */
1995
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.prototype.getCheckIndex = function() {
1996
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
1997
+ };
1998
+
1999
+
2000
+ /**
2001
+ * @param {number} value
2002
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation} returns this
2003
+ */
2004
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.prototype.setCheckIndex = function(value) {
2005
+ return jspb.Message.setProto3IntField(this, 1, value);
2006
+ };
2007
+
2008
+
2009
+ /**
2010
+ * optional StreamStateViolation stream_state = 2;
2011
+ * @return {?proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation}
2012
+ */
2013
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.prototype.getStreamState = function() {
2014
+ return /** @type{?proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation} */ (
2015
+ jspb.Message.getWrapperField(this, proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation, 2));
2016
+ };
2017
+
2018
+
2019
+ /**
2020
+ * @param {?proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.StreamStateViolation|undefined} value
2021
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation} returns this
2022
+ */
2023
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.prototype.setStreamState = function(value) {
2024
+ return jspb.Message.setOneofWrapperField(this, 2, proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.oneofGroups_[0], value);
2025
+ };
2026
+
2027
+
2028
+ /**
2029
+ * Clears the message field making it undefined.
2030
+ * @return {!proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation} returns this
2031
+ */
2032
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.prototype.clearStreamState = function() {
2033
+ return this.setStreamState(undefined);
2034
+ };
2035
+
2036
+
2037
+ /**
2038
+ * Returns whether this field is set.
2039
+ * @return {boolean}
2040
+ */
2041
+ proto.kurrentdb.protocol.v2.streams.errors.ConsistencyViolation.prototype.hasStreamState = function() {
2042
+ return jspb.Message.getField(this, 2) != null;
2043
+ };
2044
+
2045
+
1423
2046
  /**
1424
2047
  * @enum {number}
1425
2048
  */
@@ -1433,7 +2056,8 @@ proto.kurrentdb.protocol.v2.streams.errors.StreamsError = {
1433
2056
  STREAMS_ERROR_APPEND_RECORD_SIZE_EXCEEDED: 6,
1434
2057
  STREAMS_ERROR_APPEND_TRANSACTION_SIZE_EXCEEDED: 7,
1435
2058
  STREAMS_ERROR_STREAM_ALREADY_IN_APPEND_SESSION: 8,
1436
- STREAMS_ERROR_APPEND_SESSION_NO_REQUESTS: 9
2059
+ STREAMS_ERROR_APPEND_SESSION_NO_REQUESTS: 9,
2060
+ STREAMS_ERROR_APPEND_CONSISTENCY_VIOLATION: 14
1437
2061
  };
1438
2062
 
1439
2063
  goog.object.extend(exports, proto.kurrentdb.protocol.v2.streams.errors);