@meeovi/layer-commerce 1.0.4 → 1.0.5

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 (309) hide show
  1. package/app/components/catalog/product/ProductAccordion/types.ts +1 -1
  2. package/app/components/catalog/product/ProductProperties/types.ts +1 -1
  3. package/app/components/catalog/product/ProductSlider/types.ts +1 -1
  4. package/app/components/catalog/product/RecommendedProducts/types.ts +1 -1
  5. package/app/components/sales/CheckoutAddress/types.ts +1 -1
  6. package/app/components/sales/OrderSummary/types.ts +1 -1
  7. package/app/composables/_types.ts +6 -5
  8. package/app/composables/stores/cart.ts +2 -2
  9. package/app/composables/useProductReviews/useProductReviews.ts +1 -1
  10. package/app/modules/vue-head/composables/useHead.ts +3 -0
  11. package/dist/components/catalog/product/ProductAccordion/types.d.ts +4 -0
  12. package/dist/components/catalog/product/ProductAccordion/types.js +1 -0
  13. package/dist/components/catalog/product/ProductProperties/types.d.ts +4 -0
  14. package/dist/components/catalog/product/ProductProperties/types.js +1 -0
  15. package/dist/components/catalog/product/ProductSlider/types.d.ts +6 -0
  16. package/dist/components/catalog/product/ProductSlider/types.js +1 -0
  17. package/dist/components/catalog/product/RecommendedProducts/types.d.ts +4 -0
  18. package/dist/components/catalog/product/RecommendedProducts/types.js +1 -0
  19. package/dist/components/sales/CheckoutAddress/types.d.ts +14 -0
  20. package/dist/components/sales/CheckoutAddress/types.js +1 -0
  21. package/dist/components/sales/CheckoutPayment/types.d.ts +10 -0
  22. package/dist/components/sales/CheckoutPayment/types.js +7 -0
  23. package/dist/components/sales/OrderSummary/types.d.ts +4 -0
  24. package/dist/components/sales/OrderSummary/types.js +1 -0
  25. package/dist/composables/_types.d.ts +11 -0
  26. package/dist/composables/_types.js +1 -0
  27. package/dist/composables/adapters/abstract/cartAdapter.d.ts +0 -0
  28. package/dist/composables/adapters/abstract/cartAdapter.js +0 -0
  29. package/dist/composables/adapters/abstract/categoryAdapter.d.ts +0 -0
  30. package/dist/composables/adapters/abstract/categoryAdapter.js +0 -0
  31. package/dist/composables/adapters/abstract/customerAdapter.d.ts +0 -0
  32. package/dist/composables/adapters/abstract/customerAdapter.js +0 -0
  33. package/dist/composables/adapters/abstract/inventoryAdapter.d.ts +0 -0
  34. package/dist/composables/adapters/abstract/inventoryAdapter.js +0 -0
  35. package/dist/composables/adapters/abstract/orderAdapter.d.ts +0 -0
  36. package/dist/composables/adapters/abstract/orderAdapter.js +0 -0
  37. package/dist/composables/adapters/abstract/productAdapter.d.ts +6 -0
  38. package/dist/composables/adapters/abstract/productAdapter.js +1 -0
  39. package/dist/composables/cart/registry.d.ts +4 -0
  40. package/dist/composables/cart/registry.js +16 -0
  41. package/dist/composables/cart/types.d.ts +16 -0
  42. package/dist/composables/cart/types.js +1 -0
  43. package/dist/composables/cart/useCart.d.ts +6 -0
  44. package/dist/composables/cart/useCart.js +13 -0
  45. package/dist/composables/config.d.ts +7 -0
  46. package/dist/composables/config.js +11 -0
  47. package/dist/composables/defs/apiDefinitions.d.ts +7 -0
  48. package/dist/composables/defs/apiDefinitions.js +39 -0
  49. package/dist/composables/defs/extension.d.ts +91 -0
  50. package/dist/composables/defs/extension.js +154 -0
  51. package/dist/composables/defs/extension.mocks.d.ts +30 -0
  52. package/dist/composables/defs/extension.mocks.js +23 -0
  53. package/dist/composables/defs/extension.test.d.ts +1 -0
  54. package/dist/composables/defs/extension.test.js +233 -0
  55. package/dist/composables/defs/index.d.ts +3 -0
  56. package/dist/composables/defs/index.js +3 -0
  57. package/dist/composables/defs/types.d.ts +81 -0
  58. package/dist/composables/defs/types.js +1 -0
  59. package/dist/composables/domain/cart.d.ts +0 -0
  60. package/dist/composables/domain/cart.js +0 -0
  61. package/dist/composables/domain/category.d.ts +0 -0
  62. package/dist/composables/domain/category.js +0 -0
  63. package/dist/composables/domain/order.d.ts +0 -0
  64. package/dist/composables/domain/order.js +0 -0
  65. package/dist/composables/domain/price.d.ts +0 -0
  66. package/dist/composables/domain/price.js +0 -0
  67. package/dist/composables/domain/product.d.ts +8 -0
  68. package/dist/composables/domain/product.js +1 -0
  69. package/dist/composables/domain/reward.d.ts +0 -0
  70. package/dist/composables/domain/reward.js +0 -0
  71. package/dist/composables/domain/transactions.d.ts +0 -0
  72. package/dist/composables/domain/transactions.js +0 -0
  73. package/dist/composables/helpers/contextualizedNormalizers.d.ts +5 -0
  74. package/dist/composables/helpers/contextualizedNormalizers.js +6 -0
  75. package/dist/composables/helpers/contextualizedNormalizers.test.d.ts +1 -0
  76. package/dist/composables/helpers/contextualizedNormalizers.test.js +62 -0
  77. package/dist/composables/helpers/index.d.ts +1 -0
  78. package/dist/composables/helpers/index.js +1 -0
  79. package/dist/composables/index.d.ts +6 -0
  80. package/dist/composables/index.js +6 -0
  81. package/dist/composables/methods/auth.d.ts +62 -0
  82. package/dist/composables/methods/auth.js +1 -0
  83. package/dist/composables/methods/cart.d.ts +101 -0
  84. package/dist/composables/methods/cart.js +1 -0
  85. package/dist/composables/methods/category.d.ts +22 -0
  86. package/dist/composables/methods/category.js +1 -0
  87. package/dist/composables/methods/checkout.d.ts +42 -0
  88. package/dist/composables/methods/checkout.js +1 -0
  89. package/dist/composables/methods/customer.d.ts +39 -0
  90. package/dist/composables/methods/customer.js +1 -0
  91. package/dist/composables/methods/helpers.d.ts +2 -0
  92. package/dist/composables/methods/helpers.js +3 -0
  93. package/dist/composables/methods/index.d.ts +49 -0
  94. package/dist/composables/methods/index.js +9 -0
  95. package/dist/composables/methods/order.d.ts +29 -0
  96. package/dist/composables/methods/order.js +1 -0
  97. package/dist/composables/methods/product.d.ts +71 -0
  98. package/dist/composables/methods/product.js +1 -0
  99. package/dist/composables/methods/settings.d.ts +12 -0
  100. package/dist/composables/methods/settings.js +1 -0
  101. package/dist/composables/models/cart.d.ts +84 -0
  102. package/dist/composables/models/cart.js +1 -0
  103. package/dist/composables/models/category.d.ts +12 -0
  104. package/dist/composables/models/category.js +1 -0
  105. package/dist/composables/models/checkout.d.ts +15 -0
  106. package/dist/composables/models/checkout.js +1 -0
  107. package/dist/composables/models/customer.d.ts +14 -0
  108. package/dist/composables/models/customer.js +1 -0
  109. package/dist/composables/models/facets.d.ts +21 -0
  110. package/dist/composables/models/facets.js +5 -0
  111. package/dist/composables/models/index.d.ts +62 -0
  112. package/dist/composables/models/index.js +8 -0
  113. package/dist/composables/models/order.d.ts +39 -0
  114. package/dist/composables/models/order.js +1 -0
  115. package/dist/composables/models/product.d.ts +55 -0
  116. package/dist/composables/models/product.js +1 -0
  117. package/dist/composables/models/shared.d.ts +66 -0
  118. package/dist/composables/models/shared.js +1 -0
  119. package/dist/composables/products/registry.d.ts +4 -0
  120. package/dist/composables/products/registry.js +16 -0
  121. package/dist/composables/products/types.d.ts +12 -0
  122. package/dist/composables/products/types.js +1 -0
  123. package/dist/composables/products/useEvents.d.ts +0 -0
  124. package/dist/composables/products/useEvents.js +0 -0
  125. package/dist/composables/products/useGiftCards.d.ts +0 -0
  126. package/dist/composables/products/useGiftCards.js +0 -0
  127. package/dist/composables/products/useProducts.d.ts +4 -0
  128. package/dist/composables/products/useProducts.js +10 -0
  129. package/dist/composables/products/useSubscriptions.d.ts +0 -0
  130. package/dist/composables/products/useSubscriptions.js +0 -0
  131. package/dist/composables/registry.d.ts +9 -0
  132. package/dist/composables/registry.js +13 -0
  133. package/dist/composables/stores/cart.d.ts +1 -0
  134. package/dist/composables/stores/cart.js +203 -0
  135. package/dist/composables/stores/cartStore.d.ts +1 -0
  136. package/dist/composables/stores/cartStore.js +246 -0
  137. package/dist/composables/stores/checkout.d.ts +1 -0
  138. package/dist/composables/stores/checkout.js +17 -0
  139. package/dist/composables/stores/compare.d.ts +1 -0
  140. package/dist/composables/stores/compare.js +50 -0
  141. package/dist/composables/stores/orders.d.ts +1 -0
  142. package/dist/composables/stores/orders.js +156 -0
  143. package/dist/composables/stores/product.d.ts +1 -0
  144. package/dist/composables/stores/product.js +26 -0
  145. package/dist/composables/stores/productList.d.ts +0 -0
  146. package/dist/composables/stores/productList.js +0 -0
  147. package/dist/composables/stores/productListInfo.d.ts +0 -0
  148. package/dist/composables/stores/productListInfo.js +0 -0
  149. package/dist/composables/stores/products.d.ts +1 -0
  150. package/dist/composables/stores/products.js +106 -0
  151. package/dist/composables/stores/recentlyViewedProducts.d.ts +0 -0
  152. package/dist/composables/stores/recentlyViewedProducts.js +0 -0
  153. package/dist/composables/stores/review.d.ts +1 -0
  154. package/dist/composables/stores/review.js +25 -0
  155. package/dist/composables/stores/storeInPickUp.d.ts +1 -0
  156. package/dist/composables/stores/storeInPickUp.js +21 -0
  157. package/dist/composables/stores/user.d.ts +1 -0
  158. package/dist/composables/stores/user.js +16 -0
  159. package/dist/composables/stores/wishlist.d.ts +1 -0
  160. package/dist/composables/stores/wishlist.js +17 -0
  161. package/dist/composables/types/Order.type.d.ts +141 -0
  162. package/dist/composables/types/Order.type.js +1 -0
  163. package/dist/composables/types/index.d.ts +265 -0
  164. package/dist/composables/types/index.js +3 -0
  165. package/dist/composables/types/product.d.ts +13 -0
  166. package/dist/composables/types/product.js +1 -0
  167. package/dist/composables/useBreakpoints/index.d.ts +1 -0
  168. package/dist/composables/useBreakpoints/index.js +1 -0
  169. package/dist/composables/useBreakpoints/useBreakpoints.d.ts +10 -0
  170. package/dist/composables/useBreakpoints/useBreakpoints.js +24 -0
  171. package/dist/composables/useCart/index.d.ts +1 -0
  172. package/dist/composables/useCart/index.js +1 -0
  173. package/dist/composables/useCart/types.d.ts +13 -0
  174. package/dist/composables/useCart/types.js +1 -0
  175. package/dist/composables/useCart/useCart.d.ts +8 -0
  176. package/dist/composables/useCart/useCart.js +43 -0
  177. package/dist/composables/useCartShippingMethods/index.d.ts +1 -0
  178. package/dist/composables/useCartShippingMethods/index.js +1 -0
  179. package/dist/composables/useCartShippingMethods/types.d.ts +13 -0
  180. package/dist/composables/useCartShippingMethods/types.js +1 -0
  181. package/dist/composables/useCartShippingMethods/useCartShippingMethods.d.ts +7 -0
  182. package/dist/composables/useCartShippingMethods/useCartShippingMethods.js +35 -0
  183. package/dist/composables/useCatalog.d.ts +13 -0
  184. package/dist/composables/useCatalog.js +61 -0
  185. package/dist/composables/useContent/index.d.ts +1 -0
  186. package/dist/composables/useContent/index.js +1 -0
  187. package/dist/composables/useContent/types.d.ts +32 -0
  188. package/dist/composables/useContent/types.js +1 -0
  189. package/dist/composables/useContent/useContent.d.ts +9 -0
  190. package/dist/composables/useContent/useContent.js +43 -0
  191. package/dist/composables/useContent.d.ts +14 -0
  192. package/dist/composables/useContent.js +55 -0
  193. package/dist/composables/useCustomer/index.d.ts +2 -0
  194. package/dist/composables/useCustomer/index.js +2 -0
  195. package/dist/composables/useCustomer/types.d.ts +13 -0
  196. package/dist/composables/useCustomer/types.js +1 -0
  197. package/dist/composables/useCustomer/useCustomer.d.ts +8 -0
  198. package/dist/composables/useCustomer/useCustomer.js +34 -0
  199. package/dist/composables/useCustomerAddress/index.d.ts +2 -0
  200. package/dist/composables/useCustomerAddress/index.js +2 -0
  201. package/dist/composables/useCustomerAddress/types.d.ts +13 -0
  202. package/dist/composables/useCustomerAddress/types.js +1 -0
  203. package/dist/composables/useCustomerAddress/useCustomerAddress.d.ts +8 -0
  204. package/dist/composables/useCustomerAddress/useCustomerAddress.js +43 -0
  205. package/dist/composables/useCustomerOrder/adress.d.ts +11 -0
  206. package/dist/composables/useCustomerOrder/adress.js +10 -0
  207. package/dist/composables/useCustomerOrder/index.d.ts +2 -0
  208. package/dist/composables/useCustomerOrder/index.js +2 -0
  209. package/dist/composables/useCustomerOrder/product.d.ts +28 -0
  210. package/dist/composables/useCustomerOrder/product.js +37 -0
  211. package/dist/composables/useCustomerOrder/types.d.ts +32 -0
  212. package/dist/composables/useCustomerOrder/types.js +1 -0
  213. package/dist/composables/useCustomerOrder/useCustomerOrder.d.ts +8 -0
  214. package/dist/composables/useCustomerOrder/useCustomerOrder.js +52 -0
  215. package/dist/composables/useCustomerOrders/index.d.ts +2 -0
  216. package/dist/composables/useCustomerOrders/index.js +2 -0
  217. package/dist/composables/useCustomerOrders/types.d.ts +15 -0
  218. package/dist/composables/useCustomerOrders/types.js +1 -0
  219. package/dist/composables/useCustomerOrders/useCustomerOrders.d.ts +8 -0
  220. package/dist/composables/useCustomerOrders/useCustomerOrders.js +42 -0
  221. package/dist/composables/useCustomerReturns/index.d.ts +2 -0
  222. package/dist/composables/useCustomerReturns/index.js +2 -0
  223. package/dist/composables/useCustomerReturns/types.d.ts +13 -0
  224. package/dist/composables/useCustomerReturns/types.js +1 -0
  225. package/dist/composables/useCustomerReturns/useCustomerReturns.d.ts +8 -0
  226. package/dist/composables/useCustomerReturns/useCustomerReturns.js +32 -0
  227. package/dist/composables/useHandleError/index.d.ts +1 -0
  228. package/dist/composables/useHandleError/index.js +1 -0
  229. package/dist/composables/useHandleError/types.d.ts +7 -0
  230. package/dist/composables/useHandleError/types.js +1 -0
  231. package/dist/composables/useHandleError/useHandleError.d.ts +10 -0
  232. package/dist/composables/useHandleError/useHandleError.js +24 -0
  233. package/dist/composables/usePageTitle.d.ts +5 -0
  234. package/dist/composables/usePageTitle.js +14 -0
  235. package/dist/composables/useProduct/index.d.ts +2 -0
  236. package/dist/composables/useProduct/index.js +2 -0
  237. package/dist/composables/useProduct/types.d.ts +13 -0
  238. package/dist/composables/useProduct/types.js +1 -0
  239. package/dist/composables/useProduct/useProduct.d.ts +9 -0
  240. package/dist/composables/useProduct/useProduct.js +36 -0
  241. package/dist/composables/useProductAttribute/index.d.ts +1 -0
  242. package/dist/composables/useProductAttribute/index.js +1 -0
  243. package/dist/composables/useProductAttribute/useProductAttribute.d.ts +11 -0
  244. package/dist/composables/useProductAttribute/useProductAttribute.js +25 -0
  245. package/dist/composables/useProductRecommended/index.d.ts +1 -0
  246. package/dist/composables/useProductRecommended/index.js +1 -0
  247. package/dist/composables/useProductRecommended/types.d.ts +13 -0
  248. package/dist/composables/useProductRecommended/types.js +1 -0
  249. package/dist/composables/useProductRecommended/useProductRecommended.d.ts +6 -0
  250. package/dist/composables/useProductRecommended/useProductRecommended.js +33 -0
  251. package/dist/composables/useProductReviews/index.d.ts +2 -0
  252. package/dist/composables/useProductReviews/index.js +2 -0
  253. package/dist/composables/useProductReviews/types.d.ts +13 -0
  254. package/dist/composables/useProductReviews/types.js +1 -0
  255. package/dist/composables/useProductReviews/useProductReviews.d.ts +9 -0
  256. package/dist/composables/useProductReviews/useProductReviews.js +36 -0
  257. package/dist/composables/useProducts/types.d.ts +18 -0
  258. package/dist/composables/useProducts/types.js +1 -0
  259. package/dist/composables/useProducts/useProducts.d.ts +8 -0
  260. package/dist/composables/useProducts/useProducts.js +35 -0
  261. package/dist/composables/utils/countryList.d.ts +5 -0
  262. package/dist/composables/utils/countryList.js +14 -0
  263. package/dist/composables/utils/glossary.d.ts +0 -0
  264. package/dist/composables/utils/glossary.js +0 -0
  265. package/dist/composables/utils/importExport.d.ts +0 -0
  266. package/dist/composables/utils/importExport.js +0 -0
  267. package/dist/composables/utils/print.d.ts +0 -0
  268. package/dist/composables/utils/print.js +0 -0
  269. package/dist/composables/utils/shopThemes.d.ts +0 -0
  270. package/dist/composables/utils/shopThemes.js +0 -0
  271. package/dist/composables/utils/statistics.d.ts +0 -0
  272. package/dist/composables/utils/statistics.js +0 -0
  273. package/dist/composables/utils/stock.d.ts +0 -0
  274. package/dist/composables/utils/stock.js +0 -0
  275. package/dist/composables/utils/stripe.d.ts +7 -0
  276. package/dist/composables/utils/stripe.js +14 -0
  277. package/dist/composables/utils/taxation.d.ts +0 -0
  278. package/dist/composables/utils/taxation.js +0 -0
  279. package/dist/composables/utils/tellFriends.d.ts +0 -0
  280. package/dist/composables/utils/tellFriends.js +0 -0
  281. package/dist/composables/validationRules/index.d.ts +1 -0
  282. package/dist/composables/validationRules/index.js +1 -0
  283. package/dist/composables/validationRules/password.d.ts +1 -0
  284. package/dist/composables/validationRules/password.js +20 -0
  285. package/dist/composables/validationRules/password.test.d.ts +1 -0
  286. package/dist/composables/validationRules/password.test.js +68 -0
  287. package/dist/composables/vendors/index.d.ts +0 -0
  288. package/dist/composables/vendors/index.js +0 -0
  289. package/dist/composables/vendors/registry.d.ts +0 -0
  290. package/dist/composables/vendors/registry.js +0 -0
  291. package/dist/composables/vendors/useAffiliates.d.ts +0 -0
  292. package/dist/composables/vendors/useAffiliates.js +0 -0
  293. package/dist/composables/vendors/useCommission.d.ts +0 -0
  294. package/dist/composables/vendors/useCommission.js +0 -0
  295. package/dist/modules/vue-head/composables/useHead.d.ts +1 -0
  296. package/dist/modules/vue-head/composables/useHead.js +3 -0
  297. package/dist/utils/client.d.ts +6 -0
  298. package/dist/utils/client.js +23 -0
  299. package/dist/utils/index.d.ts +15 -0
  300. package/dist/utils/index.js +38 -0
  301. package/dist/utils/normalizer.d.ts +12 -0
  302. package/dist/utils/normalizer.js +13 -0
  303. package/dist/utils/normalizers/magento.d.ts +3 -0
  304. package/dist/utils/normalizers/magento.js +23 -0
  305. package/dist/utils/normalizers/shopify.d.ts +3 -0
  306. package/dist/utils/normalizers/shopify.js +24 -0
  307. package/global.d.ts +135 -0
  308. package/package.json +1 -1
  309. package/tsconfig.json +9 -2
@@ -0,0 +1,101 @@
1
+ import type { Simplify } from "type-fest";
2
+ import type { Maybe, SfCart } from "../models";
3
+ export interface GetCartExtendedArgs {
4
+ }
5
+ export interface GetCartCustomArgs {
6
+ }
7
+ export type GetCartArgs = {
8
+ /**
9
+ * Unique identifier of cart
10
+ */
11
+ cartId?: string;
12
+ };
13
+ export interface AddCartLineItemExtendedArgs {
14
+ }
15
+ export interface AddCartLineItemCustomArgs {
16
+ }
17
+ export type AddCartLineItemArgs = {
18
+ /**
19
+ * Product unique identifier - for commercetools it's a SKU, for sap it's a product code
20
+ */
21
+ productId: string;
22
+ sku: Maybe<string>;
23
+ /**
24
+ * Quantity of product to add to cart
25
+ * @default 1
26
+ */
27
+ quantity?: number;
28
+ /**
29
+ * Unique identifier of cart
30
+ */
31
+ cartId?: string;
32
+ };
33
+ export interface UpdateCartLineItemExtendedArgs {
34
+ }
35
+ export interface UpdateCartLineItemCustomArgs {
36
+ }
37
+ export type UpdateCartLineItemArgs = {
38
+ lineItemId: string;
39
+ quantity: number;
40
+ /**
41
+ * Unique identifier of cart
42
+ */
43
+ cartId?: string;
44
+ };
45
+ export interface RemoveCartLineItemExtendedArgs {
46
+ }
47
+ export interface RemoveCartLineItemCustomArgs {
48
+ }
49
+ export type RemoveCartLineItemArgs = {
50
+ lineItemId: string;
51
+ /**
52
+ * Unique identifier of cart
53
+ */
54
+ cartId?: string;
55
+ };
56
+ export interface ApplyCouponToCartExtendedArgs {
57
+ }
58
+ export interface ApplyCouponToCartCustomArgs {
59
+ }
60
+ export type ApplyCouponToCartArgs = {
61
+ couponCode: string;
62
+ /**
63
+ * Unique identifier of cart
64
+ */
65
+ cartId?: string;
66
+ };
67
+ export interface RemoveCouponFromCartExtendedArgs {
68
+ }
69
+ export interface RemoveCouponFromCartCustomArgs {
70
+ }
71
+ export type RemoveCouponFromCartArgs = {
72
+ /**
73
+ * Don't confuse it with coupon code. It can be retrieved from cart.appliedCoupons
74
+ */
75
+ couponId: string;
76
+ /**
77
+ * Unique identifier of cart
78
+ */
79
+ cartId?: string;
80
+ };
81
+ /**
82
+ * Get all information about customer's cart
83
+ */
84
+ export type GetCart = (args?: Simplify<GetCartArgs>) => Promise<SfCart>;
85
+ /**
86
+ * Add product to cart
87
+ */
88
+ export type AddCartLineItem = (args: Simplify<AddCartLineItemArgs>) => Promise<SfCart>;
89
+ /**
90
+ * Update product quantity in cart
91
+ */
92
+ export type UpdateCartLineItem = (args: Simplify<UpdateCartLineItemArgs>) => Promise<SfCart>;
93
+ /**
94
+ * Remove product from cart
95
+ */
96
+ export type RemoveCartLineItem = (args: Simplify<RemoveCartLineItemArgs>) => Promise<SfCart>;
97
+ /**
98
+ * Apply a coupon to cart to get a discount
99
+ */
100
+ export type ApplyCouponToCart = (args: Simplify<ApplyCouponToCartArgs>) => Promise<SfCart>;
101
+ export type RemoveCouponFromCart = (args: Simplify<RemoveCouponFromCartArgs>) => Promise<SfCart>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { Simplify } from "type-fest";
2
+ import type { SfCategory } from "../models";
3
+ export interface GetCategoriesExtendedArgs {
4
+ }
5
+ export interface GetCategoriesCustomArgs {
6
+ }
7
+ export type GetCategoriesArgs = {
8
+ ids?: string[];
9
+ slugs?: string[];
10
+ };
11
+ export type GetCategories = (args?: Simplify<GetCategoriesArgs>) => Promise<SfCategory[]>;
12
+ export interface GetCategoryExtendedArgs {
13
+ }
14
+ export interface GetCategoryCustomArgs {
15
+ }
16
+ export type GetCategoryArgs = {
17
+ id: string;
18
+ };
19
+ export type GetCategory = (args: Simplify<GetCategoryArgs>) => Promise<{
20
+ ancestors: SfCategory[];
21
+ category: SfCategory;
22
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,42 @@
1
+ import type { Simplify } from "type-fest";
2
+ import type { SfCart, SfCreateAddressBody, SfCustomerAddress, SfShippingMethods } from "../models";
3
+ export interface SetCustomerEmailExtendedArgs {
4
+ }
5
+ export interface SetCustomerEmailCustomArgs {
6
+ }
7
+ export type SetCustomerEmailArgs = {
8
+ email: string;
9
+ };
10
+ export type SetShippingAddress = {
11
+ shippingAddress: SfCreateAddressBody | SfCustomerAddress;
12
+ };
13
+ export interface SetCartAddressExtendedArgs {
14
+ }
15
+ export interface SetCartAddressCustomArgs {
16
+ }
17
+ export type SetCartAddressArgs = SetShippingAddress & {};
18
+ export interface SetShippingMethodExtendedArgs {
19
+ }
20
+ export interface SetShippingMethodCustomArgs {
21
+ }
22
+ export type SetShippingMethodArgs = {
23
+ shippingMethodId: string;
24
+ };
25
+ /**
26
+ * Set an email of active customer
27
+ */
28
+ export type SetCustomerEmail = (args: Simplify<SetCustomerEmailArgs>) => Promise<SfCart>;
29
+ /**
30
+ * Set customers adddress
31
+ * @example Set shipping address first
32
+ * setCartAddress({ shippingAddress: { ... } })
33
+ */
34
+ export type SetCartAddress = (args: Simplify<SetCartAddressArgs>) => Promise<SfCart>;
35
+ /**
36
+ * Get available shipping methods based on customer's shipping address
37
+ */
38
+ export type GetAvailableShippingMethods = () => Promise<SfShippingMethods>;
39
+ /**
40
+ * Choose a one shipping method from available shipping methods
41
+ */
42
+ export type SetShippingMethod = (args: Simplify<SetShippingMethodArgs>) => Promise<SfCart>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,39 @@
1
+ import type { Simplify } from "type-fest";
2
+ import type { SfCreateAddressBody, SfCustomerAddress, SfId } from "../models";
3
+ export interface CreateCustomerAddressExtendedArgs {
4
+ }
5
+ export interface CreateCustomerAddressCustomArgs {
6
+ }
7
+ export type CreateCustomerAddressArgs = {
8
+ address: SfCreateAddressBody;
9
+ };
10
+ export type CreateCustomerAddress = (args: Simplify<CreateCustomerAddressArgs>) => Promise<{
11
+ address: SfCustomerAddress;
12
+ }>;
13
+ export interface UpdateCustomerAddressExtendedArgs {
14
+ }
15
+ export interface UpdateCustomerAddressCustomArgs {
16
+ }
17
+ export type UpdateCustomerAddressArgs = {
18
+ id: SfId;
19
+ address: SfCreateAddressBody;
20
+ };
21
+ export type UpdateCustomerAddress = (args: Simplify<UpdateCustomerAddressArgs>) => Promise<{
22
+ address: SfCustomerAddress;
23
+ }>;
24
+ export interface DeleteCustomerAddressExtendedArgs {
25
+ }
26
+ export interface DeleteCustomerAddressCustomArgs {
27
+ }
28
+ export type DeleteCustomerAddressArgs = {
29
+ id: SfId;
30
+ };
31
+ export type DeleteCustomerAddress = (args: Simplify<DeleteCustomerAddressArgs>) => Promise<void>;
32
+ export interface GetCustomerAddressesExtendedArgs {
33
+ }
34
+ export interface GetCustomerAddressesCustomArgs {
35
+ }
36
+ export type GetCustomerAddressesArgs = {};
37
+ export type GetCustomerAddresses = (args?: Simplify<GetCustomerAddressesArgs>) => Promise<{
38
+ addresses: SfCustomerAddress[];
39
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { SetCartAddressArgs, SetShippingAddress } from "./checkout";
2
+ export declare function isShippingAddress(args: SetCartAddressArgs): args is SetShippingAddress;
@@ -0,0 +1,3 @@
1
+ export function isShippingAddress(args) {
2
+ return args.shippingAddress !== undefined;
3
+ }
@@ -0,0 +1,49 @@
1
+ import type { GetCustomer, LoginCustomer, LogoutCustomer, RegisterCustomer, UpdateCustomer, ChangeCustomerPassword } from "./auth";
2
+ import type { GetCart, AddCartLineItem, UpdateCartLineItem, RemoveCartLineItem, ApplyCouponToCart, RemoveCouponFromCart } from "./cart";
3
+ import type { GetCategories, GetCategory } from "./category";
4
+ import type { GetAvailableShippingMethods, SetCartAddress, SetCustomerEmail, SetShippingMethod } from "./checkout";
5
+ import type { CreateCustomerAddress, DeleteCustomerAddress, UpdateCustomerAddress, GetCustomerAddresses } from "./customer";
6
+ import type { GetOrders, GetOrderDetails, PlaceOrder } from "./order";
7
+ import type { GetProducts, GetProductDetails, GetProductReviews, SearchProducts } from "./product";
8
+ import type { GetCurrencies } from "./settings";
9
+ export * from "./auth";
10
+ export * from "./cart";
11
+ export * from "./category";
12
+ export * from "./checkout";
13
+ export * from "./customer";
14
+ export * from "./helpers";
15
+ export * from "./product";
16
+ export * from "./settings";
17
+ export * from "./order";
18
+ export type UnifiedMethods = {
19
+ getCart: GetCart;
20
+ addCartLineItem: AddCartLineItem;
21
+ updateCartLineItem: UpdateCartLineItem;
22
+ removeCartLineItem: RemoveCartLineItem;
23
+ applyCouponToCart: ApplyCouponToCart;
24
+ removeCouponFromCart: RemoveCouponFromCart;
25
+ getCategories: GetCategories;
26
+ getCategory: GetCategory;
27
+ getCustomer: GetCustomer;
28
+ loginCustomer: LoginCustomer;
29
+ logoutCustomer: LogoutCustomer;
30
+ registerCustomer: RegisterCustomer;
31
+ updateCustomer: UpdateCustomer;
32
+ changeCustomerPassword: ChangeCustomerPassword;
33
+ getProducts: GetProducts;
34
+ getProductDetails: GetProductDetails;
35
+ getProductReviews: GetProductReviews;
36
+ searchProducts: SearchProducts;
37
+ getAvailableShippingMethods: GetAvailableShippingMethods;
38
+ setCartAddress: SetCartAddress;
39
+ setCustomerEmail: SetCustomerEmail;
40
+ setShippingMethod: SetShippingMethod;
41
+ createCustomerAddress: CreateCustomerAddress;
42
+ deleteCustomerAddress: DeleteCustomerAddress;
43
+ updateCustomerAddress: UpdateCustomerAddress;
44
+ getCustomerAddresses: GetCustomerAddresses;
45
+ getCurrencies: GetCurrencies;
46
+ getOrders: GetOrders;
47
+ getOrderDetails: GetOrderDetails;
48
+ placeOrder: PlaceOrder;
49
+ };
@@ -0,0 +1,9 @@
1
+ export * from "./auth";
2
+ export * from "./cart";
3
+ export * from "./category";
4
+ export * from "./checkout";
5
+ export * from "./customer";
6
+ export * from "./helpers";
7
+ export * from "./product";
8
+ export * from "./settings";
9
+ export * from "./order";
@@ -0,0 +1,29 @@
1
+ import type { Simplify } from "type-fest";
2
+ import type { SfPagination } from "../models";
3
+ import type { SfOrder, SfOrderListItem } from "../models/order";
4
+ export interface GetOrdersExtendedArgs {
5
+ }
6
+ export interface GetOrdersCustomArgs {
7
+ }
8
+ export type GetOrdersArgs = {
9
+ pageSize?: number;
10
+ currentPage?: number;
11
+ };
12
+ export type GetOrders = (args?: Simplify<GetOrdersArgs>) => Promise<{
13
+ orders: SfOrderListItem[];
14
+ pagination: SfPagination;
15
+ }>;
16
+ export interface GetOrderExtendedArgs {
17
+ }
18
+ export interface GetOrderCustomArgs {
19
+ }
20
+ export type GetOrderArgs = {
21
+ id: string;
22
+ };
23
+ export type GetOrderDetails = (args: Simplify<GetOrderArgs>) => Promise<SfOrder>;
24
+ export interface PlaceOrderExtendedArgs {
25
+ }
26
+ export interface PlaceOrderCustomArgs {
27
+ }
28
+ export type PlaceOrderArgs = {};
29
+ export type PlaceOrder = (args?: Simplify<PlaceOrderArgs>) => Promise<SfOrder>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,71 @@
1
+ import type { Simplify } from "type-fest";
2
+ import type { SfCategory, SfFacet, SfId, SfPagination, SfProduct, SfProductCatalogItem, SfProductReview } from "../models";
3
+ export interface SfSortBy {
4
+ }
5
+ export interface SearchProductsExtendedArgs {
6
+ }
7
+ export interface SearchProductsCustomArgs {
8
+ }
9
+ export type SearchProductsArgs = {
10
+ pageSize?: number;
11
+ currentPage?: number;
12
+ sortBy?: "relevant" | "price-low-to-high" | "price-high-to-low" | (string & {});
13
+ search?: string;
14
+ category?: SfCategory["id"];
15
+ facets?: {
16
+ [name: string]: string[];
17
+ };
18
+ } & SfSortBy;
19
+ export type SearchProducts = (args: Simplify<SearchProductsArgs>) => Promise<{
20
+ products: SfProductCatalogItem[];
21
+ pagination: SfPagination;
22
+ facets: SfFacet[];
23
+ }>;
24
+ export interface GetProductsExtendedArgs {
25
+ }
26
+ export interface GetProductsCustomArgs {
27
+ }
28
+ export type GetProductsArgs = {
29
+ ids?: string[];
30
+ skus?: string[];
31
+ };
32
+ export type GetProducts = (args: Simplify<GetProductsArgs>) => Promise<{
33
+ products: SfProductCatalogItem[];
34
+ }>;
35
+ export interface GetProductDetailsExtendedArgs {
36
+ }
37
+ export interface GetProductDetailsCustomArgs {
38
+ }
39
+ export type GetProductDetailsArgs = {
40
+ id: SfId;
41
+ sku?: string;
42
+ };
43
+ export type GetProductDetails = (args: Simplify<GetProductDetailsArgs>) => Promise<{
44
+ product: SfProduct;
45
+ categoryHierarchy: SfCategory[];
46
+ }>;
47
+ export interface GetProductReviewsExtendedArgs {
48
+ }
49
+ export interface GetProductReviewsCustomArgs {
50
+ }
51
+ export type GetProductReviewsArgs = {
52
+ productId: SfId;
53
+ pageSize?: number;
54
+ currentPage?: number;
55
+ };
56
+ export type GetProductReviews = (args: Simplify<GetProductReviewsArgs>) => Promise<{
57
+ reviews: SfProductReview[];
58
+ pagination: SfPagination;
59
+ }>;
60
+ export interface AddProductReviewExtendedArgs {
61
+ }
62
+ export interface AddProductReviewCustomArgs {
63
+ }
64
+ export type AddProductReviewArgs = {
65
+ productId: SfId;
66
+ productSku?: string;
67
+ review: Pick<SfProductReview, "title" | "text" | "rating" | "reviewer">;
68
+ };
69
+ export type AddProductReview = (args: Simplify<AddProductReviewArgs>) => Promise<{
70
+ review: SfProductReview;
71
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { Simplify } from "type-fest";
2
+ import type { SfCurrency } from "../models";
3
+ export interface GetCurrenciesExtendedArgs {
4
+ }
5
+ export interface GetCurrenciesCustomArgs {
6
+ }
7
+ export type GetCurrenciesArgs = {};
8
+ export type GetCurrencies = (args?: Simplify<GetCurrenciesArgs>) => Promise<{
9
+ currencies: SfCurrency[];
10
+ defaultCurrency: SfCurrency;
11
+ currentCurrency: SfCurrency;
12
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,84 @@
1
+ import type { InferCustom } from "../defs";
2
+ import type { SfShippingMethod } from "./checkout";
3
+ import type { Maybe, SfAddress, SfAttribute, SfDiscountablePrice, SfId, SfImage, SfMoney } from "./shared";
4
+ export interface SfCartLineItemCustom extends InferCustom<"normalizeCartLineItem"> {
5
+ }
6
+ export interface SfCartLineItem {
7
+ attributes: SfAttribute[];
8
+ productId: SfId;
9
+ /**
10
+ * ID of the cart's line item
11
+ */
12
+ id: SfId;
13
+ image: Maybe<SfImage>;
14
+ name: Maybe<string>;
15
+ quantity: number;
16
+ sku: Maybe<string>;
17
+ slug: string;
18
+ /**
19
+ * Product of quantity and unitPrice
20
+ */
21
+ totalPrice: Maybe<SfMoney>;
22
+ unitPrice: Maybe<SfDiscountablePrice>;
23
+ quantityLimit: Maybe<number>;
24
+ $custom?: SfCartLineItemCustom;
25
+ }
26
+ export interface SfCartCouponCustom extends InferCustom<"normalizeCartCoupon"> {
27
+ }
28
+ export interface SfCartCoupon {
29
+ code: string;
30
+ id: string;
31
+ name: Maybe<string>;
32
+ $custom?: SfCartCouponCustom;
33
+ }
34
+ export interface SfCartCustom extends InferCustom<"normalizeCart"> {
35
+ }
36
+ export interface SfCart {
37
+ appliedCoupons: SfCartCoupon[];
38
+ /**
39
+ * @default null
40
+ */
41
+ billingAddress: Maybe<SfAddress>;
42
+ /**
43
+ * Active customer's email. Required to complete the checkout
44
+ * @default null
45
+ */
46
+ customerEmail: Maybe<string>;
47
+ id: SfId;
48
+ /**
49
+ * Shipping address is required to get available shipping methods
50
+ * @default null
51
+ */
52
+ lineItems: SfCartLineItem[];
53
+ shippingAddress: Maybe<SfAddress>;
54
+ /**
55
+ * Required to complete the checkout. To get available methods use `getAvailableShippingMethods`
56
+ * @default null
57
+ */
58
+ shippingMethod: Maybe<SfShippingMethod>;
59
+ /**
60
+ * Difference of `subtotalRegularPrice` and discounts applied to line items before providing coupons.
61
+ * If none of the products are discounted, price will be equal to `subtotalRegularPrice`
62
+ */
63
+ subtotalDiscountedPrice: SfMoney;
64
+ /**
65
+ * Total regular price of all line items (coupons, taxes, shipping excluded)
66
+ */
67
+ subtotalRegularPrice: SfMoney;
68
+ totalCouponDiscounts: SfMoney;
69
+ /**
70
+ * Total count of all line items and their's quantities in cart
71
+ */
72
+ totalItems: number;
73
+ /**
74
+ * Total cart price (discounts, taxes, shipping included)
75
+ */
76
+ totalPrice: SfMoney;
77
+ /**
78
+ * Calculated after applying shipping method
79
+ * @default null
80
+ */
81
+ totalShippingPrice: Maybe<SfMoney>;
82
+ totalTax: SfMoney;
83
+ $custom?: SfCartCustom;
84
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { InferCustom } from "../defs";
2
+ import type { Maybe, SfId } from "./shared";
3
+ export interface SfCategoryCustom extends InferCustom<"normalizeCartCoupon"> {
4
+ }
5
+ export interface SfCategory {
6
+ id: SfId;
7
+ name: string;
8
+ slug: string;
9
+ subcategories: Maybe<SfCategory[]>;
10
+ parentCategoryId: Maybe<SfId>;
11
+ $custom?: SfCategoryCustom;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { InferCustom } from "../defs";
2
+ import type { Maybe, SfMoney } from "./shared";
3
+ export interface SfShippingMethodCustom extends InferCustom<"normalizeCartCoupon"> {
4
+ }
5
+ export interface SfShippingMethod {
6
+ description: Maybe<string>;
7
+ estimatedDelivery: Maybe<string>;
8
+ id: string;
9
+ name: string;
10
+ price: SfMoney;
11
+ $custom?: SfShippingMethodCustom;
12
+ }
13
+ export interface SfShippingMethods {
14
+ methods: SfShippingMethod[];
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { InferCustom } from "../defs";
2
+ import type { SfAddress, SfId } from "./shared";
3
+ export interface SfCustomerCustom extends InferCustom<"normalizeCustomer"> {
4
+ }
5
+ export interface SfCustomer {
6
+ id: SfId;
7
+ email: string;
8
+ firstName: string;
9
+ lastName: string;
10
+ $custom?: SfCustomerCustom;
11
+ }
12
+ export interface SfCustomerAddress extends SfAddress {
13
+ id: SfId;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { InferCustom } from "../defs";
2
+ import type { Maybe } from "./shared";
3
+ export declare enum SfFacetTypes {
4
+ MULTI_SELECT = "MULTI_SELECT",
5
+ SINGLE_SELECT = "SINGLE_SELECT"
6
+ }
7
+ export type SfFacetType = `${SfFacetTypes}`;
8
+ export interface SfFacetItem {
9
+ label: string;
10
+ value: string;
11
+ productCount: Maybe<number>;
12
+ }
13
+ export interface SfFacetCustom extends InferCustom<"normalizeFacet"> {
14
+ }
15
+ export interface SfFacet {
16
+ label: string;
17
+ name: string;
18
+ values: SfFacetItem[];
19
+ type: Maybe<SfFacetType | (string & Record<never, never>)>;
20
+ $custom?: SfFacetCustom;
21
+ }
@@ -0,0 +1,5 @@
1
+ export var SfFacetTypes;
2
+ (function (SfFacetTypes) {
3
+ SfFacetTypes["MULTI_SELECT"] = "MULTI_SELECT";
4
+ SfFacetTypes["SINGLE_SELECT"] = "SINGLE_SELECT";
5
+ })(SfFacetTypes || (SfFacetTypes = {}));
@@ -0,0 +1,62 @@
1
+ import type { SfCart, SfCartCoupon, SfCartCouponCustom, SfCartLineItemCustom } from "./cart";
2
+ import type { SfCategory, SfCategoryCustom } from "./category";
3
+ import type { SfShippingMethod, SfShippingMethodCustom, SfShippingMethods } from "./checkout";
4
+ import type { SfCustomer, SfCustomerAddress, SfCustomerCustom } from "./customer";
5
+ import type { SfFacet, SfFacetCustom, SfFacetItem, SfFacetType, SfFacetTypes } from "./facets";
6
+ import type { SfOrder, SfOrderCustom, SfOrderLineItem, SfOrderLineItemCustom, SfOrderListItem, SfOrderListItemCustom } from "./order";
7
+ import type { SfPagination, SfPaginationCustom, SfProduct, SfProductCatalogItem, SfProductCatalogItemCustom, SfProductCustom, SfProductReview, SfProductReviewCustom, SfProductVariant } from "./product";
8
+ import type { SfAddress, SfAddressCustom, SfAttribute, SfAttributeCustom, SfCreateAddressBody, SfCurrency, SfDiscountablePrice, SfDiscountablePriceCustom, SfImage, SfImageCustom, SfMoney, SfMoneyCustom } from "./shared";
9
+ export * from "./cart";
10
+ export * from "./category";
11
+ export * from "./checkout";
12
+ export * from "./customer";
13
+ export * from "./facets";
14
+ export * from "./product";
15
+ export * from "./shared";
16
+ export * from "./order";
17
+ export interface SfContract {
18
+ SfCartLineItemCustom: SfCartLineItemCustom;
19
+ SfCartCouponCustom: SfCartCouponCustom;
20
+ SfCartCoupon: SfCartCoupon;
21
+ SfCart: SfCart;
22
+ SfCategoryCustom: SfCategoryCustom;
23
+ SfCategory: SfCategory;
24
+ SfShippingMethodCustom: SfShippingMethodCustom;
25
+ SfShippingMethod: SfShippingMethod;
26
+ SfShippingMethods: SfShippingMethods;
27
+ SfCustomerCustom: SfCustomerCustom;
28
+ SfCustomer: SfCustomer;
29
+ SfCustomerAddress: SfCustomerAddress;
30
+ SfFacetTypes: SfFacetTypes;
31
+ SfFacetType: SfFacetType;
32
+ SfFacetItem: SfFacetItem;
33
+ SfFacetCustom: SfFacetCustom;
34
+ SfFacet: SfFacet;
35
+ SfOrderLineItemCustom: SfOrderLineItemCustom;
36
+ SfOrderLineItem: SfOrderLineItem;
37
+ SfOrderCustom: SfOrderCustom;
38
+ SfOrder: SfOrder;
39
+ SfOrderListItemCustom: SfOrderListItemCustom;
40
+ SfOrderListItem: SfOrderListItem;
41
+ SfProductVariant: SfProductVariant;
42
+ SfProductReviewCustom: SfProductReviewCustom;
43
+ SfProductReview: SfProductReview;
44
+ SfProductCustom: SfProductCustom;
45
+ SfProduct: SfProduct;
46
+ SfProductCatalogItemCustom: SfProductCatalogItemCustom;
47
+ SfProductCatalogItem: SfProductCatalogItem;
48
+ SfPaginationCustom: SfPaginationCustom;
49
+ SfPagination: SfPagination;
50
+ SfMoneyCustom: SfMoneyCustom;
51
+ SfMoney: SfMoney;
52
+ SfDiscountablePriceCustom: SfDiscountablePriceCustom;
53
+ SfDiscountablePrice: SfDiscountablePrice;
54
+ SfImageCustom: SfImageCustom;
55
+ SfImage: SfImage;
56
+ SfAttributeCustom: SfAttributeCustom;
57
+ SfAttribute: SfAttribute;
58
+ SfCreateAddressBody: SfCreateAddressBody;
59
+ SfAddressCustom: SfAddressCustom;
60
+ SfAddress: SfAddress;
61
+ SfCurrency: SfCurrency;
62
+ }
@@ -0,0 +1,8 @@
1
+ export * from "./cart";
2
+ export * from "./category";
3
+ export * from "./checkout";
4
+ export * from "./customer";
5
+ export * from "./facets";
6
+ export * from "./product";
7
+ export * from "./shared";
8
+ export * from "./order";