@liquidcommerce/elements-sdk 2.6.0-beta.4 → 2.6.0-beta.40
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 +156 -2500
- package/dist/index.checkout.esm.js +16087 -0
- package/dist/index.esm.js +16301 -14189
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +22 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +11 -1
- package/dist/types/clients/checkout.d.ts +13 -0
- package/dist/types/constants/core.constant.d.ts +5 -3
- package/dist/types/core/api/api-client.service.d.ts +10 -12
- package/dist/types/core/api/auth-client.service.d.ts +31 -9
- package/dist/types/core/api/http-client.service.d.ts +0 -1
- package/dist/types/core/client/actions/base-action.service.d.ts +15 -0
- package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
- package/dist/types/core/client/actions/client-cart-action.service.d.ts +37 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +50 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +12 -0
- package/dist/types/core/client/client-action.service.d.ts +6 -70
- package/dist/types/core/client/client-config.service.d.ts +3 -2
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/google-tag-manager.service.d.ts +4 -1
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- 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 -75
- package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -56
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +17 -108
- package/dist/types/core/store/interfaces/core.interface.d.ts +18 -3
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +45 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +3 -1
- package/dist/types/core/store/store.constant.d.ts +4 -0
- package/dist/types/enums/core.enum.d.ts +38 -1
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +7 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/interfaces/api/cart.interface.d.ts +95 -0
- package/dist/types/interfaces/api/checkout.interface.d.ts +217 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +38 -0
- package/dist/types/interfaces/api/product.interface.d.ts +5 -7
- package/dist/types/interfaces/configs/checkout.interface.d.ts +1 -0
- package/dist/types/interfaces/configs/global.interface.d.ts +4 -2
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +28 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
- package/dist/types/interfaces/core.interface.d.ts +34 -6
- package/dist/types/modules/address/address-input.component.d.ts +11 -0
- package/dist/types/modules/address/address.command.d.ts +1 -0
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- 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/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +22 -9
- package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- 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/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/product.commands.d.ts +1 -0
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +8 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts +12 -0
- package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +13 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +10 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +9 -0
- package/dist/types/modules/product-list/components/card-components/product-title.d.ts +6 -0
- package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +14 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +1 -1
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +13 -0
- package/dist/types/modules/product-list/components/index.d.ts +7 -3
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +2 -1
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +10 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -37
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +28 -0
- package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +26 -0
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +22 -0
- package/dist/types/modules/product-list/product-list-card.component.d.ts +30 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +64 -4
- package/dist/types/modules/product-list/product-list.component.d.ts +16 -44
- package/dist/types/modules/product-list/product-list.constants.d.ts +39 -0
- package/dist/types/modules/product-list/product-list.interface.d.ts +37 -31
- package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
- package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -1
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +14 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +8 -1
- package/dist/types/modules/ui-components/modal/modal.component.d.ts +23 -0
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
- package/dist/types/modules/ui-components/styles/modal.style.d.ts +1 -0
- package/dist/types/modules/ui-components/ui.commands.d.ts +3 -1
- package/dist/types/static/icon/check.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/utils/format.d.ts +0 -14
- package/docs/actions.md +320 -0
- package/docs/address.md +242 -0
- package/docs/cart.md +387 -0
- package/docs/checkout.md +420 -0
- package/docs/{CONFIGURATION.md → configuration.md} +212 -48
- package/docs/events.md +181 -0
- package/docs/product-list.md +311 -0
- package/docs/product.md +250 -0
- package/docs/{THEMING.md → theming.md} +110 -20
- package/docs/{TROUBLESHOOTING.md → troubleshooting.md} +6 -6
- package/package.json +20 -13
- package/dist/types/enums/cloud.enum.d.ts +0 -403
- 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 -211
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -5
- 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-list/components/product-list-card.component.d.ts +0 -37
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
- package/dist/types/utils/helper.d.ts +0 -27
- package/docs/ACTIONS.md +0 -1300
- package/docs/DOCUMENTATION_INDEX.md +0 -311
- package/docs/EVENTS.md +0 -798
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
- /package/dist/types/{elements-builder-client.d.ts → clients/builder.d.ts} +0 -0
- /package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +0 -0
- /package/dist/types/{elements-client.d.ts → clients/main.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
- /package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
- /package/docs/{BROWSER_SUPPORT.md → browser-support.md} +0 -0
- /package/docs/{PROXY.md → proxy.md} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IInjectCheckoutParams, IInjectedComponent, ILiquidCommerceElementsDevelopmentConfig } from '@/interfaces/core.interface';
|
|
2
|
+
export declare const SHARED_ATTR: {
|
|
3
|
+
readonly SCRIPT: {
|
|
4
|
+
readonly CHECKOUT_PARAM: "data-checkout-param";
|
|
5
|
+
};
|
|
6
|
+
readonly ELEMENT: {
|
|
7
|
+
readonly CHECKOUT: "data-lce-checkout";
|
|
8
|
+
readonly HIDE_HEADER: "hide-header";
|
|
9
|
+
readonly EXIT_CHECKOUT: "data-lce-exit-checkout";
|
|
10
|
+
};
|
|
11
|
+
readonly JSON_SCRIPT: {
|
|
12
|
+
readonly DEVELOPMENT: "data-liquid-commerce-elements-development";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function startsWithLcePrefix(value: string | null): boolean;
|
|
16
|
+
export declare function getDevelopmentConfigs(): ILiquidCommerceElementsDevelopmentConfig | undefined;
|
|
17
|
+
export declare function triggerAutoInit(initFunction: () => Promise<void>, errorPrefix: string): void;
|
|
18
|
+
export declare function setupCheckout(script: HTMLScriptElement, injectFn: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>, exitCheckoutFn: () => void, options: {
|
|
19
|
+
requireCheckoutId?: boolean;
|
|
20
|
+
errorPrefix: string;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
export declare function setupExitCheckoutHandlers(exitCheckoutFn: () => void): void;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import '@/modules/theme-provider/styles/register-styles';
|
|
2
|
+
import '@/modules/address/styles/register-styles';
|
|
3
|
+
import '@/modules/cart/styles/register-styles';
|
|
4
|
+
import '@/modules/checkout/styles/register-styles';
|
|
5
|
+
import '@/modules/product/styles/register-styles';
|
|
6
|
+
import '@/modules/product-list/styles/register-styles';
|
|
1
7
|
import { ApiClientService } from '@/core/api/api-client.service';
|
|
2
8
|
import { AuthClientService } from '@/core/api/auth-client.service';
|
|
3
9
|
import { ClientActionService } from '@/core/client/client-action.service';
|
|
@@ -10,7 +16,7 @@ import { LoggerFactory } from '@/core/logger/logger-factory';
|
|
|
10
16
|
import { StoreService } from '@/core/store/store.service';
|
|
11
17
|
import { TelemetryService } from '@/core/telemetry/telemetry.service';
|
|
12
18
|
import { type ComponentType } from '@/enums';
|
|
13
|
-
import type {
|
|
19
|
+
import type { IInjectProductElement, IInjectProductListFiltersParams, IInjectProductListParams, IInjectProductListSearchParams, IInjectedComponent, ILiquidCommerceElementsActions, IProcessInjectElementParams } from '@/interfaces/core.interface';
|
|
14
20
|
import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
|
|
15
21
|
export declare abstract class ElementsBaseClient {
|
|
16
22
|
protected readonly authClient: AuthClientService;
|
|
@@ -28,6 +34,7 @@ export declare abstract class ElementsBaseClient {
|
|
|
28
34
|
protected clientPrepared: boolean;
|
|
29
35
|
protected componentFactoryInitialized: boolean;
|
|
30
36
|
protected cartDrawerCreated: boolean;
|
|
37
|
+
protected modalCreated: boolean;
|
|
31
38
|
protected injectedComponents: Map<string, IInjectedComponent>;
|
|
32
39
|
constructor(clientConfigs: IClientConfigs);
|
|
33
40
|
prepare(): Promise<void>;
|
|
@@ -38,7 +45,10 @@ export declare abstract class ElementsBaseClient {
|
|
|
38
45
|
protected processInjectElement(params: IProcessInjectElementParams): Promise<IInjectedComponent | null>;
|
|
39
46
|
protected processInjectProduct(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
40
47
|
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
48
|
+
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
|
|
49
|
+
injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
|
|
41
50
|
protected ensureCartDrawerExists(): void;
|
|
51
|
+
protected ensureModalExists(): void;
|
|
42
52
|
protected ensureAllComponentsRegistered(): void;
|
|
43
53
|
protected createInjectedComponentWrapper(containerId: string, type: ComponentType, element: HTMLElement): IInjectedComponent;
|
|
44
54
|
protected rerenderInjectedComponentsByType(type: ComponentType): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ICheckoutActions } from '@/core/client/actions/client-checkout-action.service';
|
|
2
|
+
import type { IInjectCheckoutParams, IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/core.interface';
|
|
3
|
+
import '@/modules/theme-provider/styles/register-styles';
|
|
4
|
+
import '@/modules/checkout/styles/register-styles';
|
|
5
|
+
export interface IElementsCheckoutActions extends Omit<ICheckoutActions, 'openCheckout' | 'closeCheckout' | 'toggleCheckout'> {
|
|
6
|
+
}
|
|
7
|
+
export interface IElementsCheckoutClient {
|
|
8
|
+
injectCheckout: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>;
|
|
9
|
+
actions: {
|
|
10
|
+
checkout: IElementsCheckoutActions;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function ElementsCheckout(apiKey: string, config: ILiquidCommerceElementsCheckoutClientConfig): Promise<IElementsCheckoutClient | null>;
|
|
@@ -7,9 +7,9 @@ export declare const PRODUCT_LIST_CARD_VARIANT: {
|
|
|
7
7
|
STANDARD: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const PRODUCT_LIST_FILTER_TYPES: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
ENGRAVING: string;
|
|
11
|
+
PRESALE: string;
|
|
12
|
+
FULFILLMENT: string;
|
|
13
13
|
PRICE: string;
|
|
14
14
|
BRANDS: string;
|
|
15
15
|
CATEGORIES: string;
|
|
@@ -45,4 +45,6 @@ export declare const Z_INDEX: {
|
|
|
45
45
|
readonly ADDRESS_ACTIONS: 5050;
|
|
46
46
|
readonly SKELETON_WAVE: 5040;
|
|
47
47
|
readonly CONTENT_OVERLAY: 5030;
|
|
48
|
+
readonly MODAL: 2147483640;
|
|
48
49
|
};
|
|
50
|
+
export declare const DESKTOP_BREAKPOINT = 1024;
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import type { AuthClientService } from '@/core/api/auth-client.service';
|
|
2
2
|
import type { IPersistedStore } from '@/core/store/interfaces/core.interface';
|
|
3
3
|
import type { IAddressAutocompleteResult, IAddressDetailsResult, ILocation } from '@/interfaces/api/address.interface';
|
|
4
|
+
import type { ICart, ICartUpdateParams } from '@/interfaces/api/cart.interface';
|
|
5
|
+
import type { ICheckoutComplete, ICheckoutItemsUpdateParams, ICheckoutItemsUpdateResponse, ICheckoutPaymentConfirm, ICheckoutPaymentConfirmParams, ICheckoutPaymentSession, ICheckoutPrepare, ICheckoutPrepareParams } from '@/interfaces/api/checkout.interface';
|
|
4
6
|
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
5
|
-
import type {
|
|
6
|
-
import type { IUserPaymentSession, IUserSession } from '@/interfaces/cloud/user.interface';
|
|
7
|
-
import type { IAllConfigs } from '@/interfaces/configs';
|
|
7
|
+
import type { IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
|
|
8
8
|
export declare class ApiClientService {
|
|
9
9
|
private client;
|
|
10
10
|
private readonly logger;
|
|
11
11
|
constructor();
|
|
12
12
|
static getInstance(): ApiClientService;
|
|
13
13
|
setClient(client: AuthClientService): Promise<void>;
|
|
14
|
-
getAllConfigs(): Promise<IAllConfigs>;
|
|
15
14
|
setPersistedStore(userDeviceId: string, data: IPersistedStore): Promise<void>;
|
|
16
15
|
getPersistedStore(userDeviceId: string): Promise<IPersistedStore | null>;
|
|
17
16
|
deletePersistedStore(userDeviceId: string): Promise<void>;
|
|
18
17
|
getAddressSuggestions(input: string): Promise<IAddressAutocompleteResult[]>;
|
|
19
18
|
getAddressDetails(id: string): Promise<IAddressDetailsResult>;
|
|
20
19
|
getProductsData(identifier: string[], location?: ILocation): Promise<IProductAvailabilityResponse | null>;
|
|
21
|
-
catalogSearch(params:
|
|
20
|
+
catalogSearch(params: IProductSearchParams): Promise<IProductSearchResponse>;
|
|
22
21
|
getCartData(id: string | null): Promise<ICart>;
|
|
23
|
-
updateCart(params: ICartUpdateParams
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
checkoutComplete(params: Partial<ICheckoutCompleteParams>): Promise<ICheckoutCompleteResponse>;
|
|
22
|
+
updateCart(params: ICartUpdateParams): Promise<ICart>;
|
|
23
|
+
prepareCheckout(params: ICheckoutPrepareParams): Promise<ICheckoutPrepare>;
|
|
24
|
+
updateCheckoutItems(params: ICheckoutItemsUpdateParams): Promise<ICheckoutItemsUpdateResponse>;
|
|
25
|
+
getPaymentSession(cartId: string): Promise<ICheckoutPaymentSession>;
|
|
26
|
+
confirmPaymentSession(params: ICheckoutPaymentConfirmParams): Promise<ICheckoutPaymentConfirm>;
|
|
27
|
+
checkoutComplete(token: string): Promise<ICheckoutComplete>;
|
|
30
28
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ElementsEnv } from '@/enums';
|
|
2
|
+
import type { IAllConfigs } from '@/interfaces/configs/global.interface';
|
|
2
3
|
export interface IAuthConfig {
|
|
3
4
|
apiKey: string;
|
|
4
5
|
env: ElementsEnv;
|
|
@@ -9,9 +10,8 @@ export interface IHttpRequestOptions {
|
|
|
9
10
|
body?: any;
|
|
10
11
|
}
|
|
11
12
|
export interface IAuth {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
type: 'ACCESS_TOKEN';
|
|
13
|
+
accessToken: string;
|
|
14
|
+
expiration: number;
|
|
15
15
|
}
|
|
16
16
|
export interface IApiResponseBase {
|
|
17
17
|
message: string;
|
|
@@ -20,23 +20,45 @@ export interface IApiResponse<T> {
|
|
|
20
20
|
message: string;
|
|
21
21
|
data: T;
|
|
22
22
|
}
|
|
23
|
+
export interface IAuthWithConfigs {
|
|
24
|
+
auth: IAuth;
|
|
25
|
+
configs: IAllConfigs;
|
|
26
|
+
}
|
|
23
27
|
export declare class AuthClientService {
|
|
28
|
+
private static readonly TOKEN_EXPIRATION_BUFFER_MS;
|
|
29
|
+
private static readonly MAX_RETRIES;
|
|
30
|
+
private static readonly RETRY_DELAY_MS;
|
|
24
31
|
private readonly apiKey;
|
|
25
32
|
private readonly baseUrl;
|
|
26
33
|
private readonly env;
|
|
27
|
-
private accessToken;
|
|
28
|
-
private tokenExpiration;
|
|
29
|
-
private isAuthenticating;
|
|
30
34
|
private readonly httpClient;
|
|
31
35
|
private readonly logger;
|
|
32
36
|
private readonly clientConfig;
|
|
37
|
+
private accessToken;
|
|
38
|
+
private tokenExpiration;
|
|
39
|
+
private authPromise;
|
|
40
|
+
private refreshPromise;
|
|
33
41
|
private constructor();
|
|
34
42
|
static getInstance(config: IAuthConfig): AuthClientService;
|
|
43
|
+
authenticateAndGetConfigs(): Promise<{
|
|
44
|
+
success: boolean;
|
|
45
|
+
configs?: IAllConfigs;
|
|
46
|
+
}>;
|
|
35
47
|
authenticate(): Promise<boolean>;
|
|
36
|
-
|
|
48
|
+
refreshToken(): Promise<boolean>;
|
|
49
|
+
get<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
50
|
+
post<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
51
|
+
private performAuthentication;
|
|
52
|
+
private performTokenRefresh;
|
|
37
53
|
private request;
|
|
54
|
+
private handleSuccessResponse;
|
|
55
|
+
private handleAuthError;
|
|
56
|
+
private handleErrorResponse;
|
|
57
|
+
private isTokenExpired;
|
|
58
|
+
private clearToken;
|
|
38
59
|
private buildUrl;
|
|
60
|
+
private buildHeaders;
|
|
39
61
|
private getProxyHeaders;
|
|
40
|
-
|
|
41
|
-
|
|
62
|
+
private isAuthError;
|
|
63
|
+
private shouldRetryNonAuth;
|
|
42
64
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ApiClientService } from '@/core/api/api-client.service';
|
|
2
|
+
import { LoggerFactory } from '@/core/logger/logger-factory';
|
|
3
|
+
import { PubSubService } from '@/core/pubsub/pubsub.service';
|
|
4
|
+
import { StoreService } from '@/core/store/store.service';
|
|
5
|
+
import type { ILocation } from '@/interfaces/api/address.interface';
|
|
6
|
+
import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
|
|
7
|
+
export declare abstract class BaseActionService {
|
|
8
|
+
protected readonly pubSub: PubSubService;
|
|
9
|
+
protected readonly store: StoreService;
|
|
10
|
+
protected readonly api: ApiClientService;
|
|
11
|
+
protected readonly themeProvider: ThemeProviderService;
|
|
12
|
+
protected readonly logger: ReturnType<typeof LoggerFactory.get>;
|
|
13
|
+
constructor(loggerName: string);
|
|
14
|
+
protected getLocation(): ILocation | undefined;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates, IAddressData } from '@/interfaces/api/address.interface';
|
|
2
|
+
import { BaseActionService } from './base-action.service';
|
|
3
|
+
export interface IAddressActions {
|
|
4
|
+
setAddressByPlacesId: (placesId: string) => Promise<void>;
|
|
5
|
+
setAddressManually: (address: IAddressAddress, coordinates: IAddressCoordinates) => Promise<void>;
|
|
6
|
+
clear: () => Promise<void>;
|
|
7
|
+
getDetails: () => IAddressData | null;
|
|
8
|
+
}
|
|
9
|
+
export declare class ClientAddressActionService extends BaseActionService {
|
|
10
|
+
private readonly command;
|
|
11
|
+
constructor();
|
|
12
|
+
static getInstance(): ClientAddressActionService;
|
|
13
|
+
get actions(): IAddressActions;
|
|
14
|
+
private setAddressByPlacesId;
|
|
15
|
+
private setAddressManually;
|
|
16
|
+
private clear;
|
|
17
|
+
private getDetails;
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
2
|
+
import { type FulfillmentType } from '@/enums';
|
|
3
|
+
import { BaseActionService } from './base-action.service';
|
|
4
|
+
export interface IAddProductParams {
|
|
5
|
+
identifier: string;
|
|
6
|
+
fulfillmentType: FulfillmentType;
|
|
7
|
+
quantity: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ICartActions {
|
|
10
|
+
openCart: () => void;
|
|
11
|
+
closeCart: () => void;
|
|
12
|
+
toggleCart: () => void;
|
|
13
|
+
addProduct: (params: IAddProductParams[], openCart?: boolean) => Promise<void>;
|
|
14
|
+
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
15
|
+
removePromoCode: () => Promise<void>;
|
|
16
|
+
resetCart: () => Promise<void>;
|
|
17
|
+
getDetails: () => IBaseCartEventData;
|
|
18
|
+
}
|
|
19
|
+
export declare class ClientCartActionService extends BaseActionService {
|
|
20
|
+
private readonly command;
|
|
21
|
+
private pendingCartParams;
|
|
22
|
+
private pendingCartOpenFlag;
|
|
23
|
+
constructor();
|
|
24
|
+
static getInstance(): ClientCartActionService;
|
|
25
|
+
get actions(): ICartActions;
|
|
26
|
+
private setupAddressUpdateListener;
|
|
27
|
+
private retryPendingCartOperation;
|
|
28
|
+
private clearPendingCartOperation;
|
|
29
|
+
private openCart;
|
|
30
|
+
private closeCart;
|
|
31
|
+
private toggleCart;
|
|
32
|
+
private addProduct;
|
|
33
|
+
private applyPromoCode;
|
|
34
|
+
private removePromoCode;
|
|
35
|
+
private resetCart;
|
|
36
|
+
private getDetails;
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
2
|
+
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/constant';
|
|
3
|
+
import { BaseActionService } from './base-action.service';
|
|
4
|
+
import type { IAddProductParams } from './client-cart-action.service';
|
|
5
|
+
export interface ICheckoutActions {
|
|
6
|
+
openCheckout: () => void;
|
|
7
|
+
closeCheckout: () => void;
|
|
8
|
+
toggleCheckout: () => void;
|
|
9
|
+
exitCheckout: () => void;
|
|
10
|
+
addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
|
|
11
|
+
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
12
|
+
removePromoCode: () => Promise<void>;
|
|
13
|
+
applyGiftCard: (code: string) => Promise<void>;
|
|
14
|
+
removeGiftCard: (code: string) => Promise<void>;
|
|
15
|
+
toggleIsGift: (active?: boolean) => Promise<void>;
|
|
16
|
+
toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
|
|
17
|
+
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => Promise<void>;
|
|
18
|
+
updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
|
|
19
|
+
updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
|
|
20
|
+
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
21
|
+
getDetails: () => ICheckoutDetailsEventData;
|
|
22
|
+
}
|
|
23
|
+
export declare class ClientCheckoutActionService extends BaseActionService {
|
|
24
|
+
private readonly command;
|
|
25
|
+
private readonly allowedCustomerFields;
|
|
26
|
+
private readonly allowedBillingFields;
|
|
27
|
+
private readonly allowedGiftFields;
|
|
28
|
+
private cartActionsAddProduct;
|
|
29
|
+
constructor();
|
|
30
|
+
static getInstance(): ClientCheckoutActionService;
|
|
31
|
+
setCartActionsAddProduct(addProductFn: (params: IAddProductParams[]) => Promise<void>): void;
|
|
32
|
+
get actions(): ICheckoutActions;
|
|
33
|
+
private normalizeCheckoutFieldValue;
|
|
34
|
+
private openCheckout;
|
|
35
|
+
private closeCheckout;
|
|
36
|
+
private toggleCheckout;
|
|
37
|
+
private exitCheckout;
|
|
38
|
+
private addProduct;
|
|
39
|
+
private applyPromoCode;
|
|
40
|
+
private removePromoCode;
|
|
41
|
+
private applyGiftCard;
|
|
42
|
+
private removeGiftCard;
|
|
43
|
+
private toggleIsGift;
|
|
44
|
+
private toggleBillingSameAsShipping;
|
|
45
|
+
private toggleMarketingPreferences;
|
|
46
|
+
private updateCustomerInfo;
|
|
47
|
+
private updateBillingInfo;
|
|
48
|
+
private updateGiftInfo;
|
|
49
|
+
private getDetails;
|
|
50
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
2
|
+
import { BaseActionService } from './base-action.service';
|
|
3
|
+
export interface IProductActions {
|
|
4
|
+
getDetails: (identifier: string) => IBaseProductEventData;
|
|
5
|
+
}
|
|
6
|
+
export declare class ClientProductActionService extends BaseActionService {
|
|
7
|
+
private readonly command;
|
|
8
|
+
constructor();
|
|
9
|
+
static getInstance(): ClientProductActionService;
|
|
10
|
+
get actions(): IProductActions;
|
|
11
|
+
private getDetails;
|
|
12
|
+
}
|
|
@@ -1,74 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
3
|
-
import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
4
|
-
import { type FulfillmentType } from '@/enums';
|
|
5
|
-
import type { IAddressAddress, IAddressCoordinates, IAddressData } from '@/interfaces/api/address.interface';
|
|
6
|
-
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
|
|
7
|
-
export interface IProductActions {
|
|
8
|
-
getDetails: (identifier: string) => IBaseProductEventData;
|
|
9
|
-
}
|
|
10
|
-
export interface IAddressActions {
|
|
11
|
-
setAddressByPlacesId: (placesId: string) => Promise<void>;
|
|
12
|
-
setAddressManually: (address: IAddressAddress, coordinates: IAddressCoordinates) => Promise<void>;
|
|
13
|
-
clear: () => Promise<void>;
|
|
14
|
-
getDetails: () => IAddressData | null;
|
|
15
|
-
}
|
|
16
|
-
export interface IAddProductParams {
|
|
17
|
-
identifier: string;
|
|
18
|
-
fulfillmentType: FulfillmentType;
|
|
19
|
-
quantity: number;
|
|
20
|
-
}
|
|
21
|
-
export interface ICartActions {
|
|
22
|
-
openCart: () => void;
|
|
23
|
-
closeCart: () => void;
|
|
24
|
-
toggleCart: () => void;
|
|
25
|
-
addProduct: (params: IAddProductParams[], openCart?: boolean) => Promise<void>;
|
|
26
|
-
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
27
|
-
removePromoCode: () => Promise<void>;
|
|
28
|
-
resetCart: () => Promise<void>;
|
|
29
|
-
getDetails: () => IBaseCartEventData;
|
|
30
|
-
}
|
|
31
|
-
export interface ICheckoutActions {
|
|
32
|
-
openCheckout: () => void;
|
|
33
|
-
closeCheckout: () => void;
|
|
34
|
-
toggleCheckout: () => void;
|
|
35
|
-
addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
|
|
36
|
-
addPresaleProduct: (params: IAddProductParams) => Promise<void>;
|
|
37
|
-
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
38
|
-
removePromoCode: () => Promise<void>;
|
|
39
|
-
applyGiftCard: (code: string) => Promise<void>;
|
|
40
|
-
removeGiftCard: (code: string) => Promise<void>;
|
|
41
|
-
toggleIsGift: (active?: boolean) => Promise<void>;
|
|
42
|
-
toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
|
|
43
|
-
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => Promise<void>;
|
|
44
|
-
updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
|
|
45
|
-
updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
|
|
46
|
-
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
47
|
-
getDetails: () => ICheckoutDetailsEventData;
|
|
48
|
-
}
|
|
1
|
+
import type { ILiquidCommerceElementsActions } from '@/interfaces/core.interface';
|
|
49
2
|
export declare class ClientActionService {
|
|
50
|
-
private readonly
|
|
51
|
-
private readonly
|
|
52
|
-
private readonly
|
|
53
|
-
private readonly
|
|
54
|
-
private readonly themeProvider;
|
|
55
|
-
private readonly logger;
|
|
56
|
-
private pendingCartParams;
|
|
57
|
-
private pendingCartOpenFlag;
|
|
3
|
+
private readonly productActionService;
|
|
4
|
+
private readonly addressActionService;
|
|
5
|
+
private readonly cartActionService;
|
|
6
|
+
private readonly checkoutActionService;
|
|
58
7
|
constructor();
|
|
59
8
|
static getInstance(): ClientActionService;
|
|
60
|
-
|
|
61
|
-
private retryPendingCartOperation;
|
|
62
|
-
private clearPendingCartOperation;
|
|
63
|
-
private getLocation;
|
|
64
|
-
private productActions;
|
|
65
|
-
private addressActions;
|
|
66
|
-
private cartActions;
|
|
67
|
-
private checkoutActions;
|
|
68
|
-
actions: {
|
|
69
|
-
product: IProductActions;
|
|
70
|
-
address: IAddressActions;
|
|
71
|
-
cart: ICartActions;
|
|
72
|
-
checkout: ICheckoutActions;
|
|
73
|
-
};
|
|
9
|
+
get actions(): ILiquidCommerceElementsActions;
|
|
74
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DebugMode, type ElementsEnv } from '@/enums';
|
|
2
2
|
import type { IPromoTicker } from '@/interfaces/configs';
|
|
3
|
-
import type { IClientCustomThemeConfig, IElementsProxyConfig } from '@/interfaces/core.interface';
|
|
3
|
+
import type { IClientCustomThemeConfig, IElementsProxyConfig, ILiquidCommerceElementsCheckoutConfig } from '@/interfaces/core.interface';
|
|
4
4
|
export type DeviceType = 'desktop' | 'tablet' | 'mobile';
|
|
5
5
|
export interface IClientConfigs {
|
|
6
6
|
apiKey: string;
|
|
@@ -22,6 +22,7 @@ export interface IClientConfigs {
|
|
|
22
22
|
paymentMethodId?: string;
|
|
23
23
|
openShadowDom?: boolean;
|
|
24
24
|
hasCustomApiUrl?: boolean;
|
|
25
|
+
checkout: ILiquidCommerceElementsCheckoutConfig | null;
|
|
25
26
|
}
|
|
26
27
|
export interface IClientConfigInput {
|
|
27
28
|
env?: ElementsEnv;
|
|
@@ -35,6 +36,7 @@ export interface IClientConfigInput {
|
|
|
35
36
|
paymentMethodId?: string;
|
|
36
37
|
openShadowDom?: boolean;
|
|
37
38
|
};
|
|
39
|
+
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
38
40
|
}
|
|
39
41
|
export declare class ClientConfigService {
|
|
40
42
|
private config;
|
|
@@ -52,7 +54,6 @@ export declare class ClientConfigService {
|
|
|
52
54
|
debuggingDisabled(): boolean;
|
|
53
55
|
hasCustomTheme(): boolean;
|
|
54
56
|
isMobile(): boolean;
|
|
55
|
-
isLocalStorageAvailable(): boolean;
|
|
56
57
|
getProxyConfig(): IElementsProxyConfig | null;
|
|
57
58
|
private validateInputs;
|
|
58
59
|
private buildConfiguration;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ICart } from '@/interfaces/
|
|
1
|
+
import type { ICart } from '@/interfaces/api/cart.interface';
|
|
2
2
|
import { BaseCommand } from './base-command.service';
|
|
3
3
|
export declare class CommonCommands extends BaseCommand {
|
|
4
4
|
static getInstance(): CommonCommands;
|
|
5
5
|
syncCartFromResponse(cartApi: ICart, publishEvent?: boolean): void;
|
|
6
|
+
private buildCartLoadedEventData;
|
|
6
7
|
loadCart(): Promise<void>;
|
|
7
8
|
}
|
|
@@ -6,6 +6,7 @@ declare global {
|
|
|
6
6
|
}
|
|
7
7
|
interface GTMConfig {
|
|
8
8
|
partnerName: string;
|
|
9
|
+
partnerCode: string;
|
|
9
10
|
partnerGTMId?: string;
|
|
10
11
|
enablePartnerGTM: boolean;
|
|
11
12
|
enableLiquidCommerceGTM: boolean;
|
|
@@ -32,6 +33,7 @@ interface BaseItem {
|
|
|
32
33
|
quantity?: number;
|
|
33
34
|
item_type?: string;
|
|
34
35
|
item_subtype?: string;
|
|
36
|
+
item_image?: string;
|
|
35
37
|
upc?: string;
|
|
36
38
|
grouping_id?: string;
|
|
37
39
|
product_id?: string;
|
|
@@ -47,6 +49,7 @@ interface PurchaseData {
|
|
|
47
49
|
}
|
|
48
50
|
export declare class GoogleTagManagerService {
|
|
49
51
|
private partnerName?;
|
|
52
|
+
private partnerCode?;
|
|
50
53
|
private partnerGTMId?;
|
|
51
54
|
private liquidCommerceGTMId?;
|
|
52
55
|
private enablePartnerGTM;
|
|
@@ -91,7 +94,7 @@ export declare class GoogleTagManagerService {
|
|
|
91
94
|
net_total?: number;
|
|
92
95
|
}): void;
|
|
93
96
|
promoCodeAttempt(code: string): void;
|
|
94
|
-
promoCodeApplied(code: string,
|
|
97
|
+
promoCodeApplied(code: string, discount?: number): void;
|
|
95
98
|
promoCodeFailed(code: string, reason?: string): void;
|
|
96
99
|
giftCardAttempt(code: string): void;
|
|
97
100
|
giftCardApplied(code: string, appliedAmount?: number): void;
|
|
@@ -13,6 +13,6 @@ export declare class LoggerService {
|
|
|
13
13
|
debug(message: string, data?: Record<string, any>): void;
|
|
14
14
|
info(message: string, data?: Record<string, any>): void;
|
|
15
15
|
warn(message: string, data?: Record<string, any>): void;
|
|
16
|
-
error(message: string,
|
|
16
|
+
error(message: string, errorOrData?: Error | Record<string, any>): void;
|
|
17
17
|
private sendToTelemetry;
|
|
18
18
|
}
|
|
@@ -1,67 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
variantId: string;
|
|
5
|
-
liquidId: string;
|
|
6
|
-
retailerId: string;
|
|
7
|
-
partNumber: string;
|
|
8
|
-
fulfillmentId: string;
|
|
9
|
-
upc: string;
|
|
10
|
-
sku: string;
|
|
11
|
-
salsifyGrouping: string;
|
|
12
|
-
catPath: string;
|
|
13
|
-
volume: string;
|
|
14
|
-
uom: string;
|
|
15
|
-
pack: boolean;
|
|
16
|
-
packDesc: string;
|
|
17
|
-
container: string;
|
|
18
|
-
containerType: string;
|
|
19
|
-
name: string;
|
|
20
|
-
brand: string;
|
|
21
|
-
size: string;
|
|
22
|
-
price: number;
|
|
23
|
-
quantity: number;
|
|
24
|
-
maxQuantity: number;
|
|
25
|
-
unitPrice: number;
|
|
26
|
-
mainImage: string;
|
|
27
|
-
attributes: ICartItemAttributes;
|
|
28
|
-
}
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
2
|
+
import type { ICartItem, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
29
3
|
export interface IBaseCartEventData {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
4
|
+
cartId: string;
|
|
5
|
+
promoCodeDiscount: number | null;
|
|
6
|
+
subtotal: number;
|
|
7
|
+
itemCount: number;
|
|
8
|
+
items: Record<string, ICartItem>;
|
|
9
|
+
retailers: Record<string, ICartRetailer>;
|
|
33
10
|
location: {
|
|
34
11
|
placesId: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
state: string;
|
|
40
|
-
zip: string;
|
|
41
|
-
country: string;
|
|
42
|
-
};
|
|
43
|
-
coordinates: {
|
|
44
|
-
latitude: number;
|
|
45
|
-
longitude: number;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
amounts: {
|
|
49
|
-
deliveryFee: number;
|
|
50
|
-
discounts: number;
|
|
51
|
-
engravingFee: number;
|
|
52
|
-
giftCardTotal: number;
|
|
53
|
-
platformFee: number;
|
|
54
|
-
shippingFee: number;
|
|
55
|
-
subtotal: number;
|
|
56
|
-
total: number;
|
|
57
|
-
};
|
|
58
|
-
itemCount: number;
|
|
59
|
-
updatedAt: string;
|
|
60
|
-
createdAt: string;
|
|
12
|
+
formattedAddress: string;
|
|
13
|
+
address: IAddressAddress;
|
|
14
|
+
coordinates: IAddressCoordinates;
|
|
15
|
+
} | null;
|
|
61
16
|
}
|
|
62
17
|
export interface ICartLoadedEventData extends IBaseCartEventData {
|
|
63
18
|
}
|
|
64
19
|
export interface ICartFailedEventData {
|
|
20
|
+
cartId: string;
|
|
65
21
|
message: string;
|
|
66
22
|
}
|
|
67
23
|
export interface ICartUpdatedEventData {
|
|
@@ -69,38 +25,45 @@ export interface ICartUpdatedEventData {
|
|
|
69
25
|
current: IBaseCartEventData;
|
|
70
26
|
}
|
|
71
27
|
export interface ICartItemAddedEventData {
|
|
72
|
-
|
|
73
|
-
|
|
28
|
+
cartId: string;
|
|
29
|
+
itemId: string;
|
|
74
30
|
fulfillmentId: string;
|
|
75
31
|
partNumber: string;
|
|
76
32
|
quantity: number;
|
|
77
33
|
engravingLines?: string[];
|
|
78
34
|
}
|
|
79
35
|
export interface ICartItemRemovedEventData {
|
|
80
|
-
|
|
36
|
+
cartId: string;
|
|
37
|
+
itemId: string;
|
|
81
38
|
}
|
|
82
39
|
export interface ICartItemQuantityChangedEventData {
|
|
83
|
-
|
|
40
|
+
cartId: string;
|
|
41
|
+
itemId: string;
|
|
84
42
|
quantity: number;
|
|
85
43
|
previousQuantity: number;
|
|
86
44
|
}
|
|
87
45
|
export interface ICartItemEngravingUpdatedEventData {
|
|
88
|
-
|
|
46
|
+
cartId: string;
|
|
47
|
+
itemId: string;
|
|
89
48
|
engravingLines: string[];
|
|
90
49
|
previousEngravingLines: string[];
|
|
91
50
|
}
|
|
92
51
|
export interface ICartPromoCodeEventData {
|
|
93
|
-
|
|
94
|
-
|
|
52
|
+
cartId: string;
|
|
53
|
+
discount?: number;
|
|
54
|
+
newSubtotal?: number;
|
|
95
55
|
}
|
|
96
56
|
export interface ICartPromoCodeFailedEventData {
|
|
57
|
+
cartId: string;
|
|
97
58
|
error: string;
|
|
98
59
|
}
|
|
99
60
|
export interface ICartProductAddEventData {
|
|
61
|
+
cartId: string;
|
|
100
62
|
itemsAdded: number;
|
|
101
63
|
identifiers: string[];
|
|
102
64
|
}
|
|
103
65
|
export interface ICartProductAddFailedEventData {
|
|
66
|
+
cartId: string;
|
|
104
67
|
identifiers: string[];
|
|
105
68
|
error: string;
|
|
106
69
|
}
|