@liquidcommerce/cloud-sdk 1.0.1

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.
Files changed (35) hide show
  1. package/README.md +256 -0
  2. package/dist/index.cjs +1 -0
  3. package/dist/index.esm.js +1 -0
  4. package/dist/liquidcommerce-cloud-sdk.ssr.js +1 -0
  5. package/dist/types/constants/core.constant.d.ts +4 -0
  6. package/dist/types/core/authenticated.service.d.ts +125 -0
  7. package/dist/types/core/cart-helper.service.d.ts +48 -0
  8. package/dist/types/core/catalog-helper.service.d.ts +113 -0
  9. package/dist/types/core/checkout-helper.service.d.ts +76 -0
  10. package/dist/types/core/index.d.ts +7 -0
  11. package/dist/types/core/location-helper.service.d.ts +47 -0
  12. package/dist/types/core/payment-provider.service.d.ts +91 -0
  13. package/dist/types/core/singleton.service.d.ts +138 -0
  14. package/dist/types/enums.d.ts +265 -0
  15. package/dist/types/index.d.ts +1 -0
  16. package/dist/types/index.umd.d.ts +2 -0
  17. package/dist/types/interfaces/address.interface.d.ts +21 -0
  18. package/dist/types/interfaces/cart.interface.d.ts +188 -0
  19. package/dist/types/interfaces/catalog.interface.d.ts +69 -0
  20. package/dist/types/interfaces/catalog.service.interface.d.ts +65 -0
  21. package/dist/types/interfaces/checkout.interface.d.ts +118 -0
  22. package/dist/types/interfaces/liquid-commerce-client.interface.d.ts +597 -0
  23. package/dist/types/interfaces/payment.interface.d.ts +88 -0
  24. package/dist/types/interfaces/retailer.interface.d.ts +63 -0
  25. package/dist/types/interfaces/user.interface.d.ts +53 -0
  26. package/dist/types/liquid-commerce-client.d.ts +189 -0
  27. package/dist/types/services/address.service.d.ts +44 -0
  28. package/dist/types/services/cart.service.d.ts +31 -0
  29. package/dist/types/services/catalog.service.d.ts +38 -0
  30. package/dist/types/services/checkout.service.d.ts +28 -0
  31. package/dist/types/services/payment.service.d.ts +39 -0
  32. package/dist/types/services/user.service.d.ts +43 -0
  33. package/dist/types/types.d.ts +36 -0
  34. package/package.json +108 -0
  35. package/umd/liquidcommerce-cloud-sdk.min.js +1 -0
@@ -0,0 +1,265 @@
1
+ export declare enum LIQUID_COMMERCE_ENV {
2
+ DEV = "dev",
3
+ STAGE = "stage"
4
+ }
5
+ export declare enum ENUM_MODALITIES {
6
+ ON_DEMAND = "onDemand",
7
+ SHIPPING = "shipping"
8
+ }
9
+ export declare enum DAYS_OF_WEEK {
10
+ MONDAY = "monday",
11
+ TUESDAY = "tuesday",
12
+ WEDNESDAY = "wednesday",
13
+ THURSDAY = "thursday",
14
+ FRIDAY = "friday",
15
+ SATURDAY = "saturday",
16
+ SUNDAY = "sunday"
17
+ }
18
+ export declare enum STATES_CODE {
19
+ AL = "AL",
20
+ AK = "AK",
21
+ AR = "AR",
22
+ CA = "CA",
23
+ CO = "CO",
24
+ CT = "CT",
25
+ DE = "DE",
26
+ DC = "DC",
27
+ FL = "FL",
28
+ GA = "GA",
29
+ HI = "HI",
30
+ ID = "ID",
31
+ IL = "IL",
32
+ IN = "IN",
33
+ IA = "IA",
34
+ KS = "KS",
35
+ KY = "KY",
36
+ LA = "LA",
37
+ ME = "ME",
38
+ MD = "MD",
39
+ MA = "MA",
40
+ MI = "MI",
41
+ MN = "MN",
42
+ MS = "MS",
43
+ MO = "MO",
44
+ MT = "MT",
45
+ NE = "NE",
46
+ NV = "NV",
47
+ NH = "NH",
48
+ NJ = "NJ",
49
+ NM = "NM",
50
+ NY = "NY",
51
+ NC = "NC",
52
+ ND = "ND",
53
+ OH = "OH",
54
+ OK = "OK",
55
+ OR = "OR",
56
+ PA = "PA",
57
+ RI = "RI",
58
+ SC = "SC",
59
+ SD = "SD",
60
+ TN = "TN",
61
+ TX = "TX",
62
+ UT = "UT",
63
+ VT = "VT",
64
+ VA = "VA",
65
+ WA = "WA",
66
+ WV = "WV",
67
+ WI = "WI",
68
+ WY = "WY"
69
+ }
70
+ export declare enum STATES_NAME {
71
+ ALABAMA = "AL",
72
+ ALASKA = "AK",
73
+ ARKANSAS = "AR",
74
+ CALIFORNIA = "CA",
75
+ COLORADO = "CO",
76
+ CONNECTICUT = "CT",
77
+ DELAWARE = "DE",
78
+ DISTRICT_OF_COLUMBIA = "DC",
79
+ FLORIDA = "FL",
80
+ GEORGIA = "GA",
81
+ HAWAII = "HI",
82
+ IDAHO = "ID",
83
+ ILLINOIS = "IL",
84
+ INDIANA = "IN",
85
+ IOWA = "IA",
86
+ KANSAS = "KS",
87
+ KENTUCKY = "KY",
88
+ LOUISIANA = "LA",
89
+ MAINE = "ME",
90
+ MARYLAND = "MD",
91
+ MASSACHUSETTS = "MA",
92
+ MICHIGAN = "MI",
93
+ MINNESOTA = "MN",
94
+ MISSISSIPPI = "MS",
95
+ MISSOURI = "MO",
96
+ MONTANA = "MT",
97
+ NEBRASKA = "NE",
98
+ NEVADA = "NV",
99
+ NEW_HAMPSHIRE = "NH",
100
+ NEW_JERSEY = "NJ",
101
+ NEW_MEXICO = "NM",
102
+ NEW_YORK = "NY",
103
+ NORTH_CAROLINA = "NC",
104
+ NORTH_DAKOTA = "ND",
105
+ OHIO = "OH",
106
+ OKLAHOMA = "OK",
107
+ OREGON = "OR",
108
+ PENNSYLVANIA = "PA",
109
+ RHODE_ISLAND = "RI",
110
+ SOUTH_CAROLINA = "SC",
111
+ SOUTH_DAKOTA = "SD",
112
+ TENNESSEE = "TN",
113
+ TEXAS = "TX",
114
+ UTAH = "UT",
115
+ VERMONT = "VT",
116
+ VIRGINIA = "VA",
117
+ WASHINGTON = "WA",
118
+ WEST_VIRGINIA = "WV",
119
+ WISCONSIN = "WI",
120
+ WYOMING = "WY"
121
+ }
122
+ export declare enum ENUM_BEER {
123
+ ALE = "BEER > ALE",
124
+ LAGER = "BEER > LAGER",
125
+ MAIN = "BEER",
126
+ NON_ALCOHOLIC = "BEER > NON-ALCOHOLIC",
127
+ OTHER_BEER = "BEER > OTHER BEER"
128
+ }
129
+ export declare enum ENUM_FOOD {
130
+ BASE = "FOOD",
131
+ PANTRY_OTHER = "FOOD > PANTRY > OTHER"
132
+ }
133
+ export declare enum ENUM_MERCHANDISE {
134
+ BASE = "MERCHANDISE",
135
+ GLASSWARE = "MERCHANDISE > GLASSWARE",
136
+ HUMIDOR = "MERCHANDISE > HUMIDOR"
137
+ }
138
+ export declare enum ENUM_MISCELLANEOUS {
139
+ BASE = "MISCELLANEOUS",
140
+ GIFT_CARD = "MISCELLANEOUS > GIFT CARDS",
141
+ PROMOTIONAL = "MISCELLANEOUS > PROMOTIONAL",
142
+ MEMBERSHIP = "MISCELLANEOUS > MEMBERSHIP"
143
+ }
144
+ export declare enum ENUM_NON_ALCOHOLIC {
145
+ BASE = "NON ALCOHOLIC",
146
+ BITTERS = "NON ALCOHOLIC > BITTERS",
147
+ COCKTAIL_MIX = "NON ALCOHOLIC > COCKTAIL MIX",
148
+ COFFEE = "NON ALCOHOLIC > COFFEE",
149
+ ENERGY_DRINKS = "NON ALCOHOLIC > ENERGY DRINKS",
150
+ JUICE = "NON ALCOHOLIC > JUICE",
151
+ SODA = "NON ALCOHOLIC > SODA",
152
+ SPECIALTY_ITEM = "NON ALCOHOLIC > SPECIALTY ITEM",
153
+ SPIRITS = "NON ALCOHOLIC > SPIRITS",
154
+ TEA = "NON ALCOHOLIC > TEA",
155
+ WATER = "NON ALCOHOLIC > WATER",
156
+ WINE = "NON ALCOHOLIC > WINE"
157
+ }
158
+ export declare enum ENUM_READY_TO_DRINK {
159
+ BASE = "READY TO DRINK",
160
+ HARD_CIDER = "READY TO DRINK > HARD CIDER",
161
+ HARD_CIDER_PERRY_PEAR_CIDER = "READY TO DRINK > HARD CIDER > PERRY (PEAR CIDER)",
162
+ HARD_TEA = "READY TO DRINK > HARD TEA",
163
+ MALT_BASED = "READY TO DRINK > MALT BASED",
164
+ SPIRITS_BASED_RTDS = "READY TO DRINK > SPIRITS-BASED RTDS",
165
+ SPIRITS_BASED_RTDS_RUM_COCKTAILS = "READY TO DRINK > SPIRITS-BASED RTDS > RUM COCKTAILS",
166
+ SPIRITS_BASED_RTDS_TEQUILA_COCKTAILS = "READY TO DRINK > SPIRITS-BASED RTDS > TEQUILA COCKTAILS",
167
+ SPIRITS_BASED_RTDS_VODKA_COCKTAILS = "READY TO DRINK > SPIRITS-BASED RTDS > VODKA COCKTAILS",
168
+ SPIRITS_BASED_RTDS_WHISKEY_COCKTAILS = "READY TO DRINK > SPIRITS-BASED RTDS > WHISKEY COCKTAILS",
169
+ WINE_COCKTAILS = "READY TO DRINK > WINE COCKTAILS"
170
+ }
171
+ export declare enum ENUM_SPIRITS {
172
+ BASE = "SPIRITS",
173
+ BAIJIU = "SPIRITS > BAIJIU",
174
+ BITTERS = "SPIRITS > BITTERS",
175
+ BRANDY = "SPIRITS > BRANDY",
176
+ CACHACA = "SPIRITS > CACHACA",
177
+ GIN = "SPIRITS > GIN",
178
+ LAGER = "SPIRITS > LAGER",
179
+ LIQUEUR = "SPIRITS > LIQUEUR",
180
+ MEZCAL = "SPIRITS > MEZCAL",
181
+ OTHER_SPIRITS = "SPIRITS > OTHER SPIRITS",
182
+ RUM = "SPIRITS > RUM",
183
+ RUM_AGED_RUM = "SPIRITS > RUM > AGED RUM",
184
+ RUM_DARK_RUM = "SPIRITS > RUM > DARK RUM",
185
+ RUM_FLAVORED_RUM = "SPIRITS > RUM > FLAVORED RUM",
186
+ RUM_GOLD_RUM = "SPIRITS > RUM > GOLD RUM",
187
+ RUM_OTHER = "SPIRITS > RUM > OTHER",
188
+ RUM_SPICED = "SPIRITS > RUM > SPICED",
189
+ RUM_WHITE_RUM = "SPIRITS > RUM > WHITE RUM",
190
+ SOJU = "SPIRITS > SOJU",
191
+ TEQUILA = "SPIRITS > TEQUILA",
192
+ VODKA = "SPIRITS > VODKA",
193
+ VODKA_FLAVORED_VODKA = "SPIRITS > VODKA > FLAVORED VODKA",
194
+ WHISKEY = "SPIRITS > WHISKEY",
195
+ WHISKEY_AMERICAN_WHISKEY = "SPIRITS > WHISKEY > AMERICAN WHISKEY",
196
+ WHISKEY_BOURBON = "SPIRITS > WHISKEY > BOURBON",
197
+ WHISKEY_CANADIAN_WHISKEY = "SPIRITS > WHISKEY > CANADIAN WHISKEY",
198
+ WHISKEY_IRISH_WHISKEY = "SPIRITS > WHISKEY > IRISH WHISKEY",
199
+ WHISKEY_SCOTCH = "SPIRITS > WHISKEY > SCOTCH"
200
+ }
201
+ export declare enum ENUM_WINE {
202
+ BASE = "WINE",
203
+ CHAMPAGNE_SPARKLING = "WINE > CHAMPAGNE & SPARKLING",
204
+ CHAMPAGNE_SPARKLING_SPARKLING_WINE = "WINE > CHAMPAGNE & SPARKLING > SPARKLING WINE",
205
+ COOKING = "WINE > COOKING",
206
+ DESSERT_FORTIFIED_WINE = "WINE > DESSERT & FORTIFIED WINE",
207
+ DESSERT_FORTIFIED_WINE_SHERRY = "WINE > DESSERT & FORTIFIED WINE > SHERRY",
208
+ RED_WINE = "WINE > RED WINE",
209
+ ROSE_WINE = "WINE > ROSE WINE",
210
+ SAKE = "WINE > SAKE",
211
+ WHITE_WINE = "WINE > WHITE WINE"
212
+ }
213
+ export declare enum ENUM_FILTER_KEYS {
214
+ BRANDS = "brands",
215
+ FLAVOR = "flavor",
216
+ REGION = "region",
217
+ VARIETY = "variety",
218
+ PRICE = "price",
219
+ AVAILABILITY = "availability",
220
+ CATEGORIES = "categories",
221
+ SIZES = "sizes",
222
+ COLORS = "colors",
223
+ APPELLATION = "appellation",
224
+ COUNTRY = "country",
225
+ VINTAGE = "vintage",
226
+ MATERIALS = "materials"
227
+ }
228
+ export declare enum ENUM_NAVIGATION_ORDER_DIRECTION_TYPE {
229
+ ASC = "asc",
230
+ DESC = "desc"
231
+ }
232
+ export declare enum ENUM_ORDER_BY {
233
+ PRICE = "price"
234
+ }
235
+ export declare enum ENUM_AVAILABILITY_VALUE {
236
+ UNSPECIFIED = "AVAILABILITY_UNSPECIFIED",
237
+ IN_STOCK = "IN_STOCK",
238
+ OUT_OF_STOCK = "OUT_OF_STOCK",
239
+ PREORDER = "PREORDER",
240
+ BACKORDER = "BACKORDER"
241
+ }
242
+ export declare enum CART_PARAM_ERROR_ENUM {
243
+ INVALID_ITEMS_TYPE = "Items must be a non-empty array",
244
+ INVALID_ITEMS_MAX = "You can only send up to 25 items at a time!",
245
+ INVALID_PART_NUMBER = "The partnerNumber provided is invalid",
246
+ INVALID_FULFILLMENT_ID = "The fulfillmentId provided is invalid"
247
+ }
248
+ export declare enum CART_EVENT_ENUM {
249
+ OOS = "OutOfStock",
250
+ ITEMS_NOT_ADDED = "ItemsNotAdded",
251
+ ITEM_NOT_ENGRAVED = "ItemEngravingError",
252
+ ADDRESS_CHANGE = "AddressChange",
253
+ RETAILER_MIN = "RetailerMinNotMet",
254
+ NO_ITEMS_IN_CART = "NoItemsInCart",
255
+ INVALID_ID = "InvalidId",
256
+ NO_ID = "NoId",
257
+ CART_CHECKOUT_PROCESSED = "CartCheckoutProcessed",
258
+ NEW_CART = "NewCart",
259
+ DEFAULT = "CartError",
260
+ ITEM_QTY_CHANGE = "ItemQuantityChange"
261
+ }
262
+ export declare enum ENUM_ADDRESS_TYPE {
263
+ SHIPPING = "shipping",
264
+ BILLING = "billing"
265
+ }
@@ -0,0 +1 @@
1
+ export { LIQUID_COMMERCE_ENV, LiquidCommerce } from './liquid-commerce-client';
@@ -0,0 +1,2 @@
1
+ import { LIQUID_COMMERCE_ENV, LiquidCommerce } from './index';
2
+ export { LIQUID_COMMERCE_ENV, LiquidCommerce };
@@ -0,0 +1,21 @@
1
+ import type { ICoreParams } from '../types';
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
+ }
@@ -0,0 +1,188 @@
1
+ import type { CART_EVENT_ENUM } from '../enums';
2
+ import type { ILoc, ILocBase } from './address.interface';
3
+ import type { IProduct } from './catalog.interface';
4
+ import type { IRetailer } from './retailer.interface';
5
+ /**
6
+ * Represents the engraving information for a cart item.
7
+ *
8
+ * @interface ICartItemEngraving
9
+ * @property {boolean} isEngravable - Indicates whether the item is engravable or not.
10
+ * @property {boolean} hasEngraving - Indicates whether the item has engraving or not.
11
+ * @property {number} fee - The fee associated with engraving the item.
12
+ * @property {number} maxCharsPerLine - The maximum number of characters allowed per line for the engraving.
13
+ * @property {number} maxLines - The maximum number of lines allowed for the engraving.
14
+ * @property {string} location - The location or area where the engraving should be placed on the item.
15
+ * @property {string[]} lines - The content of each line of the engraving.
16
+ */
17
+ export interface ICartItemEngraving {
18
+ isEngravable: boolean;
19
+ hasEngraving: boolean;
20
+ fee: number;
21
+ maxCharsPerLine: number;
22
+ maxLines: number;
23
+ location: string;
24
+ lines: string[];
25
+ }
26
+ /**
27
+ * Represents an item in a gift cart.
28
+ *
29
+ * @interface ICartItemGiftCart
30
+ * @property {string} sender - The sender of the gift.
31
+ * @property {string} message - The message attached to the gift.
32
+ * @property {string[]} recipients - The list of recipients of the gift.
33
+ * @property {string} sendDate - The date when the gift should be sent.
34
+ */
35
+ export interface ICartItemGiftCart {
36
+ sender: string;
37
+ message: string;
38
+ recipients: string[];
39
+ sendDate: string;
40
+ }
41
+ /**
42
+ * Represents the attributes of a cart item.
43
+ * @interface
44
+ */
45
+ export interface ICartItemAttributes {
46
+ engraving: ICartItemEngraving;
47
+ giftCard: ICartItemGiftCart;
48
+ }
49
+ /**
50
+ * Interface representing a cart item.
51
+ * @interface
52
+ */
53
+ export interface ICartItem extends Partial<IProduct> {
54
+ id: string;
55
+ variantId: string;
56
+ liquidId: string;
57
+ retailerId: string;
58
+ partNumber: string;
59
+ fulfillmentId: string;
60
+ quantity: number;
61
+ customerPlacement: string;
62
+ maxQuantity: number;
63
+ unitPrice: number;
64
+ availableAt: string;
65
+ attributes: ICartItemAttributes;
66
+ }
67
+ /**
68
+ * Represents the attributes of a promo code in a cart.
69
+ * @interface
70
+ */
71
+ export interface ICartAttributesPromoCode {
72
+ value: string;
73
+ freeDelivery: boolean;
74
+ freeServiceFee: boolean;
75
+ freeShipping: boolean;
76
+ }
77
+ /**
78
+ * Represents the attributes of a gift card in a cart.
79
+ *
80
+ * @interface ICartAttributesGiftCard
81
+ * @memberof module:cart
82
+ * @property {string} code - The code of the gift card.
83
+ * @property {number} value - The value of the gift card in the cart.
84
+ */
85
+ export interface ICartAttributesGiftCard {
86
+ code: string;
87
+ value: number;
88
+ }
89
+ /**
90
+ * Represents the attributes, amounts, and fees associated with a cart.
91
+ */
92
+ export interface ICartAttributesAmountsFees {
93
+ shipping: number;
94
+ onDemand: number;
95
+ }
96
+ /**
97
+ * Interface representing the attributes, amounts, and discounts for a cart.
98
+ * @interface
99
+ */
100
+ export interface ICartAttributesAmountsDiscounts {
101
+ shipping: number;
102
+ onDemand: number;
103
+ engraving: number;
104
+ service: number;
105
+ products: number;
106
+ }
107
+ /**
108
+ * Represents the attribute amounts of a cart.
109
+ */
110
+ export interface ICartAttributesAmounts {
111
+ fees: ICartAttributesAmountsFees;
112
+ discounts: ICartAttributesAmountsDiscounts;
113
+ }
114
+ /**
115
+ * Represents the attributes of a cart.
116
+ * @interface
117
+ */
118
+ export interface ICartAttributes {
119
+ promoCode: ICartAttributesPromoCode;
120
+ giftCards: ICartAttributesGiftCard[];
121
+ amounts: ICartAttributesAmounts;
122
+ }
123
+ /**
124
+ * Represents a retailer with additional properties related to a cart.
125
+ *
126
+ * @interface ICartRetailer
127
+ * @extends IRetailer
128
+ */
129
+ export interface ICartRetailer extends IRetailer {
130
+ platformFee: number;
131
+ engravingFee: number;
132
+ deliveryFee: number;
133
+ shippingFee: number;
134
+ subtotal: number;
135
+ total: number;
136
+ }
137
+ /**
138
+ * Represents an event related to a shopping cart.
139
+ */
140
+ export interface ICartEvent {
141
+ type: CART_EVENT_ENUM;
142
+ message: string;
143
+ items?: Array<Partial<ICartItem>>;
144
+ }
145
+ /**
146
+ * Interface representing a shopping cart.
147
+ */
148
+ export interface ICart {
149
+ id: string;
150
+ quantity: number;
151
+ platformFee: number;
152
+ deliveryFee: number;
153
+ shippingFee: number;
154
+ engravingFee: number;
155
+ discounts: number;
156
+ giftCardTotal: number;
157
+ subtotal: number;
158
+ total: number;
159
+ createdAt: string;
160
+ updatedAt: string;
161
+ items: ICartItem[];
162
+ loc: ILoc;
163
+ retailers: ICartRetailer[];
164
+ attributes: ICartAttributes;
165
+ events: ICartEvent[];
166
+ }
167
+ /**
168
+ * Represents an item to be updated in a shopping cart.
169
+ */
170
+ export interface ICartUpdateItem {
171
+ id?: string;
172
+ partNumber: string;
173
+ sku?: string;
174
+ quantity: number;
175
+ fulfillmentId: string;
176
+ engravingLines?: string[];
177
+ scheduledFor?: string | Date;
178
+ }
179
+ /**
180
+ * Represents the parameters for updating a cart.
181
+ * @interface
182
+ */
183
+ export interface ICartUpdateParams extends ILocBase {
184
+ id: string;
185
+ items: ICartUpdateItem[];
186
+ promoCode?: string;
187
+ giftCards?: string[];
188
+ }
@@ -0,0 +1,69 @@
1
+ import type { ENUM_MODALITIES } from '../enums';
2
+ export interface IProductFulfillmentTypes {
3
+ shipping: string;
4
+ onDemand: string;
5
+ }
6
+ export interface IProductVariant {
7
+ partNumber: string;
8
+ retailerId: string;
9
+ price: number;
10
+ modalities?: ENUM_MODALITIES;
11
+ salePrice: number;
12
+ isEngravable: boolean;
13
+ stock: number;
14
+ fulfillments: string[];
15
+ fulfillmentTypes: IProductFulfillmentTypes;
16
+ }
17
+ export interface IProductSizeEngraving {
18
+ status: boolean;
19
+ validated?: boolean;
20
+ maxLines: number;
21
+ maxCharsPerLine: number;
22
+ fee: number;
23
+ location: string;
24
+ }
25
+ export interface IProductSizeAttributes {
26
+ engraving?: IProductSizeEngraving;
27
+ }
28
+ export interface IProductSize {
29
+ upc: string;
30
+ size: string;
31
+ image: string;
32
+ pack: boolean;
33
+ packDesc: string;
34
+ container: string;
35
+ containerType: string;
36
+ attributes: IProductSizeAttributes;
37
+ modalities?: ENUM_MODALITIES;
38
+ variants: IProductVariant[];
39
+ }
40
+ export interface IProduct {
41
+ name: string;
42
+ brand: string;
43
+ catPath: string;
44
+ category: string;
45
+ classification: string;
46
+ type: string;
47
+ size?: string;
48
+ modalities?: ENUM_MODALITIES;
49
+ subType: string;
50
+ region: string;
51
+ country: string;
52
+ material: string;
53
+ abv: string;
54
+ age: string;
55
+ pack?: boolean;
56
+ packDesc?: string;
57
+ container?: string;
58
+ containerType?: string;
59
+ color: string;
60
+ flavor: string;
61
+ variety: string;
62
+ appellation: string;
63
+ vintage: string;
64
+ description: string;
65
+ htmlDescription: string;
66
+ tastingNotes: string;
67
+ images: string[];
68
+ sizes: IProductSize[];
69
+ }
@@ -0,0 +1,65 @@
1
+ import type { ENUM_AVAILABILITY_VALUE, ENUM_FILTER_KEYS, ENUM_NAVIGATION_ORDER_DIRECTION_TYPE, ENUM_ORDER_BY } from '../enums';
2
+ import type { LiquidTaxonomy } from '../types';
3
+ import type { ILocBase } from './address.interface';
4
+ import type { IProduct } from './catalog.interface';
5
+ import type { IRetailer } from './retailer.interface';
6
+ interface ICategoryFilter {
7
+ key: ENUM_FILTER_KEYS.CATEGORIES | 'categories';
8
+ values: LiquidTaxonomy[];
9
+ }
10
+ interface IPriceFilter {
11
+ key: ENUM_FILTER_KEYS.PRICE | 'price';
12
+ values: {
13
+ min?: number | string;
14
+ max?: number | string;
15
+ };
16
+ }
17
+ interface IAvailabilityFilter {
18
+ key: ENUM_FILTER_KEYS.AVAILABILITY | 'availability';
19
+ values: ENUM_AVAILABILITY_VALUE | keyof typeof ENUM_AVAILABILITY_VALUE;
20
+ }
21
+ interface IFilter {
22
+ key: Omit<ENUM_FILTER_KEYS, ENUM_FILTER_KEYS.CATEGORIES | ENUM_FILTER_KEYS.PRICE | ENUM_FILTER_KEYS.AVAILABILITY>;
23
+ values: string | string[] | number | number[];
24
+ }
25
+ export interface ICatalogParams extends ILocBase {
26
+ search?: string;
27
+ pageToken?: string;
28
+ entity?: string;
29
+ page?: number;
30
+ perPage?: number;
31
+ visitorId?: string;
32
+ orderBy?: ENUM_ORDER_BY;
33
+ orderDirection?: ENUM_NAVIGATION_ORDER_DIRECTION_TYPE;
34
+ filters?: Array<ICategoryFilter | IPriceFilter | IAvailabilityFilter | IFilter>;
35
+ }
36
+ export interface ICatalog {
37
+ retailers?: IRetailer[] | Array<Record<string, any>>;
38
+ products?: IProduct[] | Array<Record<string, any>>;
39
+ navigation?: INavigationSchema;
40
+ }
41
+ interface IFilterValue {
42
+ value: LiquidTaxonomy | ENUM_AVAILABILITY_VALUE | string;
43
+ count: number;
44
+ }
45
+ interface IFilterSchema {
46
+ bucket: ENUM_FILTER_KEYS;
47
+ values: IFilterValue[];
48
+ }
49
+ interface ICursorSchema {
50
+ nextPageToken: string;
51
+ previousPageToken: string;
52
+ }
53
+ interface INavigationSchema {
54
+ id: string;
55
+ correctedQuery: string;
56
+ attributionToken: string;
57
+ currentPage: number;
58
+ totalPages: number;
59
+ totalCount: number;
60
+ availableOrderBy: ENUM_ORDER_BY[];
61
+ availableOrderDirection: ENUM_NAVIGATION_ORDER_DIRECTION_TYPE[];
62
+ cursor: ICursorSchema;
63
+ filters: IFilterSchema[];
64
+ }
65
+ export {};