flowrix 1.0.1-beta.94 → 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 (36) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +0 -10
  3. package/dist/runtime/middleware/flowrix.js +3 -3
  4. package/dist/runtime/server/api/albums.js +1 -1
  5. package/dist/runtime/server/api/banners.js +1 -1
  6. package/dist/runtime/server/api/brand/[...slug].js +1 -1
  7. package/dist/runtime/server/api/brand/index.js +1 -1
  8. package/dist/runtime/server/api/catalog/brands.js +1 -1
  9. package/dist/runtime/server/api/catalog/categories.js +1 -1
  10. package/dist/runtime/server/api/catalog/categoriesall.js +1 -1
  11. package/dist/runtime/server/api/catalog/featured.js +1 -1
  12. package/dist/runtime/server/api/catalog/posts.js +1 -1
  13. package/dist/runtime/server/api/catalog/samples.js +1 -1
  14. package/dist/runtime/server/api/catalog/search.js +1 -1
  15. package/dist/runtime/server/api/category/[...slug].js +1 -1
  16. package/dist/runtime/server/api/cmspost/[...slug].js +1 -1
  17. package/dist/runtime/server/api/cmspost/all.js +1 -1
  18. package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +1 -1
  19. package/dist/runtime/server/api/countries.js +1 -1
  20. package/dist/runtime/server/api/featured.js +1 -1
  21. package/dist/runtime/server/api/generate/robots.get.js +1 -1
  22. package/dist/runtime/server/api/generate/sitemap.get.js +1 -1
  23. package/dist/runtime/server/api/nav/[id]/links.js +1 -1
  24. package/dist/runtime/server/api/page/[...slug].js +1 -1
  25. package/dist/runtime/server/api/product/[...slug].js +1 -1
  26. package/dist/runtime/server/api/samples.js +1 -1
  27. package/dist/runtime/server/api/search.js +1 -1
  28. package/dist/runtime/server/api/service/[slug].js +1 -1
  29. package/dist/runtime/server/api/service/getall.js +1 -1
  30. package/dist/runtime/server/api/shop.js +1 -1
  31. package/dist/runtime/server/api/webform.js +1 -1
  32. package/dist/runtime/stores/wishlists.d.ts +1 -2
  33. package/dist/runtime/stores/wishlists.js +0 -6
  34. package/dist/runtime/utils/api.js +3 -3
  35. package/dist/runtime/utils/htmlCache.js +1 -1
  36. 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.94",
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,16 +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
- Object.assign(runtimeConfig.public, {
13
- ...runtimeConfig.public,
14
- FLOWRIX_API_KEY: runtimeConfig.public.FLOWRIX_API_KEY || env.FLOWRIX_API_KEY || runtimeConfig.FLOWRIX_API_KEY || "",
15
- FLOWRIX_API_ORIGIN: runtimeConfig.public.FLOWRIX_API_ORIGIN || env.FLOWRIX_API_ORIGIN || runtimeConfig.FLOWRIX_API_ORIGIN || "",
16
- FLOWRIX_API_BASE: runtimeConfig.public.FLOWRIX_API_BASE || env.FLOWRIX_API_BASE || runtimeConfig.FLOWRIX_API_BASE || "",
17
- FLOWRIX_CACHE: runtimeConfig.public.FLOWRIX_CACHE || env.FLOWRIX_CACHE || runtimeConfig.FLOWRIX_CACHE || false,
18
- FLOWRIX_CDN: runtimeConfig.public.FLOWRIX_CDN || env.FLOWRIX_CDN || runtimeConfig.FLOWRIX_CDN || ""
19
- });
20
10
  const resolver = createResolver(import.meta.url);
21
11
  await installModule("@pinia/nuxt");
22
12
  addServerHandler({
@@ -18,9 +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_ORIGIN = config.public?.FLOWRIX_API_ORIGIN || "";
23
- let FLOWRIX_API_BASE = config.public?.FLOWRIX_API_BASE || "";
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 || "";
24
24
  const cookiesObj = parseCookies(config.cookies || "");
25
25
  const authToken = cookiesObj["authToken"];
26
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
  }
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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,9 +37,9 @@ 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_ORIGIN = config.public.FLOWRIX_API_ORIGIN;
42
- 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;
43
43
  const baseURL = FLOWRIX_API_BASE || "";
44
44
  async function request(method, url, data = null, options = {}, extraHeaders = {}) {
45
45
  const locationHeaders = getLocationHeaders();
@@ -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.94",
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",