@behio/storefront-sdk 0.14.0 → 0.16.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-XITY2WQN.mjs → chunk-IVTS3F3H.mjs} +4 -4
- package/dist/{chunk-GGUHYQNF.js → chunk-WNJ72O66.js} +4 -4
- package/dist/{client-tINA5Ntn.d.mts → client-M8hW9taR.d.mts} +29 -7
- package/dist/{client-tINA5Ntn.d.ts → client-M8hW9taR.d.ts} +29 -7
- 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 +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +2 -2
- package/dist/react.mjs +1 -1
- package/package.json +1 -1
|
@@ -633,7 +633,7 @@ var CartModule = class {
|
|
|
633
633
|
/** Add item to cart */
|
|
634
634
|
async addItem(input) {
|
|
635
635
|
const res = await this.client.request("POST", "/cart/items", {
|
|
636
|
-
body: {
|
|
636
|
+
body: { productId: input.productId, quantity: input.quantity }
|
|
637
637
|
});
|
|
638
638
|
if (res.error) return res;
|
|
639
639
|
if (res.data.newSessionToken) {
|
|
@@ -674,9 +674,9 @@ var CartModule = class {
|
|
|
674
674
|
this.client.emit("cart:updated", res.data);
|
|
675
675
|
return res;
|
|
676
676
|
}
|
|
677
|
-
/** Remove a gift card from the cart */
|
|
678
|
-
async removeGiftCard() {
|
|
679
|
-
const res = await this.client.request("DELETE",
|
|
677
|
+
/** Remove a specific applied gift card from the cart by its code. */
|
|
678
|
+
async removeGiftCard(code) {
|
|
679
|
+
const res = await this.client.request("DELETE", `/cart/gift-card/${encodeURIComponent(code)}`);
|
|
680
680
|
if (res.error) return res;
|
|
681
681
|
this.client.emit("cart:updated", res.data);
|
|
682
682
|
return res;
|
|
@@ -633,7 +633,7 @@ var CartModule = class {
|
|
|
633
633
|
/** Add item to cart */
|
|
634
634
|
async addItem(input) {
|
|
635
635
|
const res = await this.client.request("POST", "/cart/items", {
|
|
636
|
-
body: {
|
|
636
|
+
body: { productId: input.productId, quantity: input.quantity }
|
|
637
637
|
});
|
|
638
638
|
if (res.error) return res;
|
|
639
639
|
if (res.data.newSessionToken) {
|
|
@@ -674,9 +674,9 @@ var CartModule = class {
|
|
|
674
674
|
this.client.emit("cart:updated", res.data);
|
|
675
675
|
return res;
|
|
676
676
|
}
|
|
677
|
-
/** Remove a gift card from the cart */
|
|
678
|
-
async removeGiftCard() {
|
|
679
|
-
const res = await this.client.request("DELETE",
|
|
677
|
+
/** Remove a specific applied gift card from the cart by its code. */
|
|
678
|
+
async removeGiftCard(code) {
|
|
679
|
+
const res = await this.client.request("DELETE", `/cart/gift-card/${encodeURIComponent(code)}`);
|
|
680
680
|
if (res.error) return res;
|
|
681
681
|
this.client.emit("cart:updated", res.data);
|
|
682
682
|
return res;
|
|
@@ -109,6 +109,11 @@ interface ProductVolumePrice {
|
|
|
109
109
|
currency?: string;
|
|
110
110
|
}
|
|
111
111
|
interface ProductVariant {
|
|
112
|
+
/**
|
|
113
|
+
* Eshop product ID of this variant (each variant is its own sellable eshop
|
|
114
|
+
* product). Pass it straight to `cart.addItem({productId: variant.id})` to add
|
|
115
|
+
* the chosen variant.
|
|
116
|
+
*/
|
|
112
117
|
id: string;
|
|
113
118
|
sku: string;
|
|
114
119
|
name: string;
|
|
@@ -319,6 +324,12 @@ interface CartItemProduct {
|
|
|
319
324
|
}
|
|
320
325
|
interface CartItem {
|
|
321
326
|
id: string;
|
|
327
|
+
/**
|
|
328
|
+
* Eshop product ID of the sellable unit on this line. A variant is its own
|
|
329
|
+
* product, so this is the exact product/variant the customer added — use it
|
|
330
|
+
* to deep-link back to the product page.
|
|
331
|
+
*/
|
|
332
|
+
productId: string;
|
|
322
333
|
product: CartItemProduct;
|
|
323
334
|
quantity: number;
|
|
324
335
|
unitPrice: number;
|
|
@@ -341,12 +352,23 @@ interface Cart {
|
|
|
341
352
|
grandTotal: number;
|
|
342
353
|
currency: string;
|
|
343
354
|
itemCount: number;
|
|
344
|
-
/** Applied gift
|
|
345
|
-
*
|
|
346
|
-
|
|
355
|
+
/** Applied gift cards (multi). They deduct at checkout (consumed in order, each
|
|
356
|
+
* min(balance, remaining due), last one partially), so they do not change
|
|
357
|
+
* `grandTotal` here; use them to list applied cards + balances in the cart. */
|
|
358
|
+
giftCards: GiftCardSummary[];
|
|
359
|
+
}
|
|
360
|
+
/** A gift card applied to the cart, with its current balance. */
|
|
361
|
+
interface GiftCardSummary {
|
|
362
|
+
code: string;
|
|
363
|
+
balance: number;
|
|
364
|
+
currency: string;
|
|
347
365
|
}
|
|
348
366
|
interface AddToCartInput {
|
|
349
|
-
/**
|
|
367
|
+
/**
|
|
368
|
+
* Eshop product ID of the sellable unit. A variant is its own eshop product,
|
|
369
|
+
* so to add a chosen variant just pass that variant's `id` (from
|
|
370
|
+
* `ProductDetail.variants[].id`) here — there is no separate variant field.
|
|
371
|
+
*/
|
|
350
372
|
productId: string;
|
|
351
373
|
quantity: number;
|
|
352
374
|
}
|
|
@@ -1099,8 +1121,8 @@ declare class CartModule {
|
|
|
1099
1121
|
clear(): Promise<SdkResult<void>>;
|
|
1100
1122
|
/** Apply a gift card code to the cart. Balance is deducted at checkout. */
|
|
1101
1123
|
applyGiftCard(code: string): Promise<SdkResult<Cart>>;
|
|
1102
|
-
/** Remove a gift card from the cart */
|
|
1103
|
-
removeGiftCard(): Promise<SdkResult<Cart>>;
|
|
1124
|
+
/** Remove a specific applied gift card from the cart by its code. */
|
|
1125
|
+
removeGiftCard(code: string): Promise<SdkResult<Cart>>;
|
|
1104
1126
|
/**
|
|
1105
1127
|
* Add a bundle to the cart. Price is snapshotted at the bundle's current
|
|
1106
1128
|
* price. Pass either the bundle id or its slug — slug is more ergonomic
|
|
@@ -1340,4 +1362,4 @@ declare class ShippingModule {
|
|
|
1340
1362
|
}>>;
|
|
1341
1363
|
}
|
|
1342
1364
|
|
|
1343
|
-
export { type PaymentStatus as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type CookieConsent as D, type CookieConsentInput as E, type FilterField as F, type GiftCardBalance as G, type SubmitQuoteInput as H, type BackInStockSubscription as I, type AddToCartInput as J, type AuthTokens as K, BehioApiError as L, type BundleItem as M, type CartDiscount as N, type OrderListItem as O, type ProductsQuery as P, type QuoteRequest as Q, type RegisterInput as R, type ShopInfo as S, type CartItem as T, type CheckoutAddress as U, type FulfillmentStatus as V, type WishlistItem as W, type LoginInput as X, type MessageResponse as Y, type OrderItem as Z, type OrderStatus as _, BehioStorefront as a, type ProductPrice as a0, type ProductReview as a1, type ProductVariant as a2, type AddressType as a3, AddressTypes as a4, type BehioErrorCode as a5, type BehioEventHandler as a6, type BehioEventType as a7, BehioNetworkError as a8, type CartItemProduct as a9,
|
|
1365
|
+
export { type PaymentStatus as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type CookieConsent as D, type CookieConsentInput as E, type FilterField as F, type GiftCardBalance as G, type SubmitQuoteInput as H, type BackInStockSubscription as I, type AddToCartInput as J, type AuthTokens as K, BehioApiError as L, type BundleItem as M, type CartDiscount as N, type OrderListItem as O, type ProductsQuery as P, type QuoteRequest as Q, type RegisterInput as R, type ShopInfo as S, type CartItem as T, type CheckoutAddress as U, type FulfillmentStatus as V, type WishlistItem as W, type LoginInput as X, type MessageResponse as Y, type OrderItem as Z, type OrderStatus as _, BehioStorefront as a, type ProductPrice as a0, type ProductReview as a1, type ProductVariant as a2, type AddressType as a3, AddressTypes as a4, type BehioErrorCode as a5, type BehioEventHandler as a6, type BehioEventType as a7, BehioNetworkError as a8, type CartItemProduct as a9, type ShippingQuoteInput as aA, err as aB, ok as aC, toSdkError as aD, type CheckoutPaymentMethod as aa, type DataGroupFieldType as ab, FulfillmentStatuses as ac, type GiftCardSummary as ad, type OrderStatusHistory as ae, OrderStatuses as af, type OrderTracking as ag, type PageAttachment as ah, PaymentStatuses as ai, type ProductMedia as aj, type ProductMediaVariant as ak, ProductSort as al, type ProductSortValue as am, type ProductVolumePrice as an, type QuoteItem as ao, type RequestInterceptor as ap, type RequestInterceptorConfig as aq, type ResponseInterceptor as ar, type ResponseInterceptorData as as, type ReturnRequestItem as at, type ReturnStatusItem as au, type ReturnableOrderItem as av, type SdkError as aw, type SdkResult as ax, type ShippingMethodSummary as ay, type ShippingQuote as az, type PaginatedResponse as b, 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 OrderDetail as k, type OrderAccessRequestResponse as l, type OrderAccessVerifyResponse as m, type CheckoutInput as n, type PageDetail as o, type Page as p, type ShopSeo as q, type Bundle as r, type CrossSellItem as s, type ActivePromotion as t, type ProductReviewsResponse as u, type SubmitReviewInput as v, type ReturnableOrder as w, type ReturnStatus as x, type ReturnRequest as y, type SubmitReturnInput as z };
|
|
@@ -109,6 +109,11 @@ interface ProductVolumePrice {
|
|
|
109
109
|
currency?: string;
|
|
110
110
|
}
|
|
111
111
|
interface ProductVariant {
|
|
112
|
+
/**
|
|
113
|
+
* Eshop product ID of this variant (each variant is its own sellable eshop
|
|
114
|
+
* product). Pass it straight to `cart.addItem({productId: variant.id})` to add
|
|
115
|
+
* the chosen variant.
|
|
116
|
+
*/
|
|
112
117
|
id: string;
|
|
113
118
|
sku: string;
|
|
114
119
|
name: string;
|
|
@@ -319,6 +324,12 @@ interface CartItemProduct {
|
|
|
319
324
|
}
|
|
320
325
|
interface CartItem {
|
|
321
326
|
id: string;
|
|
327
|
+
/**
|
|
328
|
+
* Eshop product ID of the sellable unit on this line. A variant is its own
|
|
329
|
+
* product, so this is the exact product/variant the customer added — use it
|
|
330
|
+
* to deep-link back to the product page.
|
|
331
|
+
*/
|
|
332
|
+
productId: string;
|
|
322
333
|
product: CartItemProduct;
|
|
323
334
|
quantity: number;
|
|
324
335
|
unitPrice: number;
|
|
@@ -341,12 +352,23 @@ interface Cart {
|
|
|
341
352
|
grandTotal: number;
|
|
342
353
|
currency: string;
|
|
343
354
|
itemCount: number;
|
|
344
|
-
/** Applied gift
|
|
345
|
-
*
|
|
346
|
-
|
|
355
|
+
/** Applied gift cards (multi). They deduct at checkout (consumed in order, each
|
|
356
|
+
* min(balance, remaining due), last one partially), so they do not change
|
|
357
|
+
* `grandTotal` here; use them to list applied cards + balances in the cart. */
|
|
358
|
+
giftCards: GiftCardSummary[];
|
|
359
|
+
}
|
|
360
|
+
/** A gift card applied to the cart, with its current balance. */
|
|
361
|
+
interface GiftCardSummary {
|
|
362
|
+
code: string;
|
|
363
|
+
balance: number;
|
|
364
|
+
currency: string;
|
|
347
365
|
}
|
|
348
366
|
interface AddToCartInput {
|
|
349
|
-
/**
|
|
367
|
+
/**
|
|
368
|
+
* Eshop product ID of the sellable unit. A variant is its own eshop product,
|
|
369
|
+
* so to add a chosen variant just pass that variant's `id` (from
|
|
370
|
+
* `ProductDetail.variants[].id`) here — there is no separate variant field.
|
|
371
|
+
*/
|
|
350
372
|
productId: string;
|
|
351
373
|
quantity: number;
|
|
352
374
|
}
|
|
@@ -1099,8 +1121,8 @@ declare class CartModule {
|
|
|
1099
1121
|
clear(): Promise<SdkResult<void>>;
|
|
1100
1122
|
/** Apply a gift card code to the cart. Balance is deducted at checkout. */
|
|
1101
1123
|
applyGiftCard(code: string): Promise<SdkResult<Cart>>;
|
|
1102
|
-
/** Remove a gift card from the cart */
|
|
1103
|
-
removeGiftCard(): Promise<SdkResult<Cart>>;
|
|
1124
|
+
/** Remove a specific applied gift card from the cart by its code. */
|
|
1125
|
+
removeGiftCard(code: string): Promise<SdkResult<Cart>>;
|
|
1104
1126
|
/**
|
|
1105
1127
|
* Add a bundle to the cart. Price is snapshotted at the bundle's current
|
|
1106
1128
|
* price. Pass either the bundle id or its slug — slug is more ergonomic
|
|
@@ -1340,4 +1362,4 @@ declare class ShippingModule {
|
|
|
1340
1362
|
}>>;
|
|
1341
1363
|
}
|
|
1342
1364
|
|
|
1343
|
-
export { type PaymentStatus as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type CookieConsent as D, type CookieConsentInput as E, type FilterField as F, type GiftCardBalance as G, type SubmitQuoteInput as H, type BackInStockSubscription as I, type AddToCartInput as J, type AuthTokens as K, BehioApiError as L, type BundleItem as M, type CartDiscount as N, type OrderListItem as O, type ProductsQuery as P, type QuoteRequest as Q, type RegisterInput as R, type ShopInfo as S, type CartItem as T, type CheckoutAddress as U, type FulfillmentStatus as V, type WishlistItem as W, type LoginInput as X, type MessageResponse as Y, type OrderItem as Z, type OrderStatus as _, BehioStorefront as a, type ProductPrice as a0, type ProductReview as a1, type ProductVariant as a2, type AddressType as a3, AddressTypes as a4, type BehioErrorCode as a5, type BehioEventHandler as a6, type BehioEventType as a7, BehioNetworkError as a8, type CartItemProduct as a9,
|
|
1365
|
+
export { type PaymentStatus as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type CookieConsent as D, type CookieConsentInput as E, type FilterField as F, type GiftCardBalance as G, type SubmitQuoteInput as H, type BackInStockSubscription as I, type AddToCartInput as J, type AuthTokens as K, BehioApiError as L, type BundleItem as M, type CartDiscount as N, type OrderListItem as O, type ProductsQuery as P, type QuoteRequest as Q, type RegisterInput as R, type ShopInfo as S, type CartItem as T, type CheckoutAddress as U, type FulfillmentStatus as V, type WishlistItem as W, type LoginInput as X, type MessageResponse as Y, type OrderItem as Z, type OrderStatus as _, BehioStorefront as a, type ProductPrice as a0, type ProductReview as a1, type ProductVariant as a2, type AddressType as a3, AddressTypes as a4, type BehioErrorCode as a5, type BehioEventHandler as a6, type BehioEventType as a7, BehioNetworkError as a8, type CartItemProduct as a9, type ShippingQuoteInput as aA, err as aB, ok as aC, toSdkError as aD, type CheckoutPaymentMethod as aa, type DataGroupFieldType as ab, FulfillmentStatuses as ac, type GiftCardSummary as ad, type OrderStatusHistory as ae, OrderStatuses as af, type OrderTracking as ag, type PageAttachment as ah, PaymentStatuses as ai, type ProductMedia as aj, type ProductMediaVariant as ak, ProductSort as al, type ProductSortValue as am, type ProductVolumePrice as an, type QuoteItem as ao, type RequestInterceptor as ap, type RequestInterceptorConfig as aq, type ResponseInterceptor as ar, type ResponseInterceptorData as as, type ReturnRequestItem as at, type ReturnStatusItem as au, type ReturnableOrderItem as av, type SdkError as aw, type SdkResult as ax, type ShippingMethodSummary as ay, type ShippingQuote as az, type PaginatedResponse as b, 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 OrderDetail as k, type OrderAccessRequestResponse as l, type OrderAccessVerifyResponse as m, type CheckoutInput as n, type PageDetail as o, type Page as p, type ShopSeo as q, type Bundle as r, type CrossSellItem as s, type ActivePromotion as t, type ProductReviewsResponse as u, type SubmitReviewInput as v, type ReturnableOrder as w, type ReturnStatus as x, type ReturnRequest as y, type SubmitReturnInput as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { t as ActivePromotion, J as AddToCartInput, j as AddressDetail, A as AddressSuggestion, a3 as AddressType, a4 as AddressTypes, K as AuthTokens, I as BackInStockSubscription, L as BehioApiError, a5 as BehioErrorCode, a6 as BehioEventHandler, a7 as BehioEventType, a8 as BehioNetworkError, a as BehioStorefront, B as BehioStorefrontConfig, r as Bundle, M as BundleItem, g as Cart, N as CartDiscount, T as CartItem, a9 as CartItemProduct, C as Category, e as CategoryDetail, U as CheckoutAddress, n as CheckoutInput, aa as CheckoutPaymentMethod, D as CookieConsent, E as CookieConsentInput, s as CrossSellItem, i as CustomerAddress, h as CustomerProfile, ab as DataGroupFieldType, F as FilterField, V as FulfillmentStatus, ac as FulfillmentStatuses, G as GiftCardBalance, X as LoginInput, Y as MessageResponse, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, k as OrderDetail, Z as OrderItem, O as OrderListItem, _ as OrderStatus,
|
|
1
|
+
export { t as ActivePromotion, J as AddToCartInput, j as AddressDetail, A as AddressSuggestion, a3 as AddressType, a4 as AddressTypes, K as AuthTokens, I as BackInStockSubscription, L as BehioApiError, a5 as BehioErrorCode, a6 as BehioEventHandler, a7 as BehioEventType, a8 as BehioNetworkError, a as BehioStorefront, B as BehioStorefrontConfig, r as Bundle, M as BundleItem, g as Cart, N as CartDiscount, T as CartItem, a9 as CartItemProduct, C as Category, e as CategoryDetail, U as CheckoutAddress, n as CheckoutInput, aa as CheckoutPaymentMethod, D as CookieConsent, E as CookieConsentInput, s as CrossSellItem, i as CustomerAddress, h as CustomerProfile, ab as DataGroupFieldType, F as FilterField, V as FulfillmentStatus, ac as FulfillmentStatuses, G as GiftCardBalance, ad as GiftCardSummary, X as LoginInput, Y as MessageResponse, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, k as OrderDetail, Z as OrderItem, O as OrderListItem, _ as OrderStatus, ae as OrderStatusHistory, af as OrderStatuses, ag as OrderTracking, p as Page, ah as PageAttachment, o as PageDetail, b as PaginatedResponse, $ as PaymentStatus, ai as PaymentStatuses, d as ProductDetail, f as ProductLabel, c as ProductListItem, aj as ProductMedia, ak as ProductMediaVariant, a0 as ProductPrice, a1 as ProductReview, u as ProductReviewsResponse, al as ProductSort, am as ProductSortValue, a2 as ProductVariant, an as ProductVolumePrice, P as ProductsQuery, ao as QuoteItem, Q as QuoteRequest, R as RegisterInput, ap as RequestInterceptor, aq as RequestInterceptorConfig, ar as ResponseInterceptor, as as ResponseInterceptorData, y as ReturnRequest, at as ReturnRequestItem, x as ReturnStatus, au as ReturnStatusItem, w as ReturnableOrder, av as ReturnableOrderItem, aw as SdkError, ax as SdkResult, ay as ShippingMethodSummary, az as ShippingQuote, aA as ShippingQuoteInput, S as ShopInfo, q as ShopSeo, H as SubmitQuoteInput, z as SubmitReturnInput, v as SubmitReviewInput, W as WishlistItem, aB as err, aC as ok, aD as toSdkError } from './client-M8hW9taR.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { t as ActivePromotion, J as AddToCartInput, j as AddressDetail, A as AddressSuggestion, a3 as AddressType, a4 as AddressTypes, K as AuthTokens, I as BackInStockSubscription, L as BehioApiError, a5 as BehioErrorCode, a6 as BehioEventHandler, a7 as BehioEventType, a8 as BehioNetworkError, a as BehioStorefront, B as BehioStorefrontConfig, r as Bundle, M as BundleItem, g as Cart, N as CartDiscount, T as CartItem, a9 as CartItemProduct, C as Category, e as CategoryDetail, U as CheckoutAddress, n as CheckoutInput, aa as CheckoutPaymentMethod, D as CookieConsent, E as CookieConsentInput, s as CrossSellItem, i as CustomerAddress, h as CustomerProfile, ab as DataGroupFieldType, F as FilterField, V as FulfillmentStatus, ac as FulfillmentStatuses, G as GiftCardBalance, X as LoginInput, Y as MessageResponse, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, k as OrderDetail, Z as OrderItem, O as OrderListItem, _ as OrderStatus,
|
|
1
|
+
export { t as ActivePromotion, J as AddToCartInput, j as AddressDetail, A as AddressSuggestion, a3 as AddressType, a4 as AddressTypes, K as AuthTokens, I as BackInStockSubscription, L as BehioApiError, a5 as BehioErrorCode, a6 as BehioEventHandler, a7 as BehioEventType, a8 as BehioNetworkError, a as BehioStorefront, B as BehioStorefrontConfig, r as Bundle, M as BundleItem, g as Cart, N as CartDiscount, T as CartItem, a9 as CartItemProduct, C as Category, e as CategoryDetail, U as CheckoutAddress, n as CheckoutInput, aa as CheckoutPaymentMethod, D as CookieConsent, E as CookieConsentInput, s as CrossSellItem, i as CustomerAddress, h as CustomerProfile, ab as DataGroupFieldType, F as FilterField, V as FulfillmentStatus, ac as FulfillmentStatuses, G as GiftCardBalance, ad as GiftCardSummary, X as LoginInput, Y as MessageResponse, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, k as OrderDetail, Z as OrderItem, O as OrderListItem, _ as OrderStatus, ae as OrderStatusHistory, af as OrderStatuses, ag as OrderTracking, p as Page, ah as PageAttachment, o as PageDetail, b as PaginatedResponse, $ as PaymentStatus, ai as PaymentStatuses, d as ProductDetail, f as ProductLabel, c as ProductListItem, aj as ProductMedia, ak as ProductMediaVariant, a0 as ProductPrice, a1 as ProductReview, u as ProductReviewsResponse, al as ProductSort, am as ProductSortValue, a2 as ProductVariant, an as ProductVolumePrice, P as ProductsQuery, ao as QuoteItem, Q as QuoteRequest, R as RegisterInput, ap as RequestInterceptor, aq as RequestInterceptorConfig, ar as ResponseInterceptor, as as ResponseInterceptorData, y as ReturnRequest, at as ReturnRequestItem, x as ReturnStatus, au as ReturnStatusItem, w as ReturnableOrder, av as ReturnableOrderItem, aw as SdkError, ax as SdkResult, ay as ShippingMethodSummary, az as ShippingQuote, aA as ShippingQuoteInput, S as ShopInfo, q as ShopSeo, H as SubmitQuoteInput, z as SubmitReturnInput, v as SubmitReviewInput, W as WishlistItem, aB as err, aC as ok, aD as toSdkError } from './client-M8hW9taR.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var _chunkXWYDXBLGjs = require('./chunk-XWYDXBLG.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkWNJ72O66js = require('./chunk-WNJ72O66.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -27,4 +27,4 @@ var _chunkGGUHYQNFjs = require('./chunk-GGUHYQNF.js');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.AddressTypes =
|
|
30
|
+
exports.AddressTypes = _chunkWNJ72O66js.AddressTypes; exports.BehioApiError = _chunkWNJ72O66js.BehioApiError; exports.BehioNetworkError = _chunkWNJ72O66js.BehioNetworkError; exports.BehioStorefront = _chunkWNJ72O66js.BehioStorefront; exports.FulfillmentStatuses = _chunkWNJ72O66js.FulfillmentStatuses; exports.OrderStatuses = _chunkWNJ72O66js.OrderStatuses; exports.PaymentStatuses = _chunkWNJ72O66js.PaymentStatuses; exports.ProductSort = _chunkWNJ72O66js.ProductSort; exports.err = _chunkWNJ72O66js.err; exports.formatPrice = _chunkXWYDXBLGjs.formatPrice; exports.ok = _chunkWNJ72O66js.ok; exports.toSdkError = _chunkWNJ72O66js.toSdkError;
|
package/dist/index.mjs
CHANGED
package/dist/next.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-
|
|
1
|
+
import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-M8hW9taR.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 { B as BehioStorefrontConfig, a as BehioStorefront } from './client-
|
|
1
|
+
import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-M8hW9taR.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 _chunkWNJ72O66js = require('./chunk-WNJ72O66.js');
|
|
4
4
|
|
|
5
5
|
// src/next.ts
|
|
6
6
|
var _headers = require('next/headers');
|
|
@@ -18,7 +18,7 @@ async function getBehio(options = {}) {
|
|
|
18
18
|
const locale = _nullishCoalesce(options.locale, () => ( process.env.BEHIO_LOCALE));
|
|
19
19
|
const currency = _nullishCoalesce(options.currency, () => ( process.env.BEHIO_CURRENCY));
|
|
20
20
|
const cookieName = _nullishCoalesce(options.cartCookieName, () => ( CART_COOKIE_NAME));
|
|
21
|
-
const client = new (0,
|
|
21
|
+
const client = new (0, _chunkWNJ72O66js.BehioStorefront)({
|
|
22
22
|
apiKey,
|
|
23
23
|
...baseUrl ? { baseUrl } : {},
|
|
24
24
|
...locale ? { locale } : {},
|
package/dist/next.mjs
CHANGED
package/dist/react.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { QueryClient } from '@tanstack/react-query';
|
|
4
|
-
import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, f as ProductLabel, F as FilterField, g as Cart, h as CustomerProfile, R as RegisterInput, i as CustomerAddress, A as AddressSuggestion, j as AddressDetail, O as OrderListItem, k as OrderDetail, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, n as CheckoutInput, o as PageDetail, p as Page, S as ShopInfo, q as ShopSeo, r as Bundle, s as CrossSellItem, t as ActivePromotion, G as GiftCardBalance, W as WishlistItem, u as ProductReviewsResponse, v as SubmitReviewInput, w as ReturnableOrder, x as ReturnStatus, y as ReturnRequest, z as SubmitReturnInput, D as CookieConsent, E as CookieConsentInput, Q as QuoteRequest, H as SubmitQuoteInput, I as BackInStockSubscription } from './client-
|
|
5
|
-
export { J as AddToCartInput, K as AuthTokens, L as BehioApiError, M as BundleItem, N as CartDiscount, T as CartItem, U as CheckoutAddress, V as FulfillmentStatus, X as LoginInput, Y as MessageResponse, Z as OrderItem, _ as OrderStatus, $ as PaymentStatus, a0 as ProductPrice, a1 as ProductReview, a2 as ProductVariant } from './client-
|
|
4
|
+
import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, f as ProductLabel, F as FilterField, g as Cart, h as CustomerProfile, R as RegisterInput, i as CustomerAddress, A as AddressSuggestion, j as AddressDetail, O as OrderListItem, k as OrderDetail, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, n as CheckoutInput, o as PageDetail, p as Page, S as ShopInfo, q as ShopSeo, r as Bundle, s as CrossSellItem, t as ActivePromotion, G as GiftCardBalance, W as WishlistItem, u as ProductReviewsResponse, v as SubmitReviewInput, w as ReturnableOrder, x as ReturnStatus, y as ReturnRequest, z as SubmitReturnInput, D as CookieConsent, E as CookieConsentInput, Q as QuoteRequest, H as SubmitQuoteInput, I as BackInStockSubscription } from './client-M8hW9taR.mjs';
|
|
5
|
+
export { J as AddToCartInput, K as AuthTokens, L as BehioApiError, M as BundleItem, N as CartDiscount, T as CartItem, U as CheckoutAddress, V as FulfillmentStatus, X as LoginInput, Y as MessageResponse, Z as OrderItem, _ as OrderStatus, $ as PaymentStatus, a0 as ProductPrice, a1 as ProductReview, a2 as ProductVariant } from './client-M8hW9taR.mjs';
|
|
6
6
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
7
|
export { formatPrice } from './index.mjs';
|
|
8
8
|
|
package/dist/react.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { QueryClient } from '@tanstack/react-query';
|
|
4
|
-
import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, f as ProductLabel, F as FilterField, g as Cart, h as CustomerProfile, R as RegisterInput, i as CustomerAddress, A as AddressSuggestion, j as AddressDetail, O as OrderListItem, k as OrderDetail, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, n as CheckoutInput, o as PageDetail, p as Page, S as ShopInfo, q as ShopSeo, r as Bundle, s as CrossSellItem, t as ActivePromotion, G as GiftCardBalance, W as WishlistItem, u as ProductReviewsResponse, v as SubmitReviewInput, w as ReturnableOrder, x as ReturnStatus, y as ReturnRequest, z as SubmitReturnInput, D as CookieConsent, E as CookieConsentInput, Q as QuoteRequest, H as SubmitQuoteInput, I as BackInStockSubscription } from './client-
|
|
5
|
-
export { J as AddToCartInput, K as AuthTokens, L as BehioApiError, M as BundleItem, N as CartDiscount, T as CartItem, U as CheckoutAddress, V as FulfillmentStatus, X as LoginInput, Y as MessageResponse, Z as OrderItem, _ as OrderStatus, $ as PaymentStatus, a0 as ProductPrice, a1 as ProductReview, a2 as ProductVariant } from './client-
|
|
4
|
+
import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, f as ProductLabel, F as FilterField, g as Cart, h as CustomerProfile, R as RegisterInput, i as CustomerAddress, A as AddressSuggestion, j as AddressDetail, O as OrderListItem, k as OrderDetail, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, n as CheckoutInput, o as PageDetail, p as Page, S as ShopInfo, q as ShopSeo, r as Bundle, s as CrossSellItem, t as ActivePromotion, G as GiftCardBalance, W as WishlistItem, u as ProductReviewsResponse, v as SubmitReviewInput, w as ReturnableOrder, x as ReturnStatus, y as ReturnRequest, z as SubmitReturnInput, D as CookieConsent, E as CookieConsentInput, Q as QuoteRequest, H as SubmitQuoteInput, I as BackInStockSubscription } from './client-M8hW9taR.js';
|
|
5
|
+
export { J as AddToCartInput, K as AuthTokens, L as BehioApiError, M as BundleItem, N as CartDiscount, T as CartItem, U as CheckoutAddress, V as FulfillmentStatus, X as LoginInput, Y as MessageResponse, Z as OrderItem, _ as OrderStatus, $ as PaymentStatus, a0 as ProductPrice, a1 as ProductReview, a2 as ProductVariant } from './client-M8hW9taR.js';
|
|
6
6
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
7
|
export { formatPrice } from './index.js';
|
|
8
8
|
|
package/dist/react.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkXWYDXBLGjs = require('./chunk-XWYDXBLG.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkWNJ72O66js = require('./chunk-WNJ72O66.js');
|
|
7
7
|
|
|
8
8
|
// src/react/provider.tsx
|
|
9
9
|
var _react = require('react');
|
|
@@ -133,7 +133,7 @@ function BehioProvider({
|
|
|
133
133
|
const [activeCurrency, setActiveCurrency] = _react.useState.call(void 0, resolveInitialCurrency);
|
|
134
134
|
const clientRef = _react.useRef.call(void 0, null);
|
|
135
135
|
if (!clientRef.current) {
|
|
136
|
-
clientRef.current = new (0,
|
|
136
|
+
clientRef.current = new (0, _chunkWNJ72O66js.BehioStorefront)({
|
|
137
137
|
apiKey,
|
|
138
138
|
baseUrl,
|
|
139
139
|
...shopDomain ? { shopDomain } : {},
|
package/dist/react.mjs
CHANGED