@liquidcommerce/elements-sdk 2.6.0 → 2.6.2

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 (72) hide show
  1. package/README.md +1 -0
  2. package/dist/index.esm.js +10881 -10331
  3. package/dist/types/constants/core.constant.d.ts +11 -0
  4. package/dist/types/core/api/api-client.service.d.ts +11 -11
  5. package/dist/types/core/api/auth-client.service.d.ts +20 -18
  6. package/dist/types/core/client/client-action.service.d.ts +18 -11
  7. package/dist/types/core/client/client-config.service.d.ts +1 -0
  8. package/dist/types/core/command/base-command.service.d.ts +2 -2
  9. package/dist/types/core/command/common-command.service.d.ts +2 -1
  10. package/dist/types/core/google-tag-manager.service.d.ts +13 -10
  11. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
  12. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +26 -63
  13. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +11 -1
  14. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
  15. package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
  16. package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -54
  17. package/dist/types/core/store/interfaces/checkout.interface.d.ts +2 -2
  18. package/dist/types/core/store/interfaces/core.interface.d.ts +5 -4
  19. package/dist/types/core/store/interfaces/product.interface.d.ts +12 -66
  20. package/dist/types/core/store/store.constant.d.ts +1 -1
  21. package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
  22. package/dist/types/elements-base-client.d.ts +1 -1
  23. package/dist/types/enums/cloud.enum.d.ts +20 -0
  24. package/dist/types/enums/core.enum.d.ts +1 -0
  25. package/dist/types/interfaces/api/address.interface.d.ts +28 -0
  26. package/dist/types/interfaces/api/cart.interface.d.ts +91 -0
  27. package/dist/types/interfaces/api/product-list.interface.d.ts +30 -0
  28. package/dist/types/interfaces/api/product.interface.d.ts +106 -0
  29. package/dist/types/interfaces/cloud/checkout.interface.d.ts +14 -10
  30. package/dist/types/interfaces/cloud/index.d.ts +0 -4
  31. package/dist/types/interfaces/cloud/retailer.interface.d.ts +2 -2
  32. package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
  33. package/dist/types/interfaces/configs/global.interface.d.ts +1 -0
  34. package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
  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 +0 -1
  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/product/components/components.d.ts +2 -4
  42. package/dist/types/modules/product/product.commands.d.ts +2 -2
  43. package/dist/types/modules/product-list/components/index.d.ts +2 -0
  44. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +3 -2
  45. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +6 -0
  46. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +1 -0
  47. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts +7 -0
  48. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +16 -0
  49. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-price-filter.components.d.ts +22 -0
  50. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +16 -0
  51. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +18 -0
  52. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +27 -5
  53. package/dist/types/modules/product-list/product-list.commands.d.ts +3 -2
  54. package/dist/types/modules/product-list/product-list.component.d.ts +13 -5
  55. package/dist/types/modules/product-list/product-list.interface.d.ts +77 -0
  56. package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
  57. package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
  58. package/dist/types/static/icon/filter.icon.d.ts +2 -0
  59. package/dist/types/static/icon/index.d.ts +1 -0
  60. package/dist/types/utils/format.d.ts +0 -13
  61. package/dist/types/utils/helper.d.ts +2 -1
  62. package/docs/THEMING.md +3 -0
  63. package/package.json +6 -7
  64. package/umd/elements.js +1 -1
  65. package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
  66. package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
  67. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
  68. package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
  69. package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
  70. package/dist/types/modules/product/utils/helpers.d.ts +0 -3
  71. package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
  72. package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
@@ -1,6 +1,5 @@
1
1
  import type { IElementsCartEvent } from 'utils/helper';
2
- import type { FulfillmentType } from '@/enums';
3
- import type { IAddress, ICartItemAttributes, IRetailerExpectation, IRetailerFees } from '@/interfaces/cloud';
2
+ import type { ICartFulfillment, ICartItemAttributes, ICartPromoCode, ICartRetailer } from '@/interfaces/api/cart.interface';
4
3
  export interface ICartItemStore {
5
4
  id: string;
6
5
  variantId: string;
@@ -31,64 +30,27 @@ export interface ICartItemStore {
31
30
  updating: boolean;
32
31
  error: string | null;
33
32
  }
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;
33
+ export interface ICartFulfillmentStore extends ICartFulfillment {
34
+ loading: boolean;
35
+ error: string | null;
36
+ updating: boolean;
44
37
  }
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;
38
+ export interface ICartRetailerStore extends ICartRetailer {
39
+ loading: boolean;
40
+ error: string | null;
41
+ updating: boolean;
60
42
  }
61
- export interface IRetailerStore {
43
+ export interface ICartStore {
62
44
  id: string;
63
- name: string;
64
- platformFee: number;
65
- shippingFee: number;
66
45
  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;
46
+ itemsQuantity: number;
47
+ items: Record<string, ICartItemStore>;
48
+ fulfillments: Record<string, ICartFulfillmentStore>;
49
+ retailers: Record<string, ICartRetailerStore>;
50
+ promoCode: ICartPromoCode | null;
51
+ events: IElementsCartEvent[];
82
52
  loading: boolean;
83
53
  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
54
  rerender: boolean;
90
55
  shouldReset: boolean;
91
- updatedAt: string;
92
- createdAt: string;
93
- events: IElementsCartEvent[];
94
56
  }
@@ -1,5 +1,5 @@
1
1
  import type { IElementsCheckoutEvents } from 'utils/helper';
2
- import type { ICartItemAttributes, ICheckoutTotalAmounts } from '@/interfaces/cloud';
2
+ import type { ICartItemAttributes } from '@/interfaces/api/cart.interface';
3
3
  export interface ICheckoutMarketingPreferencesStore {
4
4
  canEmail: boolean;
5
5
  canSms: boolean;
@@ -134,7 +134,7 @@ export interface ICheckoutStore {
134
134
  promoCode: ICheckoutPromoCodeStore | null;
135
135
  giftCards: ICheckoutGiftCardStore[];
136
136
  items: Record<string, ICheckoutItemStore>;
137
- amounts: ICheckoutTotalAmounts;
137
+ amounts: any;
138
138
  orderNumber: string | null;
139
139
  onDemandFulfillmentTipInfo: Record<string, IOnDemandFulfillmentTipInfo>;
140
140
  tipSelection: number;
@@ -1,8 +1,9 @@
1
1
  import type { IAddressStore } from '@/core/store/interfaces/address.interface';
2
+ import type { ICartFulfillmentStore, ICartItemStore, ICartRetailerStore, ICartStore } from '@/core/store/interfaces/cart.interface';
2
3
  import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutPresaleStore, ICheckoutPromoCodeStore, 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';
6
7
  export interface IDrawerContentConfig {
7
8
  type: ComponentType;
8
9
  data?: Record<string, any>;
@@ -15,17 +16,17 @@ export interface IUIStore {
15
16
  drawer: IDrawerStore;
16
17
  }
17
18
  export interface IGlobalStore {
18
- cart: ICartStore;
19
19
  address: IAddressStore;
20
+ products: Record<string, IProductStore>;
21
+ cart: ICartStore;
20
22
  checkout: ICheckoutStore;
21
23
  ui: IUIStore;
22
- products: Record<string, IProductStore>;
23
24
  }
24
25
  export interface IPersistedStore {
25
26
  p?: string;
26
27
  c?: string;
27
28
  }
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}`;
29
+ 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 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}`;
29
30
  interface MiddlewareContext {
30
31
  action: string;
31
32
  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;
@@ -75,3 +75,23 @@ export declare const ENUM_ADDRESS_TYPE: {
75
75
  readonly BILLING: "billing";
76
76
  };
77
77
  export type AddressType = (typeof ENUM_ADDRESS_TYPE)[keyof typeof ENUM_ADDRESS_TYPE];
78
+ export declare const ENUM_FILTER_KEYS: {
79
+ readonly BRANDS: "brands";
80
+ readonly FLAVOR: "flavor";
81
+ readonly FULFILLMENT: "fulfillment";
82
+ readonly TAGS: "tags";
83
+ readonly REGION: "region";
84
+ readonly VARIETY: "variety";
85
+ readonly ENGRAVING: "engraving";
86
+ readonly PRICE: "price";
87
+ readonly PRESALE: "presale";
88
+ readonly AVAILABILITY: "availability";
89
+ readonly CATEGORIES: "categories";
90
+ readonly SIZES: "sizes";
91
+ readonly COLORS: "colors";
92
+ readonly APPELLATION: "appellation";
93
+ readonly COUNTRY: "country";
94
+ readonly VINTAGE: "vintage";
95
+ readonly MATERIALS: "materials";
96
+ readonly COLLECTION_TAGS: "collectionTags";
97
+ };
@@ -95,6 +95,7 @@ export declare const COMPONENT_TYPE: {
95
95
  readonly PRODUCT_LIST: "product-list";
96
96
  readonly PRODUCT_LIST_CARD: "product-list-card";
97
97
  readonly PRODUCT_LIST_FILTERS: "product-list-filters";
98
+ readonly PRODUCT_LIST_SEARCH: "product-list-search";
98
99
  readonly PRODUCT_LIST_CARD_LOADING: "product-list-card-loading";
99
100
  readonly CART: "cart";
100
101
  readonly CART_RETAILER: "cart-retailer";
@@ -0,0 +1,28 @@
1
+ import type { IAddressStore } from '@/core/store/interfaces/address.interface';
2
+ export interface IAddressAutocompleteResult {
3
+ id: string;
4
+ description: string;
5
+ }
6
+ export interface IAddressCoordinates {
7
+ latitude: number;
8
+ longitude: number;
9
+ }
10
+ export interface IAddressAddress {
11
+ one: string;
12
+ two: string;
13
+ city: string;
14
+ state: string;
15
+ zip: string;
16
+ country: string;
17
+ }
18
+ export interface IAddressDetailsResult {
19
+ formattedAddress: string;
20
+ address: IAddressAddress;
21
+ coordinates: IAddressCoordinates;
22
+ }
23
+ export interface ILocation {
24
+ address: IAddressAddress;
25
+ coordinates: IAddressCoordinates;
26
+ }
27
+ export interface IAddressData extends IAddressStore {
28
+ }
@@ -0,0 +1,91 @@
1
+ import type { CartEventEnum, FulfillmentType } from '@/enums';
2
+ import type { ILocation } from '@/interfaces/api/address.interface';
3
+ import type { IProductPresale } from '@/interfaces/api/product.interface';
4
+ export interface ICartUpdateItem {
5
+ id?: string;
6
+ partNumber: string;
7
+ quantity: number;
8
+ fulfillmentId: string;
9
+ engravingLines?: string[];
10
+ }
11
+ export interface ICartUpdateParams {
12
+ id: string;
13
+ items: ICartUpdateItem[];
14
+ promoCode?: string;
15
+ location?: ILocation;
16
+ }
17
+ export interface ICartFulfillment {
18
+ id: string;
19
+ canEngrave: boolean;
20
+ type: FulfillmentType;
21
+ expectation: string;
22
+ itemIds: string[];
23
+ subtotal: number;
24
+ hasUnmetMinimumPurchaseAmount: boolean;
25
+ minimumPurchaseAmount: number;
26
+ }
27
+ export interface ICartRetailer {
28
+ id: string;
29
+ name: string;
30
+ subtotal: number;
31
+ itemsQuantity: number;
32
+ fulfillments: Record<string, ICartFulfillment>;
33
+ }
34
+ export interface ICartItemAttributes {
35
+ engraving: ICartItemEngraving;
36
+ presale: IProductPresale;
37
+ }
38
+ export interface ICartItem {
39
+ id: string;
40
+ variantId: string;
41
+ liquidId: string;
42
+ retailerId: string;
43
+ partNumber: string;
44
+ fulfillmentId: string;
45
+ upc: string;
46
+ sku: string;
47
+ salsifyGrouping: string;
48
+ catPath: string;
49
+ volume: string;
50
+ uom: string;
51
+ pack: boolean;
52
+ packDesc: string;
53
+ container: string;
54
+ containerType: string;
55
+ name: string;
56
+ brand: string;
57
+ size: string;
58
+ price: number;
59
+ quantity: number;
60
+ maxQuantity: number;
61
+ unitPrice: number;
62
+ mainImage: string;
63
+ attributes: ICartItemAttributes;
64
+ }
65
+ export interface ICartPromoCode {
66
+ code: string;
67
+ discountAmount: number;
68
+ }
69
+ export interface ICart {
70
+ id: string;
71
+ subtotal: number;
72
+ itemsQuantity: number;
73
+ items: Record<string, ICartItem>;
74
+ retailers: Record<string, ICartRetailer>;
75
+ promoCode: ICartPromoCode | null;
76
+ events: ICartEvent[];
77
+ }
78
+ export interface ICartItemEngraving {
79
+ isEngravable: boolean;
80
+ hasEngraving: boolean;
81
+ fee: number;
82
+ maxCharsPerLine: number;
83
+ maxLines: number;
84
+ location: string;
85
+ lines: string[];
86
+ }
87
+ export interface ICartEvent {
88
+ type: CartEventEnum;
89
+ message: string;
90
+ items?: Array<Partial<ICartItem>>;
91
+ }
@@ -0,0 +1,30 @@
1
+ import type { ENUM_FILTER_KEYS } from '@/enums';
2
+ import type { ILocation } from '@/interfaces/api/address.interface';
3
+ import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
4
+ export interface IProductSearchParams {
5
+ location?: ILocation;
6
+ search?: string;
7
+ pageToken?: string;
8
+ page?: number;
9
+ perPage?: number;
10
+ filters?: Array<Record<any, any>>;
11
+ }
12
+ export type FacetFilterKeys = typeof ENUM_FILTER_KEYS.BRANDS | typeof ENUM_FILTER_KEYS.FLAVOR | typeof ENUM_FILTER_KEYS.REGION | typeof ENUM_FILTER_KEYS.VARIETY | typeof ENUM_FILTER_KEYS.ENGRAVING | typeof ENUM_FILTER_KEYS.PRESALE | typeof ENUM_FILTER_KEYS.PRICE | typeof ENUM_FILTER_KEYS.AVAILABILITY | typeof ENUM_FILTER_KEYS.CATEGORIES | typeof ENUM_FILTER_KEYS.SIZES | typeof ENUM_FILTER_KEYS.COLORS | typeof ENUM_FILTER_KEYS.APPELLATION | typeof ENUM_FILTER_KEYS.COUNTRY | typeof ENUM_FILTER_KEYS.VINTAGE | typeof ENUM_FILTER_KEYS.MATERIALS | typeof ENUM_FILTER_KEYS.TAGS;
13
+ export interface IFilterSchema {
14
+ category: FacetFilterKeys;
15
+ values: IFilterValue[];
16
+ }
17
+ export interface IFilterValue {
18
+ value: string;
19
+ formattedValue: string;
20
+ count: number;
21
+ }
22
+ export interface INavigationResponse {
23
+ currentPage: number;
24
+ totalPages: number;
25
+ totalCount: number;
26
+ filters: IFilterSchema[];
27
+ }
28
+ export interface IProductSearchResponse extends IProductAvailabilityResponse {
29
+ navigation: INavigationResponse;
30
+ }
@@ -0,0 +1,106 @@
1
+ import type { FulfillmentType } from '@/enums';
2
+ import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface';
3
+ export interface IProductAvailabilityParams {
4
+ identifiers: string[];
5
+ location?: ILocation;
6
+ }
7
+ export interface IProductAvailabilityResponse {
8
+ products: IProduct[];
9
+ retailers: Record<string, IRetailer>;
10
+ }
11
+ export interface IProductVariant {
12
+ retailerId: string;
13
+ shippingFulfillmentId: string;
14
+ onDemandFulfillmentId: string;
15
+ isEngravable: boolean;
16
+ partNumber: string;
17
+ price: number;
18
+ stock: number;
19
+ }
20
+ export interface IProductSize {
21
+ id: string;
22
+ upc: string;
23
+ size: string;
24
+ pack: boolean;
25
+ packDesc: string;
26
+ container: string;
27
+ containerType: string;
28
+ image: string;
29
+ uom: string;
30
+ volume: string;
31
+ maxQuantityPerOrder: number;
32
+ attributes: IProductSizeAttributes;
33
+ shippingVariants: Record<string, IProductVariant>;
34
+ onDemandVariants: Record<string, IProductVariant>;
35
+ }
36
+ export interface IProductFulfillmentHourStatus {
37
+ text: string;
38
+ isOpen: boolean;
39
+ openTime: string;
40
+ isClosed: boolean;
41
+ closeTime: string;
42
+ }
43
+ export interface IProduct {
44
+ id: string;
45
+ name: string;
46
+ description: string;
47
+ htmlDescription: string;
48
+ images: string[];
49
+ brand: string;
50
+ region: string;
51
+ country: string;
52
+ material: string;
53
+ abv: string;
54
+ proof: string;
55
+ age: string;
56
+ color: string;
57
+ flavor: string;
58
+ variety: string;
59
+ appellation: string;
60
+ vintage: string;
61
+ tastingNotes: string;
62
+ catPath: string;
63
+ category: string;
64
+ classification: string;
65
+ type: string;
66
+ subType: string;
67
+ salsifyGrouping: string;
68
+ noAvailabilityPrice: number;
69
+ sizes: Record<string, IProductSize>;
70
+ }
71
+ export interface IFulfillment {
72
+ id: string;
73
+ type: FulfillmentType;
74
+ doesAllowGiftCards: boolean;
75
+ doesAllowPromos: boolean;
76
+ expectationText: string;
77
+ engravingExpectationText: string;
78
+ fee: number;
79
+ timezone: string;
80
+ hourStatus: IProductFulfillmentHourStatus;
81
+ }
82
+ export type IRetailerAddress = IAddressAddress & IAddressCoordinates;
83
+ export interface IRetailer {
84
+ id: string;
85
+ name: string;
86
+ address: IRetailerAddress;
87
+ addressFormatted: string;
88
+ shippingFulfillment: IFulfillment | null;
89
+ onDemandFulfillment: IFulfillment | null;
90
+ }
91
+ export interface IProductSizeEngraving {
92
+ maxLines: number;
93
+ maxCharsPerLine: number;
94
+ fee: number;
95
+ location: string;
96
+ }
97
+ export interface IProductSizeAttributes {
98
+ presale: IProductPresale;
99
+ engraving: IProductSizeEngraving;
100
+ }
101
+ export interface IProductPresale {
102
+ canPurchaseOn: null | string;
103
+ estimatedShipBy: null | string;
104
+ isActive: boolean;
105
+ language: string;
106
+ }
@@ -1,7 +1,7 @@
1
1
  import type { CheckoutEventEnum } from '@/enums';
2
+ import type { IAddressAddress } from '@/interfaces/api/address.interface';
3
+ import type { ICartItemAttributes } from '@/interfaces/api/cart.interface';
2
4
  import type { ICoreParams } from '@/interfaces/cloud/core.interface';
3
- import type { IAddress } from './address.interface';
4
- import type { ICartAttributesPromoCode, ICartItemAttributes } from './cart.interface';
5
5
  import type { IRetailerExpectation } from './retailer.interface';
6
6
  export interface ICheckoutRecipient {
7
7
  firstName?: string;
@@ -130,7 +130,7 @@ export interface ICheckoutFulfillment extends ICheckoutTotalAmounts {
130
130
  export interface ICheckoutRetailer extends ICheckoutTotalAmounts {
131
131
  id: string;
132
132
  name: string;
133
- address?: IAddress;
133
+ address?: IAddressAddress;
134
134
  fulfillments: ICheckoutFulfillment[];
135
135
  }
136
136
  export interface ICheckoutItem {
@@ -175,6 +175,13 @@ export interface ICheckoutEvents {
175
175
  type: CheckoutEventEnum;
176
176
  message: string;
177
177
  }
178
+ export interface ICheckoutAttributesPromoCode {
179
+ value: string;
180
+ discount: number;
181
+ freeDelivery: boolean;
182
+ freeServiceFee: boolean;
183
+ freeShipping: boolean;
184
+ }
178
185
  export interface ICheckoutPrepareResponse {
179
186
  token: string;
180
187
  cartId: string;
@@ -188,7 +195,7 @@ export interface ICheckoutPrepareResponse {
188
195
  acceptedAccountCreation?: boolean;
189
196
  giftOptions: ICheckoutGiftOptions;
190
197
  marketingPreferences: ICheckoutMarketingPreferences;
191
- shippingAddress: IAddress;
198
+ shippingAddress: IAddressAddress;
192
199
  billingAddress: ICheckoutBillingAddress;
193
200
  amounts: ICheckoutTotalAmounts;
194
201
  items: ICheckoutItem[];
@@ -196,7 +203,7 @@ export interface ICheckoutPrepareResponse {
196
203
  payment?: string;
197
204
  giftCards: ICheckoutGiftCard[];
198
205
  events: ICheckoutEvents[];
199
- promoCode: ICartAttributesPromoCode;
206
+ promoCode: ICheckoutAttributesPromoCode;
200
207
  isPresaleLocked: boolean;
201
208
  presaleExpiresAt: string | null;
202
209
  }
@@ -205,10 +212,7 @@ export interface ICheckoutCompleteParams extends ICoreParams {
205
212
  payment: string;
206
213
  }
207
214
  export interface ICheckoutCompleteResponse {
208
- order: {
209
- number: string;
210
- legacyOrderNumber: string;
211
- referenceId: string;
212
- };
215
+ legacyOrderNumber: string;
216
+ referenceId: string;
213
217
  }
214
218
  export {};
@@ -1,7 +1,3 @@
1
- export * from './address.interface';
2
- export * from './cart.interface';
3
- export * from './catalog.interface';
4
1
  export * from './checkout.interface';
5
2
  export * from './core.interface';
6
- export * from './product.interface';
7
3
  export * from './retailer.interface';
@@ -1,6 +1,6 @@
1
1
  import type { FulfillmentType } from '@/enums';
2
2
  import type { DAYS_OF_WEEK } from '@/enums/cloud.enum';
3
- import type { IAddress, ICoords } from './address.interface';
3
+ import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
4
4
  export interface IRetailerTimes {
5
5
  startsAt: string;
6
6
  endsAt: string;
@@ -62,6 +62,6 @@ export interface IRetailer {
62
62
  engravingFee?: number;
63
63
  subtotal?: number;
64
64
  total?: number;
65
- address?: IAddress & ICoords;
65
+ address?: IAddressAddress & IAddressCoordinates;
66
66
  fulfillments: IRetailerFulfillments[];
67
67
  }
@@ -1,11 +1,11 @@
1
1
  export interface IElementsConfigurations {
2
- googleTagManagerId: string;
3
- enablePartnerGaTracking: boolean;
4
- liquidCommerceGoogleTagManagerId: string;
5
- enableLiquidCommerceGaTracking: boolean;
2
+ isElementsEnabled: boolean;
3
+ enablePartnerGTM: boolean;
4
+ partnerGTMId: string;
5
+ enableLiquidCommerceGTM: boolean;
6
+ liquidCommerceGTMId: string;
6
7
  partnerCode: string;
7
8
  supportEmail: string;
8
9
  builderBackgroundColor: string;
9
10
  partnerName: string;
10
- isElementsEnabled: boolean;
11
11
  }