@viu/emporix-sdk-react 2.5.1 → 2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @viu/emporix-sdk-react
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#92](https://github.com/viuteam/emporix-sdk/pull/92) [`45a2bd8`](https://github.com/viuteam/emporix-sdk/commit/45a2bd8d83cb46d775301790cb2efc60805efc90) Thanks [@amnael1](https://github.com/amnael1)! - Add opt-in reactive customer-token auto-refresh.
8
+
9
+ Core: `EmporixClient.setCustomerTokenRefresher(refresher)` registers a
10
+ single-flight `CustomerTokenRefresher`; on a `customer`-kind 401 the HTTP layer
11
+ refreshes once and retries. Off by default — the customer token stays
12
+ caller-owned.
13
+
14
+ React: `EmporixProvider` gains `autoRefreshCustomerToken` and
15
+ `onCustomerSessionExpired`. When enabled, a customer 401 is transparently
16
+ refreshed via the stored refresh token (anonymous-authorized
17
+ `GET /refreshauthtoken`) and the request is retried; B2B `legalEntityId` is
18
+ preserved.
19
+
3
20
  ## 2.5.1
4
21
 
5
22
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { useEmporix, EmporixSiteContext, useActiveCompany } from './chunk-D43CSHK3.js';
1
+ import { useEmporix, EmporixSiteContext, useActiveCompany } from './chunk-SDRV73LG.js';
2
2
  import { useContext, useState, useEffect, useCallback } from 'react';
3
3
  import { useQueryClient, useQuery, useMutation, useInfiniteQuery } from '@tanstack/react-query';
4
4
  import { auth, EmporixError } from '@viu/emporix-sdk';
@@ -1420,5 +1420,5 @@ function useUpdateApproval() {
1420
1420
  }
1421
1421
 
1422
1422
  export { useActiveCart, useAddToShoppingList, useAddressMutations, useApproval, useApprovals, useAssignContact, useAvailabilities, useAvailability, useCancelOrder, useCart, useCartMutations, useCategories, useCategoriesInfinite, useCategory, useCategoryTree, useChangePassword, useCheckout, useCompany, useCompanyContacts, useCompanyGroups, useCompanyLocations, useCompanySwitcher, useCreateApproval, useCreateCart, useCreateCompany, useCreateLocation, useCreateReturn, useCreateShoppingList, useCustomerAddresses, useCustomerSession, useDefaultSite, useDeleteCompany, useDeleteLocation, useDeleteShoppingList, useMatchPrices, useMatchPricesChunked, useMyCompanies, useMyOrders, useMyOrdersInfinite, useMyReturns, useMyRewardPoints, useMyRewardPointsSummary, useMySegmentCategories, useMySegmentCategoriesInfinite, useMySegmentCategoryTree, useMySegmentItems, useMySegmentProducts, useMySegmentProductsInfinite, useMySegments, useOrder, useOrderTransition, usePasswordReset, usePaymentModes, useProduct, useProductByCode, useProductMedia, useProductSearch, useProducts, useProductsByCodes, useProductsInCategory, useProductsInCategoryInfinite, useProductsInfinite, useRedeemCoupon, useRedeemOptions, useRedeemRewardPoints, useRemoveFromShoppingList, useReorder, useReturn, useSalesOrder, useSetShoppingListItemQuantity, useShoppingLists, useSiteContext, useSites, useUnassignContact, useUpdateApproval, useUpdateCompany, useUpdateContactAssignment, useUpdateCustomer, useUpdateLocation, useUpdateSalesOrder, useValidateCoupon, useVariantChildren };
1423
- //# sourceMappingURL=chunk-QMBRDYLW.js.map
1424
- //# sourceMappingURL=chunk-QMBRDYLW.js.map
1423
+ //# sourceMappingURL=chunk-RCI7242Y.js.map
1424
+ //# sourceMappingURL=chunk-RCI7242Y.js.map