@useinsider/guido 3.1.1-beta.5ad1748 → 3.1.1-beta.5fce9b2

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,34 +1,36 @@
1
1
  import { useHttp as c } from "../composables/useHttp.js";
2
- import { URLS as m } from "../enums/extensions/recommendationBlock.js";
2
+ import { URLS as i } from "../enums/extensions/recommendationBlock.js";
3
3
  const f = () => {
4
- const { get: o } = c();
5
- return {
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."), {
6
6
  fetchRecommendationCreateData: async () => {
7
7
  try {
8
- return (await o("/newsletter/recommendations/create-data")).data;
8
+ return (await r("/newsletter/recommendations/create-data")).data;
9
9
  } catch (e) {
10
10
  throw console.error("fetchUserModalState error:", e), e;
11
11
  }
12
12
  },
13
13
  fetchRecommendationFilters: async () => {
14
14
  try {
15
- const { data: e } = await o("/stripo/email-recommendation-attributes");
15
+ const { data: e } = await r("/stripo/email-recommendation-attributes");
16
16
  return e;
17
17
  } catch (e) {
18
18
  throw console.error("fetchRecommendationFilters error:", e), e;
19
19
  }
20
20
  },
21
- fetchRecommendationProducts: async (e, a) => {
21
+ fetchRecommendationProducts: async (e, s) => {
22
22
  var n;
23
23
  try {
24
- const t = decodeURIComponent(new URLSearchParams(Object.entries(a)).toString());
24
+ const t = decodeURIComponent(new URLSearchParams(Object.entries(s)).toString());
25
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}`
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}`
30
32
  );
31
- return ((n = r == null ? void 0 : r.data) == null ? void 0 : n.data) ?? [];
33
+ return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
32
34
  } catch (t) {
33
35
  throw console.error("fetchRecommendationProducts error:", t), t;
34
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.1.1-beta.5ad1748",
3
+ "version": "3.1.1-beta.5fce9b2",
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",