@ecency/sdk 1.5.2 → 1.5.4
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/browser/index.js +11 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +11 -2
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +11 -2
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -3317,7 +3317,7 @@ function getStatsQueryOptions({
|
|
|
3317
3317
|
queryKey: ["integrations", "plausible", url, dimensions, metrics],
|
|
3318
3318
|
queryFn: async () => {
|
|
3319
3319
|
const fetchApi = getBoundFetch();
|
|
3320
|
-
const response = await fetchApi(
|
|
3320
|
+
const response = await fetchApi(`${CONFIG.privateApiHost}/api/stats`, {
|
|
3321
3321
|
method: "POST",
|
|
3322
3322
|
body: JSON.stringify({
|
|
3323
3323
|
metrics,
|
|
@@ -4524,7 +4524,16 @@ async function parseJsonResponse3(response) {
|
|
|
4524
4524
|
error.data = errorData;
|
|
4525
4525
|
throw error;
|
|
4526
4526
|
}
|
|
4527
|
-
|
|
4527
|
+
const text = await response.text();
|
|
4528
|
+
if (!text || text.trim() === "") {
|
|
4529
|
+
return "";
|
|
4530
|
+
}
|
|
4531
|
+
try {
|
|
4532
|
+
return JSON.parse(text);
|
|
4533
|
+
} catch (e) {
|
|
4534
|
+
console.warn("[SDK] Failed to parse JSON response:", e, "Response:", text);
|
|
4535
|
+
return "";
|
|
4536
|
+
}
|
|
4528
4537
|
}
|
|
4529
4538
|
async function signUp(username, email, referral) {
|
|
4530
4539
|
const fetchApi = getBoundFetch();
|