abbot-http-client 0.0.44 → 0.0.45

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/dist/index.cjs CHANGED
@@ -286,12 +286,13 @@ var AbbotHttp = class extends Axios {
286
286
  (error) => Promise.reject(error)
287
287
  );
288
288
  axios2.interceptors.response.use(
289
- (response) => {
289
+ async (response) => {
290
290
  const res = { ...response };
291
291
  if (option?.isDownload) {
292
292
  const contentTypes = ["application/json", "text/plain"];
293
293
  if (contentTypes.includes(response.headers["content-type"])) {
294
- res.data = cryp.decrypt(response.data);
294
+ const result = response.data instanceof Blob ? await response.data.text() : response.data;
295
+ res.data = cryp.decrypt(result);
295
296
  }
296
297
  return res;
297
298
  }
package/dist/index.js CHANGED
@@ -247,12 +247,13 @@ var AbbotHttp = class extends Axios {
247
247
  (error) => Promise.reject(error)
248
248
  );
249
249
  axios2.interceptors.response.use(
250
- (response) => {
250
+ async (response) => {
251
251
  const res = { ...response };
252
252
  if (option?.isDownload) {
253
253
  const contentTypes = ["application/json", "text/plain"];
254
254
  if (contentTypes.includes(response.headers["content-type"])) {
255
- res.data = cryp.decrypt(response.data);
255
+ const result = response.data instanceof Blob ? await response.data.text() : response.data;
256
+ res.data = cryp.decrypt(result);
256
257
  }
257
258
  return res;
258
259
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abbot-http-client",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "description": "This package helps Abbot team to handle all the axios requests.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",