@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.
Files changed (80) hide show
  1. package/dist/address-DQEZzyUG.d.cts +19 -0
  2. package/dist/address-DQEZzyUG.d.ts +19 -0
  3. package/dist/api/index.cjs +367 -0
  4. package/dist/api/index.d.cts +127 -0
  5. package/dist/api/index.d.ts +127 -0
  6. package/dist/api/index.js +131 -0
  7. package/dist/booking-ClX-dhX7.d.ts +131 -0
  8. package/dist/booking-Drl7-IL7.d.cts +131 -0
  9. package/dist/cart-DVrn8hD0.d.cts +367 -0
  10. package/dist/cart-DVrn8hD0.d.ts +367 -0
  11. package/dist/checkout/index.cjs +228 -0
  12. package/dist/checkout/index.d.cts +251 -0
  13. package/dist/checkout/index.d.ts +251 -0
  14. package/dist/checkout/index.js +122 -0
  15. package/dist/chunk-4CVKE6CC.cjs +312 -0
  16. package/dist/chunk-4MJMNIAB.js +123 -0
  17. package/dist/chunk-57ZBPAXU.js +114 -0
  18. package/dist/chunk-7MQOVWLW.js +40 -0
  19. package/dist/chunk-7UH6REGV.js +12 -0
  20. package/dist/chunk-A6IO3HIN.cjs +151 -0
  21. package/dist/chunk-CFF632IQ.cjs +100 -0
  22. package/dist/chunk-CSISWBZZ.js +121 -0
  23. package/dist/chunk-E7WPE3PV.js +98 -0
  24. package/dist/chunk-FLBJKM6G.js +83 -0
  25. package/dist/chunk-GB3HW6DM.js +61 -0
  26. package/dist/chunk-GH75WUO2.cjs +42 -0
  27. package/dist/chunk-GQTO5ZE2.cjs +96 -0
  28. package/dist/chunk-JHGXIIBZ.cjs +37 -0
  29. package/dist/chunk-JQMLHRWL.js +21 -0
  30. package/dist/chunk-K44JZ5NL.cjs +212 -0
  31. package/dist/chunk-K5B62JZO.cjs +154 -0
  32. package/dist/chunk-KWKHHRRJ.cjs +15 -0
  33. package/dist/chunk-LBGIUNM6.js +30 -0
  34. package/dist/chunk-LC5ZAUKL.cjs +220 -0
  35. package/dist/chunk-N3CTXRFT.cjs +30 -0
  36. package/dist/chunk-QCQCFYYR.js +206 -0
  37. package/dist/chunk-QM73PI5L.cjs +218 -0
  38. package/dist/chunk-RCXQJ6XC.cjs +131 -0
  39. package/dist/chunk-UM24VDYB.js +216 -0
  40. package/dist/chunk-UXLUE3HW.cjs +69 -0
  41. package/dist/chunk-WFDKKOO7.js +210 -0
  42. package/dist/chunk-YUPBTD4M.js +289 -0
  43. package/dist/components/index.cjs +576 -0
  44. package/dist/components/index.css +329 -0
  45. package/dist/components/index.d.cts +58 -0
  46. package/dist/components/index.d.ts +58 -0
  47. package/dist/components/index.js +569 -0
  48. package/dist/coupons-C7iJ-1cy.d.cts +37 -0
  49. package/dist/coupons-CnfTKL1i.d.ts +37 -0
  50. package/dist/hooks/index.cjs +381 -0
  51. package/dist/hooks/index.d.cts +123 -0
  52. package/dist/hooks/index.d.ts +123 -0
  53. package/dist/hooks/index.js +364 -0
  54. package/dist/index-DTyIuLuI.d.cts +18 -0
  55. package/dist/index-DTyIuLuI.d.ts +18 -0
  56. package/dist/index.cjs +14 -0
  57. package/dist/index.d.cts +1 -0
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.js +1 -0
  60. package/dist/models/index.cjs +2 -0
  61. package/dist/models/index.d.cts +53 -0
  62. package/dist/models/index.d.ts +53 -0
  63. package/dist/models/index.js +1 -0
  64. package/dist/orders-CkUzv5Xh.d.ts +159 -0
  65. package/dist/orders-D0oC9ugD.d.cts +159 -0
  66. package/dist/phonepe-D7vn-9SR.d.cts +27 -0
  67. package/dist/phonepe-D7vn-9SR.d.ts +27 -0
  68. package/dist/store/index.cjs +149 -0
  69. package/dist/store/index.d.cts +46 -0
  70. package/dist/store/index.d.ts +46 -0
  71. package/dist/store/index.js +141 -0
  72. package/dist/useAddressForm-C-Uzug4d.d.ts +42 -0
  73. package/dist/useAddressForm-DgkCP1nG.d.cts +42 -0
  74. package/dist/utils/index.cjs +535 -0
  75. package/dist/utils/index.d.cts +507 -0
  76. package/dist/utils/index.d.ts +507 -0
  77. package/dist/utils/index.js +342 -0
  78. package/dist/wishlist-BzhnCAQD.d.ts +41 -0
  79. package/dist/wishlist-CBCZD66Y.d.cts +41 -0
  80. package/package.json +134 -0
@@ -0,0 +1,364 @@
1
+ import { getUserDetails } from '../chunk-7UH6REGV.js';
2
+ import { useCartStore } from '../chunk-7MQOVWLW.js';
3
+ import { getCart, getProductDetail, getWishlist, getProductCategories, getProductList } from '../chunk-57ZBPAXU.js';
4
+ import '../chunk-E7WPE3PV.js';
5
+ import { processPayment, fetchAvailableCoupons, fetchAppliedCoupon, applyCheckoutCoupon, removeCheckoutCoupon } from '../chunk-QCQCFYYR.js';
6
+ import { getOrders, placeOrder } from '../chunk-4MJMNIAB.js';
7
+ import '../chunk-WFDKKOO7.js';
8
+ export { useAddressForm } from '../chunk-UM24VDYB.js';
9
+ import { getAddresses } from '../chunk-LBGIUNM6.js';
10
+ import '../chunk-YUPBTD4M.js';
11
+ import '../chunk-CSISWBZZ.js';
12
+ import '../chunk-GB3HW6DM.js';
13
+ import '../chunk-FLBJKM6G.js';
14
+ import '../chunk-JQMLHRWL.js';
15
+ import { useState, useRef, useCallback, useEffect } from 'react';
16
+
17
+ var useAddress = () => {
18
+ const [data, setData] = useState([]);
19
+ const [error, setError] = useState(null);
20
+ const [isLoading, setIsLoading] = useState(true);
21
+ const hasFetched = useRef(false);
22
+ const fetchData = useCallback(async () => {
23
+ try {
24
+ setIsLoading(true);
25
+ const result = await getAddresses("/store/customer_address/");
26
+ setData(result || []);
27
+ setError(null);
28
+ } catch (err) {
29
+ setError(err);
30
+ } finally {
31
+ setIsLoading(false);
32
+ }
33
+ }, []);
34
+ useEffect(() => {
35
+ if (!hasFetched.current) {
36
+ hasFetched.current = true;
37
+ fetchData();
38
+ }
39
+ }, [fetchData]);
40
+ return { data, error, isLoading, mutate: fetchData };
41
+ };
42
+ var useCart = (addressId) => {
43
+ const [data, setData] = useState(void 0);
44
+ const [error, setError] = useState(null);
45
+ const [isLoading, setIsLoading] = useState(true);
46
+ const fetchData = useCallback(
47
+ async (addrId) => {
48
+ try {
49
+ setIsLoading(true);
50
+ const result = await getCart("/customer/cart/", addrId ?? addressId);
51
+ setData(result);
52
+ setError(null);
53
+ } catch (err) {
54
+ setError(err);
55
+ } finally {
56
+ setIsLoading(false);
57
+ }
58
+ },
59
+ [addressId]
60
+ );
61
+ useEffect(() => {
62
+ fetchData();
63
+ }, [fetchData]);
64
+ const refetchWithParams = useCallback(
65
+ (newAddressId) => {
66
+ fetchData(newAddressId);
67
+ },
68
+ [fetchData]
69
+ );
70
+ return { data, error, isLoading, mutate: fetchData, refetchWithParams };
71
+ };
72
+ var useOrders = (filters) => {
73
+ const [data, setData] = useState(void 0);
74
+ const [error, setError] = useState(null);
75
+ const [isLoading, setIsLoading] = useState(true);
76
+ const queryString = new URLSearchParams(filters).toString();
77
+ const fetchData = useCallback(async () => {
78
+ try {
79
+ setIsLoading(true);
80
+ const url = `/customer/order/?${queryString}`;
81
+ const result = await getOrders(url);
82
+ setData(result);
83
+ setError(null);
84
+ } catch (err) {
85
+ setError(err);
86
+ } finally {
87
+ setIsLoading(false);
88
+ }
89
+ }, [queryString]);
90
+ useEffect(() => {
91
+ fetchData();
92
+ }, [fetchData]);
93
+ return { data, error, isLoading, mutate: fetchData };
94
+ };
95
+ var useGetProducts = (filter) => {
96
+ const [data, setData] = useState(
97
+ void 0
98
+ );
99
+ const [isLoading, setIsLoading] = useState(true);
100
+ const hasFetched = useRef(false);
101
+ useEffect(() => {
102
+ if (hasFetched.current) return;
103
+ hasFetched.current = true;
104
+ const fetchData = async () => {
105
+ try {
106
+ setIsLoading(true);
107
+ const result = await getProductList("/inventory/products/", filter);
108
+ setData(result);
109
+ } catch (err) {
110
+ } finally {
111
+ setIsLoading(false);
112
+ }
113
+ };
114
+ fetchData();
115
+ }, []);
116
+ return { data, loading: isLoading && !data, isLoading };
117
+ };
118
+ var useGetProductDetails = (slug) => {
119
+ const [data, setData] = useState(void 0);
120
+ const [isLoading, setIsLoading] = useState(true);
121
+ const fetchData = useCallback(async () => {
122
+ try {
123
+ setIsLoading(true);
124
+ const result = await getProductDetail("/inventory/products/", slug);
125
+ setData(result);
126
+ } catch (err) {
127
+ } finally {
128
+ setIsLoading(false);
129
+ }
130
+ }, [slug]);
131
+ useEffect(() => {
132
+ fetchData();
133
+ }, [fetchData]);
134
+ return { data, loading: isLoading && !data, isLoading };
135
+ };
136
+ var useGetProductCategories = () => {
137
+ const [data, setData] = useState([]);
138
+ const [error, setError] = useState(null);
139
+ const [isLoading, setIsLoading] = useState(true);
140
+ const hasFetched = useRef(false);
141
+ useEffect(() => {
142
+ if (hasFetched.current) return;
143
+ hasFetched.current = true;
144
+ const fetchData = async () => {
145
+ try {
146
+ setIsLoading(true);
147
+ const result = await getProductCategories("/store/categories");
148
+ setData(result || []);
149
+ } catch (err) {
150
+ setError(err);
151
+ } finally {
152
+ setIsLoading(false);
153
+ }
154
+ };
155
+ fetchData();
156
+ }, []);
157
+ return { data, loading: isLoading, error };
158
+ };
159
+ var useUserDetails = () => {
160
+ const [data, setData] = useState(void 0);
161
+ const [error, setError] = useState(null);
162
+ const [isLoading, setIsLoading] = useState(true);
163
+ const hasFetched = useRef(false);
164
+ const fetchData = useCallback(async () => {
165
+ try {
166
+ setIsLoading(true);
167
+ const result = await getUserDetails("/users/store/profile/");
168
+ setData(result);
169
+ setError(null);
170
+ } catch (err) {
171
+ setError(err);
172
+ } finally {
173
+ setIsLoading(false);
174
+ }
175
+ }, []);
176
+ useEffect(() => {
177
+ if (!hasFetched.current) {
178
+ hasFetched.current = true;
179
+ fetchData();
180
+ }
181
+ }, [fetchData]);
182
+ return { data, error, isLoading, mutate: fetchData };
183
+ };
184
+ var useWishlist = () => {
185
+ const [data, setData] = useState(void 0);
186
+ const [error, setError] = useState(null);
187
+ const [isLoading, setIsLoading] = useState(true);
188
+ const hasFetched = useRef(false);
189
+ const fetchData = useCallback(async () => {
190
+ try {
191
+ setIsLoading(true);
192
+ const result = await getWishlist("/customer/wishlist/");
193
+ setData(result);
194
+ setError(null);
195
+ } catch (err) {
196
+ setError(err);
197
+ } finally {
198
+ setIsLoading(false);
199
+ }
200
+ }, []);
201
+ useEffect(() => {
202
+ if (!hasFetched.current) {
203
+ hasFetched.current = true;
204
+ fetchData();
205
+ }
206
+ }, [fetchData]);
207
+ return { data, error, isLoading, mutate: fetchData };
208
+ };
209
+ var useProductDetailModal = () => {
210
+ const [selectedProductSlug, setSelectedProductSlug] = useState();
211
+ const [isModalOpen, setIsModalOpen] = useState(false);
212
+ const _handleOnOpenModal = (productSlug) => {
213
+ setSelectedProductSlug(productSlug);
214
+ document.body.style.overflow = "hidden";
215
+ setIsModalOpen(true);
216
+ };
217
+ const _handleOnCloseModal = () => {
218
+ document.body.style.overflow = "auto";
219
+ setIsModalOpen(false);
220
+ };
221
+ return {
222
+ isModalOpen,
223
+ onOpenModal: _handleOnOpenModal,
224
+ onCloseModal: _handleOnCloseModal,
225
+ selectedProductSlug
226
+ };
227
+ };
228
+ var useServiceFormModal = () => {
229
+ const [isModalOpen, setIsModalOpen] = useState(false);
230
+ const _handleOnOpenModal = () => {
231
+ document.body.style.overflow = "hidden";
232
+ setIsModalOpen(true);
233
+ };
234
+ const _handleOnCloseModal = () => {
235
+ document.body.style.overflow = "auto";
236
+ setIsModalOpen(false);
237
+ };
238
+ return {
239
+ isServiceModalOpen: isModalOpen,
240
+ onOpenServiceModal: _handleOnOpenModal,
241
+ onCloseServiceModal: _handleOnCloseModal
242
+ };
243
+ };
244
+ function useCheckoutPayment(options) {
245
+ const [orderSummary, setOrderSummary] = useState(null);
246
+ const [isPlacingOrder, setIsPlacingOrder] = useState(false);
247
+ const [isConfirmingPayment, setIsConfirmingPayment] = useState(false);
248
+ const [showSuccessModal, setShowSuccessModal] = useState(false);
249
+ const [showFailureModal, setShowFailureModal] = useState(false);
250
+ const resetCartCount = useCartStore((s) => s.resetCartCount);
251
+ const callbacks = {
252
+ onSuccess: (order) => {
253
+ setOrderSummary(order);
254
+ setShowSuccessModal(true);
255
+ options.onSuccess?.(order);
256
+ },
257
+ onFailure: (order) => {
258
+ setOrderSummary(order);
259
+ setShowFailureModal(true);
260
+ options.onFailure?.(order);
261
+ },
262
+ onRedirect: options.onRedirect,
263
+ onStripeModalOpen: options.onStripeModalOpen,
264
+ onCartReset: resetCartCount,
265
+ onPaymentStart: () => setIsConfirmingPayment(true),
266
+ onPaymentEnd: () => setIsConfirmingPayment(false)
267
+ };
268
+ const placeAndPay = useCallback(
269
+ async (addressId, paymentMethod) => {
270
+ try {
271
+ setIsPlacingOrder(true);
272
+ const isCod = paymentMethod === "cod";
273
+ const response = await placeOrder(
274
+ addressId,
275
+ options.phonepeRedirectUrl,
276
+ isCod,
277
+ options.stripeRedirectUrl,
278
+ options.tabbyRedirectUrl
279
+ );
280
+ const order = response.data;
281
+ setOrderSummary(order);
282
+ processPayment(order, paymentMethod, callbacks);
283
+ } catch {
284
+ setShowFailureModal(true);
285
+ } finally {
286
+ setIsPlacingOrder(false);
287
+ }
288
+ },
289
+ [options.phonepeRedirectUrl, options.stripeRedirectUrl, options.tabbyRedirectUrl]
290
+ );
291
+ return {
292
+ orderSummary,
293
+ isPlacingOrder,
294
+ isConfirmingPayment,
295
+ showSuccessModal,
296
+ showFailureModal,
297
+ setShowSuccessModal,
298
+ setShowFailureModal,
299
+ placeAndPay
300
+ };
301
+ }
302
+ function useCheckoutCoupon(options) {
303
+ const [availableCoupons, setAvailableCoupons] = useState([]);
304
+ const [appliedCoupon, setAppliedCoupon] = useState(null);
305
+ const [isApplying, setIsApplying] = useState(false);
306
+ const [isLoading, setIsLoading] = useState(false);
307
+ const [error, setError] = useState(null);
308
+ const callbacks = { onCartRefresh: options.onCartRefresh };
309
+ const refreshCoupons = useCallback(async () => {
310
+ setIsLoading(true);
311
+ try {
312
+ const [coupons, applied] = await Promise.all([
313
+ fetchAvailableCoupons(),
314
+ fetchAppliedCoupon()
315
+ ]);
316
+ setAvailableCoupons(coupons);
317
+ setAppliedCoupon(applied);
318
+ } catch {
319
+ } finally {
320
+ setIsLoading(false);
321
+ }
322
+ }, []);
323
+ const applyCouponHandler = useCallback(
324
+ async (code) => {
325
+ setError(null);
326
+ setIsApplying(true);
327
+ try {
328
+ const coupon = await applyCheckoutCoupon(code, callbacks);
329
+ setAppliedCoupon(coupon);
330
+ } catch (err) {
331
+ setError(err instanceof Error ? err.message : "Failed to apply coupon");
332
+ } finally {
333
+ setIsApplying(false);
334
+ }
335
+ },
336
+ [options.onCartRefresh]
337
+ );
338
+ const removeCouponHandler = useCallback(async () => {
339
+ if (!appliedCoupon) return;
340
+ try {
341
+ await removeCheckoutCoupon(appliedCoupon.coupon_code, callbacks);
342
+ setAppliedCoupon(null);
343
+ setError(null);
344
+ } catch {
345
+ }
346
+ }, [appliedCoupon, options.onCartRefresh]);
347
+ useEffect(() => {
348
+ if (options.autoFetch !== false) {
349
+ refreshCoupons();
350
+ }
351
+ }, []);
352
+ return {
353
+ availableCoupons,
354
+ appliedCoupon,
355
+ isApplying,
356
+ isLoading,
357
+ error,
358
+ applyCoupon: applyCouponHandler,
359
+ removeCoupon: removeCouponHandler,
360
+ refreshCoupons
361
+ };
362
+ }
363
+
364
+ export { useAddress, useCart, useCheckoutCoupon, useCheckoutPayment, useGetProductCategories, useGetProductDetails, useGetProducts, useOrders, useProductDetailModal, useServiceFormModal, useUserDetails, useWishlist };
@@ -0,0 +1,18 @@
1
+ interface SnapstoreConfig {
2
+ publicApiEndpoint: string;
3
+ apiEndpoint?: string;
4
+ storeId?: string;
5
+ secretKey?: string;
6
+ cloudFront?: string;
7
+ phonePeApiEndpoint?: string;
8
+ }
9
+ declare function initConfig(config: SnapstoreConfig): void;
10
+ declare function getConfig(): SnapstoreConfig;
11
+ declare const getPublicApiEndpoint: () => string;
12
+ declare const getApiEndpoint: () => string | undefined;
13
+ declare const getStoreId: () => string;
14
+ declare const getSecretKey: () => string;
15
+ declare const getCloudFront: () => string | undefined;
16
+ declare const getPhonePeApiEndpoint: () => string | undefined;
17
+
18
+ export { type SnapstoreConfig as S, getCloudFront as a, getConfig as b, getPhonePeApiEndpoint as c, getPublicApiEndpoint as d, getSecretKey as e, getStoreId as f, getApiEndpoint as g, initConfig as i };
@@ -0,0 +1,18 @@
1
+ interface SnapstoreConfig {
2
+ publicApiEndpoint: string;
3
+ apiEndpoint?: string;
4
+ storeId?: string;
5
+ secretKey?: string;
6
+ cloudFront?: string;
7
+ phonePeApiEndpoint?: string;
8
+ }
9
+ declare function initConfig(config: SnapstoreConfig): void;
10
+ declare function getConfig(): SnapstoreConfig;
11
+ declare const getPublicApiEndpoint: () => string;
12
+ declare const getApiEndpoint: () => string | undefined;
13
+ declare const getStoreId: () => string;
14
+ declare const getSecretKey: () => string;
15
+ declare const getCloudFront: () => string | undefined;
16
+ declare const getPhonePeApiEndpoint: () => string | undefined;
17
+
18
+ export { type SnapstoreConfig as S, getCloudFront as a, getConfig as b, getPhonePeApiEndpoint as c, getPublicApiEndpoint as d, getSecretKey as e, getStoreId as f, getApiEndpoint as g, initConfig as i };
package/dist/index.cjs ADDED
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunkN3CTXRFT_cjs = require('./chunk-N3CTXRFT.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "getConfig", {
8
+ enumerable: true,
9
+ get: function () { return chunkN3CTXRFT_cjs.getConfig; }
10
+ });
11
+ Object.defineProperty(exports, "initConfig", {
12
+ enumerable: true,
13
+ get: function () { return chunkN3CTXRFT_cjs.initConfig; }
14
+ });
@@ -0,0 +1 @@
1
+ export { S as SnapstoreConfig, b as getConfig, i as initConfig } from './index-DTyIuLuI.cjs';
@@ -0,0 +1 @@
1
+ export { S as SnapstoreConfig, b as getConfig, i as initConfig } from './index-DTyIuLuI.js';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export { getConfig, initConfig } from './chunk-JQMLHRWL.js';
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,53 @@
1
+ export { A as Address } from '../address-DQEZzyUG.cjs';
2
+ export { A as Analytics, B as Booking, a as BookingDetails, b as CollectionAttributes, C as CollectionResponse, c as CollectionVariant, R as Review, s as singleCollection } from '../booking-Drl7-IL7.cjs';
3
+ export { A as Attributes, B as BookingService, a as BookingServiceDate, C as Cart, b as CartState, c as CustomField, O as OperatingHours, P as Photos, d as Product, e as ProductDetail, S as SpecialHours, T as TimeSlot, W as WishlistState } from '../cart-DVrn8hD0.cjs';
4
+ export { C as Category, O as Order } from '../orders-D0oC9ugD.cjs';
5
+ export { A as ApplicableTarget, C as Coupon, a as CouponResponse, b as CouponStatus, c as Coupons, D as DiscountType, V as ValueType } from '../coupons-C7iJ-1cy.cjs';
6
+ export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-D7vn-9SR.cjs';
7
+ export { U as User, W as Wishlist } from '../wishlist-CBCZD66Y.cjs';
8
+ import 'react-toastify';
9
+
10
+ declare namespace CountryModel {
11
+ interface StateResponse {
12
+ error: boolean;
13
+ msg: string;
14
+ data: StateData;
15
+ }
16
+ interface StateData {
17
+ name: string;
18
+ iso3: string;
19
+ iso2: string;
20
+ states: State[];
21
+ }
22
+ interface State {
23
+ name: string;
24
+ state_code: string;
25
+ }
26
+ interface Country {
27
+ id: number;
28
+ is_active: boolean;
29
+ is_deleted: boolean;
30
+ name: string;
31
+ numeric_code: string;
32
+ official_name: string;
33
+ short_code: string;
34
+ tld_code: string;
35
+ }
36
+ interface State1 {
37
+ id: number;
38
+ created_at: string;
39
+ updated_at: string;
40
+ name: string;
41
+ short_code: string;
42
+ parent_code: string | null;
43
+ subdivision_type: string;
44
+ is_active: boolean;
45
+ is_deleted: boolean;
46
+ country: number;
47
+ }
48
+ type StateResponse1 = {
49
+ results: State1[];
50
+ };
51
+ }
52
+
53
+ export { CountryModel };
@@ -0,0 +1,53 @@
1
+ export { A as Address } from '../address-DQEZzyUG.js';
2
+ export { A as Analytics, B as Booking, a as BookingDetails, b as CollectionAttributes, C as CollectionResponse, c as CollectionVariant, R as Review, s as singleCollection } from '../booking-ClX-dhX7.js';
3
+ export { A as Attributes, B as BookingService, a as BookingServiceDate, C as Cart, b as CartState, c as CustomField, O as OperatingHours, P as Photos, d as Product, e as ProductDetail, S as SpecialHours, T as TimeSlot, W as WishlistState } from '../cart-DVrn8hD0.js';
4
+ export { C as Category, O as Order } from '../orders-CkUzv5Xh.js';
5
+ export { A as ApplicableTarget, C as Coupon, a as CouponResponse, b as CouponStatus, c as Coupons, D as DiscountType, V as ValueType } from '../coupons-CnfTKL1i.js';
6
+ export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-D7vn-9SR.js';
7
+ export { U as User, W as Wishlist } from '../wishlist-BzhnCAQD.js';
8
+ import 'react-toastify';
9
+
10
+ declare namespace CountryModel {
11
+ interface StateResponse {
12
+ error: boolean;
13
+ msg: string;
14
+ data: StateData;
15
+ }
16
+ interface StateData {
17
+ name: string;
18
+ iso3: string;
19
+ iso2: string;
20
+ states: State[];
21
+ }
22
+ interface State {
23
+ name: string;
24
+ state_code: string;
25
+ }
26
+ interface Country {
27
+ id: number;
28
+ is_active: boolean;
29
+ is_deleted: boolean;
30
+ name: string;
31
+ numeric_code: string;
32
+ official_name: string;
33
+ short_code: string;
34
+ tld_code: string;
35
+ }
36
+ interface State1 {
37
+ id: number;
38
+ created_at: string;
39
+ updated_at: string;
40
+ name: string;
41
+ short_code: string;
42
+ parent_code: string | null;
43
+ subdivision_type: string;
44
+ is_active: boolean;
45
+ is_deleted: boolean;
46
+ country: number;
47
+ }
48
+ type StateResponse1 = {
49
+ results: State1[];
50
+ };
51
+ }
52
+
53
+ export { CountryModel };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,159 @@
1
+ import { f as SLICE_STATUS } from './cart-DVrn8hD0.js';
2
+
3
+ declare namespace Category {
4
+ interface Root {
5
+ id: number;
6
+ name: string;
7
+ photo: string;
8
+ slug: string;
9
+ description: string;
10
+ children?: Root[];
11
+ }
12
+ interface CategoriesState {
13
+ data: Root[];
14
+ status: SLICE_STATUS;
15
+ }
16
+ }
17
+
18
+ declare namespace Order {
19
+ interface Root {
20
+ id: number;
21
+ store: number;
22
+ customer: number;
23
+ total_amount: number;
24
+ paid_amount: number;
25
+ purchased_at: string;
26
+ purchased_products: PurchasedProduct[];
27
+ order_status: OrderStatus;
28
+ order_number: number;
29
+ payment_method: any;
30
+ shipping_address: string;
31
+ shipping_city: string;
32
+ shipping_state: string;
33
+ shipping_country: string;
34
+ shipping_zip: string;
35
+ tracking_id: any;
36
+ tracking_url: any;
37
+ delivery_date?: string;
38
+ delivered_at: any;
39
+ cancelled_at: any;
40
+ returned_at: any;
41
+ customer_details: CustomerDetails;
42
+ customer_name: string;
43
+ customer_phone: string;
44
+ }
45
+ interface OrderResponse {
46
+ currentPage: number;
47
+ totalPages: number;
48
+ results: Root[];
49
+ }
50
+ interface VariantAttributes {
51
+ size: {
52
+ name: string;
53
+ value: string;
54
+ };
55
+ color?: {
56
+ name: string;
57
+ value: string;
58
+ };
59
+ Color?: {
60
+ name: string;
61
+ value: string;
62
+ };
63
+ }
64
+ interface CustomerDetails {
65
+ name: string;
66
+ phone: string;
67
+ }
68
+ type OrderStatus = "pending" | "confirmed" | "packed" | "shipped" | "delivered" | "cancelled" | "failed" | "paid";
69
+ interface OrderSummary {
70
+ id: number;
71
+ store: number;
72
+ customer: number;
73
+ total_amount: number;
74
+ paid_amount: number;
75
+ purchased_at: string;
76
+ purchased_products: PurchasedProduct[];
77
+ order_status: string;
78
+ order_number: number;
79
+ payment_method: any;
80
+ shipping_address: string;
81
+ shipping_city: string;
82
+ shipping_state: string;
83
+ shipping_country: string;
84
+ shipping_zip: string;
85
+ tracking_id: any;
86
+ tracking_url: any;
87
+ delivery_date: any;
88
+ delivered_at: any;
89
+ cancelled_at: any;
90
+ returned_at: any;
91
+ customer_email: string;
92
+ customer_name: string;
93
+ customer_phone: string;
94
+ shipped_at: any;
95
+ confirmed_at: any;
96
+ refunded_at: any;
97
+ store_address: string;
98
+ store_city: string;
99
+ store_state: string;
100
+ store_country: string;
101
+ store_zip: string;
102
+ cart_count: number;
103
+ razorpay_public_token: string;
104
+ razorpay_order_id: string;
105
+ razorpay_order_status: string;
106
+ razorpay_order_amount: number;
107
+ razorpay_order_currency: string;
108
+ razorpay_payment_id: string;
109
+ razorpay_signature: string;
110
+ store_color_scheme: {
111
+ primary: string;
112
+ secondary: string;
113
+ };
114
+ store_logo: string;
115
+ store_name: string;
116
+ shipping_amount: number;
117
+ phonepe_redirect_url: string;
118
+ stripe_client_secret: string;
119
+ stripe_payment_intent_id: string;
120
+ stripe_publishable_key: string;
121
+ total_coupon_discount: number;
122
+ stripe_payment_link_url: string;
123
+ tabby_redirect_url?: string;
124
+ }
125
+ interface PurchasedProduct {
126
+ product_id: number;
127
+ product_name: string;
128
+ product_variant_id: number;
129
+ product_variant_slug: string;
130
+ product_variant_name: string;
131
+ product_variant_sku: string;
132
+ quantity: number;
133
+ variant_price: number;
134
+ tax_percentage: number;
135
+ total_tax_price: number;
136
+ total_price: number;
137
+ variant_attributes: VariantAttributes;
138
+ product_variant_photo: any;
139
+ is_digital: boolean;
140
+ discount_amount: number;
141
+ }
142
+ interface StripePaymentStatus {
143
+ order_id: number;
144
+ order_status: string;
145
+ payment_link_id: string;
146
+ payment_link_url: string;
147
+ checkout_session_id: string;
148
+ status: string;
149
+ payment_status: string;
150
+ session_status: string;
151
+ amount_total: number;
152
+ currency: string;
153
+ customer_email: string | null;
154
+ payment_intent: string;
155
+ payment_link: string;
156
+ }
157
+ }
158
+
159
+ export { Category as C, Order as O };