@liquidcommerce/elements-sdk 2.6.0-beta.1 → 2.6.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.esm.js +10746 -10275
- package/dist/types/constants/core.constant.d.ts +11 -0
- package/dist/types/core/api/api-client.service.d.ts +11 -11
- package/dist/types/core/api/auth-client.service.d.ts +3 -14
- package/dist/types/core/client/client-action.service.d.ts +18 -11
- package/dist/types/core/client/client-config.service.d.ts +1 -0
- package/dist/types/core/command/base-command.service.d.ts +2 -2
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/google-tag-manager.service.d.ts +12 -10
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +26 -63
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +11 -1
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
- package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -54
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +2 -2
- package/dist/types/core/store/interfaces/core.interface.d.ts +5 -4
- package/dist/types/core/store/interfaces/product.interface.d.ts +12 -66
- package/dist/types/core/store/store.constant.d.ts +1 -1
- package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
- package/dist/types/elements-base-client.d.ts +1 -1
- package/dist/types/enums/cloud.enum.d.ts +20 -0
- package/dist/types/enums/core.enum.d.ts +1 -0
- package/dist/types/interfaces/api/address.interface.d.ts +28 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +91 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +30 -0
- package/dist/types/interfaces/api/product.interface.d.ts +106 -0
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +14 -10
- package/dist/types/interfaces/cloud/index.d.ts +0 -4
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +2 -2
- package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
- package/dist/types/interfaces/configs/global.interface.d.ts +1 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
- package/dist/types/modules/address/address.command.d.ts +2 -3
- package/dist/types/modules/address/address.interface.d.ts +0 -7
- package/dist/types/modules/cart/cart.commands.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
- package/dist/types/modules/product/components/components.d.ts +2 -4
- package/dist/types/modules/product/product.commands.d.ts +2 -2
- package/dist/types/modules/product-list/components/index.d.ts +2 -0
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +3 -2
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +6 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +1 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts +7 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-price-filter.components.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +18 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +27 -5
- package/dist/types/modules/product-list/product-list.commands.d.ts +3 -2
- package/dist/types/modules/product-list/product-list.component.d.ts +13 -5
- package/dist/types/modules/product-list/product-list.interface.d.ts +77 -0
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
- package/dist/types/static/icon/filter.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/utils/helper.d.ts +2 -1
- package/docs/THEMING.md +3 -0
- package/package.json +4 -5
- package/umd/elements.js +1 -1
- package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
- package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
- package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
- package/dist/types/modules/product/utils/helpers.d.ts +0 -3
- package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IElementsCheckoutEvents } from 'utils/helper';
|
|
2
|
-
import type { ICartItemAttributes
|
|
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:
|
|
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 {
|
|
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.
|
|
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 {
|
|
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
|
|
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:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -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 {
|
|
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?:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
legacyOrderNumber: string;
|
|
211
|
-
referenceId: string;
|
|
212
|
-
};
|
|
215
|
+
legacyOrderNumber: string;
|
|
216
|
+
referenceId: string;
|
|
213
217
|
}
|
|
214
218
|
export {};
|
|
@@ -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 {
|
|
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?:
|
|
65
|
+
address?: IAddressAddress & IAddressCoordinates;
|
|
66
66
|
fulfillments: IRetailerFulfillments[];
|
|
67
67
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface IElementsConfigurations {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
}
|
|
@@ -2,6 +2,7 @@ import type { DeepPartial } from '@/interfaces/core.interface';
|
|
|
2
2
|
export type FulfillmentDisplayType = 'carousel' | 'popup';
|
|
3
3
|
export interface IProductLayout {
|
|
4
4
|
showImages: boolean;
|
|
5
|
+
showOnlyMainImage: boolean;
|
|
5
6
|
showTitle: boolean;
|
|
6
7
|
showDescription: boolean;
|
|
7
8
|
showQuantityCounter: boolean;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
|
-
import type {
|
|
3
|
-
import type { IAddressData } from './address.interface';
|
|
2
|
+
import type { IAddressAddress, IAddressAutocompleteResult, IAddressCoordinates, IAddressData, IAddressDetailsResult } from '@/interfaces/api/address.interface';
|
|
4
3
|
export declare class AddressCommands extends BaseCommand {
|
|
5
4
|
private productCommands;
|
|
6
5
|
private cartCommands;
|
|
@@ -9,7 +8,7 @@ export declare class AddressCommands extends BaseCommand {
|
|
|
9
8
|
searchAddresses(query: string): Promise<IAddressAutocompleteResult[]>;
|
|
10
9
|
getAddressDetails(addressId: string): Promise<IAddressDetailsResult>;
|
|
11
10
|
setSelectedAddress(addressData: IAddressData): Promise<void>;
|
|
12
|
-
setAddressManually(address:
|
|
11
|
+
setAddressManually(address: IAddressAddress, coordinates: IAddressCoordinates): Promise<void>;
|
|
13
12
|
clearSelectedAddress(): Promise<void>;
|
|
14
13
|
getDetails(): IAddressData | null;
|
|
15
14
|
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { IAddress, ICoords } from '@/interfaces/cloud/address.interface';
|
|
2
1
|
export interface IAddressOptions {
|
|
3
2
|
showLabel?: boolean;
|
|
4
3
|
}
|
|
5
|
-
export interface IAddressData {
|
|
6
|
-
id: string;
|
|
7
|
-
formattedAddress: string;
|
|
8
|
-
address: Omit<IAddress, 'id'>;
|
|
9
|
-
coordinates: ICoords;
|
|
10
|
-
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
2
|
import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
3
3
|
export interface AddItemParams {
|
|
4
|
-
upc: string;
|
|
5
4
|
fulfillmentId: string;
|
|
6
5
|
partNumber: string;
|
|
7
6
|
quantity: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
-
|
|
2
|
+
import type { ICartComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CartBodyComponent extends BaseComponent<null, ICartComponent> {
|
|
3
4
|
get hostClasses(): string[];
|
|
4
5
|
constructor();
|
|
5
6
|
private createEmptyCartElement;
|
|
@@ -12,7 +12,6 @@ export declare class CartFooterComponent extends BaseComponent<ICartFooterCompon
|
|
|
12
12
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
13
13
|
afterRender(): void;
|
|
14
14
|
private isAnythingLoading;
|
|
15
|
-
private hasUnmetMinimum;
|
|
16
15
|
private shouldDisableCheckout;
|
|
17
16
|
private updateCheckoutButtonState;
|
|
18
17
|
private updateSubtotalItemsCount;
|