Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
@scaleleap/amazon-marketplaces
Advanced tools
A collection of Amazon Marketplace data objects.
Weekly downloads
Readme
A collection of Amazon Marketplace data objects.
This package is written in TypeScript and is fully typed.
This package combines data about Amazon Marketplace (the consumer side of Amazon) into a structured class.
A2EUQ1WTGCTBG2
)CA
)America/Los_Angeles
)CAD
)Canada
)https://www.amazon.ca/
)import { amazonMarketplaces } from '@scaleleap/amazon-marketplaces'
const { CA } = amazonMarketplaces
console.log('Amazon Marketplace %s uses currency %s.', CA.name, CA.currency)
Sometimes it is more ergonomic to iterate over an array of marketplaces.
And that is where amazonMarketplacesList
may come handy.
import { amazonMarketplacesList } from '@scaleleap/amazon-marketplaces'
const marketplaceIds = amazonMarketplacesList.map(marketplace => marketplace.id)
import {
findAmazonMarketplace,
findAmazonMarketplaceOrFail,
AmazonMarketplaceCountryCode
} from '@scaleleap/amazon-marketplaces'
// Return value *can* be undefined
const CA = findAmazonMarketplace('countryCode', AmazonMarketplaceCountryCode.CA)
// Function will throw an error if marketplace is not found
// Thus return value is never undefined.
const US = findAmazonMarketplaceOrFail('countryCode', AmazonMarketplaceCountryCode.US)
// TypeScript assertion functions that ensure that the marketplace has advertising / selling partner enabled.
// Throws if not.
assertMarketplaceHasAdvertising(CA)
assertMarketplaceHasSellingPartner(CA)
// CA.advertising is now type guarded and can be safely accessed.
console.log(CA.advertising.countryCode)
{
"countryCode": "CA",
"timeZone": "America/Los_Angeles",
"currency": "CAD",
"id": "A2EUQ1WTGCTBG2",
"name": "Canada",
"uri": "https://www.amazon.ca",
"webServiceUri": "https://mws.amazonservices.ca",
"advertising": {
"countryCode": "CA",
"timeZone": "America/Los_Angeles",
"region": {
"accessTokenUri": "https://api.amazon.com/auth/o2/token",
"authorizationUri": "https://www.amazon.com/ap/oa",
"code": "NA",
"endpoint": "https://advertising-api.amazon.com",
"name": "North America",
},
"bids": {
"sponsoredBrands": {
"min": 10,
"max": 4900
},
"sponsoredProducts": {
"min": 2,
"max": 100000
}
},
},
"sellingPartner": {
"region": {
"awsRegion": "us-east-1",
"code": "NA",
"endpoint": "https://sellingpartnerapi-na.amazon.com",
"name": "North America",
},
"sellerCentralAuthUri": "https://sellercentral.amazon.com"
}
}
You may also view the Jest snapshot data for the fully rendered data object examples.
$ npm i -s @scaleleap/amazon-marketplaces
If you find any other data that can be added, please open an issue and let us know.
Note that this repository uses Conventional Commit style commit messages.
If a new marketplace is added, this should be marked as breaking change and increase the major version, because others may rely on iterating over the available marketplaces.
This project is licensed under the MIT License.
FAQs
A collection of Amazon Marketplace data objects.
The npm package @scaleleap/amazon-marketplaces receives a total of 2,435 weekly downloads. As such, @scaleleap/amazon-marketplaces popularity was classified as popular.
We found that @scaleleap/amazon-marketplaces demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.