From dae8348895742a62e7522c86b7f0543b1b785e5a Mon Sep 17 00:00:00 2001 From: Roman Filippov Date: Sat, 20 Jun 2020 15:25:02 +0700 Subject: [PATCH] feat: adds Saudi Arabia marketplace BREAKING CHANGE: adds Saudi Arabia marketplace --- src/amazon-marketplace.ts | 2 ++ src/marketplaces/SA.ts | 14 ++++++++++++++ src/marketplaces/index.ts | 6 ++++++ tests/__snapshots__/marketplaces.test.ts.snap | 11 +++++++++++ tests/index.test.ts | 2 +- tests/marketplaces.test.ts | 2 +- 6 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 src/marketplaces/SA.ts diff --git a/src/amazon-marketplace.ts b/src/amazon-marketplace.ts index 2e97cf16..f5817b2f 100644 --- a/src/amazon-marketplace.ts +++ b/src/amazon-marketplace.ts @@ -18,6 +18,7 @@ export enum AmazonMarketplaceCountryCode { JP = 'JP', MX = 'MX', NL = 'NL', + SA = 'SA', SG = 'SG', TR = 'TR', US = 'US', @@ -37,6 +38,7 @@ export enum AmazonMarketplaceAdvertisingCurrency { INR = 'INR', JPY = 'JPY', MXN = 'MXN', + SAR = 'SAR', SGD = 'SGD', TRY = 'TRY', USD = 'USD', diff --git a/src/marketplaces/SA.ts b/src/marketplaces/SA.ts new file mode 100644 index 00000000..e1cd8adb --- /dev/null +++ b/src/marketplaces/SA.ts @@ -0,0 +1,14 @@ +import { + AmazonMarketplace, + AmazonMarketplaceCountryCode, + AmazonMarketplaceAdvertisingCurrency, +} from '../amazon-marketplace' + +export const SA = new AmazonMarketplace({ + countryCode: AmazonMarketplaceCountryCode.SA, + currency: AmazonMarketplaceAdvertisingCurrency.SAR, + id: 'A17E79C6D8DWNP', + name: 'Saudi Arabia', + uri: 'https://www.amazon.sa', + webServiceUri: 'https://mws-eu.amazonservices.com', +}) diff --git a/src/marketplaces/index.ts b/src/marketplaces/index.ts index b48c5a34..e148724c 100644 --- a/src/marketplaces/index.ts +++ b/src/marketplaces/index.ts @@ -12,6 +12,7 @@ import { IT } from './IT' import { JP } from './JP' import { MX } from './MX' import { NL } from './NL' +import { SA } from './SA' import { SG } from './SG' import { TR } from './TR' import { US } from './US' @@ -87,6 +88,11 @@ export const amazonMarketplaces = { */ NL, + /** + * Singapore + */ + SA, + /** * Singapore */ diff --git a/tests/__snapshots__/marketplaces.test.ts.snap b/tests/__snapshots__/marketplaces.test.ts.snap index 4157d6fa..a8e246c9 100644 --- a/tests/__snapshots__/marketplaces.test.ts.snap +++ b/tests/__snapshots__/marketplaces.test.ts.snap @@ -343,6 +343,17 @@ AmazonMarketplace { } `; +exports[`marketplace SA should match snapshot 1`] = ` +AmazonMarketplace { + "countryCode": "SA", + "currency": "SAR", + "id": "A17E79C6D8DWNP", + "name": "Saudi Arabia", + "uri": "https://www.amazon.sa", + "webServiceUri": "https://mws-eu.amazonservices.com", +} +`; + exports[`marketplace SG should match snapshot 1`] = ` AmazonMarketplace { "countryCode": "SG", diff --git a/tests/index.test.ts b/tests/index.test.ts index d4c39a75..1e2c80b2 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -22,6 +22,6 @@ describe('index', () => { it('should also provide a list of marketplaces', () => { expect(Array.isArray(amazonMarketplacesList)).toBeTruthy() - expect(amazonMarketplacesList.length).toBe(17) + expect(amazonMarketplacesList.length).toBe(18) }) }) diff --git a/tests/marketplaces.test.ts b/tests/marketplaces.test.ts index dbf9ee8b..92859ffc 100644 --- a/tests/marketplaces.test.ts +++ b/tests/marketplaces.test.ts @@ -10,7 +10,7 @@ describe('marketplace', () => { it('has a known number of marketplaces', () => { expect.assertions(1) - expect(countryCodes.length).toBe(17) + expect(countryCodes.length).toBe(18) }) describe.each(countryCodes)('%s', (countryCode) => {