@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,131 @@
|
|
|
1
|
+
export { getUserDetails, updateUserDetails } from '../chunk-7UH6REGV.js';
|
|
2
|
+
export { addToCart, addWishlist, getCart, getCategories, getDigitalProductDownloadLink, getProductCategories, getProductDetail, getProductDetailBySlug, getProductList, getProducts, getWishlist, notifyProductStock, removeFromCart, removeFromWishlist, updateCart, updateDigitalProductDownloadLinkCount } from '../chunk-57ZBPAXU.js';
|
|
3
|
+
import '../chunk-E7WPE3PV.js';
|
|
4
|
+
export { applyCoupon, checkPhonepePaymentStatus, getAppliedCoupon, getCoupons, getOrderDetails, getOrderDetailsByNumber, getOrders, getPublicOrderDetailsByNumber, getStripePaymentStatus, getStripePaymentStatusPublic, makeCODOrder, phonepeOrderSuccess, phonepePublicOrderSuccess, placeOrder, publicMakeCODOrder, publicPlaceOrder, razorpayOrderFail, razorpayOrderSuccess, razorpayPublicOrderSuccess, removeCoupon, stripeOrderFail, stripeOrderSuccess, stripePublicOrderSuccess, updateOrder, updateOrderCustomization, uploadCustomizationImage, verifyTabbyPayment } from '../chunk-4MJMNIAB.js';
|
|
5
|
+
export { addAddress, deleteAddress, getAddresses, getCountries, getSubdivisions, updateAddress } from '../chunk-LBGIUNM6.js';
|
|
6
|
+
import { http_service_default } from '../chunk-GB3HW6DM.js';
|
|
7
|
+
export { getHttpService, http_service_default as httpService, resetHttpService } from '../chunk-GB3HW6DM.js';
|
|
8
|
+
import '../chunk-FLBJKM6G.js';
|
|
9
|
+
import { getApiEndpoint } from '../chunk-JQMLHRWL.js';
|
|
10
|
+
import axios from 'axios';
|
|
11
|
+
|
|
12
|
+
var _serverInstance = null;
|
|
13
|
+
function createServerInstance() {
|
|
14
|
+
const baseURL = getApiEndpoint();
|
|
15
|
+
if (!baseURL) {
|
|
16
|
+
throw new Error("Missing API_ENDPOINT. Call initConfig() with apiEndpoint.");
|
|
17
|
+
}
|
|
18
|
+
axios.defaults.withCredentials = true;
|
|
19
|
+
const instance = axios.create({
|
|
20
|
+
baseURL,
|
|
21
|
+
withCredentials: true
|
|
22
|
+
});
|
|
23
|
+
const onRequestSuccess = (config) => {
|
|
24
|
+
return config;
|
|
25
|
+
};
|
|
26
|
+
const onRequestFail = (error) => {
|
|
27
|
+
return Promise.reject(error);
|
|
28
|
+
};
|
|
29
|
+
instance.interceptors.request.use(onRequestSuccess, onRequestFail);
|
|
30
|
+
const onResponseSuccess = (response) => {
|
|
31
|
+
return response;
|
|
32
|
+
};
|
|
33
|
+
const onResponseFail = (error) => {
|
|
34
|
+
if (error && !error.response) ; else {
|
|
35
|
+
const status = error.response?.status;
|
|
36
|
+
if (status === 401) {
|
|
37
|
+
error.response?.data?.detail;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return Promise.reject(error);
|
|
41
|
+
};
|
|
42
|
+
instance.interceptors.response.use(onResponseSuccess, onResponseFail);
|
|
43
|
+
return instance;
|
|
44
|
+
}
|
|
45
|
+
function getServerHttpService() {
|
|
46
|
+
if (!_serverInstance) {
|
|
47
|
+
_serverInstance = createServerInstance();
|
|
48
|
+
}
|
|
49
|
+
return _serverInstance;
|
|
50
|
+
}
|
|
51
|
+
var serverHttpService = new Proxy({}, {
|
|
52
|
+
get(_target, prop) {
|
|
53
|
+
return getServerHttpService()[prop];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
var server_http_service_default = serverHttpService;
|
|
57
|
+
|
|
58
|
+
// src/api/auth.ts
|
|
59
|
+
var sendOTP = async (credentials) => {
|
|
60
|
+
return http_service_default.post("/store/login/", {
|
|
61
|
+
...credentials,
|
|
62
|
+
platform: "APP",
|
|
63
|
+
step: "SEND_OTP"
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
var verifyOTP = async (credentials) => {
|
|
67
|
+
return http_service_default.post("/store/login/", {
|
|
68
|
+
...credentials,
|
|
69
|
+
platform: "APP",
|
|
70
|
+
step: "VERIFY_OTP"
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
function getNewToken(refresh) {
|
|
74
|
+
return http_service_default.post("/api/token/refresh/", { refresh });
|
|
75
|
+
}
|
|
76
|
+
function getLoginMethod() {
|
|
77
|
+
return http_service_default.get("/store/login_options/");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/api/filter.ts
|
|
81
|
+
async function getFilters() {
|
|
82
|
+
return http_service_default.get("/store/filter/");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// src/api/collection.ts
|
|
86
|
+
async function getCollection(slug) {
|
|
87
|
+
return await http_service_default.get(`/inventory/public/collections/${slug}/`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// src/api/review.ts
|
|
91
|
+
async function addReview(content) {
|
|
92
|
+
return http_service_default.post("/reviews/customer/", content);
|
|
93
|
+
}
|
|
94
|
+
async function getReviews(data) {
|
|
95
|
+
const { filters, ...rest } = data;
|
|
96
|
+
return http_service_default.get("/reviews/store/", {
|
|
97
|
+
params: { ...rest, ...filters }
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async function getReviewSummary(review_type, variant_slug) {
|
|
101
|
+
return http_service_default.get("/reviews/summary/", {
|
|
102
|
+
params: { review_type, variant_slug }
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
async function uploadReviewImages(uploadForm) {
|
|
106
|
+
return http_service_default.post("/utils/upload_image", uploadForm);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/api/affiliate.ts
|
|
110
|
+
async function getAffiliateRedirect(ref) {
|
|
111
|
+
return http_service_default.get("/marketing/aff-redirect/", {
|
|
112
|
+
params: { ref }
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// src/api/analytics.ts
|
|
117
|
+
async function postAnalytics(data) {
|
|
118
|
+
return http_service_default.post("/spa/cad/", data);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// src/api/booking.ts
|
|
122
|
+
async function createBooking(bookingData) {
|
|
123
|
+
return http_service_default.post("/customer/service_booking/", bookingData);
|
|
124
|
+
}
|
|
125
|
+
async function getUserBookings(filter) {
|
|
126
|
+
return http_service_default.get("/customer/service_booking/", {
|
|
127
|
+
params: { ...filter }
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { addReview, createBooking, getAffiliateRedirect, getCollection, getFilters, getLoginMethod, getNewToken, getReviewSummary, getReviews, getServerHttpService, getUserBookings, postAnalytics, sendOTP, server_http_service_default as serverHttpService, uploadReviewImages, verifyOTP };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { e as ProductDetail } from './cart-DVrn8hD0.js';
|
|
2
|
+
|
|
3
|
+
interface CollectionResponse {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
is_published: boolean;
|
|
9
|
+
image: string | null;
|
|
10
|
+
published_at: string | null;
|
|
11
|
+
variants?: any[];
|
|
12
|
+
}
|
|
13
|
+
interface singleCollection {
|
|
14
|
+
slug: string;
|
|
15
|
+
}
|
|
16
|
+
interface Attributes {
|
|
17
|
+
[key: string]: {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface CollectionVariant {
|
|
23
|
+
id: number;
|
|
24
|
+
name: string;
|
|
25
|
+
sku: string;
|
|
26
|
+
actual_price: string;
|
|
27
|
+
selling_price: string;
|
|
28
|
+
stock_quantity: number;
|
|
29
|
+
product: number;
|
|
30
|
+
is_active: boolean;
|
|
31
|
+
is_featured: boolean;
|
|
32
|
+
product_measurements: string;
|
|
33
|
+
attributes: Attributes;
|
|
34
|
+
back_order: boolean;
|
|
35
|
+
back_order_limit: number;
|
|
36
|
+
user_purchase_limit: number;
|
|
37
|
+
status: string;
|
|
38
|
+
product_photos: any[];
|
|
39
|
+
media: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare namespace Review {
|
|
43
|
+
interface ReviewPayload {
|
|
44
|
+
review_type: "store" | "product";
|
|
45
|
+
product: number;
|
|
46
|
+
rating: number;
|
|
47
|
+
title: string;
|
|
48
|
+
content: string;
|
|
49
|
+
images: string[];
|
|
50
|
+
}
|
|
51
|
+
interface ReviewItem {
|
|
52
|
+
id: number;
|
|
53
|
+
created_at: string;
|
|
54
|
+
customer_name: string;
|
|
55
|
+
purchase_verified: boolean;
|
|
56
|
+
rating: number;
|
|
57
|
+
title: string;
|
|
58
|
+
content: string;
|
|
59
|
+
replied_by: any;
|
|
60
|
+
reply_content: string;
|
|
61
|
+
reply_created_at: string;
|
|
62
|
+
uploaded_images: string[];
|
|
63
|
+
}
|
|
64
|
+
interface ReviewSummary {
|
|
65
|
+
average_rating: number;
|
|
66
|
+
total_reviews: number;
|
|
67
|
+
rating_5: number;
|
|
68
|
+
rating_4: number;
|
|
69
|
+
rating_3: number;
|
|
70
|
+
rating_2: number;
|
|
71
|
+
rating_1: number;
|
|
72
|
+
}
|
|
73
|
+
interface GetReviewResponse {
|
|
74
|
+
count: number;
|
|
75
|
+
next: string;
|
|
76
|
+
results: ReviewItem[];
|
|
77
|
+
rating_summary: ReviewSummary;
|
|
78
|
+
current_page: number;
|
|
79
|
+
total_pages: number;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare namespace Analytics {
|
|
84
|
+
interface Root {
|
|
85
|
+
unique_visitors: UniqueVisitors;
|
|
86
|
+
top_pages: TopPage[];
|
|
87
|
+
}
|
|
88
|
+
interface UniqueVisitors {
|
|
89
|
+
unique_users: number;
|
|
90
|
+
unique_visitors: number;
|
|
91
|
+
total: number;
|
|
92
|
+
}
|
|
93
|
+
interface TopPage {
|
|
94
|
+
path: string;
|
|
95
|
+
visit_count: number;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface BookingDetails {
|
|
100
|
+
customer_name: string;
|
|
101
|
+
customer_phone: string;
|
|
102
|
+
service_date: Date | null;
|
|
103
|
+
service_time: string;
|
|
104
|
+
customer_address: string;
|
|
105
|
+
customer_email: string;
|
|
106
|
+
customer_pincode: string;
|
|
107
|
+
customer_city: string;
|
|
108
|
+
}
|
|
109
|
+
interface Booking {
|
|
110
|
+
id: number;
|
|
111
|
+
booking_service: number;
|
|
112
|
+
product_variant: number;
|
|
113
|
+
slot_start_time: string | null;
|
|
114
|
+
slot_end_time: string | null;
|
|
115
|
+
booking_date: string;
|
|
116
|
+
booking_status: string;
|
|
117
|
+
booking_amount_paid: string;
|
|
118
|
+
booking_amount_paid_at: string | null;
|
|
119
|
+
booking_amount_paid_method: string;
|
|
120
|
+
customer_name: string;
|
|
121
|
+
customer_phone: string;
|
|
122
|
+
customer_address: string;
|
|
123
|
+
customer_email: string;
|
|
124
|
+
customer_pincode: string;
|
|
125
|
+
customer_city: string;
|
|
126
|
+
customer_country_code: string;
|
|
127
|
+
booking_number: number;
|
|
128
|
+
service_details: ProductDetail.Root;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { Analytics as A, type Booking as B, type CollectionResponse as C, Review as R, type BookingDetails as a, type Attributes as b, type CollectionVariant as c, type singleCollection as s };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { e as ProductDetail } from './cart-DVrn8hD0.cjs';
|
|
2
|
+
|
|
3
|
+
interface CollectionResponse {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
is_published: boolean;
|
|
9
|
+
image: string | null;
|
|
10
|
+
published_at: string | null;
|
|
11
|
+
variants?: any[];
|
|
12
|
+
}
|
|
13
|
+
interface singleCollection {
|
|
14
|
+
slug: string;
|
|
15
|
+
}
|
|
16
|
+
interface Attributes {
|
|
17
|
+
[key: string]: {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface CollectionVariant {
|
|
23
|
+
id: number;
|
|
24
|
+
name: string;
|
|
25
|
+
sku: string;
|
|
26
|
+
actual_price: string;
|
|
27
|
+
selling_price: string;
|
|
28
|
+
stock_quantity: number;
|
|
29
|
+
product: number;
|
|
30
|
+
is_active: boolean;
|
|
31
|
+
is_featured: boolean;
|
|
32
|
+
product_measurements: string;
|
|
33
|
+
attributes: Attributes;
|
|
34
|
+
back_order: boolean;
|
|
35
|
+
back_order_limit: number;
|
|
36
|
+
user_purchase_limit: number;
|
|
37
|
+
status: string;
|
|
38
|
+
product_photos: any[];
|
|
39
|
+
media: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare namespace Review {
|
|
43
|
+
interface ReviewPayload {
|
|
44
|
+
review_type: "store" | "product";
|
|
45
|
+
product: number;
|
|
46
|
+
rating: number;
|
|
47
|
+
title: string;
|
|
48
|
+
content: string;
|
|
49
|
+
images: string[];
|
|
50
|
+
}
|
|
51
|
+
interface ReviewItem {
|
|
52
|
+
id: number;
|
|
53
|
+
created_at: string;
|
|
54
|
+
customer_name: string;
|
|
55
|
+
purchase_verified: boolean;
|
|
56
|
+
rating: number;
|
|
57
|
+
title: string;
|
|
58
|
+
content: string;
|
|
59
|
+
replied_by: any;
|
|
60
|
+
reply_content: string;
|
|
61
|
+
reply_created_at: string;
|
|
62
|
+
uploaded_images: string[];
|
|
63
|
+
}
|
|
64
|
+
interface ReviewSummary {
|
|
65
|
+
average_rating: number;
|
|
66
|
+
total_reviews: number;
|
|
67
|
+
rating_5: number;
|
|
68
|
+
rating_4: number;
|
|
69
|
+
rating_3: number;
|
|
70
|
+
rating_2: number;
|
|
71
|
+
rating_1: number;
|
|
72
|
+
}
|
|
73
|
+
interface GetReviewResponse {
|
|
74
|
+
count: number;
|
|
75
|
+
next: string;
|
|
76
|
+
results: ReviewItem[];
|
|
77
|
+
rating_summary: ReviewSummary;
|
|
78
|
+
current_page: number;
|
|
79
|
+
total_pages: number;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare namespace Analytics {
|
|
84
|
+
interface Root {
|
|
85
|
+
unique_visitors: UniqueVisitors;
|
|
86
|
+
top_pages: TopPage[];
|
|
87
|
+
}
|
|
88
|
+
interface UniqueVisitors {
|
|
89
|
+
unique_users: number;
|
|
90
|
+
unique_visitors: number;
|
|
91
|
+
total: number;
|
|
92
|
+
}
|
|
93
|
+
interface TopPage {
|
|
94
|
+
path: string;
|
|
95
|
+
visit_count: number;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface BookingDetails {
|
|
100
|
+
customer_name: string;
|
|
101
|
+
customer_phone: string;
|
|
102
|
+
service_date: Date | null;
|
|
103
|
+
service_time: string;
|
|
104
|
+
customer_address: string;
|
|
105
|
+
customer_email: string;
|
|
106
|
+
customer_pincode: string;
|
|
107
|
+
customer_city: string;
|
|
108
|
+
}
|
|
109
|
+
interface Booking {
|
|
110
|
+
id: number;
|
|
111
|
+
booking_service: number;
|
|
112
|
+
product_variant: number;
|
|
113
|
+
slot_start_time: string | null;
|
|
114
|
+
slot_end_time: string | null;
|
|
115
|
+
booking_date: string;
|
|
116
|
+
booking_status: string;
|
|
117
|
+
booking_amount_paid: string;
|
|
118
|
+
booking_amount_paid_at: string | null;
|
|
119
|
+
booking_amount_paid_method: string;
|
|
120
|
+
customer_name: string;
|
|
121
|
+
customer_phone: string;
|
|
122
|
+
customer_address: string;
|
|
123
|
+
customer_email: string;
|
|
124
|
+
customer_pincode: string;
|
|
125
|
+
customer_city: string;
|
|
126
|
+
customer_country_code: string;
|
|
127
|
+
booking_number: number;
|
|
128
|
+
service_details: ProductDetail.Root;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { Analytics as A, type Booking as B, type CollectionResponse as C, Review as R, type BookingDetails as a, type Attributes as b, type CollectionVariant as c, type singleCollection as s };
|