@hapl/api-queries 1.0.19 → 1.0.20
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/api-queries.cjs.development.js +19 -2
- package/dist/api-queries.cjs.development.js.map +1 -1
- package/dist/api-queries.cjs.production.min.js +1 -1
- package/dist/api-queries.cjs.production.min.js.map +1 -1
- package/dist/api-queries.esm.js +19 -2
- package/dist/api-queries.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/clients/v1/api/file/uploadFile.ts +10 -2
- package/src/clients/v1/api/file/uploadFiles.ts +10 -2
package/dist/api-queries.esm.js
CHANGED
|
@@ -2,6 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
import qs from 'qs';
|
|
3
3
|
import { nanoid } from 'nanoid/non-secure';
|
|
4
4
|
import isNil from 'lodash-es/isNil';
|
|
5
|
+
import isString from 'lodash-es/isString';
|
|
5
6
|
import chunk from 'lodash-es/chunk';
|
|
6
7
|
|
|
7
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -4094,7 +4095,15 @@ function uploadFileRequest(_ref) {
|
|
|
4094
4095
|
}, headers),
|
|
4095
4096
|
onUploadProgress: onUploadProgress,
|
|
4096
4097
|
transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
|
|
4097
|
-
if (
|
|
4098
|
+
if (isString(data)) {
|
|
4099
|
+
var match = data.match(/<title>(.*?)<\/title>/i);
|
|
4100
|
+
return match ? match[1] : data;
|
|
4101
|
+
}
|
|
4102
|
+
|
|
4103
|
+
if (!data.success) {
|
|
4104
|
+
return data.data.error || data.data.message;
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4098
4107
|
return data.data[0];
|
|
4099
4108
|
}])
|
|
4100
4109
|
}).then(function (res) {
|
|
@@ -4127,7 +4136,15 @@ function uploadFilesRequest(_ref) {
|
|
|
4127
4136
|
'Content-Type': 'multipart/form-data'
|
|
4128
4137
|
}, headers),
|
|
4129
4138
|
transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
|
|
4130
|
-
if (
|
|
4139
|
+
if (isString(data)) {
|
|
4140
|
+
var match = data.match(/<title>(.*?)<\/title>/i);
|
|
4141
|
+
return match ? match[1] : data;
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
if (!data.success) {
|
|
4145
|
+
return data.data.error || data.data.message;
|
|
4146
|
+
}
|
|
4147
|
+
|
|
4131
4148
|
var ids = [];
|
|
4132
4149
|
var byId = {};
|
|
4133
4150
|
data.data.forEach(function (entity) {
|