-
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
No transformation for getObject(params).createReadStream()
Steps to reproduce
import { S3 } from "aws-sdk";
import { Readable } from "stream";
const client = new S3({ region: "us-west-2" });
const response: Readable = client
.getObject({ Bucket: "my-bucket", Key: "my-key" })
.createReadStream();
Observed behavior
import { S3 } from "@aws-sdk/client-s3";
import { Readable } from "stream";
const client = new S3({
region: "us-west-2"
});
const response: Readable = client
.getObject({ Bucket: "my-bucket", Key: "my-key" })
.createReadStream();
This is an issue since createReadStream
does not exist on getObject in v3.
Expected behavior
import { S3 } from "aws-sdk";
import { Readable } from "stream";
const client = new S3({ region: "us-west-2" });
const response: Readable = (await client
.getObject({ Bucket: "my-bucket", Key: "my-key" }))
.Body;
Environment
aws-sdk-js-codemod: 1.3.6
- jscodeshift: 0.15.2
- recast: 0.23.4
Additional context
- Example usage: https://github.com/Budibase/budibase/blob/c75d1bd50eb3309062d5e2ac106274fbfe508ef3/packages/server/src/integrations/s3.ts#L236-L241
- The createReadStream source code in JS SDK v2: https://github.com/aws/aws-sdk-js/blob/fcb26f8051567a2cbbfe02e4f6752e982bbfa339/lib/request.js#L568
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingp2This is a standard priority issueThis is a standard priority issue