From 5465d6e5c7e7993939f9892d736a0a9b7299b771 Mon Sep 17 00:00:00 2001 From: Roman Filippov Date: Mon, 9 Mar 2020 22:23:53 +0700 Subject: [PATCH] feat: adds Amazon Advertising region enum --- README.md | 1 + src/amazon-marketplace.ts | 14 ++++++++++++++ src/european-advertising-factory.ts | 2 ++ src/marketplaces/AE.ts | 2 ++ src/marketplaces/AU.ts | 2 ++ src/marketplaces/GB.ts | 2 ++ src/marketplaces/JP.ts | 2 ++ src/marketplaces/US.ts | 2 ++ 8 files changed, 27 insertions(+) diff --git a/README.md b/README.md index 8faadbe6..f20c3642 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ const US = findAmazonMarketplaceOrFail('countryCode', AmazonMarketplaceAdvertisi "advertising": { "uri": "https://advertising-api.amazon.com", "countryCode": "CA", + "region": "NA", "bids": { "sponsoredBrands": { "min": 10, diff --git a/src/amazon-marketplace.ts b/src/amazon-marketplace.ts index b7535f28..010137fd 100644 --- a/src/amazon-marketplace.ts +++ b/src/amazon-marketplace.ts @@ -70,6 +70,15 @@ export enum AmazonMarketplaceAdvertisingTimeZone { EUROPE_PARIS = 'Europe/Paris', } +/** + * Amazon Advertising API Regions + */ +export enum AmazonMarketplaceAdvertisingRegion { + NORTH_AMERICA = 'NA', + EUROPE = 'EU', + FAR_EAST = 'FE', +} + export interface AmazonMarketplaceAdvertising { /** * Amazon Advertising API endpoint URI. @@ -97,6 +106,11 @@ export interface AmazonMarketplaceAdvertising { */ readonly countryCode: AmazonMarketplaceAdvertisingCountryCode + /** + * Amazon Advertising API Regions + */ + readonly region: AmazonMarketplaceAdvertisingRegion + /** * Minimum and maximum bids for each advertising type. */ diff --git a/src/european-advertising-factory.ts b/src/european-advertising-factory.ts index 964cbeb7..83c76ddb 100644 --- a/src/european-advertising-factory.ts +++ b/src/european-advertising-factory.ts @@ -2,6 +2,7 @@ import { AmazonMarketplaceAdvertisingCountryCode, AmazonMarketplaceAdvertisingTimeZone, AmazonMarketplaceAdvertising, + AmazonMarketplaceAdvertisingRegion, } from './amazon-marketplace' export function europeanAdvertisingFactory( @@ -10,6 +11,7 @@ export function europeanAdvertisingFactory( return { uri: 'https://advertising-api-eu.amazon.com', countryCode, + region: AmazonMarketplaceAdvertisingRegion.EUROPE, bids: { sponsoredBrands: { min: 10, diff --git a/src/marketplaces/AE.ts b/src/marketplaces/AE.ts index dfb387e8..44334660 100644 --- a/src/marketplaces/AE.ts +++ b/src/marketplaces/AE.ts @@ -4,6 +4,7 @@ import { AmazonMarketplaceCountryCode, AmazonMarketplaceAdvertisingCurrency, AmazonMarketplaceAdvertisingCountryCode, + AmazonMarketplaceAdvertisingRegion, } from '../amazon-marketplace' export const AE = new AmazonMarketplace({ @@ -16,6 +17,7 @@ export const AE = new AmazonMarketplace({ advertising: { uri: 'https://advertising-api-eu.amazon.com', countryCode: AmazonMarketplaceAdvertisingCountryCode.AE, + region: AmazonMarketplaceAdvertisingRegion.EUROPE, bids: { sponsoredBrands: { min: 24, diff --git a/src/marketplaces/AU.ts b/src/marketplaces/AU.ts index 8072d176..78079ffa 100644 --- a/src/marketplaces/AU.ts +++ b/src/marketplaces/AU.ts @@ -4,6 +4,7 @@ import { AmazonMarketplaceCountryCode, AmazonMarketplaceAdvertisingCurrency, AmazonMarketplaceAdvertisingCountryCode, + AmazonMarketplaceAdvertisingRegion, } from '../amazon-marketplace' export const AU = new AmazonMarketplace({ @@ -16,6 +17,7 @@ export const AU = new AmazonMarketplace({ advertising: { uri: 'https://advertising-api-fe.amazon.com', countryCode: AmazonMarketplaceAdvertisingCountryCode.AU, + region: AmazonMarketplaceAdvertisingRegion.FAR_EAST, bids: { sponsoredBrands: { min: 10, diff --git a/src/marketplaces/GB.ts b/src/marketplaces/GB.ts index 1fca434a..6b4b04e8 100644 --- a/src/marketplaces/GB.ts +++ b/src/marketplaces/GB.ts @@ -4,6 +4,7 @@ import { AmazonMarketplaceCountryCode, AmazonMarketplaceAdvertisingCurrency, AmazonMarketplaceAdvertisingCountryCode, + AmazonMarketplaceAdvertisingRegion, } from '../amazon-marketplace' import { DE } from './DE' @@ -21,6 +22,7 @@ export const GB = new AmazonMarketplace({ advertising: { uri: DE.advertising.uri, countryCode: AmazonMarketplaceAdvertisingCountryCode.UK, + region: AmazonMarketplaceAdvertisingRegion.EUROPE, bids: { sponsoredBrands: { min: 10, diff --git a/src/marketplaces/JP.ts b/src/marketplaces/JP.ts index fe00b400..670a05064 100644 --- a/src/marketplaces/JP.ts +++ b/src/marketplaces/JP.ts @@ -4,6 +4,7 @@ import { AmazonMarketplaceCountryCode, AmazonMarketplaceAdvertisingCurrency, AmazonMarketplaceAdvertisingCountryCode, + AmazonMarketplaceAdvertisingRegion, } from '../amazon-marketplace' export const JP = new AmazonMarketplace({ @@ -16,6 +17,7 @@ export const JP = new AmazonMarketplace({ advertising: { uri: 'https://advertising-api-fe.amazon.com', countryCode: AmazonMarketplaceAdvertisingCountryCode.JP, + region: AmazonMarketplaceAdvertisingRegion.FAR_EAST, bids: { sponsoredBrands: { min: 1000, diff --git a/src/marketplaces/US.ts b/src/marketplaces/US.ts index af663e5f..3a7b93ed 100644 --- a/src/marketplaces/US.ts +++ b/src/marketplaces/US.ts @@ -4,6 +4,7 @@ import { AmazonMarketplaceCountryCode, AmazonMarketplaceAdvertisingCurrency, AmazonMarketplaceAdvertisingCountryCode, + AmazonMarketplaceAdvertisingRegion, } from '../amazon-marketplace' export const US = new AmazonMarketplace({ @@ -16,6 +17,7 @@ export const US = new AmazonMarketplace({ advertising: { uri: 'https://advertising-api.amazon.com', countryCode: AmazonMarketplaceAdvertisingCountryCode.US, + region: AmazonMarketplaceAdvertisingRegion.NORTH_AMERICA, bids: { sponsoredBrands: { min: 10,