amazon-mws
amazon-mws copied to clipboard
Provide TypeScript type definitions for MWS JSON responses
Hi,
would it be possible to provide TypeScript type definitions for the different MWS JSON responses? For example, a call to mws.reports.submit({'Version': '2009-01-01', 'Action': 'RequestReport', ...)
would provide the following result:
// Base type for Report Responses
export type ReportResponse = {
Headers: { [key: string]: string; };
StatusCode: number;
ResponseMetadata: { RequestId: string };
Type?: string;
Code?: number;
Message?: string;
}
// RequestReportResponse
export type RequestReportResponse = ReportResponse & {
ReportRequestInfo: ReportRequestInfo;
}
export type ReportRequestInfo = {
ReportType: string;
ReportProcessingStatus: string;
EndDate: string;
Scheduled: boolean,
ReportRequestId: string;
SubmittedDate: string;
StartDate: string;
CompletedDate: string;
GeneratedReportId: string;
}
I'm going to create type definitions for a few API calls as I need them. I could provide them as PR, if you are interested in taking them into your project?
@chriszirkel Sure, I would like to add this. Please take a look a this file https://github.com/bhushankumarl/amazon-mws/blob/master/index.d.ts.