Releases: dolittle/JavaScript.SDK
Release v24.0.0
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
Summary
Merge with master
Prerelease v24.0.0-meriadoc.0
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
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
Summary
Upgrade the grpc versions
Changed
- Changed the grpc and contracts versions
Release v23.2.1
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
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
aliasproperty on the@projectiondecorator options. - A
.withAliasmethod on the Projection builder API.
Release v23.1.0
Summary
Adds two new event key selectors to projections, StaticKey and KeyFromEventOccurred
Added
staticKeyevent key selector attribute for projection On-methods that sets a constant, static, key as the key of the read modelkeyFromEventOccurredevent 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
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.connectedthat returns aPromise<void>that is resolved when the client is successfully connected to a Runtime. - A binding for the MongoDB
Dbtype 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 methodCollection.forReadModel(TReadModel).
Changed
- The
IMongoDBResource.getDatabase()returns anDbinstead of aPromise<Db>since the configuration is retrieved while connecting to the Runtime. - The
IDolittleClient.connectedboolean property has been renamed to.isConnected.
Release v22.2.0
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.