Generate the authentication headers required by Walmart Marketplace API.
- Returns the required authentication headers for Walmart Marketplace API.
- Defaults the
Accept
andContent-Type
headers toapplication/json
, which can be changed toapplication/xml
if XML is preferred. - Generates a UUID for the
CorrelationId
if one is not specified for the request.
Outputs Authentication headers as an object.
{
"WM_SVC.NAME": "Walmart Marketplace",
"WM_QOS.CORRELATION_ID": "1234hfvgtr",
"Authorization": "Basic E1EPWiqwuLYceSVr2XGmlj...",
"Accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded"
}
{
"WM_SVC.NAME": "Walmart Marketplace",
"WM_QOS.CORRELATION_ID": "1234hfvgtr",
"Authorization": "Basic E1EPWiqwuLYceSVr2XGmlj...",
"Accept": "application/json",
"Content-Type": "application/json",
"Access": "eyJraWQiOiIwNjI..."
}
headers.Accept = 'application/xml';
headers.ContentType = 'application/xml';
npm install --save wmt-marketplace-auth
- npm run build :
rimraf ./lib/ && tsc -p .
Package | Version | Dev |
---|---|---|
uuid | 3.2.1 | ✖ |
ts-node | 5.0.1 | ✔ |
typescript | 2.8.1 | ✔ |
tslint | 5.9.1 | ✔ |
mocha | 5.0.5 | ✔ |
chai | 4.1.2 | ✔ |
nyc | 11.6.0 | ✔ |
rimraf | 2.6.2 | ✔ |
@types/mocha | 5.0.0 | ✔ |
@types/chai | 4.1.2 | ✔ |
@types/node | 9.6.2 | ✔ |
@types/uuid | 3.4.3 | ✔ |
node-readme | 0.1.9 | ✔ |
We are always excited when we can make our projects open source and allow contributors to build and work on these components. To make this possible, there are a few things we kindly ask all contributors to understand and follow. Please review the Contributing Guide.
Kane McConnell [email protected]