flowrix 1.0.1-beta.10 → 1.0.1-beta.101

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 (239) hide show
  1. package/dist/module.d.mts +1 -6
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +104 -29
  4. package/dist/runtime/composables/Blog/useBlogIndex.d.ts +2 -5
  5. package/dist/runtime/composables/Brand/brand.js +2 -0
  6. package/dist/runtime/composables/Cart/useCart.d.ts +40 -0
  7. package/dist/runtime/composables/Cart/useCart.js +10 -0
  8. package/dist/runtime/composables/Cart/useCartDetail.d.ts +15 -5
  9. package/dist/runtime/composables/Cart/useCartDetail.js +3 -0
  10. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +40 -1
  11. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +2 -2
  12. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +40 -1
  13. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +2 -2
  14. package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +3 -14
  15. package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +2 -2
  16. package/dist/runtime/composables/Checkout/useCheckout.d.ts +84 -73
  17. package/dist/runtime/composables/Checkout/useCheckout.js +81 -34
  18. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.d.ts +43 -0
  19. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.js +84 -0
  20. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.d.ts +55 -0
  21. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.js +196 -0
  22. package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +7 -7
  23. package/dist/runtime/composables/Checkout/useCreateAccount.js +3 -1
  24. package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +2 -2
  25. package/dist/runtime/composables/Checkout/useDeliveryMethod.js +14 -7
  26. package/dist/runtime/composables/Customer/useBillingAddress.d.ts +112 -0
  27. package/dist/runtime/composables/Customer/useBillingAddress.js +93 -0
  28. package/dist/runtime/composables/Customer/useLogin.d.ts +9 -0
  29. package/dist/runtime/composables/Customer/useLogin.js +34 -0
  30. package/dist/runtime/composables/Customer/useOrders.d.ts +29 -0
  31. package/dist/runtime/composables/Customer/useOrders.js +56 -0
  32. package/dist/runtime/composables/Customer/usePasswordReset.d.ts +26 -0
  33. package/dist/runtime/composables/Customer/usePasswordReset.js +258 -0
  34. package/dist/runtime/composables/Customer/useProfile.d.ts +75 -0
  35. package/dist/runtime/composables/Customer/useProfile.js +106 -0
  36. package/dist/runtime/composables/Customer/useQuotations.d.ts +32 -0
  37. package/dist/runtime/composables/Customer/useQuotations.js +40 -0
  38. package/dist/runtime/composables/Customer/useRegister.d.ts +120 -11
  39. package/dist/runtime/composables/Customer/useRegister.js +311 -34
  40. package/dist/runtime/composables/Customer/useShippingAddress.d.ts +121 -0
  41. package/dist/runtime/composables/Customer/useShippingAddress.js +145 -0
  42. package/dist/runtime/composables/Customer/useUpdatePassword.d.ts +21 -0
  43. package/dist/runtime/composables/Customer/useUpdatePassword.js +94 -0
  44. package/dist/runtime/composables/Customer/useUserCards.d.ts +22 -0
  45. package/dist/runtime/composables/Customer/useUserCards.js +65 -0
  46. package/dist/runtime/composables/{useWishlists.d.ts → Customer/useWishlists.d.ts} +6 -19
  47. package/dist/runtime/composables/{useWishlists.js → Customer/useWishlists.js} +21 -29
  48. package/dist/runtime/composables/Extras/useCountry.d.ts +11 -6
  49. package/dist/runtime/composables/Extras/useCountry.js +5 -4
  50. package/dist/runtime/composables/Header/useHeader.d.ts +6 -20
  51. package/dist/runtime/composables/Header/useHeader.js +3 -2
  52. package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +4 -5
  53. package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +1 -1
  54. package/dist/runtime/composables/Product/useProductComponent.js +2 -0
  55. package/dist/runtime/composables/Product/useProductSlug.d.ts +8 -1
  56. package/dist/runtime/composables/Product/useQuickView.d.ts +8 -0
  57. package/dist/runtime/composables/Product/useQuickView.js +27 -0
  58. package/dist/runtime/composables/Product/useService.d.ts +1 -1
  59. package/dist/runtime/composables/Product/useService.js +0 -3
  60. package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +2 -2
  61. package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +2 -2
  62. package/dist/runtime/composables/index.d.ts +17 -12
  63. package/dist/runtime/composables/index.js +17 -12
  64. package/dist/runtime/composables/useAddresses.js +6 -6
  65. package/dist/runtime/composables/useApp.d.ts +1 -0
  66. package/dist/runtime/composables/useApp.js +24 -0
  67. package/dist/runtime/composables/useCards.js +2 -2
  68. package/dist/runtime/composables/useDataLayer.js +2 -1
  69. package/dist/runtime/composables/useDotDigital.d.ts +3 -0
  70. package/dist/runtime/composables/useDotDigital.js +122 -0
  71. package/dist/runtime/composables/useLocation.d.ts +2 -12
  72. package/dist/runtime/composables/useQuotationCheckout.d.ts +78 -0
  73. package/dist/runtime/composables/useQuotationCheckout.js +138 -0
  74. package/dist/runtime/middleware/flowrix.d.ts +5 -4
  75. package/dist/runtime/middleware/flowrix.js +40 -21
  76. package/dist/runtime/pages/flowrix-default.d.vue.ts +3 -0
  77. package/dist/runtime/pages/flowrix-default.vue +34 -0
  78. package/dist/runtime/pages/flowrix-default.vue.d.ts +3 -0
  79. package/dist/runtime/plugin.d.ts +1 -1
  80. package/dist/runtime/server/api/albums.d.ts +1 -0
  81. package/dist/runtime/server/api/albums.js +32 -9
  82. package/dist/runtime/server/api/auth/forgot.js +1 -2
  83. package/dist/runtime/server/api/auth/login.d.ts +7 -0
  84. package/dist/runtime/server/api/auth/login.js +4 -16
  85. package/dist/runtime/server/api/auth/logout.js +1 -2
  86. package/dist/runtime/server/api/auth/register.js +1 -2
  87. package/dist/runtime/server/api/auth/session.get.js +1 -3
  88. package/dist/runtime/server/api/auth/user/reset-password.js +1 -2
  89. package/dist/runtime/server/api/auth/user/session.js +1 -2
  90. package/dist/runtime/server/api/auth/user/verify-token.js +1 -2
  91. package/dist/runtime/server/api/banners.js +17 -17
  92. package/dist/runtime/server/api/brand/[...slug].js +52 -0
  93. package/dist/runtime/server/api/brand/index.d.ts +3 -0
  94. package/dist/runtime/server/api/brand/index.js +46 -0
  95. package/dist/runtime/server/api/cache/[...slug].delete.d.ts +5 -0
  96. package/dist/runtime/server/api/cache/[...slug].delete.js +37 -0
  97. package/dist/runtime/server/api/cache/clean.get.d.ts +10 -0
  98. package/dist/runtime/server/api/cache/clean.get.js +13 -0
  99. package/dist/runtime/server/api/cart/[slug]/add.d.ts +1 -1
  100. package/dist/runtime/server/api/cart/[slug]/add.js +11 -11
  101. package/dist/runtime/server/api/cart/[slug]/update.d.ts +1 -1
  102. package/dist/runtime/server/api/cart/[slug]/update.js +11 -11
  103. package/dist/runtime/server/api/{blog/blog.d.ts → cart/related.d.ts} +0 -1
  104. package/dist/runtime/server/api/cart/related.js +20 -0
  105. package/dist/runtime/server/api/cart/remove.js +1 -2
  106. package/dist/runtime/server/api/cart/service/[slug]/add.d.ts +1 -1
  107. package/dist/runtime/server/api/cart/service/[slug]/add.js +12 -12
  108. package/dist/runtime/server/api/catalog/brands.d.ts +3 -0
  109. package/dist/runtime/server/api/catalog/brands.js +46 -0
  110. package/dist/runtime/server/api/catalog/categories.js +23 -20
  111. package/dist/runtime/server/api/catalog/categoriesall.d.ts +3 -0
  112. package/dist/runtime/server/api/catalog/categoriesall.js +46 -0
  113. package/dist/runtime/server/api/catalog/featured.js +23 -18
  114. package/dist/runtime/server/api/catalog/posts.d.ts +3 -0
  115. package/dist/runtime/server/api/catalog/posts.js +46 -0
  116. package/dist/runtime/server/api/catalog/samples.js +23 -20
  117. package/dist/runtime/server/api/catalog/search.js +23 -20
  118. package/dist/runtime/server/api/category/[...slug].js +24 -21
  119. package/dist/runtime/server/api/checkout/applyCoupon.d.ts +1 -1
  120. package/dist/runtime/server/api/checkout/applyCoupon.js +13 -13
  121. package/dist/runtime/server/api/checkout/configs.d.ts +1 -1
  122. package/dist/runtime/server/api/checkout/configs.js +11 -11
  123. package/dist/runtime/server/api/checkout/countries.d.ts +1 -1
  124. package/dist/runtime/server/api/checkout/countries.js +5 -9
  125. package/dist/runtime/server/api/checkout/paymentmethod.d.ts +1 -1
  126. package/dist/runtime/server/api/checkout/paymentmethod.js +16 -11
  127. package/dist/runtime/server/api/checkout/quotation/[slug].d.ts +2 -0
  128. package/dist/runtime/server/api/checkout/quotation/[slug].js +20 -0
  129. package/dist/runtime/server/api/checkout/quotation/guest/[slug].d.ts +2 -0
  130. package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +35 -0
  131. package/dist/runtime/server/api/checkout/quotation/guest/customer.d.ts +2 -0
  132. package/dist/runtime/server/api/checkout/quotation/guest/customer.js +20 -0
  133. package/dist/runtime/server/api/checkout/quotation/submit/[slug].d.ts +2 -0
  134. package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +22 -0
  135. package/dist/runtime/server/api/checkvariables.d.ts +3 -0
  136. package/dist/runtime/server/api/checkvariables.js +35 -0
  137. package/dist/runtime/server/api/cmspost/[...slug].js +49 -0
  138. package/dist/runtime/server/api/cmspost/all.d.ts +3 -0
  139. package/dist/runtime/server/api/cmspost/all.js +46 -0
  140. package/dist/runtime/server/api/company/profile.d.ts +1 -1
  141. package/dist/runtime/server/api/company/profile.js +9 -9
  142. package/dist/runtime/server/api/contact-center/webforms/[id]/details.d.ts +1 -1
  143. package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +45 -15
  144. package/dist/runtime/server/api/contact-center/webforms/create.d.ts +1 -1
  145. package/dist/runtime/server/api/contact-center/webforms/create.js +10 -10
  146. package/dist/runtime/server/api/countries.d.ts +2 -0
  147. package/dist/runtime/server/api/countries.js +39 -0
  148. package/dist/runtime/server/api/customer/address/add.js +1 -2
  149. package/dist/runtime/server/api/customer/address/delete.js +2 -3
  150. package/dist/runtime/server/api/customer/address/setshipping.js +1 -2
  151. package/dist/runtime/server/api/customer/address/update.js +1 -2
  152. package/dist/runtime/server/api/customer/cards/delete.js +2 -3
  153. package/dist/runtime/server/api/customer/cards/get.js +2 -3
  154. package/dist/runtime/server/api/customer/change-password.js +2 -3
  155. package/dist/runtime/server/api/customer/checkout.js +1 -2
  156. package/dist/runtime/server/api/customer/orders.js +2 -3
  157. package/dist/runtime/server/api/customer/profile/update.js +1 -2
  158. package/dist/runtime/server/api/customer/quotations.js +2 -3
  159. package/dist/runtime/server/api/customer/search.js +1 -2
  160. package/dist/runtime/server/api/customer/tax-invoice.js +1 -2
  161. package/dist/runtime/server/api/customer/wishlist/add.js +1 -2
  162. package/dist/runtime/server/api/customer/wishlist/createWishList.js +1 -2
  163. package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +1 -2
  164. package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +1 -2
  165. package/dist/runtime/server/api/customer/wishlist/get.js +2 -3
  166. package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +1 -2
  167. package/dist/runtime/server/api/customer/wishlist/updateWishList.js +2 -3
  168. package/dist/runtime/server/api/featured.d.ts +3 -0
  169. package/dist/runtime/server/api/featured.js +46 -0
  170. package/dist/runtime/server/api/generate/robots.get.d.ts +2 -0
  171. package/dist/runtime/server/api/generate/robots.get.js +20 -0
  172. package/dist/runtime/server/api/generate/sitemap.get.d.ts +2 -0
  173. package/dist/runtime/server/api/generate/sitemap.get.js +32 -0
  174. package/dist/runtime/server/api/location.d.ts +1 -1
  175. package/dist/runtime/server/api/location.js +20 -12
  176. package/dist/runtime/server/api/nav/[id]/links.d.ts +1 -0
  177. package/dist/runtime/server/api/nav/[id]/links.js +43 -12
  178. package/dist/runtime/server/api/page/[...slug].js +49 -0
  179. package/dist/runtime/server/api/product/[...slug].js +25 -14
  180. package/dist/runtime/server/api/{v2/[...slug].d.ts → quickview/[slug].d.ts} +0 -1
  181. package/dist/runtime/server/api/quickview/[slug].js +17 -0
  182. package/dist/runtime/server/api/reviews.d.ts +2 -0
  183. package/dist/runtime/server/api/reviews.js +18 -0
  184. package/dist/runtime/server/api/samples.d.ts +3 -0
  185. package/dist/runtime/server/api/samples.js +47 -0
  186. package/dist/runtime/server/api/search.d.ts +3 -0
  187. package/dist/runtime/server/api/search.js +47 -0
  188. package/dist/runtime/server/api/service/[slug].js +19 -18
  189. package/dist/runtime/server/api/service/availability.d.ts +1 -1
  190. package/dist/runtime/server/api/service/availability.js +11 -13
  191. package/dist/runtime/server/api/service/getall.d.ts +3 -0
  192. package/dist/runtime/server/api/service/getall.js +52 -0
  193. package/dist/runtime/server/api/shop.d.ts +3 -0
  194. package/dist/runtime/server/api/shop.js +47 -0
  195. package/dist/runtime/server/api/subscribe.d.ts +1 -1
  196. package/dist/runtime/server/api/subscribe.js +19 -14
  197. package/dist/runtime/server/api/v2/[...slug].get.d.ts +2 -0
  198. package/dist/runtime/server/api/v2/[...slug].get.js +31 -0
  199. package/dist/runtime/server/api/webform.d.ts +3 -0
  200. package/dist/runtime/server/api/webform.js +49 -0
  201. package/dist/runtime/server/tsconfig.json +3 -3
  202. package/dist/runtime/stores/Cart.d.ts +12 -0
  203. package/dist/runtime/stores/Cart.js +56 -19
  204. package/dist/runtime/stores/Checkout.d.ts +9 -15
  205. package/dist/runtime/stores/Checkout.js +22 -40
  206. package/dist/runtime/stores/Search.d.ts +1 -1
  207. package/dist/runtime/stores/Services.js +2 -2
  208. package/dist/runtime/stores/auth.d.ts +8 -11
  209. package/dist/runtime/stores/auth.js +390 -8
  210. package/dist/runtime/stores/countries.d.ts +1 -3
  211. package/dist/runtime/stores/countries.js +4 -8
  212. package/dist/runtime/stores/product/slug.d.ts +1 -17
  213. package/dist/runtime/stores/wishlists.d.ts +114 -7
  214. package/dist/runtime/stores/wishlists.js +209 -15
  215. package/dist/runtime/utils/api.js +7 -13
  216. package/dist/runtime/utils/htmlCache.d.ts +2 -2
  217. package/dist/runtime/utils/htmlCache.js +23 -13
  218. package/dist/types.d.mts +6 -2
  219. package/package.json +30 -20
  220. package/dist/runtime/composables/Checkout/useBillingAddress.d.ts +0 -19
  221. package/dist/runtime/composables/Checkout/useBillingAddress.js +0 -82
  222. package/dist/runtime/composables/Checkout/useShippingAddress.d.ts +0 -9
  223. package/dist/runtime/composables/Checkout/useShippingAddress.js +0 -121
  224. package/dist/runtime/composables/useAuth.d.ts +0 -45
  225. package/dist/runtime/composables/useAuth.js +0 -180
  226. package/dist/runtime/composables/useCountries.d.ts +0 -12
  227. package/dist/runtime/composables/useCountries.js +0 -50
  228. package/dist/runtime/composables/useOrders.d.ts +0 -21
  229. package/dist/runtime/composables/useOrders.js +0 -82
  230. package/dist/runtime/composables/useQuotations.d.ts +0 -14
  231. package/dist/runtime/composables/useQuotations.js +0 -50
  232. package/dist/runtime/server/api/blog/[slug].js +0 -51
  233. package/dist/runtime/server/api/blog/blog.js +0 -17
  234. package/dist/runtime/server/api/brand/[slug].js +0 -58
  235. package/dist/runtime/server/api/page/[slug].js +0 -51
  236. package/dist/runtime/server/api/v2/[...slug].js +0 -9
  237. /package/dist/runtime/server/api/brand/{[slug].d.ts → [...slug].d.ts} +0 -0
  238. /package/dist/runtime/server/api/{blog/[slug].d.ts → cmspost/[...slug].d.ts} +0 -0
  239. /package/dist/runtime/server/api/page/{[slug].d.ts → [...slug].d.ts} +0 -0
@@ -10,14 +10,12 @@ export * from "./Cart/useCartDetail.js";
10
10
  export * from "./Category/useCategoryContent.js";
11
11
  export * from "./Category/useCategoryGrid.js";
12
12
  export * from "./Category/useCategoryIndex.js";
13
- export * from "./Category/useCategoryTemplate2";
14
- export * from "./Category/useCategoryTemplate3";
15
13
  export * from "./Category/useCategoryTop.js";
16
- export * from "./Checkout/useBillingAddress.js";
14
+ export * from "./Checkout/useCheckoutBillingAddress.js";
17
15
  export * from "./Checkout/useCheckout.js";
18
16
  export * from "./Checkout/useCreateAccount.js";
19
17
  export * from "./Checkout/useDeliveryMethod.js";
20
- export * from "./Checkout/useShippingAddress.js";
18
+ export * from "./Checkout/useCheckoutShippingAddress.js";
21
19
  export * from "./Checkout/PaymentMethods/useDirectDeposit.js";
22
20
  export * from "./Checkout/PaymentMethods/useEway.js";
23
21
  export * from "./Checkout/PaymentMethods/useFlowrixpay.js";
@@ -27,6 +25,16 @@ export * from "./Checkout/PaymentMethods/usePaypal.js";
27
25
  export * from "./Checkout/PaymentMethods/useStripe.js";
28
26
  export * from "./Checkout/PaymentMethods/useZippay.js";
29
27
  export * from "./Customer/useRegister.js";
28
+ export * from "./Customer/useLogin.js";
29
+ export * from "./Customer/useProfile.js";
30
+ export * from "./Customer/useOrders.js";
31
+ export * from "./Customer/useQuotations.js";
32
+ export * from "./Customer/useBillingAddress.js";
33
+ export * from "./Customer/useShippingAddress.js";
34
+ export * from "./Customer/useUpdatePassword.js";
35
+ export * from "./Customer/useUserCards.js";
36
+ export * from "./Customer/useWishlists.js";
37
+ export * from "./Customer/usePasswordReset.js";
30
38
  export * from "./Extras/useCountry.js";
31
39
  export * from "./Extras/useDateFormatter.js";
32
40
  export * from "./Extras/useNumberOnly.js";
@@ -55,20 +63,17 @@ export * from "./SideBar/useSideBar.js";
55
63
  export * from "./SideBar/Filters/useFilters.js";
56
64
  export * from "./SideBar/Filters/useSorting.js";
57
65
  export { useAddresses } from "./useAddresses.js";
66
+ export { useQuickView } from "./Product/useQuickView.js";
67
+ export { useSendQuickValues } from "./Product/useQuickView.js";
58
68
  export { useAddToCart } from "./useAddToCart.js";
59
- export { useAuth } from "./useAuth.js";
60
69
  export { useCards } from "./useCards.js";
61
70
  export { useClientApi } from "./useClientApi.js";
62
- export { useCountries } from "./useCountries.js";
63
- export { useDataLayer } from "./useDataLayer.js";
71
+ export { GTM_page_view, GTM_view_item, GTM_view_item_list, GTM_view_cart, GTM_add_to_cart, GTM_remove_from_cart, GTM_begin_checkout, GTM_add_shipping_info, GTM_add_payment_info, GTM_purchase, GTM_select_item_color, GTM_select_item_collection, GTM_Attribute_Content } from "./useDataLayer.js";
64
72
  export { useDynamicHtmlRenderer } from "./useDynamicHtmlRenderer.js";
65
73
  export { useLocation } from "./useLocation.js";
66
74
  export { useLocations } from "./useLocations.js";
67
- export { useMetaLayer } from "./useMetaLayer.js";
68
- export { useOrders } from "./useOrders.js";
69
- export { useQuotations } from "./useQuotations.js";
75
+ export { useQuotationCheckout } from "./useQuotationCheckout.js";
70
76
  export { useSearch } from "./useSearch.js";
71
77
  export { useSubscriptions } from "./useSubscriptions.js";
72
- export { useTikTokDatalayer } from "./useTikTokDatalayer.js";
73
78
  export { useWebforms } from "./useWebforms.js";
74
- export { useWishlists } from "./useWishlists.js";
79
+ export { useApp } from "./useApp.js";
@@ -1,6 +1,6 @@
1
1
  import { computed } from "vue";
2
2
  import { useAddressesStore } from "../stores/addresses.js";
3
- import { useAuth } from "./useAuth.js";
3
+ import { useAuthStore } from "../stores/auth.js";
4
4
  import { useApi } from "../utils/api.js";
5
5
  function formatErrorMessage(message) {
6
6
  if (!message) return "An error occurred";
@@ -19,14 +19,14 @@ function formatErrorMessage(message) {
19
19
  }
20
20
  export function useAddresses() {
21
21
  const store = useAddressesStore();
22
- const { fetchProfile } = useAuth();
22
+ const { fetchProfile } = useAuthStore();
23
23
  const { post, patch, delete: deleteRequest } = useApi();
24
24
  async function addAddress(userData) {
25
25
  store.setLoading(true);
26
26
  store.setError(null);
27
27
  try {
28
28
  userData.shipping = 1;
29
- const response = await post("/customer/address/add", userData);
29
+ const response = await post("/mystore/customer/address/add", userData);
30
30
  if (response.status === "Success" && response.data) {
31
31
  await fetchProfile();
32
32
  return response;
@@ -48,7 +48,7 @@ export function useAddresses() {
48
48
  store.setLoading(true);
49
49
  store.setError(null);
50
50
  try {
51
- const response = await patch(`/customer/address/${userData.id}/update`, userData);
51
+ const response = await patch(`/mystore/customer/address/${userData.id}/update`, userData);
52
52
  if (response.status === "Success" && response.data) {
53
53
  await fetchProfile();
54
54
  return response;
@@ -70,7 +70,7 @@ export function useAddresses() {
70
70
  store.setLoading(true);
71
71
  store.setError(null);
72
72
  try {
73
- const response = await patch(`/customer/address/${id}/delete`, {});
73
+ const response = await patch(`/mystore/customer/address/${id}/delete`, {});
74
74
  if (response.status === "Success") {
75
75
  await fetchProfile();
76
76
  return response;
@@ -92,7 +92,7 @@ export function useAddresses() {
92
92
  store.setLoading(true);
93
93
  store.setError(null);
94
94
  try {
95
- const response = await post(`/customer/address/${addressId}/setshipping`, {});
95
+ const response = await post(`/mystore/customer/address/${addressId}/setshipping`, {});
96
96
  if (response.status === "Success") {
97
97
  await fetchProfile();
98
98
  return response;
@@ -0,0 +1 @@
1
+ export declare const useApp: () => {};
@@ -0,0 +1,24 @@
1
+ import { useHead } from "#imports";
2
+ import { useCompanyProfile } from "../stores/useCompanyProfile.js";
3
+ export const useApp = () => {
4
+ const companyProfile = useCompanyProfile();
5
+ const gtmId = companyProfile.profile?.data?.integrations["google-tag-manager"]["script"] || "";
6
+ const tiktok = companyProfile.profile?.data?.integrations["tiktok"]["script"] || "";
7
+ useHead({
8
+ script: [
9
+ {
10
+ children: `
11
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
12
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
13
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
14
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
15
+ })(window,document,'script','dataLayer','${gtmId}');
16
+ `
17
+ },
18
+ {
19
+ children: `${tiktok}`
20
+ }
21
+ ]
22
+ });
23
+ return {};
24
+ };
@@ -23,7 +23,7 @@ export function useCards() {
23
23
  store.setLoading(true);
24
24
  store.setError(null);
25
25
  try {
26
- const response = await get("/customer/cards");
26
+ const response = await get("/mystore/customer/cards");
27
27
  if (response.status === "Success" && response.data) {
28
28
  store.setCards(response.data.data);
29
29
  return response;
@@ -45,7 +45,7 @@ export function useCards() {
45
45
  store.setLoading(true);
46
46
  store.setError(null);
47
47
  try {
48
- const response = await del(`/customer/cards/${cardId}`);
48
+ const response = await del(`/mystore/customer/cards/${cardId}`);
49
49
  if (response.status === "Success") {
50
50
  store.removeCard(cardId);
51
51
  return response;
@@ -9,7 +9,7 @@ const getDataLayer = () => {
9
9
  };
10
10
  const getCurrencyCode = () => {
11
11
  const companyProfile = useCompanyProfile();
12
- return companyProfile.profile?.currencyCode || "USD";
12
+ return companyProfile.profile?.data?.currencyCode || "USD";
13
13
  };
14
14
  export function GTM_page_view(to) {
15
15
  const dataLayer = getDataLayer();
@@ -112,6 +112,7 @@ export function GTM_view_cart(cart = null) {
112
112
  });
113
113
  }
114
114
  export function GTM_add_to_cart(lastitem = null) {
115
+ console.log(lastitem);
115
116
  const dataLayer = getDataLayer();
116
117
  if (!dataLayer || !lastitem) return;
117
118
  let price = lastitem.pricefloat;
@@ -0,0 +1,3 @@
1
+ export declare function addtodotdigital(email: any): void;
2
+ export declare function sendCartInsight(): void;
3
+ export declare function CompleteCartInsight(cart: any, status: any): void;
@@ -0,0 +1,122 @@
1
+ import { useCartStore } from "../stores/Cart.js";
2
+ import { useAuthStore } from "../stores/auth.js";
3
+ import { useRouter } from "vue-router";
4
+ const cartStore = useCartStore();
5
+ const authStore = useAuthStore();
6
+ const router = useRouter();
7
+ const getUTCDateTime = () => {
8
+ const now = /* @__PURE__ */ new Date();
9
+ const pad = (number) => number < 10 ? `0${number}` : number;
10
+ const year = now.getUTCFullYear();
11
+ const month = pad(now.getUTCMonth() + 1);
12
+ const day = pad(now.getUTCDate());
13
+ const hours = pad(now.getUTCHours());
14
+ const minutes = pad(now.getUTCMinutes());
15
+ const seconds = pad(now.getUTCSeconds());
16
+ return `${year}${month}${day}T${hours}${minutes}${seconds}Z`;
17
+ };
18
+ const generateProductUrl = (sku) => {
19
+ const resolvedRoute = router.resolve({ name: "Product", params: { slug: sku } });
20
+ return window.location.origin + resolvedRoute.href;
21
+ };
22
+ const generateCartUrl = (token) => {
23
+ const resolvedRoute = router.resolve({ name: "AbandonedCart", params: { slug: token } });
24
+ return "https://" + window.location.host + resolvedRoute.href;
25
+ };
26
+ export function addtodotdigital(email) {
27
+ if (typeof window.dmPt !== "undefined" && window.dmPt) {
28
+ window.dmPt("identify", email);
29
+ }
30
+ }
31
+ export function sendCartInsight() {
32
+ if (typeof window.dmPt !== "undefined" && window.dmPt) {
33
+ const cartItems = cartStore.cart.items;
34
+ const totals = cartStore.cart.totals;
35
+ const abndToken = cartStore.cart.abndToken;
36
+ const isAuthenticated = authStore.isAuthenticated;
37
+ const cartPhase = isAuthenticated ? "CUSTOMER_LOGIN" : "Guest";
38
+ if (isAuthenticated) {
39
+ window.dmPt("identify", authStore.user.email);
40
+ }
41
+ let lineItems = [];
42
+ if (cartItems) {
43
+ Object.values(cartItems).forEach((item, index) => {
44
+ lineItems.push({
45
+ sku: item.sku,
46
+ name: item.name,
47
+ description: item.name,
48
+ category: item.category,
49
+ unitPrice: item.rpfloat,
50
+ salePrice: item.pricefloat,
51
+ quantity: item.qty,
52
+ totalPrice: Number(item.qty * item.pricefloat),
53
+ imageUrl: item.image,
54
+ productUrl: generateProductUrl(item.slug)
55
+ });
56
+ });
57
+ }
58
+ const cartData = {
59
+ programID: 33188,
60
+ cartDelay: 1,
61
+ cartID: abndToken,
62
+ cartPhase: "CART",
63
+ currency: "AUD",
64
+ subtotal: totals.subtotal,
65
+ discountAmount: totals.discount,
66
+ createDate: getUTCDateTime(),
67
+ modifiedDate: getUTCDateTime(),
68
+ taxAmount: totals.gst,
69
+ shipping: totals.shipping,
70
+ grandTotal: totals.total,
71
+ cartUrl: generateCartUrl(abndToken),
72
+ lineItems
73
+ };
74
+ window.dmPt("cartInsight", cartData);
75
+ }
76
+ }
77
+ export function CompleteCartInsight(cart, status) {
78
+ if (typeof window.dmPt !== "undefined" && window.dmPt) {
79
+ const cartItems = cart.items;
80
+ const totals = cart.totals;
81
+ const abndToken = cart.abndToken;
82
+ const isAuthenticated = authStore.isAuthenticated;
83
+ const cartPhase = isAuthenticated ? "CUSTOMER_LOGIN" : "Guest";
84
+ if (isAuthenticated == true) {
85
+ dmPt("identify", authStore.user.email);
86
+ }
87
+ let lineItems = [];
88
+ if (cartItems) {
89
+ Object.values(cartItems).forEach((item, index) => {
90
+ lineItems.push({
91
+ sku: item.sku,
92
+ name: item.name,
93
+ description: item.name,
94
+ category: item.category,
95
+ unitPrice: item.rpfloat,
96
+ salePrice: item.pricefloat,
97
+ quantity: item.qty,
98
+ totalPrice: Number(item.qty * item.pricefloat),
99
+ imageUrl: item.image,
100
+ productUrl: generateProductUrl(item.slug)
101
+ });
102
+ });
103
+ }
104
+ const cartData = {
105
+ programID: 33188,
106
+ cartDelay: 1,
107
+ cartID: abndToken,
108
+ cartPhase: status,
109
+ currency: "AUD",
110
+ subtotal: totals.subtotal,
111
+ discountAmount: totals.discount,
112
+ createDate: getUTCDateTime(),
113
+ modifiedDate: getUTCDateTime(),
114
+ taxAmount: totals.gst,
115
+ shipping: totals.shipping,
116
+ grandTotal: totals.total,
117
+ cartUrl: generateCartUrl(abndToken),
118
+ lineItems
119
+ };
120
+ window.dmPt("cartInsight", cartData);
121
+ }
122
+ }
@@ -5,18 +5,8 @@ export interface LocationData {
5
5
  city?: string;
6
6
  }
7
7
  export declare const useLocation: () => {
8
- location: Readonly<import("vue").Ref<{
9
- readonly country: string;
10
- readonly countryCode?: string | undefined;
11
- readonly state?: string | undefined;
12
- readonly city?: string | undefined;
13
- }, {
14
- readonly country: string;
15
- readonly countryCode?: string | undefined;
16
- readonly state?: string | undefined;
17
- readonly city?: string | undefined;
18
- }>>;
19
- shippingCountry: Readonly<import("vue").Ref<string, string>>;
8
+ location: Readonly<import("vue").Ref<any, any>>;
9
+ shippingCountry: Readonly<import("vue").Ref<any, any>>;
20
10
  updateLocation: (newLocation: Partial<LocationData>) => void;
21
11
  updateCountry: (country: string, countryCode?: string) => void;
22
12
  resetLocation: () => void;
@@ -0,0 +1,78 @@
1
+ export declare const useQuotationCheckout: () => {
2
+ inputData: import("vue").Ref<{
3
+ paymentmethod: string;
4
+ customertoken: string;
5
+ authoritytoleave: undefined;
6
+ register: string;
7
+ password: string;
8
+ password_confirmation: string;
9
+ passwordStrengthValue: string;
10
+ customernotes: string;
11
+ ewayKey: string;
12
+ eway_cardname: string;
13
+ eway_cardnumber: string;
14
+ eway_expirymonth: string;
15
+ eway_expiryyear: string;
16
+ eway_cvn: string;
17
+ till_cardname: string;
18
+ till_cardnumber: string;
19
+ till_cvn: string;
20
+ till_expirymonth: string;
21
+ till_expiryyear: string;
22
+ save_card_details: number;
23
+ }, {
24
+ paymentmethod: string;
25
+ customertoken: string;
26
+ authoritytoleave: undefined;
27
+ register: string;
28
+ password: string;
29
+ password_confirmation: string;
30
+ passwordStrengthValue: string;
31
+ customernotes: string;
32
+ ewayKey: string;
33
+ eway_cardname: string;
34
+ eway_cardnumber: string;
35
+ eway_expirymonth: string;
36
+ eway_expiryyear: string;
37
+ eway_cvn: string;
38
+ till_cardname: string;
39
+ till_cardnumber: string;
40
+ till_cvn: string;
41
+ till_expirymonth: string;
42
+ till_expiryyear: string;
43
+ save_card_details: number;
44
+ } | {
45
+ paymentmethod: string;
46
+ customertoken: string;
47
+ authoritytoleave: undefined;
48
+ register: string;
49
+ password: string;
50
+ password_confirmation: string;
51
+ passwordStrengthValue: string;
52
+ customernotes: string;
53
+ ewayKey: string;
54
+ eway_cardname: string;
55
+ eway_cardnumber: string;
56
+ eway_expirymonth: string;
57
+ eway_expiryyear: string;
58
+ eway_cvn: string;
59
+ till_cardname: string;
60
+ till_cardnumber: string;
61
+ till_cvn: string;
62
+ till_expirymonth: string;
63
+ till_expiryyear: string;
64
+ save_card_details: number;
65
+ }>;
66
+ publishableKey: import("vue").Ref<any, any>;
67
+ responseData: import("vue").Ref<any, any>;
68
+ QuotationData: import("vue").Ref<any, any>;
69
+ checkoutSession: import("vue").Ref<any, any>;
70
+ preference: import("vue").Ref<any, any>;
71
+ errorResponseData: import("vue").Ref<any, any>;
72
+ resetState: () => void;
73
+ getQuotation: (slug: string) => Promise<any>;
74
+ getGuestQuotation: (slug: string, query?: any) => Promise<any>;
75
+ GuestCheckoutQuotation: (slug: string, quotationData: any, query?: any) => Promise<any>;
76
+ paymentMethods: (formData: any) => Promise<any>;
77
+ submitCheckout: (slug: string, quotationData: any) => Promise<unknown>;
78
+ };
@@ -0,0 +1,138 @@
1
+ import { ref } from "vue";
2
+ export const useQuotationCheckout = () => {
3
+ const publishableKey = ref({});
4
+ const responseData = ref([]);
5
+ const QuotationData = ref([]);
6
+ const checkoutSession = ref([]);
7
+ const preference = ref({ data: { fields: {} } });
8
+ const errorResponseData = ref([]);
9
+ const inputData = ref({
10
+ paymentmethod: "",
11
+ customertoken: "",
12
+ authoritytoleave: void 0,
13
+ register: "",
14
+ password: "",
15
+ password_confirmation: "",
16
+ passwordStrengthValue: "",
17
+ customernotes: "",
18
+ ewayKey: "",
19
+ eway_cardname: "",
20
+ eway_cardnumber: "",
21
+ eway_expirymonth: "",
22
+ eway_expiryyear: "",
23
+ eway_cvn: "",
24
+ till_cardname: "",
25
+ till_cardnumber: "",
26
+ till_cvn: "",
27
+ till_expirymonth: "",
28
+ till_expiryyear: "",
29
+ save_card_details: 0
30
+ });
31
+ const resetState = () => {
32
+ publishableKey.value = {};
33
+ responseData.value = [];
34
+ checkoutSession.value = [];
35
+ preference.value = [];
36
+ errorResponseData.value = [];
37
+ };
38
+ const getQuotation = async (slug) => {
39
+ try {
40
+ const response = await $fetch(`/api/checkout/quotation/${slug}`, {
41
+ method: "GET"
42
+ });
43
+ if (response) {
44
+ publishableKey.value = response.data;
45
+ QuotationData.value = response;
46
+ }
47
+ return response;
48
+ } catch (error) {
49
+ errorResponseData.value = error.data || error;
50
+ throw error;
51
+ }
52
+ };
53
+ const getGuestQuotation = async (slug, query) => {
54
+ try {
55
+ const response = await $fetch(`/api/checkout/quotation/guest/${slug}`, {
56
+ method: "GET",
57
+ query
58
+ });
59
+ if (response) {
60
+ publishableKey.value = response.data;
61
+ QuotationData.value = response;
62
+ responseData.value = response;
63
+ }
64
+ return response;
65
+ } catch (error) {
66
+ errorResponseData.value = error.data || error;
67
+ throw error;
68
+ }
69
+ };
70
+ const GuestCheckoutQuotation = async (slug, quotationData, query) => {
71
+ try {
72
+ responseData.value = [];
73
+ errorResponseData.value = [];
74
+ const FormData = quotationData.fields;
75
+ const response = await $fetch(`/api/checkout/quotation/guest/${slug}`, {
76
+ method: "POST",
77
+ body: FormData,
78
+ query
79
+ });
80
+ if (response) {
81
+ publishableKey.value = response.data;
82
+ responseData.value = response;
83
+ }
84
+ return response;
85
+ } catch (error) {
86
+ errorResponseData.value = error.data || error;
87
+ throw error;
88
+ }
89
+ };
90
+ const paymentMethods = async (formData) => {
91
+ try {
92
+ const response = await $fetch("/api/checkout/paymentmethod", {
93
+ method: "POST",
94
+ body: formData
95
+ });
96
+ if (response) {
97
+ publishableKey.value = response.data;
98
+ }
99
+ return response;
100
+ } catch (error) {
101
+ errorResponseData.value = error.data || error;
102
+ throw error;
103
+ }
104
+ };
105
+ const submitCheckout = async (slug, quotationData) => {
106
+ try {
107
+ responseData.value = [];
108
+ errorResponseData.value = [];
109
+ console.log("Data", slug, quotationData);
110
+ const response = await $fetch(`/api/checkout/quotation/submit/${slug}`, {
111
+ method: "POST",
112
+ body: quotationData
113
+ });
114
+ if (response.status == "Success") {
115
+ responseData.value = response.data;
116
+ }
117
+ return response;
118
+ } catch (error) {
119
+ errorResponseData.value = error.data || error;
120
+ throw error;
121
+ }
122
+ };
123
+ return {
124
+ inputData,
125
+ publishableKey,
126
+ responseData,
127
+ QuotationData,
128
+ checkoutSession,
129
+ preference,
130
+ errorResponseData,
131
+ resetState,
132
+ getQuotation,
133
+ getGuestQuotation,
134
+ GuestCheckoutQuotation,
135
+ paymentMethods,
136
+ submitCheckout
137
+ };
138
+ };
@@ -1,6 +1,7 @@
1
1
  export declare const flowrixApi: {
2
- get: (endpoint: any, options?: {}, apiversion?: string) => Promise<unknown>;
3
- post: (endpoint: any, options?: {}, apiversion?: string) => Promise<unknown>;
4
- put: (endpoint: any, options?: {}, apiversion?: string) => Promise<unknown>;
5
- delete: (endpoint: any, options?: {}, apiversion?: string) => Promise<unknown>;
2
+ get: (endpoint: any, config?: {}, options?: {}) => Promise<unknown>;
3
+ post: (endpoint: any, config?: {}, options?: {}) => Promise<unknown>;
4
+ put: (endpoint: any, config?: {}, options?: {}) => Promise<unknown>;
5
+ patch: (endpoint: any, config?: {}, options?: {}) => Promise<unknown>;
6
+ delete: (endpoint: any, config?: {}, options?: {}) => Promise<unknown>;
6
7
  };
@@ -1,22 +1,33 @@
1
1
  const isServer = typeof process !== "undefined" && process.server;
2
- function getEnv(key) {
3
- if (typeof useRuntimeConfig === "function") {
4
- const config = useRuntimeConfig();
5
- return config.public?.[key] || config[key];
2
+ function getCookie(name) {
3
+ if (process.client) {
4
+ const value = `; ${document.cookie}`;
5
+ const parts = value.split(`; ${name}=`);
6
+ if (parts.length === 2) return parts.pop().split(";").shift();
7
+ return null;
8
+ } else {
9
+ return null;
6
10
  }
7
- return process.env[key];
8
11
  }
9
- async function request(method, endpoint, options = {}, apiversion) {
10
- const FLOWRIX_API_KEY = getEnv("FLOWRIX_API_KEY");
11
- const FLOWRIX_API_SECRET = getEnv("FLOWRIX_API_SECRET");
12
- const FLOWRIX_API_ORIGIN = getEnv("FLOWRIX_API_ORIGIN");
13
- let FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE");
14
- if (apiversion == "v2") {
15
- FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE_V2");
16
- }
12
+ const parseCookies = (cookieString) => {
13
+ return Object.fromEntries(
14
+ cookieString.split(";").map((c) => {
15
+ const [key, ...v] = c.trim().split("=");
16
+ return [key, decodeURIComponent(v.join("="))];
17
+ })
18
+ );
19
+ };
20
+ async function request(method, config = {}, endpoint, options = {}) {
21
+ const FLOWRIX_API_KEY = config?.FLOWRIX_API_KEY || config.public?.FLOWRIX_API_KEY || "";
22
+ const FLOWRIX_API_ORIGIN = config?.FLOWRIX_API_ORIGIN || config.public?.FLOWRIX_API_ORIGIN || "";
23
+ let FLOWRIX_API_BASE = config?.FLOWRIX_API_BASE || config.public?.FLOWRIX_API_BASE || "";
24
+ const cookiesObj = parseCookies(config.cookies || "");
25
+ const authToken = cookiesObj["authToken"];
17
26
  const headers = {
18
- "x-api-key": FLOWRIX_API_KEY,
19
- "x-api-secret": FLOWRIX_API_SECRET,
27
+ "x-public-key": FLOWRIX_API_KEY,
28
+ "x-session-token": getCookie("x-session-token"),
29
+ "Access-Control-Expose-Headers": "x-session-token",
30
+ "authorization": `Bearer ${authToken}`,
20
31
  "Origin": FLOWRIX_API_ORIGIN,
21
32
  ...options.headers
22
33
  };
@@ -24,17 +35,25 @@ async function request(method, endpoint, options = {}, apiversion) {
24
35
  const response = await $fetch(`${FLOWRIX_API_BASE}${endpoint}`, {
25
36
  method,
26
37
  ...options,
27
- headers
38
+ headers,
39
+ onResponse({ response: response2 }) {
40
+ const token = response2.headers.get("x-session-token");
41
+ if (token) {
42
+ if (process.client) {
43
+ document.cookie = `x-session-token=${token}; path=/; max-age=3600; secure; SameSite=Lax`;
44
+ }
45
+ }
46
+ }
28
47
  });
29
48
  return response;
30
49
  } catch (error) {
31
- console.error(`[FLOWRIX ERROR] ${method.toUpperCase()} ${FLOWRIX_API_BASE}${endpoint}`, error);
32
50
  throw error;
33
51
  }
34
52
  }
35
53
  export const flowrixApi = {
36
- get: (endpoint, options = {}, apiversion = "v1") => request("get", endpoint, options, apiversion),
37
- post: (endpoint, options = {}, apiversion = "v1") => request("post", endpoint, options, apiversion),
38
- put: (endpoint, options = {}, apiversion = "v1") => request("put", endpoint, options, apiversion),
39
- delete: (endpoint, options = {}, apiversion = "v1") => request("delete", endpoint, options, apiversion)
54
+ get: (endpoint, config = {}, options = {}) => request("get", config, endpoint, options),
55
+ post: (endpoint, config = {}, options = {}) => request("post", config, endpoint, options),
56
+ put: (endpoint, config = {}, options = {}) => request("put", config, endpoint, options),
57
+ patch: (endpoint, config = {}, options = {}) => request("patch", config, endpoint, options),
58
+ delete: (endpoint, config = {}, options = {}) => request("delete", config, endpoint, options)
40
59
  };
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;