@liquidcommerce/elements-sdk 2.6.0-beta.1 → 2.6.0-beta.100
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/README.md +99 -2517
- package/dist/index.checkout.esm.js +17794 -0
- package/dist/index.esm.js +26010 -20601
- package/dist/ssr-stub.checkout.esm.js +18 -0
- package/dist/ssr-stub.esm.js +270 -0
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +50 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -2
- package/dist/types/clients/builder.d.ts +3 -0
- package/dist/types/clients/checkout.d.ts +6 -0
- package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
- package/dist/types/clients/main.d.ts +3 -0
- package/dist/types/constants/core.constant.d.ts +13 -6
- package/dist/types/core/a11y/announcer.service.d.ts +16 -0
- package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
- package/dist/types/core/a11y/focusable.d.ts +5 -0
- package/dist/types/core/a11y/glyph-button.d.ts +8 -0
- package/dist/types/core/a11y/index.d.ts +5 -0
- package/dist/types/core/a11y/single-select.d.ts +16 -0
- package/dist/types/core/api/api-client.service.d.ts +23 -22
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +39 -26
- package/dist/types/core/api/http-client.service.d.ts +0 -8
- package/dist/types/core/base-component.service.d.ts +4 -1
- package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
- package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
- package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
- package/dist/types/core/client/client-action.service.d.ts +6 -67
- package/dist/types/core/client/client-config.service.d.ts +9 -5
- package/dist/types/core/command/base-command.service.d.ts +2 -2
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/google-tag-manager.service.d.ts +15 -11
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +6 -12
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +45 -50
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
- package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
- package/dist/types/core/singleton-manager.service.d.ts +12 -8
- package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -55
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -108
- package/dist/types/core/store/interfaces/core.interface.d.ts +16 -5
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +13 -66
- package/dist/types/core/store/store.constant.d.ts +6 -1
- package/dist/types/core/store/store.service.d.ts +1 -0
- package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
- package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
- package/dist/types/enums/core.enum.d.ts +40 -1
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +8 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +8 -3
- package/dist/types/interfaces/api/address.interface.d.ts +28 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +96 -0
- package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
- package/dist/types/interfaces/{cloud → api}/index.d.ts +1 -3
- package/dist/types/interfaces/api/product-list.interface.d.ts +39 -0
- package/dist/types/interfaces/api/product.interface.d.ts +112 -0
- package/dist/types/interfaces/client.interface.d.ts +72 -0
- package/dist/types/interfaces/component.interface.d.ts +7 -0
- package/dist/types/interfaces/config.interface.d.ts +40 -0
- package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
- package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
- package/dist/types/interfaces/configs/global.interface.d.ts +10 -3
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +4 -1
- package/dist/types/interfaces/injection.interface.d.ts +49 -0
- package/dist/types/modules/address/address-display.component.d.ts +3 -1
- package/dist/types/modules/address/address-input.component.d.ts +10 -1
- package/dist/types/modules/address/address.command.d.ts +4 -4
- package/dist/types/modules/address/address.interface.d.ts +0 -7
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +4 -5
- package/dist/types/modules/cart/components/cart-body.component.d.ts +3 -1
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
- package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
- package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +27 -10
- package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
- package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +2 -1
- package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
- package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
- package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
- package/dist/types/modules/checkout/constant.d.ts +3 -0
- package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/components/components.d.ts +7 -4
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +7 -1
- package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
- package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +4 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +10 -2
- package/dist/types/modules/product/product.commands.d.ts +7 -7
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
- package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-checkbox-filter.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-price-filter.d.ts +22 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
- package/dist/types/modules/product-list/components/index.d.ts +6 -0
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +36 -30
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +56 -14
- package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +53 -0
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
- package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
- package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +23 -7
- package/dist/types/modules/product-list/product-list.component.d.ts +17 -39
- package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
- package/dist/types/modules/product-list/product-list.interface.d.ts +65 -0
- package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
- package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
- package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
- package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
- package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +8 -1
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +14 -1
- package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
- package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
- package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
- package/dist/types/ssr/stub.checkout.d.ts +6 -0
- package/dist/types/ssr/stub.d.ts +10 -0
- package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
- package/dist/types/static/icon/bag.icon.d.ts +1 -1
- package/dist/types/static/icon/check.icon.d.ts +2 -0
- package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
- package/dist/types/static/icon/close.icon.d.ts +1 -1
- package/dist/types/static/icon/error-info.icon.d.ts +1 -1
- package/dist/types/static/icon/filter.icon.d.ts +2 -0
- package/dist/types/static/icon/icon.a11y.d.ts +1 -0
- package/dist/types/static/icon/icon.types.d.ts +1 -0
- package/dist/types/static/icon/index.d.ts +3 -0
- package/dist/types/static/icon/info.icon.d.ts +1 -1
- package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
- package/dist/types/static/icon/search.icon.d.ts +1 -1
- package/dist/types/static/icon/success.icon.d.ts +1 -1
- package/dist/types/static/icon/trash.icon.d.ts +1 -1
- package/dist/types/static/icon/warning.icon.d.ts +1 -1
- package/dist/types/utils/dom-compat.d.ts +2 -0
- package/dist/types/utils/format.d.ts +4 -14
- package/dist/types/utils/image-bg-removal.d.ts +3 -0
- package/dist/types/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +15 -0
- package/docs/v1/README.md +213 -0
- package/docs/v1/api/actions/address-actions.md +286 -0
- package/docs/v1/api/actions/cart-actions.md +364 -0
- package/docs/v1/api/actions/checkout-actions.md +527 -0
- package/docs/v1/api/actions/product-actions.md +204 -0
- package/docs/v1/api/client.md +596 -0
- package/docs/v1/api/configuration.md +555 -0
- package/docs/v1/api/injection-methods.md +292 -0
- package/docs/v1/api/typescript-types.md +423 -0
- package/docs/v1/api/ui-helpers.md +200 -0
- package/docs/v1/examples/advanced-patterns.md +199 -0
- package/docs/v1/examples/checkout-flow.md +90 -0
- package/docs/v1/examples/custom-theming.md +63 -0
- package/docs/v1/examples/multi-product-page.md +90 -0
- package/docs/v1/examples/simple-product-page.md +89 -0
- package/docs/v1/getting-started/concepts.md +521 -0
- package/docs/v1/getting-started/installation.md +349 -0
- package/docs/v1/getting-started/quick-start.md +410 -0
- package/docs/v1/guides/accessibility.md +173 -0
- package/docs/v1/guides/address-component.md +435 -0
- package/docs/v1/guides/best-practices.md +365 -0
- package/docs/v1/guides/cart-component.md +757 -0
- package/docs/v1/guides/checkout-component.md +670 -0
- package/docs/v1/guides/events.md +939 -0
- package/docs/v1/guides/product-component.md +735 -0
- package/docs/v1/guides/product-list-component.md +630 -0
- package/docs/v1/guides/theming.md +228 -0
- package/docs/v1/integration/angular.md +39 -0
- package/docs/v1/integration/laravel.md +41 -0
- package/docs/v1/integration/nextjs.md +69 -0
- package/docs/v1/integration/proxy-setup.md +106 -0
- package/docs/v1/integration/react.md +64 -0
- package/docs/v1/integration/vanilla-js.md +84 -0
- package/docs/v1/integration/vue.md +58 -0
- package/docs/v1/reference/analytics.md +108 -0
- package/docs/v1/reference/browser-support.md +47 -0
- package/docs/v1/reference/error-handling.md +83 -0
- package/docs/v1/reference/performance.md +52 -0
- package/docs/v1/reference/telemetry.md +85 -0
- package/docs/v1/reference/troubleshooting.md +135 -0
- package/package.json +69 -45
- package/dist/types/elements-builder-client.d.ts +0 -2
- package/dist/types/elements-client.d.ts +0 -2
- package/dist/types/enums/cloud.enum.d.ts +0 -77
- package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
- package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -214
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/interfaces/core.interface.d.ts +0 -111
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/modules/product/utils/helpers.d.ts +0 -3
- package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
- package/dist/types/utils/helper.d.ts +0 -27
- package/docs/ACTIONS.md +0 -1300
- package/docs/BROWSER_SUPPORT.md +0 -279
- package/docs/CONFIGURATION.md +0 -853
- package/docs/DOCUMENTATION_INDEX.md +0 -311
- package/docs/EVENTS.md +0 -798
- package/docs/PROXY.md +0 -228
- package/docs/THEMING.md +0 -589
- package/docs/TROUBLESHOOTING.md +0 -793
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
|
@@ -1,67 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
variantId: string;
|
|
5
|
-
liquidId: string;
|
|
6
|
-
retailerId: string;
|
|
7
|
-
partNumber: string;
|
|
8
|
-
fulfillmentId: string;
|
|
9
|
-
upc: string;
|
|
10
|
-
sku: string;
|
|
11
|
-
salsifyGrouping: string;
|
|
12
|
-
catPath: string;
|
|
13
|
-
volume: string;
|
|
14
|
-
uom: string;
|
|
15
|
-
pack: boolean;
|
|
16
|
-
packDesc: string;
|
|
17
|
-
container: string;
|
|
18
|
-
containerType: string;
|
|
19
|
-
name: string;
|
|
20
|
-
brand: string;
|
|
21
|
-
size: string;
|
|
22
|
-
price: number;
|
|
23
|
-
quantity: number;
|
|
24
|
-
maxQuantity: number;
|
|
25
|
-
unitPrice: number;
|
|
26
|
-
mainImage: string;
|
|
27
|
-
attributes: ICartItemAttributes;
|
|
28
|
-
}
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
2
|
+
import type { ICartItem, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
29
3
|
export interface IBaseCartEventData {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
4
|
+
cartId: string;
|
|
5
|
+
promoCodeDiscount: number | null;
|
|
6
|
+
subtotal: number;
|
|
7
|
+
itemCount: number;
|
|
8
|
+
items: Record<string, ICartItem>;
|
|
9
|
+
retailers: Record<string, ICartRetailer>;
|
|
33
10
|
location: {
|
|
34
11
|
placesId: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
state: string;
|
|
40
|
-
zip: string;
|
|
41
|
-
country: string;
|
|
42
|
-
};
|
|
43
|
-
coordinates: {
|
|
44
|
-
latitude: number;
|
|
45
|
-
longitude: number;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
amounts: {
|
|
49
|
-
deliveryFee: number;
|
|
50
|
-
discounts: number;
|
|
51
|
-
engravingFee: number;
|
|
52
|
-
giftCardTotal: number;
|
|
53
|
-
platformFee: number;
|
|
54
|
-
shippingFee: number;
|
|
55
|
-
subtotal: number;
|
|
56
|
-
total: number;
|
|
57
|
-
};
|
|
58
|
-
itemCount: number;
|
|
59
|
-
updatedAt: string;
|
|
60
|
-
createdAt: string;
|
|
12
|
+
formattedAddress: string;
|
|
13
|
+
address: IAddressAddress;
|
|
14
|
+
coordinates: IAddressCoordinates;
|
|
15
|
+
} | null;
|
|
61
16
|
}
|
|
62
17
|
export interface ICartLoadedEventData extends IBaseCartEventData {
|
|
63
18
|
}
|
|
64
19
|
export interface ICartFailedEventData {
|
|
20
|
+
cartId: string;
|
|
65
21
|
message: string;
|
|
66
22
|
}
|
|
67
23
|
export interface ICartUpdatedEventData {
|
|
@@ -69,38 +25,45 @@ export interface ICartUpdatedEventData {
|
|
|
69
25
|
current: IBaseCartEventData;
|
|
70
26
|
}
|
|
71
27
|
export interface ICartItemAddedEventData {
|
|
72
|
-
|
|
73
|
-
|
|
28
|
+
cartId: string;
|
|
29
|
+
itemId: string;
|
|
74
30
|
fulfillmentId: string;
|
|
75
31
|
partNumber: string;
|
|
76
32
|
quantity: number;
|
|
77
33
|
engravingLines?: string[];
|
|
78
34
|
}
|
|
79
35
|
export interface ICartItemRemovedEventData {
|
|
80
|
-
|
|
36
|
+
cartId: string;
|
|
37
|
+
itemId: string;
|
|
81
38
|
}
|
|
82
39
|
export interface ICartItemQuantityChangedEventData {
|
|
83
|
-
|
|
40
|
+
cartId: string;
|
|
41
|
+
itemId: string;
|
|
84
42
|
quantity: number;
|
|
85
43
|
previousQuantity: number;
|
|
86
44
|
}
|
|
87
45
|
export interface ICartItemEngravingUpdatedEventData {
|
|
88
|
-
|
|
46
|
+
cartId: string;
|
|
47
|
+
itemId: string;
|
|
89
48
|
engravingLines: string[];
|
|
90
49
|
previousEngravingLines: string[];
|
|
91
50
|
}
|
|
92
51
|
export interface ICartPromoCodeEventData {
|
|
93
|
-
|
|
94
|
-
|
|
52
|
+
cartId: string;
|
|
53
|
+
discount?: number;
|
|
54
|
+
newSubtotal?: number;
|
|
95
55
|
}
|
|
96
56
|
export interface ICartPromoCodeFailedEventData {
|
|
57
|
+
cartId: string;
|
|
97
58
|
error: string;
|
|
98
59
|
}
|
|
99
60
|
export interface ICartProductAddEventData {
|
|
61
|
+
cartId: string;
|
|
100
62
|
itemsAdded: number;
|
|
101
63
|
identifiers: string[];
|
|
102
64
|
}
|
|
103
65
|
export interface ICartProductAddFailedEventData {
|
|
66
|
+
cartId: string;
|
|
104
67
|
identifiers: string[];
|
|
105
68
|
error: string;
|
|
106
69
|
}
|
|
@@ -1,24 +1,56 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ICheckoutAmounts, ICheckoutItem } from '@/interfaces/api/checkout.interface';
|
|
2
2
|
export interface IBaseCheckoutEventData {
|
|
3
|
+
token: string;
|
|
3
4
|
cartId: string;
|
|
5
|
+
isGift: boolean;
|
|
6
|
+
billingSameAsShipping: boolean;
|
|
7
|
+
marketingPreferences: {
|
|
8
|
+
canEmail: boolean;
|
|
9
|
+
canSms: boolean;
|
|
10
|
+
};
|
|
11
|
+
hasPromoCode: boolean;
|
|
12
|
+
hasGiftCards: boolean;
|
|
13
|
+
amounts: ICheckoutAmounts;
|
|
14
|
+
itemCount: number;
|
|
15
|
+
items: Record<string, ICheckoutItem>;
|
|
4
16
|
}
|
|
5
17
|
export interface ICheckoutLoadedEventData extends IBaseCheckoutEventData {
|
|
6
18
|
}
|
|
19
|
+
export interface ICheckoutDetailsEventData extends IBaseCheckoutEventData {
|
|
20
|
+
}
|
|
21
|
+
export interface ICheckoutCustomerInformationUpdatedEventData {
|
|
22
|
+
cartId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ICheckoutGiftInformationUpdatedEventData {
|
|
25
|
+
cartId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ICheckoutBillingInformationUpdatedEventData {
|
|
28
|
+
cartId: string;
|
|
29
|
+
}
|
|
7
30
|
export interface ICheckoutTipUpdatedEventData {
|
|
31
|
+
cartId: string;
|
|
8
32
|
deliveryTips: Array<{
|
|
9
|
-
fulfillmentId
|
|
10
|
-
|
|
33
|
+
fulfillmentId: string;
|
|
34
|
+
tip: number;
|
|
35
|
+
}>;
|
|
36
|
+
previousDeliveryTips: Array<{
|
|
37
|
+
fulfillmentId: string;
|
|
38
|
+
tip: number;
|
|
11
39
|
}>;
|
|
12
40
|
}
|
|
13
41
|
export interface ICheckoutFailedEventData {
|
|
14
42
|
message: string;
|
|
15
43
|
}
|
|
16
44
|
export interface ICheckoutToggleEventData {
|
|
45
|
+
cartId: string;
|
|
17
46
|
isActive: boolean;
|
|
47
|
+
previousIsActive: boolean;
|
|
18
48
|
}
|
|
19
49
|
export interface ICheckoutMarketingPreferencesToggleEventData {
|
|
50
|
+
cartId: string;
|
|
20
51
|
fieldName: 'canEmail' | 'canSms';
|
|
21
52
|
isActive: boolean;
|
|
53
|
+
previousIsActive: boolean;
|
|
22
54
|
}
|
|
23
55
|
export interface ICheckoutSubmitStartedEventData {
|
|
24
56
|
started: boolean;
|
|
@@ -31,84 +63,47 @@ export interface ICheckoutSubmitFailedEventData {
|
|
|
31
63
|
message: string;
|
|
32
64
|
}
|
|
33
65
|
export interface ICheckoutItemQuantityChangedEventData {
|
|
66
|
+
cartId: string;
|
|
34
67
|
cartItemId: string;
|
|
35
68
|
quantity: number;
|
|
36
69
|
previousQuantity: number;
|
|
37
70
|
}
|
|
38
71
|
export interface ICheckoutItemRemovedEventData {
|
|
72
|
+
cartId: string;
|
|
39
73
|
cartItemId: string;
|
|
40
74
|
}
|
|
41
75
|
export interface ICheckoutItemEngravingUpdatedEventData {
|
|
76
|
+
cartId: string;
|
|
42
77
|
cartItemId: string;
|
|
43
78
|
engravingLines: string[];
|
|
44
79
|
previousEngravingLines: string[];
|
|
45
80
|
}
|
|
46
81
|
export interface ICheckoutPromoCodeEventData {
|
|
47
|
-
|
|
82
|
+
cartId: string;
|
|
83
|
+
discount?: number;
|
|
48
84
|
newTotal?: number;
|
|
49
85
|
}
|
|
50
86
|
export interface ICheckoutPromoCodeFailedEventData {
|
|
87
|
+
cartId: string;
|
|
51
88
|
error: string;
|
|
52
89
|
}
|
|
53
90
|
export interface ICheckoutGiftCardEventData {
|
|
91
|
+
cartId: string;
|
|
54
92
|
newTotal?: number;
|
|
55
93
|
}
|
|
56
94
|
export interface ICheckoutGiftCardFailedEventData {
|
|
95
|
+
cartId: string;
|
|
57
96
|
error: string;
|
|
58
97
|
}
|
|
59
98
|
export interface ICheckoutProductAddEventData {
|
|
99
|
+
cartId: string;
|
|
60
100
|
itemsAdded: number;
|
|
61
101
|
identifiers: string[];
|
|
62
102
|
isPresale?: boolean;
|
|
63
103
|
}
|
|
64
104
|
export interface ICheckoutProductAddFailedEventData {
|
|
105
|
+
cartId: string;
|
|
65
106
|
identifiers: string[];
|
|
66
107
|
error: string;
|
|
67
108
|
isPresale?: boolean;
|
|
68
109
|
}
|
|
69
|
-
export interface ICheckoutItemEventData {
|
|
70
|
-
liquidId: string;
|
|
71
|
-
variantId: string;
|
|
72
|
-
cartItemId: string;
|
|
73
|
-
retailerId: string;
|
|
74
|
-
fulfillmentId: string;
|
|
75
|
-
salsifyGrouping: string;
|
|
76
|
-
name: string;
|
|
77
|
-
catPath: string;
|
|
78
|
-
volume: string;
|
|
79
|
-
uom: string;
|
|
80
|
-
proof: string;
|
|
81
|
-
abv: string;
|
|
82
|
-
containerType: string;
|
|
83
|
-
container: string;
|
|
84
|
-
size: string;
|
|
85
|
-
pack: boolean;
|
|
86
|
-
packDesc: string;
|
|
87
|
-
mainImage: string;
|
|
88
|
-
brand: string;
|
|
89
|
-
partNumber: string;
|
|
90
|
-
upc: string;
|
|
91
|
-
sku: string;
|
|
92
|
-
price: number;
|
|
93
|
-
unitPrice: number;
|
|
94
|
-
quantity: number;
|
|
95
|
-
unitTax: number;
|
|
96
|
-
bottleDeposits: number;
|
|
97
|
-
attributes: ICartItemAttributes;
|
|
98
|
-
retailerName: string;
|
|
99
|
-
expectationDetail: string;
|
|
100
|
-
}
|
|
101
|
-
export interface ICheckoutDetailsEventData {
|
|
102
|
-
cartId: string;
|
|
103
|
-
isGift: boolean;
|
|
104
|
-
billingSameAsShipping: boolean;
|
|
105
|
-
marketingPreferences: {
|
|
106
|
-
canEmail: boolean;
|
|
107
|
-
canSms: boolean;
|
|
108
|
-
};
|
|
109
|
-
hasPromoCode: boolean;
|
|
110
|
-
hasGiftCards: boolean;
|
|
111
|
-
amounts: ICheckoutTotalAmounts;
|
|
112
|
-
itemCount: number;
|
|
113
|
-
items: Record<string, ICheckoutItemEventData>;
|
|
114
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IAddressActionEventData } from '@/core/pubsub/interfaces/address.interface';
|
|
1
|
+
import type { IAddressActionEventData, IAddressFailedEventData } from '@/core/pubsub/interfaces/address.interface';
|
|
2
2
|
import type { ICartFailedEventData, ICartItemAddedEventData, ICartItemEngravingUpdatedEventData, ICartItemQuantityChangedEventData, ICartItemRemovedEventData, ICartLoadedEventData, ICartProductAddEventData, ICartProductAddFailedEventData, ICartPromoCodeEventData, ICartPromoCodeFailedEventData, ICartUpdatedEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
3
|
-
import type { ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
3
|
+
import type { ICheckoutBillingInformationUpdatedEventData, ICheckoutCustomerInformationUpdatedEventData, ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutGiftInformationUpdatedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
4
4
|
import type { IProductAddToCartEventData, IProductFulfillmentChangedEventData, IProductFulfillmentTypeChangedEventData, IProductLoadedEventData, IProductQuantityChangedEventData, IProductSizeChangedEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
5
5
|
import { ELEMENTS_ACTIONS_EVENT } from '@/enums';
|
|
6
6
|
export interface IElementsClientIsReadyEventData {
|
|
@@ -16,6 +16,10 @@ export interface IEventMetadata {
|
|
|
16
16
|
originalEvent: string;
|
|
17
17
|
actionNamespace?: 'address' | 'product' | 'cart' | 'checkout' | 'other';
|
|
18
18
|
timestamp: number;
|
|
19
|
+
sdkVersion: string;
|
|
20
|
+
env: string;
|
|
21
|
+
tenantName: string;
|
|
22
|
+
tenantCode: string;
|
|
19
23
|
}
|
|
20
24
|
export interface IEnhancedEventData<T> {
|
|
21
25
|
data: T;
|
|
@@ -25,7 +29,7 @@ export interface IElementsActionsEventsMap {
|
|
|
25
29
|
[ELEMENTS_ACTIONS_EVENT.CLIENT_READY]: IElementsClientIsReadyEventData;
|
|
26
30
|
[ELEMENTS_ACTIONS_EVENT.ADDRESS_UPDATED]: IAddressActionEventData;
|
|
27
31
|
[ELEMENTS_ACTIONS_EVENT.ADDRESS_CLEARED]: boolean;
|
|
28
|
-
[ELEMENTS_ACTIONS_EVENT.ADDRESS_FAILED]:
|
|
32
|
+
[ELEMENTS_ACTIONS_EVENT.ADDRESS_FAILED]: IAddressFailedEventData;
|
|
29
33
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_LOADED]: IProductLoadedEventData;
|
|
30
34
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_QUANTITY_DECREASE]: IProductQuantityChangedEventData;
|
|
31
35
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_QUANTITY_INCREASE]: IProductQuantityChangedEventData;
|
|
@@ -49,6 +53,7 @@ export interface IElementsActionsEventsMap {
|
|
|
49
53
|
[ELEMENTS_ACTIONS_EVENT.CART_PROMO_CODE_FAILED]: ICartPromoCodeFailedEventData;
|
|
50
54
|
[ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_SUCCESS]: ICartProductAddEventData;
|
|
51
55
|
[ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_FAILED]: ICartProductAddFailedEventData;
|
|
56
|
+
[ELEMENTS_ACTIONS_EVENT.INTERNAL_CART_TO_CHECKOUT]: object;
|
|
52
57
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_OPENED]: boolean;
|
|
53
58
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CLOSED]: boolean;
|
|
54
59
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_LOADED]: ICheckoutLoadedEventData;
|
|
@@ -56,9 +61,9 @@ export interface IElementsActionsEventsMap {
|
|
|
56
61
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_IS_GIFT_TOGGLED]: ICheckoutToggleEventData;
|
|
57
62
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED]: ICheckoutToggleEventData;
|
|
58
63
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_MARKETING_PREFERENCES_TOGGLED]: ICheckoutMarketingPreferencesToggleEventData;
|
|
59
|
-
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]:
|
|
60
|
-
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]:
|
|
61
|
-
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]:
|
|
64
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]: ICheckoutCustomerInformationUpdatedEventData;
|
|
65
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]: ICheckoutGiftInformationUpdatedEventData;
|
|
66
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]: ICheckoutBillingInformationUpdatedEventData;
|
|
62
67
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_REMOVED]: ICheckoutItemRemovedEventData;
|
|
63
68
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_INCREASE]: ICheckoutItemQuantityChangedEventData;
|
|
64
69
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_DECREASE]: ICheckoutItemQuantityChangedEventData;
|
|
@@ -1,87 +1,23 @@
|
|
|
1
1
|
import type { FulfillmentType } from '@/enums';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
price: number;
|
|
5
|
-
partNumber: string;
|
|
6
|
-
stock: number;
|
|
7
|
-
isEngravable: boolean;
|
|
8
|
-
fulfillmentId: string;
|
|
9
|
-
fulfillmentType: FulfillmentType;
|
|
10
|
-
modalities: FulfillmentType[];
|
|
11
|
-
retailerId: string;
|
|
2
|
+
import type { IFulfillment, IProduct, IProductSize, IProductVariant, IRetailerAddress } from '@/interfaces/api/product.interface';
|
|
3
|
+
export type IProductFulfillmentEventData = IFulfillment & {
|
|
12
4
|
retailerName: string;
|
|
13
|
-
retailerAddress:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
location: string;
|
|
23
|
-
};
|
|
24
|
-
presale?: {
|
|
25
|
-
canPurchaseOn: null | string;
|
|
26
|
-
estimatedShipBy: null | string;
|
|
27
|
-
isActive: boolean;
|
|
28
|
-
language: string;
|
|
29
|
-
presaleLimit: number;
|
|
30
|
-
price: number;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export interface IBaseProductSizeEventData {
|
|
34
|
-
id: string;
|
|
35
|
-
upc: string;
|
|
36
|
-
size: string;
|
|
37
|
-
pack: boolean;
|
|
38
|
-
packDesc: string;
|
|
39
|
-
container: string;
|
|
40
|
-
containerType: string;
|
|
41
|
-
maxQuantityPerOrder: number;
|
|
42
|
-
image: string;
|
|
43
|
-
uom: string;
|
|
44
|
-
volume: string;
|
|
45
|
-
attributes: IBaseProductSizeAttributesEventData;
|
|
46
|
-
shippingFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
47
|
-
onDemandFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
48
|
-
}
|
|
49
|
-
export interface IBaseProductEventData {
|
|
5
|
+
retailerAddress: IRetailerAddress;
|
|
6
|
+
retailerAddressFormatted: string;
|
|
7
|
+
variant: IProductVariant;
|
|
8
|
+
};
|
|
9
|
+
export interface IProductSizeEventData extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
|
|
10
|
+
onDemandFulfillments: Record<string, IProductFulfillmentEventData>;
|
|
11
|
+
shippingFulfillments: Record<string, IProductFulfillmentEventData>;
|
|
12
|
+
}
|
|
13
|
+
export interface IBaseProductEventData extends Omit<IProduct, 'sizes'> {
|
|
50
14
|
identifier: string;
|
|
51
15
|
selectedSizeId: string | null;
|
|
52
|
-
selectedFulfillmentId: string | null;
|
|
53
16
|
selectedFulfillmentType: FulfillmentType;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
category: string;
|
|
59
|
-
classification: string;
|
|
60
|
-
type: string;
|
|
61
|
-
salsifyGrouping: string;
|
|
62
|
-
subType: string;
|
|
63
|
-
mainImage: string | null;
|
|
64
|
-
images: string[];
|
|
65
|
-
region: string;
|
|
66
|
-
country: string;
|
|
67
|
-
material: string;
|
|
68
|
-
abv: string;
|
|
69
|
-
proof: string;
|
|
70
|
-
age: string;
|
|
71
|
-
color: string;
|
|
72
|
-
flavor: string;
|
|
73
|
-
variety: string;
|
|
74
|
-
appellation: string;
|
|
75
|
-
vintage: string;
|
|
76
|
-
description: string;
|
|
77
|
-
htmlDescription: string;
|
|
78
|
-
tastingNotes: string;
|
|
79
|
-
priceInfo: {
|
|
80
|
-
min: number;
|
|
81
|
-
max: number;
|
|
82
|
-
avg: number;
|
|
83
|
-
} | null;
|
|
84
|
-
sizes: Record<string, IBaseProductSizeEventData>;
|
|
17
|
+
selectedFulfillmentId: string | null;
|
|
18
|
+
productHasAvailability: boolean;
|
|
19
|
+
fulfillmentHasAvailability: boolean;
|
|
20
|
+
sizes: Record<string, IProductSizeEventData>;
|
|
85
21
|
}
|
|
86
22
|
export interface IProductLoadedEventData extends IBaseProductEventData {
|
|
87
23
|
}
|
|
@@ -92,7 +28,6 @@ export interface IProductQuantityChangedEventData {
|
|
|
92
28
|
}
|
|
93
29
|
export interface IProductAddToCartEventData {
|
|
94
30
|
identifier: string;
|
|
95
|
-
upc: string;
|
|
96
31
|
fulfillmentId: string;
|
|
97
32
|
partNumber: string;
|
|
98
33
|
quantity: number;
|
|
@@ -101,7 +36,7 @@ export interface IProductAddToCartEventData {
|
|
|
101
36
|
export interface IProductSizeChangedEventData {
|
|
102
37
|
identifier: string;
|
|
103
38
|
selectedSizeId: string;
|
|
104
|
-
|
|
39
|
+
selectedSize: string;
|
|
105
40
|
previousSizeId: string;
|
|
106
41
|
previousSize: string;
|
|
107
42
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IElementsActionsEventsMap, IElementsFormsEventsMap, SpecificActionEvent, SpecificFormEvent } from '@/core/pubsub/interfaces/core.interface';
|
|
2
2
|
export declare class PubSubService {
|
|
3
3
|
private readonly logger;
|
|
4
|
-
private
|
|
4
|
+
private readonly clientConfig;
|
|
5
5
|
constructor();
|
|
6
6
|
private readonly eventPrefix;
|
|
7
7
|
static getInstance(): PubSubService;
|
|
@@ -9,5 +9,4 @@ export declare class PubSubService {
|
|
|
9
9
|
publishForm<K extends SpecificFormEvent>(eventType: K, data: IElementsFormsEventsMap[K]): void;
|
|
10
10
|
private publishSpecific;
|
|
11
11
|
private dispatchNativeEvents;
|
|
12
|
-
private setupClientReadyBuffering;
|
|
13
12
|
}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import type { IClientConfigs } from '@/core/client/client-config.service';
|
|
2
|
-
import type { LiquidCommerceElementsBuilderClientConstructor, LiquidCommerceElementsClientConstructor } from '@/interfaces/
|
|
2
|
+
import type { LiquidCommerceElementsBuilderClientConstructor, LiquidCommerceElementsCheckoutClientConstructor, LiquidCommerceElementsClientConstructor } from '@/interfaces/client.interface';
|
|
3
|
+
type ClientConstructor = LiquidCommerceElementsClientConstructor | LiquidCommerceElementsBuilderClientConstructor | LiquidCommerceElementsCheckoutClientConstructor;
|
|
4
|
+
export type SDKContext = 'regular' | 'builder' | 'checkout';
|
|
3
5
|
export declare class SingletonManager {
|
|
4
6
|
private static clientConstructor;
|
|
5
|
-
private static
|
|
6
|
-
private static builderClientInstances;
|
|
7
|
+
private static contexts;
|
|
7
8
|
private static currentContext;
|
|
9
|
+
private static initializationInProgress;
|
|
8
10
|
private static getInstances;
|
|
9
11
|
private constructor();
|
|
10
|
-
static setContext(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
static
|
|
14
|
-
static
|
|
12
|
+
static setContext(context: SDKContext): void;
|
|
13
|
+
static finalizeInitialization(): void;
|
|
14
|
+
static hasContext(context: SDKContext): boolean;
|
|
15
|
+
static destroyContext(context: SDKContext): void;
|
|
16
|
+
static setClientConstructor(lceConstructor: ClientConstructor): void;
|
|
17
|
+
static getClientConstructor(): ClientConstructor | null;
|
|
15
18
|
static getClassInstance<T>(className: string, instanceCreator: () => T): T;
|
|
16
19
|
static getClient<T>(clientConfigs: IClientConfigs): Promise<T>;
|
|
17
20
|
}
|
|
21
|
+
export {};
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
1
2
|
export interface IAddressStore {
|
|
2
3
|
id: string;
|
|
3
4
|
formattedAddress: string;
|
|
4
|
-
address:
|
|
5
|
-
|
|
6
|
-
two: string;
|
|
7
|
-
city: string;
|
|
8
|
-
state: string;
|
|
9
|
-
zip: string;
|
|
10
|
-
country: string;
|
|
11
|
-
};
|
|
12
|
-
coordinates: {
|
|
13
|
-
lat: number;
|
|
14
|
-
long: number;
|
|
15
|
-
};
|
|
5
|
+
address: IAddressAddress;
|
|
6
|
+
coordinates: IAddressCoordinates;
|
|
16
7
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { FulfillmentType } from '@/enums';
|
|
3
|
-
import type { IAddress, ICartItemAttributes, IRetailerExpectation, IRetailerFees } from '@/interfaces/cloud';
|
|
1
|
+
import type { ICartEvent, ICartFulfillment, ICartItemAttributes, ICartPromoCode, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
4
2
|
export interface ICartItemStore {
|
|
5
3
|
id: string;
|
|
6
4
|
variantId: string;
|
|
@@ -31,64 +29,27 @@ export interface ICartItemStore {
|
|
|
31
29
|
updating: boolean;
|
|
32
30
|
error: string | null;
|
|
33
31
|
}
|
|
34
|
-
export interface
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
platformFee: number;
|
|
39
|
-
giftCardTotal: number;
|
|
40
|
-
engravingFee: number;
|
|
41
|
-
deliveryFee: number;
|
|
42
|
-
discounts: number;
|
|
43
|
-
quantity: number;
|
|
32
|
+
export interface ICartFulfillmentStore extends ICartFulfillment {
|
|
33
|
+
loading: boolean;
|
|
34
|
+
error: string | null;
|
|
35
|
+
updating: boolean;
|
|
44
36
|
}
|
|
45
|
-
export interface
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
fees: IRetailerFees;
|
|
50
|
-
expectation: IRetailerExpectation;
|
|
51
|
-
shippingFee: number;
|
|
52
|
-
subtotal: number;
|
|
53
|
-
items: string[];
|
|
54
|
-
engravingFee: number;
|
|
55
|
-
deliveryFee: number;
|
|
56
|
-
retailerId: string;
|
|
57
|
-
loading?: boolean;
|
|
58
|
-
error?: string | null;
|
|
59
|
-
updating?: boolean;
|
|
37
|
+
export interface ICartRetailerStore extends ICartRetailer {
|
|
38
|
+
loading: boolean;
|
|
39
|
+
error: string | null;
|
|
40
|
+
updating: boolean;
|
|
60
41
|
}
|
|
61
|
-
export interface
|
|
42
|
+
export interface ICartStore {
|
|
62
43
|
id: string;
|
|
63
|
-
name: string;
|
|
64
|
-
platformFee: number;
|
|
65
|
-
shippingFee: number;
|
|
66
44
|
subtotal: number;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
error?: string | null;
|
|
74
|
-
updating?: boolean;
|
|
75
|
-
}
|
|
76
|
-
export interface ICartPromoCodeStore {
|
|
77
|
-
code: string;
|
|
78
|
-
discountAmount: number;
|
|
79
|
-
}
|
|
80
|
-
export interface ICartStore {
|
|
81
|
-
id: string | null;
|
|
45
|
+
itemsQuantity: number;
|
|
46
|
+
items: Record<string, ICartItemStore>;
|
|
47
|
+
fulfillments: Record<string, ICartFulfillmentStore>;
|
|
48
|
+
retailers: Record<string, ICartRetailerStore>;
|
|
49
|
+
promoCode: ICartPromoCode | null;
|
|
50
|
+
events: ICartEvent[];
|
|
82
51
|
loading: boolean;
|
|
83
52
|
error: string | null;
|
|
84
|
-
items: Record<string, ICartItemStore>;
|
|
85
|
-
totals: ICartTotalsStore;
|
|
86
|
-
retailers: Record<string, IRetailerStore>;
|
|
87
|
-
promoCode: ICartPromoCodeStore | null;
|
|
88
|
-
fulfillments: Record<string, IRetailerFulfillmentStore>;
|
|
89
53
|
rerender: boolean;
|
|
90
54
|
shouldReset: boolean;
|
|
91
|
-
updatedAt: string;
|
|
92
|
-
createdAt: string;
|
|
93
|
-
events: IElementsCartEvent[];
|
|
94
55
|
}
|