@dropins/storefront-checkout 0.1.0-alpha33 → 0.1.0-alpha35
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/__generated__/types.d.ts +16556 -0
- package/api/errors/errors.d.ts +27 -0
- package/api/errors/index.d.ts +2 -0
- package/api/estimateShippingMethods/estimateShippingMethods.d.ts +13 -0
- package/api/estimateShippingMethods/fixtures.d.ts +8 -0
- package/api/estimateShippingMethods/graphql/estimateShippingMethods.graphql.d.ts +2 -0
- package/api/estimateShippingMethods/graphql/index.d.ts +2 -0
- package/api/estimateShippingMethods/index.d.ts +2 -0
- package/api/fetch-graphql/fetch-graphql.d.ts +8 -0
- package/api/fetch-graphql/index.d.ts +2 -0
- package/api/fetchAddressFormFields/fetchAddressFormFields.d.ts +4 -0
- package/api/fetchAddressFormFields/fixtures.d.ts +5 -0
- package/api/fetchAddressFormFields/graphql/fetchAddressFormFields.graphql.d.ts +2 -0
- package/api/fetchAddressFormFields/index.d.ts +3 -0
- package/api/getCart/fixtures.d.ts +12 -0
- package/api/getCart/getCart.d.ts +2 -0
- package/api/getCart/graphql/getCart.graphql.d.ts +4 -0
- package/api/getCart/graphql/index.d.ts +2 -0
- package/api/getCart/index.d.ts +2 -0
- package/api/getCountries/fixtures.d.ts +6 -0
- package/api/getCountries/getCountries.d.ts +4 -0
- package/api/getCountries/graphql/getCountries.graphql.d.ts +2 -0
- package/api/getCountries/index.d.ts +2 -0
- package/api/getCustomer/getCustomer.d.ts +4 -0
- package/api/getCustomer/graphql/getCustomer.graphql.d.ts +2 -0
- package/api/getCustomer/graphql/index.d.ts +2 -0
- package/api/getCustomer/index.d.ts +2 -0
- package/api/getRegions/fixtures.d.ts +5 -0
- package/api/getRegions/getRegions.d.ts +5 -0
- package/api/getRegions/graphql/getRegions.graphql.d.ts +2 -0
- package/api/getRegions/index.d.ts +2 -0
- package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +2 -0
- package/api/getStoreConfig/index.d.ts +2 -0
- package/api/index.d.ts +19 -0
- package/api/initialize/index.d.ts +2 -0
- package/api/initialize/initialize.d.ts +10 -0
- package/api/isEmailAvailable/graphql/isEmailAvailable.graphql.d.ts +2 -0
- package/api/isEmailAvailable/index.d.ts +2 -0
- package/api/isEmailAvailable/isEmailAvailable.d.ts +4 -0
- package/api/placeOrder/fixtures.d.ts +6 -0
- package/api/placeOrder/graphql/index.d.ts +2 -0
- package/api/placeOrder/graphql/placeOrder.graphql.d.ts +2 -0
- package/api/placeOrder/index.d.ts +2 -0
- package/api/placeOrder/placeOrder.d.ts +2 -0
- package/api/redirect/index.d.ts +2 -0
- package/api/redirect/redirect.d.ts +2 -0
- package/api/setBillingAddress/graphql/setBillingAddress.graphql.d.ts +2 -0
- package/api/setBillingAddress/index.d.ts +2 -0
- package/api/setBillingAddress/setBillingAddress.d.ts +13 -0
- package/api/setGuestEmailOnCart/graphql/setGuestEmailOnCart.graphql.d.ts +2 -0
- package/api/setGuestEmailOnCart/index.d.ts +2 -0
- package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +2 -0
- package/api/setPaymentMethod/graphql/setPaymentMethod.graphql.d.ts +2 -0
- package/api/setPaymentMethod/index.d.ts +2 -0
- package/api/setPaymentMethod/setPaymentMethod.d.ts +2 -0
- package/api/setShippingAddress/graphql/setShippingAddress.graphql.d.ts +2 -0
- package/api/setShippingAddress/index.d.ts +2 -0
- package/api/setShippingAddress/setShippingAddress.d.ts +30 -0
- package/api/setShippingMethods/graphql/setShippingMethodsOnCart.graphql.d.ts +2 -0
- package/api/setShippingMethods/index.d.ts +2 -0
- package/api/setShippingMethods/setShippingMethods.d.ts +2 -0
- package/api/utils/dispatchApiCall.d.ts +41 -0
- package/api/utils/enqueueRequest.d.ts +2 -0
- package/api/utils/filterControlledErrors.d.ts +18 -0
- package/api.d.ts +1 -0
- package/api.js +1 -2
- package/chunks/BillToShippingAddress2.js +1 -2
- package/chunks/BillingForm.js +1 -2
- package/chunks/ErrorBanner.js +1 -2
- package/chunks/LoginForm.js +1 -2
- package/chunks/MergedCartBanner.js +1 -0
- package/chunks/PlaceOrder.js +1 -2
- package/chunks/ShippingForm.js +1 -2
- package/chunks/ShippingMethods.js +1 -2
- package/chunks/ToggleButton.js +1 -2
- package/chunks/ToggleButton2.js +1 -0
- package/chunks/address-form-fields.js +43 -0
- package/chunks/constants.js +0 -1
- package/chunks/constants2.js +1 -2
- package/chunks/constants3.js +1 -2
- package/chunks/getCart.graphql.js +10 -173
- package/chunks/getStoreConfig.js +4 -14
- package/chunks/initialize.js +1 -2
- package/chunks/placeOrder2.js +57 -70
- package/chunks/setBillingAddress.js +3 -6
- package/chunks/setGuestEmailOnCart.js +4 -7
- package/chunks/setPaymentMethod.js +3 -6
- package/chunks/setShippingAddress.js +4 -7
- package/chunks/setShippingMethods.js +4 -7
- package/chunks/transform-shipping-methods.js +1 -2
- package/components/AddressForm/AddressForm.d.ts +21 -0
- package/components/AddressForm/constants.d.ts +4 -0
- package/components/AddressForm/index.d.ts +7 -0
- package/components/AddressForm/useAddressBackup.d.ts +8 -0
- package/components/AddressForm/useAddressForm.d.ts +38 -0
- package/components/AddressForm/useCheckoutAddressEventEmitter.d.ts +9 -0
- package/components/AddressForm/usePreselectedFields.d.ts +9 -0
- package/components/AddressForm/utils.d.ts +13 -0
- package/components/BillToShippingAddress/BillToShippingAddress.d.ts +8 -0
- package/components/BillToShippingAddress/BillToShippingAddressSkeleton.d.ts +4 -0
- package/components/BillToShippingAddress/index.d.ts +4 -0
- package/components/Checkout/Checkout.d.ts +25 -0
- package/components/Checkout/index.d.ts +3 -0
- package/components/EmptyCart/EmptyCart.d.ts +9 -0
- package/components/EmptyCart/index.d.ts +3 -0
- package/components/FieldsForm/FieldsForm.d.ts +13 -0
- package/components/FieldsForm/FieldsFormSkeleton.d.ts +4 -0
- package/components/FieldsForm/fieldFactory.d.ts +9 -0
- package/components/FieldsForm/fixtures.d.ts +5 -0
- package/components/FieldsForm/index.d.ts +6 -0
- package/components/FieldsForm/validation.d.ts +18 -0
- package/components/Heading/Heading.d.ts +8 -0
- package/components/Heading/index.d.ts +3 -0
- package/components/LoginForm/Email.d.ts +13 -0
- package/components/LoginForm/LoginForm.d.ts +17 -0
- package/components/LoginForm/LoginFormSkeleton.d.ts +4 -0
- package/components/LoginForm/SignIn.d.ts +9 -0
- package/components/LoginForm/SignOut.d.ts +8 -0
- package/components/LoginForm/index.d.ts +6 -0
- package/components/OutOfStock/OutOfStock.d.ts +9 -0
- package/components/OutOfStock/index.d.ts +3 -0
- package/components/OverlayLoader/OverlayLoader.d.ts +6 -0
- package/components/OverlayLoader/index.d.ts +2 -0
- package/components/PaymentMethods/PaymentMethods.d.ts +13 -0
- package/components/PaymentMethods/PaymentMethodsSkeleton.d.ts +4 -0
- package/components/PaymentMethods/index.d.ts +4 -0
- package/components/PlaceOrder/PlaceOrder.d.ts +9 -0
- package/components/PlaceOrder/PlaceOrderSkeleton.d.ts +4 -0
- package/components/PlaceOrder/index.d.ts +3 -0
- package/components/ServerError/ServerError.d.ts +10 -0
- package/components/ServerError/index.d.ts +3 -0
- package/components/ShippingMethods/ShippingMethods.d.ts +12 -0
- package/components/ShippingMethods/ShippingMethodsSkeleton.d.ts +4 -0
- package/components/ShippingMethods/index.d.ts +4 -0
- package/components/ToggleButton/ToggleButton.d.ts +14 -0
- package/components/ToggleButton/assets/icons/index.d.ts +2 -0
- package/components/ToggleButton/assets/images/index.d.ts +2 -0
- package/components/ToggleButton/index.d.ts +3 -0
- package/components/index.d.ts +15 -0
- package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +10 -0
- package/containers/BillToShippingAddress/constants.d.ts +2 -0
- package/containers/BillToShippingAddress/index.d.ts +4 -0
- package/containers/BillToShippingAddress.d.ts +3 -0
- package/containers/BillToShippingAddress.js +1 -2
- package/containers/BillingForm/BillingForm.d.ts +7 -0
- package/containers/BillingForm/constants.d.ts +2 -0
- package/containers/BillingForm/index.d.ts +4 -0
- package/containers/BillingForm.d.ts +3 -0
- package/containers/BillingForm.js +1 -2
- package/containers/Checkout/Checkout.d.ts +35 -0
- package/containers/Checkout/constants.d.ts +2 -0
- package/containers/Checkout/index.d.ts +4 -0
- package/containers/Checkout.d.ts +3 -0
- package/containers/Checkout.js +1 -2
- package/containers/ErrorBanner/ErrorBanner.d.ts +5 -0
- package/containers/ErrorBanner/index.d.ts +3 -0
- package/containers/ErrorBanner.d.ts +3 -0
- package/containers/ErrorBanner.js +0 -1
- package/containers/LoginForm/LoginForm.d.ts +10 -0
- package/containers/LoginForm/constants.d.ts +2 -0
- package/containers/LoginForm/index.d.ts +4 -0
- package/containers/LoginForm.d.ts +3 -0
- package/containers/LoginForm.js +1 -2
- package/containers/MergedCartBanner/MergedCartBanner.d.ts +5 -0
- package/containers/MergedCartBanner/index.d.ts +3 -0
- package/containers/MergedCartBanner.d.ts +3 -0
- package/containers/MergedCartBanner.js +1 -0
- package/containers/PaymentMethods/PaymentMethods.d.ts +23 -0
- package/containers/PaymentMethods/defaultHandlers.d.ts +11 -0
- package/containers/PaymentMethods/index.d.ts +3 -0
- package/containers/PaymentMethods.d.ts +3 -0
- package/containers/PaymentMethods.js +1 -2
- package/containers/PlaceOrder/PlaceOrder.d.ts +9 -0
- package/containers/PlaceOrder/index.d.ts +3 -0
- package/containers/PlaceOrder.d.ts +3 -0
- package/containers/PlaceOrder.js +1 -2
- package/containers/ShippingForm/ShippingForm.d.ts +9 -0
- package/containers/ShippingForm/constants.d.ts +2 -0
- package/containers/ShippingForm/index.d.ts +4 -0
- package/containers/ShippingForm.d.ts +3 -0
- package/containers/ShippingForm.js +1 -2
- package/containers/ShippingMethods/ShippingMethods.d.ts +9 -0
- package/containers/ShippingMethods/hooks/useShippingEstimateEventEmitter.d.ts +3 -0
- package/containers/ShippingMethods/index.d.ts +3 -0
- package/containers/ShippingMethods.d.ts +3 -0
- package/containers/ShippingMethods.js +1 -2
- package/containers/index.d.ts +11 -0
- package/context/address-form-fields.d.ts +13 -0
- package/context/checkout.d.ts +44 -0
- package/context/countries.d.ts +13 -0
- package/context/index.d.ts +6 -0
- package/context/services.d.ts +13 -0
- package/context/store.d.ts +12 -0
- package/data/models/acdl.d.ts +99 -0
- package/data/models/address-form-fields.d.ts +52 -0
- package/data/models/address.d.ts +21 -0
- package/data/models/cart.d.ts +14 -0
- package/data/models/country.d.ts +5 -0
- package/data/models/custom-attribute.d.ts +5 -0
- package/data/models/customer.d.ts +25 -0
- package/data/models/email-availability.d.ts +2 -0
- package/data/models/index.d.ts +14 -0
- package/data/models/order.d.ts +46 -0
- package/data/models/payment-method.d.ts +5 -0
- package/data/models/price.d.ts +5 -0
- package/data/models/region.d.ts +6 -0
- package/data/models/shipping-estimate.d.ts +17 -0
- package/data/models/shipping-method.d.ts +19 -0
- package/data/models/store-config.d.ts +9 -0
- package/data/transforms/index.d.ts +12 -0
- package/data/transforms/transform-acdl.d.ts +6 -0
- package/data/transforms/transform-address-form-fields.d.ts +66 -0
- package/data/transforms/transform-address.d.ts +79 -0
- package/data/transforms/transform-cart.d.ts +7 -0
- package/data/transforms/transform-countries.d.ts +5 -0
- package/data/transforms/transform-customer.d.ts +14 -0
- package/data/transforms/transform-email-availability.d.ts +6 -0
- package/data/transforms/transform-order.d.ts +7 -0
- package/data/transforms/transform-payment-methods.d.ts +9 -0
- package/data/transforms/transform-regions.d.ts +8 -0
- package/data/transforms/transform-shipping-estimate.d.ts +5 -0
- package/data/transforms/transform-shipping-methods.d.ts +14 -0
- package/data/transforms/transform-store-config.d.ts +5 -0
- package/hooks/useAuthentication/index.d.ts +2 -0
- package/hooks/useAuthentication/useAuthentication.d.ts +2 -0
- package/hooks/useLockScroll/index.d.ts +2 -0
- package/hooks/useLockScroll/useLockScroll.d.ts +5 -0
- package/hooks/useValidity/index.d.ts +2 -0
- package/hooks/useValidity/useValidity.d.ts +19 -0
- package/i18n/en_US.json.d.ts +86 -0
- package/lib/acdl.d.ts +18 -0
- package/lib/fetch-error.d.ts +7 -0
- package/lib/index.d.ts +4 -0
- package/lib/localStorage.d.ts +10 -0
- package/lib/network-error.d.ts +6 -0
- package/lib/redirect.d.ts +2 -0
- package/lib/state.d.ts +7 -0
- package/msw/browser.d.ts +2 -0
- package/msw/fixtures/fragments/american-regions.d.ts +4 -0
- package/msw/fixtures/fragments/available-shipping-methods.d.ts +23 -0
- package/msw/fixtures/fragments/billing-address.d.ts +36 -0
- package/msw/fixtures/fragments/cart.d.ts +112 -0
- package/msw/fixtures/fragments/countries.d.ts +4 -0
- package/msw/fixtures/fragments/form-fields.d.ts +4 -0
- package/msw/fixtures/fragments/index.d.ts +8 -0
- package/msw/fixtures/fragments/shipping-address.d.ts +42 -0
- package/msw/fixtures/index.d.ts +4 -0
- package/msw/fixtures/mutations/estimate-shipping-methods.d.ts +4 -0
- package/msw/fixtures/mutations/index.d.ts +8 -0
- package/msw/fixtures/mutations/place-order.d.ts +4 -0
- package/msw/fixtures/mutations/set-billing-address.d.ts +5 -0
- package/msw/fixtures/mutations/set-guest-email.d.ts +4 -0
- package/msw/fixtures/mutations/set-payment-method.d.ts +4 -0
- package/msw/fixtures/mutations/set-shipping-address.d.ts +4 -0
- package/msw/fixtures/mutations/set-shipping-methods.d.ts +4 -0
- package/msw/fixtures/queries/fetch-address-form-fields.d.ts +4 -0
- package/msw/fixtures/queries/get-cart.d.ts +4 -0
- package/msw/fixtures/queries/get-countries.d.ts +4 -0
- package/msw/fixtures/queries/get-customer-cart-stock-status.d.ts +4 -0
- package/msw/fixtures/queries/get-customer.d.ts +5 -0
- package/msw/fixtures/queries/get-regions.d.ts +4 -0
- package/msw/fixtures/queries/get-stock-status.d.ts +4 -0
- package/msw/fixtures/queries/get-store-config.d.ts +4 -0
- package/msw/fixtures/queries/index.d.ts +10 -0
- package/msw/fixtures/queries/is-email-available.d.ts +4 -0
- package/msw/handlers.d.ts +4 -0
- package/msw/server.d.ts +2 -0
- package/package.json +1 -1
- package/render/Provider.d.ts +10 -0
- package/render/index.d.ts +2 -0
- package/render/render.d.ts +6 -0
- package/render.d.ts +1 -0
- package/render.js +3 -4
- package/services/backup.d.ts +17 -0
- package/services/index.d.ts +2 -0
- package/signals/AuthenticationSignal.d.ts +2 -0
- package/signals/CartSignal.d.ts +7 -0
- package/signals/CustomerSignal.d.ts +7 -0
- package/signals/EstimateShippingMethodsSignal.d.ts +7 -0
- package/signals/IsBillToShippingSignal.d.ts +6 -0
- package/signals/RegionsSignal.d.ts +12 -0
- package/signals/SelectedShippingMethodSignal.d.ts +4 -0
- package/signals/index.d.ts +8 -0
- package/tests/constants.d.ts +3 -0
- package/tests/index.d.ts +2 -0
- package/tests/integration/utils/index.d.ts +3 -0
- package/tests/integration/utils/setup.d.ts +5 -0
- package/tests/integration/utils/user-actions.d.ts +2 -0
- package/tests/mocks/svg.d.ts +4 -0
- package/tests/render.d.ts +4 -0
- package/tests/utils/expectError.d.ts +9 -0
- package/tests/utils/index.d.ts +3 -0
- package/tests/utils/mockEvents.d.ts +5 -0
- package/utils/autocompleteFieldCodes/autocompleteFieldCodes.d.ts +18 -0
- package/utils/autocompleteFieldCodes/index.d.ts +2 -0
- package/utils/getMultilineValues/getMultilineValues.d.ts +3 -0
- package/utils/getMultilineValues/index.d.ts +2 -0
- package/utils/index.d.ts +7 -0
- package/utils/isEmpty/index.d.ts +2 -0
- package/utils/isEmpty/isEmpty.d.ts +2 -0
- package/utils/isNullish/index.d.ts +2 -0
- package/utils/isNullish/isNullish.d.ts +2 -0
- package/utils/parseRegionId/index.d.ts +2 -0
- package/utils/parseRegionId/parseRegionId.d.ts +2 -0
- package/utils/processFormFields/index.d.ts +2 -0
- package/utils/processFormFields/processFormFields.d.ts +21 -0
- package/utils/refetchEstimatedShippingMethods/index.d.ts +2 -0
- package/utils/refetchEstimatedShippingMethods/refetchEstimatedShippingMethods.d.ts +4 -0
- package/utils/shippingMethods/index.d.ts +2 -0
- package/utils/shippingMethods/isEqual.d.ts +4 -0
- package/api.js.map +0 -1
- package/chunks/BillToShippingAddress2.js.map +0 -1
- package/chunks/BillingForm.js.map +0 -1
- package/chunks/CartSummary.js +0 -2
- package/chunks/CartSummary.js.map +0 -1
- package/chunks/ErrorBanner.js.map +0 -1
- package/chunks/LoginForm.js.map +0 -1
- package/chunks/OrderSummary.js +0 -2
- package/chunks/OrderSummary.js.map +0 -1
- package/chunks/PaymentMethods.js +0 -2
- package/chunks/PaymentMethods.js.map +0 -1
- package/chunks/PlaceOrder.js.map +0 -1
- package/chunks/SelectedShippingMethodSignal.js +0 -2
- package/chunks/SelectedShippingMethodSignal.js.map +0 -1
- package/chunks/ShippingForm.js.map +0 -1
- package/chunks/ShippingMethods.js.map +0 -1
- package/chunks/ToggleButton.js.map +0 -1
- package/chunks/cart-item.js +0 -2
- package/chunks/cart-item.js.map +0 -1
- package/chunks/constants.js.map +0 -1
- package/chunks/constants2.js.map +0 -1
- package/chunks/constants3.js.map +0 -1
- package/chunks/getCart.graphql.js.map +0 -1
- package/chunks/getMultilineValues.js +0 -44
- package/chunks/getMultilineValues.js.map +0 -1
- package/chunks/getStoreConfig.js.map +0 -1
- package/chunks/initialize.js.map +0 -1
- package/chunks/placeOrder2.js.map +0 -1
- package/chunks/setBillingAddress.js.map +0 -1
- package/chunks/setGuestEmailOnCart.js.map +0 -1
- package/chunks/setPaymentMethod.js.map +0 -1
- package/chunks/setShippingAddress.js.map +0 -1
- package/chunks/setShippingMethods.js.map +0 -1
- package/chunks/transform-shipping-methods.js.map +0 -1
- package/containers/BillToShippingAddress.js.map +0 -1
- package/containers/BillingForm.js.map +0 -1
- package/containers/CartSummary.js +0 -2
- package/containers/CartSummary.js.map +0 -1
- package/containers/Checkout.js.map +0 -1
- package/containers/ErrorBanner.js.map +0 -1
- package/containers/LoginForm.js.map +0 -1
- package/containers/OrderSummary.js +0 -2
- package/containers/OrderSummary.js.map +0 -1
- package/containers/PaymentMethods.js.map +0 -1
- package/containers/PlaceOrder.js.map +0 -1
- package/containers/ShippingForm.js.map +0 -1
- package/containers/ShippingMethods.js.map +0 -1
- package/render.js.map +0 -1
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{S as c,S as j}from"../chunks/ShippingMethods.js";import"../chunks/
|
|
2
|
-
//# sourceMappingURL=ShippingMethods.js.map
|
|
1
|
+
import{S as c,S as j}from"../chunks/ShippingMethods.js";import"../chunks/address-form-fields.js";import"../chunks/transform-shipping-methods.js";import"../chunks/getStoreConfig.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-jsx-runtime.js";import"../chunks/setShippingMethods.js";import"../chunks/getCart.graphql.js";import"@dropins/tools/lib.js";import"../chunks/ToggleButton.js";import"@dropins/tools/i18n.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";import"../chunks/ErrorBanner.js";import"../chunks/MergedCartBanner.js";export{c as ShippingMethods,j as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './BillToShippingAddress';
|
|
2
|
+
export * from './BillingForm';
|
|
3
|
+
export * from './Checkout';
|
|
4
|
+
export * from './ErrorBanner';
|
|
5
|
+
export * from './LoginForm';
|
|
6
|
+
export * from './MergedCartBanner';
|
|
7
|
+
export * from './PaymentMethods';
|
|
8
|
+
export * from './PlaceOrder';
|
|
9
|
+
export * from './ShippingForm';
|
|
10
|
+
export * from './ShippingMethods';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AddressFormField } from '../data/models';
|
|
2
|
+
import { ComponentChildren } from 'preact';
|
|
3
|
+
|
|
4
|
+
type Context = {
|
|
5
|
+
fields?: AddressFormField[];
|
|
6
|
+
};
|
|
7
|
+
type AddressFormFieldsProps = {
|
|
8
|
+
children: ComponentChildren;
|
|
9
|
+
};
|
|
10
|
+
declare function AddressFormFieldsProvider({ children }: AddressFormFieldsProps): import("preact").JSX.Element;
|
|
11
|
+
declare function useAddressFormFields(): Context;
|
|
12
|
+
export { AddressFormFieldsProvider, useAddressFormFields };
|
|
13
|
+
//# sourceMappingURL=address-form-fields.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Cart } from '../data/models';
|
|
2
|
+
import { FunctionComponent } from 'preact';
|
|
3
|
+
import { Dispatch } from 'preact/hooks';
|
|
4
|
+
|
|
5
|
+
export declare enum CheckoutState {
|
|
6
|
+
EMPTY = "EMPTY",
|
|
7
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
8
|
+
INIT = "INIT",
|
|
9
|
+
LOADING = "LOADING",
|
|
10
|
+
COMPLETE = "COMPLETE"
|
|
11
|
+
}
|
|
12
|
+
export declare enum CheckoutEvent {
|
|
13
|
+
CART_UPDATED = 0,
|
|
14
|
+
ORDER_PLACED = 1,
|
|
15
|
+
USER_AUTHENTICATED = 2,
|
|
16
|
+
USER_UNAUTHENTICATED = 3,
|
|
17
|
+
USER_SIGN_OUT = 4
|
|
18
|
+
}
|
|
19
|
+
type CartUpdated = {
|
|
20
|
+
type: CheckoutEvent.CART_UPDATED;
|
|
21
|
+
payload?: Cart | null;
|
|
22
|
+
};
|
|
23
|
+
type UserAuthenticated = {
|
|
24
|
+
type: CheckoutEvent.USER_AUTHENTICATED;
|
|
25
|
+
};
|
|
26
|
+
type UserUnAuthenticated = {
|
|
27
|
+
type: CheckoutEvent.USER_UNAUTHENTICATED;
|
|
28
|
+
};
|
|
29
|
+
type UserSignedOut = {
|
|
30
|
+
type: CheckoutEvent.USER_SIGN_OUT;
|
|
31
|
+
};
|
|
32
|
+
type OrderPlaced = {
|
|
33
|
+
type: CheckoutEvent.ORDER_PLACED;
|
|
34
|
+
};
|
|
35
|
+
type CheckoutAction = CartUpdated | UserAuthenticated | UserUnAuthenticated | OrderPlaced | UserSignedOut;
|
|
36
|
+
type CheckoutContextValue = {
|
|
37
|
+
state: CheckoutState;
|
|
38
|
+
dispatch: Dispatch<CheckoutAction>;
|
|
39
|
+
};
|
|
40
|
+
export declare const CheckoutContext: import('preact').Context<CheckoutContextValue | undefined>;
|
|
41
|
+
export declare const CheckoutStateProvider: FunctionComponent;
|
|
42
|
+
export declare function useCheckoutState(): CheckoutContextValue;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=checkout.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentChildren } from 'preact';
|
|
2
|
+
import { Country as CountryModel } from '../data/models/country';
|
|
3
|
+
|
|
4
|
+
type Context = {
|
|
5
|
+
countries?: CountryModel[];
|
|
6
|
+
};
|
|
7
|
+
type CountriesProps = {
|
|
8
|
+
children: ComponentChildren;
|
|
9
|
+
};
|
|
10
|
+
declare function CountriesProvider({ children }: CountriesProps): import("preact").JSX.Element;
|
|
11
|
+
declare function useCountries(): Context;
|
|
12
|
+
export { CountriesProvider, useCountries };
|
|
13
|
+
//# sourceMappingURL=countries.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BackupService } from '../services';
|
|
2
|
+
|
|
3
|
+
export interface Services {
|
|
4
|
+
backupService: BackupService;
|
|
5
|
+
}
|
|
6
|
+
export declare const ServicesContext: import('preact').Context<Services>;
|
|
7
|
+
export type ServicesProviderProps = {
|
|
8
|
+
children: any;
|
|
9
|
+
services: Services;
|
|
10
|
+
};
|
|
11
|
+
export declare function ServicesProvider({ children, services, }: ServicesProviderProps): import("preact").JSX.Element;
|
|
12
|
+
export declare function useServices(): Services;
|
|
13
|
+
//# sourceMappingURL=services.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoreConfig } from '../data/models';
|
|
2
|
+
import { FunctionComponent } from 'preact';
|
|
3
|
+
|
|
4
|
+
export declare const DEFAULT_COUNTRY = "US";
|
|
5
|
+
export declare const STORE_CONFIG_DEFAULTS: StoreConfig;
|
|
6
|
+
interface ContextData {
|
|
7
|
+
config?: StoreConfig;
|
|
8
|
+
}
|
|
9
|
+
export declare const StoreProvider: FunctionComponent;
|
|
10
|
+
export declare function useStore(): ContextData;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module contains the schema type definitions to build the ShoppingCart
|
|
3
|
+
* and Order contexts, which are required to trigger the "place-order" event.
|
|
4
|
+
*
|
|
5
|
+
* The following schema types have been extracted from the Adobe Commerce
|
|
6
|
+
* Events SDK package.
|
|
7
|
+
*
|
|
8
|
+
* ShoppingCart schema type @see https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/types/schemas/shoppingCart.ts
|
|
9
|
+
* Order schema type @see https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/types/schemas/order.ts
|
|
10
|
+
*/
|
|
11
|
+
type ShoppingCartItem = {
|
|
12
|
+
canApplyMsrp: boolean;
|
|
13
|
+
formattedPrice: string;
|
|
14
|
+
id: string;
|
|
15
|
+
prices: {
|
|
16
|
+
price: Price;
|
|
17
|
+
};
|
|
18
|
+
product: Product;
|
|
19
|
+
configurableOptions?: Array<ConfigurableOption>;
|
|
20
|
+
quantity: number;
|
|
21
|
+
};
|
|
22
|
+
type Price = {
|
|
23
|
+
value: number;
|
|
24
|
+
currency?: string;
|
|
25
|
+
regularPrice?: number;
|
|
26
|
+
};
|
|
27
|
+
type Product = {
|
|
28
|
+
productId: number;
|
|
29
|
+
name: string;
|
|
30
|
+
sku: string;
|
|
31
|
+
topLevelSku?: string | null;
|
|
32
|
+
specialToDate?: string | null;
|
|
33
|
+
specialFromDate?: string | null;
|
|
34
|
+
newToDate?: string | null;
|
|
35
|
+
newFromDate?: string | null;
|
|
36
|
+
createdAt?: string | null;
|
|
37
|
+
updatedAt?: string | null;
|
|
38
|
+
manufacturer?: string | null;
|
|
39
|
+
countryOfManufacture?: string | null;
|
|
40
|
+
categories?: string[] | null;
|
|
41
|
+
productType?: string | null;
|
|
42
|
+
pricing?: {
|
|
43
|
+
regularPrice: number;
|
|
44
|
+
minimalPrice?: number;
|
|
45
|
+
maximalPrice?: number;
|
|
46
|
+
specialPrice?: number;
|
|
47
|
+
tierPricing?: {
|
|
48
|
+
customerGroupId?: number | null;
|
|
49
|
+
qty: number;
|
|
50
|
+
value: number;
|
|
51
|
+
}[];
|
|
52
|
+
currencyCode: string | null;
|
|
53
|
+
};
|
|
54
|
+
canonicalUrl?: string | null;
|
|
55
|
+
mainImageUrl?: string | null;
|
|
56
|
+
};
|
|
57
|
+
type ConfigurableOption = {
|
|
58
|
+
id?: number;
|
|
59
|
+
optionLabel: string;
|
|
60
|
+
valueId?: number;
|
|
61
|
+
valueLabel: string;
|
|
62
|
+
};
|
|
63
|
+
type Payment = {
|
|
64
|
+
paymentMethodCode: string;
|
|
65
|
+
paymentMethodName: string;
|
|
66
|
+
total: number;
|
|
67
|
+
};
|
|
68
|
+
type Shipping = {
|
|
69
|
+
shippingMethod?: string;
|
|
70
|
+
shippingAmount?: number;
|
|
71
|
+
};
|
|
72
|
+
export type ShoppingCartContext = {
|
|
73
|
+
id: string | null;
|
|
74
|
+
items?: Array<ShoppingCartItem>;
|
|
75
|
+
prices?: {
|
|
76
|
+
subtotalExcludingTax?: Price;
|
|
77
|
+
subtotalIncludingTax?: Price;
|
|
78
|
+
};
|
|
79
|
+
totalQuantity: number;
|
|
80
|
+
possibleOnepageCheckout?: boolean;
|
|
81
|
+
giftMessageSelected?: boolean;
|
|
82
|
+
giftWrappingSelected?: boolean;
|
|
83
|
+
source?: string;
|
|
84
|
+
};
|
|
85
|
+
export type OrderContext = {
|
|
86
|
+
appliedCouponCode: string;
|
|
87
|
+
email: string;
|
|
88
|
+
grandTotal: number;
|
|
89
|
+
orderId: string;
|
|
90
|
+
orderType?: 'checkout' | 'instant_purchase';
|
|
91
|
+
otherTax: number;
|
|
92
|
+
payments?: Payment[];
|
|
93
|
+
salesTax: number;
|
|
94
|
+
shipping?: Shipping;
|
|
95
|
+
subtotalExcludingTax: number;
|
|
96
|
+
subtotalIncludingTax: number;
|
|
97
|
+
};
|
|
98
|
+
export {};
|
|
99
|
+
//# sourceMappingURL=acdl.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AttributeFrontendInputEnum, ValidationRuleEnum } from '../../__generated__/types';
|
|
2
|
+
import { PickerOption } from '@dropins/tools/types/elsie/src/src/components';
|
|
3
|
+
|
|
4
|
+
type AddressFormFieldRule = {
|
|
5
|
+
name: ValidationRuleEnum;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
type AddressFormField = {
|
|
9
|
+
code: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
frontendInput?: AttributeFrontendInputEnum;
|
|
12
|
+
isDisabled: boolean;
|
|
13
|
+
isRequired: boolean;
|
|
14
|
+
label?: string;
|
|
15
|
+
multilineCount?: number;
|
|
16
|
+
options: PickerOption[];
|
|
17
|
+
sortOrder?: number;
|
|
18
|
+
validateRules?: AddressFormFieldRule[];
|
|
19
|
+
};
|
|
20
|
+
type FieldEvents = {
|
|
21
|
+
handleSelect?: (event: Event) => void;
|
|
22
|
+
onBlur: (event: Event) => void;
|
|
23
|
+
onChange: (event: Event) => void;
|
|
24
|
+
onInvalid: (event: Event) => void;
|
|
25
|
+
};
|
|
26
|
+
type FieldValues = {
|
|
27
|
+
error: string | string[];
|
|
28
|
+
value: string | string[];
|
|
29
|
+
};
|
|
30
|
+
type AddressFormElement = AddressFormField & FieldEvents & FieldValues;
|
|
31
|
+
declare enum AddressFormType {
|
|
32
|
+
SHIPPING = "shipping_addresses",
|
|
33
|
+
BILLING = "billing_address"
|
|
34
|
+
}
|
|
35
|
+
declare enum AddressFormFieldCode {
|
|
36
|
+
City = "city",
|
|
37
|
+
Company = "company",
|
|
38
|
+
Country = "country_id",
|
|
39
|
+
FirstName = "firstname",
|
|
40
|
+
LastName = "lastname",
|
|
41
|
+
PostCode = "postcode",
|
|
42
|
+
Region = "region",
|
|
43
|
+
RegionId = "region_id",
|
|
44
|
+
SaveInAddressBook = "save_in_address_book",
|
|
45
|
+
Street = "street",
|
|
46
|
+
Telephone = "telephone",
|
|
47
|
+
Vat = "vat_id"
|
|
48
|
+
}
|
|
49
|
+
type AddressFormValues = Record<string, string>;
|
|
50
|
+
type AddressFormErrors = Record<string, string>;
|
|
51
|
+
export { AddressFormErrors, AddressFormField, AddressFormFieldCode, AddressFormType, AddressFormValues, AddressFormElement, };
|
|
52
|
+
//# sourceMappingURL=address-form-fields.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Region, Country, ShippingMethod, CustomAttribute } from '.';
|
|
2
|
+
|
|
3
|
+
export type Address = {
|
|
4
|
+
firstName: string;
|
|
5
|
+
lastName: string;
|
|
6
|
+
company?: string;
|
|
7
|
+
street: string[];
|
|
8
|
+
city: string;
|
|
9
|
+
postCode?: string;
|
|
10
|
+
vatId?: string;
|
|
11
|
+
telephone?: string;
|
|
12
|
+
region?: Region;
|
|
13
|
+
country: Country;
|
|
14
|
+
customAttributes: CustomAttribute[];
|
|
15
|
+
};
|
|
16
|
+
export type ShippingAddress = Address & {
|
|
17
|
+
availableShippingMethods?: ShippingMethod[];
|
|
18
|
+
selectedShippingMethod?: ShippingMethod;
|
|
19
|
+
};
|
|
20
|
+
export type BillingAddress = Address;
|
|
21
|
+
//# sourceMappingURL=address.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PaymentMethod } from './payment-method';
|
|
2
|
+
import { ShippingAddress, BillingAddress } from './address';
|
|
3
|
+
|
|
4
|
+
export type Cart = {
|
|
5
|
+
availablePaymentMethods?: PaymentMethod[];
|
|
6
|
+
billingAddress?: BillingAddress;
|
|
7
|
+
email?: string;
|
|
8
|
+
id: string;
|
|
9
|
+
isEmpty: boolean;
|
|
10
|
+
isVirtual: boolean;
|
|
11
|
+
selectedPaymentMethod?: PaymentMethod;
|
|
12
|
+
shippingAddresses?: ShippingAddress[];
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Region, Country, CustomAttribute } from '.';
|
|
2
|
+
|
|
3
|
+
export type CustomerAddress = {
|
|
4
|
+
id: string;
|
|
5
|
+
firstName: string;
|
|
6
|
+
lastName: string;
|
|
7
|
+
company?: string;
|
|
8
|
+
street: string[];
|
|
9
|
+
city: string;
|
|
10
|
+
postCode?: string;
|
|
11
|
+
vatId?: string;
|
|
12
|
+
telephone?: string;
|
|
13
|
+
region?: Region;
|
|
14
|
+
country: Country;
|
|
15
|
+
customAttributes: CustomAttribute[];
|
|
16
|
+
};
|
|
17
|
+
export type Customer = {
|
|
18
|
+
firstName: string;
|
|
19
|
+
lastName: string;
|
|
20
|
+
email: string;
|
|
21
|
+
addresses: CustomerAddress[];
|
|
22
|
+
defaultBillingAddress?: CustomerAddress;
|
|
23
|
+
defaultShippingAddress?: CustomerAddress;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=customer.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './acdl';
|
|
2
|
+
export * from './address-form-fields';
|
|
3
|
+
export * from './cart';
|
|
4
|
+
export * from './country';
|
|
5
|
+
export * from './custom-attribute';
|
|
6
|
+
export * from './customer';
|
|
7
|
+
export * from './email-availability';
|
|
8
|
+
export * from './price';
|
|
9
|
+
export * from './region';
|
|
10
|
+
export * from './shipping-estimate';
|
|
11
|
+
export * from './shipping-method';
|
|
12
|
+
export * from './store-config';
|
|
13
|
+
export * from './order';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Price } from './price';
|
|
2
|
+
|
|
3
|
+
type OrderPayment = {
|
|
4
|
+
code: string;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
type OrderCoupon = {
|
|
8
|
+
code: string;
|
|
9
|
+
};
|
|
10
|
+
export type OrderItemProduct = {
|
|
11
|
+
canonicalUrl?: string;
|
|
12
|
+
id: string;
|
|
13
|
+
image?: string;
|
|
14
|
+
name: string;
|
|
15
|
+
productType: string;
|
|
16
|
+
sku: string;
|
|
17
|
+
};
|
|
18
|
+
export type OrderItem = {
|
|
19
|
+
discountedTotal?: number;
|
|
20
|
+
id: string;
|
|
21
|
+
price: Price;
|
|
22
|
+
product: OrderItemProduct;
|
|
23
|
+
selectedOptions?: Array<{
|
|
24
|
+
label: string;
|
|
25
|
+
value: any;
|
|
26
|
+
}>;
|
|
27
|
+
totalQuantity: number;
|
|
28
|
+
};
|
|
29
|
+
export type Order = {
|
|
30
|
+
coupons: OrderCoupon[];
|
|
31
|
+
email: string;
|
|
32
|
+
items: OrderItem[];
|
|
33
|
+
number: string;
|
|
34
|
+
payments: OrderPayment[];
|
|
35
|
+
shipping?: {
|
|
36
|
+
code: string;
|
|
37
|
+
amount: number;
|
|
38
|
+
};
|
|
39
|
+
subtotal: number;
|
|
40
|
+
token: string;
|
|
41
|
+
total: number;
|
|
42
|
+
totalQuantity: number;
|
|
43
|
+
totalTax: number;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=order.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Price } from './price';
|
|
2
|
+
|
|
3
|
+
export interface ShippingEstimatePartialAddress {
|
|
4
|
+
countryCode: string;
|
|
5
|
+
postCode?: string;
|
|
6
|
+
region?: string;
|
|
7
|
+
regionCode?: string;
|
|
8
|
+
regionId?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ShippingEstimateShippingMethod {
|
|
11
|
+
amount: Price;
|
|
12
|
+
carrierCode: string;
|
|
13
|
+
methodCode: string;
|
|
14
|
+
amountExclTax?: Price;
|
|
15
|
+
amountInclTax?: Price;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=shipping-estimate.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Price } from './price';
|
|
2
|
+
|
|
3
|
+
type Code = string;
|
|
4
|
+
type Title = string;
|
|
5
|
+
type Carrier = {
|
|
6
|
+
code: Code;
|
|
7
|
+
title: Title;
|
|
8
|
+
};
|
|
9
|
+
export type ShippingMethod = {
|
|
10
|
+
amount: Price;
|
|
11
|
+
carrier: Carrier;
|
|
12
|
+
code: Code;
|
|
13
|
+
title: Title;
|
|
14
|
+
value: string;
|
|
15
|
+
amountExclTax?: Price;
|
|
16
|
+
amountInclTax?: Price;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=shipping-method.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface StoreConfig {
|
|
2
|
+
defaultCountry: string;
|
|
3
|
+
countriesWithRequiredRegion: string[];
|
|
4
|
+
displayStateIfOptional: boolean;
|
|
5
|
+
countriesWithOptionalZipCode: string[];
|
|
6
|
+
isGuestCheckoutEnabled: boolean;
|
|
7
|
+
isOnePageCheckoutEnabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=store-config.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './transform-acdl';
|
|
2
|
+
export * from './transform-address-form-fields';
|
|
3
|
+
export * from './transform-cart';
|
|
4
|
+
export * from './transform-countries';
|
|
5
|
+
export * from './transform-customer';
|
|
6
|
+
export * from './transform-email-availability';
|
|
7
|
+
export * from './transform-order';
|
|
8
|
+
export * from './transform-regions';
|
|
9
|
+
export * from './transform-shipping-estimate';
|
|
10
|
+
export * from './transform-shipping-methods';
|
|
11
|
+
export * from './transform-store-config';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OrderContext, ShoppingCartContext } from '../models/acdl';
|
|
2
|
+
import { Order } from '../models/order';
|
|
3
|
+
|
|
4
|
+
export declare const transformShoppingCartContext: (order: Order) => ShoppingCartContext;
|
|
5
|
+
export declare const transformOrderContext: (order: Order) => OrderContext;
|
|
6
|
+
//# sourceMappingURL=transform-acdl.d.ts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { FetchAddressFormFieldsQuery, ValidationRuleEnum } from '../../__generated__/types';
|
|
2
|
+
import { AddressFormField } from '../models';
|
|
3
|
+
|
|
4
|
+
type AttributesForm = FetchAddressFormFieldsQuery['attributesForm'];
|
|
5
|
+
declare const transformAddressFormFields: (data: ({
|
|
6
|
+
__typename?: "AttributeMetadata" | undefined;
|
|
7
|
+
frontend_input?: import('../../__generated__/types').AttributeFrontendInputEnum | null | undefined;
|
|
8
|
+
code: string;
|
|
9
|
+
label?: string | null | undefined;
|
|
10
|
+
default_value?: string | null | undefined;
|
|
11
|
+
is_required: boolean;
|
|
12
|
+
options: ({
|
|
13
|
+
__typename?: "AttributeOptionMetadata" | undefined;
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
is_default: boolean;
|
|
17
|
+
} | null)[];
|
|
18
|
+
} | {
|
|
19
|
+
__typename?: "CatalogAttributeMetadata" | undefined;
|
|
20
|
+
frontend_input?: import('../../__generated__/types').AttributeFrontendInputEnum | null | undefined;
|
|
21
|
+
code: string;
|
|
22
|
+
label?: string | null | undefined;
|
|
23
|
+
default_value?: string | null | undefined;
|
|
24
|
+
is_required: boolean;
|
|
25
|
+
options: ({
|
|
26
|
+
__typename?: "AttributeOptionMetadata" | undefined;
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
is_default: boolean;
|
|
30
|
+
} | null)[];
|
|
31
|
+
} | {
|
|
32
|
+
__typename?: "CustomerAttributeMetadata" | undefined;
|
|
33
|
+
multiline_count?: number | null | undefined;
|
|
34
|
+
sort_order?: number | null | undefined;
|
|
35
|
+
frontend_input?: import('../../__generated__/types').AttributeFrontendInputEnum | null | undefined;
|
|
36
|
+
code: string;
|
|
37
|
+
label?: string | null | undefined;
|
|
38
|
+
default_value?: string | null | undefined;
|
|
39
|
+
is_required: boolean;
|
|
40
|
+
validate_rules?: ({
|
|
41
|
+
__typename?: "ValidationRule" | undefined;
|
|
42
|
+
name?: ValidationRuleEnum | null | undefined;
|
|
43
|
+
value?: string | null | undefined;
|
|
44
|
+
} | null)[] | null | undefined;
|
|
45
|
+
options: ({
|
|
46
|
+
__typename?: "AttributeOptionMetadata" | undefined;
|
|
47
|
+
label: string;
|
|
48
|
+
value: string;
|
|
49
|
+
is_default: boolean;
|
|
50
|
+
} | null)[];
|
|
51
|
+
} | {
|
|
52
|
+
__typename?: "ReturnItemAttributeMetadata" | undefined;
|
|
53
|
+
frontend_input?: import('../../__generated__/types').AttributeFrontendInputEnum | null | undefined;
|
|
54
|
+
code: string;
|
|
55
|
+
label?: string | null | undefined;
|
|
56
|
+
default_value?: string | null | undefined;
|
|
57
|
+
is_required: boolean;
|
|
58
|
+
options: ({
|
|
59
|
+
__typename?: "AttributeOptionMetadata" | undefined;
|
|
60
|
+
label: string;
|
|
61
|
+
value: string;
|
|
62
|
+
is_default: boolean;
|
|
63
|
+
} | null)[];
|
|
64
|
+
} | null)[]) => AddressFormField[];
|
|
65
|
+
export { AttributesForm, transformAddressFormFields };
|
|
66
|
+
//# sourceMappingURL=transform-address-form-fields.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { GetCartQuery } from '../../__generated__/types';
|
|
2
|
+
import { ShippingAddress as ShippingAddressModel, BillingAddress as BillingAddressModel } from '../models/address';
|
|
3
|
+
import { CustomAttribute as CustomAttributeModel } from '../models';
|
|
4
|
+
|
|
5
|
+
type ShippingAddresses = NonNullable<GetCartQuery['cart']>['shipping_addresses'];
|
|
6
|
+
type ShippingAddress = ShippingAddresses[0];
|
|
7
|
+
type NonNullableShippingAddress = NonNullable<ShippingAddress>;
|
|
8
|
+
type BillingAddress = NonNullable<GetCartQuery['cart']>['billing_address'];
|
|
9
|
+
type NonNullableBillingAddress = NonNullable<BillingAddress>;
|
|
10
|
+
type CustomAttributes = NonNullableShippingAddress['custom_attributes'] | NonNullableBillingAddress['custom_attributes'];
|
|
11
|
+
export declare const transformCustomAttributes: (data: CustomAttributes) => CustomAttributeModel[];
|
|
12
|
+
declare const transformBillingAddress: (data: BillingAddress) => BillingAddressModel | undefined;
|
|
13
|
+
declare const transformShippingAddresses: (data: ({
|
|
14
|
+
__typename?: "ShippingCartAddress" | undefined;
|
|
15
|
+
firstname: string;
|
|
16
|
+
lastname: string;
|
|
17
|
+
company?: string | null | undefined;
|
|
18
|
+
street: (string | null)[];
|
|
19
|
+
city: string;
|
|
20
|
+
postcode?: string | null | undefined;
|
|
21
|
+
vat_id?: string | null | undefined;
|
|
22
|
+
telephone?: string | null | undefined;
|
|
23
|
+
region?: {
|
|
24
|
+
__typename?: "CartAddressRegion" | undefined;
|
|
25
|
+
region_id?: number | null | undefined;
|
|
26
|
+
code?: string | null | undefined;
|
|
27
|
+
label?: string | null | undefined;
|
|
28
|
+
} | null | undefined;
|
|
29
|
+
country: {
|
|
30
|
+
__typename?: "CartAddressCountry" | undefined;
|
|
31
|
+
code: string;
|
|
32
|
+
label: string;
|
|
33
|
+
};
|
|
34
|
+
custom_attributes: ({
|
|
35
|
+
__typename?: "AttributeSelectedOptions" | undefined;
|
|
36
|
+
} | {
|
|
37
|
+
__typename?: "AttributeValue" | undefined;
|
|
38
|
+
code: string;
|
|
39
|
+
value: string;
|
|
40
|
+
} | null)[];
|
|
41
|
+
available_shipping_methods?: ({
|
|
42
|
+
__typename?: "AvailableShippingMethod" | undefined;
|
|
43
|
+
available: boolean;
|
|
44
|
+
carrier_code: string;
|
|
45
|
+
carrier_title: string;
|
|
46
|
+
error_message?: string | null | undefined;
|
|
47
|
+
method_code?: string | null | undefined;
|
|
48
|
+
method_title?: string | null | undefined;
|
|
49
|
+
amount: {
|
|
50
|
+
__typename?: "Money" | undefined;
|
|
51
|
+
currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
|
|
52
|
+
value?: number | null | undefined;
|
|
53
|
+
};
|
|
54
|
+
price_excl_tax: {
|
|
55
|
+
__typename?: "Money" | undefined;
|
|
56
|
+
value?: number | null | undefined;
|
|
57
|
+
currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
|
|
58
|
+
};
|
|
59
|
+
price_incl_tax: {
|
|
60
|
+
__typename?: "Money" | undefined;
|
|
61
|
+
value?: number | null | undefined;
|
|
62
|
+
currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
|
|
63
|
+
};
|
|
64
|
+
} | null)[] | null | undefined;
|
|
65
|
+
selected_shipping_method?: {
|
|
66
|
+
__typename?: "SelectedShippingMethod" | undefined;
|
|
67
|
+
carrier_code: string;
|
|
68
|
+
carrier_title: string;
|
|
69
|
+
method_code: string;
|
|
70
|
+
method_title: string;
|
|
71
|
+
amount: {
|
|
72
|
+
__typename?: "Money" | undefined;
|
|
73
|
+
value?: number | null | undefined;
|
|
74
|
+
currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
|
|
75
|
+
};
|
|
76
|
+
} | null | undefined;
|
|
77
|
+
} | null)[]) => ShippingAddressModel[] | undefined;
|
|
78
|
+
export { ShippingAddress, BillingAddress, transformBillingAddress, transformShippingAddresses, };
|
|
79
|
+
//# sourceMappingURL=transform-address.d.ts.map
|