@commercelayer/react-components 4.20.0 → 4.21.0-beta.1
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/index.cjs +3 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +3266 -0
- package/lib/index.d.ts +3266 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -0
- package/package.json +27 -166
- package/lib/cjs/components/ExternalFunction.d.ts +0 -7
- package/lib/cjs/components/ExternalFunction.js +0 -2
- package/lib/cjs/components/MetadataInput.d.ts +0 -5
- package/lib/cjs/components/MetadataInput.js +0 -2
- package/lib/cjs/components/SubmitButton.d.ts +0 -10
- package/lib/cjs/components/SubmitButton.js +0 -2
- package/lib/cjs/components/addresses/Address.d.ts +0 -31
- package/lib/cjs/components/addresses/Address.js +0 -2
- package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +0 -34
- package/lib/cjs/components/addresses/AddressCountrySelector.js +0 -2
- package/lib/cjs/components/addresses/AddressField.d.ts +0 -61
- package/lib/cjs/components/addresses/AddressField.js +0 -2
- package/lib/cjs/components/addresses/AddressInput.d.ts +0 -34
- package/lib/cjs/components/addresses/AddressInput.js +0 -2
- package/lib/cjs/components/addresses/AddressInputSelect.d.ts +0 -29
- package/lib/cjs/components/addresses/AddressInputSelect.js +0 -2
- package/lib/cjs/components/addresses/AddressStateSelector.d.ts +0 -36
- package/lib/cjs/components/addresses/AddressStateSelector.js +0 -2
- package/lib/cjs/components/addresses/AddressesContainer.d.ts +0 -40
- package/lib/cjs/components/addresses/AddressesContainer.js +0 -2
- package/lib/cjs/components/addresses/AddressesEmpty.d.ts +0 -26
- package/lib/cjs/components/addresses/AddressesEmpty.js +0 -2
- package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +0 -6
- package/lib/cjs/components/addresses/BillingAddressContainer.js +0 -2
- package/lib/cjs/components/addresses/BillingAddressForm.d.ts +0 -34
- package/lib/cjs/components/addresses/BillingAddressForm.js +0 -2
- package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +0 -18
- package/lib/cjs/components/addresses/SaveAddressesButton.js +0 -2
- package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +0 -7
- package/lib/cjs/components/addresses/ShippingAddressContainer.js +0 -2
- package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +0 -31
- package/lib/cjs/components/addresses/ShippingAddressForm.js +0 -2
- package/lib/cjs/components/auth/CommerceLayer.d.ts +0 -25
- package/lib/cjs/components/auth/CommerceLayer.js +0 -2
- package/lib/cjs/components/customers/CustomerAddressForm.d.ts +0 -13
- package/lib/cjs/components/customers/CustomerAddressForm.js +0 -2
- package/lib/cjs/components/customers/CustomerContainer.d.ts +0 -38
- package/lib/cjs/components/customers/CustomerContainer.js +0 -2
- package/lib/cjs/components/customers/CustomerField.d.ts +0 -25
- package/lib/cjs/components/customers/CustomerField.js +0 -2
- package/lib/cjs/components/customers/CustomerInput.d.ts +0 -11
- package/lib/cjs/components/customers/CustomerInput.js +0 -2
- package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +0 -11
- package/lib/cjs/components/customers/CustomerPaymentSource.js +0 -2
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +0 -14
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.js +0 -2
- package/lib/cjs/components/customers/MyAccountLink.d.ts +0 -38
- package/lib/cjs/components/customers/MyAccountLink.js +0 -2
- package/lib/cjs/components/customers/MyIdentityLink.d.ts +0 -59
- package/lib/cjs/components/customers/MyIdentityLink.js +0 -2
- package/lib/cjs/components/customers/SaveCustomerButton.d.ts +0 -12
- package/lib/cjs/components/customers/SaveCustomerButton.js +0 -2
- package/lib/cjs/components/errors/Errors.d.ts +0 -31
- package/lib/cjs/components/errors/Errors.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCard.d.ts +0 -10
- package/lib/cjs/components/gift_cards/GiftCard.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +0 -6
- package/lib/cjs/components/gift_cards/GiftCardContainer.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +0 -7
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +0 -7
- package/lib/cjs/components/gift_cards/GiftCardInput.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +0 -16
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +0 -15
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +0 -11
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +0 -20
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +0 -10
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +0 -2
- package/lib/cjs/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
- package/lib/cjs/components/gift_cards/GiftCardRecipientInput.js +0 -2
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +0 -36
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.js +0 -2
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +0 -10
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +0 -2
- package/lib/cjs/components/line_items/LineItem.d.ts +0 -8
- package/lib/cjs/components/line_items/LineItem.js +0 -2
- package/lib/cjs/components/line_items/LineItemAmount.d.ts +0 -7
- package/lib/cjs/components/line_items/LineItemAmount.js +0 -2
- package/lib/cjs/components/line_items/LineItemCode.d.ts +0 -13
- package/lib/cjs/components/line_items/LineItemCode.js +0 -2
- package/lib/cjs/components/line_items/LineItemField.d.ts +0 -14
- package/lib/cjs/components/line_items/LineItemField.js +0 -2
- package/lib/cjs/components/line_items/LineItemImage.d.ts +0 -17
- package/lib/cjs/components/line_items/LineItemImage.js +0 -2
- package/lib/cjs/components/line_items/LineItemName.d.ts +0 -12
- package/lib/cjs/components/line_items/LineItemName.js +0 -2
- package/lib/cjs/components/line_items/LineItemOption.d.ts +0 -19
- package/lib/cjs/components/line_items/LineItemOption.js +0 -2
- package/lib/cjs/components/line_items/LineItemOptions.d.ts +0 -16
- package/lib/cjs/components/line_items/LineItemOptions.js +0 -2
- package/lib/cjs/components/line_items/LineItemQuantity.d.ts +0 -21
- package/lib/cjs/components/line_items/LineItemQuantity.js +0 -2
- package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +0 -14
- package/lib/cjs/components/line_items/LineItemRemoveLink.js +0 -2
- package/lib/cjs/components/line_items/LineItemsContainer.d.ts +0 -9
- package/lib/cjs/components/line_items/LineItemsContainer.js +0 -2
- package/lib/cjs/components/line_items/LineItemsCount.d.ts +0 -12
- package/lib/cjs/components/line_items/LineItemsCount.js +0 -2
- package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +0 -12
- package/lib/cjs/components/line_items/LineItemsEmpty.js +0 -2
- package/lib/cjs/components/orders/AddToCartButton.d.ts +0 -95
- package/lib/cjs/components/orders/AddToCartButton.js +0 -2
- package/lib/cjs/components/orders/AdjustmentAmount.d.ts +0 -4
- package/lib/cjs/components/orders/AdjustmentAmount.js +0 -2
- package/lib/cjs/components/orders/CartLink.d.ts +0 -47
- package/lib/cjs/components/orders/CartLink.js +0 -2
- package/lib/cjs/components/orders/CheckoutLink.d.ts +0 -28
- package/lib/cjs/components/orders/CheckoutLink.js +0 -2
- package/lib/cjs/components/orders/DiscountAmount.d.ts +0 -4
- package/lib/cjs/components/orders/DiscountAmount.js +0 -2
- package/lib/cjs/components/orders/GiftCardAmount.d.ts +0 -4
- package/lib/cjs/components/orders/GiftCardAmount.js +0 -2
- package/lib/cjs/components/orders/HostedCart.d.ts +0 -58
- package/lib/cjs/components/orders/HostedCart.js +0 -2
- package/lib/cjs/components/orders/OrderContainer.d.ts +0 -58
- package/lib/cjs/components/orders/OrderContainer.js +0 -2
- package/lib/cjs/components/orders/OrderList.d.ts +0 -83
- package/lib/cjs/components/orders/OrderList.js +0 -2
- package/lib/cjs/components/orders/OrderListEmpty.d.ts +0 -17
- package/lib/cjs/components/orders/OrderListEmpty.js +0 -2
- package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +0 -48
- package/lib/cjs/components/orders/OrderListPaginationButtons.js +0 -2
- package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +0 -29
- package/lib/cjs/components/orders/OrderListPaginationInfo.js +0 -2
- package/lib/cjs/components/orders/OrderListRow.d.ts +0 -29
- package/lib/cjs/components/orders/OrderListRow.js +0 -2
- package/lib/cjs/components/orders/OrderNumber.d.ts +0 -5
- package/lib/cjs/components/orders/OrderNumber.js +0 -2
- package/lib/cjs/components/orders/OrderStorage.d.ts +0 -31
- package/lib/cjs/components/orders/OrderStorage.js +0 -2
- package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +0 -4
- package/lib/cjs/components/orders/PaymentMethodAmount.js +0 -2
- package/lib/cjs/components/orders/PlaceOrderButton.d.ts +0 -35
- package/lib/cjs/components/orders/PlaceOrderButton.js +0 -2
- package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +0 -8
- package/lib/cjs/components/orders/PlaceOrderContainer.js +0 -2
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +0 -4
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.js +0 -2
- package/lib/cjs/components/orders/ShippingAmount.d.ts +0 -4
- package/lib/cjs/components/orders/ShippingAmount.js +0 -2
- package/lib/cjs/components/orders/SubTotalAmount.d.ts +0 -4
- package/lib/cjs/components/orders/SubTotalAmount.js +0 -2
- package/lib/cjs/components/orders/TaxesAmount.d.ts +0 -4
- package/lib/cjs/components/orders/TaxesAmount.js +0 -2
- package/lib/cjs/components/orders/TotalAmount.d.ts +0 -4
- package/lib/cjs/components/orders/TotalAmount.js +0 -2
- package/lib/cjs/components/parcels/ParcelField.d.ts +0 -14
- package/lib/cjs/components/parcels/ParcelField.js +0 -2
- package/lib/cjs/components/parcels/ParcelLineItem.d.ts +0 -7
- package/lib/cjs/components/parcels/ParcelLineItem.js +0 -2
- package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +0 -14
- package/lib/cjs/components/parcels/ParcelLineItemField.js +0 -2
- package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +0 -18
- package/lib/cjs/components/parcels/ParcelLineItemsCount.js +0 -2
- package/lib/cjs/components/parcels/Parcels.d.ts +0 -7
- package/lib/cjs/components/parcels/Parcels.js +0 -2
- package/lib/cjs/components/parcels/ParcelsCount.d.ts +0 -18
- package/lib/cjs/components/parcels/ParcelsCount.js +0 -2
- package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/AdyenGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/BraintreeGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/ExternalGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/KlarnaGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +0 -16
- package/lib/cjs/components/payment_gateways/PaymentGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/PaypalGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/StripeGateway.js +0 -2
- package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +0 -5
- package/lib/cjs/components/payment_gateways/WireTransferGateway.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +0 -45
- package/lib/cjs/components/payment_methods/PaymentMethod.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +0 -10
- package/lib/cjs/components/payment_methods/PaymentMethodName.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +0 -8
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +0 -17
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +0 -2
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.d.ts +0 -8
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +0 -2
- package/lib/cjs/components/payment_source/AdyenPayment.d.ts +0 -54
- package/lib/cjs/components/payment_source/AdyenPayment.js +0 -2
- package/lib/cjs/components/payment_source/BraintreePayment.d.ts +0 -32
- package/lib/cjs/components/payment_source/BraintreePayment.js +0 -2
- package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +0 -23
- package/lib/cjs/components/payment_source/CheckoutComPayment.js +0 -2
- package/lib/cjs/components/payment_source/ExternalPayment.d.ts +0 -24
- package/lib/cjs/components/payment_source/ExternalPayment.js +0 -2
- package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +0 -10
- package/lib/cjs/components/payment_source/KlarnaPayment.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSource.d.ts +0 -19
- package/lib/cjs/components/payment_source/PaymentSource.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +0 -15
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +0 -12
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +0 -15
- package/lib/cjs/components/payment_source/PaymentSourceDetail.js +0 -2
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +0 -10
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +0 -2
- package/lib/cjs/components/payment_source/PaypalPayment.d.ts +0 -12
- package/lib/cjs/components/payment_source/PaypalPayment.js +0 -2
- package/lib/cjs/components/payment_source/StripeExpressPayment.d.ts +0 -6
- package/lib/cjs/components/payment_source/StripeExpressPayment.js +0 -2
- package/lib/cjs/components/payment_source/StripePayment.d.ts +0 -21
- package/lib/cjs/components/payment_source/StripePayment.js +0 -2
- package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +0 -12
- package/lib/cjs/components/payment_source/WireTransferPayment.js +0 -2
- package/lib/cjs/components/prices/Price.d.ts +0 -35
- package/lib/cjs/components/prices/Price.js +0 -2
- package/lib/cjs/components/prices/PricesContainer.d.ts +0 -41
- package/lib/cjs/components/prices/PricesContainer.js +0 -2
- package/lib/cjs/components/shipments/Shipment.d.ts +0 -10
- package/lib/cjs/components/shipments/Shipment.js +0 -2
- package/lib/cjs/components/shipments/ShipmentField.d.ts +0 -12
- package/lib/cjs/components/shipments/ShipmentField.js +0 -2
- package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +0 -6
- package/lib/cjs/components/shipments/ShipmentsContainer.js +0 -2
- package/lib/cjs/components/shipments/ShipmentsCount.d.ts +0 -18
- package/lib/cjs/components/shipments/ShipmentsCount.js +0 -2
- package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +0 -8
- package/lib/cjs/components/shipping_methods/ShippingMethod.js +0 -2
- package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +0 -11
- package/lib/cjs/components/shipping_methods/ShippingMethodName.js +0 -2
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +0 -20
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +0 -2
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +0 -17
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +0 -2
- package/lib/cjs/components/skus/AvailabilityContainer.d.ts +0 -34
- package/lib/cjs/components/skus/AvailabilityContainer.js +0 -2
- package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +0 -52
- package/lib/cjs/components/skus/AvailabilityTemplate.js +0 -2
- package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +0 -10
- package/lib/cjs/components/skus/DeliveryLeadTime.js +0 -2
- package/lib/cjs/components/skus/SkuField.d.ts +0 -25
- package/lib/cjs/components/skus/SkuField.js +0 -2
- package/lib/cjs/components/skus/SkuList.d.ts +0 -10
- package/lib/cjs/components/skus/SkuList.js +0 -2
- package/lib/cjs/components/skus/SkuListsContainer.d.ts +0 -6
- package/lib/cjs/components/skus/SkuListsContainer.js +0 -2
- package/lib/cjs/components/skus/Skus.d.ts +0 -18
- package/lib/cjs/components/skus/Skus.js +0 -2
- package/lib/cjs/components/skus/SkusContainer.d.ts +0 -31
- package/lib/cjs/components/skus/SkusContainer.js +0 -2
- package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +0 -7
- package/lib/cjs/components/stock_transfers/StockTransfer.js +0 -2
- package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +0 -10
- package/lib/cjs/components/stock_transfers/StockTransferField.js +0 -2
- package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +0 -26
- package/lib/cjs/components/utils/AddressCardsTemplate.js +0 -2
- package/lib/cjs/components/utils/BaseField.d.ts +0 -8
- package/lib/cjs/components/utils/BaseField.js +0 -2
- package/lib/cjs/components/utils/BaseInput.d.ts +0 -5
- package/lib/cjs/components/utils/BaseInput.js +0 -2
- package/lib/cjs/components/utils/BaseOrderPrice.d.ts +0 -6
- package/lib/cjs/components/utils/BaseOrderPrice.js +0 -2
- package/lib/cjs/components/utils/BaseSelect.d.ts +0 -5
- package/lib/cjs/components/utils/BaseSelect.js +0 -2
- package/lib/cjs/components/utils/ErrorBoundary.d.ts +0 -14
- package/lib/cjs/components/utils/ErrorBoundary.js +0 -2
- package/lib/cjs/components/utils/GenericFieldComponent.d.ts +0 -58
- package/lib/cjs/components/utils/GenericFieldComponent.js +0 -2
- package/lib/cjs/components/utils/Parent.d.ts +0 -6
- package/lib/cjs/components/utils/Parent.js +0 -2
- package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +0 -41
- package/lib/cjs/components/utils/PaymentCardsTemplate.js +0 -2
- package/lib/cjs/components/utils/PriceTemplate.d.ts +0 -8
- package/lib/cjs/components/utils/PriceTemplate.js +0 -2
- package/lib/cjs/components/utils/getAllErrors.d.ts +0 -16
- package/lib/cjs/components/utils/getAllErrors.js +0 -2
- package/lib/cjs/config/currency.d.ts +0 -5
- package/lib/cjs/config/currency.js +0 -2
- package/lib/cjs/context/AddressChildrenContext.d.ts +0 -6
- package/lib/cjs/context/AddressChildrenContext.js +0 -2
- package/lib/cjs/context/AddressContext.d.ts +0 -18
- package/lib/cjs/context/AddressContext.js +0 -2
- package/lib/cjs/context/AvailabilityContext.d.ts +0 -2
- package/lib/cjs/context/AvailabilityContext.js +0 -2
- package/lib/cjs/context/BillingAddressContext.d.ts +0 -9
- package/lib/cjs/context/BillingAddressContext.js +0 -2
- package/lib/cjs/context/BillingAddressFormContext.d.ts +0 -22
- package/lib/cjs/context/BillingAddressFormContext.js +0 -2
- package/lib/cjs/context/CommerceLayerContext.d.ts +0 -6
- package/lib/cjs/context/CommerceLayerContext.js +0 -2
- package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +0 -8
- package/lib/cjs/context/CouponAndGiftCardFormContext.js +0 -2
- package/lib/cjs/context/CustomerAddressFormContext.d.ts +0 -17
- package/lib/cjs/context/CustomerAddressFormContext.js +0 -2
- package/lib/cjs/context/CustomerContext.d.ts +0 -29
- package/lib/cjs/context/CustomerContext.js +0 -2
- package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +0 -11
- package/lib/cjs/context/CustomerPaymentSourceContext.js +0 -2
- package/lib/cjs/context/ExternalFunctionContext.d.ts +0 -11
- package/lib/cjs/context/ExternalFunctionContext.js +0 -2
- package/lib/cjs/context/GiftCardContext.d.ts +0 -10
- package/lib/cjs/context/GiftCardContext.js +0 -2
- package/lib/cjs/context/InStockSubscriptionContext.d.ts +0 -6
- package/lib/cjs/context/InStockSubscriptionContext.js +0 -2
- package/lib/cjs/context/LineItemChildrenContext.d.ts +0 -8
- package/lib/cjs/context/LineItemChildrenContext.js +0 -2
- package/lib/cjs/context/LineItemContext.d.ts +0 -7
- package/lib/cjs/context/LineItemContext.js +0 -2
- package/lib/cjs/context/LineItemOptionChildrenContext.d.ts +0 -9
- package/lib/cjs/context/LineItemOptionChildrenContext.js +0 -2
- package/lib/cjs/context/OrderContext.d.ts +0 -28
- package/lib/cjs/context/OrderContext.js +0 -2
- package/lib/cjs/context/OrderListChildrenContext.d.ts +0 -73
- package/lib/cjs/context/OrderListChildrenContext.js +0 -2
- package/lib/cjs/context/OrderListPaginationContext.d.ts +0 -15
- package/lib/cjs/context/OrderListPaginationContext.js +0 -2
- package/lib/cjs/context/OrderStorageContext.d.ts +0 -10
- package/lib/cjs/context/OrderStorageContext.js +0 -2
- package/lib/cjs/context/ParcelChildrenContext.d.ts +0 -6
- package/lib/cjs/context/ParcelChildrenContext.js +0 -2
- package/lib/cjs/context/ParcelLineItemChildrenContext.d.ts +0 -6
- package/lib/cjs/context/ParcelLineItemChildrenContext.js +0 -2
- package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +0 -10
- package/lib/cjs/context/PaymentMethodChildrenContext.js +0 -2
- package/lib/cjs/context/PaymentMethodContext.d.ts +0 -13
- package/lib/cjs/context/PaymentMethodContext.js +0 -2
- package/lib/cjs/context/PaymentSourceContext.d.ts +0 -14
- package/lib/cjs/context/PaymentSourceContext.js +0 -2
- package/lib/cjs/context/PlaceOrderContext.d.ts +0 -12
- package/lib/cjs/context/PlaceOrderContext.js +0 -2
- package/lib/cjs/context/PricesContext.d.ts +0 -6
- package/lib/cjs/context/PricesContext.js +0 -2
- package/lib/cjs/context/ShipmentChildrenContext.d.ts +0 -13
- package/lib/cjs/context/ShipmentChildrenContext.js +0 -2
- package/lib/cjs/context/ShipmentContext.d.ts +0 -10
- package/lib/cjs/context/ShipmentContext.js +0 -2
- package/lib/cjs/context/ShippingAddressContext.d.ts +0 -9
- package/lib/cjs/context/ShippingAddressContext.js +0 -2
- package/lib/cjs/context/ShippingAddressFormContext.d.ts +0 -3
- package/lib/cjs/context/ShippingAddressFormContext.js +0 -2
- package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +0 -9
- package/lib/cjs/context/ShippingMethodChildrenContext.js +0 -2
- package/lib/cjs/context/SkuChildrenContext.d.ts +0 -8
- package/lib/cjs/context/SkuChildrenContext.js +0 -2
- package/lib/cjs/context/SkuContext.d.ts +0 -8
- package/lib/cjs/context/SkuContext.js +0 -2
- package/lib/cjs/context/SkuListsContext.d.ts +0 -5
- package/lib/cjs/context/SkuListsContext.js +0 -2
- package/lib/cjs/context/StockTransferChildrenContext.d.ts +0 -6
- package/lib/cjs/context/StockTransferChildrenContext.js +0 -2
- package/lib/cjs/hooks/useCommerceLayer.d.ts +0 -12
- package/lib/cjs/hooks/useCommerceLayer.js +0 -2
- package/lib/cjs/hooks/useCustomerContainer.d.ts +0 -12
- package/lib/cjs/hooks/useCustomerContainer.js +0 -2
- package/lib/cjs/hooks/useOrderContainer.d.ts +0 -16
- package/lib/cjs/hooks/useOrderContainer.js +0 -2
- package/lib/cjs/index.d.ts +0 -107
- package/lib/cjs/index.js +0 -2
- package/lib/cjs/reducers/AddressReducer.d.ts +0 -80
- package/lib/cjs/reducers/AddressReducer.js +0 -2
- package/lib/cjs/reducers/AvailabilityReducer.d.ts +0 -53
- package/lib/cjs/reducers/AvailabilityReducer.js +0 -2
- package/lib/cjs/reducers/BillingAddressReducer.d.ts +0 -31
- package/lib/cjs/reducers/BillingAddressReducer.js +0 -2
- package/lib/cjs/reducers/CustomerReducer.d.ts +0 -183
- package/lib/cjs/reducers/CustomerReducer.js +0 -2
- package/lib/cjs/reducers/GiftCardReducer.d.ts +0 -66
- package/lib/cjs/reducers/GiftCardReducer.js +0 -2
- package/lib/cjs/reducers/InStockSubscriptionReducer.d.ts +0 -33
- package/lib/cjs/reducers/InStockSubscriptionReducer.js +0 -2
- package/lib/cjs/reducers/LineItemReducer.d.ts +0 -47
- package/lib/cjs/reducers/LineItemReducer.js +0 -2
- package/lib/cjs/reducers/OrderReducer.d.ts +0 -157
- package/lib/cjs/reducers/OrderReducer.js +0 -2
- package/lib/cjs/reducers/PaymentMethodReducer.d.ts +0 -161
- package/lib/cjs/reducers/PaymentMethodReducer.js +0 -2
- package/lib/cjs/reducers/PlaceOrderReducer.d.ts +0 -72
- package/lib/cjs/reducers/PlaceOrderReducer.js +0 -2
- package/lib/cjs/reducers/PriceReducer.d.ts +0 -35
- package/lib/cjs/reducers/PriceReducer.js +0 -2
- package/lib/cjs/reducers/ShipmentReducer.d.ts +0 -41
- package/lib/cjs/reducers/ShipmentReducer.js +0 -2
- package/lib/cjs/reducers/ShippingAddressReducer.d.ts +0 -32
- package/lib/cjs/reducers/ShippingAddressReducer.js +0 -2
- package/lib/cjs/reducers/SkuListsReducer.d.ts +0 -21
- package/lib/cjs/reducers/SkuListsReducer.js +0 -2
- package/lib/cjs/reducers/SkuReducer.d.ts +0 -21
- package/lib/cjs/reducers/SkuReducer.js +0 -2
- package/lib/cjs/typings/errors.d.ts +0 -15
- package/lib/cjs/typings/errors.js +0 -2
- package/lib/cjs/typings/globals.d.ts +0 -6
- package/lib/cjs/typings/globals.js +0 -2
- package/lib/cjs/typings/index.d.ts +0 -117
- package/lib/cjs/typings/index.js +0 -2
- package/lib/cjs/utils/PropsType.d.ts +0 -33
- package/lib/cjs/utils/PropsType.js +0 -2
- package/lib/cjs/utils/addressesManager.d.ts +0 -64
- package/lib/cjs/utils/addressesManager.js +0 -2
- package/lib/cjs/utils/baseReducer.d.ts +0 -3
- package/lib/cjs/utils/baseReducer.js +0 -2
- package/lib/cjs/utils/browserInfo.d.ts +0 -12
- package/lib/cjs/utils/browserInfo.js +0 -2
- package/lib/cjs/utils/canPlaceOrder.d.ts +0 -5
- package/lib/cjs/utils/canPlaceOrder.js +0 -2
- package/lib/cjs/utils/checkIncludeResource.d.ts +0 -8
- package/lib/cjs/utils/checkIncludeResource.js +0 -2
- package/lib/cjs/utils/compareObjAttribute.d.ts +0 -7
- package/lib/cjs/utils/compareObjAttribute.js +0 -2
- package/lib/cjs/utils/countryStateCity.d.ts +0 -801
- package/lib/cjs/utils/countryStateCity.js +0 -2
- package/lib/cjs/utils/customMessages.d.ts +0 -2
- package/lib/cjs/utils/customMessages.js +0 -2
- package/lib/cjs/utils/customerOrderOptions.d.ts +0 -3
- package/lib/cjs/utils/customerOrderOptions.js +0 -2
- package/lib/cjs/utils/events.d.ts +0 -5
- package/lib/cjs/utils/events.js +0 -2
- package/lib/cjs/utils/expressPaymentHelper.d.ts +0 -92
- package/lib/cjs/utils/expressPaymentHelper.js +0 -2
- package/lib/cjs/utils/filterChildren.d.ts +0 -12
- package/lib/cjs/utils/filterChildren.js +0 -2
- package/lib/cjs/utils/formCleaner.d.ts +0 -4
- package/lib/cjs/utils/formCleaner.js +0 -2
- package/lib/cjs/utils/getAmount.d.ts +0 -7
- package/lib/cjs/utils/getAmount.js +0 -2
- package/lib/cjs/utils/getApplicationLink.d.ts +0 -35
- package/lib/cjs/utils/getApplicationLink.js +0 -2
- package/lib/cjs/utils/getCardDetails.d.ts +0 -16
- package/lib/cjs/utils/getCardDetails.js +0 -2
- package/lib/cjs/utils/getCustomerIdByToken.d.ts +0 -6
- package/lib/cjs/utils/getCustomerIdByToken.js +0 -2
- package/lib/cjs/utils/getDomain.d.ts +0 -4
- package/lib/cjs/utils/getDomain.js +0 -2
- package/lib/cjs/utils/getErrors.d.ts +0 -19
- package/lib/cjs/utils/getErrors.js +0 -2
- package/lib/cjs/utils/getLineItemsCount.d.ts +0 -10
- package/lib/cjs/utils/getLineItemsCount.js +0 -2
- package/lib/cjs/utils/getLoaderComponent.d.ts +0 -3
- package/lib/cjs/utils/getLoaderComponent.js +0 -2
- package/lib/cjs/utils/getPaymentAttributes.d.ts +0 -17
- package/lib/cjs/utils/getPaymentAttributes.js +0 -2
- package/lib/cjs/utils/getPrices.d.ts +0 -6
- package/lib/cjs/utils/getPrices.js +0 -2
- package/lib/cjs/utils/getPublicIp.d.ts +0 -1
- package/lib/cjs/utils/getPublicIp.js +0 -2
- package/lib/cjs/utils/getSdk.d.ts +0 -3
- package/lib/cjs/utils/getSdk.js +0 -2
- package/lib/cjs/utils/getSkus.d.ts +0 -3
- package/lib/cjs/utils/getSkus.js +0 -2
- package/lib/cjs/utils/hasSubscriptions.d.ts +0 -7
- package/lib/cjs/utils/hasSubscriptions.js +0 -2
- package/lib/cjs/utils/hooks/useCustomContext.d.ts +0 -21
- package/lib/cjs/utils/hooks/useCustomContext.js +0 -2
- package/lib/cjs/utils/hooks/useExternalScript.d.ts +0 -1
- package/lib/cjs/utils/hooks/useExternalScript.js +0 -2
- package/lib/cjs/utils/icons.d.ts +0 -2
- package/lib/cjs/utils/icons.js +0 -2
- package/lib/cjs/utils/isDate.d.ts +0 -1
- package/lib/cjs/utils/isDate.js +0 -2
- package/lib/cjs/utils/isEmpty.d.ts +0 -1
- package/lib/cjs/utils/isEmpty.js +0 -2
- package/lib/cjs/utils/isGuestToken.d.ts +0 -6
- package/lib/cjs/utils/isGuestToken.js +0 -2
- package/lib/cjs/utils/isJSON.d.ts +0 -1
- package/lib/cjs/utils/isJSON.js +0 -2
- package/lib/cjs/utils/jwt.d.ts +0 -27
- package/lib/cjs/utils/jwt.js +0 -2
- package/lib/cjs/utils/localStorage.d.ts +0 -11
- package/lib/cjs/utils/localStorage.js +0 -2
- package/lib/cjs/utils/omit.d.ts +0 -1
- package/lib/cjs/utils/omit.js +0 -2
- package/lib/cjs/utils/organization.d.ts +0 -18
- package/lib/cjs/utils/organization.js +0 -2
- package/lib/cjs/utils/payment-methods/sortPaymentMethods.d.ts +0 -2
- package/lib/cjs/utils/payment-methods/sortPaymentMethods.js +0 -2
- package/lib/cjs/utils/pick.d.ts +0 -1
- package/lib/cjs/utils/pick.js +0 -2
- package/lib/cjs/utils/placeholderImages.d.ts +0 -2
- package/lib/cjs/utils/placeholderImages.js +0 -2
- package/lib/cjs/utils/promisify.d.ts +0 -1
- package/lib/cjs/utils/promisify.js +0 -2
- package/lib/cjs/utils/replace.d.ts +0 -2
- package/lib/cjs/utils/replace.js +0 -2
- package/lib/cjs/utils/scrollbarWidth.d.ts +0 -1
- package/lib/cjs/utils/scrollbarWidth.js +0 -2
- package/lib/cjs/utils/shipments.d.ts +0 -3
- package/lib/cjs/utils/shipments.js +0 -2
- package/lib/cjs/utils/snakeToCamelCase.d.ts +0 -5
- package/lib/cjs/utils/snakeToCamelCase.js +0 -2
- package/lib/cjs/utils/stripe/retrievePaymentIntent.d.ts +0 -14
- package/lib/cjs/utils/stripe/retrievePaymentIntent.js +0 -2
- package/lib/cjs/utils/triggerAttributeHelper.d.ts +0 -31
- package/lib/cjs/utils/triggerAttributeHelper.js +0 -2
- package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +0 -8
- package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.js +0 -2
- package/lib/cjs/utils/validateFormFields.d.ts +0 -16
- package/lib/cjs/utils/validateFormFields.js +0 -2
- package/lib/esm/components/ExternalFunction.d.ts +0 -7
- package/lib/esm/components/ExternalFunction.js +0 -2
- package/lib/esm/components/MetadataInput.d.ts +0 -5
- package/lib/esm/components/MetadataInput.js +0 -2
- package/lib/esm/components/SubmitButton.d.ts +0 -10
- package/lib/esm/components/SubmitButton.js +0 -2
- package/lib/esm/components/addresses/Address.d.ts +0 -31
- package/lib/esm/components/addresses/Address.js +0 -2
- package/lib/esm/components/addresses/AddressCountrySelector.d.ts +0 -34
- package/lib/esm/components/addresses/AddressCountrySelector.js +0 -2
- package/lib/esm/components/addresses/AddressField.d.ts +0 -61
- package/lib/esm/components/addresses/AddressField.js +0 -2
- package/lib/esm/components/addresses/AddressInput.d.ts +0 -34
- package/lib/esm/components/addresses/AddressInput.js +0 -2
- package/lib/esm/components/addresses/AddressInputSelect.d.ts +0 -29
- package/lib/esm/components/addresses/AddressInputSelect.js +0 -2
- package/lib/esm/components/addresses/AddressStateSelector.d.ts +0 -36
- package/lib/esm/components/addresses/AddressStateSelector.js +0 -2
- package/lib/esm/components/addresses/AddressesContainer.d.ts +0 -40
- package/lib/esm/components/addresses/AddressesContainer.js +0 -2
- package/lib/esm/components/addresses/AddressesEmpty.d.ts +0 -26
- package/lib/esm/components/addresses/AddressesEmpty.js +0 -2
- package/lib/esm/components/addresses/BillingAddressContainer.d.ts +0 -6
- package/lib/esm/components/addresses/BillingAddressContainer.js +0 -2
- package/lib/esm/components/addresses/BillingAddressForm.d.ts +0 -34
- package/lib/esm/components/addresses/BillingAddressForm.js +0 -2
- package/lib/esm/components/addresses/SaveAddressesButton.d.ts +0 -18
- package/lib/esm/components/addresses/SaveAddressesButton.js +0 -2
- package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +0 -7
- package/lib/esm/components/addresses/ShippingAddressContainer.js +0 -2
- package/lib/esm/components/addresses/ShippingAddressForm.d.ts +0 -31
- package/lib/esm/components/addresses/ShippingAddressForm.js +0 -2
- package/lib/esm/components/auth/CommerceLayer.d.ts +0 -25
- package/lib/esm/components/auth/CommerceLayer.js +0 -2
- package/lib/esm/components/customers/CustomerAddressForm.d.ts +0 -13
- package/lib/esm/components/customers/CustomerAddressForm.js +0 -2
- package/lib/esm/components/customers/CustomerContainer.d.ts +0 -38
- package/lib/esm/components/customers/CustomerContainer.js +0 -2
- package/lib/esm/components/customers/CustomerField.d.ts +0 -25
- package/lib/esm/components/customers/CustomerField.js +0 -2
- package/lib/esm/components/customers/CustomerInput.d.ts +0 -11
- package/lib/esm/components/customers/CustomerInput.js +0 -2
- package/lib/esm/components/customers/CustomerPaymentSource.d.ts +0 -11
- package/lib/esm/components/customers/CustomerPaymentSource.js +0 -2
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +0 -14
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.js +0 -2
- package/lib/esm/components/customers/MyAccountLink.d.ts +0 -38
- package/lib/esm/components/customers/MyAccountLink.js +0 -2
- package/lib/esm/components/customers/MyIdentityLink.d.ts +0 -59
- package/lib/esm/components/customers/MyIdentityLink.js +0 -2
- package/lib/esm/components/customers/SaveCustomerButton.d.ts +0 -12
- package/lib/esm/components/customers/SaveCustomerButton.js +0 -2
- package/lib/esm/components/errors/Errors.d.ts +0 -31
- package/lib/esm/components/errors/Errors.js +0 -2
- package/lib/esm/components/gift_cards/GiftCard.d.ts +0 -10
- package/lib/esm/components/gift_cards/GiftCard.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +0 -6
- package/lib/esm/components/gift_cards/GiftCardContainer.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +0 -7
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardInput.d.ts +0 -7
- package/lib/esm/components/gift_cards/GiftCardInput.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +0 -16
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +0 -15
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +0 -11
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +0 -20
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +0 -10
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.js +0 -2
- package/lib/esm/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
- package/lib/esm/components/gift_cards/GiftCardRecipientInput.js +0 -2
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +0 -36
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.js +0 -2
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +0 -10
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +0 -2
- package/lib/esm/components/line_items/LineItem.d.ts +0 -8
- package/lib/esm/components/line_items/LineItem.js +0 -2
- package/lib/esm/components/line_items/LineItemAmount.d.ts +0 -7
- package/lib/esm/components/line_items/LineItemAmount.js +0 -2
- package/lib/esm/components/line_items/LineItemCode.d.ts +0 -13
- package/lib/esm/components/line_items/LineItemCode.js +0 -2
- package/lib/esm/components/line_items/LineItemField.d.ts +0 -14
- package/lib/esm/components/line_items/LineItemField.js +0 -2
- package/lib/esm/components/line_items/LineItemImage.d.ts +0 -17
- package/lib/esm/components/line_items/LineItemImage.js +0 -2
- package/lib/esm/components/line_items/LineItemName.d.ts +0 -12
- package/lib/esm/components/line_items/LineItemName.js +0 -2
- package/lib/esm/components/line_items/LineItemOption.d.ts +0 -19
- package/lib/esm/components/line_items/LineItemOption.js +0 -2
- package/lib/esm/components/line_items/LineItemOptions.d.ts +0 -16
- package/lib/esm/components/line_items/LineItemOptions.js +0 -2
- package/lib/esm/components/line_items/LineItemQuantity.d.ts +0 -21
- package/lib/esm/components/line_items/LineItemQuantity.js +0 -2
- package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +0 -14
- package/lib/esm/components/line_items/LineItemRemoveLink.js +0 -2
- package/lib/esm/components/line_items/LineItemsContainer.d.ts +0 -9
- package/lib/esm/components/line_items/LineItemsContainer.js +0 -2
- package/lib/esm/components/line_items/LineItemsCount.d.ts +0 -12
- package/lib/esm/components/line_items/LineItemsCount.js +0 -2
- package/lib/esm/components/line_items/LineItemsEmpty.d.ts +0 -12
- package/lib/esm/components/line_items/LineItemsEmpty.js +0 -2
- package/lib/esm/components/orders/AddToCartButton.d.ts +0 -95
- package/lib/esm/components/orders/AddToCartButton.js +0 -2
- package/lib/esm/components/orders/AdjustmentAmount.d.ts +0 -4
- package/lib/esm/components/orders/AdjustmentAmount.js +0 -2
- package/lib/esm/components/orders/CartLink.d.ts +0 -47
- package/lib/esm/components/orders/CartLink.js +0 -2
- package/lib/esm/components/orders/CheckoutLink.d.ts +0 -28
- package/lib/esm/components/orders/CheckoutLink.js +0 -2
- package/lib/esm/components/orders/DiscountAmount.d.ts +0 -4
- package/lib/esm/components/orders/DiscountAmount.js +0 -2
- package/lib/esm/components/orders/GiftCardAmount.d.ts +0 -4
- package/lib/esm/components/orders/GiftCardAmount.js +0 -2
- package/lib/esm/components/orders/HostedCart.d.ts +0 -58
- package/lib/esm/components/orders/HostedCart.js +0 -2
- package/lib/esm/components/orders/OrderContainer.d.ts +0 -58
- package/lib/esm/components/orders/OrderContainer.js +0 -2
- package/lib/esm/components/orders/OrderList.d.ts +0 -83
- package/lib/esm/components/orders/OrderList.js +0 -2
- package/lib/esm/components/orders/OrderListEmpty.d.ts +0 -17
- package/lib/esm/components/orders/OrderListEmpty.js +0 -2
- package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +0 -48
- package/lib/esm/components/orders/OrderListPaginationButtons.js +0 -2
- package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +0 -29
- package/lib/esm/components/orders/OrderListPaginationInfo.js +0 -2
- package/lib/esm/components/orders/OrderListRow.d.ts +0 -29
- package/lib/esm/components/orders/OrderListRow.js +0 -2
- package/lib/esm/components/orders/OrderNumber.d.ts +0 -5
- package/lib/esm/components/orders/OrderNumber.js +0 -2
- package/lib/esm/components/orders/OrderStorage.d.ts +0 -31
- package/lib/esm/components/orders/OrderStorage.js +0 -2
- package/lib/esm/components/orders/PaymentMethodAmount.d.ts +0 -4
- package/lib/esm/components/orders/PaymentMethodAmount.js +0 -2
- package/lib/esm/components/orders/PlaceOrderButton.d.ts +0 -35
- package/lib/esm/components/orders/PlaceOrderButton.js +0 -2
- package/lib/esm/components/orders/PlaceOrderContainer.d.ts +0 -8
- package/lib/esm/components/orders/PlaceOrderContainer.js +0 -2
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +0 -4
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.js +0 -2
- package/lib/esm/components/orders/ShippingAmount.d.ts +0 -4
- package/lib/esm/components/orders/ShippingAmount.js +0 -2
- package/lib/esm/components/orders/SubTotalAmount.d.ts +0 -4
- package/lib/esm/components/orders/SubTotalAmount.js +0 -2
- package/lib/esm/components/orders/TaxesAmount.d.ts +0 -4
- package/lib/esm/components/orders/TaxesAmount.js +0 -2
- package/lib/esm/components/orders/TotalAmount.d.ts +0 -4
- package/lib/esm/components/orders/TotalAmount.js +0 -2
- package/lib/esm/components/parcels/ParcelField.d.ts +0 -14
- package/lib/esm/components/parcels/ParcelField.js +0 -2
- package/lib/esm/components/parcels/ParcelLineItem.d.ts +0 -7
- package/lib/esm/components/parcels/ParcelLineItem.js +0 -2
- package/lib/esm/components/parcels/ParcelLineItemField.d.ts +0 -14
- package/lib/esm/components/parcels/ParcelLineItemField.js +0 -2
- package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +0 -18
- package/lib/esm/components/parcels/ParcelLineItemsCount.js +0 -2
- package/lib/esm/components/parcels/Parcels.d.ts +0 -7
- package/lib/esm/components/parcels/Parcels.js +0 -2
- package/lib/esm/components/parcels/ParcelsCount.d.ts +0 -18
- package/lib/esm/components/parcels/ParcelsCount.js +0 -2
- package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/AdyenGateway.js +0 -2
- package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/BraintreeGateway.js +0 -2
- package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/CheckoutComGateway.js +0 -2
- package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/ExternalGateway.js +0 -2
- package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/KlarnaGateway.js +0 -2
- package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +0 -16
- package/lib/esm/components/payment_gateways/PaymentGateway.js +0 -2
- package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/PaypalGateway.js +0 -2
- package/lib/esm/components/payment_gateways/StripeGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/StripeGateway.js +0 -2
- package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +0 -5
- package/lib/esm/components/payment_gateways/WireTransferGateway.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethod.d.ts +0 -45
- package/lib/esm/components/payment_methods/PaymentMethod.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +0 -10
- package/lib/esm/components/payment_methods/PaymentMethodName.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +0 -8
- package/lib/esm/components/payment_methods/PaymentMethodPrice.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +0 -17
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.js +0 -2
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.d.ts +0 -8
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.js +0 -2
- package/lib/esm/components/payment_source/AdyenPayment.d.ts +0 -54
- package/lib/esm/components/payment_source/AdyenPayment.js +0 -2
- package/lib/esm/components/payment_source/BraintreePayment.d.ts +0 -32
- package/lib/esm/components/payment_source/BraintreePayment.js +0 -2
- package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +0 -23
- package/lib/esm/components/payment_source/CheckoutComPayment.js +0 -2
- package/lib/esm/components/payment_source/ExternalPayment.d.ts +0 -24
- package/lib/esm/components/payment_source/ExternalPayment.js +0 -2
- package/lib/esm/components/payment_source/KlarnaPayment.d.ts +0 -10
- package/lib/esm/components/payment_source/KlarnaPayment.js +0 -2
- package/lib/esm/components/payment_source/PaymentSource.d.ts +0 -19
- package/lib/esm/components/payment_source/PaymentSource.js +0 -2
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +0 -15
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.js +0 -2
- package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +0 -12
- package/lib/esm/components/payment_source/PaymentSourceBrandName.js +0 -2
- package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +0 -15
- package/lib/esm/components/payment_source/PaymentSourceDetail.js +0 -2
- package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +0 -10
- package/lib/esm/components/payment_source/PaymentSourceEditButton.js +0 -2
- package/lib/esm/components/payment_source/PaypalPayment.d.ts +0 -12
- package/lib/esm/components/payment_source/PaypalPayment.js +0 -2
- package/lib/esm/components/payment_source/StripeExpressPayment.d.ts +0 -6
- package/lib/esm/components/payment_source/StripeExpressPayment.js +0 -2
- package/lib/esm/components/payment_source/StripePayment.d.ts +0 -21
- package/lib/esm/components/payment_source/StripePayment.js +0 -2
- package/lib/esm/components/payment_source/WireTransferPayment.d.ts +0 -12
- package/lib/esm/components/payment_source/WireTransferPayment.js +0 -2
- package/lib/esm/components/prices/Price.d.ts +0 -35
- package/lib/esm/components/prices/Price.js +0 -2
- package/lib/esm/components/prices/PricesContainer.d.ts +0 -41
- package/lib/esm/components/prices/PricesContainer.js +0 -2
- package/lib/esm/components/shipments/Shipment.d.ts +0 -10
- package/lib/esm/components/shipments/Shipment.js +0 -2
- package/lib/esm/components/shipments/ShipmentField.d.ts +0 -12
- package/lib/esm/components/shipments/ShipmentField.js +0 -2
- package/lib/esm/components/shipments/ShipmentsContainer.d.ts +0 -6
- package/lib/esm/components/shipments/ShipmentsContainer.js +0 -2
- package/lib/esm/components/shipments/ShipmentsCount.d.ts +0 -18
- package/lib/esm/components/shipments/ShipmentsCount.js +0 -2
- package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +0 -8
- package/lib/esm/components/shipping_methods/ShippingMethod.js +0 -2
- package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +0 -11
- package/lib/esm/components/shipping_methods/ShippingMethodName.js +0 -2
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +0 -20
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.js +0 -2
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +0 -17
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +0 -2
- package/lib/esm/components/skus/AvailabilityContainer.d.ts +0 -34
- package/lib/esm/components/skus/AvailabilityContainer.js +0 -2
- package/lib/esm/components/skus/AvailabilityTemplate.d.ts +0 -52
- package/lib/esm/components/skus/AvailabilityTemplate.js +0 -2
- package/lib/esm/components/skus/DeliveryLeadTime.d.ts +0 -10
- package/lib/esm/components/skus/DeliveryLeadTime.js +0 -2
- package/lib/esm/components/skus/SkuField.d.ts +0 -25
- package/lib/esm/components/skus/SkuField.js +0 -2
- package/lib/esm/components/skus/SkuList.d.ts +0 -10
- package/lib/esm/components/skus/SkuList.js +0 -2
- package/lib/esm/components/skus/SkuListsContainer.d.ts +0 -6
- package/lib/esm/components/skus/SkuListsContainer.js +0 -2
- package/lib/esm/components/skus/Skus.d.ts +0 -18
- package/lib/esm/components/skus/Skus.js +0 -2
- package/lib/esm/components/skus/SkusContainer.d.ts +0 -31
- package/lib/esm/components/skus/SkusContainer.js +0 -2
- package/lib/esm/components/stock_transfers/StockTransfer.d.ts +0 -7
- package/lib/esm/components/stock_transfers/StockTransfer.js +0 -2
- package/lib/esm/components/stock_transfers/StockTransferField.d.ts +0 -10
- package/lib/esm/components/stock_transfers/StockTransferField.js +0 -2
- package/lib/esm/components/utils/AddressCardsTemplate.d.ts +0 -26
- package/lib/esm/components/utils/AddressCardsTemplate.js +0 -2
- package/lib/esm/components/utils/BaseField.d.ts +0 -8
- package/lib/esm/components/utils/BaseField.js +0 -2
- package/lib/esm/components/utils/BaseInput.d.ts +0 -5
- package/lib/esm/components/utils/BaseInput.js +0 -2
- package/lib/esm/components/utils/BaseOrderPrice.d.ts +0 -6
- package/lib/esm/components/utils/BaseOrderPrice.js +0 -2
- package/lib/esm/components/utils/BaseSelect.d.ts +0 -5
- package/lib/esm/components/utils/BaseSelect.js +0 -2
- package/lib/esm/components/utils/ErrorBoundary.d.ts +0 -14
- package/lib/esm/components/utils/ErrorBoundary.js +0 -2
- package/lib/esm/components/utils/GenericFieldComponent.d.ts +0 -58
- package/lib/esm/components/utils/GenericFieldComponent.js +0 -2
- package/lib/esm/components/utils/Parent.d.ts +0 -6
- package/lib/esm/components/utils/Parent.js +0 -2
- package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +0 -41
- package/lib/esm/components/utils/PaymentCardsTemplate.js +0 -2
- package/lib/esm/components/utils/PriceTemplate.d.ts +0 -8
- package/lib/esm/components/utils/PriceTemplate.js +0 -2
- package/lib/esm/components/utils/getAllErrors.d.ts +0 -16
- package/lib/esm/components/utils/getAllErrors.js +0 -2
- package/lib/esm/config/currency.d.ts +0 -5
- package/lib/esm/config/currency.js +0 -2
- package/lib/esm/context/AddressChildrenContext.d.ts +0 -6
- package/lib/esm/context/AddressChildrenContext.js +0 -2
- package/lib/esm/context/AddressContext.d.ts +0 -18
- package/lib/esm/context/AddressContext.js +0 -2
- package/lib/esm/context/AvailabilityContext.d.ts +0 -2
- package/lib/esm/context/AvailabilityContext.js +0 -2
- package/lib/esm/context/BillingAddressContext.d.ts +0 -9
- package/lib/esm/context/BillingAddressContext.js +0 -2
- package/lib/esm/context/BillingAddressFormContext.d.ts +0 -22
- package/lib/esm/context/BillingAddressFormContext.js +0 -2
- package/lib/esm/context/CommerceLayerContext.d.ts +0 -6
- package/lib/esm/context/CommerceLayerContext.js +0 -2
- package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +0 -8
- package/lib/esm/context/CouponAndGiftCardFormContext.js +0 -2
- package/lib/esm/context/CustomerAddressFormContext.d.ts +0 -17
- package/lib/esm/context/CustomerAddressFormContext.js +0 -2
- package/lib/esm/context/CustomerContext.d.ts +0 -29
- package/lib/esm/context/CustomerContext.js +0 -2
- package/lib/esm/context/CustomerPaymentSourceContext.d.ts +0 -11
- package/lib/esm/context/CustomerPaymentSourceContext.js +0 -2
- package/lib/esm/context/ExternalFunctionContext.d.ts +0 -11
- package/lib/esm/context/ExternalFunctionContext.js +0 -2
- package/lib/esm/context/GiftCardContext.d.ts +0 -10
- package/lib/esm/context/GiftCardContext.js +0 -2
- package/lib/esm/context/InStockSubscriptionContext.d.ts +0 -6
- package/lib/esm/context/InStockSubscriptionContext.js +0 -2
- package/lib/esm/context/LineItemChildrenContext.d.ts +0 -8
- package/lib/esm/context/LineItemChildrenContext.js +0 -2
- package/lib/esm/context/LineItemContext.d.ts +0 -7
- package/lib/esm/context/LineItemContext.js +0 -2
- package/lib/esm/context/LineItemOptionChildrenContext.d.ts +0 -9
- package/lib/esm/context/LineItemOptionChildrenContext.js +0 -2
- package/lib/esm/context/OrderContext.d.ts +0 -28
- package/lib/esm/context/OrderContext.js +0 -2
- package/lib/esm/context/OrderListChildrenContext.d.ts +0 -73
- package/lib/esm/context/OrderListChildrenContext.js +0 -2
- package/lib/esm/context/OrderListPaginationContext.d.ts +0 -15
- package/lib/esm/context/OrderListPaginationContext.js +0 -2
- package/lib/esm/context/OrderStorageContext.d.ts +0 -10
- package/lib/esm/context/OrderStorageContext.js +0 -2
- package/lib/esm/context/ParcelChildrenContext.d.ts +0 -6
- package/lib/esm/context/ParcelChildrenContext.js +0 -2
- package/lib/esm/context/ParcelLineItemChildrenContext.d.ts +0 -6
- package/lib/esm/context/ParcelLineItemChildrenContext.js +0 -2
- package/lib/esm/context/PaymentMethodChildrenContext.d.ts +0 -10
- package/lib/esm/context/PaymentMethodChildrenContext.js +0 -2
- package/lib/esm/context/PaymentMethodContext.d.ts +0 -13
- package/lib/esm/context/PaymentMethodContext.js +0 -2
- package/lib/esm/context/PaymentSourceContext.d.ts +0 -14
- package/lib/esm/context/PaymentSourceContext.js +0 -2
- package/lib/esm/context/PlaceOrderContext.d.ts +0 -12
- package/lib/esm/context/PlaceOrderContext.js +0 -2
- package/lib/esm/context/PricesContext.d.ts +0 -6
- package/lib/esm/context/PricesContext.js +0 -2
- package/lib/esm/context/ShipmentChildrenContext.d.ts +0 -13
- package/lib/esm/context/ShipmentChildrenContext.js +0 -2
- package/lib/esm/context/ShipmentContext.d.ts +0 -10
- package/lib/esm/context/ShipmentContext.js +0 -2
- package/lib/esm/context/ShippingAddressContext.d.ts +0 -9
- package/lib/esm/context/ShippingAddressContext.js +0 -2
- package/lib/esm/context/ShippingAddressFormContext.d.ts +0 -3
- package/lib/esm/context/ShippingAddressFormContext.js +0 -2
- package/lib/esm/context/ShippingMethodChildrenContext.d.ts +0 -9
- package/lib/esm/context/ShippingMethodChildrenContext.js +0 -2
- package/lib/esm/context/SkuChildrenContext.d.ts +0 -8
- package/lib/esm/context/SkuChildrenContext.js +0 -2
- package/lib/esm/context/SkuContext.d.ts +0 -8
- package/lib/esm/context/SkuContext.js +0 -2
- package/lib/esm/context/SkuListsContext.d.ts +0 -5
- package/lib/esm/context/SkuListsContext.js +0 -2
- package/lib/esm/context/StockTransferChildrenContext.d.ts +0 -6
- package/lib/esm/context/StockTransferChildrenContext.js +0 -2
- package/lib/esm/hooks/useCommerceLayer.d.ts +0 -12
- package/lib/esm/hooks/useCommerceLayer.js +0 -2
- package/lib/esm/hooks/useCustomerContainer.d.ts +0 -12
- package/lib/esm/hooks/useCustomerContainer.js +0 -2
- package/lib/esm/hooks/useOrderContainer.d.ts +0 -16
- package/lib/esm/hooks/useOrderContainer.js +0 -2
- package/lib/esm/index.d.ts +0 -107
- package/lib/esm/index.js +0 -2
- package/lib/esm/reducers/AddressReducer.d.ts +0 -80
- package/lib/esm/reducers/AddressReducer.js +0 -2
- package/lib/esm/reducers/AvailabilityReducer.d.ts +0 -53
- package/lib/esm/reducers/AvailabilityReducer.js +0 -2
- package/lib/esm/reducers/BillingAddressReducer.d.ts +0 -31
- package/lib/esm/reducers/BillingAddressReducer.js +0 -2
- package/lib/esm/reducers/CustomerReducer.d.ts +0 -183
- package/lib/esm/reducers/CustomerReducer.js +0 -2
- package/lib/esm/reducers/GiftCardReducer.d.ts +0 -66
- package/lib/esm/reducers/GiftCardReducer.js +0 -2
- package/lib/esm/reducers/InStockSubscriptionReducer.d.ts +0 -33
- package/lib/esm/reducers/InStockSubscriptionReducer.js +0 -2
- package/lib/esm/reducers/LineItemReducer.d.ts +0 -47
- package/lib/esm/reducers/LineItemReducer.js +0 -2
- package/lib/esm/reducers/OrderReducer.d.ts +0 -157
- package/lib/esm/reducers/OrderReducer.js +0 -2
- package/lib/esm/reducers/PaymentMethodReducer.d.ts +0 -161
- package/lib/esm/reducers/PaymentMethodReducer.js +0 -2
- package/lib/esm/reducers/PlaceOrderReducer.d.ts +0 -72
- package/lib/esm/reducers/PlaceOrderReducer.js +0 -2
- package/lib/esm/reducers/PriceReducer.d.ts +0 -35
- package/lib/esm/reducers/PriceReducer.js +0 -2
- package/lib/esm/reducers/ShipmentReducer.d.ts +0 -41
- package/lib/esm/reducers/ShipmentReducer.js +0 -2
- package/lib/esm/reducers/ShippingAddressReducer.d.ts +0 -32
- package/lib/esm/reducers/ShippingAddressReducer.js +0 -2
- package/lib/esm/reducers/SkuListsReducer.d.ts +0 -21
- package/lib/esm/reducers/SkuListsReducer.js +0 -2
- package/lib/esm/reducers/SkuReducer.d.ts +0 -21
- package/lib/esm/reducers/SkuReducer.js +0 -2
- package/lib/esm/typings/errors.d.ts +0 -15
- package/lib/esm/typings/errors.js +0 -2
- package/lib/esm/typings/globals.d.ts +0 -6
- package/lib/esm/typings/globals.js +0 -2
- package/lib/esm/typings/index.d.ts +0 -117
- package/lib/esm/typings/index.js +0 -2
- package/lib/esm/utils/PropsType.d.ts +0 -33
- package/lib/esm/utils/PropsType.js +0 -2
- package/lib/esm/utils/addressesManager.d.ts +0 -64
- package/lib/esm/utils/addressesManager.js +0 -2
- package/lib/esm/utils/baseReducer.d.ts +0 -3
- package/lib/esm/utils/baseReducer.js +0 -2
- package/lib/esm/utils/browserInfo.d.ts +0 -12
- package/lib/esm/utils/browserInfo.js +0 -2
- package/lib/esm/utils/canPlaceOrder.d.ts +0 -5
- package/lib/esm/utils/canPlaceOrder.js +0 -2
- package/lib/esm/utils/checkIncludeResource.d.ts +0 -8
- package/lib/esm/utils/checkIncludeResource.js +0 -2
- package/lib/esm/utils/compareObjAttribute.d.ts +0 -7
- package/lib/esm/utils/compareObjAttribute.js +0 -2
- package/lib/esm/utils/countryStateCity.d.ts +0 -801
- package/lib/esm/utils/countryStateCity.js +0 -2
- package/lib/esm/utils/customMessages.d.ts +0 -2
- package/lib/esm/utils/customMessages.js +0 -2
- package/lib/esm/utils/customerOrderOptions.d.ts +0 -3
- package/lib/esm/utils/customerOrderOptions.js +0 -2
- package/lib/esm/utils/events.d.ts +0 -5
- package/lib/esm/utils/events.js +0 -2
- package/lib/esm/utils/expressPaymentHelper.d.ts +0 -92
- package/lib/esm/utils/expressPaymentHelper.js +0 -2
- package/lib/esm/utils/filterChildren.d.ts +0 -12
- package/lib/esm/utils/filterChildren.js +0 -2
- package/lib/esm/utils/formCleaner.d.ts +0 -4
- package/lib/esm/utils/formCleaner.js +0 -2
- package/lib/esm/utils/getAmount.d.ts +0 -7
- package/lib/esm/utils/getAmount.js +0 -2
- package/lib/esm/utils/getApplicationLink.d.ts +0 -35
- package/lib/esm/utils/getApplicationLink.js +0 -2
- package/lib/esm/utils/getCardDetails.d.ts +0 -16
- package/lib/esm/utils/getCardDetails.js +0 -2
- package/lib/esm/utils/getCustomerIdByToken.d.ts +0 -6
- package/lib/esm/utils/getCustomerIdByToken.js +0 -2
- package/lib/esm/utils/getDomain.d.ts +0 -4
- package/lib/esm/utils/getDomain.js +0 -2
- package/lib/esm/utils/getErrors.d.ts +0 -19
- package/lib/esm/utils/getErrors.js +0 -2
- package/lib/esm/utils/getLineItemsCount.d.ts +0 -10
- package/lib/esm/utils/getLineItemsCount.js +0 -2
- package/lib/esm/utils/getLoaderComponent.d.ts +0 -3
- package/lib/esm/utils/getLoaderComponent.js +0 -2
- package/lib/esm/utils/getPaymentAttributes.d.ts +0 -17
- package/lib/esm/utils/getPaymentAttributes.js +0 -2
- package/lib/esm/utils/getPrices.d.ts +0 -6
- package/lib/esm/utils/getPrices.js +0 -2
- package/lib/esm/utils/getPublicIp.d.ts +0 -1
- package/lib/esm/utils/getPublicIp.js +0 -2
- package/lib/esm/utils/getSdk.d.ts +0 -3
- package/lib/esm/utils/getSdk.js +0 -2
- package/lib/esm/utils/getSkus.d.ts +0 -3
- package/lib/esm/utils/getSkus.js +0 -2
- package/lib/esm/utils/hasSubscriptions.d.ts +0 -7
- package/lib/esm/utils/hasSubscriptions.js +0 -2
- package/lib/esm/utils/hooks/useCustomContext.d.ts +0 -21
- package/lib/esm/utils/hooks/useCustomContext.js +0 -2
- package/lib/esm/utils/hooks/useExternalScript.d.ts +0 -1
- package/lib/esm/utils/hooks/useExternalScript.js +0 -2
- package/lib/esm/utils/icons.d.ts +0 -2
- package/lib/esm/utils/icons.js +0 -2
- package/lib/esm/utils/isDate.d.ts +0 -1
- package/lib/esm/utils/isDate.js +0 -2
- package/lib/esm/utils/isEmpty.d.ts +0 -1
- package/lib/esm/utils/isEmpty.js +0 -2
- package/lib/esm/utils/isGuestToken.d.ts +0 -6
- package/lib/esm/utils/isGuestToken.js +0 -2
- package/lib/esm/utils/isJSON.d.ts +0 -1
- package/lib/esm/utils/isJSON.js +0 -2
- package/lib/esm/utils/jwt.d.ts +0 -27
- package/lib/esm/utils/jwt.js +0 -2
- package/lib/esm/utils/localStorage.d.ts +0 -11
- package/lib/esm/utils/localStorage.js +0 -2
- package/lib/esm/utils/omit.d.ts +0 -1
- package/lib/esm/utils/omit.js +0 -2
- package/lib/esm/utils/organization.d.ts +0 -18
- package/lib/esm/utils/organization.js +0 -2
- package/lib/esm/utils/payment-methods/sortPaymentMethods.d.ts +0 -2
- package/lib/esm/utils/payment-methods/sortPaymentMethods.js +0 -2
- package/lib/esm/utils/pick.d.ts +0 -1
- package/lib/esm/utils/pick.js +0 -2
- package/lib/esm/utils/placeholderImages.d.ts +0 -2
- package/lib/esm/utils/placeholderImages.js +0 -2
- package/lib/esm/utils/promisify.d.ts +0 -1
- package/lib/esm/utils/promisify.js +0 -2
- package/lib/esm/utils/replace.d.ts +0 -2
- package/lib/esm/utils/replace.js +0 -2
- package/lib/esm/utils/scrollbarWidth.d.ts +0 -1
- package/lib/esm/utils/scrollbarWidth.js +0 -2
- package/lib/esm/utils/shipments.d.ts +0 -3
- package/lib/esm/utils/shipments.js +0 -2
- package/lib/esm/utils/snakeToCamelCase.d.ts +0 -5
- package/lib/esm/utils/snakeToCamelCase.js +0 -2
- package/lib/esm/utils/stripe/retrievePaymentIntent.d.ts +0 -14
- package/lib/esm/utils/stripe/retrievePaymentIntent.js +0 -2
- package/lib/esm/utils/triggerAttributeHelper.d.ts +0 -31
- package/lib/esm/utils/triggerAttributeHelper.js +0 -2
- package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +0 -8
- package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.js +0 -2
- package/lib/esm/utils/validateFormFields.d.ts +0 -16
- package/lib/esm/utils/validateFormFields.js +0 -2
- package/lib/tsconfig.prod.esm.tsbuildinfo +0 -1
- package/lib/tsconfig.prod.tsbuildinfo +0 -1
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
2
|
-
import type { BaseAction } from '../typings/index';
|
|
3
|
-
import type { Dispatch } from 'react';
|
|
4
|
-
import type { BaseError } from '../typings/errors';
|
|
5
|
-
type InStockSubscriptionActionType = 'setErrors';
|
|
6
|
-
type InStockSubscriptionAction = BaseAction<InStockSubscriptionActionType, InStockSubscriptionState>;
|
|
7
|
-
export interface InStockSubscriptionState {
|
|
8
|
-
errors?: BaseError[];
|
|
9
|
-
}
|
|
10
|
-
export declare const inStockSubscriptionInitialState: InStockSubscriptionState;
|
|
11
|
-
interface TSetInStockSubscriptionParams {
|
|
12
|
-
/**
|
|
13
|
-
* Commerce Layer config
|
|
14
|
-
*/
|
|
15
|
-
config?: CommerceLayerConfig;
|
|
16
|
-
/**
|
|
17
|
-
* Customer email
|
|
18
|
-
*/
|
|
19
|
-
customerEmail?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Sku code
|
|
22
|
-
*/
|
|
23
|
-
skuCode: string;
|
|
24
|
-
/**
|
|
25
|
-
* Dispatch function
|
|
26
|
-
*/
|
|
27
|
-
dispatch?: Dispatch<InStockSubscriptionAction>;
|
|
28
|
-
}
|
|
29
|
-
export declare function setInStockSubscription<T extends TSetInStockSubscriptionParams>({ config, customerEmail, skuCode, dispatch }: T): Promise<{
|
|
30
|
-
success: boolean;
|
|
31
|
-
}>;
|
|
32
|
-
export default function inStockSubscriptionReducer(state: InStockSubscriptionState, reducer: InStockSubscriptionAction): InStockSubscriptionState;
|
|
33
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";import getErrors from"../utils/getErrors";const actionType=["setErrors"];export const inStockSubscriptionInitialState={errors:[]};export async function setInStockSubscription({config,customerEmail,skuCode,dispatch}){try{if(config==null)throw new Error("Access token and endpoint is required");const sdk=getSdk(config),attributes={sku_code:skuCode};return customerEmail!=null&&(attributes.customer_email=customerEmail),await sdk.in_stock_subscriptions.create(attributes),{success:!0}}catch(error){const errors=getErrors({error,resource:"in_stock_subscriptions"});return dispatch?.({type:"setErrors",payload:{errors}}),{success:!1}}}export default function inStockSubscriptionReducer(state,reducer){return baseReducer(state,reducer,actionType)}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { Dispatch } from 'react';
|
|
2
|
-
import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
3
|
-
import type { getOrderContext } from './OrderReducer';
|
|
4
|
-
import type { LoaderType } from '../typings/index';
|
|
5
|
-
import type { BaseError } from '../typings/errors';
|
|
6
|
-
import type { Order, LineItem } from '@commercelayer/sdk';
|
|
7
|
-
export interface UpdateLineItemParams {
|
|
8
|
-
lineItemId: string;
|
|
9
|
-
quantity?: number;
|
|
10
|
-
hasExternalPrice?: boolean;
|
|
11
|
-
dispatch: Dispatch<LineItemAction>;
|
|
12
|
-
config: CommerceLayerConfig;
|
|
13
|
-
getOrder: getOrderContext | undefined;
|
|
14
|
-
orderId: string;
|
|
15
|
-
errors: BaseError[] | undefined;
|
|
16
|
-
}
|
|
17
|
-
export type UpdateLineItem = (params: UpdateLineItemParams) => Promise<void>;
|
|
18
|
-
export type DeleteLineItemParam = Record<string, any> & UpdateLineItemParams;
|
|
19
|
-
export type DeleteLineItem = (params: DeleteLineItemParam) => Promise<void>;
|
|
20
|
-
export interface GetLineItemsParams {
|
|
21
|
-
dispatch: Dispatch<LineItemAction>;
|
|
22
|
-
config: CommerceLayerConfig;
|
|
23
|
-
order: Order | null;
|
|
24
|
-
filters: Record<string, any>;
|
|
25
|
-
}
|
|
26
|
-
export type GetLineItems = (params: GetLineItemsParams) => void;
|
|
27
|
-
export interface LineItemPayload {
|
|
28
|
-
loading?: boolean;
|
|
29
|
-
loader?: LoaderType;
|
|
30
|
-
lineItems?: LineItem[] | null;
|
|
31
|
-
errors?: BaseError[];
|
|
32
|
-
}
|
|
33
|
-
export interface LineItemState extends LineItemPayload {
|
|
34
|
-
updateLineItem?: (lineItemId: string, quantity?: number, hasExternalPrice?: boolean) => Promise<void>;
|
|
35
|
-
deleteLineItem?: (lineItemId: string) => Promise<void>;
|
|
36
|
-
}
|
|
37
|
-
export interface LineItemAction {
|
|
38
|
-
type: LineItemActionType;
|
|
39
|
-
payload: LineItemPayload;
|
|
40
|
-
}
|
|
41
|
-
export declare const getLineItems: GetLineItems;
|
|
42
|
-
export declare function updateLineItem(params: UpdateLineItemParams): Promise<void>;
|
|
43
|
-
export declare const deleteLineItem: DeleteLineItem;
|
|
44
|
-
export declare const lineItemInitialState: LineItemState;
|
|
45
|
-
export type LineItemActionType = 'setLineItems' | 'setErrors' | 'setLoading';
|
|
46
|
-
declare const lineItemReducer: (state: LineItemState, reducer: LineItemAction) => LineItemState;
|
|
47
|
-
export default lineItemReducer;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";import getErrors from"../utils/getErrors";export const getLineItems=params=>{const{order,dispatch,config}=params,sdk=getSdk(config);let allLineItems=[];order&&sdk.orders.retrieve(order?.id,{include:["line_items","line_items.line_item_options.sku_option"],fields:{orders:["line_items"]}}).then(response=>{dispatch({type:"setLoading",payload:{loading:!1}});const items=response.line_items||[];allLineItems=[...allLineItems,...items],dispatch({type:"setLineItems",payload:{lineItems:allLineItems}})}).catch(error=>{const errors=getErrors({error,resource:"line_items"});dispatch({type:"setErrors",payload:{errors}})})};export async function updateLineItem(params){const{config,lineItemId,quantity,hasExternalPrice,getOrder,orderId,dispatch}=params,sdk=getSdk(config);try{await sdk.line_items.update({id:lineItemId,quantity,_external_price:hasExternalPrice}),getOrder&&await getOrder(orderId),dispatch({type:"setErrors",payload:{errors:[]}})}catch(error){const errors=getErrors({error,resource:"line_items",attributes:{id:lineItemId}});dispatch({type:"setErrors",payload:{errors}})}}export const deleteLineItem=async params=>{const{config,lineItemId,getOrder,orderId,dispatch}=params,sdk=getSdk(config);try{await sdk.line_items.delete(lineItemId),getOrder&&await getOrder(orderId),dispatch({type:"setErrors",payload:{errors:[]}})}catch(error){const errors=getErrors({error,resource:"line_items"});dispatch({type:"setErrors",payload:{errors}})}},lineItemInitialState={loading:!1,errors:[],lineItems:[]};const actionType=["setLineItems","setErrors","setLoading"],lineItemReducer=(state,reducer)=>baseReducer(state,reducer,actionType);export default lineItemReducer;
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import type { Dispatch } from 'react';
|
|
2
|
-
import { type SetLocalOrder, type DeleteLocalOrder } from '../utils/localStorage';
|
|
3
|
-
import type { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
4
|
-
import type { BaseMetadataObject } from '../typings/index';
|
|
5
|
-
import type { BaseError } from '../typings/errors';
|
|
6
|
-
import type { AddressResource } from './AddressReducer';
|
|
7
|
-
import type { Order, OrderUpdate } from '@commercelayer/sdk';
|
|
8
|
-
import type { LooseAutocomplete } from '../typings/globals';
|
|
9
|
-
export type GetOrderParams = Partial<{
|
|
10
|
-
clearWhenPlaced: boolean;
|
|
11
|
-
config: CommerceLayerConfig;
|
|
12
|
-
deleteLocalOrder: DeleteLocalOrder;
|
|
13
|
-
dispatch: Dispatch<OrderActions>;
|
|
14
|
-
id: string;
|
|
15
|
-
persistKey: string;
|
|
16
|
-
state: OrderState;
|
|
17
|
-
}>;
|
|
18
|
-
export type GetOrder = (params: GetOrderParams) => Promise<undefined | Order>;
|
|
19
|
-
type CreateOrderParams = Pick<AddToCartParams, 'config' | 'dispatch' | 'persistKey' | 'state' | 'orderMetadata' | 'orderAttributes' | 'setLocalOrder'>;
|
|
20
|
-
export interface AddToCartImportParams extends Omit<AddToCartParams, 'skuCode' | 'skuId' | 'quantity' | 'option' | 'lineItem'> {
|
|
21
|
-
lineItems: CustomLineItem[];
|
|
22
|
-
}
|
|
23
|
-
export type AddToCartReturn = Promise<{
|
|
24
|
-
success: boolean;
|
|
25
|
-
orderId: string | undefined;
|
|
26
|
-
}>;
|
|
27
|
-
export type AddToCartImport = (params: AddToCartImportParams) => AddToCartReturn;
|
|
28
|
-
export type UnsetOrderState = (dispatch: Dispatch<OrderActions>) => void;
|
|
29
|
-
export type ResourceIncluded = 'billing_address' | 'shipping_address' | 'line_items.line_item_options.sku_option' | 'line_items.item' | 'available_customer_payment_sources.payment_source' | 'available_customer_payment_sources.payment_method' | 'shipments.available_shipping_methods' | 'shipments.stock_transfers' | 'shipments.stock_transfers.line_item' | 'shipments.stock_line_items.line_item' | 'shipments.shipping_method' | 'shipments.stock_location' | 'shipments.parcels' | 'shipments.parcels.parcel_line_items' | 'payment_source' | 'available_payment_methods' | 'payment_method';
|
|
30
|
-
type ResourceIncludedLoaded = Partial<Record<ResourceIncluded, boolean>>;
|
|
31
|
-
export interface OrderPayload {
|
|
32
|
-
loading?: boolean;
|
|
33
|
-
orderId?: string;
|
|
34
|
-
order?: Order;
|
|
35
|
-
errors?: BaseError[];
|
|
36
|
-
include?: ResourceIncluded[] | undefined;
|
|
37
|
-
includeLoaded?: ResourceIncludedLoaded;
|
|
38
|
-
withoutIncludes?: boolean;
|
|
39
|
-
}
|
|
40
|
-
export type AddToCartImportValues = Pick<AddToCartImportParams, 'lineItems'>;
|
|
41
|
-
export type getOrderContext = (id: string) => Promise<undefined | Order>;
|
|
42
|
-
export type OrderState = Partial<OrderPayload>;
|
|
43
|
-
export interface OrderActions {
|
|
44
|
-
type: OrderActionType;
|
|
45
|
-
payload: OrderPayload;
|
|
46
|
-
}
|
|
47
|
-
export type OrderActionType = 'setLoading' | 'setOrderId' | 'setOrder' | 'setSingleQuantity' | 'setCurrentSkuCodes' | 'setCurrentSkuPrices' | 'setCurrentItem' | 'setErrors' | 'setSaveAddressToCustomerAddressBook' | 'setGiftCardOrCouponCode' | 'setIncludesResource';
|
|
48
|
-
export declare function createOrder(params: CreateOrderParams): Promise<string>;
|
|
49
|
-
export declare const getApiOrder: GetOrder;
|
|
50
|
-
export interface UpdateOrderArgs {
|
|
51
|
-
id: string;
|
|
52
|
-
attributes: Omit<OrderUpdate, 'id'>;
|
|
53
|
-
dispatch?: Dispatch<OrderActions>;
|
|
54
|
-
include?: string[];
|
|
55
|
-
config?: CommerceLayerConfig;
|
|
56
|
-
state?: OrderState;
|
|
57
|
-
}
|
|
58
|
-
export declare function updateOrder({ id, attributes, dispatch, config, include, state }: UpdateOrderArgs): Promise<{
|
|
59
|
-
success: boolean;
|
|
60
|
-
error?: unknown;
|
|
61
|
-
order?: Order;
|
|
62
|
-
}>;
|
|
63
|
-
export declare const setOrder: (order: Order, dispatch?: Dispatch<OrderActions>) => void;
|
|
64
|
-
export interface AddResourceToInclude {
|
|
65
|
-
resourcesIncluded?: ResourceIncluded[];
|
|
66
|
-
dispatch?: Dispatch<OrderActions>;
|
|
67
|
-
newResource?: ResourceIncluded | ResourceIncluded[];
|
|
68
|
-
resourceIncludedLoaded?: ResourceIncludedLoaded;
|
|
69
|
-
newResourceLoaded?: ResourceIncludedLoaded;
|
|
70
|
-
}
|
|
71
|
-
export declare function addResourceToInclude({ resourcesIncluded, dispatch, newResource, newResourceLoaded, resourceIncludedLoaded }: AddResourceToInclude): void;
|
|
72
|
-
export interface LineItemOption {
|
|
73
|
-
/**
|
|
74
|
-
* SKU Option ID. Ex: mNJEgsJwBn
|
|
75
|
-
*/
|
|
76
|
-
skuOptionId: string;
|
|
77
|
-
/**
|
|
78
|
-
* Set of key-value pairs that represent the selected options. Ex: { message: 'This is a option message' }
|
|
79
|
-
*/
|
|
80
|
-
options: Record<string, string>;
|
|
81
|
-
quantity?: number;
|
|
82
|
-
}
|
|
83
|
-
type TFrequency = 'hourly' | 'daily' | 'weekly' | 'monthly' | 'two-month' | 'three-month' | 'four-month' | 'six-month' | 'yearly';
|
|
84
|
-
export interface CustomLineItem {
|
|
85
|
-
name?: string;
|
|
86
|
-
imageUrl?: string | null;
|
|
87
|
-
metadata?: Record<string, string>;
|
|
88
|
-
frequency?: LooseAutocomplete<TFrequency>;
|
|
89
|
-
externalPrice?: boolean;
|
|
90
|
-
_update_quantity?: boolean;
|
|
91
|
-
}
|
|
92
|
-
export type AddToCartParams = Partial<{
|
|
93
|
-
bundleCode: string;
|
|
94
|
-
skuCode: string;
|
|
95
|
-
persistKey: string;
|
|
96
|
-
config: CommerceLayerConfig;
|
|
97
|
-
dispatch: Dispatch<OrderActions>;
|
|
98
|
-
state: Partial<OrderState>;
|
|
99
|
-
quantity: number;
|
|
100
|
-
lineItemOption: LineItemOption;
|
|
101
|
-
lineItem: CustomLineItem;
|
|
102
|
-
orderMetadata: BaseMetadataObject;
|
|
103
|
-
orderAttributes: Record<string, any>;
|
|
104
|
-
errors: BaseError[];
|
|
105
|
-
setLocalOrder: SetLocalOrder;
|
|
106
|
-
buyNowMode: boolean;
|
|
107
|
-
checkoutUrl: string;
|
|
108
|
-
openMiniCart: boolean;
|
|
109
|
-
}>;
|
|
110
|
-
export declare function addToCart(params: AddToCartParams): Promise<{
|
|
111
|
-
success: boolean;
|
|
112
|
-
orderId?: string;
|
|
113
|
-
}>;
|
|
114
|
-
export declare const unsetOrderState: UnsetOrderState;
|
|
115
|
-
interface OrderErrors {
|
|
116
|
-
dispatch?: Dispatch<OrderActions>;
|
|
117
|
-
errors: BaseError[];
|
|
118
|
-
}
|
|
119
|
-
export declare function setOrderErrors({ dispatch, errors }: OrderErrors): {
|
|
120
|
-
success: boolean;
|
|
121
|
-
};
|
|
122
|
-
export type SaveAddressToCustomerAddressBook = (params: {
|
|
123
|
-
dispatch?: Dispatch<OrderActions>;
|
|
124
|
-
type: AddressResource;
|
|
125
|
-
value: boolean;
|
|
126
|
-
}) => void;
|
|
127
|
-
export declare const saveAddressToCustomerAddressBook: SaveAddressToCustomerAddressBook;
|
|
128
|
-
interface TSetGiftCardOrCouponCodeParams {
|
|
129
|
-
code: string;
|
|
130
|
-
codeType: OrderCodeType;
|
|
131
|
-
dispatch?: Dispatch<OrderActions>;
|
|
132
|
-
config?: CommerceLayerConfig;
|
|
133
|
-
order?: Order;
|
|
134
|
-
include?: string[];
|
|
135
|
-
state?: OrderState;
|
|
136
|
-
}
|
|
137
|
-
export declare function setGiftCardOrCouponCode({ code, codeType, dispatch, config, order, include, state }: TSetGiftCardOrCouponCodeParams): Promise<{
|
|
138
|
-
success: boolean;
|
|
139
|
-
order?: Order;
|
|
140
|
-
}>;
|
|
141
|
-
export type CodeType = 'coupon' | 'gift_card';
|
|
142
|
-
export type OrderCodeType = `${CodeType}_code`;
|
|
143
|
-
interface TRemoveGiftCardOrCouponCodeParams {
|
|
144
|
-
codeType: OrderCodeType;
|
|
145
|
-
dispatch?: Dispatch<OrderActions>;
|
|
146
|
-
config?: CommerceLayerConfig;
|
|
147
|
-
order?: Order;
|
|
148
|
-
include?: string[];
|
|
149
|
-
state?: OrderState;
|
|
150
|
-
}
|
|
151
|
-
export declare function removeGiftCardOrCouponCode({ codeType, dispatch, config, order, include, state }: TRemoveGiftCardOrCouponCodeParams): Promise<{
|
|
152
|
-
success: boolean;
|
|
153
|
-
order?: Order;
|
|
154
|
-
}>;
|
|
155
|
-
export declare const orderInitialState: Partial<OrderState>;
|
|
156
|
-
declare const orderReducer: (state: OrderState, reducer: OrderActions) => OrderState;
|
|
157
|
-
export default orderReducer;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{setCustomerOrderParam}from"../utils/localStorage";import baseReducer from"../utils/baseReducer";import isEmpty from"lodash/isEmpty";import getSdk from"../utils/getSdk";import getErrors,{setErrors}from"../utils/getErrors";import{getOrganizationConfig}from"../utils/organization";import{publish}from"../utils/events";import{getDomain}from"../utils/getDomain";import{getApplicationLink}from"../utils/getApplicationLink";const actionType=["setLoading","setOrderId","setOrder","setSingleQuantity","setCurrentSkuCodes","setCurrentSkuPrices","setErrors","setCurrentItem","setSaveAddressToCustomerAddressBook","setIncludesResource"];export async function createOrder(params){if(params){const{persistKey,state,dispatch,config,orderMetadata:metadata,orderAttributes={},setLocalOrder}=params;if(state?.orderId)return state.orderId;const sdk=config!=null?getSdk(config):void 0;try{if(sdk==null)return"";const o=await sdk?.orders.create({metadata,...orderAttributes});return dispatch&&dispatch({type:"setOrderId",payload:{orderId:o?.id}}),persistKey&&setLocalOrder&&setLocalOrder(persistKey,o.id),o.id}catch(error){const errors=getErrors({error,resource:"orders"});console.error("Create order",errors),dispatch&&setErrors({currentErrors:state?.errors,newErrors:errors,dispatch})}}return""}export const getApiOrder=async params=>{const{id,dispatch,config,clearWhenPlaced,persistKey,deleteLocalOrder,state}=params,sdk=config!=null?getSdk(config):void 0;try{if(sdk==null)return;const options={};state?.include&&state.include.length>0&&(options.include=state.include);const order=await sdk.orders.retrieve(id??"",options);return clearWhenPlaced&&order.editable===!1?(persistKey&&deleteLocalOrder&&deleteLocalOrder(persistKey),dispatch&&dispatch({type:"setOrder",payload:{order:void 0,orderId:""}})):dispatch&&dispatch({type:"setOrder",payload:{order,orderId:order.id}}),order}catch(error){const errors=getErrors({error,resource:"orders"});console.error("Retrieve order",errors),dispatch&&setErrors({currentErrors:state?.errors,newErrors:errors,dispatch});return}};export async function updateOrder({id,attributes,dispatch,config,include,state}){const sdk=config!=null?getSdk(config):void 0;try{if(sdk==null)return{success:!1};const resource={...attributes,id};await sdk.orders.update(resource,{include});const order=await getApiOrder({id,config,dispatch,state});return dispatch&&order&&dispatch({type:"setOrder",payload:{order}}),{success:!0,order}}catch(error){const errors=getErrors({error,resource:"orders"});return dispatch&&(setOrderErrors({errors,dispatch}),dispatch({type:"setErrors",payload:{errors}})),{success:!1,error}}}export const setOrder=(order,dispatch)=>{dispatch&&dispatch({type:"setOrder",payload:{order}})};export function addResourceToInclude({resourcesIncluded=[],dispatch,newResource,newResourceLoaded,resourceIncludedLoaded}){const payload={include:void 0,includeLoaded:void 0};if(newResource){const resources=typeof newResource=="string"?[newResource]:newResource;payload.include=[...new Set([...resourcesIncluded,...resources])],resources.forEach(resource=>{const includeLoaded={...payload.includeLoaded,[resource]:!0};payload.includeLoaded=includeLoaded})}else delete payload.include;const payloadIncludeLoaded={...resourceIncludedLoaded,...newResourceLoaded,...payload.includeLoaded&&payload.includeLoaded};payload.includeLoaded=payloadIncludeLoaded,dispatch&&dispatch({type:"setIncludesResource",payload:{...payload,withoutIncludes:!1}})}export async function addToCart(params){const{skuCode,bundleCode,quantity,config,dispatch,lineItem,state,errors=[],buyNowMode,checkoutUrl,lineItemOption,openMiniCart=!0}=params;try{if(config){const sdk=getSdk(config),id=await createOrder(params);if(id){const order=sdk.orders.relationship(id),name=lineItem?.name,imageUrl=lineItem?.imageUrl,metadata=lineItem?.metadata,frequency=lineItem?.frequency,externalPrice=lineItem?.externalPrice;if(buyNowMode)if(state?.order?.line_items)await Promise.all(state?.order?.line_items.map(async lineItem2=>{await sdk.line_items.delete(lineItem2.id)}));else{const{line_items:lineItems}=await sdk.orders.retrieve(id,{fields:["line_items"],include:["line_items"]});lineItems&&lineItems?.length>0&&await Promise.all(lineItems.map(async lineItem2=>{await sdk.line_items.delete(lineItem2.id)}))}const attrs={order,sku_code:skuCode,name,image_url:imageUrl,quantity:quantity??1,_update_quantity:lineItem?._update_quantity??!0,bundle_code:bundleCode,metadata,frequency};externalPrice===!0&&(attrs._external_price=externalPrice);const newLineItem=await sdk.line_items.create(attrs);if(lineItemOption!=null){const{skuOptionId,options,quantity:quantity2}=lineItemOption,skuOption=sdk.sku_options.relationship(skuOptionId),lineItemRel=sdk.line_items.relationship(newLineItem.id),lineItemOptionsAttributes={quantity:quantity2??1,options,sku_option:skuOption,line_item:lineItemRel};await sdk.line_item_options.create(lineItemOptionsAttributes),await getApiOrder({id,...params})}else await getApiOrder({id,...params,state});if(!isEmpty(errors)&&dispatch&&dispatch({type:"setErrors",payload:{errors:[]}}),buyNowMode&&id&&config?.accessToken!=null&&config?.endpoint!=null){const params2=`${id}?accessToken=${config.accessToken??""}`,{domain,slug}=getDomain(config.endpoint),href=getApplicationLink({slug,orderId:id,accessToken:config.accessToken,applicationType:"checkout",domain}),organizationConfig=await getOrganizationConfig({accessToken:config.accessToken,endpoint:config.endpoint,params:{accessToken:config.accessToken,orderId:order?.id,slug}}),redirectUrl=checkoutUrl?`${checkoutUrl}/${params2}`:organizationConfig?.links?.checkout??href;location.href=redirectUrl}else openMiniCart&&publish("open-cart");return{success:!0,orderId:id}}}return{success:!1}}catch(error){const errors2=getErrors({error,resource:"orders"});return console.error("Add to cart",errors2),dispatch&&setErrors({currentErrors:state?.errors,newErrors:errors2,dispatch}),{success:!1}}}export const unsetOrderState=dispatch=>{dispatch({type:"setOrderId",payload:{orderId:""}}),dispatch({type:"setOrder",payload:{order:void 0}})};export function setOrderErrors({dispatch,errors=[]}){return dispatch&&dispatch({type:"setErrors",payload:{errors}}),{success:!1}}export const saveAddressToCustomerAddressBook=({type,value,dispatch})=>{const k=`_save_${type}_to_customer_address_book`,v=`${value.toString()}`;setCustomerOrderParam(k,v),dispatch&&dispatch({type:"setSaveAddressToCustomerAddressBook",payload:{[k]:v}})};export async function setGiftCardOrCouponCode({code,codeType,dispatch,config,order,include,state}){try{if(config&&order&&code&&dispatch){const attributes={[codeType]:code},{success,order:currentOrder,error}=await updateOrder({id:order.id,attributes,config,include,dispatch,state});if(!success)throw error;return dispatch({type:"setErrors",payload:{errors:[]}}),{success,order:currentOrder}}return{success:!1}}catch(error){const errors=getErrors({error,resource:"orders",field:codeType});return dispatch&&setOrderErrors({errors,dispatch}),{success:!1}}}export async function removeGiftCardOrCouponCode({codeType,dispatch,config,order,include,state}){try{if(config&&order&&dispatch){const attributes={[codeType]:""},orderUpdated=await updateOrder({id:order.id,attributes,config,include,dispatch,state});return dispatch({type:"setErrors",payload:{errors:[]}}),{success:!0,order:orderUpdated?.order}}return{success:!1}}catch(error){const errors=getErrors({error,resource:"orders",field:codeType});return console.error("Remove gift card o coupon code",errors),dispatch&&setOrderErrors({errors,dispatch}),{success:!1}}}export const orderInitialState={loading:!0,orderId:"",order:void 0,errors:[],include:void 0,withoutIncludes:!0};const orderReducer=(state,reducer)=>baseReducer(state,reducer,actionType);export default orderReducer;
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import type { AdyenPaymentConfig } from "../components/payment_source/AdyenPayment";
|
|
2
|
-
import type { BraintreeConfig } from "../components/payment_source/BraintreePayment";
|
|
3
|
-
import type { PaypalConfig } from "../components/payment_source/PaypalPayment";
|
|
4
|
-
import type { StripeConfig } from "../components/payment_source/StripePayment";
|
|
5
|
-
import type { WireTransferConfig } from "../components/payment_source/WireTransferPayment";
|
|
6
|
-
import type { CommerceLayerConfig } from "../context/CommerceLayerContext";
|
|
7
|
-
import type { getOrderContext, updateOrder } from "./OrderReducer";
|
|
8
|
-
import type { BaseError } from "../typings/errors";
|
|
9
|
-
import type { Order, PaymentMethod, StripePayment, WireTransfer, AdyenPayment, BraintreePayment, CheckoutComPayment, ExternalPayment, PaypalPayment, KlarnaPayment } from "@commercelayer/sdk";
|
|
10
|
-
import type { Dispatch, MutableRefObject } from "react";
|
|
11
|
-
import type { CheckoutComConfig } from "../components/payment_source/CheckoutComPayment";
|
|
12
|
-
import type { ExternalPaymentConfig } from "../components/payment_source/ExternalPayment";
|
|
13
|
-
import type { ResourceKeys } from "../utils/getPaymentAttributes";
|
|
14
|
-
export type PaymentSourceType = Order["payment_source"];
|
|
15
|
-
interface Card {
|
|
16
|
-
type: string;
|
|
17
|
-
brand: string;
|
|
18
|
-
last4: string;
|
|
19
|
-
exp_year: number;
|
|
20
|
-
exp_month: number;
|
|
21
|
-
}
|
|
22
|
-
export interface PaymentSourceObject {
|
|
23
|
-
adyen_payments: AdyenPayment & {
|
|
24
|
-
payment_request_data?: {
|
|
25
|
-
payment_method?: Card;
|
|
26
|
-
};
|
|
27
|
-
payment_response?: {
|
|
28
|
-
resultCode?: "Authorised";
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
braintree_payments: BraintreePayment & {
|
|
32
|
-
options?: {
|
|
33
|
-
card: Card;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
external_payments: ExternalPayment & {
|
|
37
|
-
payment_source_token?: string;
|
|
38
|
-
};
|
|
39
|
-
paypal_payments: PaypalPayment;
|
|
40
|
-
stripe_payments: StripePayment & {
|
|
41
|
-
options?: {
|
|
42
|
-
card: Card;
|
|
43
|
-
};
|
|
44
|
-
payment_method?: {
|
|
45
|
-
card: Card;
|
|
46
|
-
type: string | "klarna" | "card";
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
wire_transfers: WireTransfer;
|
|
50
|
-
checkout_com_payments: CheckoutComPayment & {
|
|
51
|
-
payment_response: {
|
|
52
|
-
source?: Pick<Card, "last4"> & {
|
|
53
|
-
scheme: string;
|
|
54
|
-
expiry_year: number;
|
|
55
|
-
expiry_month: number;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
klarna_payments: KlarnaPayment;
|
|
60
|
-
}
|
|
61
|
-
export type PaymentMethodActionType = "setErrors" | "setPaymentMethods" | "setPaymentMethodConfig" | "setPaymentSource" | "setPaymentRef" | "setLoading";
|
|
62
|
-
export type PaymentRef = MutableRefObject<null | HTMLFormElement>;
|
|
63
|
-
export interface PaymentMethodActionPayload {
|
|
64
|
-
errors: BaseError[];
|
|
65
|
-
paymentMethods: PaymentMethod[] | null;
|
|
66
|
-
currentPaymentMethodType: PaymentResource;
|
|
67
|
-
currentPaymentMethodId: string;
|
|
68
|
-
currentPaymentMethodRef: PaymentRef;
|
|
69
|
-
currentCustomerPaymentSourceId: string | null;
|
|
70
|
-
config: PaymentMethodConfig;
|
|
71
|
-
paymentSource: Order["payment_source"] | null;
|
|
72
|
-
loading: boolean;
|
|
73
|
-
}
|
|
74
|
-
export declare function setLoading({ loading, dispatch, }: {
|
|
75
|
-
loading: boolean;
|
|
76
|
-
dispatch?: Dispatch<PaymentMethodAction>;
|
|
77
|
-
}): void;
|
|
78
|
-
export type SetPaymentRef = (args: {
|
|
79
|
-
ref: PaymentRef;
|
|
80
|
-
dispatch?: Dispatch<PaymentMethodAction>;
|
|
81
|
-
}) => void;
|
|
82
|
-
export declare const setPaymentRef: SetPaymentRef;
|
|
83
|
-
export type PaymentMethodState = Partial<PaymentMethodActionPayload>;
|
|
84
|
-
export interface PaymentMethodAction {
|
|
85
|
-
type: PaymentMethodActionType;
|
|
86
|
-
payload: Partial<PaymentMethodActionPayload>;
|
|
87
|
-
}
|
|
88
|
-
export declare const paymentMethodInitialState: PaymentMethodState;
|
|
89
|
-
export type SetPaymentMethodErrors = <V extends BaseError[]>(errors: V, dispatch?: Dispatch<PaymentMethodAction>) => void;
|
|
90
|
-
export declare const setPaymentMethodErrors: SetPaymentMethodErrors;
|
|
91
|
-
type GetPaymentMethods = (args: {
|
|
92
|
-
order: Order;
|
|
93
|
-
dispatch: Dispatch<PaymentMethodAction>;
|
|
94
|
-
}) => Promise<void>;
|
|
95
|
-
export declare const getPaymentMethods: GetPaymentMethods;
|
|
96
|
-
export type PaymentResource = keyof PaymentSourceObject;
|
|
97
|
-
export type PaymentResourceKey = "braintreePayment" | "stripePayment" | "klarnaPayment" | "wireTransfer" | "paypalPayment" | "adyenPayment" | "checkoutComPayment";
|
|
98
|
-
export type SDKPaymentResource = "AdyenPayment" | "BraintreePayment" | "ExternalPayment" | "PaypalPayment" | "StripePayment" | "WireTransfer" | "CheckoutComPayment";
|
|
99
|
-
interface TSetPaymentMethodParams {
|
|
100
|
-
config?: CommerceLayerConfig;
|
|
101
|
-
dispatch?: Dispatch<PaymentMethodAction>;
|
|
102
|
-
updateOrder?: typeof updateOrder;
|
|
103
|
-
setOrderErrors?: (collection: any) => {
|
|
104
|
-
success: boolean;
|
|
105
|
-
};
|
|
106
|
-
order?: Order;
|
|
107
|
-
paymentMethodId: string;
|
|
108
|
-
paymentResource?: PaymentResource;
|
|
109
|
-
}
|
|
110
|
-
export declare function setPaymentMethod({ config, dispatch, order, paymentMethodId, updateOrder, setOrderErrors, paymentResource, }: TSetPaymentMethodParams): Promise<{
|
|
111
|
-
success: boolean;
|
|
112
|
-
order?: Order;
|
|
113
|
-
}>;
|
|
114
|
-
type PaymentSourceTypes = (StripePayment & WireTransfer) | (StripePayment | WireTransfer);
|
|
115
|
-
export type SetPaymentSourceResponse = {
|
|
116
|
-
order: Order;
|
|
117
|
-
paymentSource: PaymentSourceTypes;
|
|
118
|
-
} | null;
|
|
119
|
-
export interface SetPaymentSourceParams extends Omit<PaymentMethodState, "config"> {
|
|
120
|
-
config?: CommerceLayerConfig;
|
|
121
|
-
dispatch?: Dispatch<PaymentMethodAction>;
|
|
122
|
-
getOrder?: getOrderContext;
|
|
123
|
-
attributes?: Record<string, unknown>;
|
|
124
|
-
order?: Order;
|
|
125
|
-
paymentResource: PaymentResource;
|
|
126
|
-
paymentSourceId?: string;
|
|
127
|
-
customerPaymentSourceId?: string;
|
|
128
|
-
updateOrder?: typeof updateOrder;
|
|
129
|
-
}
|
|
130
|
-
export declare function setPaymentSource({ config, dispatch, getOrder, attributes, order, paymentResource, customerPaymentSourceId, paymentSourceId, updateOrder, errors: currentErrors, }: SetPaymentSourceParams): Promise<PaymentSourceType | undefined | null>;
|
|
131
|
-
export type UpdatePaymentSource = (args: {
|
|
132
|
-
id: string;
|
|
133
|
-
attributes: Record<string, any>;
|
|
134
|
-
paymentResource: PaymentResource;
|
|
135
|
-
config?: CommerceLayerConfig;
|
|
136
|
-
dispatch?: Dispatch<PaymentMethodAction>;
|
|
137
|
-
}) => Promise<void>;
|
|
138
|
-
export declare const updatePaymentSource: UpdatePaymentSource;
|
|
139
|
-
export type DestroyPaymentSource = (args: {
|
|
140
|
-
paymentSourceId: string;
|
|
141
|
-
paymentResource: PaymentResource;
|
|
142
|
-
dispatch?: Dispatch<PaymentMethodAction>;
|
|
143
|
-
updateOrder?: typeof updateOrder;
|
|
144
|
-
orderId?: string;
|
|
145
|
-
}) => Promise<void>;
|
|
146
|
-
export declare const destroyPaymentSource: DestroyPaymentSource;
|
|
147
|
-
export interface PaymentMethodConfig {
|
|
148
|
-
adyenPayment?: AdyenPaymentConfig;
|
|
149
|
-
braintreePayment?: BraintreeConfig;
|
|
150
|
-
checkoutComPayment?: CheckoutComConfig;
|
|
151
|
-
externalPayment?: ExternalPaymentConfig;
|
|
152
|
-
klarnaPayment?: Pick<AdyenPaymentConfig, "placeOrderCallback"> & Pick<StripeConfig, "containerClassName">;
|
|
153
|
-
paypalPayment?: PaypalConfig;
|
|
154
|
-
stripePayment?: StripeConfig;
|
|
155
|
-
wireTransfer?: Partial<WireTransferConfig>;
|
|
156
|
-
}
|
|
157
|
-
type SetPaymentMethodConfig = (config: PaymentMethodConfig, dispatch: Dispatch<PaymentMethodAction>) => void;
|
|
158
|
-
export declare const setPaymentMethodConfig: SetPaymentMethodConfig;
|
|
159
|
-
export declare function getPaymentConfig<R extends PaymentResource = PaymentResource, K extends PaymentMethodConfig = PaymentMethodConfig>(paymentResource: R, config: K): Pick<K, ResourceKeys<R>>;
|
|
160
|
-
declare const paymentMethodReducer: (state: PaymentMethodState, reducer: PaymentMethodAction) => PaymentMethodState;
|
|
161
|
-
export default paymentMethodReducer;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import baseReducer from"../utils/baseReducer";import getErrors,{setErrors}from"../utils/getErrors";import getSdk from"../utils/getSdk";import{snakeToCamelCase}from"../utils/snakeToCamelCase";import{replace}from"../utils/replace";import{pick}from"../utils/pick";export function setLoading({loading,dispatch}){dispatch&&dispatch({type:"setLoading",payload:{loading}})}export const setPaymentRef=({ref,dispatch})=>{ref&&dispatch&&dispatch({type:"setPaymentRef",payload:{currentPaymentMethodRef:ref}})},paymentMethodInitialState={errors:[],paymentMethods:void 0},setPaymentMethodErrors=(errors,dispatch)=>{dispatch&&dispatch({type:"setErrors",payload:{errors}})},getPaymentMethods=async({order,dispatch})=>{const paymentMethods=order.available_payment_methods,paymentMethod=order.payment_method,paymentSource=order.payment_source;dispatch({type:"setPaymentMethods",payload:{paymentMethods,currentPaymentMethodId:paymentMethod?.id,currentPaymentMethodType:paymentMethod?.payment_source_type,paymentSource}})};export async function setPaymentMethod({config,dispatch,order,paymentMethodId,updateOrder,setOrderErrors,paymentResource}){let response={success:!1};try{if(config&&order&&dispatch&&paymentResource){localStorage.removeItem("_save_payment_source_to_customer_wallet");const attributes={payment_method:getSdk(config).payment_methods.relationship(paymentMethodId)};updateOrder!=null&&(response=await updateOrder({id:order.id,attributes})),dispatch({type:"setPaymentMethods",payload:{currentPaymentMethodId:paymentMethodId,currentPaymentMethodType:paymentResource,errors:[]}}),setOrderErrors&&setOrderErrors([])}return response}catch(error){const errors=getErrors({error,resource:"orders",field:paymentResource});return console.error("Set payment method",errors),response}}export async function setPaymentSource({config,dispatch,getOrder,attributes,order,paymentResource,customerPaymentSourceId,paymentSourceId,updateOrder,errors:currentErrors}){try{const isAlreadyPlaced=order?.status==="placed";if(config&&order&&!isAlreadyPlaced){let paymentSource;const sdk=getSdk(config);if(customerPaymentSourceId){if(updateOrder!=null){const{order:orderUpdated}=await updateOrder({id:order.id,attributes:{_customer_payment_source_id:customerPaymentSourceId}});dispatch!=null&&orderUpdated!=null&&dispatch({type:"setPaymentSource",payload:{paymentSource:orderUpdated.payment_source,currentCustomerPaymentSourceId:orderUpdated.payment_source?.id}})}}else{if(paymentSourceId){const attrs={id:paymentSourceId,...attributes};paymentSource=attributes!=null?await sdk[paymentResource].update(attrs):await sdk[paymentResource].retrieve(paymentSourceId)}else{const attrs={...attributes,order:sdk.orders.relationship(order.id)};paymentSource=await sdk[paymentResource].create(attrs)}return getOrder&&await getOrder(order.id),dispatch&&dispatch({type:"setPaymentSource",payload:{paymentSource,errors:[],currentCustomerPaymentSourceId:null}}),paymentSource}}}catch(error){const errors=getErrors({error,resource:"payment_methods",field:paymentResource});if(errors!=null&&errors?.length>0){const[error2]=errors;if(error2?.status==="401"&&getOrder!=null&&order!=null){const currentOrder=await getOrder(order?.id);currentOrder?.status!=null&&!["placed","approved"].includes(currentOrder.status)&&(console.error("Set payment source:",errors),setErrors({currentErrors,newErrors:errors,dispatch}))}}else setErrors({currentErrors,newErrors:errors,dispatch})}}export const updatePaymentSource=async({id,attributes,config,dispatch,paymentResource})=>{if(config)try{const paymentSource=await getSdk(config)[paymentResource].update({id,...attributes});dispatch&&dispatch({type:"setPaymentSource",payload:{paymentSource}})}catch(err){console.error("Update payment source:",err)}},destroyPaymentSource=async({paymentSourceId,paymentResource,dispatch})=>{paymentSourceId&&paymentResource&&dispatch&&dispatch({type:"setPaymentSource",payload:{paymentSource:void 0}})},setPaymentMethodConfig=(config,dispatch)=>{dispatch({type:"setPaymentMethodConfig",payload:{config}})};export function getPaymentConfig(paymentResource,config){const resourceKeys=replace(replace(paymentResource,"payments","payment"),"transfers","transfer"),resource=snakeToCamelCase(resourceKeys);return pick(config,[resource])}const type=["setErrors","setPaymentMethodConfig","setPaymentMethods","setPaymentSource","setPaymentRef","setLoading"],paymentMethodReducer=(state,reducer)=>baseReducer(state,reducer,type);export default paymentMethodReducer;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { Dispatch, RefObject } from "react";
|
|
2
|
-
import type { CommerceLayerConfig } from "../context/CommerceLayerContext";
|
|
3
|
-
import type { BaseError } from "../typings/errors";
|
|
4
|
-
import type { Order } from "@commercelayer/sdk";
|
|
5
|
-
import type { PaymentResource, PaymentSourceType } from "./PaymentMethodReducer";
|
|
6
|
-
export type PlaceOrderActionType = "setErrors" | "setPlaceOrderPermitted" | "setButtonRef" | "setStatus";
|
|
7
|
-
export interface PlaceOrderOptions {
|
|
8
|
-
paypalPayerId?: string;
|
|
9
|
-
adyen?: {
|
|
10
|
-
MD?: string;
|
|
11
|
-
PaRes?: string;
|
|
12
|
-
redirectResult?: string;
|
|
13
|
-
};
|
|
14
|
-
checkoutCom?: {
|
|
15
|
-
session_id: string;
|
|
16
|
-
};
|
|
17
|
-
stripe?: {
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated
|
|
20
|
-
* Use `paymentIntentClientSecret` instead
|
|
21
|
-
*/
|
|
22
|
-
redirectStatus?: string;
|
|
23
|
-
paymentIntentClientSecret: string;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export interface PlaceOrderActionPayload {
|
|
27
|
-
errors: BaseError[];
|
|
28
|
-
isPermitted: boolean;
|
|
29
|
-
paymentType: PaymentResource;
|
|
30
|
-
paymentSecret: string;
|
|
31
|
-
paymentId: string;
|
|
32
|
-
paymentSource: PaymentSourceType;
|
|
33
|
-
options?: PlaceOrderOptions;
|
|
34
|
-
placeOrderButtonRef?: RefObject<HTMLButtonElement | null>;
|
|
35
|
-
status: "placing" | "standby";
|
|
36
|
-
}
|
|
37
|
-
export declare function setButtonRef(ref: RefObject<HTMLButtonElement | null>, dispatch: Dispatch<PlaceOrderAction>): void;
|
|
38
|
-
export type PlaceOrderState = Partial<PlaceOrderActionPayload>;
|
|
39
|
-
export interface PlaceOrderAction {
|
|
40
|
-
type: PlaceOrderActionType;
|
|
41
|
-
payload: Partial<PlaceOrderActionPayload>;
|
|
42
|
-
}
|
|
43
|
-
export declare const placeOrderInitialState: PlaceOrderState;
|
|
44
|
-
export declare function setPlaceOrderErrors<V extends BaseError[]>(errors: V, dispatch: Dispatch<PlaceOrderAction>): void;
|
|
45
|
-
interface TPlaceOrderPermittedParams {
|
|
46
|
-
config?: CommerceLayerConfig;
|
|
47
|
-
dispatch: Dispatch<PlaceOrderAction>;
|
|
48
|
-
order?: Order;
|
|
49
|
-
options?: PlaceOrderOptions;
|
|
50
|
-
}
|
|
51
|
-
export declare function placeOrderPermitted({ config, order, dispatch, options, }: TPlaceOrderPermittedParams): void;
|
|
52
|
-
interface TSetPlaceOrderParams {
|
|
53
|
-
config?: CommerceLayerConfig;
|
|
54
|
-
order?: Order;
|
|
55
|
-
state?: PlaceOrderState;
|
|
56
|
-
setOrderErrors?: (errors: BaseError[]) => void;
|
|
57
|
-
paymentSource?: PaymentSourceType;
|
|
58
|
-
include?: string[];
|
|
59
|
-
setOrder?: (order: Order) => void;
|
|
60
|
-
currentCustomerPaymentSourceId?: string | null;
|
|
61
|
-
}
|
|
62
|
-
export declare function setPlaceOrder({ state, order, config, setOrderErrors, paymentSource, setOrder, include, currentCustomerPaymentSourceId, }: TSetPlaceOrderParams): Promise<{
|
|
63
|
-
placed: boolean;
|
|
64
|
-
errors?: BaseError[];
|
|
65
|
-
order?: Order;
|
|
66
|
-
}>;
|
|
67
|
-
export declare function setPlaceOrderStatus({ status, dispatch, }: {
|
|
68
|
-
status: "placing" | "standby";
|
|
69
|
-
dispatch?: Dispatch<PlaceOrderAction>;
|
|
70
|
-
}): void;
|
|
71
|
-
declare const placeOrderReducer: (state: PlaceOrderState, reducer: PlaceOrderAction) => PlaceOrderState;
|
|
72
|
-
export default placeOrderReducer;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import baseReducer from"../utils/baseReducer";import isEmpty from"lodash/isEmpty";import{isDoNotShip,shipmentsFilled}from"../utils/shipments";import{saveBillingAddress,saveShippingAddress,saveToWallet}from"../utils/customerOrderOptions";import getSdk from"../utils/getSdk";import getErrors from"../utils/getErrors";import{isGuestToken}from"../utils/isGuestToken";import{setCustomerOrderParam}from"../utils/localStorage";import{hasSubscriptions}from"../utils/hasSubscriptions";import{updateOrderSubscriptionCustomerPaymentSource}from"../utils/updateOrderSubscriptionCustomerPaymentSource";export function setButtonRef(ref,dispatch){ref?.current!=null&&dispatch({type:"setButtonRef",payload:{placeOrderButtonRef:ref}})}export const placeOrderInitialState={errors:[],isPermitted:!1,status:"standby"};export function setPlaceOrderErrors(errors,dispatch){dispatch&&dispatch({type:"setErrors",payload:{errors}})}export function placeOrderPermitted({config,order,dispatch,options}){if(order&&config){let isPermitted=!0;order.privacy_url&&order.terms_url&&(isPermitted=localStorage.getItem("privacy-terms")==="true");const billingAddress=order.billing_address,shippingAddress=order.shipping_address,doNotShip=isDoNotShip(order.line_items),shipments=order.shipments,shipment=shipments&&shipmentsFilled(shipments),paymentMethod=order.payment_method,paymentSource=order.payment_source;order.total_amount_with_taxes_cents!==0&&isEmpty(paymentMethod?.id)&&(isPermitted=!1),isEmpty(billingAddress)&&(isPermitted=!1),isEmpty(shippingAddress)&&!doNotShip&&(isPermitted=!1),!isEmpty(shipments)&&!shipment&&(isPermitted=!1),paymentSource?.mismatched_amounts&&(isPermitted=!1),dispatch({type:"setPlaceOrderPermitted",payload:{isPermitted,paymentType:paymentMethod?.payment_source_type,paymentSecret:paymentSource?.client_secret,paymentId:paymentSource?.options?.id,paymentSource,options}})}}export async function setPlaceOrder({state,order,config,setOrderErrors,paymentSource,setOrder,include,currentCustomerPaymentSourceId}){const response={placed:!1};if(state&&config&&order){if(order?.status==="placed")return{placed:!0,order};const sdk=getSdk(config),{options,paymentType}=state;try{const lastOrderStatus=await sdk.orders.retrieve(order.id);if(lastOrderStatus.status==="placed")return{placed:!0,order:lastOrderStatus};if(paymentType==="paypal_payments"&&paymentSource?.type==="paypal_payments"){if(!options?.paypalPayerId&&paymentSource?.approval_url)return window.location.href=paymentSource?.approval_url,response;await sdk[paymentType].update({id:paymentSource.id,paypal_payer_id:options?.paypalPayerId})}if(paymentType==="checkout_com_payments"&&paymentSource&&options?.checkoutCom?.session_id){const payment=await sdk[paymentType].update({id:paymentSource.id,_details:!0,session_id:options?.checkoutCom?.session_id});if(payment?.payment_response?.status!=="Authorized"){const[action]=payment?.payment_response?.actions||[""];throw{errors:[{code:"PAYMENT_NOT_APPROVED_FOR_EXECUTION",message:action?.response_summary,resource:"orders",field:"checkout_com_payments"}]}}}const updateAttributes={id:order.id,_place:!0};if(saveBillingAddress()&&await sdk.orders.update({id:order.id,_save_billing_address_to_customer_address_book:!0}),saveShippingAddress()&&await sdk.orders.update({id:order.id,_save_shipping_address_to_customer_address_book:!0}),paymentType==="stripe_payments"&&paymentSource!=null){const ps=paymentSource,currentUrl=window.location.href,returnUrl=ps?.options?.return_url;currentUrl!==returnUrl&&await sdk[paymentType].update({id:paymentSource.id,options:{return_url:currentUrl}})}switch(hasSubscriptions(order)&&config?.accessToken!=null&&!isGuestToken(config.accessToken)&¤tCustomerPaymentSourceId==null&&setCustomerOrderParam("_save_payment_source_to_customer_wallet","true"),paymentType){case"braintree_payments":{const total=order?.total_amount_cents??0;await Promise.all([saveToWallet()&&total>0&&sdk.orders.update({id:order.id,_save_payment_source_to_customer_wallet:!0})]);const orderUpdated=await sdk.orders.update(updateAttributes,{include});return setOrder&&setOrder(orderUpdated),setOrderErrors&&setOrderErrors([]),updateOrderSubscriptionCustomerPaymentSource(orderUpdated,paymentType,sdk),{placed:!0,order:orderUpdated}}default:{const orderUpdated=await sdk.orders.update(updateAttributes,{include}),total=orderUpdated?.total_amount_cents??0;return setOrder&&setOrder(orderUpdated),await Promise.all([saveToWallet()&&total>0&&sdk.orders.update({id:order.id,_save_payment_source_to_customer_wallet:!0}).catch(error=>{const errors=getErrors({error,resource:"orders",field:paymentType});setOrderErrors&&setOrderErrors(errors)})]).then(()=>{updateOrderSubscriptionCustomerPaymentSource(orderUpdated,paymentType,sdk)}),{placed:!0,order:orderUpdated}}}}catch(error){const errors=getErrors({error,resource:"orders",field:paymentType});return setOrderErrors&&setOrderErrors(errors),{...response,errors}}}return response}export function setPlaceOrderStatus({status,dispatch}){dispatch?.({type:"setStatus",payload:{status}})}const type=["setErrors","setPlaceOrderPermitted","setButtonRef","setStatus"],placeOrderReducer=(state,reducer)=>baseReducer(state,reducer,type);export default placeOrderReducer;
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
export type Prices = Record<string, Price | Price[]>;
|
|
7
|
-
type SkuCodesPrice = string[];
|
|
8
|
-
export interface PriceState {
|
|
9
|
-
loading: boolean;
|
|
10
|
-
prices: Prices;
|
|
11
|
-
skuCodes: SkuCodesPrice;
|
|
12
|
-
errors?: BaseError[];
|
|
13
|
-
skuCode?: string;
|
|
14
|
-
setSkuCodes?: typeof setSkuCodes;
|
|
15
|
-
loader?: LoaderType;
|
|
16
|
-
}
|
|
17
|
-
export interface PriceAction extends BaseAction {
|
|
18
|
-
type: PriceActionType;
|
|
19
|
-
}
|
|
20
|
-
export declare const priceInitialState: PriceState;
|
|
21
|
-
export declare function setSkuCodes({ skuCodes, dispatch }: {
|
|
22
|
-
skuCodes: SkuCodesPrice;
|
|
23
|
-
dispatch?: Dispatch<PriceAction>;
|
|
24
|
-
}): void;
|
|
25
|
-
export declare function getSkusPrice(skuCodes: SkuCodesPrice, { config, dispatch, perPage, filters }: {
|
|
26
|
-
config: CommerceLayerConfig;
|
|
27
|
-
dispatch: Dispatch<PriceAction>;
|
|
28
|
-
perPage: QueryPageSize;
|
|
29
|
-
filters: Record<string, any>;
|
|
30
|
-
}): void;
|
|
31
|
-
export type UnsetPriceState = (dispatch: Dispatch<PriceAction>) => void;
|
|
32
|
-
export declare const unsetPriceState: UnsetPriceState;
|
|
33
|
-
export type PriceActionType = 'setLoading' | 'setPrices' | 'setSkuCodes' | 'setErrors';
|
|
34
|
-
declare const priceReducer: (state: PriceState, reducer: PriceAction) => PriceState;
|
|
35
|
-
export default priceReducer;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import getPrices from"../utils/getPrices";import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";import getErrors from"../utils/getErrors";export const priceInitialState={loading:!0,prices:{},skuCodes:[],errors:[]};export function setSkuCodes({skuCodes,dispatch}){dispatch&&dispatch({type:"setSkuCodes",payload:{skuCodes}})}export function getSkusPrice(skuCodes,{config,dispatch,perPage,filters}){let allPrices={};const sdk=getSdk(config);sdk.prices.list({filters:{sku_code_in:skuCodes.join(","),...filters},pageSize:perPage}).then(async response=>{const pricesObj=getPrices(response);allPrices={...allPrices,...pricesObj},dispatch({type:"setPrices",payload:{prices:allPrices}}),dispatch({type:"setLoading",payload:{loading:!1}});const meta=response.meta;if(meta.pageCount>1)for(let pageNumber=meta.currentPage+1;pageNumber<=meta.pageCount;pageNumber++){const pageResponse=await sdk.prices.list({filters:{sku_code_in:skuCodes.join(","),...filters},pageSize:perPage,pageNumber}),pricesObj2=getPrices(pageResponse);allPrices={...allPrices,...pricesObj2},dispatch({type:"setPrices",payload:{prices:allPrices}})}}).catch(error=>{const errors=getErrors({error,resource:"prices"});dispatch({type:"setErrors",payload:{errors}})})}export const unsetPriceState=dispatch=>{dispatch({type:"setPrices",payload:{prices:{}}}),dispatch({type:"setLoading",payload:{loading:!1}})};const typeAction=["setLoading","setPrices","setSkuCodes","setErrors"],priceReducer=(state,reducer)=>baseReducer(state,reducer,typeAction);export default priceReducer;
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
export type ShipmentActionType = 'setErrors' | 'setShipments' | 'setShippingMethod';
|
|
7
|
-
export type ShipmentLineItem = LineItem & {
|
|
8
|
-
line_item: LineItem;
|
|
9
|
-
};
|
|
10
|
-
export interface ShipmentActionPayload {
|
|
11
|
-
errors: BaseError[];
|
|
12
|
-
shipments: Shipment[] | null;
|
|
13
|
-
deliveryLeadTimes: DeliveryLeadTime[];
|
|
14
|
-
}
|
|
15
|
-
export type ShipmentState = Partial<ShipmentActionPayload>;
|
|
16
|
-
export interface ShipmentAction {
|
|
17
|
-
type: ShipmentActionType;
|
|
18
|
-
payload: Partial<ShipmentActionPayload>;
|
|
19
|
-
}
|
|
20
|
-
export declare const shipmentInitialState: ShipmentState;
|
|
21
|
-
export type SetShipmentErrors = <V extends BaseError[]>(errors: V, dispatch?: Dispatch<ShipmentAction>) => void;
|
|
22
|
-
export declare const setShipmentErrors: SetShipmentErrors;
|
|
23
|
-
type GetShipments = (args: {
|
|
24
|
-
order: Order;
|
|
25
|
-
dispatch: Dispatch<ShipmentAction>;
|
|
26
|
-
config: CommerceLayerConfig;
|
|
27
|
-
}) => Promise<void>;
|
|
28
|
-
export declare const getShipments: GetShipments;
|
|
29
|
-
interface TSetShippingMethodParams {
|
|
30
|
-
config: CommerceLayerConfig;
|
|
31
|
-
shipmentId: string;
|
|
32
|
-
shippingMethodId: string;
|
|
33
|
-
order?: Order;
|
|
34
|
-
getOrder?: getOrderContext;
|
|
35
|
-
}
|
|
36
|
-
export declare function setShippingMethod({ config, shipmentId, shippingMethodId, getOrder, order }: TSetShippingMethodParams): Promise<{
|
|
37
|
-
success: boolean;
|
|
38
|
-
order?: Order;
|
|
39
|
-
}>;
|
|
40
|
-
declare const shipmentReducer: (state: ShipmentState, reducer: ShipmentAction) => ShipmentState;
|
|
41
|
-
export default shipmentReducer;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";import{canPlaceOrder}from"../utils/canPlaceOrder";export const shipmentInitialState={errors:[]},setShipmentErrors=(errors,dispatch)=>{dispatch&&dispatch({type:"setErrors",payload:{errors}})},getShipments=async({order,dispatch,config})=>{try{const sdk=getSdk(config),shipments=order.shipments;let allDeliveryLeadTimes=[],currentPage=1,totalPages=1;do{const response=await sdk.delivery_lead_times.list({include:["shipping_method","stock_location"],pageNumber:currentPage});allDeliveryLeadTimes=allDeliveryLeadTimes.concat(response),totalPages=response.meta.pageCount,currentPage++}while(currentPage<=totalPages);dispatch({type:"setShipments",payload:{shipments,deliveryLeadTimes:allDeliveryLeadTimes}})}catch(error){console.error(error)}};export async function setShippingMethod({config,shipmentId,shippingMethodId,getOrder,order}){try{if(order!=null&&!canPlaceOrder(order))return{success:!1,order};if(shippingMethodId){const sdk=getSdk(config);if(await sdk.shipments.update({id:shipmentId,shipping_method:sdk.shipping_methods.relationship(shippingMethodId)}),getOrder!=null&&order!=null)return{success:!0,order:await getOrder(order.id)}}return{success:!1}}catch(error){return console.error(error),{success:!1}}}const type=["setErrors","setShipments","setShippingMethod"],shipmentReducer=(state,reducer)=>baseReducer(state,reducer,type);export default shipmentReducer;
|