@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.
@@ -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 = "5378f467085983961242b86ab1ac550e56c1ab19";
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 calling ${(_error$config = error.config) === null || _error$config === void 0 ? void 0 : _error$config.url} from the SDK`, {
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
- errorDetails: {
303
- url: (_error$config2 = error.config) === null || _error$config2 === void 0 ? void 0 : _error$config2.url,
304
- method: (_error$config3 = error.config) === null || _error$config3 === void 0 ? void 0 : _error$config3.method,
305
- status: (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.status,
306
- statusText: (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : _error$response4.statusText,
307
- data,
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
- errorObject: error
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/basis-theory-js",
3
- "version": "4.22.0",
3
+ "version": "4.22.1",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {