flowrix 1.0.1-beta.93 → 1.0.1-beta.95

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.
Files changed (71) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +0 -19
  3. package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +0 -1
  4. package/dist/runtime/middleware/flowrix.js +3 -4
  5. package/dist/runtime/server/api/albums.js +1 -1
  6. package/dist/runtime/server/api/auth/forgot.js +0 -1
  7. package/dist/runtime/server/api/auth/login.js +0 -5
  8. package/dist/runtime/server/api/auth/logout.js +0 -1
  9. package/dist/runtime/server/api/auth/register.js +0 -1
  10. package/dist/runtime/server/api/auth/session.get.js +0 -2
  11. package/dist/runtime/server/api/auth/user/reset-password.js +0 -1
  12. package/dist/runtime/server/api/auth/user/session.js +0 -1
  13. package/dist/runtime/server/api/auth/user/verify-token.js +0 -1
  14. package/dist/runtime/server/api/banners.js +1 -1
  15. package/dist/runtime/server/api/brand/[...slug].js +1 -1
  16. package/dist/runtime/server/api/brand/index.js +1 -1
  17. package/dist/runtime/server/api/cart/related.js +0 -1
  18. package/dist/runtime/server/api/cart/remove.js +0 -1
  19. package/dist/runtime/server/api/catalog/brands.js +1 -1
  20. package/dist/runtime/server/api/catalog/categories.js +1 -1
  21. package/dist/runtime/server/api/catalog/categoriesall.js +1 -1
  22. package/dist/runtime/server/api/catalog/featured.js +1 -1
  23. package/dist/runtime/server/api/catalog/posts.js +1 -1
  24. package/dist/runtime/server/api/catalog/samples.js +1 -1
  25. package/dist/runtime/server/api/catalog/search.js +1 -1
  26. package/dist/runtime/server/api/category/[...slug].js +1 -1
  27. package/dist/runtime/server/api/checkout/quotation/[slug].js +0 -1
  28. package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +0 -2
  29. package/dist/runtime/server/api/checkout/quotation/guest/customer.js +0 -1
  30. package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +0 -1
  31. package/dist/runtime/server/api/cmspost/[...slug].js +1 -1
  32. package/dist/runtime/server/api/cmspost/all.js +1 -1
  33. package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +1 -1
  34. package/dist/runtime/server/api/countries.js +1 -1
  35. package/dist/runtime/server/api/customer/address/add.js +0 -1
  36. package/dist/runtime/server/api/customer/address/delete.js +0 -1
  37. package/dist/runtime/server/api/customer/address/setshipping.js +0 -1
  38. package/dist/runtime/server/api/customer/address/update.js +0 -1
  39. package/dist/runtime/server/api/customer/cards/delete.js +0 -1
  40. package/dist/runtime/server/api/customer/cards/get.js +0 -1
  41. package/dist/runtime/server/api/customer/change-password.js +0 -1
  42. package/dist/runtime/server/api/customer/checkout.js +0 -1
  43. package/dist/runtime/server/api/customer/orders.js +0 -1
  44. package/dist/runtime/server/api/customer/profile/update.js +0 -1
  45. package/dist/runtime/server/api/customer/quotations.js +0 -1
  46. package/dist/runtime/server/api/customer/search.js +0 -1
  47. package/dist/runtime/server/api/customer/tax-invoice.js +0 -1
  48. package/dist/runtime/server/api/customer/wishlist/add.js +0 -1
  49. package/dist/runtime/server/api/customer/wishlist/createWishList.js +0 -1
  50. package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +0 -1
  51. package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +0 -1
  52. package/dist/runtime/server/api/customer/wishlist/get.js +0 -1
  53. package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +0 -1
  54. package/dist/runtime/server/api/customer/wishlist/updateWishList.js +0 -1
  55. package/dist/runtime/server/api/featured.js +1 -1
  56. package/dist/runtime/server/api/generate/robots.get.js +1 -1
  57. package/dist/runtime/server/api/generate/sitemap.get.js +1 -1
  58. package/dist/runtime/server/api/nav/[id]/links.js +1 -1
  59. package/dist/runtime/server/api/page/[...slug].js +1 -1
  60. package/dist/runtime/server/api/product/[...slug].js +1 -1
  61. package/dist/runtime/server/api/samples.js +1 -1
  62. package/dist/runtime/server/api/search.js +1 -1
  63. package/dist/runtime/server/api/service/[slug].js +1 -1
  64. package/dist/runtime/server/api/service/getall.js +1 -1
  65. package/dist/runtime/server/api/shop.js +1 -1
  66. package/dist/runtime/server/api/webform.js +1 -1
  67. package/dist/runtime/stores/wishlists.d.ts +1 -2
  68. package/dist/runtime/stores/wishlists.js +0 -6
  69. package/dist/runtime/utils/api.js +3 -5
  70. package/dist/runtime/utils/htmlCache.js +1 -1
  71. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flowrix",
3
3
  "configKey": "flowrix",
4
- "version": "1.0.1-beta.93",
4
+ "version": "1.0.1-beta.95",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -7,25 +7,6 @@ const module$1 = defineNuxtModule({
7
7
  },
8
8
  defaults: {},
9
9
  async setup(_options, nuxt) {
10
- const env = process.env;
11
- const runtimeConfig = nuxt.options.runtimeConfig;
12
- runtimeConfig.FLOWRIX_API_KEY ||= env.FLOWRIX_API_KEY || "";
13
- runtimeConfig.FLOWRIX_API_SECRET ||= env.FLOWRIX_API_SECRET || "";
14
- runtimeConfig.FLOWRIX_API_ORIGIN ||= env.FLOWRIX_API_ORIGIN || "";
15
- runtimeConfig.FLOWRIX_API_BASE ||= env.FLOWRIX_API_BASE || "";
16
- runtimeConfig.FLOWRIX_API_BASE_V2 ||= env.FLOWRIX_API_BASE_V2 || "";
17
- runtimeConfig.FLOWRIX_CACHE ||= env.FLOWRIX_CACHE || false;
18
- runtimeConfig.FLOWRIX_CDN ||= env.FLOWRIX_CDN || "";
19
- Object.assign(runtimeConfig.public, {
20
- ...runtimeConfig.public,
21
- FLOWRIX_API_KEY: runtimeConfig.public.FLOWRIX_API_KEY || env.FLOWRIX_API_KEY || "",
22
- FLOWRIX_API_SECRET: runtimeConfig.public.FLOWRIX_API_SECRET || env.FLOWRIX_API_SECRET || "",
23
- FLOWRIX_API_ORIGIN: runtimeConfig.public.FLOWRIX_API_ORIGIN || env.FLOWRIX_API_ORIGIN || "",
24
- FLOWRIX_API_BASE: runtimeConfig.public.FLOWRIX_API_BASE || env.FLOWRIX_API_BASE || "",
25
- FLOWRIX_API_BASE_V2: runtimeConfig.public.FLOWRIX_API_BASE_V2 || env.FLOWRIX_API_BASE_V2 || "",
26
- FLOWRIX_CACHE: runtimeConfig.public.FLOWRIX_CACHE || env.FLOWRIX_CACHE || false,
27
- FLOWRIX_CDN: runtimeConfig.public.FLOWRIX_CDN || env.FLOWRIX_CDN || ""
28
- });
29
10
  const resolver = createResolver(import.meta.url);
30
11
  await installModule("@pinia/nuxt");
31
12
  addServerHandler({
@@ -11,7 +11,6 @@ export const useCustomScript = defineStore("CustomScript", {
11
11
  UNIT_RELATIVE: null,
12
12
  DISCOUNTS: null,
13
13
  measurementUnit: null,
14
- promotionSettings: null,
15
14
  B2BTYPE: null,
16
15
  USEBASEPRICE: null,
17
16
  BASEPRICE: null,
@@ -18,10 +18,9 @@ const parseCookies = (cookieString) => {
18
18
  );
19
19
  };
20
20
  async function request(method, config = {}, endpoint, options = {}) {
21
- const FLOWRIX_API_KEY = config.public?.FLOWRIX_API_KEY || "";
22
- const FLOWRIX_API_SECRET = config.public?.FLOWRIX_API_SECRET || "";
23
- const FLOWRIX_API_ORIGIN = config.public?.FLOWRIX_API_ORIGIN || "";
24
- let FLOWRIX_API_BASE = config.public?.FLOWRIX_API_BASE_V2 || "";
21
+ const FLOWRIX_API_KEY = config?.FLOWRIX_API_KEY || "";
22
+ const FLOWRIX_API_ORIGIN = config?.FLOWRIX_API_ORIGIN || "";
23
+ let FLOWRIX_API_BASE = config?.FLOWRIX_API_BASE || "";
25
24
  const cookiesObj = parseCookies(config.cookies || "");
26
25
  const authToken = cookiesObj["authToken"];
27
26
  const headers = {
@@ -29,7 +29,7 @@ export default defineEventHandler(async (event) => {
29
29
  cookies: rawCookies
30
30
  };
31
31
  const albums = await flowrixApi.get(`albums`, apiConfig);
32
- if (config.public.FLOWRIX_CACHE == true) {
32
+ if (config.FLOWRIX_CACHE == true) {
33
33
  await ensureCacheDir();
34
34
  await writeFile(filePath, JSON.stringify(albums, null, 2), "utf-8");
35
35
  }
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "POST",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY,
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN,
12
11
  "Content-Type": "application/json"
13
12
  },
@@ -9,15 +9,10 @@ export default defineEventHandler(async (event) => {
9
9
  statusMessage: "Email and password are required"
10
10
  });
11
11
  }
12
- console.log("Environment check:");
13
- console.log("API_BASE:", process.env.FLOWRIX_API_KEY);
14
- console.log("API_KEY present:", process.env.FLOWRIX_API_SECRET);
15
- console.log("API_SECRET present:", process.env.FLOWRIX_API_ORIGIN);
16
12
  const response = await fetch(`${process.env.FLOWRIX_API_BASE}login/`, {
17
13
  method: "POST",
18
14
  headers: {
19
15
  "x-public-key": process.env.FLOWRIX_API_KEY,
20
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
21
16
  "Origin": process.env.FLOWRIX_API_ORIGIN,
22
17
  "Content-Type": "application/json"
23
18
  },
@@ -6,7 +6,6 @@ export default defineEventHandler(async (event) => {
6
6
  method: "POST",
7
7
  headers: {
8
8
  "x-public-key": process.env.FLOWRIX_API_KEY,
9
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
10
9
  "Origin": process.env.FLOWRIX_API_ORIGIN,
11
10
  "Authorization": `Bearer ${accessTok || ""}`
12
11
  }
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "POST",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY,
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN,
12
11
  "Content-Type": "application/json"
13
12
  },
@@ -12,13 +12,11 @@ export default defineEventHandler(async (event) => {
12
12
  const config = useRuntimeConfig();
13
13
  const apiBase = config.apiBase;
14
14
  const apiKey = config.apiKey;
15
- const apiSecret = config.apiSecret;
16
15
  const apiOrigin = config.apiOrigin;
17
16
  const response = await fetch(`${apiBase}user/session`, {
18
17
  method: "GET",
19
18
  headers: {
20
19
  "x-public-key": apiKey,
21
- "x-api-secret": apiSecret,
22
20
  "Origin": apiOrigin || "",
23
21
  "Authorization": `Bearer ${token}`,
24
22
  "Content-Type": "application/json",
@@ -8,7 +8,6 @@ export default defineEventHandler(async (event) => {
8
8
  method: "POST",
9
9
  headers: {
10
10
  "x-public-key": process.env.FLOWRIX_API_KEY,
11
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
12
11
  "Origin": process.env.FLOWRIX_API_ORIGIN,
13
12
  "Content-Type": "application/json",
14
13
  // <--- CHANGE THIS
@@ -6,7 +6,6 @@ export default defineEventHandler(async (event) => {
6
6
  method: "GET",
7
7
  headers: {
8
8
  "x-public-key": process.env.FLOWRIX_API_KEY,
9
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
10
9
  "Origin": process.env.FLOWRIX_API_ORIGIN,
11
10
  Authorization: authHeader
12
11
  // Use the authorization header if available
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "POST",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY,
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN,
12
11
  "Content-Type": "application/json"
13
12
  },
@@ -29,7 +29,7 @@ export default defineEventHandler(async (event) => {
29
29
  cookies: rawCookies
30
30
  };
31
31
  const banners = await flowrixApi.get(`banners`, apiConfig);
32
- if (config.public.FLOWRIX_CACHE == true) {
32
+ if (config.FLOWRIX_CACHE == true) {
33
33
  await ensureCacheDir();
34
34
  await writeFile(filePath, JSON.stringify(banners, null, 2), "utf-8");
35
35
  }
@@ -40,7 +40,7 @@ export default defineEventHandler(async (event) => {
40
40
  ...query
41
41
  };
42
42
  const brand = await flowrixApi.get(`brands/${slug}`, apiConfig, { query });
43
- if (config.public.FLOWRIX_CACHE == true) {
43
+ if (config.FLOWRIX_CACHE == true) {
44
44
  await ensureCacheDir();
45
45
  await writeFile(filePath, JSON.stringify(brand, null, 2), "utf-8");
46
46
  }
@@ -34,7 +34,7 @@ export default defineEventHandler(async (event) => {
34
34
  ...query
35
35
  };
36
36
  const brands = await flowrixApi.get(`brands`, apiConfig, { query });
37
- if (config.public.FLOWRIX_CACHE == true) {
37
+ if (config.FLOWRIX_CACHE == true) {
38
38
  await ensureCacheDir();
39
39
  await writeFile(filePath, JSON.stringify(brands, null, 2), "utf-8");
40
40
  }
@@ -8,7 +8,6 @@ export default defineEventHandler(async (event) => {
8
8
  method: "POST",
9
9
  headers: {
10
10
  "x-public-key": process.env.FLOWRIX_API_KEY,
11
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
12
11
  "Origin": process.env.FLOWRIX_API_ORIGIN
13
12
  },
14
13
  body
@@ -8,7 +8,6 @@ export default defineEventHandler(async (event) => {
8
8
  method: "POST",
9
9
  headers: {
10
10
  "x-public-key": process.env.FLOWRIX_API_KEY,
11
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
12
11
  "Origin": process.env.FLOWRIX_API_ORIGIN
13
12
  },
14
13
  body
@@ -34,7 +34,7 @@ export default defineEventHandler(async (event) => {
34
34
  ...query
35
35
  };
36
36
  const brands = await flowrixApi.get(`brands`, apiConfig, { query });
37
- if (config.public.FLOWRIX_CACHE == true) {
37
+ if (config.FLOWRIX_CACHE == true) {
38
38
  await ensureCacheDir();
39
39
  await writeFile(filePath, JSON.stringify(brands, null, 2), "utf-8");
40
40
  }
@@ -34,7 +34,7 @@ export default defineEventHandler(async (event) => {
34
34
  ...query
35
35
  };
36
36
  const categories = await flowrixApi.get(`categories`, apiConfig, { query });
37
- if (config.public.FLOWRIX_CACHE == true) {
37
+ if (config.FLOWRIX_CACHE == true) {
38
38
  await ensureCacheDir();
39
39
  await writeFile(filePath, JSON.stringify(categories, null, 2), "utf-8");
40
40
  }
@@ -34,7 +34,7 @@ export default defineEventHandler(async (event) => {
34
34
  ...query
35
35
  };
36
36
  const categories = await flowrixApi.get(`categories/all`, apiConfig, { query });
37
- if (config.public.FLOWRIX_CACHE == true) {
37
+ if (config.FLOWRIX_CACHE == true) {
38
38
  await ensureCacheDir();
39
39
  await writeFile(filePath, JSON.stringify(categories, null, 2), "utf-8");
40
40
  }
@@ -34,7 +34,7 @@ export default defineEventHandler(async (event) => {
34
34
  ...query
35
35
  };
36
36
  const featured = await flowrixApi.get(`products/featured`, apiConfig, { query });
37
- if (config.public.FLOWRIX_CACHE == true) {
37
+ if (config.FLOWRIX_CACHE == true) {
38
38
  await ensureCacheDir();
39
39
  await writeFile(filePath, JSON.stringify(featured, null, 2), "utf-8");
40
40
  }
@@ -34,7 +34,7 @@ export default defineEventHandler(async (event) => {
34
34
  ...query
35
35
  };
36
36
  const posts = await flowrixApi.post(`posts`, apiConfig, { query });
37
- if (config.public.FLOWRIX_CACHE == true) {
37
+ if (config.FLOWRIX_CACHE == true) {
38
38
  await ensureCacheDir();
39
39
  await writeFile(filePath, JSON.stringify(posts, null, 2), "utf-8");
40
40
  }
@@ -35,7 +35,7 @@ export default defineEventHandler(async (event) => {
35
35
  ...query
36
36
  };
37
37
  const samples = await flowrixApi.get(`samples`, apiConfig, { query });
38
- if (config.public.FLOWRIX_CACHE == true) {
38
+ if (config.FLOWRIX_CACHE == true) {
39
39
  await ensureCacheDir();
40
40
  await writeFile(filePath, JSON.stringify(samples, null, 2), "utf-8");
41
41
  }
@@ -35,7 +35,7 @@ export default defineEventHandler(async (event) => {
35
35
  ...query
36
36
  };
37
37
  const search = await flowrixApi.get(`search`, apiConfig, { query });
38
- if (config.public.FLOWRIX_CACHE == true) {
38
+ if (config.FLOWRIX_CACHE == true) {
39
39
  await ensureCacheDir();
40
40
  await writeFile(filePath, JSON.stringify(search, null, 2), "utf-8");
41
41
  }
@@ -42,7 +42,7 @@ export default defineEventHandler(async (event) => {
42
42
  "scope[withchildren]": "true"
43
43
  };
44
44
  const category = await flowrixApi.get(`categories/${slug}`, apiConfig, { query });
45
- if (config.public.FLOWRIX_CACHE == true) {
45
+ if (config.FLOWRIX_CACHE == true) {
46
46
  await ensureCacheDir();
47
47
  await writeFile(filePath, JSON.stringify(category, null, 2), "utf-8");
48
48
  }
@@ -8,7 +8,6 @@ export default defineEventHandler(async (event) => {
8
8
  method: "GET",
9
9
  headers: {
10
10
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
11
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
12
11
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
13
12
  "Authorization": `Bearer ${accessTok || ""}`
14
13
  }
@@ -10,7 +10,6 @@ export default defineEventHandler(async (event) => {
10
10
  method: "GET",
11
11
  headers: {
12
12
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
13
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
14
13
  "Origin": process.env.FLOWRIX_API_ORIGIN || ""
15
14
  },
16
15
  query
@@ -22,7 +21,6 @@ export default defineEventHandler(async (event) => {
22
21
  method: "POST",
23
22
  headers: {
24
23
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
25
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
26
24
  "Origin": process.env.FLOWRIX_API_ORIGIN || ""
27
25
  },
28
26
  body,
@@ -8,7 +8,6 @@ export default defineEventHandler(async (event) => {
8
8
  method,
9
9
  headers: {
10
10
  "x-public-key": process.env.FLOWRIX_API_KEY,
11
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
12
11
  "Origin": process.env.FLOWRIX_API_ORIGIN
13
12
  },
14
13
  body
@@ -9,7 +9,6 @@ export default defineEventHandler(async (event) => {
9
9
  method: "POST",
10
10
  headers: {
11
11
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
12
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
13
12
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
14
13
  "Authorization": `Bearer ${accessTok || ""}`
15
14
  },
@@ -37,7 +37,7 @@ export default defineEventHandler(async (event) => {
37
37
  cookies: rawCookies
38
38
  };
39
39
  const blog = await flowrixApi.get(`post/${slug}`, apiConfig, {});
40
- if (config.public.FLOWRIX_CACHE == true) {
40
+ if (config.FLOWRIX_CACHE == true) {
41
41
  await ensureCacheDir();
42
42
  await writeFile(filePath, JSON.stringify(blog, null, 2), "utf-8");
43
43
  }
@@ -34,7 +34,7 @@ export default defineEventHandler(async (event) => {
34
34
  ...query
35
35
  };
36
36
  const posts = await flowrixApi.post(`posts`, apiConfig, { query });
37
- if (config.public.FLOWRIX_CACHE == true) {
37
+ if (config.FLOWRIX_CACHE == true) {
38
38
  await ensureCacheDir();
39
39
  await writeFile(filePath, JSON.stringify(posts, null, 2), "utf-8");
40
40
  }
@@ -37,7 +37,7 @@ export default defineEventHandler(async (event) => {
37
37
  cookies: rawCookies
38
38
  };
39
39
  const webfrom = await flowrixApi.get(`contact-center/webforms/${slug}/details`, apiConfig, {});
40
- if (config.public.FLOWRIX_CACHE == true) {
40
+ if (config.FLOWRIX_CACHE == true) {
41
41
  await ensureCacheDir();
42
42
  await writeFile(filePath, JSON.stringify(webfrom, null, 2), "utf-8");
43
43
  }
@@ -27,7 +27,7 @@ export default defineEventHandler(async (event) => {
27
27
  cookies: rawCookies
28
28
  };
29
29
  const countries = await flowrixApi.get(`countries`, apiConfig);
30
- if (config.public.FLOWRIX_CACHE == true) {
30
+ if (config.FLOWRIX_CACHE == true) {
31
31
  await ensureCacheDir();
32
32
  await writeFile(filePath, JSON.stringify(countries, null, 2), "utf-8");
33
33
  }
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "POST",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
12
11
  "Authorization": `Bearer ${accessTok || ""}`,
13
12
  "Content-Type": "application/json",
@@ -14,7 +14,6 @@ export default defineEventHandler(async (event) => {
14
14
  method: "PATCH",
15
15
  headers: {
16
16
  "x-public-key": process.env.FLOWRIX_API_KEY,
17
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
18
17
  "Origin": process.env.FLOWRIX_API_ORIGIN,
19
18
  "Authorization": `Bearer ${accessTok || ""}`
20
19
  }
@@ -14,7 +14,6 @@ export default defineEventHandler(async (event) => {
14
14
  method: "POST",
15
15
  headers: {
16
16
  "x-public-key": process.env.FLOWRIX_API_KEY,
17
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
18
17
  "Origin": process.env.FLOWRIX_API_ORIGIN,
19
18
  "Authorization": `Bearer ${accessTok || ""}`,
20
19
  "Content-Type": "application/json",
@@ -16,7 +16,6 @@ export default defineEventHandler(async (event) => {
16
16
  method: "PATCH",
17
17
  headers: {
18
18
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
19
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
20
19
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
21
20
  "Authorization": `Bearer ${accessTok || ""}`,
22
21
  "Content-Type": "application/json",
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "DELETE",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY,
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN,
12
11
  "Authorization": `Bearer ${accessTok || ""}`
13
12
  }
@@ -5,7 +5,6 @@ export default defineEventHandler(async (event) => {
5
5
  const response = await $fetch(`${process.env.FLOWRIX_API_BASE}customer/cards`, {
6
6
  headers: {
7
7
  "x-public-key": process.env.FLOWRIX_API_KEY,
8
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
9
8
  "Origin": process.env.FLOWRIX_API_ORIGIN,
10
9
  "Authorization": `Bearer ${accessTok || ""}`
11
10
  }
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "POST",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
12
11
  "Authorization": `Bearer ${accessTok || ""}`,
13
12
  "Content-Type": "application/json",
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "POST",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY,
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN
12
11
  },
13
12
  body
@@ -5,7 +5,6 @@ export default defineEventHandler(async (event) => {
5
5
  const response = await $fetch(`${process.env.FLOWRIX_API_BASE}customer/orders`, {
6
6
  headers: {
7
7
  "x-public-key": process.env.FLOWRIX_API_KEY,
8
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
9
8
  "Origin": process.env.FLOWRIX_API_ORIGIN,
10
9
  "Authorization": `Bearer ${accessTok || ""}`
11
10
  }
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "POST",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
12
11
  "Authorization": `Bearer ${accessTok || ""}`,
13
12
  "Content-Type": "application/json",
@@ -5,7 +5,6 @@ export default defineEventHandler(async (event) => {
5
5
  const response = await $fetch(`${process.env.FLOWRIX_API_BASE}customer/quotations`, {
6
6
  headers: {
7
7
  "x-public-key": process.env.FLOWRIX_API_KEY,
8
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
9
8
  "Origin": process.env.FLOWRIX_API_ORIGIN,
10
9
  "Authorization": `Bearer ${accessTok || ""}`
11
10
  }
@@ -6,7 +6,6 @@ export default defineEventHandler(async (event) => {
6
6
  method: "POST",
7
7
  headers: {
8
8
  "x-public-key": process.env.FLOWRIX_API_KEY,
9
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
10
9
  "Origin": process.env.FLOWRIX_API_ORIGIN
11
10
  },
12
11
  body
@@ -12,7 +12,6 @@ export default defineEventHandler(async (event) => {
12
12
  {
13
13
  headers: {
14
14
  "x-public-key": process.env.FLOWRIX_API_KEY,
15
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
16
15
  "Origin": process.env.FLOWRIX_API_ORIGIN,
17
16
  "Authorization": `Bearer ${accessTok || ""}`
18
17
  }
@@ -8,7 +8,6 @@ export default defineEventHandler(async (event) => {
8
8
  method: "POST",
9
9
  headers: {
10
10
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
11
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
12
11
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
13
12
  "Authorization": `Bearer ${accessTok || ""}`,
14
13
  "Content-Type": "application/json",
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "POST",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
12
11
  "Authorization": `Bearer ${accessTok || ""}`,
13
12
  "Content-Type": "application/json",
@@ -16,7 +16,6 @@ export default defineEventHandler(async (event) => {
16
16
  method: "POST",
17
17
  headers: {
18
18
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
19
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
20
19
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
21
20
  "Authorization": `Bearer ${accessTok || ""}`,
22
21
  "Content-Type": "application/json",
@@ -8,7 +8,6 @@ export default defineEventHandler(async (event) => {
8
8
  method: "POST",
9
9
  headers: {
10
10
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
11
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
12
11
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
13
12
  "Authorization": `Bearer ${accessTok || ""}`,
14
13
  "Content-Type": "application/json",
@@ -5,7 +5,6 @@ export default defineEventHandler(async (event) => {
5
5
  const response = await $fetch(`${process.env.FLOWRIX_API_BASE}customer/wishlist`, {
6
6
  headers: {
7
7
  "x-public-key": process.env.FLOWRIX_API_KEY,
8
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
9
8
  "Origin": process.env.FLOWRIX_API_ORIGIN,
10
9
  "Authorization": `Bearer ${accessTok || ""}`
11
10
  }
@@ -7,7 +7,6 @@ export default defineEventHandler(async (event) => {
7
7
  method: "GET",
8
8
  headers: {
9
9
  "x-public-key": process.env.FLOWRIX_API_KEY,
10
- "x-api-secret": process.env.FLOWRIX_API_SECRET,
11
10
  "Origin": process.env.FLOWRIX_API_ORIGIN,
12
11
  "Authorization": `Bearer ${accessTok || ""}`
13
12
  }
@@ -8,7 +8,6 @@ export default defineEventHandler(async (event) => {
8
8
  method: "POST",
9
9
  headers: {
10
10
  "x-public-key": process.env.FLOWRIX_API_KEY || "",
11
- "x-api-secret": process.env.FLOWRIX_API_SECRET || "",
12
11
  "Origin": process.env.FLOWRIX_API_ORIGIN || "",
13
12
  "Authorization": `Bearer ${accessTok || ""}`,
14
13
  "Content-Type": "application/json",
@@ -34,7 +34,7 @@ export default defineEventHandler(async (event) => {
34
34
  ...query
35
35
  };
36
36
  const featured = await flowrixApi.get(`products/featured`, apiConfig, { query });
37
- if (config.public.FLOWRIX_CACHE == true) {
37
+ if (config.FLOWRIX_CACHE == true) {
38
38
  await ensureCacheDir();
39
39
  await writeFile(filePath, JSON.stringify(featured, null, 2), "utf-8");
40
40
  }
@@ -8,7 +8,7 @@ import { $fetch } from "ofetch";
8
8
  export default defineEventHandler(async (event) => {
9
9
  try {
10
10
  const config = useRuntimeConfig();
11
- const fileUrl = config.public.FLOWRIX_CDN + "robots.txt";
11
+ const fileUrl = config.FLOWRIX_CDN + "robots.txt";
12
12
  const fileContent = await $fetch(fileUrl);
13
13
  setHeader(event, "Content-Type", "text/plain; charset=utf-8");
14
14
  return fileContent;
@@ -13,7 +13,7 @@ export default defineEventHandler(async (event) => {
13
13
  }
14
14
  const isGzip = fullPath.endsWith(".gz");
15
15
  const config = useRuntimeConfig();
16
- const cdnUrl = config.public.FLOWRIX_CDN + "sitemap/" + fullPath;
16
+ const cdnUrl = config.FLOWRIX_CDN + "sitemap/" + fullPath;
17
17
  const buffer = await $fetch(cdnUrl, { responseType: "arrayBuffer" });
18
18
  const data = Buffer.from(buffer);
19
19
  if (isGzip) {
@@ -38,7 +38,7 @@ export default defineEventHandler(async (event) => {
38
38
  cookies: rawCookies
39
39
  };
40
40
  const menu = await flowrixApi.get(`nav/${slug}/links`, apiConfig, {});
41
- if (config.public.FLOWRIX_CACHE == true) {
41
+ if (config.FLOWRIX_CACHE == true) {
42
42
  await ensureCacheDir();
43
43
  await writeFile(filePath, JSON.stringify(menu, null, 2), "utf-8");
44
44
  }
@@ -37,7 +37,7 @@ export default defineEventHandler(async (event) => {
37
37
  cookies: rawCookies
38
38
  };
39
39
  const page = await flowrixApi.get(`page/${slug}`, apiConfig, {});
40
- if (config.public.FLOWRIX_CACHE == true) {
40
+ if (config.FLOWRIX_CACHE == true) {
41
41
  await ensureCacheDir();
42
42
  await writeFile(filePath, JSON.stringify(page, null, 2), "utf-8");
43
43
  }
@@ -43,7 +43,7 @@ export default defineEventHandler(async (event) => {
43
43
  body: JSON.stringify(body),
44
44
  query
45
45
  });
46
- if (config.public.FLOWRIX_CACHE == true) {
46
+ if (config.FLOWRIX_CACHE == true) {
47
47
  await ensureCacheDir();
48
48
  await writeFile(filePath, JSON.stringify(product, null, 2), "utf-8");
49
49
  }
@@ -35,7 +35,7 @@ export default defineEventHandler(async (event) => {
35
35
  ...query
36
36
  };
37
37
  const samples = await flowrixApi.get(`samples`, apiConfig, { query });
38
- if (config.public.FLOWRIX_CACHE == true) {
38
+ if (config.FLOWRIX_CACHE == true) {
39
39
  await ensureCacheDir();
40
40
  await writeFile(filePath, JSON.stringify(samples, null, 2), "utf-8");
41
41
  }
@@ -35,7 +35,7 @@ export default defineEventHandler(async (event) => {
35
35
  ...query
36
36
  };
37
37
  const search = await flowrixApi.get(`search`, apiConfig, { query });
38
- if (config.public.FLOWRIX_CACHE == true) {
38
+ if (config.FLOWRIX_CACHE == true) {
39
39
  await ensureCacheDir();
40
40
  await writeFile(filePath, JSON.stringify(search, null, 2), "utf-8");
41
41
  }
@@ -40,7 +40,7 @@ export default defineEventHandler(async (event) => {
40
40
  cookies: rawCookies
41
41
  };
42
42
  const service = await flowrixApi.get(`services/${slug}`, apiConfig, {});
43
- if (config.public.FLOWRIX_CACHE == true) {
43
+ if (config.FLOWRIX_CACHE == true) {
44
44
  await ensureCacheDir();
45
45
  await writeFile(filePath, JSON.stringify(service, null, 2), "utf-8");
46
46
  }
@@ -40,7 +40,7 @@ export default defineEventHandler(async (event) => {
40
40
  cookies: rawCookies
41
41
  };
42
42
  const service = await flowrixApi.get(`services`, apiConfig, {});
43
- if (config.public.FLOWRIX_CACHE == true) {
43
+ if (config.FLOWRIX_CACHE == true) {
44
44
  await ensureCacheDir();
45
45
  await writeFile(filePath, JSON.stringify(service, null, 2), "utf-8");
46
46
  }
@@ -35,7 +35,7 @@ export default defineEventHandler(async (event) => {
35
35
  ...query
36
36
  };
37
37
  const search = await flowrixApi.get(`search`, apiConfig, { query });
38
- if (config.public.FLOWRIX_CACHE == true) {
38
+ if (config.FLOWRIX_CACHE == true) {
39
39
  await ensureCacheDir();
40
40
  await writeFile(filePath, JSON.stringify(search, null, 2), "utf-8");
41
41
  }
@@ -37,7 +37,7 @@ export default defineEventHandler(async (event) => {
37
37
  cookies: rawCookies
38
38
  };
39
39
  const webfrom = await flowrixApi.get(`contact-center/webforms/${slug}/details`, apiConfig, {});
40
- if (config.public.FLOWRIX_CACHE == true) {
40
+ if (config.FLOWRIX_CACHE == true) {
41
41
  await ensureCacheDir();
42
42
  await writeFile(filePath, JSON.stringify(webfrom, null, 2), "utf-8");
43
43
  }
@@ -114,8 +114,6 @@ export declare const useWishlistsStore: import("pinia").StoreDefinition<"wishlis
114
114
  setError(error: string | null): void;
115
115
  setWishlists(wishlists: Wishlist[]): void;
116
116
  addWishlist(wishlist: Wishlist): void;
117
- updateWishlist(updatedWishlist: Wishlist): void;
118
- updateWishlist(id: number, data: UpdateWishlistData): Promise<ApiResponse<Wishlist>>;
119
117
  removeWishlist(wishlistId: number): void;
120
118
  setWishlistProducts(listId: number, products: WishlistProduct[]): void;
121
119
  addWishlistProduct(listId: number, product: WishlistProduct): void;
@@ -132,5 +130,6 @@ export declare const useWishlistsStore: import("pinia").StoreDefinition<"wishlis
132
130
  createWishlist(data: CreateWishlistData): Promise<ApiResponse<Wishlist>>;
133
131
  addToWishlist(listId: number, productSlug: string, data?: AddToWishlistData): Promise<ApiResponse<WishlistProduct>>;
134
132
  removeFromWishlist(listId: number, productSlug: string): Promise<ApiResponse<void>>;
133
+ updateWishlist(id: number, data: UpdateWishlistData): Promise<ApiResponse<Wishlist>>;
135
134
  deleteWishlist(id: number): Promise<ApiResponse<void>>;
136
135
  }>;
@@ -21,12 +21,6 @@ export const useWishlistsStore = defineStore("wishlists", {
21
21
  addWishlist(wishlist) {
22
22
  this.wishlists.push(wishlist);
23
23
  },
24
- updateWishlist(updatedWishlist) {
25
- const index = this.wishlists.findIndex((w) => w.id === updatedWishlist.id);
26
- if (index !== -1) {
27
- this.wishlists[index] = updatedWishlist;
28
- }
29
- },
30
24
  removeWishlist(wishlistId) {
31
25
  this.wishlists = this.wishlists.filter((w) => w.id !== wishlistId);
32
26
  },
@@ -37,17 +37,15 @@ function getLocationHeaders() {
37
37
  export function useApi() {
38
38
  const authStore = useAuthStore();
39
39
  const config = useRuntimeConfig();
40
- const FLOWRIX_API_KEY = config.public.FLOWRIX_API_KEY;
41
- const FLOWRIX_API_SECRET = config.public.FLOWRIX_API_SECRET;
42
- const FLOWRIX_API_ORIGIN = config.public.FLOWRIX_API_ORIGIN;
43
- const FLOWRIX_API_BASE = config.public.FLOWRIX_API_BASE;
40
+ const FLOWRIX_API_KEY = config.FLOWRIX_API_KEY;
41
+ const FLOWRIX_API_ORIGIN = config.FLOWRIX_API_ORIGIN;
42
+ const FLOWRIX_API_BASE = config.FLOWRIX_API_BASE;
44
43
  const baseURL = FLOWRIX_API_BASE || "";
45
44
  async function request(method, url, data = null, options = {}, extraHeaders = {}) {
46
45
  const locationHeaders = getLocationHeaders();
47
46
  const headers = {
48
47
  "Content-Type": "application/json",
49
48
  "x-public-key": FLOWRIX_API_KEY,
50
- "x-api-secret": FLOWRIX_API_SECRET,
51
49
  // Add location headers from cookies
52
50
  ...locationHeaders,
53
51
  // Add extra headers
@@ -54,7 +54,7 @@ export default defineEventHandler(async (event) => {
54
54
  if (chunk) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
55
55
  const html = Buffer.concat(chunks).toString("utf-8");
56
56
  if (event.node.res.statusCode === 200 && html.includes("<!DOCTYPE html>")) {
57
- if (config.public.FLOWRIX_CACHE == true) {
57
+ if (config.FLOWRIX_CACHE == true) {
58
58
  writeCache(url, html, customerType);
59
59
  }
60
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowrix",
3
- "version": "1.0.1-beta.93",
3
+ "version": "1.0.1-beta.95",
4
4
  "description": "Plug-and-play Nuxt eCommerce cart powered by FLOWRiX. Subscription required.",
5
5
  "license": "MIT",
6
6
  "type": "module",