Adding start/end as static Position
Add the streamPosition constants Move Projections into the expose classes section Version 0.2.2
This commit is contained in:
@ -4,15 +4,23 @@ var results = require('./results');
|
||||
const expectedVersion = {
|
||||
any: -2,
|
||||
noStream: -1,
|
||||
emptyStream: -1
|
||||
emptyStream: -1,
|
||||
streamExists: -4
|
||||
};
|
||||
Object.freeze(expectedVersion);
|
||||
|
||||
const positions = {
|
||||
start: new results.Position(0, 0),
|
||||
end: new results.Position(-1, -1)
|
||||
};
|
||||
Object.freeze(positions);
|
||||
|
||||
const streamPosition = {
|
||||
start: 0,
|
||||
end: -1
|
||||
};
|
||||
Object.freeze(streamPosition);
|
||||
|
||||
/**
|
||||
* Create an EventData object from JavaScript event/metadata that will be serialized as json
|
||||
* @public
|
||||
@ -60,6 +68,7 @@ module.exports.ProjectionCommandFailedError = require('./errors/projectionComman
|
||||
// Expose enums/constants
|
||||
module.exports.expectedVersion = expectedVersion;
|
||||
module.exports.positions = positions;
|
||||
module.exports.streamPosition = streamPosition;
|
||||
module.exports.systemMetadata = require('./common/systemMetadata');
|
||||
module.exports.eventReadStatus = results.EventReadStatus;
|
||||
module.exports.sliceReadStatus = require('./sliceReadStatus');
|
||||
|
@ -30,6 +30,8 @@ Position.prototype.toString = function() {
|
||||
return [this.commitPosition.toString(), this.preparePosition.toString()].join("/");
|
||||
};
|
||||
|
||||
Position.start = new Position(0,0);
|
||||
Position.end = new Position(-1,-1);
|
||||
|
||||
const EventReadStatus = {
|
||||
Success: 'success',
|
||||
|
Reference in New Issue
Block a user