@behio/storefront-sdk 2.16.0 → 2.18.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/README.md +23 -0
- package/dist/{chunk-AUH7KNL6.mjs → chunk-N6YG4AJ4.mjs} +29 -0
- package/dist/{chunk-AOUXSMSR.js → chunk-NBYEO5KC.js} +34 -5
- package/dist/{client-Ddk-DIHi.d.mts → client-CBNbEn0x.d.mts} +76 -1
- package/dist/{client-Ddk-DIHi.d.ts → client-CBNbEn0x.d.ts} +76 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -6
- package/dist/index.mjs +13 -4
- 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 +84 -1
- package/dist/react.d.ts +84 -1
- package/dist/react.js +96 -44
- package/dist/react.mjs +80 -30
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
ok,
|
|
13
13
|
publishCartSummary,
|
|
14
14
|
toSdkError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-N6YG4AJ4.mjs";
|
|
16
16
|
|
|
17
17
|
// src/react/utils/format-price.ts
|
|
18
18
|
function formatPrice(amount, currency, locale, display) {
|
|
@@ -238,6 +238,8 @@ async function revokeAnalyticsConsent(client) {
|
|
|
238
238
|
var ERROR_MESSAGES = {
|
|
239
239
|
"cs": {
|
|
240
240
|
"be.billing.apiDailyLimit": "Denn\xED limit vol\xE1n\xED API va\u0161eho tarifu ({limit}) je vy\u010Derpan\xFD. Obnov\xED se o p\u016Flnoci UTC, vy\u0161\u0161\xED tarif m\xE1 limit vy\u0161\u0161\xED.",
|
|
241
|
+
"be.collections.collectionNotFound": "Kolekce nebyla nalezena.",
|
|
242
|
+
"be.collections.itemNotFound": "Polo\u017Eka kolekce nebyla nalezena.",
|
|
241
243
|
"be.common.notFound": "Tohle u\u017E neexistuje.",
|
|
242
244
|
"be.forms.consentRequired": "Bez souhlasu nejde formul\xE1\u0159 odeslat.",
|
|
243
245
|
"be.forms.fileFieldNotFound": "Formul\xE1\u0159 takov\xE9 pole pro soubor nem\xE1.",
|
|
@@ -461,7 +463,8 @@ var ERROR_MESSAGES = {
|
|
|
461
463
|
"be.storefront.shippingQuoteStale": "Ko\u0161\xEDk se od kalkulace dopravy zm\u011Bnil. Na\u010Dt\u011Bte mo\u017Enosti dopravy znovu.",
|
|
462
464
|
"be.storefront.shopMaintenance": "Obchod je v \xFAdr\u017Eb\u011B. Zkuste to pros\xEDm pozd\u011Bji.",
|
|
463
465
|
"be.storefront.shopNotAvailable": "E-shop nen\xED dostupn\xFD.",
|
|
464
|
-
"be.storefront.
|
|
466
|
+
"be.storefront.shopPaused": "Obchod te\u010F nep\u0159ij\xEDm\xE1 objedn\xE1vky.",
|
|
467
|
+
"be.storefront.siteKeyNotAllowed": "Tento web zat\xEDm neprod\xE1v\xE1, tak\u017Ee obchodn\xED endpointy jako katalog, ko\u0161\xEDk a pokladna nejsou pro jeho kl\xED\u010D dostupn\xE9. Prodej zapnete p\u0159id\xE1n\xEDm obchodu k webu v Behiu (site-commerce-enable).",
|
|
465
468
|
"be.storefront.siteOwnerMissing": "Web nem\xE1 vlastn\xEDka (e-shop ani web).",
|
|
466
469
|
"be.storefront.someProductsNotFound": "N\u011Bkter\xE9 produkty nebyly nalezeny.",
|
|
467
470
|
"be.storefront.stockBusyRetry": "Zbo\u017E\xED si pr\xE1v\u011B kupuje v\xEDc lid\xED najednou, zkuste to pros\xEDm znovu.",
|
|
@@ -500,6 +503,8 @@ var ERROR_MESSAGES = {
|
|
|
500
503
|
},
|
|
501
504
|
"sk": {
|
|
502
505
|
"be.billing.apiDailyLimit": "Denn\xFD limit volan\xED API v\xE1\u0161ho tarifu ({limit}) je vy\u010Derpan\xFD. Obnov\xED sa o polnoci UTC, vy\u0161\u0161\xED tarif m\xE1 vy\u0161\u0161\xED limit.",
|
|
506
|
+
"be.collections.collectionNotFound": "Kolekcia sa nena\u0161la.",
|
|
507
|
+
"be.collections.itemNotFound": "Polo\u017Eka kolekcie sa nena\u0161la.",
|
|
503
508
|
"be.common.notFound": "Toto u\u017E neexistuje.",
|
|
504
509
|
"be.forms.consentRequired": "Bez s\xFAhlasu sa formul\xE1r ned\xE1 odosla\u0165.",
|
|
505
510
|
"be.forms.fileFieldNotFound": "Formul\xE1r tak\xE9to pole pre s\xFAbor nem\xE1.",
|
|
@@ -723,7 +728,8 @@ var ERROR_MESSAGES = {
|
|
|
723
728
|
"be.storefront.shippingQuoteStale": "Ko\u0161\xEDk sa od kalkul\xE1cie dopravy zmenil. Na\u010D\xEDtajte mo\u017Enosti dopravy znova.",
|
|
724
729
|
"be.storefront.shopMaintenance": "Obchod je v \xFAdr\u017Ebe. Sk\xFAste to pros\xEDm nesk\xF4r.",
|
|
725
730
|
"be.storefront.shopNotAvailable": "E-shop nie je dostupn\xFD.",
|
|
726
|
-
"be.storefront.
|
|
731
|
+
"be.storefront.shopPaused": "Obchod teraz neprij\xEDma objedn\xE1vky.",
|
|
732
|
+
"be.storefront.siteKeyNotAllowed": "Tento web zatia\u013E nepred\xE1va, tak\u017Ee obchodn\xE9 endpointy ako katal\xF3g, ko\u0161\xEDk a poklad\u0148a nie s\xFA pre jeho k\u013E\xFA\u010D dostupn\xE9. Predaj zapnete pridan\xEDm obchodu k webu v Behiu (site-commerce-enable).",
|
|
727
733
|
"be.storefront.siteOwnerMissing": "Web nem\xE1 vlastn\xEDka (e-shop ani web).",
|
|
728
734
|
"be.storefront.someProductsNotFound": "Niektor\xE9 produkty sa nena\u0161li.",
|
|
729
735
|
"be.storefront.stockBusyRetry": "Tovar si pr\xE1ve kupuje viac \u013Eud\xED naraz, sk\xFAste to pros\xEDm znova.",
|
|
@@ -762,6 +768,8 @@ var ERROR_MESSAGES = {
|
|
|
762
768
|
},
|
|
763
769
|
"en": {
|
|
764
770
|
"be.billing.apiDailyLimit": "Your plan's daily API limit ({limit} calls) has been reached. It resets at midnight UTC; higher plans have a higher limit.",
|
|
771
|
+
"be.collections.collectionNotFound": "Collection not found.",
|
|
772
|
+
"be.collections.itemNotFound": "Collection item not found.",
|
|
765
773
|
"be.common.notFound": "This no longer exists.",
|
|
766
774
|
"be.forms.consentRequired": "The form cannot be sent without consent.",
|
|
767
775
|
"be.forms.fileFieldNotFound": "This form has no such file field.",
|
|
@@ -985,7 +993,8 @@ var ERROR_MESSAGES = {
|
|
|
985
993
|
"be.storefront.shippingQuoteStale": "Cart has changed since the shipping quote was issued, re-fetch shipping",
|
|
986
994
|
"be.storefront.shopMaintenance": "The shop is under maintenance. Please try again later.",
|
|
987
995
|
"be.storefront.shopNotAvailable": "Shop is not available",
|
|
988
|
-
"be.storefront.
|
|
996
|
+
"be.storefront.shopPaused": "The shop is not accepting orders right now.",
|
|
997
|
+
"be.storefront.siteKeyNotAllowed": "This website does not sell yet, so shop endpoints such as the catalog, cart and checkout are not available for its key. Add a shop to the website in Behio (site-commerce-enable) to start selling.",
|
|
989
998
|
"be.storefront.siteOwnerMissing": "The site has no owner (neither e-shop nor website)",
|
|
990
999
|
"be.storefront.someProductsNotFound": "One or more products were not found",
|
|
991
1000
|
"be.storefront.stockBusyRetry": "Many people are buying this item right now, please try again.",
|
package/dist/next.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-
|
|
1
|
+
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-CBNbEn0x.mjs';
|
|
2
2
|
|
|
3
3
|
interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
|
|
4
4
|
/** Override the cart session cookie name (default: "behio_cart_session"). */
|
package/dist/next.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-
|
|
1
|
+
import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-CBNbEn0x.js';
|
|
2
2
|
|
|
3
3
|
interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
|
|
4
4
|
/** Override the cart session cookie name (default: "behio_cart_session"). */
|
package/dist/next.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNBYEO5KCjs = require('./chunk-NBYEO5KC.js');
|
|
4
4
|
|
|
5
5
|
// src/next.ts
|
|
6
6
|
var _headers = require('next/headers');
|
|
@@ -19,7 +19,7 @@ async function getBehio(options = {}) {
|
|
|
19
19
|
const locale = _nullishCoalesce(options.locale, () => ( process.env.BEHIO_LOCALE));
|
|
20
20
|
const currency = _nullishCoalesce(options.currency, () => ( process.env.BEHIO_CURRENCY));
|
|
21
21
|
const cookieName = _nullishCoalesce(options.cartCookieName, () => ( CART_COOKIE_NAME));
|
|
22
|
-
const client = new (0,
|
|
22
|
+
const client = new (0, _chunkNBYEO5KCjs.BehioStorefront)({
|
|
23
23
|
apiKey,
|
|
24
24
|
...baseUrl ? { baseUrl } : {},
|
|
25
25
|
...locale ? { locale } : {},
|
package/dist/next.mjs
CHANGED
package/dist/react.d.mts
CHANGED
|
@@ -236,6 +236,18 @@ interface CheckoutSettings {
|
|
|
236
236
|
/** Price presentation mode (Eshop.priceDisplay). See `CheckoutSettings.priceDisplay`. */
|
|
237
237
|
type PriceDisplay = "INCL_VAT" | "EXCL_VAT" | "CUSTOMER_CHOICE";
|
|
238
238
|
type CurrencyDisplayFormat = "SYMBOL_BEFORE" | "SYMBOL_AFTER" | "CODE";
|
|
239
|
+
/**
|
|
240
|
+
* Selling state of the site (SDK 2.18.0). `NONE` = website without a shop,
|
|
241
|
+
* `ADDED` = shop being set up (orders are accepted), `LIVE` = selling,
|
|
242
|
+
* `PAUSED` = not accepting orders right now: cart writes, checkout and gift
|
|
243
|
+
* card purchases answer 403 `be.storefront.shopPaused`. Keep the catalog
|
|
244
|
+
* visible and replace the buy buttons with a notice.
|
|
245
|
+
*/
|
|
246
|
+
interface ShopCommerce {
|
|
247
|
+
state: "NONE" | "ADDED" | "LIVE" | "PAUSED";
|
|
248
|
+
/** False for PAUSED and for a website without a shop. */
|
|
249
|
+
acceptsOrders: boolean;
|
|
250
|
+
}
|
|
239
251
|
interface ShopInfo {
|
|
240
252
|
/** Merchant default catalog order, normalized to the public sort values. */
|
|
241
253
|
defaultProductSort?: ProductSortValue;
|
|
@@ -251,6 +263,8 @@ interface ShopInfo {
|
|
|
251
263
|
enabled: boolean;
|
|
252
264
|
message: string | null;
|
|
253
265
|
};
|
|
266
|
+
/** Selling state. Optional because cached payloads predating SDK 2.18.0 may still be served; missing = accepting orders. */
|
|
267
|
+
commerce?: ShopCommerce;
|
|
254
268
|
id: string;
|
|
255
269
|
name: string;
|
|
256
270
|
domain: string;
|
|
@@ -2381,6 +2395,43 @@ interface StorefrontFormSettings {
|
|
|
2381
2395
|
/** When true, `consent: true` is required for the submit to pass. */
|
|
2382
2396
|
requireConsent?: boolean;
|
|
2383
2397
|
}
|
|
2398
|
+
/** Field types of a data collection. */
|
|
2399
|
+
type StorefrontCollectionFieldType = "text" | "longtext" | "number" | "boolean" | "date" | "url" | "image" | "email" | "select" | "tags";
|
|
2400
|
+
/** One field of a data collection; item values live under `data[key]`. */
|
|
2401
|
+
interface StorefrontCollectionField {
|
|
2402
|
+
key: string;
|
|
2403
|
+
type: StorefrontCollectionFieldType;
|
|
2404
|
+
label: string;
|
|
2405
|
+
required: boolean;
|
|
2406
|
+
help?: string;
|
|
2407
|
+
/** Choices for `select`, suggestions for `tags`. */
|
|
2408
|
+
options?: string[];
|
|
2409
|
+
}
|
|
2410
|
+
/** One published item of a data collection. */
|
|
2411
|
+
interface StorefrontCollectionItem {
|
|
2412
|
+
id: string;
|
|
2413
|
+
/** Detail address, unique in the collection; null when the item has none. */
|
|
2414
|
+
slug: string | null;
|
|
2415
|
+
/** `{fieldKey: value}`: text, number, boolean, `YYYY-MM-DD` date, URL, string[] for tags. */
|
|
2416
|
+
data: Record<string, unknown>;
|
|
2417
|
+
createdAt: number;
|
|
2418
|
+
updatedAt: number;
|
|
2419
|
+
}
|
|
2420
|
+
/** A public data collection (`GET /collections/{slug}`). */
|
|
2421
|
+
interface StorefrontCollection {
|
|
2422
|
+
slug: string;
|
|
2423
|
+
name: string;
|
|
2424
|
+
description: string | null;
|
|
2425
|
+
fields: StorefrontCollectionField[];
|
|
2426
|
+
items: StorefrontCollectionItem[];
|
|
2427
|
+
/** Number of published items (for paging). */
|
|
2428
|
+
total: number;
|
|
2429
|
+
}
|
|
2430
|
+
interface StorefrontCollectionQuery {
|
|
2431
|
+
/** 1 to 200, default 100. */
|
|
2432
|
+
limit?: number;
|
|
2433
|
+
offset?: number;
|
|
2434
|
+
}
|
|
2384
2435
|
/** Public definition of a form (`GET /forms/{slug}`). */
|
|
2385
2436
|
interface StorefrontForm {
|
|
2386
2437
|
slug: string;
|
|
@@ -3267,6 +3318,7 @@ declare class BehioStorefront {
|
|
|
3267
3318
|
readonly pages: PagesModule;
|
|
3268
3319
|
readonly blog: BlogModule;
|
|
3269
3320
|
readonly forms: FormsModule;
|
|
3321
|
+
readonly collections: CollectionsModule;
|
|
3270
3322
|
readonly wishlist: WishlistModule;
|
|
3271
3323
|
readonly reviews: ReviewsModule;
|
|
3272
3324
|
readonly returns: ReturnsModule;
|
|
@@ -3974,6 +4026,29 @@ declare class BlogModule {
|
|
|
3974
4026
|
/** One published post with sanitised HTML content and related posts. */
|
|
3975
4027
|
post(handle: string, slug: string, locale?: string): Promise<SdkResult<BlogPostDetail>>;
|
|
3976
4028
|
}
|
|
4029
|
+
/**
|
|
4030
|
+
* Data collections: structured content the owner edits in Behio (team,
|
|
4031
|
+
* references, price list, FAQ, listings) and the site reads at runtime, so
|
|
4032
|
+
* no site needs its own database. Only public collections and published
|
|
4033
|
+
* items are returned. Cached by Behio and invalidated on every admin change.
|
|
4034
|
+
* Works with website keys that have no e-shop attached.
|
|
4035
|
+
*/
|
|
4036
|
+
declare class CollectionsModule {
|
|
4037
|
+
private client;
|
|
4038
|
+
constructor(client: BehioStorefront);
|
|
4039
|
+
/**
|
|
4040
|
+
* One collection with its published items in the owner's order.
|
|
4041
|
+
* `limit` 1 to 200 (default 100), `offset` for paging; `total` is the
|
|
4042
|
+
* number of published items. 404 `be.collections.collectionNotFound` for an
|
|
4043
|
+
* unknown or private slug.
|
|
4044
|
+
*/
|
|
4045
|
+
get(slug: string, query?: StorefrontCollectionQuery): Promise<SdkResult<StorefrontCollection>>;
|
|
4046
|
+
/**
|
|
4047
|
+
* One published item by its slug or id (detail page). 404
|
|
4048
|
+
* `be.collections.itemNotFound` for a draft or unknown item.
|
|
4049
|
+
*/
|
|
4050
|
+
item(slug: string, itemSlugOrId: string): Promise<SdkResult<StorefrontCollectionItem>>;
|
|
4051
|
+
}
|
|
3977
4052
|
/**
|
|
3978
4053
|
* Merchant-defined forms (contact, demand, registration to an event...).
|
|
3979
4054
|
* The definition is public and cacheable; a submit is validated server-side
|
|
@@ -5009,6 +5084,14 @@ interface UseBlogPostOptions {
|
|
|
5009
5084
|
/** One published post (sanitised HTML content + related posts). */
|
|
5010
5085
|
declare function useBlogPost(handle: string, slug: string, locale?: string, options?: UseBlogPostOptions): _tanstack_react_query.UseQueryResult<NoInfer<BlogPostDetail>, Error>;
|
|
5011
5086
|
|
|
5087
|
+
interface UseCollectionOptions {
|
|
5088
|
+
enabled?: boolean;
|
|
5089
|
+
}
|
|
5090
|
+
/** A public data collection with its published items (team, references, FAQ...). */
|
|
5091
|
+
declare function useCollection(slug: string, query?: StorefrontCollectionQuery, options?: UseCollectionOptions): _tanstack_react_query.UseQueryResult<NoInfer<StorefrontCollection>, Error>;
|
|
5092
|
+
/** One published collection item by slug or id (detail page). */
|
|
5093
|
+
declare function useCollectionItem(slug: string, itemSlugOrId: string, options?: UseCollectionOptions): _tanstack_react_query.UseQueryResult<NoInfer<StorefrontCollectionItem>, Error>;
|
|
5094
|
+
|
|
5012
5095
|
interface UseSiteFormOptions {
|
|
5013
5096
|
enabled?: boolean;
|
|
5014
5097
|
}
|
|
@@ -5842,4 +5925,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
|
|
|
5842
5925
|
success: boolean;
|
|
5843
5926
|
}>>;
|
|
5844
5927
|
|
|
5845
|
-
export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };
|
|
5928
|
+
export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };
|
package/dist/react.d.ts
CHANGED
|
@@ -236,6 +236,18 @@ interface CheckoutSettings {
|
|
|
236
236
|
/** Price presentation mode (Eshop.priceDisplay). See `CheckoutSettings.priceDisplay`. */
|
|
237
237
|
type PriceDisplay = "INCL_VAT" | "EXCL_VAT" | "CUSTOMER_CHOICE";
|
|
238
238
|
type CurrencyDisplayFormat = "SYMBOL_BEFORE" | "SYMBOL_AFTER" | "CODE";
|
|
239
|
+
/**
|
|
240
|
+
* Selling state of the site (SDK 2.18.0). `NONE` = website without a shop,
|
|
241
|
+
* `ADDED` = shop being set up (orders are accepted), `LIVE` = selling,
|
|
242
|
+
* `PAUSED` = not accepting orders right now: cart writes, checkout and gift
|
|
243
|
+
* card purchases answer 403 `be.storefront.shopPaused`. Keep the catalog
|
|
244
|
+
* visible and replace the buy buttons with a notice.
|
|
245
|
+
*/
|
|
246
|
+
interface ShopCommerce {
|
|
247
|
+
state: "NONE" | "ADDED" | "LIVE" | "PAUSED";
|
|
248
|
+
/** False for PAUSED and for a website without a shop. */
|
|
249
|
+
acceptsOrders: boolean;
|
|
250
|
+
}
|
|
239
251
|
interface ShopInfo {
|
|
240
252
|
/** Merchant default catalog order, normalized to the public sort values. */
|
|
241
253
|
defaultProductSort?: ProductSortValue;
|
|
@@ -251,6 +263,8 @@ interface ShopInfo {
|
|
|
251
263
|
enabled: boolean;
|
|
252
264
|
message: string | null;
|
|
253
265
|
};
|
|
266
|
+
/** Selling state. Optional because cached payloads predating SDK 2.18.0 may still be served; missing = accepting orders. */
|
|
267
|
+
commerce?: ShopCommerce;
|
|
254
268
|
id: string;
|
|
255
269
|
name: string;
|
|
256
270
|
domain: string;
|
|
@@ -2381,6 +2395,43 @@ interface StorefrontFormSettings {
|
|
|
2381
2395
|
/** When true, `consent: true` is required for the submit to pass. */
|
|
2382
2396
|
requireConsent?: boolean;
|
|
2383
2397
|
}
|
|
2398
|
+
/** Field types of a data collection. */
|
|
2399
|
+
type StorefrontCollectionFieldType = "text" | "longtext" | "number" | "boolean" | "date" | "url" | "image" | "email" | "select" | "tags";
|
|
2400
|
+
/** One field of a data collection; item values live under `data[key]`. */
|
|
2401
|
+
interface StorefrontCollectionField {
|
|
2402
|
+
key: string;
|
|
2403
|
+
type: StorefrontCollectionFieldType;
|
|
2404
|
+
label: string;
|
|
2405
|
+
required: boolean;
|
|
2406
|
+
help?: string;
|
|
2407
|
+
/** Choices for `select`, suggestions for `tags`. */
|
|
2408
|
+
options?: string[];
|
|
2409
|
+
}
|
|
2410
|
+
/** One published item of a data collection. */
|
|
2411
|
+
interface StorefrontCollectionItem {
|
|
2412
|
+
id: string;
|
|
2413
|
+
/** Detail address, unique in the collection; null when the item has none. */
|
|
2414
|
+
slug: string | null;
|
|
2415
|
+
/** `{fieldKey: value}`: text, number, boolean, `YYYY-MM-DD` date, URL, string[] for tags. */
|
|
2416
|
+
data: Record<string, unknown>;
|
|
2417
|
+
createdAt: number;
|
|
2418
|
+
updatedAt: number;
|
|
2419
|
+
}
|
|
2420
|
+
/** A public data collection (`GET /collections/{slug}`). */
|
|
2421
|
+
interface StorefrontCollection {
|
|
2422
|
+
slug: string;
|
|
2423
|
+
name: string;
|
|
2424
|
+
description: string | null;
|
|
2425
|
+
fields: StorefrontCollectionField[];
|
|
2426
|
+
items: StorefrontCollectionItem[];
|
|
2427
|
+
/** Number of published items (for paging). */
|
|
2428
|
+
total: number;
|
|
2429
|
+
}
|
|
2430
|
+
interface StorefrontCollectionQuery {
|
|
2431
|
+
/** 1 to 200, default 100. */
|
|
2432
|
+
limit?: number;
|
|
2433
|
+
offset?: number;
|
|
2434
|
+
}
|
|
2384
2435
|
/** Public definition of a form (`GET /forms/{slug}`). */
|
|
2385
2436
|
interface StorefrontForm {
|
|
2386
2437
|
slug: string;
|
|
@@ -3267,6 +3318,7 @@ declare class BehioStorefront {
|
|
|
3267
3318
|
readonly pages: PagesModule;
|
|
3268
3319
|
readonly blog: BlogModule;
|
|
3269
3320
|
readonly forms: FormsModule;
|
|
3321
|
+
readonly collections: CollectionsModule;
|
|
3270
3322
|
readonly wishlist: WishlistModule;
|
|
3271
3323
|
readonly reviews: ReviewsModule;
|
|
3272
3324
|
readonly returns: ReturnsModule;
|
|
@@ -3974,6 +4026,29 @@ declare class BlogModule {
|
|
|
3974
4026
|
/** One published post with sanitised HTML content and related posts. */
|
|
3975
4027
|
post(handle: string, slug: string, locale?: string): Promise<SdkResult<BlogPostDetail>>;
|
|
3976
4028
|
}
|
|
4029
|
+
/**
|
|
4030
|
+
* Data collections: structured content the owner edits in Behio (team,
|
|
4031
|
+
* references, price list, FAQ, listings) and the site reads at runtime, so
|
|
4032
|
+
* no site needs its own database. Only public collections and published
|
|
4033
|
+
* items are returned. Cached by Behio and invalidated on every admin change.
|
|
4034
|
+
* Works with website keys that have no e-shop attached.
|
|
4035
|
+
*/
|
|
4036
|
+
declare class CollectionsModule {
|
|
4037
|
+
private client;
|
|
4038
|
+
constructor(client: BehioStorefront);
|
|
4039
|
+
/**
|
|
4040
|
+
* One collection with its published items in the owner's order.
|
|
4041
|
+
* `limit` 1 to 200 (default 100), `offset` for paging; `total` is the
|
|
4042
|
+
* number of published items. 404 `be.collections.collectionNotFound` for an
|
|
4043
|
+
* unknown or private slug.
|
|
4044
|
+
*/
|
|
4045
|
+
get(slug: string, query?: StorefrontCollectionQuery): Promise<SdkResult<StorefrontCollection>>;
|
|
4046
|
+
/**
|
|
4047
|
+
* One published item by its slug or id (detail page). 404
|
|
4048
|
+
* `be.collections.itemNotFound` for a draft or unknown item.
|
|
4049
|
+
*/
|
|
4050
|
+
item(slug: string, itemSlugOrId: string): Promise<SdkResult<StorefrontCollectionItem>>;
|
|
4051
|
+
}
|
|
3977
4052
|
/**
|
|
3978
4053
|
* Merchant-defined forms (contact, demand, registration to an event...).
|
|
3979
4054
|
* The definition is public and cacheable; a submit is validated server-side
|
|
@@ -5009,6 +5084,14 @@ interface UseBlogPostOptions {
|
|
|
5009
5084
|
/** One published post (sanitised HTML content + related posts). */
|
|
5010
5085
|
declare function useBlogPost(handle: string, slug: string, locale?: string, options?: UseBlogPostOptions): _tanstack_react_query.UseQueryResult<NoInfer<BlogPostDetail>, Error>;
|
|
5011
5086
|
|
|
5087
|
+
interface UseCollectionOptions {
|
|
5088
|
+
enabled?: boolean;
|
|
5089
|
+
}
|
|
5090
|
+
/** A public data collection with its published items (team, references, FAQ...). */
|
|
5091
|
+
declare function useCollection(slug: string, query?: StorefrontCollectionQuery, options?: UseCollectionOptions): _tanstack_react_query.UseQueryResult<NoInfer<StorefrontCollection>, Error>;
|
|
5092
|
+
/** One published collection item by slug or id (detail page). */
|
|
5093
|
+
declare function useCollectionItem(slug: string, itemSlugOrId: string, options?: UseCollectionOptions): _tanstack_react_query.UseQueryResult<NoInfer<StorefrontCollectionItem>, Error>;
|
|
5094
|
+
|
|
5012
5095
|
interface UseSiteFormOptions {
|
|
5013
5096
|
enabled?: boolean;
|
|
5014
5097
|
}
|
|
@@ -5842,4 +5925,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
|
|
|
5842
5925
|
success: boolean;
|
|
5843
5926
|
}>>;
|
|
5844
5927
|
|
|
5845
|
-
export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };
|
|
5928
|
+
export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };
|