@eyepop.ai/eyepop 1.9.0 → 1.9.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/dist/eyepop.index.js +10 -8
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +10 -8
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/package.json +1 -1
package/dist/eyepop.index.js
CHANGED
|
@@ -11218,17 +11218,19 @@ var DataEndpoint = class extends Endpoint {
|
|
|
11218
11218
|
if (response.status === 204) {
|
|
11219
11219
|
return null;
|
|
11220
11220
|
}
|
|
11221
|
+
const contentType = response.headers.get("Content-Type");
|
|
11222
|
+
this._requestLogger.debug("Response - " + response.status + " " + response.statusText);
|
|
11221
11223
|
if (!response.ok) {
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
+
if (contentType && (contentType.toLowerCase().startsWith("application/json") || contentType.toLowerCase().startsWith("text/"))) {
|
|
11225
|
+
throw new Error(`Request failed with ${response.status} ${response.statusText}: ${await response.text()}`);
|
|
11226
|
+
} else {
|
|
11227
|
+
throw new Error(`Request failed with ${response.status} ${response.statusText}`);
|
|
11228
|
+
}
|
|
11224
11229
|
}
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
const blob = await response.blob();
|
|
11228
|
-
return blob;
|
|
11230
|
+
if (contentType && contentType.toLowerCase().startsWith("application/json")) {
|
|
11231
|
+
return await response.json();
|
|
11229
11232
|
}
|
|
11230
|
-
|
|
11231
|
-
return response.json();
|
|
11233
|
+
return await response.blob();
|
|
11232
11234
|
}
|
|
11233
11235
|
async listDatasets(include_stats = true, modifiable_version_only) {
|
|
11234
11236
|
const modifiableVersionQuery = typeof modifiable_version_only !== "undefined" ? `&modifiable_version_only=${modifiable_version_only}` : "";
|