Skip to content

Commit 5aeb73e

Browse files
authored
Add initial transformation for s3.upload API (#394)
1 parent 064528e commit 5aeb73e

28 files changed

+386
-5
lines changed

.changeset/small-foxes-hug.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": minor
3+
---
4+
5+
Add initial transformation for s3.upload API
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import AWS = require("aws-sdk");
2+
3+
const client = new AWS.S3({ region: "REGION" });
4+
await client.upload({
5+
Body: "BODY",
6+
Bucket: "Bucket",
7+
ContentType: "ContentType",
8+
Key: "Key",
9+
}).promise();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import AWS_lib_storage = require("@aws-sdk/lib-storage");
2+
3+
const {
4+
Upload
5+
} = AWS_lib_storage;
6+
7+
import AWS_S3 = require("@aws-sdk/client-s3");
8+
9+
const {
10+
S3
11+
} = AWS_S3;
12+
13+
const client = new S3({ region: "REGION" });
14+
await new Upload({
15+
client,
16+
17+
params: {
18+
Body: "BODY",
19+
Bucket: "Bucket",
20+
ContentType: "ContentType",
21+
Key: "Key",
22+
}
23+
}).done();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import AWS from "aws-sdk";
2+
3+
const client = new AWS.S3({ region: "REGION" });
4+
await client.upload({
5+
Body: "BODY",
6+
Bucket: "Bucket",
7+
ContentType: "ContentType",
8+
Key: "Key",
9+
}).promise();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Upload } from "@aws-sdk/lib-storage";
2+
import { S3 } from "@aws-sdk/client-s3";
3+
4+
const client = new S3({ region: "REGION" });
5+
await new Upload({
6+
client,
7+
8+
params: {
9+
Body: "BODY",
10+
Bucket: "Bucket",
11+
ContentType: "ContentType",
12+
Key: "Key",
13+
}
14+
}).done();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const S3 = require("aws-sdk").S3;
2+
3+
const client = new S3({ region: "REGION" });
4+
await client.upload({
5+
Body: "BODY",
6+
Bucket: "Bucket",
7+
ContentType: "ContentType",
8+
Key: "Key",
9+
}).promise();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const {
2+
Upload
3+
} = require("@aws-sdk/lib-storage"),
4+
{
5+
S3
6+
} = require("@aws-sdk/client-s3");
7+
8+
const client = new S3({ region: "REGION" });
9+
await new Upload({
10+
client,
11+
12+
params: {
13+
Body: "BODY",
14+
Bucket: "Bucket",
15+
ContentType: "ContentType",
16+
Key: "Key",
17+
}
18+
}).done();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const AWS = require("aws-sdk");
2+
3+
const client = new AWS.S3({ region: "REGION" });
4+
await client.upload({
5+
Body: "BODY",
6+
Bucket: "Bucket",
7+
ContentType: "ContentType",
8+
Key: "Key",
9+
}).promise();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const {
2+
Upload
3+
} = require("@aws-sdk/lib-storage"),
4+
{
5+
S3
6+
} = require("@aws-sdk/client-s3");
7+
8+
const client = new S3({ region: "REGION" });
9+
await new Upload({
10+
client,
11+
12+
params: {
13+
Body: "BODY",
14+
Bucket: "Bucket",
15+
ContentType: "ContentType",
16+
Key: "Key",
17+
}
18+
}).done();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import S3 from "aws-sdk/clients/s3";
2+
3+
const client = new S3({ region: "REGION" });
4+
await client.upload({
5+
Body: "BODY",
6+
Bucket: "Bucket",
7+
ContentType: "ContentType",
8+
Key: "Key",
9+
}).promise();

0 commit comments

Comments
 (0)