@commercelayer/react-components 4.21.0-beta.1 → 4.21.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.
Files changed (1013) hide show
  1. package/lib/cjs/components/ExternalFunction.d.ts +7 -0
  2. package/lib/cjs/components/ExternalFunction.js +2 -0
  3. package/lib/cjs/components/MetadataInput.d.ts +5 -0
  4. package/lib/cjs/components/MetadataInput.js +2 -0
  5. package/lib/cjs/components/SubmitButton.d.ts +10 -0
  6. package/lib/cjs/components/SubmitButton.js +2 -0
  7. package/lib/cjs/components/addresses/Address.d.ts +31 -0
  8. package/lib/cjs/components/addresses/Address.js +2 -0
  9. package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +34 -0
  10. package/lib/cjs/components/addresses/AddressCountrySelector.js +2 -0
  11. package/lib/cjs/components/addresses/AddressField.d.ts +61 -0
  12. package/lib/cjs/components/addresses/AddressField.js +2 -0
  13. package/lib/cjs/components/addresses/AddressInput.d.ts +34 -0
  14. package/lib/cjs/components/addresses/AddressInput.js +2 -0
  15. package/lib/cjs/components/addresses/AddressInputSelect.d.ts +29 -0
  16. package/lib/cjs/components/addresses/AddressInputSelect.js +2 -0
  17. package/lib/cjs/components/addresses/AddressStateSelector.d.ts +50 -0
  18. package/lib/cjs/components/addresses/AddressStateSelector.js +2 -0
  19. package/lib/cjs/components/addresses/AddressesContainer.d.ts +40 -0
  20. package/lib/cjs/components/addresses/AddressesContainer.js +2 -0
  21. package/lib/cjs/components/addresses/AddressesEmpty.d.ts +26 -0
  22. package/lib/cjs/components/addresses/AddressesEmpty.js +2 -0
  23. package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +6 -0
  24. package/lib/cjs/components/addresses/BillingAddressContainer.js +2 -0
  25. package/lib/cjs/components/addresses/BillingAddressForm.d.ts +34 -0
  26. package/lib/cjs/components/addresses/BillingAddressForm.js +2 -0
  27. package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +18 -0
  28. package/lib/cjs/components/addresses/SaveAddressesButton.js +2 -0
  29. package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +7 -0
  30. package/lib/cjs/components/addresses/ShippingAddressContainer.js +2 -0
  31. package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +31 -0
  32. package/lib/cjs/components/addresses/ShippingAddressForm.js +2 -0
  33. package/lib/cjs/components/auth/CommerceLayer.d.ts +25 -0
  34. package/lib/cjs/components/auth/CommerceLayer.js +2 -0
  35. package/lib/cjs/components/customers/CustomerAddressForm.d.ts +13 -0
  36. package/lib/cjs/components/customers/CustomerAddressForm.js +2 -0
  37. package/lib/cjs/components/customers/CustomerContainer.d.ts +38 -0
  38. package/lib/cjs/components/customers/CustomerContainer.js +2 -0
  39. package/lib/cjs/components/customers/CustomerField.d.ts +25 -0
  40. package/lib/cjs/components/customers/CustomerField.js +2 -0
  41. package/lib/cjs/components/customers/CustomerInput.d.ts +11 -0
  42. package/lib/cjs/components/customers/CustomerInput.js +2 -0
  43. package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +11 -0
  44. package/lib/cjs/components/customers/CustomerPaymentSource.js +2 -0
  45. package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +14 -0
  46. package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.js +2 -0
  47. package/lib/cjs/components/customers/MyAccountLink.d.ts +38 -0
  48. package/lib/cjs/components/customers/MyAccountLink.js +2 -0
  49. package/lib/cjs/components/customers/MyIdentityLink.d.ts +59 -0
  50. package/lib/cjs/components/customers/MyIdentityLink.js +2 -0
  51. package/lib/cjs/components/customers/SaveCustomerButton.d.ts +12 -0
  52. package/lib/cjs/components/customers/SaveCustomerButton.js +2 -0
  53. package/lib/cjs/components/errors/Errors.d.ts +31 -0
  54. package/lib/cjs/components/errors/Errors.js +2 -0
  55. package/lib/cjs/components/gift_cards/GiftCard.d.ts +10 -0
  56. package/lib/cjs/components/gift_cards/GiftCard.js +2 -0
  57. package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +6 -0
  58. package/lib/cjs/components/gift_cards/GiftCardContainer.js +2 -0
  59. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +7 -0
  60. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +2 -0
  61. package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +7 -0
  62. package/lib/cjs/components/gift_cards/GiftCardInput.js +2 -0
  63. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +16 -0
  64. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +2 -0
  65. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +15 -0
  66. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +2 -0
  67. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +11 -0
  68. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +2 -0
  69. package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +20 -0
  70. package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +2 -0
  71. package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +10 -0
  72. package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +2 -0
  73. package/lib/cjs/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
  74. package/lib/cjs/components/gift_cards/GiftCardRecipientInput.js +2 -0
  75. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +36 -0
  76. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.js +2 -0
  77. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +10 -0
  78. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +2 -0
  79. package/lib/cjs/components/line_items/LineItem.d.ts +8 -0
  80. package/lib/cjs/components/line_items/LineItem.js +2 -0
  81. package/lib/cjs/components/line_items/LineItemAmount.d.ts +7 -0
  82. package/lib/cjs/components/line_items/LineItemAmount.js +2 -0
  83. package/lib/cjs/components/line_items/LineItemCode.d.ts +13 -0
  84. package/lib/cjs/components/line_items/LineItemCode.js +2 -0
  85. package/lib/cjs/components/line_items/LineItemField.d.ts +14 -0
  86. package/lib/cjs/components/line_items/LineItemField.js +2 -0
  87. package/lib/cjs/components/line_items/LineItemImage.d.ts +17 -0
  88. package/lib/cjs/components/line_items/LineItemImage.js +2 -0
  89. package/lib/cjs/components/line_items/LineItemName.d.ts +12 -0
  90. package/lib/cjs/components/line_items/LineItemName.js +2 -0
  91. package/lib/cjs/components/line_items/LineItemOption.d.ts +19 -0
  92. package/lib/cjs/components/line_items/LineItemOption.js +2 -0
  93. package/lib/cjs/components/line_items/LineItemOptions.d.ts +16 -0
  94. package/lib/cjs/components/line_items/LineItemOptions.js +2 -0
  95. package/lib/cjs/components/line_items/LineItemQuantity.d.ts +21 -0
  96. package/lib/cjs/components/line_items/LineItemQuantity.js +2 -0
  97. package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +14 -0
  98. package/lib/cjs/components/line_items/LineItemRemoveLink.js +2 -0
  99. package/lib/cjs/components/line_items/LineItemsContainer.d.ts +9 -0
  100. package/lib/cjs/components/line_items/LineItemsContainer.js +2 -0
  101. package/lib/cjs/components/line_items/LineItemsCount.d.ts +12 -0
  102. package/lib/cjs/components/line_items/LineItemsCount.js +2 -0
  103. package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +12 -0
  104. package/lib/cjs/components/line_items/LineItemsEmpty.js +2 -0
  105. package/lib/cjs/components/orders/AddToCartButton.d.ts +95 -0
  106. package/lib/cjs/components/orders/AddToCartButton.js +2 -0
  107. package/lib/cjs/components/orders/AdjustmentAmount.d.ts +4 -0
  108. package/lib/cjs/components/orders/AdjustmentAmount.js +2 -0
  109. package/lib/cjs/components/orders/CartLink.d.ts +47 -0
  110. package/lib/cjs/components/orders/CartLink.js +2 -0
  111. package/lib/cjs/components/orders/CheckoutLink.d.ts +28 -0
  112. package/lib/cjs/components/orders/CheckoutLink.js +2 -0
  113. package/lib/cjs/components/orders/DiscountAmount.d.ts +4 -0
  114. package/lib/cjs/components/orders/DiscountAmount.js +2 -0
  115. package/lib/cjs/components/orders/GiftCardAmount.d.ts +4 -0
  116. package/lib/cjs/components/orders/GiftCardAmount.js +2 -0
  117. package/lib/cjs/components/orders/HostedCart.d.ts +58 -0
  118. package/lib/cjs/components/orders/HostedCart.js +2 -0
  119. package/lib/cjs/components/orders/OrderContainer.d.ts +62 -0
  120. package/lib/cjs/components/orders/OrderContainer.js +2 -0
  121. package/lib/cjs/components/orders/OrderList.d.ts +83 -0
  122. package/lib/cjs/components/orders/OrderList.js +2 -0
  123. package/lib/cjs/components/orders/OrderListEmpty.d.ts +17 -0
  124. package/lib/cjs/components/orders/OrderListEmpty.js +2 -0
  125. package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +48 -0
  126. package/lib/cjs/components/orders/OrderListPaginationButtons.js +2 -0
  127. package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +29 -0
  128. package/lib/cjs/components/orders/OrderListPaginationInfo.js +2 -0
  129. package/lib/cjs/components/orders/OrderListRow.d.ts +29 -0
  130. package/lib/cjs/components/orders/OrderListRow.js +2 -0
  131. package/lib/cjs/components/orders/OrderNumber.d.ts +5 -0
  132. package/lib/cjs/components/orders/OrderNumber.js +2 -0
  133. package/lib/cjs/components/orders/OrderStorage.d.ts +31 -0
  134. package/lib/cjs/components/orders/OrderStorage.js +2 -0
  135. package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +4 -0
  136. package/lib/cjs/components/orders/PaymentMethodAmount.js +2 -0
  137. package/lib/cjs/components/orders/PlaceOrderButton.d.ts +35 -0
  138. package/lib/cjs/components/orders/PlaceOrderButton.js +2 -0
  139. package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +8 -0
  140. package/lib/cjs/components/orders/PlaceOrderContainer.js +2 -0
  141. package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +4 -0
  142. package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.js +2 -0
  143. package/lib/cjs/components/orders/ShippingAmount.d.ts +4 -0
  144. package/lib/cjs/components/orders/ShippingAmount.js +2 -0
  145. package/lib/cjs/components/orders/SubTotalAmount.d.ts +4 -0
  146. package/lib/cjs/components/orders/SubTotalAmount.js +2 -0
  147. package/lib/cjs/components/orders/TaxesAmount.d.ts +4 -0
  148. package/lib/cjs/components/orders/TaxesAmount.js +2 -0
  149. package/lib/cjs/components/orders/TotalAmount.d.ts +4 -0
  150. package/lib/cjs/components/orders/TotalAmount.js +2 -0
  151. package/lib/cjs/components/parcels/ParcelField.d.ts +14 -0
  152. package/lib/cjs/components/parcels/ParcelField.js +2 -0
  153. package/lib/cjs/components/parcels/ParcelLineItem.d.ts +7 -0
  154. package/lib/cjs/components/parcels/ParcelLineItem.js +2 -0
  155. package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +14 -0
  156. package/lib/cjs/components/parcels/ParcelLineItemField.js +2 -0
  157. package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +18 -0
  158. package/lib/cjs/components/parcels/ParcelLineItemsCount.js +2 -0
  159. package/lib/cjs/components/parcels/Parcels.d.ts +7 -0
  160. package/lib/cjs/components/parcels/Parcels.js +2 -0
  161. package/lib/cjs/components/parcels/ParcelsCount.d.ts +18 -0
  162. package/lib/cjs/components/parcels/ParcelsCount.js +2 -0
  163. package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +5 -0
  164. package/lib/cjs/components/payment_gateways/AdyenGateway.js +2 -0
  165. package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +5 -0
  166. package/lib/cjs/components/payment_gateways/BraintreeGateway.js +2 -0
  167. package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +5 -0
  168. package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +2 -0
  169. package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +5 -0
  170. package/lib/cjs/components/payment_gateways/ExternalGateway.js +2 -0
  171. package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +5 -0
  172. package/lib/cjs/components/payment_gateways/KlarnaGateway.js +2 -0
  173. package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +16 -0
  174. package/lib/cjs/components/payment_gateways/PaymentGateway.js +2 -0
  175. package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +5 -0
  176. package/lib/cjs/components/payment_gateways/PaypalGateway.js +2 -0
  177. package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +5 -0
  178. package/lib/cjs/components/payment_gateways/StripeGateway.js +2 -0
  179. package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +5 -0
  180. package/lib/cjs/components/payment_gateways/WireTransferGateway.js +2 -0
  181. package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +45 -0
  182. package/lib/cjs/components/payment_methods/PaymentMethod.js +2 -0
  183. package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +10 -0
  184. package/lib/cjs/components/payment_methods/PaymentMethodName.js +2 -0
  185. package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +8 -0
  186. package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +2 -0
  187. package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +17 -0
  188. package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +2 -0
  189. package/lib/cjs/components/payment_methods/PaymentMethodsContainer.d.ts +8 -0
  190. package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +2 -0
  191. package/lib/cjs/components/payment_source/AdyenPayment.d.ts +66 -0
  192. package/lib/cjs/components/payment_source/AdyenPayment.js +2 -0
  193. package/lib/cjs/components/payment_source/BraintreePayment.d.ts +32 -0
  194. package/lib/cjs/components/payment_source/BraintreePayment.js +2 -0
  195. package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +23 -0
  196. package/lib/cjs/components/payment_source/CheckoutComPayment.js +2 -0
  197. package/lib/cjs/components/payment_source/ExternalPayment.d.ts +24 -0
  198. package/lib/cjs/components/payment_source/ExternalPayment.js +2 -0
  199. package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +10 -0
  200. package/lib/cjs/components/payment_source/KlarnaPayment.js +2 -0
  201. package/lib/cjs/components/payment_source/PaymentSource.d.ts +19 -0
  202. package/lib/cjs/components/payment_source/PaymentSource.js +2 -0
  203. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +15 -0
  204. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +2 -0
  205. package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +12 -0
  206. package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +2 -0
  207. package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +15 -0
  208. package/lib/cjs/components/payment_source/PaymentSourceDetail.js +2 -0
  209. package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +10 -0
  210. package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +2 -0
  211. package/lib/cjs/components/payment_source/PaypalPayment.d.ts +12 -0
  212. package/lib/cjs/components/payment_source/PaypalPayment.js +2 -0
  213. package/lib/cjs/components/payment_source/StripeExpressPayment.d.ts +6 -0
  214. package/lib/cjs/components/payment_source/StripeExpressPayment.js +2 -0
  215. package/lib/cjs/components/payment_source/StripePayment.d.ts +21 -0
  216. package/lib/cjs/components/payment_source/StripePayment.js +2 -0
  217. package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +12 -0
  218. package/lib/cjs/components/payment_source/WireTransferPayment.js +2 -0
  219. package/lib/cjs/components/prices/Price.d.ts +35 -0
  220. package/lib/cjs/components/prices/Price.js +2 -0
  221. package/lib/cjs/components/prices/PricesContainer.d.ts +41 -0
  222. package/lib/cjs/components/prices/PricesContainer.js +2 -0
  223. package/lib/cjs/components/shipments/Shipment.d.ts +10 -0
  224. package/lib/cjs/components/shipments/Shipment.js +2 -0
  225. package/lib/cjs/components/shipments/ShipmentField.d.ts +12 -0
  226. package/lib/cjs/components/shipments/ShipmentField.js +2 -0
  227. package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +6 -0
  228. package/lib/cjs/components/shipments/ShipmentsContainer.js +2 -0
  229. package/lib/cjs/components/shipments/ShipmentsCount.d.ts +18 -0
  230. package/lib/cjs/components/shipments/ShipmentsCount.js +2 -0
  231. package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +8 -0
  232. package/lib/cjs/components/shipping_methods/ShippingMethod.js +2 -0
  233. package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +11 -0
  234. package/lib/cjs/components/shipping_methods/ShippingMethodName.js +2 -0
  235. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +20 -0
  236. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +2 -0
  237. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +17 -0
  238. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +2 -0
  239. package/lib/cjs/components/skus/AvailabilityContainer.d.ts +34 -0
  240. package/lib/cjs/components/skus/AvailabilityContainer.js +2 -0
  241. package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +52 -0
  242. package/lib/cjs/components/skus/AvailabilityTemplate.js +2 -0
  243. package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +10 -0
  244. package/lib/cjs/components/skus/DeliveryLeadTime.js +2 -0
  245. package/lib/cjs/components/skus/SkuField.d.ts +25 -0
  246. package/lib/cjs/components/skus/SkuField.js +2 -0
  247. package/lib/cjs/components/skus/SkuList.d.ts +10 -0
  248. package/lib/cjs/components/skus/SkuList.js +2 -0
  249. package/lib/cjs/components/skus/SkuListsContainer.d.ts +6 -0
  250. package/lib/cjs/components/skus/SkuListsContainer.js +2 -0
  251. package/lib/cjs/components/skus/Skus.d.ts +18 -0
  252. package/lib/cjs/components/skus/Skus.js +2 -0
  253. package/lib/cjs/components/skus/SkusContainer.d.ts +31 -0
  254. package/lib/cjs/components/skus/SkusContainer.js +2 -0
  255. package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +7 -0
  256. package/lib/cjs/components/stock_transfers/StockTransfer.js +2 -0
  257. package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +10 -0
  258. package/lib/cjs/components/stock_transfers/StockTransferField.js +2 -0
  259. package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +26 -0
  260. package/lib/cjs/components/utils/AddressCardsTemplate.js +2 -0
  261. package/lib/cjs/components/utils/BaseField.d.ts +8 -0
  262. package/lib/cjs/components/utils/BaseField.js +2 -0
  263. package/lib/cjs/components/utils/BaseInput.d.ts +5 -0
  264. package/lib/cjs/components/utils/BaseInput.js +2 -0
  265. package/lib/cjs/components/utils/BaseOrderPrice.d.ts +6 -0
  266. package/lib/cjs/components/utils/BaseOrderPrice.js +2 -0
  267. package/lib/cjs/components/utils/BaseSelect.d.ts +5 -0
  268. package/lib/cjs/components/utils/BaseSelect.js +2 -0
  269. package/lib/cjs/components/utils/ErrorBoundary.d.ts +14 -0
  270. package/lib/cjs/components/utils/ErrorBoundary.js +2 -0
  271. package/lib/cjs/components/utils/GenericFieldComponent.d.ts +58 -0
  272. package/lib/cjs/components/utils/GenericFieldComponent.js +2 -0
  273. package/lib/cjs/components/utils/Parent.d.ts +6 -0
  274. package/lib/cjs/components/utils/Parent.js +2 -0
  275. package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +41 -0
  276. package/lib/cjs/components/utils/PaymentCardsTemplate.js +2 -0
  277. package/lib/cjs/components/utils/PriceTemplate.d.ts +8 -0
  278. package/lib/cjs/components/utils/PriceTemplate.js +2 -0
  279. package/lib/cjs/components/utils/getAllErrors.d.ts +16 -0
  280. package/lib/cjs/components/utils/getAllErrors.js +2 -0
  281. package/lib/cjs/config/currency.d.ts +5 -0
  282. package/lib/cjs/config/currency.js +2 -0
  283. package/lib/cjs/context/AddressChildrenContext.d.ts +6 -0
  284. package/lib/cjs/context/AddressChildrenContext.js +2 -0
  285. package/lib/cjs/context/AddressContext.d.ts +18 -0
  286. package/lib/cjs/context/AddressContext.js +2 -0
  287. package/lib/cjs/context/AvailabilityContext.d.ts +2 -0
  288. package/lib/cjs/context/AvailabilityContext.js +2 -0
  289. package/lib/cjs/context/BillingAddressContext.d.ts +9 -0
  290. package/lib/cjs/context/BillingAddressContext.js +2 -0
  291. package/lib/cjs/context/BillingAddressFormContext.d.ts +22 -0
  292. package/lib/cjs/context/BillingAddressFormContext.js +2 -0
  293. package/lib/cjs/context/CommerceLayerContext.d.ts +6 -0
  294. package/lib/cjs/context/CommerceLayerContext.js +2 -0
  295. package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +8 -0
  296. package/lib/cjs/context/CouponAndGiftCardFormContext.js +2 -0
  297. package/lib/cjs/context/CustomerAddressFormContext.d.ts +17 -0
  298. package/lib/cjs/context/CustomerAddressFormContext.js +2 -0
  299. package/lib/cjs/context/CustomerContext.d.ts +29 -0
  300. package/lib/cjs/context/CustomerContext.js +2 -0
  301. package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +11 -0
  302. package/lib/cjs/context/CustomerPaymentSourceContext.js +2 -0
  303. package/lib/cjs/context/ExternalFunctionContext.d.ts +11 -0
  304. package/lib/cjs/context/ExternalFunctionContext.js +2 -0
  305. package/lib/cjs/context/GiftCardContext.d.ts +10 -0
  306. package/lib/cjs/context/GiftCardContext.js +2 -0
  307. package/lib/cjs/context/InStockSubscriptionContext.d.ts +6 -0
  308. package/lib/cjs/context/InStockSubscriptionContext.js +2 -0
  309. package/lib/cjs/context/LineItemChildrenContext.d.ts +8 -0
  310. package/lib/cjs/context/LineItemChildrenContext.js +2 -0
  311. package/lib/cjs/context/LineItemContext.d.ts +7 -0
  312. package/lib/cjs/context/LineItemContext.js +2 -0
  313. package/lib/cjs/context/LineItemOptionChildrenContext.d.ts +9 -0
  314. package/lib/cjs/context/LineItemOptionChildrenContext.js +2 -0
  315. package/lib/cjs/context/OrderContext.d.ts +30 -0
  316. package/lib/cjs/context/OrderContext.js +2 -0
  317. package/lib/cjs/context/OrderListChildrenContext.d.ts +73 -0
  318. package/lib/cjs/context/OrderListChildrenContext.js +2 -0
  319. package/lib/cjs/context/OrderListPaginationContext.d.ts +15 -0
  320. package/lib/cjs/context/OrderListPaginationContext.js +2 -0
  321. package/lib/cjs/context/OrderStorageContext.d.ts +10 -0
  322. package/lib/cjs/context/OrderStorageContext.js +2 -0
  323. package/lib/cjs/context/ParcelChildrenContext.d.ts +6 -0
  324. package/lib/cjs/context/ParcelChildrenContext.js +2 -0
  325. package/lib/cjs/context/ParcelLineItemChildrenContext.d.ts +6 -0
  326. package/lib/cjs/context/ParcelLineItemChildrenContext.js +2 -0
  327. package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +10 -0
  328. package/lib/cjs/context/PaymentMethodChildrenContext.js +2 -0
  329. package/lib/cjs/context/PaymentMethodContext.d.ts +13 -0
  330. package/lib/cjs/context/PaymentMethodContext.js +2 -0
  331. package/lib/cjs/context/PaymentSourceContext.d.ts +14 -0
  332. package/lib/cjs/context/PaymentSourceContext.js +2 -0
  333. package/lib/cjs/context/PlaceOrderContext.d.ts +12 -0
  334. package/lib/cjs/context/PlaceOrderContext.js +2 -0
  335. package/lib/cjs/context/PricesContext.d.ts +6 -0
  336. package/lib/cjs/context/PricesContext.js +2 -0
  337. package/lib/cjs/context/ShipmentChildrenContext.d.ts +13 -0
  338. package/lib/cjs/context/ShipmentChildrenContext.js +2 -0
  339. package/lib/cjs/context/ShipmentContext.d.ts +10 -0
  340. package/lib/cjs/context/ShipmentContext.js +2 -0
  341. package/lib/cjs/context/ShippingAddressContext.d.ts +9 -0
  342. package/lib/cjs/context/ShippingAddressContext.js +2 -0
  343. package/lib/cjs/context/ShippingAddressFormContext.d.ts +3 -0
  344. package/lib/cjs/context/ShippingAddressFormContext.js +2 -0
  345. package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +9 -0
  346. package/lib/cjs/context/ShippingMethodChildrenContext.js +2 -0
  347. package/lib/cjs/context/SkuChildrenContext.d.ts +8 -0
  348. package/lib/cjs/context/SkuChildrenContext.js +2 -0
  349. package/lib/cjs/context/SkuContext.d.ts +8 -0
  350. package/lib/cjs/context/SkuContext.js +2 -0
  351. package/lib/cjs/context/SkuListsContext.d.ts +5 -0
  352. package/lib/cjs/context/SkuListsContext.js +2 -0
  353. package/lib/cjs/context/StockTransferChildrenContext.d.ts +6 -0
  354. package/lib/cjs/context/StockTransferChildrenContext.js +2 -0
  355. package/lib/cjs/hooks/useCommerceLayer.d.ts +12 -0
  356. package/lib/cjs/hooks/useCommerceLayer.js +2 -0
  357. package/lib/cjs/hooks/useCustomerContainer.d.ts +12 -0
  358. package/lib/cjs/hooks/useCustomerContainer.js +2 -0
  359. package/lib/cjs/hooks/useOrderContainer.d.ts +16 -0
  360. package/lib/cjs/hooks/useOrderContainer.js +2 -0
  361. package/lib/cjs/index.d.ts +107 -0
  362. package/lib/cjs/index.js +2 -0
  363. package/lib/cjs/reducers/AddressReducer.d.ts +80 -0
  364. package/lib/cjs/reducers/AddressReducer.js +2 -0
  365. package/lib/cjs/reducers/AvailabilityReducer.d.ts +53 -0
  366. package/lib/cjs/reducers/AvailabilityReducer.js +2 -0
  367. package/lib/cjs/reducers/BillingAddressReducer.d.ts +31 -0
  368. package/lib/cjs/reducers/BillingAddressReducer.js +2 -0
  369. package/lib/cjs/reducers/CustomerReducer.d.ts +183 -0
  370. package/lib/cjs/reducers/CustomerReducer.js +2 -0
  371. package/lib/cjs/reducers/GiftCardReducer.d.ts +66 -0
  372. package/lib/cjs/reducers/GiftCardReducer.js +2 -0
  373. package/lib/cjs/reducers/InStockSubscriptionReducer.d.ts +33 -0
  374. package/lib/cjs/reducers/InStockSubscriptionReducer.js +2 -0
  375. package/lib/cjs/reducers/LineItemReducer.d.ts +47 -0
  376. package/lib/cjs/reducers/LineItemReducer.js +2 -0
  377. package/lib/cjs/reducers/OrderReducer.d.ts +171 -0
  378. package/lib/cjs/reducers/OrderReducer.js +2 -0
  379. package/lib/cjs/reducers/PaymentMethodReducer.d.ts +161 -0
  380. package/lib/cjs/reducers/PaymentMethodReducer.js +2 -0
  381. package/lib/cjs/reducers/PlaceOrderReducer.d.ts +72 -0
  382. package/lib/cjs/reducers/PlaceOrderReducer.js +2 -0
  383. package/lib/cjs/reducers/PriceReducer.d.ts +35 -0
  384. package/lib/cjs/reducers/PriceReducer.js +2 -0
  385. package/lib/cjs/reducers/ShipmentReducer.d.ts +41 -0
  386. package/lib/cjs/reducers/ShipmentReducer.js +2 -0
  387. package/lib/cjs/reducers/ShippingAddressReducer.d.ts +32 -0
  388. package/lib/cjs/reducers/ShippingAddressReducer.js +2 -0
  389. package/lib/cjs/reducers/SkuListsReducer.d.ts +21 -0
  390. package/lib/cjs/reducers/SkuListsReducer.js +2 -0
  391. package/lib/cjs/reducers/SkuReducer.d.ts +21 -0
  392. package/lib/cjs/reducers/SkuReducer.js +2 -0
  393. package/lib/cjs/typings/errors.d.ts +15 -0
  394. package/lib/cjs/typings/errors.js +2 -0
  395. package/lib/cjs/typings/globals.d.ts +6 -0
  396. package/lib/cjs/typings/globals.js +2 -0
  397. package/lib/cjs/typings/index.d.ts +117 -0
  398. package/lib/cjs/typings/index.js +2 -0
  399. package/lib/cjs/utils/PropsType.d.ts +33 -0
  400. package/lib/cjs/utils/PropsType.js +2 -0
  401. package/lib/cjs/utils/addressesManager.d.ts +64 -0
  402. package/lib/cjs/utils/addressesManager.js +2 -0
  403. package/lib/cjs/utils/adyen/manageGiftCard.d.ts +16 -0
  404. package/lib/cjs/utils/adyen/manageGiftCard.js +2 -0
  405. package/lib/cjs/utils/baseReducer.d.ts +3 -0
  406. package/lib/cjs/utils/baseReducer.js +2 -0
  407. package/lib/cjs/utils/browserInfo.d.ts +12 -0
  408. package/lib/cjs/utils/browserInfo.js +2 -0
  409. package/lib/cjs/utils/canPlaceOrder.d.ts +5 -0
  410. package/lib/cjs/utils/canPlaceOrder.js +2 -0
  411. package/lib/cjs/utils/checkIncludeResource.d.ts +8 -0
  412. package/lib/cjs/utils/checkIncludeResource.js +2 -0
  413. package/lib/cjs/utils/compareObjAttribute.d.ts +7 -0
  414. package/lib/cjs/utils/compareObjAttribute.js +2 -0
  415. package/lib/cjs/utils/countryStateCity.d.ts +801 -0
  416. package/lib/cjs/utils/countryStateCity.js +2 -0
  417. package/lib/cjs/utils/customMessages.d.ts +2 -0
  418. package/lib/cjs/utils/customMessages.js +2 -0
  419. package/lib/cjs/utils/customerOrderOptions.d.ts +3 -0
  420. package/lib/cjs/utils/customerOrderOptions.js +2 -0
  421. package/lib/cjs/utils/events.d.ts +5 -0
  422. package/lib/cjs/utils/events.js +2 -0
  423. package/lib/cjs/utils/expressPaymentHelper.d.ts +92 -0
  424. package/lib/cjs/utils/expressPaymentHelper.js +2 -0
  425. package/lib/cjs/utils/filterChildren.d.ts +12 -0
  426. package/lib/cjs/utils/filterChildren.js +2 -0
  427. package/lib/cjs/utils/formCleaner.d.ts +4 -0
  428. package/lib/cjs/utils/formCleaner.js +2 -0
  429. package/lib/cjs/utils/getAmount.d.ts +7 -0
  430. package/lib/cjs/utils/getAmount.js +2 -0
  431. package/lib/cjs/utils/getApplicationLink.d.ts +35 -0
  432. package/lib/cjs/utils/getApplicationLink.js +2 -0
  433. package/lib/cjs/utils/getCardDetails.d.ts +16 -0
  434. package/lib/cjs/utils/getCardDetails.js +2 -0
  435. package/lib/cjs/utils/getCustomerIdByToken.d.ts +6 -0
  436. package/lib/cjs/utils/getCustomerIdByToken.js +2 -0
  437. package/lib/cjs/utils/getDomain.d.ts +4 -0
  438. package/lib/cjs/utils/getDomain.js +2 -0
  439. package/lib/cjs/utils/getErrors.d.ts +19 -0
  440. package/lib/cjs/utils/getErrors.js +2 -0
  441. package/lib/cjs/utils/getLineItemsCount.d.ts +10 -0
  442. package/lib/cjs/utils/getLineItemsCount.js +2 -0
  443. package/lib/cjs/utils/getLoaderComponent.d.ts +3 -0
  444. package/lib/cjs/utils/getLoaderComponent.js +2 -0
  445. package/lib/cjs/utils/getPaymentAttributes.d.ts +17 -0
  446. package/lib/cjs/utils/getPaymentAttributes.js +2 -0
  447. package/lib/cjs/utils/getPrices.d.ts +6 -0
  448. package/lib/cjs/utils/getPrices.js +2 -0
  449. package/lib/cjs/utils/getPublicIp.d.ts +1 -0
  450. package/lib/cjs/utils/getPublicIp.js +2 -0
  451. package/lib/cjs/utils/getSdk.d.ts +3 -0
  452. package/lib/cjs/utils/getSdk.js +2 -0
  453. package/lib/cjs/utils/getSkus.d.ts +3 -0
  454. package/lib/cjs/utils/getSkus.js +2 -0
  455. package/lib/cjs/utils/hasSubscriptions.d.ts +7 -0
  456. package/lib/cjs/utils/hasSubscriptions.js +2 -0
  457. package/lib/cjs/utils/hooks/useCustomContext.d.ts +21 -0
  458. package/lib/cjs/utils/hooks/useCustomContext.js +2 -0
  459. package/lib/cjs/utils/hooks/useExternalScript.d.ts +1 -0
  460. package/lib/cjs/utils/hooks/useExternalScript.js +2 -0
  461. package/lib/cjs/utils/icons.d.ts +2 -0
  462. package/lib/cjs/utils/icons.js +2 -0
  463. package/lib/cjs/utils/isDate.d.ts +1 -0
  464. package/lib/cjs/utils/isDate.js +2 -0
  465. package/lib/cjs/utils/isEmpty.d.ts +1 -0
  466. package/lib/cjs/utils/isEmpty.js +2 -0
  467. package/lib/cjs/utils/isGuestToken.d.ts +6 -0
  468. package/lib/cjs/utils/isGuestToken.js +2 -0
  469. package/lib/cjs/utils/isJSON.d.ts +1 -0
  470. package/lib/cjs/utils/isJSON.js +2 -0
  471. package/lib/cjs/utils/jwt.d.ts +27 -0
  472. package/lib/cjs/utils/jwt.js +2 -0
  473. package/lib/cjs/utils/localStorage.d.ts +11 -0
  474. package/lib/cjs/utils/localStorage.js +2 -0
  475. package/lib/cjs/utils/omit.d.ts +1 -0
  476. package/lib/cjs/utils/omit.js +2 -0
  477. package/lib/cjs/utils/organization.d.ts +18 -0
  478. package/lib/cjs/utils/organization.js +2 -0
  479. package/lib/cjs/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
  480. package/lib/cjs/utils/payment-methods/sortPaymentMethods.js +2 -0
  481. package/lib/cjs/utils/pick.d.ts +1 -0
  482. package/lib/cjs/utils/pick.js +2 -0
  483. package/lib/cjs/utils/placeholderImages.d.ts +2 -0
  484. package/lib/cjs/utils/placeholderImages.js +2 -0
  485. package/lib/cjs/utils/promisify.d.ts +1 -0
  486. package/lib/cjs/utils/promisify.js +2 -0
  487. package/lib/cjs/utils/replace.d.ts +2 -0
  488. package/lib/cjs/utils/replace.js +2 -0
  489. package/lib/cjs/utils/scrollbarWidth.d.ts +1 -0
  490. package/lib/cjs/utils/scrollbarWidth.js +2 -0
  491. package/lib/cjs/utils/shipments.d.ts +3 -0
  492. package/lib/cjs/utils/shipments.js +2 -0
  493. package/lib/cjs/utils/snakeToCamelCase.d.ts +5 -0
  494. package/lib/cjs/utils/snakeToCamelCase.js +2 -0
  495. package/lib/cjs/utils/stripe/retrievePaymentIntent.d.ts +14 -0
  496. package/lib/cjs/utils/stripe/retrievePaymentIntent.js +2 -0
  497. package/lib/cjs/utils/triggerAttributeHelper.d.ts +31 -0
  498. package/lib/cjs/utils/triggerAttributeHelper.js +2 -0
  499. package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +8 -0
  500. package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.js +2 -0
  501. package/lib/cjs/utils/validateFormFields.d.ts +16 -0
  502. package/lib/cjs/utils/validateFormFields.js +2 -0
  503. package/lib/esm/components/ExternalFunction.d.ts +7 -0
  504. package/lib/esm/components/ExternalFunction.js +2 -0
  505. package/lib/esm/components/MetadataInput.d.ts +5 -0
  506. package/lib/esm/components/MetadataInput.js +2 -0
  507. package/lib/esm/components/SubmitButton.d.ts +10 -0
  508. package/lib/esm/components/SubmitButton.js +2 -0
  509. package/lib/esm/components/addresses/Address.d.ts +31 -0
  510. package/lib/esm/components/addresses/Address.js +2 -0
  511. package/lib/esm/components/addresses/AddressCountrySelector.d.ts +34 -0
  512. package/lib/esm/components/addresses/AddressCountrySelector.js +2 -0
  513. package/lib/esm/components/addresses/AddressField.d.ts +61 -0
  514. package/lib/esm/components/addresses/AddressField.js +2 -0
  515. package/lib/esm/components/addresses/AddressInput.d.ts +34 -0
  516. package/lib/esm/components/addresses/AddressInput.js +2 -0
  517. package/lib/esm/components/addresses/AddressInputSelect.d.ts +29 -0
  518. package/lib/esm/components/addresses/AddressInputSelect.js +2 -0
  519. package/lib/esm/components/addresses/AddressStateSelector.d.ts +50 -0
  520. package/lib/esm/components/addresses/AddressStateSelector.js +2 -0
  521. package/lib/esm/components/addresses/AddressesContainer.d.ts +40 -0
  522. package/lib/esm/components/addresses/AddressesContainer.js +2 -0
  523. package/lib/esm/components/addresses/AddressesEmpty.d.ts +26 -0
  524. package/lib/esm/components/addresses/AddressesEmpty.js +2 -0
  525. package/lib/esm/components/addresses/BillingAddressContainer.d.ts +6 -0
  526. package/lib/esm/components/addresses/BillingAddressContainer.js +2 -0
  527. package/lib/esm/components/addresses/BillingAddressForm.d.ts +34 -0
  528. package/lib/esm/components/addresses/BillingAddressForm.js +2 -0
  529. package/lib/esm/components/addresses/SaveAddressesButton.d.ts +18 -0
  530. package/lib/esm/components/addresses/SaveAddressesButton.js +2 -0
  531. package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +7 -0
  532. package/lib/esm/components/addresses/ShippingAddressContainer.js +2 -0
  533. package/lib/esm/components/addresses/ShippingAddressForm.d.ts +31 -0
  534. package/lib/esm/components/addresses/ShippingAddressForm.js +2 -0
  535. package/lib/esm/components/auth/CommerceLayer.d.ts +25 -0
  536. package/lib/esm/components/auth/CommerceLayer.js +2 -0
  537. package/lib/esm/components/customers/CustomerAddressForm.d.ts +13 -0
  538. package/lib/esm/components/customers/CustomerAddressForm.js +2 -0
  539. package/lib/esm/components/customers/CustomerContainer.d.ts +38 -0
  540. package/lib/esm/components/customers/CustomerContainer.js +2 -0
  541. package/lib/esm/components/customers/CustomerField.d.ts +25 -0
  542. package/lib/esm/components/customers/CustomerField.js +2 -0
  543. package/lib/esm/components/customers/CustomerInput.d.ts +11 -0
  544. package/lib/esm/components/customers/CustomerInput.js +2 -0
  545. package/lib/esm/components/customers/CustomerPaymentSource.d.ts +11 -0
  546. package/lib/esm/components/customers/CustomerPaymentSource.js +2 -0
  547. package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +14 -0
  548. package/lib/esm/components/customers/CustomerPaymentSourceEmpty.js +2 -0
  549. package/lib/esm/components/customers/MyAccountLink.d.ts +38 -0
  550. package/lib/esm/components/customers/MyAccountLink.js +2 -0
  551. package/lib/esm/components/customers/MyIdentityLink.d.ts +59 -0
  552. package/lib/esm/components/customers/MyIdentityLink.js +2 -0
  553. package/lib/esm/components/customers/SaveCustomerButton.d.ts +12 -0
  554. package/lib/esm/components/customers/SaveCustomerButton.js +2 -0
  555. package/lib/esm/components/errors/Errors.d.ts +31 -0
  556. package/lib/esm/components/errors/Errors.js +2 -0
  557. package/lib/esm/components/gift_cards/GiftCard.d.ts +10 -0
  558. package/lib/esm/components/gift_cards/GiftCard.js +2 -0
  559. package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +6 -0
  560. package/lib/esm/components/gift_cards/GiftCardContainer.js +2 -0
  561. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +7 -0
  562. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +2 -0
  563. package/lib/esm/components/gift_cards/GiftCardInput.d.ts +7 -0
  564. package/lib/esm/components/gift_cards/GiftCardInput.js +2 -0
  565. package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +16 -0
  566. package/lib/esm/components/gift_cards/GiftCardOrCouponCode.js +2 -0
  567. package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +15 -0
  568. package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +2 -0
  569. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +11 -0
  570. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +2 -0
  571. package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +20 -0
  572. package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.js +2 -0
  573. package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +10 -0
  574. package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.js +2 -0
  575. package/lib/esm/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
  576. package/lib/esm/components/gift_cards/GiftCardRecipientInput.js +2 -0
  577. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +36 -0
  578. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.js +2 -0
  579. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +10 -0
  580. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +2 -0
  581. package/lib/esm/components/line_items/LineItem.d.ts +8 -0
  582. package/lib/esm/components/line_items/LineItem.js +2 -0
  583. package/lib/esm/components/line_items/LineItemAmount.d.ts +7 -0
  584. package/lib/esm/components/line_items/LineItemAmount.js +2 -0
  585. package/lib/esm/components/line_items/LineItemCode.d.ts +13 -0
  586. package/lib/esm/components/line_items/LineItemCode.js +2 -0
  587. package/lib/esm/components/line_items/LineItemField.d.ts +14 -0
  588. package/lib/esm/components/line_items/LineItemField.js +2 -0
  589. package/lib/esm/components/line_items/LineItemImage.d.ts +17 -0
  590. package/lib/esm/components/line_items/LineItemImage.js +2 -0
  591. package/lib/esm/components/line_items/LineItemName.d.ts +12 -0
  592. package/lib/esm/components/line_items/LineItemName.js +2 -0
  593. package/lib/esm/components/line_items/LineItemOption.d.ts +19 -0
  594. package/lib/esm/components/line_items/LineItemOption.js +2 -0
  595. package/lib/esm/components/line_items/LineItemOptions.d.ts +16 -0
  596. package/lib/esm/components/line_items/LineItemOptions.js +2 -0
  597. package/lib/esm/components/line_items/LineItemQuantity.d.ts +21 -0
  598. package/lib/esm/components/line_items/LineItemQuantity.js +2 -0
  599. package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +14 -0
  600. package/lib/esm/components/line_items/LineItemRemoveLink.js +2 -0
  601. package/lib/esm/components/line_items/LineItemsContainer.d.ts +9 -0
  602. package/lib/esm/components/line_items/LineItemsContainer.js +2 -0
  603. package/lib/esm/components/line_items/LineItemsCount.d.ts +12 -0
  604. package/lib/esm/components/line_items/LineItemsCount.js +2 -0
  605. package/lib/esm/components/line_items/LineItemsEmpty.d.ts +12 -0
  606. package/lib/esm/components/line_items/LineItemsEmpty.js +2 -0
  607. package/lib/esm/components/orders/AddToCartButton.d.ts +95 -0
  608. package/lib/esm/components/orders/AddToCartButton.js +2 -0
  609. package/lib/esm/components/orders/AdjustmentAmount.d.ts +4 -0
  610. package/lib/esm/components/orders/AdjustmentAmount.js +2 -0
  611. package/lib/esm/components/orders/CartLink.d.ts +47 -0
  612. package/lib/esm/components/orders/CartLink.js +2 -0
  613. package/lib/esm/components/orders/CheckoutLink.d.ts +28 -0
  614. package/lib/esm/components/orders/CheckoutLink.js +2 -0
  615. package/lib/esm/components/orders/DiscountAmount.d.ts +4 -0
  616. package/lib/esm/components/orders/DiscountAmount.js +2 -0
  617. package/lib/esm/components/orders/GiftCardAmount.d.ts +4 -0
  618. package/lib/esm/components/orders/GiftCardAmount.js +2 -0
  619. package/lib/esm/components/orders/HostedCart.d.ts +58 -0
  620. package/lib/esm/components/orders/HostedCart.js +2 -0
  621. package/lib/esm/components/orders/OrderContainer.d.ts +62 -0
  622. package/lib/esm/components/orders/OrderContainer.js +2 -0
  623. package/lib/esm/components/orders/OrderList.d.ts +83 -0
  624. package/lib/esm/components/orders/OrderList.js +2 -0
  625. package/lib/esm/components/orders/OrderListEmpty.d.ts +17 -0
  626. package/lib/esm/components/orders/OrderListEmpty.js +2 -0
  627. package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +48 -0
  628. package/lib/esm/components/orders/OrderListPaginationButtons.js +2 -0
  629. package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +29 -0
  630. package/lib/esm/components/orders/OrderListPaginationInfo.js +2 -0
  631. package/lib/esm/components/orders/OrderListRow.d.ts +29 -0
  632. package/lib/esm/components/orders/OrderListRow.js +2 -0
  633. package/lib/esm/components/orders/OrderNumber.d.ts +5 -0
  634. package/lib/esm/components/orders/OrderNumber.js +2 -0
  635. package/lib/esm/components/orders/OrderStorage.d.ts +31 -0
  636. package/lib/esm/components/orders/OrderStorage.js +2 -0
  637. package/lib/esm/components/orders/PaymentMethodAmount.d.ts +4 -0
  638. package/lib/esm/components/orders/PaymentMethodAmount.js +2 -0
  639. package/lib/esm/components/orders/PlaceOrderButton.d.ts +35 -0
  640. package/lib/esm/components/orders/PlaceOrderButton.js +2 -0
  641. package/lib/esm/components/orders/PlaceOrderContainer.d.ts +8 -0
  642. package/lib/esm/components/orders/PlaceOrderContainer.js +2 -0
  643. package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +4 -0
  644. package/lib/esm/components/orders/PrivacyAndTermsCheckbox.js +2 -0
  645. package/lib/esm/components/orders/ShippingAmount.d.ts +4 -0
  646. package/lib/esm/components/orders/ShippingAmount.js +2 -0
  647. package/lib/esm/components/orders/SubTotalAmount.d.ts +4 -0
  648. package/lib/esm/components/orders/SubTotalAmount.js +2 -0
  649. package/lib/esm/components/orders/TaxesAmount.d.ts +4 -0
  650. package/lib/esm/components/orders/TaxesAmount.js +2 -0
  651. package/lib/esm/components/orders/TotalAmount.d.ts +4 -0
  652. package/lib/esm/components/orders/TotalAmount.js +2 -0
  653. package/lib/esm/components/parcels/ParcelField.d.ts +14 -0
  654. package/lib/esm/components/parcels/ParcelField.js +2 -0
  655. package/lib/esm/components/parcels/ParcelLineItem.d.ts +7 -0
  656. package/lib/esm/components/parcels/ParcelLineItem.js +2 -0
  657. package/lib/esm/components/parcels/ParcelLineItemField.d.ts +14 -0
  658. package/lib/esm/components/parcels/ParcelLineItemField.js +2 -0
  659. package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +18 -0
  660. package/lib/esm/components/parcels/ParcelLineItemsCount.js +2 -0
  661. package/lib/esm/components/parcels/Parcels.d.ts +7 -0
  662. package/lib/esm/components/parcels/Parcels.js +2 -0
  663. package/lib/esm/components/parcels/ParcelsCount.d.ts +18 -0
  664. package/lib/esm/components/parcels/ParcelsCount.js +2 -0
  665. package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +5 -0
  666. package/lib/esm/components/payment_gateways/AdyenGateway.js +2 -0
  667. package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +5 -0
  668. package/lib/esm/components/payment_gateways/BraintreeGateway.js +2 -0
  669. package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +5 -0
  670. package/lib/esm/components/payment_gateways/CheckoutComGateway.js +2 -0
  671. package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +5 -0
  672. package/lib/esm/components/payment_gateways/ExternalGateway.js +2 -0
  673. package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +5 -0
  674. package/lib/esm/components/payment_gateways/KlarnaGateway.js +2 -0
  675. package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +16 -0
  676. package/lib/esm/components/payment_gateways/PaymentGateway.js +2 -0
  677. package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +5 -0
  678. package/lib/esm/components/payment_gateways/PaypalGateway.js +2 -0
  679. package/lib/esm/components/payment_gateways/StripeGateway.d.ts +5 -0
  680. package/lib/esm/components/payment_gateways/StripeGateway.js +2 -0
  681. package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +5 -0
  682. package/lib/esm/components/payment_gateways/WireTransferGateway.js +2 -0
  683. package/lib/esm/components/payment_methods/PaymentMethod.d.ts +45 -0
  684. package/lib/esm/components/payment_methods/PaymentMethod.js +2 -0
  685. package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +10 -0
  686. package/lib/esm/components/payment_methods/PaymentMethodName.js +2 -0
  687. package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +8 -0
  688. package/lib/esm/components/payment_methods/PaymentMethodPrice.js +2 -0
  689. package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +17 -0
  690. package/lib/esm/components/payment_methods/PaymentMethodRadioButton.js +2 -0
  691. package/lib/esm/components/payment_methods/PaymentMethodsContainer.d.ts +8 -0
  692. package/lib/esm/components/payment_methods/PaymentMethodsContainer.js +2 -0
  693. package/lib/esm/components/payment_source/AdyenPayment.d.ts +66 -0
  694. package/lib/esm/components/payment_source/AdyenPayment.js +2 -0
  695. package/lib/esm/components/payment_source/BraintreePayment.d.ts +32 -0
  696. package/lib/esm/components/payment_source/BraintreePayment.js +2 -0
  697. package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +23 -0
  698. package/lib/esm/components/payment_source/CheckoutComPayment.js +2 -0
  699. package/lib/esm/components/payment_source/ExternalPayment.d.ts +24 -0
  700. package/lib/esm/components/payment_source/ExternalPayment.js +2 -0
  701. package/lib/esm/components/payment_source/KlarnaPayment.d.ts +10 -0
  702. package/lib/esm/components/payment_source/KlarnaPayment.js +2 -0
  703. package/lib/esm/components/payment_source/PaymentSource.d.ts +19 -0
  704. package/lib/esm/components/payment_source/PaymentSource.js +2 -0
  705. package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +15 -0
  706. package/lib/esm/components/payment_source/PaymentSourceBrandIcon.js +2 -0
  707. package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +12 -0
  708. package/lib/esm/components/payment_source/PaymentSourceBrandName.js +2 -0
  709. package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +15 -0
  710. package/lib/esm/components/payment_source/PaymentSourceDetail.js +2 -0
  711. package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +10 -0
  712. package/lib/esm/components/payment_source/PaymentSourceEditButton.js +2 -0
  713. package/lib/esm/components/payment_source/PaypalPayment.d.ts +12 -0
  714. package/lib/esm/components/payment_source/PaypalPayment.js +2 -0
  715. package/lib/esm/components/payment_source/StripeExpressPayment.d.ts +6 -0
  716. package/lib/esm/components/payment_source/StripeExpressPayment.js +2 -0
  717. package/lib/esm/components/payment_source/StripePayment.d.ts +21 -0
  718. package/lib/esm/components/payment_source/StripePayment.js +2 -0
  719. package/lib/esm/components/payment_source/WireTransferPayment.d.ts +12 -0
  720. package/lib/esm/components/payment_source/WireTransferPayment.js +2 -0
  721. package/lib/esm/components/prices/Price.d.ts +35 -0
  722. package/lib/esm/components/prices/Price.js +2 -0
  723. package/lib/esm/components/prices/PricesContainer.d.ts +41 -0
  724. package/lib/esm/components/prices/PricesContainer.js +2 -0
  725. package/lib/esm/components/shipments/Shipment.d.ts +10 -0
  726. package/lib/esm/components/shipments/Shipment.js +2 -0
  727. package/lib/esm/components/shipments/ShipmentField.d.ts +12 -0
  728. package/lib/esm/components/shipments/ShipmentField.js +2 -0
  729. package/lib/esm/components/shipments/ShipmentsContainer.d.ts +6 -0
  730. package/lib/esm/components/shipments/ShipmentsContainer.js +2 -0
  731. package/lib/esm/components/shipments/ShipmentsCount.d.ts +18 -0
  732. package/lib/esm/components/shipments/ShipmentsCount.js +2 -0
  733. package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +8 -0
  734. package/lib/esm/components/shipping_methods/ShippingMethod.js +2 -0
  735. package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +11 -0
  736. package/lib/esm/components/shipping_methods/ShippingMethodName.js +2 -0
  737. package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +20 -0
  738. package/lib/esm/components/shipping_methods/ShippingMethodPrice.js +2 -0
  739. package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +17 -0
  740. package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +2 -0
  741. package/lib/esm/components/skus/AvailabilityContainer.d.ts +34 -0
  742. package/lib/esm/components/skus/AvailabilityContainer.js +2 -0
  743. package/lib/esm/components/skus/AvailabilityTemplate.d.ts +52 -0
  744. package/lib/esm/components/skus/AvailabilityTemplate.js +2 -0
  745. package/lib/esm/components/skus/DeliveryLeadTime.d.ts +10 -0
  746. package/lib/esm/components/skus/DeliveryLeadTime.js +2 -0
  747. package/lib/esm/components/skus/SkuField.d.ts +25 -0
  748. package/lib/esm/components/skus/SkuField.js +2 -0
  749. package/lib/esm/components/skus/SkuList.d.ts +10 -0
  750. package/lib/esm/components/skus/SkuList.js +2 -0
  751. package/lib/esm/components/skus/SkuListsContainer.d.ts +6 -0
  752. package/lib/esm/components/skus/SkuListsContainer.js +2 -0
  753. package/lib/esm/components/skus/Skus.d.ts +18 -0
  754. package/lib/esm/components/skus/Skus.js +2 -0
  755. package/lib/esm/components/skus/SkusContainer.d.ts +31 -0
  756. package/lib/esm/components/skus/SkusContainer.js +2 -0
  757. package/lib/esm/components/stock_transfers/StockTransfer.d.ts +7 -0
  758. package/lib/esm/components/stock_transfers/StockTransfer.js +2 -0
  759. package/lib/esm/components/stock_transfers/StockTransferField.d.ts +10 -0
  760. package/lib/esm/components/stock_transfers/StockTransferField.js +2 -0
  761. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +26 -0
  762. package/lib/esm/components/utils/AddressCardsTemplate.js +2 -0
  763. package/lib/esm/components/utils/BaseField.d.ts +8 -0
  764. package/lib/esm/components/utils/BaseField.js +2 -0
  765. package/lib/esm/components/utils/BaseInput.d.ts +5 -0
  766. package/lib/esm/components/utils/BaseInput.js +2 -0
  767. package/lib/esm/components/utils/BaseOrderPrice.d.ts +6 -0
  768. package/lib/esm/components/utils/BaseOrderPrice.js +2 -0
  769. package/lib/esm/components/utils/BaseSelect.d.ts +5 -0
  770. package/lib/esm/components/utils/BaseSelect.js +2 -0
  771. package/lib/esm/components/utils/ErrorBoundary.d.ts +14 -0
  772. package/lib/esm/components/utils/ErrorBoundary.js +2 -0
  773. package/lib/esm/components/utils/GenericFieldComponent.d.ts +58 -0
  774. package/lib/esm/components/utils/GenericFieldComponent.js +2 -0
  775. package/lib/esm/components/utils/Parent.d.ts +6 -0
  776. package/lib/esm/components/utils/Parent.js +2 -0
  777. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +41 -0
  778. package/lib/esm/components/utils/PaymentCardsTemplate.js +2 -0
  779. package/lib/esm/components/utils/PriceTemplate.d.ts +8 -0
  780. package/lib/esm/components/utils/PriceTemplate.js +2 -0
  781. package/lib/esm/components/utils/getAllErrors.d.ts +16 -0
  782. package/lib/esm/components/utils/getAllErrors.js +2 -0
  783. package/lib/esm/config/currency.d.ts +5 -0
  784. package/lib/esm/config/currency.js +2 -0
  785. package/lib/esm/context/AddressChildrenContext.d.ts +6 -0
  786. package/lib/esm/context/AddressChildrenContext.js +2 -0
  787. package/lib/esm/context/AddressContext.d.ts +18 -0
  788. package/lib/esm/context/AddressContext.js +2 -0
  789. package/lib/esm/context/AvailabilityContext.d.ts +2 -0
  790. package/lib/esm/context/AvailabilityContext.js +2 -0
  791. package/lib/esm/context/BillingAddressContext.d.ts +9 -0
  792. package/lib/esm/context/BillingAddressContext.js +2 -0
  793. package/lib/esm/context/BillingAddressFormContext.d.ts +22 -0
  794. package/lib/esm/context/BillingAddressFormContext.js +2 -0
  795. package/lib/esm/context/CommerceLayerContext.d.ts +6 -0
  796. package/lib/esm/context/CommerceLayerContext.js +2 -0
  797. package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +8 -0
  798. package/lib/esm/context/CouponAndGiftCardFormContext.js +2 -0
  799. package/lib/esm/context/CustomerAddressFormContext.d.ts +17 -0
  800. package/lib/esm/context/CustomerAddressFormContext.js +2 -0
  801. package/lib/esm/context/CustomerContext.d.ts +29 -0
  802. package/lib/esm/context/CustomerContext.js +2 -0
  803. package/lib/esm/context/CustomerPaymentSourceContext.d.ts +11 -0
  804. package/lib/esm/context/CustomerPaymentSourceContext.js +2 -0
  805. package/lib/esm/context/ExternalFunctionContext.d.ts +11 -0
  806. package/lib/esm/context/ExternalFunctionContext.js +2 -0
  807. package/lib/esm/context/GiftCardContext.d.ts +10 -0
  808. package/lib/esm/context/GiftCardContext.js +2 -0
  809. package/lib/esm/context/InStockSubscriptionContext.d.ts +6 -0
  810. package/lib/esm/context/InStockSubscriptionContext.js +2 -0
  811. package/lib/esm/context/LineItemChildrenContext.d.ts +8 -0
  812. package/lib/esm/context/LineItemChildrenContext.js +2 -0
  813. package/lib/esm/context/LineItemContext.d.ts +7 -0
  814. package/lib/esm/context/LineItemContext.js +2 -0
  815. package/lib/esm/context/LineItemOptionChildrenContext.d.ts +9 -0
  816. package/lib/esm/context/LineItemOptionChildrenContext.js +2 -0
  817. package/lib/esm/context/OrderContext.d.ts +30 -0
  818. package/lib/esm/context/OrderContext.js +2 -0
  819. package/lib/esm/context/OrderListChildrenContext.d.ts +73 -0
  820. package/lib/esm/context/OrderListChildrenContext.js +2 -0
  821. package/lib/esm/context/OrderListPaginationContext.d.ts +15 -0
  822. package/lib/esm/context/OrderListPaginationContext.js +2 -0
  823. package/lib/esm/context/OrderStorageContext.d.ts +10 -0
  824. package/lib/esm/context/OrderStorageContext.js +2 -0
  825. package/lib/esm/context/ParcelChildrenContext.d.ts +6 -0
  826. package/lib/esm/context/ParcelChildrenContext.js +2 -0
  827. package/lib/esm/context/ParcelLineItemChildrenContext.d.ts +6 -0
  828. package/lib/esm/context/ParcelLineItemChildrenContext.js +2 -0
  829. package/lib/esm/context/PaymentMethodChildrenContext.d.ts +10 -0
  830. package/lib/esm/context/PaymentMethodChildrenContext.js +2 -0
  831. package/lib/esm/context/PaymentMethodContext.d.ts +13 -0
  832. package/lib/esm/context/PaymentMethodContext.js +2 -0
  833. package/lib/esm/context/PaymentSourceContext.d.ts +14 -0
  834. package/lib/esm/context/PaymentSourceContext.js +2 -0
  835. package/lib/esm/context/PlaceOrderContext.d.ts +12 -0
  836. package/lib/esm/context/PlaceOrderContext.js +2 -0
  837. package/lib/esm/context/PricesContext.d.ts +6 -0
  838. package/lib/esm/context/PricesContext.js +2 -0
  839. package/lib/esm/context/ShipmentChildrenContext.d.ts +13 -0
  840. package/lib/esm/context/ShipmentChildrenContext.js +2 -0
  841. package/lib/esm/context/ShipmentContext.d.ts +10 -0
  842. package/lib/esm/context/ShipmentContext.js +2 -0
  843. package/lib/esm/context/ShippingAddressContext.d.ts +9 -0
  844. package/lib/esm/context/ShippingAddressContext.js +2 -0
  845. package/lib/esm/context/ShippingAddressFormContext.d.ts +3 -0
  846. package/lib/esm/context/ShippingAddressFormContext.js +2 -0
  847. package/lib/esm/context/ShippingMethodChildrenContext.d.ts +9 -0
  848. package/lib/esm/context/ShippingMethodChildrenContext.js +2 -0
  849. package/lib/esm/context/SkuChildrenContext.d.ts +8 -0
  850. package/lib/esm/context/SkuChildrenContext.js +2 -0
  851. package/lib/esm/context/SkuContext.d.ts +8 -0
  852. package/lib/esm/context/SkuContext.js +2 -0
  853. package/lib/esm/context/SkuListsContext.d.ts +5 -0
  854. package/lib/esm/context/SkuListsContext.js +2 -0
  855. package/lib/esm/context/StockTransferChildrenContext.d.ts +6 -0
  856. package/lib/esm/context/StockTransferChildrenContext.js +2 -0
  857. package/lib/esm/hooks/useCommerceLayer.d.ts +12 -0
  858. package/lib/esm/hooks/useCommerceLayer.js +2 -0
  859. package/lib/esm/hooks/useCustomerContainer.d.ts +12 -0
  860. package/lib/esm/hooks/useCustomerContainer.js +2 -0
  861. package/lib/esm/hooks/useOrderContainer.d.ts +16 -0
  862. package/lib/esm/hooks/useOrderContainer.js +2 -0
  863. package/lib/esm/index.d.ts +107 -0
  864. package/lib/esm/index.js +2 -0
  865. package/lib/esm/reducers/AddressReducer.d.ts +80 -0
  866. package/lib/esm/reducers/AddressReducer.js +2 -0
  867. package/lib/esm/reducers/AvailabilityReducer.d.ts +53 -0
  868. package/lib/esm/reducers/AvailabilityReducer.js +2 -0
  869. package/lib/esm/reducers/BillingAddressReducer.d.ts +31 -0
  870. package/lib/esm/reducers/BillingAddressReducer.js +2 -0
  871. package/lib/esm/reducers/CustomerReducer.d.ts +183 -0
  872. package/lib/esm/reducers/CustomerReducer.js +2 -0
  873. package/lib/esm/reducers/GiftCardReducer.d.ts +66 -0
  874. package/lib/esm/reducers/GiftCardReducer.js +2 -0
  875. package/lib/esm/reducers/InStockSubscriptionReducer.d.ts +33 -0
  876. package/lib/esm/reducers/InStockSubscriptionReducer.js +2 -0
  877. package/lib/esm/reducers/LineItemReducer.d.ts +47 -0
  878. package/lib/esm/reducers/LineItemReducer.js +2 -0
  879. package/lib/esm/reducers/OrderReducer.d.ts +171 -0
  880. package/lib/esm/reducers/OrderReducer.js +2 -0
  881. package/lib/esm/reducers/PaymentMethodReducer.d.ts +161 -0
  882. package/lib/esm/reducers/PaymentMethodReducer.js +2 -0
  883. package/lib/esm/reducers/PlaceOrderReducer.d.ts +72 -0
  884. package/lib/esm/reducers/PlaceOrderReducer.js +2 -0
  885. package/lib/esm/reducers/PriceReducer.d.ts +35 -0
  886. package/lib/esm/reducers/PriceReducer.js +2 -0
  887. package/lib/esm/reducers/ShipmentReducer.d.ts +41 -0
  888. package/lib/esm/reducers/ShipmentReducer.js +2 -0
  889. package/lib/esm/reducers/ShippingAddressReducer.d.ts +32 -0
  890. package/lib/esm/reducers/ShippingAddressReducer.js +2 -0
  891. package/lib/esm/reducers/SkuListsReducer.d.ts +21 -0
  892. package/lib/esm/reducers/SkuListsReducer.js +2 -0
  893. package/lib/esm/reducers/SkuReducer.d.ts +21 -0
  894. package/lib/esm/reducers/SkuReducer.js +2 -0
  895. package/lib/esm/typings/errors.d.ts +15 -0
  896. package/lib/esm/typings/errors.js +2 -0
  897. package/lib/esm/typings/globals.d.ts +6 -0
  898. package/lib/esm/typings/globals.js +2 -0
  899. package/lib/esm/typings/index.d.ts +117 -0
  900. package/lib/esm/typings/index.js +2 -0
  901. package/lib/esm/utils/PropsType.d.ts +33 -0
  902. package/lib/esm/utils/PropsType.js +2 -0
  903. package/lib/esm/utils/addressesManager.d.ts +64 -0
  904. package/lib/esm/utils/addressesManager.js +2 -0
  905. package/lib/esm/utils/adyen/manageGiftCard.d.ts +16 -0
  906. package/lib/esm/utils/adyen/manageGiftCard.js +2 -0
  907. package/lib/esm/utils/baseReducer.d.ts +3 -0
  908. package/lib/esm/utils/baseReducer.js +2 -0
  909. package/lib/esm/utils/browserInfo.d.ts +12 -0
  910. package/lib/esm/utils/browserInfo.js +2 -0
  911. package/lib/esm/utils/canPlaceOrder.d.ts +5 -0
  912. package/lib/esm/utils/canPlaceOrder.js +2 -0
  913. package/lib/esm/utils/checkIncludeResource.d.ts +8 -0
  914. package/lib/esm/utils/checkIncludeResource.js +2 -0
  915. package/lib/esm/utils/compareObjAttribute.d.ts +7 -0
  916. package/lib/esm/utils/compareObjAttribute.js +2 -0
  917. package/lib/esm/utils/countryStateCity.d.ts +801 -0
  918. package/lib/esm/utils/countryStateCity.js +2 -0
  919. package/lib/esm/utils/customMessages.d.ts +2 -0
  920. package/lib/esm/utils/customMessages.js +2 -0
  921. package/lib/esm/utils/customerOrderOptions.d.ts +3 -0
  922. package/lib/esm/utils/customerOrderOptions.js +2 -0
  923. package/lib/esm/utils/events.d.ts +5 -0
  924. package/lib/esm/utils/events.js +2 -0
  925. package/lib/esm/utils/expressPaymentHelper.d.ts +92 -0
  926. package/lib/esm/utils/expressPaymentHelper.js +2 -0
  927. package/lib/esm/utils/filterChildren.d.ts +12 -0
  928. package/lib/esm/utils/filterChildren.js +2 -0
  929. package/lib/esm/utils/formCleaner.d.ts +4 -0
  930. package/lib/esm/utils/formCleaner.js +2 -0
  931. package/lib/esm/utils/getAmount.d.ts +7 -0
  932. package/lib/esm/utils/getAmount.js +2 -0
  933. package/lib/esm/utils/getApplicationLink.d.ts +35 -0
  934. package/lib/esm/utils/getApplicationLink.js +2 -0
  935. package/lib/esm/utils/getCardDetails.d.ts +16 -0
  936. package/lib/esm/utils/getCardDetails.js +2 -0
  937. package/lib/esm/utils/getCustomerIdByToken.d.ts +6 -0
  938. package/lib/esm/utils/getCustomerIdByToken.js +2 -0
  939. package/lib/esm/utils/getDomain.d.ts +4 -0
  940. package/lib/esm/utils/getDomain.js +2 -0
  941. package/lib/esm/utils/getErrors.d.ts +19 -0
  942. package/lib/esm/utils/getErrors.js +2 -0
  943. package/lib/esm/utils/getLineItemsCount.d.ts +10 -0
  944. package/lib/esm/utils/getLineItemsCount.js +2 -0
  945. package/lib/esm/utils/getLoaderComponent.d.ts +3 -0
  946. package/lib/esm/utils/getLoaderComponent.js +2 -0
  947. package/lib/esm/utils/getPaymentAttributes.d.ts +17 -0
  948. package/lib/esm/utils/getPaymentAttributes.js +2 -0
  949. package/lib/esm/utils/getPrices.d.ts +6 -0
  950. package/lib/esm/utils/getPrices.js +2 -0
  951. package/lib/esm/utils/getPublicIp.d.ts +1 -0
  952. package/lib/esm/utils/getPublicIp.js +2 -0
  953. package/lib/esm/utils/getSdk.d.ts +3 -0
  954. package/lib/esm/utils/getSdk.js +2 -0
  955. package/lib/esm/utils/getSkus.d.ts +3 -0
  956. package/lib/esm/utils/getSkus.js +2 -0
  957. package/lib/esm/utils/hasSubscriptions.d.ts +7 -0
  958. package/lib/esm/utils/hasSubscriptions.js +2 -0
  959. package/lib/esm/utils/hooks/useCustomContext.d.ts +21 -0
  960. package/lib/esm/utils/hooks/useCustomContext.js +2 -0
  961. package/lib/esm/utils/hooks/useExternalScript.d.ts +1 -0
  962. package/lib/esm/utils/hooks/useExternalScript.js +2 -0
  963. package/lib/esm/utils/icons.d.ts +2 -0
  964. package/lib/esm/utils/icons.js +2 -0
  965. package/lib/esm/utils/isDate.d.ts +1 -0
  966. package/lib/esm/utils/isDate.js +2 -0
  967. package/lib/esm/utils/isEmpty.d.ts +1 -0
  968. package/lib/esm/utils/isEmpty.js +2 -0
  969. package/lib/esm/utils/isGuestToken.d.ts +6 -0
  970. package/lib/esm/utils/isGuestToken.js +2 -0
  971. package/lib/esm/utils/isJSON.d.ts +1 -0
  972. package/lib/esm/utils/isJSON.js +2 -0
  973. package/lib/esm/utils/jwt.d.ts +27 -0
  974. package/lib/esm/utils/jwt.js +2 -0
  975. package/lib/esm/utils/localStorage.d.ts +11 -0
  976. package/lib/esm/utils/localStorage.js +2 -0
  977. package/lib/esm/utils/omit.d.ts +1 -0
  978. package/lib/esm/utils/omit.js +2 -0
  979. package/lib/esm/utils/organization.d.ts +18 -0
  980. package/lib/esm/utils/organization.js +2 -0
  981. package/lib/esm/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
  982. package/lib/esm/utils/payment-methods/sortPaymentMethods.js +2 -0
  983. package/lib/esm/utils/pick.d.ts +1 -0
  984. package/lib/esm/utils/pick.js +2 -0
  985. package/lib/esm/utils/placeholderImages.d.ts +2 -0
  986. package/lib/esm/utils/placeholderImages.js +2 -0
  987. package/lib/esm/utils/promisify.d.ts +1 -0
  988. package/lib/esm/utils/promisify.js +2 -0
  989. package/lib/esm/utils/replace.d.ts +2 -0
  990. package/lib/esm/utils/replace.js +2 -0
  991. package/lib/esm/utils/scrollbarWidth.d.ts +1 -0
  992. package/lib/esm/utils/scrollbarWidth.js +2 -0
  993. package/lib/esm/utils/shipments.d.ts +3 -0
  994. package/lib/esm/utils/shipments.js +2 -0
  995. package/lib/esm/utils/snakeToCamelCase.d.ts +5 -0
  996. package/lib/esm/utils/snakeToCamelCase.js +2 -0
  997. package/lib/esm/utils/stripe/retrievePaymentIntent.d.ts +14 -0
  998. package/lib/esm/utils/stripe/retrievePaymentIntent.js +2 -0
  999. package/lib/esm/utils/triggerAttributeHelper.d.ts +31 -0
  1000. package/lib/esm/utils/triggerAttributeHelper.js +2 -0
  1001. package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +8 -0
  1002. package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.js +2 -0
  1003. package/lib/esm/utils/validateFormFields.d.ts +16 -0
  1004. package/lib/esm/utils/validateFormFields.js +2 -0
  1005. package/lib/tsconfig.prod.esm.tsbuildinfo +1 -0
  1006. package/lib/tsconfig.prod.tsbuildinfo +1 -0
  1007. package/package.json +152 -13
  1008. package/lib/index.cjs +0 -3
  1009. package/lib/index.cjs.map +0 -1
  1010. package/lib/index.d.cts +0 -3266
  1011. package/lib/index.d.ts +0 -3266
  1012. package/lib/index.js +0 -3
  1013. package/lib/index.js.map +0 -1
@@ -0,0 +1,66 @@
1
+ import type { Customer, Market, GiftCardRecipient, GiftCardRecipientCreate, Order } from '@commercelayer/sdk';
2
+ import type { BaseMetadata } from '../typings/index';
3
+ import type { Dispatch } from 'react';
4
+ import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
5
+ import type { BaseError } from '../typings/errors';
6
+ import type { createOrder as makeOrder, getOrderContext } from './OrderReducer';
7
+ export type GiftCardActionType = 'setAvailability' | 'setGiftCardRecipient' | 'setGiftCardErrors' | 'setGiftCardLoading';
8
+ export interface GiftCardRecipientI {
9
+ email: string;
10
+ firstName?: string;
11
+ lastName?: string;
12
+ referenceOrigin?: string;
13
+ reference?: string;
14
+ metadata?: BaseMetadata;
15
+ customer?: Customer;
16
+ }
17
+ export interface GiftCardI {
18
+ currencyCode?: string;
19
+ balanceCent?: number;
20
+ balanceMaxCents?: number;
21
+ singleUse?: boolean;
22
+ rechargeable?: boolean;
23
+ imageUrl?: string;
24
+ expiresAt?: null | Date;
25
+ firstName?: string;
26
+ lastName?: string;
27
+ email?: string;
28
+ referenceOrigin?: string;
29
+ recipientEmail?: string;
30
+ reference?: string;
31
+ metadata?: BaseMetadata;
32
+ orderId?: string;
33
+ }
34
+ export interface GiftCardActionPayload extends GiftCardI {
35
+ market?: Market;
36
+ giftCardRecipient?: GiftCardRecipient;
37
+ errors?: BaseError[];
38
+ loading?: boolean;
39
+ }
40
+ export interface GiftCardState extends GiftCardActionPayload {
41
+ currencyCode: string;
42
+ balanceCent: number;
43
+ addGiftCardRecipient?: (values: GiftCardRecipientI & Record<string, any>) => void;
44
+ addGiftCard?: (values: GiftCardI & Record<string, any>) => void;
45
+ addGiftCardError?: (errors: BaseError[]) => void;
46
+ addGiftCardLoading?: (loading: boolean) => void;
47
+ }
48
+ export interface GiftCardAction {
49
+ type: GiftCardActionType;
50
+ payload: GiftCardActionPayload;
51
+ }
52
+ export declare const giftCardInitialState: GiftCardState;
53
+ export type AddGiftCardError = <V extends BaseError[]>(errors: V, dispatch: Dispatch<GiftCardAction>) => void;
54
+ export type AddGiftCardLoading = <V extends boolean>(loading: V, dispatch: Dispatch<GiftCardAction>) => void;
55
+ export declare function addGiftCardRecipient<V extends GiftCardRecipientCreate>(values: V, config: CommerceLayerConfig, dispatch: Dispatch<GiftCardAction>): Promise<void>;
56
+ export declare const addGiftCardLoading: AddGiftCardLoading;
57
+ export declare function addGiftCard<V extends GiftCardI>(values: V, { config, dispatch, getOrder, createOrder, order }: {
58
+ getOrder?: getOrderContext;
59
+ createOrder?: typeof makeOrder;
60
+ config: CommerceLayerConfig;
61
+ dispatch: Dispatch<GiftCardAction>;
62
+ order?: Order;
63
+ }): Promise<void>;
64
+ export declare const addGiftCardError: AddGiftCardError;
65
+ declare const giftCardReducer: (state: GiftCardState, reducer: GiftCardAction) => GiftCardState;
66
+ export default giftCardReducer;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addGiftCardError=exports.addGiftCardLoading=exports.giftCardInitialState=void 0,exports.addGiftCardRecipient=addGiftCardRecipient,exports.addGiftCard=addGiftCard;const tslib_1=require("tslib"),baseReducer_1=tslib_1.__importDefault(require("../utils/baseReducer")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),getErrors_1=tslib_1.__importDefault(require("../utils/getErrors")),getSdk_1=tslib_1.__importDefault(require("../utils/getSdk"));exports.giftCardInitialState={currencyCode:"",balanceCent:0,singleUse:!1,rechargeable:!0,loading:!1,expiresAt:null,errors:[]};function addGiftCardRecipient(values,config,dispatch){return tslib_1.__awaiter(this,void 0,void 0,function*(){try{const recipient=yield(0,getSdk_1.default)(config).gift_card_recipients.create(values);dispatch({type:"setGiftCardRecipient",payload:{giftCardRecipient:recipient}})}catch(error){console.error(error)}})}const addGiftCardLoading=(loading,dispatch)=>{dispatch({type:"setGiftCardLoading",payload:{loading}})};exports.addGiftCardLoading=addGiftCardLoading;function addGiftCard(values_1,_a){return tslib_1.__awaiter(this,arguments,void 0,function*(values,{config,dispatch,getOrder,createOrder,order}){var _b,_c;try{const sdk=(0,getSdk_1.default)(config);(0,exports.addGiftCardLoading)(!0,dispatch);const{firstName,lastName,email}=values,val=tslib_1.__rest(values,["firstName","lastName","email"]),giftCardValue=Object.assign({recipient_email:email},val),giftCard=yield sdk.gift_cards.create(giftCardValue,{include:["gift_card_recipient"]}),recipientValues={id:(_c=(_b=giftCard.gift_card_recipient)===null||_b===void 0?void 0:_b.id)!==null&&_c!==void 0?_c:""};if(firstName&&(recipientValues.first_name=firstName),lastName&&(recipientValues.last_name=lastName),(0,isEmpty_1.default)(recipientValues)||(yield sdk.gift_card_recipients.update(recipientValues)),createOrder&&getOrder){const id=order?order.id:yield createOrder({});if(id){const order2=sdk.orders.relationship(id),item=sdk.gift_cards.relationship(giftCard.id);yield sdk.line_items.create({quantity:1,order:order2,item}),yield getOrder(id)}}dispatch({type:"setGiftCardRecipient",payload:Object.assign({},giftCardValue)}),(0,exports.addGiftCardLoading)(!1,dispatch)}catch(error){const errors=(0,getErrors_1.default)({error,resource:"gift_cards"});dispatch({type:"setGiftCardErrors",payload:{errors}}),(0,exports.addGiftCardLoading)(!1,dispatch)}})}const addGiftCardError=(errors,dispatch)=>{dispatch({type:"setGiftCardErrors",payload:{errors}})};exports.addGiftCardError=addGiftCardError;const type=["setAvailability","setGiftCardRecipient","setGiftCardErrors","setGiftCardLoading"],giftCardReducer=(state,reducer)=>(0,baseReducer_1.default)(state,reducer,type);exports.default=giftCardReducer;
@@ -0,0 +1,33 @@
1
+ import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
2
+ import type { BaseAction } from '../typings/index';
3
+ import type { Dispatch } from 'react';
4
+ import type { BaseError } from '../typings/errors';
5
+ type InStockSubscriptionActionType = 'setErrors';
6
+ type InStockSubscriptionAction = BaseAction<InStockSubscriptionActionType, InStockSubscriptionState>;
7
+ export interface InStockSubscriptionState {
8
+ errors?: BaseError[];
9
+ }
10
+ export declare const inStockSubscriptionInitialState: InStockSubscriptionState;
11
+ interface TSetInStockSubscriptionParams {
12
+ /**
13
+ * Commerce Layer config
14
+ */
15
+ config?: CommerceLayerConfig;
16
+ /**
17
+ * Customer email
18
+ */
19
+ customerEmail?: string;
20
+ /**
21
+ * Sku code
22
+ */
23
+ skuCode: string;
24
+ /**
25
+ * Dispatch function
26
+ */
27
+ dispatch?: Dispatch<InStockSubscriptionAction>;
28
+ }
29
+ export declare function setInStockSubscription<T extends TSetInStockSubscriptionParams>({ config, customerEmail, skuCode, dispatch }: T): Promise<{
30
+ success: boolean;
31
+ }>;
32
+ export default function inStockSubscriptionReducer(state: InStockSubscriptionState, reducer: InStockSubscriptionAction): InStockSubscriptionState;
33
+ export {};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.inStockSubscriptionInitialState=void 0,exports.setInStockSubscription=setInStockSubscription,exports.default=inStockSubscriptionReducer;const tslib_1=require("tslib"),baseReducer_1=tslib_1.__importDefault(require("../utils/baseReducer")),getSdk_1=tslib_1.__importDefault(require("../utils/getSdk")),getErrors_1=tslib_1.__importDefault(require("../utils/getErrors")),actionType=["setErrors"];exports.inStockSubscriptionInitialState={errors:[]};function setInStockSubscription(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({config,customerEmail,skuCode,dispatch}){try{if(config==null)throw new Error("Access token and endpoint is required");const sdk=(0,getSdk_1.default)(config),attributes={sku_code:skuCode};return customerEmail!=null&&(attributes.customer_email=customerEmail),yield sdk.in_stock_subscriptions.create(attributes),{success:!0}}catch(error){const errors=(0,getErrors_1.default)({error,resource:"in_stock_subscriptions"});return dispatch?.({type:"setErrors",payload:{errors}}),{success:!1}}})}function inStockSubscriptionReducer(state,reducer){return(0,baseReducer_1.default)(state,reducer,actionType)}
@@ -0,0 +1,47 @@
1
+ import type { Dispatch } from 'react';
2
+ import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
3
+ import type { getOrderContext } from './OrderReducer';
4
+ import type { LoaderType } from '../typings/index';
5
+ import type { BaseError } from '../typings/errors';
6
+ import type { Order, LineItem } from '@commercelayer/sdk';
7
+ export interface UpdateLineItemParams {
8
+ lineItemId: string;
9
+ quantity?: number;
10
+ hasExternalPrice?: boolean;
11
+ dispatch: Dispatch<LineItemAction>;
12
+ config: CommerceLayerConfig;
13
+ getOrder: getOrderContext | undefined;
14
+ orderId: string;
15
+ errors: BaseError[] | undefined;
16
+ }
17
+ export type UpdateLineItem = (params: UpdateLineItemParams) => Promise<void>;
18
+ export type DeleteLineItemParam = Record<string, any> & UpdateLineItemParams;
19
+ export type DeleteLineItem = (params: DeleteLineItemParam) => Promise<void>;
20
+ export interface GetLineItemsParams {
21
+ dispatch: Dispatch<LineItemAction>;
22
+ config: CommerceLayerConfig;
23
+ order: Order | null;
24
+ filters: Record<string, any>;
25
+ }
26
+ export type GetLineItems = (params: GetLineItemsParams) => void;
27
+ export interface LineItemPayload {
28
+ loading?: boolean;
29
+ loader?: LoaderType;
30
+ lineItems?: LineItem[] | null;
31
+ errors?: BaseError[];
32
+ }
33
+ export interface LineItemState extends LineItemPayload {
34
+ updateLineItem?: (lineItemId: string, quantity?: number, hasExternalPrice?: boolean) => Promise<void>;
35
+ deleteLineItem?: (lineItemId: string) => Promise<void>;
36
+ }
37
+ export interface LineItemAction {
38
+ type: LineItemActionType;
39
+ payload: LineItemPayload;
40
+ }
41
+ export declare const getLineItems: GetLineItems;
42
+ export declare function updateLineItem(params: UpdateLineItemParams): Promise<void>;
43
+ export declare const deleteLineItem: DeleteLineItem;
44
+ export declare const lineItemInitialState: LineItemState;
45
+ export type LineItemActionType = 'setLineItems' | 'setErrors' | 'setLoading';
46
+ declare const lineItemReducer: (state: LineItemState, reducer: LineItemAction) => LineItemState;
47
+ export default lineItemReducer;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.lineItemInitialState=exports.deleteLineItem=exports.getLineItems=void 0,exports.updateLineItem=updateLineItem;const tslib_1=require("tslib"),baseReducer_1=tslib_1.__importDefault(require("../utils/baseReducer")),getSdk_1=tslib_1.__importDefault(require("../utils/getSdk")),getErrors_1=tslib_1.__importDefault(require("../utils/getErrors")),getLineItems=params=>{const{order,dispatch,config}=params,sdk=(0,getSdk_1.default)(config);let allLineItems=[];order&&sdk.orders.retrieve(order?.id,{include:["line_items","line_items.line_item_options.sku_option"],fields:{orders:["line_items"]}}).then(response=>{dispatch({type:"setLoading",payload:{loading:!1}});const items=response.line_items||[];allLineItems=[...allLineItems,...items],dispatch({type:"setLineItems",payload:{lineItems:allLineItems}})}).catch(error=>{const errors=(0,getErrors_1.default)({error,resource:"line_items"});dispatch({type:"setErrors",payload:{errors}})})};exports.getLineItems=getLineItems;function updateLineItem(params){return tslib_1.__awaiter(this,void 0,void 0,function*(){const{config,lineItemId,quantity,hasExternalPrice,getOrder,orderId,dispatch}=params,sdk=(0,getSdk_1.default)(config);try{yield sdk.line_items.update({id:lineItemId,quantity,_external_price:hasExternalPrice}),getOrder&&(yield getOrder(orderId)),dispatch({type:"setErrors",payload:{errors:[]}})}catch(error){const errors=(0,getErrors_1.default)({error,resource:"line_items",attributes:{id:lineItemId}});dispatch({type:"setErrors",payload:{errors}})}})}const deleteLineItem=params=>tslib_1.__awaiter(void 0,void 0,void 0,function*(){const{config,lineItemId,getOrder,orderId,dispatch}=params,sdk=(0,getSdk_1.default)(config);try{yield sdk.line_items.delete(lineItemId),getOrder&&(yield getOrder(orderId)),dispatch({type:"setErrors",payload:{errors:[]}})}catch(error){const errors=(0,getErrors_1.default)({error,resource:"line_items"});dispatch({type:"setErrors",payload:{errors}})}});exports.deleteLineItem=deleteLineItem,exports.lineItemInitialState={loading:!1,errors:[],lineItems:[]};const actionType=["setLineItems","setErrors","setLoading"],lineItemReducer=(state,reducer)=>(0,baseReducer_1.default)(state,reducer,actionType);exports.default=lineItemReducer;
@@ -0,0 +1,171 @@
1
+ import type { Dispatch } from "react";
2
+ import { type SetLocalOrder, type DeleteLocalOrder } from "../utils/localStorage";
3
+ import type { CommerceLayerConfig } from "../context/CommerceLayerContext";
4
+ import type { BaseMetadataObject } from "../typings/index";
5
+ import type { BaseError } from "../typings/errors";
6
+ import type { AddressResource } from "./AddressReducer";
7
+ import type { Order, OrderUpdate, CommerceLayerClient, ResourceUpdate, AdyenPaymentUpdate } from "@commercelayer/sdk";
8
+ import type { LooseAutocomplete } from "../typings/globals";
9
+ export type GetOrderParams = Partial<{
10
+ clearWhenPlaced: boolean;
11
+ config: CommerceLayerConfig;
12
+ deleteLocalOrder: DeleteLocalOrder;
13
+ dispatch: Dispatch<OrderActions>;
14
+ id: string;
15
+ persistKey: string;
16
+ state: OrderState;
17
+ }>;
18
+ export type GetOrder = (params: GetOrderParams) => Promise<undefined | Order>;
19
+ type CreateOrderParams = Pick<AddToCartParams, "config" | "dispatch" | "persistKey" | "state" | "orderMetadata" | "orderAttributes" | "setLocalOrder">;
20
+ export interface AddToCartImportParams extends Omit<AddToCartParams, "skuCode" | "skuId" | "quantity" | "option" | "lineItem"> {
21
+ lineItems: CustomLineItem[];
22
+ }
23
+ export type AddToCartReturn = Promise<{
24
+ success: boolean;
25
+ orderId: string | undefined;
26
+ }>;
27
+ export type AddToCartImport = (params: AddToCartImportParams) => AddToCartReturn;
28
+ export type UnsetOrderState = (dispatch: Dispatch<OrderActions>) => void;
29
+ export type ResourceIncluded = "billing_address" | "shipping_address" | "line_items.line_item_options.sku_option" | "line_items.item" | "available_customer_payment_sources.payment_source" | "available_customer_payment_sources.payment_method" | "shipments.available_shipping_methods" | "shipments.stock_transfers" | "shipments.stock_transfers.line_item" | "shipments.stock_line_items.line_item" | "shipments.shipping_method" | "shipments.stock_location" | "shipments.parcels" | "shipments.parcels.parcel_line_items" | "payment_source" | "available_payment_methods" | "payment_method";
30
+ type ResourceIncludedLoaded = Partial<Record<ResourceIncluded, boolean>>;
31
+ export interface OrderPayload {
32
+ loading?: boolean;
33
+ orderId?: string;
34
+ order?: Order;
35
+ errors?: BaseError[];
36
+ include?: ResourceIncluded[] | undefined;
37
+ includeLoaded?: ResourceIncludedLoaded;
38
+ withoutIncludes?: boolean;
39
+ manageAdyenGiftCard?: boolean;
40
+ }
41
+ export type AddToCartImportValues = Pick<AddToCartImportParams, "lineItems">;
42
+ export type getOrderContext = (id: string) => Promise<undefined | Order>;
43
+ export type OrderState = Partial<OrderPayload>;
44
+ export interface OrderActions {
45
+ type: OrderActionType;
46
+ payload: OrderPayload;
47
+ }
48
+ export type OrderActionType = "setLoading" | "setOrderId" | "setOrder" | "setSingleQuantity" | "setCurrentSkuCodes" | "setCurrentSkuPrices" | "setCurrentItem" | "setErrors" | "setSaveAddressToCustomerAddressBook" | "setGiftCardOrCouponCode" | "setIncludesResource";
49
+ export declare function createOrder(params: CreateOrderParams): Promise<string>;
50
+ export declare const getApiOrder: GetOrder;
51
+ export interface UpdateOrderArgs {
52
+ id: string;
53
+ attributes: Omit<OrderUpdate, "id">;
54
+ dispatch?: Dispatch<OrderActions>;
55
+ include?: string[];
56
+ config?: CommerceLayerConfig;
57
+ state?: OrderState;
58
+ }
59
+ export declare function updateOrder({ id, attributes, dispatch, config, include, state, }: UpdateOrderArgs): Promise<{
60
+ success: boolean;
61
+ error?: unknown;
62
+ order?: Order;
63
+ }>;
64
+ interface TResourceRequest {
65
+ resource: Extract<keyof CommerceLayerClient, "adyen_payments">;
66
+ requestType: "update";
67
+ attributes: TResourceRequest["resource"] extends "adyen_payments" ? AdyenPaymentUpdate : ResourceUpdate;
68
+ order: Order;
69
+ dispatch?: Dispatch<OrderActions>;
70
+ config?: CommerceLayerConfig;
71
+ state?: OrderState;
72
+ }
73
+ export declare function paymentSourceRequest({ resource, requestType, dispatch, attributes, config, order, state, }: TResourceRequest): Promise<{
74
+ success: boolean;
75
+ order?: Order;
76
+ }>;
77
+ export declare const setOrder: (order: Order, dispatch?: Dispatch<OrderActions>) => void;
78
+ export interface AddResourceToInclude {
79
+ resourcesIncluded?: ResourceIncluded[];
80
+ dispatch?: Dispatch<OrderActions>;
81
+ newResource?: ResourceIncluded | ResourceIncluded[];
82
+ resourceIncludedLoaded?: ResourceIncludedLoaded;
83
+ newResourceLoaded?: ResourceIncludedLoaded;
84
+ }
85
+ export declare function addResourceToInclude({ resourcesIncluded, dispatch, newResource, newResourceLoaded, resourceIncludedLoaded, }: AddResourceToInclude): void;
86
+ export interface LineItemOption {
87
+ /**
88
+ * SKU Option ID. Ex: mNJEgsJwBn
89
+ */
90
+ skuOptionId: string;
91
+ /**
92
+ * Set of key-value pairs that represent the selected options. Ex: { message: 'This is a option message' }
93
+ */
94
+ options: Record<string, string>;
95
+ quantity?: number;
96
+ }
97
+ type TFrequency = "hourly" | "daily" | "weekly" | "monthly" | "two-month" | "three-month" | "four-month" | "six-month" | "yearly";
98
+ export interface CustomLineItem {
99
+ name?: string;
100
+ imageUrl?: string | null;
101
+ metadata?: Record<string, string>;
102
+ frequency?: LooseAutocomplete<TFrequency>;
103
+ externalPrice?: boolean;
104
+ _update_quantity?: boolean;
105
+ }
106
+ export type AddToCartParams = Partial<{
107
+ bundleCode: string;
108
+ skuCode: string;
109
+ persistKey: string;
110
+ config: CommerceLayerConfig;
111
+ dispatch: Dispatch<OrderActions>;
112
+ state: Partial<OrderState>;
113
+ quantity: number;
114
+ lineItemOption: LineItemOption;
115
+ lineItem: CustomLineItem;
116
+ orderMetadata: BaseMetadataObject;
117
+ orderAttributes: Record<string, any>;
118
+ errors: BaseError[];
119
+ setLocalOrder: SetLocalOrder;
120
+ buyNowMode: boolean;
121
+ checkoutUrl: string;
122
+ openMiniCart: boolean;
123
+ }>;
124
+ export declare function addToCart(params: AddToCartParams): Promise<{
125
+ success: boolean;
126
+ orderId?: string;
127
+ }>;
128
+ export declare const unsetOrderState: UnsetOrderState;
129
+ interface OrderErrors {
130
+ dispatch?: Dispatch<OrderActions>;
131
+ errors: BaseError[];
132
+ }
133
+ export declare function setOrderErrors({ dispatch, errors }: OrderErrors): {
134
+ success: boolean;
135
+ };
136
+ export type SaveAddressToCustomerAddressBook = (params: {
137
+ dispatch?: Dispatch<OrderActions>;
138
+ type: AddressResource;
139
+ value: boolean;
140
+ }) => void;
141
+ export declare const saveAddressToCustomerAddressBook: SaveAddressToCustomerAddressBook;
142
+ interface TSetGiftCardOrCouponCodeParams {
143
+ code: string;
144
+ codeType: OrderCodeType;
145
+ dispatch?: Dispatch<OrderActions>;
146
+ config?: CommerceLayerConfig;
147
+ order?: Order;
148
+ include?: string[];
149
+ state?: OrderState;
150
+ }
151
+ export declare function setGiftCardOrCouponCode({ code, codeType, dispatch, config, order, include, state, }: TSetGiftCardOrCouponCodeParams): Promise<{
152
+ success: boolean;
153
+ order?: Order;
154
+ }>;
155
+ export type CodeType = "coupon" | "gift_card";
156
+ export type OrderCodeType = `${CodeType}_code`;
157
+ interface TRemoveGiftCardOrCouponCodeParams {
158
+ codeType: OrderCodeType;
159
+ dispatch?: Dispatch<OrderActions>;
160
+ config?: CommerceLayerConfig;
161
+ order?: Order;
162
+ include?: string[];
163
+ state?: OrderState;
164
+ }
165
+ export declare function removeGiftCardOrCouponCode({ codeType, dispatch, config, order, include, state, }: TRemoveGiftCardOrCouponCodeParams): Promise<{
166
+ success: boolean;
167
+ order?: Order;
168
+ }>;
169
+ export declare const orderInitialState: Partial<OrderState>;
170
+ declare const orderReducer: (state: OrderState, reducer: OrderActions) => OrderState;
171
+ export default orderReducer;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.orderInitialState=exports.saveAddressToCustomerAddressBook=exports.unsetOrderState=exports.setOrder=exports.getApiOrder=void 0,exports.createOrder=createOrder,exports.updateOrder=updateOrder,exports.paymentSourceRequest=paymentSourceRequest,exports.addResourceToInclude=addResourceToInclude,exports.addToCart=addToCart,exports.setOrderErrors=setOrderErrors,exports.setGiftCardOrCouponCode=setGiftCardOrCouponCode,exports.removeGiftCardOrCouponCode=removeGiftCardOrCouponCode;const tslib_1=require("tslib"),localStorage_1=require("../utils/localStorage"),baseReducer_1=tslib_1.__importDefault(require("../utils/baseReducer")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),getSdk_1=tslib_1.__importDefault(require("../utils/getSdk")),getErrors_1=tslib_1.__importStar(require("../utils/getErrors")),organization_1=require("../utils/organization"),events_1=require("../utils/events"),getDomain_1=require("../utils/getDomain"),getApplicationLink_1=require("../utils/getApplicationLink"),actionType=["setLoading","setOrderId","setOrder","setSingleQuantity","setCurrentSkuCodes","setCurrentSkuPrices","setErrors","setCurrentItem","setSaveAddressToCustomerAddressBook","setIncludesResource"];function createOrder(params){return tslib_1.__awaiter(this,void 0,void 0,function*(){if(params){const{persistKey,state,dispatch,config,orderMetadata:metadata,orderAttributes={},setLocalOrder}=params;if(state?.orderId)return state.orderId;const sdk=config!=null?(0,getSdk_1.default)(config):void 0;try{if(sdk==null)return"";const o=yield sdk?.orders.create(Object.assign({metadata},orderAttributes));return dispatch&&dispatch({type:"setOrderId",payload:{orderId:o?.id}}),persistKey&&setLocalOrder&&setLocalOrder(persistKey,o.id),o.id}catch(error){const errors=(0,getErrors_1.default)({error,resource:"orders"});console.error("Create order",errors),dispatch&&(0,getErrors_1.setErrors)({currentErrors:state?.errors,newErrors:errors,dispatch})}}return""})}const getApiOrder=params=>tslib_1.__awaiter(void 0,void 0,void 0,function*(){const{id,dispatch,config,clearWhenPlaced,persistKey,deleteLocalOrder,state}=params,sdk=config!=null?(0,getSdk_1.default)(config):void 0;try{if(sdk==null)return;const options={};state?.include&&state.include.length>0&&(options.include=state.include);const order=yield sdk.orders.retrieve(id??"",options);return clearWhenPlaced&&order.editable===!1?(persistKey&&deleteLocalOrder&&deleteLocalOrder(persistKey),dispatch&&dispatch({type:"setOrder",payload:{order:void 0,orderId:""}})):dispatch&&dispatch({type:"setOrder",payload:{order,orderId:order.id}}),order}catch(error){const errors=(0,getErrors_1.default)({error,resource:"orders"});console.error("Retrieve order",errors),dispatch&&(0,getErrors_1.setErrors)({currentErrors:state?.errors,newErrors:errors,dispatch});return}});exports.getApiOrder=getApiOrder;function updateOrder(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({id,attributes,dispatch,config,include,state}){const sdk=config!=null?(0,getSdk_1.default)(config):void 0;try{if(sdk==null)return{success:!1};const resource=Object.assign(Object.assign({},attributes),{id});yield sdk.orders.update(resource,{include});const order=yield(0,exports.getApiOrder)({id,config,dispatch,state});return dispatch&&order&&dispatch({type:"setOrder",payload:{order}}),{success:!0,order}}catch(error){const errors=(0,getErrors_1.default)({error,resource:"orders"});return dispatch&&(setOrderErrors({errors,dispatch}),dispatch({type:"setErrors",payload:{errors}})),{success:!1,error}}})}function paymentSourceRequest(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({resource,requestType,dispatch,attributes,config,order,state}){const sdk=config!=null?(0,getSdk_1.default)(config):void 0;try{if(sdk==null)return{success:!1};yield sdk[resource][requestType](attributes);const orderUpdated=yield updateOrder({id:order.id,attributes:{},config,include:state?.include,dispatch,state});return{success:!0,order:orderUpdated?.order}}catch(error){console.error("Resource request",error);const errors=(0,getErrors_1.default)({error,resource:"orders"});return console.error("Remove gift card o coupon code",errors),dispatch&&setOrderErrors({errors,dispatch}),{success:!1}}})}const setOrder=(order,dispatch)=>{dispatch&&dispatch({type:"setOrder",payload:{order}})};exports.setOrder=setOrder;function addResourceToInclude({resourcesIncluded=[],dispatch,newResource,newResourceLoaded,resourceIncludedLoaded}){const payload={include:void 0,includeLoaded:void 0};if(newResource){const resources=typeof newResource=="string"?[newResource]:newResource;payload.include=[...new Set([...resourcesIncluded,...resources])],resources.forEach(resource=>{const includeLoaded=Object.assign(Object.assign({},payload.includeLoaded),{[resource]:!0});payload.includeLoaded=includeLoaded})}else delete payload.include;const payloadIncludeLoaded=Object.assign(Object.assign(Object.assign({},resourceIncludedLoaded),newResourceLoaded),payload.includeLoaded&&payload.includeLoaded);payload.includeLoaded=payloadIncludeLoaded,dispatch&&dispatch({type:"setIncludesResource",payload:Object.assign(Object.assign({},payload),{withoutIncludes:!1})})}function addToCart(params){return tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b,_c,_d,_e,_f;const{skuCode,bundleCode,quantity,config,dispatch,lineItem,state,errors=[],buyNowMode,checkoutUrl,lineItemOption,openMiniCart=!0}=params;try{if(config){const sdk=(0,getSdk_1.default)(config),id=yield createOrder(params);if(id){const order=sdk.orders.relationship(id),name=lineItem?.name,imageUrl=lineItem?.imageUrl,metadata=lineItem?.metadata,frequency=lineItem?.frequency,externalPrice=lineItem?.externalPrice;if(buyNowMode)if(!((_a=state?.order)===null||_a===void 0)&&_a.line_items)yield Promise.all((_b=state?.order)===null||_b===void 0?void 0:_b.line_items.map(lineItem2=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield sdk.line_items.delete(lineItem2.id)})));else{const{line_items:lineItems}=yield sdk.orders.retrieve(id,{fields:["line_items"],include:["line_items"]});lineItems&&lineItems?.length>0&&(yield Promise.all(lineItems.map(lineItem2=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield sdk.line_items.delete(lineItem2.id)}))))}const attrs={order,sku_code:skuCode,name,image_url:imageUrl,quantity:quantity??1,_update_quantity:(_c=lineItem?._update_quantity)!==null&&_c!==void 0?_c:!0,bundle_code:bundleCode,metadata,frequency};externalPrice===!0&&(attrs._external_price=externalPrice);const newLineItem=yield sdk.line_items.create(attrs);if(lineItemOption!=null){const{skuOptionId,options,quantity:quantity2}=lineItemOption,skuOption=sdk.sku_options.relationship(skuOptionId),lineItemRel=sdk.line_items.relationship(newLineItem.id),lineItemOptionsAttributes={quantity:quantity2??1,options,sku_option:skuOption,line_item:lineItemRel};yield sdk.line_item_options.create(lineItemOptionsAttributes),yield(0,exports.getApiOrder)(Object.assign({id},params))}else yield(0,exports.getApiOrder)(Object.assign(Object.assign({id},params),{state}));if(!(0,isEmpty_1.default)(errors)&&dispatch&&dispatch({type:"setErrors",payload:{errors:[]}}),buyNowMode&&id&&config?.accessToken!=null&&config?.endpoint!=null){const params2=`${id}?accessToken=${(_d=config.accessToken)!==null&&_d!==void 0?_d:""}`,{domain,slug}=(0,getDomain_1.getDomain)(config.endpoint),href=(0,getApplicationLink_1.getApplicationLink)({slug,orderId:id,accessToken:config.accessToken,applicationType:"checkout",domain}),organizationConfig=yield(0,organization_1.getOrganizationConfig)({accessToken:config.accessToken,endpoint:config.endpoint,params:{accessToken:config.accessToken,orderId:order?.id,slug}}),redirectUrl=checkoutUrl?`${checkoutUrl}/${params2}`:(_f=(_e=organizationConfig?.links)===null||_e===void 0?void 0:_e.checkout)!==null&&_f!==void 0?_f:href;location.href=redirectUrl}else openMiniCart&&(0,events_1.publish)("open-cart");return{success:!0,orderId:id}}}return{success:!1}}catch(error){const errors2=(0,getErrors_1.default)({error,resource:"orders"});return console.error("Add to cart",errors2),dispatch&&(0,getErrors_1.setErrors)({currentErrors:state?.errors,newErrors:errors2,dispatch}),{success:!1}}})}const unsetOrderState=dispatch=>{dispatch({type:"setOrderId",payload:{orderId:""}}),dispatch({type:"setOrder",payload:{order:void 0}})};exports.unsetOrderState=unsetOrderState;function setOrderErrors({dispatch,errors=[]}){return dispatch&&dispatch({type:"setErrors",payload:{errors}}),{success:!1}}const saveAddressToCustomerAddressBook=({type,value,dispatch})=>{const k=`_save_${type}_to_customer_address_book`,v=`${value.toString()}`;(0,localStorage_1.setCustomerOrderParam)(k,v),dispatch&&dispatch({type:"setSaveAddressToCustomerAddressBook",payload:{[k]:v}})};exports.saveAddressToCustomerAddressBook=saveAddressToCustomerAddressBook;function setGiftCardOrCouponCode(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({code,codeType,dispatch,config,order,include,state}){try{if(config&&order&&code&&dispatch){const attributes={[codeType]:code},{success,order:currentOrder,error}=yield updateOrder({id:order.id,attributes,config,include,dispatch,state});if(!success)throw error;return dispatch({type:"setErrors",payload:{errors:[]}}),{success,order:currentOrder}}return{success:!1}}catch(error){const errors=(0,getErrors_1.default)({error,resource:"orders",field:codeType});return dispatch&&setOrderErrors({errors,dispatch}),{success:!1}}})}function removeGiftCardOrCouponCode(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({codeType,dispatch,config,order,include,state}){try{if(config&&order&&dispatch){const attributes={[codeType]:""},orderUpdated=yield updateOrder({id:order.id,attributes,config,include,dispatch,state});return dispatch({type:"setErrors",payload:{errors:[]}}),{success:!0,order:orderUpdated?.order}}return{success:!1}}catch(error){const errors=(0,getErrors_1.default)({error,resource:"orders",field:codeType});return console.error("Remove gift card o coupon code",errors),dispatch&&setOrderErrors({errors,dispatch}),{success:!1}}})}exports.orderInitialState={loading:!0,orderId:"",order:void 0,errors:[],include:void 0,withoutIncludes:!0};const orderReducer=(state,reducer)=>(0,baseReducer_1.default)(state,reducer,actionType);exports.default=orderReducer;
@@ -0,0 +1,161 @@
1
+ import type { AdyenPaymentConfig } from "../components/payment_source/AdyenPayment";
2
+ import type { BraintreeConfig } from "../components/payment_source/BraintreePayment";
3
+ import type { PaypalConfig } from "../components/payment_source/PaypalPayment";
4
+ import type { StripeConfig } from "../components/payment_source/StripePayment";
5
+ import type { WireTransferConfig } from "../components/payment_source/WireTransferPayment";
6
+ import type { CommerceLayerConfig } from "../context/CommerceLayerContext";
7
+ import type { getOrderContext, updateOrder } from "./OrderReducer";
8
+ import type { BaseError } from "../typings/errors";
9
+ import type { Order, PaymentMethod, StripePayment, WireTransfer, AdyenPayment, BraintreePayment, CheckoutComPayment, ExternalPayment, PaypalPayment, KlarnaPayment } from "@commercelayer/sdk";
10
+ import type { Dispatch, MutableRefObject } from "react";
11
+ import type { CheckoutComConfig } from "../components/payment_source/CheckoutComPayment";
12
+ import type { ExternalPaymentConfig } from "../components/payment_source/ExternalPayment";
13
+ import type { ResourceKeys } from "../utils/getPaymentAttributes";
14
+ export type PaymentSourceType = Order["payment_source"];
15
+ interface Card {
16
+ type: string;
17
+ brand: string;
18
+ last4: string;
19
+ exp_year: number;
20
+ exp_month: number;
21
+ }
22
+ export interface PaymentSourceObject {
23
+ adyen_payments: AdyenPayment & {
24
+ payment_request_data?: {
25
+ payment_method?: Card;
26
+ };
27
+ payment_response?: {
28
+ resultCode?: "Authorised";
29
+ };
30
+ };
31
+ braintree_payments: BraintreePayment & {
32
+ options?: {
33
+ card: Card;
34
+ };
35
+ };
36
+ external_payments: ExternalPayment & {
37
+ payment_source_token?: string;
38
+ };
39
+ paypal_payments: PaypalPayment;
40
+ stripe_payments: StripePayment & {
41
+ options?: {
42
+ card: Card;
43
+ };
44
+ payment_method?: {
45
+ card: Card;
46
+ type: string | "klarna" | "card";
47
+ };
48
+ };
49
+ wire_transfers: WireTransfer;
50
+ checkout_com_payments: CheckoutComPayment & {
51
+ payment_response: {
52
+ source?: Pick<Card, "last4"> & {
53
+ scheme: string;
54
+ expiry_year: number;
55
+ expiry_month: number;
56
+ };
57
+ };
58
+ };
59
+ klarna_payments: KlarnaPayment;
60
+ }
61
+ export type PaymentMethodActionType = "setErrors" | "setPaymentMethods" | "setPaymentMethodConfig" | "setPaymentSource" | "setPaymentRef" | "setLoading";
62
+ export type PaymentRef = MutableRefObject<null | HTMLFormElement>;
63
+ export interface PaymentMethodActionPayload {
64
+ errors: BaseError[];
65
+ paymentMethods: PaymentMethod[] | null;
66
+ currentPaymentMethodType: PaymentResource;
67
+ currentPaymentMethodId: string;
68
+ currentPaymentMethodRef: PaymentRef;
69
+ currentCustomerPaymentSourceId: string | null;
70
+ config: PaymentMethodConfig;
71
+ paymentSource: Order["payment_source"] | null;
72
+ loading: boolean;
73
+ }
74
+ export declare function setLoading({ loading, dispatch, }: {
75
+ loading: boolean;
76
+ dispatch?: Dispatch<PaymentMethodAction>;
77
+ }): void;
78
+ export type SetPaymentRef = (args: {
79
+ ref: PaymentRef;
80
+ dispatch?: Dispatch<PaymentMethodAction>;
81
+ }) => void;
82
+ export declare const setPaymentRef: SetPaymentRef;
83
+ export type PaymentMethodState = Partial<PaymentMethodActionPayload>;
84
+ export interface PaymentMethodAction {
85
+ type: PaymentMethodActionType;
86
+ payload: Partial<PaymentMethodActionPayload>;
87
+ }
88
+ export declare const paymentMethodInitialState: PaymentMethodState;
89
+ export type SetPaymentMethodErrors = <V extends BaseError[]>(errors: V, dispatch?: Dispatch<PaymentMethodAction>) => void;
90
+ export declare const setPaymentMethodErrors: SetPaymentMethodErrors;
91
+ type GetPaymentMethods = (args: {
92
+ order: Order;
93
+ dispatch: Dispatch<PaymentMethodAction>;
94
+ }) => Promise<void>;
95
+ export declare const getPaymentMethods: GetPaymentMethods;
96
+ export type PaymentResource = keyof PaymentSourceObject;
97
+ export type PaymentResourceKey = "braintreePayment" | "stripePayment" | "klarnaPayment" | "wireTransfer" | "paypalPayment" | "adyenPayment" | "checkoutComPayment";
98
+ export type SDKPaymentResource = "AdyenPayment" | "BraintreePayment" | "ExternalPayment" | "PaypalPayment" | "StripePayment" | "WireTransfer" | "CheckoutComPayment";
99
+ interface TSetPaymentMethodParams {
100
+ config?: CommerceLayerConfig;
101
+ dispatch?: Dispatch<PaymentMethodAction>;
102
+ updateOrder?: typeof updateOrder;
103
+ setOrderErrors?: (collection: any) => {
104
+ success: boolean;
105
+ };
106
+ order?: Order;
107
+ paymentMethodId: string;
108
+ paymentResource?: PaymentResource;
109
+ }
110
+ export declare function setPaymentMethod({ config, dispatch, order, paymentMethodId, updateOrder, setOrderErrors, paymentResource, }: TSetPaymentMethodParams): Promise<{
111
+ success: boolean;
112
+ order?: Order;
113
+ }>;
114
+ type PaymentSourceTypes = (StripePayment & WireTransfer) | (StripePayment | WireTransfer);
115
+ export type SetPaymentSourceResponse = {
116
+ order: Order;
117
+ paymentSource: PaymentSourceTypes;
118
+ } | null;
119
+ export interface SetPaymentSourceParams extends Omit<PaymentMethodState, "config"> {
120
+ config?: CommerceLayerConfig;
121
+ dispatch?: Dispatch<PaymentMethodAction>;
122
+ getOrder?: getOrderContext;
123
+ attributes?: Record<string, unknown>;
124
+ order?: Order;
125
+ paymentResource: PaymentResource;
126
+ paymentSourceId?: string;
127
+ customerPaymentSourceId?: string;
128
+ updateOrder?: typeof updateOrder;
129
+ }
130
+ export declare function setPaymentSource({ config, dispatch, getOrder, attributes, order, paymentResource, customerPaymentSourceId, paymentSourceId, updateOrder, errors: currentErrors, }: SetPaymentSourceParams): Promise<PaymentSourceType | undefined | null>;
131
+ export type UpdatePaymentSource = (args: {
132
+ id: string;
133
+ attributes: Record<string, any>;
134
+ paymentResource: PaymentResource;
135
+ config?: CommerceLayerConfig;
136
+ dispatch?: Dispatch<PaymentMethodAction>;
137
+ }) => Promise<void>;
138
+ export declare const updatePaymentSource: UpdatePaymentSource;
139
+ export type DestroyPaymentSource = (args: {
140
+ paymentSourceId: string;
141
+ paymentResource: PaymentResource;
142
+ dispatch?: Dispatch<PaymentMethodAction>;
143
+ updateOrder?: typeof updateOrder;
144
+ orderId?: string;
145
+ }) => Promise<void>;
146
+ export declare const destroyPaymentSource: DestroyPaymentSource;
147
+ export interface PaymentMethodConfig {
148
+ adyenPayment?: AdyenPaymentConfig;
149
+ braintreePayment?: BraintreeConfig;
150
+ checkoutComPayment?: CheckoutComConfig;
151
+ externalPayment?: ExternalPaymentConfig;
152
+ klarnaPayment?: Pick<AdyenPaymentConfig, "placeOrderCallback"> & Pick<StripeConfig, "containerClassName">;
153
+ paypalPayment?: PaypalConfig;
154
+ stripePayment?: StripeConfig;
155
+ wireTransfer?: Partial<WireTransferConfig>;
156
+ }
157
+ type SetPaymentMethodConfig = (config: PaymentMethodConfig, dispatch: Dispatch<PaymentMethodAction>) => void;
158
+ export declare const setPaymentMethodConfig: SetPaymentMethodConfig;
159
+ export declare function getPaymentConfig<R extends PaymentResource = PaymentResource, K extends PaymentMethodConfig = PaymentMethodConfig>(paymentResource: R, config: K): Pick<K, ResourceKeys<R>>;
160
+ declare const paymentMethodReducer: (state: PaymentMethodState, reducer: PaymentMethodAction) => PaymentMethodState;
161
+ export default paymentMethodReducer;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setPaymentMethodConfig=exports.destroyPaymentSource=exports.updatePaymentSource=exports.getPaymentMethods=exports.setPaymentMethodErrors=exports.paymentMethodInitialState=exports.setPaymentRef=void 0,exports.setLoading=setLoading,exports.setPaymentMethod=setPaymentMethod,exports.setPaymentSource=setPaymentSource,exports.getPaymentConfig=getPaymentConfig;const tslib_1=require("tslib"),baseReducer_1=tslib_1.__importDefault(require("../utils/baseReducer")),getErrors_1=tslib_1.__importStar(require("../utils/getErrors")),getSdk_1=tslib_1.__importDefault(require("../utils/getSdk")),snakeToCamelCase_1=require("../utils/snakeToCamelCase"),replace_1=require("../utils/replace"),pick_1=require("../utils/pick");function setLoading({loading,dispatch}){dispatch&&dispatch({type:"setLoading",payload:{loading}})}const setPaymentRef=({ref,dispatch})=>{ref&&dispatch&&dispatch({type:"setPaymentRef",payload:{currentPaymentMethodRef:ref}})};exports.setPaymentRef=setPaymentRef,exports.paymentMethodInitialState={errors:[],paymentMethods:void 0};const setPaymentMethodErrors=(errors,dispatch)=>{dispatch&&dispatch({type:"setErrors",payload:{errors}})};exports.setPaymentMethodErrors=setPaymentMethodErrors;const getPaymentMethods=_a=>tslib_1.__awaiter(void 0,[_a],void 0,function*({order,dispatch}){const paymentMethods=order.available_payment_methods,paymentMethod=order.payment_method,paymentSource=order.payment_source;dispatch({type:"setPaymentMethods",payload:{paymentMethods,currentPaymentMethodId:paymentMethod?.id,currentPaymentMethodType:paymentMethod?.payment_source_type,paymentSource}})});exports.getPaymentMethods=getPaymentMethods;function setPaymentMethod(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({config,dispatch,order,paymentMethodId,updateOrder,setOrderErrors,paymentResource}){let response={success:!1};try{if(config&&order&&dispatch&&paymentResource){localStorage.removeItem("_save_payment_source_to_customer_wallet");const attributes={payment_method:(0,getSdk_1.default)(config).payment_methods.relationship(paymentMethodId)};updateOrder!=null&&(response=yield updateOrder({id:order.id,attributes})),dispatch({type:"setPaymentMethods",payload:{currentPaymentMethodId:paymentMethodId,currentPaymentMethodType:paymentResource,errors:[]}}),setOrderErrors&&setOrderErrors([])}return response}catch(error){const errors=(0,getErrors_1.default)({error,resource:"orders",field:paymentResource});return console.error("Set payment method",errors),response}})}function setPaymentSource(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({config,dispatch,getOrder,attributes,order,paymentResource,customerPaymentSourceId,paymentSourceId,updateOrder,errors:currentErrors}){var _b;try{const isAlreadyPlaced=order?.status==="placed";if(config&&order&&!isAlreadyPlaced){let paymentSource;const sdk=(0,getSdk_1.default)(config);if(customerPaymentSourceId){if(updateOrder!=null){const{order:orderUpdated}=yield updateOrder({id:order.id,attributes:{_customer_payment_source_id:customerPaymentSourceId}});dispatch!=null&&orderUpdated!=null&&dispatch({type:"setPaymentSource",payload:{paymentSource:orderUpdated.payment_source,currentCustomerPaymentSourceId:(_b=orderUpdated.payment_source)===null||_b===void 0?void 0:_b.id}})}}else{if(paymentSourceId){const attrs=Object.assign({id:paymentSourceId},attributes);paymentSource=attributes!=null?yield sdk[paymentResource].update(attrs):yield sdk[paymentResource].retrieve(paymentSourceId)}else{const attrs=Object.assign(Object.assign({},attributes),{order:sdk.orders.relationship(order.id)});paymentSource=yield sdk[paymentResource].create(attrs)}return getOrder&&(yield getOrder(order.id)),dispatch&&dispatch({type:"setPaymentSource",payload:{paymentSource,errors:[],currentCustomerPaymentSourceId:null}}),paymentSource}}}catch(error){const errors=(0,getErrors_1.default)({error,resource:"payment_methods",field:paymentResource});if(errors!=null&&errors?.length>0){const[error2]=errors;if(error2?.status==="401"&&getOrder!=null&&order!=null){const currentOrder=yield getOrder(order?.id);currentOrder?.status!=null&&!["placed","approved"].includes(currentOrder.status)&&(console.error("Set payment source:",errors),(0,getErrors_1.setErrors)({currentErrors,newErrors:errors,dispatch}))}}else(0,getErrors_1.setErrors)({currentErrors,newErrors:errors,dispatch})}})}const updatePaymentSource=_a=>tslib_1.__awaiter(void 0,[_a],void 0,function*({id,attributes,config,dispatch,paymentResource}){if(config)try{const paymentSource=yield(0,getSdk_1.default)(config)[paymentResource].update(Object.assign({id},attributes));dispatch&&dispatch({type:"setPaymentSource",payload:{paymentSource}})}catch(err){console.error("Update payment source:",err)}});exports.updatePaymentSource=updatePaymentSource;const destroyPaymentSource=_a=>tslib_1.__awaiter(void 0,[_a],void 0,function*({paymentSourceId,paymentResource,dispatch}){paymentSourceId&&paymentResource&&dispatch&&dispatch({type:"setPaymentSource",payload:{paymentSource:void 0}})});exports.destroyPaymentSource=destroyPaymentSource;const setPaymentMethodConfig=(config,dispatch)=>{dispatch({type:"setPaymentMethodConfig",payload:{config}})};exports.setPaymentMethodConfig=setPaymentMethodConfig;function getPaymentConfig(paymentResource,config){const resourceKeys=(0,replace_1.replace)((0,replace_1.replace)(paymentResource,"payments","payment"),"transfers","transfer"),resource=(0,snakeToCamelCase_1.snakeToCamelCase)(resourceKeys);return(0,pick_1.pick)(config,[resource])}const type=["setErrors","setPaymentMethodConfig","setPaymentMethods","setPaymentSource","setPaymentRef","setLoading"],paymentMethodReducer=(state,reducer)=>(0,baseReducer_1.default)(state,reducer,type);exports.default=paymentMethodReducer;
@@ -0,0 +1,72 @@
1
+ import type { Dispatch, RefObject } from "react";
2
+ import type { CommerceLayerConfig } from "../context/CommerceLayerContext";
3
+ import type { BaseError } from "../typings/errors";
4
+ import type { Order } from "@commercelayer/sdk";
5
+ import type { PaymentResource, PaymentSourceType } from "./PaymentMethodReducer";
6
+ export type PlaceOrderActionType = "setErrors" | "setPlaceOrderPermitted" | "setButtonRef" | "setStatus";
7
+ export interface PlaceOrderOptions {
8
+ paypalPayerId?: string;
9
+ adyen?: {
10
+ MD?: string;
11
+ PaRes?: string;
12
+ redirectResult?: string;
13
+ };
14
+ checkoutCom?: {
15
+ session_id: string;
16
+ };
17
+ stripe?: {
18
+ /**
19
+ * @deprecated
20
+ * Use `paymentIntentClientSecret` instead
21
+ */
22
+ redirectStatus?: string;
23
+ paymentIntentClientSecret: string;
24
+ };
25
+ }
26
+ export interface PlaceOrderActionPayload {
27
+ errors: BaseError[];
28
+ isPermitted: boolean;
29
+ paymentType: PaymentResource;
30
+ paymentSecret: string;
31
+ paymentId: string;
32
+ paymentSource: PaymentSourceType;
33
+ options?: PlaceOrderOptions;
34
+ placeOrderButtonRef?: RefObject<HTMLButtonElement | null>;
35
+ status: "placing" | "standby";
36
+ }
37
+ export declare function setButtonRef(ref: RefObject<HTMLButtonElement | null>, dispatch: Dispatch<PlaceOrderAction>): void;
38
+ export type PlaceOrderState = Partial<PlaceOrderActionPayload>;
39
+ export interface PlaceOrderAction {
40
+ type: PlaceOrderActionType;
41
+ payload: Partial<PlaceOrderActionPayload>;
42
+ }
43
+ export declare const placeOrderInitialState: PlaceOrderState;
44
+ export declare function setPlaceOrderErrors<V extends BaseError[]>(errors: V, dispatch: Dispatch<PlaceOrderAction>): void;
45
+ interface TPlaceOrderPermittedParams {
46
+ config?: CommerceLayerConfig;
47
+ dispatch: Dispatch<PlaceOrderAction>;
48
+ order?: Order;
49
+ options?: PlaceOrderOptions;
50
+ }
51
+ export declare function placeOrderPermitted({ config, order, dispatch, options, }: TPlaceOrderPermittedParams): void;
52
+ interface TSetPlaceOrderParams {
53
+ config?: CommerceLayerConfig;
54
+ order?: Order;
55
+ state?: PlaceOrderState;
56
+ setOrderErrors?: (errors: BaseError[]) => void;
57
+ paymentSource?: PaymentSourceType;
58
+ include?: string[];
59
+ setOrder?: (order: Order) => void;
60
+ currentCustomerPaymentSourceId?: string | null;
61
+ }
62
+ export declare function setPlaceOrder({ state, order, config, setOrderErrors, paymentSource, setOrder, include, currentCustomerPaymentSourceId, }: TSetPlaceOrderParams): Promise<{
63
+ placed: boolean;
64
+ errors?: BaseError[];
65
+ order?: Order;
66
+ }>;
67
+ export declare function setPlaceOrderStatus({ status, dispatch, }: {
68
+ status: "placing" | "standby";
69
+ dispatch?: Dispatch<PlaceOrderAction>;
70
+ }): void;
71
+ declare const placeOrderReducer: (state: PlaceOrderState, reducer: PlaceOrderAction) => PlaceOrderState;
72
+ export default placeOrderReducer;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.placeOrderInitialState=void 0,exports.setButtonRef=setButtonRef,exports.setPlaceOrderErrors=setPlaceOrderErrors,exports.placeOrderPermitted=placeOrderPermitted,exports.setPlaceOrder=setPlaceOrder,exports.setPlaceOrderStatus=setPlaceOrderStatus;const tslib_1=require("tslib"),baseReducer_1=tslib_1.__importDefault(require("../utils/baseReducer")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),shipments_1=require("../utils/shipments"),customerOrderOptions_1=require("../utils/customerOrderOptions"),getSdk_1=tslib_1.__importDefault(require("../utils/getSdk")),getErrors_1=tslib_1.__importDefault(require("../utils/getErrors")),isGuestToken_1=require("../utils/isGuestToken"),localStorage_1=require("../utils/localStorage"),hasSubscriptions_1=require("../utils/hasSubscriptions"),updateOrderSubscriptionCustomerPaymentSource_1=require("../utils/updateOrderSubscriptionCustomerPaymentSource");function setButtonRef(ref,dispatch){ref?.current!=null&&dispatch({type:"setButtonRef",payload:{placeOrderButtonRef:ref}})}exports.placeOrderInitialState={errors:[],isPermitted:!1,status:"standby"};function setPlaceOrderErrors(errors,dispatch){dispatch&&dispatch({type:"setErrors",payload:{errors}})}function placeOrderPermitted({config,order,dispatch,options}){var _a;if(order&&config){let isPermitted=!0;order.privacy_url&&order.terms_url&&(isPermitted=localStorage.getItem("privacy-terms")==="true");const billingAddress=order.billing_address,shippingAddress=order.shipping_address,doNotShip=(0,shipments_1.isDoNotShip)(order.line_items),shipments=order.shipments,shipment=shipments&&(0,shipments_1.shipmentsFilled)(shipments),paymentMethod=order.payment_method,paymentSource=order.payment_source;order.total_amount_with_taxes_cents!==0&&(0,isEmpty_1.default)(paymentMethod?.id)&&(isPermitted=!1),(0,isEmpty_1.default)(billingAddress)&&(isPermitted=!1),(0,isEmpty_1.default)(shippingAddress)&&!doNotShip&&(isPermitted=!1),!(0,isEmpty_1.default)(shipments)&&!shipment&&(isPermitted=!1),paymentSource?.mismatched_amounts&&(isPermitted=!1),dispatch({type:"setPlaceOrderPermitted",payload:{isPermitted,paymentType:paymentMethod?.payment_source_type,paymentSecret:paymentSource?.client_secret,paymentId:(_a=paymentSource?.options)===null||_a===void 0?void 0:_a.id,paymentSource,options}})}}function setPlaceOrder(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({state,order,config,setOrderErrors,paymentSource,setOrder,include,currentCustomerPaymentSourceId}){var _b,_c,_d,_e,_f,_g,_h;const response={placed:!1};if(state&&config&&order){if(order?.status==="placed")return{placed:!0,order};const sdk=(0,getSdk_1.default)(config),{options,paymentType}=state;try{const lastOrderStatus=yield sdk.orders.retrieve(order.id);if(lastOrderStatus.status==="placed")return{placed:!0,order:lastOrderStatus};if(paymentType==="paypal_payments"&&paymentSource?.type==="paypal_payments"){if(!options?.paypalPayerId&&paymentSource?.approval_url)return window.location.href=paymentSource?.approval_url,response;yield sdk[paymentType].update({id:paymentSource.id,paypal_payer_id:options?.paypalPayerId})}if(paymentType==="checkout_com_payments"&&paymentSource&&(!((_b=options?.checkoutCom)===null||_b===void 0)&&_b.session_id)){const payment=yield sdk[paymentType].update({id:paymentSource.id,_details:!0,session_id:(_c=options?.checkoutCom)===null||_c===void 0?void 0:_c.session_id});if(((_d=payment?.payment_response)===null||_d===void 0?void 0:_d.status)!=="Authorized"){const[action]=((_e=payment?.payment_response)===null||_e===void 0?void 0:_e.actions)||[""];throw{errors:[{code:"PAYMENT_NOT_APPROVED_FOR_EXECUTION",message:action?.response_summary,resource:"orders",field:"checkout_com_payments"}]}}}const updateAttributes={id:order.id,_place:!0};if((0,customerOrderOptions_1.saveBillingAddress)()&&(yield sdk.orders.update({id:order.id,_save_billing_address_to_customer_address_book:!0})),(0,customerOrderOptions_1.saveShippingAddress)()&&(yield sdk.orders.update({id:order.id,_save_shipping_address_to_customer_address_book:!0})),paymentType==="stripe_payments"&&paymentSource!=null){const ps=paymentSource,currentUrl=window.location.href,returnUrl=(_f=ps?.options)===null||_f===void 0?void 0:_f.return_url;currentUrl!==returnUrl&&(yield sdk[paymentType].update({id:paymentSource.id,options:{return_url:currentUrl}}))}switch((0,hasSubscriptions_1.hasSubscriptions)(order)&&config?.accessToken!=null&&!(0,isGuestToken_1.isGuestToken)(config.accessToken)&&currentCustomerPaymentSourceId==null&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet","true"),paymentType){case"braintree_payments":{const total=(_g=order?.total_amount_cents)!==null&&_g!==void 0?_g:0;yield Promise.all([(0,customerOrderOptions_1.saveToWallet)()&&total>0&&sdk.orders.update({id:order.id,_save_payment_source_to_customer_wallet:!0})]);const orderUpdated=yield sdk.orders.update(updateAttributes,{include});return setOrder&&setOrder(orderUpdated),setOrderErrors&&setOrderErrors([]),(0,updateOrderSubscriptionCustomerPaymentSource_1.updateOrderSubscriptionCustomerPaymentSource)(orderUpdated,paymentType,sdk),{placed:!0,order:orderUpdated}}default:{const orderUpdated=yield sdk.orders.update(updateAttributes,{include}),total=(_h=orderUpdated?.total_amount_cents)!==null&&_h!==void 0?_h:0;return setOrder&&setOrder(orderUpdated),yield Promise.all([(0,customerOrderOptions_1.saveToWallet)()&&total>0&&sdk.orders.update({id:order.id,_save_payment_source_to_customer_wallet:!0}).catch(error=>{const errors=(0,getErrors_1.default)({error,resource:"orders",field:paymentType});setOrderErrors&&setOrderErrors(errors)})]).then(()=>{(0,updateOrderSubscriptionCustomerPaymentSource_1.updateOrderSubscriptionCustomerPaymentSource)(orderUpdated,paymentType,sdk)}),{placed:!0,order:orderUpdated}}}}catch(error){const errors=(0,getErrors_1.default)({error,resource:"orders",field:paymentType});return setOrderErrors&&setOrderErrors(errors),Object.assign(Object.assign({},response),{errors})}}return response})}function setPlaceOrderStatus({status,dispatch}){dispatch?.({type:"setStatus",payload:{status}})}const type=["setErrors","setPlaceOrderPermitted","setButtonRef","setStatus"],placeOrderReducer=(state,reducer)=>(0,baseReducer_1.default)(state,reducer,type);exports.default=placeOrderReducer;