databerry
databerry copied to clipboard
chore: migrate AWS SDK for JavaScript v2 APIs to v3
Issue
From AWS SDK for JavaScript v2 README:
We are formalizing our plans to make the Maintenance Announcement (Phase 2) for AWS SDK for JavaScript v2 in 2023.
Description
This PR migrates AWS SDK for JavaScript v2 APIs to v3 using aws-sdk-js-codemod.
$ npx [email protected] -t v2-to-v3 packages/lib/aws.ts
@trivikr is attempting to deploy a commit to the databerry Team on Vercel.
A member of the Team first needs to authorize it.
@trivikr there's other files where we call s3.(...).promise(), are those calls still compatible with v3 ?
// e.g. apps/dashboard/pages/api/datasources/index.ts
await s3.putObject(params).promise();
there's other files where we call s3.(...).promise(), are those calls still compatible with v3 ?
Thanks for the catch.
The codemod missed transforming these files, as the type of the client is any.
Codemod only does API transformations which it knows are accurate. It doesn't remove .promise() from any other API calls the source code might be making. I've created a feature request for it at https://github.com/awslabs/aws-sdk-js-codemod/issues/697
I'll verify those usages, and manually remove .promise() calls though for the purpose of this PR.
I'll verify those usages, and manually remove
.promise()calls though for the purpose of this PR.
@gmpetrov Fixed in https://github.com/gmpetrov/databerry/pull/234/commits/61ec16538f0bbceab9d0720a528c89282f22057c
@gmpetrov I rebase changes since last three months, and also migrated JS SDK v2 APIs in newly introduced webhook.
Are there any other changes needed to test this change in CI, and merge?
AWS SDK for JavaScript v2 will enter maintenance mode on September 8, 2024 and reach end-of-support on September 8, 2025.
For more information, check blog post at https://a.co/cUPnyil