@behio/storefront-sdk 0.42.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.d.mts CHANGED
@@ -356,6 +356,14 @@ interface ProductVariant {
356
356
  * "default photo" or to render the picture in a subtler style.
357
357
  */
358
358
  imageIsInherited: boolean;
359
+ /**
360
+ * Parameters of this variant. A variant carries its own value where it has
361
+ * one and inherits the parent's everywhere else, so you can render the rows
362
+ * that actually differ under each variant. Empty when nothing is assigned.
363
+ *
364
+ * Added in SDK 1.0.0.
365
+ */
366
+ parameterGroups: ProductParameterGroup[];
359
367
  }
360
368
  interface ProductLabel {
361
369
  id: string;
@@ -569,25 +577,41 @@ interface VariantAxis {
569
577
  values: VariantAxisValue[];
570
578
  }
571
579
  /**
572
- * One custom-field (data-group value) rendered as a spec-table row. BOOLEAN
573
- * carries a typed `booleanValue` (value is null) so the storefront can localize
574
- * Ano/Ne; MONEY carries its currency in `unit`; PERCENTAGE carries "%" in
575
- * `unit`.
580
+ * One row of a curated parameter group.
581
+ *
582
+ * A parameter is something the merchant explicitly published: a label they
583
+ * wrote, a value resolved from a fixed string, a product field, or ONE named
584
+ * field of one warehouse data group. Nothing here reveals warehouse structure:
585
+ * no ids, no field keys, no internal types.
586
+ *
587
+ * `value` is null only for boolean parameters, where `booleanValue` carries the
588
+ * typed value so the storefront localizes Ano/Ne itself. A parameter with no
589
+ * value is omitted from the array rather than rendered as an empty row.
576
590
  */
577
- interface ProductCustomField {
578
- key: string;
579
- name: string;
580
- /** TEXT | NUMBER | DECIMAL | BOOLEAN | DATE | TIME | DATETIME | PERCENTAGE | MONEY | ITEM_LIST | ... */
581
- type: string;
591
+ interface ProductParameter {
592
+ label: string;
582
593
  value: string | null;
583
594
  booleanValue: boolean | null;
595
+ /** "cm", "g", a currency code, "%"; null when the parameter has none. */
584
596
  unit: string | null;
585
597
  }
586
- /** A spec-table section (one inventory data group) with its fields. */
587
- interface ProductCustomFieldGroup {
588
- key: string;
598
+ /**
599
+ * One curated parameter group. A product can carry several, so a template can
600
+ * render one as a spec table and another as badges. Ordering is array order,
601
+ * both for the groups and for the parameters inside them.
602
+ */
603
+ interface ProductParameterGroup {
604
+ /**
605
+ * Stable public identifier derived from the merchant's own group name
606
+ * ("Parametry oblečení" -> "parametry-obleceni"). Pass it to
607
+ * `catalog.getProductParameterGroup` to fetch just this group.
608
+ */
609
+ slug: string;
589
610
  name: string;
590
- fields: ProductCustomField[];
611
+ parameters: ProductParameter[];
612
+ }
613
+ interface ProductParametersResponse {
614
+ groups: ProductParameterGroup[];
591
615
  }
592
616
  interface ProductDetail extends ProductListItem {
593
617
  longDescription?: string;
@@ -617,14 +641,15 @@ interface ProductDetail extends ProductListItem {
617
641
  variantAxes: VariantAxis[];
618
642
  volumePricing: ProductVolumePrice[];
619
643
  /**
620
- * Structured product parameters from custom fields (inventory data groups),
621
- * grouped into spec-table sections (GAP-12). Empty when the product has no
622
- * data-group values. Distinct from `longDescription` (free HTML): this is
623
- * machine-readable key/value data for a "Parametry" table + comparison
624
- * engines. (Corrected from the old untyped `Record<string, unknown>` — the
625
- * API never populated that; it now sends this structured shape.)
644
+ * Curated parameter groups, already resolved. Empty when the merchant
645
+ * assigned none. Distinct from `longDescription` (free HTML): this is
646
+ * machine-readable key/value data for a "Parametry" table, comparison
647
+ * engines and AEO.
648
+ *
649
+ * Replaced `customFields` in SDK 1.0.0. The old field returned raw warehouse
650
+ * data groups, which published internal bookkeeping nobody curated.
626
651
  */
627
- customFields: ProductCustomFieldGroup[];
652
+ parameterGroups: ProductParameterGroup[];
628
653
  seo: {
629
654
  title?: string | null;
630
655
  description?: string | null;
@@ -731,13 +756,22 @@ interface CategoryDetail extends Category {
731
756
  ogImage?: string | null;
732
757
  };
733
758
  }
734
- type DataGroupFieldType = "TEXT" | "NUMBER" | "DECIMAL" | "BOOLEAN" | "DATE" | "TIME" | "DATETIME" | "PERCENTAGE" | "MONEY" | "ASSET" | "ITEM_LIST" | "DYNAMIC_NUMBER_CALCULATION_FROM_OTHERS";
759
+ /**
760
+ * One available filter, derived from a curated parameter the merchant marked
761
+ * filterable. A visitor can therefore never filter by a field that does not
762
+ * appear in the product's parameters.
763
+ */
735
764
  interface FilterField {
765
+ /** Parameter slug. Pass it back in `ProductsQuery.parameters` or `facets`. */
736
766
  key: string;
767
+ /** Parameter label in the requested language. */
737
768
  name: string;
738
- type: DataGroupFieldType | string;
739
- groupKey: string;
769
+ /** How to render it: value list, numeric range, or yes/no. */
770
+ type: "enum" | "range" | "boolean" | string;
771
+ /** Slug of the parameter group this filter belongs to. */
772
+ groupSlug: string;
740
773
  groupName: string;
774
+ unit?: string | null;
741
775
  values?: string[];
742
776
  }
743
777
  interface FacetValue {
@@ -757,14 +791,14 @@ interface FacetRange {
757
791
  max: number | null;
758
792
  }
759
793
  interface Facet {
794
+ /** Parameter slug. Never a warehouse field key. */
760
795
  key: string;
761
796
  name: string;
762
797
  /** "enum" (checkboxes), "range" (slider) or "boolean". */
763
798
  type: "enum" | "range" | "boolean" | string;
764
- groupKey: string;
799
+ /** Slug of the parameter group this facet belongs to. */
800
+ groupSlug: string;
765
801
  groupName: string;
766
- /** Underlying data-group field type (TEXT, NUMBER, MONEY, ...). */
767
- fieldType: string;
768
802
  /** enum/boolean facets: selectable values with counts. */
769
803
  values?: FacetValue[];
770
804
  /** range facets: numeric bounds within the current context. */
@@ -859,11 +893,17 @@ interface ProductsQuery {
859
893
  /** Minimum aggregate rating, e.g. 4 for "4 and up". */
860
894
  ratingMin?: number;
861
895
  search?: string;
862
- /** Custom-field filters. A value may be an array = multi-select (OR within
863
- * the key), e.g. {"barva": ["cerna", "bila"]}. */
864
- customFields?: Record<string, string | number | boolean | string[] | unknown>;
865
- /** Slug-based facet selection for SEO URLs: facet key -> value slugs, e.g.
866
- * {"barva": ["cerna"]}. Resolved server-side to the underlying values. */
896
+ /**
897
+ * Parameter filters, keyed by PARAMETER SLUG. A value may be an array =
898
+ * multi-select (OR within the key), e.g. {"barva": ["cerna", "bila"]}.
899
+ * Range filters use the `_min` / `_max` suffix, e.g. {"hmotnost_min": 100}.
900
+ *
901
+ * Replaced `customFields` in SDK 1.0.0, which was keyed by a warehouse
902
+ * data-group field key.
903
+ */
904
+ parameters?: Record<string, string | number | boolean | string[] | unknown>;
905
+ /** Slug-based facet selection for SEO URLs: parameter slug -> value slugs,
906
+ * e.g. {"barva": ["cerna"]}. Resolved server-side to the stored values. */
867
907
  facets?: Record<string, string[]>;
868
908
  /** Filter by specific product IDs (comma-separated in URL) */
869
909
  ids?: string[];
@@ -1202,7 +1242,10 @@ interface DigitalDownload {
1202
1242
  fileName: string;
1203
1243
  /** Localized product name the file belongs to (may be null). */
1204
1244
  productName: string | null;
1205
- /** Product slug for linking back to the PDP (may be null). */
1245
+ /**
1246
+ * Product slug for linking back to the PDP (may be null). Resolved the same
1247
+ * way as everywhere else: per-locale slug first, then the product id.
1248
+ */
1206
1249
  productSlug: string | null;
1207
1250
  fileSize: number;
1208
1251
  mimeType: string;
@@ -1224,7 +1267,10 @@ interface CourseListItem {
1224
1267
  courseId: string;
1225
1268
  /** Localized course (product) name, best-effort. */
1226
1269
  name: string | null;
1227
- /** Product slug for linking to the PDP. */
1270
+ /**
1271
+ * Product slug for linking to the PDP. Resolved the same way as in the
1272
+ * catalog: per-locale slug first, then the product id.
1273
+ */
1228
1274
  slug: string;
1229
1275
  imageUrl: string | null;
1230
1276
  totalLessons: number;
@@ -1276,6 +1322,7 @@ interface CourseModule {
1276
1322
  interface CourseDetail {
1277
1323
  courseId: string;
1278
1324
  name: string | null;
1325
+ /** Product slug for linking to the PDP (resolved per-locale slug, else id). */
1279
1326
  slug: string;
1280
1327
  imageUrl: string | null;
1281
1328
  /** Welcome text shown at the top of the member area (markdown). */
@@ -1616,15 +1663,17 @@ interface Bundle {
1616
1663
  slug: string;
1617
1664
  name: string;
1618
1665
  description: string | null;
1619
- bundlePrice: number;
1666
+ /** `null` when the eshop hides prices from guests and this visitor has no price entitlement. */
1667
+ bundlePrice: number | null;
1620
1668
  currency: string;
1621
1669
  coverImage: string | null;
1622
1670
  endsAt: number | null;
1623
- itemsSum: number;
1624
- /** Absolute saving vs buying the components separately, in `currency`. */
1625
- savings: number;
1626
- /** Percentage saving, 0–100. 0 when `itemsSum` is zero. */
1627
- savingsPercent: number;
1671
+ /** `null` when prices are hidden (see `bundlePrice`). */
1672
+ itemsSum: number | null;
1673
+ /** Absolute saving vs buying the components separately, in `currency`. `null` when prices are hidden. */
1674
+ savings: number | null;
1675
+ /** Percentage saving, 0–100. 0 when `itemsSum` is zero. `null` when prices are hidden. */
1676
+ savingsPercent: number | null;
1628
1677
  /** Minimum bundles per order. Default 1. */
1629
1678
  minQuantity: number;
1630
1679
  /** Maximum bundles per order. `null` = uncapped. */
@@ -2328,15 +2377,42 @@ declare class CatalogModule {
2328
2377
  locale?: string;
2329
2378
  currency?: string;
2330
2379
  }): Promise<SdkResult<PaginatedResponse<ProductListItem>>>;
2331
- /** Get available filter fields for dynamic filter UI */
2332
- getFilters(): Promise<SdkResult<{
2380
+ /**
2381
+ * Available filters for a dynamic filter UI.
2382
+ *
2383
+ * Derived from curated PARAMETERS the merchant marked filterable, so a
2384
+ * visitor can never filter by something that does not appear in the
2385
+ * product's parameters. Labels are per language, hence `locale`.
2386
+ */
2387
+ getFilters(options?: {
2388
+ locale?: string;
2389
+ }): Promise<SdkResult<{
2333
2390
  filters: FilterField[];
2334
2391
  }>>;
2335
2392
  /**
2336
- * Facet groups + selection-aware counts for the current filter set (custom
2337
- * fields, labels, price, availability, rating, subcategories). Pass the SAME
2338
- * query you pass to `getProducts` (category, search, price, inStock, ratingMin,
2339
- * customFields, facets slugs, labels): counts for each facet are computed with
2393
+ * Curated parameter groups of a product, already resolved (label, value,
2394
+ * unit, order). Returns an ARRAY of groups so a template can lay them out
2395
+ * however it likes: one group as a spec table, another as badges.
2396
+ *
2397
+ * A variant's own parameters ride along on `ProductDetail.variants[]`, so
2398
+ * this call is for the parent product.
2399
+ */
2400
+ getProductParameters(slug: string, options?: {
2401
+ locale?: string;
2402
+ }): Promise<SdkResult<ProductParametersResponse>>;
2403
+ /**
2404
+ * One specific parameter group of a product, by its slug. 404 when the
2405
+ * product does not have that group, which is deliberate: the caller asked
2406
+ * for a named thing, so an empty array would hide a wrong slug.
2407
+ */
2408
+ getProductParameterGroup(slug: string, groupSlug: string, options?: {
2409
+ locale?: string;
2410
+ }): Promise<SdkResult<ProductParameterGroup>>;
2411
+ /**
2412
+ * Facet groups + selection-aware counts for the current filter set
2413
+ * (parameters, labels, price, availability, rating, subcategories). Pass the
2414
+ * SAME query you pass to `getProducts` (category, search, price, inStock,
2415
+ * ratingMin, parameters, facets slugs, labels): counts are computed with
2340
2416
  * that facet excluded, and values that drop to 0 are still returned (render
2341
2417
  * them disabled). Use this to build an Alza-style filter sidebar.
2342
2418
  */
@@ -2956,6 +3032,8 @@ interface UseFeaturedOptions {
2956
3032
  declare function useFeatured(options?: UseFeaturedOptions): _tanstack_react_query.UseQueryResult<NoInfer<PaginatedResponse<ProductListItem>>, Error>;
2957
3033
 
2958
3034
  interface UseFiltersOptions {
3035
+ /** Filter labels are per language; defaults to the shop's default language. */
3036
+ locale?: string;
2959
3037
  enabled?: boolean;
2960
3038
  }
2961
3039
  declare function useFilters(options?: UseFiltersOptions): _tanstack_react_query.UseQueryResult<NoInfer<FilterField[]>, Error>;
@@ -2972,6 +3050,22 @@ interface UseFacetsOptions {
2972
3050
  */
2973
3051
  declare function useFacets(query?: ProductsQuery, options?: UseFacetsOptions): _tanstack_react_query.UseQueryResult<NoInfer<FacetsResponse>, Error>;
2974
3052
 
3053
+ interface UseProductParametersOptions {
3054
+ locale?: string;
3055
+ /** Fetch only this group (by its slug) instead of all of them. */
3056
+ groupSlug?: string;
3057
+ enabled?: boolean;
3058
+ }
3059
+ /**
3060
+ * Curated parameter groups of a product.
3061
+ *
3062
+ * Prefer reading `product.parameterGroups` from `useProduct` when you already
3063
+ * have the detail loaded; this hook is for the cases where you want the spec
3064
+ * table (or one named group) on its own, e.g. a comparison table or a tab that
3065
+ * loads lazily.
3066
+ */
3067
+ declare function useProductParameters(slug: string, options?: UseProductParametersOptions): _tanstack_react_query.UseQueryResult<NoInfer<ProductParameterGroup[]>, Error>;
3068
+
2975
3069
  interface UseSearchOptions {
2976
3070
  page?: number;
2977
3071
  limit?: number;
@@ -4345,4 +4439,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
4345
4439
  success: boolean;
4346
4440
  }>>;
4347
4441
 
4348
- export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentStatus, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSubscriptionsOptions, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useWishlist };
4442
+ export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentStatus, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSubscriptionsOptions, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useWishlist };
package/dist/react.d.ts CHANGED
@@ -356,6 +356,14 @@ interface ProductVariant {
356
356
  * "default photo" or to render the picture in a subtler style.
357
357
  */
358
358
  imageIsInherited: boolean;
359
+ /**
360
+ * Parameters of this variant. A variant carries its own value where it has
361
+ * one and inherits the parent's everywhere else, so you can render the rows
362
+ * that actually differ under each variant. Empty when nothing is assigned.
363
+ *
364
+ * Added in SDK 1.0.0.
365
+ */
366
+ parameterGroups: ProductParameterGroup[];
359
367
  }
360
368
  interface ProductLabel {
361
369
  id: string;
@@ -569,25 +577,41 @@ interface VariantAxis {
569
577
  values: VariantAxisValue[];
570
578
  }
571
579
  /**
572
- * One custom-field (data-group value) rendered as a spec-table row. BOOLEAN
573
- * carries a typed `booleanValue` (value is null) so the storefront can localize
574
- * Ano/Ne; MONEY carries its currency in `unit`; PERCENTAGE carries "%" in
575
- * `unit`.
580
+ * One row of a curated parameter group.
581
+ *
582
+ * A parameter is something the merchant explicitly published: a label they
583
+ * wrote, a value resolved from a fixed string, a product field, or ONE named
584
+ * field of one warehouse data group. Nothing here reveals warehouse structure:
585
+ * no ids, no field keys, no internal types.
586
+ *
587
+ * `value` is null only for boolean parameters, where `booleanValue` carries the
588
+ * typed value so the storefront localizes Ano/Ne itself. A parameter with no
589
+ * value is omitted from the array rather than rendered as an empty row.
576
590
  */
577
- interface ProductCustomField {
578
- key: string;
579
- name: string;
580
- /** TEXT | NUMBER | DECIMAL | BOOLEAN | DATE | TIME | DATETIME | PERCENTAGE | MONEY | ITEM_LIST | ... */
581
- type: string;
591
+ interface ProductParameter {
592
+ label: string;
582
593
  value: string | null;
583
594
  booleanValue: boolean | null;
595
+ /** "cm", "g", a currency code, "%"; null when the parameter has none. */
584
596
  unit: string | null;
585
597
  }
586
- /** A spec-table section (one inventory data group) with its fields. */
587
- interface ProductCustomFieldGroup {
588
- key: string;
598
+ /**
599
+ * One curated parameter group. A product can carry several, so a template can
600
+ * render one as a spec table and another as badges. Ordering is array order,
601
+ * both for the groups and for the parameters inside them.
602
+ */
603
+ interface ProductParameterGroup {
604
+ /**
605
+ * Stable public identifier derived from the merchant's own group name
606
+ * ("Parametry oblečení" -> "parametry-obleceni"). Pass it to
607
+ * `catalog.getProductParameterGroup` to fetch just this group.
608
+ */
609
+ slug: string;
589
610
  name: string;
590
- fields: ProductCustomField[];
611
+ parameters: ProductParameter[];
612
+ }
613
+ interface ProductParametersResponse {
614
+ groups: ProductParameterGroup[];
591
615
  }
592
616
  interface ProductDetail extends ProductListItem {
593
617
  longDescription?: string;
@@ -617,14 +641,15 @@ interface ProductDetail extends ProductListItem {
617
641
  variantAxes: VariantAxis[];
618
642
  volumePricing: ProductVolumePrice[];
619
643
  /**
620
- * Structured product parameters from custom fields (inventory data groups),
621
- * grouped into spec-table sections (GAP-12). Empty when the product has no
622
- * data-group values. Distinct from `longDescription` (free HTML): this is
623
- * machine-readable key/value data for a "Parametry" table + comparison
624
- * engines. (Corrected from the old untyped `Record<string, unknown>` — the
625
- * API never populated that; it now sends this structured shape.)
644
+ * Curated parameter groups, already resolved. Empty when the merchant
645
+ * assigned none. Distinct from `longDescription` (free HTML): this is
646
+ * machine-readable key/value data for a "Parametry" table, comparison
647
+ * engines and AEO.
648
+ *
649
+ * Replaced `customFields` in SDK 1.0.0. The old field returned raw warehouse
650
+ * data groups, which published internal bookkeeping nobody curated.
626
651
  */
627
- customFields: ProductCustomFieldGroup[];
652
+ parameterGroups: ProductParameterGroup[];
628
653
  seo: {
629
654
  title?: string | null;
630
655
  description?: string | null;
@@ -731,13 +756,22 @@ interface CategoryDetail extends Category {
731
756
  ogImage?: string | null;
732
757
  };
733
758
  }
734
- type DataGroupFieldType = "TEXT" | "NUMBER" | "DECIMAL" | "BOOLEAN" | "DATE" | "TIME" | "DATETIME" | "PERCENTAGE" | "MONEY" | "ASSET" | "ITEM_LIST" | "DYNAMIC_NUMBER_CALCULATION_FROM_OTHERS";
759
+ /**
760
+ * One available filter, derived from a curated parameter the merchant marked
761
+ * filterable. A visitor can therefore never filter by a field that does not
762
+ * appear in the product's parameters.
763
+ */
735
764
  interface FilterField {
765
+ /** Parameter slug. Pass it back in `ProductsQuery.parameters` or `facets`. */
736
766
  key: string;
767
+ /** Parameter label in the requested language. */
737
768
  name: string;
738
- type: DataGroupFieldType | string;
739
- groupKey: string;
769
+ /** How to render it: value list, numeric range, or yes/no. */
770
+ type: "enum" | "range" | "boolean" | string;
771
+ /** Slug of the parameter group this filter belongs to. */
772
+ groupSlug: string;
740
773
  groupName: string;
774
+ unit?: string | null;
741
775
  values?: string[];
742
776
  }
743
777
  interface FacetValue {
@@ -757,14 +791,14 @@ interface FacetRange {
757
791
  max: number | null;
758
792
  }
759
793
  interface Facet {
794
+ /** Parameter slug. Never a warehouse field key. */
760
795
  key: string;
761
796
  name: string;
762
797
  /** "enum" (checkboxes), "range" (slider) or "boolean". */
763
798
  type: "enum" | "range" | "boolean" | string;
764
- groupKey: string;
799
+ /** Slug of the parameter group this facet belongs to. */
800
+ groupSlug: string;
765
801
  groupName: string;
766
- /** Underlying data-group field type (TEXT, NUMBER, MONEY, ...). */
767
- fieldType: string;
768
802
  /** enum/boolean facets: selectable values with counts. */
769
803
  values?: FacetValue[];
770
804
  /** range facets: numeric bounds within the current context. */
@@ -859,11 +893,17 @@ interface ProductsQuery {
859
893
  /** Minimum aggregate rating, e.g. 4 for "4 and up". */
860
894
  ratingMin?: number;
861
895
  search?: string;
862
- /** Custom-field filters. A value may be an array = multi-select (OR within
863
- * the key), e.g. {"barva": ["cerna", "bila"]}. */
864
- customFields?: Record<string, string | number | boolean | string[] | unknown>;
865
- /** Slug-based facet selection for SEO URLs: facet key -> value slugs, e.g.
866
- * {"barva": ["cerna"]}. Resolved server-side to the underlying values. */
896
+ /**
897
+ * Parameter filters, keyed by PARAMETER SLUG. A value may be an array =
898
+ * multi-select (OR within the key), e.g. {"barva": ["cerna", "bila"]}.
899
+ * Range filters use the `_min` / `_max` suffix, e.g. {"hmotnost_min": 100}.
900
+ *
901
+ * Replaced `customFields` in SDK 1.0.0, which was keyed by a warehouse
902
+ * data-group field key.
903
+ */
904
+ parameters?: Record<string, string | number | boolean | string[] | unknown>;
905
+ /** Slug-based facet selection for SEO URLs: parameter slug -> value slugs,
906
+ * e.g. {"barva": ["cerna"]}. Resolved server-side to the stored values. */
867
907
  facets?: Record<string, string[]>;
868
908
  /** Filter by specific product IDs (comma-separated in URL) */
869
909
  ids?: string[];
@@ -1202,7 +1242,10 @@ interface DigitalDownload {
1202
1242
  fileName: string;
1203
1243
  /** Localized product name the file belongs to (may be null). */
1204
1244
  productName: string | null;
1205
- /** Product slug for linking back to the PDP (may be null). */
1245
+ /**
1246
+ * Product slug for linking back to the PDP (may be null). Resolved the same
1247
+ * way as everywhere else: per-locale slug first, then the product id.
1248
+ */
1206
1249
  productSlug: string | null;
1207
1250
  fileSize: number;
1208
1251
  mimeType: string;
@@ -1224,7 +1267,10 @@ interface CourseListItem {
1224
1267
  courseId: string;
1225
1268
  /** Localized course (product) name, best-effort. */
1226
1269
  name: string | null;
1227
- /** Product slug for linking to the PDP. */
1270
+ /**
1271
+ * Product slug for linking to the PDP. Resolved the same way as in the
1272
+ * catalog: per-locale slug first, then the product id.
1273
+ */
1228
1274
  slug: string;
1229
1275
  imageUrl: string | null;
1230
1276
  totalLessons: number;
@@ -1276,6 +1322,7 @@ interface CourseModule {
1276
1322
  interface CourseDetail {
1277
1323
  courseId: string;
1278
1324
  name: string | null;
1325
+ /** Product slug for linking to the PDP (resolved per-locale slug, else id). */
1279
1326
  slug: string;
1280
1327
  imageUrl: string | null;
1281
1328
  /** Welcome text shown at the top of the member area (markdown). */
@@ -1616,15 +1663,17 @@ interface Bundle {
1616
1663
  slug: string;
1617
1664
  name: string;
1618
1665
  description: string | null;
1619
- bundlePrice: number;
1666
+ /** `null` when the eshop hides prices from guests and this visitor has no price entitlement. */
1667
+ bundlePrice: number | null;
1620
1668
  currency: string;
1621
1669
  coverImage: string | null;
1622
1670
  endsAt: number | null;
1623
- itemsSum: number;
1624
- /** Absolute saving vs buying the components separately, in `currency`. */
1625
- savings: number;
1626
- /** Percentage saving, 0–100. 0 when `itemsSum` is zero. */
1627
- savingsPercent: number;
1671
+ /** `null` when prices are hidden (see `bundlePrice`). */
1672
+ itemsSum: number | null;
1673
+ /** Absolute saving vs buying the components separately, in `currency`. `null` when prices are hidden. */
1674
+ savings: number | null;
1675
+ /** Percentage saving, 0–100. 0 when `itemsSum` is zero. `null` when prices are hidden. */
1676
+ savingsPercent: number | null;
1628
1677
  /** Minimum bundles per order. Default 1. */
1629
1678
  minQuantity: number;
1630
1679
  /** Maximum bundles per order. `null` = uncapped. */
@@ -2328,15 +2377,42 @@ declare class CatalogModule {
2328
2377
  locale?: string;
2329
2378
  currency?: string;
2330
2379
  }): Promise<SdkResult<PaginatedResponse<ProductListItem>>>;
2331
- /** Get available filter fields for dynamic filter UI */
2332
- getFilters(): Promise<SdkResult<{
2380
+ /**
2381
+ * Available filters for a dynamic filter UI.
2382
+ *
2383
+ * Derived from curated PARAMETERS the merchant marked filterable, so a
2384
+ * visitor can never filter by something that does not appear in the
2385
+ * product's parameters. Labels are per language, hence `locale`.
2386
+ */
2387
+ getFilters(options?: {
2388
+ locale?: string;
2389
+ }): Promise<SdkResult<{
2333
2390
  filters: FilterField[];
2334
2391
  }>>;
2335
2392
  /**
2336
- * Facet groups + selection-aware counts for the current filter set (custom
2337
- * fields, labels, price, availability, rating, subcategories). Pass the SAME
2338
- * query you pass to `getProducts` (category, search, price, inStock, ratingMin,
2339
- * customFields, facets slugs, labels): counts for each facet are computed with
2393
+ * Curated parameter groups of a product, already resolved (label, value,
2394
+ * unit, order). Returns an ARRAY of groups so a template can lay them out
2395
+ * however it likes: one group as a spec table, another as badges.
2396
+ *
2397
+ * A variant's own parameters ride along on `ProductDetail.variants[]`, so
2398
+ * this call is for the parent product.
2399
+ */
2400
+ getProductParameters(slug: string, options?: {
2401
+ locale?: string;
2402
+ }): Promise<SdkResult<ProductParametersResponse>>;
2403
+ /**
2404
+ * One specific parameter group of a product, by its slug. 404 when the
2405
+ * product does not have that group, which is deliberate: the caller asked
2406
+ * for a named thing, so an empty array would hide a wrong slug.
2407
+ */
2408
+ getProductParameterGroup(slug: string, groupSlug: string, options?: {
2409
+ locale?: string;
2410
+ }): Promise<SdkResult<ProductParameterGroup>>;
2411
+ /**
2412
+ * Facet groups + selection-aware counts for the current filter set
2413
+ * (parameters, labels, price, availability, rating, subcategories). Pass the
2414
+ * SAME query you pass to `getProducts` (category, search, price, inStock,
2415
+ * ratingMin, parameters, facets slugs, labels): counts are computed with
2340
2416
  * that facet excluded, and values that drop to 0 are still returned (render
2341
2417
  * them disabled). Use this to build an Alza-style filter sidebar.
2342
2418
  */
@@ -2956,6 +3032,8 @@ interface UseFeaturedOptions {
2956
3032
  declare function useFeatured(options?: UseFeaturedOptions): _tanstack_react_query.UseQueryResult<NoInfer<PaginatedResponse<ProductListItem>>, Error>;
2957
3033
 
2958
3034
  interface UseFiltersOptions {
3035
+ /** Filter labels are per language; defaults to the shop's default language. */
3036
+ locale?: string;
2959
3037
  enabled?: boolean;
2960
3038
  }
2961
3039
  declare function useFilters(options?: UseFiltersOptions): _tanstack_react_query.UseQueryResult<NoInfer<FilterField[]>, Error>;
@@ -2972,6 +3050,22 @@ interface UseFacetsOptions {
2972
3050
  */
2973
3051
  declare function useFacets(query?: ProductsQuery, options?: UseFacetsOptions): _tanstack_react_query.UseQueryResult<NoInfer<FacetsResponse>, Error>;
2974
3052
 
3053
+ interface UseProductParametersOptions {
3054
+ locale?: string;
3055
+ /** Fetch only this group (by its slug) instead of all of them. */
3056
+ groupSlug?: string;
3057
+ enabled?: boolean;
3058
+ }
3059
+ /**
3060
+ * Curated parameter groups of a product.
3061
+ *
3062
+ * Prefer reading `product.parameterGroups` from `useProduct` when you already
3063
+ * have the detail loaded; this hook is for the cases where you want the spec
3064
+ * table (or one named group) on its own, e.g. a comparison table or a tab that
3065
+ * loads lazily.
3066
+ */
3067
+ declare function useProductParameters(slug: string, options?: UseProductParametersOptions): _tanstack_react_query.UseQueryResult<NoInfer<ProductParameterGroup[]>, Error>;
3068
+
2975
3069
  interface UseSearchOptions {
2976
3070
  page?: number;
2977
3071
  limit?: number;
@@ -4345,4 +4439,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
4345
4439
  success: boolean;
4346
4440
  }>>;
4347
4441
 
4348
- export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentStatus, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSubscriptionsOptions, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useWishlist };
4442
+ export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentStatus, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSubscriptionsOptions, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useWishlist };