Skip to content

Releases: EventStore/EventStore-Client-NodeJS

@eventstore/[email protected]

02 Sep 05:47
4c46920
Compare
Choose a tag to compare

Bug fixes

  • Do not trace events with non-json metadata (#386) View

@eventstore/[email protected]

10 Jun 05:12
fe0b45e
Compare
Choose a tag to compare

Features

  • Added tracing instrumentation for the append and subscribe operations

v6.2.1

13 May 08:01
792842e
Compare
Choose a tag to compare

Bug fixes

  • Include dist in release

v6.2.0

10 May 10:49
0c191b3
Compare
Choose a tag to compare

Features

  • Support providing an x.509 certificate for user authentication (#361) View

Changed

Updated error handling to use NotFoundError instead of UnknownError in projection operations when the projection doesn't exist

  • Previously, the server was returning UnknownError when a projection didn't exist. EventStoreDB now returns NotFoundError. This change updates the client to use NotFoundError instead of UnknownError when a projection doesn't exist. View

⚠️ This only affects users who are using EventStoreDB versions 24.6 and greater.

Expect CancelledError when node is terminated to align with server version 24.4

  • EventStoreDB recently configured the ShutdownTimeout to 5s after being set to 30s in recent .NET releases resulting to different error status code returned from the server. The client now expects a CancelledError when the node is terminated. View

⚠️ This only affects users who are using EventStoreDB versions 24.4 and greater.

Miscellaneous

  • The tests are now run against Node LTS (v20.12.2 as of this release).
  • We are now using tsdoc for documentation comments as eslint-plugin-jsdoc does not support NodeJS versions below 18.

v6.1.0

19 Dec 13:35
Compare
Choose a tag to compare

Features

  • Add support for caught up and fell behind subscription message View

Enhancements

  • Increase test coverage for reconnection View
  • Use dynamic tags instead of hardcoding esdb versions View
  • Update TypeScript, ESLint and other dependencies View
  • Update grpc-js to 1.9.12 View

Thanks

🎉 Thanks for @jokesterfr and @Imanghvs for their contributions! 🎉

v6.0.0

25 Aug 10:03
Compare
Choose a tag to compare

Breaking changes

CancelledError is now thrown when a stream is cancelled by the server

Previously, we would throw an UnavailableError when the server was unavailable to take a request, or a stream was cancelled by the server. This release now throws a CancelledError when the stream is cancelled, allowing users to distinguish between them.

If users are catching UnavailableError on a stream for this situation, they should now be looking for a CancelledError. View

Before:

try {
  for await (const event of client.readStream("my_stream")) {
    // do something
  }
} catch (error) {
  if (isCommandError(error)) {
    if (error.type === ErrorType.UNAVAILABLE) {
      // Server is unavailable to take request
      // _OR_
      // Stream was cancelled by server
    }
  }
}

After:

try {
  for await (const event of client.readStream("my_stream")) {
    // do something
  }
} catch (error) {
  if (isCommandError(error)) {
    if (error.type === ErrorType.CANCELLED) {
      // Stream was cancelled by server
    }

    if (error.type === ErrorType.UNAVAILABLE) {
      // Server is unavailable to take request
    }
  }
}

Bug Fixes

  • fix out of bounds value for stream revision View

v5.0.1

16 Feb 13:12
Compare
Choose a tag to compare

Bug Fixes

  • Fix minor typo View
  • Generate sourcemaps with build View

Thanks

🎉 Thanks for @coffemakingtoaster for their contributions! 🎉

v5.0.0

04 Nov 11:56
Compare
Choose a tag to compare

Breaking changes

RecordedEvent["created"] is now a Date

Previously, a recorded event's created property was being returned in ticks, a 64bit integer in 100ns precision. As well as being an unusual format, this was being parsed into a Number, so was unsafe. This release changes the property to be represented by a Date.

Before:

created was an unsafe "ticks" since epoch:

for await (const { event } of client.readStream(STREAM_NAME)) {
  // 16675621600650000 (greater than Number.MAX_SAFE_INTEGER)
  console.log(event?.created);
}

After:

created is a Date:

for await (const { event } of client.readStream(STREAM_NAME)) {
  // 2022-11-04T11:42:40.065Z
  console.log(event?.created);
}

v4.0.0

02 Sep 10:54
Compare
Choose a tag to compare

Breaking changes

Add emitEnabled option to createProjection.

Due to a bug on the server, previously, the trackEmittedStreams option was setting emitEnabled, and not trackEmittedStreams. This release adds the emitEnabled option and corrects the behaviour of trackEmittedStreams, with a polyfill for earlier server versions. View

Before:

Setting trackEmittedStreams would enable emitting, but not track streams.

await client.createProjection(PROJECTION_NAME, projectionQuery, {
  trackEmittedStreams: true,
});

After:

Setting emitEnabled works as expected:

await client.createProjection(PROJECTION_NAME, projectionQuery, {
  emitEnabled: true,
});

Setting both emitEnabled and trackEmittedStreams works as expected:

await client.createProjection(PROJECTION_NAME, projectionQuery, {
  emitEnabled: true,
  trackEmittedStreams: true,
});

Setting only trackEmittedStreams will be rejected by the server:

// incorrect
await client.createProjection(PROJECTION_NAME, projectionQuery, {
  trackEmittedStreams: true,
});

Features

Add position to events from stream

When connected to a server that supports it (>22.6), events read from a stream will include their commit and prepare position. View

Bug Fixes

  • Prevent multiple appends within the same event loop creating many batches, and improve backpressure. View
  • Destroy read stream if stream is not found. View
  • Only swallow unimplemented errors when creating server-features. View

Removal of Deprecated Apis

  • Remove deprecated consumer strategy names. View
  • Remove deprecated persistent subscription methods. View
  • Remove deprecated getProjectionStatistics method. View

v3.4.0

14 Jul 13:40
Compare
Choose a tag to compare

Features

Add retry count to persistent subscription events

Adds retryCount property to events from subscribeToPersistentSubscriptionToStream and subscribeToPersistentSubscriptionToAll View

const subscription = client.subscribeToPersistentSubscriptionToStream(
  STREAM_NAME,
  GROUP_NAME
);

for await (const event of subscription) {
  try {
    console.log(
      `handling event ${event.event?.type} with retryCount ${event.retryCount}`
    );
    await handleEvent(event);
    await subscription.ack(event);
  } catch (error) {
    await subscription.nack(PARK, error.toString(), event);
  }
}

Bug Fixes

  • Fix doc comment on readStream View
  • Fix type definition for acl in stream metadata View