-
Notifications
You must be signed in to change notification settings - Fork 634
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
Trying to use CompleteMultipartUploadCommand
with conditional requests I noticed the IfMatch
and IfNoneMatch
fields are visible in the API reference, but not available in the actual package.
I assumed it must be that my SDK is outdated, so I tried updating to the latest version but nothing changed.
I also checked to see that the same issue affects the PutObjectCommand
as well.
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/CompleteMultipartUploadCommand/
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/PutObjectCommand/
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.11.1
Reproduction Steps
Try to instantiate a CompleteMultipartUploadCommand
using either IfMatch
or IfNoneMatch
new CompleteMultipartUploadCommand({
Bucket: "some-bucket",
Key: "some/key",
UploadId: "1234567890",
IfNoneMatch: "*",
});
Observed Behavior
You get type errors:
No overload matches this call.
Overload 1 of 2, '(input: CompleteMultipartUploadCommandInput): CompleteMultipartUploadCommand', gave the following error.
Object literal may only specify known properties, and 'IfNoneMatch' does not exist in type 'CompleteMultipartUploadCommandInput'.
Overload 2 of 2, '(__0_0: CompleteMultipartUploadCommandInput): CompleteMultipartUploadCommand', gave the following error.
Object literal may only specify known properties, and 'IfNoneMatch' does not exist in type 'CompleteMultipartUploadCommandInput'.ts(2769)
Expected Behavior
You shouldn't get type errors.
Possible Solution
No response
Additional Information/Context
I believe this bug was likely not noticed because using a separate input object dodges the type error.
This works fine:
const input = {
Bucket: "some-bucket",
Key: "some/key",
UploadId: "1234567890",
IfNoneMatch: "*",
};
new CompleteMultipartUploadCommand(input);