@basis-theory/basis-theory-js 4.22.0 → 4.22.1
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.
- package/common/constants.js +1 -1
- package/common/utils.js +18 -12
- package/package.json +1 -1
package/common/constants.js
CHANGED
|
@@ -28,7 +28,7 @@ const DEFAULT_ELEMENTS_BASE_URL = `https://${"js.basistheory.com/hosted-elements
|
|
|
28
28
|
exports.DEFAULT_ELEMENTS_BASE_URL = DEFAULT_ELEMENTS_BASE_URL;
|
|
29
29
|
const DD_TOKEN = "pub5f53501515584007899577554c4aeda6";
|
|
30
30
|
exports.DD_TOKEN = DD_TOKEN;
|
|
31
|
-
const DD_GIT_SHA = "
|
|
31
|
+
const DD_GIT_SHA = "316bf0c2304e914cd0a3767fdb3fc684c2fe0779";
|
|
32
32
|
exports.DD_GIT_SHA = DD_GIT_SHA;
|
|
33
33
|
const CLIENT_BASE_PATHS = {
|
|
34
34
|
tokens: 'tokens',
|
package/common/utils.js
CHANGED
|
@@ -291,24 +291,30 @@ const createRequestConfig = (options, transformers) => {
|
|
|
291
291
|
exports.createRequestConfig = createRequestConfig;
|
|
292
292
|
|
|
293
293
|
const errorInterceptor = error => {
|
|
294
|
-
var _error$response$statu, _error$response, _error$response2, _error$config, _error$config2, _error$config3, _error$response3, _error$response4, _error$response5;
|
|
294
|
+
var _error$response$statu, _error$response, _error$response2, _error$config, _error$config$method, _error$config2, _error$config3, _error$config4, _error$config4$method, _error$config5, _error$config5$header, _error$response3, _error$response4, _error$response5;
|
|
295
295
|
|
|
296
296
|
const status = (_error$response$statu = (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== null && _error$response$statu !== void 0 ? _error$response$statu : -1;
|
|
297
297
|
const data = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data;
|
|
298
|
-
const logSeverity = status < 499 ? 'warn' : 'error';
|
|
298
|
+
const logSeverity = status > -1 && status < 499 ? 'warn' : 'error';
|
|
299
299
|
|
|
300
|
-
_logging.logger.log[logSeverity](`Error when
|
|
300
|
+
_logging.logger.log[logSeverity](`Error when making ${error === null || error === void 0 ? void 0 : (_error$config = error.config) === null || _error$config === void 0 ? void 0 : (_error$config$method = _error$config.method) === null || _error$config$method === void 0 ? void 0 : _error$config$method.toUpperCase()} request to ${error === null || error === void 0 ? void 0 : (_error$config2 = error.config) === null || _error$config2 === void 0 ? void 0 : _error$config2.baseURL} from the JS SDK`, {
|
|
301
301
|
apiStatus: status,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
headers: (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : _error$response5.headers,
|
|
309
|
-
message: error.message
|
|
302
|
+
logType: 'axiosError',
|
|
303
|
+
logOrigin: 'axiosErrorInterceptor',
|
|
304
|
+
requestDetails: {
|
|
305
|
+
url: error === null || error === void 0 ? void 0 : (_error$config3 = error.config) === null || _error$config3 === void 0 ? void 0 : _error$config3.baseURL,
|
|
306
|
+
method: error === null || error === void 0 ? void 0 : (_error$config4 = error.config) === null || _error$config4 === void 0 ? void 0 : (_error$config4$method = _error$config4.method) === null || _error$config4$method === void 0 ? void 0 : _error$config4$method.toUpperCase(),
|
|
307
|
+
btUserAgent: error === null || error === void 0 ? void 0 : (_error$config5 = error.config) === null || _error$config5 === void 0 ? void 0 : (_error$config5$header = _error$config5.headers) === null || _error$config5$header === void 0 ? void 0 : _error$config5$header[_constants.CLIENT_USER_AGENT_HEADER]
|
|
310
308
|
},
|
|
311
|
-
|
|
309
|
+
errorDetails: {
|
|
310
|
+
code: error === null || error === void 0 ? void 0 : error.code,
|
|
311
|
+
name: error === null || error === void 0 ? void 0 : error.name,
|
|
312
|
+
stack: error === null || error === void 0 ? void 0 : error.stack,
|
|
313
|
+
headers: error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.headers,
|
|
314
|
+
message: error === null || error === void 0 ? void 0 : error.message,
|
|
315
|
+
status: error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : _error$response4.status,
|
|
316
|
+
statusText: error === null || error === void 0 ? void 0 : (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : _error$response5.statusText
|
|
317
|
+
}
|
|
312
318
|
});
|
|
313
319
|
|
|
314
320
|
throw new _BasisTheoryApiError.BasisTheoryApiError(error.message, status, data);
|