flowrix 1.0.0
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/LICENSE +18 -0
- package/README.md +84 -0
- package/dist/module.d.mts +8 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +273 -0
- package/dist/runtime/composables/Blog/useBlogIndex.d.ts +111 -0
- package/dist/runtime/composables/Blog/useBlogIndex.js +86 -0
- package/dist/runtime/composables/Blog/useBlogMain.d.ts +13 -0
- package/dist/runtime/composables/Blog/useBlogMain.js +7 -0
- package/dist/runtime/composables/Blog/useBlogSidebar.d.ts +7 -0
- package/dist/runtime/composables/Blog/useBlogSidebar.js +37 -0
- package/dist/runtime/composables/Blog/useBlogSingle.d.ts +30 -0
- package/dist/runtime/composables/Blog/useBlogSingle.js +87 -0
- package/dist/runtime/composables/Blog/useMagazineCard.d.ts +13 -0
- package/dist/runtime/composables/Blog/useMagazineCard.js +14 -0
- package/dist/runtime/composables/Blog/useSingleBlogMain.d.ts +20 -0
- package/dist/runtime/composables/Blog/useSingleBlogMain.js +28 -0
- package/dist/runtime/composables/Brand/brand.d.ts +7 -0
- package/dist/runtime/composables/Brand/brand.js +45 -0
- package/dist/runtime/composables/Cart/useCartDetail.d.ts +49 -0
- package/dist/runtime/composables/Cart/useCartDetail.js +48 -0
- package/dist/runtime/composables/Category/useCategoryContent.d.ts +9 -0
- package/dist/runtime/composables/Category/useCategoryContent.js +15 -0
- package/dist/runtime/composables/Category/useCategoryGrid.d.ts +40 -0
- package/dist/runtime/composables/Category/useCategoryGrid.js +38 -0
- package/dist/runtime/composables/Category/useCategoryIndex.d.ts +33 -0
- package/dist/runtime/composables/Category/useCategoryIndex.js +65 -0
- package/dist/runtime/composables/Category/useCategoryTemplate2.d.ts +50 -0
- package/dist/runtime/composables/Category/useCategoryTemplate2.js +43 -0
- package/dist/runtime/composables/Category/useCategoryTemplate3.d.ts +66 -0
- package/dist/runtime/composables/Category/useCategoryTemplate3.js +45 -0
- package/dist/runtime/composables/Category/useCategoryTop.d.ts +18 -0
- package/dist/runtime/composables/Category/useCategoryTop.js +65 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.d.ts +3 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.js +22 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useEway.d.ts +8 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useEway.js +88 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +13 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +155 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +9 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +90 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.d.ts +15 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +146 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.d.ts +3 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.js +22 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +7 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.js +43 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.d.ts +3 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.js +22 -0
- package/dist/runtime/composables/Checkout/useBillingAddress.d.ts +19 -0
- package/dist/runtime/composables/Checkout/useBillingAddress.js +82 -0
- package/dist/runtime/composables/Checkout/useCheckout.d.ts +186 -0
- package/dist/runtime/composables/Checkout/useCheckout.js +366 -0
- package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +15 -0
- package/dist/runtime/composables/Checkout/useCreateAccount.js +61 -0
- package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +4 -0
- package/dist/runtime/composables/Checkout/useDeliveryMethod.js +36 -0
- package/dist/runtime/composables/Checkout/useShippingAddress.d.ts +9 -0
- package/dist/runtime/composables/Checkout/useShippingAddress.js +121 -0
- package/dist/runtime/composables/Customer/useRegister.d.ts +18 -0
- package/dist/runtime/composables/Customer/useRegister.js +48 -0
- package/dist/runtime/composables/Extras/useCountry.d.ts +6 -0
- package/dist/runtime/composables/Extras/useCountry.js +11 -0
- package/dist/runtime/composables/Extras/useDateFormatter.d.ts +4 -0
- package/dist/runtime/composables/Extras/useDateFormatter.js +20 -0
- package/dist/runtime/composables/Extras/useNumberOnly.d.ts +5 -0
- package/dist/runtime/composables/Extras/useNumberOnly.js +21 -0
- package/dist/runtime/composables/Extras/usePasswordFormatter.d.ts +8 -0
- package/dist/runtime/composables/Extras/usePasswordFormatter.js +61 -0
- package/dist/runtime/composables/Extras/useSrcSets.d.ts +8 -0
- package/dist/runtime/composables/Extras/useSrcSets.js +26 -0
- package/dist/runtime/composables/Extras/useTogglePassword.d.ts +4 -0
- package/dist/runtime/composables/Extras/useTogglePassword.js +11 -0
- package/dist/runtime/composables/Footer/useFooter.d.ts +14 -0
- package/dist/runtime/composables/Footer/useFooter.js +61 -0
- package/dist/runtime/composables/Header/useHeader.d.ts +28 -0
- package/dist/runtime/composables/Header/useHeader.js +66 -0
- package/dist/runtime/composables/Menu/MainMenu.d.ts +4 -0
- package/dist/runtime/composables/Menu/MainMenu.js +17 -0
- package/dist/runtime/composables/Product/CustomProduct/useAttributeType.d.ts +3 -0
- package/dist/runtime/composables/Product/CustomProduct/useAttributeType.js +20 -0
- package/dist/runtime/composables/Product/CustomProduct/useAttributes.d.ts +70 -0
- package/dist/runtime/composables/Product/CustomProduct/useAttributes.js +68 -0
- package/dist/runtime/composables/Product/CustomProduct/useCustomProduct.d.ts +74 -0
- package/dist/runtime/composables/Product/CustomProduct/useCustomProduct.js +107 -0
- package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.d.ts +159 -0
- package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +2080 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleAttribute.d.ts +4 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleAttribute.js +27 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleStep.d.ts +68 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleStep.js +21 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleValue.d.ts +67 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleValue.js +15 -0
- package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +74 -0
- package/dist/runtime/composables/Product/CustomProduct/useSteps.js +78 -0
- package/dist/runtime/composables/Product/simpleProduct/useSimpleProduct.d.ts +25 -0
- package/dist/runtime/composables/Product/simpleProduct/useSimpleProduct.js +77 -0
- package/dist/runtime/composables/Product/useProductCard.d.ts +13 -0
- package/dist/runtime/composables/Product/useProductCard.js +88 -0
- package/dist/runtime/composables/Product/useProductComponent.d.ts +5 -0
- package/dist/runtime/composables/Product/useProductComponent.js +21 -0
- package/dist/runtime/composables/Product/useProductSlug.d.ts +1 -0
- package/dist/runtime/composables/Product/useProductSlug.js +25 -0
- package/dist/runtime/composables/Product/useService.d.ts +17 -0
- package/dist/runtime/composables/Product/useService.js +67 -0
- package/dist/runtime/composables/Product/useTemplate.d.ts +5 -0
- package/dist/runtime/composables/Product/useTemplate.js +21 -0
- package/dist/runtime/composables/Samples/useSamples.d.ts +10 -0
- package/dist/runtime/composables/Samples/useSamples.js +36 -0
- package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +6 -0
- package/dist/runtime/composables/SideBar/Filters/useFilters.js +51 -0
- package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +5 -0
- package/dist/runtime/composables/SideBar/Filters/useSorting.js +27 -0
- package/dist/runtime/composables/SideBar/useSideBar.d.ts +8 -0
- package/dist/runtime/composables/SideBar/useSideBar.js +68 -0
- package/dist/runtime/composables/index.d.ts +74 -0
- package/dist/runtime/composables/index.js +74 -0
- package/dist/runtime/composables/types.d.ts +5 -0
- package/dist/runtime/composables/types.js +0 -0
- package/dist/runtime/composables/useAddToCart.d.ts +28 -0
- package/dist/runtime/composables/useAddToCart.js +114 -0
- package/dist/runtime/composables/useAddresses.d.ts +18 -0
- package/dist/runtime/composables/useAddresses.js +126 -0
- package/dist/runtime/composables/useAuth.d.ts +45 -0
- package/dist/runtime/composables/useAuth.js +180 -0
- package/dist/runtime/composables/useCards.d.ts +19 -0
- package/dist/runtime/composables/useCards.js +73 -0
- package/dist/runtime/composables/useClientApi.d.ts +23 -0
- package/dist/runtime/composables/useClientApi.js +53 -0
- package/dist/runtime/composables/useCountries.d.ts +12 -0
- package/dist/runtime/composables/useCountries.js +50 -0
- package/dist/runtime/composables/useDataLayer.d.ts +18 -0
- package/dist/runtime/composables/useDataLayer.js +385 -0
- package/dist/runtime/composables/useDynamicHtmlRenderer.d.ts +4 -0
- package/dist/runtime/composables/useDynamicHtmlRenderer.js +33 -0
- package/dist/runtime/composables/useLocation.d.ts +23 -0
- package/dist/runtime/composables/useLocation.js +32 -0
- package/dist/runtime/composables/useLocations.d.ts +12 -0
- package/dist/runtime/composables/useLocations.js +53 -0
- package/dist/runtime/composables/useMetaLayer.d.ts +10 -0
- package/dist/runtime/composables/useMetaLayer.js +263 -0
- package/dist/runtime/composables/useOrders.d.ts +21 -0
- package/dist/runtime/composables/useOrders.js +82 -0
- package/dist/runtime/composables/useQuotations.d.ts +14 -0
- package/dist/runtime/composables/useQuotations.js +50 -0
- package/dist/runtime/composables/useSearch.d.ts +7 -0
- package/dist/runtime/composables/useSearch.js +40 -0
- package/dist/runtime/composables/useSubscriptions.d.ts +13 -0
- package/dist/runtime/composables/useSubscriptions.js +58 -0
- package/dist/runtime/composables/useTikTokDatalayer.d.ts +8 -0
- package/dist/runtime/composables/useTikTokDatalayer.js +165 -0
- package/dist/runtime/composables/useWebforms.d.ts +16 -0
- package/dist/runtime/composables/useWebforms.js +75 -0
- package/dist/runtime/composables/useWishlists.d.ts +38 -0
- package/dist/runtime/composables/useWishlists.js +191 -0
- package/dist/runtime/middleware/flowrix.d.ts +6 -0
- package/dist/runtime/middleware/flowrix.js +40 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +4 -0
- package/dist/runtime/plugins/persistedstate.client.d.ts +2 -0
- package/dist/runtime/plugins/persistedstate.client.js +9 -0
- package/dist/runtime/server/api/albums.d.ts +2 -0
- package/dist/runtime/server/api/albums.js +18 -0
- package/dist/runtime/server/api/auth/forgot.d.ts +5 -0
- package/dist/runtime/server/api/auth/forgot.js +44 -0
- package/dist/runtime/server/api/auth/login.d.ts +11 -0
- package/dist/runtime/server/api/auth/login.js +69 -0
- package/dist/runtime/server/api/auth/logout.d.ts +5 -0
- package/dist/runtime/server/api/auth/logout.js +23 -0
- package/dist/runtime/server/api/auth/register.d.ts +2 -0
- package/dist/runtime/server/api/auth/register.js +51 -0
- package/dist/runtime/server/api/auth/session.get.d.ts +2 -0
- package/dist/runtime/server/api/auth/session.get.js +46 -0
- package/dist/runtime/server/api/auth/user/reset-password.d.ts +5 -0
- package/dist/runtime/server/api/auth/user/reset-password.js +40 -0
- package/dist/runtime/server/api/auth/user/session.d.ts +2 -0
- package/dist/runtime/server/api/auth/user/session.js +43 -0
- package/dist/runtime/server/api/auth/user/verify-token.d.ts +6 -0
- package/dist/runtime/server/api/auth/user/verify-token.js +50 -0
- package/dist/runtime/server/api/banners.d.ts +3 -0
- package/dist/runtime/server/api/banners.js +41 -0
- package/dist/runtime/server/api/blog/[slug].d.ts +3 -0
- package/dist/runtime/server/api/blog/[slug].js +51 -0
- package/dist/runtime/server/api/blog/blog.d.ts +3 -0
- package/dist/runtime/server/api/blog/blog.js +17 -0
- package/dist/runtime/server/api/brand/[slug].d.ts +3 -0
- package/dist/runtime/server/api/brand/[slug].js +58 -0
- package/dist/runtime/server/api/cart/[slug]/add.d.ts +2 -0
- package/dist/runtime/server/api/cart/[slug]/add.js +21 -0
- package/dist/runtime/server/api/cart/[slug]/update.d.ts +2 -0
- package/dist/runtime/server/api/cart/[slug]/update.js +21 -0
- package/dist/runtime/server/api/cart/remove.d.ts +2 -0
- package/dist/runtime/server/api/cart/remove.js +21 -0
- package/dist/runtime/server/api/cart/service/[slug]/add.d.ts +2 -0
- package/dist/runtime/server/api/cart/service/[slug]/add.js +16 -0
- package/dist/runtime/server/api/catalog/categories.d.ts +3 -0
- package/dist/runtime/server/api/catalog/categories.js +43 -0
- package/dist/runtime/server/api/catalog/featured.d.ts +3 -0
- package/dist/runtime/server/api/catalog/featured.js +41 -0
- package/dist/runtime/server/api/catalog/samples.d.ts +3 -0
- package/dist/runtime/server/api/catalog/samples.js +44 -0
- package/dist/runtime/server/api/catalog/search.d.ts +3 -0
- package/dist/runtime/server/api/catalog/search.js +44 -0
- package/dist/runtime/server/api/category/[...slug].d.ts +3 -0
- package/dist/runtime/server/api/category/[...slug].js +51 -0
- package/dist/runtime/server/api/checkout/applyCoupon.d.ts +2 -0
- package/dist/runtime/server/api/checkout/applyCoupon.js +20 -0
- package/dist/runtime/server/api/checkout/configs.d.ts +2 -0
- package/dist/runtime/server/api/checkout/configs.js +20 -0
- package/dist/runtime/server/api/checkout/countries.d.ts +2 -0
- package/dist/runtime/server/api/checkout/countries.js +17 -0
- package/dist/runtime/server/api/checkout/paymentmethod.d.ts +2 -0
- package/dist/runtime/server/api/checkout/paymentmethod.js +20 -0
- package/dist/runtime/server/api/company/profile.d.ts +2 -0
- package/dist/runtime/server/api/company/profile.js +18 -0
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.d.ts +3 -0
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +19 -0
- package/dist/runtime/server/api/contact-center/webforms/create.d.ts +2 -0
- package/dist/runtime/server/api/contact-center/webforms/create.js +16 -0
- package/dist/runtime/server/api/customer/address/add.d.ts +14 -0
- package/dist/runtime/server/api/customer/address/add.js +33 -0
- package/dist/runtime/server/api/customer/address/delete.d.ts +20 -0
- package/dist/runtime/server/api/customer/address/delete.js +37 -0
- package/dist/runtime/server/api/customer/address/setshipping.d.ts +20 -0
- package/dist/runtime/server/api/customer/address/setshipping.js +41 -0
- package/dist/runtime/server/api/customer/address/update.d.ts +20 -0
- package/dist/runtime/server/api/customer/address/update.js +42 -0
- package/dist/runtime/server/api/customer/cards/delete.d.ts +2 -0
- package/dist/runtime/server/api/customer/cards/delete.js +23 -0
- package/dist/runtime/server/api/customer/cards/get.d.ts +2 -0
- package/dist/runtime/server/api/customer/cards/get.js +17 -0
- package/dist/runtime/server/api/customer/change-password.d.ts +14 -0
- package/dist/runtime/server/api/customer/change-password.js +34 -0
- package/dist/runtime/server/api/customer/checkout.d.ts +2 -0
- package/dist/runtime/server/api/customer/checkout.js +20 -0
- package/dist/runtime/server/api/customer/orders.d.ts +2 -0
- package/dist/runtime/server/api/customer/orders.js +17 -0
- package/dist/runtime/server/api/customer/profile/update.d.ts +14 -0
- package/dist/runtime/server/api/customer/profile/update.js +34 -0
- package/dist/runtime/server/api/customer/quotations.d.ts +2 -0
- package/dist/runtime/server/api/customer/quotations.js +17 -0
- package/dist/runtime/server/api/customer/search.d.ts +2 -0
- package/dist/runtime/server/api/customer/search.js +15 -0
- package/dist/runtime/server/api/customer/tax-invoice.d.ts +8 -0
- package/dist/runtime/server/api/customer/tax-invoice.js +36 -0
- package/dist/runtime/server/api/customer/wishlist/add.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/add.js +30 -0
- package/dist/runtime/server/api/customer/wishlist/createWishList.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/createWishList.js +29 -0
- package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +46 -0
- package/dist/runtime/server/api/customer/wishlist/deleteWishList.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +30 -0
- package/dist/runtime/server/api/customer/wishlist/get.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/get.js +17 -0
- package/dist/runtime/server/api/customer/wishlist/getWishListItems.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +21 -0
- package/dist/runtime/server/api/customer/wishlist/updateWishList.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/updateWishList.js +30 -0
- package/dist/runtime/server/api/location.d.ts +2 -0
- package/dist/runtime/server/api/location.js +13 -0
- package/dist/runtime/server/api/nav/[id]/links.d.ts +2 -0
- package/dist/runtime/server/api/nav/[id]/links.js +19 -0
- package/dist/runtime/server/api/page/[slug].d.ts +3 -0
- package/dist/runtime/server/api/page/[slug].js +51 -0
- package/dist/runtime/server/api/product/[...slug].d.ts +3 -0
- package/dist/runtime/server/api/product/[...slug].js +44 -0
- package/dist/runtime/server/api/service/[slug].d.ts +3 -0
- package/dist/runtime/server/api/service/[slug].js +51 -0
- package/dist/runtime/server/api/service/availability.d.ts +2 -0
- package/dist/runtime/server/api/service/availability.js +27 -0
- package/dist/runtime/server/api/subscribe.d.ts +2 -0
- package/dist/runtime/server/api/subscribe.js +16 -0
- package/dist/runtime/server/api/v2/[...slug].d.ts +3 -0
- package/dist/runtime/server/api/v2/[...slug].js +9 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/stores/Booking.d.ts +99 -0
- package/dist/runtime/stores/Booking.js +96 -0
- package/dist/runtime/stores/Cart.d.ts +67 -0
- package/dist/runtime/stores/Cart.js +272 -0
- package/dist/runtime/stores/Categories.d.ts +13 -0
- package/dist/runtime/stores/Categories.js +90 -0
- package/dist/runtime/stores/Checkout.d.ts +85 -0
- package/dist/runtime/stores/Checkout.js +213 -0
- package/dist/runtime/stores/IpLocation.d.ts +18 -0
- package/dist/runtime/stores/IpLocation.js +29 -0
- package/dist/runtime/stores/NavMenu.d.ts +15 -0
- package/dist/runtime/stores/NavMenu.js +26 -0
- package/dist/runtime/stores/Search.d.ts +0 -0
- package/dist/runtime/stores/Search.js +33 -0
- package/dist/runtime/stores/Services.d.ts +7 -0
- package/dist/runtime/stores/Services.js +49 -0
- package/dist/runtime/stores/Utilities.d.ts +5 -0
- package/dist/runtime/stores/Utilities.js +11 -0
- package/dist/runtime/stores/addresses.d.ts +15 -0
- package/dist/runtime/stores/addresses.js +31 -0
- package/dist/runtime/stores/auth.d.ts +62 -0
- package/dist/runtime/stores/auth.js +59 -0
- package/dist/runtime/stores/cards.d.ts +15 -0
- package/dist/runtime/stores/cards.js +22 -0
- package/dist/runtime/stores/compareStore.d.ts +7 -0
- package/dist/runtime/stores/compareStore.js +45 -0
- package/dist/runtime/stores/countries.d.ts +10 -0
- package/dist/runtime/stores/countries.js +19 -0
- package/dist/runtime/stores/index.d.ts +26 -0
- package/dist/runtime/stores/index.js +24 -0
- package/dist/runtime/stores/locations.d.ts +11 -0
- package/dist/runtime/stores/locations.js +19 -0
- package/dist/runtime/stores/orders.d.ts +16 -0
- package/dist/runtime/stores/orders.js +19 -0
- package/dist/runtime/stores/product/README.md +141 -0
- package/dist/runtime/stores/product/slug.d.ts +181 -0
- package/dist/runtime/stores/product/slug.js +91 -0
- package/dist/runtime/stores/product.d.ts +5 -0
- package/dist/runtime/stores/product.js +38 -0
- package/dist/runtime/stores/quotations.d.ts +12 -0
- package/dist/runtime/stores/quotations.js +19 -0
- package/dist/runtime/stores/subscriptions.d.ts +11 -0
- package/dist/runtime/stores/subscriptions.js +19 -0
- package/dist/runtime/stores/useCompanyProfile.d.ts +7 -0
- package/dist/runtime/stores/useCompanyProfile.js +22 -0
- package/dist/runtime/stores/useNavMenuStore.d.ts +5 -0
- package/dist/runtime/stores/useNavMenuStore.js +23 -0
- package/dist/runtime/stores/webforms.d.ts +18 -0
- package/dist/runtime/stores/webforms.js +23 -0
- package/dist/runtime/stores/wishlists.d.ts +28 -0
- package/dist/runtime/stores/wishlists.js +49 -0
- package/dist/runtime/utils/api.d.ts +13 -0
- package/dist/runtime/utils/api.js +102 -0
- package/dist/runtime/utils/companyProfile.d.ts +22 -0
- package/dist/runtime/utils/companyProfile.js +21 -0
- package/dist/types.d.mts +3 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Nimble Technology Pty Ltd (ACN 664 547 424) All rights reserved.
|
|
4
|
+
|
|
5
|
+
This module (“Software”) is part of the FLOWRiX ecosystem and is provided for use only by licensed FLOWRiX subscribers under the FLOWRiX Terms of Use available at https://flowrix.com/terms-of-use.
|
|
6
|
+
By installing, copying, or otherwise using this Software, you agree to be bound by the FLOWRiX Terms of Use.
|
|
7
|
+
|
|
8
|
+
If you do not agree to those terms, you must not install or use this Software.
|
|
9
|
+
|
|
10
|
+
Usage Conditions
|
|
11
|
+
-A valid and active FLOWRiX eCommerce subscription is required.
|
|
12
|
+
-You are granted a non-exclusive, non-transferable, revocable license to use this module solely for implementing eCommerce functionality in Nuxt projects connected to FLOWRiX.
|
|
13
|
+
-You may not copy, modify, distribute, sublicense, reverse-engineer, or use this Software independently of FLOWRiX.
|
|
14
|
+
-Use of this Software constitutes acceptance of all FLOWRiX Terms, including privacy, subscription, and third-party service clauses.
|
|
15
|
+
|
|
16
|
+
Disclaimer
|
|
17
|
+
This Software is provided “as is” without warranty of any kind, express or implied.
|
|
18
|
+
Nimble Technology Pty Ltd is not liable for any damages or losses arising from use or inability to use this Software.
|
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Get your module up and running quickly.
|
|
3
|
+
|
|
4
|
+
Find and replace all on all files (CMD+SHIFT+F):
|
|
5
|
+
- Name: My Module
|
|
6
|
+
- Package name: flowrix
|
|
7
|
+
- Description: My new Nuxt module
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
# My Module
|
|
11
|
+
|
|
12
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
13
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
14
|
+
[![License][license-src]][license-href]
|
|
15
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
|
+
|
|
17
|
+
My new Nuxt module for doing amazing things.
|
|
18
|
+
|
|
19
|
+
- [✨ Release Notes](/CHANGELOG.md)
|
|
20
|
+
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/flowrix?file=playground%2Fapp.vue) -->
|
|
21
|
+
<!-- - [📖 Documentation](https://example.com) -->
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
<!-- Highlight some of the features your module provide here -->
|
|
26
|
+
- ⛰ Foo
|
|
27
|
+
- 🚠 Bar
|
|
28
|
+
- 🌲 Baz
|
|
29
|
+
|
|
30
|
+
## Quick Setup
|
|
31
|
+
|
|
32
|
+
Install the module to your Nuxt application with one command:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx nuxi module add flowrix
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
That's it! You can now use My Module in your Nuxt app ✨
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Contribution
|
|
42
|
+
|
|
43
|
+
<details>
|
|
44
|
+
<summary>Local development</summary>
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Install dependencies
|
|
48
|
+
npm install
|
|
49
|
+
|
|
50
|
+
# Generate type stubs
|
|
51
|
+
npm run dev:prepare
|
|
52
|
+
|
|
53
|
+
# Develop with the playground
|
|
54
|
+
npm run dev
|
|
55
|
+
|
|
56
|
+
# Build the playground
|
|
57
|
+
npm run dev:build
|
|
58
|
+
|
|
59
|
+
# Run ESLint
|
|
60
|
+
npm run lint
|
|
61
|
+
|
|
62
|
+
# Run Vitest
|
|
63
|
+
npm run test
|
|
64
|
+
npm run test:watch
|
|
65
|
+
|
|
66
|
+
# Release new version
|
|
67
|
+
npm run release
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
</details>
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
<!-- Badges -->
|
|
74
|
+
[npm-version-src]: https://img.shields.io/npm/v/flowrix/latest.svg?style=flat&colorA=020420&colorB=00DC82
|
|
75
|
+
[npm-version-href]: https://npmjs.com/package/flowrix
|
|
76
|
+
|
|
77
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/flowrix.svg?style=flat&colorA=020420&colorB=00DC82
|
|
78
|
+
[npm-downloads-href]: https://npm.chart.dev/flowrix
|
|
79
|
+
|
|
80
|
+
[license-src]: https://img.shields.io/npm/l/flowrix.svg?style=flat&colorA=020420&colorB=00DC82
|
|
81
|
+
[license-href]: https://npmjs.com/package/flowrix
|
|
82
|
+
|
|
83
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
|
|
84
|
+
[nuxt-href]: https://nuxt.com
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, installModule, addPlugin, addImportsDir, addImports, addServerHandler } from '@nuxt/kit';
|
|
2
|
+
|
|
3
|
+
const module = defineNuxtModule({
|
|
4
|
+
meta: {
|
|
5
|
+
name: "flowrix",
|
|
6
|
+
configKey: "flowrix"
|
|
7
|
+
},
|
|
8
|
+
defaults: {},
|
|
9
|
+
async setup(_options, nuxt) {
|
|
10
|
+
nuxt.options.runtimeConfig = {
|
|
11
|
+
...nuxt.options.runtimeConfig,
|
|
12
|
+
// Server-only key
|
|
13
|
+
FLOWRIX_API_KEY: nuxt.options.runtimeConfig.FLOWRIX_API_KEY || process.env.FLOWRIX_API_KEY || "",
|
|
14
|
+
FLOWRIX_API_SECRET: nuxt.options.runtimeConfig.FLOWRIX_API_SECRET || process.env.FLOWRIX_API_SECRET || "",
|
|
15
|
+
FLOWRIX_API_ORIGIN: nuxt.options.runtimeConfig.FLOWRIX_API_ORIGIN || process.env.FLOWRIX_API_ORIGIN || "",
|
|
16
|
+
FLOWRIX_API_BASE: nuxt.options.runtimeConfig.FLOWRIX_API_BASE || process.env.FLOWRIX_API_BASE || "",
|
|
17
|
+
FLOWRIX_API_BASE_V2: nuxt.options.runtimeConfig.FLOWRIX_API_BASE_V2 || process.env.FLOWRIX_API_BASE_V2 || "",
|
|
18
|
+
public: {
|
|
19
|
+
...nuxt.options.runtimeConfig.public,
|
|
20
|
+
// Client-exposed key
|
|
21
|
+
FLOWRIX_API_KEY: nuxt.options.runtimeConfig.public?.FLOWRIX_API_KEY || process.env.FLOWRIX_API_KEY || "",
|
|
22
|
+
FLOWRIX_API_SECRET: nuxt.options.runtimeConfig.public?.FLOWRIX_API_SECRET || process.env.FLOWRIX_API_SECRET || "",
|
|
23
|
+
FLOWRIX_API_ORIGIN: nuxt.options.runtimeConfig.public?.FLOWRIX_API_ORIGIN || process.env.FLOWRIX_API_ORIGIN || "",
|
|
24
|
+
FLOWRIX_API_BASE: nuxt.options.runtimeConfig.public?.FLOWRIX_API_BASE || process.env.FLOWRIX_API_BASE || "",
|
|
25
|
+
FLOWRIX_API_BASE_V2: nuxt.options.runtimeConfig.public?.FLOWRIX_API_BASE_V2 || process.env.FLOWRIX_API_BASE_V2 || ""
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const resolver = createResolver(import.meta.url);
|
|
29
|
+
await installModule("@pinia/nuxt");
|
|
30
|
+
addPlugin({
|
|
31
|
+
src: resolver.resolve("./runtime/plugins/persistedstate.client"),
|
|
32
|
+
mode: "client"
|
|
33
|
+
// ensures only client side
|
|
34
|
+
});
|
|
35
|
+
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
36
|
+
addImportsDir(resolver.resolve("./runtime/stores"));
|
|
37
|
+
addImports({
|
|
38
|
+
from: resolver.resolve("./runtime/middleware/flowrix"),
|
|
39
|
+
name: "flowrixApi"
|
|
40
|
+
});
|
|
41
|
+
addServerHandler({
|
|
42
|
+
route: "/api/albums",
|
|
43
|
+
handler: resolver.resolve("./runtime/server/api/albums")
|
|
44
|
+
});
|
|
45
|
+
addServerHandler({
|
|
46
|
+
route: "/api/banners",
|
|
47
|
+
handler: resolver.resolve("./runtime/server/api/banners")
|
|
48
|
+
});
|
|
49
|
+
addServerHandler({
|
|
50
|
+
route: "/api/location",
|
|
51
|
+
handler: resolver.resolve("./runtime/server/api/location")
|
|
52
|
+
});
|
|
53
|
+
addServerHandler({
|
|
54
|
+
route: "/api/subscribe",
|
|
55
|
+
handler: resolver.resolve("./runtime/server/api/subscribe")
|
|
56
|
+
});
|
|
57
|
+
addServerHandler({
|
|
58
|
+
route: "/api/auth/forgot",
|
|
59
|
+
handler: resolver.resolve("./runtime/server/api/auth/forgot")
|
|
60
|
+
});
|
|
61
|
+
addServerHandler({
|
|
62
|
+
route: "/api/auth/login",
|
|
63
|
+
handler: resolver.resolve("./runtime/server/api/auth/login")
|
|
64
|
+
});
|
|
65
|
+
addServerHandler({
|
|
66
|
+
route: "/api/auth/logout",
|
|
67
|
+
handler: resolver.resolve("./runtime/server/api/auth/logout")
|
|
68
|
+
});
|
|
69
|
+
addServerHandler({
|
|
70
|
+
route: "/api/auth/register",
|
|
71
|
+
handler: resolver.resolve("./runtime/server/api/auth/register")
|
|
72
|
+
});
|
|
73
|
+
addServerHandler({
|
|
74
|
+
route: "/api/auth/session",
|
|
75
|
+
handler: resolver.resolve("./runtime/server/api/auth/session.get")
|
|
76
|
+
});
|
|
77
|
+
addServerHandler({
|
|
78
|
+
route: "/api/auth/user/reset-password",
|
|
79
|
+
handler: resolver.resolve("./runtime/server/api/auth/user/reset-password")
|
|
80
|
+
});
|
|
81
|
+
addServerHandler({
|
|
82
|
+
route: "/api/auth/user/session",
|
|
83
|
+
handler: resolver.resolve("./runtime/server/api/auth/user/session")
|
|
84
|
+
});
|
|
85
|
+
addServerHandler({
|
|
86
|
+
route: "/api/auth/user/verify-token",
|
|
87
|
+
handler: resolver.resolve("./runtime/server/api/auth/user/verify-token")
|
|
88
|
+
});
|
|
89
|
+
addServerHandler({
|
|
90
|
+
route: "/api/blog/:slug",
|
|
91
|
+
handler: resolver.resolve("./runtime/server/api/blog/[slug]")
|
|
92
|
+
});
|
|
93
|
+
addServerHandler({
|
|
94
|
+
route: "/api/blog/blog",
|
|
95
|
+
handler: resolver.resolve("./runtime/server/api/blog/blog")
|
|
96
|
+
});
|
|
97
|
+
addServerHandler({
|
|
98
|
+
route: "/api/brand/:slug",
|
|
99
|
+
handler: resolver.resolve("./runtime/server/api/brand/[slug]")
|
|
100
|
+
});
|
|
101
|
+
addServerHandler({
|
|
102
|
+
route: "/api/cart/remove",
|
|
103
|
+
handler: resolver.resolve("./runtime/server/api/cart/remove")
|
|
104
|
+
});
|
|
105
|
+
addServerHandler({
|
|
106
|
+
route: "/api/cart/:slug/add",
|
|
107
|
+
handler: resolver.resolve("./runtime/server/api/cart/[slug]/add")
|
|
108
|
+
});
|
|
109
|
+
addServerHandler({
|
|
110
|
+
route: "/api/cart/:slug/update",
|
|
111
|
+
handler: resolver.resolve("./runtime/server/api/cart/[slug]/update")
|
|
112
|
+
});
|
|
113
|
+
addServerHandler({
|
|
114
|
+
route: "/api/cart/service/:slug/add",
|
|
115
|
+
handler: resolver.resolve("./runtime/server/api/cart/service/[slug]/add")
|
|
116
|
+
});
|
|
117
|
+
addServerHandler({
|
|
118
|
+
route: "/api/catalog/categories",
|
|
119
|
+
handler: resolver.resolve("./runtime/server/api/catalog/categories")
|
|
120
|
+
});
|
|
121
|
+
addServerHandler({
|
|
122
|
+
route: "/api/catalog/featured",
|
|
123
|
+
handler: resolver.resolve("./runtime/server/api/catalog/featured")
|
|
124
|
+
});
|
|
125
|
+
addServerHandler({
|
|
126
|
+
route: "/api/catalog/samples",
|
|
127
|
+
handler: resolver.resolve("./runtime/server/api/catalog/samples")
|
|
128
|
+
});
|
|
129
|
+
addServerHandler({
|
|
130
|
+
route: "/api/catalog/search",
|
|
131
|
+
handler: resolver.resolve("./runtime/server/api/catalog/search")
|
|
132
|
+
});
|
|
133
|
+
addServerHandler({
|
|
134
|
+
route: "/api/category/**",
|
|
135
|
+
handler: resolver.resolve("./runtime/server/api/category/[...slug]")
|
|
136
|
+
});
|
|
137
|
+
addServerHandler({
|
|
138
|
+
route: "/api/checkout/applyCoupon",
|
|
139
|
+
handler: resolver.resolve("./runtime/server/api/checkout/applyCoupon")
|
|
140
|
+
});
|
|
141
|
+
addServerHandler({
|
|
142
|
+
route: "/api/checkout/configs",
|
|
143
|
+
handler: resolver.resolve("./runtime/server/api/checkout/configs")
|
|
144
|
+
});
|
|
145
|
+
addServerHandler({
|
|
146
|
+
route: "/api/checkout/countries",
|
|
147
|
+
handler: resolver.resolve("./runtime/server/api/checkout/countries")
|
|
148
|
+
});
|
|
149
|
+
addServerHandler({
|
|
150
|
+
route: "/api/checkout/paymentmethod",
|
|
151
|
+
handler: resolver.resolve("./runtime/server/api/checkout/paymentmethod")
|
|
152
|
+
});
|
|
153
|
+
addServerHandler({
|
|
154
|
+
route: "/api/company/profile",
|
|
155
|
+
handler: resolver.resolve("./runtime/server/api/company/profile")
|
|
156
|
+
});
|
|
157
|
+
addServerHandler({
|
|
158
|
+
route: "/api/contact-center/webforms/create",
|
|
159
|
+
handler: resolver.resolve("./runtime/server/api/contact-center/webforms/create")
|
|
160
|
+
});
|
|
161
|
+
addServerHandler({
|
|
162
|
+
route: "/api/contact-center/webforms/:id/details",
|
|
163
|
+
handler: resolver.resolve("./runtime/server/api/contact-center/webforms/[id]/details")
|
|
164
|
+
});
|
|
165
|
+
addServerHandler({
|
|
166
|
+
route: "/api/customer/change-password",
|
|
167
|
+
handler: resolver.resolve("./runtime/server/api/customer/change-password")
|
|
168
|
+
});
|
|
169
|
+
addServerHandler({
|
|
170
|
+
route: "/api/customer/checkout",
|
|
171
|
+
handler: resolver.resolve("./runtime/server/api/customer/checkout")
|
|
172
|
+
});
|
|
173
|
+
addServerHandler({
|
|
174
|
+
route: "/api/customer/orders",
|
|
175
|
+
handler: resolver.resolve("./runtime/server/api/customer/orders")
|
|
176
|
+
});
|
|
177
|
+
addServerHandler({
|
|
178
|
+
route: "/api/customer/quotations",
|
|
179
|
+
handler: resolver.resolve("./runtime/server/api/customer/quotations")
|
|
180
|
+
});
|
|
181
|
+
addServerHandler({
|
|
182
|
+
route: "/api/customer/search",
|
|
183
|
+
handler: resolver.resolve("./runtime/server/api/customer/search")
|
|
184
|
+
});
|
|
185
|
+
addServerHandler({
|
|
186
|
+
route: "/api/customer/tax-invoice",
|
|
187
|
+
handler: resolver.resolve("./runtime/server/api/customer/tax-invoice")
|
|
188
|
+
});
|
|
189
|
+
addServerHandler({
|
|
190
|
+
route: "/api/customer/address/add",
|
|
191
|
+
handler: resolver.resolve("./runtime/server/api/customer/address/add")
|
|
192
|
+
});
|
|
193
|
+
addServerHandler({
|
|
194
|
+
route: "/api/customer/address/delete",
|
|
195
|
+
handler: resolver.resolve("./runtime/server/api/customer/address/delete")
|
|
196
|
+
});
|
|
197
|
+
addServerHandler({
|
|
198
|
+
route: "/api/customer/address/setshipping",
|
|
199
|
+
handler: resolver.resolve("./runtime/server/api/customer/address/setshipping")
|
|
200
|
+
});
|
|
201
|
+
addServerHandler({
|
|
202
|
+
route: "/api/customer/address/update",
|
|
203
|
+
handler: resolver.resolve("./runtime/server/api/customer/address/update")
|
|
204
|
+
});
|
|
205
|
+
addServerHandler({
|
|
206
|
+
route: "/api/customer/cards/delete",
|
|
207
|
+
handler: resolver.resolve("./runtime/server/api/customer/cards/delete")
|
|
208
|
+
});
|
|
209
|
+
addServerHandler({
|
|
210
|
+
route: "/api/customer/cards/get",
|
|
211
|
+
handler: resolver.resolve("./runtime/server/api/customer/cards/get")
|
|
212
|
+
});
|
|
213
|
+
addServerHandler({
|
|
214
|
+
route: "/api/customer/profile/update",
|
|
215
|
+
handler: resolver.resolve("./runtime/server/api/customer/profile/update")
|
|
216
|
+
});
|
|
217
|
+
addServerHandler({
|
|
218
|
+
route: "/api/customer/wishlist/add",
|
|
219
|
+
handler: resolver.resolve("./runtime/server/api/customer/wishlist/add")
|
|
220
|
+
});
|
|
221
|
+
addServerHandler({
|
|
222
|
+
route: "/api/customer/wishlist/createWishList",
|
|
223
|
+
handler: resolver.resolve("./runtime/server/api/customer/wishlist/createWishList")
|
|
224
|
+
});
|
|
225
|
+
addServerHandler({
|
|
226
|
+
route: "/api/customer/wishlist/deleteFromWishList",
|
|
227
|
+
handler: resolver.resolve("./runtime/server/api/customer/wishlist/deleteFromWishList")
|
|
228
|
+
});
|
|
229
|
+
addServerHandler({
|
|
230
|
+
route: "/api/customer/wishlist/deleteWishList",
|
|
231
|
+
handler: resolver.resolve("./runtime/server/api/customer/wishlist/deleteWishList")
|
|
232
|
+
});
|
|
233
|
+
addServerHandler({
|
|
234
|
+
route: "/api/customer/wishlist/get",
|
|
235
|
+
handler: resolver.resolve("./runtime/server/api/customer/wishlist/get")
|
|
236
|
+
});
|
|
237
|
+
addServerHandler({
|
|
238
|
+
route: "/api/customer/wishlist/getWishListItems",
|
|
239
|
+
handler: resolver.resolve("./runtime/server/api/customer/wishlist/getWishListItems")
|
|
240
|
+
});
|
|
241
|
+
addServerHandler({
|
|
242
|
+
route: "/api/customer/wishlist/updateWishList",
|
|
243
|
+
handler: resolver.resolve("./runtime/server/api/customer/wishlist/updateWishList")
|
|
244
|
+
});
|
|
245
|
+
addServerHandler({
|
|
246
|
+
route: "/api/nav/:id/links",
|
|
247
|
+
handler: resolver.resolve("./runtime/server/api/nav/[id]/links")
|
|
248
|
+
});
|
|
249
|
+
addServerHandler({
|
|
250
|
+
route: "/api/page/:slug",
|
|
251
|
+
handler: resolver.resolve("./runtime/server/api/page/[slug]")
|
|
252
|
+
});
|
|
253
|
+
addServerHandler({
|
|
254
|
+
route: "/api/product/**",
|
|
255
|
+
handler: resolver.resolve("./runtime/server/api/product/[...slug]")
|
|
256
|
+
});
|
|
257
|
+
addServerHandler({
|
|
258
|
+
route: "/api/service/:slug",
|
|
259
|
+
handler: resolver.resolve("./runtime/server/api/service/[slug]")
|
|
260
|
+
});
|
|
261
|
+
addServerHandler({
|
|
262
|
+
route: "/api/service/availability",
|
|
263
|
+
handler: resolver.resolve("./runtime/server/api/service/availability")
|
|
264
|
+
});
|
|
265
|
+
addServerHandler({
|
|
266
|
+
route: "/api/v2/**",
|
|
267
|
+
handler: resolver.resolve("./runtime/server/api/v2/[...slug]")
|
|
268
|
+
});
|
|
269
|
+
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
export { module as default };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
interface BlogPost {
|
|
2
|
+
id: number;
|
|
3
|
+
category: string;
|
|
4
|
+
title: string;
|
|
5
|
+
name: string;
|
|
6
|
+
image: string;
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
interface BlogCategory {
|
|
10
|
+
name: string;
|
|
11
|
+
url: string;
|
|
12
|
+
}
|
|
13
|
+
interface BlogData {
|
|
14
|
+
data: {
|
|
15
|
+
posts: {
|
|
16
|
+
data: BlogPost[];
|
|
17
|
+
};
|
|
18
|
+
categories: BlogCategory[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const useBlogIndex: () => {
|
|
22
|
+
activeCategory: import("vue").Ref<string, string>;
|
|
23
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
24
|
+
shopQuery: import("vue").Ref<{
|
|
25
|
+
limit: number;
|
|
26
|
+
page: number;
|
|
27
|
+
category: string;
|
|
28
|
+
search: string;
|
|
29
|
+
}, {
|
|
30
|
+
limit: number;
|
|
31
|
+
page: number;
|
|
32
|
+
category: string;
|
|
33
|
+
search: string;
|
|
34
|
+
} | {
|
|
35
|
+
limit: number;
|
|
36
|
+
page: number;
|
|
37
|
+
category: string;
|
|
38
|
+
search: string;
|
|
39
|
+
}>;
|
|
40
|
+
PostItems: import("vue").Ref<{
|
|
41
|
+
id: number;
|
|
42
|
+
category: string;
|
|
43
|
+
title: string;
|
|
44
|
+
name: string;
|
|
45
|
+
image: string;
|
|
46
|
+
url: string;
|
|
47
|
+
}[], BlogPost[] | {
|
|
48
|
+
id: number;
|
|
49
|
+
category: string;
|
|
50
|
+
title: string;
|
|
51
|
+
name: string;
|
|
52
|
+
image: string;
|
|
53
|
+
url: string;
|
|
54
|
+
}[]>;
|
|
55
|
+
PostsData: import("vue").Ref<{
|
|
56
|
+
data: {
|
|
57
|
+
posts: {
|
|
58
|
+
data: {
|
|
59
|
+
id: number;
|
|
60
|
+
category: string;
|
|
61
|
+
title: string;
|
|
62
|
+
name: string;
|
|
63
|
+
image: string;
|
|
64
|
+
url: string;
|
|
65
|
+
}[];
|
|
66
|
+
};
|
|
67
|
+
categories: {
|
|
68
|
+
name: string;
|
|
69
|
+
url: string;
|
|
70
|
+
}[];
|
|
71
|
+
};
|
|
72
|
+
} | null, BlogData | {
|
|
73
|
+
data: {
|
|
74
|
+
posts: {
|
|
75
|
+
data: {
|
|
76
|
+
id: number;
|
|
77
|
+
category: string;
|
|
78
|
+
title: string;
|
|
79
|
+
name: string;
|
|
80
|
+
image: string;
|
|
81
|
+
url: string;
|
|
82
|
+
}[];
|
|
83
|
+
};
|
|
84
|
+
categories: {
|
|
85
|
+
name: string;
|
|
86
|
+
url: string;
|
|
87
|
+
}[];
|
|
88
|
+
};
|
|
89
|
+
} | null>;
|
|
90
|
+
total: import("vue").Ref<number, number>;
|
|
91
|
+
displayPosts: import("vue").ComputedRef<{
|
|
92
|
+
id: number;
|
|
93
|
+
category: string;
|
|
94
|
+
title: string;
|
|
95
|
+
name: string;
|
|
96
|
+
image: string;
|
|
97
|
+
url: string;
|
|
98
|
+
}[]>;
|
|
99
|
+
progressPercentage: import("vue").ComputedRef<number>;
|
|
100
|
+
canLoadMore: import("vue").ComputedRef<boolean>;
|
|
101
|
+
loadMore: () => Promise<void>;
|
|
102
|
+
clearSearch: () => void;
|
|
103
|
+
fetchBlogData: () => Promise<{
|
|
104
|
+
data: import("vue").Ref<BlogData | undefined, BlogData | undefined>;
|
|
105
|
+
pending: import("vue").Ref<boolean, boolean>;
|
|
106
|
+
} | {
|
|
107
|
+
data: import("vue").Ref<null, null>;
|
|
108
|
+
pending: import("vue").Ref<boolean, boolean>;
|
|
109
|
+
}>;
|
|
110
|
+
};
|
|
111
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ref, computed, watch, onMounted } from "vue";
|
|
2
|
+
import { useFetch } from "#imports";
|
|
3
|
+
export const useBlogIndex = () => {
|
|
4
|
+
const activeCategory = ref("All");
|
|
5
|
+
const loading = ref(false);
|
|
6
|
+
const limit = 4;
|
|
7
|
+
const currentIndex = ref(0);
|
|
8
|
+
const total = ref(0);
|
|
9
|
+
const shopQuery = ref({
|
|
10
|
+
limit: 6,
|
|
11
|
+
page: 1,
|
|
12
|
+
category: "",
|
|
13
|
+
search: ""
|
|
14
|
+
});
|
|
15
|
+
const PostItems = ref([]);
|
|
16
|
+
const PostsData = ref(null);
|
|
17
|
+
const queryString = (querydata) => {
|
|
18
|
+
const params = new URLSearchParams();
|
|
19
|
+
params.append("limit", querydata.limit.toString());
|
|
20
|
+
params.append("page", querydata.page.toString());
|
|
21
|
+
params.append("category", querydata.category !== "All" ? querydata.category : "");
|
|
22
|
+
params.append("search", querydata.search);
|
|
23
|
+
return params.toString();
|
|
24
|
+
};
|
|
25
|
+
const loadMore = async () => {
|
|
26
|
+
if (loading.value || currentIndex.value >= total.value) return;
|
|
27
|
+
loading.value = true;
|
|
28
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
29
|
+
shopQuery.value.page += 1;
|
|
30
|
+
await fetchBlogData();
|
|
31
|
+
loading.value = false;
|
|
32
|
+
};
|
|
33
|
+
const clearSearch = () => {
|
|
34
|
+
PostItems.value = [];
|
|
35
|
+
shopQuery.value.page = 1;
|
|
36
|
+
shopQuery.value.search = "";
|
|
37
|
+
currentIndex.value = 0;
|
|
38
|
+
};
|
|
39
|
+
const fetchBlogData = async () => {
|
|
40
|
+
try {
|
|
41
|
+
const { data, pending } = await useFetch(() => `/api/blog/blog?${queryString(shopQuery.value)}`, {
|
|
42
|
+
method: "POST",
|
|
43
|
+
watch: [() => shopQuery.value.category],
|
|
44
|
+
server: false
|
|
45
|
+
});
|
|
46
|
+
watch(data, (newData) => {
|
|
47
|
+
if (newData) {
|
|
48
|
+
PostsData.value = newData;
|
|
49
|
+
PostItems.value.push(...newData.data?.posts?.data || []);
|
|
50
|
+
total.value = newData.data?.posts?.data.length || 0;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
onMounted(() => {
|
|
54
|
+
if (data.value) {
|
|
55
|
+
PostsData.value = data.value;
|
|
56
|
+
PostItems.value.push(...data.value.data?.posts?.data || []);
|
|
57
|
+
total.value = data.value.data?.posts?.data.length || 0;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return { data, pending };
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error("Failed to fetch blog data:", error);
|
|
63
|
+
return { data: ref(null), pending: ref(false) };
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const displayPosts = computed(() => PostItems.value);
|
|
67
|
+
const progressPercentage = computed(() => PostItems.value.length / total.value * 100);
|
|
68
|
+
const canLoadMore = computed(() => !loading.value && PostItems.value.length < total.value);
|
|
69
|
+
return {
|
|
70
|
+
// State
|
|
71
|
+
activeCategory,
|
|
72
|
+
loading,
|
|
73
|
+
shopQuery,
|
|
74
|
+
PostItems,
|
|
75
|
+
PostsData,
|
|
76
|
+
total,
|
|
77
|
+
// Computed
|
|
78
|
+
displayPosts,
|
|
79
|
+
progressPercentage,
|
|
80
|
+
canLoadMore,
|
|
81
|
+
// Methods
|
|
82
|
+
loadMore,
|
|
83
|
+
clearSearch,
|
|
84
|
+
fetchBlogData
|
|
85
|
+
};
|
|
86
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface BlogPost {
|
|
2
|
+
name: string;
|
|
3
|
+
short_description: string;
|
|
4
|
+
url: string;
|
|
5
|
+
image: string;
|
|
6
|
+
}
|
|
7
|
+
interface BlogMainProps {
|
|
8
|
+
post: BlogPost;
|
|
9
|
+
}
|
|
10
|
+
export declare const useBlogMain: (props: BlogMainProps) => {
|
|
11
|
+
post: import("vue").ComputedRef<BlogPost>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const useBlogSidebar: () => {
|
|
2
|
+
categories: import("vue").Ref<string[], string[]>;
|
|
3
|
+
email: import("vue").Ref<string, string>;
|
|
4
|
+
isSubscribing: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
subscribeToNewsletter: () => Promise<void>;
|
|
6
|
+
selectCategory: (category: string) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
export const useBlogSidebar = () => {
|
|
3
|
+
const categories = ref([
|
|
4
|
+
"Automation",
|
|
5
|
+
"Bedroom",
|
|
6
|
+
"Blinds",
|
|
7
|
+
"Curtains",
|
|
8
|
+
"Shutters",
|
|
9
|
+
"Bathroom",
|
|
10
|
+
"Motorisation",
|
|
11
|
+
"Office"
|
|
12
|
+
]);
|
|
13
|
+
const email = ref("");
|
|
14
|
+
const isSubscribing = ref(false);
|
|
15
|
+
const subscribeToNewsletter = async () => {
|
|
16
|
+
if (!email.value) return;
|
|
17
|
+
isSubscribing.value = true;
|
|
18
|
+
try {
|
|
19
|
+
email.value = "";
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error("Newsletter subscription failed:", error);
|
|
22
|
+
} finally {
|
|
23
|
+
isSubscribing.value = false;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const selectCategory = (category) => {
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
// State
|
|
30
|
+
categories,
|
|
31
|
+
email,
|
|
32
|
+
isSubscribing,
|
|
33
|
+
// Methods
|
|
34
|
+
subscribeToNewsletter,
|
|
35
|
+
selectCategory
|
|
36
|
+
};
|
|
37
|
+
};
|