-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
bugSomething isn't workingSomething isn't workingp2This is a standard priority issueThis is a standard priority issue
Description
Self-service
- I'd be willing to implement a fix
Describe the bug
When S3.GetObject is called and Body is processed, the equivalent v3 mixins are not added
Steps to reproduce
import AWS from "aws-sdk";
const client = new AWS.S3();
const params = {
Bucket: "my-bucket",
Key: "my-key",
};
const response = await client.getObject(params).promise();
const data = response.Body;
Observed behavior
The data
in the transformed code is a Readable Stream and not a buffer.
import { S3 } from "@aws-sdk/client-s3";
const client = new S3();
const params = {
Bucket: "my-bucket",
Key: "my-key",
};
const response = await client.getObject(params);
const data = response.Body;
Expected behavior
The Body needs to be transformed from Readable Stream to Buffer.
import { S3 } from "@aws-sdk/client-s3";
const client = new S3();
const params = {
Bucket: "my-bucket",
Key: "my-key",
};
const response = await client.getObject(params);
const data = Buffer.from(await response.Body.transformToByteArray());
Environment
aws-sdk-js-codemod: 1.0.5
- jscodeshift: 0.15.2
- recast: 0.23.4
Additional context
No response
Apidcloud and biffgaut
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingp2This is a standard priority issueThis is a standard priority issue