backk-frontend-utils
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -14,3 +14,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
export default function callRemoteService(microserviceName, serviceFunctionName, serviceFunctionArgument, microserviceNamespace, jwtStorageEncryptionKey, options) { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -21,9 +21,11 @@ const serverPort = window.location.search | ||
const scheme = serverPort === HTTPS_DEFAULT_PORT ? 'https' : 'http'; | ||
const body = serviceFunctionArgument ? JSON.stringify(serviceFunctionArgument) : undefined; | ||
try { | ||
const response = yield fetch(`${scheme}://${window.location.hostname}:${serverPort}/${microserviceName}.${microserviceNamespace}/${serviceFunctionName}`, { | ||
body, | ||
method: (_b = options === null || options === void 0 ? void 0 : options.httpMethod) !== null && _b !== void 0 ? _b : 'POST', | ||
body: serviceFunctionArgument ? JSON.stringify(serviceFunctionArgument) : undefined, | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: 'Bearer ' + Base64.encode((_c = getJwtFromSessionStorage(jwtStorageEncryptionKey)) !== null && _c !== void 0 ? _c : ''), | ||
'Content-Length': (_c = body === null || body === void 0 ? void 0 : body.length.toString()) !== null && _c !== void 0 ? _c : '0', | ||
Authorization: 'Bearer ' + Base64.encode((_d = getJwtFromSessionStorage(jwtStorageEncryptionKey)) !== null && _d !== void 0 ? _d : ''), | ||
}, | ||
@@ -30,0 +32,0 @@ }); |
{ | ||
"name": "backk-frontend-utils", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "Web frontend utils for Backk microservices", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
41044
296