@liquidcommerce/elements-sdk 2.1.0-beta.49
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/LICENSE +24 -0
- package/README.md +1183 -0
- package/dist/index.esm.js +16834 -0
- package/dist/types/auto-initialize.d.ts +2 -0
- package/dist/types/constants/core.constant.d.ts +6 -0
- package/dist/types/constants/index.d.ts +2 -0
- package/dist/types/constants/z-index.constant.d.ts +24 -0
- package/dist/types/core/auth.service.d.ts +29 -0
- package/dist/types/core/base-component.service.d.ts +93 -0
- package/dist/types/core/client/client-action.service.d.ts +70 -0
- package/dist/types/core/client/client-config.service.d.ts +47 -0
- package/dist/types/core/command/base-command.service.d.ts +17 -0
- package/dist/types/core/command/command.service.d.ts +16 -0
- package/dist/types/core/command/common-command.service.d.ts +5 -0
- package/dist/types/core/component-factory.service.d.ts +27 -0
- package/dist/types/core/fingerprint.service.d.ts +28 -0
- package/dist/types/core/google-tag-manager.service.d.ts +93 -0
- package/dist/types/core/logger/logger-factory.d.ts +8 -0
- package/dist/types/core/logger/logger.service.d.ts +17 -0
- package/dist/types/core/pubsub/index.d.ts +2 -0
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +16 -0
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +107 -0
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +84 -0
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +81 -0
- package/dist/types/core/pubsub/interfaces/index.d.ts +5 -0
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +91 -0
- package/dist/types/core/pubsub/pubsub.service.d.ts +12 -0
- package/dist/types/core/singleton-manager.service.d.ts +12 -0
- package/dist/types/core/store/index.d.ts +2 -0
- package/dist/types/core/store/interfaces/address.interface.d.ts +16 -0
- package/dist/types/core/store/interfaces/cart.interface.d.ts +94 -0
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +154 -0
- package/dist/types/core/store/interfaces/core.interface.d.ts +40 -0
- package/dist/types/core/store/interfaces/index.d.ts +5 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +81 -0
- package/dist/types/core/store/store.constant.d.ts +8 -0
- package/dist/types/core/store/store.service.d.ts +41 -0
- package/dist/types/core/utils.d.ts +27 -0
- package/dist/types/elements-client-helper.d.ts +1 -0
- package/dist/types/elements-client.d.ts +2 -0
- package/dist/types/enums/cloud.enum.d.ts +77 -0
- package/dist/types/enums/core.enum.d.ts +134 -0
- package/dist/types/enums/index.d.ts +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.umd.d.ts +2 -0
- package/dist/types/interfaces/cloud/address.interface.d.ts +36 -0
- package/dist/types/interfaces/cloud/cart.interface.d.ts +132 -0
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +214 -0
- package/dist/types/interfaces/cloud/core.interface.d.ts +22 -0
- package/dist/types/interfaces/cloud/index.d.ts +6 -0
- package/dist/types/interfaces/cloud/product.interface.d.ts +156 -0
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +66 -0
- package/dist/types/interfaces/cloud/user.interface.d.ts +100 -0
- package/dist/types/interfaces/configs/address.interface.d.ts +8 -0
- package/dist/types/interfaces/configs/cart.interface.d.ts +15 -0
- package/dist/types/interfaces/configs/checkout.interface.d.ts +34 -0
- package/dist/types/interfaces/configs/configurations.interface.d.ts +13 -0
- package/dist/types/interfaces/configs/global.interface.d.ts +46 -0
- package/dist/types/interfaces/configs/index.d.ts +6 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +25 -0
- package/dist/types/interfaces/core.interface.d.ts +81 -0
- package/dist/types/modules/address/address-display.component.d.ts +13 -0
- package/dist/types/modules/address/address-input.component.d.ts +40 -0
- package/dist/types/modules/address/address.command.d.ts +15 -0
- package/dist/types/modules/address/address.component.d.ts +12 -0
- package/dist/types/modules/address/address.interface.d.ts +10 -0
- package/dist/types/modules/address/index.d.ts +4 -0
- package/dist/types/modules/api-client/api-client.interface.d.ts +21 -0
- package/dist/types/modules/api-client/api-client.service.d.ts +28 -0
- package/dist/types/modules/api-client/index.d.ts +2 -0
- package/dist/types/modules/cart/cart.commands.d.ts +36 -0
- package/dist/types/modules/cart/cart.commands.helper.d.ts +8 -0
- package/dist/types/modules/cart/cart.component.d.ts +11 -0
- package/dist/types/modules/cart/components/cart-body.component.d.ts +24 -0
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +21 -0
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +26 -0
- package/dist/types/modules/cart/components/cart-header.component.d.ts +6 -0
- package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +21 -0
- package/dist/types/modules/cart/components/cart-item.component.d.ts +13 -0
- package/dist/types/modules/cart/components/cart-promo-code.component.d.ts +17 -0
- package/dist/types/modules/cart/components/cart-retailer-subtotal.component.d.ts +10 -0
- package/dist/types/modules/cart/components/cart-retailer.component.d.ts +23 -0
- package/dist/types/modules/cart/components/index.d.ts +8 -0
- package/dist/types/modules/cart/index.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +50 -0
- package/dist/types/modules/checkout/checkout.commands.helper.d.ts +13 -0
- package/dist/types/modules/checkout/checkout.component.d.ts +11 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +9 -0
- package/dist/types/modules/checkout/components/checkout-information-section.component.d.ts +12 -0
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +26 -0
- package/dist/types/modules/checkout/components/checkout-summary-section.component.d.ts +12 -0
- package/dist/types/modules/checkout/components/checkout.type.d.ts +4 -0
- package/dist/types/modules/checkout/components/index.d.ts +20 -0
- package/dist/types/modules/checkout/components/information/checkout-billing-form.component.d.ts +18 -0
- package/dist/types/modules/checkout/components/information/checkout-buyer-information-form.component.d.ts +12 -0
- package/dist/types/modules/checkout/components/information/checkout-delivery-information-form.component.d.ts +17 -0
- package/dist/types/modules/checkout/components/information/checkout-payment-form.component.d.ts +21 -0
- package/dist/types/modules/checkout/components/information/checkout-stripe-form.component.d.ts +52 -0
- package/dist/types/modules/checkout/components/summary/checkout-amounts.component.d.ts +7 -0
- package/dist/types/modules/checkout/components/summary/checkout-completed.component.d.ts +12 -0
- package/dist/types/modules/checkout/components/summary/checkout-gift-cards.component.d.ts +14 -0
- package/dist/types/modules/checkout/components/summary/checkout-item-quantity.component.d.ts +19 -0
- package/dist/types/modules/checkout/components/summary/checkout-item.component.d.ts +21 -0
- package/dist/types/modules/checkout/components/summary/checkout-items.component.d.ts +16 -0
- package/dist/types/modules/checkout/components/summary/checkout-place-order-button.component.d.ts +23 -0
- package/dist/types/modules/checkout/components/summary/checkout-presale-expired.component.d.ts +16 -0
- package/dist/types/modules/checkout/components/summary/checkout-promo-code.component.d.ts +17 -0
- package/dist/types/modules/checkout/components/summary/checkout-tips.component.d.ts +19 -0
- package/dist/types/modules/checkout/components/summary/promo-pc-gc.component.d.ts +16 -0
- package/dist/types/modules/checkout/constant.d.ts +32 -0
- package/dist/types/modules/checkout/index.d.ts +1 -0
- package/dist/types/modules/product/components/components.d.ts +20 -0
- package/dist/types/modules/product/components/index.d.ts +13 -0
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +26 -0
- package/dist/types/modules/product/components/product-description.component.d.ts +9 -0
- package/dist/types/modules/product/components/product-drawer.component.d.ts +19 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +36 -0
- package/dist/types/modules/product/components/product-interactions.component.d.ts +14 -0
- package/dist/types/modules/product/components/product-options.component.d.ts +12 -0
- package/dist/types/modules/product/components/product-price.component.d.ts +11 -0
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +32 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +13 -0
- package/dist/types/modules/product/components/product-retailers-popup.component.d.ts +11 -0
- package/dist/types/modules/product/components/product-retailers.component.d.ts +11 -0
- package/dist/types/modules/product/constant.d.ts +2 -0
- package/dist/types/modules/product/index.d.ts +1 -0
- package/dist/types/modules/product/product.commands.d.ts +29 -0
- package/dist/types/modules/product/product.component.d.ts +13 -0
- package/dist/types/modules/product/utils/helpers.d.ts +10 -0
- package/dist/types/modules/product/utils/index.d.ts +2 -0
- package/dist/types/modules/product/utils/retailer-hours.d.ts +9 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +7 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +2 -0
- package/dist/types/modules/theme-provider/index.d.ts +2 -0
- package/dist/types/modules/theme-provider/services/css-variable-processor.service.d.ts +20 -0
- package/dist/types/modules/theme-provider/services/font-manager.service.d.ts +9 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +13 -0
- package/dist/types/modules/theme-provider/styles/address/address.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/cart/cart.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/checkout/checkout.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/global.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/product/image-carousel.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +3 -0
- package/dist/types/modules/theme-provider/styles/product/product.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/product/retailers.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/ui/drawer.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +3 -0
- package/dist/types/modules/theme-provider/styles/ui/loading.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/ui/promo-code-ticker.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +22 -0
- package/dist/types/modules/ui-components/alert/alert.component.d.ts +24 -0
- package/dist/types/modules/ui-components/alert/index.d.ts +1 -0
- package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +11 -0
- package/dist/types/modules/ui-components/buttons/index.d.ts +1 -0
- package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +23 -0
- package/dist/types/modules/ui-components/drawer/index.d.ts +1 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +24 -0
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +19 -0
- package/dist/types/modules/ui-components/engraving/index.d.ts +2 -0
- package/dist/types/modules/ui-components/error-view/error-view.d.ts +9 -0
- package/dist/types/modules/ui-components/error-view/index.d.ts +1 -0
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +51 -0
- package/dist/types/modules/ui-components/input/index.d.ts +2 -0
- package/dist/types/modules/ui-components/input/input.component.d.ts +46 -0
- package/dist/types/modules/ui-components/lce-element/index.d.ts +1 -0
- package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +11 -0
- package/dist/types/modules/ui-components/loading/index.d.ts +1 -0
- package/dist/types/modules/ui-components/loading/product-loading.component.d.ts +6 -0
- package/dist/types/modules/ui-components/powered-by/index.d.ts +1 -0
- package/dist/types/modules/ui-components/powered-by/powered-by.component.d.ts +13 -0
- package/dist/types/modules/ui-components/promo-code-ticker/index.d.ts +1 -0
- package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +17 -0
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +8 -0
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +2 -0
- package/dist/types/modules/ui-components/purchase-min-alert/purchase-min-alert.component.d.ts +16 -0
- package/dist/types/modules/ui-components/ui.commands.d.ts +7 -0
- package/dist/types/static/icon/arrow-right.icon.d.ts +2 -0
- package/dist/types/static/icon/bag.icon.d.ts +2 -0
- package/dist/types/static/icon/checkbox.icon.d.ts +2 -0
- package/dist/types/static/icon/chevron-down.icon.d.ts +2 -0
- package/dist/types/static/icon/chevron-left.icon.d.ts +2 -0
- package/dist/types/static/icon/close.icon.d.ts +2 -0
- package/dist/types/static/icon/completed.icon.d.ts +2 -0
- package/dist/types/static/icon/error-info.icon.d.ts +2 -0
- package/dist/types/static/icon/icon.types.d.ts +6 -0
- package/dist/types/static/icon/index.d.ts +15 -0
- package/dist/types/static/icon/info.icon.d.ts +2 -0
- package/dist/types/static/icon/loading-spinner.icon.d.ts +2 -0
- package/dist/types/static/icon/search.icon.d.ts +2 -0
- package/dist/types/static/icon/success.icon.d.ts +2 -0
- package/dist/types/static/icon/trash.icon.d.ts +2 -0
- package/dist/types/static/icon/warning.icon.d.ts +2 -0
- package/dist/types/utils/dom-polyfills.d.ts +10 -0
- package/dist/types/utils/format.d.ts +23 -0
- package/dist/types/utils/helper.d.ts +27 -0
- package/dist/types/utils/html-sanitizer.d.ts +2 -0
- package/package.json +110 -0
- package/umd/elements.js +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IAddressStore, ICartStore, ICheckoutStore, IGlobalStore, IProductStore, IUIStore } from '@/core/store/interfaces';
|
|
2
|
+
export declare const LOCAL_STORAGE_PREFIX = "liquid_elements";
|
|
3
|
+
export declare const initialProductState: IProductStore;
|
|
4
|
+
export declare const initialCartState: ICartStore;
|
|
5
|
+
export declare const initialCheckoutState: ICheckoutStore;
|
|
6
|
+
export declare const initialUIState: IUIStore;
|
|
7
|
+
export declare const initialAddressState: IAddressStore;
|
|
8
|
+
export declare const initialStoreState: IGlobalStore;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
+
import type { IGlobalStore, IPersistedStore, IProductStore, StorePaths } from '@/core/store/interfaces';
|
|
3
|
+
export declare class StoreService {
|
|
4
|
+
private state;
|
|
5
|
+
private listeners;
|
|
6
|
+
private middleware;
|
|
7
|
+
private saveTimeout?;
|
|
8
|
+
private localStorageKey?;
|
|
9
|
+
private isLocalStorageAvailable;
|
|
10
|
+
private readonly logger;
|
|
11
|
+
private readonly clientConfig;
|
|
12
|
+
private readonly api;
|
|
13
|
+
constructor();
|
|
14
|
+
static getInstance(): StoreService;
|
|
15
|
+
initialize({ userDeviceId, isLocalStorageAvailable, persistedStore, }: {
|
|
16
|
+
userDeviceId: string;
|
|
17
|
+
isLocalStorageAvailable: boolean;
|
|
18
|
+
persistedStore: IPersistedStore | null;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
get<T = any>(path: StorePaths): T;
|
|
21
|
+
set<T = any>(path: StorePaths, value: T): boolean;
|
|
22
|
+
update<T = any>(path: StorePaths, updater: (current: T) => T): boolean;
|
|
23
|
+
remove(path: StorePaths): boolean;
|
|
24
|
+
batch(updates: Record<string, any> | ((state: IGlobalStore) => Record<string, any>)): boolean;
|
|
25
|
+
watch(path: StorePaths, callback: (value: any, oldValue: any) => void): () => void;
|
|
26
|
+
watchMany(paths: StorePaths[], callback: (changes: IOnStoreChanged[]) => void): () => void;
|
|
27
|
+
createProductInstance(productId: string): boolean;
|
|
28
|
+
removeProductInstance(productId: string): boolean;
|
|
29
|
+
getProductInstances(): Record<string, IProductStore>;
|
|
30
|
+
getState(): IGlobalStore;
|
|
31
|
+
private setupMiddleware;
|
|
32
|
+
private loggingMiddleware;
|
|
33
|
+
private performanceMiddleware;
|
|
34
|
+
private runWithMiddleware;
|
|
35
|
+
private immutableSet;
|
|
36
|
+
private notifyListeners;
|
|
37
|
+
private debouncedSave;
|
|
38
|
+
private saveStore;
|
|
39
|
+
private loadPersistedState;
|
|
40
|
+
private getAddressDataFromId;
|
|
41
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type FetchFunction = typeof fetch;
|
|
2
|
+
export interface IHttpClientOptions {
|
|
3
|
+
method: string;
|
|
4
|
+
headers: Record<string, string>;
|
|
5
|
+
body?: string;
|
|
6
|
+
}
|
|
7
|
+
export type HttpClient = (url: string, options: IHttpClientOptions) => Promise<ICustomResponse>;
|
|
8
|
+
export interface IRequestOptions {
|
|
9
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
body?: any;
|
|
12
|
+
}
|
|
13
|
+
export interface ICustomResponse {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
status: number;
|
|
16
|
+
statusText: string;
|
|
17
|
+
headers: Record<string, string>;
|
|
18
|
+
json: () => Promise<any>;
|
|
19
|
+
text: () => Promise<string>;
|
|
20
|
+
}
|
|
21
|
+
export declare function fetchAdapter(fetchFunc: FetchFunction): HttpClient;
|
|
22
|
+
export declare const xhrFetch: HttpClient;
|
|
23
|
+
export declare function getFetchImplementation(): HttpClient;
|
|
24
|
+
export declare function objectValues<T>(obj: Record<string, T>): T[];
|
|
25
|
+
export declare function objectEntries<T>(obj: Record<string, T>): Array<[string, T]>;
|
|
26
|
+
export declare function arrayFind<T>(array: T[], predicate: (item: T, index: number, array: T[]) => boolean): T | undefined;
|
|
27
|
+
export declare function arrayFindIndex<T>(array: T[], predicate: (item: T, index: number, array: T[]) => boolean): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deepMergeConfigs<T extends Record<string, any>>(target: T, source: Partial<T>): T;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare enum DAYS_OF_WEEK {
|
|
2
|
+
MONDAY = "monday",
|
|
3
|
+
TUESDAY = "tuesday",
|
|
4
|
+
WEDNESDAY = "wednesday",
|
|
5
|
+
THURSDAY = "thursday",
|
|
6
|
+
FRIDAY = "friday",
|
|
7
|
+
SATURDAY = "saturday",
|
|
8
|
+
SUNDAY = "sunday"
|
|
9
|
+
}
|
|
10
|
+
export declare const CART_EVENT_ENUM: {
|
|
11
|
+
readonly OOS: "OutOfStock";
|
|
12
|
+
readonly ITEMS_NOT_ADDED: "ItemsNotAdded";
|
|
13
|
+
readonly ITEMS_REQUESTED_NOT_ADDED: "ItemsRequestedNotAdded";
|
|
14
|
+
readonly ITEM_NOT_ENGRAVED: "ItemEngravingError";
|
|
15
|
+
readonly ADDRESS_CHANGE: "AddressChange";
|
|
16
|
+
readonly LOCATION_AVAILABILITY: "LocationAvailability";
|
|
17
|
+
readonly PARTNER_PRODUCT_CONFIGS: "PartnerProductConfigs";
|
|
18
|
+
readonly REMOVED_EXISTING_ITEMS: "RemovedExistingCartItems";
|
|
19
|
+
readonly RETAILER_MIN: "RetailerMinNotMet";
|
|
20
|
+
readonly NO_ITEMS_IN_CART: "NoItemsInCart";
|
|
21
|
+
readonly INVALID_ID: "InvalidId";
|
|
22
|
+
readonly NO_ID: "NoId";
|
|
23
|
+
readonly CART_CHECKOUT_PROCESSED: "CartCheckoutProcessed";
|
|
24
|
+
readonly NEW_CART: "NewCart";
|
|
25
|
+
readonly DEFAULT: "CartError";
|
|
26
|
+
readonly ITEM_QTY_CHANGE: "ItemQuantityChange";
|
|
27
|
+
readonly ITEM_ID_NOT_FOUND: "ItemIdNotFound";
|
|
28
|
+
readonly ITEMS_REMOVED: "ItemsRemoved";
|
|
29
|
+
readonly COUPON_PROCESSING_ERROR: "CouponProcessingError";
|
|
30
|
+
readonly COUPON_NOT_FOUND: "CouponNotFound";
|
|
31
|
+
readonly COUPON_EXPIRED: "CouponExpired";
|
|
32
|
+
readonly NO_APPLICABLE_DISCOUNT: "NoApplicableDiscount";
|
|
33
|
+
readonly COUPON_NOT_STARTED: "CouponNotStarted";
|
|
34
|
+
readonly MINIMUM_ORDER_VALUE_NOT_MET: "MinimumOrderValueNotMet";
|
|
35
|
+
readonly MINIMUM_ORDER_UNITS_NOT_MET: "MinimumOrderUnitsNotMet";
|
|
36
|
+
readonly MINIMUM_DISTINCT_ITEMS_NOT_MET: "MinimumDistinctItemsNotMet";
|
|
37
|
+
readonly QUOTA_EXCEEDED: "QuotaExceeded";
|
|
38
|
+
readonly USER_LIMIT_EXCEEDED: "UserLimitExceeded";
|
|
39
|
+
readonly NOT_FIRST_PURCHASE: "NotFirstPurchase";
|
|
40
|
+
readonly INVALID_COUPON: "InvalidCoupon";
|
|
41
|
+
readonly INVALID_MEMBERSHIP: "InvalidMembership";
|
|
42
|
+
readonly INVALID_DOMAIN: "InvalidDomain";
|
|
43
|
+
readonly INVALID_REQUIREMENTS: "InvalidRequirements";
|
|
44
|
+
readonly INVALID_ORGANIZATION: "InvalidOrganization";
|
|
45
|
+
readonly PRODUCT_NOT_ELIGIBLE: "ProductNotEligible";
|
|
46
|
+
readonly NOT_ENOUGH_PREVIOUS_ORDERS: "NotEnoughPreviousOrders";
|
|
47
|
+
readonly PRESALE_ITEMS_NOT_ALLOWED: "PresaleItemsNotAllowed";
|
|
48
|
+
readonly PRESALE_LIMIT_EXCEEDED: "PresaleLimitExceeded";
|
|
49
|
+
readonly PRESALE_NOT_STARTED: "PresaleNotStarted";
|
|
50
|
+
readonly PRESALE_EXPIRED: "PresaleExpired";
|
|
51
|
+
readonly PRESALE_MIXED_CART: "PresaleMixedCart";
|
|
52
|
+
readonly RETAILER_DOES_NOT_ALLOW_PROMOS: "RetailerDoesNotAllowPromos";
|
|
53
|
+
readonly RETAILERS_DO_NOT_ALLOW_PROMOS: "RetailersDoNotAllowPromos";
|
|
54
|
+
};
|
|
55
|
+
export type CartEventEnum = (typeof CART_EVENT_ENUM)[keyof typeof CART_EVENT_ENUM];
|
|
56
|
+
export declare const CHECKOUT_EVENT_ENUM: {
|
|
57
|
+
readonly ERROR_PROCESSING_GIFT_CARDS: "ErrorProcessingGiftCards";
|
|
58
|
+
readonly INVALID_GIFT_CARD_CODE: "InvalidGiftCardCodes";
|
|
59
|
+
readonly INVALID_GIFT_CARD_PARTNER: "InvalidGiftCardPartner";
|
|
60
|
+
readonly INACTIVE_GIFT_CARD: "InactiveGiftCard";
|
|
61
|
+
readonly GIFT_CARD_ALREADY_IN_USE: "GiftCardAlreadyInUse";
|
|
62
|
+
readonly GIFT_CARD_EXPIRED: "GiftCardExpired";
|
|
63
|
+
readonly GIFT_CARD_BALANCE_DEPLETED: "GiftCardBalanceDepleted";
|
|
64
|
+
readonly RETAILER_ONDEMAND_HOURS_NOT_AVAILABLE: "RetailerOnDemandHoursNotAvailable";
|
|
65
|
+
readonly ITEM_QTY_CHANGE: "ItemQuantityChange";
|
|
66
|
+
readonly MAX_QUANTITY_PER_ORDER_EXCEEDED: "MaxQuantityPerOrderExceeded";
|
|
67
|
+
readonly RETAILER_DOES_NOT_ALLOW_PROMOS: "RetailerDoesNotAllowPromos";
|
|
68
|
+
readonly RETAILERS_DO_NOT_ALLOW_PROMOS: "RetailersDoNotAllowPromos";
|
|
69
|
+
readonly RETAILER_DOES_NOT_ALLOW_GIFT_CARDS: "RetailerDoesNotAllowGiftCards";
|
|
70
|
+
readonly RETAILERS_DO_NOT_ALLOW_GIFT_CARDS: "RetailersDoNotAllowGiftCards";
|
|
71
|
+
};
|
|
72
|
+
export type CheckoutEventEnum = (typeof CHECKOUT_EVENT_ENUM)[keyof typeof CHECKOUT_EVENT_ENUM];
|
|
73
|
+
export declare const ENUM_ADDRESS_TYPE: {
|
|
74
|
+
readonly SHIPPING: "shipping";
|
|
75
|
+
readonly BILLING: "billing";
|
|
76
|
+
};
|
|
77
|
+
export type AddressType = (typeof ENUM_ADDRESS_TYPE)[keyof typeof ENUM_ADDRESS_TYPE];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export declare const ELEMENTS_ENV: {
|
|
2
|
+
readonly LOCAL: "local";
|
|
3
|
+
readonly DEVELOPMENT: "development";
|
|
4
|
+
readonly STAGING: "staging";
|
|
5
|
+
readonly PRODUCTION: "production";
|
|
6
|
+
};
|
|
7
|
+
export type ElementsEnv = (typeof ELEMENTS_ENV)[keyof typeof ELEMENTS_ENV];
|
|
8
|
+
export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
9
|
+
readonly CLIENT_READY: "client_ready";
|
|
10
|
+
readonly PRODUCT_LOADED: "product_loaded";
|
|
11
|
+
readonly PRODUCT_QUANTITY_INCREASE: "product_quantity_increase";
|
|
12
|
+
readonly PRODUCT_QUANTITY_DECREASE: "product_quantity_decrease";
|
|
13
|
+
readonly PRODUCT_ADD_TO_CART: "product_add_to_cart";
|
|
14
|
+
readonly PRODUCT_SIZE_CHANGED: "product_size_changed";
|
|
15
|
+
readonly PRODUCT_FULFILLMENT_TYPE_CHANGED: "product_fulfillment_type_changed";
|
|
16
|
+
readonly PRODUCT_FULFILLMENT_CHANGED: "product_fulfillment_changed";
|
|
17
|
+
readonly PRODUCT_ENGRAVING_UPDATED: "product_engraving_updated";
|
|
18
|
+
readonly CART_LOADED: "cart_loaded";
|
|
19
|
+
readonly CART_CLOSED: "cart_closed";
|
|
20
|
+
readonly CART_OPENED: "cart_opened";
|
|
21
|
+
readonly CART_UPDATED: "cart_updated";
|
|
22
|
+
readonly CART_FAILED: "cart_failed";
|
|
23
|
+
readonly CART_RESET: "cart_reset";
|
|
24
|
+
readonly CART_ITEM_ADDED: "cart_item_added";
|
|
25
|
+
readonly CART_ITEM_REMOVED: "cart_item_removed";
|
|
26
|
+
readonly CART_ITEM_QUANTITY_INCREASE: "cart_item_quantity_increase";
|
|
27
|
+
readonly CART_ITEM_QUANTITY_DECREASE: "cart_item_quantity_decrease";
|
|
28
|
+
readonly CART_ITEM_ENGRAVING_UPDATED: "cart_item_engraving_updated";
|
|
29
|
+
readonly CART_PROMO_CODE_APPLIED: "cart_promo_code_applied";
|
|
30
|
+
readonly CART_PROMO_CODE_REMOVED: "cart_promo_code_removed";
|
|
31
|
+
readonly CART_PROMO_CODE_FAILED: "cart_promo_code_failed";
|
|
32
|
+
readonly CART_PRODUCT_ADD_SUCCESS: "cart_product_add_success";
|
|
33
|
+
readonly CART_PRODUCT_ADD_FAILED: "cart_product_add_failed";
|
|
34
|
+
readonly ADDRESS_UPDATED: "address_updated";
|
|
35
|
+
readonly ADDRESS_CLEARED: "address_cleared";
|
|
36
|
+
readonly ADDRESS_FAILED: "address_failed";
|
|
37
|
+
readonly CHECKOUT_LOADED: "checkout_loaded";
|
|
38
|
+
readonly CHECKOUT_OPENED: "checkout_opened";
|
|
39
|
+
readonly CHECKOUT_CLOSED: "checkout_closed";
|
|
40
|
+
readonly CHECKOUT_FAILED: "checkout_failed";
|
|
41
|
+
readonly CHECKOUT_IS_GIFT_TOGGLED: "checkout_is_gift_toggled";
|
|
42
|
+
readonly CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED: "checkout_billing_same_as_shipping_toggled";
|
|
43
|
+
readonly CHECKOUT_MARKETING_PREFERENCES_TOGGLED: "checkout_marketing_preferences_toggled";
|
|
44
|
+
readonly CHECKOUT_CUSTOMER_INFORMATION_UPDATED: "checkout_customer_information_updated";
|
|
45
|
+
readonly CHECKOUT_BILLING_INFORMATION_UPDATED: "checkout_billing_information_updated";
|
|
46
|
+
readonly CHECKOUT_GIFT_INFORMATION_UPDATED: "checkout_gift_information_updated";
|
|
47
|
+
readonly CHECKOUT_ITEM_REMOVED: "checkout_item_removed";
|
|
48
|
+
readonly CHECKOUT_ITEM_QUANTITY_INCREASE: "checkout_item_quantity_increase";
|
|
49
|
+
readonly CHECKOUT_ITEM_QUANTITY_DECREASE: "checkout_item_quantity_decrease";
|
|
50
|
+
readonly CHECKOUT_ITEM_ENGRAVING_UPDATED: "checkout_item_engraving_updated";
|
|
51
|
+
readonly CHECKOUT_TIP_UPDATED: "checkout_tip_updated";
|
|
52
|
+
readonly CHECKOUT_SUBMIT_STARTED: "checkout_submit_started";
|
|
53
|
+
readonly CHECKOUT_SUBMIT_COMPLETED: "checkout_submit_completed";
|
|
54
|
+
readonly CHECKOUT_SUBMIT_FAILED: "checkout_submit_failed";
|
|
55
|
+
readonly CHECKOUT_PROMO_CODE_APPLIED: "checkout_promo_code_applied";
|
|
56
|
+
readonly CHECKOUT_PROMO_CODE_REMOVED: "checkout_promo_code_removed";
|
|
57
|
+
readonly CHECKOUT_PROMO_CODE_FAILED: "checkout_promo_code_failed";
|
|
58
|
+
readonly CHECKOUT_GIFT_CARD_APPLIED: "checkout_gift_card_applied";
|
|
59
|
+
readonly CHECKOUT_GIFT_CARD_REMOVED: "checkout_gift_card_removed";
|
|
60
|
+
readonly CHECKOUT_GIFT_CARD_FAILED: "checkout_gift_card_failed";
|
|
61
|
+
readonly CHECKOUT_PRODUCT_ADD_SUCCESS: "checkout_product_add_success";
|
|
62
|
+
readonly CHECKOUT_PRODUCT_ADD_FAILED: "checkout_product_add_failed";
|
|
63
|
+
};
|
|
64
|
+
export declare const ELEMENTS_FORM: {
|
|
65
|
+
readonly CUSTOMER: "customer";
|
|
66
|
+
readonly GIFT: "gift";
|
|
67
|
+
readonly BILLING: "billing";
|
|
68
|
+
};
|
|
69
|
+
export declare const COMPONENT_TYPE: {
|
|
70
|
+
readonly DRAWER: "drawer";
|
|
71
|
+
readonly INPUT: "input";
|
|
72
|
+
readonly BIRTHDATE_INPUT: "birthdate-input";
|
|
73
|
+
readonly ENGRAVING_FORM: "engraving-form";
|
|
74
|
+
readonly ENGRAVING_VIEW: "engraving-view";
|
|
75
|
+
readonly BUTTONS_CART_OPEN: "buttons-cart-open";
|
|
76
|
+
readonly POWERED_BY: "powered-by";
|
|
77
|
+
readonly LCE_ELEMENT: "lce-element";
|
|
78
|
+
readonly PURCHASE_MIN_ALERT: "purchase-min-alert";
|
|
79
|
+
readonly ALERT: "alert";
|
|
80
|
+
readonly PROMO_CODE_TICKER: "promo-code-ticker";
|
|
81
|
+
readonly ADDRESS: "address";
|
|
82
|
+
readonly ADDRESS_INPUT: "address-input";
|
|
83
|
+
readonly ADDRESS_DISPLAY: "address-display";
|
|
84
|
+
readonly PRODUCT: "product";
|
|
85
|
+
readonly PRODUCT_IMAGE_CAROUSEL: "product-image-carousel";
|
|
86
|
+
readonly PRODUCT_OPTIONS: "product-options";
|
|
87
|
+
readonly PRODUCT_INTERACTIONS: "product-interactions";
|
|
88
|
+
readonly PRODUCT_DESCRIPTION: "product-description";
|
|
89
|
+
readonly PRODUCT_RETAILERS: "product-retailers";
|
|
90
|
+
readonly PRODUCT_RETAILERS_CAROUSEL: "product-retailers-carousel";
|
|
91
|
+
readonly PRODUCT_RETAILERS_POPUP: "product-retailers-popup";
|
|
92
|
+
readonly PRODUCT_RETAILERS_POPUP_LIST: "product-retailers-popup-list";
|
|
93
|
+
readonly PRODUCT_PRICE: "product-price";
|
|
94
|
+
readonly PRODUCT_ADD_TO_CART_SECTION: "product-add-to-cart-section";
|
|
95
|
+
readonly PRODUCT_DRAWER: "product-drawer";
|
|
96
|
+
readonly PRODUCT_LOADING: "product-loading";
|
|
97
|
+
readonly CART: "cart";
|
|
98
|
+
readonly CART_RETAILER: "cart-retailer";
|
|
99
|
+
readonly CART_ITEM: "cart-item";
|
|
100
|
+
readonly CART_FOOTER: "cart-footer";
|
|
101
|
+
readonly CART_ITEM_QUANTITY_PRICE: "cart-item-quantity-price";
|
|
102
|
+
readonly CART_RETAILER_SUBTOTAL: "cart-retailer-subtotal";
|
|
103
|
+
readonly CART_PROMO_CODE: "cart-promo-code";
|
|
104
|
+
readonly CART_HEADER: "cart-header";
|
|
105
|
+
readonly CART_BODY: "cart-body";
|
|
106
|
+
readonly CART_FULFILLMENT: "cart-fulfillment";
|
|
107
|
+
readonly CHECKOUT: "checkout";
|
|
108
|
+
readonly CHECKOUT_INFORMATION_SECTION: "checkout-information-section";
|
|
109
|
+
readonly CHECKOUT_STRIPE_FORM: "checkout-stripe-form";
|
|
110
|
+
readonly CHECKOUT_PAYMENT_FORM: "checkout-payment-form";
|
|
111
|
+
readonly CHECKOUT_BILLING_FORM: "checkout-billing-form";
|
|
112
|
+
readonly CHECKOUT_SUMMARY_SECTION: "checkout-summary-section";
|
|
113
|
+
readonly CHECKOUT_PROMO_CODE: "checkout-promo-code";
|
|
114
|
+
readonly CHECKOUT_GIFT_CARDS: "checkout-gift-cards";
|
|
115
|
+
readonly CHECKOUT_AMOUNTS: "checkout-amounts";
|
|
116
|
+
readonly CHECKOUT_ITEMS: "checkout-items";
|
|
117
|
+
readonly CHECKOUT_COMPLETED: "checkout-completed";
|
|
118
|
+
readonly CHECKOUT_DELIVERY_INFORMATION_FORM: "checkout-delivery-information-form";
|
|
119
|
+
readonly CHECKOUT_BUYER_INFORMATION_FORM: "checkout-buyer-information-form";
|
|
120
|
+
readonly CHECKOUT_TIPS: "checkout-tips";
|
|
121
|
+
readonly CHECKOUT_PC_GC: "checkout-pc-gc";
|
|
122
|
+
readonly CHECKOUT_ITEM: "checkout-item";
|
|
123
|
+
readonly CHECKOUT_ITEM_QUANTITY: "checkout-item-quantity";
|
|
124
|
+
readonly CHECKOUT_PLACE_ORDER_BUTTON: "checkout-place-order-button";
|
|
125
|
+
readonly CHECKOUT_HEADER: "checkout-header";
|
|
126
|
+
readonly CHECKOUT_PRESALE_COUNTDOWN: "checkout-presale-countdown";
|
|
127
|
+
readonly CHECKOUT_PRESALE_EXPIRED: "checkout-presale-expired";
|
|
128
|
+
};
|
|
129
|
+
export type ComponentType = (typeof COMPONENT_TYPE)[keyof typeof COMPONENT_TYPE];
|
|
130
|
+
export declare const FULFILLMENT_TYPE: {
|
|
131
|
+
readonly ON_DEMAND: "onDemand";
|
|
132
|
+
readonly SHIPPING: "shipping";
|
|
133
|
+
};
|
|
134
|
+
export type FulfillmentType = (typeof FULFILLMENT_TYPE)[keyof typeof FULFILLMENT_TYPE];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ICoreParams } from './core.interface';
|
|
2
|
+
export interface IAddress {
|
|
3
|
+
id?: string;
|
|
4
|
+
one: string;
|
|
5
|
+
two: string;
|
|
6
|
+
city: string;
|
|
7
|
+
state: string;
|
|
8
|
+
zip: string;
|
|
9
|
+
country?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ICoords {
|
|
12
|
+
lat: number;
|
|
13
|
+
long: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ILoc {
|
|
16
|
+
address?: IAddress;
|
|
17
|
+
coords?: ICoords;
|
|
18
|
+
}
|
|
19
|
+
export interface ILocBase extends ICoreParams {
|
|
20
|
+
loc?: ILoc;
|
|
21
|
+
}
|
|
22
|
+
export interface IAddressAutocompleteParams extends ICoreParams {
|
|
23
|
+
input: string;
|
|
24
|
+
}
|
|
25
|
+
export interface IAddressAutocompleteResult {
|
|
26
|
+
id: string;
|
|
27
|
+
description: string;
|
|
28
|
+
}
|
|
29
|
+
export interface IAddressDetailsParams extends ICoreParams {
|
|
30
|
+
id: string;
|
|
31
|
+
}
|
|
32
|
+
export interface IAddressDetailsResult {
|
|
33
|
+
formattedAddress: string;
|
|
34
|
+
coords: ICoords;
|
|
35
|
+
address: Omit<IAddress, 'id'>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { CartEventEnum } from '@/enums';
|
|
2
|
+
import type { ILoc, ILocBase } from './address.interface';
|
|
3
|
+
import type { IProduct, IProductPresale } from './product.interface';
|
|
4
|
+
import type { IRetailer } from './retailer.interface';
|
|
5
|
+
export interface ICartItemEngraving {
|
|
6
|
+
isEngravable: boolean;
|
|
7
|
+
hasEngraving: boolean;
|
|
8
|
+
fee: number;
|
|
9
|
+
maxCharsPerLine: number;
|
|
10
|
+
maxLines: number;
|
|
11
|
+
location: string;
|
|
12
|
+
lines: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface ICartItemGiftCart {
|
|
15
|
+
sender: string;
|
|
16
|
+
message: string;
|
|
17
|
+
recipients: string[];
|
|
18
|
+
sendDate: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ICartItemAttributes {
|
|
21
|
+
engraving: ICartItemEngraving;
|
|
22
|
+
presale: IProductPresale;
|
|
23
|
+
giftCard: ICartItemGiftCart;
|
|
24
|
+
}
|
|
25
|
+
export interface ICartItem extends Partial<Omit<IProduct, 'attributes'>> {
|
|
26
|
+
id: string;
|
|
27
|
+
retailerId: string;
|
|
28
|
+
fulfillmentId: string;
|
|
29
|
+
variantId: string;
|
|
30
|
+
liquidId: string;
|
|
31
|
+
salsifyGrouping: string;
|
|
32
|
+
salsifyPid?: string;
|
|
33
|
+
partNumber: string;
|
|
34
|
+
upc: string;
|
|
35
|
+
sku: string;
|
|
36
|
+
name: string;
|
|
37
|
+
brand: string;
|
|
38
|
+
size: string;
|
|
39
|
+
volume: string;
|
|
40
|
+
uom: string;
|
|
41
|
+
abv: string;
|
|
42
|
+
proof: string;
|
|
43
|
+
catPath: string;
|
|
44
|
+
pack: boolean;
|
|
45
|
+
packDesc: string;
|
|
46
|
+
container: string;
|
|
47
|
+
containerType: string;
|
|
48
|
+
quantity: number;
|
|
49
|
+
maxQuantity: number;
|
|
50
|
+
unitPrice: number;
|
|
51
|
+
price: number;
|
|
52
|
+
scheduledFor: string | Date;
|
|
53
|
+
availableAt: string | Date;
|
|
54
|
+
images: string[];
|
|
55
|
+
mainImage: string;
|
|
56
|
+
attributes: ICartItemAttributes;
|
|
57
|
+
}
|
|
58
|
+
export interface ICartAttributesPromoCode {
|
|
59
|
+
value: string;
|
|
60
|
+
discount: number;
|
|
61
|
+
freeDelivery: boolean;
|
|
62
|
+
freeServiceFee: boolean;
|
|
63
|
+
freeShipping: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface ICartAttributesAmountsFees {
|
|
66
|
+
shipping: number;
|
|
67
|
+
onDemand: number;
|
|
68
|
+
}
|
|
69
|
+
export interface ICartAttributesAmountsDiscounts {
|
|
70
|
+
shipping: number;
|
|
71
|
+
onDemand: number;
|
|
72
|
+
engraving: number;
|
|
73
|
+
service: number;
|
|
74
|
+
products: number;
|
|
75
|
+
}
|
|
76
|
+
export interface ICartAttributesAmounts {
|
|
77
|
+
fees: ICartAttributesAmountsFees;
|
|
78
|
+
discounts: ICartAttributesAmountsDiscounts;
|
|
79
|
+
}
|
|
80
|
+
export interface ICartAttributes {
|
|
81
|
+
promoCode: ICartAttributesPromoCode;
|
|
82
|
+
amounts: ICartAttributesAmounts;
|
|
83
|
+
}
|
|
84
|
+
export interface ICartRetailer extends IRetailer {
|
|
85
|
+
platformFee: number;
|
|
86
|
+
engravingFee: number;
|
|
87
|
+
deliveryFee: number;
|
|
88
|
+
shippingFee: number;
|
|
89
|
+
subtotal: number;
|
|
90
|
+
total: number;
|
|
91
|
+
}
|
|
92
|
+
export interface ICartEvent {
|
|
93
|
+
type: CartEventEnum;
|
|
94
|
+
message: string;
|
|
95
|
+
items?: Array<Partial<ICartItem>>;
|
|
96
|
+
}
|
|
97
|
+
export interface ICart {
|
|
98
|
+
id: string;
|
|
99
|
+
quantity: number;
|
|
100
|
+
platformFee: number;
|
|
101
|
+
deliveryFee: number;
|
|
102
|
+
engravingFee: number;
|
|
103
|
+
shippingFee: number;
|
|
104
|
+
discounts: number;
|
|
105
|
+
giftCardTotal: number;
|
|
106
|
+
subtotal: number;
|
|
107
|
+
total: number;
|
|
108
|
+
isPresaleLocked: boolean;
|
|
109
|
+
presaleExpiresAt: string | null;
|
|
110
|
+
createdAt: string | Date;
|
|
111
|
+
updatedAt: string | Date;
|
|
112
|
+
items: ICartItem[];
|
|
113
|
+
loc: ILoc;
|
|
114
|
+
retailers: ICartRetailer[];
|
|
115
|
+
attributes: ICartAttributes;
|
|
116
|
+
events: ICartEvent[];
|
|
117
|
+
}
|
|
118
|
+
export interface ICartUpdateItem {
|
|
119
|
+
id?: string;
|
|
120
|
+
upc?: string;
|
|
121
|
+
partNumber: string;
|
|
122
|
+
sku?: string;
|
|
123
|
+
quantity: number;
|
|
124
|
+
fulfillmentId: string;
|
|
125
|
+
engravingLines?: string[];
|
|
126
|
+
scheduledFor?: string | Date;
|
|
127
|
+
}
|
|
128
|
+
export interface ICartUpdateParams extends ILocBase {
|
|
129
|
+
id: string;
|
|
130
|
+
items: ICartUpdateItem[];
|
|
131
|
+
promoCode?: string;
|
|
132
|
+
}
|