@useinsider/guido 3.1.1-beta.5ad1748 → 3.1.1-beta.601f405
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.
|
@@ -1,40 +1,27 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
return {
|
|
1
|
+
import { useHttp as o } from "../composables/useHttp.js";
|
|
2
|
+
const i = () => {
|
|
3
|
+
const { get: t } = o();
|
|
4
|
+
return console.error("[Guido] VITE_RECOMMENDATION_CLIENT_ID is not set. Recommendation API requests will fail."), {
|
|
6
5
|
fetchRecommendationCreateData: async () => {
|
|
7
6
|
try {
|
|
8
|
-
return (await
|
|
7
|
+
return (await t("/newsletter/recommendations/create-data")).data;
|
|
9
8
|
} catch (e) {
|
|
10
9
|
throw console.error("fetchUserModalState error:", e), e;
|
|
11
10
|
}
|
|
12
11
|
},
|
|
13
12
|
fetchRecommendationFilters: async () => {
|
|
14
13
|
try {
|
|
15
|
-
const { data: e } = await
|
|
14
|
+
const { data: e } = await t("/stripo/email-recommendation-attributes");
|
|
16
15
|
return e;
|
|
17
16
|
} catch (e) {
|
|
18
17
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
19
18
|
}
|
|
20
19
|
},
|
|
21
|
-
fetchRecommendationProducts: async (e,
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
const t = decodeURIComponent(new URLSearchParams(Object.entries(a)).toString());
|
|
25
|
-
console.debug("🏁 Recommendation API Query:", t);
|
|
26
|
-
const { get: s } = c({
|
|
27
|
-
headers: {}
|
|
28
|
-
}), r = await s(
|
|
29
|
-
`${m.RECOMMENDATION_API_URL}/v2/${e}?${t}`
|
|
30
|
-
);
|
|
31
|
-
return ((n = r == null ? void 0 : r.data) == null ? void 0 : n.data) ?? [];
|
|
32
|
-
} catch (t) {
|
|
33
|
-
throw console.error("fetchRecommendationProducts error:", t), t;
|
|
34
|
-
}
|
|
20
|
+
fetchRecommendationProducts: async (e, c) => {
|
|
21
|
+
throw new Error("[Guido] VITE_RECOMMENDATION_CLIENT_ID is not set. Cannot fetch recommendations.");
|
|
35
22
|
}
|
|
36
23
|
};
|
|
37
24
|
};
|
|
38
25
|
export {
|
|
39
|
-
|
|
26
|
+
i as useRecommendationApi
|
|
40
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.1.1-beta.
|
|
3
|
+
"version": "3.1.1-beta.601f405",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|