Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide TypeScript type definitions for MWS JSON responses #151

Open
zirkelc opened this issue Dec 13, 2020 · 1 comment
Open

Provide TypeScript type definitions for MWS JSON responses #151

zirkelc opened this issue Dec 13, 2020 · 1 comment
Assignees

Comments

@zirkelc
Copy link

zirkelc commented Dec 13, 2020

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?

@bhushankummar bhushankummar self-assigned this Jan 5, 2021
@bhushankummar
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants