Closed kuhe closed 8 months ago
testing:
// in v2/workspace/s3 folder
import S3 from "../../clients/s3";
var s3 = new S3({
region: 'us-west-2'
});
(async () => {
// both Expires and ExpiresString will be set on the returned object.
const get = await s3.getObject({
Bucket: "...",
Key: "goodexpires",
}).promise();
console.log("expires and expiresString", get.Expires, get.ExpiresString);
// this emits a warning, but does not throw. Expires becomes undefined and only ExpiresString is set.
const get2 = await s3.headObject({
Bucket: "...",
Key: "badexpires",
}).promise();
console.log("expires and expiresString", get2.Expires, get2.ExpiresString);
})();
See https://github.com/aws/aws-sdk-js-v3/pull/5715.
Adds an S3-only model transform that adds an additional field
ExpiresString: string
where any operation output hasExpires: Date
as an output member. This field will contain the raw value from Expires response header in all cases.If
Expires
response header is not a date format, this will no longer throw an exception. Users can access theExpiresString
field as a fallback, andExpires
will be set toundefined
in that case.Checklist
npm run test
passes.d.ts
file is updatednpm run add-change