@ecomiq/storefront 1.1.5 → 1.1.9
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 +3 -2
- package/dist/{chunk-QRR7EPCH.js → chunk-AKD5IDEB.js} +4 -3
- package/dist/chunk-AKD5IDEB.js.map +1 -0
- package/dist/{chunk-ZG2XUYGZ.js → chunk-EFEVJJWF.js} +85 -21
- package/dist/chunk-EFEVJJWF.js.map +1 -0
- package/dist/{chunk-3QGB55R6.js → chunk-NAJQB5DN.js} +4 -6
- package/dist/chunk-NAJQB5DN.js.map +1 -0
- package/dist/{chunk-ASFU32ZM.js → chunk-OABDGTBI.js} +25 -8
- package/dist/chunk-OABDGTBI.js.map +1 -0
- package/dist/chunks/client.d.ts +850 -132
- package/dist/chunks/client.js +47 -12
- package/dist/chunks/client.js.map +1 -1
- package/dist/chunks/config.js +1 -1
- package/dist/chunks/core-public.d.ts +2 -2
- package/dist/chunks/core-public.js +2 -2
- package/dist/chunks/server-nextjs.d.ts +3 -3
- package/dist/chunks/server-nextjs.js +17 -5
- package/dist/chunks/server-nextjs.js.map +1 -1
- package/dist/chunks/server-tanstack.d.ts +3 -3
- package/dist/chunks/server-tanstack.js +13 -7
- package/dist/chunks/server-tanstack.js.map +1 -1
- package/dist/{collection-C6bWDLiw.d.ts → collection-DU7gREXS.d.ts} +174 -38
- package/dist/{ecomiq-oauth-password-plugin-J5wDFqzL.d.ts → ecomiq-oauth-password-plugin-B_gMdGuc.d.ts} +32 -30
- package/dist/nextjs/api.js +1 -1
- package/dist/nextjs.server.d.ts +17 -0
- package/dist/tanstack/api.js +2 -2
- package/dist/tanstack.d.ts +0 -1
- package/dist/tanstack.server.d.ts +17 -0
- package/package.json +12 -2
- package/dist/chunk-3QGB55R6.js.map +0 -1
- package/dist/chunk-ASFU32ZM.js.map +0 -1
- package/dist/chunk-QRR7EPCH.js.map +0 -1
- package/dist/chunk-ZG2XUYGZ.js.map +0 -1
package/dist/chunks/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EcomiqConfigSchema, clearEcomiqConfigCache, hasEcomiqSlugStoreConfig, loadEcomiqConfig, resolvePublicStoreKey } from '../chunk-
|
|
1
|
+
export { EcomiqConfigSchema, clearEcomiqConfigCache, hasEcomiqSlugStoreConfig, loadEcomiqConfig, resolvePublicStoreKey } from '../chunk-NAJQB5DN.js';
|
|
2
2
|
import '../chunk-64GLOWMJ.js';
|
|
3
3
|
import '../chunk-Q4U5OEUT.js';
|
|
4
4
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StorefrontSettings, a as StorefrontPageDetail } from '../collection-
|
|
2
|
-
export { b as StorefrontCmsPage, c as StorefrontCmsSettings, d as StorefrontCollection, e as StorefrontCollectionDetail, f as StorefrontCollectionDetailSchema, g as StorefrontCollectionSchema, h as StorefrontCollectionsResponseSchema, i as
|
|
1
|
+
import { S as StorefrontSettings, a as StorefrontPageDetail } from '../collection-DU7gREXS.js';
|
|
2
|
+
export { b as StorefrontCmsPage, c as StorefrontCmsSettings, d as StorefrontCollection, e as StorefrontCollectionDetail, f as StorefrontCollectionDetailSchema, g as StorefrontCollectionSchema, h as StorefrontCollectionsResponseSchema, i as StorefrontFacet, j as StorefrontFacetSchema, k as StorefrontPageDetailSchema, l as StorefrontPageListItem, m as StorefrontPageListItemSchema, n as StorefrontProduct, o as StorefrontProductDetail, p as StorefrontProductDetailSchema, q as StorefrontProductSchema, r as StorefrontProductsParamsInput, s as StorefrontProductsParamsSchema, t as StorefrontProductsResponse, u as StorefrontProductsResponseSchema, v as StorefrontSearchFilter, w as StorefrontSearchFilterSchema, x as StorefrontSettingsSchema, y as StorefrontStore, z as StorefrontStoreSchema, A as StorefrontVariant } from '../collection-DU7gREXS.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
/** Prefijo base de la API storefront (ej. v1/storefront). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StorefrontPageDetailSchema } from '../chunk-
|
|
2
|
-
export { StorefrontCollectionDetailSchema, StorefrontCollectionSchema, StorefrontCollectionsResponseSchema, StorefrontPageDetailSchema, StorefrontPageListItemSchema, StorefrontProductDetailSchema, StorefrontProductSchema, StorefrontProductsParamsSchema, StorefrontProductsResponseSchema } from '../chunk-
|
|
1
|
+
import { StorefrontPageDetailSchema } from '../chunk-OABDGTBI.js';
|
|
2
|
+
export { StorefrontCollectionDetailSchema, StorefrontCollectionSchema, StorefrontCollectionsResponseSchema, StorefrontFacetSchema, StorefrontPageDetailSchema, StorefrontPageListItemSchema, StorefrontProductDetailSchema, StorefrontProductSchema, StorefrontProductsParamsSchema, StorefrontProductsResponseSchema, StorefrontSearchFilterSchema } from '../chunk-OABDGTBI.js';
|
|
3
3
|
export { StorefrontSettingsSchema, StorefrontStoreSchema } from '../chunk-64GLOWMJ.js';
|
|
4
4
|
export { STOREFRONT_API_PATH_PREFIX } from '../chunk-S7CPZ4UE.js';
|
|
5
5
|
import { countryCurrency } from '../chunk-Q4U5OEUT.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as PublicStoreSettingsSource, a as PublicStoreResult, F as FetchPublicStoreSettingsOptions } from '../ecomiq-oauth-password-plugin-
|
|
2
|
-
export { C as CustomerAddress, b as CustomerAddressSchema, c as CustomerAddressUpsert, d as CustomerAddressUpsertSchema, e as CustomerMe, f as CustomerMeSchema, g as CustomerOrderDetail, g as CustomerOrderDetailDto, h as CustomerOrderDetailSchema, i as CustomerOrderListItem, i as CustomerOrderListItemDto, j as CustomerOrderListItemSchema, k as CustomerProfilePatch, l as CustomerProfilePatchSchema, m as CustomerRegisterRequest, n as CustomerRegisterRequestSchema, E as ECOMIQ_CLIENTS_STORE_KV_BINDING, S as StoreApiClient, o as StoreApiGetOptions, p as addCartCoupon, q as applyServerRequestOriginFromHeaders, r as buildStorefrontKvSnapshotKey, s as buildStorefrontKvSnapshotKeyFromStoreKey, t as checkoutCart, u as createCart, v as createCustomerAddress, w as createStoreApiClient, x as customerMeToProfilePatch, y as deleteCustomerAddress, z as ecomiqOAuthPassword, A as fetchPublicStoreSettings, B as getCart, D as getCartCheckout, G as getCartPaymentMethods, H as getCustomerAddresses, I as getCustomerMe, J as getCustomerOrder, K as getCustomerOrders, L as getSharedOrderDraft, M as getShippingOptions, N as getStoreApiBaseUrl, O as getStoreApiClient, Q as getStorefrontCollectionBySlug, R as getStorefrontCollections, T as getStorefrontPageBySlug, U as getStorefrontPagePreview, V as getStorefrontPages, W as getStorefrontProductBySlug, X as getStorefrontProducts, Y as getStorefrontSettings, Z as getStorefrontSettingsFromKv, _ as getStorefrontSettingsFromKvByStoreKey, $ as isCartNotActiveApiError, a0 as normalizeStoreHost, a1 as patchCartAddresses, a2 as patchCartBuyer, a3 as patchCustomer, a4 as putCartShippingMethod, a5 as registerCustomer, a6 as removeCartCoupon, a7 as resolvePublicStoreSettingsSource, a8 as resolveStorefrontSettingsHost, a9 as setClientStoreId, aa as setServerRequestOrigin, ab as setServerStoreId, ac as storeApiClient, ad as updateCustomerAddress, ae as uploadPaymentReceipt } from '../ecomiq-oauth-password-plugin-
|
|
1
|
+
import { P as PublicStoreSettingsSource, a as PublicStoreResult, F as FetchPublicStoreSettingsOptions } from '../ecomiq-oauth-password-plugin-B_gMdGuc.js';
|
|
2
|
+
export { C as CustomerAddress, b as CustomerAddressSchema, c as CustomerAddressUpsert, d as CustomerAddressUpsertSchema, e as CustomerMe, f as CustomerMeSchema, g as CustomerOrderDetail, g as CustomerOrderDetailDto, h as CustomerOrderDetailSchema, i as CustomerOrderListItem, i as CustomerOrderListItemDto, j as CustomerOrderListItemSchema, k as CustomerProfilePatch, l as CustomerProfilePatchSchema, m as CustomerRegisterRequest, n as CustomerRegisterRequestSchema, E as ECOMIQ_CLIENTS_STORE_KV_BINDING, S as StoreApiClient, o as StoreApiGetOptions, p as addCartCoupon, q as applyServerRequestOriginFromHeaders, r as buildStorefrontKvSnapshotKey, s as buildStorefrontKvSnapshotKeyFromStoreKey, t as checkoutCart, u as createCart, v as createCustomerAddress, w as createStoreApiClient, x as customerMeToProfilePatch, y as deleteCustomerAddress, z as ecomiqOAuthPassword, A as fetchPublicStoreSettings, B as getCart, D as getCartCheckout, G as getCartPaymentMethods, H as getCustomerAddresses, I as getCustomerMe, J as getCustomerOrder, K as getCustomerOrders, L as getSharedOrderDraft, M as getShippingOptions, N as getStoreApiBaseUrl, O as getStoreApiClient, Q as getStorefrontCollectionBySlug, R as getStorefrontCollections, T as getStorefrontPageBySlug, U as getStorefrontPagePreview, V as getStorefrontPages, W as getStorefrontProductBySlug, X as getStorefrontProducts, Y as getStorefrontSettings, Z as getStorefrontSettingsFromKv, _ as getStorefrontSettingsFromKvByStoreKey, $ as isCartNotActiveApiError, a0 as normalizeStoreHost, a1 as patchCartAddresses, a2 as patchCartBuyer, a3 as patchCustomer, a4 as putCartShippingMethod, a5 as registerCustomer, a6 as removeCartCoupon, a7 as resolvePublicStoreSettingsSource, a8 as resolveStorefrontSettingsHost, a9 as setClientStoreId, aa as setServerRequestOrigin, ab as setServerStoreId, ac as storeApiClient, ad as updateCustomerAddress, ae as uploadPaymentReceipt } from '../ecomiq-oauth-password-plugin-B_gMdGuc.js';
|
|
3
3
|
export { S as StoreProxyHandlerConfig, h as handleStoreProxyRequest } from '../store-proxy-handler-CNzKlTFA.js';
|
|
4
|
-
import '../collection-
|
|
4
|
+
import '../collection-DU7gREXS.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'better-auth';
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { fetchPublicStoreSettings,
|
|
2
|
-
export { CustomerAddressSchema, CustomerAddressUpsertSchema, CustomerMeSchema, CustomerOrderDetailSchema, CustomerOrderListItemSchema, CustomerProfilePatchSchema, CustomerRegisterRequestSchema, StoreApiClient, addCartCoupon, applyServerRequestOriginFromHeaders, checkoutCart, createCart, createCustomerAddress, createStoreApiClient, customerMeToProfilePatch, deleteCustomerAddress, ecomiqOAuthPassword, fetchPublicStoreSettings, getCart, getCartCheckout, getCartPaymentMethods, getCustomerAddresses, getCustomerMe, getCustomerOrder, getCustomerOrders, getSharedOrderDraft, getShippingOptions, getStoreApiBaseUrl, getStoreApiClient, getStorefrontCollectionBySlug, getStorefrontCollections, getStorefrontPageBySlug, getStorefrontPagePreview, getStorefrontPages, getStorefrontProductBySlug, getStorefrontProducts, getStorefrontSettings, isCartNotActiveApiError, patchCartAddresses, patchCartBuyer, patchCustomer, putCartShippingMethod, registerCustomer, removeCartCoupon, resolvePublicStoreSettingsSource, setClientStoreId, setServerRequestOrigin, setServerStoreId, storeApiClient, updateCustomerAddress, uploadPaymentReceipt } from '../chunk-
|
|
3
|
-
export { ECOMIQ_CLIENTS_STORE_KV_BINDING, buildStorefrontKvSnapshotKey, buildStorefrontKvSnapshotKeyFromStoreKey, getStorefrontSettingsFromKv, getStorefrontSettingsFromKvByStoreKey, normalizeStoreHost, resolveStorefrontSettingsHost } from '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
import { fetchPublicStoreSettings, getStorefrontProductBySlug, applyServerRequestOriginFromHeaders, setServerStoreId, normalizeRequestHostname } from '../chunk-EFEVJJWF.js';
|
|
2
|
+
export { CustomerAddressSchema, CustomerAddressUpsertSchema, CustomerMeSchema, CustomerOrderDetailSchema, CustomerOrderListItemSchema, CustomerProfilePatchSchema, CustomerRegisterRequestSchema, StoreApiClient, addCartCoupon, applyServerRequestOriginFromHeaders, checkoutCart, createCart, createCustomerAddress, createStoreApiClient, customerMeToProfilePatch, deleteCustomerAddress, ecomiqOAuthPassword, fetchPublicStoreSettings, getCart, getCartCheckout, getCartPaymentMethods, getCustomerAddresses, getCustomerMe, getCustomerOrder, getCustomerOrders, getSharedOrderDraft, getShippingOptions, getStoreApiBaseUrl, getStoreApiClient, getStorefrontCollectionBySlug, getStorefrontCollections, getStorefrontPageBySlug, getStorefrontPagePreview, getStorefrontPages, getStorefrontProductBySlug, getStorefrontProducts, getStorefrontSettings, isCartNotActiveApiError, patchCartAddresses, patchCartBuyer, patchCustomer, putCartShippingMethod, registerCustomer, removeCartCoupon, resolvePublicStoreSettingsSource, setClientStoreId, setServerRequestOrigin, setServerStoreId, storeApiClient, updateCustomerAddress, uploadPaymentReceipt } from '../chunk-EFEVJJWF.js';
|
|
3
|
+
export { ECOMIQ_CLIENTS_STORE_KV_BINDING, buildStorefrontKvSnapshotKey, buildStorefrontKvSnapshotKeyFromStoreKey, getStorefrontSettingsFromKv, getStorefrontSettingsFromKvByStoreKey, normalizeStoreHost, resolveStorefrontSettingsHost } from '../chunk-NAJQB5DN.js';
|
|
4
|
+
import '../chunk-OABDGTBI.js';
|
|
5
5
|
import '../chunk-64GLOWMJ.js';
|
|
6
|
-
export { handleStoreProxyRequest } from '../chunk-
|
|
6
|
+
export { handleStoreProxyRequest } from '../chunk-AKD5IDEB.js';
|
|
7
7
|
import '../chunk-S7CPZ4UE.js';
|
|
8
8
|
import '../chunk-Q4U5OEUT.js';
|
|
9
9
|
import { headers } from 'next/headers';
|
|
@@ -41,6 +41,18 @@ async function getPublicStoreFromHeaders(headerList, options) {
|
|
|
41
41
|
);
|
|
42
42
|
return applyPublicStoreRuntime(result);
|
|
43
43
|
}
|
|
44
|
+
cache(
|
|
45
|
+
async (slug) => {
|
|
46
|
+
try {
|
|
47
|
+
await getPublicStore();
|
|
48
|
+
return await getStorefrontProductBySlug(slug, {
|
|
49
|
+
cacheKey: `storefront-product-${slug}`
|
|
50
|
+
});
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
);
|
|
44
56
|
|
|
45
57
|
export { getHostname, getPublicStore, getPublicStoreFromHeaders };
|
|
46
58
|
//# sourceMappingURL=server-nextjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/frameworks/nextjs/actions/getHostName.ts","../../src/react/frameworks/nextjs/actions/getPublicStore.ts"],"names":["headers"],"mappings":";;;;;;;;;;;AASA,eAAsB,WAAA,GAAsC;AAC1D,EAAA,MAAM,UAAA,GAAa,MAAM,OAAA,EAAQ;AACjC,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,OAAO,yBAAyB,UAAU,CAAA;AAC5C;ACKA,IAAM,kCAAA,GAAqC,KAAA;AAAA,EACzC,CACE,IAAA,EACA,MAAA,KAEA,wBAAA,CAAyB;AAAA,IACvB,IAAA;AAAA,IACA,QAAQ,MAAA,IAAU;AAAA,GACnB;AACL,CAAA;AAEA,SAAS,wBAAwB,MAAA,EAA8C;AAC7E,EAAA,gBAAA,CAAiB,MAAA,CAAO,IAAA,EAAM,KAAA,CAAM,EAAA,IAAM,IAAI,CAAA;AAC9C,EAAA,OAAO,MAAA;AACT;AAUA,eAAsB,eACpB,OAAA,EAC4B;AAC5B,EAAA,MAAM,UAAA,GAAa,MAAMA,OAAAA,EAAQ;AACjC,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,MAAM,SAAS,MAAM,kCAAA;AAAA,IACnB,UAAA,CAAW,IAAI,MAAM,CAAA;AAAA,IACrB,SAAS,MAAA,IAAU;AAAA,GACrB;AACA,EAAA,OAAO,wBAAwB,MAAM,CAAA;AACvC;AAKA,eAAsB,yBAAA,CACpB,YACA,OAAA,EAC4B;AAC5B,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,MAAM,SAAS,MAAM,kCAAA;AAAA,IACnB,UAAA,CAAW,IAAI,MAAM,CAAA;AAAA,IACrB,SAAS,MAAA,IAAU;AAAA,GACrB;AACA,EAAA,OAAO,wBAAwB,MAAM,CAAA;AACvC","file":"server-nextjs.js","sourcesContent":["import { headers } from \"next/headers\";\nimport {\n applyServerRequestOriginFromHeaders,\n normalizeRequestHostname,\n} from \"../../../../core/server/request-origin\";\n\n/**\n * Devuelve el host completo de la request (ej. \"plata950.ecomiq.pe\", \"localhost:3000\").\n */\nexport async function getHostname(): Promise<string | null> {\n const headerList = await headers();\n applyServerRequestOriginFromHeaders(headerList);\n return normalizeRequestHostname(headerList);\n}\n","import { cache } from \"react\";\nimport { headers } from \"next/headers\";\nimport {\n applyServerRequestOriginFromHeaders,\n} from \"../../../../core/server/request-origin\";\nimport { setServerStoreId } from \"../../../../core/client/store-api-client\";\nimport {\n fetchPublicStoreSettings,\n type FetchPublicStoreSettingsOptions,\n type PublicStoreResult,\n type PublicStoreSettingsSource,\n} from \"../../../../core/server/fetch-public-store\";\n\ntype GetPublicStoreOptions = {\n /** Si se omite, se usa `resolvePublicStoreSettingsSource()` (variable de entorno). */\n source?: PublicStoreSettingsSource;\n};\n\nconst fetchPublicStoreSettingsForRequest = cache(\n (\n host: string | null,\n source: PublicStoreSettingsSource | null,\n ): Promise<PublicStoreResult> =>\n fetchPublicStoreSettings({\n host,\n source: source ?? undefined,\n }),\n);\n\nfunction applyPublicStoreRuntime(result: PublicStoreResult): PublicStoreResult {\n setServerStoreId(result.data?.store.id ?? null);\n return result;\n}\n\n/**\n * Obtiene la tienda pública (Next.js App Router).\n * Usa `headers()` para resolver host y origen del proxy.\n *\n * Identificador de tienda:\n * 1. `slugStore` en `ecomiq.config.js` si existe (opcional, útil en localhost).\n * 2. Si no hay config, deriva del header `Host`.\n */\nexport async function getPublicStore(\n options?: GetPublicStoreOptions,\n): Promise<PublicStoreResult> {\n const headerList = await headers();\n applyServerRequestOriginFromHeaders(headerList);\n const result = await fetchPublicStoreSettingsForRequest(\n headerList.get(\"host\"),\n options?.source ?? null,\n );\n return applyPublicStoreRuntime(result);\n}\n\n/**\n * Igual que `getPublicStore` pero con headers explícitos (tests, middleware custom).\n */\nexport async function getPublicStoreFromHeaders(\n headerList: { get(name: string): string | null },\n options?: Omit<FetchPublicStoreSettingsOptions, \"host\">,\n): Promise<PublicStoreResult> {\n applyServerRequestOriginFromHeaders(headerList);\n const result = await fetchPublicStoreSettingsForRequest(\n headerList.get(\"host\"),\n options?.source ?? null,\n );\n return applyPublicStoreRuntime(result);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/react/frameworks/nextjs/actions/getHostName.ts","../../src/react/frameworks/nextjs/actions/getPublicStore.ts","../../src/react/frameworks/nextjs/actions/getProductBySlug.ts"],"names":["headers","cache"],"mappings":";;;;;;;;;;;AASA,eAAsB,WAAA,GAAsC;AAC1D,EAAA,MAAM,UAAA,GAAa,MAAM,OAAA,EAAQ;AACjC,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,OAAO,yBAAyB,UAAU,CAAA;AAC5C;ACKA,IAAM,kCAAA,GAAqC,KAAA;AAAA,EACzC,CACE,IAAA,EACA,MAAA,KAEA,wBAAA,CAAyB;AAAA,IACvB,IAAA;AAAA,IACA,QAAQ,MAAA,IAAU;AAAA,GACnB;AACL,CAAA;AAEA,SAAS,wBAAwB,MAAA,EAA8C;AAC7E,EAAA,gBAAA,CAAiB,MAAA,CAAO,IAAA,EAAM,KAAA,CAAM,EAAA,IAAM,IAAI,CAAA;AAC9C,EAAA,OAAO,MAAA;AACT;AAUA,eAAsB,eACpB,OAAA,EAC4B;AAC5B,EAAA,MAAM,UAAA,GAAa,MAAMA,OAAAA,EAAQ;AACjC,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,MAAM,SAAS,MAAM,kCAAA;AAAA,IACnB,UAAA,CAAW,IAAI,MAAM,CAAA;AAAA,IACrB,SAAS,MAAA,IAAU;AAAA,GACrB;AACA,EAAA,OAAO,wBAAwB,MAAM,CAAA;AACvC;AAKA,eAAsB,yBAAA,CACpB,YACA,OAAA,EAC4B;AAC5B,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,MAAM,SAAS,MAAM,kCAAA;AAAA,IACnB,UAAA,CAAW,IAAI,MAAM,CAAA;AAAA,IACrB,SAAS,MAAA,IAAU;AAAA,GACrB;AACA,EAAA,OAAO,wBAAwB,MAAM,CAAA;AACvC;ACrDsCC,KAAAA;AAAA,EACpC,OAAO,IAAA,KAA0D;AAC/D,IAAA,IAAI;AACF,MAAA,MAAM,cAAA,EAAe;AACrB,MAAA,OAAO,MAAM,2BAA2B,IAAA,EAAM;AAAA,QAC5C,QAAA,EAAU,sBAAsB,IAAI,CAAA;AAAA,OACrC,CAAA;AAAA,IACH,CAAA,CAAA,MAAQ;AACN,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF;AACF","file":"server-nextjs.js","sourcesContent":["import { headers } from \"next/headers\";\nimport {\n applyServerRequestOriginFromHeaders,\n normalizeRequestHostname,\n} from \"../../../../core/server/request-origin\";\n\n/**\n * Devuelve el host completo de la request (ej. \"plata950.ecomiq.pe\", \"localhost:3000\").\n */\nexport async function getHostname(): Promise<string | null> {\n const headerList = await headers();\n applyServerRequestOriginFromHeaders(headerList);\n return normalizeRequestHostname(headerList);\n}\n","import { cache } from \"react\";\nimport { headers } from \"next/headers\";\nimport {\n applyServerRequestOriginFromHeaders,\n} from \"../../../../core/server/request-origin\";\nimport { setServerStoreId } from \"../../../../core/client/store-api-client\";\nimport {\n fetchPublicStoreSettings,\n type FetchPublicStoreSettingsOptions,\n type PublicStoreResult,\n type PublicStoreSettingsSource,\n} from \"../../../../core/server/fetch-public-store\";\n\ntype GetPublicStoreOptions = {\n /** Si se omite, se usa `resolvePublicStoreSettingsSource()` (variable de entorno). */\n source?: PublicStoreSettingsSource;\n};\n\nconst fetchPublicStoreSettingsForRequest = cache(\n (\n host: string | null,\n source: PublicStoreSettingsSource | null,\n ): Promise<PublicStoreResult> =>\n fetchPublicStoreSettings({\n host,\n source: source ?? undefined,\n }),\n);\n\nfunction applyPublicStoreRuntime(result: PublicStoreResult): PublicStoreResult {\n setServerStoreId(result.data?.store.id ?? null);\n return result;\n}\n\n/**\n * Obtiene la tienda pública (Next.js App Router).\n * Usa `headers()` para resolver host y origen del proxy.\n *\n * Identificador de tienda:\n * 1. `slugStore` en `ecomiq.config.js` si existe (opcional, útil en localhost).\n * 2. Si no hay config, deriva del header `Host`.\n */\nexport async function getPublicStore(\n options?: GetPublicStoreOptions,\n): Promise<PublicStoreResult> {\n const headerList = await headers();\n applyServerRequestOriginFromHeaders(headerList);\n const result = await fetchPublicStoreSettingsForRequest(\n headerList.get(\"host\"),\n options?.source ?? null,\n );\n return applyPublicStoreRuntime(result);\n}\n\n/**\n * Igual que `getPublicStore` pero con headers explícitos (tests, middleware custom).\n */\nexport async function getPublicStoreFromHeaders(\n headerList: { get(name: string): string | null },\n options?: Omit<FetchPublicStoreSettingsOptions, \"host\">,\n): Promise<PublicStoreResult> {\n applyServerRequestOriginFromHeaders(headerList);\n const result = await fetchPublicStoreSettingsForRequest(\n headerList.get(\"host\"),\n options?.source ?? null,\n );\n return applyPublicStoreRuntime(result);\n}\n","import { cache } from \"react\";\nimport { getPublicStore } from \"./getPublicStore\";\nimport { getStorefrontProductBySlug } from \"../../../../core/client/store-api-product.service\";\nimport type { StorefrontProductDetail } from \"../../../../core/models/product\";\n\n/**\n * Producto por slug con dedup por request (`React.cache`) y caché ISR por tag.\n * Evita el doble fetch generateMetadata + page en la misma request.\n *\n * Resuelve `getPublicStore()` antes del fetch porque el proxy exige\n * `X-Store-Id` y en App Router layouts/metadata/page corren en paralelo\n * (no se puede asumir que otro componente ya lo seteó). Con `React.cache`\n * la llamada extra se dedupe a costo cero.\n */\nexport const getCachedProductBySlug = cache(\n async (slug: string): Promise<StorefrontProductDetail | null> => {\n try {\n await getPublicStore();\n return await getStorefrontProductBySlug(slug, {\n cacheKey: `storefront-product-${slug}`,\n });\n } catch {\n return null;\n }\n },\n);\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as PublicStoreSettingsSource, a as PublicStoreResult, F as FetchPublicStoreSettingsOptions } from '../ecomiq-oauth-password-plugin-
|
|
2
|
-
export { C as CustomerAddress, b as CustomerAddressSchema, c as CustomerAddressUpsert, d as CustomerAddressUpsertSchema, e as CustomerMe, f as CustomerMeSchema, g as CustomerOrderDetail, g as CustomerOrderDetailDto, h as CustomerOrderDetailSchema, i as CustomerOrderListItem, i as CustomerOrderListItemDto, j as CustomerOrderListItemSchema, k as CustomerProfilePatch, l as CustomerProfilePatchSchema, m as CustomerRegisterRequest, n as CustomerRegisterRequestSchema, E as ECOMIQ_CLIENTS_STORE_KV_BINDING, S as StoreApiClient, o as StoreApiGetOptions, p as addCartCoupon, q as applyServerRequestOriginFromHeaders, r as buildStorefrontKvSnapshotKey, s as buildStorefrontKvSnapshotKeyFromStoreKey, t as checkoutCart, u as createCart, v as createCustomerAddress, w as createStoreApiClient, x as customerMeToProfilePatch, y as deleteCustomerAddress, z as ecomiqOAuthPassword, A as fetchPublicStoreSettings, B as getCart, D as getCartCheckout, G as getCartPaymentMethods, H as getCustomerAddresses, I as getCustomerMe, J as getCustomerOrder, K as getCustomerOrders, L as getSharedOrderDraft, M as getShippingOptions, N as getStoreApiBaseUrl, O as getStoreApiClient, Q as getStorefrontCollectionBySlug, R as getStorefrontCollections, T as getStorefrontPageBySlug, U as getStorefrontPagePreview, V as getStorefrontPages, W as getStorefrontProductBySlug, X as getStorefrontProducts, Y as getStorefrontSettings, Z as getStorefrontSettingsFromKv, _ as getStorefrontSettingsFromKvByStoreKey, $ as isCartNotActiveApiError, a0 as normalizeStoreHost, a1 as patchCartAddresses, a2 as patchCartBuyer, a3 as patchCustomer, a4 as putCartShippingMethod, a5 as registerCustomer, a6 as removeCartCoupon, a7 as resolvePublicStoreSettingsSource, a8 as resolveStorefrontSettingsHost, a9 as setClientStoreId, aa as setServerRequestOrigin, ab as setServerStoreId, ac as storeApiClient, ad as updateCustomerAddress, ae as uploadPaymentReceipt } from '../ecomiq-oauth-password-plugin-
|
|
1
|
+
import { P as PublicStoreSettingsSource, a as PublicStoreResult, F as FetchPublicStoreSettingsOptions } from '../ecomiq-oauth-password-plugin-B_gMdGuc.js';
|
|
2
|
+
export { C as CustomerAddress, b as CustomerAddressSchema, c as CustomerAddressUpsert, d as CustomerAddressUpsertSchema, e as CustomerMe, f as CustomerMeSchema, g as CustomerOrderDetail, g as CustomerOrderDetailDto, h as CustomerOrderDetailSchema, i as CustomerOrderListItem, i as CustomerOrderListItemDto, j as CustomerOrderListItemSchema, k as CustomerProfilePatch, l as CustomerProfilePatchSchema, m as CustomerRegisterRequest, n as CustomerRegisterRequestSchema, E as ECOMIQ_CLIENTS_STORE_KV_BINDING, S as StoreApiClient, o as StoreApiGetOptions, p as addCartCoupon, q as applyServerRequestOriginFromHeaders, r as buildStorefrontKvSnapshotKey, s as buildStorefrontKvSnapshotKeyFromStoreKey, t as checkoutCart, u as createCart, v as createCustomerAddress, w as createStoreApiClient, x as customerMeToProfilePatch, y as deleteCustomerAddress, z as ecomiqOAuthPassword, A as fetchPublicStoreSettings, B as getCart, D as getCartCheckout, G as getCartPaymentMethods, H as getCustomerAddresses, I as getCustomerMe, J as getCustomerOrder, K as getCustomerOrders, L as getSharedOrderDraft, M as getShippingOptions, N as getStoreApiBaseUrl, O as getStoreApiClient, Q as getStorefrontCollectionBySlug, R as getStorefrontCollections, T as getStorefrontPageBySlug, U as getStorefrontPagePreview, V as getStorefrontPages, W as getStorefrontProductBySlug, X as getStorefrontProducts, Y as getStorefrontSettings, Z as getStorefrontSettingsFromKv, _ as getStorefrontSettingsFromKvByStoreKey, $ as isCartNotActiveApiError, a0 as normalizeStoreHost, a1 as patchCartAddresses, a2 as patchCartBuyer, a3 as patchCustomer, a4 as putCartShippingMethod, a5 as registerCustomer, a6 as removeCartCoupon, a7 as resolvePublicStoreSettingsSource, a8 as resolveStorefrontSettingsHost, a9 as setClientStoreId, aa as setServerRequestOrigin, ab as setServerStoreId, ac as storeApiClient, ad as updateCustomerAddress, ae as uploadPaymentReceipt } from '../ecomiq-oauth-password-plugin-B_gMdGuc.js';
|
|
3
3
|
export { S as StoreProxyHandlerConfig, h as handleStoreProxyRequest } from '../store-proxy-handler-CNzKlTFA.js';
|
|
4
|
-
import '../collection-
|
|
4
|
+
import '../collection-DU7gREXS.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'better-auth';
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { applyServerRequestOriginFromHeaders, normalizeRequestHostname, fetchPublicStoreSettings } from '../chunk-
|
|
2
|
-
export { CustomerAddressSchema, CustomerAddressUpsertSchema, CustomerMeSchema, CustomerOrderDetailSchema, CustomerOrderListItemSchema, CustomerProfilePatchSchema, CustomerRegisterRequestSchema, StoreApiClient, addCartCoupon, applyServerRequestOriginFromHeaders, checkoutCart, createCart, createCustomerAddress, createStoreApiClient, customerMeToProfilePatch, deleteCustomerAddress, ecomiqOAuthPassword, fetchPublicStoreSettings, getCart, getCartCheckout, getCartPaymentMethods, getCustomerAddresses, getCustomerMe, getCustomerOrder, getCustomerOrders, getSharedOrderDraft, getShippingOptions, getStoreApiBaseUrl, getStoreApiClient, getStorefrontCollectionBySlug, getStorefrontCollections, getStorefrontPageBySlug, getStorefrontPagePreview, getStorefrontPages, getStorefrontProductBySlug, getStorefrontProducts, getStorefrontSettings, isCartNotActiveApiError, patchCartAddresses, patchCartBuyer, patchCustomer, putCartShippingMethod, registerCustomer, removeCartCoupon, resolvePublicStoreSettingsSource, setClientStoreId, setServerRequestOrigin, setServerStoreId, storeApiClient, updateCustomerAddress, uploadPaymentReceipt } from '../chunk-
|
|
3
|
-
export { ECOMIQ_CLIENTS_STORE_KV_BINDING, buildStorefrontKvSnapshotKey, buildStorefrontKvSnapshotKeyFromStoreKey, getStorefrontSettingsFromKv, getStorefrontSettingsFromKvByStoreKey, normalizeStoreHost, resolveStorefrontSettingsHost } from '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
import { applyServerRequestOriginFromHeaders, normalizeRequestHostname, fetchPublicStoreSettings, setServerStoreId } from '../chunk-EFEVJJWF.js';
|
|
2
|
+
export { CustomerAddressSchema, CustomerAddressUpsertSchema, CustomerMeSchema, CustomerOrderDetailSchema, CustomerOrderListItemSchema, CustomerProfilePatchSchema, CustomerRegisterRequestSchema, StoreApiClient, addCartCoupon, applyServerRequestOriginFromHeaders, checkoutCart, createCart, createCustomerAddress, createStoreApiClient, customerMeToProfilePatch, deleteCustomerAddress, ecomiqOAuthPassword, fetchPublicStoreSettings, getCart, getCartCheckout, getCartPaymentMethods, getCustomerAddresses, getCustomerMe, getCustomerOrder, getCustomerOrders, getSharedOrderDraft, getShippingOptions, getStoreApiBaseUrl, getStoreApiClient, getStorefrontCollectionBySlug, getStorefrontCollections, getStorefrontPageBySlug, getStorefrontPagePreview, getStorefrontPages, getStorefrontProductBySlug, getStorefrontProducts, getStorefrontSettings, isCartNotActiveApiError, patchCartAddresses, patchCartBuyer, patchCustomer, putCartShippingMethod, registerCustomer, removeCartCoupon, resolvePublicStoreSettingsSource, setClientStoreId, setServerRequestOrigin, setServerStoreId, storeApiClient, updateCustomerAddress, uploadPaymentReceipt } from '../chunk-EFEVJJWF.js';
|
|
3
|
+
export { ECOMIQ_CLIENTS_STORE_KV_BINDING, buildStorefrontKvSnapshotKey, buildStorefrontKvSnapshotKeyFromStoreKey, getStorefrontSettingsFromKv, getStorefrontSettingsFromKvByStoreKey, normalizeStoreHost, resolveStorefrontSettingsHost } from '../chunk-NAJQB5DN.js';
|
|
4
|
+
import '../chunk-OABDGTBI.js';
|
|
5
5
|
import '../chunk-64GLOWMJ.js';
|
|
6
|
-
export { handleStoreProxyRequest } from '../chunk-
|
|
6
|
+
export { handleStoreProxyRequest } from '../chunk-AKD5IDEB.js';
|
|
7
7
|
import '../chunk-S7CPZ4UE.js';
|
|
8
8
|
import '../chunk-Q4U5OEUT.js';
|
|
9
9
|
import { getRequestHeaders } from '@tanstack/react-start/server';
|
|
@@ -13,20 +13,26 @@ async function getHostname() {
|
|
|
13
13
|
applyServerRequestOriginFromHeaders(headerList);
|
|
14
14
|
return normalizeRequestHostname(headerList);
|
|
15
15
|
}
|
|
16
|
+
function applyPublicStoreRuntime(result) {
|
|
17
|
+
setServerStoreId(result.data?.store.id ?? null);
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
16
20
|
async function getPublicStore(options) {
|
|
17
21
|
const headerList = getRequestHeaders();
|
|
18
22
|
applyServerRequestOriginFromHeaders(headerList);
|
|
19
|
-
|
|
23
|
+
const result = await fetchPublicStoreSettings({
|
|
20
24
|
host: headerList.get("host"),
|
|
21
25
|
source: options?.source
|
|
22
26
|
});
|
|
27
|
+
return applyPublicStoreRuntime(result);
|
|
23
28
|
}
|
|
24
29
|
async function getPublicStoreFromHeaders(headerList, options) {
|
|
25
30
|
applyServerRequestOriginFromHeaders(headerList);
|
|
26
|
-
|
|
31
|
+
const result = await fetchPublicStoreSettings({
|
|
27
32
|
host: headerList.get("host"),
|
|
28
33
|
...options
|
|
29
34
|
});
|
|
35
|
+
return applyPublicStoreRuntime(result);
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
export { getHostname, getPublicStore, getPublicStoreFromHeaders };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/frameworks/tanstack/actions/getHostname.ts","../../src/react/frameworks/tanstack/actions/getPublicStore.ts"],"names":["getRequestHeaders"],"mappings":";;;;;;;;;;AAMA,eAAsB,WAAA,GAAsC;AAC1D,EAAA,MAAM,aAAa,iBAAA,EAAkB;AACrC,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,OAAO,yBAAyB,UAAU,CAAA;AAC5C;
|
|
1
|
+
{"version":3,"sources":["../../src/react/frameworks/tanstack/actions/getHostname.ts","../../src/react/frameworks/tanstack/actions/getPublicStore.ts"],"names":["getRequestHeaders"],"mappings":";;;;;;;;;;AAMA,eAAsB,WAAA,GAAsC;AAC1D,EAAA,MAAM,aAAa,iBAAA,EAAkB;AACrC,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,OAAO,yBAAyB,UAAU,CAAA;AAC5C;ACOA,SAAS,wBAAwB,MAAA,EAA8C;AAC7E,EAAA,gBAAA,CAAiB,MAAA,CAAO,IAAA,EAAM,KAAA,CAAM,EAAA,IAAM,IAAI,CAAA;AAC9C,EAAA,OAAO,MAAA;AACT;AAMA,eAAsB,eACpB,OAAA,EAC4B;AAC5B,EAAA,MAAM,aAAaA,iBAAAA,EAAkB;AACrC,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,MAAM,MAAA,GAAS,MAAM,wBAAA,CAAyB;AAAA,IAC5C,IAAA,EAAM,UAAA,CAAW,GAAA,CAAI,MAAM,CAAA;AAAA,IAC3B,QAAQ,OAAA,EAAS;AAAA,GAClB,CAAA;AACD,EAAA,OAAO,wBAAwB,MAAM,CAAA;AACvC;AAEA,eAAsB,yBAAA,CACpB,YACA,OAAA,EAC4B;AAC5B,EAAA,mCAAA,CAAoC,UAAU,CAAA;AAC9C,EAAA,MAAM,MAAA,GAAS,MAAM,wBAAA,CAAyB;AAAA,IAC5C,IAAA,EAAM,UAAA,CAAW,GAAA,CAAI,MAAM,CAAA;AAAA,IAC3B,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,OAAO,wBAAwB,MAAM,CAAA;AACvC","file":"server-tanstack.js","sourcesContent":["import { getRequestHeaders } from \"@tanstack/react-start/server\";\nimport {\n applyServerRequestOriginFromHeaders,\n normalizeRequestHostname,\n} from \"../../../../core/server/request-origin\";\n\nexport async function getHostname(): Promise<string | null> {\n const headerList = getRequestHeaders();\n applyServerRequestOriginFromHeaders(headerList);\n return normalizeRequestHostname(headerList);\n}\n","import { getRequestHeaders } from \"@tanstack/react-start/server\";\nimport {\n applyServerRequestOriginFromHeaders,\n} from \"../../../../core/server/request-origin\";\nimport { setServerStoreId } from \"../../../../core/client/store-api-client\";\nimport {\n fetchPublicStoreSettings,\n type FetchPublicStoreSettingsOptions,\n type PublicStoreResult,\n type PublicStoreSettingsSource,\n} from \"../../../../core/server/fetch-public-store\";\n\ntype GetPublicStoreOptions = {\n source?: PublicStoreSettingsSource;\n};\n\n/** Setea el `X-Store-Id` que el proxy `/api/store` exige en las subrequests SSR. */\nfunction applyPublicStoreRuntime(result: PublicStoreResult): PublicStoreResult {\n setServerStoreId(result.data?.store.id ?? null);\n return result;\n}\n\n/**\n * Obtiene la tienda pública en TanStack Start (server function, loader o server route).\n * Usa `getRequestHeaders()` del contexto de request activo.\n */\nexport async function getPublicStore(\n options?: GetPublicStoreOptions,\n): Promise<PublicStoreResult> {\n const headerList = getRequestHeaders();\n applyServerRequestOriginFromHeaders(headerList);\n const result = await fetchPublicStoreSettings({\n host: headerList.get(\"host\"),\n source: options?.source,\n });\n return applyPublicStoreRuntime(result);\n}\n\nexport async function getPublicStoreFromHeaders(\n headerList: { get(name: string): string | null },\n options?: Omit<FetchPublicStoreSettingsOptions, \"host\">,\n): Promise<PublicStoreResult> {\n applyServerRequestOriginFromHeaders(headerList);\n const result = await fetchPublicStoreSettings({\n host: headerList.get(\"host\"),\n ...options,\n });\n return applyPublicStoreRuntime(result);\n}\n"]}
|
|
@@ -3313,6 +3313,75 @@ declare const StorefrontProductSchema: z.ZodObject<{
|
|
|
3313
3313
|
bundleItemsCount?: number | undefined;
|
|
3314
3314
|
brand?: string | null | undefined;
|
|
3315
3315
|
}>;
|
|
3316
|
+
declare const StorefrontFacetSchema: z.ZodObject<{
|
|
3317
|
+
value: z.ZodString;
|
|
3318
|
+
count: z.ZodNumber;
|
|
3319
|
+
label: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
3320
|
+
selected: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
3321
|
+
}, "strip", z.ZodTypeAny, {
|
|
3322
|
+
value: string;
|
|
3323
|
+
count: number;
|
|
3324
|
+
selected: boolean;
|
|
3325
|
+
label?: string | null | undefined;
|
|
3326
|
+
}, {
|
|
3327
|
+
value: string;
|
|
3328
|
+
count: number;
|
|
3329
|
+
label?: string | null | undefined;
|
|
3330
|
+
selected?: boolean | undefined;
|
|
3331
|
+
}>;
|
|
3332
|
+
declare const StorefrontSearchFilterSchema: z.ZodObject<{
|
|
3333
|
+
id: z.ZodString;
|
|
3334
|
+
label: z.ZodString;
|
|
3335
|
+
type: z.ZodString;
|
|
3336
|
+
values: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3337
|
+
value: z.ZodString;
|
|
3338
|
+
count: z.ZodNumber;
|
|
3339
|
+
label: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
3340
|
+
selected: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
3341
|
+
}, "strip", z.ZodTypeAny, {
|
|
3342
|
+
value: string;
|
|
3343
|
+
count: number;
|
|
3344
|
+
selected: boolean;
|
|
3345
|
+
label?: string | null | undefined;
|
|
3346
|
+
}, {
|
|
3347
|
+
value: string;
|
|
3348
|
+
count: number;
|
|
3349
|
+
label?: string | null | undefined;
|
|
3350
|
+
selected?: boolean | undefined;
|
|
3351
|
+
}>, "many">>>;
|
|
3352
|
+
min: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3353
|
+
max: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3354
|
+
selectedMin: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3355
|
+
selectedMax: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3356
|
+
}, "strip", z.ZodTypeAny, {
|
|
3357
|
+
values: {
|
|
3358
|
+
value: string;
|
|
3359
|
+
count: number;
|
|
3360
|
+
selected: boolean;
|
|
3361
|
+
label?: string | null | undefined;
|
|
3362
|
+
}[];
|
|
3363
|
+
type: string;
|
|
3364
|
+
id: string;
|
|
3365
|
+
label: string;
|
|
3366
|
+
min?: number | null | undefined;
|
|
3367
|
+
max?: number | null | undefined;
|
|
3368
|
+
selectedMin?: number | null | undefined;
|
|
3369
|
+
selectedMax?: number | null | undefined;
|
|
3370
|
+
}, {
|
|
3371
|
+
type: string;
|
|
3372
|
+
id: string;
|
|
3373
|
+
label: string;
|
|
3374
|
+
values?: {
|
|
3375
|
+
value: string;
|
|
3376
|
+
count: number;
|
|
3377
|
+
label?: string | null | undefined;
|
|
3378
|
+
selected?: boolean | undefined;
|
|
3379
|
+
}[] | undefined;
|
|
3380
|
+
min?: number | null | undefined;
|
|
3381
|
+
max?: number | null | undefined;
|
|
3382
|
+
selectedMin?: number | null | undefined;
|
|
3383
|
+
selectedMax?: number | null | undefined;
|
|
3384
|
+
}>;
|
|
3316
3385
|
declare const StorefrontProductsResponseSchema: z.ZodObject<{
|
|
3317
3386
|
pageIndex: z.ZodNumber;
|
|
3318
3387
|
pageSize: z.ZodNumber;
|
|
@@ -3367,33 +3436,60 @@ declare const StorefrontProductsResponseSchema: z.ZodObject<{
|
|
|
3367
3436
|
bundleItemsCount?: number | undefined;
|
|
3368
3437
|
brand?: string | null | undefined;
|
|
3369
3438
|
}>, "many">;
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3439
|
+
filters: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3440
|
+
id: z.ZodString;
|
|
3441
|
+
label: z.ZodString;
|
|
3442
|
+
type: z.ZodString;
|
|
3443
|
+
values: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3444
|
+
value: z.ZodString;
|
|
3445
|
+
count: z.ZodNumber;
|
|
3446
|
+
label: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
3447
|
+
selected: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
3448
|
+
}, "strip", z.ZodTypeAny, {
|
|
3449
|
+
value: string;
|
|
3450
|
+
count: number;
|
|
3451
|
+
selected: boolean;
|
|
3452
|
+
label?: string | null | undefined;
|
|
3453
|
+
}, {
|
|
3454
|
+
value: string;
|
|
3455
|
+
count: number;
|
|
3456
|
+
label?: string | null | undefined;
|
|
3457
|
+
selected?: boolean | undefined;
|
|
3458
|
+
}>, "many">>>;
|
|
3459
|
+
min: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3460
|
+
max: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3461
|
+
selectedMin: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3462
|
+
selectedMax: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3383
3463
|
}, "strip", z.ZodTypeAny, {
|
|
3384
|
-
|
|
3385
|
-
|
|
3464
|
+
values: {
|
|
3465
|
+
value: string;
|
|
3466
|
+
count: number;
|
|
3467
|
+
selected: boolean;
|
|
3468
|
+
label?: string | null | undefined;
|
|
3469
|
+
}[];
|
|
3470
|
+
type: string;
|
|
3471
|
+
id: string;
|
|
3472
|
+
label: string;
|
|
3473
|
+
min?: number | null | undefined;
|
|
3474
|
+
max?: number | null | undefined;
|
|
3475
|
+
selectedMin?: number | null | undefined;
|
|
3476
|
+
selectedMax?: number | null | undefined;
|
|
3386
3477
|
}, {
|
|
3387
|
-
|
|
3388
|
-
|
|
3478
|
+
type: string;
|
|
3479
|
+
id: string;
|
|
3480
|
+
label: string;
|
|
3481
|
+
values?: {
|
|
3482
|
+
value: string;
|
|
3483
|
+
count: number;
|
|
3484
|
+
label?: string | null | undefined;
|
|
3485
|
+
selected?: boolean | undefined;
|
|
3486
|
+
}[] | undefined;
|
|
3487
|
+
min?: number | null | undefined;
|
|
3488
|
+
max?: number | null | undefined;
|
|
3489
|
+
selectedMin?: number | null | undefined;
|
|
3490
|
+
selectedMax?: number | null | undefined;
|
|
3389
3491
|
}>, "many">>>;
|
|
3390
|
-
minPrice: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3391
|
-
maxPrice: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3392
3492
|
}, "strip", z.ZodTypeAny, {
|
|
3393
|
-
categories: {
|
|
3394
|
-
value: string;
|
|
3395
|
-
count: number;
|
|
3396
|
-
}[];
|
|
3397
3493
|
pageSize: number;
|
|
3398
3494
|
pageIndex: number;
|
|
3399
3495
|
totalCount: number;
|
|
@@ -3415,12 +3511,21 @@ declare const StorefrontProductsResponseSchema: z.ZodObject<{
|
|
|
3415
3511
|
compareAtPrice?: number | null | undefined;
|
|
3416
3512
|
brand?: string | null | undefined;
|
|
3417
3513
|
}[];
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3514
|
+
filters: {
|
|
3515
|
+
values: {
|
|
3516
|
+
value: string;
|
|
3517
|
+
count: number;
|
|
3518
|
+
selected: boolean;
|
|
3519
|
+
label?: string | null | undefined;
|
|
3520
|
+
}[];
|
|
3521
|
+
type: string;
|
|
3522
|
+
id: string;
|
|
3523
|
+
label: string;
|
|
3524
|
+
min?: number | null | undefined;
|
|
3525
|
+
max?: number | null | undefined;
|
|
3526
|
+
selectedMin?: number | null | undefined;
|
|
3527
|
+
selectedMax?: number | null | undefined;
|
|
3421
3528
|
}[];
|
|
3422
|
-
minPrice?: number | null | undefined;
|
|
3423
|
-
maxPrice?: number | null | undefined;
|
|
3424
3529
|
}, {
|
|
3425
3530
|
pageSize: number;
|
|
3426
3531
|
pageIndex: number;
|
|
@@ -3443,15 +3548,20 @@ declare const StorefrontProductsResponseSchema: z.ZodObject<{
|
|
|
3443
3548
|
bundleItemsCount?: number | undefined;
|
|
3444
3549
|
brand?: string | null | undefined;
|
|
3445
3550
|
}[];
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3551
|
+
filters?: {
|
|
3552
|
+
type: string;
|
|
3553
|
+
id: string;
|
|
3554
|
+
label: string;
|
|
3555
|
+
values?: {
|
|
3556
|
+
value: string;
|
|
3557
|
+
count: number;
|
|
3558
|
+
label?: string | null | undefined;
|
|
3559
|
+
selected?: boolean | undefined;
|
|
3560
|
+
}[] | undefined;
|
|
3561
|
+
min?: number | null | undefined;
|
|
3562
|
+
max?: number | null | undefined;
|
|
3563
|
+
selectedMin?: number | null | undefined;
|
|
3564
|
+
selectedMax?: number | null | undefined;
|
|
3455
3565
|
}[] | undefined;
|
|
3456
3566
|
}>;
|
|
3457
3567
|
declare const StorefrontProductsParamsSchema: z.ZodObject<{
|
|
@@ -3461,9 +3571,17 @@ declare const StorefrontProductsParamsSchema: z.ZodObject<{
|
|
|
3461
3571
|
sellerId: z.ZodOptional<z.ZodString>;
|
|
3462
3572
|
search: z.ZodOptional<z.ZodString>;
|
|
3463
3573
|
collection: z.ZodOptional<z.ZodString>;
|
|
3574
|
+
collections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3464
3575
|
category: z.ZodOptional<z.ZodString>;
|
|
3576
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3465
3577
|
brand: z.ZodOptional<z.ZodString>;
|
|
3578
|
+
brands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3466
3579
|
productType: z.ZodOptional<z.ZodString>;
|
|
3580
|
+
productTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3581
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
3582
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3583
|
+
filters: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3584
|
+
locationId: z.ZodOptional<z.ZodString>;
|
|
3467
3585
|
inStock: z.ZodOptional<z.ZodBoolean>;
|
|
3468
3586
|
minPrice: z.ZodOptional<z.ZodNumber>;
|
|
3469
3587
|
maxPrice: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3472,6 +3590,8 @@ declare const StorefrontProductsParamsSchema: z.ZodObject<{
|
|
|
3472
3590
|
page: number;
|
|
3473
3591
|
pageSize: number;
|
|
3474
3592
|
sellerId?: string | undefined;
|
|
3593
|
+
categories?: string[] | undefined;
|
|
3594
|
+
tags?: string[] | undefined;
|
|
3475
3595
|
inStock?: boolean | undefined;
|
|
3476
3596
|
category?: string | undefined;
|
|
3477
3597
|
search?: string | undefined;
|
|
@@ -3479,10 +3599,18 @@ declare const StorefrontProductsParamsSchema: z.ZodObject<{
|
|
|
3479
3599
|
maxPrice?: number | undefined;
|
|
3480
3600
|
productType?: string | undefined;
|
|
3481
3601
|
brand?: string | undefined;
|
|
3602
|
+
filters?: string[] | undefined;
|
|
3482
3603
|
collection?: string | undefined;
|
|
3604
|
+
collections?: string[] | undefined;
|
|
3605
|
+
brands?: string[] | undefined;
|
|
3606
|
+
productTypes?: string[] | undefined;
|
|
3607
|
+
tag?: string | undefined;
|
|
3608
|
+
locationId?: string | undefined;
|
|
3483
3609
|
}, {
|
|
3484
3610
|
sort?: "price_asc" | "price_desc" | "name_asc" | "name_desc" | "newest" | undefined;
|
|
3485
3611
|
sellerId?: string | undefined;
|
|
3612
|
+
categories?: string[] | undefined;
|
|
3613
|
+
tags?: string[] | undefined;
|
|
3486
3614
|
inStock?: boolean | undefined;
|
|
3487
3615
|
page?: number | undefined;
|
|
3488
3616
|
pageSize?: number | undefined;
|
|
@@ -3492,7 +3620,13 @@ declare const StorefrontProductsParamsSchema: z.ZodObject<{
|
|
|
3492
3620
|
maxPrice?: number | undefined;
|
|
3493
3621
|
productType?: string | undefined;
|
|
3494
3622
|
brand?: string | undefined;
|
|
3623
|
+
filters?: string[] | undefined;
|
|
3495
3624
|
collection?: string | undefined;
|
|
3625
|
+
collections?: string[] | undefined;
|
|
3626
|
+
brands?: string[] | undefined;
|
|
3627
|
+
productTypes?: string[] | undefined;
|
|
3628
|
+
tag?: string | undefined;
|
|
3629
|
+
locationId?: string | undefined;
|
|
3496
3630
|
}>;
|
|
3497
3631
|
declare const StorefrontVariantSchema: z.ZodObject<{
|
|
3498
3632
|
id: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -3839,6 +3973,8 @@ declare const StorefrontProductDetailSchema: z.ZodObject<{
|
|
|
3839
3973
|
updatedAt?: string | null | undefined;
|
|
3840
3974
|
}>;
|
|
3841
3975
|
type StorefrontProduct = z.infer<typeof StorefrontProductSchema>;
|
|
3976
|
+
type StorefrontFacet = z.infer<typeof StorefrontFacetSchema>;
|
|
3977
|
+
type StorefrontSearchFilter = z.infer<typeof StorefrontSearchFilterSchema>;
|
|
3842
3978
|
type StorefrontProductsResponse = z.infer<typeof StorefrontProductsResponseSchema>;
|
|
3843
3979
|
/** Params de entrada (sort/page/pageSize opcionales con defaults en el schema) */
|
|
3844
3980
|
type StorefrontProductsParamsInput = z.input<typeof StorefrontProductsParamsSchema>;
|
|
@@ -3923,4 +4059,4 @@ declare const StorefrontCollectionDetailSchema: z.ZodObject<{
|
|
|
3923
4059
|
type StorefrontCollection = z.infer<typeof StorefrontCollectionSchema>;
|
|
3924
4060
|
type StorefrontCollectionDetail = z.infer<typeof StorefrontCollectionDetailSchema>;
|
|
3925
4061
|
|
|
3926
|
-
export { type StorefrontSettings as S, type StorefrontPageDetail as a, type StorefrontCmsPage as b, type StorefrontCmsSettings as c, type StorefrontCollection as d, type StorefrontCollectionDetail as e, StorefrontCollectionDetailSchema as f, StorefrontCollectionSchema as g, StorefrontCollectionsResponseSchema as h,
|
|
4062
|
+
export { type StorefrontVariant as A, type StorefrontSettings as S, type StorefrontPageDetail as a, type StorefrontCmsPage as b, type StorefrontCmsSettings as c, type StorefrontCollection as d, type StorefrontCollectionDetail as e, StorefrontCollectionDetailSchema as f, StorefrontCollectionSchema as g, StorefrontCollectionsResponseSchema as h, type StorefrontFacet as i, StorefrontFacetSchema as j, StorefrontPageDetailSchema as k, type StorefrontPageListItem as l, StorefrontPageListItemSchema as m, type StorefrontProduct as n, type StorefrontProductDetail as o, StorefrontProductDetailSchema as p, StorefrontProductSchema as q, type StorefrontProductsParamsInput as r, StorefrontProductsParamsSchema as s, type StorefrontProductsResponse as t, StorefrontProductsResponseSchema as u, type StorefrontSearchFilter as v, StorefrontSearchFilterSchema as w, StorefrontSettingsSchema as x, type StorefrontStore as y, StorefrontStoreSchema as z };
|