@liquidcommerce/elements-sdk 2.6.0-beta.3 → 2.6.0-beta.30

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.
Files changed (118) hide show
  1. package/README.md +7 -7
  2. package/dist/index.esm.js +15191 -14530
  3. package/dist/types/constants/core.constant.d.ts +4 -3
  4. package/dist/types/core/api/api-client.service.d.ts +15 -17
  5. package/dist/types/core/api/auth-client.service.d.ts +34 -23
  6. package/dist/types/core/api/http-client.service.d.ts +0 -1
  7. package/dist/types/core/client/client-action.service.d.ts +18 -12
  8. package/dist/types/core/client/client-config.service.d.ts +3 -0
  9. package/dist/types/core/command/base-command.service.d.ts +2 -2
  10. package/dist/types/core/command/common-command.service.d.ts +2 -1
  11. package/dist/types/core/google-tag-manager.service.d.ts +14 -11
  12. package/dist/types/core/logger/logger.service.d.ts +1 -1
  13. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
  14. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
  15. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +44 -50
  16. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +5 -4
  17. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
  18. package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
  19. package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -55
  20. package/dist/types/core/store/interfaces/checkout.interface.d.ts +17 -108
  21. package/dist/types/core/store/interfaces/core.interface.d.ts +18 -5
  22. package/dist/types/core/store/interfaces/product-list.interface.d.ts +47 -0
  23. package/dist/types/core/store/interfaces/product.interface.d.ts +13 -66
  24. package/dist/types/core/store/store.constant.d.ts +3 -1
  25. package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
  26. package/dist/types/elements-base-client.d.ts +5 -1
  27. package/dist/types/enums/core.enum.d.ts +26 -1
  28. package/dist/types/enums/index.d.ts +0 -1
  29. package/dist/types/interfaces/api/address.interface.d.ts +28 -0
  30. package/dist/types/interfaces/api/cart.interface.d.ts +95 -0
  31. package/dist/types/interfaces/api/checkout.interface.d.ts +216 -0
  32. package/dist/types/interfaces/api/product-list.interface.d.ts +38 -0
  33. package/dist/types/interfaces/api/product.interface.d.ts +105 -0
  34. package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
  35. package/dist/types/interfaces/configs/global.interface.d.ts +4 -2
  36. package/dist/types/interfaces/configs/index.d.ts +1 -0
  37. package/dist/types/interfaces/configs/product-list.interface.d.ts +25 -0
  38. package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
  39. package/dist/types/interfaces/core.interface.d.ts +17 -5
  40. package/dist/types/modules/address/address.command.d.ts +3 -3
  41. package/dist/types/modules/address/address.interface.d.ts +0 -7
  42. package/dist/types/modules/cart/cart.commands.d.ts +4 -5
  43. package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
  44. package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
  45. package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
  46. package/dist/types/modules/checkout/checkout.commands.d.ts +18 -9
  47. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  48. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  49. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
  50. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  51. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  52. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  53. package/dist/types/modules/checkout/constant.d.ts +3 -0
  54. package/dist/types/modules/product/components/components.d.ts +2 -4
  55. package/dist/types/modules/product/product.commands.d.ts +3 -2
  56. package/dist/types/modules/product-list/components/card-components/index.d.ts +4 -0
  57. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  58. package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts +13 -0
  59. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +10 -0
  60. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +9 -0
  61. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  62. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  63. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  64. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  65. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +14 -0
  66. package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +1 -1
  67. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +13 -0
  68. package/dist/types/modules/product-list/components/index.d.ts +5 -3
  69. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +59 -37
  70. package/dist/types/modules/product-list/components/product-list-retailers.d.ts +17 -0
  71. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +22 -0
  72. package/dist/types/modules/product-list/product-list-card.component.d.ts +35 -0
  73. package/dist/types/modules/product-list/product-list.commands.d.ts +55 -3
  74. package/dist/types/modules/product-list/product-list.component.d.ts +13 -42
  75. package/dist/types/modules/product-list/product-list.constants.d.ts +39 -0
  76. package/dist/types/modules/product-list/product-list.interface.d.ts +36 -31
  77. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  78. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  79. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +1 -0
  80. package/dist/types/modules/theme-provider/styles/ui/modal.style.d.ts +1 -0
  81. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -1
  82. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +1 -0
  83. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  84. package/dist/types/modules/ui-components/input/input.component.d.ts +8 -1
  85. package/dist/types/modules/ui-components/modal/modal.component.d.ts +21 -0
  86. package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
  87. package/dist/types/modules/ui-components/ui.commands.d.ts +3 -1
  88. package/dist/types/static/icon/check.icon.d.ts +2 -0
  89. package/dist/types/static/icon/index.d.ts +1 -0
  90. package/dist/types/utils/format.d.ts +0 -14
  91. package/docs/ACTIONS.md +13 -13
  92. package/docs/EVENTS.md +7 -7
  93. package/package.json +8 -9
  94. package/umd/elements.js +1 -1
  95. package/dist/types/enums/cloud.enum.d.ts +0 -403
  96. package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
  97. package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
  98. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
  99. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -214
  100. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  101. package/dist/types/interfaces/cloud/index.d.ts +0 -7
  102. package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
  103. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  104. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  105. package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
  106. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  107. package/dist/types/modules/product/utils/helpers.d.ts +0 -3
  108. package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
  109. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +0 -36
  110. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
  111. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
  112. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
  113. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
  114. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
  115. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  116. package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
  117. package/dist/types/utils/helper.d.ts +0 -27
  118. /package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import type { IAddressActionEventData } 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 {
@@ -49,6 +49,7 @@ export interface IElementsActionsEventsMap {
49
49
  [ELEMENTS_ACTIONS_EVENT.CART_PROMO_CODE_FAILED]: ICartPromoCodeFailedEventData;
50
50
  [ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_SUCCESS]: ICartProductAddEventData;
51
51
  [ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_FAILED]: ICartProductAddFailedEventData;
52
+ [ELEMENTS_ACTIONS_EVENT.INTERNAL_CART_TO_CHECKOUT]: object;
52
53
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_OPENED]: boolean;
53
54
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_CLOSED]: boolean;
54
55
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_LOADED]: ICheckoutLoadedEventData;
@@ -56,9 +57,9 @@ export interface IElementsActionsEventsMap {
56
57
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_IS_GIFT_TOGGLED]: ICheckoutToggleEventData;
57
58
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED]: ICheckoutToggleEventData;
58
59
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_MARKETING_PREFERENCES_TOGGLED]: ICheckoutMarketingPreferencesToggleEventData;
59
- [ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]: boolean;
60
- [ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]: boolean;
61
- [ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]: boolean;
60
+ [ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]: ICheckoutCustomerInformationUpdatedEventData;
61
+ [ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]: ICheckoutGiftInformationUpdatedEventData;
62
+ [ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]: ICheckoutBillingInformationUpdatedEventData;
62
63
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_REMOVED]: ICheckoutItemRemovedEventData;
63
64
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_INCREASE]: ICheckoutItemQuantityChangedEventData;
64
65
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_DECREASE]: ICheckoutItemQuantityChangedEventData;
@@ -1,87 +1,23 @@
1
1
  import type { FulfillmentType } from '@/enums';
2
- import type { IAddress, ICoords } from '@/interfaces/cloud';
3
- export interface IBaseProductFulfillmentEventData {
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: (IAddress & ICoords) | null;
14
- retailerTimezone: string;
15
- }
16
- export interface IBaseProductSizeAttributesEventData {
17
- engraving?: {
18
- status: boolean;
19
- maxLines: number;
20
- maxCharsPerLine: number;
21
- fee: number;
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
- id: string;
55
- name: string;
56
- brand: string;
57
- catPath: string;
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
- size: string;
39
+ selectedSize: string;
105
40
  previousSizeId: string;
106
41
  previousSize: string;
107
42
  }
@@ -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
- one: string;
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 { IElementsCartEvent } from 'utils/helper';
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 ICartTotalsStore {
35
- subtotal: number;
36
- total: number;
37
- shippingFee: number;
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 IRetailerFulfillmentStore {
46
- id: string;
47
- canEngrave: boolean;
48
- type: FulfillmentType;
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 IRetailerStore {
42
+ export interface ICartStore {
62
43
  id: string;
63
- name: string;
64
- platformFee: number;
65
- shippingFee: number;
66
44
  subtotal: number;
67
- address?: IAddress;
68
- deliveryFee: number;
69
- engravingFee: number;
70
- total: number;
71
- fulfillments: string[];
72
- loading?: boolean;
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
  }
@@ -1,121 +1,29 @@
1
- import type { IElementsCheckoutEvents } from 'utils/helper';
2
- import type { ICartItemAttributes, ICheckoutTotalAmounts } from '@/interfaces/cloud';
3
- export interface ICheckoutMarketingPreferencesStore {
4
- canEmail: boolean;
5
- canSms: boolean;
6
- }
7
- export interface ICheckoutPromoCodeStore {
8
- code: string;
9
- discountAmount: number;
10
- }
11
- export interface ICheckoutGiftCardStore {
12
- code: string;
13
- discountAmount: number;
14
- }
15
- export interface ICheckoutItemStore {
16
- liquidId: string;
17
- variantId: string;
18
- cartItemId: string;
19
- retailerId: string;
20
- fulfillmentId: string;
21
- salsifyGrouping: string;
22
- name: string;
23
- catPath: string;
24
- volume: string;
25
- uom: string;
26
- proof: string;
27
- abv: string;
28
- containerType: string;
29
- container: string;
30
- size: string;
31
- pack: boolean;
32
- packDesc: string;
33
- mainImage: string;
34
- brand: string;
35
- partNumber: string;
36
- upc: string;
37
- sku: string;
38
- price: number;
39
- unitPrice: number;
40
- quantity: number;
41
- unitTax: number;
42
- bottleDeposits: number;
43
- attributes: ICartItemAttributes;
44
- retailerName: string;
45
- expectationDetail: string;
1
+ import type { ICheckoutAmounts, ICheckoutBilling, ICheckoutCustomer, ICheckoutEvent, ICheckoutFulfillment, ICheckoutGiftCard, ICheckoutGiftRecipient, ICheckoutItem, ICheckoutMarketingPreferences, ICheckoutPaymentConfirm, ICheckoutPaymentSession, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer, ICheckoutShippingAddress } from '@/interfaces/api/checkout.interface';
2
+ export interface ICheckoutItemStore extends ICheckoutItem {
46
3
  loading: boolean;
47
4
  updating: boolean;
48
5
  error: string | null;
49
6
  }
50
- export interface IOnDemandFulfillmentTipInfo {
51
- fulfillmentId: string;
52
- retailerId: string;
53
- retailerName: string;
54
- subtotal: number;
55
- tip: number;
56
- }
57
- export interface ICheckoutPresaleStore {
58
- isLocked: boolean;
59
- expiresAt: string | null;
60
- }
61
- export interface ICheckoutCustomerStore {
62
- id?: string;
63
- firstName: string;
64
- lastName: string;
65
- email: string;
66
- phone: string;
67
- birthDate: string;
68
- company: string;
69
- }
70
7
  export interface ICheckoutCustomerFormStore {
71
- data: ICheckoutCustomerStore;
8
+ data: ICheckoutCustomer;
72
9
  isEditing: boolean;
73
10
  isValid: boolean;
74
11
  isSaving: boolean;
75
12
  }
76
- export interface ICheckoutGiftRecipientStore {
77
- firstName: string;
78
- lastName: string;
79
- email: string;
80
- phone: string;
81
- message: string;
82
- }
83
13
  export interface ICheckoutGiftRecipientFormStore {
84
- data: ICheckoutGiftRecipientStore;
14
+ data: ICheckoutGiftRecipient;
85
15
  isEditing: boolean;
86
16
  isValid: boolean;
87
17
  isSaving: boolean;
88
18
  }
89
- export interface ICheckoutBillingStore {
90
- firstName: string;
91
- lastName: string;
92
- email: string;
93
- phone: string;
94
- company: string;
95
- addressOne: string;
96
- addressTwo: string;
97
- city: string;
98
- state: string;
99
- zipCode: string;
100
- }
101
- export interface ICheckoutPaymentCardStore {
102
- brand: string;
103
- last4: string;
104
- expMonth: string;
105
- expYear: string;
106
- }
107
- export interface ICheckoutPaymentMethodStore {
108
- id: string;
109
- card: ICheckoutPaymentCardStore;
19
+ export interface ICheckoutPaymentMethodStore extends ICheckoutPaymentConfirm {
110
20
  }
111
- export interface ICheckoutPaymentSessionStore {
112
- key: string;
113
- secret: string;
21
+ export interface ICheckoutPaymentSessionStore extends ICheckoutPaymentSession {
114
22
  }
115
23
  export interface ICheckoutPaymentFormStore {
116
24
  paymentSession: ICheckoutPaymentSessionStore | null;
117
25
  paymentMethod: ICheckoutPaymentMethodStore | null;
118
- data: ICheckoutBillingStore | null;
26
+ data: ICheckoutBilling | null;
119
27
  billingSameAsShipping: boolean;
120
28
  isEditing: boolean;
121
29
  isValid: boolean;
@@ -124,19 +32,21 @@ export interface ICheckoutPaymentFormStore {
124
32
  export interface ICheckoutStore {
125
33
  token: string;
126
34
  cartId: string;
127
- presale: ICheckoutPresaleStore | null;
35
+ presale: ICheckoutPresale | null;
128
36
  isGift: boolean;
129
- marketingPreferences: ICheckoutMarketingPreferencesStore;
37
+ marketingPreferences: ICheckoutMarketingPreferences;
130
38
  customerForm: ICheckoutCustomerFormStore;
131
39
  giftRecipientForm: ICheckoutGiftRecipientFormStore;
132
40
  paymentForm: ICheckoutPaymentFormStore;
133
- shippingAddressTwo: string;
134
- promoCode: ICheckoutPromoCodeStore | null;
135
- giftCards: ICheckoutGiftCardStore[];
41
+ shippingAddress: ICheckoutShippingAddress;
42
+ promoCode: ICheckoutPromoCode | null;
43
+ giftCards: ICheckoutGiftCard[];
44
+ itemsQuantity: number;
136
45
  items: Record<string, ICheckoutItemStore>;
137
- amounts: ICheckoutTotalAmounts;
46
+ fulfillments: Record<string, ICheckoutFulfillment>;
47
+ retailers: Record<string, ICheckoutRetailer>;
48
+ amounts: ICheckoutAmounts;
138
49
  orderNumber: string | null;
139
- onDemandFulfillmentTipInfo: Record<string, IOnDemandFulfillmentTipInfo>;
140
50
  tipSelection: number;
141
51
  deliveryInstructions: string;
142
52
  giftCardError: string | null;
@@ -145,6 +55,5 @@ export interface ICheckoutStore {
145
55
  loading: boolean;
146
56
  updating: boolean;
147
57
  error: string | null;
148
- warning: string[];
149
- events: IElementsCheckoutEvents[];
58
+ events: ICheckoutEvent[];
150
59
  }
@@ -1,31 +1,44 @@
1
1
  import type { IAddressStore } from '@/core/store/interfaces/address.interface';
2
- import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutPresaleStore, ICheckoutPromoCodeStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
2
+ import type { ICartFulfillmentStore, ICartItemStore, ICartRetailerStore, ICartStore } from '@/core/store/interfaces/cart.interface';
3
+ import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutItemStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
3
4
  import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
5
+ import type { IProductListStore } from '@/core/store/interfaces/product-list.interface';
4
6
  import type { ComponentType } from '@/enums';
5
- import type { ICartItemStore, ICartPromoCodeStore, ICartStore, ICartTotalsStore, IRetailerFulfillmentStore, IRetailerStore } from './cart.interface';
7
+ import type { ICartPromoCode } from '@/interfaces/api/cart.interface';
8
+ import type { ICheckoutGiftRecipient, ICheckoutMarketingPreferences, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer } from '@/interfaces/api/checkout.interface';
6
9
  export interface IDrawerContentConfig {
7
10
  type: ComponentType;
8
11
  data?: Record<string, any>;
9
12
  }
13
+ export interface IModalContentConfig {
14
+ type: ComponentType;
15
+ data?: Record<string, any>;
16
+ }
10
17
  export interface IDrawerStore {
11
18
  isOpen: boolean;
12
19
  contentConfig: IDrawerContentConfig | null;
13
20
  }
14
21
  export interface IUIStore {
15
22
  drawer: IDrawerStore;
23
+ modal: IModalStore;
24
+ }
25
+ export interface IModalStore {
26
+ isOpen: boolean;
27
+ contentConfig: IModalContentConfig | null;
16
28
  }
17
29
  export interface IGlobalStore {
18
- cart: ICartStore;
19
30
  address: IAddressStore;
31
+ products: Record<string, IProductStore>;
32
+ cart: ICartStore;
20
33
  checkout: ICheckoutStore;
34
+ productsList: IProductListStore;
21
35
  ui: IUIStore;
22
- products: Record<string, IProductStore>;
23
36
  }
24
37
  export interface IPersistedStore {
25
38
  p?: string;
26
39
  c?: string;
27
40
  }
28
- export type StorePaths = keyof IGlobalStore | `products.${string}` | `products.${string}.${keyof IProductStore}` | `products.${string}.sizes.${string}` | `products.${string}.sizes.${string}.${keyof IProductSizeStore}` | `address.${keyof IAddressStore}` | `cart.${keyof ICartStore}` | `cart.items.${string}` | `cart.items.${string}.${keyof ICartItemStore}` | `cart.totals.${keyof ICartTotalsStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof IRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof IRetailerFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCodeStore}` | `ui.${keyof IUIStore}` | `ui.drawer.${keyof IDrawerStore}` | `checkout.${keyof ICheckoutStore}` | `checkout.customerForm.${keyof ICheckoutCustomerFormStore}` | `checkout.giftRecipientForm.${keyof ICheckoutGiftRecipientFormStore}` | `checkout.paymentForm.${keyof ICheckoutPaymentFormStore}` | `checkout.paymentForm.paymentSession.${keyof ICheckoutPaymentSessionStore}` | `checkout.paymentForm.paymentMethod.${keyof ICheckoutPaymentMethodStore}` | `checkout.presale.${keyof ICheckoutPresaleStore}` | `checkout.marketingPreferences.${keyof ICheckoutMarketingPreferencesStore}` | `checkout.giftRecipient.${keyof ICheckoutGiftRecipientStore}` | `checkout.giftCards.${string}` | `checkout.promoCode.${keyof ICheckoutPromoCodeStore}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.onDemandFulfillmentTipInfo.${string}`;
41
+ export type StorePaths = keyof IGlobalStore | `products.${string}` | `products.${string}.${keyof IProductStore}` | `products.${string}.sizes.${string}` | `products.${string}.sizes.${string}.${keyof IProductSizeStore}` | `address.${keyof IAddressStore}` | `cart.${keyof ICartStore}` | `cart.items.${string}` | `cart.items.${string}.${keyof ICartItemStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof ICartRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof ICartFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCode}` | `ui.${keyof IUIStore}` | `ui.drawer.${keyof IDrawerStore}` | `ui.modal.${keyof IModalStore}` | `checkout.${keyof ICheckoutStore}` | `checkout.customerForm.${keyof ICheckoutCustomerFormStore}` | `checkout.giftRecipientForm.${keyof ICheckoutGiftRecipientFormStore}` | `checkout.paymentForm.${keyof ICheckoutPaymentFormStore}` | `checkout.paymentForm.paymentSession.${keyof ICheckoutPaymentSessionStore}` | `checkout.paymentForm.paymentMethod.${keyof ICheckoutPaymentMethodStore}` | `checkout.presale.${keyof ICheckoutPresale}` | `checkout.marketingPreferences.${keyof ICheckoutMarketingPreferences}` | `checkout.giftRecipient.${keyof ICheckoutGiftRecipient}` | `checkout.giftCards.${string}` | `checkout.promoCode.${keyof ICheckoutPromoCode}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.retailers.${string}` | `checkout.retailers.${string}.${keyof ICheckoutRetailer}` | `checkout.fulfillments.${string}` | `productsList.${string}`;
29
42
  interface MiddlewareContext {
30
43
  action: string;
31
44
  payload: any;
@@ -0,0 +1,47 @@
1
+ import type { IPagination } from 'modules/product-list/product-list.interface';
2
+ import type { FulfillmentType } from '@/enums';
3
+ import type { IFulfillment, IProduct, IProductVariant, IRetailer, IRetailerAddress } from '@/interfaces/api/product.interface';
4
+ import type { IFilterSchema } from '@/interfaces/api/product-list.interface';
5
+ import type { IModalStore } from './core.interface';
6
+ import type { IProductSizeStore } from './product.interface';
7
+ export type IProductFulfillmentStore = IFulfillment & {
8
+ retailerName: string;
9
+ retailerAddress: IRetailerAddress;
10
+ retailerAddressFormatted: string;
11
+ variant: IProductVariant;
12
+ image: string | null;
13
+ };
14
+ export interface IProductList extends IProduct {
15
+ quantity: number;
16
+ selectedSizeId: string | null;
17
+ selectedFulfillmentType: FulfillmentType;
18
+ selectedFulfillmentId: string | null;
19
+ selectedFulfillment: IProductFulfillmentStore | null;
20
+ productHasAvailability: boolean;
21
+ fulfillmentHasAvailability: boolean;
22
+ }
23
+ export interface IProductListProduct extends Omit<IProduct, 'sizes'> {
24
+ sizes: Record<string, IProductSizeStore>;
25
+ }
26
+ export interface IProductListStore {
27
+ products: IProductListProduct[];
28
+ retailers: Record<string, IRetailer>;
29
+ filters: IFilterSchema[];
30
+ pagination: IPagination;
31
+ appliedFilters: Record<string, string[]>;
32
+ searchTerm: string;
33
+ gridConfig?: {
34
+ rows: number;
35
+ columns: number;
36
+ };
37
+ userProducts: {
38
+ [productId: string]: {
39
+ selectedSizeId: string;
40
+ selectedFulfillmentType: FulfillmentType;
41
+ selectedFulfillment: IProductFulfillmentStore | null;
42
+ selectedQuantity: number;
43
+ modal: IModalStore;
44
+ };
45
+ };
46
+ loading: boolean;
47
+ }
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType, FulfillmentType } from '@/enums';
2
- import type { IAddress, ICoords, IProductSizeAttributes, IRetailerExpectation, IRetailerFees, RetailerHours } from '@/interfaces/cloud';
2
+ import type { IFulfillment, IProduct, IProductSize, IProductVariant, IRetailerAddress } from '@/interfaces/api/product.interface';
3
3
  export interface IProductDrawerContentConfig {
4
4
  type: ComponentType;
5
5
  data?: Record<string, any>;
@@ -8,85 +8,32 @@ export interface IProductDrawerStore {
8
8
  isOpen: boolean;
9
9
  contentConfig: IProductDrawerContentConfig | null;
10
10
  }
11
- export interface IProductFulfillmentStore {
12
- isVariantEngravable: boolean;
13
- stock: number;
14
- price: number;
15
- retailerId: string;
16
- partNumber: string;
17
- fulfillmentId: string;
18
- fulfillmentType: FulfillmentType;
19
- modalities: FulfillmentType[];
11
+ export type IProductFulfillmentStore = IFulfillment & {
20
12
  retailerName: string;
21
- retailerAddress: (IAddress & ICoords) | null;
22
- type: FulfillmentType;
23
- timezone: string;
24
- canEngrave: boolean;
25
- expectation: IRetailerExpectation;
26
- fees: IRetailerFees;
27
- hours: RetailerHours;
28
- }
29
- export interface IProductSizeStore {
30
- id: string;
31
- upc: string;
32
- size: string;
33
- pack: boolean;
34
- packDesc: string | null;
35
- container: string;
36
- containerType: string;
37
- maxQuantityPerOrder: number;
38
- image: string;
39
- uom: string;
40
- volume: string;
41
- attributes: IProductSizeAttributes;
13
+ retailerAddress: IRetailerAddress;
14
+ retailerAddressFormatted: string;
15
+ variant: IProductVariant;
16
+ image?: string;
17
+ };
18
+ export interface IProductSizeStore extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
42
19
  onDemandFulfillments: Record<string, IProductFulfillmentStore>;
43
20
  shippingFulfillments: Record<string, IProductFulfillmentStore>;
44
21
  loading: boolean;
45
22
  error: string | null;
46
23
  }
47
- export interface IProductStore {
24
+ export interface IProductStore extends Omit<IProduct, 'sizes'> {
48
25
  identifier: string;
49
- id: string;
50
- name: string;
51
- brand: string;
52
- catPath: string;
53
- category: string;
54
- classification: string;
55
- type: string;
56
- salsifyGrouping: string;
57
- subType: string;
58
- mainImage: string | null;
59
- images: string[];
60
- region: string;
61
- country: string;
62
- material: string;
63
- abv: string;
64
- proof: string;
65
- age: string;
66
- color: string;
67
- flavor: string;
68
- variety: string;
69
- appellation: string;
70
- vintage: string;
71
- description: string;
72
- htmlDescription: string;
73
- tastingNotes: string;
74
- priceInfo?: {
75
- min: number;
76
- max: number;
77
- avg: number;
78
- };
79
- quantity: number;
80
26
  sizes: Record<string, IProductSizeStore>;
81
- productHasAvailability: boolean;
27
+ quantity: number;
82
28
  selectedSizeId: string | null;
83
29
  selectedFulfillmentType: FulfillmentType;
84
30
  selectedFulfillmentId: string | null;
85
31
  selectedFulfillment: IProductFulfillmentStore | null;
32
+ productHasAvailability: boolean;
86
33
  fulfillmentHasAvailability: boolean;
34
+ drawer: IProductDrawerStore;
87
35
  loading: boolean;
88
36
  updating: boolean;
89
- error: string | null;
90
- drawer: IProductDrawerStore;
91
37
  rerender: boolean;
38
+ error: string | null;
92
39
  }
@@ -3,10 +3,12 @@ import type { ICartStore } from '@/core/store/interfaces/cart.interface';
3
3
  import type { ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
4
4
  import type { IGlobalStore, IUIStore } from '@/core/store/interfaces/core.interface';
5
5
  import type { IProductStore } from '@/core/store/interfaces/product.interface';
6
+ import type { IProductListStore } from './interfaces/product-list.interface';
6
7
  export declare const LOCAL_STORAGE_PREFIX = "lce";
8
+ export declare const initialAddressState: IAddressStore;
7
9
  export declare const initialProductState: IProductStore;
8
10
  export declare const initialCartState: ICartStore;
9
11
  export declare const initialCheckoutState: ICheckoutStore;
10
12
  export declare const initialUIState: IUIStore;
11
- export declare const initialAddressState: IAddressStore;
13
+ export declare const initialProductsListState: IProductListStore;
12
14
  export declare const initialStoreState: IGlobalStore;
@@ -37,7 +37,6 @@ export interface ITelemetryError {
37
37
  message: string;
38
38
  stack?: string;
39
39
  code?: string | number;
40
- statusCode?: number;
41
40
  }
42
41
  export interface ITelemetrySDKContext {
43
42
  version: string;