@behio/storefront-sdk 0.4.0 → 0.6.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 +1 -0
- package/dist/{chunk-YLKO3SUR.js → chunk-77TWIYZE.js} +88 -6
- package/dist/{chunk-L5KVNLTD.mjs → chunk-COWHUXHJ.mjs} +87 -5
- package/dist/index.d.mts +316 -5
- package/dist/index.d.ts +316 -5
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/next.d.mts +14 -0
- package/dist/next.d.ts +14 -0
- package/dist/next.js +57 -0
- package/dist/next.mjs +57 -0
- package/dist/react.d.mts +8 -3
- package/dist/react.d.ts +8 -3
- package/dist/react.js +10 -3
- package/dist/react.mjs +8 -1
- package/package.json +6 -1
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 { BehioStorefront, ProductsQuery, PaginatedResponse, ProductListItem, ProductDetail, Category, CategoryDetail, ProductLabel, FilterField, Cart, CustomerProfile, RegisterInput, CustomerAddress, AddressSuggestion, AddressDetail, OrderListItem, OrderDetail, CheckoutInput, PageDetail, Page, ShopInfo, ShopSeo, Bundle, CrossSellItem, ActivePromotion, GiftCardBalance, WishlistItem, ProductReviewsResponse, SubmitReviewInput, ReturnRequest, SubmitReturnInput, CookieConsent, CookieConsentInput, QuoteRequest, SubmitQuoteInput } from './index.js';
|
|
4
|
+
import { BehioStorefront, ProductsQuery, PaginatedResponse, ProductListItem, ProductDetail, Category, CategoryDetail, ProductLabel, FilterField, Cart, CustomerProfile, RegisterInput, CustomerAddress, AddressSuggestion, AddressDetail, OrderListItem, OrderDetail, CheckoutInput, PageDetail, Page, ShopInfo, ShopSeo, Bundle, CrossSellItem, ActivePromotion, GiftCardBalance, WishlistItem, ProductReviewsResponse, SubmitReviewInput, ReturnableOrder, ReturnStatus, ReturnRequest, SubmitReturnInput, CookieConsent, CookieConsentInput, QuoteRequest, SubmitQuoteInput } from './index.js';
|
|
5
5
|
export { AddToCartInput, AuthTokens, BehioApiError, BundleItem, CartDiscount, CartItem, CheckoutAddress, FulfillmentStatus, LoginInput, MessageResponse, OrderItem, OrderStatus, PaymentStatus, ProductPrice, ProductReview, ProductVariant } from './index.js';
|
|
6
6
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
7
|
|
|
@@ -639,8 +639,13 @@ declare function useSubmitReview(): _tanstack_react_query.UseMutationResult<{
|
|
|
639
639
|
id: string;
|
|
640
640
|
}, Error, SubmitReviewInput, unknown>;
|
|
641
641
|
|
|
642
|
+
/** Guest order lookup for the EU withdrawal form (order number + order email). */
|
|
643
|
+
declare function useLookupReturnableOrder(): _tanstack_react_query.UseMutationResult<ReturnableOrder, Error, {
|
|
644
|
+
orderNumber: string;
|
|
645
|
+
email: string;
|
|
646
|
+
}, unknown>;
|
|
642
647
|
declare function useSubmitReturn(): _tanstack_react_query.UseMutationResult<ReturnRequest, Error, SubmitReturnInput, unknown>;
|
|
643
|
-
declare function useReturnStatus(returnId: string | undefined, email: string | undefined): _tanstack_react_query.UseQueryResult<
|
|
648
|
+
declare function useReturnStatus(returnId: string | undefined, email: string | undefined): _tanstack_react_query.UseQueryResult<ReturnStatus, Error>;
|
|
644
649
|
|
|
645
650
|
declare function useCookieConsent(visitorId: string | undefined): {
|
|
646
651
|
record: _tanstack_react_query.UseMutateAsyncFunction<CookieConsent, Error, CookieConsentInput, unknown>;
|
|
@@ -851,4 +856,4 @@ declare function useBehioClient(): BehioStorefront;
|
|
|
851
856
|
*/
|
|
852
857
|
declare function formatPrice(amount: number, currency: string, locale?: string): string;
|
|
853
858
|
|
|
854
|
-
export { ActivePromotion, BehioProvider, type BehioProviderProps, Bundle, Cart, Category, CategoryDetail, CheckoutInput, CookieConsent, CookieConsentInput, CrossSellItem, CustomerAddress, CustomerProfile, FilterField, GiftCardBalance, OrderDetail, OrderListItem, Page, PageDetail, PaginatedResponse, ProductDetail, ProductLabel, ProductListItem, ProductReviewsResponse, ProductsQuery, QuoteRequest, RegisterInput, ReturnRequest, ShopInfo, ShopSeo, type StorageAdapter, SubmitQuoteInput, SubmitReturnInput, SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCustomerOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShopInfoOptions, type UseShopSeoOptions, WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, localStorageAdapter, memoryStorage, useAddressAutocomplete, useAddresses, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCheckout, useCookieConsent, useCrossSell, useCustomer, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useOrder, useOrders, usePage, usePages, useProduct, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShopInfo, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useWishlist };
|
|
859
|
+
export { ActivePromotion, BehioProvider, type BehioProviderProps, Bundle, Cart, Category, CategoryDetail, CheckoutInput, CookieConsent, CookieConsentInput, CrossSellItem, CustomerAddress, CustomerProfile, FilterField, GiftCardBalance, OrderDetail, OrderListItem, Page, PageDetail, PaginatedResponse, ProductDetail, ProductLabel, ProductListItem, ProductReviewsResponse, ProductsQuery, QuoteRequest, RegisterInput, ReturnRequest, ShopInfo, ShopSeo, type StorageAdapter, SubmitQuoteInput, SubmitReturnInput, SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCustomerOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShopInfoOptions, type UseShopSeoOptions, WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, localStorageAdapter, memoryStorage, useAddressAutocomplete, useAddresses, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCheckout, useCookieConsent, useCrossSell, useCustomer, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLookupReturnableOrder, useOrder, useOrders, usePage, usePages, useProduct, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShopInfo, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useWishlist };
|
package/dist/react.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 _chunk77TWIYZEjs = require('./chunk-77TWIYZE.js');
|
|
4
4
|
|
|
5
5
|
// src/react/provider.tsx
|
|
6
6
|
var _react = require('react');
|
|
@@ -114,7 +114,7 @@ function BehioProvider({
|
|
|
114
114
|
const storageAdapter = _react.useMemo.call(void 0, () => resolveStorage(storageOption), [storageOption]);
|
|
115
115
|
const clientRef = _react.useRef.call(void 0, null);
|
|
116
116
|
if (!clientRef.current) {
|
|
117
|
-
clientRef.current = new (0,
|
|
117
|
+
clientRef.current = new (0, _chunk77TWIYZEjs.BehioStorefront)({
|
|
118
118
|
apiKey,
|
|
119
119
|
baseUrl,
|
|
120
120
|
locale,
|
|
@@ -1078,6 +1078,12 @@ function useSubmitReview() {
|
|
|
1078
1078
|
|
|
1079
1079
|
// src/react/hooks/use-returns.ts
|
|
1080
1080
|
|
|
1081
|
+
function useLookupReturnableOrder() {
|
|
1082
|
+
const { client } = useBehio();
|
|
1083
|
+
return _reactquery.useMutation.call(void 0, {
|
|
1084
|
+
mutationFn: ({ orderNumber, email }) => unwrap(client.returns.lookupOrder(orderNumber, email))
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1081
1087
|
function useSubmitReturn() {
|
|
1082
1088
|
const { client } = useBehio();
|
|
1083
1089
|
return _reactquery.useMutation.call(void 0, {
|
|
@@ -1199,4 +1205,5 @@ function formatPrice(amount, currency, locale) {
|
|
|
1199
1205
|
|
|
1200
1206
|
|
|
1201
1207
|
|
|
1202
|
-
|
|
1208
|
+
|
|
1209
|
+
exports.BehioProvider = BehioProvider; exports.cookieStorage = cookieStorage; exports.createMemoryStorage = createMemoryStorage; exports.detectStorage = detectStorage; exports.formatPrice = formatPrice; exports.localStorageAdapter = localStorageAdapter; exports.memoryStorage = memoryStorage; exports.useAddressAutocomplete = useAddressAutocomplete; exports.useAddresses = useAddresses; exports.useAuth = useAuth; exports.useBehio = useBehio; exports.useBehioClient = useBehioClient; exports.useBundle = useBundle; exports.useBundles = useBundles; exports.useCart = useCart; exports.useCartCount = useCartCount; exports.useCategories = useCategories; exports.useCategory = useCategory; exports.useCheckout = useCheckout; exports.useCookieConsent = useCookieConsent; exports.useCrossSell = useCrossSell; exports.useCustomer = useCustomer; exports.useFeatured = useFeatured; exports.useFilters = useFilters; exports.useGiftCardBalance = useGiftCardBalance; exports.useIsInWishlist = useIsInWishlist; exports.useLabels = useLabels; exports.useLookupReturnableOrder = useLookupReturnableOrder; exports.useOrder = useOrder; exports.useOrders = useOrders; exports.usePage = usePage; exports.usePages = usePages; exports.useProduct = useProduct; exports.useProductPromotions = useProductPromotions; exports.useProductReviews = useProductReviews; exports.useProducts = useProducts; exports.useQuoteStatus = useQuoteStatus; exports.useReturnStatus = useReturnStatus; exports.useSearch = useSearch; exports.useShopInfo = useShopInfo; exports.useShopSeo = useShopSeo; exports.useSubmitQuote = useSubmitQuote; exports.useSubmitReturn = useSubmitReturn; exports.useSubmitReview = useSubmitReview; exports.useWishlist = useWishlist;
|
package/dist/react.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BehioStorefront
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-COWHUXHJ.mjs";
|
|
4
4
|
|
|
5
5
|
// src/react/provider.tsx
|
|
6
6
|
import { useRef, useEffect, useMemo } from "react";
|
|
@@ -1078,6 +1078,12 @@ function useSubmitReview() {
|
|
|
1078
1078
|
|
|
1079
1079
|
// src/react/hooks/use-returns.ts
|
|
1080
1080
|
import { useQuery as useQuery23, useMutation as useMutation9 } from "@tanstack/react-query";
|
|
1081
|
+
function useLookupReturnableOrder() {
|
|
1082
|
+
const { client } = useBehio();
|
|
1083
|
+
return useMutation9({
|
|
1084
|
+
mutationFn: ({ orderNumber, email }) => unwrap(client.returns.lookupOrder(orderNumber, email))
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1081
1087
|
function useSubmitReturn() {
|
|
1082
1088
|
const { client } = useBehio();
|
|
1083
1089
|
return useMutation9({
|
|
@@ -1182,6 +1188,7 @@ export {
|
|
|
1182
1188
|
useGiftCardBalance,
|
|
1183
1189
|
useIsInWishlist,
|
|
1184
1190
|
useLabels,
|
|
1191
|
+
useLookupReturnableOrder,
|
|
1185
1192
|
useOrder,
|
|
1186
1193
|
useOrders,
|
|
1187
1194
|
usePage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@behio/storefront-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "TypeScript SDK for Behio Headless E-Shop — core client + React hooks",
|
|
5
5
|
"author": "Behio",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
"types": "./dist/react.d.ts",
|
|
18
18
|
"import": "./dist/react.mjs",
|
|
19
19
|
"require": "./dist/react.js"
|
|
20
|
+
},
|
|
21
|
+
"./next": {
|
|
22
|
+
"types": "./dist/next.d.ts",
|
|
23
|
+
"import": "./dist/next.mjs",
|
|
24
|
+
"require": "./dist/next.js"
|
|
20
25
|
}
|
|
21
26
|
},
|
|
22
27
|
"files": [
|