@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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GetCartQuery } from '../../__generated__/types';
|
|
2
|
+
import { Cart as CartModel } from '../models';
|
|
3
|
+
|
|
4
|
+
type Cart = NonNullable<GetCartQuery['cart']>;
|
|
5
|
+
declare const transformCart: (cart: Cart) => CartModel;
|
|
6
|
+
export { Cart, transformCart };
|
|
7
|
+
//# sourceMappingURL=transform-cart.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Country as CountryModel } from '../models/country';
|
|
2
|
+
import { GetCountriesQuery } from '../../__generated__/types';
|
|
3
|
+
|
|
4
|
+
export declare const transformCountries: (data: GetCountriesQuery['countries']) => CountryModel[] | undefined;
|
|
5
|
+
//# sourceMappingURL=transform-countries.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GetCustomerQuery } from '../../__generated__/types';
|
|
2
|
+
import { Customer as CustomerModel, CustomAttribute as CustomAttributeModel } from '../models';
|
|
3
|
+
|
|
4
|
+
type Customer = GetCustomerQuery['customer'];
|
|
5
|
+
export declare const transformCustomAttributesV2: (data: ({
|
|
6
|
+
__typename?: "AttributeSelectedOptions" | undefined;
|
|
7
|
+
} | {
|
|
8
|
+
__typename?: "AttributeValue" | undefined;
|
|
9
|
+
code: string;
|
|
10
|
+
value: string;
|
|
11
|
+
} | null)[]) => CustomAttributeModel[];
|
|
12
|
+
declare const transformCustomer: (data: Customer) => CustomerModel | undefined;
|
|
13
|
+
export { transformCustomer };
|
|
14
|
+
//# sourceMappingURL=transform-customer.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IsEmailAvailableQuery } from '../../__generated__/types';
|
|
2
|
+
import { EmailAvailability } from '../models';
|
|
3
|
+
|
|
4
|
+
declare const transformEmailAvailability: (data: IsEmailAvailableQuery['isEmailAvailable']) => EmailAvailability;
|
|
5
|
+
export { transformEmailAvailability };
|
|
6
|
+
//# sourceMappingURL=transform-email-availability.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Order as OrderModel } from '../models/order';
|
|
2
|
+
import { PlaceOrderMutation } from '../../__generated__/types';
|
|
3
|
+
|
|
4
|
+
type Order = NonNullable<NonNullable<PlaceOrderMutation['placeOrder']>['orderV2']>;
|
|
5
|
+
export declare const transformOrder: (order: Order) => OrderModel;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=transform-order.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GetCartQuery } from '../../__generated__/types';
|
|
2
|
+
import { PaymentMethod } from '../models/payment-method';
|
|
3
|
+
|
|
4
|
+
type SelectedPaymentMethod = NonNullable<GetCartQuery['cart']>['selected_payment_method'];
|
|
5
|
+
type AvailablePaymentMethods = NonNullable<GetCartQuery['cart']>['available_payment_methods'];
|
|
6
|
+
declare const transformSelectedPaymentMethod: (data: SelectedPaymentMethod) => PaymentMethod | undefined;
|
|
7
|
+
declare const transformAvailablePaymentMethods: (data: AvailablePaymentMethods) => PaymentMethod[] | undefined;
|
|
8
|
+
export { transformAvailablePaymentMethods, transformSelectedPaymentMethod };
|
|
9
|
+
//# sourceMappingURL=transform-payment-methods.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Region as RegionModel } from '../models/region';
|
|
2
|
+
import { GetRegionsQuery } from '../../__generated__/types';
|
|
3
|
+
|
|
4
|
+
type RegionsCountry = NonNullable<GetRegionsQuery['country']>;
|
|
5
|
+
type AvailableRegions = RegionsCountry['available_regions'];
|
|
6
|
+
declare const transformRegions: (data: RegionsCountry['available_regions']) => RegionModel[] | undefined;
|
|
7
|
+
export { AvailableRegions, transformRegions };
|
|
8
|
+
//# sourceMappingURL=transform-regions.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ShippingEstimatePartialAddress, ShippingEstimateShippingMethod, ShippingMethod } from '../models';
|
|
2
|
+
|
|
3
|
+
export declare const transformShippingEstimatePartialAddress: (data: Record<string, string>) => ShippingEstimatePartialAddress;
|
|
4
|
+
export declare const transformShippingEstimateShippingMethod: (data: ShippingMethod) => ShippingEstimateShippingMethod;
|
|
5
|
+
//# sourceMappingURL=transform-shipping-estimate.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ShippingMethod } from '../models/shipping-method';
|
|
2
|
+
import { GetCartQuery } from '../../__generated__/types';
|
|
3
|
+
|
|
4
|
+
type Cart = NonNullable<GetCartQuery['cart']>;
|
|
5
|
+
type ShippingAddresses = Cart['shipping_addresses'];
|
|
6
|
+
type ShippingAddress = NonNullable<NonNullable<ShippingAddresses>[number]>;
|
|
7
|
+
type AvailableShippingMethods = ShippingAddress['available_shipping_methods'];
|
|
8
|
+
type AvailableShippingMethod = NonNullable<AvailableShippingMethods>[number];
|
|
9
|
+
type SelectedShippingMethod = ShippingAddress['selected_shipping_method'];
|
|
10
|
+
export declare const transformSelectedShippingMethod: (data: SelectedShippingMethod) => ShippingMethod | undefined;
|
|
11
|
+
export declare const transformAvailableShippingMethod: (data: AvailableShippingMethod) => ShippingMethod | undefined;
|
|
12
|
+
export declare const transformShippingMethods: (data: AvailableShippingMethods) => ShippingMethod[] | undefined;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=transform-shipping-methods.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type Translations = {
|
|
2
|
+
badInput: string;
|
|
3
|
+
patternMismatch: string;
|
|
4
|
+
rangeOverflow: string;
|
|
5
|
+
rangeUnderflow: string;
|
|
6
|
+
tooLong: string;
|
|
7
|
+
tooShort: string;
|
|
8
|
+
typeMismatch: string;
|
|
9
|
+
valueMissing: string;
|
|
10
|
+
};
|
|
11
|
+
type FormElement = HTMLInputElement | HTMLSelectElement;
|
|
12
|
+
export declare const useValidity: (translations: Translations) => {
|
|
13
|
+
errors: Record<string, string>;
|
|
14
|
+
dismissError: (code: string) => void;
|
|
15
|
+
validateFormElement: (formElement: FormElement) => void;
|
|
16
|
+
resetErrors: () => void;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=useValidity.d.ts.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"Checkout": {
|
|
3
|
+
"title": "Checkout",
|
|
4
|
+
"LoginForm": {
|
|
5
|
+
"title": "Contact details",
|
|
6
|
+
"account": "Already have an account?",
|
|
7
|
+
"ariaLabel": "Email",
|
|
8
|
+
"invalidEmailError": "Please enter a valid email address.",
|
|
9
|
+
"missingEmailError": "Enter an email address.",
|
|
10
|
+
"emailExists": {
|
|
11
|
+
"alreadyHaveAccount": "It looks like you already have an account.",
|
|
12
|
+
"signInButton": "Sign in",
|
|
13
|
+
"forFasterCheckout": "for a faster checkout."
|
|
14
|
+
},
|
|
15
|
+
"floatingLabel": "Email *",
|
|
16
|
+
"placeholder": "Enter your email address",
|
|
17
|
+
"signIn": "Sign In",
|
|
18
|
+
"switch": "Do you want to switch account?",
|
|
19
|
+
"signOut": "Sign Out"
|
|
20
|
+
},
|
|
21
|
+
"ShippingMethods": {
|
|
22
|
+
"title": "Shipping options",
|
|
23
|
+
"emptyState": "This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct."
|
|
24
|
+
},
|
|
25
|
+
"ShippingAddress": {
|
|
26
|
+
"title": "Delivery"
|
|
27
|
+
},
|
|
28
|
+
"BillingAddress": {
|
|
29
|
+
"title": "Billing Address"
|
|
30
|
+
},
|
|
31
|
+
"AddressForm": {
|
|
32
|
+
"Validity": {
|
|
33
|
+
"badInput": "Provide a valid {field}.",
|
|
34
|
+
"patternMismatch": "Ensure you have entered a correct {field} format.",
|
|
35
|
+
"rangeOverflow": "Choose a valid {field} within the allowed range.",
|
|
36
|
+
"rangeUnderflow": "Choose a valid {field} within the allowed range.",
|
|
37
|
+
"tooLong": "This entry is too long. Keep it under {field} characters.",
|
|
38
|
+
"tooShort": "Use at least {field} characters.",
|
|
39
|
+
"typeMismatch": "Enter a valid {field}.",
|
|
40
|
+
"valueMissing": "Enter a {field}, this field is required."
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"BillToShippingAddress": {
|
|
44
|
+
"title": "Bill to shipping address"
|
|
45
|
+
},
|
|
46
|
+
"PaymentMethods": {
|
|
47
|
+
"title": "Payment",
|
|
48
|
+
"emptyState": "No payment methods available"
|
|
49
|
+
},
|
|
50
|
+
"OutOfStock": {
|
|
51
|
+
"title": "Out of stock",
|
|
52
|
+
"message": "Your cart contains items that are out of stock or have limited availability. Please review your cart before placing the order.",
|
|
53
|
+
"button": "Review cart",
|
|
54
|
+
"lowInventory": {
|
|
55
|
+
"one": "Last item!",
|
|
56
|
+
"many": "Only {{count}} left!"
|
|
57
|
+
},
|
|
58
|
+
"alert": "Out of stock!"
|
|
59
|
+
},
|
|
60
|
+
"PlaceOrder": {
|
|
61
|
+
"button": "Place Order"
|
|
62
|
+
},
|
|
63
|
+
"ServerError": {
|
|
64
|
+
"title": "We were unable to process your order",
|
|
65
|
+
"contactSupport": "If you continue to have issues, please contact support.",
|
|
66
|
+
"unexpected": "An unexpected error occurred while processing your order. Please try again later.",
|
|
67
|
+
"button": "Try again"
|
|
68
|
+
},
|
|
69
|
+
"EmptyCart": {
|
|
70
|
+
"title": "Your cart is empty",
|
|
71
|
+
"button": "Start shopping"
|
|
72
|
+
},
|
|
73
|
+
"ErrorBanner": {
|
|
74
|
+
"genericMessage": "Server error detected. Please check your connection and try again."
|
|
75
|
+
},
|
|
76
|
+
"MergedCartBanner": {
|
|
77
|
+
"items": {
|
|
78
|
+
"one": "1 item from a previous session was added to your cart. Please review your new subtotal.",
|
|
79
|
+
"many": "{{count}} items from a previous session were added to your cart. Please review your new subtotal."
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
;
|
|
85
|
+
|
|
86
|
+
export default _default;
|
package/lib/acdl.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Order } from '../data/models/order';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* See: https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/contexts.ts
|
|
5
|
+
*/
|
|
6
|
+
export declare const contexts: {
|
|
7
|
+
SHOPPING_CART_CONTEXT: string;
|
|
8
|
+
ORDER_CONTEXT: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* See: https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/events.ts
|
|
12
|
+
*/
|
|
13
|
+
export declare const events: {
|
|
14
|
+
PLACE_ORDER: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function getAdobeDataLayer(): any;
|
|
17
|
+
export declare function publishPlaceOrderEvent(order: Order): void;
|
|
18
|
+
//# sourceMappingURL=acdl.d.ts.map
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Repository } from '../services/backup';
|
|
2
|
+
|
|
3
|
+
export declare class LocalStorage implements Repository {
|
|
4
|
+
isAvailable(): boolean;
|
|
5
|
+
getKeys(): string[];
|
|
6
|
+
setItem(key: string, value: string): void;
|
|
7
|
+
getItem(key: string): string | null;
|
|
8
|
+
removeItem(key: string): void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=localStorage.d.ts.map
|
package/lib/state.d.ts
ADDED
package/msw/browser.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CurrencyEnum } from '../../../__generated__/types';
|
|
2
|
+
|
|
3
|
+
export declare const availableShippingMethodsFixture: {
|
|
4
|
+
amount: {
|
|
5
|
+
currency: CurrencyEnum;
|
|
6
|
+
value: number;
|
|
7
|
+
};
|
|
8
|
+
available: boolean;
|
|
9
|
+
carrier_code: string;
|
|
10
|
+
carrier_title: string;
|
|
11
|
+
error_message: string;
|
|
12
|
+
method_code: string;
|
|
13
|
+
method_title: string;
|
|
14
|
+
price_excl_tax: {
|
|
15
|
+
value: number;
|
|
16
|
+
currency: CurrencyEnum;
|
|
17
|
+
};
|
|
18
|
+
price_incl_tax: {
|
|
19
|
+
value: number;
|
|
20
|
+
currency: CurrencyEnum;
|
|
21
|
+
};
|
|
22
|
+
}[];
|
|
23
|
+
//# sourceMappingURL=available-shipping-methods.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const billingAddressFixture: {
|
|
2
|
+
firstname: string;
|
|
3
|
+
lastname: string;
|
|
4
|
+
company: null;
|
|
5
|
+
street: string[];
|
|
6
|
+
city: string;
|
|
7
|
+
postcode: string;
|
|
8
|
+
vat_id: null;
|
|
9
|
+
country: {
|
|
10
|
+
code: string;
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
region: {
|
|
14
|
+
region_id: number;
|
|
15
|
+
code: string;
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
telephone: string;
|
|
19
|
+
custom_attributes: {}[];
|
|
20
|
+
};
|
|
21
|
+
export declare const ukBillingAddressFixture: {
|
|
22
|
+
firstname: string;
|
|
23
|
+
lastname: string;
|
|
24
|
+
company: null;
|
|
25
|
+
street: string[];
|
|
26
|
+
city: string;
|
|
27
|
+
postcode: string;
|
|
28
|
+
vat_id: null;
|
|
29
|
+
country: {
|
|
30
|
+
code: string;
|
|
31
|
+
label: string;
|
|
32
|
+
};
|
|
33
|
+
telephone: string;
|
|
34
|
+
custom_attributes: {}[];
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=billing-address.d.ts.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export declare const cartFixture: {
|
|
2
|
+
__typename?: "Cart" | undefined;
|
|
3
|
+
id: string;
|
|
4
|
+
is_virtual: boolean;
|
|
5
|
+
email?: string | null | undefined;
|
|
6
|
+
total_quantity: number;
|
|
7
|
+
billing_address?: {
|
|
8
|
+
__typename?: "BillingCartAddress" | undefined;
|
|
9
|
+
city: string;
|
|
10
|
+
firstname: string;
|
|
11
|
+
lastname: string;
|
|
12
|
+
company?: string | null | undefined;
|
|
13
|
+
postcode?: string | null | undefined;
|
|
14
|
+
vat_id?: string | null | undefined;
|
|
15
|
+
street: (string | null)[];
|
|
16
|
+
telephone?: string | null | undefined;
|
|
17
|
+
country: {
|
|
18
|
+
__typename?: "CartAddressCountry" | undefined;
|
|
19
|
+
code: string;
|
|
20
|
+
label: string;
|
|
21
|
+
};
|
|
22
|
+
region?: {
|
|
23
|
+
__typename?: "CartAddressRegion" | undefined;
|
|
24
|
+
region_id?: number | null | undefined;
|
|
25
|
+
code?: string | null | undefined;
|
|
26
|
+
label?: string | null | undefined;
|
|
27
|
+
} | null | undefined;
|
|
28
|
+
custom_attributes: ({
|
|
29
|
+
__typename?: "AttributeSelectedOptions" | undefined;
|
|
30
|
+
} | {
|
|
31
|
+
__typename?: "AttributeValue" | undefined;
|
|
32
|
+
code: string;
|
|
33
|
+
value: string;
|
|
34
|
+
} | null)[];
|
|
35
|
+
} | null | undefined;
|
|
36
|
+
shipping_addresses: ({
|
|
37
|
+
__typename?: "ShippingCartAddress" | undefined;
|
|
38
|
+
firstname: string;
|
|
39
|
+
lastname: string;
|
|
40
|
+
company?: string | null | undefined;
|
|
41
|
+
street: (string | null)[];
|
|
42
|
+
city: string;
|
|
43
|
+
postcode?: string | null | undefined;
|
|
44
|
+
vat_id?: string | null | undefined;
|
|
45
|
+
telephone?: string | null | undefined;
|
|
46
|
+
region?: {
|
|
47
|
+
__typename?: "CartAddressRegion" | undefined;
|
|
48
|
+
region_id?: number | null | undefined;
|
|
49
|
+
code?: string | null | undefined;
|
|
50
|
+
label?: string | null | undefined;
|
|
51
|
+
} | null | undefined;
|
|
52
|
+
country: {
|
|
53
|
+
__typename?: "CartAddressCountry" | undefined;
|
|
54
|
+
code: string;
|
|
55
|
+
label: string;
|
|
56
|
+
};
|
|
57
|
+
custom_attributes: ({
|
|
58
|
+
__typename?: "AttributeSelectedOptions" | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
__typename?: "AttributeValue" | undefined;
|
|
61
|
+
code: string;
|
|
62
|
+
value: string;
|
|
63
|
+
} | null)[];
|
|
64
|
+
available_shipping_methods?: ({
|
|
65
|
+
__typename?: "AvailableShippingMethod" | undefined;
|
|
66
|
+
available: boolean;
|
|
67
|
+
carrier_code: string;
|
|
68
|
+
carrier_title: string;
|
|
69
|
+
error_message?: string | null | undefined;
|
|
70
|
+
method_code?: string | null | undefined;
|
|
71
|
+
method_title?: string | null | undefined;
|
|
72
|
+
amount: {
|
|
73
|
+
__typename?: "Money" | undefined;
|
|
74
|
+
currency?: import('../../../__generated__/types').CurrencyEnum | null | undefined;
|
|
75
|
+
value?: number | null | undefined;
|
|
76
|
+
};
|
|
77
|
+
price_excl_tax: {
|
|
78
|
+
__typename?: "Money" | undefined;
|
|
79
|
+
value?: number | null | undefined;
|
|
80
|
+
currency?: import('../../../__generated__/types').CurrencyEnum | null | undefined;
|
|
81
|
+
};
|
|
82
|
+
price_incl_tax: {
|
|
83
|
+
__typename?: "Money" | undefined;
|
|
84
|
+
value?: number | null | undefined;
|
|
85
|
+
currency?: import('../../../__generated__/types').CurrencyEnum | null | undefined;
|
|
86
|
+
};
|
|
87
|
+
} | null)[] | null | undefined;
|
|
88
|
+
selected_shipping_method?: {
|
|
89
|
+
__typename?: "SelectedShippingMethod" | undefined;
|
|
90
|
+
carrier_code: string;
|
|
91
|
+
carrier_title: string;
|
|
92
|
+
method_code: string;
|
|
93
|
+
method_title: string;
|
|
94
|
+
amount: {
|
|
95
|
+
__typename?: "Money" | undefined;
|
|
96
|
+
value?: number | null | undefined;
|
|
97
|
+
currency?: import('../../../__generated__/types').CurrencyEnum | null | undefined;
|
|
98
|
+
};
|
|
99
|
+
} | null | undefined;
|
|
100
|
+
} | null)[];
|
|
101
|
+
available_payment_methods?: ({
|
|
102
|
+
__typename?: "AvailablePaymentMethod" | undefined;
|
|
103
|
+
code: string;
|
|
104
|
+
title: string;
|
|
105
|
+
} | null)[] | null | undefined;
|
|
106
|
+
selected_payment_method?: {
|
|
107
|
+
__typename?: "SelectedPaymentMethod" | undefined;
|
|
108
|
+
code: string;
|
|
109
|
+
title: string;
|
|
110
|
+
} | null | undefined;
|
|
111
|
+
} | null | undefined;
|
|
112
|
+
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './shipping-address';
|
|
2
|
+
export * from './available-shipping-methods';
|
|
3
|
+
export * from './billing-address';
|
|
4
|
+
export * from './countries';
|
|
5
|
+
export * from './american-regions';
|
|
6
|
+
export * from './form-fields';
|
|
7
|
+
export * from './cart';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const shippingAddressFixture: {
|
|
2
|
+
firstname: string;
|
|
3
|
+
lastname: string;
|
|
4
|
+
company: null;
|
|
5
|
+
street: string[];
|
|
6
|
+
city: string;
|
|
7
|
+
postcode: string;
|
|
8
|
+
vat_id: null;
|
|
9
|
+
country: {
|
|
10
|
+
code: string;
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
region: {
|
|
14
|
+
region_id: number;
|
|
15
|
+
code: string;
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
telephone: string;
|
|
19
|
+
custom_attributes: {}[];
|
|
20
|
+
available_shipping_methods: {
|
|
21
|
+
amount: {
|
|
22
|
+
currency: import('../../../__generated__/types').CurrencyEnum;
|
|
23
|
+
value: number;
|
|
24
|
+
};
|
|
25
|
+
available: boolean;
|
|
26
|
+
carrier_code: string;
|
|
27
|
+
carrier_title: string;
|
|
28
|
+
error_message: string;
|
|
29
|
+
method_code: string;
|
|
30
|
+
method_title: string;
|
|
31
|
+
price_excl_tax: {
|
|
32
|
+
value: number;
|
|
33
|
+
currency: import('../../../__generated__/types').CurrencyEnum;
|
|
34
|
+
};
|
|
35
|
+
price_incl_tax: {
|
|
36
|
+
value: number;
|
|
37
|
+
currency: import('../../../__generated__/types').CurrencyEnum;
|
|
38
|
+
};
|
|
39
|
+
}[];
|
|
40
|
+
selected_shipping_method: null;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=shipping-address.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './set-shipping-address';
|
|
2
|
+
export * from './set-billing-address';
|
|
3
|
+
export * from './set-shipping-methods';
|
|
4
|
+
export * from './set-payment-method';
|
|
5
|
+
export * from './set-guest-email';
|
|
6
|
+
export * from './place-order';
|
|
7
|
+
export * from './estimate-shipping-methods';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SetBillingAddressMutation } from '../../../__generated__/types';
|
|
2
|
+
|
|
3
|
+
export declare const setBillingAddressFixture: SetBillingAddressMutation;
|
|
4
|
+
export declare const setBillingAddressSameAsShippingFixture: SetBillingAddressMutation;
|
|
5
|
+
//# sourceMappingURL=set-billing-address.d.ts.map
|