flowrix 1.0.1-beta.14 → 1.0.1-beta.141

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 (275) hide show
  1. package/dist/module.d.mts +1 -6
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +169 -30
  4. package/dist/runtime/composables/Blog/useBlogIndex.d.ts +2 -5
  5. package/dist/runtime/composables/Blog/useBlogSingle.js +2 -4
  6. package/dist/runtime/composables/Brand/brand.d.ts +1 -1
  7. package/dist/runtime/composables/Brand/brand.js +30 -2
  8. package/dist/runtime/composables/Cart/useCart.d.ts +40 -0
  9. package/dist/runtime/composables/Cart/useCart.js +10 -0
  10. package/dist/runtime/composables/Cart/useCartComponent.d.ts +1 -0
  11. package/dist/runtime/composables/Cart/useCartComponent.js +11 -0
  12. package/dist/runtime/composables/Cart/useCartDetail.d.ts +15 -5
  13. package/dist/runtime/composables/Cart/useCartDetail.js +3 -0
  14. package/dist/runtime/composables/Category/useCategoryIndex.d.ts +25 -32
  15. package/dist/runtime/composables/Category/useCategoryIndex.js +63 -44
  16. package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.js +8 -0
  17. package/dist/runtime/composables/Checkout/PaymentMethods/useEway.js +16 -6
  18. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +40 -1
  19. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +10 -2
  20. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +40 -1
  21. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +10 -2
  22. package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +3 -14
  23. package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.js +8 -0
  24. package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +2 -2
  25. package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.js +8 -0
  26. package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.js +8 -0
  27. package/dist/runtime/composables/Checkout/useCheckout.d.ts +85 -73
  28. package/dist/runtime/composables/Checkout/useCheckout.js +84 -53
  29. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.d.ts +43 -0
  30. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.js +84 -0
  31. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.d.ts +55 -0
  32. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.js +196 -0
  33. package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +7 -7
  34. package/dist/runtime/composables/Checkout/useCreateAccount.js +3 -1
  35. package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +2 -2
  36. package/dist/runtime/composables/Checkout/useDeliveryMethod.js +18 -11
  37. package/dist/runtime/composables/Customer/useBillingAddress.d.ts +112 -0
  38. package/dist/runtime/composables/Customer/useBillingAddress.js +93 -0
  39. package/dist/runtime/composables/Customer/useLogin.d.ts +9 -0
  40. package/dist/runtime/composables/Customer/useLogin.js +34 -0
  41. package/dist/runtime/composables/Customer/useOrders.d.ts +29 -0
  42. package/dist/runtime/composables/Customer/useOrders.js +56 -0
  43. package/dist/runtime/composables/Customer/usePasswordReset.d.ts +26 -0
  44. package/dist/runtime/composables/Customer/usePasswordReset.js +258 -0
  45. package/dist/runtime/composables/Customer/useProfile.d.ts +75 -0
  46. package/dist/runtime/composables/Customer/useProfile.js +106 -0
  47. package/dist/runtime/composables/Customer/useQuotations.d.ts +32 -0
  48. package/dist/runtime/composables/Customer/useQuotations.js +40 -0
  49. package/dist/runtime/composables/Customer/useRegister.d.ts +121 -13
  50. package/dist/runtime/composables/Customer/useRegister.js +310 -35
  51. package/dist/runtime/composables/Customer/useShippingAddress.d.ts +121 -0
  52. package/dist/runtime/composables/Customer/useShippingAddress.js +145 -0
  53. package/dist/runtime/composables/Customer/useUpdatePassword.d.ts +21 -0
  54. package/dist/runtime/composables/Customer/useUpdatePassword.js +130 -0
  55. package/dist/runtime/composables/Customer/useUserCards.d.ts +22 -0
  56. package/dist/runtime/composables/Customer/useUserCards.js +65 -0
  57. package/dist/runtime/composables/{useWishlists.d.ts → Customer/useWishlists.d.ts} +7 -20
  58. package/dist/runtime/composables/{useWishlists.js → Customer/useWishlists.js} +21 -30
  59. package/dist/runtime/composables/Extras/useCountry.d.ts +11 -6
  60. package/dist/runtime/composables/Extras/useCountry.js +5 -4
  61. package/dist/runtime/composables/Footer/useFooter.d.ts +4 -4
  62. package/dist/runtime/composables/Footer/useFooter.js +12 -8
  63. package/dist/runtime/composables/Header/useHeader.d.ts +6 -20
  64. package/dist/runtime/composables/Header/useHeader.js +3 -2
  65. package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +4 -5
  66. package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +1 -1
  67. package/dist/runtime/composables/Product/useProductComponent.js +110 -0
  68. package/dist/runtime/composables/Product/useProductSlug.d.ts +8 -1
  69. package/dist/runtime/composables/Product/useQuickView.d.ts +8 -0
  70. package/dist/runtime/composables/Product/useQuickView.js +27 -0
  71. package/dist/runtime/composables/Product/useService.d.ts +42 -15
  72. package/dist/runtime/composables/Product/useService.js +137 -48
  73. package/dist/runtime/composables/Samples/useSamples.d.ts +5 -6
  74. package/dist/runtime/composables/Samples/useSamples.js +19 -15
  75. package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +2 -2
  76. package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +2 -2
  77. package/dist/runtime/composables/index.d.ts +18 -12
  78. package/dist/runtime/composables/index.js +18 -12
  79. package/dist/runtime/composables/useAddresses.js +6 -6
  80. package/dist/runtime/composables/useApp.d.ts +1 -0
  81. package/dist/runtime/composables/useApp.js +88 -0
  82. package/dist/runtime/composables/useCards.js +2 -2
  83. package/dist/runtime/composables/useDataLayer.js +1 -1
  84. package/dist/runtime/composables/useDotDigital.d.ts +3 -0
  85. package/dist/runtime/composables/useDotDigital.js +122 -0
  86. package/dist/runtime/composables/useLocation.d.ts +61 -19
  87. package/dist/runtime/composables/useLocation.js +353 -25
  88. package/dist/runtime/composables/useMetaLayer.js +11 -11
  89. package/dist/runtime/composables/useQuotationCheckout.d.ts +78 -0
  90. package/dist/runtime/composables/useQuotationCheckout.js +137 -0
  91. package/dist/runtime/composables/useSubscriptions.d.ts +17 -10
  92. package/dist/runtime/composables/useSubscriptions.js +68 -33
  93. package/dist/runtime/composables/useTikTokDatalayer.js +7 -7
  94. package/dist/runtime/composables/useWebforms.d.ts +38 -9
  95. package/dist/runtime/composables/useWebforms.js +93 -60
  96. package/dist/runtime/middleware/flowrix.d.ts +5 -4
  97. package/dist/runtime/middleware/flowrix.js +40 -22
  98. package/dist/runtime/pages/404.d.vue.ts +3 -0
  99. package/dist/runtime/pages/404.vue +6 -0
  100. package/dist/runtime/pages/404.vue.d.ts +3 -0
  101. package/dist/runtime/pages/flowrix-default.d.vue.ts +3 -0
  102. package/dist/runtime/pages/flowrix-default.vue +42 -0
  103. package/dist/runtime/pages/flowrix-default.vue.d.ts +3 -0
  104. package/dist/runtime/plugin.d.ts +1 -1
  105. package/dist/runtime/plugins/router.d.ts +2 -0
  106. package/dist/runtime/plugins/router.js +11 -0
  107. package/dist/runtime/server/api/albums.d.ts +1 -0
  108. package/dist/runtime/server/api/albums.js +35 -7
  109. package/dist/runtime/server/api/auth/forgot.js +1 -2
  110. package/dist/runtime/server/api/auth/login.d.ts +7 -0
  111. package/dist/runtime/server/api/auth/login.js +4 -16
  112. package/dist/runtime/server/api/auth/logout.js +1 -2
  113. package/dist/runtime/server/api/auth/register.js +1 -2
  114. package/dist/runtime/server/api/auth/session.get.js +1 -3
  115. package/dist/runtime/server/api/auth/user/reset-password.js +1 -2
  116. package/dist/runtime/server/api/auth/user/session.js +1 -2
  117. package/dist/runtime/server/api/auth/user/verify-token.js +1 -2
  118. package/dist/runtime/server/api/banners.js +20 -15
  119. package/dist/runtime/server/api/brand/[...slug].js +55 -0
  120. package/dist/runtime/server/api/brand/index.d.ts +3 -0
  121. package/dist/runtime/server/api/brand/index.js +46 -0
  122. package/dist/runtime/server/api/cache/[...slug].delete.d.ts +4 -1
  123. package/dist/runtime/server/api/cache/[...slug].delete.js +4 -7
  124. package/dist/runtime/server/api/cache/clean.get.d.ts +5 -0
  125. package/dist/runtime/server/api/cache/clean.get.js +4 -7
  126. package/dist/runtime/server/api/cart/[slug]/add.d.ts +1 -1
  127. package/dist/runtime/server/api/cart/[slug]/add.js +11 -11
  128. package/dist/runtime/server/api/cart/[slug]/update.d.ts +1 -1
  129. package/dist/runtime/server/api/cart/[slug]/update.js +11 -11
  130. package/dist/runtime/server/api/{v2/[...slug].d.ts → cart/related.d.ts} +0 -1
  131. package/dist/runtime/server/api/cart/related.js +21 -0
  132. package/dist/runtime/server/api/cart/remove.d.ts +1 -1
  133. package/dist/runtime/server/api/cart/remove.js +10 -10
  134. package/dist/runtime/server/api/cart/service/[slug]/add.d.ts +1 -1
  135. package/dist/runtime/server/api/cart/service/[slug]/add.js +12 -12
  136. package/dist/runtime/server/api/catalog/brands.d.ts +3 -0
  137. package/dist/runtime/server/api/catalog/brands.js +52 -0
  138. package/dist/runtime/server/api/catalog/categories.js +28 -19
  139. package/dist/runtime/server/api/catalog/categoriesall.d.ts +3 -0
  140. package/dist/runtime/server/api/catalog/categoriesall.js +52 -0
  141. package/dist/runtime/server/api/catalog/featured.js +28 -17
  142. package/dist/runtime/server/api/catalog/posts.d.ts +3 -0
  143. package/dist/runtime/server/api/catalog/posts.js +52 -0
  144. package/dist/runtime/server/api/catalog/samples.js +28 -19
  145. package/dist/runtime/server/api/catalog/search.js +28 -19
  146. package/dist/runtime/server/api/category/[...slug].js +31 -20
  147. package/dist/runtime/server/api/check-404.d.ts +4 -0
  148. package/dist/runtime/server/api/check-404.js +8 -0
  149. package/dist/runtime/server/api/checkout/applyCoupon.d.ts +1 -1
  150. package/dist/runtime/server/api/checkout/applyCoupon.js +13 -13
  151. package/dist/runtime/server/api/checkout/configs.d.ts +1 -1
  152. package/dist/runtime/server/api/checkout/configs.js +11 -11
  153. package/dist/runtime/server/api/checkout/countries.d.ts +1 -1
  154. package/dist/runtime/server/api/checkout/countries.js +5 -9
  155. package/dist/runtime/server/api/checkout/paymentmethod.d.ts +1 -1
  156. package/dist/runtime/server/api/checkout/paymentmethod.js +16 -11
  157. package/dist/runtime/server/api/{blog/blog.d.ts → checkout/quotation/[slug].d.ts} +0 -1
  158. package/dist/runtime/server/api/checkout/quotation/[slug].js +20 -0
  159. package/dist/runtime/server/api/checkout/quotation/guest/[slug].d.ts +2 -0
  160. package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +35 -0
  161. package/dist/runtime/server/api/checkout/quotation/guest/customer.d.ts +2 -0
  162. package/dist/runtime/server/api/checkout/quotation/guest/customer.js +20 -0
  163. package/dist/runtime/server/api/checkout/quotation/submit/[slug].d.ts +2 -0
  164. package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +22 -0
  165. package/dist/runtime/server/api/checkvariables.d.ts +3 -0
  166. package/dist/runtime/server/api/checkvariables.js +37 -0
  167. package/dist/runtime/server/api/cmspost/[...slug].js +54 -0
  168. package/dist/runtime/server/api/cmspost/all.d.ts +3 -0
  169. package/dist/runtime/server/api/cmspost/all.js +52 -0
  170. package/dist/runtime/server/api/company/profile.d.ts +1 -1
  171. package/dist/runtime/server/api/company/profile.js +12 -7
  172. package/dist/runtime/server/api/contact-center/webforms/[id]/details.d.ts +1 -1
  173. package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +50 -15
  174. package/dist/runtime/server/api/contact-center/webforms/create.d.ts +1 -1
  175. package/dist/runtime/server/api/contact-center/webforms/create.js +13 -9
  176. package/dist/runtime/server/api/countries.d.ts +2 -0
  177. package/dist/runtime/server/api/countries.js +44 -0
  178. package/dist/runtime/server/api/customer/address/add.js +1 -2
  179. package/dist/runtime/server/api/customer/address/delete.js +2 -3
  180. package/dist/runtime/server/api/customer/address/setshipping.js +1 -2
  181. package/dist/runtime/server/api/customer/address/update.js +1 -2
  182. package/dist/runtime/server/api/customer/cards/delete.js +2 -3
  183. package/dist/runtime/server/api/customer/cards/get.js +2 -3
  184. package/dist/runtime/server/api/customer/change-password.js +2 -3
  185. package/dist/runtime/server/api/customer/checkout.js +1 -2
  186. package/dist/runtime/server/api/customer/orders.js +2 -3
  187. package/dist/runtime/server/api/customer/profile/update.js +1 -2
  188. package/dist/runtime/server/api/customer/quotations.js +2 -3
  189. package/dist/runtime/server/api/customer/search.js +1 -2
  190. package/dist/runtime/server/api/customer/tax-invoice.js +1 -2
  191. package/dist/runtime/server/api/customer/wishlist/add.js +1 -2
  192. package/dist/runtime/server/api/customer/wishlist/createWishList.js +1 -2
  193. package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +1 -2
  194. package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +1 -2
  195. package/dist/runtime/server/api/customer/wishlist/get.js +2 -3
  196. package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +1 -2
  197. package/dist/runtime/server/api/customer/wishlist/updateWishList.js +2 -3
  198. package/dist/runtime/server/api/featured.d.ts +3 -0
  199. package/dist/runtime/server/api/featured.js +52 -0
  200. package/dist/runtime/server/api/generate/robots.get.d.ts +2 -0
  201. package/dist/runtime/server/api/generate/robots.get.js +20 -0
  202. package/dist/runtime/server/api/generate/sitemap.get.d.ts +2 -0
  203. package/dist/runtime/server/api/generate/sitemap.get.js +32 -0
  204. package/dist/runtime/server/api/location.d.ts +1 -1
  205. package/dist/runtime/server/api/location.js +24 -12
  206. package/dist/runtime/server/api/nav/[id]/links.d.ts +1 -0
  207. package/dist/runtime/server/api/nav/[id]/links.js +46 -10
  208. package/dist/runtime/server/api/page/[...slug].js +54 -0
  209. package/dist/runtime/server/api/product/[...slug].js +28 -13
  210. package/dist/runtime/server/api/quickview/[slug].d.ts +2 -0
  211. package/dist/runtime/server/api/quickview/[slug].js +21 -0
  212. package/dist/runtime/server/api/reviews.d.ts +2 -0
  213. package/dist/runtime/server/api/reviews.js +23 -0
  214. package/dist/runtime/server/api/samples.d.ts +3 -0
  215. package/dist/runtime/server/api/samples.js +53 -0
  216. package/dist/runtime/server/api/search.d.ts +3 -0
  217. package/dist/runtime/server/api/search.js +53 -0
  218. package/dist/runtime/server/api/service/[slug].js +22 -16
  219. package/dist/runtime/server/api/service/availability.d.ts +1 -1
  220. package/dist/runtime/server/api/service/availability.js +14 -12
  221. package/dist/runtime/server/api/service/getall.d.ts +3 -0
  222. package/dist/runtime/server/api/service/getall.js +57 -0
  223. package/dist/runtime/server/api/shop.d.ts +3 -0
  224. package/dist/runtime/server/api/shop.js +53 -0
  225. package/dist/runtime/server/api/subscribe.d.ts +1 -1
  226. package/dist/runtime/server/api/subscribe.js +23 -14
  227. package/dist/runtime/server/api/v2/[...slug].get.d.ts +2 -0
  228. package/dist/runtime/server/api/v2/[...slug].get.js +32 -0
  229. package/dist/runtime/server/api/webform.d.ts +3 -0
  230. package/dist/runtime/server/api/webform.js +54 -0
  231. package/dist/runtime/server/tsconfig.json +3 -3
  232. package/dist/runtime/stores/Cart.d.ts +12 -0
  233. package/dist/runtime/stores/Cart.js +62 -17
  234. package/dist/runtime/stores/Checkout.d.ts +9 -15
  235. package/dist/runtime/stores/Checkout.js +38 -45
  236. package/dist/runtime/stores/IpLocation.d.ts +95 -4
  237. package/dist/runtime/stores/IpLocation.js +93 -15
  238. package/dist/runtime/stores/Search.d.ts +1 -1
  239. package/dist/runtime/stores/Services.d.ts +5 -0
  240. package/dist/runtime/stores/Services.js +59 -8
  241. package/dist/runtime/stores/auth.d.ts +8 -11
  242. package/dist/runtime/stores/auth.js +385 -8
  243. package/dist/runtime/stores/countries.d.ts +1 -3
  244. package/dist/runtime/stores/countries.js +4 -8
  245. package/dist/runtime/stores/product/README.md +6 -6
  246. package/dist/runtime/stores/product/slug.d.ts +1 -17
  247. package/dist/runtime/stores/webforms.d.ts +24 -9
  248. package/dist/runtime/stores/webforms.js +105 -5
  249. package/dist/runtime/stores/wishlists.d.ts +125 -8
  250. package/dist/runtime/stores/wishlists.js +212 -20
  251. package/dist/runtime/utils/api.js +7 -13
  252. package/dist/runtime/utils/htmlCache.d.ts +2 -2
  253. package/dist/runtime/utils/htmlCache.js +23 -13
  254. package/dist/types.d.mts +6 -2
  255. package/package.json +16 -5
  256. package/dist/runtime/composables/Checkout/useBillingAddress.d.ts +0 -19
  257. package/dist/runtime/composables/Checkout/useBillingAddress.js +0 -82
  258. package/dist/runtime/composables/Checkout/useShippingAddress.d.ts +0 -9
  259. package/dist/runtime/composables/Checkout/useShippingAddress.js +0 -121
  260. package/dist/runtime/composables/useAuth.d.ts +0 -45
  261. package/dist/runtime/composables/useAuth.js +0 -180
  262. package/dist/runtime/composables/useCountries.d.ts +0 -12
  263. package/dist/runtime/composables/useCountries.js +0 -50
  264. package/dist/runtime/composables/useOrders.d.ts +0 -21
  265. package/dist/runtime/composables/useOrders.js +0 -82
  266. package/dist/runtime/composables/useQuotations.d.ts +0 -14
  267. package/dist/runtime/composables/useQuotations.js +0 -50
  268. package/dist/runtime/server/api/blog/[slug].js +0 -51
  269. package/dist/runtime/server/api/blog/blog.js +0 -17
  270. package/dist/runtime/server/api/brand/[slug].js +0 -58
  271. package/dist/runtime/server/api/page/[slug].js +0 -51
  272. package/dist/runtime/server/api/v2/[...slug].js +0 -9
  273. /package/dist/runtime/server/api/brand/{[slug].d.ts → [...slug].d.ts} +0 -0
  274. /package/dist/runtime/server/api/{blog/[slug].d.ts → cmspost/[...slug].d.ts} +0 -0
  275. /package/dist/runtime/server/api/page/{[slug].d.ts → [...slug].d.ts} +0 -0
@@ -1,28 +1,145 @@
1
1
  export interface Wishlist {
2
2
  id: number;
3
- name?: string;
3
+ title: string;
4
+ default: boolean;
5
+ created_at: string;
4
6
  }
5
7
  export interface WishlistProduct {
6
8
  id: number;
7
- productSlug: string;
9
+ slug: string;
10
+ item_id: string;
11
+ name: string;
12
+ image: string;
13
+ price: string;
14
+ pricefloat: number;
15
+ rp: string;
16
+ rpfloat: number;
17
+ type: string;
18
+ brandimage: string;
19
+ options?: any;
8
20
  }
9
21
  export interface WishlistProducts {
10
22
  [listId: number]: WishlistProduct[];
11
23
  }
24
+ export interface CreateWishlistData {
25
+ title: string;
26
+ default: boolean;
27
+ }
28
+ export interface UpdateWishlistData {
29
+ title: string;
30
+ default: boolean;
31
+ }
32
+ export interface AddToWishlistData {
33
+ }
34
+ export interface ApiResponse<T> {
35
+ status: string;
36
+ message: string | Record<string, string[]> | null;
37
+ data: T | null;
38
+ }
12
39
  export declare const useWishlistsStore: import("pinia").StoreDefinition<"wishlists", {
13
40
  wishlists: Wishlist[];
14
41
  wishlistProducts: WishlistProducts;
15
42
  loading: boolean;
16
43
  error: string | null;
17
- }, {}, {
44
+ productVersions: Record<number, number>;
45
+ }, {
46
+ getWishlists: (state: {
47
+ wishlists: {
48
+ id: number;
49
+ title: string;
50
+ default: boolean;
51
+ created_at: string;
52
+ }[];
53
+ wishlistProducts: WishlistProducts;
54
+ loading: boolean;
55
+ error: string | null;
56
+ productVersions: Record<number, number>;
57
+ } & import("pinia").PiniaCustomStateProperties<{
58
+ wishlists: Wishlist[];
59
+ wishlistProducts: WishlistProducts;
60
+ loading: boolean;
61
+ error: string | null;
62
+ productVersions: Record<number, number>;
63
+ }>) => {
64
+ id: number;
65
+ title: string;
66
+ default: boolean;
67
+ created_at: string;
68
+ }[];
69
+ getWishlistProducts: (state: {
70
+ wishlists: {
71
+ id: number;
72
+ title: string;
73
+ default: boolean;
74
+ created_at: string;
75
+ }[];
76
+ wishlistProducts: WishlistProducts;
77
+ loading: boolean;
78
+ error: string | null;
79
+ productVersions: Record<number, number>;
80
+ } & import("pinia").PiniaCustomStateProperties<{
81
+ wishlists: Wishlist[];
82
+ wishlistProducts: WishlistProducts;
83
+ loading: boolean;
84
+ error: string | null;
85
+ productVersions: Record<number, number>;
86
+ }>) => (listId: number) => WishlistProduct[];
87
+ isLoading: (state: {
88
+ wishlists: {
89
+ id: number;
90
+ title: string;
91
+ default: boolean;
92
+ created_at: string;
93
+ }[];
94
+ wishlistProducts: WishlistProducts;
95
+ loading: boolean;
96
+ error: string | null;
97
+ productVersions: Record<number, number>;
98
+ } & import("pinia").PiniaCustomStateProperties<{
99
+ wishlists: Wishlist[];
100
+ wishlistProducts: WishlistProducts;
101
+ loading: boolean;
102
+ error: string | null;
103
+ productVersions: Record<number, number>;
104
+ }>) => boolean;
105
+ getError: (state: {
106
+ wishlists: {
107
+ id: number;
108
+ title: string;
109
+ default: boolean;
110
+ created_at: string;
111
+ }[];
112
+ wishlistProducts: WishlistProducts;
113
+ loading: boolean;
114
+ error: string | null;
115
+ productVersions: Record<number, number>;
116
+ } & import("pinia").PiniaCustomStateProperties<{
117
+ wishlists: Wishlist[];
118
+ wishlistProducts: WishlistProducts;
119
+ loading: boolean;
120
+ error: string | null;
121
+ productVersions: Record<number, number>;
122
+ }>) => string | null;
123
+ }, {
124
+ setLoading(loading: boolean): void;
125
+ setError(error: string | null): void;
18
126
  setWishlists(wishlists: Wishlist[]): void;
19
127
  addWishlist(wishlist: Wishlist): void;
20
- updateWishlist(updatedWishlist: Wishlist): void;
21
- removeWishlist(id: number): void;
128
+ removeWishlist(wishlistId: number): void;
22
129
  setWishlistProducts(listId: number, products: WishlistProduct[]): void;
23
130
  addWishlistProduct(listId: number, product: WishlistProduct): void;
24
- removeWishlistProduct(listId: number, productSlug: string): void;
25
131
  clearWishlistProducts(listId: number): void;
26
- setLoading(loading: boolean): void;
27
- setError(error: string | null): void;
132
+ fetchWishlists(force?: boolean): Promise<ApiResponse<Wishlist[]>>;
133
+ fetchWishlistProducts(listId: number): Promise<ApiResponse<{
134
+ id: number;
135
+ title: string;
136
+ default: boolean;
137
+ created_at: string;
138
+ products: WishlistProduct[];
139
+ }>>;
140
+ createWishlist(data: CreateWishlistData): Promise<ApiResponse<Wishlist>>;
141
+ addToWishlist(listId: number, productSlug: string, data?: AddToWishlistData): Promise<ApiResponse<WishlistProduct>>;
142
+ removeFromWishlist(listId: number, itemId: string): Promise<ApiResponse<void>>;
143
+ updateWishlist(id: number, data: UpdateWishlistData): Promise<ApiResponse<Wishlist>>;
144
+ deleteWishlist(id: number): Promise<ApiResponse<void>>;
28
145
  }>;
@@ -1,49 +1,241 @@
1
1
  import { defineStore } from "pinia";
2
+ import { flowrixApi } from "../middleware/flowrix.js";
3
+ import { useRuntimeConfig } from "#imports";
2
4
  export const useWishlistsStore = defineStore("wishlists", {
3
5
  state: () => ({
4
6
  wishlists: [],
5
7
  wishlistProducts: {},
6
8
  loading: false,
7
- error: null
9
+ error: null,
10
+ productVersions: {}
8
11
  }),
9
12
  actions: {
13
+ setLoading(loading) {
14
+ this.loading = loading;
15
+ },
16
+ setError(error) {
17
+ this.error = error;
18
+ },
10
19
  setWishlists(wishlists) {
11
20
  this.wishlists = wishlists;
12
21
  },
13
22
  addWishlist(wishlist) {
14
- this.wishlists.unshift(wishlist);
15
- },
16
- updateWishlist(updatedWishlist) {
17
- const index = this.wishlists.findIndex((w) => w.id === updatedWishlist.id);
18
- if (index !== -1) {
19
- this.wishlists[index] = updatedWishlist;
20
- }
23
+ this.wishlists.push(wishlist);
21
24
  },
22
- removeWishlist(id) {
23
- this.wishlists = this.wishlists.filter((w) => w.id !== id);
25
+ removeWishlist(wishlistId) {
26
+ this.wishlists = this.wishlists.filter((w) => w.id !== wishlistId);
27
+ delete this.productVersions[wishlistId];
24
28
  },
25
29
  setWishlistProducts(listId, products) {
26
30
  this.wishlistProducts[listId] = products;
31
+ this.productVersions[listId] = (this.productVersions[listId] || 0) + 1;
27
32
  },
28
33
  addWishlistProduct(listId, product) {
29
34
  if (!this.wishlistProducts[listId]) {
30
35
  this.wishlistProducts[listId] = [];
31
36
  }
32
- this.wishlistProducts[listId].unshift(product);
33
- },
34
- removeWishlistProduct(listId, productSlug) {
35
- if (this.wishlistProducts[listId]) {
36
- this.wishlistProducts[listId] = this.wishlistProducts[listId].filter((p) => p.productSlug !== productSlug);
37
- }
37
+ this.wishlistProducts[listId].push(product);
38
+ this.productVersions[listId] = (this.productVersions[listId] || 0) + 1;
38
39
  },
39
40
  clearWishlistProducts(listId) {
40
41
  delete this.wishlistProducts[listId];
42
+ delete this.productVersions[listId];
41
43
  },
42
- setLoading(loading) {
43
- this.loading = loading;
44
+ // Fetch all wishlists
45
+ async fetchWishlists(force = false) {
46
+ if (!force && this.wishlists.length > 0) {
47
+ return {
48
+ status: "Success",
49
+ data: this.wishlists,
50
+ message: null
51
+ };
52
+ }
53
+ try {
54
+ const config = useRuntimeConfig();
55
+ let rawCookies = "";
56
+ if (process.client) {
57
+ rawCookies = document.cookie || "";
58
+ }
59
+ const apiConfig = {
60
+ ...config,
61
+ cookies: rawCookies
62
+ };
63
+ const apiUrl = "mystore/customer/wishlist";
64
+ const response = await flowrixApi.get(apiUrl, apiConfig, {});
65
+ if (response.status === "Success") {
66
+ this.setWishlists(response.data || []);
67
+ return response;
68
+ } else {
69
+ return response;
70
+ }
71
+ } catch (error) {
72
+ return error.data;
73
+ }
44
74
  },
45
- setError(error) {
46
- this.error = error;
75
+ async fetchWishlistProducts(listId) {
76
+ try {
77
+ const config = useRuntimeConfig();
78
+ let rawCookies = "";
79
+ if (process.client) {
80
+ rawCookies = document.cookie || "";
81
+ }
82
+ const apiConfig = {
83
+ ...config,
84
+ cookies: rawCookies
85
+ };
86
+ const apiUrl = `mystore/customer/wishlist/${listId}/products`;
87
+ const response = await flowrixApi.get(apiUrl, apiConfig, {});
88
+ if (response.status === "Success" && response.data) {
89
+ const products = response.data.products || [];
90
+ this.setWishlistProducts(listId, products);
91
+ return response;
92
+ } else {
93
+ return response;
94
+ }
95
+ } catch (error) {
96
+ console.error("[Store] Error fetching wishlist products:", error);
97
+ return error.data;
98
+ }
99
+ },
100
+ // Create a new wishlist
101
+ async createWishlist(data) {
102
+ try {
103
+ const config = useRuntimeConfig();
104
+ let rawCookies = "";
105
+ if (process.client) {
106
+ rawCookies = document.cookie || "";
107
+ }
108
+ const apiConfig = {
109
+ ...config,
110
+ cookies: rawCookies
111
+ };
112
+ const apiUrl = "mystore/customer/wishlist/add";
113
+ const response = await flowrixApi.post(apiUrl, apiConfig, {
114
+ body: data
115
+ });
116
+ if (response.status === "Success") {
117
+ await this.fetchWishlists(true);
118
+ return response;
119
+ } else {
120
+ return response;
121
+ }
122
+ } catch (error) {
123
+ return error.data;
124
+ }
125
+ },
126
+ // Add product to wishlist
127
+ async addToWishlist(listId, productSlug, data = {}) {
128
+ try {
129
+ const config = useRuntimeConfig();
130
+ let rawCookies = "";
131
+ if (process.client) {
132
+ rawCookies = document.cookie || "";
133
+ }
134
+ const apiConfig = {
135
+ ...config,
136
+ cookies: rawCookies
137
+ };
138
+ const apiUrl = `mystore/customer/wishlist/${listId}/${productSlug}/add`;
139
+ const response = await flowrixApi.post(apiUrl, apiConfig, {
140
+ body: data
141
+ });
142
+ if (response.status === "Success" && response.data) {
143
+ this.addWishlistProduct(listId, response.data);
144
+ return response;
145
+ } else {
146
+ return response;
147
+ }
148
+ } catch (error) {
149
+ return error.data;
150
+ }
151
+ },
152
+ async removeFromWishlist(listId, itemId) {
153
+ try {
154
+ const config = useRuntimeConfig();
155
+ let rawCookies = "";
156
+ if (process.client) {
157
+ rawCookies = document.cookie || "";
158
+ }
159
+ const apiConfig = {
160
+ ...config,
161
+ cookies: rawCookies
162
+ };
163
+ const apiUrl = `mystore/customer/wishlist/${listId}/item/delete`;
164
+ const response = await flowrixApi.post(apiUrl, apiConfig, {
165
+ body: { ids: { productSlug: itemId } }
166
+ });
167
+ console.log("[Store] Remove API response:", response.status);
168
+ if (response.status === "Success") {
169
+ return response;
170
+ } else {
171
+ return response;
172
+ }
173
+ } catch (error) {
174
+ console.error("[Store] Error in removeFromWishlist:", error);
175
+ return error.data;
176
+ }
177
+ },
178
+ // Update wishlist
179
+ async updateWishlist(id, data) {
180
+ try {
181
+ const config = useRuntimeConfig();
182
+ let rawCookies = "";
183
+ if (process.client) {
184
+ rawCookies = document.cookie || "";
185
+ }
186
+ const apiConfig = {
187
+ ...config,
188
+ cookies: rawCookies
189
+ };
190
+ const apiUrl = `mystore/customer/wishlist/${id}/update`;
191
+ const response = await flowrixApi.post(apiUrl, apiConfig, {
192
+ body: data
193
+ });
194
+ if (response.status === "Success") {
195
+ await this.fetchWishlists(true);
196
+ return response;
197
+ } else {
198
+ return response;
199
+ }
200
+ } catch (error) {
201
+ return error.data;
202
+ }
203
+ },
204
+ // Delete wishlist
205
+ async deleteWishlist(id) {
206
+ try {
207
+ const config = useRuntimeConfig();
208
+ let rawCookies = "";
209
+ if (process.client) {
210
+ rawCookies = document.cookie || "";
211
+ }
212
+ const apiConfig = {
213
+ ...config,
214
+ cookies: rawCookies
215
+ };
216
+ const apiUrl = `mystore/customer/wishlist/${id}/delete`;
217
+ const response = await flowrixApi.post(apiUrl, apiConfig, {
218
+ body: {}
219
+ });
220
+ if (response.status === "Success") {
221
+ this.removeWishlist(id);
222
+ this.clearWishlistProducts(id);
223
+ return response;
224
+ } else {
225
+ return response;
226
+ }
227
+ } catch (error) {
228
+ return error.data;
229
+ }
47
230
  }
231
+ },
232
+ getters: {
233
+ getWishlists: (state) => state.wishlists,
234
+ getWishlistProducts: (state) => (listId) => {
235
+ const version = state.productVersions[listId] || 0;
236
+ return state.wishlistProducts[listId] || [];
237
+ },
238
+ isLoading: (state) => state.loading,
239
+ getError: (state) => state.error
48
240
  }
49
241
  });
@@ -1,3 +1,5 @@
1
+ import { useRuntimeConfig } from "nuxt/app";
2
+ import { useCookie } from "nuxt/app";
1
3
  import { useAuthStore } from "../stores/auth.js";
2
4
  function getLocationHeaders() {
3
5
  const headers = {};
@@ -32,26 +34,18 @@ function getLocationHeaders() {
32
34
  }
33
35
  return headers;
34
36
  }
35
- function getEnv(key) {
36
- if (typeof useRuntimeConfig === "function") {
37
- const config = useRuntimeConfig();
38
- return config.public?.[key] || config[key];
39
- }
40
- return process.env[key];
41
- }
42
37
  export function useApi() {
43
38
  const authStore = useAuthStore();
44
- const FLOWRIX_API_KEY = getEnv("FLOWRIX_API_KEY");
45
- const FLOWRIX_API_SECRET = getEnv("FLOWRIX_API_SECRET");
46
- const FLOWRIX_API_ORIGIN = getEnv("FLOWRIX_API_ORIGIN");
47
- const FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE");
39
+ const config = useRuntimeConfig();
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;
48
43
  const baseURL = FLOWRIX_API_BASE || "";
49
44
  async function request(method, url, data = null, options = {}, extraHeaders = {}) {
50
45
  const locationHeaders = getLocationHeaders();
51
46
  const headers = {
52
47
  "Content-Type": "application/json",
53
- "X-API-Key": FLOWRIX_API_KEY,
54
- "X-API-Secret": FLOWRIX_API_SECRET,
48
+ "x-public-key": FLOWRIX_API_KEY,
55
49
  // Add location headers from cookies
56
50
  ...locationHeaders,
57
51
  // Add extra headers
@@ -1,5 +1,5 @@
1
- export declare function readCache(pathname: string): Promise<string | null>;
2
- export declare function writeCache(pathname: string, html: string): Promise<void>;
1
+ export declare function readCache(url: URL, customerType: number): Promise<string | null>;
2
+ export declare function writeCache(url: URL, html: string, customerType: number): Promise<void>;
3
3
  export declare function clearCache(): Promise<void>;
4
4
  declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | undefined>>;
5
5
  export default _default;
@@ -1,27 +1,34 @@
1
1
  import { promises as fs } from "fs";
2
2
  import { join } from "path";
3
- import { getRequestURL } from "h3";
4
- import { defineEventHandler } from "h3";
5
- const cacheDir = join(process.cwd(), ".nuxt", "cache", "html");
3
+ import { getRequestURL, defineEventHandler, getCookie } from "h3";
4
+ import { useRuntimeConfig } from "#imports";
5
+ const cacheDir = join("/tmp", ".cache", "html");
6
6
  async function ensureDir() {
7
7
  await fs.mkdir(cacheDir, { recursive: true });
8
8
  }
9
- function getCacheFilePath(pathname) {
10
- const safeName = pathname.replace(/[^a-zA-Z0-9-_]/g, "_") || "index";
11
- return join(cacheDir, `${safeName}-__.html`);
9
+ function getCacheFilePath(url, customerType) {
10
+ const { pathname, searchParams } = url;
11
+ const queryObj = {};
12
+ for (const [key, value] of searchParams.entries()) {
13
+ queryObj[key] = value;
14
+ }
15
+ const queryString = Object.keys(queryObj).length ? `_${JSON.stringify(queryObj)}` : "";
16
+ const cacheKey = `${pathname}${queryString}`;
17
+ const safeName = cacheKey.replace(/[^a-zA-Z0-9-_]/g, "_") || "index";
18
+ return join(cacheDir, `${safeName}-__-${customerType}.html`);
12
19
  }
13
- export async function readCache(pathname) {
20
+ export async function readCache(url, customerType) {
14
21
  try {
15
- const filePath = getCacheFilePath(pathname);
22
+ const filePath = getCacheFilePath(url, customerType);
16
23
  const html = await fs.readFile(filePath, "utf8");
17
24
  return html;
18
25
  } catch {
19
26
  return null;
20
27
  }
21
28
  }
22
- export async function writeCache(pathname, html) {
29
+ export async function writeCache(url, html, customerType) {
23
30
  await ensureDir();
24
- const filePath = getCacheFilePath(pathname);
31
+ const filePath = getCacheFilePath(url, customerType);
25
32
  await fs.writeFile(filePath, html, "utf8");
26
33
  }
27
34
  export async function clearCache() {
@@ -33,9 +40,10 @@ export async function clearCache() {
33
40
  }
34
41
  export default defineEventHandler(async (event) => {
35
42
  const url = getRequestURL(event);
36
- const pathname = url.pathname;
43
+ const config = useRuntimeConfig();
44
+ const customerType = getCookie(event, "customertype") || 1;
37
45
  if (event.method !== "GET" || !event.headers.get("accept")?.includes("text/html")) return;
38
- const cached = await readCache(pathname);
46
+ const cached = await readCache(url, customerType);
39
47
  if (cached) {
40
48
  event.node.res.setHeader("x-cache", "HIT");
41
49
  return cached;
@@ -46,7 +54,9 @@ export default defineEventHandler(async (event) => {
46
54
  if (chunk) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
47
55
  const html = Buffer.concat(chunks).toString("utf-8");
48
56
  if (event.node.res.statusCode === 200 && html.includes("<!DOCTYPE html>")) {
49
- writeCache(pathname, html);
57
+ if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
58
+ writeCache(url, html, customerType);
59
+ }
50
60
  }
51
61
  return originalEnd.apply(this, arguments);
52
62
  };
package/dist/types.d.mts CHANGED
@@ -1,3 +1,7 @@
1
- export { default } from './module.mjs'
1
+ import type { NuxtModule } from '@nuxt/schema'
2
+
3
+ import type { default as Module } from './module.mjs'
2
4
 
3
- export { type ModuleOptions } from './module.mjs'
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
+
7
+ export { default } from './module.mjs'
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "flowrix",
3
- "version": "1.0.1-beta.14",
4
- "description": "lug-and-play Nuxt eCommerce cart powered by FLOWRiX. Subscription required.",
3
+ "version": "1.0.1-beta.141",
4
+ "description": "Plug-and-play Nuxt eCommerce cart powered by FLOWRiX. Subscription required.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {
9
9
  "types": "./dist/types.d.mts",
10
10
  "import": "./dist/module.mjs"
11
+ },
12
+ "./composables": {
13
+ "types": "./dist/runtime/composables/index.d.ts",
14
+ "import": "./dist/runtime/composables/index.js"
11
15
  }
12
16
  },
13
17
  "main": "./dist/module.mjs",
@@ -15,12 +19,14 @@
15
19
  "*": {
16
20
  ".": [
17
21
  "./dist/types.d.mts"
22
+ ],
23
+ "composables": [
24
+ "./dist/runtime/composables/index.d.ts"
18
25
  ]
19
26
  }
20
27
  },
21
28
  "files": [
22
- "dist",
23
- "runtime/stores"
29
+ "dist"
24
30
  ],
25
31
  "scripts": {
26
32
  "prepack": "nuxt-module-build build",
@@ -37,19 +43,24 @@
37
43
  "@nuxt/kit": "4.2.0",
38
44
  "@pinia/nuxt": "0.7.0",
39
45
  "@stripe/stripe-js": "8.2.0",
46
+ "@vueuse/nuxt": "14.0.0",
47
+ "defu": "^6.1.4",
48
+ "nuxt-swiper": "2.0.1",
49
+ "nuxt-toast": "1.4.0",
40
50
  "pinia": "2.3.1",
41
51
  "pinia-plugin-persistedstate": "3.2.3"
42
52
  },
43
53
  "devDependencies": {
44
54
  "@nuxt/devtools": "2.6.5",
45
55
  "@nuxt/eslint-config": "1.9.0",
46
- "@nuxt/module-builder": "1.0.2",
56
+ "@nuxt/module-builder": "^1.0.2",
47
57
  "@nuxt/schema": "4.2.0",
48
58
  "@nuxt/test-utils": "3.19.2",
49
59
  "@types/node": "24.9.1",
50
60
  "changelogen": "0.6.2",
51
61
  "eslint": "9.38.0",
52
62
  "nuxt": "4.2.0",
63
+ "sass": "^1.94.2",
53
64
  "typescript": "5.9.3",
54
65
  "vitest": "3.2.4",
55
66
  "vue-tsc": "3.1.1"
@@ -1,19 +0,0 @@
1
- export default function (inputData: any): {
2
- checkoutStore: any;
3
- passwordShow: import("vue").Ref<string, string>;
4
- password: import("vue").Ref<string, string>;
5
- password_confirmationShow: import("vue").Ref<string, string>;
6
- updateBillingAddress: (billingfield: any) => void;
7
- UserAccount: import("vue").Ref<boolean, boolean>;
8
- CheckUserAccount: (billingDetails: any, userEmail: string) => Promise<void>;
9
- CheckingUserAccount: import("vue").Ref<boolean, boolean>;
10
- passwordStrength: any;
11
- passwordStrengthClass: any;
12
- passwordStrengthValue: any;
13
- passwordStrengthWidth: any;
14
- passwordStrengthTextColor: any;
15
- UpdateStripe: (inputData: any) => Promise<void>;
16
- Countries: import("vue").Ref<never[], never[]>;
17
- ChangeCountry: (billingfield: any) => Promise<void>;
18
- States: import("vue").Ref<never[], never[]>;
19
- };