This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes report ID parsing, where they were automatically parsed as numbers, but the numbers were too large and caused an overlow and were getting rounded. Closes #327
- Loading branch information
Showing
6 changed files
with
196 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { promises as fs } from 'fs' | ||
|
||
import { parseResponse } from '../../../../src/http' | ||
|
||
describe('issue #327', () => { | ||
it('should parse report response correctly', async () => { | ||
expect.assertions(1) | ||
|
||
const response = await fs.readFile(`${__dirname}/response.xml`, { encoding: 'utf8' }) | ||
|
||
const [data] = parseResponse({ | ||
data: response, | ||
headers: {}, | ||
}) | ||
|
||
expect(data).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`issue #327 should parse report response correctly 1`] = ` | ||
Object { | ||
"GetReportListResponse": Object { | ||
"GetReportListResult": Object { | ||
"HasNext": true, | ||
"NextToken": "2YgYW55IPQhvu5hbCBwbGVhc3VyZS4=", | ||
"ReportInfo": Array [ | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-17T09:43:46+00:00", | ||
"ReportId": "28136451747018703", | ||
"ReportRequestId": 505364018703, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-17T09:42:21+00:00", | ||
"ReportId": "28146215237018703", | ||
"ReportRequestId": 505360018703, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-17T08:27:14+00:00", | ||
"ReportId": "28139198851018703", | ||
"ReportRequestId": 505332018703, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-17T04:26:54+00:00", | ||
"ReportId": "28141052303018703", | ||
"ReportRequestId": 505237018703, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-16T14:12:45+00:00", | ||
"ReportId": "28119289673018702", | ||
"ReportRequestId": 504882018702, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-15T18:07:48+00:00", | ||
"ReportId": "28085787288018701", | ||
"ReportRequestId": 504400018701, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-08T18:03:33+00:00", | ||
"ReportId": "27873864943018694", | ||
"ReportRequestId": 500801018694, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-08T18:01:57+00:00", | ||
"ReportId": "27875410347018694", | ||
"ReportRequestId": 500800018694, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-08T17:54:27+00:00", | ||
"ReportId": "27886303516018694", | ||
"ReportRequestId": 500796018694, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
Object { | ||
"Acknowledged": false, | ||
"AvailableDate": "2021-03-08T05:31:26+00:00", | ||
"ReportId": "27864140748018694", | ||
"ReportRequestId": 500483018694, | ||
"ReportType": "_RFQD_BULK_DOWNLOAD_", | ||
}, | ||
], | ||
}, | ||
"ResponseMetadata": Object { | ||
"RequestId": "fbf677c1-dcee-4110-bc88-2ba3702e331b", | ||
}, | ||
"attr": Object { | ||
"xmlns": "http://mws.amazonservices.com/doc/2009-01-01/", | ||
}, | ||
}, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<GetReportListResponse xmlns="http://mws.amazonservices.com/doc/2009-01-01/"> | ||
<GetReportListResult> | ||
<NextToken>2YgYW55IPQhvu5hbCBwbGVhc3VyZS4=</NextToken> | ||
<HasNext>true</HasNext> | ||
|
||
<!-- From: https://github.com/ScaleLeap/amazon-mws-api-sdk/issues/327#issuecomment-801718189 --> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>28136451747018703</ReportId> | ||
<ReportRequestId>505364018703</ReportRequestId> | ||
<AvailableDate>2021-03-17T09:43:46+00:00</AvailableDate> | ||
</ReportInfo> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>28146215237018703</ReportId> | ||
<ReportRequestId>505360018703</ReportRequestId> | ||
<AvailableDate>2021-03-17T09:42:21+00:00</AvailableDate> | ||
</ReportInfo> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>28139198851018703</ReportId> | ||
<ReportRequestId>505332018703</ReportRequestId> | ||
<AvailableDate>2021-03-17T08:27:14+00:00</AvailableDate> | ||
</ReportInfo> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>28141052303018703</ReportId> | ||
<ReportRequestId>505237018703</ReportRequestId> | ||
<AvailableDate>2021-03-17T04:26:54+00:00</AvailableDate> | ||
</ReportInfo> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>28119289673018702</ReportId> | ||
<ReportRequestId>504882018702</ReportRequestId> | ||
<AvailableDate>2021-03-16T14:12:45+00:00</AvailableDate> | ||
</ReportInfo> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>28085787288018701</ReportId> | ||
<ReportRequestId>504400018701</ReportRequestId> | ||
<AvailableDate>2021-03-15T18:07:48+00:00</AvailableDate> | ||
</ReportInfo> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>27873864943018694</ReportId> | ||
<ReportRequestId>500801018694</ReportRequestId> | ||
<AvailableDate>2021-03-08T18:03:33+00:00</AvailableDate> | ||
</ReportInfo> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>27875410347018694</ReportId> | ||
<ReportRequestId>500800018694</ReportRequestId> | ||
<AvailableDate>2021-03-08T18:01:57+00:00</AvailableDate> | ||
</ReportInfo> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>27886303516018694</ReportId> | ||
<ReportRequestId>500796018694</ReportRequestId> | ||
<AvailableDate>2021-03-08T17:54:27+00:00</AvailableDate> | ||
</ReportInfo> | ||
<ReportInfo> | ||
<ReportType>_RFQD_BULK_DOWNLOAD_</ReportType> | ||
<Acknowledged>false</Acknowledged> | ||
<ReportId>27864140748018694</ReportId> | ||
<ReportRequestId>500483018694</ReportRequestId> | ||
<AvailableDate>2021-03-08T05:31:26+00:00</AvailableDate> | ||
</ReportInfo> | ||
|
||
|
||
</GetReportListResult> | ||
<ResponseMetadata> | ||
<RequestId>fbf677c1-dcee-4110-bc88-2ba3702e331b</RequestId> | ||
</ResponseMetadata> | ||
</GetReportListResponse> |