ismx-nexo-node-app 0.4.176 → 0.4.177
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.
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const Repository_1 = __importDefault(require("./Repository"));
|
|
16
16
|
const QueryUtils_1 = __importDefault(require("./utils/QueryUtils"));
|
|
17
17
|
const DateUtils_1 = __importDefault(require("../business/utils/DateUtils"));
|
|
18
|
-
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
19
18
|
class RepositoryRest extends Repository_1.default {
|
|
20
19
|
constructor(baseUrl, options = {}) {
|
|
21
20
|
super();
|
|
@@ -46,7 +45,7 @@ class RepositoryRest extends Repository_1.default {
|
|
|
46
45
|
for (const [header, value] of Object.entries((_e = request.headers) !== null && _e !== void 0 ? _e : {}))
|
|
47
46
|
headers.set(header, (_g = (_f = request.headers) === null || _f === void 0 ? void 0 : _f[header]) !== null && _g !== void 0 ? _g : "");
|
|
48
47
|
// Realiza la llamada a la API con las cabeceras y la URL base de la llamada.
|
|
49
|
-
const _fetch = (_h = this.options.fetch) !== null && _h !== void 0 ? _h :
|
|
48
|
+
const _fetch = (_h = this.options.fetch) !== null && _h !== void 0 ? _h : fetch;
|
|
50
49
|
let call = _fetch(request.url + QueryUtils_1.default.map(request.query), Object.assign(Object.assign({}, request), { body: method !== "GET" ? body : undefined, headers: headers }));
|
|
51
50
|
// Añade información adicional a la respuesta y devuelve el resultado (o el error en su caso).
|
|
52
51
|
// @ts-ignore
|
package/package.json
CHANGED
|
@@ -2,7 +2,6 @@ import Repository from "./Repository";
|
|
|
2
2
|
import {HttpRequest, HttpResponse} from "../api/Service";
|
|
3
3
|
import QueryUtils from "./utils/QueryUtils";
|
|
4
4
|
import DateUtils from "../business/utils/DateUtils";
|
|
5
|
-
import fetch from "node-fetch";
|
|
6
5
|
|
|
7
6
|
export interface RestOptions {
|
|
8
7
|
interceptor?: (endpoint: string, request: HttpRequest) => HttpRequest | undefined
|