@serialized/serialized-client
Advanced tools
Comparing version 4.12.0 to 5.0.0
@@ -61,3 +61,3 @@ import { BaseClient, DomainEvent } from './'; | ||
} | ||
declare class AggregatesClient<A> extends BaseClient { | ||
declare class AggregatesClient extends BaseClient { | ||
private aggregateTypeConstructor; | ||
@@ -72,6 +72,6 @@ private readonly aggregateType; | ||
saveBulk(request: AggregateBulkRequest): Promise<number>; | ||
update(aggregateId: string, commandHandler: (s: A) => DomainEvent<any>[], options?: UpdateAggregateOptions): Promise<number>; | ||
bulkUpdate(aggregateIds: string[], commandHandler: (s: A) => DomainEvent<any>[], tenantId?: string): Promise<number>; | ||
update(aggregateId: string, commandHandler: (s: any) => DomainEvent<any>[], options?: UpdateAggregateOptions): Promise<number>; | ||
bulkUpdate(aggregateIds: string[], commandHandler: (s: any) => DomainEvent<any>[], tenantId?: string): Promise<number>; | ||
bulkSave(batches: EventBatch[], tenantId?: string): Promise<number>; | ||
create(aggregateId: string, commandHandler: (s: A) => DomainEvent<any>[], options?: CreateAggregateOptions): Promise<number>; | ||
create(aggregateId: string, commandHandler: (s: any) => DomainEvent<any>[], options?: CreateAggregateOptions): Promise<number>; | ||
private loadInternal; | ||
@@ -78,0 +78,0 @@ deleteAggregate(request: DeleteAggregateRequest, options?: DeleteAggregateOptions): Promise<DeleteAggregateResponse | void>; |
@@ -360,3 +360,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var config, url; | ||
var config, url, eventCounts; | ||
return __generator(this, function (_a) { | ||
@@ -373,3 +373,4 @@ switch (_a.label) { | ||
_a.sent(); | ||
return [2 /*return*/, batches.flatMap(function (b) { return b.events; }).length]; | ||
eventCounts = batches.map(function (b) { return b.events.length; }); | ||
return [2 /*return*/, eventCounts.reduce(function (sum, current) { return (sum + current); }, 0)]; | ||
} | ||
@@ -376,0 +377,0 @@ }); |
@@ -14,3 +14,3 @@ import { AggregatesClient, AggregatesClientConfig, FeedsClient, ProjectionsClient, ReactionsClient, SerializedConfig, TenantClient } from "./"; | ||
validateConfiguration(): void; | ||
aggregateClient<A>(type: any, aggregateClientConfig?: AggregatesClientConfig): AggregatesClient<A>; | ||
aggregateClient(aggregateType: any, aggregateClientConfig?: AggregatesClientConfig): AggregatesClient; | ||
projectionsClient(): ProjectionsClient; | ||
@@ -17,0 +17,0 @@ feedsClient(): FeedsClient; |
@@ -35,4 +35,4 @@ "use strict"; | ||
}; | ||
SerializedInstance.prototype.aggregateClient = function (type, aggregateClientConfig) { | ||
return new _1.AggregatesClient(type, this.serializedConfig, aggregateClientConfig); | ||
SerializedInstance.prototype.aggregateClient = function (aggregateType, aggregateClientConfig) { | ||
return new _1.AggregatesClient(aggregateType, this.serializedConfig, aggregateClientConfig); | ||
}; | ||
@@ -39,0 +39,0 @@ SerializedInstance.prototype.projectionsClient = function () { |
@@ -6,3 +6,3 @@ { | ||
"author": "Serialized", | ||
"version": "4.12.0", | ||
"version": "5.0.0", | ||
"main": "dist/index.js", | ||
@@ -9,0 +9,0 @@ "types": "dist/index.d.ts", |
119431
2512