medusa-storefront-data 2.5.3 → 2.5.4
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/segment-data/default-page-input.json +191 -0
- package/dist/src/config.d.ts +3 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +31 -0
- package/dist/src/cookies.d.ts +23 -0
- package/dist/src/cookies.d.ts.map +1 -0
- package/dist/src/cookies.js +140 -0
- package/dist/src/dynamic-config-schema/index.d.ts +103 -0
- package/dist/src/dynamic-config-schema/index.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/index.js +172 -0
- package/dist/src/dynamic-config-schema/sections/about-brand.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/about-brand.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/about-brand.js +30 -0
- package/dist/src/dynamic-config-schema/sections/baptism-picks.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/baptism-picks.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/baptism-picks.js +17 -0
- package/dist/src/dynamic-config-schema/sections/baptism.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/baptism.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/baptism.js +4 -0
- package/dist/src/dynamic-config-schema/sections/blog-posts.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/blog-posts.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/blog-posts.js +31 -0
- package/dist/src/dynamic-config-schema/sections/brand-marquee.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/brand-marquee.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/brand-marquee.js +9 -0
- package/dist/src/dynamic-config-schema/sections/brand-pillars.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/brand-pillars.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/brand-pillars.js +29 -0
- package/dist/src/dynamic-config-schema/sections/category-pills.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/category-pills.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/category-pills.js +4 -0
- package/dist/src/dynamic-config-schema/sections/celebrity-trust.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/celebrity-trust.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/celebrity-trust.js +4 -0
- package/dist/src/dynamic-config-schema/sections/features.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/features.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/features.js +12 -0
- package/dist/src/dynamic-config-schema/sections/hero.d.ts +6 -0
- package/dist/src/dynamic-config-schema/sections/hero.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/hero.js +9 -0
- package/dist/src/dynamic-config-schema/sections/index.d.ts +24 -0
- package/dist/src/dynamic-config-schema/sections/index.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/index.js +23 -0
- package/dist/src/dynamic-config-schema/sections/instagram-posts.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/instagram-posts.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/instagram-posts.js +30 -0
- package/dist/src/dynamic-config-schema/sections/loved-by-moms.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/loved-by-moms.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/loved-by-moms.js +4 -0
- package/dist/src/dynamic-config-schema/sections/luxe-favourites.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/luxe-favourites.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/luxe-favourites.js +4 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals-classic.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals-classic.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals-classic.js +12 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/new-arrivals.js +12 -0
- package/dist/src/dynamic-config-schema/sections/promo-announcements.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/promo-announcements.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/promo-announcements.js +16 -0
- package/dist/src/dynamic-config-schema/sections/promo-countdown.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/promo-countdown.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/promo-countdown.js +16 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-age.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-age.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-age.js +4 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-category.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-category.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/shop-by-category.js +4 -0
- package/dist/src/dynamic-config-schema/sections/testimonials.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/testimonials.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/testimonials.js +9 -0
- package/dist/src/dynamic-config-schema/sections/theme-dresses.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/theme-dresses.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/theme-dresses.js +4 -0
- package/dist/src/dynamic-config-schema/sections/video-stories.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/video-stories.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/video-stories.js +24 -0
- package/dist/src/dynamic-config-schema/sections/why-choose-us.d.ts +5 -0
- package/dist/src/dynamic-config-schema/sections/why-choose-us.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/sections/why-choose-us.js +9 -0
- package/dist/src/dynamic-config-schema/shared.d.ts +35 -0
- package/dist/src/dynamic-config-schema/shared.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/shared.js +99 -0
- package/dist/src/dynamic-config-schema/site-configs.d.ts +11 -0
- package/dist/src/dynamic-config-schema/site-configs.d.ts.map +1 -0
- package/dist/src/dynamic-config-schema/site-configs.js +70 -0
- package/dist/src/edge.d.ts +3 -0
- package/dist/src/edge.d.ts.map +1 -0
- package/dist/src/edge.js +1 -0
- package/dist/src/middleware.d.ts +3 -0
- package/dist/src/middleware.d.ts.map +1 -0
- package/dist/src/middleware.js +1 -0
- package/dist/src/server/brand-pillars-from-categories.d.ts +8 -0
- package/dist/src/server/brand-pillars-from-categories.d.ts.map +1 -0
- package/dist/src/server/brand-pillars-from-categories.js +92 -0
- package/dist/src/server/cart.d.ts +96 -0
- package/dist/src/server/cart.d.ts.map +1 -0
- package/dist/src/server/cart.js +797 -0
- package/dist/src/server/categories.d.ts +4 -0
- package/dist/src/server/categories.d.ts.map +1 -0
- package/dist/src/server/categories.js +34 -0
- package/dist/src/server/collections.d.ts +8 -0
- package/dist/src/server/collections.d.ts.map +1 -0
- package/dist/src/server/collections.js +39 -0
- package/dist/src/server/config-merge.d.ts +3 -0
- package/dist/src/server/config-merge.d.ts.map +1 -0
- package/dist/src/server/config-merge.js +31 -0
- package/dist/src/server/contact.d.ts +34 -0
- package/dist/src/server/contact.d.ts.map +1 -0
- package/dist/src/server/contact.js +57 -0
- package/dist/src/server/customer-registration.d.ts +142 -0
- package/dist/src/server/customer-registration.d.ts.map +1 -0
- package/dist/src/server/customer-registration.js +295 -0
- package/dist/src/server/customer.d.ts +48 -0
- package/dist/src/server/customer.d.ts.map +1 -0
- package/dist/src/server/customer.js +413 -0
- package/dist/src/server/dynamic-config-api.d.ts +11 -0
- package/dist/src/server/dynamic-config-api.d.ts.map +1 -0
- package/dist/src/server/dynamic-config-api.js +46 -0
- package/dist/src/server/dynamic-config.d.ts +176 -0
- package/dist/src/server/dynamic-config.d.ts.map +1 -0
- package/dist/src/server/dynamic-config.js +648 -0
- package/dist/src/server/fulfillment.d.ts +5 -0
- package/dist/src/server/fulfillment.d.ts.map +1 -0
- package/dist/src/server/fulfillment.js +47 -0
- package/dist/src/server/guest.d.ts +81 -0
- package/dist/src/server/guest.d.ts.map +1 -0
- package/dist/src/server/guest.js +183 -0
- package/dist/src/server/help-faq-section-defaults.json +92 -0
- package/dist/src/server/help-sections/help-faq.d.ts +11 -0
- package/dist/src/server/help-sections/help-faq.d.ts.map +1 -0
- package/dist/src/server/help-sections/help-faq.js +6 -0
- package/dist/src/server/help-sections/index.d.ts +2 -0
- package/dist/src/server/help-sections/index.d.ts.map +1 -0
- package/dist/src/server/help-sections/index.js +1 -0
- package/dist/src/server/home-sections/about-brand.d.ts +9 -0
- package/dist/src/server/home-sections/about-brand.d.ts.map +1 -0
- package/dist/src/server/home-sections/about-brand.js +9 -0
- package/dist/src/server/home-sections/baptism-picks.d.ts +10 -0
- package/dist/src/server/home-sections/baptism-picks.d.ts.map +1 -0
- package/dist/src/server/home-sections/baptism-picks.js +27 -0
- package/dist/src/server/home-sections/baptism.d.ts +13 -0
- package/dist/src/server/home-sections/baptism.d.ts.map +1 -0
- package/dist/src/server/home-sections/baptism.js +43 -0
- package/dist/src/server/home-sections/blog-posts.d.ts +9 -0
- package/dist/src/server/home-sections/blog-posts.d.ts.map +1 -0
- package/dist/src/server/home-sections/blog-posts.js +9 -0
- package/dist/src/server/home-sections/brand-marquee.d.ts +8 -0
- package/dist/src/server/home-sections/brand-marquee.d.ts.map +1 -0
- package/dist/src/server/home-sections/brand-marquee.js +7 -0
- package/dist/src/server/home-sections/brand-pillars.d.ts +9 -0
- package/dist/src/server/home-sections/brand-pillars.d.ts.map +1 -0
- package/dist/src/server/home-sections/brand-pillars.js +9 -0
- package/dist/src/server/home-sections/category-pills.d.ts +9 -0
- package/dist/src/server/home-sections/category-pills.d.ts.map +1 -0
- package/dist/src/server/home-sections/category-pills.js +19 -0
- package/dist/src/server/home-sections/celebrity-trust.d.ts +12 -0
- package/dist/src/server/home-sections/celebrity-trust.d.ts.map +1 -0
- package/dist/src/server/home-sections/celebrity-trust.js +27 -0
- package/dist/src/server/home-sections/features.d.ts +9 -0
- package/dist/src/server/home-sections/features.d.ts.map +1 -0
- package/dist/src/server/home-sections/features.js +9 -0
- package/dist/src/server/home-sections/hero.d.ts +9 -0
- package/dist/src/server/home-sections/hero.d.ts.map +1 -0
- package/dist/src/server/home-sections/hero.js +9 -0
- package/dist/src/server/home-sections/instagram-posts.d.ts +9 -0
- package/dist/src/server/home-sections/instagram-posts.d.ts.map +1 -0
- package/dist/src/server/home-sections/instagram-posts.js +9 -0
- package/dist/src/server/home-sections/loved-by-moms.d.ts +12 -0
- package/dist/src/server/home-sections/loved-by-moms.d.ts.map +1 -0
- package/dist/src/server/home-sections/loved-by-moms.js +20 -0
- package/dist/src/server/home-sections/luxe-favourites.d.ts +11 -0
- package/dist/src/server/home-sections/luxe-favourites.d.ts.map +1 -0
- package/dist/src/server/home-sections/luxe-favourites.js +19 -0
- package/dist/src/server/home-sections/new-arrivals-classic.d.ts +8 -0
- package/dist/src/server/home-sections/new-arrivals-classic.d.ts.map +1 -0
- package/dist/src/server/home-sections/new-arrivals-classic.js +10 -0
- package/dist/src/server/home-sections/new-arrivals.d.ts +12 -0
- package/dist/src/server/home-sections/new-arrivals.d.ts.map +1 -0
- package/dist/src/server/home-sections/new-arrivals.js +28 -0
- package/dist/src/server/home-sections/promo-announcements.d.ts +7 -0
- package/dist/src/server/home-sections/promo-announcements.d.ts.map +1 -0
- package/dist/src/server/home-sections/promo-announcements.js +7 -0
- package/dist/src/server/home-sections/promo-countdown.d.ts +6 -0
- package/dist/src/server/home-sections/promo-countdown.d.ts.map +1 -0
- package/dist/src/server/home-sections/promo-countdown.js +5 -0
- package/dist/src/server/home-sections/shared.d.ts +10 -0
- package/dist/src/server/home-sections/shared.d.ts.map +1 -0
- package/dist/src/server/home-sections/shared.js +29 -0
- package/dist/src/server/home-sections/shop-by-age.d.ts +9 -0
- package/dist/src/server/home-sections/shop-by-age.d.ts.map +1 -0
- package/dist/src/server/home-sections/shop-by-age.js +17 -0
- package/dist/src/server/home-sections/shop-by-category.d.ts +10 -0
- package/dist/src/server/home-sections/shop-by-category.d.ts.map +1 -0
- package/dist/src/server/home-sections/shop-by-category.js +17 -0
- package/dist/src/server/home-sections/testimonials.d.ts +9 -0
- package/dist/src/server/home-sections/testimonials.d.ts.map +1 -0
- package/dist/src/server/home-sections/testimonials.js +9 -0
- package/dist/src/server/home-sections/theme-dresses.d.ts +12 -0
- package/dist/src/server/home-sections/theme-dresses.d.ts.map +1 -0
- package/dist/src/server/home-sections/theme-dresses.js +27 -0
- package/dist/src/server/home-sections/video-stories.d.ts +9 -0
- package/dist/src/server/home-sections/video-stories.d.ts.map +1 -0
- package/dist/src/server/home-sections/video-stories.js +9 -0
- package/dist/src/server/home-sections/why-choose-us.d.ts +9 -0
- package/dist/src/server/home-sections/why-choose-us.d.ts.map +1 -0
- package/dist/src/server/home-sections/why-choose-us.js +9 -0
- package/dist/src/server/home.d.ts +51 -0
- package/dist/src/server/home.d.ts.map +1 -0
- package/dist/src/server/home.js +1 -0
- package/dist/src/server/homepage-config.types.d.ts +294 -0
- package/dist/src/server/homepage-config.types.d.ts.map +1 -0
- package/dist/src/server/homepage-config.types.js +34 -0
- package/dist/src/server/homepage-section-defaults.d.ts +189 -0
- package/dist/src/server/homepage-section-defaults.d.ts.map +1 -0
- package/dist/src/server/homepage-section-defaults.js +190 -0
- package/dist/src/server/index.d.ts +25 -0
- package/dist/src/server/index.d.ts.map +1 -0
- package/dist/src/server/index.js +24 -0
- package/dist/src/server/locale-actions.d.ts +14 -0
- package/dist/src/server/locale-actions.d.ts.map +1 -0
- package/dist/src/server/locale-actions.js +58 -0
- package/dist/src/server/locales.d.ts +8 -0
- package/dist/src/server/locales.d.ts.map +1 -0
- package/dist/src/server/locales.js +12 -0
- package/dist/src/server/normalize-homepage-config.d.ts +7 -0
- package/dist/src/server/normalize-homepage-config.d.ts.map +1 -0
- package/dist/src/server/normalize-homepage-config.js +253 -0
- package/dist/src/server/notifications.d.ts +2 -0
- package/dist/src/server/notifications.d.ts.map +1 -0
- package/dist/src/server/notifications.js +20 -0
- package/dist/src/server/onboarding.d.ts +2 -0
- package/dist/src/server/onboarding.d.ts.map +1 -0
- package/dist/src/server/onboarding.js +8 -0
- package/dist/src/server/orders.d.ts +63 -0
- package/dist/src/server/orders.d.ts.map +1 -0
- package/dist/src/server/orders.js +230 -0
- package/dist/src/server/page-input.d.ts +19 -0
- package/dist/src/server/page-input.d.ts.map +1 -0
- package/dist/src/server/page-input.js +42 -0
- package/dist/src/server/payment-details.d.ts +5 -0
- package/dist/src/server/payment-details.d.ts.map +1 -0
- package/dist/src/server/payment-details.js +28 -0
- package/dist/src/server/payment.d.ts +3 -0
- package/dist/src/server/payment.d.ts.map +1 -0
- package/dist/src/server/payment.js +13 -0
- package/dist/src/server/pincode.d.ts +7 -0
- package/dist/src/server/pincode.d.ts.map +1 -0
- package/dist/src/server/pincode.js +30 -0
- package/dist/src/server/products.d.ts +54 -0
- package/dist/src/server/products.d.ts.map +1 -0
- package/dist/src/server/products.js +154 -0
- package/dist/src/server/regions.d.ts +5 -0
- package/dist/src/server/regions.d.ts.map +1 -0
- package/dist/src/server/regions.js +57 -0
- package/dist/src/server/resolve-home-segment-data.d.ts +25 -0
- package/dist/src/server/resolve-home-segment-data.d.ts.map +1 -0
- package/dist/src/server/resolve-home-segment-data.js +20 -0
- package/dist/src/server/returns.d.ts +29 -0
- package/dist/src/server/returns.d.ts.map +1 -0
- package/dist/src/server/returns.js +132 -0
- package/dist/src/server/shoppable-looks.d.ts +17 -0
- package/dist/src/server/shoppable-looks.d.ts.map +1 -0
- package/dist/src/server/shoppable-looks.js +136 -0
- package/dist/src/server/swaps.d.ts +15 -0
- package/dist/src/server/swaps.d.ts.map +1 -0
- package/dist/src/server/swaps.js +89 -0
- package/dist/src/server/variants.d.ts +3 -0
- package/dist/src/server/variants.d.ts.map +1 -0
- package/dist/src/server/variants.js +15 -0
- package/dist/src/server/wishlist.d.ts +11 -0
- package/dist/src/server/wishlist.d.ts.map +1 -0
- package/dist/src/server/wishlist.js +49 -0
- package/dist/src/util/get-locale-header.d.ts +4 -0
- package/dist/src/util/get-locale-header.d.ts.map +1 -0
- package/dist/src/util/get-locale-header.js +7 -0
- package/dist/src/util/medusa-error.d.ts +2 -0
- package/dist/src/util/medusa-error.d.ts.map +1 -0
- package/dist/src/util/medusa-error.js +18 -0
- package/dist/src/util/revalidate-cart.d.ts +2 -0
- package/dist/src/util/revalidate-cart.d.ts.map +1 -0
- package/dist/src/util/revalidate-cart.js +8 -0
- package/dist/src/util/sort-products.d.ts +3 -0
- package/dist/src/util/sort-products.d.ts.map +1 -0
- package/dist/src/util/sort-products.js +1 -0
- package/dist/src/util/store-client.d.ts +11 -0
- package/dist/src/util/store-client.d.ts.map +1 -0
- package/dist/src/util/store-client.js +75 -0
- package/package.json +115 -155
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { medusaSwapCreate, medusaSwapCreateGuest, medusaSwapList, medusaSwapListGuest, } from "medusa-services/swaps";
|
|
3
|
+
import { cookies } from "next/headers";
|
|
4
|
+
import { revalidateTag } from "next/cache";
|
|
5
|
+
import { getStoreClientOptions, getStoreClientOptionsWithToken } from "../util/store-client";
|
|
6
|
+
/**
|
|
7
|
+
* Create an exchange (swap) request.
|
|
8
|
+
* Supports both authenticated customers and guest users.
|
|
9
|
+
*/
|
|
10
|
+
export const createSwapRequest = async (_prevState, formData) => {
|
|
11
|
+
const orderId = formData.get("order_id");
|
|
12
|
+
const returnItemsJson = formData.get("return_items");
|
|
13
|
+
const newItemsJson = formData.get("new_items");
|
|
14
|
+
const reason = formData.get("reason");
|
|
15
|
+
const note = formData.get("note");
|
|
16
|
+
if (!orderId)
|
|
17
|
+
return { success: false, error: "Order ID is required", swap: null };
|
|
18
|
+
if (!returnItemsJson)
|
|
19
|
+
return { success: false, error: "Items to return are required", swap: null };
|
|
20
|
+
if (!newItemsJson)
|
|
21
|
+
return { success: false, error: "New items are required", swap: null };
|
|
22
|
+
let returnItems = [];
|
|
23
|
+
let newItems = [];
|
|
24
|
+
try {
|
|
25
|
+
returnItems = JSON.parse(returnItemsJson);
|
|
26
|
+
newItems = JSON.parse(newItemsJson);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return { success: false, error: "Invalid items data format", swap: null };
|
|
30
|
+
}
|
|
31
|
+
if (returnItems.length === 0) {
|
|
32
|
+
return { success: false, error: "At least one item must be selected for return", swap: null };
|
|
33
|
+
}
|
|
34
|
+
const options = await getStoreClientOptions();
|
|
35
|
+
try {
|
|
36
|
+
const payload = {
|
|
37
|
+
order_id: orderId,
|
|
38
|
+
return_items: returnItems,
|
|
39
|
+
new_items: newItems,
|
|
40
|
+
reason: reason || "Size exchange",
|
|
41
|
+
note: note || "Exchange requested from storefront",
|
|
42
|
+
};
|
|
43
|
+
const cookieStore = await cookies();
|
|
44
|
+
const guestToken = cookieStore.get("_medusa_guest_jwt")?.value ||
|
|
45
|
+
cookieStore.get("_medusa_guest_token")?.value;
|
|
46
|
+
const token = cookieStore.get("_medusa_jwt")?.value;
|
|
47
|
+
let swapData;
|
|
48
|
+
if (guestToken && !token) {
|
|
49
|
+
const guestOptions = await getStoreClientOptionsWithToken(guestToken);
|
|
50
|
+
swapData = await medusaSwapCreateGuest(orderId, {
|
|
51
|
+
return_items: payload.return_items,
|
|
52
|
+
new_items: payload.new_items,
|
|
53
|
+
reason: payload.reason,
|
|
54
|
+
note: payload.note,
|
|
55
|
+
}, guestOptions);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
swapData = await medusaSwapCreate(payload, options);
|
|
59
|
+
}
|
|
60
|
+
revalidateTag("orders");
|
|
61
|
+
return { success: true, error: null, swap: swapData };
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
let errorMsg = "Failed to create exchange request";
|
|
65
|
+
if (error instanceof Error && error.message) {
|
|
66
|
+
errorMsg = error.message;
|
|
67
|
+
}
|
|
68
|
+
return { success: false, error: errorMsg, swap: null };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* List swaps for an order or customer
|
|
73
|
+
*/
|
|
74
|
+
export const listSwaps = async (orderId) => {
|
|
75
|
+
const options = await getStoreClientOptions();
|
|
76
|
+
if (options.authorization) {
|
|
77
|
+
return medusaSwapList(options, orderId ? { order_id: orderId } : undefined);
|
|
78
|
+
}
|
|
79
|
+
if (orderId) {
|
|
80
|
+
const cookieStore = await cookies();
|
|
81
|
+
const guestToken = cookieStore.get("_medusa_guest_jwt")?.value ||
|
|
82
|
+
cookieStore.get("_medusa_guest_token")?.value;
|
|
83
|
+
if (guestToken) {
|
|
84
|
+
const guestOptions = await getStoreClientOptionsWithToken(guestToken);
|
|
85
|
+
return medusaSwapListGuest(orderId, guestOptions);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return { swaps: [], count: 0 };
|
|
89
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../src/server/variants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAI3C,eAAO,MAAM,eAAe,GAC1B,YAAY,MAAM,KACjB,OAAO,CAAC,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAU9C,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { medusaVariantRetrieve } from "medusa-services/variants";
|
|
3
|
+
import { getStoreClientOptions } from "../util/store-client";
|
|
4
|
+
export const retrieveVariant = async (variant_id) => {
|
|
5
|
+
try {
|
|
6
|
+
const options = await getStoreClientOptions();
|
|
7
|
+
if (!options.authorization)
|
|
8
|
+
return null;
|
|
9
|
+
const { variant } = await medusaVariantRetrieve(variant_id, options, { fields: "*images" });
|
|
10
|
+
return variant;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Wishlist entries enriched with full Medusa product payloads. */
|
|
2
|
+
export declare function getWishlist(includeDetails?: boolean, countryCode?: string): Promise<{
|
|
3
|
+
success: false;
|
|
4
|
+
error: string;
|
|
5
|
+
data: unknown[];
|
|
6
|
+
} | {
|
|
7
|
+
success: true;
|
|
8
|
+
data: Record<string, unknown>[];
|
|
9
|
+
error?: undefined;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=wishlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wishlist.d.ts","sourceRoot":"","sources":["../../../src/server/wishlist.ts"],"names":[],"mappings":"AAOA,mEAAmE;AACnE,wBAAsB,WAAW,CAAC,cAAc,UAAO,EAAE,WAAW,CAAC,EAAE,MAAM;;;UAGF,OAAO,EAAE;;;;;GAoDnF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { sdk } from "../config";
|
|
3
|
+
import { getRegion } from "./regions";
|
|
4
|
+
import { fetchWishlist } from "medusa-wishlist-logic/server";
|
|
5
|
+
/** Wishlist entries enriched with full Medusa product payloads. */
|
|
6
|
+
export async function getWishlist(includeDetails = true, countryCode) {
|
|
7
|
+
const result = await fetchWishlist(includeDetails);
|
|
8
|
+
if (!result.success) {
|
|
9
|
+
return { success: false, error: result.error, data: [] };
|
|
10
|
+
}
|
|
11
|
+
let wishlistItems = result.data;
|
|
12
|
+
if (!includeDetails || wishlistItems.length === 0) {
|
|
13
|
+
return { success: true, data: wishlistItems };
|
|
14
|
+
}
|
|
15
|
+
const productIds = wishlistItems
|
|
16
|
+
.map((item) => {
|
|
17
|
+
const id = item.product_id ?? item.id;
|
|
18
|
+
return typeof id === "string" ? id : null;
|
|
19
|
+
})
|
|
20
|
+
.filter((id) => Boolean(id));
|
|
21
|
+
if (productIds.length === 0) {
|
|
22
|
+
return { success: true, data: wishlistItems };
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
let regionId;
|
|
26
|
+
if (countryCode) {
|
|
27
|
+
const region = await getRegion(countryCode);
|
|
28
|
+
regionId = region?.id;
|
|
29
|
+
}
|
|
30
|
+
const productsResponse = await sdk.store.product.list({
|
|
31
|
+
id: productIds,
|
|
32
|
+
fields: "*thumbnail,*images,*variants,*variants.options,*options,*options.values,*variants.calculated_price,*variants.inventory_quantity,*variants.manage_inventory,*variants.allow_backorder",
|
|
33
|
+
...(regionId ? { region_id: regionId } : {}),
|
|
34
|
+
}, {});
|
|
35
|
+
const fullProducts = productsResponse.products;
|
|
36
|
+
wishlistItems = wishlistItems.map((item) => {
|
|
37
|
+
const itemId = (item.product_id ?? item.id);
|
|
38
|
+
const fullProduct = fullProducts.find((p) => p.id === itemId);
|
|
39
|
+
if (fullProduct) {
|
|
40
|
+
return { ...item, product: fullProduct };
|
|
41
|
+
}
|
|
42
|
+
return item;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
// Return API wishlist without enrichment
|
|
47
|
+
}
|
|
48
|
+
return { success: true, data: wishlistItems };
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-locale-header.d.ts","sourceRoot":"","sources":["../../../src/util/get-locale-header.ts"],"names":[],"mappings":"AAEA,wBAAsB,eAAe;;GAKpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"medusa-error.d.ts","sourceRoot":"","sources":["../../../src/util/medusa-error.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,CAkBrD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default function medusaError(error) {
|
|
2
|
+
if (error.response) {
|
|
3
|
+
// The request was made and the server responded with a status code
|
|
4
|
+
// that falls out of the range of 2xx
|
|
5
|
+
const u = new URL(error.config.url, error.config.baseURL);
|
|
6
|
+
// Extracting the error message from the response data
|
|
7
|
+
const message = error.response.data.message || error.response.data;
|
|
8
|
+
throw new Error(message.charAt(0).toUpperCase() + message.slice(1) + ".");
|
|
9
|
+
}
|
|
10
|
+
else if (error.request) {
|
|
11
|
+
// The request was made but no response was received
|
|
12
|
+
throw new Error("No response received: " + error.request);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
// Something happened in setting up the request that triggered an Error
|
|
16
|
+
throw new Error("Error setting up the request: " + error.message);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revalidate-cart.d.ts","sourceRoot":"","sources":["../../../src/util/revalidate-cart.ts"],"names":[],"mappings":"AAGA,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAMxD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { revalidateTag } from "next/cache";
|
|
2
|
+
import { getCacheTag } from "../cookies";
|
|
3
|
+
export async function revalidateCartTags() {
|
|
4
|
+
const cartCacheTag = await getCacheTag("carts");
|
|
5
|
+
revalidateTag(cartCacheTag);
|
|
6
|
+
const fulfillmentCacheTag = await getCacheTag("fulfillment");
|
|
7
|
+
revalidateTag(fulfillmentCacheTag);
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-products.d.ts","sourceRoot":"","sources":["../../../src/util/sort-products.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { sortProducts } from "medusa-services/product-listing";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MedusaStoreClientOptions } from "medusa-services/store-api";
|
|
2
|
+
import { type MedusaAuthClientOptions } from "medusa-services/auth";
|
|
3
|
+
/**
|
|
4
|
+
* Builds portable Medusa store client options from Next.js cookies and env.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getStoreClientOptions(): Promise<MedusaStoreClientOptions>;
|
|
7
|
+
export declare function getMedusaBackendUrl(): string;
|
|
8
|
+
export declare function getGuestStoreClientOptions(): Promise<MedusaStoreClientOptions | null>;
|
|
9
|
+
export declare function getStoreClientOptionsWithToken(token: string): Promise<MedusaStoreClientOptions>;
|
|
10
|
+
export declare function getAuthClientOptions(authorization?: string): Promise<MedusaAuthClientOptions>;
|
|
11
|
+
//# sourceMappingURL=store-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-client.d.ts","sourceRoot":"","sources":["../../../src/util/store-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,EAAuB,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAqBxF;;GAEG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAY/E;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAuB3F;AAED,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,wBAAwB,CAAC,CAMnC;AAED,wBAAsB,oBAAoB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAWnG"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { getStoreAuthOptions } from "medusa-services/auth";
|
|
2
|
+
import { getAuthHeaders, getGuestAuthHeaders } from "../cookies";
|
|
3
|
+
import { getLocaleHeader } from "./get-locale-header";
|
|
4
|
+
import { cookies as nextCookies } from "next/headers";
|
|
5
|
+
function getBackendUrl() {
|
|
6
|
+
return (process.env.MEDUSA_BACKEND_URL?.replace(/\/$/, "") ||
|
|
7
|
+
process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL?.replace(/\/$/, "") ||
|
|
8
|
+
"http://localhost:9000");
|
|
9
|
+
}
|
|
10
|
+
function getPublishableApiKey() {
|
|
11
|
+
const key = process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY;
|
|
12
|
+
if (!key) {
|
|
13
|
+
throw new Error("NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY is not configured");
|
|
14
|
+
}
|
|
15
|
+
return key;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Builds portable Medusa store client options from Next.js cookies and env.
|
|
19
|
+
*/
|
|
20
|
+
export async function getStoreClientOptions() {
|
|
21
|
+
const auth = await getAuthHeaders();
|
|
22
|
+
const localeHeader = await getLocaleHeader().catch(() => ({}));
|
|
23
|
+
return {
|
|
24
|
+
backendUrl: getBackendUrl(),
|
|
25
|
+
publishableApiKey: getPublishableApiKey(),
|
|
26
|
+
authorization: "authorization" in auth ? auth.authorization : undefined,
|
|
27
|
+
headers: localeHeader["x-medusa-locale"]
|
|
28
|
+
? { "x-medusa-locale": localeHeader["x-medusa-locale"] }
|
|
29
|
+
: undefined,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function getMedusaBackendUrl() {
|
|
33
|
+
return getBackendUrl();
|
|
34
|
+
}
|
|
35
|
+
export async function getGuestStoreClientOptions() {
|
|
36
|
+
const guestAuth = await getGuestAuthHeaders();
|
|
37
|
+
let authorization = "authorization" in guestAuth ? guestAuth.authorization : undefined;
|
|
38
|
+
if (!authorization) {
|
|
39
|
+
try {
|
|
40
|
+
const cookieStore = await nextCookies();
|
|
41
|
+
const legacyToken = cookieStore.get("_medusa_guest_token")?.value;
|
|
42
|
+
if (legacyToken) {
|
|
43
|
+
authorization = `Bearer ${legacyToken}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (!authorization)
|
|
51
|
+
return null;
|
|
52
|
+
return {
|
|
53
|
+
backendUrl: getBackendUrl(),
|
|
54
|
+
publishableApiKey: getPublishableApiKey(),
|
|
55
|
+
authorization,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export async function getStoreClientOptionsWithToken(token) {
|
|
59
|
+
return {
|
|
60
|
+
backendUrl: getBackendUrl(),
|
|
61
|
+
publishableApiKey: getPublishableApiKey(),
|
|
62
|
+
authorization: token.startsWith("Bearer ") ? token : `Bearer ${token}`,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export async function getAuthClientOptions(authorization) {
|
|
66
|
+
if (authorization) {
|
|
67
|
+
return getStoreAuthOptions({
|
|
68
|
+
backendUrl: getBackendUrl(),
|
|
69
|
+
publishableApiKey: getPublishableApiKey(),
|
|
70
|
+
authorization,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const storeOptions = await getStoreClientOptions();
|
|
74
|
+
return getStoreAuthOptions(storeOptions);
|
|
75
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "medusa-storefront-data",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Medusa storefront server data layer extracted from Next.js storefront",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,165 +53,125 @@
|
|
|
53
53
|
"import": "./src/server/index.ts",
|
|
54
54
|
"default": "./src/server/index.ts"
|
|
55
55
|
},
|
|
56
|
-
"./
|
|
57
|
-
"types": "./dist/
|
|
58
|
-
"import": "./src/
|
|
59
|
-
"default": "./src/
|
|
60
|
-
},
|
|
61
|
-
"./
|
|
62
|
-
"types": "./dist/
|
|
63
|
-
"import": "./src/
|
|
64
|
-
"default": "./src/
|
|
65
|
-
},
|
|
66
|
-
"./
|
|
67
|
-
"types": "./dist/
|
|
68
|
-
"import": "./src/
|
|
69
|
-
"default": "./src/
|
|
70
|
-
},
|
|
71
|
-
"./
|
|
72
|
-
"types": "./dist/
|
|
73
|
-
"import": "./src/
|
|
74
|
-
"default": "./src/
|
|
75
|
-
},
|
|
76
|
-
"./
|
|
77
|
-
"types": "./dist/
|
|
78
|
-
"import": "./src/
|
|
79
|
-
"default": "./src/
|
|
80
|
-
},
|
|
81
|
-
"./
|
|
82
|
-
"types": "./dist/
|
|
83
|
-
"import": "./src/
|
|
84
|
-
"default": "./src/
|
|
85
|
-
},
|
|
86
|
-
"./
|
|
87
|
-
"types": "./dist/
|
|
88
|
-
"import": "./src/
|
|
89
|
-
"default": "./src/
|
|
90
|
-
},
|
|
91
|
-
"./
|
|
92
|
-
"types": "./dist/server/
|
|
93
|
-
"import": "./src/server/
|
|
94
|
-
"default": "./src/server/
|
|
95
|
-
},
|
|
96
|
-
"./
|
|
97
|
-
"types": "./dist/server/
|
|
98
|
-
"import": "./src/server/
|
|
99
|
-
"default": "./src/server/
|
|
100
|
-
},
|
|
101
|
-
"./
|
|
102
|
-
"types": "./dist/server/
|
|
103
|
-
"import": "./src/server/
|
|
104
|
-
"default": "./src/server/
|
|
105
|
-
},
|
|
106
|
-
"./
|
|
107
|
-
"types": "./dist/server/
|
|
108
|
-
"import": "./src/server/
|
|
109
|
-
"default": "./src/server/
|
|
110
|
-
},
|
|
111
|
-
"./
|
|
112
|
-
"types": "./dist/server/
|
|
113
|
-
"import": "./src/server/
|
|
114
|
-
"default": "./src/server/
|
|
115
|
-
},
|
|
116
|
-
"./
|
|
117
|
-
"types": "./dist/server/
|
|
118
|
-
"import": "./src/server/
|
|
119
|
-
"default": "./src/server/
|
|
120
|
-
},
|
|
121
|
-
"./
|
|
122
|
-
"types": "./dist/server/
|
|
123
|
-
"import": "./src/server/
|
|
124
|
-
"default": "./src/server/
|
|
56
|
+
"./home/sections/promoAnnouncements": {
|
|
57
|
+
"types": "./dist/server/home-sections/promo-announcements.d.ts",
|
|
58
|
+
"import": "./src/server/home-sections/promo-announcements.ts",
|
|
59
|
+
"default": "./src/server/home-sections/promo-announcements.ts"
|
|
60
|
+
},
|
|
61
|
+
"./home/sections/hero": {
|
|
62
|
+
"types": "./dist/server/home-sections/hero.d.ts",
|
|
63
|
+
"import": "./src/server/home-sections/hero.ts",
|
|
64
|
+
"default": "./src/server/home-sections/hero.ts"
|
|
65
|
+
},
|
|
66
|
+
"./home/sections/categoryPills": {
|
|
67
|
+
"types": "./dist/server/home-sections/category-pills.d.ts",
|
|
68
|
+
"import": "./src/server/home-sections/category-pills.ts",
|
|
69
|
+
"default": "./src/server/home-sections/category-pills.ts"
|
|
70
|
+
},
|
|
71
|
+
"./home/sections/newArrivals": {
|
|
72
|
+
"types": "./dist/server/home-sections/new-arrivals.d.ts",
|
|
73
|
+
"import": "./src/server/home-sections/new-arrivals.ts",
|
|
74
|
+
"default": "./src/server/home-sections/new-arrivals.ts"
|
|
75
|
+
},
|
|
76
|
+
"./home/sections/newArrivalsClassic": {
|
|
77
|
+
"types": "./dist/server/home-sections/new-arrivals-classic.d.ts",
|
|
78
|
+
"import": "./src/server/home-sections/new-arrivals-classic.ts",
|
|
79
|
+
"default": "./src/server/home-sections/new-arrivals-classic.ts"
|
|
80
|
+
},
|
|
81
|
+
"./home/sections/promoCountdown": {
|
|
82
|
+
"types": "./dist/server/home-sections/promo-countdown.d.ts",
|
|
83
|
+
"import": "./src/server/home-sections/promo-countdown.ts",
|
|
84
|
+
"default": "./src/server/home-sections/promo-countdown.ts"
|
|
85
|
+
},
|
|
86
|
+
"./home/sections/celebrityTrust": {
|
|
87
|
+
"types": "./dist/server/home-sections/celebrity-trust.d.ts",
|
|
88
|
+
"import": "./src/server/home-sections/celebrity-trust.ts",
|
|
89
|
+
"default": "./src/server/home-sections/celebrity-trust.ts"
|
|
90
|
+
},
|
|
91
|
+
"./home/sections/luxeFavourites": {
|
|
92
|
+
"types": "./dist/server/home-sections/luxe-favourites.d.ts",
|
|
93
|
+
"import": "./src/server/home-sections/luxe-favourites.ts",
|
|
94
|
+
"default": "./src/server/home-sections/luxe-favourites.ts"
|
|
95
|
+
},
|
|
96
|
+
"./home/sections/shopByCategory": {
|
|
97
|
+
"types": "./dist/server/home-sections/shop-by-category.d.ts",
|
|
98
|
+
"import": "./src/server/home-sections/shop-by-category.ts",
|
|
99
|
+
"default": "./src/server/home-sections/shop-by-category.ts"
|
|
100
|
+
},
|
|
101
|
+
"./home/sections/baptism": {
|
|
102
|
+
"types": "./dist/server/home-sections/baptism.d.ts",
|
|
103
|
+
"import": "./src/server/home-sections/baptism.ts",
|
|
104
|
+
"default": "./src/server/home-sections/baptism.ts"
|
|
105
|
+
},
|
|
106
|
+
"./home/sections/baptismPicks": {
|
|
107
|
+
"types": "./dist/server/home-sections/baptism-picks.d.ts",
|
|
108
|
+
"import": "./src/server/home-sections/baptism-picks.ts",
|
|
109
|
+
"default": "./src/server/home-sections/baptism-picks.ts"
|
|
110
|
+
},
|
|
111
|
+
"./home/sections/themeDresses": {
|
|
112
|
+
"types": "./dist/server/home-sections/theme-dresses.d.ts",
|
|
113
|
+
"import": "./src/server/home-sections/theme-dresses.ts",
|
|
114
|
+
"default": "./src/server/home-sections/theme-dresses.ts"
|
|
115
|
+
},
|
|
116
|
+
"./home/sections/brandMarquee": {
|
|
117
|
+
"types": "./dist/server/home-sections/brand-marquee.d.ts",
|
|
118
|
+
"import": "./src/server/home-sections/brand-marquee.ts",
|
|
119
|
+
"default": "./src/server/home-sections/brand-marquee.ts"
|
|
120
|
+
},
|
|
121
|
+
"./home/sections/aboutBrand": {
|
|
122
|
+
"types": "./dist/server/home-sections/about-brand.d.ts",
|
|
123
|
+
"import": "./src/server/home-sections/about-brand.ts",
|
|
124
|
+
"default": "./src/server/home-sections/about-brand.ts"
|
|
125
|
+
},
|
|
126
|
+
"./home/sections/testimonials": {
|
|
127
|
+
"types": "./dist/server/home-sections/testimonials.d.ts",
|
|
128
|
+
"import": "./src/server/home-sections/testimonials.ts",
|
|
129
|
+
"default": "./src/server/home-sections/testimonials.ts"
|
|
130
|
+
},
|
|
131
|
+
"./home/sections/brandPillars": {
|
|
132
|
+
"types": "./dist/server/home-sections/brand-pillars.d.ts",
|
|
133
|
+
"import": "./src/server/home-sections/brand-pillars.ts",
|
|
134
|
+
"default": "./src/server/home-sections/brand-pillars.ts"
|
|
135
|
+
},
|
|
136
|
+
"./home/sections/instagramPosts": {
|
|
137
|
+
"types": "./dist/server/home-sections/instagram-posts.d.ts",
|
|
138
|
+
"import": "./src/server/home-sections/instagram-posts.ts",
|
|
139
|
+
"default": "./src/server/home-sections/instagram-posts.ts"
|
|
140
|
+
},
|
|
141
|
+
"./home/sections/features": {
|
|
142
|
+
"types": "./dist/server/home-sections/features.d.ts",
|
|
143
|
+
"import": "./src/server/home-sections/features.ts",
|
|
144
|
+
"default": "./src/server/home-sections/features.ts"
|
|
145
|
+
},
|
|
146
|
+
"./home/sections/shopByAge": {
|
|
147
|
+
"types": "./dist/server/home-sections/shop-by-age.d.ts",
|
|
148
|
+
"import": "./src/server/home-sections/shop-by-age.ts",
|
|
149
|
+
"default": "./src/server/home-sections/shop-by-age.ts"
|
|
150
|
+
},
|
|
151
|
+
"./home/sections/whyChooseUs": {
|
|
152
|
+
"types": "./dist/server/home-sections/why-choose-us.d.ts",
|
|
153
|
+
"import": "./src/server/home-sections/why-choose-us.ts",
|
|
154
|
+
"default": "./src/server/home-sections/why-choose-us.ts"
|
|
155
|
+
},
|
|
156
|
+
"./home/sections/lovedByMoms": {
|
|
157
|
+
"types": "./dist/server/home-sections/loved-by-moms.d.ts",
|
|
158
|
+
"import": "./src/server/home-sections/loved-by-moms.ts",
|
|
159
|
+
"default": "./src/server/home-sections/loved-by-moms.ts"
|
|
160
|
+
},
|
|
161
|
+
"./home/sections/videoStories": {
|
|
162
|
+
"types": "./dist/server/home-sections/video-stories.d.ts",
|
|
163
|
+
"import": "./src/server/home-sections/video-stories.ts",
|
|
164
|
+
"default": "./src/server/home-sections/video-stories.ts"
|
|
165
|
+
},
|
|
166
|
+
"./home/sections/blogPosts": {
|
|
167
|
+
"types": "./dist/server/home-sections/blog-posts.d.ts",
|
|
168
|
+
"import": "./src/server/home-sections/blog-posts.ts",
|
|
169
|
+
"default": "./src/server/home-sections/blog-posts.ts"
|
|
125
170
|
},
|
|
126
171
|
"./help/sections/helpFaq": {
|
|
127
172
|
"types": "./dist/server/help-sections/help-faq.d.ts",
|
|
128
173
|
"import": "./src/server/help-sections/help-faq.ts",
|
|
129
174
|
"default": "./src/server/help-sections/help-faq.ts"
|
|
130
|
-
},
|
|
131
|
-
"./fulfillment": {
|
|
132
|
-
"types": "./dist/server/fulfillment.d.ts",
|
|
133
|
-
"import": "./src/server/fulfillment.ts",
|
|
134
|
-
"default": "./src/server/fulfillment.ts"
|
|
135
|
-
},
|
|
136
|
-
"./guest": {
|
|
137
|
-
"types": "./dist/server/guest.d.ts",
|
|
138
|
-
"import": "./src/server/guest.ts",
|
|
139
|
-
"default": "./src/server/guest.ts"
|
|
140
|
-
},
|
|
141
|
-
"./home": {
|
|
142
|
-
"types": "./dist/server/home.d.ts",
|
|
143
|
-
"import": "./src/server/home.ts",
|
|
144
|
-
"default": "./src/server/home.ts"
|
|
145
|
-
},
|
|
146
|
-
"./locale-actions": {
|
|
147
|
-
"types": "./dist/server/locale-actions.d.ts",
|
|
148
|
-
"import": "./src/server/locale-actions.ts",
|
|
149
|
-
"default": "./src/server/locale-actions.ts"
|
|
150
|
-
},
|
|
151
|
-
"./locales": {
|
|
152
|
-
"types": "./dist/server/locales.d.ts",
|
|
153
|
-
"import": "./src/server/locales.ts",
|
|
154
|
-
"default": "./src/server/locales.ts"
|
|
155
|
-
},
|
|
156
|
-
"./notifications": {
|
|
157
|
-
"types": "./dist/server/notifications.d.ts",
|
|
158
|
-
"import": "./src/server/notifications.ts",
|
|
159
|
-
"default": "./src/server/notifications.ts"
|
|
160
|
-
},
|
|
161
|
-
"./onboarding": {
|
|
162
|
-
"types": "./dist/server/onboarding.d.ts",
|
|
163
|
-
"import": "./src/server/onboarding.ts",
|
|
164
|
-
"default": "./src/server/onboarding.ts"
|
|
165
|
-
},
|
|
166
|
-
"./orders": {
|
|
167
|
-
"types": "./dist/server/orders.d.ts",
|
|
168
|
-
"import": "./src/server/orders.ts",
|
|
169
|
-
"default": "./src/server/orders.ts"
|
|
170
|
-
},
|
|
171
|
-
"./payment": {
|
|
172
|
-
"types": "./dist/server/payment.d.ts",
|
|
173
|
-
"import": "./src/server/payment.ts",
|
|
174
|
-
"default": "./src/server/payment.ts"
|
|
175
|
-
},
|
|
176
|
-
"./payment-details": {
|
|
177
|
-
"types": "./dist/server/payment-details.d.ts",
|
|
178
|
-
"import": "./src/server/payment-details.ts",
|
|
179
|
-
"default": "./src/server/payment-details.ts"
|
|
180
|
-
},
|
|
181
|
-
"./pincode": {
|
|
182
|
-
"types": "./dist/server/pincode.d.ts",
|
|
183
|
-
"import": "./src/server/pincode.ts",
|
|
184
|
-
"default": "./src/server/pincode.ts"
|
|
185
|
-
},
|
|
186
|
-
"./products": {
|
|
187
|
-
"types": "./dist/server/products.d.ts",
|
|
188
|
-
"import": "./src/server/products.ts",
|
|
189
|
-
"default": "./src/server/products.ts"
|
|
190
|
-
},
|
|
191
|
-
"./regions": {
|
|
192
|
-
"types": "./dist/server/regions.d.ts",
|
|
193
|
-
"import": "./src/server/regions.ts",
|
|
194
|
-
"default": "./src/server/regions.ts"
|
|
195
|
-
},
|
|
196
|
-
"./returns": {
|
|
197
|
-
"types": "./dist/server/returns.d.ts",
|
|
198
|
-
"import": "./src/server/returns.ts",
|
|
199
|
-
"default": "./src/server/returns.ts"
|
|
200
|
-
},
|
|
201
|
-
"./swaps": {
|
|
202
|
-
"types": "./dist/server/swaps.d.ts",
|
|
203
|
-
"import": "./src/server/swaps.ts",
|
|
204
|
-
"default": "./src/server/swaps.ts"
|
|
205
|
-
},
|
|
206
|
-
"./variants": {
|
|
207
|
-
"types": "./dist/server/variants.d.ts",
|
|
208
|
-
"import": "./src/server/variants.ts",
|
|
209
|
-
"default": "./src/server/variants.ts"
|
|
210
|
-
},
|
|
211
|
-
"./wishlist": {
|
|
212
|
-
"types": "./dist/server/wishlist.d.ts",
|
|
213
|
-
"import": "./src/server/wishlist.ts",
|
|
214
|
-
"default": "./src/server/wishlist.ts"
|
|
215
175
|
}
|
|
216
176
|
},
|
|
217
177
|
"main": "./dist/server/index.js",
|