ismx-nexo-node-app 0.4.53 → 0.4.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -46,7 +46,7 @@ class BusinessProxy {
|
|
|
46
46
|
}
|
|
47
47
|
call(tag, method, endpoint, request) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
var _a, _b
|
|
49
|
+
var _a, _b;
|
|
50
50
|
let module = this.modules[tag];
|
|
51
51
|
if (!module)
|
|
52
52
|
throw new Error(`Module ${tag} does not exist`);
|
|
@@ -57,7 +57,7 @@ class BusinessProxy {
|
|
|
57
57
|
for (const header of Object.keys(headers))
|
|
58
58
|
headers.set(header, (_b = (_a = request.headers) === null || _a === void 0 ? void 0 : _a[header]) !== null && _b !== void 0 ? _b : "");
|
|
59
59
|
// Si el body especificado es un objeto, lo convierte a JSON.
|
|
60
|
-
let body =
|
|
60
|
+
let body = request.body;
|
|
61
61
|
if (request.body && typeof request.body !== 'string' && !Buffer.isBuffer(request.body)) {
|
|
62
62
|
headers.set('Content-Type', 'application/json');
|
|
63
63
|
body = JSON.stringify(request.body);
|
|
@@ -24,7 +24,7 @@ class RepositoryRest extends Repository_1.default {
|
|
|
24
24
|
}
|
|
25
25
|
call() {
|
|
26
26
|
return __awaiter(this, arguments, void 0, function* (method = 'GET', endpoint = '/', request = {}) {
|
|
27
|
-
var _a, _b, _c, _d, _e
|
|
27
|
+
var _a, _b, _c, _d, _e;
|
|
28
28
|
// Especifica el método de la llamada HTTP al recurso.
|
|
29
29
|
request.method = method;
|
|
30
30
|
request.endpoint = endpoint;
|
|
@@ -37,8 +37,8 @@ class RepositoryRest extends Repository_1.default {
|
|
|
37
37
|
for (const header of Object.keys(headers))
|
|
38
38
|
headers.set(header, (_e = (_d = request.headers) === null || _d === void 0 ? void 0 : _d[header]) !== null && _e !== void 0 ? _e : "");
|
|
39
39
|
// Si el body especificado es un objeto, lo convierte a JSON.
|
|
40
|
-
let body =
|
|
41
|
-
if (request.body && typeof request.body !== 'string') {
|
|
40
|
+
let body = request.body;
|
|
41
|
+
if (request.body && typeof request.body !== 'string' && !Buffer.isBuffer(request.body)) {
|
|
42
42
|
headers.set('Content-Type', 'application/json');
|
|
43
43
|
body = JSON.stringify(request.body);
|
|
44
44
|
}
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@ export default class BusinessProxy
|
|
|
29
29
|
headers.set(header, request.headers?.[header] ?? "");
|
|
30
30
|
|
|
31
31
|
// Si el body especificado es un objeto, lo convierte a JSON.
|
|
32
|
-
let body: string | undefined = request.body
|
|
32
|
+
let body: string | undefined = request.body as string;
|
|
33
33
|
if (request.body && typeof request.body !== 'string' && !Buffer.isBuffer(request.body)) {
|
|
34
34
|
headers.set('Content-Type', 'application/json');
|
|
35
35
|
body = JSON.stringify(request.body);
|
|
@@ -46,8 +46,8 @@ export default class RepositoryRest<Body=any,Res=any> extends Repository
|
|
|
46
46
|
headers.set(header, request.headers?.[header] ?? "");
|
|
47
47
|
|
|
48
48
|
// Si el body especificado es un objeto, lo convierte a JSON.
|
|
49
|
-
let body: string | undefined = request.body
|
|
50
|
-
if (request.body && typeof request.body !== 'string') {
|
|
49
|
+
let body: string | undefined = request.body as string;
|
|
50
|
+
if (request.body && typeof request.body !== 'string' && !Buffer.isBuffer(request.body)) {
|
|
51
51
|
headers.set('Content-Type', 'application/json');
|
|
52
52
|
body = JSON.stringify(request.body);
|
|
53
53
|
}
|