@basis-theory/basis-theory-js 1.79.4 → 1.79.6
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/package.json +1 -1
- package/service/BasisTheoryService.js +24 -17
package/package.json
CHANGED
|
@@ -20,23 +20,30 @@ class BasisTheoryService {
|
|
|
20
20
|
transformResponse,
|
|
21
21
|
appInfo
|
|
22
22
|
} = options;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
|
|
24
|
+
if (typeof _axios.default === 'string') {
|
|
25
|
+
// known issue with create react app
|
|
26
|
+
// eslint-disable-next-line unicorn/prefer-type-error
|
|
27
|
+
throw new Error('basis-theory-js@1.77.0+ and basis-theory-react@1.12.1+ are not supported with CRA 5, go to https://github.com/Basis-Theory/basis-theory-js/issues/365#issuecomment-1662883062 for workarounds.');
|
|
28
|
+
} else {
|
|
29
|
+
this.client = _axios.default.create({
|
|
30
|
+
baseURL,
|
|
31
|
+
headers: {
|
|
32
|
+
[_common.API_KEY_HEADER]: apiKey,
|
|
33
|
+
[_common.CLIENT_USER_AGENT_HEADER]: (0, _common.buildClientUserAgentString)(appInfo),
|
|
34
|
+
...(typeof window === 'undefined' && {
|
|
35
|
+
[_common.USER_AGENT_HEADER]: (0, _common.buildUserAgentString)(appInfo)
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/* eslint-disable unicorn/prefer-spread */
|
|
40
|
+
transformRequest: [].concat(transformRequest || _common.transformRequestSnakeCase, _axios.default.defaults.transformRequest),
|
|
41
|
+
transformResponse: _axios.default.defaults.transformResponse.concat(transformResponse || _common.transformResponseCamelCase)
|
|
42
|
+
/* eslint-enable unicorn/prefer-spread */
|
|
43
|
+
|
|
44
|
+
});
|
|
45
|
+
this.client.interceptors.response.use(undefined, _common.errorInterceptor);
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
|
|
42
49
|
}
|