Skip to content

Commit 34802f6

Browse files
Merge branch 'develop' into W-20615600-search-launch-location-update
2 parents 5af0ecf + c53cce9 commit 34802f6

File tree

98 files changed

+8989
-10221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+8989
-10221
lines changed

e2e/package-lock.json

Lines changed: 1061 additions & 3628 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@aws-sdk/client-s3": "3.450.0",
1717
"@aws-sdk/client-sts": "3.450.0",
1818
"@salesforce/pwa-kit-dev": "3.17.0-dev",
19-
"jest": "^26.6.3"
19+
"jest": "^29.7.0"
2020
},
2121
"jest": {
2222
"setupFilesAfterEnv": [

package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/commerce-sdk-react/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## v5.1.0-dev
22
- Add Node 24 support. Drop Node 16 support. [#3652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3652)
3+
- Add Shopper Consents API support [#3674](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3674)
34

45
## v5.0.0 (Feb 12, 2026)
56
- Upgrade to commerce-sdk-isomorphic v5.0.0 and introduce Payment Instrument SCAPI integration [#3552](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3552)
@@ -14,7 +15,7 @@
1415
## v4.2.0 (Nov 04, 2025)
1516

1617
- Upgrade to commerce-sdk-isomorphic v4.0.1 [#3449](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3449)
17-
- Prevent headers from being overriden in `generateCustomEndpointOptions` [#3405](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3405/)
18+
- Prevent headers from being overridden in `generateCustomEndpointOptions` [#3405](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3405/)
1819

1920
## v4.1.0 (Sep 25, 2025)
2021

packages/commerce-sdk-react/src/constant.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Salesforce, Inc.
2+
* Copyright (c) 2025, 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
@@ -46,6 +46,7 @@ export const SERVER_AFFINITY_HEADER_KEY = 'sfdc_dwsid'
4646

4747
export const CLIENT_KEYS = {
4848
SHOPPER_BASKETS: 'shopperBaskets',
49+
SHOPPER_CONSENTS: 'shopperConsents',
4950
SHOPPER_CONTEXTS: 'shopperContexts',
5051
SHOPPER_CUSTOMERS: 'shopperCustomers',
5152
SHOPPER_EXPERIENCE: 'shopperExperience',
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2025, Salesforce, Inc.
3+
* All rights reserved.
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6+
*/
7+
import {ApiClients, CacheUpdateMatrix} from '../types'
8+
import {getSubscriptions} from './queryKeyHelpers'
9+
import {CLIENT_KEYS} from '../../constant'
10+
11+
const CLIENT_KEY = CLIENT_KEYS.SHOPPER_CONSENTS
12+
type Client = NonNullable<ApiClients[typeof CLIENT_KEY]>
13+
14+
export const cacheUpdateMatrix: CacheUpdateMatrix<Client> = {
15+
updateSubscription(customerId, {parameters}, response) {
16+
// When a subscription is updated, we invalidate the getSubscriptions query
17+
// to ensure the UI reflects the latest subscription state
18+
return {
19+
invalidate: [{queryKey: getSubscriptions.queryKey(parameters)}]
20+
}
21+
},
22+
updateSubscriptions(customerId, {parameters}, response) {
23+
// When multiple subscriptions are updated, we invalidate the getSubscriptions query
24+
// to ensure the UI reflects the latest subscription states
25+
return {
26+
invalidate: [{queryKey: getSubscriptions.queryKey(parameters)}]
27+
}
28+
}
29+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2025, Salesforce, Inc.
3+
* All rights reserved.
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6+
*/
7+
import {ShopperConsents} from 'commerce-sdk-isomorphic'
8+
import {getUnimplementedEndpoints} from '../../test-utils'
9+
import {cacheUpdateMatrix} from './cache'
10+
import {ShopperConsentsMutations as mutations} from './mutation'
11+
import * as queries from './query'
12+
13+
describe('Shopper Consents hooks', () => {
14+
test('all endpoints have hooks', () => {
15+
// unimplemented = SDK method exists, but no query hook or value in mutations enum
16+
const unimplemented = getUnimplementedEndpoints(ShopperConsents, queries, mutations)
17+
// If this test fails: create a new query hook, add the endpoint to the mutations enum,
18+
// or add it to the `expected` array with a comment explaining "TODO" or "never" (and why).
19+
expect(unimplemented).toEqual([])
20+
})
21+
test('all mutations have cache update logic', () => {
22+
// unimplemented = value in mutations enum, but no method in cache update matrix
23+
const unimplemented = new Set<string>(Object.values(mutations))
24+
Object.entries(cacheUpdateMatrix).forEach(([method, implementation]) => {
25+
if (implementation) unimplemented.delete(method)
26+
})
27+
// If this test fails: add cache update logic, remove the endpoint from the mutations enum,
28+
// or add it to the `expected` array to indicate that it is still a TODO.
29+
expect([...unimplemented]).toEqual([])
30+
})
31+
})
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2025, Salesforce, Inc.
3+
* All rights reserved.
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6+
*/
7+
export * from './mutation'
8+
export * from './query'

0 commit comments

Comments
 (0)