@bizon/amazon-ids
Advanced tools
Comparing version 1.9.0 to 2.0.0
21
index.js
@@ -5,2 +5,17 @@ const memoize = require('memoizee') | ||
const mwsRegionDomains = { | ||
// Generic MWS regions: | ||
na: 'mws.amazonservices.com', | ||
eu: 'mws-eu.amazonservices.com', | ||
fe: 'mws-fe.amazonservices.com', | ||
// Country specific MWS regions: | ||
ca: 'mws.amazonservices.ca', | ||
mx: 'mws.amazonservices.com.mx', | ||
ae: 'mws.amazonservices.ae', | ||
in: 'mws.amazonservices.in', | ||
jp: 'mws.amazonservices.jp', | ||
au: 'mws.amazonservices.com.au' | ||
} | ||
exports.marketplaces = marketplaces | ||
@@ -23,1 +38,7 @@ | ||
}) | ||
exports.getMarketplacesByMwsRegion = memoize(mwsRegion => { | ||
return this.getMarketplacesByMwsDomain( | ||
mwsRegionDomains[String(mwsRegion).toLowerCase()] | ||
) | ||
}) |
{ | ||
"name": "@bizon/amazon-ids", | ||
"version": "1.9.0", | ||
"version": "2.0.0", | ||
"description": "Collection of Amazon identifiers", | ||
@@ -17,3 +17,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"xo": "^0.28.0" | ||
"xo": "^0.32.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "xo": { |
@@ -106,2 +106,4 @@ # amazon-ids [![CircleCI](https://circleci.com/gh/bizon/amazon-ids.svg?style=svg)](https://circleci.com/gh/bizon/amazon-ids) | ||
### `getMarketplacesByMwsDomain(domain)` | ||
```js | ||
@@ -139,2 +141,38 @@ const {getMarketplacesByMwsDomain} = require('@bizon/amazon-ids') | ||
### `getMarketplacesByMwsRegion(mwsRegion)` | ||
MWS Regions is a concept introduced in [@bizon/mws-sdk](https://github.com/bizon/mws-sdk) – see [its readme](https://github.com/bizon/mws-sdk#region-and-marketplaces) to learn more about it. | ||
```js | ||
const {getMarketplacesByMwsRegion} = require('@bizon/amazon-ids') | ||
getMarketplacesByMwsRegion('na') | ||
/* | ||
[ | ||
{ | ||
code: 'us', | ||
id: 'ATVPDKIKX0DER', | ||
name: 'United States', | ||
region: 'na', | ||
domain: 'amazon.com', | ||
mwsDomain: 'mws.amazonservices.com', | ||
advertisingApiDomain: 'advertising-api.amazon.com', | ||
imagesDomain: 'images-na.ssl-images-amazon.com', | ||
vendorId: 'ATVPDKIKX0DER' | ||
}, | ||
{ | ||
code: 'br', | ||
id: 'A2Q3Y263D00KWC', | ||
name: 'Brazil', | ||
region: 'na', | ||
domain: 'amazon.com.br', | ||
mwsDomain: 'mws.amazonservices.com', | ||
imagesDomain: 'images-na.ssl-images-amazon.com', | ||
vendorId: 'A1ZZFT5FULY4LN' | ||
} | ||
] | ||
*/ | ||
``` | ||
## License | ||
@@ -141,0 +179,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11778
268
191