Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds Belgium support #523

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions src/amazon-marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { AmazonSellingPartnerApiRegion } from './amazon-selling-partner-api-regi
export enum AmazonMarketplaceCountryCode {
AE = 'AE',
AU = 'AU',
BE = 'BE',
BR = 'BR',
CA = 'CA',
CN = 'CN',
Expand Down
25 changes: 25 additions & 0 deletions src/marketplaces/be.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {
AmazonMarketplace,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceCountryCode,
} from '../amazon-marketplace'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const BE = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.BE,
currency: AmazonMarketplaceAdvertisingCurrency.EUR,
id: 'AMEN7PMS3EDWL',
name: 'Belgium',
/**
* This marketplace will lunch in the coming months.
*
* @see: https://www.aboutamazon.eu/news/job-creation-and-investment/amazon-announces-plans-to-launch-amazon-com-be-in-the-coming-months
*/
uri: 'https://www.amazon.com.be',
sellerCentralUri: 'https://sellercentral.amazon.com.be',
vendorCentralUri: 'https://vendorcentral.amazon.com.be',
webServiceUri: 'https://mws-eu.amazonservices.com',
sellingPartner: {
region: sellingPartnerRegions.EU,
},
})
6 changes: 6 additions & 0 deletions src/marketplaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AE } from './ae'
import { AU } from './au'
import { BE } from './be'
import { BR } from './br'
import { CA } from './ca'
import { CN } from './cn'
Expand Down Expand Up @@ -31,6 +32,11 @@ export const amazonMarketplaces = {
*/
AU,

/**
* Belgium
*/
BE,

/**
* Brazil
*/
Expand Down
23 changes: 23 additions & 0 deletions test/__snapshots__/marketplaces.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,29 @@ AmazonMarketplace {
}
`;

exports[`marketplace BE should match snapshot 1`] = `
AmazonMarketplace {
"countryCode": "BE",
"currency": "EUR",
"id": "AMEN7PMS3EDWL",
"name": "Belgium",
"sellerCentralUri": "https://sellercentral.amazon.com.be",
"sellingPartner": Object {
"region": AmazonSellingPartnerApiRegion {
"awsRegion": "eu-west-1",
"code": "EU",
"endpoint": "https://sellingpartnerapi-eu.amazon.com",
"name": "Europe",
},
"sellerCentralAuthUri": "https://sellercentral.amazon.com.be/apps/authorize/consent",
"vendorCentralAuthUri": "https://vendorcentral.amazon.com.be/apps/authorize/consent",
},
"uri": "https://www.amazon.com.be",
"vendorCentralUri": "https://vendorcentral.amazon.com.be",
"webServiceUri": "https://mws-eu.amazonservices.com",
}
`;

exports[`marketplace BR should match snapshot 1`] = `
AmazonMarketplace {
"advertising": Object {
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ describe('index', () => {
expect.assertions(2)

expect(Array.isArray(amazonMarketplacesList)).toBeDefined()
expect(amazonMarketplacesList).toHaveLength(21)
expect(amazonMarketplacesList).toHaveLength(22)
})
})
2 changes: 1 addition & 1 deletion test/marketplaces.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('marketplace', () => {
it('has a known number of marketplaces', () => {
expect.assertions(1)

expect(countryCodes).toHaveLength(21)
expect(countryCodes).toHaveLength(22)
})

describe.each(countryCodes)('%s', (countryCode) => {
Expand Down