@liquidcommerce/elements-sdk 2.6.0-beta.17 → 2.6.0-beta.19
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 +10477 -10580
- package/dist/types/core/api/api-client.service.d.ts +6 -6
- package/dist/types/core/client/client-action.service.d.ts +1 -2
- package/dist/types/core/client/client-config.service.d.ts +2 -0
- package/dist/types/core/google-tag-manager.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +35 -51
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +5 -4
- package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +15 -106
- package/dist/types/core/store/interfaces/core.interface.d.ts +3 -2
- package/dist/types/enums/cloud.enum.d.ts +0 -77
- package/dist/types/enums/core.enum.d.ts +24 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +11 -7
- package/dist/types/interfaces/api/checkout.interface.d.ts +211 -0
- package/dist/types/interfaces/api/product.interface.d.ts +2 -2
- package/dist/types/interfaces/cloud/index.d.ts +0 -2
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +9 -1
- package/dist/types/interfaces/core.interface.d.ts +7 -1
- package/dist/types/modules/cart/cart.commands.d.ts +4 -4
- 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-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/product.commands.d.ts +1 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +1 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +1 -0
- package/docs/ACTIONS.md +13 -13
- package/docs/EVENTS.md +7 -7
- package/package.json +5 -5
- package/umd/elements.js +1 -1
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/utils/helper.d.ts +0 -28
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import type { CheckoutEventEnum } from '@/enums';
|
|
2
|
-
import type { IAddressAddress } from '@/interfaces/api/address.interface';
|
|
3
|
-
import type { ICartItemAttributes } from '@/interfaces/api/cart.interface';
|
|
4
|
-
import type { ICoreParams } from '@/interfaces/cloud/core.interface';
|
|
5
|
-
import type { IRetailerExpectation } from './retailer.interface';
|
|
6
|
-
export interface ICheckoutRecipient {
|
|
7
|
-
firstName?: string;
|
|
8
|
-
lastName?: string;
|
|
9
|
-
email?: string;
|
|
10
|
-
phone?: string;
|
|
11
|
-
birthDate?: string;
|
|
12
|
-
hasAgeVerify?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface IBillingAddress {
|
|
15
|
-
firstName?: string;
|
|
16
|
-
lastName?: string;
|
|
17
|
-
email?: string;
|
|
18
|
-
phone?: string;
|
|
19
|
-
one?: string;
|
|
20
|
-
two?: string;
|
|
21
|
-
city?: string;
|
|
22
|
-
state?: string;
|
|
23
|
-
zip?: string;
|
|
24
|
-
country?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface ICheckoutCustomer {
|
|
27
|
-
id?: string;
|
|
28
|
-
email?: string;
|
|
29
|
-
firstName?: string;
|
|
30
|
-
lastName?: string;
|
|
31
|
-
company?: string;
|
|
32
|
-
phone?: string;
|
|
33
|
-
profileImage?: string;
|
|
34
|
-
birthDate?: string;
|
|
35
|
-
hasAgeVerify?: boolean;
|
|
36
|
-
createdAt?: Date;
|
|
37
|
-
updatedAt?: Date;
|
|
38
|
-
}
|
|
39
|
-
interface ICheckoutBaseAddress {
|
|
40
|
-
id?: string;
|
|
41
|
-
one?: string;
|
|
42
|
-
two?: string;
|
|
43
|
-
city?: string;
|
|
44
|
-
state?: string;
|
|
45
|
-
zip?: string;
|
|
46
|
-
country?: string;
|
|
47
|
-
}
|
|
48
|
-
export type ICheckoutBillingAddress = ICheckoutBaseAddress & Omit<ICheckoutCustomer, 'birthDate' | 'id' | 'createdAt' | 'hasAgeVerify' | 'updatedAt' | 'profileImage'>;
|
|
49
|
-
export interface ICheckoutGiftOptionsRecipient {
|
|
50
|
-
name?: string;
|
|
51
|
-
email?: string;
|
|
52
|
-
phone?: string;
|
|
53
|
-
}
|
|
54
|
-
export interface ICheckoutGiftOptions {
|
|
55
|
-
message?: string;
|
|
56
|
-
recipient?: ICheckoutGiftOptionsRecipient;
|
|
57
|
-
}
|
|
58
|
-
export interface ICheckoutMarketingPreferences {
|
|
59
|
-
canEmail?: boolean;
|
|
60
|
-
canSms?: boolean;
|
|
61
|
-
}
|
|
62
|
-
export interface ICheckoutDeliveryTip {
|
|
63
|
-
fulfillmentId: string;
|
|
64
|
-
tip: number;
|
|
65
|
-
}
|
|
66
|
-
export interface ICheckoutDeliveryInstructions {
|
|
67
|
-
fulfillmentId: string;
|
|
68
|
-
instructions: string;
|
|
69
|
-
}
|
|
70
|
-
export interface ICheckoutPrepareParams extends ICoreParams {
|
|
71
|
-
cartId: string;
|
|
72
|
-
customer?: ICheckoutCustomer | string;
|
|
73
|
-
recipient?: ICheckoutRecipient;
|
|
74
|
-
hasAgeVerify?: boolean;
|
|
75
|
-
shippingAddressTwo?: string;
|
|
76
|
-
billingAddress?: ICheckoutBillingAddress | IBillingAddress;
|
|
77
|
-
hasSubstitutionPolicy?: boolean;
|
|
78
|
-
isGift?: boolean;
|
|
79
|
-
billingSameAsShipping?: boolean;
|
|
80
|
-
giftOptions?: ICheckoutGiftOptions;
|
|
81
|
-
marketingPreferences?: ICheckoutMarketingPreferences;
|
|
82
|
-
deliveryTips?: ICheckoutDeliveryTip[];
|
|
83
|
-
deliveryInstructions?: ICheckoutDeliveryInstructions[];
|
|
84
|
-
acceptedAccountCreation?: boolean;
|
|
85
|
-
scheduledDelivery?: string;
|
|
86
|
-
payment?: string;
|
|
87
|
-
promoCode?: string;
|
|
88
|
-
giftCards?: string[];
|
|
89
|
-
}
|
|
90
|
-
export interface ICheckoutTotalAmountsDiscounts {
|
|
91
|
-
products: number;
|
|
92
|
-
delivery: number;
|
|
93
|
-
shipping: number;
|
|
94
|
-
engraving: number;
|
|
95
|
-
service: number;
|
|
96
|
-
}
|
|
97
|
-
export interface ICheckoutTotalAmountsTaxes {
|
|
98
|
-
bag: number;
|
|
99
|
-
bottleDeposits: number;
|
|
100
|
-
retailDelivery: number;
|
|
101
|
-
products: number;
|
|
102
|
-
delivery: number;
|
|
103
|
-
shipping: number;
|
|
104
|
-
}
|
|
105
|
-
export interface ICheckoutTotalAmountsDetails {
|
|
106
|
-
taxes: ICheckoutTotalAmountsTaxes;
|
|
107
|
-
discounts: ICheckoutTotalAmountsDiscounts;
|
|
108
|
-
}
|
|
109
|
-
export interface ICheckoutTotalAmounts {
|
|
110
|
-
subtotal: number;
|
|
111
|
-
engraving: number;
|
|
112
|
-
service: number;
|
|
113
|
-
shipping: number;
|
|
114
|
-
delivery: number;
|
|
115
|
-
platform: number;
|
|
116
|
-
discounts: number;
|
|
117
|
-
giftCards: number;
|
|
118
|
-
tax: number;
|
|
119
|
-
tip: number;
|
|
120
|
-
total: number;
|
|
121
|
-
details: ICheckoutTotalAmountsDetails;
|
|
122
|
-
}
|
|
123
|
-
export interface ICheckoutFulfillment extends ICheckoutTotalAmounts {
|
|
124
|
-
id: string;
|
|
125
|
-
scheduledFor?: string | Date;
|
|
126
|
-
type: 'shipping' | 'onDemand';
|
|
127
|
-
expectation: IRetailerExpectation;
|
|
128
|
-
items: string[];
|
|
129
|
-
}
|
|
130
|
-
export interface ICheckoutRetailer extends ICheckoutTotalAmounts {
|
|
131
|
-
id: string;
|
|
132
|
-
name: string;
|
|
133
|
-
address?: IAddressAddress;
|
|
134
|
-
fulfillments: ICheckoutFulfillment[];
|
|
135
|
-
}
|
|
136
|
-
export interface ICheckoutItem {
|
|
137
|
-
variantId: string;
|
|
138
|
-
cartItemId: string;
|
|
139
|
-
liquidId: string;
|
|
140
|
-
retailerId: string;
|
|
141
|
-
fulfillmentId: string;
|
|
142
|
-
salsifyPid?: string;
|
|
143
|
-
salsifyGrouping: string;
|
|
144
|
-
name: string;
|
|
145
|
-
catPath: string;
|
|
146
|
-
volume: string;
|
|
147
|
-
uom: string;
|
|
148
|
-
proof: string;
|
|
149
|
-
abv: string;
|
|
150
|
-
containerType: string;
|
|
151
|
-
container: string;
|
|
152
|
-
size: string;
|
|
153
|
-
pack: boolean;
|
|
154
|
-
packDesc: string;
|
|
155
|
-
mainImage: string;
|
|
156
|
-
image: string;
|
|
157
|
-
brand: string;
|
|
158
|
-
partNumber: string;
|
|
159
|
-
upc: string;
|
|
160
|
-
sku: string;
|
|
161
|
-
price: number;
|
|
162
|
-
unitPrice: number;
|
|
163
|
-
quantity: number;
|
|
164
|
-
tax: number;
|
|
165
|
-
unitTax: number;
|
|
166
|
-
bottleDeposits: number;
|
|
167
|
-
attributes: ICartItemAttributes;
|
|
168
|
-
}
|
|
169
|
-
export interface ICheckoutGiftCard {
|
|
170
|
-
code: string;
|
|
171
|
-
applied: number;
|
|
172
|
-
balance: number;
|
|
173
|
-
}
|
|
174
|
-
export interface ICheckoutEvents {
|
|
175
|
-
type: CheckoutEventEnum;
|
|
176
|
-
message: string;
|
|
177
|
-
}
|
|
178
|
-
export interface ICheckoutAttributesPromoCode {
|
|
179
|
-
value: string;
|
|
180
|
-
discount: number;
|
|
181
|
-
freeDelivery: boolean;
|
|
182
|
-
freeServiceFee: boolean;
|
|
183
|
-
freeShipping: boolean;
|
|
184
|
-
}
|
|
185
|
-
export interface ICheckoutPrepareResponse {
|
|
186
|
-
token: string;
|
|
187
|
-
cartId: string;
|
|
188
|
-
customer: ICheckoutCustomer;
|
|
189
|
-
hasAgeVerify: boolean;
|
|
190
|
-
hasSubstitutionPolicy: boolean;
|
|
191
|
-
isGift: boolean;
|
|
192
|
-
createdAt: string;
|
|
193
|
-
updatedAt: string;
|
|
194
|
-
billingSameAsShipping: boolean;
|
|
195
|
-
acceptedAccountCreation?: boolean;
|
|
196
|
-
giftOptions: ICheckoutGiftOptions;
|
|
197
|
-
marketingPreferences: ICheckoutMarketingPreferences;
|
|
198
|
-
shippingAddress: IAddressAddress;
|
|
199
|
-
billingAddress: ICheckoutBillingAddress;
|
|
200
|
-
amounts: ICheckoutTotalAmounts;
|
|
201
|
-
items: ICheckoutItem[];
|
|
202
|
-
retailers: ICheckoutRetailer[];
|
|
203
|
-
payment?: string;
|
|
204
|
-
giftCards: ICheckoutGiftCard[];
|
|
205
|
-
events: ICheckoutEvents[];
|
|
206
|
-
promoCode: ICheckoutAttributesPromoCode;
|
|
207
|
-
isPresaleLocked: boolean;
|
|
208
|
-
presaleExpiresAt: string | null;
|
|
209
|
-
}
|
|
210
|
-
export interface ICheckoutCompleteParams extends ICoreParams {
|
|
211
|
-
token: string;
|
|
212
|
-
payment: string;
|
|
213
|
-
}
|
|
214
|
-
export interface ICheckoutCompleteResponse {
|
|
215
|
-
legacyOrderNumber: string;
|
|
216
|
-
referenceId: string;
|
|
217
|
-
}
|
|
218
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface ICoreParams {
|
|
2
|
-
refresh?: boolean;
|
|
3
|
-
isLean?: boolean;
|
|
4
|
-
isLegacy?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface ILiquidPaymentToken {
|
|
7
|
-
id?: string;
|
|
8
|
-
type?: string;
|
|
9
|
-
card?: {
|
|
10
|
-
brand: string | null;
|
|
11
|
-
country: string | null;
|
|
12
|
-
expMonth: number | null;
|
|
13
|
-
expYear: number | null;
|
|
14
|
-
last4: string | null;
|
|
15
|
-
funding: string | null;
|
|
16
|
-
};
|
|
17
|
-
created?: number;
|
|
18
|
-
error?: {
|
|
19
|
-
message: string;
|
|
20
|
-
code?: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { AddressType } from '@/enums';
|
|
2
|
-
import type { ICoreParams } from '@/interfaces/cloud/core.interface';
|
|
3
|
-
export interface IUserSessionOb {
|
|
4
|
-
values?: [string, string[]];
|
|
5
|
-
createdAt: Date;
|
|
6
|
-
}
|
|
7
|
-
export interface IUserSession {
|
|
8
|
-
key: string | null;
|
|
9
|
-
secret: string | null;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
}
|
|
12
|
-
export interface IUserAddressBase {
|
|
13
|
-
placesId: string;
|
|
14
|
-
one: string;
|
|
15
|
-
two: string;
|
|
16
|
-
city: string;
|
|
17
|
-
state: string;
|
|
18
|
-
zip: string;
|
|
19
|
-
country: string;
|
|
20
|
-
lat: number;
|
|
21
|
-
long: number;
|
|
22
|
-
}
|
|
23
|
-
export interface IUserAddress extends IUserAddressBase {
|
|
24
|
-
id: string;
|
|
25
|
-
createdAt: Date;
|
|
26
|
-
updatedAt: Date;
|
|
27
|
-
isDefault?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface ISavedCard {
|
|
30
|
-
brand: string | null;
|
|
31
|
-
country: string | null;
|
|
32
|
-
expMonth: number | null;
|
|
33
|
-
expYear: number | null;
|
|
34
|
-
last4: string | null;
|
|
35
|
-
funding: string | null;
|
|
36
|
-
}
|
|
37
|
-
export interface IUserPayment {
|
|
38
|
-
id: string;
|
|
39
|
-
type: string;
|
|
40
|
-
isDefault: boolean;
|
|
41
|
-
card?: ISavedCard;
|
|
42
|
-
createdAt: Date;
|
|
43
|
-
}
|
|
44
|
-
export interface IUser {
|
|
45
|
-
id: string;
|
|
46
|
-
email: string;
|
|
47
|
-
firstName: string | null;
|
|
48
|
-
lastName: string | null;
|
|
49
|
-
phone: string | null;
|
|
50
|
-
company: string | null;
|
|
51
|
-
profileImage: string | null;
|
|
52
|
-
birthDate: string | null;
|
|
53
|
-
createdAt: Date;
|
|
54
|
-
updatedAt: Date;
|
|
55
|
-
addresses: IUserAddress[];
|
|
56
|
-
savedPayments: IUserPayment[];
|
|
57
|
-
session: IUserSession;
|
|
58
|
-
}
|
|
59
|
-
export type BaseUser = Omit<IUser, 'session'>;
|
|
60
|
-
export interface IUserSessionParams extends ICoreParams {
|
|
61
|
-
id?: string;
|
|
62
|
-
email?: string;
|
|
63
|
-
firstName?: string | null;
|
|
64
|
-
lastName?: string | null;
|
|
65
|
-
phone?: string | null;
|
|
66
|
-
company?: string | null;
|
|
67
|
-
profileImage?: string | null;
|
|
68
|
-
birthDate?: string | null;
|
|
69
|
-
}
|
|
70
|
-
export interface IUserPaymentSession {
|
|
71
|
-
cartId?: string;
|
|
72
|
-
checkoutToken?: string;
|
|
73
|
-
customerId?: string;
|
|
74
|
-
customerEmail?: string;
|
|
75
|
-
}
|
|
76
|
-
export interface IPurgeResponse {
|
|
77
|
-
deleted: boolean;
|
|
78
|
-
message: string;
|
|
79
|
-
}
|
|
80
|
-
export interface IUserAddressParams extends ICoreParams {
|
|
81
|
-
customerId: string;
|
|
82
|
-
placesId?: string;
|
|
83
|
-
one?: string;
|
|
84
|
-
two?: string;
|
|
85
|
-
city?: string;
|
|
86
|
-
state?: string;
|
|
87
|
-
zip?: string;
|
|
88
|
-
country?: string;
|
|
89
|
-
lat?: number;
|
|
90
|
-
long?: number;
|
|
91
|
-
type: AddressType;
|
|
92
|
-
isDefault?: boolean;
|
|
93
|
-
}
|
|
94
|
-
export interface IUserPaymentParams extends ICoreParams {
|
|
95
|
-
customerId: string;
|
|
96
|
-
paymentMethodId: string;
|
|
97
|
-
}
|
|
98
|
-
export interface IUserPaymentAddParams extends IUserPaymentParams {
|
|
99
|
-
isDefault?: boolean;
|
|
100
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { billingFormFields, customerFormFields, giftFormFields } from '@/modules/checkout/constant';
|
|
2
|
-
export type BillingFieldName = (typeof billingFormFields)[keyof typeof billingFormFields];
|
|
3
|
-
export type CustomerFieldName = (typeof customerFormFields)[keyof typeof customerFormFields];
|
|
4
|
-
export type GiftFieldName = (typeof giftFormFields)[keyof typeof giftFormFields];
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { CartEventEnum, CheckoutEventEnum } from 'enums';
|
|
2
|
-
import type { ICheckoutEvents } from 'interfaces/cloud';
|
|
3
|
-
import type { ICartEvent } from '@/interfaces/api/cart.interface';
|
|
4
|
-
export type ElementEventLevel = 'success' | 'warning' | 'error';
|
|
5
|
-
export interface IElementsCartEvent {
|
|
6
|
-
type: CartEventEnum;
|
|
7
|
-
message: string;
|
|
8
|
-
level: ElementEventLevel;
|
|
9
|
-
}
|
|
10
|
-
export interface IElementsCheckoutEvents {
|
|
11
|
-
type: CheckoutEventEnum;
|
|
12
|
-
message: string;
|
|
13
|
-
level: ElementEventLevel;
|
|
14
|
-
}
|
|
15
|
-
export declare const includeCartEvents: (events: ICartEvent[], eventTypes: CartEventEnum[]) => ICartEvent[];
|
|
16
|
-
export declare const excludeCartEvents: (events: ICartEvent[], eventTypes: CartEventEnum[]) => ICartEvent[];
|
|
17
|
-
export declare const eventsForCart: (events: ICartEvent[]) => ICartEvent[];
|
|
18
|
-
export declare const hasCartAnyPromoCodeEvents: (events: ICartEvent[]) => boolean;
|
|
19
|
-
export declare const includeCheckoutEvents: (events: ICheckoutEvents[], eventTypes: CheckoutEventEnum[]) => ICheckoutEvents[];
|
|
20
|
-
export declare const excludeCheckoutEvents: (events: ICheckoutEvents[], eventTypes: CheckoutEventEnum[]) => ICheckoutEvents[];
|
|
21
|
-
export declare const eventsForCheckout: (events: ICheckoutEvents[]) => ICheckoutEvents[];
|
|
22
|
-
export declare const promoCodeCheckoutEvents: (events: ICheckoutEvents[]) => ICheckoutEvents[];
|
|
23
|
-
export declare const giftCardCheckoutEvents: (events: ICheckoutEvents[]) => ICheckoutEvents[];
|
|
24
|
-
export declare const hasAnyRetailerGiftCardRestriction: (events: ICheckoutEvents[]) => boolean;
|
|
25
|
-
export declare const transformEventsForCart: (events: ICartEvent[]) => IElementsCartEvent[];
|
|
26
|
-
export declare const transformEventsForCheckout: (events: ICheckoutEvents[]) => IElementsCheckoutEvents[];
|
|
27
|
-
export declare const transformPromoCodeCheckoutEvents: (events: ICheckoutEvents[]) => IElementsCheckoutEvents[];
|
|
28
|
-
export declare const transformGiftCardCheckoutEvents: (events: ICheckoutEvents[]) => IElementsCheckoutEvents[];
|