Skip to content

Commit

Permalink
feat: add Amazon marketplace time zones (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentoanit authored Oct 24, 2022
1 parent a5a095b commit 9212e54
Show file tree
Hide file tree
Showing 25 changed files with 97 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ a structured class.

* ID (e.g. `A2EUQ1WTGCTBG2`)
* Country code (ISO 3166-1) (e.g. `CA`)
* Amazon marketplace time zone (e.g. `America/Los_Angeles`)
* Currency code (ISO 4217) (e.g. `CAD`)
* Name (country name) (e.g. `Canada`)
* URI (e.g. `https://www.amazon.ca/`)
Expand Down Expand Up @@ -87,6 +88,7 @@ console.log(CA.advertising.countryCode)
```json
{
"countryCode": "CA",
"timeZone": "America/Los_Angeles",
"currency": "CAD",
"id": "A2EUQ1WTGCTBG2",
"name": "Canada",
Expand Down
29 changes: 29 additions & 0 deletions src/amazon-marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,26 @@ export enum AmazonMarketplaceAdvertisingTimeZone {
EUROPE_WARSAW = 'Europe/Warsaw',
}

export enum AmazonMarketplaceTimeZone {
AFRICA_CAIRO = 'Africa/Cairo',
AMERICA_LOS_ANGELES = 'America/Los_Angeles',
AMERICA_SAO_PAULO = 'America/Sao_Paulo',
ASIA_DUBAI = 'Asia/Dubai',
ASIA_INDIA = 'Asia/Kolkata',
ASIA_RIYADH = 'Asia/Riyadh',
ASIA_SHANGHAI = 'Asia/Shanghai',
ASIA_SINGAPORE = 'Asia/Singapore',
ASIA_TOKYO = 'Asia/Tokyo',
AUSTRALIA_SYDNEY = 'Australia/Sydney',
EUROPE_AMSTERDAM = 'Europe/Amsterdam',
EUROPE_BRUSSELS = 'Europe/Brussels',
EUROPE_ISTANBUL = 'Europe/Istanbul',
EUROPE_LONDON = 'Europe/London',
EUROPE_PARIS = 'Europe/Paris',
EUROPE_STOCKHOLM = 'Europe/Stockholm',
EUROPE_WARSAW = 'Europe/Warsaw',
}

export interface AmazonMarketplaceAdvertising {
/**
* Amazon Advertising account time zone.
Expand Down Expand Up @@ -218,6 +238,15 @@ export interface AmazonMarketplace {
*/
readonly countryCode: AmazonMarketplaceCountryCode

/**
* Time zone for the given marketplace.
*
* @example
*
* "America/Los_Angeles"
*/
readonly timeZone: AmazonMarketplaceTimeZone

/**
* Currency code for the given marketplace.
*
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,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const AE = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.AE,
timeZone: AmazonMarketplaceTimeZone.ASIA_DUBAI,
currency: AmazonMarketplaceAdvertisingCurrency.AED,
id: 'A2VIGQ35RCS4UG',
name: 'United Arab Emirates',
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,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const AU = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.AU,
timeZone: AmazonMarketplaceTimeZone.AUSTRALIA_SYDNEY,
currency: AmazonMarketplaceAdvertisingCurrency.AUD,
id: 'A39IBJ37TRP1C6',
name: 'Australia',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/be.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import {
AmazonMarketplace,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const BE = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.BE,
timeZone: AmazonMarketplaceTimeZone.EUROPE_BRUSSELS,
currency: AmazonMarketplaceAdvertisingCurrency.EUR,
id: 'AMEN7PMS3EDWL',
name: 'Belgium',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const BR = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.BR,
timeZone: AmazonMarketplaceTimeZone.AMERICA_SAO_PAULO,
currency: AmazonMarketplaceAdvertisingCurrency.BRL,
id: 'A2Q3Y263D00KWC',
name: 'Brazil',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/ca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { amazonVendorCentralUriFactory } from '../amazon-vendor-central-uri-factory'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
Expand All @@ -14,6 +15,7 @@ import { sellingPartnerRegions } from '../selling-partner-api-regions'
*/
export const CA = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.CA,
timeZone: AmazonMarketplaceTimeZone.AMERICA_LOS_ANGELES,
currency: AmazonMarketplaceAdvertisingCurrency.CAD,
id: 'A2EUQ1WTGCTBG2',
name: 'Canada',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import {
AmazonMarketplace,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'

export const CN = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.CN,
timeZone: AmazonMarketplaceTimeZone.ASIA_SHANGHAI,
currency: AmazonMarketplaceAdvertisingCurrency.CNY,
id: 'AAHKV2X7AFYLW',
name: 'China',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { amazonVendorCentralUriFactory } from '../amazon-vendor-central-uri-factory'
import { europeanAdvertisingFactory } from '../european-advertising-factory'
Expand All @@ -11,6 +12,7 @@ import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const DE = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.DE,
timeZone: AmazonMarketplaceTimeZone.EUROPE_PARIS,
currency: AmazonMarketplaceAdvertisingCurrency.EUR,
id: 'A1PA6795UKMFR9',
name: 'Germany',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/eg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const EG = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.EG,
timeZone: AmazonMarketplaceTimeZone.AFRICA_CAIRO,
currency: AmazonMarketplaceAdvertisingCurrency.EGP,
id: 'ARBP9OOSHTCHU',
name: 'Egypt',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { amazonVendorCentralUriFactory } from '../amazon-vendor-central-uri-factory'
import { europeanAdvertisingFactory } from '../european-advertising-factory'
Expand All @@ -11,6 +12,7 @@ import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const ES = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.ES,
timeZone: AmazonMarketplaceTimeZone.EUROPE_PARIS,
currency: AmazonMarketplaceAdvertisingCurrency.EUR,
id: 'A1RKKUPIHCS9HS',
name: 'Spain',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { amazonVendorCentralUriFactory } from '../amazon-vendor-central-uri-factory'
import { europeanAdvertisingFactory } from '../european-advertising-factory'
Expand All @@ -11,6 +12,7 @@ import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const FR = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.FR,
timeZone: AmazonMarketplaceTimeZone.EUROPE_PARIS,
currency: AmazonMarketplaceAdvertisingCurrency.EUR,
id: 'A13V1IB3VIYZZH',
name: 'France',
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 {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { europeanSellerCentralUriFactory } from '../european-seller-central-uri-factory'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
Expand All @@ -16,6 +17,7 @@ if (!DE.advertising) {

export const GB = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.GB,
timeZone: AmazonMarketplaceTimeZone.EUROPE_LONDON,
currency: AmazonMarketplaceAdvertisingCurrency.GBP,
id: 'A1F83G8C2ARO7P',
name: 'United Kingdom',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const IN = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.IN,
timeZone: AmazonMarketplaceTimeZone.ASIA_INDIA,
currency: AmazonMarketplaceAdvertisingCurrency.INR,
id: 'A21TJRUUN4KGV',
name: 'India',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { amazonVendorCentralUriFactory } from '../amazon-vendor-central-uri-factory'
import { europeanAdvertisingFactory } from '../european-advertising-factory'
Expand All @@ -11,6 +12,7 @@ import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const IT = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.IT,
timeZone: AmazonMarketplaceTimeZone.EUROPE_PARIS,
currency: AmazonMarketplaceAdvertisingCurrency.EUR,
id: 'APJ6JRA9NG5V4',
name: 'Italy',
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,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const JP = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.JP,
timeZone: AmazonMarketplaceTimeZone.ASIA_TOKYO,
currency: AmazonMarketplaceAdvertisingCurrency.JPY,
id: 'A1VC38T7YXB528',
name: 'Japan',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/mx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const MX = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.MX,
timeZone: AmazonMarketplaceTimeZone.AMERICA_LOS_ANGELES,
currency: AmazonMarketplaceAdvertisingCurrency.MXN,
id: 'A1AM78C64UM0Y8',
name: 'Mexico',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { amazonVendorCentralUriFactory } from '../amazon-vendor-central-uri-factory'
import { europeanAdvertisingFactory } from '../european-advertising-factory'
Expand All @@ -12,6 +13,7 @@ import { DE } from './de'

export const NL = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.NL,
timeZone: AmazonMarketplaceTimeZone.EUROPE_AMSTERDAM,
currency: AmazonMarketplaceAdvertisingCurrency.EUR,
id: 'A1805IZSGTT6HS',
name: 'Netherlands',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { amazonVendorCentralUriFactory } from '../amazon-vendor-central-uri-factory'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const PL = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.PL,
timeZone: AmazonMarketplaceTimeZone.EUROPE_WARSAW,
currency: AmazonMarketplaceAdvertisingCurrency.PLN,
id: 'A1C3SOZRARQ6R3',
name: 'Poland',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/sa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import {
AmazonMarketplace,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'

export const SA = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.SA,
timeZone: AmazonMarketplaceTimeZone.ASIA_RIYADH,
currency: AmazonMarketplaceAdvertisingCurrency.SAR,
id: 'A17E79C6D8DWNP',
name: 'Saudi Arabia',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/se.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { amazonVendorCentralUriFactory } from '../amazon-vendor-central-uri-factory'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const SE = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.SE,
timeZone: AmazonMarketplaceTimeZone.EUROPE_STOCKHOLM,
currency: AmazonMarketplaceAdvertisingCurrency.SEK,
id: 'A2NODRKZP88ZB9',
name: 'Sweden',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/sg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const SG = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.SG,
timeZone: AmazonMarketplaceTimeZone.ASIA_SINGAPORE,
currency: AmazonMarketplaceAdvertisingCurrency.SGD,
id: 'A19VAU5U5O7RUS',
name: 'Singapore',
Expand Down
2 changes: 2 additions & 0 deletions src/marketplaces/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const TR = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.TR,
timeZone: AmazonMarketplaceTimeZone.EUROPE_ISTANBUL,
currency: AmazonMarketplaceAdvertisingCurrency.TRY,
id: 'A33AVAJ2PDY3EV',
name: 'Turkey',
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,12 +4,14 @@ import {
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
AmazonMarketplaceTimeZone,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const US = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.US,
timeZone: AmazonMarketplaceTimeZone.AMERICA_LOS_ANGELES,
currency: AmazonMarketplaceAdvertisingCurrency.USD,
id: 'ATVPDKIKX0DER',
name: 'United States',
Expand Down
Loading

0 comments on commit 9212e54

Please sign in to comment.