Skip to content

Releases: dolittle/JavaScript.SDK

Release v24.0.0

25 Mar 08:11
c15b365

Choose a tag to compare

Summary

Use the newest major version of the Dolittle Grpc Contracts to be compatible with version 8 of the Runtime

Changed

  • Use the newest major version 7 of the Dolittle Grpc Contracts

Prerelease v24.0.0-meriadoc.1

24 Mar 07:25
196e461

Choose a tag to compare

Pre-release

Summary

Merge with master

Prerelease v24.0.0-meriadoc.0

23 Mar 14:41
36d8e28

Choose a tag to compare

Pre-release

Summary

Updates to latest v7 release of Contracts to be compatible with the v8 version of the Runtime.

Changed

  • Contracts dependency updated to v7 to be compatible with v8 Runtime

Release v23.2.3

23 Mar 22:02
5ca19c6

Choose a tag to compare

Summary

Fixes a bug in the AggregateRoot where an on-method would be called (while applying events) with the value of a property named content on the event (usually undefined) - not the actual event.

Fixed

  • When on-methods in Aggregate Roots where called while applying events, the wrong object was passed in as the event. Which in most cases would mean they were called with undefined.

Release v23.2.2

09 Mar 09:59
346f049

Choose a tag to compare

Summary

Upgrade the grpc versions

Changed

  • Changed the grpc and contracts versions

Release v23.2.1

08 Mar 10:28
dae82cc

Choose a tag to compare

Summary

Fixes a bug that resulted in wrong retry timings when processing of events failed.

Fixed

  • The event processing retry time should now increment in the correct interval

Release v23.2.0

14 Feb 09:51
1601c5a

Choose a tag to compare

Summary

Adds aliases to Projections, in the same way we have for Event Handlers. They default to the name of the read model class, and can be overridden with a decorator option or a builder method.

Added

  • An optional alias property on the @projection decorator options.
  • A .withAlias method on the Projection builder API.

Release v23.1.0

11 Feb 09:18
fd5aacf

Choose a tag to compare

Summary

Adds two new event key selectors to projections, StaticKey and KeyFromEventOccurred

Added

  • staticKey event key selector attribute for projection On-methods that sets a constant, static, key as the key of the read model
  • keyFromEventOccurred event key selector for projection On-methods that uses the event occurred metadata as the key for the projection read models formatted as the string given to the attribute. We currently support these formats:
    • yyyy-MM-dd
    • yyyy-MM
    • yyyy
    • HH:mm:ss
    • hh:mm:ss
    • HH:mm
    • hh:mm
    • HH
    • hh
    • yyyy-MM-dd HH:mm:ss
    • And the above in different orderings

Release v23.0.0

10 Feb 09:20
1bbeaa7

Choose a tag to compare

Summary

The Dolittle Client now fetches resources while establishing the initial connection so that we could make the resources interfaces synchronous, simplifying the usage and allowing us to bind the MongoDB types in the DI container. Collections that are created by copying Projection read models are bound in the tenant scoped DI containers. The .connected property on the client has been changed to a Promise so you can await the connection asynchronously. The old boolean property has been moved to .isConnected.

Added

  • A new property IDolittleClient.connected that returns a Promise<void> that is resolved when the client is successfully connected to a Runtime.
  • A binding for the MongoDB Db type in the tenant scoped DI containers.
  • Bindings for MongoDB Collection<TReadModel> types in the tenant scoped DI containers for Projections with read models copied to MongoDB. These can be resolved using the service identifier provided by the extension method Collection.forReadModel(TReadModel).

Changed

  • The IMongoDBResource.getDatabase() returns an Db instead of a Promise<Db> since the configuration is retrieved while connecting to the Runtime.
  • The IDolittleClient.connected boolean property has been renamed to .isConnected.

Release v22.2.0

09 Feb 12:53
4a2e48c

Choose a tag to compare

Summary

Introduces APIs to configure secondary storage for Projection read models for querying, as introduced in dolittle/Runtime#614 (requires Runtime v7.6.0). These changes makes it easy to query Projection read models by specifying that you want copies stored in MongoDB, and then use an IMongoCollection<> for that Projection as any other MongoDB collection. The Projection still operates normally and can be fetched from the Projection Store. Modifications of documents in the copied collections will affect the original Projection processing, but should be avoided as it could cause unexpected behaviour. The collections are automatically created and dropped as needed by the Runtime when Projections are created or changed.

There is currently no mechanism for detecting multiple projections copied to the same collection, so be aware of possible strange behaviour if you have multiple Projections with the same name.

Added

  • The @copyToMongoDB(...) decorator that enables read model copies for a Projection class to MongoDB. The default collection name is the same as the class name. The decorator accepts an argument to override the collection name.
  • The @convertToMongoDB(conversion) decorator to specify a BSON conversion to apply when copying the Projection read model to a MongoDB collection.
  • A .copyToMongoDB(...) method on the Projection builder for enabling read model copies for Projections created using the builder API. This method accepts a callback that you can use to set the collection name and conversions for the read model copies.
  • Extension method Db.collection(readModelType, settings?) to get a collection using the name of the read model or the collection specified in the @copyToMongoDB(collection) decorator.