@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.
- package/lib/cjs/components/ExternalFunction.d.ts +1 -1
- package/lib/cjs/components/MetadataInput.d.ts +1 -1
- package/lib/cjs/components/SubmitButton.d.ts +2 -2
- package/lib/cjs/components/addresses/Address.d.ts +1 -1
- package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +1 -1
- package/lib/cjs/components/addresses/AddressField.d.ts +2 -2
- package/lib/cjs/components/addresses/AddressInput.d.ts +1 -1
- package/lib/cjs/components/addresses/AddressInputSelect.d.ts +1 -1
- package/lib/cjs/components/addresses/AddressStateSelector.d.ts +1 -1
- package/lib/cjs/components/addresses/AddressesEmpty.d.ts +1 -1
- package/lib/cjs/components/addresses/BillingAddressForm.d.ts +1 -1
- package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +1 -1
- package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +1 -1
- package/lib/cjs/components/customers/CustomerContainer.d.ts +1 -1
- package/lib/cjs/components/customers/CustomerField.d.ts +1 -1
- package/lib/cjs/components/customers/CustomerInput.d.ts +1 -1
- package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +1 -1
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +1 -1
- package/lib/cjs/components/customers/MyAccountLink.d.ts +1 -1
- package/lib/cjs/components/customers/MyIdentityLink.d.ts +1 -1
- package/lib/cjs/components/customers/SaveCustomerButton.d.ts +1 -1
- package/lib/cjs/components/errors/Errors.d.ts +1 -1
- package/lib/cjs/components/gift_cards/GiftCard.d.ts +1 -1
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -1
- package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +2 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +2 -2
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +1 -1
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemAmount.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemCode.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItemField.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemImage.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItemName.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemOption.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItemQuantity.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItemsCount.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +1 -1
- package/lib/cjs/components/orders/AddToCartButton.d.ts +6 -6
- package/lib/cjs/components/orders/AddToCartButton.js +1 -1
- package/lib/cjs/components/orders/AdjustmentAmount.d.ts +1 -1
- package/lib/cjs/components/orders/CartLink.d.ts +1 -1
- package/lib/cjs/components/orders/CheckoutLink.d.ts +1 -1
- package/lib/cjs/components/orders/DiscountAmount.d.ts +1 -1
- package/lib/cjs/components/orders/GiftCardAmount.d.ts +1 -1
- package/lib/cjs/components/orders/OrderContainer.d.ts +1 -1
- package/lib/cjs/components/orders/OrderList.d.ts +1 -1
- package/lib/cjs/components/orders/OrderListEmpty.d.ts +1 -1
- package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +1 -1
- package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +1 -1
- package/lib/cjs/components/orders/OrderStorage.d.ts +1 -1
- package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +1 -1
- package/lib/cjs/components/orders/PlaceOrderButton.d.ts +6 -6
- package/lib/cjs/components/orders/PlaceOrderButton.js +1 -1
- package/lib/cjs/components/orders/ShippingAmount.d.ts +1 -1
- package/lib/cjs/components/orders/SubTotalAmount.d.ts +1 -1
- package/lib/cjs/components/orders/TaxesAmount.d.ts +1 -1
- package/lib/cjs/components/orders/TotalAmount.d.ts +1 -1
- package/lib/cjs/components/parcels/ParcelField.d.ts +1 -1
- package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +1 -1
- package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +1 -1
- package/lib/cjs/components/parcels/ParcelsCount.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +2 -2
- package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
- package/lib/cjs/components/payment_source/AdyenPayment.d.ts +10 -74
- package/lib/cjs/components/payment_source/AdyenPayment.js +1 -1
- package/lib/cjs/components/payment_source/BraintreePayment.d.ts +2 -2
- package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +2 -2
- package/lib/cjs/components/payment_source/ExternalPayment.d.ts +2 -2
- package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +2 -2
- package/lib/cjs/components/payment_source/PaymentSource.d.ts +2 -2
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +1 -1
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +1 -1
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
- package/lib/cjs/components/payment_source/StripePayment.d.ts +3 -3
- package/lib/cjs/components/prices/Price.d.ts +2 -2
- package/lib/cjs/components/prices/PricesContainer.d.ts +2 -2
- package/lib/cjs/components/shipments/ShipmentField.d.ts +1 -1
- package/lib/cjs/components/shipments/ShipmentsCount.d.ts +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +1 -1
- package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +2 -2
- package/lib/cjs/components/skus/SkuField.d.ts +1 -1
- package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +1 -1
- package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +1 -1
- package/lib/cjs/components/utils/BaseInput.d.ts +1 -1
- package/lib/cjs/components/utils/BaseOrderPrice.d.ts +2 -2
- package/lib/cjs/components/utils/BaseSelect.d.ts +1 -1
- package/lib/cjs/components/utils/GenericFieldComponent.d.ts +6 -6
- package/lib/cjs/components/utils/Parent.d.ts +1 -1
- package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +3 -3
- package/lib/cjs/components/utils/PriceTemplate.d.ts +1 -1
- package/lib/cjs/components/utils/getAllErrors.d.ts +3 -3
- package/lib/cjs/context/AddressChildrenContext.d.ts +1 -1
- package/lib/cjs/context/AddressContext.d.ts +1 -1
- package/lib/cjs/context/BillingAddressContext.d.ts +1 -1
- package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +1 -1
- package/lib/cjs/context/CustomerAddressFormContext.d.ts +2 -2
- package/lib/cjs/context/CustomerContext.d.ts +1 -1
- package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +1 -1
- package/lib/cjs/context/GiftCardContext.d.ts +1 -1
- package/lib/cjs/context/InStockSubscriptionContext.d.ts +1 -1
- package/lib/cjs/context/LineItemChildrenContext.d.ts +1 -1
- package/lib/cjs/context/LineItemContext.d.ts +2 -2
- package/lib/cjs/context/OrderContext.d.ts +2 -2
- package/lib/cjs/context/OrderListChildrenContext.d.ts +3 -3
- package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +1 -1
- package/lib/cjs/context/ShippingAddressContext.d.ts +1 -1
- package/lib/cjs/context/ShippingAddressFormContext.d.ts +1 -1
- package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +1 -1
- package/lib/cjs/context/SkuChildrenContext.d.ts +1 -1
- package/lib/cjs/context/SkuContext.d.ts +1 -1
- package/lib/cjs/context/StockTransferChildrenContext.d.ts +1 -1
- package/lib/cjs/hooks/useCommerceLayer.d.ts +1 -1
- package/lib/cjs/hooks/useCustomerContainer.d.ts +1 -1
- package/lib/cjs/hooks/useOrderContainer.d.ts +1 -1
- package/lib/cjs/reducers/AddressReducer.d.ts +9 -9
- package/lib/cjs/reducers/AvailabilityReducer.d.ts +5 -5
- package/lib/cjs/reducers/BillingAddressReducer.d.ts +4 -4
- package/lib/cjs/reducers/CustomerReducer.d.ts +4 -4
- package/lib/cjs/reducers/GiftCardReducer.d.ts +6 -6
- package/lib/cjs/reducers/InStockSubscriptionReducer.d.ts +3 -3
- package/lib/cjs/reducers/LineItemReducer.d.ts +6 -6
- package/lib/cjs/reducers/OrderReducer.d.ts +6 -6
- package/lib/cjs/reducers/PaymentMethodReducer.d.ts +26 -26
- package/lib/cjs/reducers/PlaceOrderReducer.d.ts +11 -11
- package/lib/cjs/reducers/PriceReducer.d.ts +5 -5
- package/lib/cjs/reducers/ShipmentReducer.d.ts +5 -5
- package/lib/cjs/reducers/ShippingAddressReducer.d.ts +4 -4
- package/lib/cjs/reducers/SkuListsReducer.d.ts +2 -2
- package/lib/cjs/reducers/SkuReducer.d.ts +4 -4
- package/lib/cjs/typings/errors.d.ts +1 -1
- package/lib/cjs/typings/index.d.ts +2 -2
- package/lib/cjs/utils/addressesManager.d.ts +3 -3
- package/lib/cjs/utils/baseReducer.d.ts +1 -1
- package/lib/cjs/utils/canPlaceOrder.d.ts +1 -1
- package/lib/cjs/utils/checkIncludeResource.d.ts +1 -1
- package/lib/cjs/utils/customMessages.d.ts +1 -1
- package/lib/cjs/utils/expressPaymentHelper.d.ts +8 -8
- package/lib/cjs/utils/expressPaymentHelper.js +1 -1
- package/lib/cjs/utils/filterChildren.d.ts +1 -1
- package/lib/cjs/utils/formCleaner.d.ts +1 -1
- package/lib/cjs/utils/getCardDetails.d.ts +3 -3
- package/lib/cjs/utils/getErrors.d.ts +2 -2
- package/lib/cjs/utils/getLoaderComponent.d.ts +1 -1
- package/lib/cjs/utils/getPaymentAttributes.d.ts +2 -2
- package/lib/cjs/utils/getPrices.d.ts +1 -1
- package/lib/cjs/utils/getSdk.d.ts +1 -1
- package/lib/cjs/utils/getSkus.d.ts +1 -1
- package/lib/cjs/utils/hasSubscriptions.d.ts +1 -1
- package/lib/cjs/utils/organization.d.ts +4 -4
- package/lib/cjs/utils/organization.js +1 -1
- package/lib/cjs/utils/payment-methods/sortPaymentMethods.d.ts +2 -2
- package/lib/cjs/utils/shipments.d.ts +1 -1
- package/lib/cjs/utils/triggerAttributeHelper.d.ts +2 -2
- package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +2 -2
- package/lib/cjs/utils/validateFormFields.d.ts +5 -5
- package/lib/esm/components/ExternalFunction.d.ts +1 -1
- package/lib/esm/components/MetadataInput.d.ts +1 -1
- package/lib/esm/components/SubmitButton.d.ts +2 -2
- package/lib/esm/components/addresses/Address.d.ts +1 -1
- package/lib/esm/components/addresses/AddressCountrySelector.d.ts +1 -1
- package/lib/esm/components/addresses/AddressField.d.ts +2 -2
- package/lib/esm/components/addresses/AddressInput.d.ts +1 -1
- package/lib/esm/components/addresses/AddressInputSelect.d.ts +1 -1
- package/lib/esm/components/addresses/AddressStateSelector.d.ts +1 -1
- package/lib/esm/components/addresses/AddressesEmpty.d.ts +1 -1
- package/lib/esm/components/addresses/BillingAddressForm.d.ts +1 -1
- package/lib/esm/components/addresses/SaveAddressesButton.d.ts +1 -1
- package/lib/esm/components/addresses/ShippingAddressForm.d.ts +1 -1
- package/lib/esm/components/customers/CustomerContainer.d.ts +1 -1
- package/lib/esm/components/customers/CustomerField.d.ts +1 -1
- package/lib/esm/components/customers/CustomerInput.d.ts +1 -1
- package/lib/esm/components/customers/CustomerPaymentSource.d.ts +1 -1
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +1 -1
- package/lib/esm/components/customers/MyAccountLink.d.ts +1 -1
- package/lib/esm/components/customers/MyIdentityLink.d.ts +1 -1
- package/lib/esm/components/customers/SaveCustomerButton.d.ts +1 -1
- package/lib/esm/components/errors/Errors.d.ts +1 -1
- package/lib/esm/components/gift_cards/GiftCard.d.ts +1 -1
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -1
- package/lib/esm/components/gift_cards/GiftCardInput.d.ts +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +2 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +2 -2
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +1 -1
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemAmount.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemCode.d.ts +2 -2
- package/lib/esm/components/line_items/LineItemField.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemImage.d.ts +2 -2
- package/lib/esm/components/line_items/LineItemName.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemOption.d.ts +2 -2
- package/lib/esm/components/line_items/LineItemQuantity.d.ts +2 -2
- package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +2 -2
- package/lib/esm/components/line_items/LineItemsCount.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemsEmpty.d.ts +1 -1
- package/lib/esm/components/orders/AddToCartButton.d.ts +6 -6
- package/lib/esm/components/orders/AddToCartButton.js +1 -1
- package/lib/esm/components/orders/AdjustmentAmount.d.ts +1 -1
- package/lib/esm/components/orders/CartLink.d.ts +1 -1
- package/lib/esm/components/orders/CheckoutLink.d.ts +1 -1
- package/lib/esm/components/orders/DiscountAmount.d.ts +1 -1
- package/lib/esm/components/orders/GiftCardAmount.d.ts +1 -1
- package/lib/esm/components/orders/OrderContainer.d.ts +1 -1
- package/lib/esm/components/orders/OrderList.d.ts +1 -1
- package/lib/esm/components/orders/OrderListEmpty.d.ts +1 -1
- package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +1 -1
- package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +1 -1
- package/lib/esm/components/orders/OrderStorage.d.ts +1 -1
- package/lib/esm/components/orders/PaymentMethodAmount.d.ts +1 -1
- package/lib/esm/components/orders/PlaceOrderButton.d.ts +6 -6
- package/lib/esm/components/orders/PlaceOrderButton.js +1 -1
- package/lib/esm/components/orders/ShippingAmount.d.ts +1 -1
- package/lib/esm/components/orders/SubTotalAmount.d.ts +1 -1
- package/lib/esm/components/orders/TaxesAmount.d.ts +1 -1
- package/lib/esm/components/orders/TotalAmount.d.ts +1 -1
- package/lib/esm/components/parcels/ParcelField.d.ts +1 -1
- package/lib/esm/components/parcels/ParcelLineItemField.d.ts +1 -1
- package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +1 -1
- package/lib/esm/components/parcels/ParcelsCount.d.ts +1 -1
- package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +2 -2
- package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/StripeGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
- package/lib/esm/components/payment_source/AdyenPayment.d.ts +10 -74
- package/lib/esm/components/payment_source/AdyenPayment.js +1 -1
- package/lib/esm/components/payment_source/BraintreePayment.d.ts +2 -2
- package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +2 -2
- package/lib/esm/components/payment_source/ExternalPayment.d.ts +2 -2
- package/lib/esm/components/payment_source/KlarnaPayment.d.ts +2 -2
- package/lib/esm/components/payment_source/PaymentSource.d.ts +2 -2
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +1 -1
- package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +1 -1
- package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
- package/lib/esm/components/payment_source/StripePayment.d.ts +3 -3
- package/lib/esm/components/prices/Price.d.ts +2 -2
- package/lib/esm/components/prices/PricesContainer.d.ts +2 -2
- package/lib/esm/components/shipments/ShipmentField.d.ts +1 -1
- package/lib/esm/components/shipments/ShipmentsCount.d.ts +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +1 -1
- package/lib/esm/components/skus/AvailabilityTemplate.d.ts +2 -2
- package/lib/esm/components/skus/SkuField.d.ts +1 -1
- package/lib/esm/components/stock_transfers/StockTransferField.d.ts +1 -1
- package/lib/esm/components/utils/AddressCardsTemplate.d.ts +1 -1
- package/lib/esm/components/utils/BaseInput.d.ts +1 -1
- package/lib/esm/components/utils/BaseOrderPrice.d.ts +2 -2
- package/lib/esm/components/utils/BaseSelect.d.ts +1 -1
- package/lib/esm/components/utils/GenericFieldComponent.d.ts +6 -6
- package/lib/esm/components/utils/Parent.d.ts +1 -1
- package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +3 -3
- package/lib/esm/components/utils/PriceTemplate.d.ts +1 -1
- package/lib/esm/components/utils/getAllErrors.d.ts +3 -3
- package/lib/esm/context/AddressChildrenContext.d.ts +1 -1
- package/lib/esm/context/AddressContext.d.ts +1 -1
- package/lib/esm/context/BillingAddressContext.d.ts +1 -1
- package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +1 -1
- package/lib/esm/context/CustomerAddressFormContext.d.ts +2 -2
- package/lib/esm/context/CustomerContext.d.ts +1 -1
- package/lib/esm/context/CustomerPaymentSourceContext.d.ts +1 -1
- package/lib/esm/context/GiftCardContext.d.ts +1 -1
- package/lib/esm/context/InStockSubscriptionContext.d.ts +1 -1
- package/lib/esm/context/LineItemChildrenContext.d.ts +1 -1
- package/lib/esm/context/LineItemContext.d.ts +2 -2
- package/lib/esm/context/OrderContext.d.ts +2 -2
- package/lib/esm/context/OrderListChildrenContext.d.ts +3 -3
- package/lib/esm/context/PaymentMethodChildrenContext.d.ts +1 -1
- package/lib/esm/context/ShippingAddressContext.d.ts +1 -1
- package/lib/esm/context/ShippingAddressFormContext.d.ts +1 -1
- package/lib/esm/context/ShippingMethodChildrenContext.d.ts +1 -1
- package/lib/esm/context/SkuChildrenContext.d.ts +1 -1
- package/lib/esm/context/SkuContext.d.ts +1 -1
- package/lib/esm/context/StockTransferChildrenContext.d.ts +1 -1
- package/lib/esm/hooks/useCommerceLayer.d.ts +1 -1
- package/lib/esm/hooks/useCustomerContainer.d.ts +1 -1
- package/lib/esm/hooks/useOrderContainer.d.ts +1 -1
- package/lib/esm/reducers/AddressReducer.d.ts +9 -9
- package/lib/esm/reducers/AvailabilityReducer.d.ts +5 -5
- package/lib/esm/reducers/BillingAddressReducer.d.ts +4 -4
- package/lib/esm/reducers/CustomerReducer.d.ts +4 -4
- package/lib/esm/reducers/GiftCardReducer.d.ts +6 -6
- package/lib/esm/reducers/InStockSubscriptionReducer.d.ts +3 -3
- package/lib/esm/reducers/LineItemReducer.d.ts +6 -6
- package/lib/esm/reducers/OrderReducer.d.ts +6 -6
- package/lib/esm/reducers/PaymentMethodReducer.d.ts +26 -26
- package/lib/esm/reducers/PlaceOrderReducer.d.ts +11 -11
- package/lib/esm/reducers/PriceReducer.d.ts +5 -5
- package/lib/esm/reducers/ShipmentReducer.d.ts +5 -5
- package/lib/esm/reducers/ShippingAddressReducer.d.ts +4 -4
- package/lib/esm/reducers/SkuListsReducer.d.ts +2 -2
- package/lib/esm/reducers/SkuReducer.d.ts +4 -4
- package/lib/esm/typings/errors.d.ts +1 -1
- package/lib/esm/typings/index.d.ts +2 -2
- package/lib/esm/utils/addressesManager.d.ts +3 -3
- package/lib/esm/utils/baseReducer.d.ts +1 -1
- package/lib/esm/utils/canPlaceOrder.d.ts +1 -1
- package/lib/esm/utils/checkIncludeResource.d.ts +1 -1
- package/lib/esm/utils/customMessages.d.ts +1 -1
- package/lib/esm/utils/expressPaymentHelper.d.ts +8 -8
- package/lib/esm/utils/expressPaymentHelper.js +1 -1
- package/lib/esm/utils/filterChildren.d.ts +1 -1
- package/lib/esm/utils/formCleaner.d.ts +1 -1
- package/lib/esm/utils/getCardDetails.d.ts +3 -3
- package/lib/esm/utils/getErrors.d.ts +2 -2
- package/lib/esm/utils/getLoaderComponent.d.ts +1 -1
- package/lib/esm/utils/getPaymentAttributes.d.ts +2 -2
- package/lib/esm/utils/getPrices.d.ts +1 -1
- package/lib/esm/utils/getSdk.d.ts +1 -1
- package/lib/esm/utils/getSkus.d.ts +1 -1
- package/lib/esm/utils/hasSubscriptions.d.ts +1 -1
- package/lib/esm/utils/organization.d.ts +4 -4
- package/lib/esm/utils/organization.js +1 -1
- package/lib/esm/utils/payment-methods/sortPaymentMethods.d.ts +2 -2
- package/lib/esm/utils/shipments.d.ts +1 -1
- package/lib/esm/utils/triggerAttributeHelper.d.ts +2 -2
- package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +2 -2
- package/lib/esm/utils/validateFormFields.d.ts +5 -5
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +41 -21
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import type { BaseError } from
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
export type PaymentSourceType = Order[
|
|
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
15
|
interface Card {
|
|
16
16
|
type: string;
|
|
17
17
|
brand: string;
|
|
@@ -25,7 +25,7 @@ export interface PaymentSourceObject {
|
|
|
25
25
|
payment_method?: Card;
|
|
26
26
|
};
|
|
27
27
|
payment_response?: {
|
|
28
|
-
resultCode?:
|
|
28
|
+
resultCode?: "Authorised";
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
braintree_payments: BraintreePayment & {
|
|
@@ -43,13 +43,13 @@ export interface PaymentSourceObject {
|
|
|
43
43
|
};
|
|
44
44
|
payment_method?: {
|
|
45
45
|
card: Card;
|
|
46
|
-
type: string |
|
|
46
|
+
type: string | "klarna" | "card";
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
wire_transfers: WireTransfer;
|
|
50
50
|
checkout_com_payments: CheckoutComPayment & {
|
|
51
51
|
payment_response: {
|
|
52
|
-
source?: Pick<Card,
|
|
52
|
+
source?: Pick<Card, "last4"> & {
|
|
53
53
|
scheme: string;
|
|
54
54
|
expiry_year: number;
|
|
55
55
|
expiry_month: number;
|
|
@@ -58,7 +58,7 @@ export interface PaymentSourceObject {
|
|
|
58
58
|
};
|
|
59
59
|
klarna_payments: KlarnaPayment;
|
|
60
60
|
}
|
|
61
|
-
export type PaymentMethodActionType =
|
|
61
|
+
export type PaymentMethodActionType = "setErrors" | "setPaymentMethods" | "setPaymentMethodConfig" | "setPaymentSource" | "setPaymentRef" | "setLoading";
|
|
62
62
|
export type PaymentRef = MutableRefObject<null | HTMLFormElement>;
|
|
63
63
|
export interface PaymentMethodActionPayload {
|
|
64
64
|
errors: BaseError[];
|
|
@@ -68,10 +68,10 @@ export interface PaymentMethodActionPayload {
|
|
|
68
68
|
currentPaymentMethodRef: PaymentRef;
|
|
69
69
|
currentCustomerPaymentSourceId: string | null;
|
|
70
70
|
config: PaymentMethodConfig;
|
|
71
|
-
paymentSource: Order[
|
|
71
|
+
paymentSource: Order["payment_source"] | null;
|
|
72
72
|
loading: boolean;
|
|
73
73
|
}
|
|
74
|
-
export declare function setLoading({ loading, dispatch }: {
|
|
74
|
+
export declare function setLoading({ loading, dispatch, }: {
|
|
75
75
|
loading: boolean;
|
|
76
76
|
dispatch?: Dispatch<PaymentMethodAction>;
|
|
77
77
|
}): void;
|
|
@@ -94,8 +94,8 @@ type GetPaymentMethods = (args: {
|
|
|
94
94
|
}) => Promise<void>;
|
|
95
95
|
export declare const getPaymentMethods: GetPaymentMethods;
|
|
96
96
|
export type PaymentResource = keyof PaymentSourceObject;
|
|
97
|
-
export type PaymentResourceKey =
|
|
98
|
-
export type SDKPaymentResource =
|
|
97
|
+
export type PaymentResourceKey = "braintreePayment" | "stripePayment" | "klarnaPayment" | "wireTransfer" | "paypalPayment" | "adyenPayment" | "checkoutComPayment";
|
|
98
|
+
export type SDKPaymentResource = "AdyenPayment" | "BraintreePayment" | "ExternalPayment" | "PaypalPayment" | "StripePayment" | "WireTransfer" | "CheckoutComPayment";
|
|
99
99
|
interface TSetPaymentMethodParams {
|
|
100
100
|
config?: CommerceLayerConfig;
|
|
101
101
|
dispatch?: Dispatch<PaymentMethodAction>;
|
|
@@ -107,7 +107,7 @@ interface TSetPaymentMethodParams {
|
|
|
107
107
|
paymentMethodId: string;
|
|
108
108
|
paymentResource?: PaymentResource;
|
|
109
109
|
}
|
|
110
|
-
export declare function setPaymentMethod({ config, dispatch, order, paymentMethodId, updateOrder, setOrderErrors, paymentResource }: TSetPaymentMethodParams): Promise<{
|
|
110
|
+
export declare function setPaymentMethod({ config, dispatch, order, paymentMethodId, updateOrder, setOrderErrors, paymentResource, }: TSetPaymentMethodParams): Promise<{
|
|
111
111
|
success: boolean;
|
|
112
112
|
order?: Order;
|
|
113
113
|
}>;
|
|
@@ -116,7 +116,7 @@ export type SetPaymentSourceResponse = {
|
|
|
116
116
|
order: Order;
|
|
117
117
|
paymentSource: PaymentSourceTypes;
|
|
118
118
|
} | null;
|
|
119
|
-
export interface SetPaymentSourceParams extends Omit<PaymentMethodState,
|
|
119
|
+
export interface SetPaymentSourceParams extends Omit<PaymentMethodState, "config"> {
|
|
120
120
|
config?: CommerceLayerConfig;
|
|
121
121
|
dispatch?: Dispatch<PaymentMethodAction>;
|
|
122
122
|
getOrder?: getOrderContext;
|
|
@@ -127,7 +127,7 @@ export interface SetPaymentSourceParams extends Omit<PaymentMethodState, 'config
|
|
|
127
127
|
customerPaymentSourceId?: string;
|
|
128
128
|
updateOrder?: typeof updateOrder;
|
|
129
129
|
}
|
|
130
|
-
export declare function setPaymentSource({ config, dispatch, getOrder, attributes, order, paymentResource, customerPaymentSourceId, paymentSourceId, updateOrder, errors: currentErrors }: SetPaymentSourceParams): Promise<PaymentSourceType | undefined | null>;
|
|
130
|
+
export declare function setPaymentSource({ config, dispatch, getOrder, attributes, order, paymentResource, customerPaymentSourceId, paymentSourceId, updateOrder, errors: currentErrors, }: SetPaymentSourceParams): Promise<PaymentSourceType | undefined | null>;
|
|
131
131
|
export type UpdatePaymentSource = (args: {
|
|
132
132
|
id: string;
|
|
133
133
|
attributes: Record<string, any>;
|
|
@@ -149,7 +149,7 @@ export interface PaymentMethodConfig {
|
|
|
149
149
|
braintreePayment?: BraintreeConfig;
|
|
150
150
|
checkoutComPayment?: CheckoutComConfig;
|
|
151
151
|
externalPayment?: ExternalPaymentConfig;
|
|
152
|
-
klarnaPayment?: Pick<AdyenPaymentConfig,
|
|
152
|
+
klarnaPayment?: Pick<AdyenPaymentConfig, "placeOrderCallback"> & Pick<StripeConfig, "containerClassName">;
|
|
153
153
|
paypalPayment?: PaypalConfig;
|
|
154
154
|
stripePayment?: StripeConfig;
|
|
155
155
|
wireTransfer?: Partial<WireTransferConfig>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Dispatch, RefObject } from
|
|
2
|
-
import type { CommerceLayerConfig } from
|
|
3
|
-
import type { BaseError } from
|
|
4
|
-
import type { Order } from
|
|
5
|
-
import {
|
|
6
|
-
export type PlaceOrderActionType =
|
|
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
7
|
export interface PlaceOrderOptions {
|
|
8
8
|
paypalPayerId?: string;
|
|
9
9
|
adyen?: {
|
|
@@ -32,7 +32,7 @@ export interface PlaceOrderActionPayload {
|
|
|
32
32
|
paymentSource: PaymentSourceType;
|
|
33
33
|
options?: PlaceOrderOptions;
|
|
34
34
|
placeOrderButtonRef?: RefObject<HTMLButtonElement | null>;
|
|
35
|
-
status:
|
|
35
|
+
status: "placing" | "standby";
|
|
36
36
|
}
|
|
37
37
|
export declare function setButtonRef(ref: RefObject<HTMLButtonElement | null>, dispatch: Dispatch<PlaceOrderAction>): void;
|
|
38
38
|
export type PlaceOrderState = Partial<PlaceOrderActionPayload>;
|
|
@@ -48,7 +48,7 @@ interface TPlaceOrderPermittedParams {
|
|
|
48
48
|
order?: Order;
|
|
49
49
|
options?: PlaceOrderOptions;
|
|
50
50
|
}
|
|
51
|
-
export declare function placeOrderPermitted({ config, order, dispatch, options }: TPlaceOrderPermittedParams): void;
|
|
51
|
+
export declare function placeOrderPermitted({ config, order, dispatch, options, }: TPlaceOrderPermittedParams): void;
|
|
52
52
|
interface TSetPlaceOrderParams {
|
|
53
53
|
config?: CommerceLayerConfig;
|
|
54
54
|
order?: Order;
|
|
@@ -59,13 +59,13 @@ interface TSetPlaceOrderParams {
|
|
|
59
59
|
setOrder?: (order: Order) => void;
|
|
60
60
|
currentCustomerPaymentSourceId?: string | null;
|
|
61
61
|
}
|
|
62
|
-
export declare function setPlaceOrder({ state, order, config, setOrderErrors, paymentSource, setOrder, include, currentCustomerPaymentSourceId }: TSetPlaceOrderParams): Promise<{
|
|
62
|
+
export declare function setPlaceOrder({ state, order, config, setOrderErrors, paymentSource, setOrder, include, currentCustomerPaymentSourceId, }: TSetPlaceOrderParams): Promise<{
|
|
63
63
|
placed: boolean;
|
|
64
64
|
errors?: BaseError[];
|
|
65
65
|
order?: Order;
|
|
66
66
|
}>;
|
|
67
|
-
export declare function setPlaceOrderStatus({ status, dispatch }: {
|
|
68
|
-
status:
|
|
67
|
+
export declare function setPlaceOrderStatus({ status, dispatch, }: {
|
|
68
|
+
status: "placing" | "standby";
|
|
69
69
|
dispatch?: Dispatch<PlaceOrderAction>;
|
|
70
70
|
}): void;
|
|
71
71
|
declare const placeOrderReducer: (state: PlaceOrderState, reducer: PlaceOrderAction) => PlaceOrderState;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type { BaseAction, LoaderType } from '../typings/index';
|
|
2
|
+
import type { QueryPageSize, Price } from '@commercelayer/sdk';
|
|
3
|
+
import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
4
|
+
import type { Dispatch } from 'react';
|
|
5
|
+
import type { BaseError } from '../typings/errors';
|
|
6
6
|
export type Prices = Record<string, Price | Price[]>;
|
|
7
7
|
type SkuCodesPrice = string[];
|
|
8
8
|
export interface PriceState {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type { Dispatch } from 'react';
|
|
2
|
+
import type { BaseError } from '../typings/errors';
|
|
3
|
+
import type { DeliveryLeadTime, LineItem, Order, Shipment } from '@commercelayer/sdk';
|
|
4
|
+
import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
5
|
+
import type { getOrderContext } from './OrderReducer';
|
|
6
6
|
export type ShipmentActionType = 'setErrors' | 'setShipments' | 'setShippingMethod';
|
|
7
7
|
export type ShipmentLineItem = LineItem & {
|
|
8
8
|
line_item: LineItem;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Dispatch } from 'react';
|
|
2
|
+
import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
3
3
|
import type { Order } from '@commercelayer/sdk';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import type { getOrderContext } from './OrderReducer';
|
|
5
|
+
import type { AddressResource } from './AddressReducer';
|
|
6
6
|
export type ShippingAddressActionType = 'setShippingAddress' | 'setShippingCustomerAddressId' | 'cleanup';
|
|
7
7
|
export interface ShippingAddressActionPayload {
|
|
8
8
|
_shipping_address_clone_id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Dispatch } from 'react';
|
|
2
|
+
import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
3
3
|
type SkuListsActionType = 'getSkuList' | 'setSkuList';
|
|
4
4
|
export type SkuListsState = Partial<{
|
|
5
5
|
listIds: string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import type { QueryParamsList, Sku } from '@commercelayer/sdk';
|
|
2
|
+
import type { Dispatch } from 'react';
|
|
3
|
+
import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
4
|
+
import type { BaseAction } from '../typings/index';
|
|
5
5
|
type SkuActionType = 'getSkus' | 'setLoading';
|
|
6
6
|
type SkuAction = BaseAction<SkuActionType, SkuState>;
|
|
7
7
|
export type SkuState = Partial<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TResourceError } from '../components/errors/Errors';
|
|
2
2
|
export type CodeErrorType = 'EMPTY_ERROR' | 'FILTER_NOT_ALLOWED' | 'FORBIDDEN' | 'INTERNAL_SERVER_ERROR' | 'INVALID_DATA_FORMAT' | 'INVALID_FIELD' | 'INVALID_FIELD_FORMAT' | 'INVALID_FIELD_VALUE' | 'INVALID_FILTERS_SYNTAX' | 'INVALID_FILTER_VALUE' | 'INVALID_INCLUDE' | 'INVALID_LINKS_OBJECT' | 'INVALID_PAGE_OBJECT' | 'INVALID_PAGE_VALUE' | 'INVALID_RESOURCE' | 'INVALID_RESOURCE_ID' | 'INVALID_SORT_CRITERIA' | 'INVALID_TOKEN' | 'KEY_NOT_INCLUDED_IN_URL' | 'KEY_ORDER_MISMATCH' | 'LOCKED' | 'NOT_ACCEPTABLE' | 'OUT_OF_STOCK' | 'PARAM_MISSING' | 'PARAM_NOT_ALLOWED' | 'PAYMENT_NOT_APPROVED_FOR_EXECUTION' | 'PAYMENT_INTENT_AUTHENTICATION_FAILURE' | 'RECORD_NOT_FOUND' | 'RECORD_NOT_FOUND' | 'RELATION_EXISTS' | 'NO_SHIPPING_METHODS' | 'SAVE_FAILED' | 'TYPE_MISMATCH' | 'UNAUTHORIZED' | 'UNSUPPORTED_MEDIA_TYPE' | 'VALIDATION_ERROR';
|
|
3
3
|
export interface BaseError {
|
|
4
4
|
code: CodeErrorType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Dispatch, ForwardedRef, Ref, JSX } from 'react';
|
|
2
2
|
import PropTypes, { type InferProps } from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import type { BaseError } from './errors';
|
|
4
4
|
export declare const BC: {
|
|
5
5
|
id: PropTypes.Requireable<string>;
|
|
6
6
|
className: PropTypes.Requireable<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { BaseError } from '../typings/errors';
|
|
2
|
+
import type { OrderUpdate, Order, CommerceLayerClient, LineItem, Address, AddressCreate } from '@commercelayer/sdk';
|
|
3
|
+
import type { TCustomerAddress } from '../reducers/CustomerReducer';
|
|
4
4
|
interface BillingAddressControllerProps {
|
|
5
5
|
billing_address?: AddressCreate;
|
|
6
6
|
billingAddressId?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseError } from '../typings/errors';
|
|
2
2
|
export default function customMessages(messages: BaseError[] | undefined, v: BaseError): null | BaseError | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
-
import getSdk from"./getSdk";import{getDomain}from"./getDomain";const availablePaymentMethods=["stripe_payments"];export function getAvailableExpressPayments(paymentMethods){return paymentMethods.filter(payment=>payment.payment_source_type?availablePaymentMethods.includes(payment.payment_source_type):!1)}export async function setExpressFakeAddress({orderId,config,address,email}){const params={include:["shipments.available_shipping_methods"]},sdk=getSdk(config),fakeAddress=await 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),await sdk.orders.update(resource,params),await sdk.orders.retrieve(orderId,params)}export function getExpressShippingMethods(order){const isSingleShipment=order?.shipments?.length===1,shippingMethods=order?.shipments?.map(shipment=>shipment.available_shipping_methods);if(isSingleShipment)return shippingMethods==null?null:shippingMethods.flat().map(method=>({id:method?.id??"",label:method?.name??"",amount:method?.price_amount_for_shipment_cents??0,detail:""}));
|
|
2
|
+
import getSdk from"./getSdk";import{getDomain}from"./getDomain";const availablePaymentMethods=["stripe_payments"];export function getAvailableExpressPayments(paymentMethods){return paymentMethods.filter(payment=>payment.payment_source_type?availablePaymentMethods.includes(payment.payment_source_type):!1)}export async function setExpressFakeAddress({orderId,config,address,email}){const params={include:["shipments.available_shipping_methods"]},sdk=getSdk(config),fakeAddress=await 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),await sdk.orders.update(resource,params),await sdk.orders.retrieve(orderId,params)}export function getExpressShippingMethods(order){const isSingleShipment=order?.shipments?.length===1,shippingMethods=order?.shipments?.map(shipment=>shipment.available_shipping_methods);if(isSingleShipment)return shippingMethods==null?null:shippingMethods.flat().map(method=>({id:method?.id??"",label:method?.name??"",amount:method?.price_amount_for_shipment_cents??0,detail:""}));if(shippingMethods==null)return null;const shippingOptionsAmount=[];return shippingMethods.forEach(methods=>{if(methods!=null){const[firstMethod]=methods;firstMethod!=null&&shippingOptionsAmount.push(firstMethod.price_amount_for_shipment_cents??0)}}),[{id:"shipping",label:"Shipping",amount:shippingOptionsAmount.reduce((a,b)=>a+b,0),detail:""}]}export async function setExpressShippingMethod({config,orderId,selectFirst=!0,selectedShippingMethodId,params}){const sdk=getSdk(config),order=await 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&&await sdk.shipments.update({id:shipmentId,shipping_method:sdk.shipping_methods.relationship(firstShippingMethodId)})}else selectedShippingMethodId!=null&&await sdk.shipments.update({id:shipmentId,shipping_method:sdk.shipping_methods.relationship(selectedShippingMethodId)});else for(const shipment of order?.shipments??[]){const[firstShippingMethodId]=shipment?.available_shipping_methods?.map(method=>method.id)??[];firstShippingMethodId!=null&&await sdk.shipments.update({id:shipment.id,shipping_method:sdk.shipping_methods.relationship(firstShippingMethodId)})}return await sdk.orders.retrieve(order.id,params)}export async function setExpressPlaceOrder({config,orderId,paymentResource,paymentSourceId,placeTheOrder=!1}){const sdk=getSdk(config);if(!placeTheOrder&&paymentResource!=null&&paymentSourceId!=null){const include=["shipments.shipping_method","payment_source","payment_method"];return await sdk.orders.retrieve(orderId,{include}),await sdk[paymentResource].update({id:paymentSourceId,order:sdk.orders.relationship(orderId)}),await sdk.orders.update({id:orderId,payment_source:sdk[paymentResource].relationship(paymentSourceId)}),await sdk[paymentResource].update({id:paymentSourceId,_update:!0}),await sdk.orders.retrieve(orderId,{include})}return await sdk.orders.update({id:orderId,_place:!0})}export 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}=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 {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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 {
|
|
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 {
|
|
4
|
+
import type { Dispatch } from 'react';
|
|
5
5
|
interface GetErrorsParams {
|
|
6
6
|
error: TAPIError;
|
|
7
7
|
resource: TResourceError;
|
|
@@ -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 {
|
|
3
|
+
import type { ExternalPayment } from '@commercelayer/sdk';
|
|
4
4
|
import { type StringReplace } from './replace';
|
|
5
5
|
import { type SnakeToCamelCase } from './snakeToCamelCase';
|
|
6
|
-
import {
|
|
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 {
|
|
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 {
|
|
2
|
+
import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
3
3
|
export default function getSdk({ endpoint, accessToken }: CommerceLayerConfig): ReturnType<typeof Sdk>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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
|
|
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<
|
|
17
|
-
export declare function useOrganizationConfig({ accessToken, endpoint, params }: Partial<OrganizationConfig>):
|
|
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
|
-
import{useState,useEffect}from"react";import{getDomain}from"./getDomain";import getSdk from"./getSdk";import{
|
|
2
|
+
import{useState,useEffect}from"react";import{getDomain}from"./getDomain";import getSdk from"./getSdk";import{getMfeConfig}from"@commercelayer/organization-config";import{jwt}from"./jwt";export function getOrganizationSlug(endpoint){const org={organization:"",domain:"commercelayer.io"},{domain,slug}=getDomain(endpoint);return{organization:slug,domain:domain||org.domain}}export async function getOrganizationConfig(config){const{market}=jwt(config.accessToken),organization=await getSdk(config).organization.retrieve({fields:{organizations:["id","config"]}});return getMfeConfig({jsonConfig:organization.config??{},market:`market:id:${market.id.join(",")}`,params:config.params})}export function useOrganizationConfig({accessToken,endpoint,params}){const[organizationConfig,setOrganizationConfig]=useState(null);return useEffect(()=>{accessToken==null||endpoint==null||getOrganizationConfig({accessToken,endpoint,params}).then(config=>{setOrganizationConfig(config)})},[accessToken,endpoint]),organizationConfig}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function sortPaymentMethods(methods: PaymentMethod[], labels:
|
|
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 {
|
|
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 {
|
|
2
|
-
import {
|
|
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 {
|
|
2
|
-
import {
|
|
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 {
|
|
2
|
-
import {
|
|
1
|
+
import type { BaseState } from '../typings/index';
|
|
2
|
+
import type { BaseError } from '../typings/errors';
|
|
3
3
|
import { type AddressField } from '../reducers/AddressReducer';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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;
|