@riocrypto/common-server 1.0.2021 → 1.0.2023
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.
|
@@ -66,12 +66,17 @@ function buildAxiosWithLogging() {
|
|
|
66
66
|
}
|
|
67
67
|
return response;
|
|
68
68
|
}, (error) => {
|
|
69
|
+
var _a, _b;
|
|
69
70
|
// Combine and log the response error details without headers
|
|
70
71
|
let logMessage = `Response Error: url=${error.config ? error.config.url : "unknown"}, message=${error.message}`;
|
|
71
72
|
if (error.response) {
|
|
72
73
|
logMessage += `, status=${error.response.status}, data=${JSON.stringify(error.response.data)}`;
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
+
((_a = logger_1.default.getLogger()) === null || _a === void 0 ? void 0 : _a.info(logMessage)) || console.log(logMessage);
|
|
76
|
+
return Promise.reject({
|
|
77
|
+
message: logMessage,
|
|
78
|
+
status: (_b = error.response) === null || _b === void 0 ? void 0 : _b.status,
|
|
79
|
+
});
|
|
75
80
|
});
|
|
76
81
|
return axiosWithLogging;
|
|
77
82
|
}
|
|
@@ -8,13 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.buildBridgeClient = void 0;
|
|
16
13
|
const secret_manager_client_1 = require("./secret-manager-client");
|
|
17
|
-
const axios_1 = __importDefault(require("axios"));
|
|
18
14
|
const axios_with_logging_1 = require("./axios-with-logging");
|
|
19
15
|
const common_1 = require("@riocrypto/common");
|
|
20
16
|
const uuid_1 = require("uuid");
|
|
@@ -93,7 +89,7 @@ class BridgeClient {
|
|
|
93
89
|
}
|
|
94
90
|
getTransfer(id) {
|
|
95
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
const { data } = yield
|
|
92
|
+
const { data } = yield this.axiosClient.get(`${this.baseUrl}/v0/transfers/${id}`, {
|
|
97
93
|
headers: {
|
|
98
94
|
"Api-Key": this.apiKey,
|
|
99
95
|
},
|