@behio/storefront-sdk 0.32.0 → 0.33.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-Y7QAB75P.mjs → chunk-5KJDVDUM.mjs} +43 -0
- package/dist/{chunk-5OFVG2BO.js → chunk-Y4ZCK5HD.js} +43 -0
- package/dist/{client-BOz1trRk.d.mts → client-BQlF_Vn9.d.mts} +235 -5
- package/dist/{client-BOz1trRk.d.ts → client-BQlF_Vn9.d.ts} +235 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- 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 +171 -3
- package/dist/react.d.ts +171 -3
- package/dist/react.js +240 -45
- package/dist/react.mjs +279 -84
- package/package.json +1 -1
|
@@ -147,6 +147,7 @@ var BehioStorefront = class {
|
|
|
147
147
|
this.addresses = new AddressModule(this);
|
|
148
148
|
this.shipping = new ShippingModule(this);
|
|
149
149
|
this.newsletter = new NewsletterModule(this);
|
|
150
|
+
this.subscriptions = new SubscriptionsModule(this);
|
|
150
151
|
}
|
|
151
152
|
// --- Public methods ---
|
|
152
153
|
/**
|
|
@@ -1033,6 +1034,40 @@ var WishlistModule = class {
|
|
|
1033
1034
|
return this.client.request("GET", `/customer/wishlist/${productId}/check`);
|
|
1034
1035
|
}
|
|
1035
1036
|
};
|
|
1037
|
+
var SubscriptionsModule = class {
|
|
1038
|
+
constructor(client) {
|
|
1039
|
+
this.client = client;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* List the logged-in customer's recurring-order subscriptions (products,
|
|
1043
|
+
* cadence, next order date, status). Requires an authenticated customer
|
|
1044
|
+
* session. Subscriptions are created by the merchant in v1.
|
|
1045
|
+
*/
|
|
1046
|
+
async list() {
|
|
1047
|
+
return this.client.request("GET", "/customer/subscriptions");
|
|
1048
|
+
}
|
|
1049
|
+
/** Pause an active subscription (no orders are generated while paused). */
|
|
1050
|
+
async pause(subscriptionId) {
|
|
1051
|
+
return this.client.request(
|
|
1052
|
+
"POST",
|
|
1053
|
+
`/customer/subscriptions/${subscriptionId}/pause`
|
|
1054
|
+
);
|
|
1055
|
+
}
|
|
1056
|
+
/** Resume a paused subscription (re-schedules the next order). */
|
|
1057
|
+
async resume(subscriptionId) {
|
|
1058
|
+
return this.client.request(
|
|
1059
|
+
"POST",
|
|
1060
|
+
`/customer/subscriptions/${subscriptionId}/resume`
|
|
1061
|
+
);
|
|
1062
|
+
}
|
|
1063
|
+
/** Cancel a subscription permanently (no more orders). */
|
|
1064
|
+
async cancel(subscriptionId) {
|
|
1065
|
+
return this.client.request(
|
|
1066
|
+
"POST",
|
|
1067
|
+
`/customer/subscriptions/${subscriptionId}/cancel`
|
|
1068
|
+
);
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1036
1071
|
var ReviewsModule = class {
|
|
1037
1072
|
constructor(client) {
|
|
1038
1073
|
this.client = client;
|
|
@@ -1104,6 +1139,14 @@ var QuotesModule = class {
|
|
|
1104
1139
|
async getStatus(quoteId, email) {
|
|
1105
1140
|
return this.client.request("POST", `/quotes/${quoteId}/status`, { body: { email } });
|
|
1106
1141
|
}
|
|
1142
|
+
/**
|
|
1143
|
+
* The logged-in customer's own quote requests ("Moje poptávky", GAP-18).
|
|
1144
|
+
* Requires an authenticated session; ownership is the auth token (customer id
|
|
1145
|
+
* + verified email), never a payload. Newest first.
|
|
1146
|
+
*/
|
|
1147
|
+
async listMine() {
|
|
1148
|
+
return this.client.request("GET", "/customer/quotes");
|
|
1149
|
+
}
|
|
1107
1150
|
};
|
|
1108
1151
|
var AddressModule = class {
|
|
1109
1152
|
constructor(client) {
|
|
@@ -147,6 +147,7 @@ var BehioStorefront = class {
|
|
|
147
147
|
this.addresses = new AddressModule(this);
|
|
148
148
|
this.shipping = new ShippingModule(this);
|
|
149
149
|
this.newsletter = new NewsletterModule(this);
|
|
150
|
+
this.subscriptions = new SubscriptionsModule(this);
|
|
150
151
|
}
|
|
151
152
|
// --- Public methods ---
|
|
152
153
|
/**
|
|
@@ -1033,6 +1034,40 @@ var WishlistModule = class {
|
|
|
1033
1034
|
return this.client.request("GET", `/customer/wishlist/${productId}/check`);
|
|
1034
1035
|
}
|
|
1035
1036
|
};
|
|
1037
|
+
var SubscriptionsModule = class {
|
|
1038
|
+
constructor(client) {
|
|
1039
|
+
this.client = client;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* List the logged-in customer's recurring-order subscriptions (products,
|
|
1043
|
+
* cadence, next order date, status). Requires an authenticated customer
|
|
1044
|
+
* session. Subscriptions are created by the merchant in v1.
|
|
1045
|
+
*/
|
|
1046
|
+
async list() {
|
|
1047
|
+
return this.client.request("GET", "/customer/subscriptions");
|
|
1048
|
+
}
|
|
1049
|
+
/** Pause an active subscription (no orders are generated while paused). */
|
|
1050
|
+
async pause(subscriptionId) {
|
|
1051
|
+
return this.client.request(
|
|
1052
|
+
"POST",
|
|
1053
|
+
`/customer/subscriptions/${subscriptionId}/pause`
|
|
1054
|
+
);
|
|
1055
|
+
}
|
|
1056
|
+
/** Resume a paused subscription (re-schedules the next order). */
|
|
1057
|
+
async resume(subscriptionId) {
|
|
1058
|
+
return this.client.request(
|
|
1059
|
+
"POST",
|
|
1060
|
+
`/customer/subscriptions/${subscriptionId}/resume`
|
|
1061
|
+
);
|
|
1062
|
+
}
|
|
1063
|
+
/** Cancel a subscription permanently (no more orders). */
|
|
1064
|
+
async cancel(subscriptionId) {
|
|
1065
|
+
return this.client.request(
|
|
1066
|
+
"POST",
|
|
1067
|
+
`/customer/subscriptions/${subscriptionId}/cancel`
|
|
1068
|
+
);
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1036
1071
|
var ReviewsModule = class {
|
|
1037
1072
|
constructor(client) {
|
|
1038
1073
|
this.client = client;
|
|
@@ -1104,6 +1139,14 @@ var QuotesModule = class {
|
|
|
1104
1139
|
async getStatus(quoteId, email) {
|
|
1105
1140
|
return this.client.request("POST", `/quotes/${quoteId}/status`, { body: { email } });
|
|
1106
1141
|
}
|
|
1142
|
+
/**
|
|
1143
|
+
* The logged-in customer's own quote requests ("Moje poptávky", GAP-18).
|
|
1144
|
+
* Requires an authenticated session; ownership is the auth token (customer id
|
|
1145
|
+
* + verified email), never a payload. Newest first.
|
|
1146
|
+
*/
|
|
1147
|
+
async listMine() {
|
|
1148
|
+
return this.client.request("GET", "/customer/quotes");
|
|
1149
|
+
}
|
|
1107
1150
|
};
|
|
1108
1151
|
var AddressModule = class {
|
|
1109
1152
|
constructor(client) {
|
|
@@ -100,7 +100,21 @@ interface CheckoutSettings {
|
|
|
100
100
|
lowStockThreshold: number;
|
|
101
101
|
/** Google Places address autocomplete is enabled; mount the UX when true. */
|
|
102
102
|
addressAutocompleteEnabled: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* How prices are presented to the customer (GAP-30):
|
|
105
|
+
* - `INCL_VAT` (default, B2C): catalog/cart prices already include VAT; the
|
|
106
|
+
* VAT breakdown is the portion contained within.
|
|
107
|
+
* - `EXCL_VAT` (B2B): prices are net; render "bez DPH" labels and show VAT
|
|
108
|
+
* added on top.
|
|
109
|
+
* - `CUSTOMER_CHOICE`: the customer toggles incl/excl.
|
|
110
|
+
* Pair with per-line `taxRate` + cart/order `taxBreakdown` to render VAT rows.
|
|
111
|
+
*/
|
|
112
|
+
priceDisplay: PriceDisplay;
|
|
113
|
+
/** Shop default VAT rate (percent, e.g. 21) for labelling a single-rate cart. */
|
|
114
|
+
vatRate: number;
|
|
103
115
|
}
|
|
116
|
+
/** Price presentation mode (Eshop.priceDisplay). See `CheckoutSettings.priceDisplay`. */
|
|
117
|
+
type PriceDisplay = "INCL_VAT" | "EXCL_VAT" | "CUSTOMER_CHOICE";
|
|
104
118
|
interface ShopInfo {
|
|
105
119
|
id: string;
|
|
106
120
|
name: string;
|
|
@@ -125,6 +139,20 @@ interface ShopInfo {
|
|
|
125
139
|
quotesEnabled: boolean;
|
|
126
140
|
/** Full merchant checkout & cart contract. Honour these in cart + checkout. */
|
|
127
141
|
checkout: CheckoutSettings;
|
|
142
|
+
/**
|
|
143
|
+
* Public shop identity for SEO / structured data (GAP-31). Reads of existing
|
|
144
|
+
* merchant data — feed into the Organization JSON-LD and degrade gracefully
|
|
145
|
+
* on nulls. Optional because cached ShopInfo payloads predating the field
|
|
146
|
+
* may still be served.
|
|
147
|
+
*/
|
|
148
|
+
seo?: ShopSeoIdentity;
|
|
149
|
+
}
|
|
150
|
+
/** Public shop identity for SEO / structured data (GAP-31). */
|
|
151
|
+
interface ShopSeoIdentity {
|
|
152
|
+
/** Merchant shop description — Organization JSON-LD `description`. */
|
|
153
|
+
description: string | null;
|
|
154
|
+
/** Public contact e-mail (shop e-mail sender config) for ContactPoint. */
|
|
155
|
+
contactEmail: string | null;
|
|
128
156
|
}
|
|
129
157
|
interface NewsletterSubscribeInput {
|
|
130
158
|
email: string;
|
|
@@ -245,7 +273,9 @@ interface ProductVariant {
|
|
|
245
273
|
/** `null` when prices are gated behind login for guests (B2B mode). */
|
|
246
274
|
price: ProductPrice | null;
|
|
247
275
|
inStock: boolean;
|
|
248
|
-
|
|
276
|
+
/** Exact remaining stock, or `null` when the merchant hides the count
|
|
277
|
+
* (showStockCount off) — treat null as "unknown", never as 0. */
|
|
278
|
+
stockQuantity?: number | null;
|
|
249
279
|
/** "Only X left" for this variant — same contract as ProductListItem.lowStockRemaining. */
|
|
250
280
|
lowStockRemaining?: number | null;
|
|
251
281
|
/**
|
|
@@ -298,7 +328,9 @@ interface ProductListItem {
|
|
|
298
328
|
/** `null` when prices are gated behind login for guests (B2B mode). */
|
|
299
329
|
price: ProductPrice | null;
|
|
300
330
|
inStock: boolean;
|
|
301
|
-
|
|
331
|
+
/** Exact remaining stock, or `null` when the merchant hides the count
|
|
332
|
+
* (showStockCount off) — treat null as "unknown", never as 0. */
|
|
333
|
+
stockQuantity?: number | null;
|
|
302
334
|
/**
|
|
303
335
|
* "Zbývá posledních X kusů" nudge, computed SERVER-side. Non-null ONLY when
|
|
304
336
|
* the merchant enabled the low-stock indicator AND 0 < stock <= threshold;
|
|
@@ -316,6 +348,57 @@ interface ProductListItem {
|
|
|
316
348
|
} | null;
|
|
317
349
|
labels: ProductLabel[];
|
|
318
350
|
isFeatured: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Minimum order quantity (units); null/undefined = no minimum. Start the
|
|
353
|
+
* quantity stepper here — the server rejects add-to-cart / checkout below it.
|
|
354
|
+
*/
|
|
355
|
+
minOrderQuantity?: number | null;
|
|
356
|
+
/**
|
|
357
|
+
* Order quantity step / multiple (units); null/undefined = any quantity. The
|
|
358
|
+
* stepper moves by this amount and the server rejects non-multiple quantities.
|
|
359
|
+
*/
|
|
360
|
+
orderQuantityStep?: number | null;
|
|
361
|
+
/**
|
|
362
|
+
* Cheapest applicable auto-promotion for this product (GAP-13), or null. Same
|
|
363
|
+
* priority-based selection the checkout uses, so a card badge matches what the
|
|
364
|
+
* customer pays. Render a badge chip + a STATIC end date ("do 20. 7.") on
|
|
365
|
+
* cards; keep the live countdown on the PDP only (no per-card tickers).
|
|
366
|
+
*/
|
|
367
|
+
activePromotion?: ProductPromotionSummary | null;
|
|
368
|
+
/**
|
|
369
|
+
* Rollover image URL for the card (GAP-27), from the product's HOVER-role
|
|
370
|
+
* image when the merchant set one. Null/absent = no hover image (show the
|
|
371
|
+
* cover only). Crossfade to it on desktop hover (opacity only, no transform).
|
|
372
|
+
*/
|
|
373
|
+
hoverImageUrl?: string | null;
|
|
374
|
+
/**
|
|
375
|
+
* Aggregate rating from APPROVED reviews (GAP-23): mean 1-5 rating, or null
|
|
376
|
+
* when the product has no approved reviews. Server-computed + cached. Render
|
|
377
|
+
* gold stars only when `ratingCount > 0`; do NOT compute this from the
|
|
378
|
+
* paginated reviews endpoint.
|
|
379
|
+
*/
|
|
380
|
+
ratingAverage?: number | null;
|
|
381
|
+
/** Number of approved reviews behind `ratingAverage` (0 when none). */
|
|
382
|
+
ratingCount?: number;
|
|
383
|
+
/**
|
|
384
|
+
* Last modification of the product record (epoch ms) — sitemap `lastmod`
|
|
385
|
+
* and `dateModified` structured data (GAP-31).
|
|
386
|
+
*/
|
|
387
|
+
updatedAt?: number;
|
|
388
|
+
}
|
|
389
|
+
/** Display-only summary of the promotion winning for a card (GAP-13). */
|
|
390
|
+
interface ProductPromotionSummary {
|
|
391
|
+
promotionId: string;
|
|
392
|
+
/** Merchant badge label ("1+1"); null → render "-{discountValue} %" from the discount. */
|
|
393
|
+
badgeText: string | null;
|
|
394
|
+
/** Merchant hex badge color; null falls back to the shop's sale color. */
|
|
395
|
+
badgeColor: string | null;
|
|
396
|
+
discountType: 'PERCENTAGE' | 'FIXED_AMOUNT' | 'BUY_X_GET_Y';
|
|
397
|
+
discountValue: number;
|
|
398
|
+
/** Promotion end (epoch ms), or null for open-ended. */
|
|
399
|
+
endsAt: number | null;
|
|
400
|
+
/** Merchant opted into a countdown (the PDP shows a ticker; cards stay static). */
|
|
401
|
+
showCountdown: boolean;
|
|
319
402
|
}
|
|
320
403
|
/** A single responsive derivative (size + format) of a media image. */
|
|
321
404
|
interface ProductMediaVariant {
|
|
@@ -363,13 +446,39 @@ interface VariantAxis {
|
|
|
363
446
|
/** Values present among the purchasable variants, in admin-defined order. */
|
|
364
447
|
values: VariantAxisValue[];
|
|
365
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* One custom-field (data-group value) rendered as a spec-table row. BOOLEAN
|
|
451
|
+
* carries a typed `booleanValue` (value is null) so the storefront can localize
|
|
452
|
+
* Ano/Ne; MONEY carries its currency in `unit`; PERCENTAGE carries "%" in
|
|
453
|
+
* `unit`.
|
|
454
|
+
*/
|
|
455
|
+
interface ProductCustomField {
|
|
456
|
+
key: string;
|
|
457
|
+
name: string;
|
|
458
|
+
/** TEXT | NUMBER | DECIMAL | BOOLEAN | DATE | TIME | DATETIME | PERCENTAGE | MONEY | ITEM_LIST | ... */
|
|
459
|
+
type: string;
|
|
460
|
+
value: string | null;
|
|
461
|
+
booleanValue: boolean | null;
|
|
462
|
+
unit: string | null;
|
|
463
|
+
}
|
|
464
|
+
/** A spec-table section (one inventory data group) with its fields. */
|
|
465
|
+
interface ProductCustomFieldGroup {
|
|
466
|
+
key: string;
|
|
467
|
+
name: string;
|
|
468
|
+
fields: ProductCustomField[];
|
|
469
|
+
}
|
|
366
470
|
interface ProductDetail extends ProductListItem {
|
|
367
471
|
longDescription?: string;
|
|
368
|
-
/**
|
|
472
|
+
/**
|
|
473
|
+
* @deprecated Legacy per-listing images. Prefer `media`. Each carries its
|
|
474
|
+
* `role` (COVER | LISTING | HOVER | GALLERY) so the storefront can pick a
|
|
475
|
+
* specific image deliberately (GAP-27).
|
|
476
|
+
*/
|
|
369
477
|
images: Array<{
|
|
370
478
|
url: string;
|
|
371
479
|
alt?: string;
|
|
372
480
|
order: number;
|
|
481
|
+
role?: string;
|
|
373
482
|
}>;
|
|
374
483
|
/** Product gallery (images + videos) with responsive derivatives. */
|
|
375
484
|
media: ProductMedia[];
|
|
@@ -385,7 +494,15 @@ interface ProductDetail extends ProductListItem {
|
|
|
385
494
|
*/
|
|
386
495
|
variantAxes: VariantAxis[];
|
|
387
496
|
volumePricing: ProductVolumePrice[];
|
|
388
|
-
|
|
497
|
+
/**
|
|
498
|
+
* Structured product parameters from custom fields (inventory data groups),
|
|
499
|
+
* grouped into spec-table sections (GAP-12). Empty when the product has no
|
|
500
|
+
* data-group values. Distinct from `longDescription` (free HTML): this is
|
|
501
|
+
* machine-readable key/value data for a "Parametry" table + comparison
|
|
502
|
+
* engines. (Corrected from the old untyped `Record<string, unknown>` — the
|
|
503
|
+
* API never populated that; it now sends this structured shape.)
|
|
504
|
+
*/
|
|
505
|
+
customFields: ProductCustomFieldGroup[];
|
|
389
506
|
seo: {
|
|
390
507
|
title?: string | null;
|
|
391
508
|
description?: string | null;
|
|
@@ -601,6 +718,12 @@ interface CartItemProduct {
|
|
|
601
718
|
imageUrl?: string;
|
|
602
719
|
inStock: boolean;
|
|
603
720
|
currentPrice: number;
|
|
721
|
+
/** Minimum order quantity (units); null = no minimum. Clamp the cart
|
|
722
|
+
* stepper's lower bound to this (GAP-48). */
|
|
723
|
+
minOrderQuantity?: number | null;
|
|
724
|
+
/** Order quantity step/multiple (units); null = any. Move the cart stepper
|
|
725
|
+
* by this amount so quantities stay valid. */
|
|
726
|
+
orderQuantityStep?: number | null;
|
|
604
727
|
}
|
|
605
728
|
interface CartItem {
|
|
606
729
|
id: string;
|
|
@@ -616,6 +739,27 @@ interface CartItem {
|
|
|
616
739
|
totalPrice: number;
|
|
617
740
|
priceChanged: boolean;
|
|
618
741
|
volumePriceApplied: boolean;
|
|
742
|
+
/** VAT rate for this line in percent (e.g. 21). Estimated from the shop /
|
|
743
|
+
* product rate; refined by the shipping country at checkout (GAP-30). */
|
|
744
|
+
taxRate: number;
|
|
745
|
+
/** Net amount for this line (without VAT) = totalPrice. */
|
|
746
|
+
netAmount: number;
|
|
747
|
+
/** VAT amount for this line at `taxRate`. */
|
|
748
|
+
taxAmount: number;
|
|
749
|
+
/** Gross amount for this line (net + VAT). */
|
|
750
|
+
grossAmount: number;
|
|
751
|
+
}
|
|
752
|
+
/** One VAT rate's slice of a cart or order (GAP-30). Render "DPH {rate} %:
|
|
753
|
+
* {taxAmount}" summary rows from these. `netAmount + taxAmount = grossAmount`. */
|
|
754
|
+
interface TaxBreakdownLine {
|
|
755
|
+
/** VAT rate in percent, e.g. 21 or 12 or 0. */
|
|
756
|
+
rate: number;
|
|
757
|
+
/** Base amount (net, without VAT) taxed at this rate. */
|
|
758
|
+
netAmount: number;
|
|
759
|
+
/** VAT amount charged at this rate. */
|
|
760
|
+
taxAmount: number;
|
|
761
|
+
/** Gross amount (net + VAT) at this rate. */
|
|
762
|
+
grossAmount: number;
|
|
619
763
|
}
|
|
620
764
|
interface CartDiscount {
|
|
621
765
|
code: string;
|
|
@@ -643,6 +787,12 @@ interface Cart {
|
|
|
643
787
|
/** Sum of `appliedPromotions[].discountAmount`; already reflected in `grandTotal`. */
|
|
644
788
|
promotionDiscountTotal: number;
|
|
645
789
|
grandTotal: number;
|
|
790
|
+
/** Total VAT contained in / added to the cart across all lines (GAP-30). An
|
|
791
|
+
* estimate finalized at checkout once the shipping country is known. */
|
|
792
|
+
taxTotal: number;
|
|
793
|
+
/** VAT split by rate for "DPH 21 %: X Kč" summary rows. Empty for a
|
|
794
|
+
* non-VAT-payer shop. */
|
|
795
|
+
taxBreakdown: TaxBreakdownLine[];
|
|
646
796
|
currency: string;
|
|
647
797
|
itemCount: number;
|
|
648
798
|
/** Applied gift cards (multi). They deduct at checkout (consumed in order, each
|
|
@@ -808,6 +958,9 @@ interface OrderDetail extends OrderListItem {
|
|
|
808
958
|
customerNote?: string;
|
|
809
959
|
subtotal: number;
|
|
810
960
|
taxTotal: number;
|
|
961
|
+
/** VAT split by rate (GAP-30), summed from the order lines. Render
|
|
962
|
+
* "DPH 21 %: X Kč" rows. Empty for a non-VAT order. */
|
|
963
|
+
taxBreakdown: TaxBreakdownLine[];
|
|
811
964
|
shippingTotal: number;
|
|
812
965
|
discountTotal: number;
|
|
813
966
|
fulfillmentStatus: FulfillmentStatus;
|
|
@@ -888,6 +1041,14 @@ interface CustomerProfile {
|
|
|
888
1041
|
lastName?: string;
|
|
889
1042
|
phone?: string;
|
|
890
1043
|
emailVerified: boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* B2B approval gate (GAP-19). `false` = the account is awaiting merchant
|
|
1046
|
+
* approval (or was deactivated) — show a "pending approval" banner and gate
|
|
1047
|
+
* ordering. `true` = approved / active. New registrations on a shop with
|
|
1048
|
+
* `requireRegistrationApproval` start unapproved and cannot log in until
|
|
1049
|
+
* approved (register returns `pendingApproval`).
|
|
1050
|
+
*/
|
|
1051
|
+
isApproved: boolean;
|
|
891
1052
|
}
|
|
892
1053
|
interface CustomerAddress {
|
|
893
1054
|
id: string;
|
|
@@ -906,6 +1067,8 @@ interface Page {
|
|
|
906
1067
|
slug: string;
|
|
907
1068
|
title: string;
|
|
908
1069
|
isActive: boolean;
|
|
1070
|
+
/** Last modification of the page record (epoch ms) — sitemap `lastmod` (GAP-31). */
|
|
1071
|
+
updatedAt?: number;
|
|
909
1072
|
}
|
|
910
1073
|
interface PageDetail {
|
|
911
1074
|
slug: string;
|
|
@@ -1320,6 +1483,46 @@ interface WishlistItem {
|
|
|
1320
1483
|
stockCached: number;
|
|
1321
1484
|
createdAt: number;
|
|
1322
1485
|
}
|
|
1486
|
+
type SubscriptionStatus = "ACTIVE" | "PAUSED" | "CANCELLED" | "EXPIRED" | "PAYMENT_FAILED";
|
|
1487
|
+
type SubscriptionFrequency = "WEEKLY" | "BIWEEKLY" | "MONTHLY" | "BIMONTHLY" | "QUARTERLY" | "EVERY_6_MONTHS" | "YEARLY" | "CUSTOM_DAYS";
|
|
1488
|
+
interface SubscriptionItem {
|
|
1489
|
+
id: string;
|
|
1490
|
+
productId: string;
|
|
1491
|
+
product: {
|
|
1492
|
+
id: string;
|
|
1493
|
+
slug: string | null;
|
|
1494
|
+
};
|
|
1495
|
+
quantity: number;
|
|
1496
|
+
unitPriceSnapshot: number;
|
|
1497
|
+
currency: string;
|
|
1498
|
+
}
|
|
1499
|
+
interface Subscription {
|
|
1500
|
+
id: string;
|
|
1501
|
+
status: SubscriptionStatus;
|
|
1502
|
+
frequency: SubscriptionFrequency;
|
|
1503
|
+
/** For CUSTOM_DAYS frequency: order every N days. */
|
|
1504
|
+
customDays: number | null;
|
|
1505
|
+
/** Unix ms of the next scheduled order. */
|
|
1506
|
+
nextOrderAt: number;
|
|
1507
|
+
/** Unix ms of the last generated order, if any. */
|
|
1508
|
+
lastOrderAt: number | null;
|
|
1509
|
+
totalOrders: number;
|
|
1510
|
+
/** Max number of orders before the subscription expires (null = unlimited). */
|
|
1511
|
+
maxOrders: number | null;
|
|
1512
|
+
/** Subscriber discount percent applied to each generated order. */
|
|
1513
|
+
discountPercent: number | null;
|
|
1514
|
+
items: SubscriptionItem[];
|
|
1515
|
+
orderCount: number;
|
|
1516
|
+
createdAt: number;
|
|
1517
|
+
updatedAt: number;
|
|
1518
|
+
}
|
|
1519
|
+
interface SubscriptionAction {
|
|
1520
|
+
id: string;
|
|
1521
|
+
status: SubscriptionStatus;
|
|
1522
|
+
/** Present after resume — the newly scheduled next order (Unix ms). */
|
|
1523
|
+
nextOrderAt?: number | null;
|
|
1524
|
+
updatedAt: number;
|
|
1525
|
+
}
|
|
1323
1526
|
interface ProductReview {
|
|
1324
1527
|
id: string;
|
|
1325
1528
|
authorName: string;
|
|
@@ -1523,6 +1726,7 @@ declare class BehioStorefront {
|
|
|
1523
1726
|
readonly addresses: AddressModule;
|
|
1524
1727
|
readonly shipping: ShippingModule;
|
|
1525
1728
|
readonly newsletter: NewsletterModule;
|
|
1729
|
+
readonly subscriptions: SubscriptionsModule;
|
|
1526
1730
|
/**
|
|
1527
1731
|
* Called by the analytics tracker when the visitor grants (id) or revokes
|
|
1528
1732
|
* (null) analytics consent. When set, requests carry the X-Behio-Vid header
|
|
@@ -1943,6 +2147,24 @@ declare class WishlistModule {
|
|
|
1943
2147
|
inWishlist: boolean;
|
|
1944
2148
|
}>>;
|
|
1945
2149
|
}
|
|
2150
|
+
declare class SubscriptionsModule {
|
|
2151
|
+
private client;
|
|
2152
|
+
constructor(client: BehioStorefront);
|
|
2153
|
+
/**
|
|
2154
|
+
* List the logged-in customer's recurring-order subscriptions (products,
|
|
2155
|
+
* cadence, next order date, status). Requires an authenticated customer
|
|
2156
|
+
* session. Subscriptions are created by the merchant in v1.
|
|
2157
|
+
*/
|
|
2158
|
+
list(): Promise<SdkResult<{
|
|
2159
|
+
items: Subscription[];
|
|
2160
|
+
}>>;
|
|
2161
|
+
/** Pause an active subscription (no orders are generated while paused). */
|
|
2162
|
+
pause(subscriptionId: string): Promise<SdkResult<SubscriptionAction>>;
|
|
2163
|
+
/** Resume a paused subscription (re-schedules the next order). */
|
|
2164
|
+
resume(subscriptionId: string): Promise<SdkResult<SubscriptionAction>>;
|
|
2165
|
+
/** Cancel a subscription permanently (no more orders). */
|
|
2166
|
+
cancel(subscriptionId: string): Promise<SdkResult<SubscriptionAction>>;
|
|
2167
|
+
}
|
|
1946
2168
|
declare class ReviewsModule {
|
|
1947
2169
|
private client;
|
|
1948
2170
|
constructor(client: BehioStorefront);
|
|
@@ -1984,6 +2206,14 @@ declare class QuotesModule {
|
|
|
1984
2206
|
/** Email is the ownership gate — quotes carry contact PII and negotiated
|
|
1985
2207
|
* prices, so the id alone is never enough. POST keeps it out of URLs. */
|
|
1986
2208
|
getStatus(quoteId: string, email: string): Promise<SdkResult<QuoteRequest>>;
|
|
2209
|
+
/**
|
|
2210
|
+
* The logged-in customer's own quote requests ("Moje poptávky", GAP-18).
|
|
2211
|
+
* Requires an authenticated session; ownership is the auth token (customer id
|
|
2212
|
+
* + verified email), never a payload. Newest first.
|
|
2213
|
+
*/
|
|
2214
|
+
listMine(): Promise<SdkResult<{
|
|
2215
|
+
items: QuoteRequest[];
|
|
2216
|
+
}>>;
|
|
1987
2217
|
}
|
|
1988
2218
|
interface AddressSuggestion {
|
|
1989
2219
|
placeId: string;
|
|
@@ -2080,4 +2310,4 @@ declare class NewsletterModule {
|
|
|
2080
2310
|
unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
2081
2311
|
}
|
|
2082
2312
|
|
|
2083
|
-
export { type
|
|
2313
|
+
export { type QuoteRequest as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type ShopScripts as D, type ShopSeo as E, type FilterField as F, type Bundle as G, type ProductGroup as H, type CrossSellItem as I, type ActivePromotion as J, type GiftCardBalance as K, type LoyaltySummary as L, type Menu as M, type NewsletterSubscribeResult as N, type OrderListItem as O, type ProductsQuery as P, type ProductReviewsResponse as Q, type RegisterInput as R, type Subscription as S, type SubmitReviewInput as T, type ReturnableOrder as U, type ReturnStatus as V, type WishlistItem as W, type ReturnRequest as X, type SubmitReturnInput as Y, type CookieConsent as Z, type CookieConsentInput as _, BehioStorefront as a, type QuoteItem as a$, type SubmitQuoteInput as a0, type BackInStockSubscription as a1, type AddToCartInput as a2, type AuthTokens as a3, BehioApiError as a4, type BundleItem as a5, type CartDiscount as a6, type CartItem as a7, type CheckoutAddress as a8, type FulfillmentStatus as a9, type GiftCardSummary as aA, type LoyaltyBalance as aB, type LoyaltyNextTier as aC, type LoyaltyProgram as aD, type LoyaltyTier as aE, type LoyaltyTierPerks as aF, type LoyaltyTransaction as aG, type MenuItem as aH, type MenuItemRef as aI, type MenuItemType as aJ, type NewsletterOptInDefault as aK, type OrderStatusHistory as aL, OrderStatuses as aM, type OrderTracking as aN, type PageAttachment as aO, PaymentStatuses as aP, type PickupPointHours as aQ, type PriceDisplay as aR, type ProductAvailability as aS, type ProductCustomField as aT, type ProductCustomFieldGroup as aU, type ProductMedia as aV, type ProductMediaVariant as aW, type ProductPromotionSummary as aX, ProductSort as aY, type ProductSortValue as aZ, type ProductVolumePrice as a_, type LoginInput as aa, type MessageResponse as ab, type OrderItem as ac, type OrderStatus as ad, type PaymentStatus as ae, type ProductPrice as af, type ProductReview as ag, type ProductVariant as ah, type AddressType as ai, AddressTypes as aj, type BadgeTone as ak, type BehioErrorCode as al, type BehioEventHandler as am, type BehioEventType as an, BehioNetworkError as ao, type CartBundleLine as ap, type CartBundleLineItem as aq, type CartItemProduct as ar, type CartPromotion as as, type CheckoutSettings as at, type DataGroupFieldType as au, type DigitalDownload as av, type DownloadUrl as aw, FulfillmentStatuses as ax, type GiftCardPurchaseInput as ay, type GiftCardPurchaseResult as az, type PaginatedResponse as b, type RegisterResult as b0, type RequestInterceptor as b1, type RequestInterceptorConfig as b2, type ResponseInterceptor as b3, type ResponseInterceptorData as b4, type ReturnRequestItem as b5, type ReturnStatusItem as b6, type ReturnableOrderItem as b7, type SdkError as b8, type SdkResult as b9, type ShopScript as ba, type ShopScriptPlacement as bb, type ShopScriptType as bc, type ShopSeoIdentity as bd, type StockBehavior as be, type SubscriptionFrequency as bf, type SubscriptionItem as bg, type SubscriptionStatus as bh, type TaxBreakdownLine as bi, type VariantAxis as bj, type VariantAxisValue as bk, err as bl, ok as bm, toSdkError as bn, type ProductListItem as c, type ProductDetail as d, type CategoryDetail as e, type ProductLabel as f, type Cart as g, type CustomerProfile as h, type CustomerAddress as i, type AddressDetail as j, type SubscriptionAction as k, type PickupPointsInput as l, type PickupPoint as m, type ShippingMethodSummary as n, type ShippingQuoteInput as o, type ShippingQuote as p, type CheckoutPaymentMethod as q, type NewsletterSubscribeInput as r, type NewsletterUnsubscribeResult as s, type OrderDetail as t, type OrderAccessRequestResponse as u, type OrderAccessVerifyResponse as v, type CheckoutInput as w, type PageDetail as x, type Page as y, type ShopInfo as z };
|