Updated protobufjs to latest version

This commit is contained in:
2017-04-16 15:51:09 -07:00
parent e0446cfb3e
commit 83cfa8fe1c
21 changed files with 10922 additions and 1603 deletions

View File

@@ -20,20 +20,23 @@ function VolatileSubscriptionOperation(
util.inherits(VolatileSubscriptionOperation, SubscriptionOperation);
VolatileSubscriptionOperation.prototype._createSubscriptionPackage = function() {
var dto = new ClientMessage.SubscribeToStream(this._streamId, this._resolveLinkTos);
var dto = new ClientMessage.SubscribeToStream({
eventStreamId: this._streamId,
resolveLinkTos: this._resolveLinkTos
});
return new TcpPackage(TcpCommand.SubscribeToStream,
this._userCredentials !== null ? TcpFlags.Authenticated : TcpFlags.None,
this._correlationId,
this._userCredentials !== null ? this._userCredentials.username : null,
this._userCredentials !== null ? this._userCredentials.password : null,
new BufferSegment(dto.toBuffer()));
new BufferSegment(ClientMessage.SubscribeToStream.encode(dto).finish()));
};
VolatileSubscriptionOperation.prototype._inspectPackage = function(pkg) {
try {
if (pkg.command === TcpCommand.SubscriptionConfirmation) {
var dto = ClientMessage.SubscriptionConfirmation.decode(pkg.data.toBuffer());
this._confirmSubscription(dto.last_commit_position, dto.last_event_number);
this._confirmSubscription(dto.lastCommitPosition, dto.lastEventNumber);
return new InspectionResult(InspectionDecision.Subscribed, "SubscriptionConfirmation");
}
if (pkg.command === TcpCommand.StreamEventAppeared) {