@dolittle/sdk.aggregates
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
32 lines • 2.39 kB
JavaScript
;
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.AggregatesBuilder = void 0;
const Aggregates_1 = require("./Aggregates");
const IAggregatesBuilder_1 = require("./IAggregatesBuilder");
/**
* Represents an implementation of {@link IAggregatesBuilder}.
*/
class AggregatesBuilder extends IAggregatesBuilder_1.IAggregatesBuilder {
/**
* Initialises a new instance of the {@link AggregatesBuilder} class.
* @param {IAggregateRootTypes} _aggregateRootTypes - For aggregate root types resolution.
* @param {IEventTypes} _eventTypes - For event types resolution.
* @param {IEventStoreBuilder} _eventStoreBuilder - The builder to use for getting the event store for a specific tenant.
* @param {Logger} _logger - For logging.
*/
constructor(_aggregateRootTypes, _eventTypes, _eventStoreBuilder, _logger) {
super();
this._aggregateRootTypes = _aggregateRootTypes;
this._eventTypes = _eventTypes;
this._eventStoreBuilder = _eventStoreBuilder;
this._logger = _logger;
}
/** @inheritdoc */
forTenant(tenant) {
return new Aggregates_1.Aggregates(this._aggregateRootTypes, this._eventTypes, this._eventStoreBuilder.forTenant(tenant), this._logger);
}
}
exports.AggregatesBuilder = AggregatesBuilder;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQWdncmVnYXRlc0J1aWxkZXIuanMiLCJzb3VyY2VSb290IjoiLi4vIiwic291cmNlcyI6WyJCdWlsZGVycy9BZ2dyZWdhdGVzQnVpbGRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsK0NBQStDO0FBQy9DLHFHQUFxRzs7O0FBU3JHLDZDQUEwQztBQUMxQyw2REFBMEQ7QUFFMUQ7O0dBRUc7QUFDSCxNQUFhLGlCQUFrQixTQUFRLHVDQUFrQjtJQUNyRDs7Ozs7O09BTUc7SUFDSCxZQUNxQixtQkFBd0MsRUFDeEMsV0FBd0IsRUFDeEIsa0JBQXNDLEVBQ3RDLE9BQWU7UUFFaEMsS0FBSyxFQUFFLENBQUM7UUFMUyx3QkFBbUIsR0FBbkIsbUJBQW1CLENBQXFCO1FBQ3hDLGdCQUFXLEdBQVgsV0FBVyxDQUFhO1FBQ3hCLHVCQUFrQixHQUFsQixrQkFBa0IsQ0FBb0I7UUFDdEMsWUFBTyxHQUFQLE9BQU8sQ0FBUTtJQUdwQyxDQUFDO0lBRUQsa0JBQWtCO0lBQ2xCLFNBQVMsQ0FBQyxNQUFnQjtRQUN0QixPQUFPLElBQUksdUJBQVUsQ0FDakIsSUFBSSxDQUFDLG1CQUFtQixFQUN4QixJQUFJLENBQUMsV0FBVyxFQUNoQixJQUFJLENBQUMsa0JBQWtCLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxFQUN6QyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDdEIsQ0FBQztDQUNKO0FBekJELDhDQXlCQyJ9