Skip to content

Commit

Permalink
fix: remove unsupported sb report types
Browse files Browse the repository at this point in the history
BREAKING CHANGE: remove headlineSearch and searchTerms sb report type
  • Loading branch information
nguyentoanit committed Feb 1, 2021
1 parent 1a44623 commit c587ba5
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 316 deletions.
2 changes: 0 additions & 2 deletions src/operations/reports/metrics/sponsored-brands/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export * from './sponsored-brands-ad-group-report-metrics'
export * from './sponsored-brands-campaign-report-metrics'
export * from './sponsored-brands-headline-search-report-metrics'
export * from './sponsored-brands-keyword-report-metrics'
export * from './sponsored-brands-search-term-report-metrics'
export * from './sponsored-brands-target-report-metrics'

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions src/operations/reports/report-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export const SponsoredBrandsReportType = t.union([
t.literal('campaigns'),
t.literal('adGroups'),
t.literal('keywords'),
t.literal('headlineSearch'),
t.literal('searchTerms'),
t.literal('targets'),
])
export type SponsoredBrandsReportType = t.TypeOf<typeof SponsoredBrandsReportType>
Expand Down
2 changes: 0 additions & 2 deletions src/operations/reports/sponsored-brands/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export * from './sponsored-brands-ad-group-report-params'
export * from './sponsored-brands-campaign-report-params'
export * from './sponsored-brands-keyword-report-params'
export * from './sponsored-brands-headline-search-report-params'
export * from './sponsored-brands-search-term-report-params'
export * from './sponsored-brands-target-report-params'

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ import {
SponsoredBrandsAdGroupReportParams,
SponsoredBrandsCampaignReportParams,
SponsoredBrandsKeywordReportParams,
SponsoredBrandsHeadlineSearchReportParams,
SponsoredBrandsSearchTermReportParams,
SponsoredBrandsTargetReportParams,
} from './index'

export type SponsoredBrandsReportParams =
| SponsoredBrandsAdGroupReportParams
| SponsoredBrandsCampaignReportParams
| SponsoredBrandsKeywordReportParams
| SponsoredBrandsHeadlineSearchReportParams
| SponsoredBrandsSearchTermReportParams
| SponsoredBrandsSearchTermReportParams
| SponsoredBrandsTargetReportParams

export class SponsoredBrandsReportOperation<
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ describe('index', () => {
expect(index.SponsoredBrandsCampaignReportMetrics).toEqual(
reportTypes.SponsoredBrandsCampaignReportMetrics,
)
expect(index.SponsoredBrandsHeadlineSearchReportMetrics).toEqual(
reportTypes.SponsoredBrandsHeadlineSearchReportMetrics,
)
expect(index.SponsoredBrandsKeywordReportMetrics).toEqual(
reportTypes.SponsoredBrandsKeywordReportMetrics,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,63 +103,6 @@ describe('SponsoredBrandsReportOperation', () => {
expect(res.statusDetails).toBeDefined()
})

/**
* TODO: Need check on Production API again. Sandbox API returns an error:
* Could not find resource for full path: https://advertising-api-test.amazon.com/v2/hsa/headlineSearch/report
*/
it.skip(`should return a in progress status with headline search report`, async () => {
const res = await reportOperation.requestReport({
recordType: 'headlineSearch',
metrics: [
'campaignName',
'campaignId',
'campaignStatus',
'campaignBudget',
'campaignBudgetType',
'adGroupName',
'adGroupId',
'keywordText',
'keywordBid',
'keywordStatus',
],
reportDate: '20200314',
})

expect(res.reportId).toBeDefined()
expect(res.recordType).toBeDefined()
expect(res.status).toBe<ReportResponseStatus>('IN_PROGRESS')
expect(res.statusDetails).toBeDefined()
})

/**
* TODO: Need check on Production API again. Sandbox API returns an error:
* Could not find resource for full path: https://advertising-api-test.amazon.com/v2/hsa/searchTerms/report
*/
it.skip(`should return a in progress status with search term report`, async () => {
const res = await reportOperation.requestReport({
recordType: 'searchTerms',
metrics: [
'campaignId',
'campaignName',
'adGroupId',
'adGroupName',
'campaignBudgetType',
'campaignStatus',
'keywordId',
'keywordStatus',
'keywordBid',
'keywordText',
'matchType',
],
reportDate: '20200314',
})

expect(res.reportId).toBeDefined()
expect(res.recordType).toBeDefined()
expect(res.status).toBe<ReportResponseStatus>('IN_PROGRESS')
expect(res.statusDetails).toBeDefined()
})

it(`should return a in progress status with target report`, async () => {
const res = await reportOperation.requestReport({
recordType: 'targets',
Expand Down

0 comments on commit c587ba5

Please sign in to comment.