Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

geteventstore-promise

RemoteMetering3.6kMIT4.0.1TypeScript support: included

GetEventStore client wrapper using promises

node, client, event store, geteventstore, eventstore, promise

readme

geteventstore-promise

A Node.js Event Store client API wrapper using promises

NPM

Installation

yarn add geteventstore-promise

In your Node.js application:

const EventStore = require('geteventstore-promise');

HTTP Client

Config example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

Config example - Secure

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    protocol: 'https',
    hostname: 'localhost',
    port: 2113,
    validateServer: true, //defaults to `true` when `protocol` is `https`, set to `false` when using self-signed certs
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

Supported Methods

getEvents(streamName, startPosition, count, direction, resolveLinkTos, embed)

Returns events from a given stream.

streamName

The name of the stream to read from.

startPosition (optional)

If specified, the stream will be read starting at event number startPosition, otherwise 0 'head' will start reading from the back of the stream, if direction is specified as 'backward'

count (optional)

The number of events to be read, defaults to 1000, max of 4096

direction (optional)

The direction to the read the stream. Can be either 'forward' or 'backward'. Defaults to 'forward'.

resolveLinkTos (optional)

Resolve linked events. Defaults to true

embed (optional)

Resolve linked events. Options: 'body' and 'rich'. Defaults to body

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

// defaults for getEvents if not specified
const events = await client.getEvents('TestStream', 0, 1000, 'forward')

getAllStreamEvents(streamName, chunkSize, startPosition, resolveLinkTos, embed)

Returns all events from a given stream.

streamName

The name of the stream to read from.

chunkSize (optional)

The amount of events to read in each call to Event Store, defaults to 1000,

startPosition (optional)

If specified, the stream will be read starting at event number startPosition, otherwise 0

resolveLinkTos (optional)

Resolve linked events. Defaults to true

embed (optional)

Resolve linked events. Options: 'body' and 'rich'. Defaults to body

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

const allStreamEvents = await client.getAllStreamEvents('TestStream');

readEventsForward(streamName, startPosition, count, resolveLinkTos, embed)

Returns read metadata and events from a given stream.

streamName

The name of the stream to read from.

startPosition (optional)

If specified, the stream will be read starting at event number startPosition, otherwise 0 'head' will start reading from the back of the stream, if direction is specified as 'backward'

count (optional)

The number of events to be read, defaults to 1000, max of 4096

resolveLinkTos (optional)

Resolve linked events. Defaults to true

embed (optional)

Resolve linked events. Options: 'body' and 'rich'. Defaults to body

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

// defaults for readEventsForward if not specified
const readResult = await client.readEventsForward('TestStream', 0, 1000)

readEventsBackward(streamName, startPosition, count, resolveLinkTos, embed)

Returns read metadata and events from a given stream.

streamName

The name of the stream to read from.

startPosition (optional)

If specified, the stream will be read starting at event number startPosition, otherwise 0 'head' will start reading from the back of the stream, if direction is specified as 'backward'

count (optional)

The number of events to be read, defaults to 1000, max of 4096

resolveLinkTos (optional)

Resolve linked events. Defaults to true

embed (optional)

Resolve linked events. Options: 'body' and 'rich'. Defaults to body

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

// defaults for readEventsBackward if not specified
const readResult = await client.readEventsBackward('TestStream', 0, 1000)

writeEvent(streamName, eventType, data, metaData, options)

Writes a single event of a specific type to a stream.

streamName

The name of the stream to read from.

eventType

The type of event to save. Any string value is accepted.

data

The data to be contained in the event as a JSON object.

metaData (optional)

Any MetaData to be saved in the event as a JSON object.

options (optional)

Any options to be specified (as documented in GetEvent Store documentation). Default is simply ExpectedVersion = -2.

Example

const EventStore = require('geteventstore-promise');
const { v4: generateEventId } = require('uuid');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

await client.writeEvent('TestStream-' + generateEventId(), 'TestEventType', { something: '123' });
const events = await client.getEvents(testStream);

writeEvents(streamName, events, options)

Writes an array of Event Store ready events to a stream.

streamName

The name of the stream to read from.

events

The array of Event Store ready events to save. You can call new EventStore.EventFactory().newEvent('TestType', {something: 123}); to get an Event Store ready event.

options (optional)

Any options to be specified (as documented in GetEvent Store documentation). Default is simply ExpectedVersion = -2.

Example

const EventStore = require('geteventstore-promise');
const { v4: generateEventId } = require('uuid');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

const events = [new EventStore.EventFactory().newEvent('TestEventType', { something: '456'})];

await client.writeEvents('TestStream-' + generateEventId(), events);
const events = await client.getEvents(testStream);

checkStreamExists(streamName)

Check if a stream exists, returns true or false.

streamName

The name of the stream to check.

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

const exists = await client.checkStreamExists('ExistingProjectionStreamName');

deleteStream(streamName, hardDelete)

Deletes a stream, fails the promise if stream does not exist.

streamName

The name of the stream to delete.

hardDelete

Hard delete the stream, defaults to false

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

try {
    await client.delete('ExistingStreamName');
} catch(err) {
    // should only happen if something went wrong or the stream does not exist
    console.log(err);
}

ping()

Performs Ping command, rejects promise if unsuccessful

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

await client.ping();

Persistent Subscriptions

Supported Methods

  • assert(subscriptionName, streamName, options)
  • getEvents(subscriptionName, streamName, count, embed)
  • getSubscriptionInfo(subscriptionName, streamName)
  • getStreamSubscriptionsInfo(streamName)
  • getAllSubscriptionsInfo()
  • remove(subscriptionName, streamName)

persistentSubscriptions.assert(subscriptionName, streamName, options)

Upsert the persistent subscription

subscriptionName

The name of the subscription group

streamName

The stream name

options(optional)

The mode of the projection to create, defaults to 'continuous'

resolveLinkTos

Tells the subscription to resolve link events.

startFrom

Start the subscription from the position-th event in the stream.

extraStatistics

Tells the backend to measure timings on the clients so statistics will contain histograms of them.

checkPointAfterMilliseconds

The amount of time the system should try to checkpoint after.

liveBufferSize

The size of the live buffer (in memory) before resorting to paging.

readBatchSize

The size of the read batch when in paging mode.

bufferSize

The number of messages that should be buffered when in paging mode.

maxCheckPointCount

The maximum number of messages not checkpointed before forcing a checkpoint.

maxRetryCount

Sets the number of times a message should be retried before being considered a bad message.

maxSubscriberCount

Sets the maximum number of allowed subscribers

messageTimeoutMilliseconds

Sets the timeout for a client before the message will be retried.

minCheckPointCount

The minimum number of messages to write a checkpoint for.

namedConsumerStrategy

RoundRobin/DispatchToSingle/Pinned

persistentSubscriptions.getEvents(subscriptionName, streamName, count, embed)

Get events

subscriptionName

The name of the subscription group

streamName

The stream name

count (optional)

Number of events to return(defaults to 1)

embed (optional)

None, Content, Rich, Body, PrettyBody, TryHarder(defaults to 'Body')

persistentSubscriptions.getSubscriptionInfo(subscriptionName, streamName)

Get specific subscriptions info

subscriptionName

The name of the subscription group

streamName

The stream name

persistentSubscriptions.getStreamSubscriptionsInfo(streamName)

Get all subscriptions info for a stream

streamName

The stream name

persistentSubscriptions.getAllSubscriptionsInfo()

Get all subscriptions info


Projections

Supported Methods

  • start(projectionName)

    projectionName

    The name of the projection
  • stop(projectionName)

    projectionName

    The name of the projection
  • reset(projectionName)

    projectionName

    The name of the projection
  • remove(projectionName)

    projectionName

    The name of the projection
  • config(projectionName)

    projectionName

    The name of the projection
  • getState(projectionName, options)

    projectionName

    The name of the projection

    options

    Object, partition used to specify the partition to query the state with. e.g. { partition: 1 }

  • getInfo(projectionName, includeConfig)

    projectionName

    The name of the projection

    includeConfig

    Specify if we want to include the projection config in the projection info result set

  • enableAll()

  • disableAll()
  • getAllProjectionsInfo()
  • assert(projectionName, projectionContent, mode, enabled, checkpointsEnabled, emitEnabled, trackEmittedStreams)

    projectionName

    The name of the projection

    projectionContent

    The content of the projection

    mode(optional)

    The mode of the projection to create, defaults to 'continuous'

    enabled(optional)

    Projection enabled by default, defaults to true

    checkpointsEnabled(optional)

    Should enable checkpoints, defaults to true for continuous projections and false for onetime projections

    emitEnabled(optional)

    Should enable emitting, defaults to false

    trackEmittedStreams(optional)

    Should track the emitted streams (tracking emitted streams enables you to delete a projection and all the streams that it has created), defaults to false

Example for using any projection method

projections.getState()

Returns the state of the Projection as a JSON object.

projectionName

The name of the projection to get state of.

options(optional)
partition

The name of the partition to retrieve.

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

const projectionState = await client.projections.getState('TestProjection');

Admin

admin.scavenge()

Sends scavenge command to Event Store.

If the promise is fulfilled then the scavenge command has been sent, it does not guarantee that the scavenge will be successful.

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

await client.admin.scavenge();
console.log('Scavenge command sent!');

admin.shutdown()

Sends shutdown command to Event Store.

If the promise is fulfilled then the shutdown command has been sent, it does not guarantee that the shutdown will be successful.

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.HTTPClient({
    hostname: 'localhost',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

await client.admin.shutdown();
console.log('Shutdown command sent!');

TCP Client

Acknowledgements

Uses the node-eventstore-client as authored by nicdex

Github: https://github.com/nicdex/node-eventstore-client

Config example

const client = new EventStore.TCPClient({
    hostname: 'localhost',
    port: 1113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    },
    poolOptions: {
        min: 0,
        max: 10
    }
});

Config example - Secure

const client = new EventStore.TCPClient({
    hostname: 'localhost',
    port: 1113,
    useSslConnection: true,
    validateServer: true, //defaults to `true` when `useSslConnection` is `true`, set to `false` when using self-signed certs
    credentials: {
        username: 'admin',
        password: 'changeit'
    },
    poolOptions: {
        min: 0,
        max: 10
    }
});

Config example - Override connection name

const { v4: generateId } = require('uuid');

const client = new EventStore.TCPClient({
    hostname: 'localhost',
    port: 1113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    },
    poolOptions: {
        min: 0,
        max: 10
    },
    connectionNameGenerator: () => `APP_NAME_${generateId()}`
});

Config example - Clustering - Gossip Seeds

const client = new EventStore.TCPClient({
    gossipSeeds: [
        { hostname: '192.168.0.10', port: 2113 },
        { hostname: '192.168.0.11', port: 2113 },
        { hostname: '192.168.0.12', port: 2113 }
    ],
    credentials: {
        username: 'admin',
        password: 'changeit'
    },
    poolOptions: {
        min: 0,
        max: 10
    }
});

Config example - Clustering - DNS Discovery

const client = new EventStore.TCPClient({
    protocol: 'discover',
    hostname: 'my.host',
    port: 2113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    },
    poolOptions: {
        min: 0,
        max: 10
    }
});

Common methods(same as HTTP, just use TCP configuration)

  • getEvents(streamName, startPosition, count, direction, resolveLinkTos)
  • readEventsForward(streamName, startPosition, count, resolveLinkTos)
  • readEventsBackward(streamName, startPosition, count, resolveLinkTos)
  • writeEvent(streamName, eventType, data, metaData, options)
  • writeEvents(streamName, events, options)
  • deleteStream(streamName, hardDelete)

Supported Methods

close()

Close all active connections.

getEventsByType(streamName, eventTypes, startPosition, count, direction, resolveLinkTos)

Returns all events from a given stream by Event Types.

streamName

The name of the stream to read from.

eventTypes

An array of event types to filter by.

startPosition (optional)

If specified, the stream will be read starting at event number startPosition, otherwise 0

count (optional)

The number of events to be read, defaults to 1000, max of 4096

direction (optional)

The direction to the read the stream. Can be either 'forward' or 'backward'. Defaults to 'forward'.

resolveLinkTos (optional)

Resolve linked events. Defaults to true

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.TCPClient({
    hostname: 'localhost',
    port: 1113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

const eventsByType = await client.getEventsByType('TestStream', ['TestType']);

getAllStreamEvents(streamName, chunkSize, startPosition, resolveLinkTos)

Returns all events from a given stream.

streamName

The name of the stream to read from.

chunkSize (optional)

The amount of events to read in each call to Event Store, defaults to 1000,

startPosition (optional)

If specified, the stream will be read starting at event number startPosition, otherwise 0

resolveLinkTos (optional)

Resolve linked events. Defaults to true

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.TCPClient({
    hostname: 'localhost',
    port: 1113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

const allStreamEvents = await client.getAllStreamEvents('TestStream');

subscribeToStream(streamName, onEventAppeared, onDropped, resolveLinkTos)

Subscribes to a Stream (live subscription)

streamName

The name of the stream to read from.

onEventAppeared (optional)

function

onDropped

function

resolveLinkTos

Resolve linked events

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.TCPClient({
    hostname: 'localhost',
    port: 1113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

function onEventAppeared(subscription, ev) {
    processedEventCount++;
    return;
};

function onDropped(subscription, reason, error) {

};

await client.subscribeToStream('TestStream', onEventAppeared, onDropped, false);

subscribeToStreamFrom(streamName, fromEventNumber, onEventAppeared, onLiveProcessingStarted, onDropped, settings)

Subscribes to a Stream from a given event number (Catch up Subscription)

streamName

The name of the stream to read from.

fromEventNumber

The event number to subscribe from

onEventAppeared (optional)

function

onLiveProcessingStarted

function

onDropped

function

settings

resolveLinkTos - Whether or not to resolve link events

maxLiveQueueSize - The max amount to buffer when processing from live subscription

readBatchSize - The number of events to read per batch when reading history

debug - in debug mode(true/false)

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.TCPClient({
    hostname: 'localhost',
    port: 1113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

let processedEventCount = 0;

function onEventAppeared(subscription, ev) {
    processedEventCount++;
    return;
};

function onLiveProcessingStarted() {
    return;
}

function onDropped(subscription, reason, error) {

};

await client.subscribeToStreamFrom('TestStream', 0, onEventAppeared, onLiveProcessingStarted,onDropped);

eventEnumerator(streamName, direction, resolveLinkTos)

Returns an events enumerator on which events can be iterated.

streamName

The name of the stream to read from.

direction (optional)

The direction to the read the stream. Can be either 'forward' or 'backward'. Defaults to 'forward'.

resolveLinkTos (optional)

Resolve linked events. Defaults to true

Supported Functions

  • next(batchSize)
  • previous(batchSize)
  • first(batchSize)
  • last(batchSize)
batchSize

The number of events to read per enumeration.

Example

const EventStore = require('geteventstore-promise');

const client = new EventStore.TCPClient({
    hostname: 'localhost',
    port: 1113,
    credentials: {
        username: 'admin',
        password: 'changeit'
    }
});

const streamName = 'TestStream';
const enumerator = client.eventEnumerator(streamName);
const result = await enumerator.next(20);
//result
// {
//     isEndOfStream: true/false,
//     events: [ ..., ..., ... ]
// }

changelog

4.0.1 (2021-09-28)

TCP

  • Fix - handle closed connection when closed event never emitted

Dependencies

  • Update packages

4.0.0 (2021-05-22)

Features

  • Added support for v20 and v21
  • Added support for secured EventStoreDB clusters and single instances

Breaking Changes

  • Removed deprecated legacy instance creation: geteventstore.tcp(config), geteventstore.http(config) and geteventstore.eventFactory

TCP

Features
  • Added connectionNameGenerator function to config that allows custom TCP connection names

Tests

  • Tests now solely uses docker
  • Added test:secure and test:insecure scripts
  • test will now run all tests with secured and insecure EventStoreDB's

3.3.0 (2021-02-22)

TCP

Changes

  • Destroy connection on connection close
  • Subscription connection pools now tracked uniquely
  • close connection pool will now drain pool first

Fixes

  • subscribeToStream - close will now release and close subscription connection pool
  • subscribeToStreamFrom - added close function that will release and close subscription connection pool

Dependencies

  • Update packages

3.2.5 (2021-01-29)

Dependencies

  • Update packages

3.2.4 (2020-11-04)

Fix

  • projections - assert, trackEmittedStreams setter. Thanks @maniolias

3.2.3 (2020-10-20)

  • projections - config query added. Thanks @maniolias
  • projections - getInfo, includeConfig in result set added. Thanks @maniolias
  • projections - assert, trackEmittedStreams added. Thanks @maniolias

3.2.2 (2020-10-05)

Fix

  • persistentSubscriptions.assert - resolveLinkTos not applying due to typo. Thanks @maniolias
  • persistentSubscriptions.getEvents - 401 due to missing auth headers. Thanks @maniolias

Dependencies

  • Update packages

3.2.1 (2020-02-27)

Dependencies

  • Update packages

3.2.0 (2019-10-07)

Breaking Changes

  • subscriptions - onEventAppeared aligned with node-eventstore-client, previously: onEventAppeared(ev) now: onEventAppeared(subscription, ev). Thanks @adebisi-fa

Features

  • projections - result query added. Thanks @set4812

3.1.3 (2019-09-09)

Fix

  • Typings - Metadata and eventId is optional. Thanks @spontoreau

Dependencies

  • Update packages

3.1.2 (2019-07-29)

Misc

  • Typings - Inherit base TCP config from 'node-eventstore-client'. Thanks @adebisi-fa

Dependencies

  • Update packages

3.1.1 (2019-02-14)

Fix

  • TCPReadResult typescript definition

3.1.0 (2019-02-07)

Features

  • Add readEventsForward and readEventsBackward returning read metadata + events

Misc

  • Rename "length" parameter to "count"

3.0.3 (2019-02-06)

TCP Client

  • Fix - mapping of non-json events

3.0.2 (2019-01-02)

Fix

  • Expected version on writes defaulting to -2 when 0 provided. Thanks @amaghfur

Dependencies

  • Update packages

Misc

  • Change folder structure

3.0.1 (2018-09-17)

Misc

  • Fix - General Typescript definition issues

3.0.0 (2018-09-13)

Features

  • Typescript definitions added
  • Package exports now exposed as classes

    Previous Usage (Deprecated)
      const eventstore = require('geteventstore-promise');
      const httpClient = eventstore.http(...config);
      const tcpClient = eventstore.tcp(...config);
      const newEvent = eventstore.eventFactory.NewEvent(...args);
    New Usage
      const EventStore = require('geteventstore-promise');
      const httpClient = new EventStore.HTTPClient(...config);
      const tcpClient = new EventStore.TCPClient(...config);
      const newEvent = new EventStore.EventFactory().newEvent(...args);

Dependencies

  • Remove - bluebird
  • Remove - lodash
  • Replace - request-promise with axios

Breaking Changes

General
  • Promises - '.finally()' will not be available anymore due to the removal of bluebird
HTTP Client
  • Errors returned from HTTP calls might differ slightly from removed request-promise package vs the new axios implementation

2.0.2 (2018-09-11)

TCP Client

Misc

  • Update dependencies

2.0.1 (2018-06-04)

TCP Client

  • Fix - edge case when eventNumber is not coming back as a long

2.0.0 (2018-06-02)

TCP Client

Breaking Changes

TCP Client

  • Replacement - 'closeConnections' with 'close', which will close connection pool
  • Subscriptions - now return subscription object from tcp library instead of connection
  • Subscriptions - now return events in same format as normal getEvents
  • Subscriptions - onDropped arguments -> onDropped(subscription, reason, error)
  • subscribeToStream - no longer has "onConfirm" handler

1.4.0 (2018-05-29)

TCP Client

  • "created" property on read events will now return as a ISO-8601 string instead of date object

Breaking Changes

  • TCP: To bring both HTTP and TCP read events results inline, "created" will now return as a ISO-8601 string

1.3.3 (2018-05-29)

HTTP Client

  • Add "created" property to events on read, as TCP client returns

Dependencies

  • Use latest packages

1.3.2 (2018-04-24)

Dependencies

  • Use latest packages

1.3.1 (2017-10-27)

HTTP Client

  • Remove redundant url parsing logic, by setting base url on client create

1.3.0 (2017-10-27)

Dependencies

  • Use latest packages
  • TCP: upgrade node-eventstore-client from 0.1.7 to 0.1.9

Dev

  • Requires nodejs >= v.7.6

Misc

  • Convert library source to use es6 modules, and async/await
  • Use babel latest preset

1.2.8 (2017-08-11)

TCP Client

  • Improve tcp connection on error logging

1.2.7 (2017-08-11)

TCP Client

  • Update to latest version of newly named node-eventstore-client from eventstore-node

1.2.6 (2017-07-26)

HTTP Client

  • Feature: add embed option to getEvents and getAllStreamEvents. Options: 'body' and 'rich', defaults to 'body' as per previous versions

1.2.5 (2017-04-18)

TCP Client

  • Fix: deleting of projected streams(Expected version to any)

1.2.4 (2017-04-18)

TCP Client

  • Fix: add eventId and positionCreated properties to mapped events

1.2.3 (2017-04-18)

TCP Client

  • Feature: add deleteStream

1.2.2 (2017-03-29)

TCP Client

  • Fix: convert metadata in mapping

1.2.1 (2017-03-29)

TCP Client

  • Fix: filter deleted events on projected streams

Breaking Changes

  • TCP: events, rename property eventStreamId to streamId

1.2.0 (2017-03-29)

Source

  • Convert to ES6

Misc.

  • Fix: debug logs doing unnecessary stringify, increases performance all around

Breaking Changes

  • None

1.1.26 (2017-03-27)

TCP Client

  • Add check stream exits

1.1.25 (2017-03-27)

TCP Client

  • Update to latest version of eventstore-node that inclues some fixes

1.1.25 (2017-03-22)

TCP Client

1.1.24 (2017-03-15)

HTTP Client

  • New Feature: persistent subscriptions v1
  • Fix: deleteStream, return error object on stream 404

1.1.23 (2017-03-15)

HTTP Client

  • Fix checkStreamExists, return rejected promise on any error other than a 404

TCP Client

  • Use latest event-store-client

EventFactory

  • Added support for custom eventId(thanks @krazar)

Dependencies

  • bluebird, 3.4.6 > 3.5.0
  • debug, 2.2.0 > 2.6.3
  • event-store-client, 0.0.10 > 0.0.11
  • lodash, 4.15.0 > 4.17.4
  • request-promise, 2.0.1 > 4.1.1 (requires request 2.81.0)
  • uuid, 3.0.0 > 3.0.1

Misc

  • added missing debug logs

1.1.22 (2017-03-09)

HTTP Client

  • add timeout option

1.1.21 (2017-01-04)

All Clients

  • add resolveLinkTos optional param for all read functions

1.1.20 (2016-12-22)

HTTP Client

  • deleteStream, added option to hard delete streams(thanks @mjaric)

TCP Client

  • SubscribeToStreamFrom, added missing event-store-client settings(maxLiveQueueSize, readBatchSize, debug)

1.1.19 (2016-12-08)

Dependencies

  • 'q' promise library replaced by bluebird (3.4.6)

1.1.18 (2016-11-23)

Dependencies

  • 'node-uuid' got deprecated and renamed to 'uuid'(3.0.0)

1.1.17 (2016-11-17)

TCP Client

  • clean up console log on live subscription

1.1.16 (2016-11-10)

TCP Client

  • Add Subcribe to stream to start a live subscription to a stream

1.1.15 (2016-09-22)

Aggregate Root

  • Fix: version of aggregrate not setting on event 0

TCP Client

  • Upgrade to lastest event-store-client library(0.0.10)

Misc.

  • Update to latest lodash(4.15.0)

1.1.14 (2016-08-24)

HTTP Client

  • Fix: GetEvents: When passing starting position of 0 for backward read, only event 0 should be returned. Was starting read over from the back of the stream(Potential breaking change)

1.1.13 (2016-07-26)

TCP Client

  • Fix: Create local references of events when writing

1.1.12 (2016-07-26)

HTTP Client

  • Fix: Only parse event data when defined
  • Fix: Return full error object on getAllStreamEvents

TCP Client

  • Fix: Return full errors
  • Upgrade to lastest event-store-client library(0.0.9)

1.1.11 (2016-07-18)

TCP Client

  • Upgrade to lastest event-store-client library(0.0.8)

1.1.10 (2016-06-28)

TCP Client

  • Feature: subscribeToStreamFrom to allow resolveLinkTos setting

1.1.9 (2016-06-28)

TCP Client

  • Feature: add subscribeToStreamFrom

HTTP Client

  • Feature: get state of partitioned projection

Dependencies

  • replace underscore with lodash
  • upgrade version event-store-client 0.0.7

1.1.8 (2016-06-20)

HTTP Client

  • Fix: writeEvents return successful if empty array given
  • Fix: any get events function will default to 4096 count if greater is requested (warning also displayed)
  • Feature: add getAllStreamEvents function

TCP Client

  • Feature: added start event number on getAllStreamEvents
  • Fix: any get events function will default to 4096 count if greater is requested (warning also displayed)
  • Change: default chunkSize of reads from 250 to 1000

Tests

  • Added tests to TCP and HTTP client to check for undefined, empty array in writeEvents

1.1.7 (2016-06-08)

HTTP Client

  • Ping: returns successful if ping can be called, rejects if not

1.1.6 (2016-06-07)

HTTP Client

  • DeleteStream: deletes an existing stream, rejects if the stream does not exist

1.1.5 (2016-06-07)

HTTP Client

  • GetEvents return events in the correct order. Forwards and Backwards now return as expected. Reverse of what it used to be.

1.1.4 (2016-04-15)

TCP Client

  • Return rejected promise on failure to connect to Event Store instead of just logging it

1.1.3 (2016-04-06)

HTTP Client

  • Make checkStreamExists more accurate
  • Fix request-promise usage to include 'embed=body' as query string object(mono fix)

1.1.2 (2016-04-04)

TCP Client

  • Fix tcp client adding invalid 'host' property to config

1.1.1 (2016-03-15)

Breaking Changes

HTTP client

  • 'getProjectionState' moved to 'projections.getState'
  • 'getAllProjectionsInfo' moved to 'projections.getAllProjectionsInfo'

1.1.0 (2016-03-14)

Breaking Changes

Configuration

  • Removed wrapping http and tcp configuration properties
  • Removed protocol property, assigned internally
Previous Usage
var eventstore = require('geteventstore-promise');

var client = eventstore.http({
                http:{
                    hostname: 'localhost',
                    protocol: 'http',
                    port: 2113,
                    credentials: {
                        username: 'admin',
                        password: 'changeit'
                    }
                }
            });
New Usage
var eventstore = require('geteventstore-promise');

var client = eventstore.http({
                hostname: 'localhost',
                port: 2113,
                credentials: {
                    username: 'admin',
                    password: 'changeit'
                }
            });