@useinsider/guido 3.1.1-beta.5fce9b2 → 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,42 +1,27 @@
1
- import { useHttp as c } from "../composables/useHttp.js";
2
- import { URLS as i } from "../enums/extensions/recommendationBlock.js";
3
- const f = () => {
4
- const { get: r } = c(), a = void 0;
5
- return console.error("[Guido] VITE_INS_RECOMMENDATION_CLIENT_ID is not set. Recommendation API requests will fail."), {
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 r("/newsletter/recommendations/create-data")).data;
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 r("/stripo/email-recommendation-attributes");
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, s) => {
22
- var n;
23
- try {
24
- const t = decodeURIComponent(new URLSearchParams(Object.entries(s)).toString());
25
- console.debug("🏁 Recommendation API Query:", t);
26
- const { get: m } = c({
27
- headers: {
28
- "X-CLIENT-ID": a
29
- }
30
- }), o = await m(
31
- `${i.RECOMMENDATION_API_URL}/v2/${e}?${t}`
32
- );
33
- return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
34
- } catch (t) {
35
- throw console.error("fetchRecommendationProducts error:", t), t;
36
- }
20
+ fetchRecommendationProducts: async (e, c) => {
21
+ throw new Error("[Guido] VITE_RECOMMENDATION_CLIENT_ID is not set. Cannot fetch recommendations.");
37
22
  }
38
23
  };
39
24
  };
40
25
  export {
41
- f as useRecommendationApi
26
+ i as useRecommendationApi
42
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.1.1-beta.5fce9b2",
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",