@storepecker/storefront-core 1.0.0
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/address-DQEZzyUG.d.cts +19 -0
- package/dist/address-DQEZzyUG.d.ts +19 -0
- package/dist/api/index.cjs +367 -0
- package/dist/api/index.d.cts +127 -0
- package/dist/api/index.d.ts +127 -0
- package/dist/api/index.js +131 -0
- package/dist/booking-ClX-dhX7.d.ts +131 -0
- package/dist/booking-Drl7-IL7.d.cts +131 -0
- package/dist/cart-DVrn8hD0.d.cts +367 -0
- package/dist/cart-DVrn8hD0.d.ts +367 -0
- package/dist/checkout/index.cjs +228 -0
- package/dist/checkout/index.d.cts +251 -0
- package/dist/checkout/index.d.ts +251 -0
- package/dist/checkout/index.js +122 -0
- package/dist/chunk-4CVKE6CC.cjs +312 -0
- package/dist/chunk-4MJMNIAB.js +123 -0
- package/dist/chunk-57ZBPAXU.js +114 -0
- package/dist/chunk-7MQOVWLW.js +40 -0
- package/dist/chunk-7UH6REGV.js +12 -0
- package/dist/chunk-A6IO3HIN.cjs +151 -0
- package/dist/chunk-CFF632IQ.cjs +100 -0
- package/dist/chunk-CSISWBZZ.js +121 -0
- package/dist/chunk-E7WPE3PV.js +98 -0
- package/dist/chunk-FLBJKM6G.js +83 -0
- package/dist/chunk-GB3HW6DM.js +61 -0
- package/dist/chunk-GH75WUO2.cjs +42 -0
- package/dist/chunk-GQTO5ZE2.cjs +96 -0
- package/dist/chunk-JHGXIIBZ.cjs +37 -0
- package/dist/chunk-JQMLHRWL.js +21 -0
- package/dist/chunk-K44JZ5NL.cjs +212 -0
- package/dist/chunk-K5B62JZO.cjs +154 -0
- package/dist/chunk-KWKHHRRJ.cjs +15 -0
- package/dist/chunk-LBGIUNM6.js +30 -0
- package/dist/chunk-LC5ZAUKL.cjs +220 -0
- package/dist/chunk-N3CTXRFT.cjs +30 -0
- package/dist/chunk-QCQCFYYR.js +206 -0
- package/dist/chunk-QM73PI5L.cjs +218 -0
- package/dist/chunk-RCXQJ6XC.cjs +131 -0
- package/dist/chunk-UM24VDYB.js +216 -0
- package/dist/chunk-UXLUE3HW.cjs +69 -0
- package/dist/chunk-WFDKKOO7.js +210 -0
- package/dist/chunk-YUPBTD4M.js +289 -0
- package/dist/components/index.cjs +576 -0
- package/dist/components/index.css +329 -0
- package/dist/components/index.d.cts +58 -0
- package/dist/components/index.d.ts +58 -0
- package/dist/components/index.js +569 -0
- package/dist/coupons-C7iJ-1cy.d.cts +37 -0
- package/dist/coupons-CnfTKL1i.d.ts +37 -0
- package/dist/hooks/index.cjs +381 -0
- package/dist/hooks/index.d.cts +123 -0
- package/dist/hooks/index.d.ts +123 -0
- package/dist/hooks/index.js +364 -0
- package/dist/index-DTyIuLuI.d.cts +18 -0
- package/dist/index-DTyIuLuI.d.ts +18 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/index.cjs +2 -0
- package/dist/models/index.d.cts +53 -0
- package/dist/models/index.d.ts +53 -0
- package/dist/models/index.js +1 -0
- package/dist/orders-CkUzv5Xh.d.ts +159 -0
- package/dist/orders-D0oC9ugD.d.cts +159 -0
- package/dist/phonepe-D7vn-9SR.d.cts +27 -0
- package/dist/phonepe-D7vn-9SR.d.ts +27 -0
- package/dist/store/index.cjs +149 -0
- package/dist/store/index.d.cts +46 -0
- package/dist/store/index.d.ts +46 -0
- package/dist/store/index.js +141 -0
- package/dist/useAddressForm-C-Uzug4d.d.ts +42 -0
- package/dist/useAddressForm-DgkCP1nG.d.cts +42 -0
- package/dist/utils/index.cjs +535 -0
- package/dist/utils/index.d.cts +507 -0
- package/dist/utils/index.d.ts +507 -0
- package/dist/utils/index.js +342 -0
- package/dist/wishlist-BzhnCAQD.d.ts +41 -0
- package/dist/wishlist-CBCZD66Y.d.cts +41 -0
- package/package.json +134 -0
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { ToastOptions } from 'react-toastify';
|
|
2
|
+
|
|
3
|
+
declare enum SLICE_STATUS {
|
|
4
|
+
"IDLE" = "idle",
|
|
5
|
+
LOADING = "loading",
|
|
6
|
+
SUCCESS = "success",
|
|
7
|
+
FAILURE = "failure"
|
|
8
|
+
}
|
|
9
|
+
declare const pathNameMap: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
};
|
|
12
|
+
declare const USER_CREDENTIALS = "____user_cred_";
|
|
13
|
+
declare const USER_CART = "____user_cart_";
|
|
14
|
+
declare const USER_CRED_TOKEN = "____user_cst_";
|
|
15
|
+
declare const USER_CRED_REFRESH_TOKEN = "____user_csr_";
|
|
16
|
+
declare const PRODUCT_STATUSES: Array<string>;
|
|
17
|
+
declare const DEFAULT_TOAST_CONFIG: ToastOptions;
|
|
18
|
+
declare const ALLOWED_COUNTRIES: string[];
|
|
19
|
+
declare const ADDRESS_FORM_SESSION_KEY = "address_form_values";
|
|
20
|
+
|
|
21
|
+
declare namespace Product {
|
|
22
|
+
interface Variant {
|
|
23
|
+
id: number;
|
|
24
|
+
type: "colors" | "color" | "select" | "size" | "input";
|
|
25
|
+
name: string;
|
|
26
|
+
choices?: Array<{
|
|
27
|
+
color?: string;
|
|
28
|
+
label: string;
|
|
29
|
+
id: number;
|
|
30
|
+
inventory?: number;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
interface ProductVariant {
|
|
34
|
+
id: number;
|
|
35
|
+
name: string;
|
|
36
|
+
sku: string;
|
|
37
|
+
actual_price: string;
|
|
38
|
+
selling_price: string;
|
|
39
|
+
stock_quantity: number;
|
|
40
|
+
product: number;
|
|
41
|
+
is_active: boolean;
|
|
42
|
+
is_featured: boolean;
|
|
43
|
+
product_measurements: string;
|
|
44
|
+
attributes: Attributes;
|
|
45
|
+
back_order: boolean;
|
|
46
|
+
back_order_limit: number;
|
|
47
|
+
user_purchase_limit: number;
|
|
48
|
+
status: string;
|
|
49
|
+
product_photos: any[];
|
|
50
|
+
media: string;
|
|
51
|
+
}
|
|
52
|
+
interface ProductDetails {
|
|
53
|
+
title: string;
|
|
54
|
+
description: string;
|
|
55
|
+
}
|
|
56
|
+
interface Root {
|
|
57
|
+
id: number;
|
|
58
|
+
name: string;
|
|
59
|
+
description: string;
|
|
60
|
+
slug: string;
|
|
61
|
+
item_code: string;
|
|
62
|
+
photos: any[];
|
|
63
|
+
product_category: number;
|
|
64
|
+
brand: any;
|
|
65
|
+
badge: string;
|
|
66
|
+
multi_size: boolean;
|
|
67
|
+
size_chart: any;
|
|
68
|
+
is_featured: boolean;
|
|
69
|
+
back_order: boolean;
|
|
70
|
+
back_order_limit: number;
|
|
71
|
+
user_purchase_limit: number;
|
|
72
|
+
status: string;
|
|
73
|
+
is_active: boolean;
|
|
74
|
+
product_variants: ProductVariant[];
|
|
75
|
+
}
|
|
76
|
+
interface ProductList {
|
|
77
|
+
id: number;
|
|
78
|
+
name: string;
|
|
79
|
+
description: string;
|
|
80
|
+
slug: string;
|
|
81
|
+
item_code: string;
|
|
82
|
+
photos: any[];
|
|
83
|
+
product_category: number;
|
|
84
|
+
brand: any;
|
|
85
|
+
badge: string;
|
|
86
|
+
multi_size: boolean;
|
|
87
|
+
size_chart: any;
|
|
88
|
+
sku: string;
|
|
89
|
+
actual_price: string;
|
|
90
|
+
selling_price: string;
|
|
91
|
+
stock_quantity: number;
|
|
92
|
+
product: number;
|
|
93
|
+
is_active: boolean;
|
|
94
|
+
is_featured: boolean;
|
|
95
|
+
is_wishlisted: boolean;
|
|
96
|
+
product_measurements: string;
|
|
97
|
+
attributes: Attributes;
|
|
98
|
+
back_order: boolean;
|
|
99
|
+
back_order_limit: number;
|
|
100
|
+
user_purchase_limit: number;
|
|
101
|
+
status: string;
|
|
102
|
+
product_photos: Photos[];
|
|
103
|
+
media: string;
|
|
104
|
+
booking_service?: BookingService;
|
|
105
|
+
review_summary: {
|
|
106
|
+
average_rating: number;
|
|
107
|
+
total_ratings: number;
|
|
108
|
+
ratings: {
|
|
109
|
+
[key: string]: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
interface ProductResponse {
|
|
114
|
+
count: number;
|
|
115
|
+
current_page: number;
|
|
116
|
+
next: string | null;
|
|
117
|
+
previous: string | null;
|
|
118
|
+
results: ProductList[];
|
|
119
|
+
}
|
|
120
|
+
interface ProductState {
|
|
121
|
+
data: ProductList[];
|
|
122
|
+
status: SLICE_STATUS;
|
|
123
|
+
hasMore: boolean;
|
|
124
|
+
meta?: Meta;
|
|
125
|
+
filter: ProductFilter;
|
|
126
|
+
}
|
|
127
|
+
type ProductFilter = {
|
|
128
|
+
page: number;
|
|
129
|
+
page_size?: number;
|
|
130
|
+
is_service?: boolean;
|
|
131
|
+
[key: string]: any;
|
|
132
|
+
};
|
|
133
|
+
interface Meta {
|
|
134
|
+
count: number;
|
|
135
|
+
next: string | null;
|
|
136
|
+
previous: string | null;
|
|
137
|
+
}
|
|
138
|
+
interface Filter {
|
|
139
|
+
[key: string]: FilterContent[];
|
|
140
|
+
}
|
|
141
|
+
interface FilterContent {
|
|
142
|
+
id: number;
|
|
143
|
+
name: string;
|
|
144
|
+
slug: string;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
interface Photos {
|
|
148
|
+
image: string;
|
|
149
|
+
order: number;
|
|
150
|
+
}
|
|
151
|
+
interface Attributes {
|
|
152
|
+
[key: string]: {
|
|
153
|
+
name: string;
|
|
154
|
+
value: string;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
declare namespace ProductDetail {
|
|
158
|
+
interface Root {
|
|
159
|
+
id: number;
|
|
160
|
+
name: string;
|
|
161
|
+
actual_price: string;
|
|
162
|
+
selling_price: string;
|
|
163
|
+
stock_quantity: number;
|
|
164
|
+
product: Product;
|
|
165
|
+
is_featured: boolean;
|
|
166
|
+
product_measurements: string;
|
|
167
|
+
attributes: Attributes;
|
|
168
|
+
status: string;
|
|
169
|
+
product_photos: Photos[];
|
|
170
|
+
media: string;
|
|
171
|
+
sku: string;
|
|
172
|
+
variants: Variant[];
|
|
173
|
+
variantAttributes: Array<VariantAttribute>;
|
|
174
|
+
quantity: number;
|
|
175
|
+
is_wishlisted: boolean;
|
|
176
|
+
show_quantity: boolean;
|
|
177
|
+
slug: string;
|
|
178
|
+
category_name: string;
|
|
179
|
+
store_url: string;
|
|
180
|
+
store_name: string;
|
|
181
|
+
currency_code: string;
|
|
182
|
+
total_price: string;
|
|
183
|
+
total_tax_amount: number;
|
|
184
|
+
is_custom_product: boolean;
|
|
185
|
+
booking_service?: BookingService;
|
|
186
|
+
fulfillment_time: string;
|
|
187
|
+
review_summary: {
|
|
188
|
+
average_rating: number;
|
|
189
|
+
total_ratings: number;
|
|
190
|
+
ratings: {
|
|
191
|
+
[key: string]: number;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
interface VariantAttribute {
|
|
196
|
+
[key: string]: {
|
|
197
|
+
name: string;
|
|
198
|
+
value: string;
|
|
199
|
+
};
|
|
200
|
+
slug: any;
|
|
201
|
+
}
|
|
202
|
+
interface Product {
|
|
203
|
+
id: number;
|
|
204
|
+
name: string;
|
|
205
|
+
description: string;
|
|
206
|
+
slug: string;
|
|
207
|
+
item_code: string;
|
|
208
|
+
product_category: number;
|
|
209
|
+
brand: any;
|
|
210
|
+
badge: string;
|
|
211
|
+
multi_size: boolean;
|
|
212
|
+
size_chart: string[];
|
|
213
|
+
is_featured: boolean;
|
|
214
|
+
back_order: boolean;
|
|
215
|
+
back_order_limit: number;
|
|
216
|
+
user_purchase_limit: number;
|
|
217
|
+
status: string;
|
|
218
|
+
is_active: boolean;
|
|
219
|
+
photos: any[];
|
|
220
|
+
attributes: {
|
|
221
|
+
[key: string]: ProductAttribute[];
|
|
222
|
+
};
|
|
223
|
+
customizations: Customization[];
|
|
224
|
+
}
|
|
225
|
+
interface Customization {
|
|
226
|
+
name: string;
|
|
227
|
+
customization_type: string;
|
|
228
|
+
customization_options?: Customization[];
|
|
229
|
+
is_mandatory?: boolean;
|
|
230
|
+
additional_price?: string;
|
|
231
|
+
}
|
|
232
|
+
interface Customization {
|
|
233
|
+
name: string;
|
|
234
|
+
value: string;
|
|
235
|
+
}
|
|
236
|
+
interface ProductAttribute {
|
|
237
|
+
order: number;
|
|
238
|
+
name: string;
|
|
239
|
+
value: string;
|
|
240
|
+
}
|
|
241
|
+
interface Variant {
|
|
242
|
+
id: number;
|
|
243
|
+
name: string;
|
|
244
|
+
slug: string;
|
|
245
|
+
actual_price: string;
|
|
246
|
+
selling_price: string;
|
|
247
|
+
stock_quantity: number;
|
|
248
|
+
product: Product2;
|
|
249
|
+
is_featured: boolean;
|
|
250
|
+
product_measurements: string;
|
|
251
|
+
attributes: Attributes;
|
|
252
|
+
status: string;
|
|
253
|
+
product_photos: any[];
|
|
254
|
+
media: string;
|
|
255
|
+
}
|
|
256
|
+
interface Product2 {
|
|
257
|
+
id: number;
|
|
258
|
+
name: string;
|
|
259
|
+
description: string;
|
|
260
|
+
slug: string;
|
|
261
|
+
item_code: string;
|
|
262
|
+
product_category: number;
|
|
263
|
+
brand: any;
|
|
264
|
+
badge: string;
|
|
265
|
+
multi_size: boolean;
|
|
266
|
+
size_chart: string[];
|
|
267
|
+
is_featured: boolean;
|
|
268
|
+
back_order: boolean;
|
|
269
|
+
back_order_limit: number;
|
|
270
|
+
user_purchase_limit: number;
|
|
271
|
+
status: string;
|
|
272
|
+
is_active: boolean;
|
|
273
|
+
photos: any[];
|
|
274
|
+
}
|
|
275
|
+
interface DigitalProductVariant {
|
|
276
|
+
status: "active" | "inactive";
|
|
277
|
+
download_link: string;
|
|
278
|
+
expiry_date: string;
|
|
279
|
+
download_count: number;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
interface WishlistState {
|
|
283
|
+
items: Product.ProductList[];
|
|
284
|
+
count: number;
|
|
285
|
+
}
|
|
286
|
+
interface CustomField {
|
|
287
|
+
name: string;
|
|
288
|
+
id: number;
|
|
289
|
+
field_type: string;
|
|
290
|
+
is_mandatory: boolean;
|
|
291
|
+
placeholder?: string;
|
|
292
|
+
description?: string;
|
|
293
|
+
options?: string[];
|
|
294
|
+
default_value?: string;
|
|
295
|
+
min_value?: number;
|
|
296
|
+
max_value?: number;
|
|
297
|
+
field_order: number;
|
|
298
|
+
}
|
|
299
|
+
interface BookingService {
|
|
300
|
+
id: number;
|
|
301
|
+
service_status: string;
|
|
302
|
+
booking_amount: string;
|
|
303
|
+
pay_at_booking: boolean;
|
|
304
|
+
slot_duration: number;
|
|
305
|
+
available_days: string[];
|
|
306
|
+
operating_hours: OperatingHours;
|
|
307
|
+
blocked_dates: any[];
|
|
308
|
+
special_hours: SpecialHours;
|
|
309
|
+
slot_duration_unit: string;
|
|
310
|
+
max_bookings_per_slot: number;
|
|
311
|
+
buffer_time: number;
|
|
312
|
+
advance_booking_window: number;
|
|
313
|
+
advance_booking_unit: string;
|
|
314
|
+
min_notice_time: number;
|
|
315
|
+
is_slot_based: boolean;
|
|
316
|
+
variants: number[];
|
|
317
|
+
custom_fields: CustomField[];
|
|
318
|
+
}
|
|
319
|
+
type BookingServiceDate = "sunday" | "saturday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday";
|
|
320
|
+
type OperatingHours = {
|
|
321
|
+
[key in BookingServiceDate]: TimeSlot[];
|
|
322
|
+
};
|
|
323
|
+
interface TimeSlot {
|
|
324
|
+
end: string;
|
|
325
|
+
start: string;
|
|
326
|
+
}
|
|
327
|
+
interface SpecialHours {
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
interface CartState {
|
|
331
|
+
cart: Cart.Root | null;
|
|
332
|
+
status: SLICE_STATUS;
|
|
333
|
+
}
|
|
334
|
+
declare namespace Cart {
|
|
335
|
+
interface Root {
|
|
336
|
+
product_variants: ProductDetail.Root[];
|
|
337
|
+
total_amount: number;
|
|
338
|
+
total_quantity: number;
|
|
339
|
+
products_quantity: ProductsQuantity;
|
|
340
|
+
cart_count: number;
|
|
341
|
+
missing_items: Array<any>;
|
|
342
|
+
customization_inputs: Array<CustomizationInput>;
|
|
343
|
+
total_coupon_discount: number;
|
|
344
|
+
variant_discounts: {
|
|
345
|
+
[key: number]: number;
|
|
346
|
+
};
|
|
347
|
+
total_shipping: number;
|
|
348
|
+
total_tax_amount: number;
|
|
349
|
+
}
|
|
350
|
+
interface CustomizationInput {
|
|
351
|
+
id: number;
|
|
352
|
+
product_variant: number;
|
|
353
|
+
customization_option: number;
|
|
354
|
+
customer_wishlist: null;
|
|
355
|
+
customer_order: null;
|
|
356
|
+
customer_cart: number;
|
|
357
|
+
customer_input: string;
|
|
358
|
+
customization_option_name: string;
|
|
359
|
+
customization_option_type: string;
|
|
360
|
+
is_mandatory: boolean;
|
|
361
|
+
}
|
|
362
|
+
interface ProductsQuantity {
|
|
363
|
+
[key: number]: number;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export { type Attributes as A, type BookingService as B, Cart as C, DEFAULT_TOAST_CONFIG as D, type OperatingHours as O, type Photos as P, type SpecialHours as S, type TimeSlot as T, USER_CART as U, type WishlistState as W, type BookingServiceDate as a, type CartState as b, type CustomField as c, Product as d, ProductDetail as e, SLICE_STATUS as f, ADDRESS_FORM_SESSION_KEY as g, ALLOWED_COUNTRIES as h, PRODUCT_STATUSES as i, USER_CREDENTIALS as j, USER_CRED_REFRESH_TOKEN as k, USER_CRED_TOKEN as l, pathNameMap as p };
|