Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
fix: expose finances parameter types
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado authored and moltar committed Jun 28, 2020
1 parent 5f4d59f commit 138b5c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './error'
export * from './http'
export * from './mws'
export * from './sections/finances/finances'
export * from './sections/finances/codec'
export * from './sections/fulfillment-inventory'
export * from './sections/subscriptions'
export * from './sections/orders'
Expand Down
24 changes: 12 additions & 12 deletions src/sections/finances/finances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,22 @@ import {

const FINANCES_API_VERSION = '2015-05-01'

interface ListFinancialEventGroupsParameters {
export interface ListFinancialEventGroupsParameters {
MaxResultsPerPage?: number
FinancialEventGroupStartedAfter: Date
FinancialEventGroupStartedBefore?: Date
}

interface ListFinancicalEventsParameters {
MaxResultsPerPage?: number
AmazonOrderId?: string
FinancialEventGroupId?: string
PostedAfter?: Date
PostedBefore?: Date
}
export type ListFinancialEventsParameters = RequireOnlyOne<
{
MaxResultsPerPage?: number
AmazonOrderId?: string
FinancialEventGroupId?: string
PostedAfter?: Date
PostedBefore?: Date
},
'PostedAfter' | 'AmazonOrderId' | 'FinancialEventGroupId'
>

export class Finances {
constructor(private httpClient: HttpClient) {}
Expand Down Expand Up @@ -55,10 +58,7 @@ export class Finances {
}

async listFinancialEvents(
parameters: RequireOnlyOne<
ListFinancicalEventsParameters,
'PostedAfter' | 'AmazonOrderId' | 'FinancialEventGroupId'
>,
parameters: ListFinancialEventsParameters,
): Promise<[ListFinancialEvents, RequestMeta]> {
const [response, meta] = await this.httpClient.request('POST', {
resource: Resource.Finances,
Expand Down

0 comments on commit 138b5c0

Please sign in to comment.