flowrix 1.0.1-beta.8 → 1.0.1-beta.81

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 (192) hide show
  1. package/dist/module.d.mts +1 -6
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +94 -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 +36 -28
  18. package/dist/runtime/composables/Checkout/{useBillingAddress.d.ts → useCheckoutBillingAddress.d.ts} +6 -6
  19. package/dist/runtime/composables/Checkout/{useBillingAddress.js → useCheckoutBillingAddress.js} +6 -1
  20. package/dist/runtime/composables/Checkout/{useShippingAddress.d.ts → useCheckoutShippingAddress.d.ts} +1 -1
  21. package/dist/runtime/composables/Checkout/{useShippingAddress.js → useCheckoutShippingAddress.js} +7 -2
  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 +8 -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/useSteps.d.ts +1 -1
  53. package/dist/runtime/composables/Product/useProductSlug.d.ts +8 -1
  54. package/dist/runtime/composables/Product/useQuickView.d.ts +8 -0
  55. package/dist/runtime/composables/Product/useQuickView.js +27 -0
  56. package/dist/runtime/composables/Product/useService.d.ts +1 -1
  57. package/dist/runtime/composables/Product/useService.js +0 -3
  58. package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +2 -2
  59. package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +2 -2
  60. package/dist/runtime/composables/index.d.ts +15 -12
  61. package/dist/runtime/composables/index.js +15 -12
  62. package/dist/runtime/composables/useAddresses.js +6 -6
  63. package/dist/runtime/composables/useCards.js +2 -2
  64. package/dist/runtime/composables/useLocation.d.ts +2 -12
  65. package/dist/runtime/composables/useQuotationCheckout.d.ts +78 -0
  66. package/dist/runtime/composables/useQuotationCheckout.js +138 -0
  67. package/dist/runtime/middleware/flowrix.d.ts +5 -4
  68. package/dist/runtime/middleware/flowrix.js +41 -21
  69. package/dist/runtime/plugin.d.ts +1 -1
  70. package/dist/runtime/server/api/albums.js +1 -1
  71. package/dist/runtime/server/api/auth/forgot.js +1 -1
  72. package/dist/runtime/server/api/auth/login.js +5 -6
  73. package/dist/runtime/server/api/auth/logout.js +1 -1
  74. package/dist/runtime/server/api/auth/register.js +1 -1
  75. package/dist/runtime/server/api/auth/session.get.js +1 -1
  76. package/dist/runtime/server/api/auth/user/reset-password.js +1 -1
  77. package/dist/runtime/server/api/auth/user/session.js +1 -1
  78. package/dist/runtime/server/api/auth/user/verify-token.js +1 -1
  79. package/dist/runtime/server/api/banners.js +2 -2
  80. package/dist/runtime/server/api/brand/{[slug].js → [...slug].js} +17 -17
  81. package/dist/runtime/server/api/brand/index.d.ts +2 -0
  82. package/dist/runtime/server/api/brand/index.js +23 -0
  83. package/dist/runtime/server/api/cache/[...slug].delete.d.ts +2 -0
  84. package/dist/runtime/server/api/cache/[...slug].delete.js +40 -0
  85. package/dist/runtime/server/api/cache/clean.get.d.ts +5 -0
  86. package/dist/runtime/server/api/cache/clean.get.js +16 -0
  87. package/dist/runtime/server/api/cart/[slug]/add.js +1 -1
  88. package/dist/runtime/server/api/cart/[slug]/update.js +1 -1
  89. package/dist/runtime/server/api/cart/related.d.ts +2 -0
  90. package/dist/runtime/server/api/cart/related.js +21 -0
  91. package/dist/runtime/server/api/cart/remove.js +1 -1
  92. package/dist/runtime/server/api/cart/service/[slug]/add.js +1 -1
  93. package/dist/runtime/server/api/catalog/categories.js +5 -4
  94. package/dist/runtime/server/api/catalog/categoriesall.d.ts +3 -0
  95. package/dist/runtime/server/api/catalog/categoriesall.js +44 -0
  96. package/dist/runtime/server/api/catalog/featured.js +5 -4
  97. package/dist/runtime/server/api/catalog/samples.js +5 -4
  98. package/dist/runtime/server/api/catalog/search.js +5 -4
  99. package/dist/runtime/server/api/category/[...slug].js +18 -14
  100. package/dist/runtime/server/api/checkout/applyCoupon.js +1 -1
  101. package/dist/runtime/server/api/checkout/configs.d.ts +1 -1
  102. package/dist/runtime/server/api/checkout/configs.js +10 -11
  103. package/dist/runtime/server/api/checkout/countries.js +1 -1
  104. package/dist/runtime/server/api/checkout/paymentmethod.js +7 -7
  105. package/dist/runtime/server/api/checkout/quotation/[slug].d.ts +2 -0
  106. package/dist/runtime/server/api/checkout/quotation/[slug].js +21 -0
  107. package/dist/runtime/server/api/checkout/quotation/guest/[slug].d.ts +2 -0
  108. package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +37 -0
  109. package/dist/runtime/server/api/checkout/quotation/guest/customer.d.ts +2 -0
  110. package/dist/runtime/server/api/checkout/quotation/guest/customer.js +21 -0
  111. package/dist/runtime/server/api/checkout/quotation/submit/[slug].d.ts +2 -0
  112. package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +23 -0
  113. package/dist/runtime/server/api/{blog/[slug].js → cmspost/[...slug].js} +7 -9
  114. package/dist/runtime/server/api/{blog/blog.js → cmspost/all.js} +2 -2
  115. package/dist/runtime/server/api/company/profile.d.ts +1 -1
  116. package/dist/runtime/server/api/company/profile.js +9 -9
  117. package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +1 -1
  118. package/dist/runtime/server/api/contact-center/webforms/create.js +1 -1
  119. package/dist/runtime/server/api/countries.d.ts +2 -0
  120. package/dist/runtime/server/api/countries.js +35 -0
  121. package/dist/runtime/server/api/customer/address/add.js +1 -1
  122. package/dist/runtime/server/api/customer/address/delete.js +2 -2
  123. package/dist/runtime/server/api/customer/address/setshipping.js +1 -1
  124. package/dist/runtime/server/api/customer/address/update.js +1 -1
  125. package/dist/runtime/server/api/customer/cards/delete.js +2 -2
  126. package/dist/runtime/server/api/customer/cards/get.js +2 -2
  127. package/dist/runtime/server/api/customer/change-password.js +2 -2
  128. package/dist/runtime/server/api/customer/checkout.js +1 -1
  129. package/dist/runtime/server/api/customer/orders.js +2 -2
  130. package/dist/runtime/server/api/customer/profile/update.js +1 -1
  131. package/dist/runtime/server/api/customer/quotations.js +2 -2
  132. package/dist/runtime/server/api/customer/search.js +1 -1
  133. package/dist/runtime/server/api/customer/tax-invoice.js +1 -1
  134. package/dist/runtime/server/api/customer/wishlist/add.js +1 -1
  135. package/dist/runtime/server/api/customer/wishlist/createWishList.js +1 -1
  136. package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +1 -1
  137. package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +1 -1
  138. package/dist/runtime/server/api/customer/wishlist/get.js +2 -2
  139. package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +1 -1
  140. package/dist/runtime/server/api/customer/wishlist/updateWishList.js +2 -2
  141. package/dist/runtime/server/api/featured.d.ts +2 -0
  142. package/dist/runtime/server/api/featured.js +16 -0
  143. package/dist/runtime/server/api/location.js +1 -1
  144. package/dist/runtime/server/api/nav/[id]/links.js +1 -1
  145. package/dist/runtime/server/api/page/{[slug].js → [...slug].js} +6 -8
  146. package/dist/runtime/server/api/product/[...slug].js +8 -5
  147. package/dist/runtime/server/api/quickview/[slug].d.ts +2 -0
  148. package/dist/runtime/server/api/quickview/[slug].js +16 -0
  149. package/dist/runtime/server/api/samples.d.ts +3 -0
  150. package/dist/runtime/server/api/samples.js +20 -0
  151. package/dist/runtime/server/api/search.d.ts +3 -0
  152. package/dist/runtime/server/api/search.js +15 -0
  153. package/dist/runtime/server/api/service/[slug].js +5 -4
  154. package/dist/runtime/server/api/service/availability.js +1 -1
  155. package/dist/runtime/server/api/service/getall.d.ts +3 -0
  156. package/dist/runtime/server/api/service/getall.js +52 -0
  157. package/dist/runtime/server/api/shop.d.ts +3 -0
  158. package/dist/runtime/server/api/shop.js +15 -0
  159. package/dist/runtime/server/api/subscribe.js +1 -1
  160. package/dist/runtime/server/api/v2/[...slug].js +3 -1
  161. package/dist/runtime/server/api/webform.d.ts +3 -0
  162. package/dist/runtime/server/api/webform.js +16 -0
  163. package/dist/runtime/stores/Cart.d.ts +12 -0
  164. package/dist/runtime/stores/Cart.js +50 -16
  165. package/dist/runtime/stores/Checkout.d.ts +9 -15
  166. package/dist/runtime/stores/Checkout.js +19 -5
  167. package/dist/runtime/stores/Search.d.ts +1 -1
  168. package/dist/runtime/stores/Services.js +2 -2
  169. package/dist/runtime/stores/auth.d.ts +8 -11
  170. package/dist/runtime/stores/auth.js +390 -8
  171. package/dist/runtime/stores/countries.d.ts +1 -3
  172. package/dist/runtime/stores/countries.js +4 -8
  173. package/dist/runtime/stores/product/slug.d.ts +1 -17
  174. package/dist/runtime/stores/wishlists.d.ts +114 -6
  175. package/dist/runtime/stores/wishlists.js +209 -9
  176. package/dist/runtime/utils/api.js +9 -13
  177. package/dist/runtime/utils/htmlCache.d.ts +5 -0
  178. package/dist/runtime/utils/htmlCache.js +60 -0
  179. package/dist/types.d.mts +6 -2
  180. package/package.json +32 -20
  181. package/dist/runtime/composables/useAuth.d.ts +0 -45
  182. package/dist/runtime/composables/useAuth.js +0 -180
  183. package/dist/runtime/composables/useCountries.d.ts +0 -12
  184. package/dist/runtime/composables/useCountries.js +0 -50
  185. package/dist/runtime/composables/useOrders.d.ts +0 -21
  186. package/dist/runtime/composables/useOrders.js +0 -82
  187. package/dist/runtime/composables/useQuotations.d.ts +0 -14
  188. package/dist/runtime/composables/useQuotations.js +0 -50
  189. /package/dist/runtime/server/api/brand/{[slug].d.ts → [...slug].d.ts} +0 -0
  190. /package/dist/runtime/server/api/{blog/[slug].d.ts → cmspost/[...slug].d.ts} +0 -0
  191. /package/dist/runtime/server/api/{blog/blog.d.ts → cmspost/all.d.ts} +0 -0
  192. /package/dist/runtime/server/api/page/{[slug].d.ts → [...slug].d.ts} +0 -0
@@ -1,39 +1,39 @@
1
1
  export default function (): {
2
- router: any;
3
- route: any;
2
+ router: import("vue-router").Router;
3
+ route: import("vue-router").RouteLocationNormalizedLoadedGeneric;
4
4
  inputData: import("vue").Ref<{
5
- deliverymethod: any;
6
- billing_address: any;
5
+ deliverymethod: string | number | undefined;
6
+ billing_address: string | number | undefined;
7
7
  billing_country: any;
8
8
  shippingasbilling: boolean;
9
9
  isCustomer: boolean;
10
- billing_state: any;
11
- billing_suburb: any;
10
+ billing_state: string | number | undefined;
11
+ billing_suburb: string | undefined;
12
12
  clientsceret: any;
13
- billing_postcode: any;
14
- billing_mobile: any;
15
- billing_firstname: any;
16
- firstname: any;
17
- billing_middlename: any;
18
- billing_lastname: any;
19
- lastname: any;
20
- shipping_address: any;
21
- shippingmethod: any;
13
+ billing_postcode: number | undefined;
14
+ billing_mobile: string | number | undefined;
15
+ billing_firstname: string | number | undefined;
16
+ firstname: string | number | undefined;
17
+ billing_middlename: string | undefined;
18
+ billing_lastname: string | number | undefined;
19
+ lastname: string | number | undefined;
20
+ shipping_address: string | undefined;
21
+ shippingmethod: string | number | undefined;
22
22
  shipping_country: any;
23
- shipping_state: any;
24
- shipping_suburb: any;
25
- shipping_postcode: any;
26
- shipping_mobile: any;
27
- shipping_firstname: any;
28
- shipping_middlename: any;
29
- shipping_lastname: any;
23
+ shipping_state: string | number | undefined;
24
+ shipping_suburb: string | undefined;
25
+ shipping_postcode: number | undefined;
26
+ shipping_mobile: string | undefined;
27
+ shipping_firstname: string | undefined;
28
+ shipping_middlename: string | undefined;
29
+ shipping_lastname: string | undefined;
30
30
  vouchercode: any;
31
31
  paymentmethod: string;
32
32
  cart: any;
33
- abndToken: any;
33
+ abndToken: string | undefined;
34
34
  customertoken: string;
35
- email: any;
36
- mobile: any;
35
+ email: string | number | undefined;
36
+ mobile: string | number | undefined;
37
37
  authoritytoleave: undefined;
38
38
  register: string;
39
39
  password: string;
@@ -53,38 +53,38 @@ export default function (): {
53
53
  till_expiryyear: string;
54
54
  save_card_details: number;
55
55
  }, {
56
- deliverymethod: any;
57
- billing_address: any;
56
+ deliverymethod: string | number | undefined;
57
+ billing_address: string | number | undefined;
58
58
  billing_country: any;
59
59
  shippingasbilling: boolean;
60
60
  isCustomer: boolean;
61
- billing_state: any;
62
- billing_suburb: any;
61
+ billing_state: string | number | undefined;
62
+ billing_suburb: string | undefined;
63
63
  clientsceret: any;
64
- billing_postcode: any;
65
- billing_mobile: any;
66
- billing_firstname: any;
67
- firstname: any;
68
- billing_middlename: any;
69
- billing_lastname: any;
70
- lastname: any;
71
- shipping_address: any;
72
- shippingmethod: any;
64
+ billing_postcode: number | undefined;
65
+ billing_mobile: string | number | undefined;
66
+ billing_firstname: string | number | undefined;
67
+ firstname: string | number | undefined;
68
+ billing_middlename: string | undefined;
69
+ billing_lastname: string | number | undefined;
70
+ lastname: string | number | undefined;
71
+ shipping_address: string | undefined;
72
+ shippingmethod: string | number | undefined;
73
73
  shipping_country: any;
74
- shipping_state: any;
75
- shipping_suburb: any;
76
- shipping_postcode: any;
77
- shipping_mobile: any;
78
- shipping_firstname: any;
79
- shipping_middlename: any;
80
- shipping_lastname: any;
74
+ shipping_state: string | number | undefined;
75
+ shipping_suburb: string | undefined;
76
+ shipping_postcode: number | undefined;
77
+ shipping_mobile: string | undefined;
78
+ shipping_firstname: string | undefined;
79
+ shipping_middlename: string | undefined;
80
+ shipping_lastname: string | undefined;
81
81
  vouchercode: any;
82
82
  paymentmethod: string;
83
83
  cart: any;
84
- abndToken: any;
84
+ abndToken: string | undefined;
85
85
  customertoken: string;
86
- email: any;
87
- mobile: any;
86
+ email: string | number | undefined;
87
+ mobile: string | number | undefined;
88
88
  authoritytoleave: undefined;
89
89
  register: string;
90
90
  password: string;
@@ -104,38 +104,38 @@ export default function (): {
104
104
  till_expiryyear: string;
105
105
  save_card_details: number;
106
106
  } | {
107
- deliverymethod: any;
108
- billing_address: any;
107
+ deliverymethod: string | number | undefined;
108
+ billing_address: string | number | undefined;
109
109
  billing_country: any;
110
110
  shippingasbilling: boolean;
111
111
  isCustomer: boolean;
112
- billing_state: any;
113
- billing_suburb: any;
112
+ billing_state: string | number | undefined;
113
+ billing_suburb: string | undefined;
114
114
  clientsceret: any;
115
- billing_postcode: any;
116
- billing_mobile: any;
117
- billing_firstname: any;
118
- firstname: any;
119
- billing_middlename: any;
120
- billing_lastname: any;
121
- lastname: any;
122
- shipping_address: any;
123
- shippingmethod: any;
115
+ billing_postcode: number | undefined;
116
+ billing_mobile: string | number | undefined;
117
+ billing_firstname: string | number | undefined;
118
+ firstname: string | number | undefined;
119
+ billing_middlename: string | undefined;
120
+ billing_lastname: string | number | undefined;
121
+ lastname: string | number | undefined;
122
+ shipping_address: string | undefined;
123
+ shippingmethod: string | number | undefined;
124
124
  shipping_country: any;
125
- shipping_state: any;
126
- shipping_suburb: any;
127
- shipping_postcode: any;
128
- shipping_mobile: any;
129
- shipping_firstname: any;
130
- shipping_middlename: any;
131
- shipping_lastname: any;
125
+ shipping_state: string | number | undefined;
126
+ shipping_suburb: string | undefined;
127
+ shipping_postcode: number | undefined;
128
+ shipping_mobile: string | undefined;
129
+ shipping_firstname: string | undefined;
130
+ shipping_middlename: string | undefined;
131
+ shipping_lastname: string | undefined;
132
132
  vouchercode: any;
133
133
  paymentmethod: string;
134
134
  cart: any;
135
- abndToken: any;
135
+ abndToken: string | undefined;
136
136
  customertoken: string;
137
- email: any;
138
- mobile: any;
137
+ email: string | number | undefined;
138
+ mobile: string | number | undefined;
139
139
  authoritytoleave: undefined;
140
140
  register: string;
141
141
  password: string;
@@ -155,9 +155,20 @@ export default function (): {
155
155
  till_expiryyear: string;
156
156
  save_card_details: number;
157
157
  }>;
158
- cartData: import("vue").ComputedRef<any>;
158
+ cartData: import("vue").ComputedRef<{
159
+ [x: string]: any;
160
+ preferences?: Record<string, any>[] | undefined;
161
+ outlets?: Record<string, any>[] | undefined;
162
+ deliverytype?: string | undefined;
163
+ order_no?: string | undefined;
164
+ publishableKey?: any;
165
+ calculations?: any;
166
+ shippingmethods?: any;
167
+ cart?: Record<string, import("../../stores/Checkout.js").CartItem> | undefined;
168
+ totals?: Record<string, any> | undefined;
169
+ }>;
159
170
  AuthStore: import("vue").Ref<any, any>;
160
- checkoutStore: any;
171
+ checkoutStore: import("pinia").Store<"checkout", import("../../stores/Checkout.js").CheckoutState, {}, {}>;
161
172
  countries: any;
162
173
  BillingDetailsForm: any;
163
174
  DeliveryMethodForm: any;
@@ -1,14 +1,21 @@
1
1
  import { ref, computed, watch, onMounted, defineAsyncComponent } from "vue";
2
+ import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
3
+ import { useCartStore } from "../../stores/Cart.js";
4
+ import { useCheckoutStore } from "../../stores/Checkout.js";
5
+ import { useCountry } from "../Extras/useCountry.js";
6
+ import { useRouter, useRoute } from "vue-router";
7
+ import { useAuthStore } from "../../stores/auth.js";
2
8
  export default function() {
3
9
  const router = useRouter();
4
10
  const route = useRoute();
5
11
  const {
6
- status,
7
- data
8
- } = useAuth();
12
+ user,
13
+ token,
14
+ isAuthenticated
15
+ } = useAuthStore();
9
16
  const { profile } = useCompanyProfile();
10
17
  const cartStore = useCartStore();
11
- const companyCountryId = computed(() => profile?.value?.country_id || 235);
18
+ const companyCountryId = computed(() => profile?.data.country_id || "");
12
19
  const checkoutStore = useCheckoutStore();
13
20
  const AuthStore = ref();
14
21
  const shippingFormEnabled = ref(true);
@@ -75,14 +82,13 @@ export default function() {
75
82
  save_card_details: 0
76
83
  });
77
84
  const updateUserFieldsIfuserLogin = (async (sameasbilling = false) => {
78
- const LoggedInUser = data;
79
- if (Object.keys(LoggedInUser).length > 0 && LoggedInUser.value !== void 0) {
80
- const billingAddres = LoggedInUser.value.addresses?.filter((address) => address.billing == 1)[0];
81
- const shippingAddres = LoggedInUser.value.addresses?.filter((address) => address.shipping == 1)[0];
85
+ if (isAuthenticated) {
86
+ const billingAddres = user.addresses?.filter((address) => address.billing == 1)[0];
87
+ const shippingAddres = user.addresses?.filter((address) => address.shipping == 1)[0];
82
88
  inputData.value.billing_firstname = billingAddres.firstname;
83
89
  inputData.value.billing_lastname = billingAddres.lastname;
84
- inputData.value.email = LoggedInUser.value.email;
85
- inputData.value.billing_mobile = LoggedInUser.value.mobile;
90
+ inputData.value.email = user.email;
91
+ inputData.value.billing_mobile = user.mobile;
86
92
  if (sameasbilling == true) {
87
93
  } else {
88
94
  if (billingAddres != void 0) {
@@ -116,7 +122,7 @@ export default function() {
116
122
  inputData.value.shipping_mobile = shippingAddres.mobile;
117
123
  }
118
124
  }
119
- } else if (Object.keys(LoggedInUser).length == 0 && sameasbilling == true) {
125
+ } else if (isAuthenticated.value && sameasbilling == true) {
120
126
  inputData.value.shipping_firstname = inputData.value.billing_firstname ? inputData.value.billing_firstname : "";
121
127
  inputData.value.shipping_lastname = inputData.value.billing_lastname ? inputData.value.billing_lastname : "";
122
128
  inputData.value.shipping_address = inputData.value.billing_address ? inputData.value.billing_address : "";
@@ -166,7 +172,7 @@ export default function() {
166
172
  });
167
173
  const shippingMethods = computed(() => {
168
174
  if (checkoutStore.config) {
169
- return checkoutStore.config.shippingmethods.filter((method) => method.available == 1);
175
+ return checkoutStore.config?.shippingmethods?.filter((method) => method.available == 1);
170
176
  }
171
177
  });
172
178
  watch(() => checkoutStore.config.shippingmethods, (newValue, oldValue) => {
@@ -212,28 +218,28 @@ export default function() {
212
218
  }
213
219
  };
214
220
  const CheckFlowrixPayment = ((inputData2, payment) => {
215
- let status2 = {};
216
- var data2 = {
221
+ let status = {};
222
+ var data = {
217
223
  card_holder: inputData2.till_cardname,
218
224
  month: inputData2.till_expirymonth,
219
225
  year: inputData2.till_expiryyear
220
226
  };
221
227
  payment.tokenize(
222
- data2,
228
+ data,
223
229
  //additional data, MUST include card_holder (or first_name & last_name), month and year
224
- function(token, cardData) {
225
- inputData2.clientsceret = token;
226
- checkoutStore.publishableKey.clientsceret = token;
230
+ function(token2, cardData) {
231
+ inputData2.clientsceret = token2;
232
+ checkoutStore.publishableKey.clientsceret = token2;
227
233
  checkoutStore.saveToCheckoutSession(inputData2);
228
- if (token != "") {
229
- status2 = {};
234
+ if (token2 != "") {
235
+ status = {};
230
236
  }
231
237
  },
232
238
  function(errors) {
233
- status2 = errors;
239
+ status = errors;
234
240
  }
235
241
  );
236
- return status2;
242
+ return status;
237
243
  });
238
244
  const handleSubmit = async (url_cancel, url_success, url_booking) => {
239
245
  try {
@@ -250,8 +256,7 @@ export default function() {
250
256
  return false;
251
257
  }
252
258
  }
253
- const LoggedInUser = "";
254
- if (Object.keys(LoggedInUser).length == 0) {
259
+ if (isAuthenticated.value) {
255
260
  sessiondata.value.fields.firstname = inputData.value.billing_firstname;
256
261
  sessiondata.value.fields.lastname = inputData.value.billing_lastname;
257
262
  }
@@ -266,14 +271,16 @@ export default function() {
266
271
  sessiondata.value.fields.eway_cardnumber = cardnumber;
267
272
  sessiondata.value.fields.eway_cvn = eway_cvn;
268
273
  }
269
- await checkoutStore.submitCheckout();
270
- if (checkoutStore.errorResponseData.status != "Error") {
274
+ const chckoutResponse = await checkoutStore.submitCheckout();
275
+ if (chckoutResponse.status == "Success") {
271
276
  if (inputData.value.paymentmethod == "web-stripe") {
272
277
  const { stripe, elements } = await getStripeElements(
273
278
  checkoutStore.publishableKey.key,
274
279
  inputData.value.clientsceret
275
280
  );
276
281
  if (sessiondata.value.calculations.total > 0) {
282
+ console.log("chckoutResponse", sessiondata.value);
283
+ console.log("chckoutResponse", checkoutStore.responseData.booking ? `${window.location.origin}${url_booking}?calendar=${checkoutStore.responseData.calendar}&order_no=${checkoutStore.responseData.order_no}` : `${window.location.origin}${url_success}`);
277
284
  const { error: error2 } = await stripe.confirmPayment({
278
285
  elements,
279
286
  confirmParams: {
@@ -289,9 +296,10 @@ export default function() {
289
296
  } else {
290
297
  showMessage(error.message);
291
298
  }
292
- } else if (checkoutStore.response.data.url) {
293
- var url = checkoutStore.response.data.url;
299
+ } else if (chckoutResponse.data.url) {
300
+ var url = chckoutResponse.data.url;
294
301
  } else {
302
+ window.location.href = url_success;
295
303
  }
296
304
  removeLoading();
297
305
  } else if (checkoutStore.errorResponseData.status == "Error") {
@@ -1,5 +1,5 @@
1
1
  export default function (inputData: any): {
2
- checkoutStore: any;
2
+ checkoutStore: import("pinia").Store<"checkout", import("../../stores/Checkout.js").CheckoutState, {}, {}>;
3
3
  passwordShow: import("vue").Ref<string, string>;
4
4
  password: import("vue").Ref<string, string>;
5
5
  password_confirmationShow: import("vue").Ref<string, string>;
@@ -7,11 +7,11 @@ export default function (inputData: any): {
7
7
  UserAccount: import("vue").Ref<boolean, boolean>;
8
8
  CheckUserAccount: (billingDetails: any, userEmail: string) => Promise<void>;
9
9
  CheckingUserAccount: import("vue").Ref<boolean, boolean>;
10
- passwordStrength: any;
11
- passwordStrengthClass: any;
12
- passwordStrengthValue: any;
13
- passwordStrengthWidth: any;
14
- passwordStrengthTextColor: any;
10
+ passwordStrength: import("vue").ComputedRef<"Password must be 8 characters" | "Strong" | "Medium" | "Weak">;
11
+ passwordStrengthClass: import("vue").ComputedRef<"bg-danger" | "bg-success" | "bg-warning">;
12
+ passwordStrengthValue: import("vue").ComputedRef<number>;
13
+ passwordStrengthWidth: import("vue").ComputedRef<string>;
14
+ passwordStrengthTextColor: import("vue").ComputedRef<"text-danger" | "text-success" | "text-black">;
15
15
  UpdateStripe: (inputData: any) => Promise<void>;
16
16
  Countries: import("vue").Ref<never[], never[]>;
17
17
  ChangeCountry: (billingfield: any) => Promise<void>;
@@ -1,4 +1,9 @@
1
1
  import { ref, computed, onMounted } from "vue";
2
+ import { useCheckoutStore } from "../../stores/Checkout.js";
3
+ import { useCountry } from "../Extras/useCountry.js";
4
+ import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
5
+ import useStripe from "./PaymentMethods/useStripe.js";
6
+ import { usePasswordFormatter } from "../Extras/usePasswordFormatter.js";
2
7
  export default function(inputData) {
3
8
  const checkoutStore = useCheckoutStore();
4
9
  const passwordShow = ref("password");
@@ -54,7 +59,7 @@ export default function(inputData) {
54
59
  });
55
60
  const UpdateStripe = (async (inputData2) => {
56
61
  await checkoutStore.saveToCheckoutSession(inputData2);
57
- const { getpaymentMethod } = StripeScript.setup();
62
+ const { getpaymentMethod } = useStripe();
58
63
  const totalPrice = computed(() => {
59
64
  return checkoutStore.config ? checkoutStore.config.calculations.total : checkoutStore.config.total;
60
65
  });
@@ -1,5 +1,5 @@
1
1
  export default function (inputData: any): {
2
- checkoutStore: any;
2
+ checkoutStore: import("pinia").Store<"checkout", import("../../stores/Checkout.js").CheckoutState, {}, {}>;
3
3
  updateShippingAddress: (shippingfield: any) => void;
4
4
  sameAsBilling: (sameasbilling: boolean | undefined, inputData: any) => Promise<void>;
5
5
  UpdateStripe: (inputData: any) => Promise<void>;
@@ -1,4 +1,9 @@
1
1
  import { ref, computed, onMounted } from "vue";
2
+ import { useCheckoutStore } from "../../stores/Checkout.js";
3
+ import { useCountry } from "../Extras/useCountry.js";
4
+ import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
5
+ import useStripe from "./PaymentMethods/useStripe.js";
6
+ import { useAuthStore } from "../../stores/auth.js";
2
7
  export default function(inputData) {
3
8
  const {
4
9
  status,
@@ -11,7 +16,7 @@ export default function(inputData) {
11
16
  signIn,
12
17
  signOut,
13
18
  refresh
14
- } = useAuth();
19
+ } = useAuthStore();
15
20
  const AuthStore = ref();
16
21
  const checkoutStore = useCheckoutStore();
17
22
  const CountryData = useCountry().data;
@@ -103,7 +108,7 @@ export default function(inputData) {
103
108
  });
104
109
  const UpdateStripe = (async (inputData2) => {
105
110
  await checkoutStore.saveToCheckoutSession(inputData2);
106
- const { getpaymentMethod } = StripeScript.setup();
111
+ const { getpaymentMethod } = useStripe();
107
112
  const totalPrice = computed(() => {
108
113
  return checkoutStore.config ? checkoutStore.config.calculations.total : checkoutStore.config.total;
109
114
  });
@@ -1,5 +1,5 @@
1
- export default function (): {
2
- checkoutStore: any;
1
+ export default function (inputData: any): {
2
+ checkoutStore: import("pinia").Store<"checkout", import("../../stores/Checkout.js").CheckoutState, {}, {}>;
3
3
  passwordShow: import("vue").Ref<string, string>;
4
4
  password: import("vue").Ref<string, string>;
5
5
  password_confirmationShow: import("vue").Ref<string, string>;
@@ -7,9 +7,9 @@ export default function (): {
7
7
  UserAccount: import("vue").Ref<boolean, boolean>;
8
8
  CheckUserAccount: (billingDetails: any, userEmail: string) => Promise<void>;
9
9
  CheckingUserAccount: import("vue").Ref<boolean, boolean>;
10
- passwordStrength: any;
11
- passwordStrengthClass: any;
12
- passwordStrengthValue: any;
13
- passwordStrengthWidth: any;
14
- passwordStrengthTextColor: any;
10
+ passwordStrength: import("vue").ComputedRef<"Password must be 8 characters" | "Strong" | "Medium" | "Weak">;
11
+ passwordStrengthClass: import("vue").ComputedRef<"bg-danger" | "bg-success" | "bg-warning">;
12
+ passwordStrengthValue: import("vue").ComputedRef<number>;
13
+ passwordStrengthWidth: import("vue").ComputedRef<string>;
14
+ passwordStrengthTextColor: import("vue").ComputedRef<"text-danger" | "text-success" | "text-black">;
15
15
  };
@@ -1,5 +1,7 @@
1
1
  import { ref } from "vue";
2
- export default function() {
2
+ import { useCheckoutStore } from "../../stores/Checkout.js";
3
+ import { usePasswordFormatter } from "../Extras/usePasswordFormatter.js";
4
+ export default function(inputData) {
3
5
  const checkoutStore = useCheckoutStore();
4
6
  const passwordShow = ref("password");
5
7
  const password = ref("");
@@ -1,4 +1,4 @@
1
- export default function (): {
2
- checkoutStore: any;
1
+ export default function (inputData: any): {
2
+ checkoutStore: import("pinia").Store<"checkout", import("../../stores/Checkout.js").CheckoutState, {}, {}>;
3
3
  updateDeliveryMethod: (inputData: any) => Promise<void>;
4
4
  };
@@ -1,12 +1,13 @@
1
- import StripeScript from "./PaymentMethods/useStripe.js";
2
- export default function() {
1
+ import { useCheckoutStore } from "../../stores/Checkout.js";
2
+ import useStripe from "./PaymentMethods/useStripe.js";
3
+ export default function(inputData) {
3
4
  const checkoutStore = useCheckoutStore();
4
- const updateDeliveryMethod = (async (inputData) => {
5
- await checkoutStore.saveToCheckoutSession(inputData);
6
- const { getpaymentMethod } = StripeScript.setup();
5
+ const updateDeliveryMethod = (async (inputData2) => {
6
+ await checkoutStore.saveToCheckoutSession(inputData2);
7
+ const { getpaymentMethod } = useStripe();
7
8
  const totalPrice = checkoutStore.config ? checkoutStore.config.calculations.total : checkoutStore.config.total;
8
- if (inputData.paymentmethod && inputData.paymentmethod == "web-stripe") {
9
- getpaymentMethod("web-stripe", inputData, totalPrice);
9
+ if (inputData2.paymentmethod && inputData2.paymentmethod == "web-stripe") {
10
+ getpaymentMethod("web-stripe", inputData2, totalPrice);
10
11
  }
11
12
  const cart = [];
12
13
  cart.items = checkoutStore.config.cart;
@@ -0,0 +1,112 @@
1
+ export interface BillingForm {
2
+ id: string | number;
3
+ firstname: string;
4
+ lastname: string;
5
+ saddress: string;
6
+ suburb: string;
7
+ state: string;
8
+ state_id: string | number;
9
+ country: string;
10
+ country_id: string | number;
11
+ postcode: string;
12
+ mobile: string;
13
+ shipping: string | number;
14
+ billing: string | number;
15
+ }
16
+ export declare function useBillingAddress(): {
17
+ billingForm: import("vue").Ref<{
18
+ id: string | number;
19
+ firstname: string;
20
+ lastname: string;
21
+ saddress: string;
22
+ suburb: string;
23
+ state: string;
24
+ state_id: string | number;
25
+ country: string;
26
+ country_id: string | number;
27
+ postcode: string;
28
+ mobile: string;
29
+ shipping: string | number;
30
+ billing: string | number;
31
+ }, BillingForm | {
32
+ id: string | number;
33
+ firstname: string;
34
+ lastname: string;
35
+ saddress: string;
36
+ suburb: string;
37
+ state: string;
38
+ state_id: string | number;
39
+ country: string;
40
+ country_id: string | number;
41
+ postcode: string;
42
+ mobile: string;
43
+ shipping: string | number;
44
+ billing: string | number;
45
+ }>;
46
+ successMessage: import("vue").Ref<string, string>;
47
+ errorMessage: import("vue").Ref<string, string>;
48
+ isEditing: import("vue").Ref<boolean, boolean>;
49
+ loading: import("vue").Ref<boolean, boolean>;
50
+ submitAddressReturn: import("vue").Ref<any, any>;
51
+ user: import("vue").ComputedRef<{
52
+ id: number;
53
+ fullname: string;
54
+ firstname: string;
55
+ lastname: string;
56
+ email: string;
57
+ avatar: string;
58
+ country_id: number | null;
59
+ country: {
60
+ id: number;
61
+ name: string;
62
+ emoji: string;
63
+ } | null;
64
+ state_id: number | null;
65
+ state: string | null;
66
+ suburb: string | null;
67
+ dob: string | null;
68
+ phone: string | null;
69
+ address: string | null;
70
+ mobile: string | null;
71
+ company: string | null;
72
+ addresses: {
73
+ id: number;
74
+ fullname: string | null;
75
+ firstname: string;
76
+ middlename: string | null;
77
+ lastname: string;
78
+ address: string;
79
+ suburb: string;
80
+ state: string | null;
81
+ state_id: number | null;
82
+ country: string;
83
+ country_id: number;
84
+ postcode: string;
85
+ mobile: string;
86
+ shipping: number;
87
+ billing: number;
88
+ }[];
89
+ created_at: string;
90
+ } | null>;
91
+ userBillingAddress: import("vue").ComputedRef<{
92
+ id: number;
93
+ fullname: string | null;
94
+ firstname: string;
95
+ middlename: string | null;
96
+ lastname: string;
97
+ address: string;
98
+ suburb: string;
99
+ state: string | null;
100
+ state_id: number | null;
101
+ country: string;
102
+ country_id: number;
103
+ postcode: string;
104
+ mobile: string;
105
+ shipping: number;
106
+ billing: number;
107
+ } | undefined>;
108
+ clearMessages: () => void;
109
+ cancelEdit: () => void;
110
+ submitAddress: () => Promise<void>;
111
+ resetForm: () => void;
112
+ };