@proxima-io/storefront-core 0.3.0 → 0.8.2
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/README.md +68 -17
- package/dist/addresses/address-book.d.ts +36 -0
- package/dist/addresses/address-book.d.ts.map +1 -0
- package/dist/addresses/address-book.js +62 -0
- package/dist/addresses/address-book.js.map +1 -0
- package/dist/analytics/analytics.d.ts +28 -0
- package/dist/analytics/analytics.d.ts.map +1 -0
- package/dist/analytics/analytics.js +124 -0
- package/dist/analytics/analytics.js.map +1 -0
- package/dist/analytics/attribution.d.ts +28 -0
- package/dist/analytics/attribution.d.ts.map +1 -0
- package/dist/analytics/attribution.js +116 -0
- package/dist/analytics/attribution.js.map +1 -0
- package/dist/analytics/session.d.ts +12 -0
- package/dist/analytics/session.d.ts.map +1 -0
- package/dist/analytics/session.js +62 -0
- package/dist/analytics/session.js.map +1 -0
- package/dist/analytics/trackers.d.ts +29 -0
- package/dist/analytics/trackers.d.ts.map +1 -0
- package/dist/analytics/trackers.js +30 -0
- package/dist/analytics/trackers.js.map +1 -0
- package/dist/api/endpoints.d.ts +70 -0
- package/dist/api/endpoints.d.ts.map +1 -0
- package/dist/api/endpoints.js +70 -0
- package/dist/api/endpoints.js.map +1 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +3 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/storefront-client.d.ts +50 -0
- package/dist/api/storefront-client.d.ts.map +1 -0
- package/dist/api/storefront-client.js +123 -0
- package/dist/api/storefront-client.js.map +1 -0
- package/dist/buyer/auth.d.ts +105 -0
- package/dist/buyer/auth.d.ts.map +1 -0
- package/dist/buyer/auth.js +215 -0
- package/dist/buyer/auth.js.map +1 -0
- package/dist/cache/cache.d.ts +31 -0
- package/dist/cache/cache.d.ts.map +1 -0
- package/dist/cache/cache.js +71 -0
- package/dist/cache/cache.js.map +1 -0
- package/dist/campaign/countdown.d.ts +40 -0
- package/dist/campaign/countdown.d.ts.map +1 -0
- package/dist/campaign/countdown.js +71 -0
- package/dist/campaign/countdown.js.map +1 -0
- package/dist/cart/cart.d.ts +57 -0
- package/dist/cart/cart.d.ts.map +1 -0
- package/dist/cart/cart.js +64 -0
- package/dist/cart/cart.js.map +1 -0
- package/dist/catalog/listings.d.ts +87 -0
- package/dist/catalog/listings.d.ts.map +1 -0
- package/dist/catalog/listings.js +140 -0
- package/dist/catalog/listings.js.map +1 -0
- package/dist/cms/payment-methods.d.ts +13 -0
- package/dist/cms/payment-methods.d.ts.map +1 -0
- package/dist/cms/payment-methods.js +41 -0
- package/dist/cms/payment-methods.js.map +1 -0
- package/dist/cms/website.d.ts +76 -0
- package/dist/cms/website.d.ts.map +1 -0
- package/dist/cms/website.js +146 -0
- package/dist/cms/website.js.map +1 -0
- package/dist/cookie-consent/consent.d.ts +22 -0
- package/dist/cookie-consent/consent.d.ts.map +1 -0
- package/dist/cookie-consent/consent.js +93 -0
- package/dist/cookie-consent/consent.js.map +1 -0
- package/dist/index.d.ts +45 -1310
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -1576
- package/dist/index.js.map +1 -1
- package/dist/internal/http.d.ts +5 -0
- package/dist/internal/http.d.ts.map +1 -0
- package/dist/internal/http.js +27 -0
- package/dist/internal/http.js.map +1 -0
- package/dist/orders/guest.d.ts +9 -0
- package/dist/orders/guest.d.ts.map +1 -0
- package/dist/orders/guest.js +30 -0
- package/dist/orders/guest.js.map +1 -0
- package/dist/orders/orders.d.ts +23 -0
- package/dist/orders/orders.d.ts.map +1 -0
- package/dist/orders/orders.js +33 -0
- package/dist/orders/orders.js.map +1 -0
- package/dist/seo/engine-url.d.ts +26 -0
- package/dist/seo/engine-url.d.ts.map +1 -0
- package/dist/seo/engine-url.js +111 -0
- package/dist/seo/engine-url.js.map +1 -0
- package/dist/seo/hreflang.d.ts +19 -0
- package/dist/seo/hreflang.d.ts.map +1 -0
- package/dist/seo/hreflang.js +52 -0
- package/dist/seo/hreflang.js.map +1 -0
- package/dist/seo/indexnow.d.ts +24 -0
- package/dist/seo/indexnow.d.ts.map +1 -0
- package/dist/seo/indexnow.js +50 -0
- package/dist/seo/indexnow.js.map +1 -0
- package/dist/seo/json-ld.d.ts +57 -0
- package/dist/seo/json-ld.d.ts.map +1 -0
- package/dist/seo/json-ld.js +180 -0
- package/dist/seo/json-ld.js.map +1 -0
- package/dist/seo/page-seo.d.ts +21 -0
- package/dist/seo/page-seo.d.ts.map +1 -0
- package/dist/seo/page-seo.js +68 -0
- package/dist/seo/page-seo.js.map +1 -0
- package/dist/seo/robots.d.ts +23 -0
- package/dist/seo/robots.d.ts.map +1 -0
- package/dist/seo/robots.js +35 -0
- package/dist/seo/robots.js.map +1 -0
- package/dist/seo/sitemap.d.ts +35 -0
- package/dist/seo/sitemap.d.ts.map +1 -0
- package/dist/seo/sitemap.js +186 -0
- package/dist/seo/sitemap.js.map +1 -0
- package/dist/server/process.d.ts +136 -0
- package/dist/server/process.d.ts.map +1 -0
- package/dist/server/process.js +143 -0
- package/dist/server/process.js.map +1 -0
- package/dist/types/address.d.ts +40 -0
- package/dist/types/address.d.ts.map +1 -0
- package/dist/types/address.js +2 -0
- package/dist/types/address.js.map +1 -0
- package/dist/types/analytics.d.ts +79 -0
- package/dist/types/analytics.d.ts.map +1 -0
- package/dist/types/analytics.js +2 -0
- package/dist/types/analytics.js.map +1 -0
- package/dist/types/business.d.ts +95 -0
- package/dist/types/business.d.ts.map +1 -0
- package/dist/types/business.js +2 -0
- package/dist/types/business.js.map +1 -0
- package/dist/types/buyer.d.ts +144 -0
- package/dist/types/buyer.d.ts.map +1 -0
- package/dist/types/buyer.js +45 -0
- package/dist/types/buyer.js.map +1 -0
- package/dist/types/campaign.d.ts +51 -0
- package/dist/types/campaign.d.ts.map +1 -0
- package/dist/types/campaign.js +2 -0
- package/dist/types/campaign.js.map +1 -0
- package/dist/types/cart.d.ts +40 -0
- package/dist/types/cart.d.ts.map +1 -0
- package/dist/types/cart.js +2 -0
- package/dist/types/cart.js.map +1 -0
- package/dist/types/catalog.d.ts +164 -0
- package/dist/types/catalog.d.ts.map +1 -0
- package/dist/types/catalog.js +2 -0
- package/dist/types/catalog.js.map +1 -0
- package/dist/types/cms.d.ts +200 -0
- package/dist/types/cms.d.ts.map +1 -0
- package/dist/types/cms.js +2 -0
- package/dist/types/cms.js.map +1 -0
- package/dist/types/cookie-consent.d.ts +18 -0
- package/dist/types/cookie-consent.d.ts.map +1 -0
- package/dist/types/cookie-consent.js +7 -0
- package/dist/types/cookie-consent.js.map +1 -0
- package/dist/types/guest-order.d.ts +16 -0
- package/dist/types/guest-order.d.ts.map +1 -0
- package/dist/types/guest-order.js +9 -0
- package/dist/types/guest-order.js.map +1 -0
- package/dist/types/listing.d.ts +14 -0
- package/dist/types/listing.d.ts.map +1 -0
- package/dist/types/listing.js +2 -0
- package/dist/types/listing.js.map +1 -0
- package/dist/types/order.d.ts +40 -0
- package/dist/types/order.d.ts.map +1 -0
- package/dist/types/order.js +2 -0
- package/dist/types/order.js.map +1 -0
- package/dist/types/seo.d.ts +96 -0
- package/dist/types/seo.d.ts.map +1 -0
- package/dist/types/seo.js +2 -0
- package/dist/types/seo.js.map +1 -0
- package/dist/types/server-env.d.ts +19 -0
- package/dist/types/server-env.d.ts.map +1 -0
- package/dist/types/server-env.js +10 -0
- package/dist/types/server-env.js.map +1 -0
- package/dist/types/wishlist.d.ts +10 -0
- package/dist/types/wishlist.d.ts.map +1 -0
- package/dist/types/wishlist.js +2 -0
- package/dist/types/wishlist.js.map +1 -0
- package/dist/wishlist/wishlist.d.ts +28 -0
- package/dist/wishlist/wishlist.d.ts.map +1 -0
- package/dist/wishlist/wishlist.js +42 -0
- package/dist/wishlist/wishlist.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ProximaApiConfig, ProximaWebsiteResponse } from '../types/cms.js';
|
|
2
|
+
import type { CategoryNavTreeResponse, StorefrontBrandDirectoryResponse, StorefrontBrandListingResponse, StorefrontCategoryDirectoryResponse, StorefrontCategoryListingResponse, StorefrontListingParams, StorefrontProductListingResponse, StorefrontSearchResponse } from '../types/catalog.js';
|
|
3
|
+
import type { ProductListingFilters, ProductListingSortOption } from '../types/listing.js';
|
|
4
|
+
/**
|
|
5
|
+
* Search products by query string. Use this for the search bar, autocomplete,
|
|
6
|
+
* and search results pages — `resolved_data` for a `search` page is intentionally
|
|
7
|
+
* null; query results must be fetched directly.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const results = await searchStorefront(config, website, { q: 'zapatillas', limit: 10 });
|
|
11
|
+
*/
|
|
12
|
+
export declare function searchStorefront(config: Pick<ProximaApiConfig, "baseUrl">, website: Pick<ProximaWebsiteResponse, "business_id" | "locale" | "currency">, params: {
|
|
13
|
+
q: string;
|
|
14
|
+
limit?: number;
|
|
15
|
+
locale?: string;
|
|
16
|
+
currency?: string;
|
|
17
|
+
}): Promise<StorefrontSearchResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Fetch the general product listing with optional filters and pagination.
|
|
20
|
+
* Use this for client-side filter/sort/paginate interactions on the all-products page.
|
|
21
|
+
* The initial page render is handled by the composition — call this for subsequent
|
|
22
|
+
* filter changes and page turns.
|
|
23
|
+
*/
|
|
24
|
+
export declare function fetchStorefrontProducts(config: Pick<ProximaApiConfig, "baseUrl">, website: Pick<ProximaWebsiteResponse, "business_id" | "locale" | "currency">, params?: StorefrontListingParams & {
|
|
25
|
+
brand?: string;
|
|
26
|
+
category?: string;
|
|
27
|
+
q?: string;
|
|
28
|
+
}): Promise<StorefrontProductListingResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Fetch paginated + filtered products for a category page (CLP).
|
|
31
|
+
* Use this for client-side filter/sort/paginate after the initial SSR render
|
|
32
|
+
* (which arrives in `resolved_data` from `fetchProximaComposition`).
|
|
33
|
+
*/
|
|
34
|
+
export declare function fetchCategoryProducts(config: Pick<ProximaApiConfig, "baseUrl">, website: Pick<ProximaWebsiteResponse, "business_id" | "locale" | "currency">, params: StorefrontListingParams & {
|
|
35
|
+
/** Category slug, from the URL path */
|
|
36
|
+
slug: string;
|
|
37
|
+
brand?: string;
|
|
38
|
+
q?: string;
|
|
39
|
+
}): Promise<StorefrontCategoryListingResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Fetch paginated + filtered products for a brand page (BLP).
|
|
42
|
+
* Use this for client-side filter/sort/paginate after the initial SSR render
|
|
43
|
+
* (which arrives in `resolved_data` from `fetchProximaComposition`).
|
|
44
|
+
*/
|
|
45
|
+
export declare function fetchBrandProducts(config: Pick<ProximaApiConfig, "baseUrl">, website: Pick<ProximaWebsiteResponse, "business_id" | "locale" | "currency">, params: StorefrontListingParams & {
|
|
46
|
+
/** Brand slug, from the URL path */
|
|
47
|
+
slug: string;
|
|
48
|
+
category?: string;
|
|
49
|
+
q?: string;
|
|
50
|
+
}): Promise<StorefrontBrandListingResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Fetch the full category directory (all categories with product counts).
|
|
53
|
+
* Useful for navigation menus and sitemap generation.
|
|
54
|
+
* For section-level category carousels, use smart collections via composition instead.
|
|
55
|
+
*/
|
|
56
|
+
export declare function fetchCategoriesDirectory(config: Pick<ProximaApiConfig, "baseUrl">, website: Pick<ProximaWebsiteResponse, "business_id" | "locale">, params?: {
|
|
57
|
+
locale?: string;
|
|
58
|
+
}): Promise<StorefrontCategoryDirectoryResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* Fetch the full category hierarchy as a recursive tree.
|
|
61
|
+
* Use this for data-driven mega menus — it returns nested `children[]`
|
|
62
|
+
* with `/categoria/{slug}` hrefs ready to render.
|
|
63
|
+
*
|
|
64
|
+
* @param maxDepth - Maximum tree depth (1–5, default 3)
|
|
65
|
+
*/
|
|
66
|
+
export declare function fetchCategoryNavTree(config: Pick<ProximaApiConfig, "baseUrl">, website: Pick<ProximaWebsiteResponse, "business_id" | "locale">, params?: {
|
|
67
|
+
maxDepth?: number;
|
|
68
|
+
locale?: string;
|
|
69
|
+
}): Promise<CategoryNavTreeResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Fetch the full brand directory (all brands with product counts).
|
|
72
|
+
* Useful for navigation menus and sitemap generation.
|
|
73
|
+
*/
|
|
74
|
+
export declare function fetchBrandsDirectory(config: Pick<ProximaApiConfig, "baseUrl">, website: Pick<ProximaWebsiteResponse, "business_id" | "locale">, params?: {
|
|
75
|
+
locale?: string;
|
|
76
|
+
}): Promise<StorefrontBrandDirectoryResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch a filtered, sorted, paginated product listing.
|
|
79
|
+
* Extends fetchStorefrontProducts with price range and stock filters.
|
|
80
|
+
*/
|
|
81
|
+
export declare function fetchProductListing(config: Pick<ProximaApiConfig, "baseUrl">, website: Pick<ProximaWebsiteResponse, "business_id" | "locale" | "currency">, params?: {
|
|
82
|
+
filters?: ProductListingFilters;
|
|
83
|
+
sort?: ProductListingSortOption;
|
|
84
|
+
page?: number;
|
|
85
|
+
page_size?: number;
|
|
86
|
+
}): Promise<StorefrontProductListingResponse>;
|
|
87
|
+
//# sourceMappingURL=listings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listings.d.ts","sourceRoot":"","sources":["../../src/catalog/listings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EACV,uBAAuB,EACvB,gCAAgC,EAChC,8BAA8B,EAC9B,mCAAmC,EACnC,iCAAiC,EACjC,uBAAuB,EACvB,gCAAgC,EAChC,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAa3F;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,C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AAC,EAAE,wBAAwB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,OAAO,CAAC,gCAAgC,CAAC,CAiB3C"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { StorefrontEndpoints, createStorefrontClient } from '../api/index.js';
|
|
2
|
+
function storefrontContext(website, params = {}) {
|
|
3
|
+
return {
|
|
4
|
+
businessId: website.business_id,
|
|
5
|
+
locale: params.locale ?? website.locale,
|
|
6
|
+
currency: params.currency ?? website.currency,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Search products by query string. Use this for the search bar, autocomplete,
|
|
11
|
+
* and search results pages — `resolved_data` for a `search` page is intentionally
|
|
12
|
+
* null; query results must be fetched directly.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const results = await searchStorefront(config, website, { q: 'zapatillas', limit: 10 });
|
|
16
|
+
*/
|
|
17
|
+
export async function searchStorefront(config, website, params) {
|
|
18
|
+
const client = createStorefrontClient(config);
|
|
19
|
+
return client.get(StorefrontEndpoints.catalog.search(), {
|
|
20
|
+
...storefrontContext(website, params),
|
|
21
|
+
query: { q: params.q, limit: params.limit },
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fetch the general product listing with optional filters and pagination.
|
|
26
|
+
* Use this for client-side filter/sort/paginate interactions on the all-products page.
|
|
27
|
+
* The initial page render is handled by the composition — call this for subsequent
|
|
28
|
+
* filter changes and page turns.
|
|
29
|
+
*/
|
|
30
|
+
export async function fetchStorefrontProducts(config, website, params = {}) {
|
|
31
|
+
const client = createStorefrontClient(config);
|
|
32
|
+
return client.get(StorefrontEndpoints.catalog.products(), {
|
|
33
|
+
...storefrontContext(website, params),
|
|
34
|
+
query: {
|
|
35
|
+
page: params.page,
|
|
36
|
+
page_size: params.pageSize,
|
|
37
|
+
sort: params.sort,
|
|
38
|
+
brand: params.brand,
|
|
39
|
+
category: params.category,
|
|
40
|
+
q: params.q,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Fetch paginated + filtered products for a category page (CLP).
|
|
46
|
+
* Use this for client-side filter/sort/paginate after the initial SSR render
|
|
47
|
+
* (which arrives in `resolved_data` from `fetchProximaComposition`).
|
|
48
|
+
*/
|
|
49
|
+
export async function fetchCategoryProducts(config, website, params) {
|
|
50
|
+
const client = createStorefrontClient(config);
|
|
51
|
+
return client.get(StorefrontEndpoints.catalog.categoryProducts(params.slug), {
|
|
52
|
+
...storefrontContext(website, params),
|
|
53
|
+
query: {
|
|
54
|
+
page: params.page,
|
|
55
|
+
page_size: params.pageSize,
|
|
56
|
+
sort: params.sort,
|
|
57
|
+
brand: params.brand,
|
|
58
|
+
q: params.q,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Fetch paginated + filtered products for a brand page (BLP).
|
|
64
|
+
* Use this for client-side filter/sort/paginate after the initial SSR render
|
|
65
|
+
* (which arrives in `resolved_data` from `fetchProximaComposition`).
|
|
66
|
+
*/
|
|
67
|
+
export async function fetchBrandProducts(config, website, params) {
|
|
68
|
+
const client = createStorefrontClient(config);
|
|
69
|
+
return client.get(StorefrontEndpoints.catalog.brandProducts(params.slug), {
|
|
70
|
+
...storefrontContext(website, params),
|
|
71
|
+
query: {
|
|
72
|
+
page: params.page,
|
|
73
|
+
page_size: params.pageSize,
|
|
74
|
+
sort: params.sort,
|
|
75
|
+
category: params.category,
|
|
76
|
+
q: params.q,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Fetch the full category directory (all categories with product counts).
|
|
82
|
+
* Useful for navigation menus and sitemap generation.
|
|
83
|
+
* For section-level category carousels, use smart collections via composition instead.
|
|
84
|
+
*/
|
|
85
|
+
export async function fetchCategoriesDirectory(config, website, params = {}) {
|
|
86
|
+
const client = createStorefrontClient(config);
|
|
87
|
+
return client.get(StorefrontEndpoints.catalog.categories(), {
|
|
88
|
+
businessId: website.business_id,
|
|
89
|
+
locale: params.locale ?? website.locale,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Fetch the full category hierarchy as a recursive tree.
|
|
94
|
+
* Use this for data-driven mega menus — it returns nested `children[]`
|
|
95
|
+
* with `/categoria/{slug}` hrefs ready to render.
|
|
96
|
+
*
|
|
97
|
+
* @param maxDepth - Maximum tree depth (1–5, default 3)
|
|
98
|
+
*/
|
|
99
|
+
export async function fetchCategoryNavTree(config, website, params = {}) {
|
|
100
|
+
const client = createStorefrontClient(config);
|
|
101
|
+
return client.get(StorefrontEndpoints.catalog.categoryTree(), {
|
|
102
|
+
businessId: website.business_id,
|
|
103
|
+
locale: params.locale ?? website.locale,
|
|
104
|
+
query: { max_depth: params.maxDepth },
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Fetch the full brand directory (all brands with product counts).
|
|
109
|
+
* Useful for navigation menus and sitemap generation.
|
|
110
|
+
*/
|
|
111
|
+
export async function fetchBrandsDirectory(config, website, params = {}) {
|
|
112
|
+
const client = createStorefrontClient(config);
|
|
113
|
+
return client.get(StorefrontEndpoints.catalog.brands(), {
|
|
114
|
+
businessId: website.business_id,
|
|
115
|
+
locale: params.locale ?? website.locale,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Fetch a filtered, sorted, paginated product listing.
|
|
120
|
+
* Extends fetchStorefrontProducts with price range and stock filters.
|
|
121
|
+
*/
|
|
122
|
+
export async function fetchProductListing(config, website, params = {}) {
|
|
123
|
+
const client = createStorefrontClient(config);
|
|
124
|
+
return client.get(StorefrontEndpoints.catalog.products(), {
|
|
125
|
+
businessId: website.business_id,
|
|
126
|
+
locale: website.locale,
|
|
127
|
+
currency: website.currency,
|
|
128
|
+
query: {
|
|
129
|
+
brand: params.filters?.brand,
|
|
130
|
+
category: params.filters?.category,
|
|
131
|
+
price_min: params.filters?.price_min,
|
|
132
|
+
price_max: params.filters?.price_max,
|
|
133
|
+
in_stock: params.filters?.in_stock ? 'true' : undefined,
|
|
134
|
+
sort: params.sort,
|
|
135
|
+
page: params.page,
|
|
136
|
+
page_size: params.page_size,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=listings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listings.js","sourceRoot":"","sources":["../../src/catalog/listings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAc9E,SAAS,iBAAiB,CACxB,OAA4E,EAC5E,SAAiD,EAAE;IAEnD,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,WAAW;QAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM;QACvC,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ;KAC9C,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAyC,EACzC,OAA4E,EAC5E,MAAyE;IAEzE,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,GAAG,CAA2B,mBAAmB,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE;QAChF,GAAG,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC;QACrC,KAAK,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;KAC5C,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAAyC,EACzC,OAA4E,EAC5E,SAII,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sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,GAAG,CAAmC,mBAAmB,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE;QACxF,UAAU,EAAE,OAAO,CAAC,WAAW;QAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM;KACxC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAyC,EACzC,OAA4E,EAC5E,SAKI,EAAE;IAEN,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,GAAG,CAAmC,mBAAmB,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE;QAC1F,UAAU,EAAE,OAAO,CAAC,WAAW;QAC/B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE;YACL,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK;YAC5B,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ;YAClC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS;YACpC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS;YACpC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YACvD,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StorefrontPaymentMethod } from '../types/business.js';
|
|
2
|
+
import type { ProximaWebsiteResponse } from '../types/cms.js';
|
|
3
|
+
/**
|
|
4
|
+
* Normalize payment method payloads embedded in CMS shell/footer attributes.
|
|
5
|
+
* The API injects enabled methods at `shell_sections.footer.attributes.payment_methods`
|
|
6
|
+
* during website resolve (same tenant-wide list previously fetched separately).
|
|
7
|
+
*/
|
|
8
|
+
export declare function paymentMethodsFromAttributes(attributes: Record<string, unknown> | undefined | null): StorefrontPaymentMethod[];
|
|
9
|
+
/**
|
|
10
|
+
* Read enabled payment methods from a resolved website's shell footer slot.
|
|
11
|
+
*/
|
|
12
|
+
export declare function paymentMethodsFromShell(shellSections: ProximaWebsiteResponse['shell_sections'] | undefined, footerKey?: string): StorefrontPaymentMethod[];
|
|
13
|
+
//# sourceMappingURL=payment-methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-methods.d.ts","sourceRoot":"","sources":["../../src/cms/payment-methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAuB9D;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,GACrD,uBAAuB,EAAE,CAM3B;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,GAAG,SAAS,EACnE,SAAS,SAAW,GACnB,uBAAuB,EAAE,CAI3B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function normalizePaymentMethod(raw) {
|
|
2
|
+
if (!raw || typeof raw !== 'object')
|
|
3
|
+
return null;
|
|
4
|
+
const item = raw;
|
|
5
|
+
const code = String(item.code ?? '').trim();
|
|
6
|
+
if (!code)
|
|
7
|
+
return null;
|
|
8
|
+
const kind = item.kind;
|
|
9
|
+
const normalizedKind = kind === 'online' || kind === 'hybrid' ? kind : 'offline';
|
|
10
|
+
return {
|
|
11
|
+
code,
|
|
12
|
+
name_es: String(item.name_es ?? code),
|
|
13
|
+
description_es: item.description_es == null ? null : String(item.description_es),
|
|
14
|
+
category: String(item.category ?? ''),
|
|
15
|
+
kind: normalizedKind,
|
|
16
|
+
icon_url: item.icon_url == null ? null : String(item.icon_url),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Normalize payment method payloads embedded in CMS shell/footer attributes.
|
|
21
|
+
* The API injects enabled methods at `shell_sections.footer.attributes.payment_methods`
|
|
22
|
+
* during website resolve (same tenant-wide list previously fetched separately).
|
|
23
|
+
*/
|
|
24
|
+
export function paymentMethodsFromAttributes(attributes) {
|
|
25
|
+
const raw = attributes?.payment_methods;
|
|
26
|
+
if (!Array.isArray(raw))
|
|
27
|
+
return [];
|
|
28
|
+
return raw
|
|
29
|
+
.map(normalizePaymentMethod)
|
|
30
|
+
.filter((item) => item !== null);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Read enabled payment methods from a resolved website's shell footer slot.
|
|
34
|
+
*/
|
|
35
|
+
export function paymentMethodsFromShell(shellSections, footerKey = 'footer') {
|
|
36
|
+
const footer = shellSections?.[footerKey];
|
|
37
|
+
if (!footer?.attributes)
|
|
38
|
+
return [];
|
|
39
|
+
return paymentMethodsFromAttributes(footer.attributes);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=payment-methods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-methods.js","sourceRoot":"","sources":["../../src/cms/payment-methods.ts"],"names":[],"mappings":"AAGA,SAAS,sBAAsB,CAAC,GAAY;IAC1C,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,IAAI,GAAG,GAA8B,CAAC;IAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5C,IAAI,CAAC,IAAI;QAAE,O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AACzD,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ProximaApiConfig, ProximaCompositionResponse, ProximaRenderResponse, ProximaWebsiteResponse } from '../types/cms.js';
|
|
2
|
+
import type { StorefrontBusinessProfile, StorefrontCampaign } from '../types/business.js';
|
|
3
|
+
export declare function fetchBusinessProfile(config: Pick<ProximaApiConfig, "baseUrl" | "serviceKey">, businessId: string): Promise<StorefrontBusinessProfile>;
|
|
4
|
+
/**
|
|
5
|
+
* Fetch all active campaigns for a tenant. An "active" campaign is
|
|
6
|
+
* `is_active=true` AND (active_until is null OR active_until > now).
|
|
7
|
+
* Scheduled-but-not-yet-started campaigns are included so the storefront
|
|
8
|
+
* can render teasers ("Empieza en X días"); filter by `active_from` if
|
|
9
|
+
* you only want strictly-live ones.
|
|
10
|
+
*/
|
|
11
|
+
export declare function fetchCampaigns(config: Pick<ProximaApiConfig, "baseUrl" | "serviceKey">, businessId: string): Promise<StorefrontCampaign[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Fetch a single campaign by slug. Returns null if the campaign doesn't
|
|
14
|
+
* exist or is no longer active — sections pinned to a specific campaign
|
|
15
|
+
* (e.g. a hero hardcoded to 'black-week-2026') use this to detect when
|
|
16
|
+
* to fall back to their generic copy.
|
|
17
|
+
*/
|
|
18
|
+
export declare function fetchCampaignBySlug(config: Pick<ProximaApiConfig, "baseUrl" | "serviceKey">, businessId: string, slug: string): Promise<StorefrontCampaign | null>;
|
|
19
|
+
/** List all websites for a service-key authenticated caller. Useful for build-time scripts. */
|
|
20
|
+
export declare function fetchProximaWebsiteList(config: Pick<ProximaApiConfig, "baseUrl" | "serviceKey">): Promise<ProximaWebsiteResponse[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve a website by domain/host. Call this once per request and cache the result.
|
|
23
|
+
* Pass `host` if the incoming request host differs from `config.domain` (e.g. in middleware).
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const website = await fetchProximaWebsite({ baseUrl: env.apiUrl, domain: Astro.url.hostname });
|
|
27
|
+
*/
|
|
28
|
+
export declare function fetchProximaWebsite(config: Pick<ProximaApiConfig, "baseUrl" | "domain" | "serviceKey"> & {
|
|
29
|
+
host?: string;
|
|
30
|
+
}): Promise<ProximaWebsiteResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Build a synthetic `ProximaWebsiteResponse` for the visual builder preview.
|
|
33
|
+
* Use this when the builder passes `websiteId` and `businessId` via query params
|
|
34
|
+
* instead of resolving by domain.
|
|
35
|
+
*/
|
|
36
|
+
export declare function makeBuilderPreviewWebsite(config: Pick<ProximaApiConfig, "websiteId" | "businessId" | "domain">): ProximaWebsiteResponse;
|
|
37
|
+
/**
|
|
38
|
+
* Fetch the fully resolved page composition for the given path.
|
|
39
|
+
* This is the main data-fetching call for every SSR page render.
|
|
40
|
+
* The response embeds all section data (via smart collections) and, for detail pages,
|
|
41
|
+
* the primary entity in `resolved_data` (product, category, brand, blog post).
|
|
42
|
+
* No additional catalog API calls are needed for the initial render.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // src/pages/[...path].astro
|
|
46
|
+
* const composition = await fetchProximaComposition(
|
|
47
|
+
* { ...config, path: Astro.url.pathname },
|
|
48
|
+
* website
|
|
49
|
+
* );
|
|
50
|
+
*/
|
|
51
|
+
export declare function fetchProximaComposition(config: ProximaApiConfig, website: ProximaWebsiteResponse): Promise<ProximaCompositionResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Fetch everything needed to SSR any page in a single round-trip.
|
|
54
|
+
*
|
|
55
|
+
* Returns `shell` (theme, nav tree, payment methods), `page` (sections + resolved data + SEO),
|
|
56
|
+
* `bootstrap` (categories, brands, store config) and `website` metadata.
|
|
57
|
+
* The response is cached at the CDN edge with `stale-while-revalidate`, so warm requests
|
|
58
|
+
* are served in ~5ms without hitting the API origin.
|
|
59
|
+
*
|
|
60
|
+
* Use this instead of calling `fetchProximaWebsite` + `fetchProximaComposition` +
|
|
61
|
+
* `fetchCategoryNavTree` + `fetchBusinessProfile` separately.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // src/pages/[...path].astro
|
|
65
|
+
* const render = await fetchProximaRender(
|
|
66
|
+
* { baseUrl: env.apiUrl, domain: Astro.url.hostname, path: Astro.url.pathname, serviceKey: env.serviceKey }
|
|
67
|
+
* );
|
|
68
|
+
* if (render.page.requires_auth) return Astro.redirect('/login');
|
|
69
|
+
*/
|
|
70
|
+
export declare function fetchProximaRender(config: Pick<ProximaApiConfig, 'baseUrl' | 'domain' | 'path' | 'serviceKey'> & {
|
|
71
|
+
/** Override domain for dev/testing (maps to ?domain= query param). */
|
|
72
|
+
host?: string;
|
|
73
|
+
/** Active locale for composition + SEO resolution. */
|
|
74
|
+
locale?: string;
|
|
75
|
+
}): Promise<ProximaRenderResponse>;
|
|
76
|
+
//# sourceMappingURL=website.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website.d.ts","sourceRoot":"","sources":["../../src/cms/website.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,YAAY,CAAC,EACxD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,yBAAyB,CAAC,CAMpC;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,YAAY,CAAC,EACxD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAM/B;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,YAAY,CAAC,EACxD,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAOpC;AAED,+FAA+F;AAC/F,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,YAAY,CAAC,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAKzI;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACtF,OAAO,CAAC,sBAAsB,CAAC,CAMjC;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,YAAY,GAAG,QAAQ,CAAC,GACpE,sBAAsB,CAoBxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,0BAA0B,CAAC,CAoBrC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAC,GAAG;IAC7E,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACA,OAAO,CAAC,qBAAqB,CAAC,CAWhC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { StorefrontEndpoints, createStorefrontClient } from '../api/index.js';
|
|
2
|
+
export async function fetchBusinessProfile(config, businessId) {
|
|
3
|
+
const client = createStorefrontClient(config);
|
|
4
|
+
return client.get(StorefrontEndpoints.business.profile(), {
|
|
5
|
+
query: { business_id: businessId },
|
|
6
|
+
failPrefix: 'Business profile fetch failed',
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Fetch all active campaigns for a tenant. An "active" campaign is
|
|
11
|
+
* `is_active=true` AND (active_until is null OR active_until > now).
|
|
12
|
+
* Scheduled-but-not-yet-started campaigns are included so the storefront
|
|
13
|
+
* can render teasers ("Empieza en X días"); filter by `active_from` if
|
|
14
|
+
* you only want strictly-live ones.
|
|
15
|
+
*/
|
|
16
|
+
export async function fetchCampaigns(config, businessId) {
|
|
17
|
+
const client = createStorefrontClient(config);
|
|
18
|
+
return client.get(StorefrontEndpoints.campaigns.list(), {
|
|
19
|
+
query: { business_id: businessId },
|
|
20
|
+
failPrefix: 'Campaigns fetch failed',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Fetch a single campaign by slug. Returns null if the campaign doesn't
|
|
25
|
+
* exist or is no longer active — sections pinned to a specific campaign
|
|
26
|
+
* (e.g. a hero hardcoded to 'black-week-2026') use this to detect when
|
|
27
|
+
* to fall back to their generic copy.
|
|
28
|
+
*/
|
|
29
|
+
export async function fetchCampaignBySlug(config, businessId, slug) {
|
|
30
|
+
const client = createStorefrontClient(config);
|
|
31
|
+
return client.get(StorefrontEndpoints.campaigns.bySlug(slug), {
|
|
32
|
+
query: { business_id: businessId },
|
|
33
|
+
notFound: 'null',
|
|
34
|
+
failPrefix: 'Campaign fetch failed',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/** List all websites for a service-key authenticated caller. Useful for build-time scripts. */
|
|
38
|
+
export async function fetchProximaWebsiteList(config) {
|
|
39
|
+
const client = createStorefrontClient(config);
|
|
40
|
+
return client.get(StorefrontEndpoints.cms.websites(), {
|
|
41
|
+
failPrefix: 'Website list failed',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a website by domain/host. Call this once per request and cache the result.
|
|
46
|
+
* Pass `host` if the incoming request host differs from `config.domain` (e.g. in middleware).
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* const website = await fetchProximaWebsite({ baseUrl: env.apiUrl, domain: Astro.url.hostname });
|
|
50
|
+
*/
|
|
51
|
+
export async function fetchProximaWebsite(config) {
|
|
52
|
+
const client = createStorefrontClient(config);
|
|
53
|
+
return client.get(StorefrontEndpoints.cms.resolveWebsite(), {
|
|
54
|
+
query: { host: config.host || config.domain },
|
|
55
|
+
failPrefix: 'Website resolve failed',
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Build a synthetic `ProximaWebsiteResponse` for the visual builder preview.
|
|
60
|
+
* Use this when the builder passes `websiteId` and `businessId` via query params
|
|
61
|
+
* instead of resolving by domain.
|
|
62
|
+
*/
|
|
63
|
+
export function makeBuilderPreviewWebsite(config) {
|
|
64
|
+
if (!config.websiteId || !config.businessId) {
|
|
65
|
+
throw new Error("Builder preview requires websiteId and businessId");
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
id: config.websiteId,
|
|
69
|
+
business_id: config.businessId,
|
|
70
|
+
name: "Builder preview",
|
|
71
|
+
domain: config.domain,
|
|
72
|
+
delivery_mode: "custom_managed",
|
|
73
|
+
website_kind: "ecommerce",
|
|
74
|
+
template_key: null,
|
|
75
|
+
code_profile: null,
|
|
76
|
+
locale: "es",
|
|
77
|
+
currency: "PEN",
|
|
78
|
+
capabilities: {},
|
|
79
|
+
theme_tokens: {},
|
|
80
|
+
animation_config: {},
|
|
81
|
+
pages: [],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Fetch the fully resolved page composition for the given path.
|
|
86
|
+
* This is the main data-fetching call for every SSR page render.
|
|
87
|
+
* The response embeds all section data (via smart collections) and, for detail pages,
|
|
88
|
+
* the primary entity in `resolved_data` (product, category, brand, blog post).
|
|
89
|
+
* No additional catalog API calls are needed for the initial render.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* // src/pages/[...path].astro
|
|
93
|
+
* const composition = await fetchProximaComposition(
|
|
94
|
+
* { ...config, path: Astro.url.pathname },
|
|
95
|
+
* website
|
|
96
|
+
* );
|
|
97
|
+
*/
|
|
98
|
+
export async function fetchProximaComposition(config, website) {
|
|
99
|
+
const locale = website.locale ?? "es";
|
|
100
|
+
const currency = website.currency ?? "PEN";
|
|
101
|
+
const client = createStorefrontClient(config);
|
|
102
|
+
return client.get(StorefrontEndpoints.cms.composition(website.id), {
|
|
103
|
+
businessId: website.business_id,
|
|
104
|
+
locale,
|
|
105
|
+
currency,
|
|
106
|
+
query: {
|
|
107
|
+
path: config.path,
|
|
108
|
+
locale,
|
|
109
|
+
business_id: website.business_id,
|
|
110
|
+
variant_id: config.variantId,
|
|
111
|
+
preview_token: config.previewToken,
|
|
112
|
+
},
|
|
113
|
+
failPrefix: 'Composition failed',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Fetch everything needed to SSR any page in a single round-trip.
|
|
118
|
+
*
|
|
119
|
+
* Returns `shell` (theme, nav tree, payment methods), `page` (sections + resolved data + SEO),
|
|
120
|
+
* `bootstrap` (categories, brands, store config) and `website` metadata.
|
|
121
|
+
* The response is cached at the CDN edge with `stale-while-revalidate`, so warm requests
|
|
122
|
+
* are served in ~5ms without hitting the API origin.
|
|
123
|
+
*
|
|
124
|
+
* Use this instead of calling `fetchProximaWebsite` + `fetchProximaComposition` +
|
|
125
|
+
* `fetchCategoryNavTree` + `fetchBusinessProfile` separately.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* // src/pages/[...path].astro
|
|
129
|
+
* const render = await fetchProximaRender(
|
|
130
|
+
* { baseUrl: env.apiUrl, domain: Astro.url.hostname, path: Astro.url.pathname, serviceKey: env.serviceKey }
|
|
131
|
+
* );
|
|
132
|
+
* if (render.page.requires_auth) return Astro.redirect('/login');
|
|
133
|
+
*/
|
|
134
|
+
export async function fetchProximaRender(config) {
|
|
135
|
+
const client = createStorefrontClient(config);
|
|
136
|
+
return client.get(StorefrontEndpoints.cms.render(), {
|
|
137
|
+
query: {
|
|
138
|
+
path: config.path,
|
|
139
|
+
domain: config.host ?? config.domain,
|
|
140
|
+
...(config.locale ? { locale: config.locale } : {}),
|
|
141
|
+
},
|
|
142
|
+
...(config.locale ? { locale: config.locale } : {}),
|
|
143
|
+
failPrefix: 'Render fetch failed',
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=website.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website.js","sourceRoot":"","sources":["../../src/cms/website.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAY9E,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAwD,EACxD,UAAkB;IAElB,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,GAAG,CAA4B,mBAAmB,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE;QACnF,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE;QAClC,UAAU,EAAE,+BAA+B;KAC5C,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAwD,EACxD,UAAkB;IAElB,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,GAAG,CAAuB,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE;QAC5E,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE;QAClC,UAAU,EAAE,wBAAwB;KACrC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBA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,EAAE,MAAM,CAAC,IAAI;YACjB,MAAM,EAAE,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM;YACpC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD;QACD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,UAAU,EAAE,qBAAqB;KAClC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CookieConsentState } from '../types/cookie-consent.js';
|
|
2
|
+
/** Read persisted consent, or `null` if none / stale version. */
|
|
3
|
+
export declare function readCookieConsent(): CookieConsentState | null;
|
|
4
|
+
/** Whether the shopper already accepted or rejected non-essential cookies. */
|
|
5
|
+
export declare function hasCookieConsentDecision(): boolean;
|
|
6
|
+
/** Whether analytics events may be sent (requires explicit accept). */
|
|
7
|
+
export declare function isAnalyticsConsentGranted(state?: CookieConsentState | null): boolean;
|
|
8
|
+
export declare function isMarketingConsentGranted(state?: CookieConsentState | null): boolean;
|
|
9
|
+
/** Persist consent and notify listeners (analytics gating, third-party tags). */
|
|
10
|
+
/** Persist consent and dispatch `COOKIE_CONSENT_CHANGED_EVENT` (analytics client listens). */
|
|
11
|
+
export declare function writeCookieConsent(categories: {
|
|
12
|
+
analytics: boolean;
|
|
13
|
+
marketing: boolean;
|
|
14
|
+
}): CookieConsentState;
|
|
15
|
+
/** Accept analytics + marketing — call from cookie banner "Accept all". */
|
|
16
|
+
export declare function acceptAllCookieConsent(): CookieConsentState;
|
|
17
|
+
/** Reject non-essential cookies — analytics stays gated until user accepts. */
|
|
18
|
+
export declare function rejectNonEssentialCookieConsent(): CookieConsentState;
|
|
19
|
+
export declare function dispatchCookieConsentChanged(state: CookieConsentState): void;
|
|
20
|
+
/** Subscribe to consent updates. Returns an unsubscribe function. */
|
|
21
|
+
export declare function onCookieConsentChanged(listener: (state: CookieConsentState) => void): () => void;
|
|
22
|
+
//# sourceMappingURL=consent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent.d.ts","sourceRoot":"","sources":["../../src/cookie-consent/consent.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AA2BpC,iEAAiE;AACjE,wBAAgB,iBAAiB,IAAI,kBAAkB,GAAG,IAAI,CAG7D;AAED,8EAA8E;AAC9E,wBAAgB,wBAAwB,IAAI,OAAO,CAElD;AAED,uEAAuE;AACvE,wBAAgB,yBAAyB,CAAC,KAAK,GAAE,kBAAkB,GAAG,IAA0B,GAAG,OAAO,CAEzG;AAED,wBAAgB,yBAAyB,CAAC,KAAK,GAAE,kBAAkB,GAAG,IAA0B,GAAG,OAAO,CAEzG;AAYD,iFAAiF;AACjF,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,UAAU,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,kBAAkB,CAO7G;AAED,2EAA2E;AAC3E,wBAAgB,sBAAsB,IAAI,kBAAkB,CAE3D;AAED,+EAA+E;AAC/E,wBAAgB,+BAA+B,IAAI,kBAAkB,CAEpE;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAK5E;AAED,qEAAqE;AACrE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,GAAG,MAAM,IAAI,CAQhG"}
|