@serialized/serialized-client
Advanced tools
Comparing version 4.8.1 to 4.9.0
@@ -20,2 +20,5 @@ import { BaseClient, DomainEvent } from './'; | ||
} | ||
export interface CheckAggregateExistsOptions { | ||
tenantId?: string; | ||
} | ||
export interface LoadAggregateOptions { | ||
@@ -66,3 +69,3 @@ tenantId?: string; | ||
constructor(aggregateTypeConstructor: any, serializedConfig: any, aggregateClientConfig?: AggregatesClientConfig); | ||
checkExists(request: CheckAggregateExistsRequest): Promise<boolean>; | ||
checkExists(request: CheckAggregateExistsRequest, options?: CheckAggregateExistsOptions): Promise<boolean>; | ||
update(aggregateId: string, commandHandler: (s: A) => DomainEvent<any>[], options?: UpdateAggregateOptions): Promise<number>; | ||
@@ -69,0 +72,0 @@ bulkUpdate(aggregateIds: string[], commandHandler: (s: A) => DomainEvent<any>[], tenantId?: string): Promise<number>; |
@@ -73,3 +73,3 @@ "use strict"; | ||
} | ||
AggregatesClient.prototype.checkExists = function (request) { | ||
AggregatesClient.prototype.checkExists = function (request, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -84,3 +84,3 @@ var url, error_2; | ||
_a.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, this.axiosClient.head(url, this.axiosConfig())]; | ||
return [4 /*yield*/, this.axiosClient.head(url, this.axiosConfig(options === null || options === void 0 ? void 0 : options.tenantId))]; | ||
case 2: | ||
@@ -87,0 +87,0 @@ _a.sent(); |
@@ -9,6 +9,12 @@ import { BaseClient } from "./"; | ||
} | ||
export interface AddTenantRequest { | ||
tenantId: string; | ||
reference: string; | ||
} | ||
export declare class TenantClient extends BaseClient { | ||
addTenant(request: AddTenantRequest): Promise<void>; | ||
updateTenant(request: UpdateTenantRequest): Promise<void>; | ||
deleteTenant(request: DeleteTenantRequest): Promise<void>; | ||
static tenantUrl(tenantId: string): string; | ||
static tenantRootUrl(): string; | ||
} |
@@ -61,2 +61,14 @@ "use strict"; | ||
} | ||
TenantClient.prototype.addTenant = function (request) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.axiosClient.post(TenantClient.tenantRootUrl(), request)]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
TenantClient.prototype.updateTenant = function (request) { | ||
@@ -91,4 +103,7 @@ return __awaiter(this, void 0, void 0, function () { | ||
}; | ||
TenantClient.tenantRootUrl = function () { | ||
return "/tenants"; | ||
}; | ||
return TenantClient; | ||
}(_1.BaseClient)); | ||
exports.TenantClient = TenantClient; |
@@ -6,3 +6,3 @@ { | ||
"author": "Mattias Holmqvist", | ||
"version": "4.8.1", | ||
"version": "4.9.0", | ||
"main": "dist/index.js", | ||
@@ -9,0 +9,0 @@ "types": "dist/index.d.ts", |
123336
2597