@behio/storefront-sdk 2.29.0 → 2.31.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-SBPQZG4Y.js → chunk-QU4OFGKK.js} +36 -2
- package/dist/{chunk-YDZ2OF4O.mjs → chunk-SGMFDMIW.mjs} +36 -2
- package/dist/{client-CAPtdqzd.d.mts → client-DeAREmgD.d.mts} +58 -4
- package/dist/{client-CAPtdqzd.d.ts → client-DeAREmgD.d.ts} +58 -4
- package/dist/index.d.mts +43 -4
- package/dist/index.d.ts +43 -4
- package/dist/index.js +154 -3
- package/dist/index.mjs +153 -2
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/next.js +5 -6
- package/dist/next.mjs +4 -5
- package/dist/react.d.mts +86 -8
- package/dist/react.d.ts +86 -8
- package/dist/react.js +309 -4
- package/dist/react.mjs +307 -4
- package/package.json +1 -1
|
@@ -1956,6 +1956,10 @@ var FormsModule = class {
|
|
|
1956
1956
|
constructor(client) {
|
|
1957
1957
|
this.client = client;
|
|
1958
1958
|
}
|
|
1959
|
+
/** Only active, published placements. Internal delivery/CRM settings never leave the server. */
|
|
1960
|
+
async placements() {
|
|
1961
|
+
return this.client.request("GET", "/forms");
|
|
1962
|
+
}
|
|
1959
1963
|
/** Public definition of one form (fields + settings). 404 for an unknown or inactive slug. */
|
|
1960
1964
|
async get(slug) {
|
|
1961
1965
|
return this.client.request(
|
|
@@ -2322,12 +2326,23 @@ var NewsletterModule = class {
|
|
|
2322
2326
|
auth: false
|
|
2323
2327
|
});
|
|
2324
2328
|
}
|
|
2329
|
+
/**
|
|
2330
|
+
* An address proves nothing, so this changes nothing yet: if the address is on
|
|
2331
|
+
* the list, its owner receives a signed link. The answer is the same either way.
|
|
2332
|
+
*/
|
|
2325
2333
|
async unsubscribe(email) {
|
|
2334
|
+
return this.requestUnsubscribe({ email });
|
|
2335
|
+
}
|
|
2336
|
+
/** Unsubscribes at once with the signed token from a newsletter e-mail. */
|
|
2337
|
+
async unsubscribeWithToken(token) {
|
|
2338
|
+
return this.requestUnsubscribe({ token });
|
|
2339
|
+
}
|
|
2340
|
+
requestUnsubscribe(input) {
|
|
2326
2341
|
return this.client.request(
|
|
2327
2342
|
"POST",
|
|
2328
2343
|
"/newsletter/unsubscribe",
|
|
2329
2344
|
{
|
|
2330
|
-
body:
|
|
2345
|
+
body: input,
|
|
2331
2346
|
auth: false
|
|
2332
2347
|
}
|
|
2333
2348
|
);
|
|
@@ -2375,6 +2390,25 @@ function emitCartEvent(data) {
|
|
|
2375
2390
|
publishCartSummary({ total: cart.grandTotal, currency: typeof cart.currency === "string" ? cart.currency : null, itemCount: cart.itemCount });
|
|
2376
2391
|
}
|
|
2377
2392
|
|
|
2393
|
+
// src/visitor-ip.ts
|
|
2394
|
+
var IP_SHAPE = /^[0-9a-fA-F:.]{3,45}$/;
|
|
2395
|
+
function ipOf(value) {
|
|
2396
|
+
const trimmed = _optionalChain([value, 'optionalAccess', _58 => _58.trim, 'call', _59 => _59()]);
|
|
2397
|
+
return trimmed && IP_SHAPE.test(trimmed) ? trimmed : void 0;
|
|
2398
|
+
}
|
|
2399
|
+
function sameSecret(given, secret) {
|
|
2400
|
+
if (typeof given !== "string" || given.length !== secret.length) return false;
|
|
2401
|
+
let diff = 0;
|
|
2402
|
+
for (let i = 0; i < secret.length; i++) diff |= given.charCodeAt(i) ^ secret.charCodeAt(i);
|
|
2403
|
+
return diff === 0;
|
|
2404
|
+
}
|
|
2405
|
+
function trustedVisitorIp(headers, originSecret) {
|
|
2406
|
+
const realIp = ipOf(headers.get("x-real-ip"));
|
|
2407
|
+
if (originSecret && !sameSecret(headers.get("x-behio-origin"), originSecret)) return realIp;
|
|
2408
|
+
return _nullishCoalesce(ipOf(headers.get("cf-connecting-ip")), () => ( realIp));
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
|
|
2378
2412
|
|
|
2379
2413
|
|
|
2380
2414
|
|
|
@@ -2389,4 +2423,4 @@ function emitCartEvent(data) {
|
|
|
2389
2423
|
|
|
2390
2424
|
|
|
2391
2425
|
|
|
2392
|
-
exports.ProductSort = ProductSort; exports.OrderStatuses = OrderStatuses; exports.PaymentStatuses = PaymentStatuses; exports.FulfillmentStatuses = FulfillmentStatuses; exports.AddressTypes = AddressTypes; exports.BehioApiError = BehioApiError; exports.BehioNetworkError = BehioNetworkError; exports.ok = ok; exports.err = err; exports.toSdkError = toSdkError; exports.BehioStorefront = BehioStorefront; exports.clearCartSummary = clearCartSummary; exports.publishCartSummary = publishCartSummary;
|
|
2426
|
+
exports.ProductSort = ProductSort; exports.OrderStatuses = OrderStatuses; exports.PaymentStatuses = PaymentStatuses; exports.FulfillmentStatuses = FulfillmentStatuses; exports.AddressTypes = AddressTypes; exports.BehioApiError = BehioApiError; exports.BehioNetworkError = BehioNetworkError; exports.ok = ok; exports.err = err; exports.toSdkError = toSdkError; exports.BehioStorefront = BehioStorefront; exports.clearCartSummary = clearCartSummary; exports.publishCartSummary = publishCartSummary; exports.trustedVisitorIp = trustedVisitorIp;
|
|
@@ -1956,6 +1956,10 @@ var FormsModule = class {
|
|
|
1956
1956
|
constructor(client) {
|
|
1957
1957
|
this.client = client;
|
|
1958
1958
|
}
|
|
1959
|
+
/** Only active, published placements. Internal delivery/CRM settings never leave the server. */
|
|
1960
|
+
async placements() {
|
|
1961
|
+
return this.client.request("GET", "/forms");
|
|
1962
|
+
}
|
|
1959
1963
|
/** Public definition of one form (fields + settings). 404 for an unknown or inactive slug. */
|
|
1960
1964
|
async get(slug) {
|
|
1961
1965
|
return this.client.request(
|
|
@@ -2322,12 +2326,23 @@ var NewsletterModule = class {
|
|
|
2322
2326
|
auth: false
|
|
2323
2327
|
});
|
|
2324
2328
|
}
|
|
2329
|
+
/**
|
|
2330
|
+
* An address proves nothing, so this changes nothing yet: if the address is on
|
|
2331
|
+
* the list, its owner receives a signed link. The answer is the same either way.
|
|
2332
|
+
*/
|
|
2325
2333
|
async unsubscribe(email) {
|
|
2334
|
+
return this.requestUnsubscribe({ email });
|
|
2335
|
+
}
|
|
2336
|
+
/** Unsubscribes at once with the signed token from a newsletter e-mail. */
|
|
2337
|
+
async unsubscribeWithToken(token) {
|
|
2338
|
+
return this.requestUnsubscribe({ token });
|
|
2339
|
+
}
|
|
2340
|
+
requestUnsubscribe(input) {
|
|
2326
2341
|
return this.client.request(
|
|
2327
2342
|
"POST",
|
|
2328
2343
|
"/newsletter/unsubscribe",
|
|
2329
2344
|
{
|
|
2330
|
-
body:
|
|
2345
|
+
body: input,
|
|
2331
2346
|
auth: false
|
|
2332
2347
|
}
|
|
2333
2348
|
);
|
|
@@ -2375,6 +2390,24 @@ function emitCartEvent(data) {
|
|
|
2375
2390
|
publishCartSummary({ total: cart.grandTotal, currency: typeof cart.currency === "string" ? cart.currency : null, itemCount: cart.itemCount });
|
|
2376
2391
|
}
|
|
2377
2392
|
|
|
2393
|
+
// src/visitor-ip.ts
|
|
2394
|
+
var IP_SHAPE = /^[0-9a-fA-F:.]{3,45}$/;
|
|
2395
|
+
function ipOf(value) {
|
|
2396
|
+
const trimmed = value?.trim();
|
|
2397
|
+
return trimmed && IP_SHAPE.test(trimmed) ? trimmed : void 0;
|
|
2398
|
+
}
|
|
2399
|
+
function sameSecret(given, secret) {
|
|
2400
|
+
if (typeof given !== "string" || given.length !== secret.length) return false;
|
|
2401
|
+
let diff = 0;
|
|
2402
|
+
for (let i = 0; i < secret.length; i++) diff |= given.charCodeAt(i) ^ secret.charCodeAt(i);
|
|
2403
|
+
return diff === 0;
|
|
2404
|
+
}
|
|
2405
|
+
function trustedVisitorIp(headers, originSecret) {
|
|
2406
|
+
const realIp = ipOf(headers.get("x-real-ip"));
|
|
2407
|
+
if (originSecret && !sameSecret(headers.get("x-behio-origin"), originSecret)) return realIp;
|
|
2408
|
+
return ipOf(headers.get("cf-connecting-ip")) ?? realIp;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2378
2411
|
export {
|
|
2379
2412
|
ProductSort,
|
|
2380
2413
|
OrderStatuses,
|
|
@@ -2388,5 +2421,6 @@ export {
|
|
|
2388
2421
|
toSdkError,
|
|
2389
2422
|
BehioStorefront,
|
|
2390
2423
|
clearCartSummary,
|
|
2391
|
-
publishCartSummary
|
|
2424
|
+
publishCartSummary,
|
|
2425
|
+
trustedVisitorIp
|
|
2392
2426
|
};
|
|
@@ -300,12 +300,14 @@ interface NewsletterSubscribeInput {
|
|
|
300
300
|
source?: string;
|
|
301
301
|
/** Honeypot: keep empty. A filled value is treated as a bot and ignored. */
|
|
302
302
|
website?: string;
|
|
303
|
+
/** The consent wording shown to the visitor. Only its hash is stored, as proof. */
|
|
304
|
+
consentText?: string;
|
|
303
305
|
}
|
|
304
306
|
interface NewsletterSubscribeResult {
|
|
305
307
|
success: boolean;
|
|
306
308
|
/** Confirm the email before the subscription becomes active. */
|
|
307
309
|
confirmationRequired?: boolean;
|
|
308
|
-
/**
|
|
310
|
+
/** Always false: the answer never reveals who is on the list. */
|
|
309
311
|
alreadySubscribed: boolean;
|
|
310
312
|
}
|
|
311
313
|
interface NewsletterConfirmResult {
|
|
@@ -313,8 +315,15 @@ interface NewsletterConfirmResult {
|
|
|
313
315
|
/** The actual code is delivered by email, never returned to the browser. */
|
|
314
316
|
welcomeDiscountIssued: boolean;
|
|
315
317
|
}
|
|
318
|
+
/** Send exactly one: `token` unsubscribes, `email` only mails a signed link. */
|
|
319
|
+
interface NewsletterUnsubscribeInput {
|
|
320
|
+
email?: string;
|
|
321
|
+
token?: string;
|
|
322
|
+
}
|
|
316
323
|
interface NewsletterUnsubscribeResult {
|
|
317
324
|
success: boolean;
|
|
325
|
+
/** True for a bare email: its owner gets a signed link, nothing has changed yet. */
|
|
326
|
+
confirmationRequired: boolean;
|
|
318
327
|
}
|
|
319
328
|
interface ShopSeo {
|
|
320
329
|
robotsTxt?: string | null;
|
|
@@ -1624,6 +1633,8 @@ interface CheckoutInput {
|
|
|
1624
1633
|
termsConsent?: boolean;
|
|
1625
1634
|
gdprConsent?: boolean;
|
|
1626
1635
|
newsletterOptIn?: boolean;
|
|
1636
|
+
/** Wording of the newsletter checkbox as the customer saw it. Only its hash is stored, as proof of consent. */
|
|
1637
|
+
newsletterConsentText?: string;
|
|
1627
1638
|
/**
|
|
1628
1639
|
* Consent to start delivering digital content (courses, downloads,
|
|
1629
1640
|
* services) before the withdrawal period ends, which waives the right of
|
|
@@ -2496,7 +2507,35 @@ interface StorefrontFaqQuery {
|
|
|
2496
2507
|
locale?: string;
|
|
2497
2508
|
}
|
|
2498
2509
|
/** Public definition of a form (`GET /forms/{slug}`). */
|
|
2510
|
+
interface StorefrontFormPlacement {
|
|
2511
|
+
key: string;
|
|
2512
|
+
mode: "inline" | "popup";
|
|
2513
|
+
enabled: boolean;
|
|
2514
|
+
delaySeconds: number;
|
|
2515
|
+
dismissDays: number;
|
|
2516
|
+
devices: "all" | "mobile" | "desktop";
|
|
2517
|
+
/** Exact path or prefix ending in *. No regex. */
|
|
2518
|
+
includePaths: string[];
|
|
2519
|
+
excludePaths: string[];
|
|
2520
|
+
}
|
|
2521
|
+
interface StorefrontFormPresentation {
|
|
2522
|
+
purpose: "general" | "newsletter";
|
|
2523
|
+
content: {
|
|
2524
|
+
eyebrow: string;
|
|
2525
|
+
heading: string;
|
|
2526
|
+
body: string;
|
|
2527
|
+
imageUrl: string;
|
|
2528
|
+
imageAlt: string;
|
|
2529
|
+
dismissLabel: string;
|
|
2530
|
+
backgroundColor: string;
|
|
2531
|
+
accentColor: string;
|
|
2532
|
+
};
|
|
2533
|
+
placements: StorefrontFormPlacement[];
|
|
2534
|
+
}
|
|
2499
2535
|
interface StorefrontForm {
|
|
2536
|
+
/** Published content version. Requires the managed Forms API. */
|
|
2537
|
+
revision: number;
|
|
2538
|
+
presentation: StorefrontFormPresentation;
|
|
2500
2539
|
slug: string;
|
|
2501
2540
|
name: string;
|
|
2502
2541
|
description: string | null;
|
|
@@ -2504,6 +2543,8 @@ interface StorefrontForm {
|
|
|
2504
2543
|
settings: StorefrontFormSettings;
|
|
2505
2544
|
}
|
|
2506
2545
|
interface StorefrontFormSubmitInput {
|
|
2546
|
+
revision?: number;
|
|
2547
|
+
placement?: string;
|
|
2507
2548
|
/** `{fieldKey: value}`; unknown keys are dropped server-side. */
|
|
2508
2549
|
data: Record<string, unknown>;
|
|
2509
2550
|
locale?: string;
|
|
@@ -2539,6 +2580,8 @@ interface StorefrontFormFile {
|
|
|
2539
2580
|
type: string;
|
|
2540
2581
|
}
|
|
2541
2582
|
interface StorefrontFormSubmitResult {
|
|
2583
|
+
confirmationRequired?: boolean;
|
|
2584
|
+
alreadySubscribed?: boolean;
|
|
2542
2585
|
ok: boolean;
|
|
2543
2586
|
/** Id of the stored submission (null when the form does not store responses). */
|
|
2544
2587
|
id: string | null;
|
|
@@ -4423,6 +4466,10 @@ declare class BookingsModule {
|
|
|
4423
4466
|
declare class FormsModule {
|
|
4424
4467
|
private client;
|
|
4425
4468
|
constructor(client: BehioStorefront);
|
|
4469
|
+
/** Only active, published placements. Internal delivery/CRM settings never leave the server. */
|
|
4470
|
+
placements(): Promise<SdkResult<{
|
|
4471
|
+
items: StorefrontForm[];
|
|
4472
|
+
}>>;
|
|
4426
4473
|
/** Public definition of one form (fields + settings). 404 for an unknown or inactive slug. */
|
|
4427
4474
|
get(slug: string): Promise<SdkResult<StorefrontForm>>;
|
|
4428
4475
|
/**
|
|
@@ -4622,8 +4669,8 @@ declare class ShippingModule {
|
|
|
4622
4669
|
/**
|
|
4623
4670
|
* First-party newsletter opt-in. Use for the footer signup block and the
|
|
4624
4671
|
* checkout newsletter checkbox (render its default from
|
|
4625
|
-
* `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and
|
|
4626
|
-
*
|
|
4672
|
+
* `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and the
|
|
4673
|
+
* answer never reveals who is on the list. Pass the hidden `website`
|
|
4627
4674
|
* honeypot field straight through from your form: a filled value is silently
|
|
4628
4675
|
* accepted but stored nowhere.
|
|
4629
4676
|
*/
|
|
@@ -4632,7 +4679,14 @@ declare class NewsletterModule {
|
|
|
4632
4679
|
constructor(client: BehioStorefront);
|
|
4633
4680
|
subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
|
|
4634
4681
|
confirm(token: string): Promise<SdkResult<NewsletterConfirmResult>>;
|
|
4682
|
+
/**
|
|
4683
|
+
* An address proves nothing, so this changes nothing yet: if the address is on
|
|
4684
|
+
* the list, its owner receives a signed link. The answer is the same either way.
|
|
4685
|
+
*/
|
|
4635
4686
|
unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
4687
|
+
/** Unsubscribes at once with the signed token from a newsletter e-mail. */
|
|
4688
|
+
unsubscribeWithToken(token: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
4689
|
+
private requestUnsubscribe;
|
|
4636
4690
|
}
|
|
4637
4691
|
/** Souhrn kosiku pro skripty na strance (Behio Chat, analytika). */
|
|
4638
4692
|
interface CartSummaryEvent {
|
|
@@ -4645,4 +4699,4 @@ declare function clearCartSummary(): void;
|
|
|
4645
4699
|
/** Publish only authoritative current totals; server cart consumers call this after hydration and revalidation. */
|
|
4646
4700
|
declare function publishCartSummary(summary: CartSummaryEvent): void;
|
|
4647
4701
|
|
|
4648
|
-
export { type
|
|
4702
|
+
export { type CartLinkClaimed as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type BookingCategory as D, type BookingConfig as E, type BookingCreateInput as F, type BookingCreated as G, type BookingLocale as H, type BookingLocation as I, type BookingManageSlotsQuery as J, type BookingService as K, type BookingSlot as L, type BookingSlots as M, type BookingSlotsQuery as N, type BookingStaff as O, type ProductDetail as P, type BookingStatus as Q, type Bundle as R, type SdkResult as S, type BundleCatalogQuery as T, type BundleItem as U, type Cart as V, type CartBundleLine as W, type CartBundleLineItem as X, type CartDiscount as Y, type CartItem as Z, type CartItemProduct as _, type ProductVariant as a, type LoyaltyTransaction as a$, type CartPromotion as a0, type CartSummaryEvent as a1, type Category as a2, type CategoryDetail as a3, type CertificateVerification as a4, type CheckoutAddress as a5, type CheckoutInput as a6, type CheckoutPaymentMethod as a7, type CheckoutPreview as a8, type CheckoutResult as a9, type FacetAvailability as aA, type FacetCategory as aB, type FacetLabel as aC, type FacetPriceRange as aD, type FacetRange as aE, type FacetRatingBucket as aF, type FacetValue as aG, type FacetsResponse as aH, type FilterField as aI, type FulfillmentStatus as aJ, FulfillmentStatuses as aK, type GamificationRefreshResult as aL, type GiftCardBalance as aM, type GiftCardPurchaseInput as aN, type GiftCardPurchaseResult as aO, type GiftCardSummary as aP, type LessonNote as aQ, type LessonQuiz as aR, type LoginInput as aS, type LoyaltyBalance as aT, type LoyaltyNextTier as aU, type LoyaltyProgram as aV, type LoyaltyQuery as aW, type LoyaltyReferralResult as aX, type LoyaltySummary as aY, type LoyaltyTier as aZ, type LoyaltyTierPerks as a_, type CheckoutSettings as aa, type CookieConsentInput as ab, type CourseAttachment as ac, type CourseCertificate as ad, type CourseComment as ae, type CourseCommentReply as af, type CourseCommentsList as ag, type CourseDetail as ah, type CourseLesson as ai, type CourseListItem as aj, type CourseModule as ak, type CoursePostedComment as al, type CourseProgress as am, type CourseTutorMessage as an, type CourseTutorThread as ao, type CrossSellItem as ap, type CurrencyDisplayFormat as aq, type CustomerAddress as ar, type CustomerBadge as as, type CustomerChallenge as at, type CustomerGamification as au, type CustomerGamificationQuery as av, type CustomerProfile as aw, type DigitalDownload as ax, type DownloadUrl as ay, type Facet as az, type StorefrontFormFieldError as b, type QuoteRequest as b$, type Menu as b0, type MenuItem as b1, type MenuItemRef as b2, type MenuItemType as b3, type MessageResponse as b4, type NewsletterConfirmResult as b5, type NewsletterOptInDefault as b6, type NewsletterSubscribeInput as b7, type NewsletterSubscribeResult as b8, type NewsletterUnsubscribeInput as b9, type PickupWidgetConfig as bA, type PriceDisplay as bB, type ProductAssetGroup as bC, type ProductAssetItem as bD, type ProductAvailability as bE, type ProductGroup as bF, type ProductLabel as bG, type ProductListItem as bH, type ProductMedia as bI, type ProductMediaVariant as bJ, type ProductParameter as bK, type ProductParameterGroup as bL, type ProductParametersResponse as bM, type ProductPrice as bN, type ProductPromotionSummary as bO, type ProductReview as bP, type ProductReviewsResponse as bQ, type ProductSibling as bR, ProductSort as bS, type ProductSortValue as bT, type ProductVolumePrice as bU, type ProductsQuery as bV, type QuizAnswerInput as bW, type QuizAnswerResult as bX, type QuizQuestion as bY, type QuizResult as bZ, type QuoteItem as b_, type NewsletterUnsubscribeResult as ba, type OrderAccessRequestResponse as bb, type OrderAccessVerifyResponse as bc, type OrderDetail as bd, type OrderDiscount as be, type OrderDocument as bf, type OrderItem as bg, type OrderListItem as bh, type OrderPaymentInstructions as bi, type OrderPickupPoint as bj, type OrderShipment as bk, type OrderStatus as bl, type OrderStatusHistory as bm, OrderStatuses as bn, type OrderTracking as bo, type Page as bp, type PageAttachment as bq, type PageDetail as br, type PaginatedResponse as bs, type PaymentInstrument as bt, type PaymentStatus as bu, PaymentStatuses as bv, type PaymentSwift as bw, type PickupPoint as bx, type PickupPointHours as by, type PickupPointsInput as bz, type StorefrontFormPlacement as c, type WishlistItem as c$, type RegisterInput as c0, type RegisterResult as c1, type RequestInterceptor as c2, type RequestInterceptorConfig as c3, type ResponseInterceptor as c4, type ResponseInterceptorData as c5, type ReturnRequest as c6, type ReturnRequestItem as c7, type ReturnStatus as c8, type ReturnStatusItem as c9, type StorefrontCollectionItem as cA, type StorefrontCollectionQuery as cB, type StorefrontFaqGroup as cC, type StorefrontFaqGroupSummary as cD, type StorefrontFaqGroups as cE, type StorefrontFaqItem as cF, type StorefrontFaqQuery as cG, type StorefrontForm as cH, type StorefrontFormFieldErrorCode as cI, type StorefrontFormFile as cJ, type StorefrontFormPresentation as cK, type StorefrontFormSettings as cL, type StorefrontFormSubmitInput as cM, type StorefrontFormSubmitResult as cN, type StorefrontFormUpload as cO, type SubmitQuoteInput as cP, type SubmitReturnInput as cQ, type SubmitReviewInput as cR, type SubmitWithdrawalInput as cS, type Subscription as cT, type SubscriptionAction as cU, type SubscriptionFrequency as cV, type SubscriptionItem as cW, type SubscriptionStatus as cX, type TaxBreakdownLine as cY, type VariantAxis as cZ, type VariantAxisValue as c_, type ReturnableOrder as ca, type ReturnableOrderItem as cb, type SdkError as cc, type ShippingMethodSummary as cd, type ShippingPublicConfig as ce, type ShippingQuote as cf, type ShippingQuoteInput as cg, type ShopAppearance as ch, type ShopCommerce as ci, type ShopInfo as cj, type ShopScript as ck, type ShopScriptPlacement as cl, type ShopScriptType as cm, type ShopScripts as cn, type ShopSeo as co, type ShopSeoIdentity as cp, type SiteFormField as cq, type SiteFormFieldOption as cr, type SiteFormFieldType as cs, type Sitemap as ct, type SitemapEntry as cu, type StockBehavior as cv, type StockMode as cw, type StorefrontCollection as cx, type StorefrontCollectionField as cy, type StorefrontCollectionFieldType as cz, type AddToCartInput as d, type WithdrawalAcknowledgement as d0, type WithdrawalFlag as d1, type WithdrawalSettings as d2, type WithdrawalWindow as d3, clearCartSummary as d4, err as d5, ok as d6, publishCartSummary as d7, toSdkError as d8, type AddToCartItemsInput as e, type AddressDetail as f, type AddressSuggestion as g, type AddressType as h, AddressTypes as i, type AuthTokens as j, type BackInStockSubscription as k, type BadgeTone as l, BehioApiError as m, type BehioErrorCode as n, type BehioEventHandler as o, type BehioEventType as p, BehioNetworkError as q, type BehioStorefrontConfig as r, type Blog as s, type BlogPostDetail as t, type BlogPostListItem as u, type BlogPostsPage as v, type BlogPostsQuery as w, type BlogSettings as x, type BlogTag as y, type Booking as z };
|
|
@@ -300,12 +300,14 @@ interface NewsletterSubscribeInput {
|
|
|
300
300
|
source?: string;
|
|
301
301
|
/** Honeypot: keep empty. A filled value is treated as a bot and ignored. */
|
|
302
302
|
website?: string;
|
|
303
|
+
/** The consent wording shown to the visitor. Only its hash is stored, as proof. */
|
|
304
|
+
consentText?: string;
|
|
303
305
|
}
|
|
304
306
|
interface NewsletterSubscribeResult {
|
|
305
307
|
success: boolean;
|
|
306
308
|
/** Confirm the email before the subscription becomes active. */
|
|
307
309
|
confirmationRequired?: boolean;
|
|
308
|
-
/**
|
|
310
|
+
/** Always false: the answer never reveals who is on the list. */
|
|
309
311
|
alreadySubscribed: boolean;
|
|
310
312
|
}
|
|
311
313
|
interface NewsletterConfirmResult {
|
|
@@ -313,8 +315,15 @@ interface NewsletterConfirmResult {
|
|
|
313
315
|
/** The actual code is delivered by email, never returned to the browser. */
|
|
314
316
|
welcomeDiscountIssued: boolean;
|
|
315
317
|
}
|
|
318
|
+
/** Send exactly one: `token` unsubscribes, `email` only mails a signed link. */
|
|
319
|
+
interface NewsletterUnsubscribeInput {
|
|
320
|
+
email?: string;
|
|
321
|
+
token?: string;
|
|
322
|
+
}
|
|
316
323
|
interface NewsletterUnsubscribeResult {
|
|
317
324
|
success: boolean;
|
|
325
|
+
/** True for a bare email: its owner gets a signed link, nothing has changed yet. */
|
|
326
|
+
confirmationRequired: boolean;
|
|
318
327
|
}
|
|
319
328
|
interface ShopSeo {
|
|
320
329
|
robotsTxt?: string | null;
|
|
@@ -1624,6 +1633,8 @@ interface CheckoutInput {
|
|
|
1624
1633
|
termsConsent?: boolean;
|
|
1625
1634
|
gdprConsent?: boolean;
|
|
1626
1635
|
newsletterOptIn?: boolean;
|
|
1636
|
+
/** Wording of the newsletter checkbox as the customer saw it. Only its hash is stored, as proof of consent. */
|
|
1637
|
+
newsletterConsentText?: string;
|
|
1627
1638
|
/**
|
|
1628
1639
|
* Consent to start delivering digital content (courses, downloads,
|
|
1629
1640
|
* services) before the withdrawal period ends, which waives the right of
|
|
@@ -2496,7 +2507,35 @@ interface StorefrontFaqQuery {
|
|
|
2496
2507
|
locale?: string;
|
|
2497
2508
|
}
|
|
2498
2509
|
/** Public definition of a form (`GET /forms/{slug}`). */
|
|
2510
|
+
interface StorefrontFormPlacement {
|
|
2511
|
+
key: string;
|
|
2512
|
+
mode: "inline" | "popup";
|
|
2513
|
+
enabled: boolean;
|
|
2514
|
+
delaySeconds: number;
|
|
2515
|
+
dismissDays: number;
|
|
2516
|
+
devices: "all" | "mobile" | "desktop";
|
|
2517
|
+
/** Exact path or prefix ending in *. No regex. */
|
|
2518
|
+
includePaths: string[];
|
|
2519
|
+
excludePaths: string[];
|
|
2520
|
+
}
|
|
2521
|
+
interface StorefrontFormPresentation {
|
|
2522
|
+
purpose: "general" | "newsletter";
|
|
2523
|
+
content: {
|
|
2524
|
+
eyebrow: string;
|
|
2525
|
+
heading: string;
|
|
2526
|
+
body: string;
|
|
2527
|
+
imageUrl: string;
|
|
2528
|
+
imageAlt: string;
|
|
2529
|
+
dismissLabel: string;
|
|
2530
|
+
backgroundColor: string;
|
|
2531
|
+
accentColor: string;
|
|
2532
|
+
};
|
|
2533
|
+
placements: StorefrontFormPlacement[];
|
|
2534
|
+
}
|
|
2499
2535
|
interface StorefrontForm {
|
|
2536
|
+
/** Published content version. Requires the managed Forms API. */
|
|
2537
|
+
revision: number;
|
|
2538
|
+
presentation: StorefrontFormPresentation;
|
|
2500
2539
|
slug: string;
|
|
2501
2540
|
name: string;
|
|
2502
2541
|
description: string | null;
|
|
@@ -2504,6 +2543,8 @@ interface StorefrontForm {
|
|
|
2504
2543
|
settings: StorefrontFormSettings;
|
|
2505
2544
|
}
|
|
2506
2545
|
interface StorefrontFormSubmitInput {
|
|
2546
|
+
revision?: number;
|
|
2547
|
+
placement?: string;
|
|
2507
2548
|
/** `{fieldKey: value}`; unknown keys are dropped server-side. */
|
|
2508
2549
|
data: Record<string, unknown>;
|
|
2509
2550
|
locale?: string;
|
|
@@ -2539,6 +2580,8 @@ interface StorefrontFormFile {
|
|
|
2539
2580
|
type: string;
|
|
2540
2581
|
}
|
|
2541
2582
|
interface StorefrontFormSubmitResult {
|
|
2583
|
+
confirmationRequired?: boolean;
|
|
2584
|
+
alreadySubscribed?: boolean;
|
|
2542
2585
|
ok: boolean;
|
|
2543
2586
|
/** Id of the stored submission (null when the form does not store responses). */
|
|
2544
2587
|
id: string | null;
|
|
@@ -4423,6 +4466,10 @@ declare class BookingsModule {
|
|
|
4423
4466
|
declare class FormsModule {
|
|
4424
4467
|
private client;
|
|
4425
4468
|
constructor(client: BehioStorefront);
|
|
4469
|
+
/** Only active, published placements. Internal delivery/CRM settings never leave the server. */
|
|
4470
|
+
placements(): Promise<SdkResult<{
|
|
4471
|
+
items: StorefrontForm[];
|
|
4472
|
+
}>>;
|
|
4426
4473
|
/** Public definition of one form (fields + settings). 404 for an unknown or inactive slug. */
|
|
4427
4474
|
get(slug: string): Promise<SdkResult<StorefrontForm>>;
|
|
4428
4475
|
/**
|
|
@@ -4622,8 +4669,8 @@ declare class ShippingModule {
|
|
|
4622
4669
|
/**
|
|
4623
4670
|
* First-party newsletter opt-in. Use for the footer signup block and the
|
|
4624
4671
|
* checkout newsletter checkbox (render its default from
|
|
4625
|
-
* `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and
|
|
4626
|
-
*
|
|
4672
|
+
* `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and the
|
|
4673
|
+
* answer never reveals who is on the list. Pass the hidden `website`
|
|
4627
4674
|
* honeypot field straight through from your form: a filled value is silently
|
|
4628
4675
|
* accepted but stored nowhere.
|
|
4629
4676
|
*/
|
|
@@ -4632,7 +4679,14 @@ declare class NewsletterModule {
|
|
|
4632
4679
|
constructor(client: BehioStorefront);
|
|
4633
4680
|
subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
|
|
4634
4681
|
confirm(token: string): Promise<SdkResult<NewsletterConfirmResult>>;
|
|
4682
|
+
/**
|
|
4683
|
+
* An address proves nothing, so this changes nothing yet: if the address is on
|
|
4684
|
+
* the list, its owner receives a signed link. The answer is the same either way.
|
|
4685
|
+
*/
|
|
4635
4686
|
unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
4687
|
+
/** Unsubscribes at once with the signed token from a newsletter e-mail. */
|
|
4688
|
+
unsubscribeWithToken(token: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
4689
|
+
private requestUnsubscribe;
|
|
4636
4690
|
}
|
|
4637
4691
|
/** Souhrn kosiku pro skripty na strance (Behio Chat, analytika). */
|
|
4638
4692
|
interface CartSummaryEvent {
|
|
@@ -4645,4 +4699,4 @@ declare function clearCartSummary(): void;
|
|
|
4645
4699
|
/** Publish only authoritative current totals; server cart consumers call this after hydration and revalidation. */
|
|
4646
4700
|
declare function publishCartSummary(summary: CartSummaryEvent): void;
|
|
4647
4701
|
|
|
4648
|
-
export { type
|
|
4702
|
+
export { type CartLinkClaimed as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type BookingCategory as D, type BookingConfig as E, type BookingCreateInput as F, type BookingCreated as G, type BookingLocale as H, type BookingLocation as I, type BookingManageSlotsQuery as J, type BookingService as K, type BookingSlot as L, type BookingSlots as M, type BookingSlotsQuery as N, type BookingStaff as O, type ProductDetail as P, type BookingStatus as Q, type Bundle as R, type SdkResult as S, type BundleCatalogQuery as T, type BundleItem as U, type Cart as V, type CartBundleLine as W, type CartBundleLineItem as X, type CartDiscount as Y, type CartItem as Z, type CartItemProduct as _, type ProductVariant as a, type LoyaltyTransaction as a$, type CartPromotion as a0, type CartSummaryEvent as a1, type Category as a2, type CategoryDetail as a3, type CertificateVerification as a4, type CheckoutAddress as a5, type CheckoutInput as a6, type CheckoutPaymentMethod as a7, type CheckoutPreview as a8, type CheckoutResult as a9, type FacetAvailability as aA, type FacetCategory as aB, type FacetLabel as aC, type FacetPriceRange as aD, type FacetRange as aE, type FacetRatingBucket as aF, type FacetValue as aG, type FacetsResponse as aH, type FilterField as aI, type FulfillmentStatus as aJ, FulfillmentStatuses as aK, type GamificationRefreshResult as aL, type GiftCardBalance as aM, type GiftCardPurchaseInput as aN, type GiftCardPurchaseResult as aO, type GiftCardSummary as aP, type LessonNote as aQ, type LessonQuiz as aR, type LoginInput as aS, type LoyaltyBalance as aT, type LoyaltyNextTier as aU, type LoyaltyProgram as aV, type LoyaltyQuery as aW, type LoyaltyReferralResult as aX, type LoyaltySummary as aY, type LoyaltyTier as aZ, type LoyaltyTierPerks as a_, type CheckoutSettings as aa, type CookieConsentInput as ab, type CourseAttachment as ac, type CourseCertificate as ad, type CourseComment as ae, type CourseCommentReply as af, type CourseCommentsList as ag, type CourseDetail as ah, type CourseLesson as ai, type CourseListItem as aj, type CourseModule as ak, type CoursePostedComment as al, type CourseProgress as am, type CourseTutorMessage as an, type CourseTutorThread as ao, type CrossSellItem as ap, type CurrencyDisplayFormat as aq, type CustomerAddress as ar, type CustomerBadge as as, type CustomerChallenge as at, type CustomerGamification as au, type CustomerGamificationQuery as av, type CustomerProfile as aw, type DigitalDownload as ax, type DownloadUrl as ay, type Facet as az, type StorefrontFormFieldError as b, type QuoteRequest as b$, type Menu as b0, type MenuItem as b1, type MenuItemRef as b2, type MenuItemType as b3, type MessageResponse as b4, type NewsletterConfirmResult as b5, type NewsletterOptInDefault as b6, type NewsletterSubscribeInput as b7, type NewsletterSubscribeResult as b8, type NewsletterUnsubscribeInput as b9, type PickupWidgetConfig as bA, type PriceDisplay as bB, type ProductAssetGroup as bC, type ProductAssetItem as bD, type ProductAvailability as bE, type ProductGroup as bF, type ProductLabel as bG, type ProductListItem as bH, type ProductMedia as bI, type ProductMediaVariant as bJ, type ProductParameter as bK, type ProductParameterGroup as bL, type ProductParametersResponse as bM, type ProductPrice as bN, type ProductPromotionSummary as bO, type ProductReview as bP, type ProductReviewsResponse as bQ, type ProductSibling as bR, ProductSort as bS, type ProductSortValue as bT, type ProductVolumePrice as bU, type ProductsQuery as bV, type QuizAnswerInput as bW, type QuizAnswerResult as bX, type QuizQuestion as bY, type QuizResult as bZ, type QuoteItem as b_, type NewsletterUnsubscribeResult as ba, type OrderAccessRequestResponse as bb, type OrderAccessVerifyResponse as bc, type OrderDetail as bd, type OrderDiscount as be, type OrderDocument as bf, type OrderItem as bg, type OrderListItem as bh, type OrderPaymentInstructions as bi, type OrderPickupPoint as bj, type OrderShipment as bk, type OrderStatus as bl, type OrderStatusHistory as bm, OrderStatuses as bn, type OrderTracking as bo, type Page as bp, type PageAttachment as bq, type PageDetail as br, type PaginatedResponse as bs, type PaymentInstrument as bt, type PaymentStatus as bu, PaymentStatuses as bv, type PaymentSwift as bw, type PickupPoint as bx, type PickupPointHours as by, type PickupPointsInput as bz, type StorefrontFormPlacement as c, type WishlistItem as c$, type RegisterInput as c0, type RegisterResult as c1, type RequestInterceptor as c2, type RequestInterceptorConfig as c3, type ResponseInterceptor as c4, type ResponseInterceptorData as c5, type ReturnRequest as c6, type ReturnRequestItem as c7, type ReturnStatus as c8, type ReturnStatusItem as c9, type StorefrontCollectionItem as cA, type StorefrontCollectionQuery as cB, type StorefrontFaqGroup as cC, type StorefrontFaqGroupSummary as cD, type StorefrontFaqGroups as cE, type StorefrontFaqItem as cF, type StorefrontFaqQuery as cG, type StorefrontForm as cH, type StorefrontFormFieldErrorCode as cI, type StorefrontFormFile as cJ, type StorefrontFormPresentation as cK, type StorefrontFormSettings as cL, type StorefrontFormSubmitInput as cM, type StorefrontFormSubmitResult as cN, type StorefrontFormUpload as cO, type SubmitQuoteInput as cP, type SubmitReturnInput as cQ, type SubmitReviewInput as cR, type SubmitWithdrawalInput as cS, type Subscription as cT, type SubscriptionAction as cU, type SubscriptionFrequency as cV, type SubscriptionItem as cW, type SubscriptionStatus as cX, type TaxBreakdownLine as cY, type VariantAxis as cZ, type VariantAxisValue as c_, type ReturnableOrder as ca, type ReturnableOrderItem as cb, type SdkError as cc, type ShippingMethodSummary as cd, type ShippingPublicConfig as ce, type ShippingQuote as cf, type ShippingQuoteInput as cg, type ShopAppearance as ch, type ShopCommerce as ci, type ShopInfo as cj, type ShopScript as ck, type ShopScriptPlacement as cl, type ShopScriptType as cm, type ShopScripts as cn, type ShopSeo as co, type ShopSeoIdentity as cp, type SiteFormField as cq, type SiteFormFieldOption as cr, type SiteFormFieldType as cs, type Sitemap as ct, type SitemapEntry as cu, type StockBehavior as cv, type StockMode as cw, type StorefrontCollection as cx, type StorefrontCollectionField as cy, type StorefrontCollectionFieldType as cz, type AddToCartInput as d, type WithdrawalAcknowledgement as d0, type WithdrawalFlag as d1, type WithdrawalSettings as d2, type WithdrawalWindow as d3, clearCartSummary as d4, err as d5, ok as d6, publishCartSummary as d7, toSdkError as d8, type AddToCartItemsInput as e, type AddressDetail as f, type AddressSuggestion as g, type AddressType as h, AddressTypes as i, type AuthTokens as j, type BackInStockSubscription as k, type BadgeTone as l, BehioApiError as m, type BehioErrorCode as n, type BehioEventHandler as o, type BehioEventType as p, BehioNetworkError as q, type BehioStorefrontConfig as r, type Blog as s, type BlogPostDetail as t, type BlogPostListItem as u, type BlogPostsPage as v, type BlogPostsQuery as w, type BlogSettings as x, type BlogTag as y, type Booking as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-
|
|
2
|
-
export { A as ActivePromotion,
|
|
1
|
+
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError, c as StorefrontFormPlacement } from './client-DeAREmgD.mjs';
|
|
2
|
+
export { A as ActivePromotion, d as AddToCartInput, e as AddToCartItemsInput, f as AddressDetail, g as AddressSuggestion, h as AddressType, i as AddressTypes, j as AuthTokens, k as BackInStockSubscription, l as BadgeTone, m as BehioApiError, n as BehioErrorCode, o as BehioEventHandler, p as BehioEventType, q as BehioNetworkError, r as BehioStorefrontConfig, s as Blog, t as BlogPostDetail, u as BlogPostListItem, v as BlogPostsPage, w as BlogPostsQuery, x as BlogSettings, y as BlogTag, z as Booking, D as BookingCategory, E as BookingConfig, F as BookingCreateInput, G as BookingCreated, H as BookingLocale, I as BookingLocation, J as BookingManageSlotsQuery, K as BookingService, L as BookingSlot, M as BookingSlots, N as BookingSlotsQuery, O as BookingStaff, Q as BookingStatus, R as Bundle, T as BundleCatalogQuery, U as BundleItem, V as Cart, W as CartBundleLine, X as CartBundleLineItem, Y as CartDiscount, Z as CartItem, _ as CartItemProduct, $ as CartLinkClaimed, a0 as CartPromotion, a1 as CartSummaryEvent, a2 as Category, a3 as CategoryDetail, a4 as CertificateVerification, a5 as CheckoutAddress, a6 as CheckoutInput, a7 as CheckoutPaymentMethod, a8 as CheckoutPreview, a9 as CheckoutResult, aa as CheckoutSettings, ab as CookieConsentInput, ac as CourseAttachment, ad as CourseCertificate, ae as CourseComment, af as CourseCommentReply, ag as CourseCommentsList, ah as CourseDetail, ai as CourseLesson, aj as CourseListItem, ak as CourseModule, al as CoursePostedComment, am as CourseProgress, an as CourseTutorMessage, ao as CourseTutorThread, ap as CrossSellItem, aq as CurrencyDisplayFormat, ar as CustomerAddress, as as CustomerBadge, at as CustomerChallenge, au as CustomerGamification, av as CustomerGamificationQuery, aw as CustomerProfile, ax as DigitalDownload, ay as DownloadUrl, az as Facet, aA as FacetAvailability, aB as FacetCategory, aC as FacetLabel, aD as FacetPriceRange, aE as FacetRange, aF as FacetRatingBucket, aG as FacetValue, aH as FacetsResponse, aI as FilterField, aJ as FulfillmentStatus, aK as FulfillmentStatuses, aL as GamificationRefreshResult, aM as GiftCardBalance, aN as GiftCardPurchaseInput, aO as GiftCardPurchaseResult, aP as GiftCardSummary, aQ as LessonNote, aR as LessonQuiz, aS as LoginInput, aT as LoyaltyBalance, aU as LoyaltyNextTier, aV as LoyaltyProgram, aW as LoyaltyQuery, aX as LoyaltyReferralResult, aY as LoyaltySummary, aZ as LoyaltyTier, a_ as LoyaltyTierPerks, a$ as LoyaltyTransaction, b0 as Menu, b1 as MenuItem, b2 as MenuItemRef, b3 as MenuItemType, b4 as MessageResponse, b5 as NewsletterConfirmResult, b6 as NewsletterOptInDefault, b7 as NewsletterSubscribeInput, b8 as NewsletterSubscribeResult, b9 as NewsletterUnsubscribeInput, ba as NewsletterUnsubscribeResult, bb as OrderAccessRequestResponse, bc as OrderAccessVerifyResponse, bd as OrderDetail, be as OrderDiscount, bf as OrderDocument, bg as OrderItem, bh as OrderListItem, bi as OrderPaymentInstructions, bj as OrderPickupPoint, bk as OrderShipment, bl as OrderStatus, bm as OrderStatusHistory, bn as OrderStatuses, bo as OrderTracking, bp as Page, bq as PageAttachment, br as PageDetail, bs as PaginatedResponse, bt as PaymentInstrument, bu as PaymentStatus, bv as PaymentStatuses, bw as PaymentSwift, bx as PickupPoint, by as PickupPointHours, bz as PickupPointsInput, bA as PickupWidgetConfig, bB as PriceDisplay, bC as ProductAssetGroup, bD as ProductAssetItem, bE as ProductAvailability, bF as ProductGroup, bG as ProductLabel, bH as ProductListItem, bI as ProductMedia, bJ as ProductMediaVariant, bK as ProductParameter, bL as ProductParameterGroup, bM as ProductParametersResponse, bN as ProductPrice, bO as ProductPromotionSummary, bP as ProductReview, bQ as ProductReviewsResponse, bR as ProductSibling, bS as ProductSort, bT as ProductSortValue, bU as ProductVolumePrice, bV as ProductsQuery, bW as QuizAnswerInput, bX as QuizAnswerResult, bY as QuizQuestion, bZ as QuizResult, b_ as QuoteItem, b$ as QuoteRequest, c0 as RegisterInput, c1 as RegisterResult, c2 as RequestInterceptor, c3 as RequestInterceptorConfig, c4 as ResponseInterceptor, c5 as ResponseInterceptorData, c6 as ReturnRequest, c7 as ReturnRequestItem, c8 as ReturnStatus, c9 as ReturnStatusItem, ca as ReturnableOrder, cb as ReturnableOrderItem, cc as SdkError, cd as ShippingMethodSummary, ce as ShippingPublicConfig, cf as ShippingQuote, cg as ShippingQuoteInput, ch as ShopAppearance, ci as ShopCommerce, cj as ShopInfo, ck as ShopScript, cl as ShopScriptPlacement, cm as ShopScriptType, cn as ShopScripts, co as ShopSeo, cp as ShopSeoIdentity, cq as SiteFormField, cr as SiteFormFieldOption, cs as SiteFormFieldType, ct as Sitemap, cu as SitemapEntry, cv as StockBehavior, cw as StockMode, cx as StorefrontCollection, cy as StorefrontCollectionField, cz as StorefrontCollectionFieldType, cA as StorefrontCollectionItem, cB as StorefrontCollectionQuery, cC as StorefrontFaqGroup, cD as StorefrontFaqGroupSummary, cE as StorefrontFaqGroups, cF as StorefrontFaqItem, cG as StorefrontFaqQuery, cH as StorefrontForm, cI as StorefrontFormFieldErrorCode, cJ as StorefrontFormFile, cK as StorefrontFormPresentation, cL as StorefrontFormSettings, cM as StorefrontFormSubmitInput, cN as StorefrontFormSubmitResult, cO as StorefrontFormUpload, cP as SubmitQuoteInput, cQ as SubmitReturnInput, cR as SubmitReviewInput, cS as SubmitWithdrawalInput, cT as Subscription, cU as SubscriptionAction, cV as SubscriptionFrequency, cW as SubscriptionItem, cX as SubscriptionStatus, cY as TaxBreakdownLine, cZ as VariantAxis, c_ as VariantAxisValue, c$ as WishlistItem, d0 as WithdrawalAcknowledgement, d1 as WithdrawalFlag, d2 as WithdrawalSettings, d3 as WithdrawalWindow, d4 as clearCartSummary, d5 as err, d6 as ok, d7 as publishCartSummary, d8 as toSdkError } from './client-DeAREmgD.mjs';
|
|
3
|
+
|
|
4
|
+
interface HeaderReader {
|
|
5
|
+
get(name: string): string | null;
|
|
6
|
+
}
|
|
7
|
+
declare function trustedVisitorIp(headers: HeaderReader, originSecret?: string | null): string | undefined;
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* Format a price amount with currency using Intl.NumberFormat.
|
|
@@ -140,7 +145,7 @@ declare function buildVariantComparison(product: ProductDetail, labels: {
|
|
|
140
145
|
* Consent stays the script layer's job: this helper never loads anything, it
|
|
141
146
|
* only talks to runtimes that already exist on the page.
|
|
142
147
|
*/
|
|
143
|
-
type EcommerceEventName = "view_item" | "view_item_list" | "select_item" | "add_to_cart" | "remove_from_cart" | "view_cart" | "add_to_wishlist" | "view_promotion" | "select_promotion" | "begin_checkout" | "add_payment_info" | "add_shipping_info" | "search" | "generate_lead" | "purchase" | "variant_selected" | "newsletter_signup";
|
|
148
|
+
type EcommerceEventName = "view_item" | "view_item_list" | "select_item" | "add_to_cart" | "remove_from_cart" | "view_cart" | "add_to_wishlist" | "view_promotion" | "select_promotion" | "begin_checkout" | "add_payment_info" | "add_shipping_info" | "search" | "generate_lead" | "purchase" | "variant_selected" | "newsletter_signup" | "newsletter_request" | "form_popup_view";
|
|
144
149
|
type EcommerceItem = {
|
|
145
150
|
item_id: string;
|
|
146
151
|
item_name: string;
|
|
@@ -269,4 +274,38 @@ declare function validationFieldMessages(err: unknown, locale?: ErrorMessageLoca
|
|
|
269
274
|
*/
|
|
270
275
|
declare function formFieldErrors(err: unknown): StorefrontFormFieldError[];
|
|
271
276
|
|
|
272
|
-
|
|
277
|
+
interface StorageAdapter {
|
|
278
|
+
get(key: string): string | null;
|
|
279
|
+
set(key: string, value: string): void;
|
|
280
|
+
remove(key: string): void;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
declare const NEWSLETTER_REQUESTED_EVENT = "behio:newsletter-requested";
|
|
284
|
+
/** A preference only, no email, subscriber lookup, visitor id or fingerprint. Pending confirmation counts too. */
|
|
285
|
+
declare function markNewsletterRequested(): void;
|
|
286
|
+
declare function newsletterWasRequested(): boolean;
|
|
287
|
+
declare function matchesFormPath(rule: string, pathname: string): boolean;
|
|
288
|
+
declare function formPopupRouteAllowed(pathname: string, placement: StorefrontFormPlacement): boolean;
|
|
289
|
+
/** Visible time survives hard navigation. Hidden time is never persisted as active time. */
|
|
290
|
+
declare class FormPopupClock {
|
|
291
|
+
elapsedMs: number;
|
|
292
|
+
private since;
|
|
293
|
+
constructor(elapsedMs?: number);
|
|
294
|
+
setVisible(visible: boolean, now: number): void;
|
|
295
|
+
elapsed(now: number): number;
|
|
296
|
+
}
|
|
297
|
+
declare class FormPopupPreferences {
|
|
298
|
+
private session;
|
|
299
|
+
private persistent;
|
|
300
|
+
private now;
|
|
301
|
+
private shownInVisit;
|
|
302
|
+
constructor(session?: StorageAdapter, persistent?: StorageAdapter, now?: () => number);
|
|
303
|
+
private number;
|
|
304
|
+
visibleMs(): number;
|
|
305
|
+
saveTime(visible: number): void;
|
|
306
|
+
suppressed(slug: string, newsletter?: boolean): boolean;
|
|
307
|
+
shown(): void;
|
|
308
|
+
dismiss(slug: string, days: number): void;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export { BehioStorefront, CookieConsent, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type ErrorMessageLocale, FormPopupClock, FormPopupPreferences, type HeaderReader, NEWSLETTER_REQUESTED_EVENT, ProductDetail, ProductVariant, type ResolvedVariantContent, SdkResult, StorefrontFormFieldError, StorefrontFormPlacement, VARIANT_QUERY_PARAM, type VariantComparisonRow, availableAxisValues, buildVariantComparison, errorCode, errorMessage, errorParams, findVariantByAttributes, formFieldErrors, formPopupRouteAllowed, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, markNewsletterRequested, matchesFormPath, newsletterWasRequested, resolveVariantContent, revokeAnalyticsConsent, trackEcommerceEvent, trustedVisitorIp, validationFieldMessages, variantFromQuery, variantHref };
|