@meeovi/layer-commerce 1.0.11 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/app/cart/useCart.ts +1 -0
  2. package/app/components/catalog/product/ProductAccordion/ProductAccordion.vue +39 -0
  3. package/app/components/catalog/product/ProductAccordion/__tests__/ProductAccordion.spec.ts +15 -0
  4. package/app/components/catalog/product/ProductAccordion/types.ts +5 -0
  5. package/app/components/catalog/product/ProductProperties/ProductProperties.vue +50 -0
  6. package/app/components/catalog/product/ProductProperties/__tests__/ProductProperties.spec.ts +15 -0
  7. package/app/components/catalog/product/ProductProperties/types.ts +5 -0
  8. package/app/components/catalog/product/ProductSlider/ProductSlider.vue +28 -0
  9. package/app/components/catalog/product/ProductSlider/__tests__/ProductSlider.spec.ts +14 -0
  10. package/app/components/catalog/product/ProductSlider/types.ts +7 -0
  11. package/app/components/catalog/product/RecommendedProducts/RecommendedProducts.vue +12 -0
  12. package/app/components/catalog/product/RecommendedProducts/types.ts +5 -0
  13. package/app/components/catalog/product/RenderContentProductSlider/RenderContentProductSlider.vue +11 -0
  14. package/app/components/catalog/product/add-attribute.vue +54 -0
  15. package/app/components/catalog/product/add-product-type.vue +54 -0
  16. package/app/components/catalog/product/add-product.vue +53 -0
  17. package/app/components/catalog/product/add-showcase.vue +52 -0
  18. package/app/components/catalog/product/add-station.vue +54 -0
  19. package/app/components/catalog/product/bestsellers.vue +57 -0
  20. package/app/components/catalog/product/bidding.vue +93 -0
  21. package/app/components/catalog/product/colorOptions.vue +58 -0
  22. package/app/components/catalog/product/deals.vue +46 -0
  23. package/app/components/catalog/product/exclusives.vue +56 -0
  24. package/app/components/catalog/product/featuredproducts.vue +57 -0
  25. package/app/components/catalog/product/giftCard.vue +63 -0
  26. package/app/components/catalog/product/latestproducts.vue +46 -0
  27. package/app/components/catalog/product/productCard.vue +105 -0
  28. package/app/components/catalog/product/productCompare.vue +60 -0
  29. package/app/components/catalog/product/productCompareTable.vue +441 -0
  30. package/app/components/catalog/product/productDetails.vue +126 -0
  31. package/app/components/catalog/product/productFaqs.vue +17 -0
  32. package/app/components/catalog/product/productGallery.vue +16 -0
  33. package/app/components/catalog/product/productQty.vue +54 -0
  34. package/app/components/catalog/product/productReviews.vue +56 -0
  35. package/app/components/catalog/product/productSpecs.vue +116 -0
  36. package/app/components/catalog/product/radiostation.vue +36 -0
  37. package/app/components/catalog/product/recentlyviewed.vue +43 -0
  38. package/app/components/catalog/product/relatedbrands.vue +54 -0
  39. package/app/components/catalog/product/relatedproducts.vue +43 -0
  40. package/app/components/catalog/product/relatedstations.vue +40 -0
  41. package/app/components/catalog/product/shippingOptions.vue +41 -0
  42. package/app/components/catalog/product/sizeOptions.vue +42 -0
  43. package/app/components/catalog/product/update-attribute-set.vue +209 -0
  44. package/app/components/catalog/product/update-attribute.vue +118 -0
  45. package/app/components/catalog/product/update-product.vue +372 -0
  46. package/app/components/catalog/product/update-showcase.vue +153 -0
  47. package/app/components/catalog/shops/relatedstores.vue +37 -0
  48. package/app/components/catalog/shops/restaurant.vue +66 -0
  49. package/app/components/catalog/shops/stores.vue +44 -0
  50. package/app/components/catalog/vendor/README.md +3 -0
  51. package/app/components/catalog/vendor/blocks/biggestcustomers.vue +33 -0
  52. package/app/components/catalog/vendor/blocks/lowestselling.vue +33 -0
  53. package/app/components/catalog/vendor/blocks/topcategories.vue +33 -0
  54. package/app/components/catalog/vendor/blocks/topproducts.vue +27 -0
  55. package/app/components/catalog/vendor/pages/attributes.vue +43 -0
  56. package/app/components/catalog/vendor/pages/commissions.vue +43 -0
  57. package/app/components/catalog/vendor/pages/crm.vue +67 -0
  58. package/app/components/catalog/vendor/pages/dashboard.vue +46 -0
  59. package/app/components/catalog/vendor/pages/emails.vue +43 -0
  60. package/app/components/catalog/vendor/pages/enquiries.vue +43 -0
  61. package/app/components/catalog/vendor/pages/invoices.vue +43 -0
  62. package/app/components/catalog/vendor/pages/orders.vue +68 -0
  63. package/app/components/catalog/vendor/pages/products.vue +55 -0
  64. package/app/components/catalog/vendor/pages/reviews.vue +48 -0
  65. package/app/components/catalog/vendor/pages/shipments.vue +43 -0
  66. package/app/components/catalog/vendor/pages/stores.vue +43 -0
  67. package/app/components/categories/chart/[id].vue +200 -0
  68. package/app/components/categories/chart/add-chart.vue +142 -0
  69. package/app/components/categories/chart/chart.vue +82 -0
  70. package/app/components/categories/chart/monthlyChart.vue +46 -0
  71. package/app/components/categories/chart/weeklyChart.vue +46 -0
  72. package/app/components/categories/chart/yearlyChart.vue +46 -0
  73. package/app/components/categories/charts.vue +118 -0
  74. package/app/components/categories/deals.vue +101 -0
  75. package/app/components/categories/eats.vue +49 -0
  76. package/app/components/categories/restaurants.vue +26 -0
  77. package/app/components/categories/station/[id].vue +72 -0
  78. package/app/components/categories/stations.vue +124 -0
  79. package/app/components/categories/time/time.vue +63 -0
  80. package/app/components/categories/travel.vue +75 -0
  81. package/app/components/categories/weather/weather.vue +44 -0
  82. package/app/components/content/blocks/breadcrumbs.vue +0 -0
  83. package/app/components/content/blocks/currencySwitcher.vue +0 -0
  84. package/app/components/content/blocks/languageSwitcher.vue +0 -0
  85. package/app/components/content/blocks/videoproduct.vue +9 -0
  86. package/app/components/content/pages/checkout.vue +118 -0
  87. package/app/components/content/pages/meeoviGlobal.vue +68 -0
  88. package/app/components/content/pages/pickup-locations.vue +238 -0
  89. package/app/components/content/pages/showcases.vue +90 -0
  90. package/app/components/content/pages/success.vue +60 -0
  91. package/app/components/marketing/add-brand.vue +54 -0
  92. package/app/components/marketing/add-incentive.vue +54 -0
  93. package/app/components/marketing/promotions/giftcards.vue +102 -0
  94. package/app/components/marketing/promotions/subscriptions.vue +121 -0
  95. package/app/components/marketing/update-incentive.vue +326 -0
  96. package/app/components/menus/lowernav.vue +78 -0
  97. package/app/components/partials/LocaleSelector.vue +24 -0
  98. package/app/components/partials/ShoppingCart.vue +128 -0
  99. package/app/components/partials/StripePayment.vue +149 -0
  100. package/app/components/partials/addToCartBtn.vue +40 -0
  101. package/app/components/partials/cartItem.vue +124 -0
  102. package/app/components/partials/checkoutButton.vue +44 -0
  103. package/app/components/partials/compareBtn.vue +68 -0
  104. package/app/components/partials/ratings.vue +13 -0
  105. package/app/components/partials/store/CurrencySelector.vue +133 -0
  106. package/app/components/partials/store/StoreSwitcher.vue +13 -0
  107. package/app/components/placeholders/Comments.vue +15 -0
  108. package/app/components/placeholders/CreateListBtn.vue +7 -0
  109. package/app/components/placeholders/Event.vue +9 -0
  110. package/app/components/placeholders/ListShowcases.vue +9 -0
  111. package/app/components/placeholders/Short.vue +9 -0
  112. package/app/components/placeholders/Space.vue +9 -0
  113. package/app/components/placeholders/Tag.vue +7 -0
  114. package/app/components/related/brandCard.vue +41 -0
  115. package/app/components/related/incentiveCard.vue +44 -0
  116. package/app/components/related/invoiceCard.vue +43 -0
  117. package/app/components/related/orderCard.vue +43 -0
  118. package/app/components/related/relatedproducts.vue +17 -0
  119. package/app/components/sales/CartPageContent/CartPageContent.vue +37 -0
  120. package/app/components/sales/CheckoutAddress/CheckoutAddress.vue +50 -0
  121. package/app/components/sales/CheckoutAddress/__tests__/CheckoutAddress.spec.ts +16 -0
  122. package/app/components/sales/CheckoutAddress/types.ts +16 -0
  123. package/app/components/sales/CheckoutPayment/CheckoutPayment.vue +68 -0
  124. package/app/components/sales/CheckoutPayment/__tests__/CheckoutPayment.spec.ts +14 -0
  125. package/app/components/sales/CheckoutPayment/types.ts +12 -0
  126. package/app/components/sales/OrderSummary/OrderSummary.vue +57 -0
  127. package/app/components/sales/OrderSummary/__tests__/ContactInformation.spec.ts +52 -0
  128. package/app/components/sales/OrderSummary/types.ts +5 -0
  129. package/app/components/sales/incentives.vue +223 -0
  130. package/app/components/sales/invoices.vue +107 -0
  131. package/app/components/sales/orders.vue +378 -0
  132. package/app/components/sales/shipments.vue +65 -0
  133. package/app/components/sales/transactions.vue +109 -0
  134. package/app/components/shop/add-shop.vue +54 -0
  135. package/app/components/shop/cart/cartItem.vue +182 -0
  136. package/app/components/shop/cart/checkout.vue +415 -0
  137. package/app/components/shop/checkout/StripeCardElement.vue +206 -0
  138. package/app/components/shop/checkout/StripeCheckout.vue +49 -0
  139. package/app/components/shop/checkout/addressBilling.vue +263 -0
  140. package/app/components/shop/checkout/addressShipping.vue +175 -0
  141. package/app/components/shop/checkout/cart/ProductItem.vue +56 -0
  142. package/app/components/shop/checkout/cart/PromotionItem.vue +53 -0
  143. package/app/composables/_types.ts +18 -0
  144. package/app/composables/adapters/abstract/cartAdapter.ts +0 -0
  145. package/app/composables/adapters/abstract/categoryAdapter.ts +0 -0
  146. package/app/composables/adapters/abstract/customerAdapter.ts +0 -0
  147. package/app/composables/adapters/abstract/inventoryAdapter.ts +0 -0
  148. package/app/composables/adapters/abstract/orderAdapter.ts +0 -0
  149. package/app/composables/adapters/abstract/productAdapter.ts +7 -0
  150. package/app/composables/cart/registry.ts +20 -0
  151. package/app/composables/cart/types.ts +18 -0
  152. package/app/composables/cart/useCart.ts +15 -0
  153. package/app/composables/config.ts +19 -0
  154. package/app/composables/defs/apiDefinitions.ts +55 -0
  155. package/app/composables/defs/extension.feature +40 -0
  156. package/app/composables/defs/extension.mocks.ts +39 -0
  157. package/app/composables/defs/extension.test.ts +280 -0
  158. package/app/composables/defs/extension.ts +236 -0
  159. package/app/composables/defs/index.ts +3 -0
  160. package/app/composables/defs/types.ts +136 -0
  161. package/app/composables/domain/cart.ts +0 -0
  162. package/app/composables/domain/category.ts +0 -0
  163. package/app/composables/domain/order.ts +0 -0
  164. package/app/composables/domain/price.ts +0 -0
  165. package/app/composables/domain/product.ts +10 -0
  166. package/app/composables/domain/reward.ts +0 -0
  167. package/app/composables/domain/transactions.ts +0 -0
  168. package/app/composables/featured-products.ts +20 -0
  169. package/app/composables/helpers/contextualizedNormalizers.feature +14 -0
  170. package/app/composables/helpers/contextualizedNormalizers.test.ts +85 -0
  171. package/app/composables/helpers/contextualizedNormalizers.ts +20 -0
  172. package/app/composables/helpers/index.ts +1 -0
  173. package/app/composables/index.ts +6 -0
  174. package/app/composables/methods/auth.ts +83 -0
  175. package/app/composables/methods/cart.ts +119 -0
  176. package/app/composables/methods/category.ts +27 -0
  177. package/app/composables/methods/checkout.ts +54 -0
  178. package/app/composables/methods/customer.ts +52 -0
  179. package/app/composables/methods/helpers.ts +5 -0
  180. package/app/composables/methods/index.ts +75 -0
  181. package/app/composables/methods/order.ts +39 -0
  182. package/app/composables/methods/product.ts +95 -0
  183. package/app/composables/methods/settings.ts +16 -0
  184. package/app/composables/models/cart.ts +95 -0
  185. package/app/composables/models/category.ts +13 -0
  186. package/app/composables/models/checkout.ts +17 -0
  187. package/app/composables/models/customer.ts +16 -0
  188. package/app/composables/models/facets.ts +25 -0
  189. package/app/composables/models/index.ts +94 -0
  190. package/app/composables/models/order.ts +43 -0
  191. package/app/composables/models/product.ts +73 -0
  192. package/app/composables/models/shared.ts +75 -0
  193. package/app/composables/orders.ts +69 -0
  194. package/app/composables/products/registry.ts +20 -0
  195. package/app/composables/products/types.ts +13 -0
  196. package/app/composables/products/useEvents.ts +0 -0
  197. package/app/composables/products/useGiftCards.ts +0 -0
  198. package/app/composables/products/useProducts.ts +12 -0
  199. package/app/composables/products/useSubscriptions.ts +0 -0
  200. package/app/composables/products.ts +30 -0
  201. package/app/composables/registry.ts +21 -0
  202. package/app/composables/useAuth.ts +43 -0
  203. package/app/composables/useBreakpoints/index.ts +1 -0
  204. package/app/composables/useBreakpoints/useBreakpoints.ts +28 -0
  205. package/app/composables/useCache.ts +38 -0
  206. package/app/composables/useCart/__tests__/useCart.spec.ts +11 -0
  207. package/app/composables/useCart/index.ts +1 -0
  208. package/app/composables/useCart/types.ts +17 -0
  209. package/app/composables/useCart/useCart.ts +46 -0
  210. package/app/composables/useCartShippingMethods/__tests__/useCartShippingMethods.spec.ts +11 -0
  211. package/app/composables/useCartShippingMethods/index.ts +1 -0
  212. package/app/composables/useCartShippingMethods/types.ts +17 -0
  213. package/app/composables/useCartShippingMethods/useCartShippingMethods.ts +47 -0
  214. package/app/composables/useCatalog.ts +64 -0
  215. package/app/composables/useContent.ts +57 -0
  216. package/app/composables/useCustomer/__tests__/useCustomer.spec.ts +25 -0
  217. package/app/composables/useCustomer/index.ts +2 -0
  218. package/app/composables/useCustomer/types.ts +17 -0
  219. package/app/composables/useCustomer/useCustomer.ts +40 -0
  220. package/app/composables/useCustomerAddress/__tests__/useCustomerAddress.spec.ts +11 -0
  221. package/app/composables/useCustomerAddress/index.ts +2 -0
  222. package/app/composables/useCustomerAddress/types.ts +17 -0
  223. package/app/composables/useCustomerAddress/useCustomerAddress.ts +55 -0
  224. package/app/composables/useCustomerOrder/__tests__/useCustomerOrder.spec.ts +11 -0
  225. package/app/composables/useCustomerOrder/adress.ts +10 -0
  226. package/app/composables/useCustomerOrder/index.ts +2 -0
  227. package/app/composables/useCustomerOrder/product.ts +37 -0
  228. package/app/composables/useCustomerOrder/types.ts +40 -0
  229. package/app/composables/useCustomerOrder/useCustomerOrder.ts +63 -0
  230. package/app/composables/useCustomerOrders/__tests__/useCustomerOrders.spec.ts +11 -0
  231. package/app/composables/useCustomerOrders/index.ts +2 -0
  232. package/app/composables/useCustomerOrders/types.ts +20 -0
  233. package/app/composables/useCustomerOrders/useCustomerOrders.ts +56 -0
  234. package/app/composables/useCustomerReturns/__tests__/useCustomerReturns.spec.ts +11 -0
  235. package/app/composables/useCustomerReturns/index.ts +2 -0
  236. package/app/composables/useCustomerReturns/types.ts +17 -0
  237. package/app/composables/useCustomerReturns/useCustomerReturns.ts +41 -0
  238. package/app/composables/useHandleError/index.ts +1 -0
  239. package/app/composables/useHandleError/types.ts +11 -0
  240. package/app/composables/useHandleError/useHandleError.ts +27 -0
  241. package/app/composables/useInventory.ts +21 -0
  242. package/app/composables/useLoading.ts +21 -0
  243. package/app/composables/useNotification.ts +21 -0
  244. package/app/composables/usePageTitle.ts +16 -0
  245. package/app/composables/useProduct/index.ts +2 -0
  246. package/app/composables/useProduct/types.ts +17 -0
  247. package/app/composables/useProduct/useProduct.ts +42 -0
  248. package/app/composables/useProductAttribute/__tests__/useProduct.mock.ts +31 -0
  249. package/app/composables/useProductAttribute/__tests__/useProductAttribute.spec.ts +14 -0
  250. package/app/composables/useProductAttribute/index.ts +1 -0
  251. package/app/composables/useProductAttribute/useProductAttribute.ts +37 -0
  252. package/app/composables/useProductRecommended/__tests__/useProductRecommended.spec.ts +12 -0
  253. package/app/composables/useProductRecommended/index.ts +1 -0
  254. package/app/composables/useProductRecommended/types.ts +17 -0
  255. package/app/composables/useProductRecommended/useProductRecommended.ts +43 -0
  256. package/app/composables/useProductReviews/__tests__/productReviews.mock.ts +20 -0
  257. package/app/composables/useProductReviews/__tests__/useProductReviews.spec.ts +22 -0
  258. package/app/composables/useProductReviews/index.ts +2 -0
  259. package/app/composables/useProductReviews/types.ts +17 -0
  260. package/app/composables/useProductReviews/useProductReviews.ts +46 -0
  261. package/app/composables/useProducts/__tests__/useProducts.spec.ts +11 -0
  262. package/app/composables/useProducts/types.ts +22 -0
  263. package/app/composables/useProducts/useProducts.ts +41 -0
  264. package/app/composables/useTax.ts +17 -0
  265. package/app/composables/validationRules/index.ts +1 -0
  266. package/app/composables/validationRules/password.feature +67 -0
  267. package/app/composables/validationRules/password.test.ts +89 -0
  268. package/app/composables/validationRules/password.ts +25 -0
  269. package/app/composables/vendors/index.ts +0 -0
  270. package/app/composables/vendors/registry.ts +0 -0
  271. package/app/composables/vendors/useAffiliates.ts +0 -0
  272. package/app/composables/vendors/useCommission.ts +0 -0
  273. package/app/modules/vue-head/composables/useHead.ts +22 -0
  274. package/app/pages/brand/[...slug].vue +92 -0
  275. package/app/pages/brands.vue +90 -0
  276. package/app/pages/cart.vue +142 -0
  277. package/app/pages/compare.vue +166 -0
  278. package/app/pages/departments/[...slug].vue +385 -0
  279. package/app/pages/departments/category/[...slug].vue +135 -0
  280. package/app/pages/incentive/[...id].vue +66 -0
  281. package/app/pages/invoice/[id].vue +309 -0
  282. package/app/pages/order/[id].vue +327 -0
  283. package/app/pages/product/[...id].vue +309 -0
  284. package/app/pages/product/showcases/index.vue +86 -0
  285. package/app/pages/shipment/[...id].vue +176 -0
  286. package/app/pages/shop/[...slug].vue +158 -0
  287. package/app/pages/shops.vue +76 -0
  288. package/app/pages/subscription/[...id].vue +147 -0
  289. package/app/pages/transaction/[...id].vue +74 -0
  290. package/app/services/magento.ts +49 -0
  291. package/app/stores/cart.ts +218 -0
  292. package/app/stores/cartStore.ts +316 -0
  293. package/app/stores/checkout.ts +19 -0
  294. package/app/stores/compare.ts +65 -0
  295. package/app/stores/currency.js +29 -0
  296. package/app/stores/digital-products.js +11 -0
  297. package/app/stores/index.js +0 -0
  298. package/app/stores/orders.ts +161 -0
  299. package/app/stores/product.ts +26 -0
  300. package/app/stores/productList.ts +0 -0
  301. package/app/stores/productListInfo.ts +0 -0
  302. package/app/stores/products.ts +116 -0
  303. package/app/stores/recentlyViewedProducts.ts +0 -0
  304. package/app/stores/review.ts +25 -0
  305. package/app/stores/storeInPickUp.ts +22 -0
  306. package/app/stores/user.ts +20 -0
  307. package/app/stores/wishlist.ts +19 -0
  308. package/app/types/Order.type.ts +181 -0
  309. package/app/types/checkout.ts +6 -0
  310. package/app/types/imports.d.ts +28 -0
  311. package/app/types/index.ts +291 -0
  312. package/app/types/nuxt-imports.d.ts +5 -0
  313. package/app/types/product-state.ts +8 -0
  314. package/app/types/product.ts +22 -0
  315. package/app/types/review-state.ts +7 -0
  316. package/app/types/review.ts +2 -0
  317. package/app/types/storeInPickUp.ts +2 -0
  318. package/app/types/storePickup-state.ts +5 -0
  319. package/app/types/vue-globals.d.ts +9 -0
  320. package/app/types/wishlist-state.ts +5 -0
  321. package/app/types/wishlist.ts +2 -0
  322. package/app/utils/client.ts +26 -0
  323. package/app/utils/countryList.ts +14 -0
  324. package/app/utils/currency.js +56 -0
  325. package/app/utils/errorHandler.ts +16 -0
  326. package/app/utils/glossary.ts +0 -0
  327. package/app/utils/importExport.ts +0 -0
  328. package/app/utils/index.ts +53 -0
  329. package/app/utils/normalizer.ts +23 -0
  330. package/app/utils/normalizers/magento.ts +29 -0
  331. package/app/utils/normalizers/shopify.ts +29 -0
  332. package/app/utils/print.ts +0 -0
  333. package/app/utils/shopThemes.ts +0 -0
  334. package/app/utils/statistics.ts +0 -0
  335. package/app/utils/stock.ts +0 -0
  336. package/app/utils/stripe.ts +16 -0
  337. package/app/utils/taxation.ts +0 -0
  338. package/app/utils/tellFriends.ts +0 -0
  339. package/composables/useAuth.ts +2 -0
  340. package/composables/useCache.ts +2 -0
  341. package/composables/useInventory.ts +2 -0
  342. package/composables/useLoading.ts +2 -0
  343. package/composables/useNotification.ts +2 -0
  344. package/composables/useTax.ts +2 -0
  345. package/graphql/queries-mutations_subscriptions/types/ProductCompare.type.ts +20 -0
  346. package/package.json +5 -12
  347. package/services/magento.ts +2 -0
  348. package/tsconfig.json +36 -0
  349. package/types/checkout.d.ts +6 -0
  350. package/types/checkout.ts +6 -0
  351. package/types/nuxt-imports.d.ts +5 -0
  352. package/types/product.d.ts +5 -0
  353. package/types/product.ts +3 -0
  354. package/types/review.d.ts +1 -0
  355. package/types/review.ts +1 -0
  356. package/types/storeInPickUp.d.ts +1 -0
  357. package/types/storeInPickUp.ts +1 -0
  358. package/types/wishlist.d.ts +1 -0
  359. package/types/wishlist.ts +1 -0
  360. package/utils/errorHandler.ts +2 -0
@@ -0,0 +1,28 @@
1
+ declare module '#imports' {
2
+ export function useRuntimeConfig(): any
3
+ export function useNuxtApp(): any
4
+ export function useAppConfig(): any
5
+ export function useOrders(): any
6
+ export function useReturns(): any
7
+ export function useTransactions(): any
8
+ export function useInvoices(): any
9
+ export function useCreditMemos(): any
10
+ }
11
+
12
+ declare module 'nuxt/app' {
13
+ export function useAppConfig(): any
14
+ export function useAsyncData<T = any>(keyOrHandler: string | null | (() => Promise<T> | T), handler?: (...args: any[]) => Promise<T> | T): Promise<{ data: { value: T }, error: { value: any } }>
15
+ export function useState<T = any>(key: string, init?: T | (() => T)): { value: T }
16
+ }
17
+
18
+ // Provide globals for files that call Nuxt auto-imports without module import
19
+ declare function useNuxtApp(): any
20
+ declare function useRuntimeConfig(): any
21
+ declare function useAppConfig(): any
22
+
23
+ // Order-related auto-imports used without explicit imports in stores
24
+ declare function useOrders(): any
25
+ declare function useReturns(): any
26
+ declare function useTransactions(): any
27
+ declare function useInvoices(): any
28
+ declare function useCreditMemos(): any
@@ -0,0 +1,291 @@
1
+ export * from '~/types/checkout'
2
+ export * from '~/types/product'
3
+ export * from '~/types/review'
4
+ export * from '~/types/storeInPickUp'
5
+ export * from '~/types/wishlist'
6
+ // types/index.ts - Main type definitions for commerce layer
7
+
8
+ // Re-export Order types
9
+ export * from './Order.type'
10
+ export type Money = string | number;
11
+
12
+ export interface VariationNode {
13
+ databaseId: number;
14
+ salePrice: Money;
15
+ regularPrice: Money;
16
+ stockQuantity?: number;
17
+ image?: { sourceUrl: string };
18
+ }
19
+
20
+ export interface Variation {
21
+ node: VariationNode;
22
+ attributes: Array<{ value: string }>;
23
+ }
24
+
25
+ export interface ProductNode {
26
+ sku: string;
27
+ slug: string;
28
+ name: string;
29
+ }
30
+
31
+ export interface Product {
32
+ id: string;
33
+ sku?: string;
34
+ slug?: string;
35
+ name?: string;
36
+ description?: string;
37
+ images?: Array<{ sourceUrl?: string }>;
38
+ price?: number;
39
+ regularPrice?: number;
40
+ salePrice?: number;
41
+ sale_price?: number;
42
+ attributes?: Array<{ name: string; value: string }>;
43
+ variations?: ProductVariant[];
44
+ }
45
+
46
+ export interface ProductVariant {
47
+ id: string;
48
+ sku?: string;
49
+ price?: number;
50
+ regularPrice?: number;
51
+ salePrice?: number;
52
+ stockQuantity?: number;
53
+ image?: { sourceUrl?: string };
54
+ attributes?: Array<{ name: string; value: string }>;
55
+ }
56
+
57
+ export interface CartItemNode {
58
+ key: string;
59
+ quantity: number;
60
+ product: { node: ProductNode };
61
+ variation: Variation;
62
+ }
63
+
64
+ export interface AddToCartResponse {
65
+ addToCart: { cartItem: CartItemNode };
66
+ }
67
+
68
+ export type AddBtnStatus = 'add' | 'loading' | 'added';
69
+
70
+ export type RemoveBtnStatus = 'remove' | 'loading';
71
+
72
+ // Customer types
73
+ export interface Customer {
74
+ id: string
75
+ first_name: string
76
+ last_name: string
77
+ email: string
78
+ phone?: string
79
+ date_of_birth?: string
80
+ preferred_currency?: string
81
+ company_id?: string
82
+ created_at: string
83
+ updated_at: string
84
+ }
85
+
86
+ // Company types (B2B)
87
+ export interface Company {
88
+ id: string
89
+ name: string
90
+ email: string
91
+ phone?: string
92
+ tax_id?: string
93
+ industry?: string
94
+ owner_id: string
95
+ status: 'active' | 'inactive' | 'pending'
96
+ created_at: string
97
+ updated_at: string
98
+ }
99
+
100
+ // Return types
101
+ export interface Refund {
102
+ id: string
103
+ refund_number?: string
104
+ order_id?: string
105
+ return_id?: string
106
+ transaction_id?: string
107
+ amount: number
108
+ currency: string
109
+ reason?: string
110
+ status: 'pending' | 'processed' | 'refunded' | 'failed' | 'cancelled'
111
+ metadata?: Record<string, any>
112
+ created_at: string
113
+ updated_at: string
114
+ }
115
+
116
+ export interface Return {
117
+ id: string
118
+ return_number: string
119
+ order_id: string
120
+ customer_id: string
121
+ status: 'requested' | 'approved' | 'rejected' | 'processed' | 'refunded'
122
+ reason: string
123
+ description?: string
124
+ return_items: ReturnItem[]
125
+ refunds?: Refund[]
126
+ created_at: string
127
+ updated_at: string
128
+ }
129
+
130
+ export interface ReturnItem {
131
+ id: string
132
+ return_id: string
133
+ order_item_id: string
134
+ product_id: string
135
+ quantity: number
136
+ reason: string
137
+ condition?: 'new' | 'used' | 'damaged'
138
+ }
139
+
140
+ // Transaction types
141
+ export interface Transaction {
142
+ id: string
143
+ transaction_id: string
144
+ order_id?: string
145
+ customer_id?: string
146
+ type: 'payment' | 'refund' | 'authorization' | 'capture'
147
+ amount: number
148
+ currency: string
149
+ status: 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled'
150
+ payment_method: string
151
+ gateway_response?: Record<string, any>
152
+ created_at: string
153
+ updated_at: string
154
+ }
155
+
156
+ // Invoice types
157
+ export interface Invoice {
158
+ id: string
159
+ invoice_number: string
160
+ order_id: string
161
+ customer_id: string
162
+ amount: number
163
+ tax_amount: number
164
+ currency: string
165
+ due_date: string
166
+ status: 'draft' | 'sent' | 'paid' | 'overdue' | 'cancelled'
167
+ invoice_items: InvoiceItem[]
168
+ payments?: Payment[]
169
+ created_at: string
170
+ updated_at: string
171
+ }
172
+
173
+ export interface InvoiceItem {
174
+ id: string
175
+ invoice_id: string
176
+ product_id: string
177
+ description: string
178
+ quantity: number
179
+ unit_price: number
180
+ total: number
181
+ }
182
+
183
+ export interface Payment {
184
+ id: string
185
+ payment_number?: string
186
+ invoice_id?: string
187
+ order_id?: string
188
+ customer_id?: string
189
+ amount: number
190
+ currency: string
191
+ method: string
192
+ transaction_id?: string
193
+ status: 'pending' | 'completed' | 'failed' | 'refunded' | 'cancelled'
194
+ gateway_response?: Record<string, any>
195
+ created_at: string
196
+ updated_at: string
197
+ }
198
+
199
+ // Credit Memo types
200
+ export interface CreditMemo {
201
+ id: string
202
+ memo_number: string
203
+ order_id: string
204
+ return_id?: string
205
+ customer_id: string
206
+ amount: number
207
+ currency: string
208
+ reason: string
209
+ status: 'pending' | 'approved' | 'processed' | 'refunded' | 'cancelled'
210
+ memo_items: CreditMemoItem[]
211
+ created_at: string
212
+ updated_at: string
213
+ }
214
+
215
+ export interface CreditMemoItem {
216
+ id: string
217
+ memo_id: string
218
+ product_id: string
219
+ description: string
220
+ quantity: number
221
+ unit_price: number
222
+ total: number
223
+ }
224
+
225
+ // Cart types
226
+ export interface Cart {
227
+ id: string
228
+ customer_id?: string
229
+ session_id?: string
230
+ items: CartItem[]
231
+ subtotal: number
232
+ tax_amount: number
233
+ shipping_amount: number
234
+ discount_amount: number
235
+ total: number
236
+ currency: string
237
+ coupon_code?: string
238
+ created_at: string
239
+ updated_at: string
240
+ }
241
+
242
+ export interface CartItem {
243
+ id: string
244
+ cart_id: string
245
+ product_id: string
246
+ variant_id?: string
247
+ quantity: number
248
+ price: number
249
+ total: number
250
+ product?: Product
251
+ variant?: ProductVariant
252
+ }
253
+
254
+ // Coupon types
255
+ export interface Coupon {
256
+ id: string
257
+ code: string
258
+ name: string
259
+ description?: string
260
+ discount_type: 'percentage' | 'fixed_amount'
261
+ discount_value: number
262
+ minimum_amount?: number
263
+ maximum_discount?: number
264
+ usage_limit?: number
265
+ usage_count: number
266
+ usage_limit_per_customer?: number
267
+ valid_from?: string
268
+ valid_until?: string
269
+ status: 'active' | 'inactive' | 'expired'
270
+ created_at: string
271
+ }
272
+
273
+ // Common utility types
274
+ export interface PaginationMeta {
275
+ current_page: number
276
+ per_page: number
277
+ total: number
278
+ total_pages: number
279
+ }
280
+
281
+ export interface ApiResponse<T> {
282
+ data: T
283
+ meta?: PaginationMeta
284
+ message?: string
285
+ }
286
+
287
+ export interface ApiError {
288
+ message: string
289
+ code?: string
290
+ details?: Record<string, any>
291
+ }
@@ -0,0 +1,5 @@
1
+ declare module '#imports' {
2
+ import { Ref } from 'vue'
3
+ export function useNuxtApp(): any
4
+ export function useAsyncData<T = any>(key?: string | symbol, handler?: () => Promise<T> | T): { data: Ref<T | undefined> }
5
+ }
@@ -0,0 +1,8 @@
1
+ import type { SimpleProduct } from './product'
2
+
3
+ export interface ProductState {
4
+ products: SimpleProduct[]
5
+ selectedProduct: SimpleProduct | null
6
+ isLoading: boolean
7
+ error?: string | null
8
+ }
@@ -0,0 +1,22 @@
1
+ export interface Price {
2
+ value: number
3
+ currency: string
4
+ }
5
+
6
+ export interface ProductVariant {
7
+ id: string
8
+ sku?: string
9
+ price?: Price
10
+ attributes?: Record<string, any>
11
+ }
12
+
13
+ export interface SimpleProduct {
14
+ id: string
15
+ title?: string
16
+ description?: string
17
+ images?: string[]
18
+ price?: Price
19
+ variants?: ProductVariant[]
20
+ }
21
+ export * from './index'
22
+ export type { ProductState } from './product-state'
@@ -0,0 +1,7 @@
1
+ import type { Review } from './review'
2
+
3
+ export interface ReviewState {
4
+ reviews: Review[]
5
+ isLoading: boolean
6
+ error?: string | null
7
+ }
@@ -0,0 +1,2 @@
1
+ export interface Review { id: string; productId: string; rating: number; comment?: string; author?: string }
2
+ export type { ReviewState } from './review-state'
@@ -0,0 +1,2 @@
1
+ export interface StoreInPickUp { id: string; name: string; address: string; phone?: string }
2
+ export type { StorePickupState } from './storePickup-state'
@@ -0,0 +1,5 @@
1
+ export interface StorePickupState {
2
+ selectedStoreId: string | null
3
+ stores: any[]
4
+ error?: string | null
5
+ }
@@ -0,0 +1,9 @@
1
+ // Minimal ambient declarations for Vue/Pinia globals used in the commerce layer
2
+ declare function ref<T = any>(value?: T): any
3
+ declare function computed<T = any>(fn: () => T): any
4
+ declare function readonly<T = any>(v: T): T
5
+ declare function reactive<T = any>(v: T): T
6
+ declare function watchEffect(fn: () => void): void
7
+
8
+ // Pinia-ish defineStore (layers may call defineStore during build time)
9
+ declare function defineStore(id: string, setup: any): any
@@ -0,0 +1,5 @@
1
+ export interface WishlistState {
2
+ items: any[]
3
+ isLoading: boolean
4
+ error?: string | null
5
+ }
@@ -0,0 +1,2 @@
1
+ export interface WishlistItem { id: string; productSku: string; addedAt: string }
2
+ export type { WishlistState } from './wishlist-state'
@@ -0,0 +1,26 @@
1
+ import * as CommercePkg from '#imports';
2
+ import { sdk } from '@meeovi/sdk';
3
+
4
+ const CommerceAny: any = CommercePkg as any;
5
+
6
+ /**
7
+ * Returns a commerce client. Prefer `@meeovi/commerce` client creation APIs
8
+ * when available, otherwise fall back to `sdk.commerce`.
9
+ */
10
+ export function getCommerceClient(provider?: string, providerConfig?: any) {
11
+ try {
12
+ if (typeof CommerceAny.createClient === 'function') {
13
+ return CommerceAny.createClient(provider, providerConfig);
14
+ }
15
+ if (typeof CommerceAny.init === 'function') {
16
+ return CommerceAny.init(providerConfig);
17
+ }
18
+ } catch (e) {
19
+ // swallow and fallback to sdk
20
+ }
21
+
22
+ // fallback: return the SDK's commerce helper (already used in many composables)
23
+ return sdk.commerce;
24
+ }
25
+
26
+ export default getCommerceClient;
@@ -0,0 +1,14 @@
1
+ // ISO 3166-1 country codes and names (short sample, extend as needed)
2
+ export default [
3
+ { code: 'US', name: 'United States' },
4
+ { code: 'CA', name: 'Canada' },
5
+ { code: 'GB', name: 'United Kingdom' },
6
+ { code: 'DE', name: 'Germany' },
7
+ { code: 'FR', name: 'France' },
8
+ { code: 'IT', name: 'Italy' },
9
+ { code: 'ES', name: 'Spain' },
10
+ { code: 'AU', name: 'Australia' },
11
+ { code: 'JP', name: 'Japan' },
12
+ { code: 'CN', name: 'China' },
13
+ // ...add more as needed
14
+ ];
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Format a price amount according to the given currency
3
+ * @param {number} amount - The price amount to format
4
+ * @param {string} currency - The currency code (e.g., 'USD', 'EUR')
5
+ * @param {Object} exchangeRates - Object containing exchange rates
6
+ * @returns {string} Formatted price string
7
+ */
8
+ export const formatPrice = (amount, currency, exchangeRates) => {
9
+ if (!amount || !currency) return ''
10
+
11
+ const rate = exchangeRates[currency] || 1
12
+ const convertedAmount = amount * rate
13
+
14
+ return new Intl.NumberFormat(undefined, {
15
+ style: 'currency',
16
+ currency: currency
17
+ }).format(convertedAmount)
18
+ }
19
+
20
+ /**
21
+ * Convert price from one currency to another
22
+ * @param {number} amount - The price amount to convert
23
+ * @param {string} fromCurrency - Source currency code
24
+ * @param {string} toCurrency - Target currency code
25
+ * @param {Object} exchangeRates - Object containing exchange rates
26
+ * @returns {number} Converted price amount
27
+ */
28
+ export const convertPrice = (amount, fromCurrency, toCurrency, exchangeRates) => {
29
+ if (!amount || !fromCurrency || !toCurrency || !exchangeRates) return amount
30
+
31
+ const fromRate = exchangeRates[fromCurrency] || 1
32
+ const toRate = exchangeRates[toCurrency] || 1
33
+
34
+ return (amount * toRate) / fromRate
35
+ }
36
+
37
+ /**
38
+ * Get currency symbol for a currency code
39
+ * @param {string} code - Currency code
40
+ * @returns {string} Currency symbol
41
+ */
42
+ export const getCurrencySymbol = (code) => {
43
+ const symbols = {
44
+ USD: '$',
45
+ EUR: '€',
46
+ GBP: '£',
47
+ JPY: '¥',
48
+ AUD: 'A$',
49
+ CAD: 'C$',
50
+ CHF: 'CHF',
51
+ CNY: '¥',
52
+ INR: '₹',
53
+ // Add more currency symbols as needed
54
+ }
55
+ return symbols[code] || code
56
+ }
@@ -0,0 +1,16 @@
1
+ export const errorHandler = {
2
+ handle(err: unknown) {
3
+ // Structured handling: log and optionally rethrow
4
+ try {
5
+ if (err instanceof Error) {
6
+ console.error(`[Commerce][Error] ${err.name}: ${err.message}`)
7
+ } else {
8
+ console.error('[Commerce][Error]', err)
9
+ }
10
+ } catch (e) {
11
+ console.error('Error while handling error', e)
12
+ }
13
+ }
14
+ }
15
+
16
+ export default errorHandler
File without changes
File without changes
@@ -0,0 +1,53 @@
1
+ import { NormalizerRegistry, CommerceNormalizer } from './normalizer';
2
+
3
+ // Keep imports loose because host `@meeovi/commerce` implementations may vary
4
+ import * as CommercePkg from '#imports';
5
+ const CommerceAny: any = CommercePkg as any;
6
+
7
+ export type Provider = string;
8
+
9
+ export interface CommerceLayerConfig {
10
+ provider: Provider;
11
+ providerConfig?: Record<string, any>;
12
+ normalizer?: CommerceNormalizer;
13
+ registry?: NormalizerRegistry;
14
+ }
15
+
16
+ export function createCommerceLayer(config: CommerceLayerConfig) {
17
+ const registry = config.registry ?? new NormalizerRegistry();
18
+ const normalizer = config.normalizer ?? registry.get(config.provider);
19
+
20
+ if (!normalizer) {
21
+ throw new Error('No normalizer found for provider: ' + config.provider);
22
+ }
23
+
24
+ // Create or obtain a client from `@meeovi/commerce` in a resilient way
25
+ const client = ((): any => {
26
+ try {
27
+ if (typeof CommerceAny.createClient === 'function') {
28
+ return CommerceAny.createClient(config.provider, config.providerConfig);
29
+ }
30
+ if (typeof CommerceAny.init === 'function') {
31
+ return CommerceAny.init(config.providerConfig);
32
+ }
33
+ return CommerceAny;
34
+ } catch (e) {
35
+ // In production, surface useful message while avoiding leaking secrets
36
+ throw new Error('Failed to initialize commerce client for provider: ' + config.provider);
37
+ }
38
+ })();
39
+
40
+ async function getProduct(id: string) {
41
+ const raw = await (client.getProduct?.(id) ?? client.fetchProduct?.(id) ?? client.product?.(id));
42
+ return normalizer!.normalizeProduct(raw);
43
+ }
44
+
45
+ return {
46
+ client,
47
+ getProduct,
48
+ registry,
49
+ normalizer,
50
+ } as const;
51
+ }
52
+
53
+ export default createCommerceLayer;
@@ -0,0 +1,23 @@
1
+ export interface CommerceNormalizer {
2
+ normalizeProduct(data: any): any;
3
+ normalizeCategory?(data: any): any;
4
+ normalizeCart?(data: any): any;
5
+ }
6
+
7
+ export class NormalizerRegistry {
8
+ private registry = new Map<string, CommerceNormalizer>();
9
+
10
+ register(name: string, normalizer: CommerceNormalizer) {
11
+ this.registry.set(name, normalizer);
12
+ }
13
+
14
+ get(name: string): CommerceNormalizer | undefined {
15
+ return this.registry.get(name);
16
+ }
17
+
18
+ list(): string[] {
19
+ return Array.from(this.registry.keys());
20
+ }
21
+ }
22
+
23
+ export default NormalizerRegistry;
@@ -0,0 +1,29 @@
1
+ import { CommerceNormalizer } from "../normalizer";
2
+
3
+ export const magentoNormalizer: CommerceNormalizer = {
4
+ normalizeProduct(data: any) {
5
+ return {
6
+ id: data?.id ?? data?.sku ?? data?.item_id,
7
+ title: data?.name ?? data?.title,
8
+ price:
9
+ data?.price ?? data?.price_range?.minimum_price?.final_price?.value,
10
+ description: data?.description ?? data?.short_description,
11
+ images: (data?.media_gallery_entries ?? []).map((m: any) => m.file || m.url),
12
+ raw: data,
13
+ };
14
+ },
15
+
16
+ normalizeCategory(data: any) {
17
+ return {
18
+ id: data?.id,
19
+ name: data?.name,
20
+ raw: data,
21
+ };
22
+ },
23
+
24
+ normalizeCart(data: any) {
25
+ return { raw: data };
26
+ },
27
+ };
28
+
29
+ export default magentoNormalizer;
@@ -0,0 +1,29 @@
1
+ import { CommerceNormalizer } from "../normalizer";
2
+
3
+ export const shopifyNormalizer: CommerceNormalizer = {
4
+ normalizeProduct(data: any) {
5
+ // Shopify payloads vary depending on SDK; this maps common fields
6
+ return {
7
+ id: data?.id ?? data?.variants?.[0]?.id,
8
+ title: data?.title ?? data?.name,
9
+ price: data?.variants?.[0]?.price ?? data?.price,
10
+ description: data?.body_html ?? data?.description,
11
+ images: (data?.images ?? []).map((i: any) => i?.src || i?.url),
12
+ raw: data,
13
+ };
14
+ },
15
+
16
+ normalizeCategory(data: any) {
17
+ return {
18
+ id: data?.id,
19
+ name: data?.title ?? data?.name,
20
+ raw: data,
21
+ };
22
+ },
23
+
24
+ normalizeCart(data: any) {
25
+ return { raw: data };
26
+ },
27
+ };
28
+
29
+ export default shopifyNormalizer;
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,16 @@
1
+ // utils/stripe.ts
2
+ import { loadStripe, type Stripe } from '@stripe/stripe-js';
3
+
4
+ let stripePromise: Promise<Stripe | null> | null = null;
5
+
6
+ /**
7
+ * Returns a Stripe instance (singleton per publishable key)
8
+ * @param {string} publishableKey - Your Stripe publishable key
9
+ * @returns {Promise<Stripe | null>}
10
+ */
11
+ export function getStripe(publishableKey: string): Promise<Stripe | null> {
12
+ if (!stripePromise) {
13
+ stripePromise = loadStripe(publishableKey);
14
+ }
15
+ return stripePromise;
16
+ }
File without changes