@spree/storefront-api-v2-sdk
Version:
Node module to easily integrate your JavaScript or TypeScript application with Spree API V2. You can create an entirely custom Storefront in JS/TS with this package including one page checkout, Single Page Apps, PWAs and so on
24 lines (20 loc) • 544 B
text/typescript
import {
AuthTokenAttr,
AuthTokenParams,
RefreshTokenAttr,
RefreshTokenParams,
RevokeTokenAttr,
RevokeTokenParams
} from '../interfaces/Authentication'
export const authParams = ({ username, password }: AuthTokenAttr): AuthTokenParams => ({
username,
password,
grant_type: 'password'
})
export const refreshParams = ({ refresh_token }: RefreshTokenAttr): RefreshTokenParams => ({
refresh_token,
grant_type: 'refresh_token'
})
export const revokeParams = ({ token }: RevokeTokenAttr): RevokeTokenParams => ({
token
})