Skip to content

Commit b2871a1

Browse files
authored
Merge branch 'develop' into vm/mcp-separate-release
2 parents e9114de + 7221d94 commit b2871a1

File tree

19 files changed

+115
-63
lines changed

19 files changed

+115
-63
lines changed

packages/commerce-sdk-react/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## v5.1.0-dev
22
- Add Page Designer Support [#3727](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3727)
33
- Bump commerce-sdk-isomorphic to 5.1.0 [#3725](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3725)
4+
- Update ShopperBasketsV2 hooks documentation and query keys
45
- Add Node 24 support. Drop Node 16 support. [#3652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3652)
56
- Add Shopper Consents API support [#3674](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3674)
67

packages/commerce-sdk-react/src/hooks/ShopperBasketsV2/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export const cacheUpdateMatrix: CacheUpdateMatrix<Client> = {
183183
],
184184
remove: [
185185
// We want to fuzzy match all queryKeys with `basketId` in their path
186-
// [`/commerce-sdk-react,/organizations/,${organization},/baskets/,${basketId}`]
186+
// [`/commerce-sdk-react,/organizations/,${organization},/baskets/v2/,${basketId}`]
187187
{queryKey: getBasket.path(parameters)}
188188
]
189189
}

packages/commerce-sdk-react/src/hooks/ShopperBasketsV2/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {cacheUpdateMatrix} from './cache'
1010
import {ShopperBasketsMutations as mutations} from './mutation'
1111
import * as queries from './query'
1212

13-
describe('Shopper Baskets hooks', () => {
13+
describe('Shopper Baskets V2 hooks', () => {
1414
test('all endpoints have hooks', () => {
1515
// unimplemented = SDK method exists, but no query hook or value in mutations enum
1616
const unimplemented = getUnimplementedEndpoints(ShopperBasketsV2, queries, mutations)

packages/commerce-sdk-react/src/hooks/ShopperBasketsV2/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Salesforce, Inc.
2+
* Copyright (c) 2026, Salesforce, Inc.
33
* All rights reserved.
44
* SPDX-License-Identifier: BSD-3-Clause
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause

packages/commerce-sdk-react/src/hooks/ShopperBasketsV2/mutation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ const emptyResponseTestCases = [
203203
// Most test cases only apply to non-empty response test cases, some (error handling) can include deleteBasket
204204
const allTestCases = [...nonEmptyResponseTestCases, ...emptyResponseTestCases]
205205

206-
describe('ShopperBaskets mutations', () => {
206+
describe('ShopperBasketsV2 mutations', () => {
207207
const storedCustomerIdKey = `customer_id_${DEFAULT_TEST_CONFIG.siteId}`
208208
beforeAll(() => {
209209
// Make sure we don't accidentally overwrite something before setting up our test state

packages/commerce-sdk-react/src/hooks/ShopperBasketsV2/mutation.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const CLIENT_KEY = CLIENT_KEYS.SHOPPER_BASKETS_V2
1515
type Client = NonNullable<ApiClients[typeof CLIENT_KEY]>
1616

1717
/**
18-
* Mutations available for Shopper Baskets.
19-
* @group ShopperBaskets
18+
* Mutations available for Shopper Baskets V2.
19+
* @group ShopperBasketsV2
2020
* @category Mutation
2121
* @enum
2222
*/
@@ -165,16 +165,16 @@ export const ShopperBasketsMutations = {
165165
} as const
166166

167167
/**
168-
* Type for Shopper Baskets Mutation.
169-
* @group ShopperBaskets
168+
* Type for Shopper Baskets V2 Mutation.
169+
* @group ShopperBasketsV2
170170
* @category Mutation
171171
*/
172172
export type ShopperBasketsMutation =
173173
(typeof ShopperBasketsMutations)[keyof typeof ShopperBasketsMutations]
174174

175175
/**
176-
* Mutation hook for Shopper Baskets.
177-
* @group ShopperBaskets
176+
* Mutation hook for Shopper Baskets V2.
177+
* @group ShopperBasketsV2
178178
* @category Mutation
179179
*/
180180
export function useShopperBasketsMutation<Mutation extends ShopperBasketsMutation>(

packages/commerce-sdk-react/src/hooks/ShopperBasketsV2/query.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const testMap: TestMap = {
4141
}
4242
// Type assertion is necessary because `Object.entries` is limited
4343
const testCases = Object.entries(testMap) as Array<[keyof TestMap, TestMap[keyof TestMap]]>
44-
describe('Shopper Baskets query hooks', () => {
44+
describe('Shopper Baskets V2 query hooks', () => {
4545
beforeEach(() => nock.cleanAll())
4646
afterEach(() => {
4747
expect(nock.pendingMocks()).toHaveLength(0)

packages/commerce-sdk-react/src/hooks/ShopperBasketsV2/query.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ type Client = NonNullable<ApiClients[typeof CLIENT_KEY]>
1818

1919
/**
2020
* Gets a basket.
21-
* @group ShopperBaskets
21+
* @group ShopperBasketsV2
2222
* @category Query
2323
* @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
2424
* @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
25-
* @returns A TanStack Query query hook with data from the Shopper Baskets `getBasket` endpoint.
25+
* @returns A TanStack Query query hook with data from the Shopper Baskets V2 `getBasket` endpoint.
2626
* @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getBasket| Salesforce Developer Center} for more information about the API endpoint.
2727
* @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#getbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
2828
* @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
@@ -63,11 +63,11 @@ export const useBasket = (
6363
}
6464
/**
6565
* Gets applicable payment methods for an existing basket considering the open payment amount only.
66-
* @group ShopperBaskets
66+
* @group ShopperBasketsV2
6767
* @category Query
6868
* @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
6969
* @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
70-
* @returns A TanStack Query query hook with data from the Shopper Baskets `getPaymentMethodsForBasket` endpoint.
70+
* @returns A TanStack Query query hook with data from the Shopper Baskets V2 `getPaymentMethodsForBasket` endpoint.
7171
* @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getPaymentMethodsForBasket| Salesforce Developer Center} for more information about the API endpoint.
7272
* @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#getpaymentmethodsforbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
7373
* @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
@@ -108,11 +108,11 @@ export const usePaymentMethodsForBasket = (
108108
}
109109
/**
110110
* Gets applicable price books for an existing basket.
111-
* @group ShopperBaskets
111+
* @group ShopperBasketsV2
112112
* @category Query
113113
* @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
114114
* @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
115-
* @returns A TanStack Query query hook with data from the Shopper Baskets `getPriceBooksForBasket` endpoint.
115+
* @returns A TanStack Query query hook with data from the Shopper Baskets V2 `getPriceBooksForBasket` endpoint.
116116
* @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getPriceBooksForBasket| Salesforce Developer Center} for more information about the API endpoint.
117117
* @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#getpricebooksforbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
118118
* @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
@@ -153,11 +153,11 @@ export const usePriceBooksForBasket = (
153153
}
154154
/**
155155
* Gets the applicable shipping methods for a certain shipment of a basket.
156-
* @group ShopperBaskets
156+
* @group ShopperBasketsV2
157157
* @category Query
158158
* @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
159159
* @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
160-
* @returns A TanStack Query query hook with data from the Shopper Baskets `getShippingMethodsForShipment` endpoint.
160+
* @returns A TanStack Query query hook with data from the Shopper Baskets V2 `getShippingMethodsForShipment` endpoint.
161161
* @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getShippingMethodsForShipment| Salesforce Developer Center} for more information about the API endpoint.
162162
* @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#getshippingmethodsforshipment | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
163163
* @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
@@ -198,11 +198,11 @@ export const useShippingMethodsForShipment = (
198198
}
199199
/**
200200
* This method gives you the external taxation data set by the PUT taxes API. This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
201-
* @group ShopperBaskets
201+
* @group ShopperBasketsV2
202202
* @category Query
203203
* @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
204204
* @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
205-
* @returns A TanStack Query query hook with data from the Shopper Baskets `getTaxesFromBasket` endpoint.
205+
* @returns A TanStack Query query hook with data from the Shopper Baskets V2 `getTaxesFromBasket` endpoint.
206206
* @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getTaxesFromBasket| Salesforce Developer Center} for more information about the API endpoint.
207207
* @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#gettaxesfrombasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
208208
* @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.

packages/commerce-sdk-react/src/hooks/ShopperBasketsV2/queryKeyHelpers.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ export type QueryKeys = {
1616
'/commerce-sdk-react',
1717
'/organizations/',
1818
string | undefined,
19-
'/baskets/',
19+
'/baskets/v2/',
2020
string | undefined,
2121
Params<'getBasket'>
2222
]
2323
getPaymentMethodsForBasket: [
2424
'/commerce-sdk-react',
2525
'/organizations/',
2626
string | undefined,
27-
'/baskets/',
27+
'/baskets/v2/',
2828
string | undefined,
2929
'/payment-methods',
3030
Params<'getPaymentMethodsForBasket'>
@@ -33,7 +33,7 @@ export type QueryKeys = {
3333
'/commerce-sdk-react',
3434
'/organizations/',
3535
string | undefined,
36-
'/baskets/',
36+
'/baskets/v2/',
3737
string | undefined,
3838
'/price-books',
3939
Params<'getPriceBooksForBasket'>
@@ -42,7 +42,7 @@ export type QueryKeys = {
4242
'/commerce-sdk-react',
4343
'/organizations/',
4444
string | undefined,
45-
'/baskets/',
45+
'/baskets/v2/',
4646
string | undefined,
4747
'/shipments/',
4848
string | undefined,
@@ -53,7 +53,7 @@ export type QueryKeys = {
5353
'/commerce-sdk-react',
5454
'/organizations/',
5555
string | undefined,
56-
'/baskets/',
56+
'/baskets/v2/',
5757
string | undefined,
5858
'/taxes',
5959
Params<'getTaxesFromBasket'>
@@ -74,7 +74,7 @@ export const getBasket: QueryKeyHelper<'getBasket'> = {
7474
'/commerce-sdk-react',
7575
'/organizations/',
7676
params?.organizationId,
77-
'/baskets/',
77+
'/baskets/v2/',
7878
params?.basketId
7979
],
8080
queryKey: (params: Params<'getBasket'>) => {
@@ -90,7 +90,7 @@ export const getPaymentMethodsForBasket: QueryKeyHelper<'getPaymentMethodsForBas
9090
'/commerce-sdk-react',
9191
'/organizations/',
9292
params?.organizationId,
93-
'/baskets/',
93+
'/baskets/v2/',
9494
params?.basketId,
9595
'/payment-methods'
9696
],
@@ -107,7 +107,7 @@ export const getPriceBooksForBasket: QueryKeyHelper<'getPriceBooksForBasket'> =
107107
'/commerce-sdk-react',
108108
'/organizations/',
109109
params?.organizationId,
110-
'/baskets/',
110+
'/baskets/v2/',
111111
params?.basketId,
112112
'/price-books'
113113
],
@@ -124,7 +124,7 @@ export const getShippingMethodsForShipment: QueryKeyHelper<'getShippingMethodsFo
124124
'/commerce-sdk-react',
125125
'/organizations/',
126126
params?.organizationId,
127-
'/baskets/',
127+
'/baskets/v2/',
128128
params?.basketId,
129129
'/shipments/',
130130
params?.shipmentId,
@@ -143,7 +143,7 @@ export const getTaxesFromBasket: QueryKeyHelper<'getTaxesFromBasket'> = {
143143
'/commerce-sdk-react',
144144
'/organizations/',
145145
params?.organizationId,
146-
'/baskets/',
146+
'/baskets/v2/',
147147
params?.basketId,
148148
'/taxes'
149149
],

packages/pwa-kit-create-app/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## v3.17.0-dev
2-
- Add Salesforce Payments configuration to generated projects
2+
- Add Salesforce Payments configuration to generated projects [#3725] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3725)
33
- Clear verdaccio npm cache during project generation [#3652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3652)
44
- Add Node 24 support, remove legacy `url` module import. Drop Node 16 support [#3652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3652)
5+
- One Click Checkout removed from Developer Preview. When shoppers use passwordless OTP login with one-click checkout, the system saves their shipping and payment information for faster checkout in the future. Security safeguards required: (1) Captcha - Protects the passwordless login from bots. (2) OTP for Email Changes - Verifies identity before an email update, prevents accidental account lockouts from typos, and prevents unauthorized access to saved payment methods.
56

67
## v3.16.0 (Feb 12, 2026)
78
- Add new One-Click Checkout configuration [#3609](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3609)

0 commit comments

Comments
 (0)