Skip to content

Commit

Permalink
feat: adds Amazon Advertising region enum
Browse files Browse the repository at this point in the history
  • Loading branch information
moltar authored and Roman committed Mar 9, 2020
1 parent ab9a725 commit 5465d6e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const US = findAmazonMarketplaceOrFail('countryCode', AmazonMarketplaceAdvertisi
"advertising": {
"uri": "https://advertising-api.amazon.com",
"countryCode": "CA",
"region": "NA",
"bids": {
"sponsoredBrands": {
"min": 10,
Expand Down
14 changes: 14 additions & 0 deletions src/amazon-marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/european-advertising-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceAdvertising,
AmazonMarketplaceAdvertisingRegion,
} from './amazon-marketplace'

export function europeanAdvertisingFactory(
Expand All @@ -10,6 +11,7 @@ export function europeanAdvertisingFactory(
return {
uri: 'https://advertising-api-eu.amazon.com',
countryCode,
region: AmazonMarketplaceAdvertisingRegion.EUROPE,
bids: {
sponsoredBrands: {
min: 10,
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/AE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AmazonMarketplaceCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingRegion,
} from '../amazon-marketplace'

export const AE = new AmazonMarketplace({
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/AU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AmazonMarketplaceCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingRegion,
} from '../amazon-marketplace'

export const AU = new AmazonMarketplace({
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AmazonMarketplaceCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingRegion,
} from '../amazon-marketplace'
import { DE } from './DE'

Expand All @@ -21,6 +22,7 @@ export const GB = new AmazonMarketplace({
advertising: {
uri: DE.advertising.uri,
countryCode: AmazonMarketplaceAdvertisingCountryCode.UK,
region: AmazonMarketplaceAdvertisingRegion.EUROPE,
bids: {
sponsoredBrands: {
min: 10,
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AmazonMarketplaceCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingRegion,
} from '../amazon-marketplace'

export const JP = new AmazonMarketplace({
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AmazonMarketplaceCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingRegion,
} from '../amazon-marketplace'

export const US = new AmazonMarketplace({
Expand All @@ -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,
Expand Down

0 comments on commit 5465d6e

Please sign in to comment.