@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.
- package/README.md +7 -7
- package/dist/index.esm.js +11602 -11122
- package/dist/types/constants/core.constant.d.ts +11 -0
- package/dist/types/core/api/api-client.service.d.ts +15 -15
- package/dist/types/core/api/auth-client.service.d.ts +34 -23
- package/dist/types/core/api/http-client.service.d.ts +0 -1
- package/dist/types/core/client/client-action.service.d.ts +18 -12
- package/dist/types/core/client/client-config.service.d.ts +3 -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 +14 -11
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +44 -50
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +5 -4
- 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 -55
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +16 -107
- package/dist/types/core/store/interfaces/core.interface.d.ts +7 -5
- 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 +19 -76
- package/dist/types/enums/core.enum.d.ts +25 -0
- package/dist/types/interfaces/api/address.interface.d.ts +28 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +95 -0
- package/dist/types/interfaces/api/checkout.interface.d.ts +213 -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/configs/configurations.interface.d.ts +5 -5
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
- package/dist/types/interfaces/core.interface.d.ts +7 -1
- package/dist/types/modules/address/address.command.d.ts +3 -3
- package/dist/types/modules/address/address.interface.d.ts +0 -7
- package/dist/types/modules/cart/cart.commands.d.ts +4 -5
- 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/checkout/checkout.commands.d.ts +18 -9
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
- package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
- package/dist/types/modules/checkout/constant.d.ts +3 -0
- package/dist/types/modules/product/components/components.d.ts +2 -4
- package/dist/types/modules/product/product.commands.d.ts +3 -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 +4 -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/engraving/engraving-form.component.d.ts +1 -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/format.d.ts +0 -13
- package/docs/ACTIONS.md +13 -13
- package/docs/EVENTS.md +7 -7
- package/package.json +8 -9
- 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/checkout.interface.d.ts +0 -214
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -7
- package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/modules/product/utils/helpers.d.ts +0 -3
- package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
- package/dist/types/utils/helper.d.ts +0 -27
|
@@ -1,87 +1,23 @@
|
|
|
1
1
|
import type { FulfillmentType } from '@/enums';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
price: number;
|
|
5
|
-
partNumber: string;
|
|
6
|
-
stock: number;
|
|
7
|
-
isEngravable: boolean;
|
|
8
|
-
fulfillmentId: string;
|
|
9
|
-
fulfillmentType: FulfillmentType;
|
|
10
|
-
modalities: FulfillmentType[];
|
|
11
|
-
retailerId: string;
|
|
2
|
+
import type { IFulfillment, IProduct, IProductSize, IProductVariant, IRetailerAddress } from '@/interfaces/api/product.interface';
|
|
3
|
+
export type IProductFulfillmentEventData = IFulfillment & {
|
|
12
4
|
retailerName: string;
|
|
13
|
-
retailerAddress:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
location: string;
|
|
23
|
-
};
|
|
24
|
-
presale?: {
|
|
25
|
-
canPurchaseOn: null | string;
|
|
26
|
-
estimatedShipBy: null | string;
|
|
27
|
-
isActive: boolean;
|
|
28
|
-
language: string;
|
|
29
|
-
presaleLimit: number;
|
|
30
|
-
price: number;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export interface IBaseProductSizeEventData {
|
|
34
|
-
id: string;
|
|
35
|
-
upc: string;
|
|
36
|
-
size: string;
|
|
37
|
-
pack: boolean;
|
|
38
|
-
packDesc: string;
|
|
39
|
-
container: string;
|
|
40
|
-
containerType: string;
|
|
41
|
-
maxQuantityPerOrder: number;
|
|
42
|
-
image: string;
|
|
43
|
-
uom: string;
|
|
44
|
-
volume: string;
|
|
45
|
-
attributes: IBaseProductSizeAttributesEventData;
|
|
46
|
-
shippingFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
47
|
-
onDemandFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
48
|
-
}
|
|
49
|
-
export interface IBaseProductEventData {
|
|
5
|
+
retailerAddress: IRetailerAddress;
|
|
6
|
+
retailerAddressFormatted: string;
|
|
7
|
+
variant: IProductVariant;
|
|
8
|
+
};
|
|
9
|
+
export interface IProductSizeEventData extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
|
|
10
|
+
onDemandFulfillments: Record<string, IProductFulfillmentEventData>;
|
|
11
|
+
shippingFulfillments: Record<string, IProductFulfillmentEventData>;
|
|
12
|
+
}
|
|
13
|
+
export interface IBaseProductEventData extends Omit<IProduct, 'sizes'> {
|
|
50
14
|
identifier: string;
|
|
51
15
|
selectedSizeId: string | null;
|
|
52
|
-
selectedFulfillmentId: string | null;
|
|
53
16
|
selectedFulfillmentType: FulfillmentType;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
category: string;
|
|
59
|
-
classification: string;
|
|
60
|
-
type: string;
|
|
61
|
-
salsifyGrouping: string;
|
|
62
|
-
subType: string;
|
|
63
|
-
mainImage: string | null;
|
|
64
|
-
images: string[];
|
|
65
|
-
region: string;
|
|
66
|
-
country: string;
|
|
67
|
-
material: string;
|
|
68
|
-
abv: string;
|
|
69
|
-
proof: string;
|
|
70
|
-
age: string;
|
|
71
|
-
color: string;
|
|
72
|
-
flavor: string;
|
|
73
|
-
variety: string;
|
|
74
|
-
appellation: string;
|
|
75
|
-
vintage: string;
|
|
76
|
-
description: string;
|
|
77
|
-
htmlDescription: string;
|
|
78
|
-
tastingNotes: string;
|
|
79
|
-
priceInfo: {
|
|
80
|
-
min: number;
|
|
81
|
-
max: number;
|
|
82
|
-
avg: number;
|
|
83
|
-
} | null;
|
|
84
|
-
sizes: Record<string, IBaseProductSizeEventData>;
|
|
17
|
+
selectedFulfillmentId: string | null;
|
|
18
|
+
productHasAvailability: boolean;
|
|
19
|
+
fulfillmentHasAvailability: boolean;
|
|
20
|
+
sizes: Record<string, IProductSizeEventData>;
|
|
85
21
|
}
|
|
86
22
|
export interface IProductLoadedEventData extends IBaseProductEventData {
|
|
87
23
|
}
|
|
@@ -92,7 +28,6 @@ export interface IProductQuantityChangedEventData {
|
|
|
92
28
|
}
|
|
93
29
|
export interface IProductAddToCartEventData {
|
|
94
30
|
identifier: string;
|
|
95
|
-
upc: string;
|
|
96
31
|
fulfillmentId: string;
|
|
97
32
|
partNumber: string;
|
|
98
33
|
quantity: number;
|
|
@@ -101,7 +36,7 @@ export interface IProductAddToCartEventData {
|
|
|
101
36
|
export interface IProductSizeChangedEventData {
|
|
102
37
|
identifier: string;
|
|
103
38
|
selectedSizeId: string;
|
|
104
|
-
|
|
39
|
+
selectedSize: string;
|
|
105
40
|
previousSizeId: string;
|
|
106
41
|
previousSize: string;
|
|
107
42
|
}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
1
2
|
export interface IAddressStore {
|
|
2
3
|
id: string;
|
|
3
4
|
formattedAddress: string;
|
|
4
|
-
address:
|
|
5
|
-
|
|
6
|
-
two: string;
|
|
7
|
-
city: string;
|
|
8
|
-
state: string;
|
|
9
|
-
zip: string;
|
|
10
|
-
country: string;
|
|
11
|
-
};
|
|
12
|
-
coordinates: {
|
|
13
|
-
lat: number;
|
|
14
|
-
long: number;
|
|
15
|
-
};
|
|
5
|
+
address: IAddressAddress;
|
|
6
|
+
coordinates: IAddressCoordinates;
|
|
16
7
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { FulfillmentType } from '@/enums';
|
|
3
|
-
import type { IAddress, ICartItemAttributes, IRetailerExpectation, IRetailerFees } from '@/interfaces/cloud';
|
|
1
|
+
import type { ICartEvent, ICartFulfillment, ICartItemAttributes, ICartPromoCode, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
4
2
|
export interface ICartItemStore {
|
|
5
3
|
id: string;
|
|
6
4
|
variantId: string;
|
|
@@ -31,64 +29,27 @@ export interface ICartItemStore {
|
|
|
31
29
|
updating: boolean;
|
|
32
30
|
error: string | null;
|
|
33
31
|
}
|
|
34
|
-
export interface
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
platformFee: number;
|
|
39
|
-
giftCardTotal: number;
|
|
40
|
-
engravingFee: number;
|
|
41
|
-
deliveryFee: number;
|
|
42
|
-
discounts: number;
|
|
43
|
-
quantity: number;
|
|
32
|
+
export interface ICartFulfillmentStore extends ICartFulfillment {
|
|
33
|
+
loading: boolean;
|
|
34
|
+
error: string | null;
|
|
35
|
+
updating: boolean;
|
|
44
36
|
}
|
|
45
|
-
export interface
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
fees: IRetailerFees;
|
|
50
|
-
expectation: IRetailerExpectation;
|
|
51
|
-
shippingFee: number;
|
|
52
|
-
subtotal: number;
|
|
53
|
-
items: string[];
|
|
54
|
-
engravingFee: number;
|
|
55
|
-
deliveryFee: number;
|
|
56
|
-
retailerId: string;
|
|
57
|
-
loading?: boolean;
|
|
58
|
-
error?: string | null;
|
|
59
|
-
updating?: boolean;
|
|
37
|
+
export interface ICartRetailerStore extends ICartRetailer {
|
|
38
|
+
loading: boolean;
|
|
39
|
+
error: string | null;
|
|
40
|
+
updating: boolean;
|
|
60
41
|
}
|
|
61
|
-
export interface
|
|
42
|
+
export interface ICartStore {
|
|
62
43
|
id: string;
|
|
63
|
-
name: string;
|
|
64
|
-
platformFee: number;
|
|
65
|
-
shippingFee: number;
|
|
66
44
|
subtotal: number;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
error?: string | null;
|
|
74
|
-
updating?: boolean;
|
|
75
|
-
}
|
|
76
|
-
export interface ICartPromoCodeStore {
|
|
77
|
-
code: string;
|
|
78
|
-
discountAmount: number;
|
|
79
|
-
}
|
|
80
|
-
export interface ICartStore {
|
|
81
|
-
id: string | null;
|
|
45
|
+
itemsQuantity: number;
|
|
46
|
+
items: Record<string, ICartItemStore>;
|
|
47
|
+
fulfillments: Record<string, ICartFulfillmentStore>;
|
|
48
|
+
retailers: Record<string, ICartRetailerStore>;
|
|
49
|
+
promoCode: ICartPromoCode | null;
|
|
50
|
+
events: ICartEvent[];
|
|
82
51
|
loading: boolean;
|
|
83
52
|
error: string | null;
|
|
84
|
-
items: Record<string, ICartItemStore>;
|
|
85
|
-
totals: ICartTotalsStore;
|
|
86
|
-
retailers: Record<string, IRetailerStore>;
|
|
87
|
-
promoCode: ICartPromoCodeStore | null;
|
|
88
|
-
fulfillments: Record<string, IRetailerFulfillmentStore>;
|
|
89
53
|
rerender: boolean;
|
|
90
54
|
shouldReset: boolean;
|
|
91
|
-
updatedAt: string;
|
|
92
|
-
createdAt: string;
|
|
93
|
-
events: IElementsCartEvent[];
|
|
94
55
|
}
|
|
@@ -1,121 +1,29 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
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:
|
|
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:
|
|
14
|
+
data: ICheckoutGiftRecipient;
|
|
85
15
|
isEditing: boolean;
|
|
86
16
|
isValid: boolean;
|
|
87
17
|
isSaving: boolean;
|
|
88
18
|
}
|
|
89
|
-
export interface
|
|
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:
|
|
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:
|
|
35
|
+
presale: ICheckoutPresale | null;
|
|
128
36
|
isGift: boolean;
|
|
129
|
-
marketingPreferences:
|
|
37
|
+
marketingPreferences: ICheckoutMarketingPreferences;
|
|
130
38
|
customerForm: ICheckoutCustomerFormStore;
|
|
131
39
|
giftRecipientForm: ICheckoutGiftRecipientFormStore;
|
|
132
40
|
paymentForm: ICheckoutPaymentFormStore;
|
|
133
41
|
shippingAddressTwo: string;
|
|
134
|
-
promoCode:
|
|
135
|
-
giftCards:
|
|
42
|
+
promoCode: ICheckoutPromoCode | null;
|
|
43
|
+
giftCards: ICheckoutGiftCard[];
|
|
44
|
+
itemsQuantity: number;
|
|
136
45
|
items: Record<string, ICheckoutItemStore>;
|
|
137
|
-
|
|
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
|
-
|
|
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 {
|
|
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 {
|
|
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.
|
|
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 {
|
|
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;
|
|
@@ -1,77 +1,20 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
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];
|