@behio/storefront-sdk 0.42.0 → 1.1.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/{chunk-3TPJG2WV.js → chunk-ODAMBLGY.js} +52 -20
- package/dist/{chunk-QOZYQMK2.mjs → chunk-WMZH72WS.mjs} +43 -11
- package/dist/{client-B0vlHxB1.d.mts → client-CiowRIBp.d.mts} +185 -46
- package/dist/{client-B0vlHxB1.d.ts → client-CiowRIBp.d.ts} +185 -46
- package/dist/index.d.mts +103 -3
- package/dist/index.d.ts +103 -3
- package/dist/index.js +113 -9
- package/dist/index.mjs +109 -5
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/next.js +2 -2
- package/dist/next.mjs +1 -1
- package/dist/react.d.mts +203 -46
- package/dist/react.d.ts +203 -46
- package/dist/react.js +215 -151
- package/dist/react.mjs +149 -86
- package/package.json +1 -1
|
@@ -271,7 +271,55 @@ interface ProductVariant {
|
|
|
271
271
|
*/
|
|
272
272
|
id: string;
|
|
273
273
|
sku: string;
|
|
274
|
+
/**
|
|
275
|
+
* Variant name in the requested locale. Before SDK 1.1.0 this was always the
|
|
276
|
+
* warehouse item name, so translated shops showed one language to everyone.
|
|
277
|
+
*/
|
|
274
278
|
name: string;
|
|
279
|
+
/**
|
|
280
|
+
* Deep-link token for this variant — NOT a URL of its own.
|
|
281
|
+
*
|
|
282
|
+
* A variant has no standalone product page: the catalog 404s its slug and
|
|
283
|
+
* every listing excludes it, because a variant is bought from the parent's
|
|
284
|
+
* detail page. Link to `/product/{product.slug}?variant={variant.variantSlug}`
|
|
285
|
+
* and preselect the variant from that query parameter.
|
|
286
|
+
*
|
|
287
|
+
* Added in SDK 1.1.0.
|
|
288
|
+
*/
|
|
289
|
+
variantSlug: string;
|
|
290
|
+
/**
|
|
291
|
+
* Short description of THIS variant, or `null` when the merchant left it
|
|
292
|
+
* empty. `null` means INHERIT: fall back to `ProductDetail.shortDescription`
|
|
293
|
+
* instead of rendering an empty block. Sanitised HTML.
|
|
294
|
+
*
|
|
295
|
+
* Added in SDK 1.1.0.
|
|
296
|
+
*/
|
|
297
|
+
shortDescription?: string | null;
|
|
298
|
+
/** Long description of THIS variant. Same inherit-on-null contract as
|
|
299
|
+
* `shortDescription`. Added in SDK 1.1.0. */
|
|
300
|
+
longDescription?: string | null;
|
|
301
|
+
/**
|
|
302
|
+
* Gallery of THIS variant, ordered. Empty means the variant has no photos of
|
|
303
|
+
* its own, so keep showing the parent's gallery.
|
|
304
|
+
*
|
|
305
|
+
* Added in SDK 1.1.0.
|
|
306
|
+
*/
|
|
307
|
+
images: ProductDetail["images"];
|
|
308
|
+
/**
|
|
309
|
+
* Per-variant SEO/OG overrides, or `null` when the merchant wrote none. The
|
|
310
|
+
* canonical URL stays the parent's, so use these only when a variant is
|
|
311
|
+
* preselected via `?variant=`.
|
|
312
|
+
*
|
|
313
|
+
* Added in SDK 1.1.0.
|
|
314
|
+
*/
|
|
315
|
+
seo?: {
|
|
316
|
+
title?: string | null;
|
|
317
|
+
description?: string | null;
|
|
318
|
+
keywords?: string | null;
|
|
319
|
+
ogTitle?: string | null;
|
|
320
|
+
ogDescription?: string | null;
|
|
321
|
+
ogImage?: string | null;
|
|
322
|
+
} | null;
|
|
275
323
|
/**
|
|
276
324
|
* Axis name/value pairs identifying this variant (e.g.
|
|
277
325
|
* `[{name: 'Barva', value: 'červená'}]`) — matches the wire shape the API
|
|
@@ -300,6 +348,14 @@ interface ProductVariant {
|
|
|
300
348
|
* "default photo" or to render the picture in a subtler style.
|
|
301
349
|
*/
|
|
302
350
|
imageIsInherited: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Parameters of this variant. A variant carries its own value where it has
|
|
353
|
+
* one and inherits the parent's everywhere else, so you can render the rows
|
|
354
|
+
* that actually differ under each variant. Empty when nothing is assigned.
|
|
355
|
+
*
|
|
356
|
+
* Added in SDK 1.0.0.
|
|
357
|
+
*/
|
|
358
|
+
parameterGroups: ProductParameterGroup[];
|
|
303
359
|
}
|
|
304
360
|
interface ProductLabel {
|
|
305
361
|
id: string;
|
|
@@ -513,25 +569,41 @@ interface VariantAxis {
|
|
|
513
569
|
values: VariantAxisValue[];
|
|
514
570
|
}
|
|
515
571
|
/**
|
|
516
|
-
* One
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
*
|
|
572
|
+
* One row of a curated parameter group.
|
|
573
|
+
*
|
|
574
|
+
* A parameter is something the merchant explicitly published: a label they
|
|
575
|
+
* wrote, a value resolved from a fixed string, a product field, or ONE named
|
|
576
|
+
* field of one warehouse data group. Nothing here reveals warehouse structure:
|
|
577
|
+
* no ids, no field keys, no internal types.
|
|
578
|
+
*
|
|
579
|
+
* `value` is null only for boolean parameters, where `booleanValue` carries the
|
|
580
|
+
* typed value so the storefront localizes Ano/Ne itself. A parameter with no
|
|
581
|
+
* value is omitted from the array rather than rendered as an empty row.
|
|
520
582
|
*/
|
|
521
|
-
interface
|
|
522
|
-
|
|
523
|
-
name: string;
|
|
524
|
-
/** TEXT | NUMBER | DECIMAL | BOOLEAN | DATE | TIME | DATETIME | PERCENTAGE | MONEY | ITEM_LIST | ... */
|
|
525
|
-
type: string;
|
|
583
|
+
interface ProductParameter {
|
|
584
|
+
label: string;
|
|
526
585
|
value: string | null;
|
|
527
586
|
booleanValue: boolean | null;
|
|
587
|
+
/** "cm", "g", a currency code, "%"; null when the parameter has none. */
|
|
528
588
|
unit: string | null;
|
|
529
589
|
}
|
|
530
|
-
/**
|
|
531
|
-
|
|
532
|
-
|
|
590
|
+
/**
|
|
591
|
+
* One curated parameter group. A product can carry several, so a template can
|
|
592
|
+
* render one as a spec table and another as badges. Ordering is array order,
|
|
593
|
+
* both for the groups and for the parameters inside them.
|
|
594
|
+
*/
|
|
595
|
+
interface ProductParameterGroup {
|
|
596
|
+
/**
|
|
597
|
+
* Stable public identifier derived from the merchant's own group name
|
|
598
|
+
* ("Parametry oblečení" -> "parametry-obleceni"). Pass it to
|
|
599
|
+
* `catalog.getProductParameterGroup` to fetch just this group.
|
|
600
|
+
*/
|
|
601
|
+
slug: string;
|
|
533
602
|
name: string;
|
|
534
|
-
|
|
603
|
+
parameters: ProductParameter[];
|
|
604
|
+
}
|
|
605
|
+
interface ProductParametersResponse {
|
|
606
|
+
groups: ProductParameterGroup[];
|
|
535
607
|
}
|
|
536
608
|
interface ProductDetail extends ProductListItem {
|
|
537
609
|
longDescription?: string;
|
|
@@ -561,14 +633,15 @@ interface ProductDetail extends ProductListItem {
|
|
|
561
633
|
variantAxes: VariantAxis[];
|
|
562
634
|
volumePricing: ProductVolumePrice[];
|
|
563
635
|
/**
|
|
564
|
-
*
|
|
565
|
-
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
*
|
|
569
|
-
*
|
|
636
|
+
* Curated parameter groups, already resolved. Empty when the merchant
|
|
637
|
+
* assigned none. Distinct from `longDescription` (free HTML): this is
|
|
638
|
+
* machine-readable key/value data for a "Parametry" table, comparison
|
|
639
|
+
* engines and AEO.
|
|
640
|
+
*
|
|
641
|
+
* Replaced `customFields` in SDK 1.0.0. The old field returned raw warehouse
|
|
642
|
+
* data groups, which published internal bookkeeping nobody curated.
|
|
570
643
|
*/
|
|
571
|
-
|
|
644
|
+
parameterGroups: ProductParameterGroup[];
|
|
572
645
|
seo: {
|
|
573
646
|
title?: string | null;
|
|
574
647
|
description?: string | null;
|
|
@@ -675,13 +748,22 @@ interface CategoryDetail extends Category {
|
|
|
675
748
|
ogImage?: string | null;
|
|
676
749
|
};
|
|
677
750
|
}
|
|
678
|
-
|
|
751
|
+
/**
|
|
752
|
+
* One available filter, derived from a curated parameter the merchant marked
|
|
753
|
+
* filterable. A visitor can therefore never filter by a field that does not
|
|
754
|
+
* appear in the product's parameters.
|
|
755
|
+
*/
|
|
679
756
|
interface FilterField {
|
|
757
|
+
/** Parameter slug. Pass it back in `ProductsQuery.parameters` or `facets`. */
|
|
680
758
|
key: string;
|
|
759
|
+
/** Parameter label in the requested language. */
|
|
681
760
|
name: string;
|
|
682
|
-
|
|
683
|
-
|
|
761
|
+
/** How to render it: value list, numeric range, or yes/no. */
|
|
762
|
+
type: "enum" | "range" | "boolean" | string;
|
|
763
|
+
/** Slug of the parameter group this filter belongs to. */
|
|
764
|
+
groupSlug: string;
|
|
684
765
|
groupName: string;
|
|
766
|
+
unit?: string | null;
|
|
685
767
|
values?: string[];
|
|
686
768
|
}
|
|
687
769
|
interface FacetValue {
|
|
@@ -701,14 +783,14 @@ interface FacetRange {
|
|
|
701
783
|
max: number | null;
|
|
702
784
|
}
|
|
703
785
|
interface Facet {
|
|
786
|
+
/** Parameter slug. Never a warehouse field key. */
|
|
704
787
|
key: string;
|
|
705
788
|
name: string;
|
|
706
789
|
/** "enum" (checkboxes), "range" (slider) or "boolean". */
|
|
707
790
|
type: "enum" | "range" | "boolean" | string;
|
|
708
|
-
|
|
791
|
+
/** Slug of the parameter group this facet belongs to. */
|
|
792
|
+
groupSlug: string;
|
|
709
793
|
groupName: string;
|
|
710
|
-
/** Underlying data-group field type (TEXT, NUMBER, MONEY, ...). */
|
|
711
|
-
fieldType: string;
|
|
712
794
|
/** enum/boolean facets: selectable values with counts. */
|
|
713
795
|
values?: FacetValue[];
|
|
714
796
|
/** range facets: numeric bounds within the current context. */
|
|
@@ -803,11 +885,17 @@ interface ProductsQuery {
|
|
|
803
885
|
/** Minimum aggregate rating, e.g. 4 for "4 and up". */
|
|
804
886
|
ratingMin?: number;
|
|
805
887
|
search?: string;
|
|
806
|
-
/**
|
|
807
|
-
*
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
*
|
|
888
|
+
/**
|
|
889
|
+
* Parameter filters, keyed by PARAMETER SLUG. A value may be an array =
|
|
890
|
+
* multi-select (OR within the key), e.g. {"barva": ["cerna", "bila"]}.
|
|
891
|
+
* Range filters use the `_min` / `_max` suffix, e.g. {"hmotnost_min": 100}.
|
|
892
|
+
*
|
|
893
|
+
* Replaced `customFields` in SDK 1.0.0, which was keyed by a warehouse
|
|
894
|
+
* data-group field key.
|
|
895
|
+
*/
|
|
896
|
+
parameters?: Record<string, string | number | boolean | string[] | unknown>;
|
|
897
|
+
/** Slug-based facet selection for SEO URLs: parameter slug -> value slugs,
|
|
898
|
+
* e.g. {"barva": ["cerna"]}. Resolved server-side to the stored values. */
|
|
811
899
|
facets?: Record<string, string[]>;
|
|
812
900
|
/** Filter by specific product IDs (comma-separated in URL) */
|
|
813
901
|
ids?: string[];
|
|
@@ -852,7 +940,22 @@ interface LoginInput {
|
|
|
852
940
|
password: string;
|
|
853
941
|
}
|
|
854
942
|
interface CartItemProduct {
|
|
943
|
+
/**
|
|
944
|
+
* Slug of the page this line links to. For a variant line this is the
|
|
945
|
+
* PARENT's slug: a variant has no page of its own, so linking to its own slug
|
|
946
|
+
* landed customers on a 404 (fixed 2026-08-03, SDK 1.1.0).
|
|
947
|
+
*/
|
|
855
948
|
slug: string;
|
|
949
|
+
/**
|
|
950
|
+
* Deep-link token of the variant on this line, `null` for a plain product.
|
|
951
|
+
* Build the link as `/product/{slug}?variant={variantSlug}` so the customer
|
|
952
|
+
* returns to the exact variant sitting in their cart.
|
|
953
|
+
*
|
|
954
|
+
* Added in SDK 1.1.0.
|
|
955
|
+
*/
|
|
956
|
+
variantSlug?: string | null;
|
|
957
|
+
/** Product name in the CART's language. Before SDK 1.1.0 the API picked an
|
|
958
|
+
* arbitrary translation row, so this could come back in another language. */
|
|
856
959
|
name: string;
|
|
857
960
|
sku: string;
|
|
858
961
|
imageUrl?: string;
|
|
@@ -1146,7 +1249,10 @@ interface DigitalDownload {
|
|
|
1146
1249
|
fileName: string;
|
|
1147
1250
|
/** Localized product name the file belongs to (may be null). */
|
|
1148
1251
|
productName: string | null;
|
|
1149
|
-
/**
|
|
1252
|
+
/**
|
|
1253
|
+
* Product slug for linking back to the PDP (may be null). Resolved the same
|
|
1254
|
+
* way as everywhere else: per-locale slug first, then the product id.
|
|
1255
|
+
*/
|
|
1150
1256
|
productSlug: string | null;
|
|
1151
1257
|
fileSize: number;
|
|
1152
1258
|
mimeType: string;
|
|
@@ -1168,7 +1274,10 @@ interface CourseListItem {
|
|
|
1168
1274
|
courseId: string;
|
|
1169
1275
|
/** Localized course (product) name, best-effort. */
|
|
1170
1276
|
name: string | null;
|
|
1171
|
-
/**
|
|
1277
|
+
/**
|
|
1278
|
+
* Product slug for linking to the PDP. Resolved the same way as in the
|
|
1279
|
+
* catalog: per-locale slug first, then the product id.
|
|
1280
|
+
*/
|
|
1172
1281
|
slug: string;
|
|
1173
1282
|
imageUrl: string | null;
|
|
1174
1283
|
totalLessons: number;
|
|
@@ -1220,6 +1329,7 @@ interface CourseModule {
|
|
|
1220
1329
|
interface CourseDetail {
|
|
1221
1330
|
courseId: string;
|
|
1222
1331
|
name: string | null;
|
|
1332
|
+
/** Product slug for linking to the PDP (resolved per-locale slug, else id). */
|
|
1223
1333
|
slug: string;
|
|
1224
1334
|
imageUrl: string | null;
|
|
1225
1335
|
/** Welcome text shown at the top of the member area (markdown). */
|
|
@@ -1572,15 +1682,17 @@ interface Bundle {
|
|
|
1572
1682
|
slug: string;
|
|
1573
1683
|
name: string;
|
|
1574
1684
|
description: string | null;
|
|
1575
|
-
|
|
1685
|
+
/** `null` when the eshop hides prices from guests and this visitor has no price entitlement. */
|
|
1686
|
+
bundlePrice: number | null;
|
|
1576
1687
|
currency: string;
|
|
1577
1688
|
coverImage: string | null;
|
|
1578
1689
|
endsAt: number | null;
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1690
|
+
/** `null` when prices are hidden (see `bundlePrice`). */
|
|
1691
|
+
itemsSum: number | null;
|
|
1692
|
+
/** Absolute saving vs buying the components separately, in `currency`. `null` when prices are hidden. */
|
|
1693
|
+
savings: number | null;
|
|
1694
|
+
/** Percentage saving, 0–100. 0 when `itemsSum` is zero. `null` when prices are hidden. */
|
|
1695
|
+
savingsPercent: number | null;
|
|
1584
1696
|
/** Minimum bundles per order. Default 1. */
|
|
1585
1697
|
minQuantity: number;
|
|
1586
1698
|
/** Maximum bundles per order. `null` = uncapped. */
|
|
@@ -2284,15 +2396,42 @@ declare class CatalogModule {
|
|
|
2284
2396
|
locale?: string;
|
|
2285
2397
|
currency?: string;
|
|
2286
2398
|
}): Promise<SdkResult<PaginatedResponse<ProductListItem>>>;
|
|
2287
|
-
/**
|
|
2288
|
-
|
|
2399
|
+
/**
|
|
2400
|
+
* Available filters for a dynamic filter UI.
|
|
2401
|
+
*
|
|
2402
|
+
* Derived from curated PARAMETERS the merchant marked filterable, so a
|
|
2403
|
+
* visitor can never filter by something that does not appear in the
|
|
2404
|
+
* product's parameters. Labels are per language, hence `locale`.
|
|
2405
|
+
*/
|
|
2406
|
+
getFilters(options?: {
|
|
2407
|
+
locale?: string;
|
|
2408
|
+
}): Promise<SdkResult<{
|
|
2289
2409
|
filters: FilterField[];
|
|
2290
2410
|
}>>;
|
|
2291
2411
|
/**
|
|
2292
|
-
*
|
|
2293
|
-
*
|
|
2294
|
-
*
|
|
2295
|
-
*
|
|
2412
|
+
* Curated parameter groups of a product, already resolved (label, value,
|
|
2413
|
+
* unit, order). Returns an ARRAY of groups so a template can lay them out
|
|
2414
|
+
* however it likes: one group as a spec table, another as badges.
|
|
2415
|
+
*
|
|
2416
|
+
* A variant's own parameters ride along on `ProductDetail.variants[]`, so
|
|
2417
|
+
* this call is for the parent product.
|
|
2418
|
+
*/
|
|
2419
|
+
getProductParameters(slug: string, options?: {
|
|
2420
|
+
locale?: string;
|
|
2421
|
+
}): Promise<SdkResult<ProductParametersResponse>>;
|
|
2422
|
+
/**
|
|
2423
|
+
* One specific parameter group of a product, by its slug. 404 when the
|
|
2424
|
+
* product does not have that group, which is deliberate: the caller asked
|
|
2425
|
+
* for a named thing, so an empty array would hide a wrong slug.
|
|
2426
|
+
*/
|
|
2427
|
+
getProductParameterGroup(slug: string, groupSlug: string, options?: {
|
|
2428
|
+
locale?: string;
|
|
2429
|
+
}): Promise<SdkResult<ProductParameterGroup>>;
|
|
2430
|
+
/**
|
|
2431
|
+
* Facet groups + selection-aware counts for the current filter set
|
|
2432
|
+
* (parameters, labels, price, availability, rating, subcategories). Pass the
|
|
2433
|
+
* SAME query you pass to `getProducts` (category, search, price, inStock,
|
|
2434
|
+
* ratingMin, parameters, facets slugs, labels): counts are computed with
|
|
2296
2435
|
* that facet excluded, and values that drop to 0 are still returned (render
|
|
2297
2436
|
* them disabled). Use this to build an Alza-style filter sidebar.
|
|
2298
2437
|
*/
|
|
@@ -2794,4 +2933,4 @@ declare class NewsletterModule {
|
|
|
2794
2933
|
unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
2795
2934
|
}
|
|
2796
2935
|
|
|
2797
|
-
export { type
|
|
2936
|
+
export { type DigitalDownload as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type CertificateVerification as D, type CheckoutAddress as E, type CheckoutInput as F, type CheckoutPaymentMethod as G, type CheckoutSettings as H, type CookieConsentInput as I, type CourseAttachment as J, type CourseCertificate as K, type CourseComment as L, type CourseCommentReply as M, type CourseCommentsList as N, type CourseDetail as O, type ProductDetail as P, type CourseLesson as Q, type CourseListItem as R, type SdkResult as S, type CourseModule as T, type CoursePostedComment as U, type CourseProgress as V, type CourseTutorMessage as W, type CourseTutorThread as X, type CrossSellItem as Y, type CustomerAddress as Z, type CustomerProfile as _, type ProductVariant as a, type ProductParametersResponse as a$, type DownloadUrl as a0, type Facet as a1, type FacetAvailability as a2, type FacetCategory as a3, type FacetLabel as a4, type FacetPriceRange as a5, type FacetRange as a6, type FacetRatingBucket as a7, type FacetValue as a8, type FacetsResponse as a9, type OrderAccessRequestResponse as aA, type OrderAccessVerifyResponse as aB, type OrderDetail as aC, type OrderItem as aD, type OrderListItem as aE, type OrderStatus as aF, type OrderStatusHistory as aG, OrderStatuses as aH, type OrderTracking as aI, type Page as aJ, type PageAttachment as aK, type PageDetail as aL, type PaginatedResponse as aM, type PaymentStatus as aN, PaymentStatuses as aO, type PickupPoint as aP, type PickupPointHours as aQ, type PickupPointsInput as aR, type PriceDisplay as aS, type ProductAvailability as aT, type ProductGroup as aU, type ProductLabel as aV, type ProductListItem as aW, type ProductMedia as aX, type ProductMediaVariant as aY, type ProductParameter as aZ, type ProductParameterGroup as a_, type FilterField as aa, type FulfillmentStatus as ab, FulfillmentStatuses as ac, type GiftCardBalance as ad, type GiftCardPurchaseInput as ae, type GiftCardPurchaseResult as af, type GiftCardSummary as ag, type LessonNote as ah, type LessonQuiz as ai, type LoginInput as aj, type LoyaltyBalance as ak, type LoyaltyNextTier as al, type LoyaltyProgram as am, type LoyaltySummary as an, type LoyaltyTier as ao, type LoyaltyTierPerks as ap, type LoyaltyTransaction as aq, type Menu as ar, type MenuItem as as, type MenuItemRef as at, type MenuItemType as au, type MessageResponse as av, type NewsletterOptInDefault as aw, type NewsletterSubscribeInput as ax, type NewsletterSubscribeResult as ay, type NewsletterUnsubscribeResult as az, type AddToCartInput as b, type ProductPrice as b0, type ProductPromotionSummary as b1, type ProductReview as b2, type ProductReviewsResponse as b3, ProductSort as b4, type ProductSortValue as b5, type ProductVolumePrice as b6, type ProductsQuery as b7, type QuizAnswerInput as b8, type QuizAnswerResult as b9, type ShopSeoIdentity as bA, type StockBehavior as bB, type StockMode as bC, type SubmitQuoteInput as bD, type SubmitReturnInput as bE, type SubmitReviewInput as bF, type Subscription as bG, type SubscriptionAction as bH, type SubscriptionFrequency as bI, type SubscriptionItem as bJ, type SubscriptionStatus as bK, type TaxBreakdownLine as bL, type VariantAxis as bM, type VariantAxisValue as bN, type WishlistItem as bO, err as bP, ok as bQ, toSdkError as bR, type QuizQuestion as ba, type QuizResult as bb, type QuoteItem as bc, type QuoteRequest as bd, type RegisterInput as be, type RegisterResult as bf, type RequestInterceptor as bg, type RequestInterceptorConfig as bh, type ResponseInterceptor as bi, type ResponseInterceptorData as bj, type ReturnRequest as bk, type ReturnRequestItem as bl, type ReturnStatus as bm, type ReturnStatusItem as bn, type ReturnableOrder as bo, type ReturnableOrderItem as bp, type SdkError as bq, type ShippingMethodSummary as br, type ShippingQuote as bs, type ShippingQuoteInput as bt, type ShopInfo as bu, type ShopScript as bv, type ShopScriptPlacement as bw, type ShopScriptType as bx, type ShopScripts as by, type ShopSeo as bz, type AddressDetail as c, type AddressSuggestion as d, type AddressType as e, AddressTypes as f, type AuthTokens as g, type BackInStockSubscription as h, type BadgeTone as i, BehioApiError as j, type BehioErrorCode as k, type BehioEventHandler as l, type BehioEventType as m, BehioNetworkError as n, type BehioStorefrontConfig as o, type Bundle as p, type BundleItem as q, type Cart as r, type CartBundleLine as s, type CartBundleLineItem as t, type CartDiscount as u, type CartItem as v, type CartItemProduct as w, type CartPromotion as x, type Category as y, type CategoryDetail as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BehioStorefront, S as SdkResult, C as CookieConsent } from './client-
|
|
2
|
-
export { A as ActivePromotion,
|
|
1
|
+
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent } from './client-CiowRIBp.mjs';
|
|
2
|
+
export { A as ActivePromotion, b as AddToCartInput, c as AddressDetail, d as AddressSuggestion, e as AddressType, f as AddressTypes, g as AuthTokens, h as BackInStockSubscription, i as BadgeTone, j as BehioApiError, k as BehioErrorCode, l as BehioEventHandler, m as BehioEventType, n as BehioNetworkError, o as BehioStorefrontConfig, p as Bundle, q as BundleItem, r as Cart, s as CartBundleLine, t as CartBundleLineItem, u as CartDiscount, v as CartItem, w as CartItemProduct, x as CartPromotion, y as Category, z as CategoryDetail, D as CertificateVerification, E as CheckoutAddress, F as CheckoutInput, G as CheckoutPaymentMethod, H as CheckoutSettings, I as CookieConsentInput, J as CourseAttachment, K as CourseCertificate, L as CourseComment, M as CourseCommentReply, N as CourseCommentsList, O as CourseDetail, Q as CourseLesson, R as CourseListItem, T as CourseModule, U as CoursePostedComment, V as CourseProgress, W as CourseTutorMessage, X as CourseTutorThread, Y as CrossSellItem, Z as CustomerAddress, _ as CustomerProfile, $ as DigitalDownload, a0 as DownloadUrl, a1 as Facet, a2 as FacetAvailability, a3 as FacetCategory, a4 as FacetLabel, a5 as FacetPriceRange, a6 as FacetRange, a7 as FacetRatingBucket, a8 as FacetValue, a9 as FacetsResponse, aa as FilterField, ab as FulfillmentStatus, ac as FulfillmentStatuses, ad as GiftCardBalance, ae as GiftCardPurchaseInput, af as GiftCardPurchaseResult, ag as GiftCardSummary, ah as LessonNote, ai as LessonQuiz, aj as LoginInput, ak as LoyaltyBalance, al as LoyaltyNextTier, am as LoyaltyProgram, an as LoyaltySummary, ao as LoyaltyTier, ap as LoyaltyTierPerks, aq as LoyaltyTransaction, ar as Menu, as as MenuItem, at as MenuItemRef, au as MenuItemType, av as MessageResponse, aw as NewsletterOptInDefault, ax as NewsletterSubscribeInput, ay as NewsletterSubscribeResult, az as NewsletterUnsubscribeResult, aA as OrderAccessRequestResponse, aB as OrderAccessVerifyResponse, aC as OrderDetail, aD as OrderItem, aE as OrderListItem, aF as OrderStatus, aG as OrderStatusHistory, aH as OrderStatuses, aI as OrderTracking, aJ as Page, aK as PageAttachment, aL as PageDetail, aM as PaginatedResponse, aN as PaymentStatus, aO as PaymentStatuses, aP as PickupPoint, aQ as PickupPointHours, aR as PickupPointsInput, aS as PriceDisplay, aT as ProductAvailability, aU as ProductGroup, aV as ProductLabel, aW as ProductListItem, aX as ProductMedia, aY as ProductMediaVariant, aZ as ProductParameter, a_ as ProductParameterGroup, a$ as ProductParametersResponse, b0 as ProductPrice, b1 as ProductPromotionSummary, b2 as ProductReview, b3 as ProductReviewsResponse, b4 as ProductSort, b5 as ProductSortValue, b6 as ProductVolumePrice, b7 as ProductsQuery, b8 as QuizAnswerInput, b9 as QuizAnswerResult, ba as QuizQuestion, bb as QuizResult, bc as QuoteItem, bd as QuoteRequest, be as RegisterInput, bf as RegisterResult, bg as RequestInterceptor, bh as RequestInterceptorConfig, bi as ResponseInterceptor, bj as ResponseInterceptorData, bk as ReturnRequest, bl as ReturnRequestItem, bm as ReturnStatus, bn as ReturnStatusItem, bo as ReturnableOrder, bp as ReturnableOrderItem, bq as SdkError, br as ShippingMethodSummary, bs as ShippingQuote, bt as ShippingQuoteInput, bu as ShopInfo, bv as ShopScript, bw as ShopScriptPlacement, bx as ShopScriptType, by as ShopScripts, bz as ShopSeo, bA as ShopSeoIdentity, bB as StockBehavior, bC as StockMode, bD as SubmitQuoteInput, bE as SubmitReturnInput, bF as SubmitReviewInput, bG as Subscription, bH as SubscriptionAction, bI as SubscriptionFrequency, bJ as SubscriptionItem, bK as SubscriptionStatus, bL as TaxBreakdownLine, bM as VariantAxis, bN as VariantAxisValue, bO as WishlistItem, bP as err, bQ as ok, bR as toSdkError } from './client-CiowRIBp.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
|
@@ -11,6 +11,106 @@ export { A as ActivePromotion, a as AddToCartInput, b as AddressDetail, c as Add
|
|
|
11
11
|
*/
|
|
12
12
|
declare function formatPrice(amount: number, currency: string, locale?: string): string;
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Variant selection helpers — server-safe (no React, no DOM).
|
|
16
|
+
*
|
|
17
|
+
* Every storefront that sells variants needs the same four decisions, and every
|
|
18
|
+
* one of them has a wrong answer that looks right on screen:
|
|
19
|
+
*
|
|
20
|
+
* 1. WHICH variant is selected on first render. It has to be decided on the
|
|
21
|
+
* server from `?variant=`, otherwise the page renders the parent's text and
|
|
22
|
+
* swaps it after hydration — a visible flash, and the wrong text in view
|
|
23
|
+
* source for crawlers.
|
|
24
|
+
* 2. WHAT the page shows for it. A variant carries its own name, descriptions
|
|
25
|
+
* and gallery, but only where the merchant filled them in; everywhere else
|
|
26
|
+
* it INHERITS the parent. Rendering the raw variant fields shows empty
|
|
27
|
+
* blocks on shops that only translated the name.
|
|
28
|
+
* 3. WHERE a variant links. A variant has no page of its own, so the link is
|
|
29
|
+
* always the parent's slug plus `?variant=` (see `variantHref`).
|
|
30
|
+
* 4. WHICH variant a click means when there are several axes (colour + size):
|
|
31
|
+
* the answer is "the one matching the whole selection", not "the one whose
|
|
32
|
+
* label I clicked".
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/** Query parameter carrying the preselected variant. One name, everywhere. */
|
|
36
|
+
declare const VARIANT_QUERY_PARAM = "variant";
|
|
37
|
+
/**
|
|
38
|
+
* Content actually rendered for a product page: the variant's own values where
|
|
39
|
+
* it has them, the parent's everywhere else.
|
|
40
|
+
*/
|
|
41
|
+
interface ResolvedVariantContent {
|
|
42
|
+
name: string;
|
|
43
|
+
shortDescription: string | null;
|
|
44
|
+
longDescription: string | null;
|
|
45
|
+
images: ProductDetail["images"];
|
|
46
|
+
/** `true` for each field the variant overrode — handy for debugging a shop. */
|
|
47
|
+
overrides: {
|
|
48
|
+
name: boolean;
|
|
49
|
+
shortDescription: boolean;
|
|
50
|
+
longDescription: boolean;
|
|
51
|
+
images: boolean;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Merge a variant onto its parent product for rendering.
|
|
56
|
+
*
|
|
57
|
+
* Pass `variant: null` (nothing selected yet) and you get the parent unchanged,
|
|
58
|
+
* so a page can call this unconditionally.
|
|
59
|
+
*/
|
|
60
|
+
declare function resolveVariantContent(product: ProductDetail, variant: ProductVariant | null | undefined): ResolvedVariantContent;
|
|
61
|
+
/**
|
|
62
|
+
* Variant preselected by the URL.
|
|
63
|
+
*
|
|
64
|
+
* Accepts whatever the framework hands you (`string`, the array Next.js gives
|
|
65
|
+
* for repeated params, or nothing) and falls back to `null` when the token
|
|
66
|
+
* matches no variant — a stale link must render the parent page, never a 404
|
|
67
|
+
* and never a blank picker.
|
|
68
|
+
*/
|
|
69
|
+
declare function variantFromQuery(product: ProductDetail, value: string | string[] | null | undefined): ProductVariant | null;
|
|
70
|
+
/**
|
|
71
|
+
* Link to a product, optionally with a variant preselected.
|
|
72
|
+
*
|
|
73
|
+
* ALWAYS goes through the parent's slug. Building `/product/${variant.slug}`
|
|
74
|
+
* is the single most repeated bug around variants: it looks correct, and it
|
|
75
|
+
* 404s for every visitor, in the cart, in the XML feeds and in the admin's
|
|
76
|
+
* "open on the web" button — all three of which had exactly that bug.
|
|
77
|
+
*/
|
|
78
|
+
declare function variantHref(productSlug: string, variant?: Pick<ProductVariant, "variantSlug"> | null, basePath?: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* The variant matching a full axis selection (e.g. `{Barva: "modrá", Velikost:
|
|
81
|
+
* "M"}`). Returns `null` while the selection is incomplete or names a
|
|
82
|
+
* combination the merchant never published, which is the moment to disable the
|
|
83
|
+
* buy button rather than to add "some" variant to the cart.
|
|
84
|
+
*/
|
|
85
|
+
declare function findVariantByAttributes(product: ProductDetail, selection: Record<string, string>): ProductVariant | null;
|
|
86
|
+
/**
|
|
87
|
+
* Axis values that lead to an existing variant given what is already picked.
|
|
88
|
+
*
|
|
89
|
+
* Without this a shop happily offers "modrá + XXL", which no variant covers, and
|
|
90
|
+
* the customer finds out by clicking. Pass the current partial selection and the
|
|
91
|
+
* axis being rendered; you get the values worth showing as enabled.
|
|
92
|
+
*/
|
|
93
|
+
declare function availableAxisValues(product: ProductDetail, axisName: string, selection: Record<string, string>): string[];
|
|
94
|
+
/**
|
|
95
|
+
* Rows for a "compare the editions side by side" table: every axis that
|
|
96
|
+
* actually differs between variants, plus price and availability.
|
|
97
|
+
*
|
|
98
|
+
* Built here rather than in each template because the interesting part is what
|
|
99
|
+
* to LEAVE OUT: an axis all variants share carries no information and only
|
|
100
|
+
* makes the table wider.
|
|
101
|
+
*/
|
|
102
|
+
interface VariantComparisonRow {
|
|
103
|
+
label: string;
|
|
104
|
+
/** One cell per variant, in `product.variants` order. */
|
|
105
|
+
values: string[];
|
|
106
|
+
}
|
|
107
|
+
declare function buildVariantComparison(product: ProductDetail, labels: {
|
|
108
|
+
price: string;
|
|
109
|
+
availability: string;
|
|
110
|
+
inStock: string;
|
|
111
|
+
soldOut: string;
|
|
112
|
+
}, formatPriceValue: (variant: ProductVariant) => string): VariantComparisonRow[];
|
|
113
|
+
|
|
14
114
|
/**
|
|
15
115
|
* GA4 e-commerce event helper.
|
|
16
116
|
*
|
|
@@ -124,4 +224,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
|
|
|
124
224
|
success: boolean;
|
|
125
225
|
}>>;
|
|
126
226
|
|
|
127
|
-
export { BehioStorefront, CookieConsent, type EcommerceEventName, type EcommerceItem, type EcommercePayload, SdkResult, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, revokeAnalyticsConsent, trackEcommerceEvent };
|
|
227
|
+
export { BehioStorefront, CookieConsent, type EcommerceEventName, type EcommerceItem, type EcommercePayload, ProductDetail, ProductVariant, type ResolvedVariantContent, SdkResult, VARIANT_QUERY_PARAM, type VariantComparisonRow, availableAxisValues, buildVariantComparison, findVariantByAttributes, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, resolveVariantContent, revokeAnalyticsConsent, trackEcommerceEvent, variantFromQuery, variantHref };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BehioStorefront, S as SdkResult, C as CookieConsent } from './client-
|
|
2
|
-
export { A as ActivePromotion,
|
|
1
|
+
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent } from './client-CiowRIBp.js';
|
|
2
|
+
export { A as ActivePromotion, b as AddToCartInput, c as AddressDetail, d as AddressSuggestion, e as AddressType, f as AddressTypes, g as AuthTokens, h as BackInStockSubscription, i as BadgeTone, j as BehioApiError, k as BehioErrorCode, l as BehioEventHandler, m as BehioEventType, n as BehioNetworkError, o as BehioStorefrontConfig, p as Bundle, q as BundleItem, r as Cart, s as CartBundleLine, t as CartBundleLineItem, u as CartDiscount, v as CartItem, w as CartItemProduct, x as CartPromotion, y as Category, z as CategoryDetail, D as CertificateVerification, E as CheckoutAddress, F as CheckoutInput, G as CheckoutPaymentMethod, H as CheckoutSettings, I as CookieConsentInput, J as CourseAttachment, K as CourseCertificate, L as CourseComment, M as CourseCommentReply, N as CourseCommentsList, O as CourseDetail, Q as CourseLesson, R as CourseListItem, T as CourseModule, U as CoursePostedComment, V as CourseProgress, W as CourseTutorMessage, X as CourseTutorThread, Y as CrossSellItem, Z as CustomerAddress, _ as CustomerProfile, $ as DigitalDownload, a0 as DownloadUrl, a1 as Facet, a2 as FacetAvailability, a3 as FacetCategory, a4 as FacetLabel, a5 as FacetPriceRange, a6 as FacetRange, a7 as FacetRatingBucket, a8 as FacetValue, a9 as FacetsResponse, aa as FilterField, ab as FulfillmentStatus, ac as FulfillmentStatuses, ad as GiftCardBalance, ae as GiftCardPurchaseInput, af as GiftCardPurchaseResult, ag as GiftCardSummary, ah as LessonNote, ai as LessonQuiz, aj as LoginInput, ak as LoyaltyBalance, al as LoyaltyNextTier, am as LoyaltyProgram, an as LoyaltySummary, ao as LoyaltyTier, ap as LoyaltyTierPerks, aq as LoyaltyTransaction, ar as Menu, as as MenuItem, at as MenuItemRef, au as MenuItemType, av as MessageResponse, aw as NewsletterOptInDefault, ax as NewsletterSubscribeInput, ay as NewsletterSubscribeResult, az as NewsletterUnsubscribeResult, aA as OrderAccessRequestResponse, aB as OrderAccessVerifyResponse, aC as OrderDetail, aD as OrderItem, aE as OrderListItem, aF as OrderStatus, aG as OrderStatusHistory, aH as OrderStatuses, aI as OrderTracking, aJ as Page, aK as PageAttachment, aL as PageDetail, aM as PaginatedResponse, aN as PaymentStatus, aO as PaymentStatuses, aP as PickupPoint, aQ as PickupPointHours, aR as PickupPointsInput, aS as PriceDisplay, aT as ProductAvailability, aU as ProductGroup, aV as ProductLabel, aW as ProductListItem, aX as ProductMedia, aY as ProductMediaVariant, aZ as ProductParameter, a_ as ProductParameterGroup, a$ as ProductParametersResponse, b0 as ProductPrice, b1 as ProductPromotionSummary, b2 as ProductReview, b3 as ProductReviewsResponse, b4 as ProductSort, b5 as ProductSortValue, b6 as ProductVolumePrice, b7 as ProductsQuery, b8 as QuizAnswerInput, b9 as QuizAnswerResult, ba as QuizQuestion, bb as QuizResult, bc as QuoteItem, bd as QuoteRequest, be as RegisterInput, bf as RegisterResult, bg as RequestInterceptor, bh as RequestInterceptorConfig, bi as ResponseInterceptor, bj as ResponseInterceptorData, bk as ReturnRequest, bl as ReturnRequestItem, bm as ReturnStatus, bn as ReturnStatusItem, bo as ReturnableOrder, bp as ReturnableOrderItem, bq as SdkError, br as ShippingMethodSummary, bs as ShippingQuote, bt as ShippingQuoteInput, bu as ShopInfo, bv as ShopScript, bw as ShopScriptPlacement, bx as ShopScriptType, by as ShopScripts, bz as ShopSeo, bA as ShopSeoIdentity, bB as StockBehavior, bC as StockMode, bD as SubmitQuoteInput, bE as SubmitReturnInput, bF as SubmitReviewInput, bG as Subscription, bH as SubscriptionAction, bI as SubscriptionFrequency, bJ as SubscriptionItem, bK as SubscriptionStatus, bL as TaxBreakdownLine, bM as VariantAxis, bN as VariantAxisValue, bO as WishlistItem, bP as err, bQ as ok, bR as toSdkError } from './client-CiowRIBp.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
|
@@ -11,6 +11,106 @@ export { A as ActivePromotion, a as AddToCartInput, b as AddressDetail, c as Add
|
|
|
11
11
|
*/
|
|
12
12
|
declare function formatPrice(amount: number, currency: string, locale?: string): string;
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Variant selection helpers — server-safe (no React, no DOM).
|
|
16
|
+
*
|
|
17
|
+
* Every storefront that sells variants needs the same four decisions, and every
|
|
18
|
+
* one of them has a wrong answer that looks right on screen:
|
|
19
|
+
*
|
|
20
|
+
* 1. WHICH variant is selected on first render. It has to be decided on the
|
|
21
|
+
* server from `?variant=`, otherwise the page renders the parent's text and
|
|
22
|
+
* swaps it after hydration — a visible flash, and the wrong text in view
|
|
23
|
+
* source for crawlers.
|
|
24
|
+
* 2. WHAT the page shows for it. A variant carries its own name, descriptions
|
|
25
|
+
* and gallery, but only where the merchant filled them in; everywhere else
|
|
26
|
+
* it INHERITS the parent. Rendering the raw variant fields shows empty
|
|
27
|
+
* blocks on shops that only translated the name.
|
|
28
|
+
* 3. WHERE a variant links. A variant has no page of its own, so the link is
|
|
29
|
+
* always the parent's slug plus `?variant=` (see `variantHref`).
|
|
30
|
+
* 4. WHICH variant a click means when there are several axes (colour + size):
|
|
31
|
+
* the answer is "the one matching the whole selection", not "the one whose
|
|
32
|
+
* label I clicked".
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/** Query parameter carrying the preselected variant. One name, everywhere. */
|
|
36
|
+
declare const VARIANT_QUERY_PARAM = "variant";
|
|
37
|
+
/**
|
|
38
|
+
* Content actually rendered for a product page: the variant's own values where
|
|
39
|
+
* it has them, the parent's everywhere else.
|
|
40
|
+
*/
|
|
41
|
+
interface ResolvedVariantContent {
|
|
42
|
+
name: string;
|
|
43
|
+
shortDescription: string | null;
|
|
44
|
+
longDescription: string | null;
|
|
45
|
+
images: ProductDetail["images"];
|
|
46
|
+
/** `true` for each field the variant overrode — handy for debugging a shop. */
|
|
47
|
+
overrides: {
|
|
48
|
+
name: boolean;
|
|
49
|
+
shortDescription: boolean;
|
|
50
|
+
longDescription: boolean;
|
|
51
|
+
images: boolean;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Merge a variant onto its parent product for rendering.
|
|
56
|
+
*
|
|
57
|
+
* Pass `variant: null` (nothing selected yet) and you get the parent unchanged,
|
|
58
|
+
* so a page can call this unconditionally.
|
|
59
|
+
*/
|
|
60
|
+
declare function resolveVariantContent(product: ProductDetail, variant: ProductVariant | null | undefined): ResolvedVariantContent;
|
|
61
|
+
/**
|
|
62
|
+
* Variant preselected by the URL.
|
|
63
|
+
*
|
|
64
|
+
* Accepts whatever the framework hands you (`string`, the array Next.js gives
|
|
65
|
+
* for repeated params, or nothing) and falls back to `null` when the token
|
|
66
|
+
* matches no variant — a stale link must render the parent page, never a 404
|
|
67
|
+
* and never a blank picker.
|
|
68
|
+
*/
|
|
69
|
+
declare function variantFromQuery(product: ProductDetail, value: string | string[] | null | undefined): ProductVariant | null;
|
|
70
|
+
/**
|
|
71
|
+
* Link to a product, optionally with a variant preselected.
|
|
72
|
+
*
|
|
73
|
+
* ALWAYS goes through the parent's slug. Building `/product/${variant.slug}`
|
|
74
|
+
* is the single most repeated bug around variants: it looks correct, and it
|
|
75
|
+
* 404s for every visitor, in the cart, in the XML feeds and in the admin's
|
|
76
|
+
* "open on the web" button — all three of which had exactly that bug.
|
|
77
|
+
*/
|
|
78
|
+
declare function variantHref(productSlug: string, variant?: Pick<ProductVariant, "variantSlug"> | null, basePath?: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* The variant matching a full axis selection (e.g. `{Barva: "modrá", Velikost:
|
|
81
|
+
* "M"}`). Returns `null` while the selection is incomplete or names a
|
|
82
|
+
* combination the merchant never published, which is the moment to disable the
|
|
83
|
+
* buy button rather than to add "some" variant to the cart.
|
|
84
|
+
*/
|
|
85
|
+
declare function findVariantByAttributes(product: ProductDetail, selection: Record<string, string>): ProductVariant | null;
|
|
86
|
+
/**
|
|
87
|
+
* Axis values that lead to an existing variant given what is already picked.
|
|
88
|
+
*
|
|
89
|
+
* Without this a shop happily offers "modrá + XXL", which no variant covers, and
|
|
90
|
+
* the customer finds out by clicking. Pass the current partial selection and the
|
|
91
|
+
* axis being rendered; you get the values worth showing as enabled.
|
|
92
|
+
*/
|
|
93
|
+
declare function availableAxisValues(product: ProductDetail, axisName: string, selection: Record<string, string>): string[];
|
|
94
|
+
/**
|
|
95
|
+
* Rows for a "compare the editions side by side" table: every axis that
|
|
96
|
+
* actually differs between variants, plus price and availability.
|
|
97
|
+
*
|
|
98
|
+
* Built here rather than in each template because the interesting part is what
|
|
99
|
+
* to LEAVE OUT: an axis all variants share carries no information and only
|
|
100
|
+
* makes the table wider.
|
|
101
|
+
*/
|
|
102
|
+
interface VariantComparisonRow {
|
|
103
|
+
label: string;
|
|
104
|
+
/** One cell per variant, in `product.variants` order. */
|
|
105
|
+
values: string[];
|
|
106
|
+
}
|
|
107
|
+
declare function buildVariantComparison(product: ProductDetail, labels: {
|
|
108
|
+
price: string;
|
|
109
|
+
availability: string;
|
|
110
|
+
inStock: string;
|
|
111
|
+
soldOut: string;
|
|
112
|
+
}, formatPriceValue: (variant: ProductVariant) => string): VariantComparisonRow[];
|
|
113
|
+
|
|
14
114
|
/**
|
|
15
115
|
* GA4 e-commerce event helper.
|
|
16
116
|
*
|
|
@@ -124,4 +224,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
|
|
|
124
224
|
success: boolean;
|
|
125
225
|
}>>;
|
|
126
226
|
|
|
127
|
-
export { BehioStorefront, CookieConsent, type EcommerceEventName, type EcommerceItem, type EcommercePayload, SdkResult, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, revokeAnalyticsConsent, trackEcommerceEvent };
|
|
227
|
+
export { BehioStorefront, CookieConsent, type EcommerceEventName, type EcommerceItem, type EcommercePayload, ProductDetail, ProductVariant, type ResolvedVariantContent, SdkResult, VARIANT_QUERY_PARAM, type VariantComparisonRow, availableAxisValues, buildVariantComparison, findVariantByAttributes, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, resolveVariantContent, revokeAnalyticsConsent, trackEcommerceEvent, variantFromQuery, variantHref };
|