@liquidcommerce/elements-sdk 2.6.0-beta.2 → 2.6.0-beta.21

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 (88) hide show
  1. package/README.md +7 -7
  2. package/dist/index.esm.js +11602 -11122
  3. package/dist/types/constants/core.constant.d.ts +11 -0
  4. package/dist/types/core/api/api-client.service.d.ts +15 -15
  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/pubsub/interfaces/address.interface.d.ts +3 -12
  13. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
  14. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +44 -50
  15. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +5 -4
  16. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
  17. package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
  18. package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -55
  19. package/dist/types/core/store/interfaces/checkout.interface.d.ts +16 -107
  20. package/dist/types/core/store/interfaces/core.interface.d.ts +7 -5
  21. package/dist/types/core/store/interfaces/product.interface.d.ts +12 -66
  22. package/dist/types/core/store/store.constant.d.ts +1 -1
  23. package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
  24. package/dist/types/elements-base-client.d.ts +1 -1
  25. package/dist/types/enums/cloud.enum.d.ts +19 -76
  26. package/dist/types/enums/core.enum.d.ts +25 -0
  27. package/dist/types/interfaces/api/address.interface.d.ts +28 -0
  28. package/dist/types/interfaces/api/cart.interface.d.ts +95 -0
  29. package/dist/types/interfaces/api/checkout.interface.d.ts +213 -0
  30. package/dist/types/interfaces/api/product-list.interface.d.ts +30 -0
  31. package/dist/types/interfaces/api/product.interface.d.ts +106 -0
  32. package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
  33. package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
  34. package/dist/types/interfaces/core.interface.d.ts +7 -1
  35. package/dist/types/modules/address/address.command.d.ts +3 -3
  36. package/dist/types/modules/address/address.interface.d.ts +0 -7
  37. package/dist/types/modules/cart/cart.commands.d.ts +4 -5
  38. package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
  39. package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
  40. package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
  41. package/dist/types/modules/checkout/checkout.commands.d.ts +18 -9
  42. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  43. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  44. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
  45. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  46. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  47. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  48. package/dist/types/modules/checkout/constant.d.ts +3 -0
  49. package/dist/types/modules/product/components/components.d.ts +2 -4
  50. package/dist/types/modules/product/product.commands.d.ts +3 -2
  51. package/dist/types/modules/product-list/components/index.d.ts +2 -0
  52. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +3 -2
  53. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +6 -0
  54. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +1 -0
  55. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts +7 -0
  56. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +16 -0
  57. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-price-filter.components.d.ts +22 -0
  58. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +16 -0
  59. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +18 -0
  60. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +27 -5
  61. package/dist/types/modules/product-list/product-list.commands.d.ts +4 -2
  62. package/dist/types/modules/product-list/product-list.component.d.ts +13 -5
  63. package/dist/types/modules/product-list/product-list.interface.d.ts +77 -0
  64. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +1 -0
  65. package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
  66. package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
  67. package/dist/types/static/icon/filter.icon.d.ts +2 -0
  68. package/dist/types/static/icon/index.d.ts +1 -0
  69. package/dist/types/utils/format.d.ts +0 -13
  70. package/docs/ACTIONS.md +13 -13
  71. package/docs/EVENTS.md +7 -7
  72. package/package.json +8 -9
  73. package/umd/elements.js +1 -1
  74. package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
  75. package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
  76. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
  77. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -214
  78. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  79. package/dist/types/interfaces/cloud/index.d.ts +0 -7
  80. package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
  81. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  82. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  83. package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
  84. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  85. package/dist/types/modules/product/utils/helpers.d.ts +0 -3
  86. package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
  87. package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
  88. package/dist/types/utils/helper.d.ts +0 -27
@@ -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 } 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
41
  shippingAddressTwo: string;
134
- promoCode: ICheckoutPromoCodeStore | null;
135
- giftCards: ICheckoutGiftCardStore[];
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,8 +1,10 @@
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';
4
5
  import type { ComponentType } from '@/enums';
5
- import type { ICartItemStore, ICartPromoCodeStore, ICartStore, ICartTotalsStore, IRetailerFulfillmentStore, IRetailerStore } from './cart.interface';
6
+ import type { ICartPromoCode } from '@/interfaces/api/cart.interface';
7
+ import type { ICheckoutGiftRecipient, ICheckoutMarketingPreferences, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer } from '@/interfaces/api/checkout.interface';
6
8
  export interface IDrawerContentConfig {
7
9
  type: ComponentType;
8
10
  data?: Record<string, any>;
@@ -15,17 +17,17 @@ export interface IUIStore {
15
17
  drawer: IDrawerStore;
16
18
  }
17
19
  export interface IGlobalStore {
18
- cart: ICartStore;
19
20
  address: IAddressStore;
21
+ products: Record<string, IProductStore>;
22
+ cart: ICartStore;
20
23
  checkout: ICheckoutStore;
21
24
  ui: IUIStore;
22
- products: Record<string, IProductStore>;
23
25
  }
24
26
  export interface IPersistedStore {
25
27
  p?: string;
26
28
  c?: string;
27
29
  }
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}`;
30
+ 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}` | `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}`;
29
31
  interface MiddlewareContext {
30
32
  action: string;
31
33
  payload: any;
@@ -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,31 @@ 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
+ };
17
+ export interface IProductSizeStore extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
42
18
  onDemandFulfillments: Record<string, IProductFulfillmentStore>;
43
19
  shippingFulfillments: Record<string, IProductFulfillmentStore>;
44
20
  loading: boolean;
45
21
  error: string | null;
46
22
  }
47
- export interface IProductStore {
23
+ export interface IProductStore extends Omit<IProduct, 'sizes'> {
48
24
  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
25
  sizes: Record<string, IProductSizeStore>;
81
- productHasAvailability: boolean;
26
+ quantity: number;
82
27
  selectedSizeId: string | null;
83
28
  selectedFulfillmentType: FulfillmentType;
84
29
  selectedFulfillmentId: string | null;
85
30
  selectedFulfillment: IProductFulfillmentStore | null;
31
+ productHasAvailability: boolean;
86
32
  fulfillmentHasAvailability: boolean;
33
+ drawer: IProductDrawerStore;
87
34
  loading: boolean;
88
35
  updating: boolean;
89
- error: string | null;
90
- drawer: IProductDrawerStore;
91
36
  rerender: boolean;
37
+ error: string | null;
92
38
  }
@@ -4,9 +4,9 @@ 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
6
  export declare const LOCAL_STORAGE_PREFIX = "lce";
7
+ export declare const initialAddressState: IAddressStore;
7
8
  export declare const initialProductState: IProductStore;
8
9
  export declare const initialCartState: ICartStore;
9
10
  export declare const initialCheckoutState: ICheckoutStore;
10
11
  export declare const initialUIState: IUIStore;
11
- export declare const initialAddressState: IAddressStore;
12
12
  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;
@@ -10,7 +10,7 @@ import { LoggerFactory } from '@/core/logger/logger-factory';
10
10
  import { StoreService } from '@/core/store/store.service';
11
11
  import { TelemetryService } from '@/core/telemetry/telemetry.service';
12
12
  import { type ComponentType } from '@/enums';
13
- import type { IInjectedComponent, IInjectProductElement, IInjectProductListParams, ILiquidCommerceElementsActions, IProcessInjectElementParams } from '@/interfaces/core.interface';
13
+ import type { IInjectProductElement, IInjectProductListParams, IInjectedComponent, ILiquidCommerceElementsActions, IProcessInjectElementParams } from '@/interfaces/core.interface';
14
14
  import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
15
15
  export declare abstract class ElementsBaseClient {
16
16
  protected readonly authClient: AuthClientService;
@@ -1,77 +1,20 @@
1
- export declare enum DAYS_OF_WEEK {
2
- MONDAY = "monday",
3
- TUESDAY = "tuesday",
4
- WEDNESDAY = "wednesday",
5
- THURSDAY = "thursday",
6
- FRIDAY = "friday",
7
- SATURDAY = "saturday",
8
- SUNDAY = "sunday"
9
- }
10
- export declare const CART_EVENT_ENUM: {
11
- readonly OOS: "OutOfStock";
12
- readonly ITEMS_NOT_ADDED: "ItemsNotAdded";
13
- readonly ITEMS_REQUESTED_NOT_ADDED: "ItemsRequestedNotAdded";
14
- readonly ITEM_NOT_ENGRAVED: "ItemEngravingError";
15
- readonly ADDRESS_CHANGE: "AddressChange";
16
- readonly LOCATION_AVAILABILITY: "LocationAvailability";
17
- readonly PARTNER_PRODUCT_CONFIGS: "PartnerProductConfigs";
18
- readonly REMOVED_EXISTING_ITEMS: "RemovedExistingCartItems";
19
- readonly RETAILER_MIN: "RetailerMinNotMet";
20
- readonly NO_ITEMS_IN_CART: "NoItemsInCart";
21
- readonly INVALID_ID: "InvalidId";
22
- readonly NO_ID: "NoId";
23
- readonly CART_CHECKOUT_PROCESSED: "CartCheckoutProcessed";
24
- readonly NEW_CART: "NewCart";
25
- readonly DEFAULT: "CartError";
26
- readonly ITEM_QTY_CHANGE: "ItemQuantityChange";
27
- readonly ITEM_ID_NOT_FOUND: "ItemIdNotFound";
28
- readonly ITEMS_REMOVED: "ItemsRemoved";
29
- readonly COUPON_PROCESSING_ERROR: "CouponProcessingError";
30
- readonly COUPON_NOT_FOUND: "CouponNotFound";
31
- readonly COUPON_EXPIRED: "CouponExpired";
32
- readonly NO_APPLICABLE_DISCOUNT: "NoApplicableDiscount";
33
- readonly COUPON_NOT_STARTED: "CouponNotStarted";
34
- readonly MINIMUM_ORDER_VALUE_NOT_MET: "MinimumOrderValueNotMet";
35
- readonly MINIMUM_ORDER_UNITS_NOT_MET: "MinimumOrderUnitsNotMet";
36
- readonly MINIMUM_DISTINCT_ITEMS_NOT_MET: "MinimumDistinctItemsNotMet";
37
- readonly QUOTA_EXCEEDED: "QuotaExceeded";
38
- readonly USER_LIMIT_EXCEEDED: "UserLimitExceeded";
39
- readonly NOT_FIRST_PURCHASE: "NotFirstPurchase";
40
- readonly INVALID_COUPON: "InvalidCoupon";
41
- readonly INVALID_MEMBERSHIP: "InvalidMembership";
42
- readonly INVALID_DOMAIN: "InvalidDomain";
43
- readonly INVALID_REQUIREMENTS: "InvalidRequirements";
44
- readonly INVALID_ORGANIZATION: "InvalidOrganization";
45
- readonly PRODUCT_NOT_ELIGIBLE: "ProductNotEligible";
46
- readonly NOT_ENOUGH_PREVIOUS_ORDERS: "NotEnoughPreviousOrders";
47
- readonly PRESALE_ITEMS_NOT_ALLOWED: "PresaleItemsNotAllowed";
48
- readonly PRESALE_LIMIT_EXCEEDED: "PresaleLimitExceeded";
49
- readonly PRESALE_NOT_STARTED: "PresaleNotStarted";
50
- readonly PRESALE_EXPIRED: "PresaleExpired";
51
- readonly PRESALE_MIXED_CART: "PresaleMixedCart";
52
- readonly RETAILER_DOES_NOT_ALLOW_PROMOS: "RetailerDoesNotAllowPromos";
53
- readonly RETAILERS_DO_NOT_ALLOW_PROMOS: "RetailersDoNotAllowPromos";
1
+ export declare const ENUM_FILTER_KEYS: {
2
+ readonly BRANDS: "brands";
3
+ readonly FLAVOR: "flavor";
4
+ readonly FULFILLMENT: "fulfillment";
5
+ readonly TAGS: "tags";
6
+ readonly REGION: "region";
7
+ readonly VARIETY: "variety";
8
+ readonly ENGRAVING: "engraving";
9
+ readonly PRICE: "price";
10
+ readonly PRESALE: "presale";
11
+ readonly AVAILABILITY: "availability";
12
+ readonly CATEGORIES: "categories";
13
+ readonly SIZES: "sizes";
14
+ readonly COLORS: "colors";
15
+ readonly APPELLATION: "appellation";
16
+ readonly COUNTRY: "country";
17
+ readonly VINTAGE: "vintage";
18
+ readonly MATERIALS: "materials";
19
+ readonly COLLECTION_TAGS: "collectionTags";
54
20
  };
55
- export type CartEventEnum = (typeof CART_EVENT_ENUM)[keyof typeof CART_EVENT_ENUM];
56
- export declare const CHECKOUT_EVENT_ENUM: {
57
- readonly ERROR_PROCESSING_GIFT_CARDS: "ErrorProcessingGiftCards";
58
- readonly INVALID_GIFT_CARD_CODE: "InvalidGiftCardCodes";
59
- readonly INVALID_GIFT_CARD_PARTNER: "InvalidGiftCardPartner";
60
- readonly INACTIVE_GIFT_CARD: "InactiveGiftCard";
61
- readonly GIFT_CARD_ALREADY_IN_USE: "GiftCardAlreadyInUse";
62
- readonly GIFT_CARD_EXPIRED: "GiftCardExpired";
63
- readonly GIFT_CARD_BALANCE_DEPLETED: "GiftCardBalanceDepleted";
64
- readonly RETAILER_ONDEMAND_HOURS_NOT_AVAILABLE: "RetailerOnDemandHoursNotAvailable";
65
- readonly ITEM_QTY_CHANGE: "ItemQuantityChange";
66
- readonly MAX_QUANTITY_PER_ORDER_EXCEEDED: "MaxQuantityPerOrderExceeded";
67
- readonly RETAILER_DOES_NOT_ALLOW_PROMOS: "RetailerDoesNotAllowPromos";
68
- readonly RETAILERS_DO_NOT_ALLOW_PROMOS: "RetailersDoNotAllowPromos";
69
- readonly RETAILER_DOES_NOT_ALLOW_GIFT_CARDS: "RetailerDoesNotAllowGiftCards";
70
- readonly RETAILERS_DO_NOT_ALLOW_GIFT_CARDS: "RetailersDoNotAllowGiftCards";
71
- };
72
- export type CheckoutEventEnum = (typeof CHECKOUT_EVENT_ENUM)[keyof typeof CHECKOUT_EVENT_ENUM];
73
- export declare const ENUM_ADDRESS_TYPE: {
74
- readonly SHIPPING: "shipping";
75
- readonly BILLING: "billing";
76
- };
77
- export type AddressType = (typeof ENUM_ADDRESS_TYPE)[keyof typeof ENUM_ADDRESS_TYPE];