@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
|
@@ -32,6 +32,7 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
|
32
32
|
readonly CART_PROMO_CODE_FAILED: "cart_promo_code_failed";
|
|
33
33
|
readonly CART_PRODUCT_ADD_SUCCESS: "cart_product_add_success";
|
|
34
34
|
readonly CART_PRODUCT_ADD_FAILED: "cart_product_add_failed";
|
|
35
|
+
readonly INTERNAL_CART_TO_CHECKOUT: "internal_cart_to_checkout";
|
|
35
36
|
readonly CHECKOUT_LOADED: "checkout_loaded";
|
|
36
37
|
readonly CHECKOUT_OPENED: "checkout_opened";
|
|
37
38
|
readonly CHECKOUT_CLOSED: "checkout_closed";
|
|
@@ -95,6 +96,7 @@ export declare const COMPONENT_TYPE: {
|
|
|
95
96
|
readonly PRODUCT_LIST: "product-list";
|
|
96
97
|
readonly PRODUCT_LIST_CARD: "product-list-card";
|
|
97
98
|
readonly PRODUCT_LIST_FILTERS: "product-list-filters";
|
|
99
|
+
readonly PRODUCT_LIST_SEARCH: "product-list-search";
|
|
98
100
|
readonly PRODUCT_LIST_CARD_LOADING: "product-list-card-loading";
|
|
99
101
|
readonly CART: "cart";
|
|
100
102
|
readonly CART_RETAILER: "cart-retailer";
|
|
@@ -145,3 +147,26 @@ export declare const DEBUG_MODE: {
|
|
|
145
147
|
readonly PANEL: "panel";
|
|
146
148
|
};
|
|
147
149
|
export type DebugMode = (typeof DEBUG_MODE)[keyof typeof DEBUG_MODE];
|
|
150
|
+
export declare const CART_EVENT_TYPE: {
|
|
151
|
+
readonly GENERIC: "generic";
|
|
152
|
+
readonly PROMO_CODE: "promo-code";
|
|
153
|
+
};
|
|
154
|
+
export type CartEventType = (typeof CART_EVENT_TYPE)[keyof typeof CART_EVENT_TYPE];
|
|
155
|
+
export declare const CART_EVENT_LEVEL: {
|
|
156
|
+
readonly SUCCESS: "success";
|
|
157
|
+
readonly WARNING: "warning";
|
|
158
|
+
readonly ERROR: "error";
|
|
159
|
+
};
|
|
160
|
+
export type CartEventLevel = (typeof CART_EVENT_LEVEL)[keyof typeof CART_EVENT_LEVEL];
|
|
161
|
+
export declare const CHECKOUT_EVENT_TYPE: {
|
|
162
|
+
readonly GENERIC: "generic";
|
|
163
|
+
readonly PROMO_CODE: "promo-code";
|
|
164
|
+
readonly GIFT_CARD: "gift-card";
|
|
165
|
+
};
|
|
166
|
+
export type CheckoutEventType = (typeof CHECKOUT_EVENT_TYPE)[keyof typeof CHECKOUT_EVENT_TYPE];
|
|
167
|
+
export declare const CHECKOUT_EVENT_LEVEL: {
|
|
168
|
+
readonly SUCCESS: "success";
|
|
169
|
+
readonly WARNING: "warning";
|
|
170
|
+
readonly ERROR: "error";
|
|
171
|
+
};
|
|
172
|
+
export type CheckoutEventLevel = (typeof CHECKOUT_EVENT_LEVEL)[keyof typeof CHECKOUT_EVENT_LEVEL];
|
|
@@ -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,95 @@
|
|
|
1
|
+
import type { CartEventLevel, CartEventType, 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
|
+
engravingExpectation: string;
|
|
23
|
+
itemIds: string[];
|
|
24
|
+
subtotal: number;
|
|
25
|
+
hasUnmetMinimumPurchaseAmount: boolean;
|
|
26
|
+
minimumPurchaseAmount: number;
|
|
27
|
+
}
|
|
28
|
+
export interface ICartRetailer {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
subtotal: number;
|
|
32
|
+
itemsQuantity: number;
|
|
33
|
+
fulfillments: Record<string, ICartFulfillment>;
|
|
34
|
+
}
|
|
35
|
+
export interface ICartItemAttributes {
|
|
36
|
+
engraving: ICartItemEngraving;
|
|
37
|
+
presale: IProductPresale;
|
|
38
|
+
}
|
|
39
|
+
export interface ICartItem {
|
|
40
|
+
id: string;
|
|
41
|
+
variantId: string;
|
|
42
|
+
liquidId: string;
|
|
43
|
+
retailerId: string;
|
|
44
|
+
partNumber: string;
|
|
45
|
+
fulfillmentId: string;
|
|
46
|
+
upc: string;
|
|
47
|
+
sku: string;
|
|
48
|
+
salsifyGrouping: string;
|
|
49
|
+
catPath: string;
|
|
50
|
+
volume: string;
|
|
51
|
+
uom: string;
|
|
52
|
+
pack: boolean;
|
|
53
|
+
packDesc: string;
|
|
54
|
+
container: string;
|
|
55
|
+
containerType: string;
|
|
56
|
+
name: string;
|
|
57
|
+
brand: string;
|
|
58
|
+
size: string;
|
|
59
|
+
price: number;
|
|
60
|
+
quantity: number;
|
|
61
|
+
maxQuantity: number;
|
|
62
|
+
unitPrice: number;
|
|
63
|
+
mainImage: string;
|
|
64
|
+
attributes: ICartItemAttributes;
|
|
65
|
+
}
|
|
66
|
+
export interface ICartPromoCode {
|
|
67
|
+
code: string;
|
|
68
|
+
discount: number;
|
|
69
|
+
freeDelivery: boolean;
|
|
70
|
+
freeServiceFee: boolean;
|
|
71
|
+
freeShipping: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface ICartEvent {
|
|
74
|
+
type: CartEventType;
|
|
75
|
+
message: string;
|
|
76
|
+
level: CartEventLevel;
|
|
77
|
+
}
|
|
78
|
+
export interface ICart {
|
|
79
|
+
id: string;
|
|
80
|
+
subtotal: number;
|
|
81
|
+
itemsQuantity: number;
|
|
82
|
+
items: Record<string, ICartItem>;
|
|
83
|
+
retailers: Record<string, ICartRetailer>;
|
|
84
|
+
promoCode: ICartPromoCode | null;
|
|
85
|
+
events: ICartEvent[];
|
|
86
|
+
}
|
|
87
|
+
export interface ICartItemEngraving {
|
|
88
|
+
isEngravable: boolean;
|
|
89
|
+
hasEngraving: boolean;
|
|
90
|
+
fee: number;
|
|
91
|
+
maxCharsPerLine: number;
|
|
92
|
+
maxLines: number;
|
|
93
|
+
location: string;
|
|
94
|
+
lines: string[];
|
|
95
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import type { CheckoutEventLevel, CheckoutEventType, FulfillmentType } from '@/enums';
|
|
2
|
+
import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface';
|
|
3
|
+
import type { ICart } from '@/interfaces/api/cart.interface';
|
|
4
|
+
import type { IProductPresale } from '@/interfaces/api/product.interface';
|
|
5
|
+
export interface ICheckoutComplete {
|
|
6
|
+
orderNumber: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ICheckoutPaymentSession {
|
|
9
|
+
key: string;
|
|
10
|
+
secret: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ICheckoutPaymentConfirmParams {
|
|
13
|
+
confirmationTokenId: string;
|
|
14
|
+
setupIntentId: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ICheckoutPaymentConfirmCard {
|
|
17
|
+
brand: string;
|
|
18
|
+
expMonth: string;
|
|
19
|
+
expYear: string;
|
|
20
|
+
last4: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ICheckoutPaymentConfirm {
|
|
23
|
+
id: string;
|
|
24
|
+
card: ICheckoutPaymentConfirmCard;
|
|
25
|
+
}
|
|
26
|
+
export interface ICheckoutCustomer {
|
|
27
|
+
email: string;
|
|
28
|
+
firstName: string;
|
|
29
|
+
lastName: string;
|
|
30
|
+
company: string;
|
|
31
|
+
phone: string;
|
|
32
|
+
birthDate: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ICheckoutBilling {
|
|
35
|
+
firstName: string;
|
|
36
|
+
lastName: string;
|
|
37
|
+
email: string;
|
|
38
|
+
phone: string;
|
|
39
|
+
company: string;
|
|
40
|
+
one: string;
|
|
41
|
+
two: string;
|
|
42
|
+
city: string;
|
|
43
|
+
state: string;
|
|
44
|
+
zip: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ICheckoutGiftRecipient {
|
|
47
|
+
firstName: string;
|
|
48
|
+
lastName: string;
|
|
49
|
+
email: string;
|
|
50
|
+
phone: string;
|
|
51
|
+
message: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ICheckoutMarketingPreferences {
|
|
54
|
+
canEmail: boolean;
|
|
55
|
+
canSms: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface ICheckoutDeliveryTip {
|
|
58
|
+
fulfillmentId: string;
|
|
59
|
+
tip: number;
|
|
60
|
+
}
|
|
61
|
+
export interface ICheckoutDeliveryInstructions {
|
|
62
|
+
fulfillmentId: string;
|
|
63
|
+
instructions: string;
|
|
64
|
+
}
|
|
65
|
+
export interface ICheckoutPrepareParams {
|
|
66
|
+
cartId: string;
|
|
67
|
+
customer?: ICheckoutCustomer;
|
|
68
|
+
shippingAddressTwo?: string;
|
|
69
|
+
billingAddress?: ICheckoutBilling;
|
|
70
|
+
isGift?: boolean;
|
|
71
|
+
billingSameAsShipping?: boolean;
|
|
72
|
+
giftOptions?: ICheckoutGiftRecipient;
|
|
73
|
+
marketingPreferences?: ICheckoutMarketingPreferences;
|
|
74
|
+
deliveryTips?: ICheckoutDeliveryTip[];
|
|
75
|
+
deliveryInstructions?: ICheckoutDeliveryInstructions[];
|
|
76
|
+
payment?: string;
|
|
77
|
+
promoCode?: string;
|
|
78
|
+
giftCards?: string[];
|
|
79
|
+
}
|
|
80
|
+
export interface ICheckoutUpdateItem {
|
|
81
|
+
id?: string;
|
|
82
|
+
partNumber: string;
|
|
83
|
+
quantity: number;
|
|
84
|
+
fulfillmentId: string;
|
|
85
|
+
engravingLines?: string[];
|
|
86
|
+
}
|
|
87
|
+
export interface ICheckoutItemsUpdateParams {
|
|
88
|
+
cartId: string;
|
|
89
|
+
items: ICheckoutUpdateItem[];
|
|
90
|
+
location?: ILocation;
|
|
91
|
+
}
|
|
92
|
+
export interface ICheckoutItemsUpdateResponse {
|
|
93
|
+
cart: ICart;
|
|
94
|
+
checkout: ICheckoutPrepare;
|
|
95
|
+
}
|
|
96
|
+
export interface ICheckoutAmounts {
|
|
97
|
+
subtotal: number;
|
|
98
|
+
engraving: number;
|
|
99
|
+
service: number;
|
|
100
|
+
shipping: number;
|
|
101
|
+
delivery: number;
|
|
102
|
+
platform: number;
|
|
103
|
+
discounts: number;
|
|
104
|
+
giftCards: number;
|
|
105
|
+
tax: number;
|
|
106
|
+
tip: number;
|
|
107
|
+
total: number;
|
|
108
|
+
}
|
|
109
|
+
export interface ICheckoutPromoCode {
|
|
110
|
+
code: string;
|
|
111
|
+
discount: number;
|
|
112
|
+
freeDelivery: boolean;
|
|
113
|
+
freeServiceFee: boolean;
|
|
114
|
+
freeShipping: boolean;
|
|
115
|
+
}
|
|
116
|
+
export interface ICheckoutGiftCard {
|
|
117
|
+
code: string;
|
|
118
|
+
applied: number;
|
|
119
|
+
}
|
|
120
|
+
export interface ICheckoutShippingAddress extends IAddressAddress, IAddressCoordinates {
|
|
121
|
+
}
|
|
122
|
+
export interface ICheckoutItemEngraving {
|
|
123
|
+
isEngravable: boolean;
|
|
124
|
+
hasEngraving: boolean;
|
|
125
|
+
fee: number;
|
|
126
|
+
maxCharsPerLine: number;
|
|
127
|
+
maxLines: number;
|
|
128
|
+
location: string;
|
|
129
|
+
lines: string[];
|
|
130
|
+
}
|
|
131
|
+
export interface ICheckoutItemAttributes {
|
|
132
|
+
engraving: ICheckoutItemEngraving;
|
|
133
|
+
presale: IProductPresale;
|
|
134
|
+
}
|
|
135
|
+
export interface ICheckoutItem {
|
|
136
|
+
variantId: string;
|
|
137
|
+
cartItemId: string;
|
|
138
|
+
liquidId: string;
|
|
139
|
+
retailerId: string;
|
|
140
|
+
fulfillmentId: string;
|
|
141
|
+
salsifyPid?: string;
|
|
142
|
+
salsifyGrouping?: string;
|
|
143
|
+
name: string;
|
|
144
|
+
catPath: string;
|
|
145
|
+
volume: string;
|
|
146
|
+
uom: string;
|
|
147
|
+
proof: string;
|
|
148
|
+
abv: string;
|
|
149
|
+
containerType: string;
|
|
150
|
+
container: string;
|
|
151
|
+
size: string;
|
|
152
|
+
pack: boolean;
|
|
153
|
+
packDesc: string;
|
|
154
|
+
mainImage: string;
|
|
155
|
+
brand: string;
|
|
156
|
+
partNumber: string;
|
|
157
|
+
upc: string;
|
|
158
|
+
sku: string;
|
|
159
|
+
price: number;
|
|
160
|
+
unitPrice: number;
|
|
161
|
+
quantity: number;
|
|
162
|
+
tax: number;
|
|
163
|
+
unitTax: number;
|
|
164
|
+
bottleDeposits: number;
|
|
165
|
+
attributes: ICheckoutItemAttributes;
|
|
166
|
+
}
|
|
167
|
+
export interface ICheckoutFulfillment {
|
|
168
|
+
id: string;
|
|
169
|
+
deliveryInstructions: string;
|
|
170
|
+
type: FulfillmentType;
|
|
171
|
+
expectation: string;
|
|
172
|
+
engravingExpectation: string;
|
|
173
|
+
itemIds: string[];
|
|
174
|
+
doesAllowPromos: boolean;
|
|
175
|
+
doesAllowGiftCards: boolean;
|
|
176
|
+
amounts: ICheckoutAmounts;
|
|
177
|
+
itemsQuantity: number;
|
|
178
|
+
}
|
|
179
|
+
export interface ICheckoutRetailer {
|
|
180
|
+
id: string;
|
|
181
|
+
name: string;
|
|
182
|
+
fulfillments: Record<string, ICheckoutFulfillment>;
|
|
183
|
+
amounts: ICheckoutAmounts;
|
|
184
|
+
}
|
|
185
|
+
export interface ICheckoutPresale {
|
|
186
|
+
isLocked: boolean;
|
|
187
|
+
expiresAt: string;
|
|
188
|
+
}
|
|
189
|
+
export interface ICheckoutEvent {
|
|
190
|
+
type: CheckoutEventType;
|
|
191
|
+
message: string;
|
|
192
|
+
level: CheckoutEventLevel;
|
|
193
|
+
}
|
|
194
|
+
export interface ICheckoutPrepare {
|
|
195
|
+
token: string;
|
|
196
|
+
cartId: string;
|
|
197
|
+
customer: ICheckoutCustomer;
|
|
198
|
+
isGift: boolean;
|
|
199
|
+
billingSameAsShipping: boolean;
|
|
200
|
+
payment?: string;
|
|
201
|
+
giftOptions: ICheckoutGiftRecipient;
|
|
202
|
+
marketingPreferences: ICheckoutMarketingPreferences;
|
|
203
|
+
shippingAddress: ICheckoutShippingAddress;
|
|
204
|
+
billingAddress: ICheckoutBilling;
|
|
205
|
+
promoCode: ICheckoutPromoCode | null;
|
|
206
|
+
amounts: ICheckoutAmounts;
|
|
207
|
+
giftCards: ICheckoutGiftCard[];
|
|
208
|
+
presale: ICheckoutPresale | null;
|
|
209
|
+
itemsQuantity: number;
|
|
210
|
+
items: Record<string, ICheckoutItem>;
|
|
211
|
+
retailers: Record<string, ICheckoutRetailer>;
|
|
212
|
+
events: ICheckoutEvent[];
|
|
213
|
+
}
|
|
@@ -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
|
+
expectation: string;
|
|
77
|
+
engravingExpectation: 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,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;
|
|
@@ -28,6 +28,7 @@ export interface ILiquidCommerceElementsBaseConfig {
|
|
|
28
28
|
promoTicker?: IPromoTicker[];
|
|
29
29
|
customTheme?: IClientCustomThemeConfig;
|
|
30
30
|
debugMode?: DebugMode;
|
|
31
|
+
checkoutUrl?: string;
|
|
31
32
|
}
|
|
32
33
|
export interface ILiquidCommerceElementsBuilderConfig extends ILiquidCommerceElementsBaseConfig {
|
|
33
34
|
}
|
|
@@ -65,6 +66,11 @@ export interface IProcessInjectElementParams {
|
|
|
65
66
|
containerId: string;
|
|
66
67
|
identifier?: string;
|
|
67
68
|
options?: IAddressOptions;
|
|
69
|
+
checkoutId?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface IInjectCheckoutParams {
|
|
72
|
+
containerId: string;
|
|
73
|
+
checkoutId?: string;
|
|
68
74
|
}
|
|
69
75
|
export interface ILiquidCommerceElementsUIMethod {
|
|
70
76
|
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
@@ -101,7 +107,7 @@ export interface ILiquidCommerceElementsClient {
|
|
|
101
107
|
injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
102
108
|
injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
|
|
103
109
|
injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
|
|
104
|
-
injectCheckoutElement(
|
|
110
|
+
injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
105
111
|
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
106
112
|
ui: ILiquidCommerceElementsUIMethod;
|
|
107
113
|
actions: ILiquidCommerceElementsActions;
|
|
@@ -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,8 @@ 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;
|
|
14
|
+
private buildFormattedAddressString;
|
|
15
15
|
}
|
|
@@ -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;
|
|
@@ -9,17 +8,15 @@ export interface AddItemParams {
|
|
|
9
8
|
identifier: string;
|
|
10
9
|
}
|
|
11
10
|
export declare class CartCommands extends BaseCommand {
|
|
12
|
-
private readonly uiCommands;
|
|
13
|
-
private readonly checkoutCommands;
|
|
14
|
-
private readonly commonCommands;
|
|
15
11
|
constructor();
|
|
16
12
|
static getInstance(): CartCommands;
|
|
17
13
|
updateItemQuantity(itemId: string, delta: number): Promise<void>;
|
|
18
14
|
removeItem(itemId: string, isNotStandAlone?: boolean): Promise<void>;
|
|
19
15
|
updateItemEngraving(productItemId: string, engravingLines: string[]): Promise<void>;
|
|
20
16
|
addItem(params: AddItemParams): Promise<void>;
|
|
21
|
-
addPresaleItem(params: AddItemParams): Promise<void>;
|
|
22
17
|
handleGoToCheckout(): Promise<void>;
|
|
18
|
+
private trackBeginCheckout;
|
|
19
|
+
private resolveCheckoutRedirectUrl;
|
|
23
20
|
applyPromoCode(promoCode: string): Promise<void>;
|
|
24
21
|
removePromoCode(): Promise<void>;
|
|
25
22
|
rerenderCart(): void;
|
|
@@ -32,4 +29,6 @@ export declare class CartCommands extends BaseCommand {
|
|
|
32
29
|
private updateFulfillment;
|
|
33
30
|
private addNewFulfillmentAndRetailer;
|
|
34
31
|
private cleanupAfterItemRemoval;
|
|
32
|
+
private syncCartState;
|
|
33
|
+
private buildCartLoadedEventData;
|
|
35
34
|
}
|
|
@@ -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;
|
|
@@ -6,7 +6,6 @@ export declare class CartFulfillmentComponent extends BaseComponent<ICartFulfill
|
|
|
6
6
|
get hostClasses(): string[];
|
|
7
7
|
constructor();
|
|
8
8
|
private getFulfillmentId;
|
|
9
|
-
private getProductStore;
|
|
10
9
|
private handleItemsUpdate;
|
|
11
10
|
private setupItemElements;
|
|
12
11
|
private setupMinimumPurchaseAlert;
|
|
@@ -17,7 +16,6 @@ export declare class CartFulfillmentComponent extends BaseComponent<ICartFulfill
|
|
|
17
16
|
private isAnyItemUpdating;
|
|
18
17
|
private checkAndUpdateLoadingState;
|
|
19
18
|
onStoreChanged(changes: IOnStoreChanged[]): boolean | undefined;
|
|
20
|
-
private hasFulfillmentFeesChanged;
|
|
21
19
|
private hasFulfillmentDataChanged;
|
|
22
20
|
protected afterRender(): void;
|
|
23
21
|
protected disconnected(): void;
|