Skip to content

Commit e6fc8cb

Browse files
authored
Merge pull request #3713 from SalesforceCommerceCloud/rvishwanathbhat/merge-changes-from-develop
W-21436534: Merge from Develop to feature branch
2 parents 02d6566 + 9101a09 commit e6fc8cb

File tree

114 files changed

+9812
-10200
lines changed

Some content is hidden

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

114 files changed

+9812
-10200
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": [

e2e/tests/a11y/desktop/a11y-snapshot-test-guest.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ test.describe('Accessibility Tests with Snapshots for guest user', () => {
111111
await runAccessibilityTest(page, ['guest', 'cart-a11y-violations.json'])
112112
})
113113

114-
test('Checkout should not have new accessibility issues', async ({page}) => {
114+
// TODO: Remove skip and regenerate snapshots.
115+
test.skip('Checkout should not have new accessibility issues', async ({page}) => {
115116
await addProductToCart({page})
116117

117118
// cart

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,6 +1,7 @@
11
## v5.1.0-dev
22
- Bump commerce-sdk-isomorphic to 5.1.0-unstable-20260226081656
33
- Add Node 24 support. Drop Node 16 support. [#3652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3652)
4+
- Add Shopper Consents API support [#3674](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3674)
45

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

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

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

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
@@ -48,6 +48,7 @@ export const CLIENT_KEYS = {
4848
SHOPPER_BASKETS: 'shopperBaskets',
4949
SHOPPER_BASKETS_V2: 'shopperBasketsV2',
5050
SHOPPER_CONFIGURATIONS: 'shopperConfigurations',
51+
SHOPPER_CONSENTS: 'shopperConsents',
5152
SHOPPER_CONTEXTS: 'shopperContexts',
5253
SHOPPER_CUSTOMERS: 'shopperCustomers',
5354
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)