flowrix 1.0.1-beta.83 → 1.0.1-beta.85
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.
- package/dist/module.d.cts +2 -0
- package/package.json +8 -33
- package/dist/module.d.mts +0 -3
- package/dist/module.json +0 -9
- package/dist/module.mjs +0 -338
- package/dist/runtime/composables/Blog/useBlogIndex.d.ts +0 -108
- package/dist/runtime/composables/Blog/useBlogIndex.js +0 -86
- package/dist/runtime/composables/Blog/useBlogMain.d.ts +0 -13
- package/dist/runtime/composables/Blog/useBlogMain.js +0 -7
- package/dist/runtime/composables/Blog/useBlogSidebar.d.ts +0 -7
- package/dist/runtime/composables/Blog/useBlogSidebar.js +0 -37
- package/dist/runtime/composables/Blog/useBlogSingle.d.ts +0 -30
- package/dist/runtime/composables/Blog/useBlogSingle.js +0 -87
- package/dist/runtime/composables/Blog/useMagazineCard.d.ts +0 -13
- package/dist/runtime/composables/Blog/useMagazineCard.js +0 -14
- package/dist/runtime/composables/Blog/useSingleBlogMain.d.ts +0 -20
- package/dist/runtime/composables/Blog/useSingleBlogMain.js +0 -28
- package/dist/runtime/composables/Brand/brand.d.ts +0 -7
- package/dist/runtime/composables/Brand/brand.js +0 -47
- package/dist/runtime/composables/Cart/useCart.d.ts +0 -40
- package/dist/runtime/composables/Cart/useCart.js +0 -10
- package/dist/runtime/composables/Cart/useCartDetail.d.ts +0 -59
- package/dist/runtime/composables/Cart/useCartDetail.js +0 -51
- package/dist/runtime/composables/Category/useCategoryContent.d.ts +0 -9
- package/dist/runtime/composables/Category/useCategoryContent.js +0 -15
- package/dist/runtime/composables/Category/useCategoryGrid.d.ts +0 -40
- package/dist/runtime/composables/Category/useCategoryGrid.js +0 -38
- package/dist/runtime/composables/Category/useCategoryIndex.d.ts +0 -33
- package/dist/runtime/composables/Category/useCategoryIndex.js +0 -65
- package/dist/runtime/composables/Category/useCategoryTop.d.ts +0 -18
- package/dist/runtime/composables/Category/useCategoryTop.js +0 -65
- package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.d.ts +0 -3
- package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.js +0 -22
- package/dist/runtime/composables/Checkout/PaymentMethods/useEway.d.ts +0 -8
- package/dist/runtime/composables/Checkout/PaymentMethods/useEway.js +0 -88
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +0 -52
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +0 -155
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +0 -48
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +0 -90
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.d.ts +0 -15
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +0 -135
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.d.ts +0 -3
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.js +0 -22
- package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +0 -7
- package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.js +0 -43
- package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.d.ts +0 -3
- package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.js +0 -22
- package/dist/runtime/composables/Checkout/useCheckout.d.ts +0 -197
- package/dist/runtime/composables/Checkout/useCheckout.js +0 -374
- package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.d.ts +0 -43
- package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.js +0 -84
- package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.d.ts +0 -55
- package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.js +0 -196
- package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +0 -15
- package/dist/runtime/composables/Checkout/useCreateAccount.js +0 -63
- package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +0 -4
- package/dist/runtime/composables/Checkout/useDeliveryMethod.js +0 -37
- package/dist/runtime/composables/Customer/useBillingAddress.d.ts +0 -112
- package/dist/runtime/composables/Customer/useBillingAddress.js +0 -93
- package/dist/runtime/composables/Customer/useLogin.d.ts +0 -9
- package/dist/runtime/composables/Customer/useLogin.js +0 -34
- package/dist/runtime/composables/Customer/useOrders.d.ts +0 -29
- package/dist/runtime/composables/Customer/useOrders.js +0 -56
- package/dist/runtime/composables/Customer/usePasswordReset.d.ts +0 -26
- package/dist/runtime/composables/Customer/usePasswordReset.js +0 -258
- package/dist/runtime/composables/Customer/useProfile.d.ts +0 -75
- package/dist/runtime/composables/Customer/useProfile.js +0 -106
- package/dist/runtime/composables/Customer/useQuotations.d.ts +0 -32
- package/dist/runtime/composables/Customer/useQuotations.js +0 -40
- package/dist/runtime/composables/Customer/useRegister.d.ts +0 -127
- package/dist/runtime/composables/Customer/useRegister.js +0 -325
- package/dist/runtime/composables/Customer/useShippingAddress.d.ts +0 -121
- package/dist/runtime/composables/Customer/useShippingAddress.js +0 -145
- package/dist/runtime/composables/Customer/useUpdatePassword.d.ts +0 -21
- package/dist/runtime/composables/Customer/useUpdatePassword.js +0 -94
- package/dist/runtime/composables/Customer/useUserCards.d.ts +0 -22
- package/dist/runtime/composables/Customer/useUserCards.js +0 -65
- package/dist/runtime/composables/Customer/useWishlists.d.ts +0 -25
- package/dist/runtime/composables/Customer/useWishlists.js +0 -183
- package/dist/runtime/composables/Extras/useCountry.d.ts +0 -11
- package/dist/runtime/composables/Extras/useCountry.js +0 -12
- package/dist/runtime/composables/Extras/useDateFormatter.d.ts +0 -4
- package/dist/runtime/composables/Extras/useDateFormatter.js +0 -20
- package/dist/runtime/composables/Extras/useNumberOnly.d.ts +0 -5
- package/dist/runtime/composables/Extras/useNumberOnly.js +0 -21
- package/dist/runtime/composables/Extras/usePasswordFormatter.d.ts +0 -8
- package/dist/runtime/composables/Extras/usePasswordFormatter.js +0 -61
- package/dist/runtime/composables/Extras/useSrcSets.d.ts +0 -8
- package/dist/runtime/composables/Extras/useSrcSets.js +0 -26
- package/dist/runtime/composables/Extras/useTogglePassword.d.ts +0 -4
- package/dist/runtime/composables/Extras/useTogglePassword.js +0 -11
- package/dist/runtime/composables/Footer/useFooter.d.ts +0 -14
- package/dist/runtime/composables/Footer/useFooter.js +0 -61
- package/dist/runtime/composables/Header/useHeader.d.ts +0 -14
- package/dist/runtime/composables/Header/useHeader.js +0 -67
- package/dist/runtime/composables/Menu/MainMenu.d.ts +0 -4
- package/dist/runtime/composables/Menu/MainMenu.js +0 -17
- package/dist/runtime/composables/Product/CustomProduct/useAttributeType.d.ts +0 -3
- package/dist/runtime/composables/Product/CustomProduct/useAttributeType.js +0 -20
- package/dist/runtime/composables/Product/CustomProduct/useAttributes.d.ts +0 -70
- package/dist/runtime/composables/Product/CustomProduct/useAttributes.js +0 -68
- package/dist/runtime/composables/Product/CustomProduct/useCustomProduct.d.ts +0 -74
- package/dist/runtime/composables/Product/CustomProduct/useCustomProduct.js +0 -107
- package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.d.ts +0 -159
- package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +0 -2080
- package/dist/runtime/composables/Product/CustomProduct/useSingleAttribute.d.ts +0 -4
- package/dist/runtime/composables/Product/CustomProduct/useSingleAttribute.js +0 -27
- package/dist/runtime/composables/Product/CustomProduct/useSingleStep.d.ts +0 -68
- package/dist/runtime/composables/Product/CustomProduct/useSingleStep.js +0 -21
- package/dist/runtime/composables/Product/CustomProduct/useSingleValue.d.ts +0 -67
- package/dist/runtime/composables/Product/CustomProduct/useSingleValue.js +0 -15
- package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +0 -74
- package/dist/runtime/composables/Product/CustomProduct/useSteps.js +0 -78
- package/dist/runtime/composables/Product/simpleProduct/useSimpleProduct.d.ts +0 -25
- package/dist/runtime/composables/Product/simpleProduct/useSimpleProduct.js +0 -77
- package/dist/runtime/composables/Product/useProductCard.d.ts +0 -13
- package/dist/runtime/composables/Product/useProductCard.js +0 -88
- package/dist/runtime/composables/Product/useProductComponent.d.ts +0 -5
- package/dist/runtime/composables/Product/useProductComponent.js +0 -23
- package/dist/runtime/composables/Product/useProductSlug.d.ts +0 -8
- package/dist/runtime/composables/Product/useProductSlug.js +0 -25
- package/dist/runtime/composables/Product/useQuickView.d.ts +0 -8
- package/dist/runtime/composables/Product/useQuickView.js +0 -27
- package/dist/runtime/composables/Product/useService.d.ts +0 -17
- package/dist/runtime/composables/Product/useService.js +0 -64
- package/dist/runtime/composables/Product/useTemplate.d.ts +0 -5
- package/dist/runtime/composables/Product/useTemplate.js +0 -21
- package/dist/runtime/composables/Samples/useSamples.d.ts +0 -10
- package/dist/runtime/composables/Samples/useSamples.js +0 -36
- package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +0 -6
- package/dist/runtime/composables/SideBar/Filters/useFilters.js +0 -51
- package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +0 -5
- package/dist/runtime/composables/SideBar/Filters/useSorting.js +0 -27
- package/dist/runtime/composables/SideBar/useSideBar.d.ts +0 -8
- package/dist/runtime/composables/SideBar/useSideBar.js +0 -68
- package/dist/runtime/composables/index.d.ts +0 -78
- package/dist/runtime/composables/index.js +0 -78
- package/dist/runtime/composables/types.d.ts +0 -5
- package/dist/runtime/composables/types.js +0 -0
- package/dist/runtime/composables/useAddToCart.d.ts +0 -28
- package/dist/runtime/composables/useAddToCart.js +0 -111
- package/dist/runtime/composables/useAddresses.d.ts +0 -18
- package/dist/runtime/composables/useAddresses.js +0 -126
- package/dist/runtime/composables/useCards.d.ts +0 -19
- package/dist/runtime/composables/useCards.js +0 -73
- package/dist/runtime/composables/useClientApi.d.ts +0 -23
- package/dist/runtime/composables/useClientApi.js +0 -53
- package/dist/runtime/composables/useDataLayer.d.ts +0 -18
- package/dist/runtime/composables/useDataLayer.js +0 -386
- package/dist/runtime/composables/useDynamicHtmlRenderer.d.ts +0 -4
- package/dist/runtime/composables/useDynamicHtmlRenderer.js +0 -33
- package/dist/runtime/composables/useLocation.d.ts +0 -13
- package/dist/runtime/composables/useLocation.js +0 -32
- package/dist/runtime/composables/useLocations.d.ts +0 -12
- package/dist/runtime/composables/useLocations.js +0 -53
- package/dist/runtime/composables/useMetaLayer.d.ts +0 -10
- package/dist/runtime/composables/useMetaLayer.js +0 -263
- package/dist/runtime/composables/useQuotationCheckout.d.ts +0 -78
- package/dist/runtime/composables/useQuotationCheckout.js +0 -138
- package/dist/runtime/composables/useSearch.d.ts +0 -7
- package/dist/runtime/composables/useSearch.js +0 -40
- package/dist/runtime/composables/useSubscriptions.d.ts +0 -13
- package/dist/runtime/composables/useSubscriptions.js +0 -58
- package/dist/runtime/composables/useTikTokDatalayer.d.ts +0 -8
- package/dist/runtime/composables/useTikTokDatalayer.js +0 -165
- package/dist/runtime/composables/useWebforms.d.ts +0 -16
- package/dist/runtime/composables/useWebforms.js +0 -75
- package/dist/runtime/middleware/flowrix.d.ts +0 -7
- package/dist/runtime/middleware/flowrix.js +0 -60
- package/dist/runtime/plugin.d.ts +0 -2
- package/dist/runtime/plugin.js +0 -5
- package/dist/runtime/plugins/persistedstate.client.d.ts +0 -2
- package/dist/runtime/plugins/persistedstate.client.js +0 -9
- package/dist/runtime/server/api/albums.d.ts +0 -2
- package/dist/runtime/server/api/albums.js +0 -18
- package/dist/runtime/server/api/auth/forgot.d.ts +0 -5
- package/dist/runtime/server/api/auth/forgot.js +0 -44
- package/dist/runtime/server/api/auth/login.d.ts +0 -11
- package/dist/runtime/server/api/auth/login.js +0 -68
- package/dist/runtime/server/api/auth/logout.d.ts +0 -5
- package/dist/runtime/server/api/auth/logout.js +0 -23
- package/dist/runtime/server/api/auth/register.d.ts +0 -2
- package/dist/runtime/server/api/auth/register.js +0 -51
- package/dist/runtime/server/api/auth/session.get.d.ts +0 -2
- package/dist/runtime/server/api/auth/session.get.js +0 -46
- package/dist/runtime/server/api/auth/user/reset-password.d.ts +0 -5
- package/dist/runtime/server/api/auth/user/reset-password.js +0 -40
- package/dist/runtime/server/api/auth/user/session.d.ts +0 -2
- package/dist/runtime/server/api/auth/user/session.js +0 -43
- package/dist/runtime/server/api/auth/user/verify-token.d.ts +0 -6
- package/dist/runtime/server/api/auth/user/verify-token.js +0 -50
- package/dist/runtime/server/api/banners.d.ts +0 -3
- package/dist/runtime/server/api/banners.js +0 -41
- package/dist/runtime/server/api/brand/[...slug].d.ts +0 -3
- package/dist/runtime/server/api/brand/[...slug].js +0 -58
- package/dist/runtime/server/api/brand/index.d.ts +0 -2
- package/dist/runtime/server/api/brand/index.js +0 -23
- package/dist/runtime/server/api/cache/[...slug].delete.d.ts +0 -2
- package/dist/runtime/server/api/cache/[...slug].delete.js +0 -40
- package/dist/runtime/server/api/cache/clean.get.d.ts +0 -5
- package/dist/runtime/server/api/cache/clean.get.js +0 -16
- package/dist/runtime/server/api/cart/[slug]/add.d.ts +0 -2
- package/dist/runtime/server/api/cart/[slug]/add.js +0 -21
- package/dist/runtime/server/api/cart/[slug]/update.d.ts +0 -2
- package/dist/runtime/server/api/cart/[slug]/update.js +0 -21
- package/dist/runtime/server/api/cart/related.d.ts +0 -2
- package/dist/runtime/server/api/cart/related.js +0 -21
- package/dist/runtime/server/api/cart/remove.d.ts +0 -2
- package/dist/runtime/server/api/cart/remove.js +0 -21
- package/dist/runtime/server/api/cart/service/[slug]/add.d.ts +0 -2
- package/dist/runtime/server/api/cart/service/[slug]/add.js +0 -16
- package/dist/runtime/server/api/catalog/categories.d.ts +0 -3
- package/dist/runtime/server/api/catalog/categories.js +0 -44
- package/dist/runtime/server/api/catalog/categoriesall.d.ts +0 -3
- package/dist/runtime/server/api/catalog/categoriesall.js +0 -44
- package/dist/runtime/server/api/catalog/featured.d.ts +0 -3
- package/dist/runtime/server/api/catalog/featured.js +0 -42
- package/dist/runtime/server/api/catalog/samples.d.ts +0 -3
- package/dist/runtime/server/api/catalog/samples.js +0 -45
- package/dist/runtime/server/api/catalog/search.d.ts +0 -3
- package/dist/runtime/server/api/catalog/search.js +0 -45
- package/dist/runtime/server/api/category/[...slug].d.ts +0 -3
- package/dist/runtime/server/api/category/[...slug].js +0 -58
- package/dist/runtime/server/api/checkout/applyCoupon.d.ts +0 -2
- package/dist/runtime/server/api/checkout/applyCoupon.js +0 -20
- package/dist/runtime/server/api/checkout/configs.d.ts +0 -2
- package/dist/runtime/server/api/checkout/configs.js +0 -19
- package/dist/runtime/server/api/checkout/countries.d.ts +0 -2
- package/dist/runtime/server/api/checkout/countries.js +0 -17
- package/dist/runtime/server/api/checkout/paymentmethod.d.ts +0 -2
- package/dist/runtime/server/api/checkout/paymentmethod.js +0 -20
- package/dist/runtime/server/api/checkout/quotation/[slug].d.ts +0 -2
- package/dist/runtime/server/api/checkout/quotation/[slug].js +0 -21
- package/dist/runtime/server/api/checkout/quotation/guest/[slug].d.ts +0 -2
- package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +0 -37
- package/dist/runtime/server/api/checkout/quotation/guest/customer.d.ts +0 -2
- package/dist/runtime/server/api/checkout/quotation/guest/customer.js +0 -21
- package/dist/runtime/server/api/checkout/quotation/submit/[slug].d.ts +0 -2
- package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +0 -23
- package/dist/runtime/server/api/cmspost/[...slug].d.ts +0 -3
- package/dist/runtime/server/api/cmspost/[...slug].js +0 -49
- package/dist/runtime/server/api/cmspost/all.d.ts +0 -3
- package/dist/runtime/server/api/cmspost/all.js +0 -17
- package/dist/runtime/server/api/company/profile.d.ts +0 -2
- package/dist/runtime/server/api/company/profile.js +0 -18
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.d.ts +0 -3
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +0 -19
- package/dist/runtime/server/api/contact-center/webforms/create.d.ts +0 -2
- package/dist/runtime/server/api/contact-center/webforms/create.js +0 -16
- package/dist/runtime/server/api/countries.d.ts +0 -2
- package/dist/runtime/server/api/countries.js +0 -35
- package/dist/runtime/server/api/customer/address/add.d.ts +0 -14
- package/dist/runtime/server/api/customer/address/add.js +0 -33
- package/dist/runtime/server/api/customer/address/delete.d.ts +0 -20
- package/dist/runtime/server/api/customer/address/delete.js +0 -37
- package/dist/runtime/server/api/customer/address/setshipping.d.ts +0 -20
- package/dist/runtime/server/api/customer/address/setshipping.js +0 -41
- package/dist/runtime/server/api/customer/address/update.d.ts +0 -20
- package/dist/runtime/server/api/customer/address/update.js +0 -42
- package/dist/runtime/server/api/customer/cards/delete.d.ts +0 -2
- package/dist/runtime/server/api/customer/cards/delete.js +0 -23
- package/dist/runtime/server/api/customer/cards/get.d.ts +0 -2
- package/dist/runtime/server/api/customer/cards/get.js +0 -17
- package/dist/runtime/server/api/customer/change-password.d.ts +0 -14
- package/dist/runtime/server/api/customer/change-password.js +0 -34
- package/dist/runtime/server/api/customer/checkout.d.ts +0 -2
- package/dist/runtime/server/api/customer/checkout.js +0 -20
- package/dist/runtime/server/api/customer/orders.d.ts +0 -2
- package/dist/runtime/server/api/customer/orders.js +0 -17
- package/dist/runtime/server/api/customer/profile/update.d.ts +0 -14
- package/dist/runtime/server/api/customer/profile/update.js +0 -34
- package/dist/runtime/server/api/customer/quotations.d.ts +0 -2
- package/dist/runtime/server/api/customer/quotations.js +0 -17
- package/dist/runtime/server/api/customer/search.d.ts +0 -2
- package/dist/runtime/server/api/customer/search.js +0 -15
- package/dist/runtime/server/api/customer/tax-invoice.d.ts +0 -8
- package/dist/runtime/server/api/customer/tax-invoice.js +0 -36
- package/dist/runtime/server/api/customer/wishlist/add.d.ts +0 -2
- package/dist/runtime/server/api/customer/wishlist/add.js +0 -30
- package/dist/runtime/server/api/customer/wishlist/createWishList.d.ts +0 -2
- package/dist/runtime/server/api/customer/wishlist/createWishList.js +0 -29
- package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.d.ts +0 -2
- package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +0 -46
- package/dist/runtime/server/api/customer/wishlist/deleteWishList.d.ts +0 -2
- package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +0 -30
- package/dist/runtime/server/api/customer/wishlist/get.d.ts +0 -2
- package/dist/runtime/server/api/customer/wishlist/get.js +0 -17
- package/dist/runtime/server/api/customer/wishlist/getWishListItems.d.ts +0 -2
- package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +0 -21
- package/dist/runtime/server/api/customer/wishlist/updateWishList.d.ts +0 -2
- package/dist/runtime/server/api/customer/wishlist/updateWishList.js +0 -30
- package/dist/runtime/server/api/featured.d.ts +0 -2
- package/dist/runtime/server/api/featured.js +0 -16
- package/dist/runtime/server/api/generate/sitemap.get.d.ts +0 -5
- package/dist/runtime/server/api/generate/sitemap.get.js +0 -13
- package/dist/runtime/server/api/location.d.ts +0 -2
- package/dist/runtime/server/api/location.js +0 -13
- package/dist/runtime/server/api/nav/[id]/links.d.ts +0 -2
- package/dist/runtime/server/api/nav/[id]/links.js +0 -19
- package/dist/runtime/server/api/page/[...slug].d.ts +0 -3
- package/dist/runtime/server/api/page/[...slug].js +0 -49
- package/dist/runtime/server/api/product/[...slug].d.ts +0 -3
- package/dist/runtime/server/api/product/[...slug].js +0 -47
- package/dist/runtime/server/api/quickview/[slug].d.ts +0 -2
- package/dist/runtime/server/api/quickview/[slug].js +0 -16
- package/dist/runtime/server/api/samples.d.ts +0 -3
- package/dist/runtime/server/api/samples.js +0 -20
- package/dist/runtime/server/api/search.d.ts +0 -3
- package/dist/runtime/server/api/search.js +0 -15
- package/dist/runtime/server/api/service/[slug].d.ts +0 -3
- package/dist/runtime/server/api/service/[slug].js +0 -52
- package/dist/runtime/server/api/service/availability.d.ts +0 -2
- package/dist/runtime/server/api/service/availability.js +0 -27
- package/dist/runtime/server/api/service/getall.d.ts +0 -3
- package/dist/runtime/server/api/service/getall.js +0 -52
- package/dist/runtime/server/api/shop.d.ts +0 -3
- package/dist/runtime/server/api/shop.js +0 -15
- package/dist/runtime/server/api/subscribe.d.ts +0 -2
- package/dist/runtime/server/api/subscribe.js +0 -16
- package/dist/runtime/server/api/v2/[...slug].d.ts +0 -3
- package/dist/runtime/server/api/v2/[...slug].js +0 -11
- package/dist/runtime/server/api/webform.d.ts +0 -3
- package/dist/runtime/server/api/webform.js +0 -16
- package/dist/runtime/server/tsconfig.json +0 -3
- package/dist/runtime/stores/Booking.d.ts +0 -99
- package/dist/runtime/stores/Booking.js +0 -96
- package/dist/runtime/stores/Cart.d.ts +0 -79
- package/dist/runtime/stores/Cart.js +0 -310
- package/dist/runtime/stores/Categories.d.ts +0 -13
- package/dist/runtime/stores/Categories.js +0 -90
- package/dist/runtime/stores/Checkout.d.ts +0 -79
- package/dist/runtime/stores/Checkout.js +0 -208
- package/dist/runtime/stores/IpLocation.d.ts +0 -18
- package/dist/runtime/stores/IpLocation.js +0 -29
- package/dist/runtime/stores/NavMenu.d.ts +0 -15
- package/dist/runtime/stores/NavMenu.js +0 -26
- package/dist/runtime/stores/Search.d.ts +0 -5
- package/dist/runtime/stores/Search.js +0 -33
- package/dist/runtime/stores/Services.d.ts +0 -7
- package/dist/runtime/stores/Services.js +0 -49
- package/dist/runtime/stores/Utilities.d.ts +0 -5
- package/dist/runtime/stores/Utilities.js +0 -11
- package/dist/runtime/stores/addresses.d.ts +0 -15
- package/dist/runtime/stores/addresses.js +0 -31
- package/dist/runtime/stores/auth.d.ts +0 -59
- package/dist/runtime/stores/auth.js +0 -441
- package/dist/runtime/stores/cards.d.ts +0 -15
- package/dist/runtime/stores/cards.js +0 -22
- package/dist/runtime/stores/compareStore.d.ts +0 -7
- package/dist/runtime/stores/compareStore.js +0 -45
- package/dist/runtime/stores/countries.d.ts +0 -8
- package/dist/runtime/stores/countries.js +0 -15
- package/dist/runtime/stores/index.d.ts +0 -26
- package/dist/runtime/stores/index.js +0 -24
- package/dist/runtime/stores/locations.d.ts +0 -11
- package/dist/runtime/stores/locations.js +0 -19
- package/dist/runtime/stores/orders.d.ts +0 -16
- package/dist/runtime/stores/orders.js +0 -19
- package/dist/runtime/stores/product/README.md +0 -141
- package/dist/runtime/stores/product/slug.d.ts +0 -165
- package/dist/runtime/stores/product/slug.js +0 -91
- package/dist/runtime/stores/product.d.ts +0 -5
- package/dist/runtime/stores/product.js +0 -38
- package/dist/runtime/stores/quotations.d.ts +0 -12
- package/dist/runtime/stores/quotations.js +0 -19
- package/dist/runtime/stores/subscriptions.d.ts +0 -11
- package/dist/runtime/stores/subscriptions.js +0 -19
- package/dist/runtime/stores/useCompanyProfile.d.ts +0 -7
- package/dist/runtime/stores/useCompanyProfile.js +0 -22
- package/dist/runtime/stores/useNavMenuStore.d.ts +0 -5
- package/dist/runtime/stores/useNavMenuStore.js +0 -23
- package/dist/runtime/stores/webforms.d.ts +0 -18
- package/dist/runtime/stores/webforms.js +0 -23
- package/dist/runtime/stores/wishlists.d.ts +0 -136
- package/dist/runtime/stores/wishlists.js +0 -249
- package/dist/runtime/utils/api.d.ts +0 -13
- package/dist/runtime/utils/api.js +0 -98
- package/dist/runtime/utils/companyProfile.d.ts +0 -22
- package/dist/runtime/utils/companyProfile.js +0 -21
- package/dist/runtime/utils/htmlCache.d.ts +0 -5
- package/dist/runtime/utils/htmlCache.js +0 -64
- package/dist/types.d.mts +0 -7
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { useCompanyProfile } from "../stores/useCompanyProfile.js";
|
|
2
|
-
const getTtq = () => {
|
|
3
|
-
if (process.client && typeof window !== "undefined" && window.ttq) {
|
|
4
|
-
return window.ttq;
|
|
5
|
-
}
|
|
6
|
-
return null;
|
|
7
|
-
};
|
|
8
|
-
export function TikTok_page_view(to) {
|
|
9
|
-
const ttq = getTtq();
|
|
10
|
-
if (ttq) {
|
|
11
|
-
ttq.page();
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export function TikTok_view_item(product, price = 0, rp = 0) {
|
|
15
|
-
const ttq = getTtq();
|
|
16
|
-
if (!ttq || !product) return;
|
|
17
|
-
let discount = rp > price ? Number((rp - price).toFixed(2)) : 0;
|
|
18
|
-
ttq.track("ViewContent", {
|
|
19
|
-
type: "product",
|
|
20
|
-
contents: [{
|
|
21
|
-
content_id: "SKU_" + product?.sku,
|
|
22
|
-
content_type: "product",
|
|
23
|
-
quantity: 1,
|
|
24
|
-
description: product?.category,
|
|
25
|
-
content_name: product?.name,
|
|
26
|
-
price: Number(rp) > 0 ? Number(rp) : Number(price),
|
|
27
|
-
currency: useCompanyProfile().profile?.currencyCode,
|
|
28
|
-
value: price
|
|
29
|
-
}]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
export function TikTok_add_to_cart(lastitem = "") {
|
|
33
|
-
const ttq = getTtq();
|
|
34
|
-
if (!ttq || !lastitem) return;
|
|
35
|
-
let price = lastitem.pricefloat;
|
|
36
|
-
let discount = lastitem.rpfloat > lastitem.pricefloat ? Number((lastitem.rpfloat - lastitem.pricefloat).toFixed(2)) : 0;
|
|
37
|
-
const ecomarceCartItems = [{
|
|
38
|
-
content_id: "SKU_" + lastitem.sku,
|
|
39
|
-
content_type: "product",
|
|
40
|
-
content_name: lastitem.name,
|
|
41
|
-
price,
|
|
42
|
-
quantity: 1,
|
|
43
|
-
discount,
|
|
44
|
-
location_id: "online store"
|
|
45
|
-
}];
|
|
46
|
-
ttq.track("AddToCart", {
|
|
47
|
-
contents: ecomarceCartItems,
|
|
48
|
-
value: price,
|
|
49
|
-
currency: useCompanyProfile().profile?.currencyCode
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
export function TikTok_view_cart(cart = "") {
|
|
53
|
-
const ttq = getTtq();
|
|
54
|
-
if (!ttq || !cart?.items) return;
|
|
55
|
-
const ecomarceCartItems = Object.values(cart.items).map((item) => {
|
|
56
|
-
let price = item.pricefloat;
|
|
57
|
-
let discount = item.rpfloat > item.pricefloat ? Number((item.rpfloat - item.pricefloat).toFixed(2)) : 0;
|
|
58
|
-
return {
|
|
59
|
-
content_id: "SKU_" + item.sku,
|
|
60
|
-
content_name: item.name,
|
|
61
|
-
content_type: "product",
|
|
62
|
-
quantity: item.qty,
|
|
63
|
-
price,
|
|
64
|
-
discount,
|
|
65
|
-
item_category: item.category
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
ttq.track("ViewCart", {
|
|
69
|
-
contents: ecomarceCartItems,
|
|
70
|
-
value: cart.totals.total,
|
|
71
|
-
currency: useCompanyProfile().profile?.currencyCode
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
export function TikTok_remove_from_cart(lastitem = "") {
|
|
75
|
-
const ttq = getTtq();
|
|
76
|
-
if (!ttq || !lastitem) return;
|
|
77
|
-
let price = lastitem.pricefloat;
|
|
78
|
-
let discount = lastitem.rpfloat > lastitem.pricefloat ? Number((lastitem.rpfloat - lastitem.pricefloat).toFixed(2)) : 0;
|
|
79
|
-
const ecomarceCartItems = [{
|
|
80
|
-
content_id: "SKU_" + lastitem.sku,
|
|
81
|
-
content_type: "product",
|
|
82
|
-
content_name: lastitem.name,
|
|
83
|
-
price,
|
|
84
|
-
quantity: lastitem.qty || 1,
|
|
85
|
-
discount,
|
|
86
|
-
location_id: "online store"
|
|
87
|
-
}];
|
|
88
|
-
ttq.track("RemoveFromCart", {
|
|
89
|
-
contents: ecomarceCartItems,
|
|
90
|
-
value: price,
|
|
91
|
-
currency: useCompanyProfile().profile?.currencyCode
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
export function TikTok_begin_checkout(cart = "") {
|
|
95
|
-
const ttq = getTtq();
|
|
96
|
-
if (!ttq || !cart?.items) return;
|
|
97
|
-
const ecomarceCartItems = Object.values(cart.items).map((item) => {
|
|
98
|
-
let price = item.pricefloat;
|
|
99
|
-
let discount = item.rpfloat > item.pricefloat ? Number((item.rpfloat - item.pricefloat).toFixed(2)) : 0;
|
|
100
|
-
return {
|
|
101
|
-
content_id: "SKU_" + item.sku,
|
|
102
|
-
content_name: item.name,
|
|
103
|
-
content_type: "product",
|
|
104
|
-
quantity: item.qty,
|
|
105
|
-
price,
|
|
106
|
-
discount,
|
|
107
|
-
item_category: item.category
|
|
108
|
-
};
|
|
109
|
-
});
|
|
110
|
-
ttq.track("InitiateCheckout", {
|
|
111
|
-
contents: ecomarceCartItems,
|
|
112
|
-
value: cart.totals.total,
|
|
113
|
-
currency: useCompanyProfile().profile?.currencyCode
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
export function TikTok_add_payment_info(cart = "", payment_type = "") {
|
|
117
|
-
const ttq = getTtq();
|
|
118
|
-
if (!ttq || !cart?.items) return;
|
|
119
|
-
const ecomarceCartItems = Object.values(cart.items).map((item) => {
|
|
120
|
-
let price = item.pricefloat;
|
|
121
|
-
let discount = item.rpfloat > item.pricefloat ? Number((item.rpfloat - item.pricefloat).toFixed(2)) : 0;
|
|
122
|
-
return {
|
|
123
|
-
content_id: "SKU_" + item.sku,
|
|
124
|
-
content_name: item.name,
|
|
125
|
-
content_type: "product",
|
|
126
|
-
quantity: item.qty,
|
|
127
|
-
price,
|
|
128
|
-
discount,
|
|
129
|
-
item_category: item.category
|
|
130
|
-
};
|
|
131
|
-
});
|
|
132
|
-
ttq.track("AddPaymentInfo", {
|
|
133
|
-
contents: ecomarceCartItems,
|
|
134
|
-
payment_type,
|
|
135
|
-
value: cart.totals.total,
|
|
136
|
-
currency: useCompanyProfile().profile?.currencyCode
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
export function TikTok_purchase(orderData = "", cart = "") {
|
|
140
|
-
const ttq = getTtq();
|
|
141
|
-
if (!ttq || !cart?.items || !orderData) return;
|
|
142
|
-
const purchaseitems = Object.values(cart.items).map((item) => {
|
|
143
|
-
let price = item.pricefloat;
|
|
144
|
-
let discount = item.rpfloat > item.pricefloat ? Number((item.rpfloat - item.pricefloat).toFixed(2)) : 0;
|
|
145
|
-
return {
|
|
146
|
-
content_id: "SKU_" + item.sku,
|
|
147
|
-
content_name: item.name,
|
|
148
|
-
content_type: "product",
|
|
149
|
-
quantity: item.qty,
|
|
150
|
-
price,
|
|
151
|
-
discount,
|
|
152
|
-
item_category: item.category
|
|
153
|
-
};
|
|
154
|
-
});
|
|
155
|
-
ttq.track("Purchase", {
|
|
156
|
-
contents: purchaseitems,
|
|
157
|
-
value: orderData.grandtotalFloat,
|
|
158
|
-
currency: useCompanyProfile().profile?.currencyCode,
|
|
159
|
-
transaction_id: orderData.order_no,
|
|
160
|
-
affiliation: "online Store",
|
|
161
|
-
tax: orderData.tax,
|
|
162
|
-
shipping: orderData.shipping,
|
|
163
|
-
coupon: orderData.vouchercode
|
|
164
|
-
});
|
|
165
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type WebForm, type WebFormData } from '../stores/webforms.js';
|
|
2
|
-
export interface ApiResponse<T> {
|
|
3
|
-
status: string;
|
|
4
|
-
message: string | Record<string, string[]> | null;
|
|
5
|
-
data: T | null;
|
|
6
|
-
}
|
|
7
|
-
export declare function useWebforms(): {
|
|
8
|
-
fetchWebform: (id: number) => Promise<ApiResponse<WebForm>>;
|
|
9
|
-
submitInquiry: (formData: WebFormData, recaptchaToken?: string) => Promise<ApiResponse<any>>;
|
|
10
|
-
webform: import("vue").ComputedRef<{
|
|
11
|
-
id: number;
|
|
12
|
-
} | null>;
|
|
13
|
-
webFormReturn: import("vue").ComputedRef<any>;
|
|
14
|
-
loading: import("vue").ComputedRef<boolean>;
|
|
15
|
-
error: import("vue").ComputedRef<string | null>;
|
|
16
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
|
-
import { useWebformsStore } from "../stores/webforms.js";
|
|
3
|
-
import { useApi } from "../utils/api.js";
|
|
4
|
-
function formatErrorMessage(message) {
|
|
5
|
-
if (!message) return "An error occurred";
|
|
6
|
-
if (typeof message === "string") {
|
|
7
|
-
return message;
|
|
8
|
-
}
|
|
9
|
-
const errorMessages = [];
|
|
10
|
-
for (const [field, errors] of Object.entries(message)) {
|
|
11
|
-
if (Array.isArray(errors)) {
|
|
12
|
-
errorMessages.push(...errors);
|
|
13
|
-
} else {
|
|
14
|
-
errorMessages.push(String(errors));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return errorMessages.join(", ");
|
|
18
|
-
}
|
|
19
|
-
export function useWebforms() {
|
|
20
|
-
const store = useWebformsStore();
|
|
21
|
-
const { get, post } = useApi();
|
|
22
|
-
async function fetchWebform(id) {
|
|
23
|
-
store.setLoading(true);
|
|
24
|
-
store.setError(null);
|
|
25
|
-
try {
|
|
26
|
-
const response = await get(`contact-center/webforms/${id}/details`);
|
|
27
|
-
if (response.status === "Success" && response.data) {
|
|
28
|
-
store.setWebform(response.data);
|
|
29
|
-
return response;
|
|
30
|
-
} else {
|
|
31
|
-
const errorMessage = formatErrorMessage(response.message);
|
|
32
|
-
store.setError(errorMessage);
|
|
33
|
-
throw new Error(errorMessage);
|
|
34
|
-
}
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.error("Fetch webform error:", error);
|
|
37
|
-
const errorMessage = error.data ? formatErrorMessage(error.data.message) : error.message || "Failed to fetch webform";
|
|
38
|
-
store.setError(errorMessage);
|
|
39
|
-
throw new Error(errorMessage);
|
|
40
|
-
} finally {
|
|
41
|
-
store.setLoading(false);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
async function submitInquiry(formData, recaptchaToken = "") {
|
|
45
|
-
store.setLoading(true);
|
|
46
|
-
store.setError(null);
|
|
47
|
-
try {
|
|
48
|
-
const data = { ...formData, recaptcha: recaptchaToken };
|
|
49
|
-
const response = await post("/contact-center/webforms/create", data);
|
|
50
|
-
if (response.status === "Success") {
|
|
51
|
-
store.setWebFormReturn(response);
|
|
52
|
-
return response;
|
|
53
|
-
} else {
|
|
54
|
-
const errorMessage = formatErrorMessage(response.message);
|
|
55
|
-
store.setError(errorMessage);
|
|
56
|
-
throw new Error(errorMessage);
|
|
57
|
-
}
|
|
58
|
-
} catch (error) {
|
|
59
|
-
console.error("Submit inquiry error:", error);
|
|
60
|
-
const errorMessage = error.data ? formatErrorMessage(error.data.message) : error.message || "Failed to submit inquiry";
|
|
61
|
-
store.setError(errorMessage);
|
|
62
|
-
throw new Error(errorMessage);
|
|
63
|
-
} finally {
|
|
64
|
-
store.setLoading(false);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
fetchWebform,
|
|
69
|
-
submitInquiry,
|
|
70
|
-
webform: computed(() => store.webform),
|
|
71
|
-
webFormReturn: computed(() => store.webFormReturn),
|
|
72
|
-
loading: computed(() => store.loading),
|
|
73
|
-
error: computed(() => store.error)
|
|
74
|
-
};
|
|
75
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const flowrixApi: {
|
|
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>;
|
|
7
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
const isServer = typeof process !== "undefined" && process.server;
|
|
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;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
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.public?.FLOWRIX_API_KEY || "";
|
|
22
|
-
const FLOWRIX_API_SECRET = config.public?.FLOWRIX_API_SECRET || "";
|
|
23
|
-
const FLOWRIX_API_ORIGIN = config.public?.FLOWRIX_API_ORIGIN || "";
|
|
24
|
-
let FLOWRIX_API_BASE = config.public?.FLOWRIX_API_BASE_V2 || "";
|
|
25
|
-
const cookiesObj = parseCookies(config.cookies || "");
|
|
26
|
-
const authToken = cookiesObj["authToken"];
|
|
27
|
-
const headers = {
|
|
28
|
-
"x-public-key": FLOWRIX_API_KEY,
|
|
29
|
-
"x-session-token": getCookie("x-session-token"),
|
|
30
|
-
"Access-Control-Expose-Headers": "x-session-token",
|
|
31
|
-
"authorization": `Bearer ${authToken}`,
|
|
32
|
-
"Origin": FLOWRIX_API_ORIGIN,
|
|
33
|
-
...options.headers
|
|
34
|
-
};
|
|
35
|
-
try {
|
|
36
|
-
const response = await $fetch(`${FLOWRIX_API_BASE}${endpoint}`, {
|
|
37
|
-
method,
|
|
38
|
-
...options,
|
|
39
|
-
headers,
|
|
40
|
-
onResponse({ response: response2 }) {
|
|
41
|
-
const token = response2.headers.get("x-session-token");
|
|
42
|
-
if (token) {
|
|
43
|
-
if (process.client) {
|
|
44
|
-
document.cookie = `x-session-token=${token}; path=/; max-age=3600; secure; SameSite=Lax`;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return response;
|
|
50
|
-
} catch (error) {
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export const flowrixApi = {
|
|
55
|
-
get: (endpoint, config = {}, options = {}) => request("get", config, endpoint, options),
|
|
56
|
-
post: (endpoint, config = {}, options = {}) => request("post", config, endpoint, options),
|
|
57
|
-
put: (endpoint, config = {}, options = {}) => request("put", config, endpoint, options),
|
|
58
|
-
patch: (endpoint, config = {}, options = {}) => request("patch", config, endpoint, options),
|
|
59
|
-
delete: (endpoint, config = {}, options = {}) => request("delete", config, endpoint, options)
|
|
60
|
-
};
|
package/dist/runtime/plugin.d.ts
DELETED
package/dist/runtime/plugin.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
|
2
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
3
|
-
if (nuxtApp?.$pinia) {
|
|
4
|
-
nuxtApp.$pinia.use(piniaPluginPersistedstate);
|
|
5
|
-
} else {
|
|
6
|
-
const { $pinia } = useNuxtApp();
|
|
7
|
-
if ($pinia) $pinia.use(piniaPluginPersistedstate);
|
|
8
|
-
}
|
|
9
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineEventHandler, setResponseStatus } from "h3";
|
|
2
|
-
import { $fetch } from "ofetch";
|
|
3
|
-
export default defineEventHandler(async (event) => {
|
|
4
|
-
try {
|
|
5
|
-
const albums = await $fetch(`${process.env.FLOWRIX_API_BASE}albums`, {
|
|
6
|
-
method: "GET",
|
|
7
|
-
headers: {
|
|
8
|
-
"x-public-key": process.env.FLOWRIX_API_KEY,
|
|
9
|
-
"x-api-secret": process.env.FLOWRIX_API_SECRET,
|
|
10
|
-
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
return albums;
|
|
14
|
-
} catch (error) {
|
|
15
|
-
setResponseStatus(event, 500);
|
|
16
|
-
return { success: false, error: error.message };
|
|
17
|
-
}
|
|
18
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { defineEventHandler, readBody, createError } from "h3";
|
|
2
|
-
export default defineEventHandler(async (event) => {
|
|
3
|
-
const body = await readBody(event);
|
|
4
|
-
const { email } = body;
|
|
5
|
-
try {
|
|
6
|
-
const response = await fetch(`${process.env.FLOWRIX_API_BASE}verify-email/`, {
|
|
7
|
-
method: "POST",
|
|
8
|
-
headers: {
|
|
9
|
-
"x-public-key": process.env.FLOWRIX_API_KEY,
|
|
10
|
-
"x-api-secret": process.env.FLOWRIX_API_SECRET,
|
|
11
|
-
"Origin": process.env.FLOWRIX_API_ORIGIN,
|
|
12
|
-
"Content-Type": "application/json"
|
|
13
|
-
},
|
|
14
|
-
body: JSON.stringify({ email })
|
|
15
|
-
});
|
|
16
|
-
if (!response.ok) {
|
|
17
|
-
let errorMessage = ``;
|
|
18
|
-
try {
|
|
19
|
-
const errorData = await response.json();
|
|
20
|
-
console.error("Error response data:", errorData.message);
|
|
21
|
-
if (errorData.message) {
|
|
22
|
-
errorMessage += errorData.message?.email || errorData.message;
|
|
23
|
-
}
|
|
24
|
-
} catch (parseError) {
|
|
25
|
-
errorMessage += "Failed to parse error details.";
|
|
26
|
-
}
|
|
27
|
-
throw createError({
|
|
28
|
-
status: 400,
|
|
29
|
-
statusMessage: "Bad Request",
|
|
30
|
-
message: "Invalid user input",
|
|
31
|
-
data: { field: "email" }
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const data = await response.json();
|
|
35
|
-
return data;
|
|
36
|
-
} catch (error) {
|
|
37
|
-
throw createError({
|
|
38
|
-
status: 400,
|
|
39
|
-
statusMessage: "Bad Request",
|
|
40
|
-
message: "Invalid user input",
|
|
41
|
-
data: { field: "email" }
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface AuthUser {
|
|
2
|
-
id: string | number;
|
|
3
|
-
email: string;
|
|
4
|
-
firstName?: string;
|
|
5
|
-
lastName?: string;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
|
|
8
|
-
user: AuthUser;
|
|
9
|
-
token: string;
|
|
10
|
-
}>>;
|
|
11
|
-
export default _default;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { defineEventHandler, readBody, createError } from "h3";
|
|
2
|
-
export default defineEventHandler(async (event) => {
|
|
3
|
-
try {
|
|
4
|
-
const body = await readBody(event);
|
|
5
|
-
const { email, password } = body;
|
|
6
|
-
if (!email || !password) {
|
|
7
|
-
throw createError({
|
|
8
|
-
statusCode: 400,
|
|
9
|
-
statusMessage: "Email and password are required"
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
console.log("Environment check:");
|
|
13
|
-
console.log("API_BASE:", process.env.FLOWRIX_API_KEY);
|
|
14
|
-
console.log("API_KEY present:", process.env.FLOWRIX_API_SECRET);
|
|
15
|
-
console.log("API_SECRET present:", process.env.FLOWRIX_API_ORIGIN);
|
|
16
|
-
const response = await fetch(`${process.env.FLOWRIX_API_BASE}login/`, {
|
|
17
|
-
method: "POST",
|
|
18
|
-
headers: {
|
|
19
|
-
"x-public-key": process.env.FLOWRIX_API_KEY,
|
|
20
|
-
"x-api-secret": process.env.FLOWRIX_API_SECRET,
|
|
21
|
-
"Origin": process.env.FLOWRIX_API_ORIGIN,
|
|
22
|
-
"Content-Type": "application/json"
|
|
23
|
-
},
|
|
24
|
-
body: JSON.stringify({ email, password })
|
|
25
|
-
});
|
|
26
|
-
if (!response.ok) {
|
|
27
|
-
let errorMessage = "Login failed";
|
|
28
|
-
try {
|
|
29
|
-
const errorData = await response.json();
|
|
30
|
-
console.error("Error response data:", errorData);
|
|
31
|
-
if (errorData.message) {
|
|
32
|
-
if (Array.isArray(errorData.message)) {
|
|
33
|
-
errorMessage = errorData.message.join(", ");
|
|
34
|
-
} else if (typeof errorData.message === "object") {
|
|
35
|
-
errorMessage = errorData.message.email || Object.values(errorData.message)[0] || errorMessage;
|
|
36
|
-
} else {
|
|
37
|
-
errorMessage = errorData.message;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
} catch (parseError) {
|
|
41
|
-
console.error("Failed to parse error response:", parseError);
|
|
42
|
-
errorMessage = `HTTP ${response.status}: ${response.statusText}`;
|
|
43
|
-
}
|
|
44
|
-
throw createError({
|
|
45
|
-
statusCode: response.status,
|
|
46
|
-
statusMessage: errorMessage
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
const data = await response.json();
|
|
50
|
-
let user;
|
|
51
|
-
let token;
|
|
52
|
-
user = data.data.user;
|
|
53
|
-
token = data.data.access_token;
|
|
54
|
-
return {
|
|
55
|
-
user,
|
|
56
|
-
token
|
|
57
|
-
};
|
|
58
|
-
} catch (error) {
|
|
59
|
-
console.error("Login error:", error);
|
|
60
|
-
if (error.statusCode || error.status) {
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
throw createError({
|
|
64
|
-
statusCode: 500,
|
|
65
|
-
statusMessage: error.message || "Internal server error"
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { defineEventHandler, getCookie, deleteCookie } from "h3";
|
|
2
|
-
export default defineEventHandler(async (event) => {
|
|
3
|
-
const accessTok = getCookie(event, "auth.token");
|
|
4
|
-
try {
|
|
5
|
-
await $fetch(`${process.env.FLOWRIX_API_BASE}customer/logout`, {
|
|
6
|
-
method: "POST",
|
|
7
|
-
headers: {
|
|
8
|
-
"x-public-key": process.env.FLOWRIX_API_KEY,
|
|
9
|
-
"x-api-secret": process.env.FLOWRIX_API_SECRET,
|
|
10
|
-
"Origin": process.env.FLOWRIX_API_ORIGIN,
|
|
11
|
-
"Authorization": `Bearer ${accessTok || ""}`
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
deleteCookie(event, "auth.token");
|
|
15
|
-
deleteCookie(event, "auth.refreshToken");
|
|
16
|
-
deleteCookie(event, "auth.user");
|
|
17
|
-
deleteCookie(event, "auth.session");
|
|
18
|
-
return { success: true, message: "Logout successful" };
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.error("Error customer logout:", error);
|
|
21
|
-
return { success: false, message: "Logout failed" };
|
|
22
|
-
}
|
|
23
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { defineEventHandler, readBody } from "h3";
|
|
2
|
-
export default defineEventHandler(async (event) => {
|
|
3
|
-
const body = await readBody(event);
|
|
4
|
-
const { firstname, lastname, mobile, email, email_confirmation, password, password_confirmation } = body;
|
|
5
|
-
try {
|
|
6
|
-
const response = await fetch(`${process.env.FLOWRIX_API_BASE}customer/create`, {
|
|
7
|
-
method: "POST",
|
|
8
|
-
headers: {
|
|
9
|
-
"x-public-key": process.env.FLOWRIX_API_KEY,
|
|
10
|
-
"x-api-secret": process.env.FLOWRIX_API_SECRET,
|
|
11
|
-
"Origin": process.env.FLOWRIX_API_ORIGIN,
|
|
12
|
-
"Content-Type": "application/json"
|
|
13
|
-
},
|
|
14
|
-
body: JSON.stringify({ firstname, lastname, mobile, email, email_confirmation, password, password_confirmation })
|
|
15
|
-
});
|
|
16
|
-
if (!response.ok) {
|
|
17
|
-
let errorMessage = {};
|
|
18
|
-
let errorData;
|
|
19
|
-
try {
|
|
20
|
-
errorData = await response.json();
|
|
21
|
-
console.error("Error response data:", errorData);
|
|
22
|
-
if (errorData.message) {
|
|
23
|
-
errorMessage = errorData.message?.email || errorData.message;
|
|
24
|
-
}
|
|
25
|
-
} catch (parseError) {
|
|
26
|
-
errorMessage = "Failed to parse error details.";
|
|
27
|
-
console.error("Error parsing JSON:", parseError);
|
|
28
|
-
errorData = { message: errorMessage };
|
|
29
|
-
}
|
|
30
|
-
throw createError({
|
|
31
|
-
status: response.status,
|
|
32
|
-
message: errorMessage,
|
|
33
|
-
// Use the more specific errorMessage
|
|
34
|
-
data: { message: errorMessage, errorData }
|
|
35
|
-
// Include both messages and the raw error
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
const data = await response.json();
|
|
39
|
-
return data.data;
|
|
40
|
-
} catch (error) {
|
|
41
|
-
const statusCode = error.status || 500;
|
|
42
|
-
const message = error.message || "An unexpected error occurred";
|
|
43
|
-
const errorData = error.data || { message };
|
|
44
|
-
console.error("Final Error:", { statusCode, message, errorData });
|
|
45
|
-
throw createError({
|
|
46
|
-
status: statusCode,
|
|
47
|
-
message,
|
|
48
|
-
data: errorData
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { defineEventHandler, getCookie, createError } from "h3";
|
|
2
|
-
export default defineEventHandler(async (event) => {
|
|
3
|
-
try {
|
|
4
|
-
const authHeader = getHeader(event, "authorization");
|
|
5
|
-
const token = authHeader?.replace("Bearer ", "") || getCookie(event, "nuxt-auth.token");
|
|
6
|
-
if (!token) {
|
|
7
|
-
throw createError({
|
|
8
|
-
statusCode: 401,
|
|
9
|
-
statusMessage: "No token provided"
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
const config = useRuntimeConfig();
|
|
13
|
-
const apiBase = config.apiBase;
|
|
14
|
-
const apiKey = config.apiKey;
|
|
15
|
-
const apiSecret = config.apiSecret;
|
|
16
|
-
const apiOrigin = config.apiOrigin;
|
|
17
|
-
const response = await fetch(`${apiBase}user/session`, {
|
|
18
|
-
method: "GET",
|
|
19
|
-
headers: {
|
|
20
|
-
"x-public-key": apiKey,
|
|
21
|
-
"x-api-secret": apiSecret,
|
|
22
|
-
"Origin": apiOrigin || "",
|
|
23
|
-
"Authorization": `Bearer ${token}`,
|
|
24
|
-
"Content-Type": "application/json",
|
|
25
|
-
"Accept": "application/json"
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
if (!response.ok) {
|
|
29
|
-
throw createError({
|
|
30
|
-
statusCode: response.status,
|
|
31
|
-
statusMessage: "Failed to get session"
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const data = await response.json();
|
|
35
|
-
return data.data || data.user || data;
|
|
36
|
-
} catch (error) {
|
|
37
|
-
console.error("Session error:", error);
|
|
38
|
-
if (error.statusCode || error.status) {
|
|
39
|
-
throw error;
|
|
40
|
-
}
|
|
41
|
-
throw createError({
|
|
42
|
-
statusCode: 401,
|
|
43
|
-
statusMessage: "Invalid session"
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
});
|