@liquidcommerce/elements-sdk 2.6.0-beta.3 → 2.6.0-beta.5
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/dist/index.esm.js +10056 -10543
- package/dist/types/core/api/api-client.service.d.ts +9 -9
- package/dist/types/core/api/auth-client.service.d.ts +3 -14
- package/dist/types/core/client/client-action.service.d.ts +7 -4
- package/dist/types/core/client/client-config.service.d.ts +1 -0
- package/dist/types/core/command/base-command.service.d.ts +2 -2
- package/dist/types/core/google-tag-manager.service.d.ts +10 -10
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +3 -9
- package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/store/interfaces/cart.interface.d.ts +3 -2
- package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
- package/dist/types/core/store/interfaces/product.interface.d.ts +12 -66
- package/dist/types/core/store/store.constant.d.ts +1 -1
- package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
- package/dist/types/interfaces/api/address.interface.d.ts +28 -0
- package/dist/types/interfaces/api/product.interface.d.ts +106 -0
- package/dist/types/interfaces/cloud/cart.interface.d.ts +4 -4
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +3 -3
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +5 -8
- package/dist/types/interfaces/cloud/index.d.ts +0 -2
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +2 -2
- package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
- package/dist/types/modules/address/address.command.d.ts +2 -3
- package/dist/types/modules/address/address.interface.d.ts +0 -7
- package/dist/types/modules/product/components/components.d.ts +2 -4
- package/dist/types/modules/product/product.commands.d.ts +2 -2
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +2 -1
- package/dist/types/modules/product-list/product-list.commands.d.ts +2 -1
- package/package.json +2 -3
- package/umd/elements.js +1 -1
- package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
- package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
- package/dist/types/modules/product/utils/helpers.d.ts +0 -3
- package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AuthClientService } from '@/core/api/auth-client.service';
|
|
2
2
|
import type { IPersistedStore } from '@/core/store/interfaces/core.interface';
|
|
3
|
-
import type { IAddressAutocompleteResult, IAddressDetailsResult,
|
|
3
|
+
import type { IAddressAutocompleteResult, IAddressDetailsResult, ILocation } from '@/interfaces/api/address.interface';
|
|
4
|
+
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
5
|
+
import type { ICart, ICartUpdateParams, ICatalog, ICatalogParams, ICheckoutCompleteParams, ICheckoutCompleteResponse, ICheckoutPrepareParams, ICheckoutPrepareResponse, ILiquidPaymentToken } from '@/interfaces/cloud';
|
|
4
6
|
import type { IUserPaymentSession, IUserSession } from '@/interfaces/cloud/user.interface';
|
|
5
7
|
import type { IAllConfigs } from '@/interfaces/configs';
|
|
6
8
|
export declare class ApiClientService {
|
|
@@ -13,18 +15,16 @@ export declare class ApiClientService {
|
|
|
13
15
|
setPersistedStore(userDeviceId: string, data: IPersistedStore): Promise<void>;
|
|
14
16
|
getPersistedStore(userDeviceId: string): Promise<IPersistedStore | null>;
|
|
15
17
|
deletePersistedStore(userDeviceId: string): Promise<void>;
|
|
16
|
-
|
|
18
|
+
getAddressSuggestions(input: string): Promise<IAddressAutocompleteResult[]>;
|
|
19
|
+
getAddressDetails(id: string): Promise<IAddressDetailsResult>;
|
|
20
|
+
getProductsData(identifier: string[], location?: ILocation): Promise<IProductAvailabilityResponse | null>;
|
|
21
|
+
catalogSearch(params: ICatalogParams): Promise<ICatalog>;
|
|
17
22
|
getCartData(id: string | null): Promise<ICart>;
|
|
18
23
|
updateCart(params: ICartUpdateParams & {
|
|
19
|
-
loc?:
|
|
24
|
+
loc?: ILocation;
|
|
20
25
|
}): Promise<ICart>;
|
|
21
|
-
getAddressSuggestions(query: string): Promise<IAddressAutocompleteResult[]>;
|
|
22
|
-
getAddressDetails(id: string): Promise<IAddressDetailsResult>;
|
|
23
26
|
prepareCheckout(params: ICheckoutPrepareParams): Promise<ICheckoutPrepareResponse>;
|
|
24
27
|
getPaymentSession(params: IUserPaymentSession): Promise<IUserSession>;
|
|
25
28
|
confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<ILiquidPaymentToken>;
|
|
26
|
-
checkoutComplete(params: Partial<ICheckoutCompleteParams>): Promise<ICheckoutCompleteResponse
|
|
27
|
-
catalogSearch(params: ICatalogParams): Promise<ICatalog>;
|
|
28
|
-
private validResponseData;
|
|
29
|
-
private ensureClientInitialized;
|
|
29
|
+
checkoutComplete(params: Partial<ICheckoutCompleteParams>): Promise<ICheckoutCompleteResponse>;
|
|
30
30
|
}
|
|
@@ -13,22 +13,13 @@ export interface IAuth {
|
|
|
13
13
|
exp: number;
|
|
14
14
|
type: 'ACCESS_TOKEN';
|
|
15
15
|
}
|
|
16
|
-
export interface IResponseMetadata {
|
|
17
|
-
languages: string[];
|
|
18
|
-
timestamp: number;
|
|
19
|
-
timezone: string;
|
|
20
|
-
requestId: string;
|
|
21
|
-
path: string;
|
|
22
|
-
version: string;
|
|
23
|
-
}
|
|
24
16
|
export interface IApiResponseBase {
|
|
25
|
-
statusCode: number;
|
|
26
17
|
message: string;
|
|
27
|
-
metadata: IResponseMetadata;
|
|
28
18
|
}
|
|
29
|
-
export
|
|
19
|
+
export interface IApiResponse<T> {
|
|
20
|
+
message: string;
|
|
30
21
|
data: T;
|
|
31
|
-
}
|
|
22
|
+
}
|
|
32
23
|
export declare class AuthClientService {
|
|
33
24
|
private readonly apiKey;
|
|
34
25
|
private readonly baseUrl;
|
|
@@ -48,6 +39,4 @@ export declare class AuthClientService {
|
|
|
48
39
|
private getProxyHeaders;
|
|
49
40
|
get<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
50
41
|
post<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
51
|
-
put<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
52
|
-
delete<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
53
42
|
}
|
|
@@ -2,14 +2,14 @@ import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface
|
|
|
2
2
|
import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
3
3
|
import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
4
4
|
import { type FulfillmentType } from '@/enums';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
5
|
+
import type { IAddressAddress, IAddressCoordinates, IAddressData } from '@/interfaces/api/address.interface';
|
|
6
|
+
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
|
|
7
7
|
export interface IProductActions {
|
|
8
8
|
getDetails: (identifier: string) => IBaseProductEventData;
|
|
9
9
|
}
|
|
10
10
|
export interface IAddressActions {
|
|
11
11
|
setAddressByPlacesId: (placesId: string) => Promise<void>;
|
|
12
|
-
setAddressManually: (address:
|
|
12
|
+
setAddressManually: (address: IAddressAddress, coordinates: IAddressCoordinates) => Promise<void>;
|
|
13
13
|
clear: () => Promise<void>;
|
|
14
14
|
getDetails: () => IAddressData | null;
|
|
15
15
|
}
|
|
@@ -40,7 +40,10 @@ export interface ICheckoutActions {
|
|
|
40
40
|
removeGiftCard: (code: string) => Promise<void>;
|
|
41
41
|
toggleIsGift: (active?: boolean) => Promise<void>;
|
|
42
42
|
toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
|
|
43
|
-
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => 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;
|
|
44
47
|
getDetails: () => ICheckoutDetailsEventData;
|
|
45
48
|
}
|
|
46
49
|
export declare class ClientActionService {
|
|
@@ -4,7 +4,7 @@ import { GoogleTagManagerService } from '@/core/google-tag-manager.service';
|
|
|
4
4
|
import { LoggerFactory } from '@/core/logger/logger-factory';
|
|
5
5
|
import { PubSubService } from '@/core/pubsub/pubsub.service';
|
|
6
6
|
import { StoreService } from '@/core/store/store.service';
|
|
7
|
-
import type {
|
|
7
|
+
import type { ILocation } from '@/interfaces/api/address.interface';
|
|
8
8
|
import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
|
|
9
9
|
export declare abstract class BaseCommand {
|
|
10
10
|
protected store: StoreService;
|
|
@@ -15,5 +15,5 @@ export declare abstract class BaseCommand {
|
|
|
15
15
|
protected clientConfig: ClientConfigService;
|
|
16
16
|
protected themeProvider: ThemeProviderService;
|
|
17
17
|
constructor();
|
|
18
|
-
protected getLocation():
|
|
18
|
+
protected getLocation(): ILocation | undefined;
|
|
19
19
|
}
|
|
@@ -6,10 +6,10 @@ declare global {
|
|
|
6
6
|
}
|
|
7
7
|
interface GTMConfig {
|
|
8
8
|
partnerName: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
partnerGTMId?: string;
|
|
10
|
+
enablePartnerGTM: boolean;
|
|
11
|
+
enableLiquidCommerceGTM: boolean;
|
|
12
|
+
liquidCommerceGTMId: string;
|
|
13
13
|
}
|
|
14
14
|
interface BaseItem {
|
|
15
15
|
item_id?: string;
|
|
@@ -47,10 +47,10 @@ interface PurchaseData {
|
|
|
47
47
|
}
|
|
48
48
|
export declare class GoogleTagManagerService {
|
|
49
49
|
private partnerName?;
|
|
50
|
-
private
|
|
51
|
-
private
|
|
52
|
-
private
|
|
53
|
-
private
|
|
50
|
+
private partnerGTMId?;
|
|
51
|
+
private liquidCommerceGTMId?;
|
|
52
|
+
private enablePartnerGTM;
|
|
53
|
+
private enableLiquidCommerceGTM;
|
|
54
54
|
private isInitialized;
|
|
55
55
|
private isInitializing;
|
|
56
56
|
private initializationPromise?;
|
|
@@ -108,8 +108,8 @@ export declare class GoogleTagManagerService {
|
|
|
108
108
|
country?: string;
|
|
109
109
|
};
|
|
110
110
|
coordinates?: {
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
latitude: number;
|
|
112
|
+
longitude: number;
|
|
113
113
|
};
|
|
114
114
|
}): void;
|
|
115
115
|
addressFailed(errorData: {
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
1
2
|
export interface IAddressActionEventData {
|
|
2
3
|
googlePlacesId: string;
|
|
3
4
|
formattedAddress: string;
|
|
4
|
-
address:
|
|
5
|
-
|
|
6
|
-
two: string;
|
|
7
|
-
city: string;
|
|
8
|
-
state: string;
|
|
9
|
-
zip: string;
|
|
10
|
-
country: string;
|
|
11
|
-
};
|
|
12
|
-
coordinates: {
|
|
13
|
-
lat: number;
|
|
14
|
-
long: number;
|
|
15
|
-
};
|
|
5
|
+
address: IAddressAddress;
|
|
6
|
+
coordinates: IAddressCoordinates;
|
|
16
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FulfillmentType } from '@/enums';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
3
3
|
export interface IBaseProductFulfillmentEventData {
|
|
4
4
|
price: number;
|
|
5
5
|
partNumber: string;
|
|
@@ -7,10 +7,9 @@ export interface IBaseProductFulfillmentEventData {
|
|
|
7
7
|
isEngravable: boolean;
|
|
8
8
|
fulfillmentId: string;
|
|
9
9
|
fulfillmentType: FulfillmentType;
|
|
10
|
-
modalities: FulfillmentType[];
|
|
11
10
|
retailerId: string;
|
|
12
11
|
retailerName: string;
|
|
13
|
-
retailerAddress: (
|
|
12
|
+
retailerAddress: (IAddressAddress & IAddressCoordinates) | null;
|
|
14
13
|
retailerTimezone: string;
|
|
15
14
|
}
|
|
16
15
|
export interface IBaseProductSizeAttributesEventData {
|
|
@@ -60,7 +59,6 @@ export interface IBaseProductEventData {
|
|
|
60
59
|
type: string;
|
|
61
60
|
salsifyGrouping: string;
|
|
62
61
|
subType: string;
|
|
63
|
-
mainImage: string | null;
|
|
64
62
|
images: string[];
|
|
65
63
|
region: string;
|
|
66
64
|
country: string;
|
|
@@ -76,11 +74,7 @@ export interface IBaseProductEventData {
|
|
|
76
74
|
description: string;
|
|
77
75
|
htmlDescription: string;
|
|
78
76
|
tastingNotes: string;
|
|
79
|
-
|
|
80
|
-
min: number;
|
|
81
|
-
max: number;
|
|
82
|
-
avg: number;
|
|
83
|
-
} | null;
|
|
77
|
+
noAvailabilityPrice: number;
|
|
84
78
|
sizes: Record<string, IBaseProductSizeEventData>;
|
|
85
79
|
}
|
|
86
80
|
export interface IProductLoadedEventData extends IBaseProductEventData {
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
1
2
|
export interface IAddressStore {
|
|
2
3
|
id: string;
|
|
3
4
|
formattedAddress: string;
|
|
4
|
-
address:
|
|
5
|
-
|
|
6
|
-
two: string;
|
|
7
|
-
city: string;
|
|
8
|
-
state: string;
|
|
9
|
-
zip: string;
|
|
10
|
-
country: string;
|
|
11
|
-
};
|
|
12
|
-
coordinates: {
|
|
13
|
-
lat: number;
|
|
14
|
-
long: number;
|
|
15
|
-
};
|
|
5
|
+
address: IAddressAddress;
|
|
6
|
+
coordinates: IAddressCoordinates;
|
|
16
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IElementsCartEvent } from 'utils/helper';
|
|
2
2
|
import type { FulfillmentType } from '@/enums';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IAddressAddress } from '@/interfaces/api/address.interface';
|
|
4
|
+
import type { ICartItemAttributes, IRetailerExpectation, IRetailerFees } from '@/interfaces/cloud';
|
|
4
5
|
export interface ICartItemStore {
|
|
5
6
|
id: string;
|
|
6
7
|
variantId: string;
|
|
@@ -64,7 +65,7 @@ export interface IRetailerStore {
|
|
|
64
65
|
platformFee: number;
|
|
65
66
|
shippingFee: number;
|
|
66
67
|
subtotal: number;
|
|
67
|
-
address?:
|
|
68
|
+
address?: IAddressAddress;
|
|
68
69
|
deliveryFee: number;
|
|
69
70
|
engravingFee: number;
|
|
70
71
|
total: number;
|
|
@@ -15,11 +15,11 @@ export interface IUIStore {
|
|
|
15
15
|
drawer: IDrawerStore;
|
|
16
16
|
}
|
|
17
17
|
export interface IGlobalStore {
|
|
18
|
-
cart: ICartStore;
|
|
19
18
|
address: IAddressStore;
|
|
19
|
+
products: Record<string, IProductStore>;
|
|
20
|
+
cart: ICartStore;
|
|
20
21
|
checkout: ICheckoutStore;
|
|
21
22
|
ui: IUIStore;
|
|
22
|
-
products: Record<string, IProductStore>;
|
|
23
23
|
}
|
|
24
24
|
export interface IPersistedStore {
|
|
25
25
|
p?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType, FulfillmentType } from '@/enums';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IFulfillment, IProduct, IProductSize, IProductVariant, IRetailerAddress } from '@/interfaces/api/product.interface';
|
|
3
3
|
export interface IProductDrawerContentConfig {
|
|
4
4
|
type: ComponentType;
|
|
5
5
|
data?: Record<string, any>;
|
|
@@ -8,85 +8,31 @@ export interface IProductDrawerStore {
|
|
|
8
8
|
isOpen: boolean;
|
|
9
9
|
contentConfig: IProductDrawerContentConfig | null;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
isVariantEngravable: boolean;
|
|
13
|
-
stock: number;
|
|
14
|
-
price: number;
|
|
15
|
-
retailerId: string;
|
|
16
|
-
partNumber: string;
|
|
17
|
-
fulfillmentId: string;
|
|
18
|
-
fulfillmentType: FulfillmentType;
|
|
19
|
-
modalities: FulfillmentType[];
|
|
11
|
+
export type IProductFulfillmentStore = IFulfillment & {
|
|
20
12
|
retailerName: string;
|
|
21
|
-
retailerAddress:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
fees: IRetailerFees;
|
|
27
|
-
hours: RetailerHours;
|
|
28
|
-
}
|
|
29
|
-
export interface IProductSizeStore {
|
|
30
|
-
id: string;
|
|
31
|
-
upc: string;
|
|
32
|
-
size: string;
|
|
33
|
-
pack: boolean;
|
|
34
|
-
packDesc: string | null;
|
|
35
|
-
container: string;
|
|
36
|
-
containerType: string;
|
|
37
|
-
maxQuantityPerOrder: number;
|
|
38
|
-
image: string;
|
|
39
|
-
uom: string;
|
|
40
|
-
volume: string;
|
|
41
|
-
attributes: IProductSizeAttributes;
|
|
13
|
+
retailerAddress: IRetailerAddress;
|
|
14
|
+
retailerAddressFormatted: string;
|
|
15
|
+
variant: IProductVariant;
|
|
16
|
+
};
|
|
17
|
+
export interface IProductSizeStore extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
|
|
42
18
|
onDemandFulfillments: Record<string, IProductFulfillmentStore>;
|
|
43
19
|
shippingFulfillments: Record<string, IProductFulfillmentStore>;
|
|
44
20
|
loading: boolean;
|
|
45
21
|
error: string | null;
|
|
46
22
|
}
|
|
47
|
-
export interface IProductStore {
|
|
23
|
+
export interface IProductStore extends Omit<IProduct, 'sizes'> {
|
|
48
24
|
identifier: string;
|
|
49
|
-
id: string;
|
|
50
|
-
name: string;
|
|
51
|
-
brand: string;
|
|
52
|
-
catPath: string;
|
|
53
|
-
category: string;
|
|
54
|
-
classification: string;
|
|
55
|
-
type: string;
|
|
56
|
-
salsifyGrouping: string;
|
|
57
|
-
subType: string;
|
|
58
|
-
mainImage: string | null;
|
|
59
|
-
images: string[];
|
|
60
|
-
region: string;
|
|
61
|
-
country: string;
|
|
62
|
-
material: string;
|
|
63
|
-
abv: string;
|
|
64
|
-
proof: string;
|
|
65
|
-
age: string;
|
|
66
|
-
color: string;
|
|
67
|
-
flavor: string;
|
|
68
|
-
variety: string;
|
|
69
|
-
appellation: string;
|
|
70
|
-
vintage: string;
|
|
71
|
-
description: string;
|
|
72
|
-
htmlDescription: string;
|
|
73
|
-
tastingNotes: string;
|
|
74
|
-
priceInfo?: {
|
|
75
|
-
min: number;
|
|
76
|
-
max: number;
|
|
77
|
-
avg: number;
|
|
78
|
-
};
|
|
79
|
-
quantity: number;
|
|
80
25
|
sizes: Record<string, IProductSizeStore>;
|
|
81
|
-
|
|
26
|
+
quantity: number;
|
|
82
27
|
selectedSizeId: string | null;
|
|
83
28
|
selectedFulfillmentType: FulfillmentType;
|
|
84
29
|
selectedFulfillmentId: string | null;
|
|
85
30
|
selectedFulfillment: IProductFulfillmentStore | null;
|
|
31
|
+
productHasAvailability: boolean;
|
|
86
32
|
fulfillmentHasAvailability: boolean;
|
|
33
|
+
drawer: IProductDrawerStore;
|
|
87
34
|
loading: boolean;
|
|
88
35
|
updating: boolean;
|
|
89
|
-
error: string | null;
|
|
90
|
-
drawer: IProductDrawerStore;
|
|
91
36
|
rerender: boolean;
|
|
37
|
+
error: string | null;
|
|
92
38
|
}
|
|
@@ -4,9 +4,9 @@ import type { ICheckoutStore } from '@/core/store/interfaces/checkout.interface'
|
|
|
4
4
|
import type { IGlobalStore, IUIStore } from '@/core/store/interfaces/core.interface';
|
|
5
5
|
import type { IProductStore } from '@/core/store/interfaces/product.interface';
|
|
6
6
|
export declare const LOCAL_STORAGE_PREFIX = "lce";
|
|
7
|
+
export declare const initialAddressState: IAddressStore;
|
|
7
8
|
export declare const initialProductState: IProductStore;
|
|
8
9
|
export declare const initialCartState: ICartStore;
|
|
9
10
|
export declare const initialCheckoutState: ICheckoutStore;
|
|
10
11
|
export declare const initialUIState: IUIStore;
|
|
11
|
-
export declare const initialAddressState: IAddressStore;
|
|
12
12
|
export declare const initialStoreState: IGlobalStore;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
2
|
+
export interface IAddressAutocompleteResult {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IAddressCoordinates {
|
|
7
|
+
latitude: number;
|
|
8
|
+
longitude: number;
|
|
9
|
+
}
|
|
10
|
+
export interface IAddressAddress {
|
|
11
|
+
one: string;
|
|
12
|
+
two: string;
|
|
13
|
+
city: string;
|
|
14
|
+
state: string;
|
|
15
|
+
zip: string;
|
|
16
|
+
country: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IAddressDetailsResult {
|
|
19
|
+
formattedAddress: string;
|
|
20
|
+
address: IAddressAddress;
|
|
21
|
+
coordinates: IAddressCoordinates;
|
|
22
|
+
}
|
|
23
|
+
export interface ILocation {
|
|
24
|
+
address: IAddressAddress;
|
|
25
|
+
coordinates: IAddressCoordinates;
|
|
26
|
+
}
|
|
27
|
+
export interface IAddressData extends IAddressStore {
|
|
28
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { FulfillmentType } from '@/enums';
|
|
2
|
+
import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface';
|
|
3
|
+
export interface IProductAvailabilityParams {
|
|
4
|
+
identifiers: string[];
|
|
5
|
+
location?: ILocation;
|
|
6
|
+
}
|
|
7
|
+
export interface IProductAvailabilityResponse {
|
|
8
|
+
products: IProduct[];
|
|
9
|
+
retailers: Record<string, IRetailer>;
|
|
10
|
+
}
|
|
11
|
+
export interface IProductVariant {
|
|
12
|
+
retailerId: string;
|
|
13
|
+
shippingFulfillmentId: string;
|
|
14
|
+
onDemandFulfillmentId: string;
|
|
15
|
+
isEngravable: boolean;
|
|
16
|
+
partNumber: string;
|
|
17
|
+
price: number;
|
|
18
|
+
stock: number;
|
|
19
|
+
}
|
|
20
|
+
export interface IProductSize {
|
|
21
|
+
id: string;
|
|
22
|
+
upc: string;
|
|
23
|
+
size: string;
|
|
24
|
+
pack: boolean;
|
|
25
|
+
packDesc: string;
|
|
26
|
+
container: string;
|
|
27
|
+
containerType: string;
|
|
28
|
+
image: string;
|
|
29
|
+
uom: string;
|
|
30
|
+
volume: string;
|
|
31
|
+
maxQuantityPerOrder: number;
|
|
32
|
+
attributes: IProductSizeAttributes;
|
|
33
|
+
shippingVariants: Record<string, IProductVariant>;
|
|
34
|
+
onDemandVariants: Record<string, IProductVariant>;
|
|
35
|
+
}
|
|
36
|
+
export interface IProductFulfillmentHourStatus {
|
|
37
|
+
text: string;
|
|
38
|
+
isOpen: boolean;
|
|
39
|
+
openTime: string;
|
|
40
|
+
isClosed: boolean;
|
|
41
|
+
closeTime: string;
|
|
42
|
+
}
|
|
43
|
+
export interface IProduct {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
htmlDescription: string;
|
|
48
|
+
images: string[];
|
|
49
|
+
brand: string;
|
|
50
|
+
region: string;
|
|
51
|
+
country: string;
|
|
52
|
+
material: string;
|
|
53
|
+
abv: string;
|
|
54
|
+
proof: string;
|
|
55
|
+
age: string;
|
|
56
|
+
color: string;
|
|
57
|
+
flavor: string;
|
|
58
|
+
variety: string;
|
|
59
|
+
appellation: string;
|
|
60
|
+
vintage: string;
|
|
61
|
+
tastingNotes: string;
|
|
62
|
+
catPath: string;
|
|
63
|
+
category: string;
|
|
64
|
+
classification: string;
|
|
65
|
+
type: string;
|
|
66
|
+
subType: string;
|
|
67
|
+
salsifyGrouping: string;
|
|
68
|
+
noAvailabilityPrice: number;
|
|
69
|
+
sizes: Record<string, IProductSize>;
|
|
70
|
+
}
|
|
71
|
+
export interface IFulfillment {
|
|
72
|
+
id: string;
|
|
73
|
+
type: FulfillmentType;
|
|
74
|
+
doesAllowGiftCards: boolean;
|
|
75
|
+
doesAllowPromos: boolean;
|
|
76
|
+
expectationText: string;
|
|
77
|
+
engravingExpectationText: string;
|
|
78
|
+
fee: number;
|
|
79
|
+
timezone: string;
|
|
80
|
+
hourStatus: IProductFulfillmentHourStatus;
|
|
81
|
+
}
|
|
82
|
+
export type IRetailerAddress = IAddressAddress & IAddressCoordinates;
|
|
83
|
+
export interface IRetailer {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
address: IRetailerAddress;
|
|
87
|
+
addressFormatted: string;
|
|
88
|
+
shippingFulfillment: IFulfillment | null;
|
|
89
|
+
onDemandFulfillment: IFulfillment | null;
|
|
90
|
+
}
|
|
91
|
+
export interface IProductSizeEngraving {
|
|
92
|
+
maxLines: number;
|
|
93
|
+
maxCharsPerLine: number;
|
|
94
|
+
fee: number;
|
|
95
|
+
location: string;
|
|
96
|
+
}
|
|
97
|
+
export interface IProductSizeAttributes {
|
|
98
|
+
presale: IProductPresale;
|
|
99
|
+
engraving: IProductSizeEngraving;
|
|
100
|
+
}
|
|
101
|
+
export interface IProductPresale {
|
|
102
|
+
canPurchaseOn: null | string;
|
|
103
|
+
estimatedShipBy: null | string;
|
|
104
|
+
isActive: boolean;
|
|
105
|
+
language: string;
|
|
106
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CartEventEnum } from '@/enums';
|
|
2
|
-
import type {
|
|
3
|
-
import type { IProduct, IProductPresale } from '
|
|
2
|
+
import type { ILocation } from '@/interfaces/api/address.interface';
|
|
3
|
+
import type { IProduct, IProductPresale } from '@/interfaces/api/product.interface';
|
|
4
4
|
import type { IRetailer } from './retailer.interface';
|
|
5
5
|
export interface ICartItemEngraving {
|
|
6
6
|
isEngravable: boolean;
|
|
@@ -110,7 +110,7 @@ export interface ICart {
|
|
|
110
110
|
createdAt: string | Date;
|
|
111
111
|
updatedAt: string | Date;
|
|
112
112
|
items: ICartItem[];
|
|
113
|
-
loc:
|
|
113
|
+
loc: ILocation;
|
|
114
114
|
retailers: ICartRetailer[];
|
|
115
115
|
attributes: ICartAttributes;
|
|
116
116
|
events: ICartEvent[];
|
|
@@ -125,7 +125,7 @@ export interface ICartUpdateItem {
|
|
|
125
125
|
engravingLines?: string[];
|
|
126
126
|
scheduledFor?: string | Date;
|
|
127
127
|
}
|
|
128
|
-
export interface ICartUpdateParams
|
|
128
|
+
export interface ICartUpdateParams {
|
|
129
129
|
id: string;
|
|
130
130
|
items: ICartUpdateItem[];
|
|
131
131
|
promoCode?: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { IProduct } from '@/interfaces/
|
|
2
|
-
import type { ILocBase } from './address.interface';
|
|
1
|
+
import type { IProduct } from '@/interfaces/api/product.interface';
|
|
3
2
|
import type { IRetailer } from './retailer.interface';
|
|
4
3
|
export declare enum ENUM_NAVIGATION_ORDER_DIRECTION_TYPE {
|
|
5
4
|
ASC = "asc",
|
|
@@ -8,7 +7,7 @@ export declare enum ENUM_NAVIGATION_ORDER_DIRECTION_TYPE {
|
|
|
8
7
|
export declare enum ENUM_ORDER_BY {
|
|
9
8
|
PRICE = "price"
|
|
10
9
|
}
|
|
11
|
-
export interface ICatalogParams
|
|
10
|
+
export interface ICatalogParams {
|
|
12
11
|
search?: string;
|
|
13
12
|
pageToken?: string;
|
|
14
13
|
entity?: string;
|
|
@@ -19,6 +18,7 @@ export interface ICatalogParams extends ILocBase {
|
|
|
19
18
|
orderBy?: ENUM_ORDER_BY;
|
|
20
19
|
orderDirection?: ENUM_NAVIGATION_ORDER_DIRECTION_TYPE;
|
|
21
20
|
filters?: Array<Record<any, any>>;
|
|
21
|
+
[key: string]: any;
|
|
22
22
|
}
|
|
23
23
|
export interface ICatalog {
|
|
24
24
|
retailers?: IRetailer[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CheckoutEventEnum } from '@/enums';
|
|
2
|
+
import type { IAddressAddress } from '@/interfaces/api/address.interface';
|
|
2
3
|
import type { ICoreParams } from '@/interfaces/cloud/core.interface';
|
|
3
|
-
import type { IAddress } from './address.interface';
|
|
4
4
|
import type { ICartAttributesPromoCode, ICartItemAttributes } from './cart.interface';
|
|
5
5
|
import type { IRetailerExpectation } from './retailer.interface';
|
|
6
6
|
export interface ICheckoutRecipient {
|
|
@@ -130,7 +130,7 @@ export interface ICheckoutFulfillment extends ICheckoutTotalAmounts {
|
|
|
130
130
|
export interface ICheckoutRetailer extends ICheckoutTotalAmounts {
|
|
131
131
|
id: string;
|
|
132
132
|
name: string;
|
|
133
|
-
address?:
|
|
133
|
+
address?: IAddressAddress;
|
|
134
134
|
fulfillments: ICheckoutFulfillment[];
|
|
135
135
|
}
|
|
136
136
|
export interface ICheckoutItem {
|
|
@@ -188,7 +188,7 @@ export interface ICheckoutPrepareResponse {
|
|
|
188
188
|
acceptedAccountCreation?: boolean;
|
|
189
189
|
giftOptions: ICheckoutGiftOptions;
|
|
190
190
|
marketingPreferences: ICheckoutMarketingPreferences;
|
|
191
|
-
shippingAddress:
|
|
191
|
+
shippingAddress: IAddressAddress;
|
|
192
192
|
billingAddress: ICheckoutBillingAddress;
|
|
193
193
|
amounts: ICheckoutTotalAmounts;
|
|
194
194
|
items: ICheckoutItem[];
|
|
@@ -205,10 +205,7 @@ export interface ICheckoutCompleteParams extends ICoreParams {
|
|
|
205
205
|
payment: string;
|
|
206
206
|
}
|
|
207
207
|
export interface ICheckoutCompleteResponse {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
legacyOrderNumber: string;
|
|
211
|
-
referenceId: string;
|
|
212
|
-
};
|
|
208
|
+
legacyOrderNumber: string;
|
|
209
|
+
referenceId: string;
|
|
213
210
|
}
|
|
214
211
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FulfillmentType } from '@/enums';
|
|
2
2
|
import type { DAYS_OF_WEEK } from '@/enums/cloud.enum';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
4
4
|
export interface IRetailerTimes {
|
|
5
5
|
startsAt: string;
|
|
6
6
|
endsAt: string;
|
|
@@ -62,6 +62,6 @@ export interface IRetailer {
|
|
|
62
62
|
engravingFee?: number;
|
|
63
63
|
subtotal?: number;
|
|
64
64
|
total?: number;
|
|
65
|
-
address?:
|
|
65
|
+
address?: IAddressAddress & IAddressCoordinates;
|
|
66
66
|
fulfillments: IRetailerFulfillments[];
|
|
67
67
|
}
|