@storepecker/storefront-core 2.6.2 → 2.6.3
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/api/index.cjs +28 -19
- package/dist/api/index.d.cts +14 -2
- package/dist/api/index.d.ts +14 -2
- package/dist/api/index.js +11 -3
- package/dist/{chunk-PARH5TBK.cjs → chunk-5BT3MH4A.cjs} +3 -3
- package/dist/{chunk-QAC72HKO.js → chunk-H32TICAM.js} +14 -13
- package/dist/{chunk-SMHJRNCR.cjs → chunk-LCMJYFHC.cjs} +14 -13
- package/dist/{chunk-6PF4TQXP.js → chunk-PGBYYKFQ.js} +3 -3
- package/dist/{chunk-CUR7CHR5.js → chunk-TY5NK7NW.js} +1 -1
- package/dist/{chunk-COO7PUZH.cjs → chunk-ZQOESVVE.cjs} +19 -19
- package/dist/hooks/index.cjs +17 -17
- package/dist/hooks/index.js +5 -5
- package/dist/{blog-kdn4wDjq.d.ts → instagram-CqJBZ-0X.d.ts} +28 -1
- package/dist/{blog-yhzC2V0C.d.cts → instagram-D4JUT4ZU.d.cts} +28 -1
- package/dist/models/index.d.cts +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/store/index.cjs +8 -8
- package/dist/store/index.js +3 -3
- package/dist/utils/index.cjs +2 -2
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
package/dist/api/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkY46EHRJQ_cjs = require('../chunk-Y46EHRJQ.cjs');
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var chunk5BT3MH4A_cjs = require('../chunk-5BT3MH4A.cjs');
|
|
5
|
+
require('../chunk-LCMJYFHC.cjs');
|
|
6
6
|
var chunkXFOUNOKO_cjs = require('../chunk-XFOUNOKO.cjs');
|
|
7
7
|
var chunkLZADKC4Y_cjs = require('../chunk-LZADKC4Y.cjs');
|
|
8
8
|
var chunkRDUT4W3B_cjs = require('../chunk-RDUT4W3B.cjs');
|
|
@@ -155,6 +155,14 @@ async function getMultipleBlogsBySlugs(slugs) {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
// src/api/instagram.ts
|
|
159
|
+
async function getInstagramMedia(ids) {
|
|
160
|
+
const idsParam = Array.isArray(ids) ? ids.join(",") : ids;
|
|
161
|
+
return await chunkECHV2JSY_cjs.http_service_default.get("/marketing/instagram/media/refresh/", {
|
|
162
|
+
params: { ids: idsParam }
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
158
166
|
Object.defineProperty(exports, "getUserDetails", {
|
|
159
167
|
enumerable: true,
|
|
160
168
|
get: function () { return chunkY46EHRJQ_cjs.getUserDetails; }
|
|
@@ -165,71 +173,71 @@ Object.defineProperty(exports, "updateUserDetails", {
|
|
|
165
173
|
});
|
|
166
174
|
Object.defineProperty(exports, "addToCart", {
|
|
167
175
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
176
|
+
get: function () { return chunk5BT3MH4A_cjs.addToCart; }
|
|
169
177
|
});
|
|
170
178
|
Object.defineProperty(exports, "addWishlist", {
|
|
171
179
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
180
|
+
get: function () { return chunk5BT3MH4A_cjs.addWishlist; }
|
|
173
181
|
});
|
|
174
182
|
Object.defineProperty(exports, "getCart", {
|
|
175
183
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunk5BT3MH4A_cjs.getCart; }
|
|
177
185
|
});
|
|
178
186
|
Object.defineProperty(exports, "getCartItemQuantity", {
|
|
179
187
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunk5BT3MH4A_cjs.getCartItemQuantity; }
|
|
181
189
|
});
|
|
182
190
|
Object.defineProperty(exports, "getCategories", {
|
|
183
191
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
192
|
+
get: function () { return chunk5BT3MH4A_cjs.getCategories; }
|
|
185
193
|
});
|
|
186
194
|
Object.defineProperty(exports, "getDigitalProductDownloadLink", {
|
|
187
195
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
196
|
+
get: function () { return chunk5BT3MH4A_cjs.getDigitalProductDownloadLink; }
|
|
189
197
|
});
|
|
190
198
|
Object.defineProperty(exports, "getProductCategories", {
|
|
191
199
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
200
|
+
get: function () { return chunk5BT3MH4A_cjs.getProductCategories; }
|
|
193
201
|
});
|
|
194
202
|
Object.defineProperty(exports, "getProductDetail", {
|
|
195
203
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
204
|
+
get: function () { return chunk5BT3MH4A_cjs.getProductDetail; }
|
|
197
205
|
});
|
|
198
206
|
Object.defineProperty(exports, "getProductDetailBySlug", {
|
|
199
207
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
208
|
+
get: function () { return chunk5BT3MH4A_cjs.getProductDetailBySlug; }
|
|
201
209
|
});
|
|
202
210
|
Object.defineProperty(exports, "getProductList", {
|
|
203
211
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
212
|
+
get: function () { return chunk5BT3MH4A_cjs.getProductList; }
|
|
205
213
|
});
|
|
206
214
|
Object.defineProperty(exports, "getProducts", {
|
|
207
215
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
216
|
+
get: function () { return chunk5BT3MH4A_cjs.getProducts; }
|
|
209
217
|
});
|
|
210
218
|
Object.defineProperty(exports, "getWishlist", {
|
|
211
219
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
220
|
+
get: function () { return chunk5BT3MH4A_cjs.getWishlist; }
|
|
213
221
|
});
|
|
214
222
|
Object.defineProperty(exports, "notifyProductStock", {
|
|
215
223
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
224
|
+
get: function () { return chunk5BT3MH4A_cjs.notifyProductStock; }
|
|
217
225
|
});
|
|
218
226
|
Object.defineProperty(exports, "removeFromCart", {
|
|
219
227
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
228
|
+
get: function () { return chunk5BT3MH4A_cjs.removeFromCart; }
|
|
221
229
|
});
|
|
222
230
|
Object.defineProperty(exports, "removeFromWishlist", {
|
|
223
231
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
232
|
+
get: function () { return chunk5BT3MH4A_cjs.removeFromWishlist; }
|
|
225
233
|
});
|
|
226
234
|
Object.defineProperty(exports, "updateCart", {
|
|
227
235
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
236
|
+
get: function () { return chunk5BT3MH4A_cjs.updateCart; }
|
|
229
237
|
});
|
|
230
238
|
Object.defineProperty(exports, "updateDigitalProductDownloadLinkCount", {
|
|
231
239
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
240
|
+
get: function () { return chunk5BT3MH4A_cjs.updateDigitalProductDownloadLinkCount; }
|
|
233
241
|
});
|
|
234
242
|
Object.defineProperty(exports, "applyCoupon", {
|
|
235
243
|
enumerable: true,
|
|
@@ -398,6 +406,7 @@ exports.getBlogPostBySlug = getBlogPostBySlug;
|
|
|
398
406
|
exports.getBlogPostsList = getBlogPostsList;
|
|
399
407
|
exports.getCollection = getCollection;
|
|
400
408
|
exports.getFilters = getFilters;
|
|
409
|
+
exports.getInstagramMedia = getInstagramMedia;
|
|
401
410
|
exports.getLoginMethod = getLoginMethod;
|
|
402
411
|
exports.getMultipleBlogsBySlugs = getMultipleBlogsBySlugs;
|
|
403
412
|
exports.getMultipleCollections = getMultipleCollections;
|
package/dist/api/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { d as Product, f as ProductDetail } from '../product-CZtFWhxO.cjs';
|
|
|
6
6
|
import { O as Order } from '../orders-9_scVq_M.cjs';
|
|
7
7
|
import { W as Wishlist } from '../wishlist-Cx9Vrszq.cjs';
|
|
8
8
|
import { C as CollectionResponse } from '../collections-8YdINtUf.cjs';
|
|
9
|
-
import { R as Review, A as Analytics, a as Booking, B as Blog } from '../
|
|
9
|
+
import { R as Review, A as Analytics, a as Booking, B as Blog, I as Instagram } from '../instagram-D4JUT4ZU.cjs';
|
|
10
10
|
import 'react-toastify';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -185,4 +185,16 @@ declare function getMultipleBlogsBySlugs(slugs: string): Promise<AxiosResponse<{
|
|
|
185
185
|
results: Blog.Post[];
|
|
186
186
|
}>>;
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Fetch live media for a set of curated Instagram post ids.
|
|
190
|
+
*
|
|
191
|
+
* Instagram CDN URLs are short-lived signed links, so this must be called
|
|
192
|
+
* client-side at render time (never cached/SSR'd). The response order is not
|
|
193
|
+
* guaranteed — re-order against the requested ids on the caller side if the
|
|
194
|
+
* merchant's curated order matters.
|
|
195
|
+
*
|
|
196
|
+
* @param ids comma-separated id string, or an array of ids
|
|
197
|
+
*/
|
|
198
|
+
declare function getInstagramMedia(ids: string | (string | number)[]): Promise<AxiosResponse<Instagram.MediaRefreshResponse>>;
|
|
199
|
+
|
|
200
|
+
export { type BookingFilter, type OTPCredentials, type VerifyOTPCredentials, addAddress, addReview, addToCart, addWishlist, applyCoupon, checkPhonepePaymentStatus, createBooking, deleteAddress, getAddresses, getAffiliateRedirect, getAppliedCoupon, getBlogPostBySlug, getBlogPostsList, getCart, getCartItemQuantity, getCategories, getCollection, getCountries, getCoupons, getDigitalProductDownloadLink, getFilters, getHttpService, getInstagramMedia, getLoginMethod, getMultipleBlogsBySlugs, getMultipleCollections, getNewToken, getOrderDetails, getOrderDetailsByNumber, getOrderDetailsByRef, getOrderDetailsByRefV2, getOrders, getProductCategories, getProductDetail, getProductDetailBySlug, getProductList, getProducts, getPublicOrderDetailsByNumber, getPublicOrderDetailsByRef, getReviewSummary, getReviews, getServerHttpService, getStripePaymentStatus, getStripePaymentStatusPublic, getSubdivisions, getUserBookings, getUserDetails, getWishlist, httpService, makeCODOrder, notifyProductStock, phonepeOrderSuccess, phonepePublicOrderSuccess, placeOrder, postAnalytics, publicMakeCODOrder, publicPlaceOrder, razorpayOrderFail, razorpayOrderSuccess, razorpayPublicOrderSuccess, removeCoupon, removeFromCart, removeFromWishlist, resetHttpService, sendOTP, serverHttpService, setSessionExpiredCallback, stripeOrderFail, stripeOrderSuccess, stripePublicOrderSuccess, updateAddress, updateCart, updateDigitalProductDownloadLinkCount, updateOrder, updateOrderCustomization, updateUserDetails, uploadCustomizationImage, uploadReviewImages, verifyOTP, verifyTabbyPayment };
|
package/dist/api/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { d as Product, f as ProductDetail } from '../product-CZtFWhxO.js';
|
|
|
6
6
|
import { O as Order } from '../orders-C1XZr8tx.js';
|
|
7
7
|
import { W as Wishlist } from '../wishlist-CRNbfFIx.js';
|
|
8
8
|
import { C as CollectionResponse } from '../collections-ycrA2cPL.js';
|
|
9
|
-
import { R as Review, A as Analytics, a as Booking, B as Blog } from '../
|
|
9
|
+
import { R as Review, A as Analytics, a as Booking, B as Blog, I as Instagram } from '../instagram-CqJBZ-0X.js';
|
|
10
10
|
import 'react-toastify';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -185,4 +185,16 @@ declare function getMultipleBlogsBySlugs(slugs: string): Promise<AxiosResponse<{
|
|
|
185
185
|
results: Blog.Post[];
|
|
186
186
|
}>>;
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Fetch live media for a set of curated Instagram post ids.
|
|
190
|
+
*
|
|
191
|
+
* Instagram CDN URLs are short-lived signed links, so this must be called
|
|
192
|
+
* client-side at render time (never cached/SSR'd). The response order is not
|
|
193
|
+
* guaranteed — re-order against the requested ids on the caller side if the
|
|
194
|
+
* merchant's curated order matters.
|
|
195
|
+
*
|
|
196
|
+
* @param ids comma-separated id string, or an array of ids
|
|
197
|
+
*/
|
|
198
|
+
declare function getInstagramMedia(ids: string | (string | number)[]): Promise<AxiosResponse<Instagram.MediaRefreshResponse>>;
|
|
199
|
+
|
|
200
|
+
export { type BookingFilter, type OTPCredentials, type VerifyOTPCredentials, addAddress, addReview, addToCart, addWishlist, applyCoupon, checkPhonepePaymentStatus, createBooking, deleteAddress, getAddresses, getAffiliateRedirect, getAppliedCoupon, getBlogPostBySlug, getBlogPostsList, getCart, getCartItemQuantity, getCategories, getCollection, getCountries, getCoupons, getDigitalProductDownloadLink, getFilters, getHttpService, getInstagramMedia, getLoginMethod, getMultipleBlogsBySlugs, getMultipleCollections, getNewToken, getOrderDetails, getOrderDetailsByNumber, getOrderDetailsByRef, getOrderDetailsByRefV2, getOrders, getProductCategories, getProductDetail, getProductDetailBySlug, getProductList, getProducts, getPublicOrderDetailsByNumber, getPublicOrderDetailsByRef, getReviewSummary, getReviews, getServerHttpService, getStripePaymentStatus, getStripePaymentStatusPublic, getSubdivisions, getUserBookings, getUserDetails, getWishlist, httpService, makeCODOrder, notifyProductStock, phonepeOrderSuccess, phonepePublicOrderSuccess, placeOrder, postAnalytics, publicMakeCODOrder, publicPlaceOrder, razorpayOrderFail, razorpayOrderSuccess, razorpayPublicOrderSuccess, removeCoupon, removeFromCart, removeFromWishlist, resetHttpService, sendOTP, serverHttpService, setSessionExpiredCallback, stripeOrderFail, stripeOrderSuccess, stripePublicOrderSuccess, updateAddress, updateCart, updateDigitalProductDownloadLinkCount, updateOrder, updateOrderCustomization, updateUserDetails, uploadCustomizationImage, uploadReviewImages, verifyOTP, verifyTabbyPayment };
|
package/dist/api/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { getUserDetails, updateUserDetails } from '../chunk-WYXT5AAG.js';
|
|
2
|
-
export { addToCart, addWishlist, getCart, getCartItemQuantity, getCategories, getDigitalProductDownloadLink, getProductCategories, getProductDetail, getProductDetailBySlug, getProductList, getProducts, getWishlist, notifyProductStock, removeFromCart, removeFromWishlist, updateCart, updateDigitalProductDownloadLinkCount } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
2
|
+
export { addToCart, addWishlist, getCart, getCartItemQuantity, getCategories, getDigitalProductDownloadLink, getProductCategories, getProductDetail, getProductDetailBySlug, getProductList, getProducts, getWishlist, notifyProductStock, removeFromCart, removeFromWishlist, updateCart, updateDigitalProductDownloadLinkCount } from '../chunk-TY5NK7NW.js';
|
|
3
|
+
import '../chunk-H32TICAM.js';
|
|
4
4
|
export { applyCoupon, getAppliedCoupon, getCoupons, removeCoupon } from '../chunk-7M5CVYZJ.js';
|
|
5
5
|
export { checkPhonepePaymentStatus, getOrderDetails, getOrderDetailsByNumber, getOrderDetailsByRef, getOrderDetailsByRefV2, getOrders, getPublicOrderDetailsByNumber, getPublicOrderDetailsByRef, getStripePaymentStatus, getStripePaymentStatusPublic, makeCODOrder, phonepeOrderSuccess, phonepePublicOrderSuccess, placeOrder, publicMakeCODOrder, publicPlaceOrder, razorpayOrderFail, razorpayOrderSuccess, razorpayPublicOrderSuccess, stripeOrderFail, stripeOrderSuccess, stripePublicOrderSuccess, updateOrder, updateOrderCustomization, uploadCustomizationImage, verifyTabbyPayment } from '../chunk-ME6Z7TZW.js';
|
|
6
6
|
export { addAddress, deleteAddress, getAddresses, getCountries, getSubdivisions, updateAddress } from '../chunk-ZGMLOLTC.js';
|
|
@@ -150,4 +150,12 @@ async function getMultipleBlogsBySlugs(slugs) {
|
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
// src/api/instagram.ts
|
|
154
|
+
async function getInstagramMedia(ids) {
|
|
155
|
+
const idsParam = Array.isArray(ids) ? ids.join(",") : ids;
|
|
156
|
+
return await http_service_default.get("/marketing/instagram/media/refresh/", {
|
|
157
|
+
params: { ids: idsParam }
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { addReview, createBooking, getAffiliateRedirect, getBlogPostBySlug, getBlogPostsList, getCollection, getFilters, getInstagramMedia, getLoginMethod, getMultipleBlogsBySlugs, getMultipleCollections, getNewToken, getReviewSummary, getReviews, getServerHttpService, getUserBookings, postAnalytics, sendOTP, server_http_service_default as serverHttpService, uploadReviewImages, verifyOTP };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLCMJYFHC_cjs = require('./chunk-LCMJYFHC.cjs');
|
|
4
4
|
var chunkECHV2JSY_cjs = require('./chunk-ECHV2JSY.cjs');
|
|
5
5
|
var chunkBBRXE57K_cjs = require('./chunk-BBRXE57K.cjs');
|
|
6
6
|
|
|
7
7
|
// src/api/cart.ts
|
|
8
8
|
async function getCart(url, addressId, shippingOptionId) {
|
|
9
|
-
const localCart =
|
|
9
|
+
const localCart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
10
10
|
return chunkBBRXE57K_cjs.auth_default.getUserDetails() ? (await chunkECHV2JSY_cjs.http_service_default.get(url, { params: { address_id: addressId, shipping_option_id: shippingOptionId } })).data : localCart || {
|
|
11
11
|
product_variants: [],
|
|
12
12
|
total_amount: 0,
|
|
@@ -28,7 +28,7 @@ async function getCart(url, addressId, shippingOptionId) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
async function getCartItemQuantity() {
|
|
31
|
-
const localCart =
|
|
31
|
+
const localCart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
32
32
|
return chunkBBRXE57K_cjs.auth_default.getUserDetails() ? (await chunkECHV2JSY_cjs.http_service_default.get("/customer/cart/quantity/")).data : { total_quantity: localCart?.total_quantity || 0 };
|
|
33
33
|
}
|
|
34
34
|
async function addToCart(product, customizationInputs) {
|
|
@@ -9,15 +9,16 @@ var LocalCart = {
|
|
|
9
9
|
set(cart) {
|
|
10
10
|
localStorage.setItem(USER_CART, JSON.stringify(cart));
|
|
11
11
|
},
|
|
12
|
-
add(product) {
|
|
12
|
+
add(product, quantity = 1) {
|
|
13
|
+
const qty = Number(quantity) || 1;
|
|
13
14
|
const cart = this.get();
|
|
14
15
|
if (!cart) {
|
|
15
16
|
this.set({
|
|
16
17
|
product_variants: [product],
|
|
17
|
-
products_quantity: { [product.id]:
|
|
18
|
-
total_quantity:
|
|
19
|
-
cart_count:
|
|
20
|
-
total_amount: product.selling_price,
|
|
18
|
+
products_quantity: { [product.id]: qty },
|
|
19
|
+
total_quantity: qty,
|
|
20
|
+
cart_count: qty,
|
|
21
|
+
total_amount: Number(product.selling_price) * qty,
|
|
21
22
|
variant_discounts: {}
|
|
22
23
|
});
|
|
23
24
|
return;
|
|
@@ -27,23 +28,23 @@ var LocalCart = {
|
|
|
27
28
|
if (existingProduct) {
|
|
28
29
|
cart.products_quantity = {
|
|
29
30
|
...cart.products_quantity,
|
|
30
|
-
[product.id]: (Number(cart.products_quantity[product.id]) || 0) +
|
|
31
|
+
[product.id]: (Number(cart.products_quantity[product.id]) || 0) + qty
|
|
31
32
|
};
|
|
32
|
-
cart.total_quantity = Number(cart.total_quantity) +
|
|
33
|
-
cart.cart_count = Number(cart.cart_count) +
|
|
34
|
-
cart.total_amount = Number(cart.total_amount) + Number(product.selling_price);
|
|
33
|
+
cart.total_quantity = Number(cart.total_quantity) + qty;
|
|
34
|
+
cart.cart_count = Number(cart.cart_count) + qty;
|
|
35
|
+
cart.total_amount = Number(cart.total_amount) + Number(product.selling_price) * qty;
|
|
35
36
|
this.set(cart);
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
newCart.push(product);
|
|
39
40
|
cart.products_quantity = {
|
|
40
41
|
...cart.products_quantity,
|
|
41
|
-
[product.id]: (cart.products_quantity[product.id] || 0) +
|
|
42
|
+
[product.id]: (cart.products_quantity[product.id] || 0) + qty
|
|
42
43
|
};
|
|
43
44
|
cart.product_variants = newCart;
|
|
44
|
-
cart.total_quantity = Number(cart.total_quantity) +
|
|
45
|
-
cart.cart_count = Number(cart.cart_count) +
|
|
46
|
-
cart.total_amount = Number(cart.total_amount) + Number(product.selling_price);
|
|
45
|
+
cart.total_quantity = Number(cart.total_quantity) + qty;
|
|
46
|
+
cart.cart_count = Number(cart.cart_count) + qty;
|
|
47
|
+
cart.total_amount = Number(cart.total_amount) + Number(product.selling_price) * qty;
|
|
47
48
|
this.set(cart);
|
|
48
49
|
},
|
|
49
50
|
remove(product) {
|
|
@@ -11,15 +11,16 @@ var LocalCart = {
|
|
|
11
11
|
set(cart) {
|
|
12
12
|
localStorage.setItem(chunkNE3ZHELZ_cjs.USER_CART, JSON.stringify(cart));
|
|
13
13
|
},
|
|
14
|
-
add(product) {
|
|
14
|
+
add(product, quantity = 1) {
|
|
15
|
+
const qty = Number(quantity) || 1;
|
|
15
16
|
const cart = this.get();
|
|
16
17
|
if (!cart) {
|
|
17
18
|
this.set({
|
|
18
19
|
product_variants: [product],
|
|
19
|
-
products_quantity: { [product.id]:
|
|
20
|
-
total_quantity:
|
|
21
|
-
cart_count:
|
|
22
|
-
total_amount: product.selling_price,
|
|
20
|
+
products_quantity: { [product.id]: qty },
|
|
21
|
+
total_quantity: qty,
|
|
22
|
+
cart_count: qty,
|
|
23
|
+
total_amount: Number(product.selling_price) * qty,
|
|
23
24
|
variant_discounts: {}
|
|
24
25
|
});
|
|
25
26
|
return;
|
|
@@ -29,23 +30,23 @@ var LocalCart = {
|
|
|
29
30
|
if (existingProduct) {
|
|
30
31
|
cart.products_quantity = {
|
|
31
32
|
...cart.products_quantity,
|
|
32
|
-
[product.id]: (Number(cart.products_quantity[product.id]) || 0) +
|
|
33
|
+
[product.id]: (Number(cart.products_quantity[product.id]) || 0) + qty
|
|
33
34
|
};
|
|
34
|
-
cart.total_quantity = Number(cart.total_quantity) +
|
|
35
|
-
cart.cart_count = Number(cart.cart_count) +
|
|
36
|
-
cart.total_amount = Number(cart.total_amount) + Number(product.selling_price);
|
|
35
|
+
cart.total_quantity = Number(cart.total_quantity) + qty;
|
|
36
|
+
cart.cart_count = Number(cart.cart_count) + qty;
|
|
37
|
+
cart.total_amount = Number(cart.total_amount) + Number(product.selling_price) * qty;
|
|
37
38
|
this.set(cart);
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
41
|
newCart.push(product);
|
|
41
42
|
cart.products_quantity = {
|
|
42
43
|
...cart.products_quantity,
|
|
43
|
-
[product.id]: (cart.products_quantity[product.id] || 0) +
|
|
44
|
+
[product.id]: (cart.products_quantity[product.id] || 0) + qty
|
|
44
45
|
};
|
|
45
46
|
cart.product_variants = newCart;
|
|
46
|
-
cart.total_quantity = Number(cart.total_quantity) +
|
|
47
|
-
cart.cart_count = Number(cart.cart_count) +
|
|
48
|
-
cart.total_amount = Number(cart.total_amount) + Number(product.selling_price);
|
|
47
|
+
cart.total_quantity = Number(cart.total_quantity) + qty;
|
|
48
|
+
cart.cart_count = Number(cart.cart_count) + qty;
|
|
49
|
+
cart.total_amount = Number(cart.total_amount) + Number(product.selling_price) * qty;
|
|
49
50
|
this.set(cart);
|
|
50
51
|
},
|
|
51
52
|
remove(product) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { updateCart, removeFromCart, addToCart, getCart, getCartItemQuantity } from './chunk-
|
|
2
|
-
import { cart_default } from './chunk-
|
|
1
|
+
import { updateCart, removeFromCart, addToCart, getCart, getCartItemQuantity } from './chunk-TY5NK7NW.js';
|
|
2
|
+
import { cart_default } from './chunk-H32TICAM.js';
|
|
3
3
|
import { updateOrderCustomization } from './chunk-ME6Z7TZW.js';
|
|
4
4
|
import { auth_default } from './chunk-WEMNXIRS.js';
|
|
5
5
|
import { USER_CRED_TOKEN, USER_CREDENTIALS } from './chunk-BQ256JKN.js';
|
|
@@ -63,7 +63,7 @@ var useCartStore = create((set) => ({
|
|
|
63
63
|
(p) => p.id === item.variant_id
|
|
64
64
|
);
|
|
65
65
|
if (product) {
|
|
66
|
-
cart_default.add(product);
|
|
66
|
+
cart_default.add(product, item.quantity);
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk5BT3MH4A_cjs = require('./chunk-5BT3MH4A.cjs');
|
|
4
|
+
var chunkLCMJYFHC_cjs = require('./chunk-LCMJYFHC.cjs');
|
|
5
5
|
var chunkLZADKC4Y_cjs = require('./chunk-LZADKC4Y.cjs');
|
|
6
6
|
var chunkBBRXE57K_cjs = require('./chunk-BBRXE57K.cjs');
|
|
7
7
|
var chunkNE3ZHELZ_cjs = require('./chunk-NE3ZHELZ.cjs');
|
|
@@ -23,7 +23,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
23
23
|
}),
|
|
24
24
|
fetchCartItemQuantity: async () => {
|
|
25
25
|
try {
|
|
26
|
-
const { total_quantity } = await
|
|
26
|
+
const { total_quantity } = await chunk5BT3MH4A_cjs.getCartItemQuantity();
|
|
27
27
|
set({ total_quantity });
|
|
28
28
|
} catch (error) {
|
|
29
29
|
console.error("Failed to fetch cart item quantity", error);
|
|
@@ -32,7 +32,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
32
32
|
syncCart: async (addressId, shippingOptionId) => {
|
|
33
33
|
set({ status: "loading" /* LOADING */ });
|
|
34
34
|
try {
|
|
35
|
-
const response = await
|
|
35
|
+
const response = await chunk5BT3MH4A_cjs.getCart("/customer/cart/", addressId, shippingOptionId);
|
|
36
36
|
if (response) {
|
|
37
37
|
set({ cart: response, total_quantity: response.total_quantity, status: "idle" /* IDLE */ });
|
|
38
38
|
}
|
|
@@ -43,7 +43,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
43
43
|
fetchCart: async (addressId, shippingOptionId) => {
|
|
44
44
|
set({ status: "loading" /* LOADING */ });
|
|
45
45
|
try {
|
|
46
|
-
const response = await
|
|
46
|
+
const response = await chunk5BT3MH4A_cjs.getCart("/customer/cart/", addressId, shippingOptionId);
|
|
47
47
|
if (response) {
|
|
48
48
|
set({ cart: response, total_quantity: response.total_quantity, status: "idle" /* IDLE */ });
|
|
49
49
|
}
|
|
@@ -55,21 +55,21 @@ var useCartStore = zustand.create((set) => ({
|
|
|
55
55
|
set({ status: "loading" /* LOADING */ });
|
|
56
56
|
try {
|
|
57
57
|
if (chunkBBRXE57K_cjs.auth_default.getUserDetails()) {
|
|
58
|
-
await
|
|
58
|
+
await chunk5BT3MH4A_cjs.addToCart(items, customizationInputs);
|
|
59
59
|
await useCartStore.getState().syncCart(addressId);
|
|
60
60
|
} else {
|
|
61
|
-
const cart =
|
|
61
|
+
const cart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
62
62
|
if (cart) {
|
|
63
63
|
items.forEach((item) => {
|
|
64
64
|
const product = cart.product_variants.find(
|
|
65
65
|
(p) => p.id === item.variant_id
|
|
66
66
|
);
|
|
67
67
|
if (product) {
|
|
68
|
-
|
|
68
|
+
chunkLCMJYFHC_cjs.cart_default.add(product, item.quantity);
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
const updatedCart =
|
|
72
|
+
const updatedCart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
73
73
|
if (updatedCart) {
|
|
74
74
|
set({ cart: updatedCart, total_quantity: updatedCart.total_quantity });
|
|
75
75
|
}
|
|
@@ -83,19 +83,19 @@ var useCartStore = zustand.create((set) => ({
|
|
|
83
83
|
set({ status: "loading" /* LOADING */ });
|
|
84
84
|
try {
|
|
85
85
|
if (chunkBBRXE57K_cjs.auth_default.getUserDetails()) {
|
|
86
|
-
await
|
|
86
|
+
await chunk5BT3MH4A_cjs.removeFromCart(items);
|
|
87
87
|
await useCartStore.getState().syncCart(addressId);
|
|
88
88
|
} else {
|
|
89
|
-
const cart =
|
|
89
|
+
const cart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
90
90
|
if (cart) {
|
|
91
91
|
items.forEach((item) => {
|
|
92
92
|
const product = cart.product_variants.find(
|
|
93
93
|
(p) => p.id === item.variant_id
|
|
94
94
|
);
|
|
95
|
-
if (product)
|
|
95
|
+
if (product) chunkLCMJYFHC_cjs.cart_default.remove(product);
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
const updatedCart =
|
|
98
|
+
const updatedCart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
99
99
|
if (updatedCart) {
|
|
100
100
|
set({
|
|
101
101
|
cart: updatedCart,
|
|
@@ -114,19 +114,19 @@ var useCartStore = zustand.create((set) => ({
|
|
|
114
114
|
set({ status: "loading" /* LOADING */ });
|
|
115
115
|
try {
|
|
116
116
|
if (chunkBBRXE57K_cjs.auth_default.getUserDetails()) {
|
|
117
|
-
await
|
|
117
|
+
await chunk5BT3MH4A_cjs.updateCart(items);
|
|
118
118
|
await useCartStore.getState().syncCart(addressId);
|
|
119
119
|
} else {
|
|
120
|
-
const cart =
|
|
120
|
+
const cart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
121
121
|
if (cart) {
|
|
122
122
|
items.forEach((item) => {
|
|
123
123
|
const product = cart.product_variants.find(
|
|
124
124
|
(p) => p.id === item.variant_id
|
|
125
125
|
);
|
|
126
|
-
if (product)
|
|
126
|
+
if (product) chunkLCMJYFHC_cjs.cart_default.updateQuantity(product, item.quantity);
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
const updatedCart =
|
|
129
|
+
const updatedCart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
130
130
|
if (updatedCart) {
|
|
131
131
|
set({
|
|
132
132
|
cart: updatedCart,
|
|
@@ -174,7 +174,7 @@ var useAuthStore = zustand.create((set, get) => ({
|
|
|
174
174
|
setTimeout(async () => {
|
|
175
175
|
try {
|
|
176
176
|
set({ user, status: "success" /* SUCCESS */, isAuthenticated: true });
|
|
177
|
-
const localCartItems =
|
|
177
|
+
const localCartItems = chunkLCMJYFHC_cjs.cart_default.get();
|
|
178
178
|
if (localCartItems) {
|
|
179
179
|
await useCartStore.getState().addToCart(
|
|
180
180
|
Object.entries(localCartItems.products_quantity).map(
|
|
@@ -184,7 +184,7 @@ var useAuthStore = zustand.create((set, get) => ({
|
|
|
184
184
|
})
|
|
185
185
|
)
|
|
186
186
|
);
|
|
187
|
-
|
|
187
|
+
chunkLCMJYFHC_cjs.cart_default.clear();
|
|
188
188
|
await useCartStore.getState().fetchCart();
|
|
189
189
|
setTimeout(() => {
|
|
190
190
|
if (!preventRefreshAfterLogin) {
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkY46EHRJQ_cjs = require('../chunk-Y46EHRJQ.cjs');
|
|
4
4
|
var chunk2AHH3XBW_cjs = require('../chunk-2AHH3XBW.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkZQOESVVE_cjs = require('../chunk-ZQOESVVE.cjs');
|
|
6
|
+
var chunk5BT3MH4A_cjs = require('../chunk-5BT3MH4A.cjs');
|
|
7
|
+
var chunkLCMJYFHC_cjs = require('../chunk-LCMJYFHC.cjs');
|
|
8
8
|
var chunkQSHOJ3NJ_cjs = require('../chunk-QSHOJ3NJ.cjs');
|
|
9
9
|
var chunkXFOUNOKO_cjs = require('../chunk-XFOUNOKO.cjs');
|
|
10
10
|
require('../chunk-K44JZ5NL.cjs');
|
|
@@ -56,7 +56,7 @@ var useCart = (addressId) => {
|
|
|
56
56
|
async (addrId, shippingId) => {
|
|
57
57
|
try {
|
|
58
58
|
setIsLoading(true);
|
|
59
|
-
const result = await
|
|
59
|
+
const result = await chunk5BT3MH4A_cjs.getCart("/customer/cart/", addrId ?? addressId, shippingId);
|
|
60
60
|
setData(result);
|
|
61
61
|
setError(null);
|
|
62
62
|
} catch (err) {
|
|
@@ -128,7 +128,7 @@ function useGetProducts(initialFilter, options) {
|
|
|
128
128
|
apiParams[key] = value;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
const result = await
|
|
131
|
+
const result = await chunk5BT3MH4A_cjs.getProductList(endpoint, apiParams);
|
|
132
132
|
setData(result);
|
|
133
133
|
if (modeRef.current === "append" && isLoadMoreRef.current) {
|
|
134
134
|
setProducts((prev) => [...prev, ...result.results || []]);
|
|
@@ -196,7 +196,7 @@ var useGetProductDetails = (slug) => {
|
|
|
196
196
|
const fetchData = react.useCallback(async () => {
|
|
197
197
|
try {
|
|
198
198
|
setIsLoading(true);
|
|
199
|
-
const result = await
|
|
199
|
+
const result = await chunk5BT3MH4A_cjs.getProductDetail("/inventory/products/", slug);
|
|
200
200
|
setData(result);
|
|
201
201
|
} catch (err) {
|
|
202
202
|
} finally {
|
|
@@ -219,7 +219,7 @@ var useGetProductCategories = () => {
|
|
|
219
219
|
const fetchData = async () => {
|
|
220
220
|
try {
|
|
221
221
|
setIsLoading(true);
|
|
222
|
-
const result = await
|
|
222
|
+
const result = await chunk5BT3MH4A_cjs.getProductCategories("/store/categories");
|
|
223
223
|
setData(result || []);
|
|
224
224
|
} catch (err) {
|
|
225
225
|
setError(err);
|
|
@@ -264,7 +264,7 @@ var useWishlist = () => {
|
|
|
264
264
|
const fetchData = react.useCallback(async () => {
|
|
265
265
|
try {
|
|
266
266
|
setIsLoading(true);
|
|
267
|
-
const response = await
|
|
267
|
+
const response = await chunk5BT3MH4A_cjs.getWishlist("/customer/wishlist/");
|
|
268
268
|
if (response.data) setData(response.data);
|
|
269
269
|
setError(null);
|
|
270
270
|
} catch (err) {
|
|
@@ -322,7 +322,7 @@ function useCheckoutPayment(options) {
|
|
|
322
322
|
const [isConfirmingPayment, setIsConfirmingPayment] = react.useState(false);
|
|
323
323
|
const [showSuccessModal, setShowSuccessModal] = react.useState(false);
|
|
324
324
|
const [showFailureModal, setShowFailureModal] = react.useState(false);
|
|
325
|
-
const resetCartCount =
|
|
325
|
+
const resetCartCount = chunkZQOESVVE_cjs.useCartStore((s) => s.resetCartCount);
|
|
326
326
|
const callbacks = {
|
|
327
327
|
onSuccess: (order) => {
|
|
328
328
|
setOrderSummary(order);
|
|
@@ -509,8 +509,8 @@ function useVariantSelector(options) {
|
|
|
509
509
|
}
|
|
510
510
|
function useShopCheckout(options) {
|
|
511
511
|
const { product, onNavigateToCart, onToast } = options;
|
|
512
|
-
const { addToCart, setCart } =
|
|
513
|
-
const isUserAuthenticated =
|
|
512
|
+
const { addToCart, setCart } = chunkZQOESVVE_cjs.useCartStore();
|
|
513
|
+
const isUserAuthenticated = chunkZQOESVVE_cjs.useAuthStore((s) => s.isAuthenticated);
|
|
514
514
|
const [isWishlisted, setIsWishlisted] = react.useState(product.is_wishlisted);
|
|
515
515
|
const [isAddedToCart, setIsAddedToCart] = react.useState(false);
|
|
516
516
|
const [loading, setLoading] = react.useState(false);
|
|
@@ -521,7 +521,7 @@ function useShopCheckout(options) {
|
|
|
521
521
|
react.useEffect(() => {
|
|
522
522
|
const fetchCategories = async () => {
|
|
523
523
|
try {
|
|
524
|
-
const response = await
|
|
524
|
+
const response = await chunk5BT3MH4A_cjs.getCategories();
|
|
525
525
|
setCategories(response.data);
|
|
526
526
|
} catch (error) {
|
|
527
527
|
console.log(error);
|
|
@@ -548,8 +548,8 @@ function useShopCheckout(options) {
|
|
|
548
548
|
setLoading(false);
|
|
549
549
|
}
|
|
550
550
|
} else {
|
|
551
|
-
|
|
552
|
-
const localCartItems =
|
|
551
|
+
chunkLCMJYFHC_cjs.cart_default.add(product, quantity);
|
|
552
|
+
const localCartItems = chunkLCMJYFHC_cjs.cart_default.get();
|
|
553
553
|
if (localCartItems) {
|
|
554
554
|
setCart(localCartItems);
|
|
555
555
|
}
|
|
@@ -594,8 +594,8 @@ function useShopCheckout(options) {
|
|
|
594
594
|
setLoading(false);
|
|
595
595
|
}
|
|
596
596
|
} else {
|
|
597
|
-
|
|
598
|
-
const localCartItems =
|
|
597
|
+
chunkLCMJYFHC_cjs.cart_default.add(product, quantity);
|
|
598
|
+
const localCartItems = chunkLCMJYFHC_cjs.cart_default.get();
|
|
599
599
|
if (localCartItems) {
|
|
600
600
|
setCart(localCartItems);
|
|
601
601
|
}
|
|
@@ -635,7 +635,7 @@ function useShopCheckout(options) {
|
|
|
635
635
|
const handleNotifyMeFormSubmit = react.useCallback(
|
|
636
636
|
async (values) => {
|
|
637
637
|
try {
|
|
638
|
-
const response = await
|
|
638
|
+
const response = await chunk5BT3MH4A_cjs.notifyProductStock({
|
|
639
639
|
...values,
|
|
640
640
|
variant_slug: product.slug
|
|
641
641
|
});
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getUserDetails } from '../chunk-WYXT5AAG.js';
|
|
2
2
|
import { findMatchingVariant, findSimilarVariant, isVariantCombinationAvailable, isColorVariantType } from '../chunk-HEFA67WK.js';
|
|
3
|
-
import { useCartStore, useAuthStore } from '../chunk-
|
|
4
|
-
import { getCart, getProductList, getProductDetail, getWishlist, notifyProductStock, getProductCategories, getCategories } from '../chunk-
|
|
5
|
-
import { cart_default } from '../chunk-
|
|
3
|
+
import { useCartStore, useAuthStore } from '../chunk-PGBYYKFQ.js';
|
|
4
|
+
import { getCart, getProductList, getProductDetail, getWishlist, notifyProductStock, getProductCategories, getCategories } from '../chunk-TY5NK7NW.js';
|
|
5
|
+
import { cart_default } from '../chunk-H32TICAM.js';
|
|
6
6
|
import { processPayment, fetchAvailableCoupons, applyCheckoutCoupon, removeCheckoutCoupon } from '../chunk-VYHAWRJR.js';
|
|
7
7
|
import { applyCoupon, removeCoupon, getCoupons, getAppliedCoupon } from '../chunk-7M5CVYZJ.js';
|
|
8
8
|
import '../chunk-WFDKKOO7.js';
|
|
@@ -546,7 +546,7 @@ function useShopCheckout(options) {
|
|
|
546
546
|
setLoading(false);
|
|
547
547
|
}
|
|
548
548
|
} else {
|
|
549
|
-
cart_default.add(product);
|
|
549
|
+
cart_default.add(product, quantity);
|
|
550
550
|
const localCartItems = cart_default.get();
|
|
551
551
|
if (localCartItems) {
|
|
552
552
|
setCart(localCartItems);
|
|
@@ -592,7 +592,7 @@ function useShopCheckout(options) {
|
|
|
592
592
|
setLoading(false);
|
|
593
593
|
}
|
|
594
594
|
} else {
|
|
595
|
-
cart_default.add(product);
|
|
595
|
+
cart_default.add(product, quantity);
|
|
596
596
|
const localCartItems = cart_default.get();
|
|
597
597
|
if (localCartItems) {
|
|
598
598
|
setCart(localCartItems);
|
|
@@ -116,4 +116,31 @@ declare namespace Blog {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
declare namespace Instagram {
|
|
120
|
+
type MediaType = "IMAGE" | "VIDEO" | "CAROUSEL_ALBUM";
|
|
121
|
+
interface MediaChild {
|
|
122
|
+
id: string;
|
|
123
|
+
media_type?: MediaType;
|
|
124
|
+
media_url?: string;
|
|
125
|
+
thumbnail_url?: string;
|
|
126
|
+
}
|
|
127
|
+
interface Media {
|
|
128
|
+
id: string;
|
|
129
|
+
caption?: string;
|
|
130
|
+
media_type: MediaType;
|
|
131
|
+
media_url?: string;
|
|
132
|
+
permalink?: string;
|
|
133
|
+
thumbnail_url?: string;
|
|
134
|
+
timestamp?: string;
|
|
135
|
+
like_count?: number;
|
|
136
|
+
comments_count?: number;
|
|
137
|
+
children?: {
|
|
138
|
+
data?: MediaChild[];
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
interface MediaRefreshResponse {
|
|
142
|
+
data: Media[];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { Analytics as A, Blog as B, Instagram as I, Review as R, type Booking as a, type BookingDetails as b };
|
|
@@ -116,4 +116,31 @@ declare namespace Blog {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
declare namespace Instagram {
|
|
120
|
+
type MediaType = "IMAGE" | "VIDEO" | "CAROUSEL_ALBUM";
|
|
121
|
+
interface MediaChild {
|
|
122
|
+
id: string;
|
|
123
|
+
media_type?: MediaType;
|
|
124
|
+
media_url?: string;
|
|
125
|
+
thumbnail_url?: string;
|
|
126
|
+
}
|
|
127
|
+
interface Media {
|
|
128
|
+
id: string;
|
|
129
|
+
caption?: string;
|
|
130
|
+
media_type: MediaType;
|
|
131
|
+
media_url?: string;
|
|
132
|
+
permalink?: string;
|
|
133
|
+
thumbnail_url?: string;
|
|
134
|
+
timestamp?: string;
|
|
135
|
+
like_count?: number;
|
|
136
|
+
comments_count?: number;
|
|
137
|
+
children?: {
|
|
138
|
+
data?: MediaChild[];
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
interface MediaRefreshResponse {
|
|
142
|
+
data: Media[];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { Analytics as A, Blog as B, Instagram as I, Review as R, type Booking as a, type BookingDetails as b };
|
package/dist/models/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { A as Address } from '../address-DwBZHzbI.cjs';
|
|
2
|
-
export { A as Analytics, B as Blog, a as Booking, b as BookingDetails, R as Review } from '../
|
|
2
|
+
export { A as Analytics, B as Blog, a as Booking, b as BookingDetails, I as Instagram, R as Review } from '../instagram-D4JUT4ZU.cjs';
|
|
3
3
|
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, U as User, V as ValueType } from '../cart-CyN2JQTw.cjs';
|
|
4
4
|
export { A as CollectionAttributes, C as CollectionResponse, s as singleCollection } from '../collections-8YdINtUf.cjs';
|
|
5
5
|
export { O as Order } from '../orders-9_scVq_M.cjs';
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { A as Address } from '../address-DwBZHzbI.js';
|
|
2
|
-
export { A as Analytics, B as Blog, a as Booking, b as BookingDetails, R as Review } from '../
|
|
2
|
+
export { A as Analytics, B as Blog, a as Booking, b as BookingDetails, I as Instagram, R as Review } from '../instagram-CqJBZ-0X.js';
|
|
3
3
|
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, U as User, V as ValueType } from '../cart-BGIsIZdM.js';
|
|
4
4
|
export { A as CollectionAttributes, C as CollectionResponse, s as singleCollection } from '../collections-ycrA2cPL.js';
|
|
5
5
|
export { O as Order } from '../orders-C1XZr8tx.js';
|
package/dist/store/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var chunkZQOESVVE_cjs = require('../chunk-ZQOESVVE.cjs');
|
|
4
|
+
var chunk5BT3MH4A_cjs = require('../chunk-5BT3MH4A.cjs');
|
|
5
|
+
require('../chunk-LCMJYFHC.cjs');
|
|
6
6
|
require('../chunk-LZADKC4Y.cjs');
|
|
7
7
|
var chunkDODFO744_cjs = require('../chunk-DODFO744.cjs');
|
|
8
8
|
require('../chunk-ECHV2JSY.cjs');
|
|
@@ -21,7 +21,7 @@ var useWishlistStore = zustand.create((set) => ({
|
|
|
21
21
|
resetWishlist: () => set(initialState),
|
|
22
22
|
syncWishlist: async () => {
|
|
23
23
|
try {
|
|
24
|
-
const response = await
|
|
24
|
+
const response = await chunk5BT3MH4A_cjs.getWishlist("/customer/wishlist/");
|
|
25
25
|
if (response.data) {
|
|
26
26
|
set({
|
|
27
27
|
wishlist_count: response.data.wishlist_count,
|
|
@@ -49,7 +49,7 @@ var useProductStore = zustand.create((set, get) => ({
|
|
|
49
49
|
data: filter.page === 1 ? [] : state.data
|
|
50
50
|
}));
|
|
51
51
|
try {
|
|
52
|
-
const response = await
|
|
52
|
+
const response = await chunk5BT3MH4A_cjs.getProducts({ ...filter });
|
|
53
53
|
if (response.data) {
|
|
54
54
|
const { results, ...meta } = response.data;
|
|
55
55
|
set((state) => ({
|
|
@@ -69,15 +69,15 @@ var useProductStore = zustand.create((set, get) => ({
|
|
|
69
69
|
|
|
70
70
|
Object.defineProperty(exports, "loginUser", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkZQOESVVE_cjs.loginUser; }
|
|
73
73
|
});
|
|
74
74
|
Object.defineProperty(exports, "useAuthStore", {
|
|
75
75
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkZQOESVVE_cjs.useAuthStore; }
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "useCartStore", {
|
|
79
79
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkZQOESVVE_cjs.useCartStore; }
|
|
81
81
|
});
|
|
82
82
|
Object.defineProperty(exports, "useThemeData", {
|
|
83
83
|
enumerable: true,
|
package/dist/store/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { loginUser, useAuthStore, useCartStore } from '../chunk-
|
|
2
|
-
import { getWishlist, getProducts } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { loginUser, useAuthStore, useCartStore } from '../chunk-PGBYYKFQ.js';
|
|
2
|
+
import { getWishlist, getProducts } from '../chunk-TY5NK7NW.js';
|
|
3
|
+
import '../chunk-H32TICAM.js';
|
|
4
4
|
import '../chunk-ME6Z7TZW.js';
|
|
5
5
|
export { useThemeData } from '../chunk-5NUDTIQ2.js';
|
|
6
6
|
import '../chunk-3SYYP3XV.js';
|
package/dist/utils/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkGTV42PDK_cjs = require('../chunk-GTV42PDK.cjs');
|
|
4
4
|
var chunk2AHH3XBW_cjs = require('../chunk-2AHH3XBW.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkLCMJYFHC_cjs = require('../chunk-LCMJYFHC.cjs');
|
|
6
6
|
var chunkK44JZ5NL_cjs = require('../chunk-K44JZ5NL.cjs');
|
|
7
7
|
var chunkLJUGNSQQ_cjs = require('../chunk-LJUGNSQQ.cjs');
|
|
8
8
|
var chunk6LS5F4R3_cjs = require('../chunk-6LS5F4R3.cjs');
|
|
@@ -355,7 +355,7 @@ Object.defineProperty(exports, "isVariantCombinationAvailable", {
|
|
|
355
355
|
});
|
|
356
356
|
Object.defineProperty(exports, "LocalCart", {
|
|
357
357
|
enumerable: true,
|
|
358
|
-
get: function () { return
|
|
358
|
+
get: function () { return chunkLCMJYFHC_cjs.cart_default; }
|
|
359
359
|
});
|
|
360
360
|
Object.defineProperty(exports, "pixelEvents", {
|
|
361
361
|
enumerable: true,
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -57,7 +57,7 @@ declare function generateCacheKey(endpoint: string, params?: Record<string, any>
|
|
|
57
57
|
declare const LocalCart: {
|
|
58
58
|
get(): Cart.Root | null;
|
|
59
59
|
set(cart: any): void;
|
|
60
|
-
add(product: ProductDetail.Root): void;
|
|
60
|
+
add(product: ProductDetail.Root, quantity?: number): void;
|
|
61
61
|
remove(product: ProductDetail.Root): void;
|
|
62
62
|
updateQuantity(product: ProductDetail.Root, quantity: number): void;
|
|
63
63
|
clear(): void;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare function generateCacheKey(endpoint: string, params?: Record<string, any>
|
|
|
57
57
|
declare const LocalCart: {
|
|
58
58
|
get(): Cart.Root | null;
|
|
59
59
|
set(cart: any): void;
|
|
60
|
-
add(product: ProductDetail.Root): void;
|
|
60
|
+
add(product: ProductDetail.Root, quantity?: number): void;
|
|
61
61
|
remove(product: ProductDetail.Root): void;
|
|
62
62
|
updateQuantity(product: ProductDetail.Root, quantity: number): void;
|
|
63
63
|
clear(): void;
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { authRoutes, protectedRoutes, publicRoutes, routes_default as urls } from '../chunk-4C4NTH6O.js';
|
|
2
2
|
export { findMatchingVariant, findSimilarVariant, isColorVariantType, isVariantCombinationAvailable } from '../chunk-HEFA67WK.js';
|
|
3
|
-
export { cart_default as LocalCart } from '../chunk-
|
|
3
|
+
export { cart_default as LocalCart } from '../chunk-H32TICAM.js';
|
|
4
4
|
export { pixelEvents } from '../chunk-WFDKKOO7.js';
|
|
5
5
|
export { CacheManager, cache, clearCache, deleteCache, generateCacheKey, getCache, hasCache, invalidateCache, setCache } from '../chunk-OSM73ETC.js';
|
|
6
6
|
import { digestMessage } from '../chunk-CBKJ3Y2I.js';
|