From 0a980d41ce305e10b07960bc1e0b1315ba64b68f Mon Sep 17 00:00:00 2001 From: Toan Nguyen Date: Tue, 20 Jul 2021 10:43:59 +0700 Subject: [PATCH] feat: ad sg to advertising --- src/amazon-marketplace.ts | 2 ++ src/marketplaces/sg.ts | 18 +++++++++++++++++ test/__snapshots__/marketplaces.test.ts.snap | 21 ++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/src/amazon-marketplace.ts b/src/amazon-marketplace.ts index c6f44c59..67f0e2a9 100644 --- a/src/amazon-marketplace.ts +++ b/src/amazon-marketplace.ts @@ -68,6 +68,7 @@ export enum AmazonMarketplaceAdvertisingCountryCode { JP = 'JP', MX = 'MX', NL = 'NL', + SG = 'SG', UK = 'UK', // Not a real country code, but such is life. See https://github.com/ScaleLeap/amazon-marketplaces/issues/122 US = 'US', } @@ -79,6 +80,7 @@ export enum AmazonMarketplaceAdvertisingTimeZone { AMERICA_LOS_ANGELES = 'America/Los_Angeles', AMERICA_SAO_PAULO = 'America/Sao_Paulo', ASIA_DUBAI = 'Asia/Dubai', + ASIA_SINGAPORE = 'Asia/Singapore', ASIA_TOKYO = 'Asia/Tokyo', AUSTRALIA_SYDNEY = 'Australia/Sydney', EUROPE_AMSTERDAM = 'Europe/Amsterdam', diff --git a/src/marketplaces/sg.ts b/src/marketplaces/sg.ts index 425b7160..1c89cb14 100644 --- a/src/marketplaces/sg.ts +++ b/src/marketplaces/sg.ts @@ -1,8 +1,11 @@ import { AmazonMarketplace, + AmazonMarketplaceAdvertisingCountryCode, AmazonMarketplaceAdvertisingCurrency, + AmazonMarketplaceAdvertisingTimeZone, AmazonMarketplaceCountryCode, } from '../amazon-marketplace' +import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions' import { sellerCentralAuthUris, sellingPartnerRegions } from '../selling-partner-api-regions' export const SG = new AmazonMarketplace({ @@ -13,6 +16,21 @@ export const SG = new AmazonMarketplace({ uri: 'https://www.amazon.sg', sellerCentralUri: 'https://sellercentral.amazon.sg', webServiceUri: 'https://mws-fe.amazonservices.com', + advertising: { + countryCode: AmazonMarketplaceAdvertisingCountryCode.SG, + region: marketplaceAdvertisingRegions.FE, + bids: { + sponsoredBrands: { + min: 10, + max: 10000, + }, + sponsoredProducts: { + min: 2, + max: 110000, + }, + }, + timeZone: AmazonMarketplaceAdvertisingTimeZone.ASIA_SINGAPORE, + }, sellingPartner: { region: sellingPartnerRegions.FE, sellerCentralAuthUri: sellerCentralAuthUris.NA, diff --git a/test/__snapshots__/marketplaces.test.ts.snap b/test/__snapshots__/marketplaces.test.ts.snap index 8f2ab7b4..4620194b 100644 --- a/test/__snapshots__/marketplaces.test.ts.snap +++ b/test/__snapshots__/marketplaces.test.ts.snap @@ -603,6 +603,27 @@ AmazonMarketplace { exports[`marketplace SG should match snapshot 1`] = ` AmazonMarketplace { + "advertising": Object { + "bids": Object { + "sponsoredBrands": Object { + "max": 10000, + "min": 10, + }, + "sponsoredProducts": Object { + "max": 110000, + "min": 2, + }, + }, + "countryCode": "SG", + "region": AmazonMarketplaceAdvertisingRegion { + "accessTokenUri": "https://api.amazon.co.jp/auth/o2/token", + "authorizationUri": "https://apac.account.amazon.com/ap/oa", + "code": "FE", + "endpoint": "https://advertising-api-fe.amazon.com", + "name": "Far East", + }, + "timeZone": "Asia/Singapore", + }, "countryCode": "SG", "currency": "SGD", "id": "A19VAU5U5O7RUS",