Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/commerce-sdk-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"version": "node ./scripts/version.js"
},
"dependencies": {
"commerce-sdk-isomorphic": "^4.0.0",
"commerce-sdk-isomorphic": "5.0.0-unstable-20260124080731",
"js-cookie": "^3.0.1",
"jwt-decode": "^4.0.0"
},
Expand Down
8 changes: 8 additions & 0 deletions packages/commerce-sdk-react/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ const DATA_MAP: AuthDataMap = {
storageType: 'local',
key: 'idp_access_token'
},
idp_refresh_token: {
storageType: 'local',
key: 'idp_refresh_token'
},
dnt: {
storageType: 'local',
key: 'dnt'
},
token_type: {
storageType: 'local',
key: 'token_type'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ describe('Shopper Customers hooks', () => {
// or add it to the `expected` array with a comment explaining "TODO" or "never" (and why).
expect(unimplemented).toEqual([
'getExternalProfile', // TODO: Implement when the endpoint exits closed beta
'registerExternalProfile' // TODO: Implement when the endpoint exits closed beta
'getPublicProductListItems', // TODO: Implement when the endpoint exits closed beta
'registerExternalProfile', // TODO: Implement when the endpoint exits closed beta
'updateCustomerPaymentInstrument', // TODO: Implement when needed
])
})
test('all mutations have cache update logic', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import * as queries from './query'
describe('Shopper Experience hooks', () => {
test('all endpoints have hooks', () => {
const unimplemtented = getUnimplementedEndpoints(ShopperExperience, queries)
expect(unimplemtented).toEqual([])
expect(unimplemtented).toEqual([
// TODO: Implement content hooks when needed
'getContent',
'getContentFolder',
'getContentFolders',
'getMultipleContent',
'searchContent',
])
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ describe('Shopper Login hooks', () => {
// These endpoints all return data in the response headers, rather than body, so they
// don't work well with the current implementation of mutation hooks.
'authenticateCustomer',
'getTrustedAgentAuthorizationToken'
// TODO: Implement WebAuthn hooks when needed (new endpoints in 5.0.0)
'authorizeWebauthnRegistration',
// TODO: Implement WebAuthn hooks when needed (new endpoints in 5.0.0)
'finishWebauthnAuthentication',
'finishWebauthnUserRegistration',
'getTrustedAgentAuthorizationToken',
'startWebauthnAuthentication',
'startWebauthnUserRegistration',
])
})
test('all mutations have cache update logic', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import {ShopperPayments} from 'commerce-sdk-isomorphic'
import {Argument, ExcludeTail} from '../types'
import {pickValidParams} from '../utils'
import {pickValidParams, omitNullable} from '../utils'

// We must use a client with no parameters in order to have required/optional match the API spec
type Client = ShopperPayments<{shortCode: string}>
Expand Down Expand Up @@ -41,7 +41,10 @@ export const getPaymentConfiguration: QueryKeyHelper<'getPaymentConfiguration'>
queryKey: (params: Params<'getPaymentConfiguration'>) => {
return [
...getPaymentConfiguration.path(params),
pickValidParams(params || {}, ShopperPayments.paramKeys.getPaymentConfiguration)
// pickValidParams returns the filtered parameters, TypeScript sees that zoneId
// could be string | null, and complains because null isn't allowed in the query key.
// omitNullable removes null values from the parameters (zoneId is optional but NOT nullable)
omitNullable(pickValidParams(params || {}, ShopperPayments.paramKeys.getPaymentConfiguration))
]
}
}
Loading
Loading