@proveanything/smartlinks 1.14.13 → 1.14.14
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/asset.js +3 -1
- package/dist/docs/API_SUMMARY.md +1 -1
- package/dist/http.js +1 -1
- package/dist/iframeResponder.js +1 -1
- package/docs/API_SUMMARY.md +1 -1
- package/package.json +1 -1
package/dist/api/asset.js
CHANGED
|
@@ -10,6 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { request, post, put, del, getApiHeaders, getBaseURL, isProxyEnabled, proxyUploadFormData } from "../http";
|
|
13
|
+
import { SmartlinksApiError } from "../types/error";
|
|
13
14
|
export var asset;
|
|
14
15
|
(function (asset) {
|
|
15
16
|
function resolveApiUrl(path) {
|
|
@@ -175,7 +176,8 @@ export var asset;
|
|
|
175
176
|
}
|
|
176
177
|
catch (e) {
|
|
177
178
|
const msg = (e === null || e === void 0 ? void 0 : e.message) || 'URL upload failed';
|
|
178
|
-
|
|
179
|
+
const details = e instanceof SmartlinksApiError ? e.errorResponse : undefined;
|
|
180
|
+
throw new AssetUploadError(msg, 'UNKNOWN', details);
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
183
|
asset.uploadFromUrl = uploadFromUrl;
|
package/dist/docs/API_SUMMARY.md
CHANGED
package/dist/http.js
CHANGED
|
@@ -757,7 +757,7 @@ function ensureProxyListener() {
|
|
|
757
757
|
const errorBody = (_d = (_c = msg.errorBody) !== null && _c !== void 0 ? _c : errObj) !== null && _d !== void 0 ? _d : msg.error;
|
|
758
758
|
if (statusCode) {
|
|
759
759
|
const errBody = normalizeErrorResponse(errorBody, statusCode);
|
|
760
|
-
pending.reject(new SmartlinksApiError(message, statusCode, errBody));
|
|
760
|
+
pending.reject(new SmartlinksApiError(errBody.message, statusCode, errBody));
|
|
761
761
|
}
|
|
762
762
|
else {
|
|
763
763
|
pending.reject(new Error(message));
|
package/dist/iframeResponder.js
CHANGED
|
@@ -431,7 +431,7 @@ export class IframeResponder {
|
|
|
431
431
|
const fetchResponse = await fetch(fullUrl, fetchOptions);
|
|
432
432
|
const responseData = await fetchResponse.json().catch(() => null);
|
|
433
433
|
if (!fetchResponse.ok) {
|
|
434
|
-
response.error = (responseData === null || responseData === void 0 ? void 0 : responseData.message) || `Request failed with status ${fetchResponse.status}`;
|
|
434
|
+
response.error = (responseData === null || responseData === void 0 ? void 0 : responseData.message) || (responseData === null || responseData === void 0 ? void 0 : responseData.errorText) || `Request failed with status ${fetchResponse.status}`;
|
|
435
435
|
response.statusCode = fetchResponse.status;
|
|
436
436
|
response.errorBody = responseData;
|
|
437
437
|
}
|
package/docs/API_SUMMARY.md
CHANGED