@serialized/serialized-client
Advanced tools
Comparing version 3.12.1 to 3.12.2
@@ -36,8 +36,11 @@ "use strict"; | ||
BaseClient.prototype.axiosConfig = function (tenantId) { | ||
var additionalHeaders = {}; | ||
if (tenantId) { | ||
Object.assign(additionalHeaders, { 'Serialized-Tenant-Id': tenantId }); | ||
} | ||
return { | ||
headers: { | ||
headers: Object.assign({ | ||
'Serialized-Access-Key': this.config.accessKey, | ||
'Serialized-Secret-Access-Key': this.config.secretAccessKey, | ||
'Serialized-Tenant-Id': tenantId | ||
} | ||
'Serialized-Secret-Access-Key': this.config.secretAccessKey | ||
}, additionalHeaders) | ||
}; | ||
@@ -44,0 +47,0 @@ }; |
@@ -12,2 +12,6 @@ import { BaseClient } from "./"; | ||
} | ||
export interface GetSingleProjectionOptions { | ||
tenantId?: string; | ||
awaitCreation?: number; | ||
} | ||
export interface GetSingleProjectionResponse { | ||
@@ -84,3 +88,2 @@ projectionId: string; | ||
projectionId: string; | ||
awaitCreation?: number; | ||
} | ||
@@ -103,3 +106,3 @@ export interface ListSingleProjectionRequest { | ||
getProjectionDefinition(request: GetProjectionDefinitionRequest): Promise<LoadProjectionDefinitionResponse>; | ||
getSingleProjection(request: GetSingleProjectionRequest): Promise<GetSingleProjectionResponse>; | ||
getSingleProjection(request: GetSingleProjectionRequest, options?: GetSingleProjectionOptions): Promise<GetSingleProjectionResponse>; | ||
getAggregatedProjection(request: GetAggregatedProjectionRequest): Promise<GetAggregatedProjectionResponse>; | ||
@@ -106,0 +109,0 @@ deleteProjections(request: DeleteProjectionsRequest, options?: DeleteProjectionOptions): Promise<void>; |
@@ -93,5 +93,5 @@ "use strict"; | ||
}; | ||
ProjectionsClient.prototype.getSingleProjection = function (request) { | ||
ProjectionsClient.prototype.getSingleProjection = function (request, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var config; | ||
var config, params; | ||
return __generator(this, function (_a) { | ||
@@ -101,5 +101,12 @@ switch (_a.label) { | ||
config = this.axiosConfig(); | ||
config.params = { | ||
awaitCreation: request.awaitCreation, | ||
}; | ||
params = new URLSearchParams(); | ||
if (options) { | ||
if (options.tenantId !== undefined) { | ||
config = this.axiosConfig(options.tenantId); | ||
} | ||
if (options.awaitCreation !== undefined) { | ||
params.set('awaitCreation', String(options.awaitCreation)); | ||
} | ||
} | ||
config.params = params; | ||
return [4 /*yield*/, this.axiosClient.get(ProjectionsClient.singleProjectionUrl(request.projectionName, request.projectionId), config)]; | ||
@@ -106,0 +113,0 @@ case 1: return [2 /*return*/, (_a.sent()).data]; |
@@ -6,3 +6,3 @@ { | ||
"author": "Mattias Holmqvist", | ||
"version": "3.12.1", | ||
"version": "3.12.2", | ||
"main": "dist/index.js", | ||
@@ -9,0 +9,0 @@ "types": "dist/index.d.ts", |
78836
1609