@commercelayer/react-components 4.18.0 → 4.20.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 (343) hide show
  1. package/lib/cjs/components/ExternalFunction.d.ts +1 -1
  2. package/lib/cjs/components/MetadataInput.d.ts +1 -1
  3. package/lib/cjs/components/SubmitButton.d.ts +2 -2
  4. package/lib/cjs/components/addresses/Address.d.ts +1 -1
  5. package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +1 -1
  6. package/lib/cjs/components/addresses/AddressField.d.ts +2 -2
  7. package/lib/cjs/components/addresses/AddressInput.d.ts +1 -1
  8. package/lib/cjs/components/addresses/AddressInputSelect.d.ts +1 -1
  9. package/lib/cjs/components/addresses/AddressStateSelector.d.ts +1 -1
  10. package/lib/cjs/components/addresses/AddressesEmpty.d.ts +1 -1
  11. package/lib/cjs/components/addresses/BillingAddressForm.d.ts +1 -1
  12. package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +1 -1
  13. package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +1 -1
  14. package/lib/cjs/components/customers/CustomerContainer.d.ts +1 -1
  15. package/lib/cjs/components/customers/CustomerField.d.ts +1 -1
  16. package/lib/cjs/components/customers/CustomerInput.d.ts +1 -1
  17. package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +1 -1
  18. package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +1 -1
  19. package/lib/cjs/components/customers/MyAccountLink.d.ts +1 -1
  20. package/lib/cjs/components/customers/MyIdentityLink.d.ts +1 -1
  21. package/lib/cjs/components/customers/SaveCustomerButton.d.ts +1 -1
  22. package/lib/cjs/components/errors/Errors.d.ts +1 -1
  23. package/lib/cjs/components/gift_cards/GiftCard.d.ts +1 -1
  24. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -1
  25. package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +1 -1
  26. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +1 -1
  27. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -2
  28. package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +2 -2
  29. package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +2 -2
  30. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +1 -1
  31. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +1 -1
  32. package/lib/cjs/components/line_items/LineItemAmount.d.ts +1 -1
  33. package/lib/cjs/components/line_items/LineItemCode.d.ts +2 -2
  34. package/lib/cjs/components/line_items/LineItemField.d.ts +1 -1
  35. package/lib/cjs/components/line_items/LineItemImage.d.ts +2 -2
  36. package/lib/cjs/components/line_items/LineItemName.d.ts +1 -1
  37. package/lib/cjs/components/line_items/LineItemOption.d.ts +2 -2
  38. package/lib/cjs/components/line_items/LineItemQuantity.d.ts +2 -2
  39. package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +2 -2
  40. package/lib/cjs/components/line_items/LineItemsCount.d.ts +1 -1
  41. package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +1 -1
  42. package/lib/cjs/components/orders/AddToCartButton.d.ts +6 -6
  43. package/lib/cjs/components/orders/AddToCartButton.js +1 -1
  44. package/lib/cjs/components/orders/AdjustmentAmount.d.ts +1 -1
  45. package/lib/cjs/components/orders/CartLink.d.ts +1 -1
  46. package/lib/cjs/components/orders/CheckoutLink.d.ts +1 -1
  47. package/lib/cjs/components/orders/DiscountAmount.d.ts +1 -1
  48. package/lib/cjs/components/orders/GiftCardAmount.d.ts +1 -1
  49. package/lib/cjs/components/orders/OrderContainer.d.ts +1 -1
  50. package/lib/cjs/components/orders/OrderList.d.ts +1 -1
  51. package/lib/cjs/components/orders/OrderListEmpty.d.ts +1 -1
  52. package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +1 -1
  53. package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +1 -1
  54. package/lib/cjs/components/orders/OrderStorage.d.ts +1 -1
  55. package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +1 -1
  56. package/lib/cjs/components/orders/PlaceOrderButton.d.ts +6 -6
  57. package/lib/cjs/components/orders/PlaceOrderButton.js +1 -1
  58. package/lib/cjs/components/orders/ShippingAmount.d.ts +1 -1
  59. package/lib/cjs/components/orders/SubTotalAmount.d.ts +1 -1
  60. package/lib/cjs/components/orders/TaxesAmount.d.ts +1 -1
  61. package/lib/cjs/components/orders/TotalAmount.d.ts +1 -1
  62. package/lib/cjs/components/parcels/ParcelField.d.ts +1 -1
  63. package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +1 -1
  64. package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +1 -1
  65. package/lib/cjs/components/parcels/ParcelsCount.d.ts +1 -1
  66. package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +1 -1
  67. package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +1 -1
  68. package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
  69. package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +1 -1
  70. package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +1 -1
  71. package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +2 -2
  72. package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +1 -1
  73. package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +1 -1
  74. package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +1 -1
  75. package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +1 -1
  76. package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +1 -1
  77. package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
  78. package/lib/cjs/components/payment_source/AdyenPayment.d.ts +10 -74
  79. package/lib/cjs/components/payment_source/AdyenPayment.js +1 -1
  80. package/lib/cjs/components/payment_source/BraintreePayment.d.ts +2 -2
  81. package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +2 -2
  82. package/lib/cjs/components/payment_source/ExternalPayment.d.ts +2 -2
  83. package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +2 -2
  84. package/lib/cjs/components/payment_source/PaymentSource.d.ts +2 -2
  85. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +1 -1
  86. package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +1 -1
  87. package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
  88. package/lib/cjs/components/payment_source/StripePayment.d.ts +3 -3
  89. package/lib/cjs/components/prices/Price.d.ts +2 -2
  90. package/lib/cjs/components/prices/PricesContainer.d.ts +2 -2
  91. package/lib/cjs/components/shipments/ShipmentField.d.ts +1 -1
  92. package/lib/cjs/components/shipments/ShipmentsCount.d.ts +1 -1
  93. package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +1 -1
  94. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +1 -1
  95. package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +2 -2
  96. package/lib/cjs/components/skus/SkuField.d.ts +1 -1
  97. package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +1 -1
  98. package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +1 -1
  99. package/lib/cjs/components/utils/BaseInput.d.ts +1 -1
  100. package/lib/cjs/components/utils/BaseOrderPrice.d.ts +2 -2
  101. package/lib/cjs/components/utils/BaseSelect.d.ts +1 -1
  102. package/lib/cjs/components/utils/GenericFieldComponent.d.ts +6 -6
  103. package/lib/cjs/components/utils/Parent.d.ts +1 -1
  104. package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +3 -3
  105. package/lib/cjs/components/utils/PriceTemplate.d.ts +1 -1
  106. package/lib/cjs/components/utils/getAllErrors.d.ts +3 -3
  107. package/lib/cjs/context/AddressChildrenContext.d.ts +1 -1
  108. package/lib/cjs/context/AddressContext.d.ts +1 -1
  109. package/lib/cjs/context/BillingAddressContext.d.ts +1 -1
  110. package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +1 -1
  111. package/lib/cjs/context/CustomerAddressFormContext.d.ts +2 -2
  112. package/lib/cjs/context/CustomerContext.d.ts +1 -1
  113. package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +1 -1
  114. package/lib/cjs/context/GiftCardContext.d.ts +1 -1
  115. package/lib/cjs/context/InStockSubscriptionContext.d.ts +1 -1
  116. package/lib/cjs/context/LineItemChildrenContext.d.ts +1 -1
  117. package/lib/cjs/context/LineItemContext.d.ts +2 -2
  118. package/lib/cjs/context/OrderContext.d.ts +2 -2
  119. package/lib/cjs/context/OrderListChildrenContext.d.ts +3 -3
  120. package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +1 -1
  121. package/lib/cjs/context/ShippingAddressContext.d.ts +1 -1
  122. package/lib/cjs/context/ShippingAddressFormContext.d.ts +1 -1
  123. package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +1 -1
  124. package/lib/cjs/context/SkuChildrenContext.d.ts +1 -1
  125. package/lib/cjs/context/SkuContext.d.ts +1 -1
  126. package/lib/cjs/context/StockTransferChildrenContext.d.ts +1 -1
  127. package/lib/cjs/hooks/useCommerceLayer.d.ts +1 -1
  128. package/lib/cjs/hooks/useCustomerContainer.d.ts +1 -1
  129. package/lib/cjs/hooks/useOrderContainer.d.ts +1 -1
  130. package/lib/cjs/reducers/AddressReducer.d.ts +9 -9
  131. package/lib/cjs/reducers/AvailabilityReducer.d.ts +5 -5
  132. package/lib/cjs/reducers/BillingAddressReducer.d.ts +4 -4
  133. package/lib/cjs/reducers/CustomerReducer.d.ts +4 -4
  134. package/lib/cjs/reducers/GiftCardReducer.d.ts +6 -6
  135. package/lib/cjs/reducers/InStockSubscriptionReducer.d.ts +3 -3
  136. package/lib/cjs/reducers/LineItemReducer.d.ts +6 -6
  137. package/lib/cjs/reducers/OrderReducer.d.ts +6 -6
  138. package/lib/cjs/reducers/PaymentMethodReducer.d.ts +26 -26
  139. package/lib/cjs/reducers/PlaceOrderReducer.d.ts +11 -11
  140. package/lib/cjs/reducers/PriceReducer.d.ts +5 -5
  141. package/lib/cjs/reducers/ShipmentReducer.d.ts +5 -5
  142. package/lib/cjs/reducers/ShippingAddressReducer.d.ts +4 -4
  143. package/lib/cjs/reducers/SkuListsReducer.d.ts +2 -2
  144. package/lib/cjs/reducers/SkuReducer.d.ts +4 -4
  145. package/lib/cjs/typings/errors.d.ts +1 -1
  146. package/lib/cjs/typings/index.d.ts +2 -2
  147. package/lib/cjs/utils/addressesManager.d.ts +3 -3
  148. package/lib/cjs/utils/baseReducer.d.ts +1 -1
  149. package/lib/cjs/utils/canPlaceOrder.d.ts +1 -1
  150. package/lib/cjs/utils/checkIncludeResource.d.ts +1 -1
  151. package/lib/cjs/utils/customMessages.d.ts +1 -1
  152. package/lib/cjs/utils/expressPaymentHelper.d.ts +8 -8
  153. package/lib/cjs/utils/expressPaymentHelper.js +1 -1
  154. package/lib/cjs/utils/filterChildren.d.ts +1 -1
  155. package/lib/cjs/utils/formCleaner.d.ts +1 -1
  156. package/lib/cjs/utils/getCardDetails.d.ts +3 -3
  157. package/lib/cjs/utils/getErrors.d.ts +2 -2
  158. package/lib/cjs/utils/getLoaderComponent.d.ts +1 -1
  159. package/lib/cjs/utils/getPaymentAttributes.d.ts +2 -2
  160. package/lib/cjs/utils/getPrices.d.ts +1 -1
  161. package/lib/cjs/utils/getSdk.d.ts +1 -1
  162. package/lib/cjs/utils/getSkus.d.ts +1 -1
  163. package/lib/cjs/utils/hasSubscriptions.d.ts +1 -1
  164. package/lib/cjs/utils/organization.d.ts +4 -4
  165. package/lib/cjs/utils/organization.js +1 -1
  166. package/lib/cjs/utils/payment-methods/sortPaymentMethods.d.ts +2 -2
  167. package/lib/cjs/utils/shipments.d.ts +1 -1
  168. package/lib/cjs/utils/triggerAttributeHelper.d.ts +2 -2
  169. package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +2 -2
  170. package/lib/cjs/utils/validateFormFields.d.ts +5 -5
  171. package/lib/esm/components/ExternalFunction.d.ts +1 -1
  172. package/lib/esm/components/MetadataInput.d.ts +1 -1
  173. package/lib/esm/components/SubmitButton.d.ts +2 -2
  174. package/lib/esm/components/addresses/Address.d.ts +1 -1
  175. package/lib/esm/components/addresses/AddressCountrySelector.d.ts +1 -1
  176. package/lib/esm/components/addresses/AddressField.d.ts +2 -2
  177. package/lib/esm/components/addresses/AddressInput.d.ts +1 -1
  178. package/lib/esm/components/addresses/AddressInputSelect.d.ts +1 -1
  179. package/lib/esm/components/addresses/AddressStateSelector.d.ts +1 -1
  180. package/lib/esm/components/addresses/AddressesEmpty.d.ts +1 -1
  181. package/lib/esm/components/addresses/BillingAddressForm.d.ts +1 -1
  182. package/lib/esm/components/addresses/SaveAddressesButton.d.ts +1 -1
  183. package/lib/esm/components/addresses/ShippingAddressForm.d.ts +1 -1
  184. package/lib/esm/components/customers/CustomerContainer.d.ts +1 -1
  185. package/lib/esm/components/customers/CustomerField.d.ts +1 -1
  186. package/lib/esm/components/customers/CustomerInput.d.ts +1 -1
  187. package/lib/esm/components/customers/CustomerPaymentSource.d.ts +1 -1
  188. package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +1 -1
  189. package/lib/esm/components/customers/MyAccountLink.d.ts +1 -1
  190. package/lib/esm/components/customers/MyIdentityLink.d.ts +1 -1
  191. package/lib/esm/components/customers/SaveCustomerButton.d.ts +1 -1
  192. package/lib/esm/components/errors/Errors.d.ts +1 -1
  193. package/lib/esm/components/gift_cards/GiftCard.d.ts +1 -1
  194. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -1
  195. package/lib/esm/components/gift_cards/GiftCardInput.d.ts +1 -1
  196. package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +1 -1
  197. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -2
  198. package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +2 -2
  199. package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +2 -2
  200. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +1 -1
  201. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +1 -1
  202. package/lib/esm/components/line_items/LineItemAmount.d.ts +1 -1
  203. package/lib/esm/components/line_items/LineItemCode.d.ts +2 -2
  204. package/lib/esm/components/line_items/LineItemField.d.ts +1 -1
  205. package/lib/esm/components/line_items/LineItemImage.d.ts +2 -2
  206. package/lib/esm/components/line_items/LineItemName.d.ts +1 -1
  207. package/lib/esm/components/line_items/LineItemOption.d.ts +2 -2
  208. package/lib/esm/components/line_items/LineItemQuantity.d.ts +2 -2
  209. package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +2 -2
  210. package/lib/esm/components/line_items/LineItemsCount.d.ts +1 -1
  211. package/lib/esm/components/line_items/LineItemsEmpty.d.ts +1 -1
  212. package/lib/esm/components/orders/AddToCartButton.d.ts +6 -6
  213. package/lib/esm/components/orders/AddToCartButton.js +1 -1
  214. package/lib/esm/components/orders/AdjustmentAmount.d.ts +1 -1
  215. package/lib/esm/components/orders/CartLink.d.ts +1 -1
  216. package/lib/esm/components/orders/CheckoutLink.d.ts +1 -1
  217. package/lib/esm/components/orders/DiscountAmount.d.ts +1 -1
  218. package/lib/esm/components/orders/GiftCardAmount.d.ts +1 -1
  219. package/lib/esm/components/orders/OrderContainer.d.ts +1 -1
  220. package/lib/esm/components/orders/OrderList.d.ts +1 -1
  221. package/lib/esm/components/orders/OrderListEmpty.d.ts +1 -1
  222. package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +1 -1
  223. package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +1 -1
  224. package/lib/esm/components/orders/OrderStorage.d.ts +1 -1
  225. package/lib/esm/components/orders/PaymentMethodAmount.d.ts +1 -1
  226. package/lib/esm/components/orders/PlaceOrderButton.d.ts +6 -6
  227. package/lib/esm/components/orders/PlaceOrderButton.js +1 -1
  228. package/lib/esm/components/orders/ShippingAmount.d.ts +1 -1
  229. package/lib/esm/components/orders/SubTotalAmount.d.ts +1 -1
  230. package/lib/esm/components/orders/TaxesAmount.d.ts +1 -1
  231. package/lib/esm/components/orders/TotalAmount.d.ts +1 -1
  232. package/lib/esm/components/parcels/ParcelField.d.ts +1 -1
  233. package/lib/esm/components/parcels/ParcelLineItemField.d.ts +1 -1
  234. package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +1 -1
  235. package/lib/esm/components/parcels/ParcelsCount.d.ts +1 -1
  236. package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +1 -1
  237. package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +1 -1
  238. package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
  239. package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +1 -1
  240. package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +1 -1
  241. package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +2 -2
  242. package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +1 -1
  243. package/lib/esm/components/payment_gateways/StripeGateway.d.ts +1 -1
  244. package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +1 -1
  245. package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +1 -1
  246. package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +1 -1
  247. package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
  248. package/lib/esm/components/payment_source/AdyenPayment.d.ts +10 -74
  249. package/lib/esm/components/payment_source/AdyenPayment.js +1 -1
  250. package/lib/esm/components/payment_source/BraintreePayment.d.ts +2 -2
  251. package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +2 -2
  252. package/lib/esm/components/payment_source/ExternalPayment.d.ts +2 -2
  253. package/lib/esm/components/payment_source/KlarnaPayment.d.ts +2 -2
  254. package/lib/esm/components/payment_source/PaymentSource.d.ts +2 -2
  255. package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +1 -1
  256. package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +1 -1
  257. package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
  258. package/lib/esm/components/payment_source/StripePayment.d.ts +3 -3
  259. package/lib/esm/components/prices/Price.d.ts +2 -2
  260. package/lib/esm/components/prices/PricesContainer.d.ts +2 -2
  261. package/lib/esm/components/shipments/ShipmentField.d.ts +1 -1
  262. package/lib/esm/components/shipments/ShipmentsCount.d.ts +1 -1
  263. package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +1 -1
  264. package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +1 -1
  265. package/lib/esm/components/skus/AvailabilityTemplate.d.ts +2 -2
  266. package/lib/esm/components/skus/SkuField.d.ts +1 -1
  267. package/lib/esm/components/stock_transfers/StockTransferField.d.ts +1 -1
  268. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +1 -1
  269. package/lib/esm/components/utils/BaseInput.d.ts +1 -1
  270. package/lib/esm/components/utils/BaseOrderPrice.d.ts +2 -2
  271. package/lib/esm/components/utils/BaseSelect.d.ts +1 -1
  272. package/lib/esm/components/utils/GenericFieldComponent.d.ts +6 -6
  273. package/lib/esm/components/utils/Parent.d.ts +1 -1
  274. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +3 -3
  275. package/lib/esm/components/utils/PriceTemplate.d.ts +1 -1
  276. package/lib/esm/components/utils/getAllErrors.d.ts +3 -3
  277. package/lib/esm/context/AddressChildrenContext.d.ts +1 -1
  278. package/lib/esm/context/AddressContext.d.ts +1 -1
  279. package/lib/esm/context/BillingAddressContext.d.ts +1 -1
  280. package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +1 -1
  281. package/lib/esm/context/CustomerAddressFormContext.d.ts +2 -2
  282. package/lib/esm/context/CustomerContext.d.ts +1 -1
  283. package/lib/esm/context/CustomerPaymentSourceContext.d.ts +1 -1
  284. package/lib/esm/context/GiftCardContext.d.ts +1 -1
  285. package/lib/esm/context/InStockSubscriptionContext.d.ts +1 -1
  286. package/lib/esm/context/LineItemChildrenContext.d.ts +1 -1
  287. package/lib/esm/context/LineItemContext.d.ts +2 -2
  288. package/lib/esm/context/OrderContext.d.ts +2 -2
  289. package/lib/esm/context/OrderListChildrenContext.d.ts +3 -3
  290. package/lib/esm/context/PaymentMethodChildrenContext.d.ts +1 -1
  291. package/lib/esm/context/ShippingAddressContext.d.ts +1 -1
  292. package/lib/esm/context/ShippingAddressFormContext.d.ts +1 -1
  293. package/lib/esm/context/ShippingMethodChildrenContext.d.ts +1 -1
  294. package/lib/esm/context/SkuChildrenContext.d.ts +1 -1
  295. package/lib/esm/context/SkuContext.d.ts +1 -1
  296. package/lib/esm/context/StockTransferChildrenContext.d.ts +1 -1
  297. package/lib/esm/hooks/useCommerceLayer.d.ts +1 -1
  298. package/lib/esm/hooks/useCustomerContainer.d.ts +1 -1
  299. package/lib/esm/hooks/useOrderContainer.d.ts +1 -1
  300. package/lib/esm/reducers/AddressReducer.d.ts +9 -9
  301. package/lib/esm/reducers/AvailabilityReducer.d.ts +5 -5
  302. package/lib/esm/reducers/BillingAddressReducer.d.ts +4 -4
  303. package/lib/esm/reducers/CustomerReducer.d.ts +4 -4
  304. package/lib/esm/reducers/GiftCardReducer.d.ts +6 -6
  305. package/lib/esm/reducers/InStockSubscriptionReducer.d.ts +3 -3
  306. package/lib/esm/reducers/LineItemReducer.d.ts +6 -6
  307. package/lib/esm/reducers/OrderReducer.d.ts +6 -6
  308. package/lib/esm/reducers/PaymentMethodReducer.d.ts +26 -26
  309. package/lib/esm/reducers/PlaceOrderReducer.d.ts +11 -11
  310. package/lib/esm/reducers/PriceReducer.d.ts +5 -5
  311. package/lib/esm/reducers/ShipmentReducer.d.ts +5 -5
  312. package/lib/esm/reducers/ShippingAddressReducer.d.ts +4 -4
  313. package/lib/esm/reducers/SkuListsReducer.d.ts +2 -2
  314. package/lib/esm/reducers/SkuReducer.d.ts +4 -4
  315. package/lib/esm/typings/errors.d.ts +1 -1
  316. package/lib/esm/typings/index.d.ts +2 -2
  317. package/lib/esm/utils/addressesManager.d.ts +3 -3
  318. package/lib/esm/utils/baseReducer.d.ts +1 -1
  319. package/lib/esm/utils/canPlaceOrder.d.ts +1 -1
  320. package/lib/esm/utils/checkIncludeResource.d.ts +1 -1
  321. package/lib/esm/utils/customMessages.d.ts +1 -1
  322. package/lib/esm/utils/expressPaymentHelper.d.ts +8 -8
  323. package/lib/esm/utils/expressPaymentHelper.js +1 -1
  324. package/lib/esm/utils/filterChildren.d.ts +1 -1
  325. package/lib/esm/utils/formCleaner.d.ts +1 -1
  326. package/lib/esm/utils/getCardDetails.d.ts +3 -3
  327. package/lib/esm/utils/getErrors.d.ts +2 -2
  328. package/lib/esm/utils/getLoaderComponent.d.ts +1 -1
  329. package/lib/esm/utils/getPaymentAttributes.d.ts +2 -2
  330. package/lib/esm/utils/getPrices.d.ts +1 -1
  331. package/lib/esm/utils/getSdk.d.ts +1 -1
  332. package/lib/esm/utils/getSkus.d.ts +1 -1
  333. package/lib/esm/utils/hasSubscriptions.d.ts +1 -1
  334. package/lib/esm/utils/organization.d.ts +4 -4
  335. package/lib/esm/utils/organization.js +1 -1
  336. package/lib/esm/utils/payment-methods/sortPaymentMethods.d.ts +2 -2
  337. package/lib/esm/utils/shipments.d.ts +1 -1
  338. package/lib/esm/utils/triggerAttributeHelper.d.ts +2 -2
  339. package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +2 -2
  340. package/lib/esm/utils/validateFormFields.d.ts +5 -5
  341. package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
  342. package/lib/tsconfig.prod.tsbuildinfo +1 -1
  343. package/package.json +41 -21
@@ -1,7 +1,7 @@
1
- import { type CommerceLayerConfig } from '../context/CommerceLayerContext';
2
- import { type Order, type PaymentMethod, type QueryParamsRetrieve, type AddressCreate } from '@commercelayer/sdk';
3
- import { type PaymentRequestShippingOption } from '@stripe/stripe-js';
4
- import { type PaymentResource } from '../reducers/PaymentMethodReducer';
1
+ import type { CommerceLayerConfig } from "../context/CommerceLayerContext";
2
+ import type { Order, PaymentMethod, QueryParamsRetrieve, AddressCreate } from "@commercelayer/sdk";
3
+ import type { PaymentRequestShippingOption } from "@stripe/stripe-js";
4
+ import type { PaymentResource } from "../reducers/PaymentMethodReducer";
5
5
  export declare function getAvailableExpressPayments(paymentMethods: PaymentMethod[]): PaymentMethod[];
6
6
  interface TFakeAddressParams {
7
7
  /**
@@ -21,7 +21,7 @@ interface TFakeAddressParams {
21
21
  */
22
22
  email?: string;
23
23
  }
24
- export declare function setExpressFakeAddress({ orderId, config, address, email }: TFakeAddressParams): Promise<Order>;
24
+ export declare function setExpressFakeAddress({ orderId, config, address, email, }: TFakeAddressParams): Promise<Order>;
25
25
  export declare function getExpressShippingMethods(order: Order): PaymentRequestShippingOption[] | null;
26
26
  type TSetExpressShippingMethodParams = {
27
27
  /**
@@ -49,7 +49,7 @@ type TSetExpressShippingMethodParams = {
49
49
  selectFirst?: true;
50
50
  selectedShippingMethodId?: never;
51
51
  });
52
- export declare function setExpressShippingMethod({ config, orderId, selectFirst, selectedShippingMethodId, params }: TSetExpressShippingMethodParams): Promise<Order>;
52
+ export declare function setExpressShippingMethod({ config, orderId, selectFirst, selectedShippingMethodId, params, }: TSetExpressShippingMethodParams): Promise<Order>;
53
53
  export type TSetExpressPlaceOrderParams = {
54
54
  /**
55
55
  * The Commerce Layer config
@@ -77,7 +77,7 @@ export type TSetExpressPlaceOrderParams = {
77
77
  paymentSourceId?: never;
78
78
  placeTheOrder?: true;
79
79
  });
80
- export declare function setExpressPlaceOrder({ config, orderId, paymentResource, paymentSourceId, placeTheOrder }: TSetExpressPlaceOrderParams): Promise<Order>;
80
+ export declare function setExpressPlaceOrder({ config, orderId, paymentResource, paymentSourceId, placeTheOrder, }: TSetExpressPlaceOrderParams): Promise<Order>;
81
81
  interface TExpressRedirectUrlParams {
82
82
  /**
83
83
  * Order resource
@@ -88,5 +88,5 @@ interface TExpressRedirectUrlParams {
88
88
  */
89
89
  config: CommerceLayerConfig;
90
90
  }
91
- export declare function expressRedirectUrl({ order, config: { accessToken, endpoint } }: TExpressRedirectUrlParams): void;
91
+ export declare function expressRedirectUrl({ order, config: { accessToken, endpoint }, }: TExpressRedirectUrlParams): void;
92
92
  export {};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAvailableExpressPayments=getAvailableExpressPayments,exports.setExpressFakeAddress=setExpressFakeAddress,exports.getExpressShippingMethods=getExpressShippingMethods,exports.setExpressShippingMethod=setExpressShippingMethod,exports.setExpressPlaceOrder=setExpressPlaceOrder,exports.expressRedirectUrl=expressRedirectUrl;const tslib_1=require("tslib"),getSdk_1=tslib_1.__importDefault(require("./getSdk")),getDomain_1=require("./getDomain"),availablePaymentMethods=["stripe_payments"];function getAvailableExpressPayments(paymentMethods){return paymentMethods.filter(payment=>payment.payment_source_type?availablePaymentMethods.includes(payment.payment_source_type):!1)}function setExpressFakeAddress(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({orderId,config,address,email}){const params={include:["shipments.available_shipping_methods"]},sdk=(0,getSdk_1.default)(config),fakeAddress=yield sdk.addresses.create(address),resource={id:orderId,billing_address:sdk.addresses.relationship(fakeAddress.id),_shipping_address_same_as_billing:!0};return email!=null&&(resource.customer_email=email),yield sdk.orders.update(resource,params),yield sdk.orders.retrieve(orderId,params)})}function getExpressShippingMethods(order){var _a,_b;const isSingleShipment=((_a=order?.shipments)===null||_a===void 0?void 0:_a.length)===1,shippingMethods=(_b=order?.shipments)===null||_b===void 0?void 0:_b.map(shipment=>shipment.available_shipping_methods);if(isSingleShipment)return shippingMethods==null?null:shippingMethods.flat().map(method=>{var _a2,_b2,_c;return{id:(_a2=method?.id)!==null&&_a2!==void 0?_a2:"",label:(_b2=method?.name)!==null&&_b2!==void 0?_b2:"",amount:(_c=method?.price_amount_for_shipment_cents)!==null&&_c!==void 0?_c:0,detail:""}});{if(shippingMethods==null)return null;const shippingOptionsAmount=[];return shippingMethods.forEach(methods=>{var _a2;if(methods!=null){const[firstMethod]=methods;firstMethod!=null&&shippingOptionsAmount.push((_a2=firstMethod.price_amount_for_shipment_cents)!==null&&_a2!==void 0?_a2:0)}}),[{id:"shipping",label:"Shipping",amount:shippingOptionsAmount.reduce((a,b)=>a+b,0),detail:""}]}}function setExpressShippingMethod(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({config,orderId,selectFirst=!0,selectedShippingMethodId,params}){var _b,_c,_d;const sdk=(0,getSdk_1.default)(config),order=yield sdk.orders.retrieve(orderId,params),shippingMethods=getExpressShippingMethods(order);if(order?.shipments==null)throw new Error("No shipments found");const isSingleShipment=order.shipments.length===1,[shipmentId]=order.shipments.map(shipment=>shipment.id);if(shipmentId==null)throw new Error("No shipment found");if(shippingMethods==null||shippingMethods?.length===0)throw new Error("No shipping methods found");if(isSingleShipment)if(selectFirst){const[firstShippingMethodId]=shippingMethods.map(method=>method.id);firstShippingMethodId!=null&&(yield sdk.shipments.update({id:shipmentId,shipping_method:sdk.shipping_methods.relationship(firstShippingMethodId)}))}else selectedShippingMethodId!=null&&(yield sdk.shipments.update({id:shipmentId,shipping_method:sdk.shipping_methods.relationship(selectedShippingMethodId)}));else for(const shipment of(_b=order?.shipments)!==null&&_b!==void 0?_b:[]){const[firstShippingMethodId]=(_d=(_c=shipment?.available_shipping_methods)===null||_c===void 0?void 0:_c.map(method=>method.id))!==null&&_d!==void 0?_d:[];firstShippingMethodId!=null&&(yield sdk.shipments.update({id:shipment.id,shipping_method:sdk.shipping_methods.relationship(firstShippingMethodId)}))}return yield sdk.orders.retrieve(order.id,params)})}function setExpressPlaceOrder(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({config,orderId,paymentResource,paymentSourceId,placeTheOrder=!1}){const sdk=(0,getSdk_1.default)(config);if(!placeTheOrder&&paymentResource!=null&&paymentSourceId!=null){const include=["shipments.shipping_method","payment_source","payment_method"];return yield sdk.orders.retrieve(orderId,{include}),yield sdk[paymentResource].update({id:paymentSourceId,order:sdk.orders.relationship(orderId)}),yield sdk.orders.update({id:orderId,payment_source:sdk[paymentResource].relationship(paymentSourceId)}),yield sdk[paymentResource].update({id:paymentSourceId,_update:!0}),yield sdk.orders.retrieve(orderId,{include})}return yield sdk.orders.update({id:orderId,_place:!0})})}function expressRedirectUrl({order,config:{accessToken,endpoint}}){if(accessToken==null)throw new Error("No access token found");if(endpoint==null)throw new Error("No endpoint found");const{slug}=(0,getDomain_1.getDomain)(endpoint);if(slug==null)throw new Error("No slug found");const href=order?.checkout_url!=null?order?.checkout_url:`https://${slug}.commercelayer.app/checkout/${order.id}?accessToken=${accessToken}`;window.location.pathname.includes("/checkout")||window.location.pathname.includes(`/${order.id}`)?window.location.reload():window.location.href=href}
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAvailableExpressPayments=getAvailableExpressPayments,exports.setExpressFakeAddress=setExpressFakeAddress,exports.getExpressShippingMethods=getExpressShippingMethods,exports.setExpressShippingMethod=setExpressShippingMethod,exports.setExpressPlaceOrder=setExpressPlaceOrder,exports.expressRedirectUrl=expressRedirectUrl;const tslib_1=require("tslib"),getSdk_1=tslib_1.__importDefault(require("./getSdk")),getDomain_1=require("./getDomain"),availablePaymentMethods=["stripe_payments"];function getAvailableExpressPayments(paymentMethods){return paymentMethods.filter(payment=>payment.payment_source_type?availablePaymentMethods.includes(payment.payment_source_type):!1)}function setExpressFakeAddress(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({orderId,config,address,email}){const params={include:["shipments.available_shipping_methods"]},sdk=(0,getSdk_1.default)(config),fakeAddress=yield sdk.addresses.create(address),resource={id:orderId,billing_address:sdk.addresses.relationship(fakeAddress.id),_shipping_address_same_as_billing:!0};return email!=null&&(resource.customer_email=email),yield sdk.orders.update(resource,params),yield sdk.orders.retrieve(orderId,params)})}function getExpressShippingMethods(order){var _a,_b;const isSingleShipment=((_a=order?.shipments)===null||_a===void 0?void 0:_a.length)===1,shippingMethods=(_b=order?.shipments)===null||_b===void 0?void 0:_b.map(shipment=>shipment.available_shipping_methods);if(isSingleShipment)return shippingMethods==null?null:shippingMethods.flat().map(method=>{var _a2,_b2,_c;return{id:(_a2=method?.id)!==null&&_a2!==void 0?_a2:"",label:(_b2=method?.name)!==null&&_b2!==void 0?_b2:"",amount:(_c=method?.price_amount_for_shipment_cents)!==null&&_c!==void 0?_c:0,detail:""}});if(shippingMethods==null)return null;const shippingOptionsAmount=[];return shippingMethods.forEach(methods=>{var _a2;if(methods!=null){const[firstMethod]=methods;firstMethod!=null&&shippingOptionsAmount.push((_a2=firstMethod.price_amount_for_shipment_cents)!==null&&_a2!==void 0?_a2:0)}}),[{id:"shipping",label:"Shipping",amount:shippingOptionsAmount.reduce((a,b)=>a+b,0),detail:""}]}function setExpressShippingMethod(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({config,orderId,selectFirst=!0,selectedShippingMethodId,params}){var _b,_c,_d;const sdk=(0,getSdk_1.default)(config),order=yield sdk.orders.retrieve(orderId,params),shippingMethods=getExpressShippingMethods(order);if(order?.shipments==null)throw new Error("No shipments found");const isSingleShipment=order.shipments.length===1,[shipmentId]=order.shipments.map(shipment=>shipment.id);if(shipmentId==null)throw new Error("No shipment found");if(shippingMethods==null||shippingMethods?.length===0)throw new Error("No shipping methods found");if(isSingleShipment)if(selectFirst){const[firstShippingMethodId]=shippingMethods.map(method=>method.id);firstShippingMethodId!=null&&(yield sdk.shipments.update({id:shipmentId,shipping_method:sdk.shipping_methods.relationship(firstShippingMethodId)}))}else selectedShippingMethodId!=null&&(yield sdk.shipments.update({id:shipmentId,shipping_method:sdk.shipping_methods.relationship(selectedShippingMethodId)}));else for(const shipment of(_b=order?.shipments)!==null&&_b!==void 0?_b:[]){const[firstShippingMethodId]=(_d=(_c=shipment?.available_shipping_methods)===null||_c===void 0?void 0:_c.map(method=>method.id))!==null&&_d!==void 0?_d:[];firstShippingMethodId!=null&&(yield sdk.shipments.update({id:shipment.id,shipping_method:sdk.shipping_methods.relationship(firstShippingMethodId)}))}return yield sdk.orders.retrieve(order.id,params)})}function setExpressPlaceOrder(_a){return tslib_1.__awaiter(this,arguments,void 0,function*({config,orderId,paymentResource,paymentSourceId,placeTheOrder=!1}){const sdk=(0,getSdk_1.default)(config);if(!placeTheOrder&&paymentResource!=null&&paymentSourceId!=null){const include=["shipments.shipping_method","payment_source","payment_method"];return yield sdk.orders.retrieve(orderId,{include}),yield sdk[paymentResource].update({id:paymentSourceId,order:sdk.orders.relationship(orderId)}),yield sdk.orders.update({id:orderId,payment_source:sdk[paymentResource].relationship(paymentSourceId)}),yield sdk[paymentResource].update({id:paymentSourceId,_update:!0}),yield sdk.orders.retrieve(orderId,{include})}return yield sdk.orders.update({id:orderId,_place:!0})})}function expressRedirectUrl({order,config:{accessToken,endpoint}}){if(accessToken==null)throw new Error("No access token found");if(endpoint==null)throw new Error("No endpoint found");const{slug}=(0,getDomain_1.getDomain)(endpoint);if(slug==null)throw new Error("No slug found");const href=order?.checkout_url!=null?order?.checkout_url:`https://${slug}.commercelayer.app/checkout/${order.id}?accessToken=${accessToken}`;!window.location.pathname.includes("/cart")?window.location.reload():window.top!=null&&(window.top.location.href=href)}
@@ -1,4 +1,4 @@
1
- import { type DefaultChildrenType } from '../typings/globals';
1
+ import type { DefaultChildrenType } from '../typings/globals';
2
2
  import type { JSX } from "react";
3
3
  interface Props<T> {
4
4
  children: DefaultChildrenType;
@@ -1,4 +1,4 @@
1
- import { type TCustomerAddress } from '../reducers/CustomerReducer';
1
+ import type { TCustomerAddress } from '../reducers/CustomerReducer';
2
2
  type CombinedAddressType = TCustomerAddress | undefined;
3
3
  export declare function formCleaner(address: CombinedAddressType): CombinedAddressType;
4
4
  export {};
@@ -1,6 +1,6 @@
1
- import { type IconBrand } from '../context/PaymentSourceContext';
2
- import { type PaymentResource } from '../reducers/PaymentMethodReducer';
3
- import { type CustomerPaymentSource } from '@commercelayer/sdk';
1
+ import type { IconBrand } from '../context/PaymentSourceContext';
2
+ import type { PaymentResource } from '../reducers/PaymentMethodReducer';
3
+ import type { CustomerPaymentSource } from '@commercelayer/sdk';
4
4
  interface CardDetails {
5
5
  brand: IconBrand | string;
6
6
  last4: string;
@@ -1,7 +1,7 @@
1
- import { type TResourceError } from '../components/errors/Errors';
1
+ import type { TResourceError } from '../components/errors/Errors';
2
2
  import type { BaseError, TAPIError } from '../typings/errors';
3
3
  import type { ValueIteratee } from 'lodash';
4
- import { type Dispatch } from 'react';
4
+ import type { Dispatch } from 'react';
5
5
  interface GetErrorsParams {
6
6
  error: TAPIError;
7
7
  resource: TResourceError;
@@ -1,3 +1,3 @@
1
- import { type LoaderType } from '../typings/index';
1
+ import type { LoaderType } from '../typings/index';
2
2
  import type { JSX } from "react";
3
3
  export default function getLoaderComponent(loader: LoaderType): JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import type { PaypalConfig } from '../components/payment_source/PaypalPayment';
2
2
  import { type PaymentMethodConfig, type PaymentResource } from '../reducers/PaymentMethodReducer';
3
- import { type ExternalPayment } from '@commercelayer/sdk';
3
+ import type { ExternalPayment } from '@commercelayer/sdk';
4
4
  import { type StringReplace } from './replace';
5
5
  import { type SnakeToCamelCase } from './snakeToCamelCase';
6
- import { type StripeConfig } from '../components/payment_source/StripePayment';
6
+ import type { StripeConfig } from '../components/payment_source/StripePayment';
7
7
  interface Params<R extends PaymentResource, C extends PaymentMethodConfig> {
8
8
  resource: R;
9
9
  config: C;
@@ -1,4 +1,4 @@
1
- import { type Price } from '@commercelayer/sdk';
1
+ import type { Price } from '@commercelayer/sdk';
2
2
  import { type PTemplateProps } from '../components/utils/PriceTemplate';
3
3
  import type { JSX } from "react";
4
4
  export declare function getPriceByCode(skuPrices: Price[], code?: string): Price | undefined;
@@ -1,3 +1,3 @@
1
1
  import Sdk from '@commercelayer/sdk';
2
- import { type CommerceLayerConfig } from '../context/CommerceLayerContext';
2
+ import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
3
3
  export default function getSdk({ endpoint, accessToken }: CommerceLayerConfig): ReturnType<typeof Sdk>;
@@ -1,3 +1,3 @@
1
- import { type Sku } from '@commercelayer/sdk';
1
+ import type { Sku } from '@commercelayer/sdk';
2
2
  declare const getSkus: (skus: Sku[], sortBy: string[]) => Record<string, any>;
3
3
  export default getSkus;
@@ -1,4 +1,4 @@
1
- import { type Order } from '@commercelayer/sdk';
1
+ import type { Order } from '@commercelayer/sdk';
2
2
  /**
3
3
  * Check if a given `order` has subscriptions by checking the `frequency` attribute of the `line_items` (in case of brand new `order_subscription`) or the `subscription_created_at` attribute of the `order` itself (in case `order_subscription` is already existing)
4
4
  * @param order Order
@@ -1,4 +1,4 @@
1
- import { type DefaultConfig, getConfig } from '@commercelayer/organization-config';
1
+ import { type DefaultMfeConfig, getMfeConfig } from '@commercelayer/organization-config';
2
2
  interface ReturnObj {
3
3
  organization: string;
4
4
  domain: string;
@@ -7,12 +7,12 @@ export declare function getOrganizationSlug<E extends string>(endpoint: E): Retu
7
7
  export interface OrganizationConfig {
8
8
  accessToken: string;
9
9
  endpoint: string;
10
- params: Parameters<typeof getConfig>[0]['params'];
10
+ params: Parameters<typeof getMfeConfig>[0]['params'];
11
11
  }
12
12
  /**
13
13
  * Get organization config from Commerce Layer
14
14
  *
15
15
  */
16
- export declare function getOrganizationConfig(config: OrganizationConfig): Promise<DefaultConfig | null>;
17
- export declare function useOrganizationConfig({ accessToken, endpoint, params }: Partial<OrganizationConfig>): DefaultConfig | null;
16
+ export declare function getOrganizationConfig(config: OrganizationConfig): Promise<DefaultMfeConfig | null>;
17
+ export declare function useOrganizationConfig({ accessToken, endpoint, params }: Partial<OrganizationConfig>): DefaultMfeConfig | null;
18
18
  export {};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getOrganizationSlug=getOrganizationSlug,exports.getOrganizationConfig=getOrganizationConfig,exports.useOrganizationConfig=useOrganizationConfig;const tslib_1=require("tslib"),react_1=require("react"),getDomain_1=require("./getDomain"),getSdk_1=tslib_1.__importDefault(require("./getSdk")),organization_config_1=require("@commercelayer/organization-config"),jwt_1=require("./jwt");function getOrganizationSlug(endpoint){const org={organization:"",domain:"commercelayer.io"},{domain,slug}=(0,getDomain_1.getDomain)(endpoint);return{organization:slug,domain:domain||org.domain}}function getOrganizationConfig(config){return tslib_1.__awaiter(this,void 0,void 0,function*(){var _a;const{market}=(0,jwt_1.jwt)(config.accessToken),organization=yield(0,getSdk_1.default)(config).organization.retrieve({fields:{organizations:["id","config"]}});return(0,organization_config_1.getConfig)({jsonConfig:(_a=organization.config)!==null&&_a!==void 0?_a:{},market:`market:id:${market.id.join(",")}`,params:config.params})})}function useOrganizationConfig({accessToken,endpoint,params}){const[organizationConfig,setOrganizationConfig]=(0,react_1.useState)(null);return(0,react_1.useEffect)(()=>{accessToken==null||endpoint==null||getOrganizationConfig({accessToken,endpoint,params}).then(config=>{setOrganizationConfig(config)})},[accessToken,endpoint]),organizationConfig}
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getOrganizationSlug=getOrganizationSlug,exports.getOrganizationConfig=getOrganizationConfig,exports.useOrganizationConfig=useOrganizationConfig;const tslib_1=require("tslib"),react_1=require("react"),getDomain_1=require("./getDomain"),getSdk_1=tslib_1.__importDefault(require("./getSdk")),organization_config_1=require("@commercelayer/organization-config"),jwt_1=require("./jwt");function getOrganizationSlug(endpoint){const org={organization:"",domain:"commercelayer.io"},{domain,slug}=(0,getDomain_1.getDomain)(endpoint);return{organization:slug,domain:domain||org.domain}}function getOrganizationConfig(config){return tslib_1.__awaiter(this,void 0,void 0,function*(){var _a;const{market}=(0,jwt_1.jwt)(config.accessToken),organization=yield(0,getSdk_1.default)(config).organization.retrieve({fields:{organizations:["id","config"]}});return(0,organization_config_1.getMfeConfig)({jsonConfig:(_a=organization.config)!==null&&_a!==void 0?_a:{},market:`market:id:${market.id.join(",")}`,params:config.params})})}function useOrganizationConfig({accessToken,endpoint,params}){const[organizationConfig,setOrganizationConfig]=(0,react_1.useState)(null);return(0,react_1.useEffect)(()=>{accessToken==null||endpoint==null||getOrganizationConfig({accessToken,endpoint,params}).then(config=>{setOrganizationConfig(config)})},[accessToken,endpoint]),organizationConfig}
@@ -1,2 +1,2 @@
1
- import { type PaymentMethod } from '@commercelayer/sdk';
2
- export declare function sortPaymentMethods(methods: PaymentMethod[], labels: Array<PaymentMethod['payment_source_type']>): PaymentMethod[];
1
+ import type { PaymentMethod } from '@commercelayer/sdk';
2
+ export declare function sortPaymentMethods(methods: PaymentMethod[], labels: PaymentMethod['payment_source_type'][]): PaymentMethod[];
@@ -1,3 +1,3 @@
1
- import { type LineItem, type Shipment } from '@commercelayer/sdk';
1
+ import type { LineItem, Shipment } from '@commercelayer/sdk';
2
2
  export declare function shipmentsFilled(shipments: Shipment[]): boolean;
3
3
  export declare function isDoNotShip(lineItems?: LineItem[] | null): boolean;
@@ -1,5 +1,5 @@
1
- import { type CommerceLayerConfig } from '../context/CommerceLayerContext';
2
- import { type Order, type OrderSubscription } from '@commercelayer/sdk';
1
+ import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
2
+ import type { Order, OrderSubscription } from '@commercelayer/sdk';
3
3
  export type HelperRequestResource = 'orders' | 'order_subscriptions';
4
4
  export type TriggerAttributeHelper = {
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { type PaymentResource } from '../reducers/PaymentMethodReducer';
2
- import { type CommerceLayerClient, type Order } from '@commercelayer/sdk';
1
+ import type { PaymentResource } from '../reducers/PaymentMethodReducer';
2
+ import type { CommerceLayerClient, Order } from '@commercelayer/sdk';
3
3
  /**
4
4
  * Check if a given `order` has a linked `order_subscription` to replace its `customer_payment_source` with the `order`'s `payment_source`.
5
5
  * @param order Order
@@ -1,9 +1,9 @@
1
- import { type BaseState } from '../typings/index';
2
- import { type BaseError } from '../typings/errors';
1
+ import type { BaseState } from '../typings/index';
2
+ import type { BaseError } from '../typings/errors';
3
3
  import { type AddressField } from '../reducers/AddressReducer';
4
- import { type AddressCreate } from '@commercelayer/sdk';
5
- import { type AddressInputName } from '../typings/index';
6
- import { type TResourceError } from '../components/errors/Errors';
4
+ import type { AddressCreate } from '@commercelayer/sdk';
5
+ import type { AddressInputName } from '../typings/index';
6
+ import type { TResourceError } from '../components/errors/Errors';
7
7
  export type ValidateFormFields = <R extends string[]>(fields: HTMLFormControlsCollection, required: R, resourceType: TResourceError) => {
8
8
  errors: BaseError[];
9
9
  values: BaseState;
@@ -1,4 +1,4 @@
1
- import { type ReactNode, type JSX } from 'react';
1
+ import type { ReactNode, JSX } from 'react';
2
2
  interface Props {
3
3
  children: ReactNode;
4
4
  url: string;
@@ -1,4 +1,4 @@
1
- import { type BaseInputComponentProps } from '../typings/index';
1
+ import type { BaseInputComponentProps } from '../typings/index';
2
2
  import type { JSX } from "react";
3
3
  type Props = BaseInputComponentProps & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
4
4
  export declare function MetadataInput(props: Props): JSX.Element;
@@ -1,5 +1,5 @@
1
- import { type ReactNode, type JSX } from 'react';
2
- import { type ChildrenFunction } from '../typings/index';
1
+ import type { ReactNode, JSX } from 'react';
2
+ import type { ChildrenFunction } from '../typings/index';
3
3
  interface ChildrenProps extends Omit<Props, 'children'> {
4
4
  }
5
5
  interface Props extends Omit<JSX.IntrinsicElements['button'], 'children' | 'ref'> {
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type Address as AddressType } from '@commercelayer/sdk';
2
+ import type { Address as AddressType } from '@commercelayer/sdk';
3
3
  import { type AddressCardsTemplateChildren } from '../utils/AddressCardsTemplate';
4
4
  import type { DefaultChildrenType } from '../../typings/globals';
5
5
  interface Props extends Omit<JSX.IntrinsicElements['div'], 'children' | 'onSelect'> {
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type BaseSelectComponentProps } from '../../typings/index';
2
+ import type { BaseSelectComponentProps } from '../../typings/index';
3
3
  import { type AddressValuesKeys } from '../../context/BillingAddressFormContext';
4
4
  import { type Country } from '../../utils/countryStateCity';
5
5
  type TCountryFieldName = 'billing_address_country_code' | 'shipping_address_country_code' | 'customer_address_country_code';
@@ -1,7 +1,7 @@
1
1
  import { type ReactNode, type JSX } from 'react';
2
- import { type AddressFieldView } from '../../reducers/AddressReducer';
2
+ import type { AddressFieldView } from '../../reducers/AddressReducer';
3
3
  import type { Address } from '@commercelayer/sdk';
4
- import { type ChildrenFunction } from '../../typings/index';
4
+ import type { ChildrenFunction } from '../../typings/index';
5
5
  interface ChildrenProps extends Omit<Props, 'children' | 'name'> {
6
6
  address: Address;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type BaseInputComponentProps, type AddressInputName } from '../../typings/index';
2
+ import type { BaseInputComponentProps, AddressInputName } from '../../typings/index';
3
3
  import { type AddressValuesKeys } from '../../context/BillingAddressFormContext';
4
4
  type Props = {
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type BaseSelectComponentProps } from '../../typings/index';
2
+ import type { BaseSelectComponentProps } from '../../typings/index';
3
3
  import { type AddressValuesKeys } from '../../context/BillingAddressFormContext';
4
4
  type SelectFieldName = `billing_address_${`metadata_${string}`}` | `shipping_address_${`metadata_${string}`}`;
5
5
  interface Props extends Omit<BaseSelectComponentProps, 'name'>, Pick<JSX.IntrinsicElements['select'], 'className' | 'id' | 'style'> {
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type AddressStateSelectName, type BaseSelectComponentProps } from '../../typings/index';
2
+ import type { AddressStateSelectName, BaseSelectComponentProps } from '../../typings/index';
3
3
  import { type States } from '../../utils/countryStateCity';
4
4
  type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
5
5
  name: AddressStateSelectName;
@@ -1,4 +1,4 @@
1
- import { type ChildrenFunction } from '../../typings/index';
1
+ import type { ChildrenFunction } from '../../typings/index';
2
2
  import { type JSX } from 'react';
3
3
  interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode, type JSX } from 'react';
2
- import { type CustomFieldMessageError } from '../../reducers/AddressReducer';
2
+ import type { CustomFieldMessageError } from '../../reducers/AddressReducer';
3
3
  type Props = {
4
4
  children: ReactNode;
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode, type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
3
  import type { Order } from '@commercelayer/sdk';
4
4
  interface TOnClick {
5
5
  success: boolean;
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode, type JSX } from 'react';
2
- import { type CustomFieldMessageError } from '../../reducers/AddressReducer';
2
+ import type { CustomFieldMessageError } from '../../reducers/AddressReducer';
3
3
  interface Props extends Omit<JSX.IntrinsicElements['form'], 'onSubmit'> {
4
4
  children: ReactNode;
5
5
  reset?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
2
  import type { DefaultChildrenType } from '../../typings/globals';
3
- import { type QueryPageSize } from '@commercelayer/sdk';
3
+ import type { QueryPageSize } from '@commercelayer/sdk';
4
4
  interface Props {
5
5
  children: DefaultChildrenType;
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { type ConditionalElement } from '../../typings/index';
1
+ import type { ConditionalElement } from '../../typings/index';
2
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
3
3
  import type { JSX } from "react";
4
4
  type StockTransferFieldChildrenProps = TGenericChildrenProps<TResources['Customer']>;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type BaseInputComponentProps } from '../../typings/index';
2
+ import type { BaseInputComponentProps } from '../../typings/index';
3
3
  type Props = {
4
4
  name?: 'customer_email' | string;
5
5
  type?: 'email' | string;
@@ -1,4 +1,4 @@
1
- import { type DefaultChildrenType } from '../../typings/globals';
1
+ import type { DefaultChildrenType } from '../../typings/globals';
2
2
  import { type JSX } from 'react';
3
3
  interface Props {
4
4
  children?: DefaultChildrenType;
@@ -1,4 +1,4 @@
1
- import { type ChildrenFunction } from '../../typings/index';
1
+ import type { ChildrenFunction } from '../../typings/index';
2
2
  import type { JSX } from "react";
3
3
  interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
3
  interface ChildrenProps extends Omit<Props, 'children'> {
4
4
  /**
5
5
  * The link href
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
3
  interface ChildrenProps extends Omit<Props, 'children'> {
4
4
  /**
5
5
  * The link href
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode, type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
3
  interface ChildrenProps extends Omit<Props, 'children'> {
4
4
  handleClick: () => void;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
2
  import type { CodeErrorType } from '../../typings/errors';
3
- import { type ChildrenFunction } from '../../typings/index';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
4
  export type TResourceError = 'addresses' | 'billing_address' | 'gift_cards' | 'gift_card_or_coupon_code' | 'line_items' | 'orders' | 'payment_methods' | 'prices' | 'shipments' | 'shipping_address' | 'customer_address' | 'sku_options' | 'variant' | 'in_stock_subscriptions';
5
5
  type ErrorChildrenComponentProps = ChildrenFunction<Omit<TErrorComponent, 'children'> & {
6
6
  errors: string[];
@@ -1,5 +1,5 @@
1
1
  import { type RefObject, type JSX } from 'react';
2
- import { type BaseState } from '../../typings/index';
2
+ import type { BaseState } from '../../typings/index';
3
3
  import type { DefaultChildrenType } from '../../typings/globals';
4
4
  interface Props extends Omit<JSX.IntrinsicElements['form'], 'children' | 'ref'> {
5
5
  children: DefaultChildrenType;
@@ -1,4 +1,4 @@
1
- import { type BaseSelectComponentProps } from '../../typings/index';
1
+ import type { BaseSelectComponentProps } from '../../typings/index';
2
2
  import type { JSX } from "react";
3
3
  type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
4
4
  required?: boolean;
@@ -1,4 +1,4 @@
1
- import { type BaseInputComponentProps, type GiftCardInputName } from '../../typings/index';
1
+ import type { BaseInputComponentProps, GiftCardInputName } from '../../typings/index';
2
2
  import type { JSX } from "react";
3
3
  type Props = {
4
4
  name: GiftCardInputName;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
3
  import type { CodeType } from '../../reducers/OrderReducer';
4
4
  interface ChildrenProps extends Omit<Props, 'children' | 'type'> {
5
5
  code?: string | null;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type BaseInputComponentProps } from '../../typings/index';
3
- import { type OrderCodeType } from '../../reducers/OrderReducer';
2
+ import type { BaseInputComponentProps } from '../../typings/index';
3
+ import type { OrderCodeType } from '../../reducers/OrderReducer';
4
4
  type FieldName = 'gift_card_code' | 'coupon_code';
5
5
  type Props = {
6
6
  name?: FieldName;
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode, type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
3
- import { type CodeType, type OrderCodeType } from '../../reducers/OrderReducer';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
+ import type { CodeType, OrderCodeType } from '../../reducers/OrderReducer';
4
4
  import type { Order } from '@commercelayer/sdk';
5
5
  interface ChildrenProps extends Omit<Props, 'children' | 'onClick'> {
6
6
  codeType?: OrderCodeType;
@@ -1,5 +1,5 @@
1
- import { type ReactNode, type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
1
+ import type { ReactNode, JSX } from 'react';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
3
  interface ChildrenProps extends Omit<Props, 'children'> {
4
4
  }
5
5
  interface Props extends Omit<JSX.IntrinsicElements['button'], 'children'> {
@@ -1,4 +1,4 @@
1
- import { type ChildrenFunction } from '../../typings/index';
1
+ import type { ChildrenFunction } from '../../typings/index';
2
2
  import { type JSX } from 'react';
3
3
  interface Props extends Omit<JSX.IntrinsicElements['button'], 'children' | 'onClick'> {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { type DefaultChildrenType } from '../../typings/globals';
1
+ import type { DefaultChildrenType } from '../../typings/globals';
2
2
  import { type JSX } from 'react';
3
3
  interface Props {
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type BaseAmountComponent, type BasePriceType } from '../../typings/index';
2
+ import type { BaseAmountComponent, BasePriceType } from '../../typings/index';
3
3
  type Props = BaseAmountComponent & {
4
4
  type?: BasePriceType;
5
5
  };
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type LineItem } from '@commercelayer/sdk';
3
- import { type ChildrenFunction } from '../../typings/index';
2
+ import type { LineItem } from '@commercelayer/sdk';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
4
  export interface TLineItemCode extends Omit<Props, 'children'> {
5
5
  lineItem: LineItem;
6
6
  skuCode: string;
@@ -1,4 +1,4 @@
1
- import { type ConditionalElement } from '../../typings/index';
1
+ import type { ConditionalElement } from '../../typings/index';
2
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
3
3
  import type { JSX } from "react";
4
4
  type LineItemFieldChildrenProps = TGenericChildrenProps<TResources['LineItem']>;
@@ -1,7 +1,7 @@
1
1
  import { type JSX } from 'react';
2
- import { type LineItem } from '@commercelayer/sdk';
2
+ import type { LineItem } from '@commercelayer/sdk';
3
3
  import type { ChildrenFunction } from '../../typings/index';
4
- import { type TLineItem } from './LineItem';
4
+ import type { TLineItem } from './LineItem';
5
5
  export interface TLineItemImage extends Omit<Props, 'children'> {
6
6
  src: string;
7
7
  lineItem: LineItem;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
2
  import type { LineItem } from '@commercelayer/sdk';
3
- import { type ChildrenFunction } from '../../typings/index';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
4
  export interface TLineItemName extends Omit<Props, 'children'> {
5
5
  label: string;
6
6
  lineItem: LineItem;
@@ -1,6 +1,6 @@
1
1
  import { type CSSProperties, type JSX } from 'react';
2
- import { type LineItemOption as LineItemOptionType } from '@commercelayer/sdk';
3
- import { type ChildrenFunction } from '../../typings/index';
2
+ import type { LineItemOption as LineItemOptionType } from '@commercelayer/sdk';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
4
  export interface TLineItemOption extends Omit<Props, 'children'> {
5
5
  lineItemOption: LineItemOptionType;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
3
- import { type LineItem } from '@commercelayer/sdk';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
+ import type { LineItem } from '@commercelayer/sdk';
4
4
  interface ChildrenProps extends Omit<Props, 'children'> {
5
5
  quantity: number;
6
6
  handleChange: (event: React.MouseEvent<HTMLSelectElement>) => void;
@@ -1,6 +1,6 @@
1
1
  import { type PropsWithoutRef, type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
3
- import { type LineItem } from '@commercelayer/sdk';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
+ import type { LineItem } from '@commercelayer/sdk';
4
4
  interface ChildrenProps extends Omit<Props, 'children'> {
5
5
  handleRemove: (event: React.MouseEvent<HTMLAnchorElement>) => void;
6
6
  label?: string;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
2
  import { type TypeAccepted } from '../../utils/getLineItemsCount';
3
- import { type ChildrenFunction } from '../../typings/index';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
4
  interface ChildrenProps extends Omit<Props, 'children'> {
5
5
  quantity: number;
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
3
  interface ChildrenProps extends Omit<Props, 'children'> {
4
4
  quantity: number;
5
5
  text: string;