mitra-interactions-sdk 1.0.60-beta.40 → 1.0.60-beta.41
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.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ function autoConfigureFromLogin(response, authUrl, projectId) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
async function postBffAuth(url, body) {
|
|
37
|
+
var _a, _b, _c, _d;
|
|
37
38
|
const fetchFn = getFetch();
|
|
38
39
|
const response = await fetchFn(url, {
|
|
39
40
|
method: "POST",
|
|
@@ -44,8 +45,9 @@ async function postBffAuth(url, body) {
|
|
|
44
45
|
const { data, isJson } = parseBody(text);
|
|
45
46
|
if (!response.ok) {
|
|
46
47
|
const fallback = !isJson && text ? `HTTP ${response.status} \u2014 ${text}` : `HTTP ${response.status}`;
|
|
47
|
-
const msg = isJson && ((data == null ? void 0 : data.message) || (data == null ? void 0 : data.error)) || fallback;
|
|
48
|
-
|
|
48
|
+
const msg = isJson && ((data == null ? void 0 : data.message) || ((_a = data == null ? void 0 : data.error) == null ? void 0 : _a.message) || (data == null ? void 0 : data.error)) || fallback;
|
|
49
|
+
const code = isJson && ((_d = (_c = data == null ? void 0 : data.error_code) != null ? _c : (_b = data == null ? void 0 : data.error) == null ? void 0 : _b.code) != null ? _d : data == null ? void 0 : data.code) || void 0;
|
|
50
|
+
throw { message: typeof msg === "string" ? msg : fallback, status: response.status, ...code ? { code } : {}, details: data };
|
|
49
51
|
}
|
|
50
52
|
return data;
|
|
51
53
|
}
|